@moontra/moonui-pro 2.21.1 → 2.21.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/index.d.ts +9 -9
- package/dist/index.mjs +756 -1010
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
3
|
import { twMerge } from 'tailwind-merge';
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
4
|
+
import * as React60 from 'react';
|
|
5
|
+
import React60__default, { useState, useMemo, useCallback, useRef, useEffect, forwardRef, createContext, useContext, useLayoutEffect, useDebugValue, Component } from 'react';
|
|
6
6
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
7
7
|
import { Loader2, Play, ExternalLink, ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Minus, Clock, ChevronUp, Search, Mic, MicOff, Settings, RefreshCw, Zap, ChevronRight, Crown, Circle, ChevronLeft, Plus, Lock, Sparkles, ZoomOut, ZoomIn, Pause, VolumeX, Volume2, Download, Maximize2, Filter, Image as Image$1, Video, RotateCw, Minimize2, Phone, Globe, Upload, Eye, CheckCircle2, RotateCcw, Copy, Share, Trash2, CreditCard, XCircle, HelpCircle, Bold as Bold$1, Italic as Italic$1, Underline as Underline$1, Strikethrough, Code as Code$1, Type, Heading1, Heading2, Heading3, AlignLeft, AlignCenter, AlignRight, AlignJustify, List, ListOrdered, CheckSquare, Quote, Palette, Highlighter, Link2, Table as Table$1, Undo, Redo, Edit, Wand2, Maximize, FileText, Briefcase, MessageSquare, Heart, GraduationCap, Languages, Lightbulb, BarChart3, Music, Archive, File, FileSpreadsheet, FileJson, FileDown, ArrowUp, ArrowDown, ArrowUpDown, ChevronsLeft, ChevronsRight, CheckCircle, Star, Menu, Calendar as Calendar$1, Repeat, MapPin, Users, User, Move, EyeOff, Timer, Square, Cpu, Target, GitBranch, ArrowRight, MoreVertical, Trash, TrendingUp, MessageCircle, Paperclip, Printer, TrendingDown, Bell, CheckCheck, Settings2, LogOut, Edit3, LayoutGrid, Share2, Save, Github, Activity, Server, Monitor, MemoryStick, HardDrive, Network, Columns, Pin, Sun, Moon, Send, Tag, Flag, CalendarIcon, DollarSign, Trophy, Grip, Unlock, Map as Map$1, GitFork, Package, BellOff, ArrowUpRight, ArrowDownRight } from 'lucide-react';
|
|
8
8
|
import { cva } from 'class-variance-authority';
|
|
@@ -11,8 +11,8 @@ import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
|
11
11
|
import { format, addMonths, subMonths, startOfMonth, endOfMonth, eachDayOfInterval, getDay, startOfWeek, endOfWeek, isSameMonth, isToday, isSameDay, startOfDay, endOfDay, subDays, formatDistanceToNow } from 'date-fns';
|
|
12
12
|
import { motion, AnimatePresence, useAnimation, useMotionValue, animate, useSpring, useTransform, Reorder, useDragControls } from 'framer-motion';
|
|
13
13
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
14
|
-
import * as
|
|
15
|
-
import
|
|
14
|
+
import * as ReactDOM from 'react-dom';
|
|
15
|
+
import ReactDOM__default from 'react-dom';
|
|
16
16
|
import { createSlot, createSlottable } from '@radix-ui/react-slot';
|
|
17
17
|
import { Command } from 'cmdk';
|
|
18
18
|
import Fuse from 'fuse.js';
|
|
@@ -2123,7 +2123,7 @@ var accordionTriggerVariants = cva(
|
|
|
2123
2123
|
}
|
|
2124
2124
|
}
|
|
2125
2125
|
);
|
|
2126
|
-
var MoonUIAccordionPro =
|
|
2126
|
+
var MoonUIAccordionPro = React60.forwardRef((props, ref) => {
|
|
2127
2127
|
const {
|
|
2128
2128
|
className,
|
|
2129
2129
|
size: size4 = "md",
|
|
@@ -2143,7 +2143,7 @@ var MoonUIAccordionPro = React67.forwardRef((props, ref) => {
|
|
|
2143
2143
|
...rest
|
|
2144
2144
|
} = props;
|
|
2145
2145
|
const collapsible = props.type === "single" ? props.collapsible ?? true : void 0;
|
|
2146
|
-
|
|
2146
|
+
React60.useEffect(() => {
|
|
2147
2147
|
if (autoExpandFromHash && typeof window !== "undefined") {
|
|
2148
2148
|
const hash = window.location.hash.replace("#", "");
|
|
2149
2149
|
if (hash) {
|
|
@@ -2160,7 +2160,7 @@ var MoonUIAccordionPro = React67.forwardRef((props, ref) => {
|
|
|
2160
2160
|
}
|
|
2161
2161
|
}
|
|
2162
2162
|
}, [autoExpandFromHash]);
|
|
2163
|
-
const handleValueChange =
|
|
2163
|
+
const handleValueChange = React60.useCallback((newValue) => {
|
|
2164
2164
|
if (onItemToggle && newValue) {
|
|
2165
2165
|
if (Array.isArray(newValue)) {
|
|
2166
2166
|
newValue.forEach((v) => onItemToggle(v, true));
|
|
@@ -2204,12 +2204,12 @@ var MoonUIAccordionPro = React67.forwardRef((props, ref) => {
|
|
|
2204
2204
|
);
|
|
2205
2205
|
});
|
|
2206
2206
|
MoonUIAccordionPro.displayName = "MoonUIAccordionPro";
|
|
2207
|
-
var AccordionContext =
|
|
2208
|
-
var MoonUIAccordionItemPro =
|
|
2209
|
-
const { size: size4, variant, onItemToggle } =
|
|
2210
|
-
const [hasBeenOpened, setHasBeenOpened] =
|
|
2207
|
+
var AccordionContext = React60.createContext({});
|
|
2208
|
+
var MoonUIAccordionItemPro = React60.forwardRef(({ className, loading, progress, badge, badgeVariant = "default", completed, lazy, children, ...props }, ref) => {
|
|
2209
|
+
const { size: size4, variant, onItemToggle } = React60.useContext(AccordionContext);
|
|
2210
|
+
const [hasBeenOpened, setHasBeenOpened] = React60.useState(!lazy);
|
|
2211
2211
|
const progressOffset = progress ? 188.4 - 188.4 * progress / 100 : 188.4;
|
|
2212
|
-
|
|
2212
|
+
React60.useEffect(() => {
|
|
2213
2213
|
if (lazy && !hasBeenOpened) {
|
|
2214
2214
|
const item = document.querySelector(`[data-state="open"][value="${props.value}"]`);
|
|
2215
2215
|
if (item) {
|
|
@@ -2282,7 +2282,7 @@ var MoonUIAccordionItemPro = React67.forwardRef(({ className, loading, progress,
|
|
|
2282
2282
|
);
|
|
2283
2283
|
});
|
|
2284
2284
|
MoonUIAccordionItemPro.displayName = "MoonUIAccordionItemPro";
|
|
2285
|
-
var MoonUIAccordionTriggerPro =
|
|
2285
|
+
var MoonUIAccordionTriggerPro = React60.forwardRef(({
|
|
2286
2286
|
className,
|
|
2287
2287
|
children,
|
|
2288
2288
|
leftIcon,
|
|
@@ -2294,7 +2294,7 @@ var MoonUIAccordionTriggerPro = React67.forwardRef(({
|
|
|
2294
2294
|
hideChevron,
|
|
2295
2295
|
...props
|
|
2296
2296
|
}, ref) => {
|
|
2297
|
-
const { size: size4, variant, searchTerm } =
|
|
2297
|
+
const { size: size4, variant, searchTerm } = React60.useContext(AccordionContext);
|
|
2298
2298
|
const highlightText = (text, searchTerm2) => {
|
|
2299
2299
|
if (!searchTerm2 || typeof text !== "string")
|
|
2300
2300
|
return text;
|
|
@@ -2334,11 +2334,11 @@ var MoonUIAccordionTriggerPro = React67.forwardRef(({
|
|
|
2334
2334
|
) });
|
|
2335
2335
|
});
|
|
2336
2336
|
MoonUIAccordionTriggerPro.displayName = "MoonUIAccordionTriggerPro";
|
|
2337
|
-
var MoonUIAccordionContentPro =
|
|
2338
|
-
const { size: size4, variant, animationMode } =
|
|
2339
|
-
const [dynamicContent, setDynamicContent] =
|
|
2340
|
-
const [isLoading, setIsLoading] =
|
|
2341
|
-
|
|
2337
|
+
var MoonUIAccordionContentPro = React60.forwardRef(({ className, children, contentLoading, loadContent, noPadding, ...props }, ref) => {
|
|
2338
|
+
const { size: size4, variant, animationMode } = React60.useContext(AccordionContext);
|
|
2339
|
+
const [dynamicContent, setDynamicContent] = React60.useState(null);
|
|
2340
|
+
const [isLoading, setIsLoading] = React60.useState(false);
|
|
2341
|
+
React60.useEffect(() => {
|
|
2342
2342
|
if (loadContent && !dynamicContent) {
|
|
2343
2343
|
setIsLoading(true);
|
|
2344
2344
|
loadContent().then(setDynamicContent).finally(() => setIsLoading(false));
|
|
@@ -2375,8 +2375,8 @@ var MoonUIAccordionContentPro = React67.forwardRef(({ className, children, conte
|
|
|
2375
2375
|
});
|
|
2376
2376
|
MoonUIAccordionContentPro.displayName = "MoonUIAccordionContentPro";
|
|
2377
2377
|
var useAccordionAnalytics = () => {
|
|
2378
|
-
const [analytics, setAnalytics] =
|
|
2379
|
-
const trackItemOpen =
|
|
2378
|
+
const [analytics, setAnalytics] = React60.useState({});
|
|
2379
|
+
const trackItemOpen = React60.useCallback((itemId) => {
|
|
2380
2380
|
setAnalytics((prev) => ({
|
|
2381
2381
|
...prev,
|
|
2382
2382
|
[itemId]: {
|
|
@@ -2423,9 +2423,9 @@ var MoonUIalertVariantsPro = cva(
|
|
|
2423
2423
|
}
|
|
2424
2424
|
}
|
|
2425
2425
|
);
|
|
2426
|
-
var MoonUIAlertPro =
|
|
2426
|
+
var MoonUIAlertPro = React60.forwardRef(
|
|
2427
2427
|
({ className, variant = "default", size: size4, radius, hideIcon = false, closable = false, onClose, children, ...props }, ref) => {
|
|
2428
|
-
const MoonUIIconPro =
|
|
2428
|
+
const MoonUIIconPro = React60.useMemo(() => {
|
|
2429
2429
|
switch (variant) {
|
|
2430
2430
|
case "success":
|
|
2431
2431
|
return Check;
|
|
@@ -2464,7 +2464,7 @@ var MoonUIAlertPro = React67.forwardRef(
|
|
|
2464
2464
|
}
|
|
2465
2465
|
);
|
|
2466
2466
|
MoonUIAlertPro.displayName = "AlertPro";
|
|
2467
|
-
var MoonUIAlertTitlePro =
|
|
2467
|
+
var MoonUIAlertTitlePro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2468
2468
|
"h5",
|
|
2469
2469
|
{
|
|
2470
2470
|
ref,
|
|
@@ -2473,7 +2473,7 @@ var MoonUIAlertTitlePro = React67.forwardRef(({ className, ...props }, ref) => /
|
|
|
2473
2473
|
}
|
|
2474
2474
|
));
|
|
2475
2475
|
MoonUIAlertTitlePro.displayName = "AlertTitlePro";
|
|
2476
|
-
var MoonUIAlertDescriptionPro =
|
|
2476
|
+
var MoonUIAlertDescriptionPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2477
2477
|
"div",
|
|
2478
2478
|
{
|
|
2479
2479
|
ref,
|
|
@@ -2537,7 +2537,7 @@ var MoonUIaspectRatioVariantsPro = cva(
|
|
|
2537
2537
|
}
|
|
2538
2538
|
}
|
|
2539
2539
|
);
|
|
2540
|
-
var MoonUIAspectRatioPro =
|
|
2540
|
+
var MoonUIAspectRatioPro = React60.forwardRef(({
|
|
2541
2541
|
className,
|
|
2542
2542
|
variant,
|
|
2543
2543
|
radius,
|
|
@@ -2555,12 +2555,12 @@ var MoonUIAspectRatioPro = React67.forwardRef(({
|
|
|
2555
2555
|
children,
|
|
2556
2556
|
...props
|
|
2557
2557
|
}, ref) => {
|
|
2558
|
-
const [currentRatio, setCurrentRatio] =
|
|
2558
|
+
const [currentRatio, setCurrentRatio] = React60.useState(() => {
|
|
2559
2559
|
if (preset)
|
|
2560
2560
|
return PRESET_RATIOS[preset];
|
|
2561
2561
|
return ratio;
|
|
2562
2562
|
});
|
|
2563
|
-
|
|
2563
|
+
React60.useEffect(() => {
|
|
2564
2564
|
const newRatio = preset ? PRESET_RATIOS[preset] : ratio;
|
|
2565
2565
|
if (smoothTransition) {
|
|
2566
2566
|
setCurrentRatio(newRatio);
|
|
@@ -2568,7 +2568,7 @@ var MoonUIAspectRatioPro = React67.forwardRef(({
|
|
|
2568
2568
|
setCurrentRatio(newRatio);
|
|
2569
2569
|
}
|
|
2570
2570
|
}, [preset, ratio, smoothTransition]);
|
|
2571
|
-
|
|
2571
|
+
React60.useEffect(() => {
|
|
2572
2572
|
if (!responsive)
|
|
2573
2573
|
return;
|
|
2574
2574
|
const handleResize = () => {
|
|
@@ -2657,7 +2657,7 @@ var moonUIAvatarVariantsPro = cva(
|
|
|
2657
2657
|
}
|
|
2658
2658
|
}
|
|
2659
2659
|
);
|
|
2660
|
-
var MoonUIAvatarPro =
|
|
2660
|
+
var MoonUIAvatarPro = React60.forwardRef(({ className, size: size4, radius, variant, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2661
2661
|
AvatarPrimitive.Root,
|
|
2662
2662
|
{
|
|
2663
2663
|
ref,
|
|
@@ -2666,7 +2666,7 @@ var MoonUIAvatarPro = React67.forwardRef(({ className, size: size4, radius, vari
|
|
|
2666
2666
|
}
|
|
2667
2667
|
));
|
|
2668
2668
|
MoonUIAvatarPro.displayName = AvatarPrimitive.Root.displayName;
|
|
2669
|
-
var MoonUIAvatarImagePro =
|
|
2669
|
+
var MoonUIAvatarImagePro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2670
2670
|
AvatarPrimitive.Image,
|
|
2671
2671
|
{
|
|
2672
2672
|
ref,
|
|
@@ -2675,7 +2675,7 @@ var MoonUIAvatarImagePro = React67.forwardRef(({ className, ...props }, ref) =>
|
|
|
2675
2675
|
}
|
|
2676
2676
|
));
|
|
2677
2677
|
MoonUIAvatarImagePro.displayName = AvatarPrimitive.Image.displayName;
|
|
2678
|
-
var MoonUIAvatarFallbackPro =
|
|
2678
|
+
var MoonUIAvatarFallbackPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2679
2679
|
AvatarPrimitive.Fallback,
|
|
2680
2680
|
{
|
|
2681
2681
|
ref,
|
|
@@ -2687,9 +2687,9 @@ var MoonUIAvatarFallbackPro = React67.forwardRef(({ className, ...props }, ref)
|
|
|
2687
2687
|
}
|
|
2688
2688
|
));
|
|
2689
2689
|
MoonUIAvatarFallbackPro.displayName = AvatarPrimitive.Fallback.displayName;
|
|
2690
|
-
var MoonUIAvatarGroupPro =
|
|
2690
|
+
var MoonUIAvatarGroupPro = React60.forwardRef(
|
|
2691
2691
|
({ className, max: max2 = 3, size: size4 = "md", children, overlapOffset, ...props }, ref) => {
|
|
2692
|
-
const childrenArray =
|
|
2692
|
+
const childrenArray = React60.Children.toArray(children);
|
|
2693
2693
|
const visibleChildren = max2 ? childrenArray.slice(0, max2) : childrenArray;
|
|
2694
2694
|
const remainingCount = max2 ? Math.max(0, childrenArray.length - max2) : 0;
|
|
2695
2695
|
const defaultOffsets = {
|
|
@@ -2716,7 +2716,7 @@ var MoonUIAvatarGroupPro = React67.forwardRef(
|
|
|
2716
2716
|
marginLeft: index2 === 0 ? 0 : `${finalOffset}px`,
|
|
2717
2717
|
zIndex: visibleChildren.length - index2
|
|
2718
2718
|
},
|
|
2719
|
-
children:
|
|
2719
|
+
children: React60.isValidElement(child) && child.type === MoonUIAvatarPro ? React60.cloneElement(child, { size: size4 }) : child
|
|
2720
2720
|
},
|
|
2721
2721
|
index2
|
|
2722
2722
|
)),
|
|
@@ -2921,7 +2921,7 @@ var MoonUIbreadcrumbVariantsPro = cva(
|
|
|
2921
2921
|
}
|
|
2922
2922
|
}
|
|
2923
2923
|
);
|
|
2924
|
-
var MoonUIBreadcrumbPro =
|
|
2924
|
+
var MoonUIBreadcrumbPro = React60.forwardRef(
|
|
2925
2925
|
({ className, variant, size: size4, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
2926
2926
|
"nav",
|
|
2927
2927
|
{
|
|
@@ -2933,9 +2933,9 @@ var MoonUIBreadcrumbPro = React67.forwardRef(
|
|
|
2933
2933
|
)
|
|
2934
2934
|
);
|
|
2935
2935
|
MoonUIBreadcrumbPro.displayName = "BreadcrumbPro";
|
|
2936
|
-
var MoonUIBreadcrumbListPro =
|
|
2936
|
+
var MoonUIBreadcrumbListPro = React60.forwardRef(
|
|
2937
2937
|
({ className, collapsed, collapsedWidth = 3, ...props }, ref) => {
|
|
2938
|
-
const MoonUIchildrenArrayPro =
|
|
2938
|
+
const MoonUIchildrenArrayPro = React60.Children.toArray(props.children).filter(Boolean);
|
|
2939
2939
|
const MoonUIchildCountPro = MoonUIchildrenArrayPro.length;
|
|
2940
2940
|
if (collapsed && MoonUIchildCountPro > collapsedWidth) {
|
|
2941
2941
|
const MoonUIfirstItemPro = MoonUIchildrenArrayPro[0];
|
|
@@ -2971,9 +2971,9 @@ var MoonUIBreadcrumbListPro = React67.forwardRef(
|
|
|
2971
2971
|
}
|
|
2972
2972
|
);
|
|
2973
2973
|
MoonUIBreadcrumbListPro.displayName = "BreadcrumbListPro";
|
|
2974
|
-
var MoonUIBreadcrumbItemPro =
|
|
2974
|
+
var MoonUIBreadcrumbItemPro = React60.forwardRef(
|
|
2975
2975
|
({ className, isCurrent, href, asChild = false, ...props }, ref) => {
|
|
2976
|
-
const MoonUICompPro = asChild ?
|
|
2976
|
+
const MoonUICompPro = asChild ? React60.Fragment : href ? "a" : "span";
|
|
2977
2977
|
const MoonUIitemPropsPro = asChild ? {} : href ? { href } : {};
|
|
2978
2978
|
return /* @__PURE__ */ jsx(
|
|
2979
2979
|
"li",
|
|
@@ -3030,7 +3030,7 @@ var MoonUIBreadcrumbEllipsisPro = ({
|
|
|
3030
3030
|
}
|
|
3031
3031
|
);
|
|
3032
3032
|
MoonUIBreadcrumbEllipsisPro.displayName = "BreadcrumbEllipsisPro";
|
|
3033
|
-
var MoonUIBreadcrumbLinkPro =
|
|
3033
|
+
var MoonUIBreadcrumbLinkPro = React60.forwardRef(
|
|
3034
3034
|
({ className, href, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3035
3035
|
"a",
|
|
3036
3036
|
{
|
|
@@ -3045,7 +3045,7 @@ var MoonUIBreadcrumbLinkPro = React67.forwardRef(
|
|
|
3045
3045
|
)
|
|
3046
3046
|
);
|
|
3047
3047
|
MoonUIBreadcrumbLinkPro.displayName = "BreadcrumbLinkPro";
|
|
3048
|
-
var MoonUIBreadcrumbPagePro =
|
|
3048
|
+
var MoonUIBreadcrumbPagePro = React60.forwardRef(
|
|
3049
3049
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3050
3050
|
"span",
|
|
3051
3051
|
{
|
|
@@ -3208,7 +3208,7 @@ var moonUIButtonProVariants = cva(
|
|
|
3208
3208
|
}
|
|
3209
3209
|
}
|
|
3210
3210
|
);
|
|
3211
|
-
var MoonUIButtonPro =
|
|
3211
|
+
var MoonUIButtonPro = React60.forwardRef(
|
|
3212
3212
|
({
|
|
3213
3213
|
className,
|
|
3214
3214
|
variant,
|
|
@@ -3267,7 +3267,7 @@ function Calendar({
|
|
|
3267
3267
|
return selected;
|
|
3268
3268
|
return /* @__PURE__ */ new Date();
|
|
3269
3269
|
};
|
|
3270
|
-
const [currentMonth, setCurrentMonth] =
|
|
3270
|
+
const [currentMonth, setCurrentMonth] = React60.useState(getInitialMonth());
|
|
3271
3271
|
const weekDays = [
|
|
3272
3272
|
{ short: "S", full: "Sunday" },
|
|
3273
3273
|
{ short: "M", full: "Monday" },
|
|
@@ -3657,7 +3657,7 @@ var moonUICardVariantsPro = cva(
|
|
|
3657
3657
|
}
|
|
3658
3658
|
}
|
|
3659
3659
|
);
|
|
3660
|
-
var MoonUICardPro =
|
|
3660
|
+
var MoonUICardPro = React60.forwardRef(
|
|
3661
3661
|
({
|
|
3662
3662
|
className,
|
|
3663
3663
|
variant,
|
|
@@ -3674,8 +3674,8 @@ var MoonUICardPro = React67.forwardRef(
|
|
|
3674
3674
|
asChild,
|
|
3675
3675
|
...props
|
|
3676
3676
|
}, ref) => {
|
|
3677
|
-
const [mousePos, setMousePos] =
|
|
3678
|
-
const [isHovered, setIsHovered] =
|
|
3677
|
+
const [mousePos, setMousePos] = React60.useState({ x: 0, y: 0 });
|
|
3678
|
+
const [isHovered, setIsHovered] = React60.useState(false);
|
|
3679
3679
|
const handleMouseMove2 = (e) => {
|
|
3680
3680
|
if (!enableTilt && !enableParallax)
|
|
3681
3681
|
return;
|
|
@@ -3735,7 +3735,7 @@ var MoonUICardPro = React67.forwardRef(
|
|
|
3735
3735
|
}
|
|
3736
3736
|
);
|
|
3737
3737
|
MoonUICardPro.displayName = "MoonUICardPro";
|
|
3738
|
-
var MoonUICardHeaderPro =
|
|
3738
|
+
var MoonUICardHeaderPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3739
3739
|
"div",
|
|
3740
3740
|
{
|
|
3741
3741
|
ref,
|
|
@@ -3744,7 +3744,7 @@ var MoonUICardHeaderPro = React67.forwardRef(({ className, ...props }, ref) => /
|
|
|
3744
3744
|
}
|
|
3745
3745
|
));
|
|
3746
3746
|
MoonUICardHeaderPro.displayName = "MoonUICardHeaderPro";
|
|
3747
|
-
var MoonUICardTitlePro =
|
|
3747
|
+
var MoonUICardTitlePro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3748
3748
|
"h3",
|
|
3749
3749
|
{
|
|
3750
3750
|
ref,
|
|
@@ -3753,7 +3753,7 @@ var MoonUICardTitlePro = React67.forwardRef(({ className, ...props }, ref) => /*
|
|
|
3753
3753
|
}
|
|
3754
3754
|
));
|
|
3755
3755
|
MoonUICardTitlePro.displayName = "MoonUICardTitlePro";
|
|
3756
|
-
var MoonUICardDescriptionPro =
|
|
3756
|
+
var MoonUICardDescriptionPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3757
3757
|
"p",
|
|
3758
3758
|
{
|
|
3759
3759
|
ref,
|
|
@@ -3762,9 +3762,9 @@ var MoonUICardDescriptionPro = React67.forwardRef(({ className, ...props }, ref)
|
|
|
3762
3762
|
}
|
|
3763
3763
|
));
|
|
3764
3764
|
MoonUICardDescriptionPro.displayName = "MoonUICardDescriptionPro";
|
|
3765
|
-
var MoonUICardContentPro =
|
|
3765
|
+
var MoonUICardContentPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("pt-0", className), ...props }));
|
|
3766
3766
|
MoonUICardContentPro.displayName = "MoonUICardContentPro";
|
|
3767
|
-
var MoonUICardFooterPro =
|
|
3767
|
+
var MoonUICardFooterPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3768
3768
|
"div",
|
|
3769
3769
|
{
|
|
3770
3770
|
ref,
|
|
@@ -3811,7 +3811,7 @@ var moonUICheckboxVariantsPro = cva(
|
|
|
3811
3811
|
}
|
|
3812
3812
|
}
|
|
3813
3813
|
);
|
|
3814
|
-
var MoonUICheckboxPro =
|
|
3814
|
+
var MoonUICheckboxPro = React60.forwardRef(({
|
|
3815
3815
|
className,
|
|
3816
3816
|
variant,
|
|
3817
3817
|
size: size4,
|
|
@@ -3822,8 +3822,8 @@ var MoonUICheckboxPro = React67.forwardRef(({
|
|
|
3822
3822
|
checked,
|
|
3823
3823
|
...props
|
|
3824
3824
|
}, ref) => {
|
|
3825
|
-
const [isIndeterminate, setIsIndeterminate] =
|
|
3826
|
-
|
|
3825
|
+
const [isIndeterminate, setIsIndeterminate] = React60.useState(indeterminate);
|
|
3826
|
+
React60.useEffect(() => {
|
|
3827
3827
|
setIsIndeterminate(indeterminate);
|
|
3828
3828
|
}, [indeterminate]);
|
|
3829
3829
|
const effectiveChecked = isIndeterminate ? false : checked;
|
|
@@ -3848,7 +3848,7 @@ var MoonUICheckboxPro = React67.forwardRef(({
|
|
|
3848
3848
|
);
|
|
3849
3849
|
});
|
|
3850
3850
|
MoonUICheckboxPro.displayName = CheckboxPrimitive.Root.displayName;
|
|
3851
|
-
var MoonUICheckboxGroupPro =
|
|
3851
|
+
var MoonUICheckboxGroupPro = React60.forwardRef(
|
|
3852
3852
|
({ className, orientation = "vertical", spacing = "1rem", children, ...props }, ref) => {
|
|
3853
3853
|
return /* @__PURE__ */ jsx(
|
|
3854
3854
|
"div",
|
|
@@ -3868,7 +3868,7 @@ var MoonUICheckboxGroupPro = React67.forwardRef(
|
|
|
3868
3868
|
}
|
|
3869
3869
|
);
|
|
3870
3870
|
MoonUICheckboxGroupPro.displayName = "CheckboxGroup";
|
|
3871
|
-
var MoonUICheckboxLabelPro =
|
|
3871
|
+
var MoonUICheckboxLabelPro = React60.forwardRef(
|
|
3872
3872
|
({ className, htmlFor, children, position = "end", disabled = false, ...props }, ref) => {
|
|
3873
3873
|
return /* @__PURE__ */ jsx(
|
|
3874
3874
|
"label",
|
|
@@ -3888,14 +3888,14 @@ var MoonUICheckboxLabelPro = React67.forwardRef(
|
|
|
3888
3888
|
}
|
|
3889
3889
|
);
|
|
3890
3890
|
MoonUICheckboxLabelPro.displayName = "CheckboxLabel";
|
|
3891
|
-
var MoonUICheckboxWithLabelPro =
|
|
3891
|
+
var MoonUICheckboxWithLabelPro = React60.forwardRef(({
|
|
3892
3892
|
id,
|
|
3893
3893
|
label,
|
|
3894
3894
|
labelPosition = "end",
|
|
3895
3895
|
labelClassName,
|
|
3896
3896
|
...checkboxProps
|
|
3897
3897
|
}, ref) => {
|
|
3898
|
-
const generatedId =
|
|
3898
|
+
const generatedId = React60.useId();
|
|
3899
3899
|
const checkboxId = id || generatedId;
|
|
3900
3900
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
3901
3901
|
labelPosition === "start" && /* @__PURE__ */ jsx(
|
|
@@ -3923,7 +3923,7 @@ var MoonUICheckboxWithLabelPro = React67.forwardRef(({
|
|
|
3923
3923
|
});
|
|
3924
3924
|
MoonUICheckboxWithLabelPro.displayName = "CheckboxWithLabel";
|
|
3925
3925
|
|
|
3926
|
-
// node_modules/@radix-ui/primitive/dist/index.mjs
|
|
3926
|
+
// ../../node_modules/@radix-ui/primitive/dist/index.mjs
|
|
3927
3927
|
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
3928
3928
|
return function handleEvent(event) {
|
|
3929
3929
|
originalEventHandler?.(event);
|
|
@@ -3935,19 +3935,19 @@ function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForD
|
|
|
3935
3935
|
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
3936
3936
|
let defaultContexts = [];
|
|
3937
3937
|
function createContext32(rootComponentName, defaultContext) {
|
|
3938
|
-
const BaseContext =
|
|
3938
|
+
const BaseContext = React60.createContext(defaultContext);
|
|
3939
3939
|
const index2 = defaultContexts.length;
|
|
3940
3940
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
3941
3941
|
const Provider3 = (props) => {
|
|
3942
3942
|
const { scope, children, ...context } = props;
|
|
3943
3943
|
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
3944
|
-
const value =
|
|
3944
|
+
const value = React60.useMemo(() => context, Object.values(context));
|
|
3945
3945
|
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
3946
3946
|
};
|
|
3947
3947
|
Provider3.displayName = rootComponentName + "Provider";
|
|
3948
3948
|
function useContext23(consumerName, scope) {
|
|
3949
3949
|
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
3950
|
-
const context =
|
|
3950
|
+
const context = React60.useContext(Context);
|
|
3951
3951
|
if (context)
|
|
3952
3952
|
return context;
|
|
3953
3953
|
if (defaultContext !== void 0)
|
|
@@ -3958,11 +3958,11 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
3958
3958
|
}
|
|
3959
3959
|
const createScope = () => {
|
|
3960
3960
|
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
3961
|
-
return
|
|
3961
|
+
return React60.createContext(defaultContext);
|
|
3962
3962
|
});
|
|
3963
3963
|
return function useScope(scope) {
|
|
3964
3964
|
const contexts = scope?.[scopeName] || scopeContexts;
|
|
3965
|
-
return
|
|
3965
|
+
return React60.useMemo(
|
|
3966
3966
|
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
3967
3967
|
[scope, contexts]
|
|
3968
3968
|
);
|
|
@@ -3986,15 +3986,15 @@ function composeContextScopes(...scopes) {
|
|
|
3986
3986
|
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
3987
3987
|
return { ...nextScopes2, ...currentScope };
|
|
3988
3988
|
}, {});
|
|
3989
|
-
return
|
|
3989
|
+
return React60.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
3990
3990
|
};
|
|
3991
3991
|
};
|
|
3992
3992
|
createScope.scopeName = baseScope.scopeName;
|
|
3993
3993
|
return createScope;
|
|
3994
3994
|
}
|
|
3995
|
-
var useLayoutEffect2 = globalThis?.document ?
|
|
3995
|
+
var useLayoutEffect2 = globalThis?.document ? React60.useLayoutEffect : () => {
|
|
3996
3996
|
};
|
|
3997
|
-
var useInsertionEffect =
|
|
3997
|
+
var useInsertionEffect = React60[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
3998
3998
|
function useControllableState({
|
|
3999
3999
|
prop,
|
|
4000
4000
|
defaultProp,
|
|
@@ -4009,8 +4009,8 @@ function useControllableState({
|
|
|
4009
4009
|
const isControlled = prop !== void 0;
|
|
4010
4010
|
const value = isControlled ? prop : uncontrolledProp;
|
|
4011
4011
|
{
|
|
4012
|
-
const isControlledRef =
|
|
4013
|
-
|
|
4012
|
+
const isControlledRef = React60.useRef(prop !== void 0);
|
|
4013
|
+
React60.useEffect(() => {
|
|
4014
4014
|
const wasControlled = isControlledRef.current;
|
|
4015
4015
|
if (wasControlled !== isControlled) {
|
|
4016
4016
|
const from2 = wasControlled ? "controlled" : "uncontrolled";
|
|
@@ -4022,7 +4022,7 @@ function useControllableState({
|
|
|
4022
4022
|
isControlledRef.current = isControlled;
|
|
4023
4023
|
}, [isControlled, caller]);
|
|
4024
4024
|
}
|
|
4025
|
-
const setValue =
|
|
4025
|
+
const setValue = React60.useCallback(
|
|
4026
4026
|
(nextValue) => {
|
|
4027
4027
|
if (isControlled) {
|
|
4028
4028
|
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
@@ -4041,13 +4041,13 @@ function useUncontrolledState({
|
|
|
4041
4041
|
defaultProp,
|
|
4042
4042
|
onChange
|
|
4043
4043
|
}) {
|
|
4044
|
-
const [value, setValue] =
|
|
4045
|
-
const prevValueRef =
|
|
4046
|
-
const onChangeRef =
|
|
4044
|
+
const [value, setValue] = React60.useState(defaultProp);
|
|
4045
|
+
const prevValueRef = React60.useRef(value);
|
|
4046
|
+
const onChangeRef = React60.useRef(onChange);
|
|
4047
4047
|
useInsertionEffect(() => {
|
|
4048
4048
|
onChangeRef.current = onChange;
|
|
4049
4049
|
}, [onChange]);
|
|
4050
|
-
|
|
4050
|
+
React60.useEffect(() => {
|
|
4051
4051
|
if (prevValueRef.current !== value) {
|
|
4052
4052
|
onChangeRef.current?.(value);
|
|
4053
4053
|
prevValueRef.current = value;
|
|
@@ -4090,7 +4090,7 @@ function composeRefs(...refs) {
|
|
|
4090
4090
|
};
|
|
4091
4091
|
}
|
|
4092
4092
|
function useComposedRefs(...refs) {
|
|
4093
|
-
return
|
|
4093
|
+
return React60.useCallback(composeRefs(...refs), refs);
|
|
4094
4094
|
}
|
|
4095
4095
|
var NODES = [
|
|
4096
4096
|
"a",
|
|
@@ -4113,7 +4113,7 @@ var NODES = [
|
|
|
4113
4113
|
];
|
|
4114
4114
|
var Primitive = NODES.reduce((primitive, node) => {
|
|
4115
4115
|
const Slot = createSlot(`Primitive.${node}`);
|
|
4116
|
-
const Node4 =
|
|
4116
|
+
const Node4 = React60.forwardRef((props, forwardedRef) => {
|
|
4117
4117
|
const { asChild, ...primitiveProps } = props;
|
|
4118
4118
|
const Comp = asChild ? Slot : node;
|
|
4119
4119
|
if (typeof window !== "undefined") {
|
|
@@ -4124,8 +4124,12 @@ var Primitive = NODES.reduce((primitive, node) => {
|
|
|
4124
4124
|
Node4.displayName = `Primitive.${node}`;
|
|
4125
4125
|
return { ...primitive, [node]: Node4 };
|
|
4126
4126
|
}, {});
|
|
4127
|
+
function dispatchDiscreteCustomEvent(target, event) {
|
|
4128
|
+
if (target)
|
|
4129
|
+
ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
4130
|
+
}
|
|
4127
4131
|
function useStateMachine(initialState, machine) {
|
|
4128
|
-
return
|
|
4132
|
+
return React60.useReducer((state, event) => {
|
|
4129
4133
|
const nextState = machine[state][event];
|
|
4130
4134
|
return nextState ?? state;
|
|
4131
4135
|
}, initialState);
|
|
@@ -4133,17 +4137,17 @@ function useStateMachine(initialState, machine) {
|
|
|
4133
4137
|
var Presence = (props) => {
|
|
4134
4138
|
const { present, children } = props;
|
|
4135
4139
|
const presence = usePresence(present);
|
|
4136
|
-
const child = typeof children === "function" ? children({ present: presence.isPresent }) :
|
|
4140
|
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React60.Children.only(children);
|
|
4137
4141
|
const ref = useComposedRefs(presence.ref, getElementRef(child));
|
|
4138
4142
|
const forceMount = typeof children === "function";
|
|
4139
|
-
return forceMount || presence.isPresent ?
|
|
4143
|
+
return forceMount || presence.isPresent ? React60.cloneElement(child, { ref }) : null;
|
|
4140
4144
|
};
|
|
4141
4145
|
Presence.displayName = "Presence";
|
|
4142
4146
|
function usePresence(present) {
|
|
4143
|
-
const [node, setNode2] =
|
|
4144
|
-
const stylesRef =
|
|
4145
|
-
const prevPresentRef =
|
|
4146
|
-
const prevAnimationNameRef =
|
|
4147
|
+
const [node, setNode2] = React60.useState();
|
|
4148
|
+
const stylesRef = React60.useRef(null);
|
|
4149
|
+
const prevPresentRef = React60.useRef(present);
|
|
4150
|
+
const prevAnimationNameRef = React60.useRef("none");
|
|
4147
4151
|
const initialState = present ? "mounted" : "unmounted";
|
|
4148
4152
|
const [state, send] = useStateMachine(initialState, {
|
|
4149
4153
|
mounted: {
|
|
@@ -4158,7 +4162,7 @@ function usePresence(present) {
|
|
|
4158
4162
|
MOUNT: "mounted"
|
|
4159
4163
|
}
|
|
4160
4164
|
});
|
|
4161
|
-
|
|
4165
|
+
React60.useEffect(() => {
|
|
4162
4166
|
const currentAnimationName = getAnimationName(stylesRef.current);
|
|
4163
4167
|
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
4164
4168
|
}, [state]);
|
|
@@ -4224,7 +4228,7 @@ function usePresence(present) {
|
|
|
4224
4228
|
}, [node, send]);
|
|
4225
4229
|
return {
|
|
4226
4230
|
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
4227
|
-
ref:
|
|
4231
|
+
ref: React60.useCallback((node2) => {
|
|
4228
4232
|
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
4229
4233
|
setNode2(node2);
|
|
4230
4234
|
}, [])
|
|
@@ -4246,10 +4250,10 @@ function getElementRef(element) {
|
|
|
4246
4250
|
}
|
|
4247
4251
|
return element.props.ref || element.ref;
|
|
4248
4252
|
}
|
|
4249
|
-
var useReactId =
|
|
4253
|
+
var useReactId = React60[" useId ".trim().toString()] || (() => void 0);
|
|
4250
4254
|
var count = 0;
|
|
4251
4255
|
function useId2(deterministicId) {
|
|
4252
|
-
const [id, setId] =
|
|
4256
|
+
const [id, setId] = React60.useState(useReactId());
|
|
4253
4257
|
useLayoutEffect2(() => {
|
|
4254
4258
|
if (!deterministicId)
|
|
4255
4259
|
setId((reactId) => reactId ?? String(count++));
|
|
@@ -4259,7 +4263,7 @@ function useId2(deterministicId) {
|
|
|
4259
4263
|
var COLLAPSIBLE_NAME = "Collapsible";
|
|
4260
4264
|
var [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);
|
|
4261
4265
|
var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
|
|
4262
|
-
var Collapsible =
|
|
4266
|
+
var Collapsible = React60.forwardRef(
|
|
4263
4267
|
(props, forwardedRef) => {
|
|
4264
4268
|
const {
|
|
4265
4269
|
__scopeCollapsible,
|
|
@@ -4282,7 +4286,7 @@ var Collapsible = React67.forwardRef(
|
|
|
4282
4286
|
disabled,
|
|
4283
4287
|
contentId: useId2(),
|
|
4284
4288
|
open,
|
|
4285
|
-
onOpenToggle:
|
|
4289
|
+
onOpenToggle: React60.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
4286
4290
|
children: /* @__PURE__ */ jsx(
|
|
4287
4291
|
Primitive.div,
|
|
4288
4292
|
{
|
|
@@ -4298,7 +4302,7 @@ var Collapsible = React67.forwardRef(
|
|
|
4298
4302
|
);
|
|
4299
4303
|
Collapsible.displayName = COLLAPSIBLE_NAME;
|
|
4300
4304
|
var TRIGGER_NAME = "CollapsibleTrigger";
|
|
4301
|
-
var CollapsibleTrigger =
|
|
4305
|
+
var CollapsibleTrigger = React60.forwardRef(
|
|
4302
4306
|
(props, forwardedRef) => {
|
|
4303
4307
|
const { __scopeCollapsible, ...triggerProps } = props;
|
|
4304
4308
|
const context = useCollapsibleContext(TRIGGER_NAME, __scopeCollapsible);
|
|
@@ -4320,7 +4324,7 @@ var CollapsibleTrigger = React67.forwardRef(
|
|
|
4320
4324
|
);
|
|
4321
4325
|
CollapsibleTrigger.displayName = TRIGGER_NAME;
|
|
4322
4326
|
var CONTENT_NAME = "CollapsibleContent";
|
|
4323
|
-
var CollapsibleContent =
|
|
4327
|
+
var CollapsibleContent = React60.forwardRef(
|
|
4324
4328
|
(props, forwardedRef) => {
|
|
4325
4329
|
const { forceMount, ...contentProps } = props;
|
|
4326
4330
|
const context = useCollapsibleContext(CONTENT_NAME, props.__scopeCollapsible);
|
|
@@ -4328,20 +4332,20 @@ var CollapsibleContent = React67.forwardRef(
|
|
|
4328
4332
|
}
|
|
4329
4333
|
);
|
|
4330
4334
|
CollapsibleContent.displayName = CONTENT_NAME;
|
|
4331
|
-
var CollapsibleContentImpl =
|
|
4335
|
+
var CollapsibleContentImpl = React60.forwardRef((props, forwardedRef) => {
|
|
4332
4336
|
const { __scopeCollapsible, present, children, ...contentProps } = props;
|
|
4333
4337
|
const context = useCollapsibleContext(CONTENT_NAME, __scopeCollapsible);
|
|
4334
|
-
const [isPresent, setIsPresent] =
|
|
4335
|
-
const ref =
|
|
4338
|
+
const [isPresent, setIsPresent] = React60.useState(present);
|
|
4339
|
+
const ref = React60.useRef(null);
|
|
4336
4340
|
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
4337
|
-
const heightRef =
|
|
4341
|
+
const heightRef = React60.useRef(0);
|
|
4338
4342
|
const height = heightRef.current;
|
|
4339
|
-
const widthRef =
|
|
4343
|
+
const widthRef = React60.useRef(0);
|
|
4340
4344
|
const width = widthRef.current;
|
|
4341
4345
|
const isOpen = context.open || isPresent;
|
|
4342
|
-
const isMountAnimationPreventedRef =
|
|
4343
|
-
const originalStylesRef =
|
|
4344
|
-
|
|
4346
|
+
const isMountAnimationPreventedRef = React60.useRef(isOpen);
|
|
4347
|
+
const originalStylesRef = React60.useRef(void 0);
|
|
4348
|
+
React60.useEffect(() => {
|
|
4345
4349
|
const rAF = requestAnimationFrame(() => isMountAnimationPreventedRef.current = false);
|
|
4346
4350
|
return () => cancelAnimationFrame(rAF);
|
|
4347
4351
|
}, []);
|
|
@@ -4388,7 +4392,7 @@ function getState(open) {
|
|
|
4388
4392
|
var Root4 = Collapsible;
|
|
4389
4393
|
var Trigger2 = CollapsibleTrigger;
|
|
4390
4394
|
var Content2 = CollapsibleContent;
|
|
4391
|
-
var MoonUICollapsiblePro =
|
|
4395
|
+
var MoonUICollapsiblePro = React60.forwardRef(({
|
|
4392
4396
|
className,
|
|
4393
4397
|
variant = "default",
|
|
4394
4398
|
size: size4 = "md",
|
|
@@ -4408,7 +4412,7 @@ var MoonUICollapsiblePro = React67.forwardRef(({
|
|
|
4408
4412
|
children,
|
|
4409
4413
|
disabled
|
|
4410
4414
|
}, ref) => {
|
|
4411
|
-
const [localOpen, setLocalOpen] =
|
|
4415
|
+
const [localOpen, setLocalOpen] = React60.useState(() => {
|
|
4412
4416
|
if (persistKey && typeof window !== "undefined") {
|
|
4413
4417
|
const stored = localStorage.getItem(`collapsible-${persistKey}`);
|
|
4414
4418
|
if (stored !== null) {
|
|
@@ -4417,9 +4421,9 @@ var MoonUICollapsiblePro = React67.forwardRef(({
|
|
|
4417
4421
|
}
|
|
4418
4422
|
return defaultOpen || false;
|
|
4419
4423
|
});
|
|
4420
|
-
const [hasBeenOpened, setHasBeenOpened] =
|
|
4424
|
+
const [hasBeenOpened, setHasBeenOpened] = React60.useState(!lazy);
|
|
4421
4425
|
const isOpen = controlledOpen !== void 0 ? controlledOpen : localOpen;
|
|
4422
|
-
const handleOpenChange =
|
|
4426
|
+
const handleOpenChange = React60.useCallback((open) => {
|
|
4423
4427
|
if (!loading) {
|
|
4424
4428
|
setLocalOpen(open);
|
|
4425
4429
|
onOpenChange?.(open);
|
|
@@ -4439,7 +4443,7 @@ var MoonUICollapsiblePro = React67.forwardRef(({
|
|
|
4439
4443
|
}
|
|
4440
4444
|
}
|
|
4441
4445
|
}, [loading, onOpenChange, onToggleChange, persistKey, lazy, hasBeenOpened, autoCollapseAfter]);
|
|
4442
|
-
|
|
4446
|
+
React60.useEffect(() => {
|
|
4443
4447
|
if (shortcut) {
|
|
4444
4448
|
const handleKeyPress = (e) => {
|
|
4445
4449
|
const keys2 = shortcut.toLowerCase().split("+");
|
|
@@ -4536,7 +4540,7 @@ var MoonUICollapsiblePro = React67.forwardRef(({
|
|
|
4536
4540
|
] });
|
|
4537
4541
|
});
|
|
4538
4542
|
MoonUICollapsiblePro.displayName = "MoonUICollapsiblePro";
|
|
4539
|
-
var CollapsibleContext =
|
|
4543
|
+
var CollapsibleContext = React60.createContext({});
|
|
4540
4544
|
var collapsibleTriggerVariants = cva(
|
|
4541
4545
|
"flex w-full items-center gap-3 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
4542
4546
|
{
|
|
@@ -4563,7 +4567,7 @@ var collapsibleTriggerVariants = cva(
|
|
|
4563
4567
|
}
|
|
4564
4568
|
}
|
|
4565
4569
|
);
|
|
4566
|
-
var MoonUICollapsibleTriggerPro =
|
|
4570
|
+
var MoonUICollapsibleTriggerPro = React60.forwardRef(({
|
|
4567
4571
|
className,
|
|
4568
4572
|
children,
|
|
4569
4573
|
variant: triggerVariant,
|
|
@@ -4578,7 +4582,7 @@ var MoonUICollapsibleTriggerPro = React67.forwardRef(({
|
|
|
4578
4582
|
status,
|
|
4579
4583
|
...props
|
|
4580
4584
|
}, ref) => {
|
|
4581
|
-
const { variant, size: size4, shortcut } =
|
|
4585
|
+
const { variant, size: size4, shortcut } = React60.useContext(CollapsibleContext);
|
|
4582
4586
|
const finalVariant = triggerVariant || variant || "default";
|
|
4583
4587
|
const finalSize = triggerSize || size4 || "md";
|
|
4584
4588
|
const statusIcon = status && {
|
|
@@ -4656,7 +4660,7 @@ var collapsibleContentVariants = cva(
|
|
|
4656
4660
|
}
|
|
4657
4661
|
}
|
|
4658
4662
|
);
|
|
4659
|
-
var MoonUICollapsibleContentPro =
|
|
4663
|
+
var MoonUICollapsibleContentPro = React60.forwardRef(({
|
|
4660
4664
|
className,
|
|
4661
4665
|
children,
|
|
4662
4666
|
variant: contentVariant,
|
|
@@ -4667,12 +4671,12 @@ var MoonUICollapsibleContentPro = React67.forwardRef(({
|
|
|
4667
4671
|
padding,
|
|
4668
4672
|
...props
|
|
4669
4673
|
}, ref) => {
|
|
4670
|
-
const { variant, size: size4, animationMode, lazy } =
|
|
4674
|
+
const { variant, size: size4, animationMode, lazy } = React60.useContext(CollapsibleContext);
|
|
4671
4675
|
const finalVariant = contentVariant || variant || "default";
|
|
4672
4676
|
const finalSize = contentSize || size4 || "md";
|
|
4673
|
-
const [dynamicContent, setDynamicContent] =
|
|
4674
|
-
const [isLoading, setIsLoading] =
|
|
4675
|
-
|
|
4677
|
+
const [dynamicContent, setDynamicContent] = React60.useState(null);
|
|
4678
|
+
const [isLoading, setIsLoading] = React60.useState(false);
|
|
4679
|
+
React60.useEffect(() => {
|
|
4676
4680
|
if (loadContent && !dynamicContent) {
|
|
4677
4681
|
setIsLoading(true);
|
|
4678
4682
|
loadContent().then(setDynamicContent).finally(() => setIsLoading(false));
|
|
@@ -4712,19 +4716,19 @@ var MoonUICollapsibleContentPro = React67.forwardRef(({
|
|
|
4712
4716
|
});
|
|
4713
4717
|
MoonUICollapsibleContentPro.displayName = "MoonUICollapsibleContentPro";
|
|
4714
4718
|
var useCollapsibleAnalytics = () => {
|
|
4715
|
-
const [analytics, setAnalytics] =
|
|
4719
|
+
const [analytics, setAnalytics] = React60.useState({
|
|
4716
4720
|
openCount: 0,
|
|
4717
4721
|
lastOpened: null,
|
|
4718
4722
|
totalTimeOpen: 0
|
|
4719
4723
|
});
|
|
4720
|
-
const trackOpen =
|
|
4724
|
+
const trackOpen = React60.useCallback(() => {
|
|
4721
4725
|
setAnalytics((prev) => ({
|
|
4722
4726
|
...prev,
|
|
4723
4727
|
openCount: prev.openCount + 1,
|
|
4724
4728
|
lastOpened: /* @__PURE__ */ new Date()
|
|
4725
4729
|
}));
|
|
4726
4730
|
}, []);
|
|
4727
|
-
const trackClose =
|
|
4731
|
+
const trackClose = React60.useCallback(() => {
|
|
4728
4732
|
setAnalytics((prev) => {
|
|
4729
4733
|
if (prev.lastOpened) {
|
|
4730
4734
|
const timeOpen = Date.now() - prev.lastOpened.getTime();
|
|
@@ -4859,7 +4863,7 @@ var overlayVariants = cva(
|
|
|
4859
4863
|
}
|
|
4860
4864
|
}
|
|
4861
4865
|
);
|
|
4862
|
-
var MoonUIDialogOverlayPro =
|
|
4866
|
+
var MoonUIDialogOverlayPro = React60.forwardRef(({ className, variant, blurAmount, animation, customBackdrop = false, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
4863
4867
|
DialogPrimitive.Overlay,
|
|
4864
4868
|
{
|
|
4865
4869
|
ref,
|
|
@@ -4942,7 +4946,7 @@ var dialogContentVariants = cva(
|
|
|
4942
4946
|
}
|
|
4943
4947
|
}
|
|
4944
4948
|
);
|
|
4945
|
-
var MoonUIDialogContentPro =
|
|
4949
|
+
var MoonUIDialogContentPro = React60.forwardRef(
|
|
4946
4950
|
({
|
|
4947
4951
|
className,
|
|
4948
4952
|
children,
|
|
@@ -4971,7 +4975,7 @@ var MoonUIDialogContentPro = React67.forwardRef(
|
|
|
4971
4975
|
closeAnimation = true,
|
|
4972
4976
|
...props
|
|
4973
4977
|
}, ref) => {
|
|
4974
|
-
const [isClosing, setIsClosing] =
|
|
4978
|
+
const [isClosing, setIsClosing] = React60.useState(false);
|
|
4975
4979
|
const zIndex = 50 + stackLevel * 10;
|
|
4976
4980
|
const getConfirmationIcon = () => {
|
|
4977
4981
|
switch (confirmationType) {
|
|
@@ -5136,7 +5140,7 @@ var MoonUIDialogContentPro = React67.forwardRef(
|
|
|
5136
5140
|
};
|
|
5137
5141
|
const animationVariants2 = getAnimationVariants();
|
|
5138
5142
|
const displayIcon = confirmationType ? getConfirmationIcon() : icon;
|
|
5139
|
-
|
|
5143
|
+
React60.useEffect(() => {
|
|
5140
5144
|
if (typeof window !== "undefined" && true) {
|
|
5141
5145
|
console.log("\u{1F3AD} Dialog Animation Debug:", {
|
|
5142
5146
|
animation,
|
|
@@ -5289,7 +5293,7 @@ var MoonUIDialogFooterPro = ({
|
|
|
5289
5293
|
}
|
|
5290
5294
|
);
|
|
5291
5295
|
MoonUIDialogFooterPro.displayName = "MoonUIDialogFooterPro";
|
|
5292
|
-
var MoonUIDialogTitlePro =
|
|
5296
|
+
var MoonUIDialogTitlePro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5293
5297
|
DialogPrimitive.Title,
|
|
5294
5298
|
{
|
|
5295
5299
|
ref,
|
|
@@ -5301,7 +5305,7 @@ var MoonUIDialogTitlePro = React67.forwardRef(({ className, ...props }, ref) =>
|
|
|
5301
5305
|
}
|
|
5302
5306
|
));
|
|
5303
5307
|
MoonUIDialogTitlePro.displayName = DialogPrimitive.Title.displayName;
|
|
5304
|
-
var MoonUIDialogDescriptionPro =
|
|
5308
|
+
var MoonUIDialogDescriptionPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5305
5309
|
DialogPrimitive.Description,
|
|
5306
5310
|
{
|
|
5307
5311
|
ref,
|
|
@@ -5313,7 +5317,7 @@ var MoonUIDialogDescriptionPro = React67.forwardRef(({ className, ...props }, re
|
|
|
5313
5317
|
}
|
|
5314
5318
|
));
|
|
5315
5319
|
MoonUIDialogDescriptionPro.displayName = DialogPrimitive.Description.displayName;
|
|
5316
|
-
var MoonUIDialogFormPro =
|
|
5320
|
+
var MoonUIDialogFormPro = React60.forwardRef(({ className, enableValidation = false, onSubmit, isSubmitting = false, ...props }, ref) => {
|
|
5317
5321
|
const handleSubmit = async (e) => {
|
|
5318
5322
|
e.preventDefault();
|
|
5319
5323
|
if (onSubmit && !isSubmitting) {
|
|
@@ -5363,7 +5367,7 @@ var tooltipVariants = cva(
|
|
|
5363
5367
|
);
|
|
5364
5368
|
var MoonUITooltipPro = TooltipPrimitive.Root;
|
|
5365
5369
|
var MoonUITooltipTriggerPro = TooltipPrimitive.Trigger;
|
|
5366
|
-
var MoonUITooltipArrowPro =
|
|
5370
|
+
var MoonUITooltipArrowPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5367
5371
|
TooltipPrimitive.Arrow,
|
|
5368
5372
|
{
|
|
5369
5373
|
ref,
|
|
@@ -5372,7 +5376,7 @@ var MoonUITooltipArrowPro = React67.forwardRef(({ className, ...props }, ref) =>
|
|
|
5372
5376
|
}
|
|
5373
5377
|
));
|
|
5374
5378
|
MoonUITooltipArrowPro.displayName = TooltipPrimitive.Arrow.displayName;
|
|
5375
|
-
var MoonUITooltipContentPro =
|
|
5379
|
+
var MoonUITooltipContentPro = React60.forwardRef(({ className, variant, size: size4, showArrow = false, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
5376
5380
|
TooltipPrimitive.Content,
|
|
5377
5381
|
{
|
|
5378
5382
|
ref,
|
|
@@ -5386,7 +5390,7 @@ var MoonUITooltipContentPro = React67.forwardRef(({ className, variant, size: si
|
|
|
5386
5390
|
}
|
|
5387
5391
|
));
|
|
5388
5392
|
MoonUITooltipContentPro.displayName = TooltipPrimitive.Content.displayName;
|
|
5389
|
-
var MoonUISimpleTooltipPro =
|
|
5393
|
+
var MoonUISimpleTooltipPro = React60.forwardRef(
|
|
5390
5394
|
({
|
|
5391
5395
|
children,
|
|
5392
5396
|
content,
|
|
@@ -5506,7 +5510,7 @@ var moonUIInputVariantsPro = cva(
|
|
|
5506
5510
|
}
|
|
5507
5511
|
}
|
|
5508
5512
|
);
|
|
5509
|
-
var MoonUIInputPro =
|
|
5513
|
+
var MoonUIInputPro = React60.forwardRef(
|
|
5510
5514
|
({
|
|
5511
5515
|
className,
|
|
5512
5516
|
wrapperClassName,
|
|
@@ -5580,7 +5584,7 @@ MoonUIInputPro.displayName = "MoonUIInputPro";
|
|
|
5580
5584
|
var moonUILabelVariantsPro = cva(
|
|
5581
5585
|
"text-sm font-medium leading-none text-gray-900 dark:text-gray-200 peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:peer-disabled:opacity-60 transition-colors duration-200"
|
|
5582
5586
|
);
|
|
5583
|
-
var MoonUILabelPro =
|
|
5587
|
+
var MoonUILabelPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5584
5588
|
LabelPrimitive.Root,
|
|
5585
5589
|
{
|
|
5586
5590
|
ref,
|
|
@@ -5593,7 +5597,7 @@ var MoonUISelectPro = SelectPrimitive.Root;
|
|
|
5593
5597
|
MoonUISelectPro.displayName = "MoonUISelectPro";
|
|
5594
5598
|
var MoonUISelectGroupPro = SelectPrimitive.Group;
|
|
5595
5599
|
var MoonUISelectValuePro = SelectPrimitive.Value;
|
|
5596
|
-
var MoonUISelectTriggerPro =
|
|
5600
|
+
var MoonUISelectTriggerPro = React60.forwardRef(({ className, children, variant = "standard", size: size4 = "md", error, success, loading, leftIcon, rightIcon, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
5597
5601
|
SelectPrimitive.Trigger,
|
|
5598
5602
|
{
|
|
5599
5603
|
ref,
|
|
@@ -5635,7 +5639,7 @@ var MoonUISelectTriggerPro = React67.forwardRef(({ className, children, variant
|
|
|
5635
5639
|
}
|
|
5636
5640
|
));
|
|
5637
5641
|
MoonUISelectTriggerPro.displayName = SelectPrimitive.Trigger.displayName;
|
|
5638
|
-
var MoonUISelectScrollUpButtonPro =
|
|
5642
|
+
var MoonUISelectScrollUpButtonPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5639
5643
|
SelectPrimitive.ScrollUpButton,
|
|
5640
5644
|
{
|
|
5641
5645
|
ref,
|
|
@@ -5648,7 +5652,7 @@ var MoonUISelectScrollUpButtonPro = React67.forwardRef(({ className, ...props },
|
|
|
5648
5652
|
}
|
|
5649
5653
|
));
|
|
5650
5654
|
MoonUISelectScrollUpButtonPro.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
5651
|
-
var MoonUISelectScrollDownButtonPro =
|
|
5655
|
+
var MoonUISelectScrollDownButtonPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5652
5656
|
SelectPrimitive.ScrollDownButton,
|
|
5653
5657
|
{
|
|
5654
5658
|
ref,
|
|
@@ -5661,14 +5665,14 @@ var MoonUISelectScrollDownButtonPro = React67.forwardRef(({ className, ...props
|
|
|
5661
5665
|
}
|
|
5662
5666
|
));
|
|
5663
5667
|
MoonUISelectScrollDownButtonPro.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
5664
|
-
var MoonUISelectContentPro =
|
|
5665
|
-
const [searchValue, setSearchValue] =
|
|
5666
|
-
const filteredChildren =
|
|
5668
|
+
var MoonUISelectContentPro = React60.forwardRef(({ className, children, position = "popper", side = "bottom", align = "start", enableSearch, searchPlaceholder = "Search...", noResultsText = "No results found", searchLoading, searchIcon, ...props }, ref) => {
|
|
5669
|
+
const [searchValue, setSearchValue] = React60.useState("");
|
|
5670
|
+
const filteredChildren = React60.useMemo(() => {
|
|
5667
5671
|
if (!enableSearch || !searchValue)
|
|
5668
5672
|
return children;
|
|
5669
5673
|
const searchLower = searchValue.toLowerCase();
|
|
5670
|
-
return
|
|
5671
|
-
if (!
|
|
5674
|
+
return React60.Children.toArray(children).filter((child) => {
|
|
5675
|
+
if (!React60.isValidElement(child))
|
|
5672
5676
|
return true;
|
|
5673
5677
|
if (child.type === MoonUISelectGroupPro || child.type === MoonUISelectLabelPro || child.type === MoonUISelectSeparatorPro) {
|
|
5674
5678
|
return true;
|
|
@@ -5741,7 +5745,7 @@ var MoonUISelectContentPro = React67.forwardRef(({ className, children, position
|
|
|
5741
5745
|
"p-1",
|
|
5742
5746
|
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
5743
5747
|
),
|
|
5744
|
-
children: searchLoading ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ jsx(Loader2, { className: "h-5 w-5 animate-spin text-gray-400" }) }) : filteredChildren &&
|
|
5748
|
+
children: searchLoading ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ jsx(Loader2, { className: "h-5 w-5 animate-spin text-gray-400" }) }) : filteredChildren && React60.Children.count(filteredChildren) > 0 ? filteredChildren : enableSearch ? /* @__PURE__ */ jsx("div", { className: "py-6 text-center text-sm text-gray-500 dark:text-gray-400", children: noResultsText }) : children
|
|
5745
5749
|
}
|
|
5746
5750
|
),
|
|
5747
5751
|
/* @__PURE__ */ jsx(MoonUISelectScrollDownButtonPro, {})
|
|
@@ -5750,7 +5754,7 @@ var MoonUISelectContentPro = React67.forwardRef(({ className, children, position
|
|
|
5750
5754
|
) });
|
|
5751
5755
|
});
|
|
5752
5756
|
MoonUISelectContentPro.displayName = SelectPrimitive.Content.displayName;
|
|
5753
|
-
var MoonUISelectLabelPro =
|
|
5757
|
+
var MoonUISelectLabelPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5754
5758
|
SelectPrimitive.Label,
|
|
5755
5759
|
{
|
|
5756
5760
|
ref,
|
|
@@ -5759,7 +5763,7 @@ var MoonUISelectLabelPro = React67.forwardRef(({ className, ...props }, ref) =>
|
|
|
5759
5763
|
}
|
|
5760
5764
|
));
|
|
5761
5765
|
MoonUISelectLabelPro.displayName = SelectPrimitive.Label.displayName;
|
|
5762
|
-
var MoonUISelectItemPro =
|
|
5766
|
+
var MoonUISelectItemPro = React60.forwardRef(({ className, children, variant = "default", size: size4 = "md", rightIcon, customIndicator, enableHoverScale, description, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
5763
5767
|
SelectPrimitive.Item,
|
|
5764
5768
|
{
|
|
5765
5769
|
ref,
|
|
@@ -5791,7 +5795,7 @@ var MoonUISelectItemPro = React67.forwardRef(({ className, children, variant = "
|
|
|
5791
5795
|
}
|
|
5792
5796
|
));
|
|
5793
5797
|
MoonUISelectItemPro.displayName = SelectPrimitive.Item.displayName;
|
|
5794
|
-
var MoonUISelectSeparatorPro =
|
|
5798
|
+
var MoonUISelectSeparatorPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
5795
5799
|
SelectPrimitive.Separator,
|
|
5796
5800
|
{
|
|
5797
5801
|
ref,
|
|
@@ -5962,7 +5966,7 @@ var getAIProvider = (settings) => {
|
|
|
5962
5966
|
return null;
|
|
5963
5967
|
}
|
|
5964
5968
|
};
|
|
5965
|
-
var MoonUICommandPro =
|
|
5969
|
+
var MoonUICommandPro = React60.forwardRef(({
|
|
5966
5970
|
className,
|
|
5967
5971
|
variant,
|
|
5968
5972
|
size: size4,
|
|
@@ -6347,7 +6351,7 @@ var MoonUICommandDialogPro = ({
|
|
|
6347
6351
|
/* @__PURE__ */ jsx(MoonUICommandPro, { ...commandProps, children })
|
|
6348
6352
|
] }) });
|
|
6349
6353
|
};
|
|
6350
|
-
var MoonUICommandInputPro =
|
|
6354
|
+
var MoonUICommandInputPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
6351
6355
|
/* @__PURE__ */ jsx(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
6352
6356
|
/* @__PURE__ */ jsx(
|
|
6353
6357
|
Command.Input,
|
|
@@ -6362,7 +6366,7 @@ var MoonUICommandInputPro = React67.forwardRef(({ className, ...props }, ref) =>
|
|
|
6362
6366
|
)
|
|
6363
6367
|
] }));
|
|
6364
6368
|
MoonUICommandInputPro.displayName = Command.Input.displayName;
|
|
6365
|
-
var MoonUICommandListPro =
|
|
6369
|
+
var MoonUICommandListPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
6366
6370
|
Command.List,
|
|
6367
6371
|
{
|
|
6368
6372
|
ref,
|
|
@@ -6371,7 +6375,7 @@ var MoonUICommandListPro = React67.forwardRef(({ className, ...props }, ref) =>
|
|
|
6371
6375
|
}
|
|
6372
6376
|
));
|
|
6373
6377
|
MoonUICommandListPro.displayName = Command.List.displayName;
|
|
6374
|
-
var MoonUICommandEmptyPro =
|
|
6378
|
+
var MoonUICommandEmptyPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
6375
6379
|
Command.Empty,
|
|
6376
6380
|
{
|
|
6377
6381
|
ref,
|
|
@@ -6380,7 +6384,7 @@ var MoonUICommandEmptyPro = React67.forwardRef(({ className, ...props }, ref) =>
|
|
|
6380
6384
|
}
|
|
6381
6385
|
));
|
|
6382
6386
|
MoonUICommandEmptyPro.displayName = Command.Empty.displayName;
|
|
6383
|
-
var MoonUICommandGroupPro =
|
|
6387
|
+
var MoonUICommandGroupPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
6384
6388
|
Command.Group,
|
|
6385
6389
|
{
|
|
6386
6390
|
ref,
|
|
@@ -6392,7 +6396,7 @@ var MoonUICommandGroupPro = React67.forwardRef(({ className, ...props }, ref) =>
|
|
|
6392
6396
|
}
|
|
6393
6397
|
));
|
|
6394
6398
|
MoonUICommandGroupPro.displayName = Command.Group.displayName;
|
|
6395
|
-
var MoonUICommandSeparatorPro =
|
|
6399
|
+
var MoonUICommandSeparatorPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
6396
6400
|
Command.Separator,
|
|
6397
6401
|
{
|
|
6398
6402
|
ref,
|
|
@@ -6401,7 +6405,7 @@ var MoonUICommandSeparatorPro = React67.forwardRef(({ className, ...props }, ref
|
|
|
6401
6405
|
}
|
|
6402
6406
|
));
|
|
6403
6407
|
MoonUICommandSeparatorPro.displayName = Command.Separator.displayName;
|
|
6404
|
-
var MoonUICommandItemPro =
|
|
6408
|
+
var MoonUICommandItemPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
6405
6409
|
Command.Item,
|
|
6406
6410
|
{
|
|
6407
6411
|
ref,
|
|
@@ -6494,7 +6498,7 @@ var dropdownItemVariants = cva(
|
|
|
6494
6498
|
}
|
|
6495
6499
|
}
|
|
6496
6500
|
);
|
|
6497
|
-
var MoonUIDropdownMenuSubTriggerPro =
|
|
6501
|
+
var MoonUIDropdownMenuSubTriggerPro = React60.forwardRef(({ className, inset, children, showChevron = true, badge, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
6498
6502
|
DropdownMenuPrimitive.SubTrigger,
|
|
6499
6503
|
{
|
|
6500
6504
|
ref,
|
|
@@ -6518,7 +6522,7 @@ var MoonUIDropdownMenuSubTriggerPro = React67.forwardRef(({ className, inset, ch
|
|
|
6518
6522
|
}
|
|
6519
6523
|
));
|
|
6520
6524
|
MoonUIDropdownMenuSubTriggerPro.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
6521
|
-
var MoonUIDropdownMenuSubContentPro =
|
|
6525
|
+
var MoonUIDropdownMenuSubContentPro = React60.forwardRef(({ className, variant, animation, size: size4, ...props }, ref) => {
|
|
6522
6526
|
return /* @__PURE__ */ jsx(
|
|
6523
6527
|
DropdownMenuPrimitive.SubContent,
|
|
6524
6528
|
{
|
|
@@ -6529,7 +6533,7 @@ var MoonUIDropdownMenuSubContentPro = React67.forwardRef(({ className, variant,
|
|
|
6529
6533
|
);
|
|
6530
6534
|
});
|
|
6531
6535
|
MoonUIDropdownMenuSubContentPro.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
6532
|
-
var MoonUIDropdownMenuContentPro =
|
|
6536
|
+
var MoonUIDropdownMenuContentPro = React60.forwardRef(
|
|
6533
6537
|
({
|
|
6534
6538
|
className,
|
|
6535
6539
|
variant,
|
|
@@ -6547,12 +6551,12 @@ var MoonUIDropdownMenuContentPro = React67.forwardRef(
|
|
|
6547
6551
|
children,
|
|
6548
6552
|
...props
|
|
6549
6553
|
}, ref) => {
|
|
6550
|
-
const [searchQuery, setSearchQuery] =
|
|
6551
|
-
const filteredChildren =
|
|
6554
|
+
const [searchQuery, setSearchQuery] = React60.useState("");
|
|
6555
|
+
const filteredChildren = React60.useMemo(() => {
|
|
6552
6556
|
if (!enableSearch || !searchQuery)
|
|
6553
6557
|
return children;
|
|
6554
|
-
return
|
|
6555
|
-
if (!
|
|
6558
|
+
return React60.Children.toArray(children).filter((child) => {
|
|
6559
|
+
if (!React60.isValidElement(child))
|
|
6556
6560
|
return true;
|
|
6557
6561
|
const childText = getTextFromElement(child);
|
|
6558
6562
|
return childText.toLowerCase().includes(searchQuery.toLowerCase());
|
|
@@ -6608,7 +6612,7 @@ var MoonUIDropdownMenuContentPro = React67.forwardRef(
|
|
|
6608
6612
|
}
|
|
6609
6613
|
);
|
|
6610
6614
|
MoonUIDropdownMenuContentPro.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
6611
|
-
var MoonUIDropdownMenuItemPro =
|
|
6615
|
+
var MoonUIDropdownMenuItemPro = React60.forwardRef(
|
|
6612
6616
|
({
|
|
6613
6617
|
className,
|
|
6614
6618
|
variant,
|
|
@@ -6648,7 +6652,7 @@ var MoonUIDropdownMenuItemPro = React67.forwardRef(
|
|
|
6648
6652
|
)
|
|
6649
6653
|
);
|
|
6650
6654
|
MoonUIDropdownMenuItemPro.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
6651
|
-
var MoonUIDropdownMenuCheckboxItemPro =
|
|
6655
|
+
var MoonUIDropdownMenuCheckboxItemPro = React60.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
6652
6656
|
DropdownMenuPrimitive.CheckboxItem,
|
|
6653
6657
|
{
|
|
6654
6658
|
ref,
|
|
@@ -6665,7 +6669,7 @@ var MoonUIDropdownMenuCheckboxItemPro = React67.forwardRef(({ className, childre
|
|
|
6665
6669
|
}
|
|
6666
6670
|
));
|
|
6667
6671
|
MoonUIDropdownMenuCheckboxItemPro.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
6668
|
-
var MoonUIDropdownMenuRadioItemPro =
|
|
6672
|
+
var MoonUIDropdownMenuRadioItemPro = React60.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
6669
6673
|
DropdownMenuPrimitive.RadioItem,
|
|
6670
6674
|
{
|
|
6671
6675
|
ref,
|
|
@@ -6681,7 +6685,7 @@ var MoonUIDropdownMenuRadioItemPro = React67.forwardRef(({ className, children,
|
|
|
6681
6685
|
}
|
|
6682
6686
|
));
|
|
6683
6687
|
MoonUIDropdownMenuRadioItemPro.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
6684
|
-
var MoonUIDropdownMenuLabelPro =
|
|
6688
|
+
var MoonUIDropdownMenuLabelPro = React60.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
6685
6689
|
DropdownMenuPrimitive.Label,
|
|
6686
6690
|
{
|
|
6687
6691
|
ref,
|
|
@@ -6694,7 +6698,7 @@ var MoonUIDropdownMenuLabelPro = React67.forwardRef(({ className, inset, ...prop
|
|
|
6694
6698
|
}
|
|
6695
6699
|
));
|
|
6696
6700
|
MoonUIDropdownMenuLabelPro.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
6697
|
-
var MoonUIDropdownMenuSeparatorPro =
|
|
6701
|
+
var MoonUIDropdownMenuSeparatorPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
6698
6702
|
DropdownMenuPrimitive.Separator,
|
|
6699
6703
|
{
|
|
6700
6704
|
ref,
|
|
@@ -6723,14 +6727,14 @@ function getTextFromElement(element) {
|
|
|
6723
6727
|
if (typeof props.children === "string") {
|
|
6724
6728
|
return props.children;
|
|
6725
6729
|
}
|
|
6726
|
-
if (
|
|
6730
|
+
if (React60.isValidElement(props.children)) {
|
|
6727
6731
|
return getTextFromElement(props.children);
|
|
6728
6732
|
}
|
|
6729
6733
|
if (Array.isArray(props.children)) {
|
|
6730
6734
|
return props.children.map((child) => {
|
|
6731
6735
|
if (typeof child === "string")
|
|
6732
6736
|
return child;
|
|
6733
|
-
if (
|
|
6737
|
+
if (React60.isValidElement(child))
|
|
6734
6738
|
return getTextFromElement(child);
|
|
6735
6739
|
return "";
|
|
6736
6740
|
}).join("");
|
|
@@ -6747,7 +6751,7 @@ var MoonUIPaginationPro = ({ className, ...props }) => /* @__PURE__ */ jsx(
|
|
|
6747
6751
|
}
|
|
6748
6752
|
);
|
|
6749
6753
|
MoonUIPaginationPro.displayName = "PaginationPro";
|
|
6750
|
-
var MoonUIPaginationContentPro =
|
|
6754
|
+
var MoonUIPaginationContentPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
6751
6755
|
"ul",
|
|
6752
6756
|
{
|
|
6753
6757
|
ref,
|
|
@@ -6756,7 +6760,7 @@ var MoonUIPaginationContentPro = React67.forwardRef(({ className, ...props }, re
|
|
|
6756
6760
|
}
|
|
6757
6761
|
));
|
|
6758
6762
|
MoonUIPaginationContentPro.displayName = "PaginationContentPro";
|
|
6759
|
-
var MoonUIPaginationItemPro =
|
|
6763
|
+
var MoonUIPaginationItemPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("li", { ref, className: cn("", className), ...props }));
|
|
6760
6764
|
MoonUIPaginationItemPro.displayName = "PaginationItemPro";
|
|
6761
6765
|
var MoonUIPaginationLinkPro = ({
|
|
6762
6766
|
className,
|
|
@@ -6879,7 +6883,7 @@ var popoverContentVariants = cva(
|
|
|
6879
6883
|
);
|
|
6880
6884
|
var MoonUIPopoverPro = PopoverPrimitive.Root;
|
|
6881
6885
|
var MoonUIPopoverTriggerPro = PopoverPrimitive.Trigger;
|
|
6882
|
-
var MoonUIPopoverContentPro =
|
|
6886
|
+
var MoonUIPopoverContentPro = React60.forwardRef(({
|
|
6883
6887
|
className,
|
|
6884
6888
|
variant,
|
|
6885
6889
|
size: size4,
|
|
@@ -6922,107 +6926,11 @@ var MoonUIPopoverContentPro = React67.forwardRef(({
|
|
|
6922
6926
|
)
|
|
6923
6927
|
] }));
|
|
6924
6928
|
MoonUIPopoverContentPro.displayName = PopoverPrimitive.Content.displayName;
|
|
6925
|
-
function createContextScope2(scopeName, createContextScopeDeps = []) {
|
|
6926
|
-
let defaultContexts = [];
|
|
6927
|
-
function createContext32(rootComponentName, defaultContext) {
|
|
6928
|
-
const BaseContext = React67.createContext(defaultContext);
|
|
6929
|
-
const index2 = defaultContexts.length;
|
|
6930
|
-
defaultContexts = [...defaultContexts, defaultContext];
|
|
6931
|
-
const Provider3 = (props) => {
|
|
6932
|
-
const { scope, children, ...context } = props;
|
|
6933
|
-
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
6934
|
-
const value = React67.useMemo(() => context, Object.values(context));
|
|
6935
|
-
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
6936
|
-
};
|
|
6937
|
-
Provider3.displayName = rootComponentName + "Provider";
|
|
6938
|
-
function useContext23(consumerName, scope) {
|
|
6939
|
-
const Context = scope?.[scopeName]?.[index2] || BaseContext;
|
|
6940
|
-
const context = React67.useContext(Context);
|
|
6941
|
-
if (context)
|
|
6942
|
-
return context;
|
|
6943
|
-
if (defaultContext !== void 0)
|
|
6944
|
-
return defaultContext;
|
|
6945
|
-
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
6946
|
-
}
|
|
6947
|
-
return [Provider3, useContext23];
|
|
6948
|
-
}
|
|
6949
|
-
const createScope = () => {
|
|
6950
|
-
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
6951
|
-
return React67.createContext(defaultContext);
|
|
6952
|
-
});
|
|
6953
|
-
return function useScope(scope) {
|
|
6954
|
-
const contexts = scope?.[scopeName] || scopeContexts;
|
|
6955
|
-
return React67.useMemo(
|
|
6956
|
-
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
6957
|
-
[scope, contexts]
|
|
6958
|
-
);
|
|
6959
|
-
};
|
|
6960
|
-
};
|
|
6961
|
-
createScope.scopeName = scopeName;
|
|
6962
|
-
return [createContext32, composeContextScopes2(createScope, ...createContextScopeDeps)];
|
|
6963
|
-
}
|
|
6964
|
-
function composeContextScopes2(...scopes) {
|
|
6965
|
-
const baseScope = scopes[0];
|
|
6966
|
-
if (scopes.length === 1)
|
|
6967
|
-
return baseScope;
|
|
6968
|
-
const createScope = () => {
|
|
6969
|
-
const scopeHooks = scopes.map((createScope2) => ({
|
|
6970
|
-
useScope: createScope2(),
|
|
6971
|
-
scopeName: createScope2.scopeName
|
|
6972
|
-
}));
|
|
6973
|
-
return function useComposedScopes(overrideScopes) {
|
|
6974
|
-
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
6975
|
-
const scopeProps = useScope(overrideScopes);
|
|
6976
|
-
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
6977
|
-
return { ...nextScopes2, ...currentScope };
|
|
6978
|
-
}, {});
|
|
6979
|
-
return React67.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
6980
|
-
};
|
|
6981
|
-
};
|
|
6982
|
-
createScope.scopeName = baseScope.scopeName;
|
|
6983
|
-
return createScope;
|
|
6984
|
-
}
|
|
6985
|
-
var NODES2 = [
|
|
6986
|
-
"a",
|
|
6987
|
-
"button",
|
|
6988
|
-
"div",
|
|
6989
|
-
"form",
|
|
6990
|
-
"h2",
|
|
6991
|
-
"h3",
|
|
6992
|
-
"img",
|
|
6993
|
-
"input",
|
|
6994
|
-
"label",
|
|
6995
|
-
"li",
|
|
6996
|
-
"nav",
|
|
6997
|
-
"ol",
|
|
6998
|
-
"p",
|
|
6999
|
-
"select",
|
|
7000
|
-
"span",
|
|
7001
|
-
"svg",
|
|
7002
|
-
"ul"
|
|
7003
|
-
];
|
|
7004
|
-
var Primitive2 = NODES2.reduce((primitive, node) => {
|
|
7005
|
-
const Slot = createSlot(`Primitive.${node}`);
|
|
7006
|
-
const Node4 = React67.forwardRef((props, forwardedRef) => {
|
|
7007
|
-
const { asChild, ...primitiveProps } = props;
|
|
7008
|
-
const Comp = asChild ? Slot : node;
|
|
7009
|
-
if (typeof window !== "undefined") {
|
|
7010
|
-
window[Symbol.for("radix-ui")] = true;
|
|
7011
|
-
}
|
|
7012
|
-
return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
7013
|
-
});
|
|
7014
|
-
Node4.displayName = `Primitive.${node}`;
|
|
7015
|
-
return { ...primitive, [node]: Node4 };
|
|
7016
|
-
}, {});
|
|
7017
|
-
function dispatchDiscreteCustomEvent(target, event) {
|
|
7018
|
-
if (target)
|
|
7019
|
-
ReactDOM2.flushSync(() => target.dispatchEvent(event));
|
|
7020
|
-
}
|
|
7021
6929
|
var PROGRESS_NAME = "Progress";
|
|
7022
6930
|
var DEFAULT_MAX = 100;
|
|
7023
|
-
var [createProgressContext, createProgressScope] =
|
|
6931
|
+
var [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);
|
|
7024
6932
|
var [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME);
|
|
7025
|
-
var Progress =
|
|
6933
|
+
var Progress = React60.forwardRef(
|
|
7026
6934
|
(props, forwardedRef) => {
|
|
7027
6935
|
const {
|
|
7028
6936
|
__scopeProgress,
|
|
@@ -7041,7 +6949,7 @@ var Progress = React67.forwardRef(
|
|
|
7041
6949
|
const value = isValidValueNumber(valueProp, max2) ? valueProp : null;
|
|
7042
6950
|
const valueLabel = isNumber(value) ? getValueLabel(value, max2) : void 0;
|
|
7043
6951
|
return /* @__PURE__ */ jsx(ProgressProvider, { scope: __scopeProgress, value, max: max2, children: /* @__PURE__ */ jsx(
|
|
7044
|
-
|
|
6952
|
+
Primitive.div,
|
|
7045
6953
|
{
|
|
7046
6954
|
"aria-valuemax": max2,
|
|
7047
6955
|
"aria-valuemin": 0,
|
|
@@ -7059,12 +6967,12 @@ var Progress = React67.forwardRef(
|
|
|
7059
6967
|
);
|
|
7060
6968
|
Progress.displayName = PROGRESS_NAME;
|
|
7061
6969
|
var INDICATOR_NAME = "ProgressIndicator";
|
|
7062
|
-
var ProgressIndicator =
|
|
6970
|
+
var ProgressIndicator = React60.forwardRef(
|
|
7063
6971
|
(props, forwardedRef) => {
|
|
7064
6972
|
const { __scopeProgress, ...indicatorProps } = props;
|
|
7065
6973
|
const context = useProgressContext(INDICATOR_NAME, __scopeProgress);
|
|
7066
6974
|
return /* @__PURE__ */ jsx(
|
|
7067
|
-
|
|
6975
|
+
Primitive.div,
|
|
7068
6976
|
{
|
|
7069
6977
|
"data-state": getProgressState(context.value, context.max),
|
|
7070
6978
|
"data-value": context.value ?? void 0,
|
|
@@ -7104,7 +7012,7 @@ Defaulting to \`null\`.`;
|
|
|
7104
7012
|
}
|
|
7105
7013
|
var Root11 = Progress;
|
|
7106
7014
|
var Indicator2 = ProgressIndicator;
|
|
7107
|
-
var MoonUIProgressPro =
|
|
7015
|
+
var MoonUIProgressPro = React60.forwardRef(({ className, value, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7108
7016
|
Root11,
|
|
7109
7017
|
{
|
|
7110
7018
|
ref,
|
|
@@ -7145,8 +7053,8 @@ var MoonUIradioGroupItemVariantsPro = cva(
|
|
|
7145
7053
|
}
|
|
7146
7054
|
}
|
|
7147
7055
|
);
|
|
7148
|
-
var MoonUIRadioGroupContextPro =
|
|
7149
|
-
var MoonUIRadioGroupPro =
|
|
7056
|
+
var MoonUIRadioGroupContextPro = React60.createContext({});
|
|
7057
|
+
var MoonUIRadioGroupPro = React60.forwardRef(
|
|
7150
7058
|
({ className, value, onValueChange, disabled, name, ...props }, ref) => {
|
|
7151
7059
|
return /* @__PURE__ */ jsx(MoonUIRadioGroupContextPro.Provider, { value: { value, onValueChange, disabled, name }, children: /* @__PURE__ */ jsx(
|
|
7152
7060
|
"div",
|
|
@@ -7160,9 +7068,9 @@ var MoonUIRadioGroupPro = React67.forwardRef(
|
|
|
7160
7068
|
}
|
|
7161
7069
|
);
|
|
7162
7070
|
MoonUIRadioGroupPro.displayName = "RadioGroupPro";
|
|
7163
|
-
var MoonUIRadioGroupItemPro =
|
|
7164
|
-
const radioGroup =
|
|
7165
|
-
const generatedId =
|
|
7071
|
+
var MoonUIRadioGroupItemPro = React60.forwardRef(({ className, variant, size: size4, indicator, id, value, disabled, ...props }, ref) => {
|
|
7072
|
+
const radioGroup = React60.useContext(MoonUIRadioGroupContextPro);
|
|
7073
|
+
const generatedId = React60.useId();
|
|
7166
7074
|
const radioId = id || generatedId;
|
|
7167
7075
|
const isChecked = radioGroup.value === value;
|
|
7168
7076
|
const handleChange = (e) => {
|
|
@@ -7210,7 +7118,7 @@ var MoonUIRadioGroupItemPro = React67.forwardRef(({ className, variant, size: si
|
|
|
7210
7118
|
] });
|
|
7211
7119
|
});
|
|
7212
7120
|
MoonUIRadioGroupItemPro.displayName = "RadioGroupItemPro";
|
|
7213
|
-
var MoonUIRadioLabelPro =
|
|
7121
|
+
var MoonUIRadioLabelPro = React60.forwardRef(
|
|
7214
7122
|
({ className, htmlFor, children, disabled = false, ...props }, ref) => {
|
|
7215
7123
|
return /* @__PURE__ */ jsx(
|
|
7216
7124
|
"label",
|
|
@@ -7229,13 +7137,13 @@ var MoonUIRadioLabelPro = React67.forwardRef(
|
|
|
7229
7137
|
}
|
|
7230
7138
|
);
|
|
7231
7139
|
MoonUIRadioLabelPro.displayName = "RadioLabelPro";
|
|
7232
|
-
var MoonUIRadioItemWithLabelPro =
|
|
7140
|
+
var MoonUIRadioItemWithLabelPro = React60.forwardRef(({
|
|
7233
7141
|
id,
|
|
7234
7142
|
label,
|
|
7235
7143
|
labelClassName,
|
|
7236
7144
|
...radioProps
|
|
7237
7145
|
}, ref) => {
|
|
7238
|
-
const generatedId =
|
|
7146
|
+
const generatedId = React60.useId();
|
|
7239
7147
|
const radioId = id || generatedId;
|
|
7240
7148
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
7241
7149
|
/* @__PURE__ */ jsx(MoonUIRadioGroupItemPro, { ref, id: radioId, ...radioProps }),
|
|
@@ -7251,7 +7159,7 @@ var MoonUIRadioItemWithLabelPro = React67.forwardRef(({
|
|
|
7251
7159
|
] });
|
|
7252
7160
|
});
|
|
7253
7161
|
MoonUIRadioItemWithLabelPro.displayName = "RadioItemWithLabelPro";
|
|
7254
|
-
var ScrollArea =
|
|
7162
|
+
var ScrollArea = React60.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
7255
7163
|
ScrollAreaPrimitive.Root,
|
|
7256
7164
|
{
|
|
7257
7165
|
ref,
|
|
@@ -7265,7 +7173,7 @@ var ScrollArea = React67.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
7265
7173
|
}
|
|
7266
7174
|
));
|
|
7267
7175
|
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
7268
|
-
var ScrollBar =
|
|
7176
|
+
var ScrollBar = React60.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7269
7177
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
7270
7178
|
{
|
|
7271
7179
|
ref,
|
|
@@ -7378,7 +7286,7 @@ var moonUISeparatorVariantsPro = cva(
|
|
|
7378
7286
|
}
|
|
7379
7287
|
}
|
|
7380
7288
|
);
|
|
7381
|
-
var MoonUISeparatorPro =
|
|
7289
|
+
var MoonUISeparatorPro = React60.forwardRef(
|
|
7382
7290
|
({
|
|
7383
7291
|
className,
|
|
7384
7292
|
orientation = "horizontal",
|
|
@@ -7405,7 +7313,7 @@ var Sheet = DialogPrimitive.Root;
|
|
|
7405
7313
|
var SheetTrigger = DialogPrimitive.Trigger;
|
|
7406
7314
|
var SheetClose = DialogPrimitive.Close;
|
|
7407
7315
|
var SheetPortal = DialogPrimitive.Portal;
|
|
7408
|
-
var SheetOverlay =
|
|
7316
|
+
var SheetOverlay = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7409
7317
|
DialogPrimitive.Overlay,
|
|
7410
7318
|
{
|
|
7411
7319
|
className: cn(
|
|
@@ -7433,7 +7341,7 @@ var sheetVariants = cva(
|
|
|
7433
7341
|
}
|
|
7434
7342
|
}
|
|
7435
7343
|
);
|
|
7436
|
-
var SheetContent =
|
|
7344
|
+
var SheetContent = React60.forwardRef(({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
7437
7345
|
/* @__PURE__ */ jsx(SheetOverlay, {}),
|
|
7438
7346
|
/* @__PURE__ */ jsxs(
|
|
7439
7347
|
DialogPrimitive.Content,
|
|
@@ -7480,7 +7388,7 @@ var SheetFooter = ({
|
|
|
7480
7388
|
}
|
|
7481
7389
|
);
|
|
7482
7390
|
SheetFooter.displayName = "SheetFooter";
|
|
7483
|
-
var SheetTitle =
|
|
7391
|
+
var SheetTitle = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7484
7392
|
DialogPrimitive.Title,
|
|
7485
7393
|
{
|
|
7486
7394
|
ref,
|
|
@@ -7489,7 +7397,7 @@ var SheetTitle = React67.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
7489
7397
|
}
|
|
7490
7398
|
));
|
|
7491
7399
|
SheetTitle.displayName = DialogPrimitive.Title.displayName;
|
|
7492
|
-
var SheetDescription =
|
|
7400
|
+
var SheetDescription = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7493
7401
|
DialogPrimitive.Description,
|
|
7494
7402
|
{
|
|
7495
7403
|
ref,
|
|
@@ -7590,7 +7498,7 @@ var sliderThumbVariants = cva(
|
|
|
7590
7498
|
}
|
|
7591
7499
|
}
|
|
7592
7500
|
);
|
|
7593
|
-
var MoonUISliderPro =
|
|
7501
|
+
var MoonUISliderPro = React60.forwardRef(({
|
|
7594
7502
|
className,
|
|
7595
7503
|
size: size4,
|
|
7596
7504
|
trackVariant,
|
|
@@ -7606,10 +7514,10 @@ var MoonUISliderPro = React67.forwardRef(({
|
|
|
7606
7514
|
disabled,
|
|
7607
7515
|
...props
|
|
7608
7516
|
}, ref) => {
|
|
7609
|
-
const [sliderValue, setSliderValue] =
|
|
7517
|
+
const [sliderValue, setSliderValue] = React60.useState(
|
|
7610
7518
|
value || defaultValue2 || [0]
|
|
7611
7519
|
);
|
|
7612
|
-
|
|
7520
|
+
React60.useEffect(() => {
|
|
7613
7521
|
if (value !== void 0) {
|
|
7614
7522
|
setSliderValue(value);
|
|
7615
7523
|
}
|
|
@@ -7624,7 +7532,7 @@ var MoonUISliderPro = React67.forwardRef(({
|
|
|
7624
7532
|
const calculateThumbPercent = (value2, min3, max3) => {
|
|
7625
7533
|
return (value2 - min3) / (max3 - min3) * 100;
|
|
7626
7534
|
};
|
|
7627
|
-
const trackRef =
|
|
7535
|
+
const trackRef = React60.useRef(null);
|
|
7628
7536
|
const min2 = props.min || 0;
|
|
7629
7537
|
const max2 = props.max || 100;
|
|
7630
7538
|
const step = props.step || 1;
|
|
@@ -7745,7 +7653,7 @@ var MoonUISliderPro = React67.forwardRef(({
|
|
|
7745
7653
|
] });
|
|
7746
7654
|
});
|
|
7747
7655
|
MoonUISliderPro.displayName = "MoonUISliderPro";
|
|
7748
|
-
var MoonUISwitchPro =
|
|
7656
|
+
var MoonUISwitchPro = React60.forwardRef(({ className, size: size4 = "md", variant = "primary", loading, leftIcon, rightIcon, description, ...props }, ref) => /* @__PURE__ */ jsxs("div", { className: "inline-flex items-center gap-2", children: [
|
|
7749
7657
|
leftIcon && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: leftIcon }),
|
|
7750
7658
|
/* @__PURE__ */ jsxs(
|
|
7751
7659
|
SwitchPrimitives.Root,
|
|
@@ -7815,7 +7723,7 @@ var MoonUItableVariantsPro = cva(
|
|
|
7815
7723
|
}
|
|
7816
7724
|
}
|
|
7817
7725
|
);
|
|
7818
|
-
var MoonUITablePro =
|
|
7726
|
+
var MoonUITablePro = React60.forwardRef(({
|
|
7819
7727
|
className,
|
|
7820
7728
|
variant,
|
|
7821
7729
|
size: size4,
|
|
@@ -7832,11 +7740,11 @@ var MoonUITablePro = React67.forwardRef(({
|
|
|
7832
7740
|
...props
|
|
7833
7741
|
}, ref) => {
|
|
7834
7742
|
const MoonUIstripedPro = variant === "striped";
|
|
7835
|
-
const MoonUIchildrenWithPropsPro =
|
|
7836
|
-
if (
|
|
7743
|
+
const MoonUIchildrenWithPropsPro = React60.Children.map(props.children, (child) => {
|
|
7744
|
+
if (React60.isValidElement(child)) {
|
|
7837
7745
|
if (child.type === "tbody") {
|
|
7838
7746
|
const MoonUItbodyPropsPro = child.props;
|
|
7839
|
-
return
|
|
7747
|
+
return React60.cloneElement(child, {
|
|
7840
7748
|
className: cn(MoonUItbodyPropsPro.className, MoonUIstripedPro && "even:[&>tr]:bg-muted/50")
|
|
7841
7749
|
});
|
|
7842
7750
|
}
|
|
@@ -7861,10 +7769,10 @@ var MoonUITablePro = React67.forwardRef(({
|
|
|
7861
7769
|
] });
|
|
7862
7770
|
});
|
|
7863
7771
|
MoonUITablePro.displayName = "TablePro";
|
|
7864
|
-
var MoonUITableHeaderPro =
|
|
7772
|
+
var MoonUITableHeaderPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
7865
7773
|
MoonUITableHeaderPro.displayName = "TableHeaderPro";
|
|
7866
|
-
var MoonUITableBodyPro =
|
|
7867
|
-
const MoonUIhasChildrenPro =
|
|
7774
|
+
var MoonUITableBodyPro = React60.forwardRef(({ className, emptyContent, emptyMessage = "No data available", children, ...props }, ref) => {
|
|
7775
|
+
const MoonUIhasChildrenPro = React60.Children.count(children) > 0;
|
|
7868
7776
|
return /* @__PURE__ */ jsx(
|
|
7869
7777
|
"tbody",
|
|
7870
7778
|
{
|
|
@@ -7876,7 +7784,7 @@ var MoonUITableBodyPro = React67.forwardRef(({ className, emptyContent, emptyMes
|
|
|
7876
7784
|
);
|
|
7877
7785
|
});
|
|
7878
7786
|
MoonUITableBodyPro.displayName = "TableBodyPro";
|
|
7879
|
-
var MoonUITableFooterPro =
|
|
7787
|
+
var MoonUITableFooterPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7880
7788
|
"tfoot",
|
|
7881
7789
|
{
|
|
7882
7790
|
ref,
|
|
@@ -7885,7 +7793,7 @@ var MoonUITableFooterPro = React67.forwardRef(({ className, ...props }, ref) =>
|
|
|
7885
7793
|
}
|
|
7886
7794
|
));
|
|
7887
7795
|
MoonUITableFooterPro.displayName = "TableFooterPro";
|
|
7888
|
-
var MoonUITableRowPro =
|
|
7796
|
+
var MoonUITableRowPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7889
7797
|
"tr",
|
|
7890
7798
|
{
|
|
7891
7799
|
ref,
|
|
@@ -7897,7 +7805,7 @@ var MoonUITableRowPro = React67.forwardRef(({ className, ...props }, ref) => /*
|
|
|
7897
7805
|
}
|
|
7898
7806
|
));
|
|
7899
7807
|
MoonUITableRowPro.displayName = "TableRowPro";
|
|
7900
|
-
var MoonUITableHeadPro =
|
|
7808
|
+
var MoonUITableHeadPro = React60.forwardRef(
|
|
7901
7809
|
({ className, sortable, sorted, onSort, children, ...props }, ref) => {
|
|
7902
7810
|
const MoonUIrenderSortIconPro = () => {
|
|
7903
7811
|
if (!sortable)
|
|
@@ -7978,7 +7886,7 @@ var MoonUITableHeadPro = React67.forwardRef(
|
|
|
7978
7886
|
}
|
|
7979
7887
|
);
|
|
7980
7888
|
MoonUITableHeadPro.displayName = "TableHeadPro";
|
|
7981
|
-
var MoonUITableCellPro =
|
|
7889
|
+
var MoonUITableCellPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7982
7890
|
"td",
|
|
7983
7891
|
{
|
|
7984
7892
|
ref,
|
|
@@ -7987,7 +7895,7 @@ var MoonUITableCellPro = React67.forwardRef(({ className, ...props }, ref) => /*
|
|
|
7987
7895
|
}
|
|
7988
7896
|
));
|
|
7989
7897
|
MoonUITableCellPro.displayName = "TableCellPro";
|
|
7990
|
-
var MoonUITableCaptionPro =
|
|
7898
|
+
var MoonUITableCaptionPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
7991
7899
|
"caption",
|
|
7992
7900
|
{
|
|
7993
7901
|
ref,
|
|
@@ -7997,7 +7905,7 @@ var MoonUITableCaptionPro = React67.forwardRef(({ className, ...props }, ref) =>
|
|
|
7997
7905
|
));
|
|
7998
7906
|
MoonUITableCaptionPro.displayName = "TableCaptionPro";
|
|
7999
7907
|
var Tabs = TabsPrimitive2.Root;
|
|
8000
|
-
var TabsList =
|
|
7908
|
+
var TabsList = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8001
7909
|
TabsPrimitive2.List,
|
|
8002
7910
|
{
|
|
8003
7911
|
ref,
|
|
@@ -8009,7 +7917,7 @@ var TabsList = React67.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
8009
7917
|
}
|
|
8010
7918
|
));
|
|
8011
7919
|
TabsList.displayName = TabsPrimitive2.List.displayName;
|
|
8012
|
-
var TabsTrigger =
|
|
7920
|
+
var TabsTrigger = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8013
7921
|
TabsPrimitive2.Trigger,
|
|
8014
7922
|
{
|
|
8015
7923
|
ref,
|
|
@@ -8021,7 +7929,7 @@ var TabsTrigger = React67.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
8021
7929
|
}
|
|
8022
7930
|
));
|
|
8023
7931
|
TabsTrigger.displayName = TabsPrimitive2.Trigger.displayName;
|
|
8024
|
-
var TabsContent =
|
|
7932
|
+
var TabsContent = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8025
7933
|
TabsPrimitive2.Content,
|
|
8026
7934
|
{
|
|
8027
7935
|
ref,
|
|
@@ -8060,7 +7968,7 @@ var contentVariants = {
|
|
|
8060
7968
|
exit: { scale: 1.2, opacity: 0, filter: "blur(10px)" }
|
|
8061
7969
|
}
|
|
8062
7970
|
};
|
|
8063
|
-
var MoonUITabsPro =
|
|
7971
|
+
var MoonUITabsPro = React60.forwardRef(({
|
|
8064
7972
|
variant = "default",
|
|
8065
7973
|
animationMode = "fade",
|
|
8066
7974
|
orientation = "horizontal",
|
|
@@ -8089,8 +7997,8 @@ var MoonUITabsPro = React67.forwardRef(({
|
|
|
8089
7997
|
onValueChange,
|
|
8090
7998
|
...props
|
|
8091
7999
|
}, ref) => {
|
|
8092
|
-
const [items, setItems] =
|
|
8093
|
-
const [localValue, setLocalValue] =
|
|
8000
|
+
const [items, setItems] = React60.useState(initialItems);
|
|
8001
|
+
const [localValue, setLocalValue] = React60.useState(() => {
|
|
8094
8002
|
if (persistKey && typeof window !== "undefined") {
|
|
8095
8003
|
const stored = localStorage.getItem(`tabs-${persistKey}`);
|
|
8096
8004
|
if (stored) {
|
|
@@ -8106,11 +8014,11 @@ var MoonUITabsPro = React67.forwardRef(({
|
|
|
8106
8014
|
}
|
|
8107
8015
|
return defaultValue2 || items[0]?.value;
|
|
8108
8016
|
});
|
|
8109
|
-
const [loadedTabs, setLoadedTabs] =
|
|
8110
|
-
const [isChanging, setIsChanging] =
|
|
8111
|
-
const scrollRef =
|
|
8017
|
+
const [loadedTabs, setLoadedTabs] = React60.useState(/* @__PURE__ */ new Set());
|
|
8018
|
+
const [isChanging, setIsChanging] = React60.useState(false);
|
|
8019
|
+
const scrollRef = React60.useRef(null);
|
|
8112
8020
|
const value = controlledValue !== void 0 ? controlledValue : localValue;
|
|
8113
|
-
const handleValueChange =
|
|
8021
|
+
const handleValueChange = React60.useCallback(async (newValue) => {
|
|
8114
8022
|
if (loading || isChanging)
|
|
8115
8023
|
return;
|
|
8116
8024
|
if (onBeforeChange) {
|
|
@@ -8138,7 +8046,7 @@ var MoonUITabsPro = React67.forwardRef(({
|
|
|
8138
8046
|
window.history.replaceState({}, "", `${window.location.pathname}?${params}`);
|
|
8139
8047
|
}
|
|
8140
8048
|
}, [value, loading, isChanging, onBeforeChange, onValueChange, lazy, loadedTabs, onAnalytics, persistKey, items, urlSync]);
|
|
8141
|
-
const handleTabClose =
|
|
8049
|
+
const handleTabClose = React60.useCallback((tabValue, e) => {
|
|
8142
8050
|
e.stopPropagation();
|
|
8143
8051
|
const newItems = items.filter((item) => item.value !== tabValue);
|
|
8144
8052
|
setItems(newItems);
|
|
@@ -8149,7 +8057,7 @@ var MoonUITabsPro = React67.forwardRef(({
|
|
|
8149
8057
|
handleValueChange(newItems[0].value);
|
|
8150
8058
|
}
|
|
8151
8059
|
}, [items, value, onTabsChange, onTabClose, onAnalytics, handleValueChange]);
|
|
8152
|
-
const handleTabAdd =
|
|
8060
|
+
const handleTabAdd = React60.useCallback(() => {
|
|
8153
8061
|
if (maxTabs && items.length >= maxTabs) {
|
|
8154
8062
|
onAnalytics?.("tab_add_blocked", { reason: "max_tabs" });
|
|
8155
8063
|
return;
|
|
@@ -8157,7 +8065,7 @@ var MoonUITabsPro = React67.forwardRef(({
|
|
|
8157
8065
|
onTabAdd?.();
|
|
8158
8066
|
onAnalytics?.("tab_add", { count: items.length + 1 });
|
|
8159
8067
|
}, [items.length, maxTabs, onTabAdd, onAnalytics]);
|
|
8160
|
-
|
|
8068
|
+
React60.useEffect(() => {
|
|
8161
8069
|
if (!shortcuts)
|
|
8162
8070
|
return;
|
|
8163
8071
|
const handleKeyDown3 = (e) => {
|
|
@@ -8387,7 +8295,7 @@ var MoonUITabsPro = React67.forwardRef(({
|
|
|
8387
8295
|
] });
|
|
8388
8296
|
});
|
|
8389
8297
|
MoonUITabsPro.displayName = "MoonUITabsPro";
|
|
8390
|
-
var MoonUITabsListPro =
|
|
8298
|
+
var MoonUITabsListPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8391
8299
|
TabsPrimitive2.List,
|
|
8392
8300
|
{
|
|
8393
8301
|
ref,
|
|
@@ -8399,7 +8307,7 @@ var MoonUITabsListPro = React67.forwardRef(({ className, ...props }, ref) => /*
|
|
|
8399
8307
|
}
|
|
8400
8308
|
));
|
|
8401
8309
|
MoonUITabsListPro.displayName = "MoonUITabsListPro";
|
|
8402
|
-
var MoonUITabsTriggerPro =
|
|
8310
|
+
var MoonUITabsTriggerPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8403
8311
|
TabsPrimitive2.Trigger,
|
|
8404
8312
|
{
|
|
8405
8313
|
ref,
|
|
@@ -8411,7 +8319,7 @@ var MoonUITabsTriggerPro = React67.forwardRef(({ className, ...props }, ref) =>
|
|
|
8411
8319
|
}
|
|
8412
8320
|
));
|
|
8413
8321
|
MoonUITabsTriggerPro.displayName = "MoonUITabsTriggerPro";
|
|
8414
|
-
var MoonUITabsContentPro =
|
|
8322
|
+
var MoonUITabsContentPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8415
8323
|
TabsPrimitive2.Content,
|
|
8416
8324
|
{
|
|
8417
8325
|
ref,
|
|
@@ -8423,7 +8331,7 @@ var MoonUITabsContentPro = React67.forwardRef(({ className, ...props }, ref) =>
|
|
|
8423
8331
|
}
|
|
8424
8332
|
));
|
|
8425
8333
|
MoonUITabsContentPro.displayName = "MoonUITabsContentPro";
|
|
8426
|
-
var MoonUITextareaPro =
|
|
8334
|
+
var MoonUITextareaPro = React60__default.forwardRef(
|
|
8427
8335
|
({ className, ...props }, ref) => {
|
|
8428
8336
|
return /* @__PURE__ */ jsx(
|
|
8429
8337
|
"textarea",
|
|
@@ -8439,7 +8347,7 @@ var MoonUITextareaPro = React67__default.forwardRef(
|
|
|
8439
8347
|
}
|
|
8440
8348
|
);
|
|
8441
8349
|
MoonUITextareaPro.displayName = "MoonUITextareaPro";
|
|
8442
|
-
var MoonUIToastViewportPro =
|
|
8350
|
+
var MoonUIToastViewportPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8443
8351
|
ToastPrimitives.Viewport,
|
|
8444
8352
|
{
|
|
8445
8353
|
ref,
|
|
@@ -8468,7 +8376,7 @@ var moonUIToastVariantsPro = cva(
|
|
|
8468
8376
|
}
|
|
8469
8377
|
}
|
|
8470
8378
|
);
|
|
8471
|
-
var MoonUIToastPro =
|
|
8379
|
+
var MoonUIToastPro = React60.forwardRef(({ className, variant, ...props }, ref) => {
|
|
8472
8380
|
return /* @__PURE__ */ jsx(
|
|
8473
8381
|
ToastPrimitives.Root,
|
|
8474
8382
|
{
|
|
@@ -8479,7 +8387,7 @@ var MoonUIToastPro = React67.forwardRef(({ className, variant, ...props }, ref)
|
|
|
8479
8387
|
);
|
|
8480
8388
|
});
|
|
8481
8389
|
MoonUIToastPro.displayName = ToastPrimitives.Root.displayName;
|
|
8482
|
-
var MoonUIToastActionPro =
|
|
8390
|
+
var MoonUIToastActionPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8483
8391
|
ToastPrimitives.Action,
|
|
8484
8392
|
{
|
|
8485
8393
|
ref,
|
|
@@ -8491,7 +8399,7 @@ var MoonUIToastActionPro = React67.forwardRef(({ className, ...props }, ref) =>
|
|
|
8491
8399
|
}
|
|
8492
8400
|
));
|
|
8493
8401
|
MoonUIToastActionPro.displayName = ToastPrimitives.Action.displayName;
|
|
8494
|
-
var MoonUIToastClosePro =
|
|
8402
|
+
var MoonUIToastClosePro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8495
8403
|
ToastPrimitives.Close,
|
|
8496
8404
|
{
|
|
8497
8405
|
ref,
|
|
@@ -8505,7 +8413,7 @@ var MoonUIToastClosePro = React67.forwardRef(({ className, ...props }, ref) => /
|
|
|
8505
8413
|
}
|
|
8506
8414
|
));
|
|
8507
8415
|
MoonUIToastClosePro.displayName = ToastPrimitives.Close.displayName;
|
|
8508
|
-
var MoonUIToastTitlePro =
|
|
8416
|
+
var MoonUIToastTitlePro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8509
8417
|
ToastPrimitives.Title,
|
|
8510
8418
|
{
|
|
8511
8419
|
ref,
|
|
@@ -8514,7 +8422,7 @@ var MoonUIToastTitlePro = React67.forwardRef(({ className, ...props }, ref) => /
|
|
|
8514
8422
|
}
|
|
8515
8423
|
));
|
|
8516
8424
|
MoonUIToastTitlePro.displayName = ToastPrimitives.Title.displayName;
|
|
8517
|
-
var MoonUIToastDescriptionPro =
|
|
8425
|
+
var MoonUIToastDescriptionPro = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
8518
8426
|
ToastPrimitives.Description,
|
|
8519
8427
|
{
|
|
8520
8428
|
ref,
|
|
@@ -8621,93 +8529,17 @@ function toast({ ...props }) {
|
|
|
8621
8529
|
update
|
|
8622
8530
|
};
|
|
8623
8531
|
}
|
|
8624
|
-
|
|
8625
|
-
// ../../node_modules/@radix-ui/primitive/dist/index.mjs
|
|
8626
|
-
function composeEventHandlers2(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
8627
|
-
return function handleEvent(event) {
|
|
8628
|
-
originalEventHandler?.(event);
|
|
8629
|
-
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
8630
|
-
return ourEventHandler?.(event);
|
|
8631
|
-
}
|
|
8632
|
-
};
|
|
8633
|
-
}
|
|
8634
|
-
var useLayoutEffect22 = globalThis?.document ? React67.useLayoutEffect : () => {
|
|
8635
|
-
};
|
|
8636
|
-
var useInsertionEffect2 = React67[" useInsertionEffect ".trim().toString()] || useLayoutEffect22;
|
|
8637
|
-
function useControllableState2({
|
|
8638
|
-
prop,
|
|
8639
|
-
defaultProp,
|
|
8640
|
-
onChange = () => {
|
|
8641
|
-
},
|
|
8642
|
-
caller
|
|
8643
|
-
}) {
|
|
8644
|
-
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState2({
|
|
8645
|
-
defaultProp,
|
|
8646
|
-
onChange
|
|
8647
|
-
});
|
|
8648
|
-
const isControlled = prop !== void 0;
|
|
8649
|
-
const value = isControlled ? prop : uncontrolledProp;
|
|
8650
|
-
{
|
|
8651
|
-
const isControlledRef = React67.useRef(prop !== void 0);
|
|
8652
|
-
React67.useEffect(() => {
|
|
8653
|
-
const wasControlled = isControlledRef.current;
|
|
8654
|
-
if (wasControlled !== isControlled) {
|
|
8655
|
-
const from2 = wasControlled ? "controlled" : "uncontrolled";
|
|
8656
|
-
const to = isControlled ? "controlled" : "uncontrolled";
|
|
8657
|
-
console.warn(
|
|
8658
|
-
`${caller} is changing from ${from2} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
8659
|
-
);
|
|
8660
|
-
}
|
|
8661
|
-
isControlledRef.current = isControlled;
|
|
8662
|
-
}, [isControlled, caller]);
|
|
8663
|
-
}
|
|
8664
|
-
const setValue = React67.useCallback(
|
|
8665
|
-
(nextValue) => {
|
|
8666
|
-
if (isControlled) {
|
|
8667
|
-
const value2 = isFunction2(nextValue) ? nextValue(prop) : nextValue;
|
|
8668
|
-
if (value2 !== prop) {
|
|
8669
|
-
onChangeRef.current?.(value2);
|
|
8670
|
-
}
|
|
8671
|
-
} else {
|
|
8672
|
-
setUncontrolledProp(nextValue);
|
|
8673
|
-
}
|
|
8674
|
-
},
|
|
8675
|
-
[isControlled, prop, setUncontrolledProp, onChangeRef]
|
|
8676
|
-
);
|
|
8677
|
-
return [value, setValue];
|
|
8678
|
-
}
|
|
8679
|
-
function useUncontrolledState2({
|
|
8680
|
-
defaultProp,
|
|
8681
|
-
onChange
|
|
8682
|
-
}) {
|
|
8683
|
-
const [value, setValue] = React67.useState(defaultProp);
|
|
8684
|
-
const prevValueRef = React67.useRef(value);
|
|
8685
|
-
const onChangeRef = React67.useRef(onChange);
|
|
8686
|
-
useInsertionEffect2(() => {
|
|
8687
|
-
onChangeRef.current = onChange;
|
|
8688
|
-
}, [onChange]);
|
|
8689
|
-
React67.useEffect(() => {
|
|
8690
|
-
if (prevValueRef.current !== value) {
|
|
8691
|
-
onChangeRef.current?.(value);
|
|
8692
|
-
prevValueRef.current = value;
|
|
8693
|
-
}
|
|
8694
|
-
}, [value, prevValueRef]);
|
|
8695
|
-
return [value, setValue, onChangeRef];
|
|
8696
|
-
}
|
|
8697
|
-
function isFunction2(value) {
|
|
8698
|
-
return typeof value === "function";
|
|
8699
|
-
}
|
|
8700
8532
|
var NAME = "Toggle";
|
|
8701
|
-
var Toggle =
|
|
8533
|
+
var Toggle = React60.forwardRef((props, forwardedRef) => {
|
|
8702
8534
|
const { pressed: pressedProp, defaultPressed, onPressedChange, ...buttonProps } = props;
|
|
8703
|
-
const [pressed, setPressed] =
|
|
8535
|
+
const [pressed, setPressed] = useControllableState({
|
|
8704
8536
|
prop: pressedProp,
|
|
8705
8537
|
onChange: onPressedChange,
|
|
8706
8538
|
defaultProp: defaultPressed ?? false,
|
|
8707
8539
|
caller: NAME
|
|
8708
8540
|
});
|
|
8709
8541
|
return /* @__PURE__ */ jsx(
|
|
8710
|
-
|
|
8542
|
+
Primitive.button,
|
|
8711
8543
|
{
|
|
8712
8544
|
type: "button",
|
|
8713
8545
|
"aria-pressed": pressed,
|
|
@@ -8715,7 +8547,7 @@ var Toggle = React67.forwardRef((props, forwardedRef) => {
|
|
|
8715
8547
|
"data-disabled": props.disabled ? "" : void 0,
|
|
8716
8548
|
...buttonProps,
|
|
8717
8549
|
ref: forwardedRef,
|
|
8718
|
-
onClick:
|
|
8550
|
+
onClick: composeEventHandlers(props.onClick, () => {
|
|
8719
8551
|
if (!props.disabled) {
|
|
8720
8552
|
setPressed(!pressed);
|
|
8721
8553
|
}
|
|
@@ -8762,7 +8594,7 @@ var MoonUItoggleVariantsPro = cva(
|
|
|
8762
8594
|
}
|
|
8763
8595
|
}
|
|
8764
8596
|
);
|
|
8765
|
-
var MoonUITogglePro =
|
|
8597
|
+
var MoonUITogglePro = React60.forwardRef(({ className, variant, size: size4, shape, loading, badge, badgeVariant = "default", iconOn, iconOff, iconPosition = "left", children, pressed, onPressedChange, defaultPressed, ...props }, ref) => {
|
|
8766
8598
|
const icon = pressed ? iconOn : iconOff;
|
|
8767
8599
|
return /* @__PURE__ */ jsx(
|
|
8768
8600
|
Root19,
|
|
@@ -8795,40 +8627,6 @@ var MoonUITogglePro = React67.forwardRef(({ className, variant, size: size4, sha
|
|
|
8795
8627
|
);
|
|
8796
8628
|
});
|
|
8797
8629
|
MoonUITogglePro.displayName = Root19.displayName;
|
|
8798
|
-
function setRef2(ref, value) {
|
|
8799
|
-
if (typeof ref === "function") {
|
|
8800
|
-
return ref(value);
|
|
8801
|
-
} else if (ref !== null && ref !== void 0) {
|
|
8802
|
-
ref.current = value;
|
|
8803
|
-
}
|
|
8804
|
-
}
|
|
8805
|
-
function composeRefs2(...refs) {
|
|
8806
|
-
return (node) => {
|
|
8807
|
-
let hasCleanup = false;
|
|
8808
|
-
const cleanups = refs.map((ref) => {
|
|
8809
|
-
const cleanup = setRef2(ref, node);
|
|
8810
|
-
if (!hasCleanup && typeof cleanup == "function") {
|
|
8811
|
-
hasCleanup = true;
|
|
8812
|
-
}
|
|
8813
|
-
return cleanup;
|
|
8814
|
-
});
|
|
8815
|
-
if (hasCleanup) {
|
|
8816
|
-
return () => {
|
|
8817
|
-
for (let i = 0; i < cleanups.length; i++) {
|
|
8818
|
-
const cleanup = cleanups[i];
|
|
8819
|
-
if (typeof cleanup == "function") {
|
|
8820
|
-
cleanup();
|
|
8821
|
-
} else {
|
|
8822
|
-
setRef2(refs[i], null);
|
|
8823
|
-
}
|
|
8824
|
-
}
|
|
8825
|
-
};
|
|
8826
|
-
}
|
|
8827
|
-
};
|
|
8828
|
-
}
|
|
8829
|
-
function useComposedRefs2(...refs) {
|
|
8830
|
-
return React67.useCallback(composeRefs2(...refs), refs);
|
|
8831
|
-
}
|
|
8832
8630
|
|
|
8833
8631
|
// ../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
8834
8632
|
var sides = ["top", "right", "bottom", "left"];
|
|
@@ -10493,7 +10291,7 @@ function roundByDPR(element, value) {
|
|
|
10493
10291
|
return Math.round(value * dpr) / dpr;
|
|
10494
10292
|
}
|
|
10495
10293
|
function useLatestRef(value) {
|
|
10496
|
-
const ref =
|
|
10294
|
+
const ref = React60.useRef(value);
|
|
10497
10295
|
index(() => {
|
|
10498
10296
|
ref.current = value;
|
|
10499
10297
|
});
|
|
@@ -10516,7 +10314,7 @@ function useFloating(options) {
|
|
|
10516
10314
|
whileElementsMounted,
|
|
10517
10315
|
open
|
|
10518
10316
|
} = options;
|
|
10519
|
-
const [data, setData] =
|
|
10317
|
+
const [data, setData] = React60.useState({
|
|
10520
10318
|
x: 0,
|
|
10521
10319
|
y: 0,
|
|
10522
10320
|
strategy,
|
|
@@ -10524,19 +10322,19 @@ function useFloating(options) {
|
|
|
10524
10322
|
middlewareData: {},
|
|
10525
10323
|
isPositioned: false
|
|
10526
10324
|
});
|
|
10527
|
-
const [latestMiddleware, setLatestMiddleware] =
|
|
10325
|
+
const [latestMiddleware, setLatestMiddleware] = React60.useState(middleware);
|
|
10528
10326
|
if (!deepEqual(latestMiddleware, middleware)) {
|
|
10529
10327
|
setLatestMiddleware(middleware);
|
|
10530
10328
|
}
|
|
10531
|
-
const [_reference, _setReference] =
|
|
10532
|
-
const [_floating, _setFloating] =
|
|
10533
|
-
const setReference =
|
|
10329
|
+
const [_reference, _setReference] = React60.useState(null);
|
|
10330
|
+
const [_floating, _setFloating] = React60.useState(null);
|
|
10331
|
+
const setReference = React60.useCallback((node) => {
|
|
10534
10332
|
if (node !== referenceRef.current) {
|
|
10535
10333
|
referenceRef.current = node;
|
|
10536
10334
|
_setReference(node);
|
|
10537
10335
|
}
|
|
10538
10336
|
}, []);
|
|
10539
|
-
const setFloating =
|
|
10337
|
+
const setFloating = React60.useCallback((node) => {
|
|
10540
10338
|
if (node !== floatingRef.current) {
|
|
10541
10339
|
floatingRef.current = node;
|
|
10542
10340
|
_setFloating(node);
|
|
@@ -10544,14 +10342,14 @@ function useFloating(options) {
|
|
|
10544
10342
|
}, []);
|
|
10545
10343
|
const referenceEl = externalReference || _reference;
|
|
10546
10344
|
const floatingEl = externalFloating || _floating;
|
|
10547
|
-
const referenceRef =
|
|
10548
|
-
const floatingRef =
|
|
10549
|
-
const dataRef =
|
|
10345
|
+
const referenceRef = React60.useRef(null);
|
|
10346
|
+
const floatingRef = React60.useRef(null);
|
|
10347
|
+
const dataRef = React60.useRef(data);
|
|
10550
10348
|
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
10551
10349
|
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
10552
10350
|
const platformRef = useLatestRef(platform2);
|
|
10553
10351
|
const openRef = useLatestRef(open);
|
|
10554
|
-
const update =
|
|
10352
|
+
const update = React60.useCallback(() => {
|
|
10555
10353
|
if (!referenceRef.current || !floatingRef.current) {
|
|
10556
10354
|
return;
|
|
10557
10355
|
}
|
|
@@ -10574,7 +10372,7 @@ function useFloating(options) {
|
|
|
10574
10372
|
};
|
|
10575
10373
|
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
|
|
10576
10374
|
dataRef.current = fullData;
|
|
10577
|
-
|
|
10375
|
+
ReactDOM.flushSync(() => {
|
|
10578
10376
|
setData(fullData);
|
|
10579
10377
|
});
|
|
10580
10378
|
}
|
|
@@ -10589,7 +10387,7 @@ function useFloating(options) {
|
|
|
10589
10387
|
}));
|
|
10590
10388
|
}
|
|
10591
10389
|
}, [open]);
|
|
10592
|
-
const isMountedRef =
|
|
10390
|
+
const isMountedRef = React60.useRef(false);
|
|
10593
10391
|
index(() => {
|
|
10594
10392
|
isMountedRef.current = true;
|
|
10595
10393
|
return () => {
|
|
@@ -10608,17 +10406,17 @@ function useFloating(options) {
|
|
|
10608
10406
|
update();
|
|
10609
10407
|
}
|
|
10610
10408
|
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
10611
|
-
const refs =
|
|
10409
|
+
const refs = React60.useMemo(() => ({
|
|
10612
10410
|
reference: referenceRef,
|
|
10613
10411
|
floating: floatingRef,
|
|
10614
10412
|
setReference,
|
|
10615
10413
|
setFloating
|
|
10616
10414
|
}), [setReference, setFloating]);
|
|
10617
|
-
const elements =
|
|
10415
|
+
const elements = React60.useMemo(() => ({
|
|
10618
10416
|
reference: referenceEl,
|
|
10619
10417
|
floating: floatingEl
|
|
10620
10418
|
}), [referenceEl, floatingEl]);
|
|
10621
|
-
const floatingStyles =
|
|
10419
|
+
const floatingStyles = React60.useMemo(() => {
|
|
10622
10420
|
const initialStyles = {
|
|
10623
10421
|
position: strategy,
|
|
10624
10422
|
left: 0,
|
|
@@ -10644,7 +10442,7 @@ function useFloating(options) {
|
|
|
10644
10442
|
top: y
|
|
10645
10443
|
};
|
|
10646
10444
|
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
10647
|
-
return
|
|
10445
|
+
return React60.useMemo(() => ({
|
|
10648
10446
|
...data,
|
|
10649
10447
|
update,
|
|
10650
10448
|
refs,
|
|
@@ -10712,10 +10510,10 @@ var arrow3 = (options, deps) => ({
|
|
|
10712
10510
|
options: [options, deps]
|
|
10713
10511
|
});
|
|
10714
10512
|
var NAME2 = "Arrow";
|
|
10715
|
-
var Arrow2 =
|
|
10513
|
+
var Arrow2 = React60.forwardRef((props, forwardedRef) => {
|
|
10716
10514
|
const { children, width = 10, height = 5, ...arrowProps } = props;
|
|
10717
10515
|
return /* @__PURE__ */ jsx(
|
|
10718
|
-
|
|
10516
|
+
Primitive.svg,
|
|
10719
10517
|
{
|
|
10720
10518
|
...arrowProps,
|
|
10721
10519
|
ref: forwardedRef,
|
|
@@ -10730,15 +10528,15 @@ var Arrow2 = React67.forwardRef((props, forwardedRef) => {
|
|
|
10730
10528
|
Arrow2.displayName = NAME2;
|
|
10731
10529
|
var Root20 = Arrow2;
|
|
10732
10530
|
function useCallbackRef(callback) {
|
|
10733
|
-
const callbackRef =
|
|
10734
|
-
|
|
10531
|
+
const callbackRef = React60.useRef(callback);
|
|
10532
|
+
React60.useEffect(() => {
|
|
10735
10533
|
callbackRef.current = callback;
|
|
10736
10534
|
});
|
|
10737
|
-
return
|
|
10535
|
+
return React60.useMemo(() => (...args) => callbackRef.current?.(...args), []);
|
|
10738
10536
|
}
|
|
10739
10537
|
function useSize(element) {
|
|
10740
|
-
const [size4, setSize] =
|
|
10741
|
-
|
|
10538
|
+
const [size4, setSize] = React60.useState(void 0);
|
|
10539
|
+
useLayoutEffect2(() => {
|
|
10742
10540
|
if (element) {
|
|
10743
10541
|
setSize({ width: element.offsetWidth, height: element.offsetHeight });
|
|
10744
10542
|
const resizeObserver = new ResizeObserver((entries) => {
|
|
@@ -10771,31 +10569,31 @@ function useSize(element) {
|
|
|
10771
10569
|
return size4;
|
|
10772
10570
|
}
|
|
10773
10571
|
var POPPER_NAME = "Popper";
|
|
10774
|
-
var [createPopperContext, createPopperScope] =
|
|
10572
|
+
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
|
|
10775
10573
|
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
|
|
10776
10574
|
var Popper = (props) => {
|
|
10777
10575
|
const { __scopePopper, children } = props;
|
|
10778
|
-
const [anchor, setAnchor] =
|
|
10576
|
+
const [anchor, setAnchor] = React60.useState(null);
|
|
10779
10577
|
return /* @__PURE__ */ jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
|
|
10780
10578
|
};
|
|
10781
10579
|
Popper.displayName = POPPER_NAME;
|
|
10782
10580
|
var ANCHOR_NAME = "PopperAnchor";
|
|
10783
|
-
var PopperAnchor =
|
|
10581
|
+
var PopperAnchor = React60.forwardRef(
|
|
10784
10582
|
(props, forwardedRef) => {
|
|
10785
10583
|
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
10786
10584
|
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
|
|
10787
|
-
const ref =
|
|
10788
|
-
const composedRefs =
|
|
10789
|
-
|
|
10585
|
+
const ref = React60.useRef(null);
|
|
10586
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
10587
|
+
React60.useEffect(() => {
|
|
10790
10588
|
context.onAnchorChange(virtualRef?.current || ref.current);
|
|
10791
10589
|
});
|
|
10792
|
-
return virtualRef ? null : /* @__PURE__ */ jsx(
|
|
10590
|
+
return virtualRef ? null : /* @__PURE__ */ jsx(Primitive.div, { ...anchorProps, ref: composedRefs });
|
|
10793
10591
|
}
|
|
10794
10592
|
);
|
|
10795
10593
|
PopperAnchor.displayName = ANCHOR_NAME;
|
|
10796
10594
|
var CONTENT_NAME2 = "PopperContent";
|
|
10797
10595
|
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME2);
|
|
10798
|
-
var PopperContent =
|
|
10596
|
+
var PopperContent = React60.forwardRef(
|
|
10799
10597
|
(props, forwardedRef) => {
|
|
10800
10598
|
const {
|
|
10801
10599
|
__scopePopper,
|
|
@@ -10814,9 +10612,9 @@ var PopperContent = React67.forwardRef(
|
|
|
10814
10612
|
...contentProps
|
|
10815
10613
|
} = props;
|
|
10816
10614
|
const context = usePopperContext(CONTENT_NAME2, __scopePopper);
|
|
10817
|
-
const [content, setContent2] =
|
|
10818
|
-
const composedRefs =
|
|
10819
|
-
const [arrow6, setArrow] =
|
|
10615
|
+
const [content, setContent2] = React60.useState(null);
|
|
10616
|
+
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent2(node));
|
|
10617
|
+
const [arrow6, setArrow] = React60.useState(null);
|
|
10820
10618
|
const arrowSize = useSize(arrow6);
|
|
10821
10619
|
const arrowWidth = arrowSize?.width ?? 0;
|
|
10822
10620
|
const arrowHeight = arrowSize?.height ?? 0;
|
|
@@ -10870,7 +10668,7 @@ var PopperContent = React67.forwardRef(
|
|
|
10870
10668
|
});
|
|
10871
10669
|
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
|
|
10872
10670
|
const handlePlaced = useCallbackRef(onPlaced);
|
|
10873
|
-
|
|
10671
|
+
useLayoutEffect2(() => {
|
|
10874
10672
|
if (isPositioned) {
|
|
10875
10673
|
handlePlaced?.();
|
|
10876
10674
|
}
|
|
@@ -10878,8 +10676,8 @@ var PopperContent = React67.forwardRef(
|
|
|
10878
10676
|
const arrowX = middlewareData.arrow?.x;
|
|
10879
10677
|
const arrowY = middlewareData.arrow?.y;
|
|
10880
10678
|
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
|
|
10881
|
-
const [contentZIndex, setContentZIndex] =
|
|
10882
|
-
|
|
10679
|
+
const [contentZIndex, setContentZIndex] = React60.useState();
|
|
10680
|
+
useLayoutEffect2(() => {
|
|
10883
10681
|
if (content)
|
|
10884
10682
|
setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
10885
10683
|
}, [content]);
|
|
@@ -10917,7 +10715,7 @@ var PopperContent = React67.forwardRef(
|
|
|
10917
10715
|
arrowY,
|
|
10918
10716
|
shouldHideArrow: cannotCenterArrow,
|
|
10919
10717
|
children: /* @__PURE__ */ jsx(
|
|
10920
|
-
|
|
10718
|
+
Primitive.div,
|
|
10921
10719
|
{
|
|
10922
10720
|
"data-side": placedSide,
|
|
10923
10721
|
"data-align": placedAlign,
|
|
@@ -10945,7 +10743,7 @@ var OPPOSITE_SIDE = {
|
|
|
10945
10743
|
bottom: "top",
|
|
10946
10744
|
left: "right"
|
|
10947
10745
|
};
|
|
10948
|
-
var PopperArrow =
|
|
10746
|
+
var PopperArrow = React60.forwardRef(function PopperArrow2(props, forwardedRef) {
|
|
10949
10747
|
const { __scopePopper, ...arrowProps } = props;
|
|
10950
10748
|
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
|
|
10951
10749
|
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
|
|
@@ -11036,139 +10834,17 @@ var Anchor2 = PopperAnchor;
|
|
|
11036
10834
|
var Content11 = PopperContent;
|
|
11037
10835
|
var Arrow3 = PopperArrow;
|
|
11038
10836
|
var PORTAL_NAME = "Portal";
|
|
11039
|
-
var Portal5 =
|
|
10837
|
+
var Portal5 = React60.forwardRef((props, forwardedRef) => {
|
|
11040
10838
|
const { container: containerProp, ...portalProps } = props;
|
|
11041
|
-
const [mounted, setMounted] =
|
|
11042
|
-
|
|
10839
|
+
const [mounted, setMounted] = React60.useState(false);
|
|
10840
|
+
useLayoutEffect2(() => setMounted(true), []);
|
|
11043
10841
|
const container = containerProp || mounted && globalThis?.document?.body;
|
|
11044
|
-
return container ?
|
|
10842
|
+
return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
11045
10843
|
});
|
|
11046
10844
|
Portal5.displayName = PORTAL_NAME;
|
|
11047
|
-
function useStateMachine2(initialState, machine) {
|
|
11048
|
-
return React67.useReducer((state, event) => {
|
|
11049
|
-
const nextState = machine[state][event];
|
|
11050
|
-
return nextState ?? state;
|
|
11051
|
-
}, initialState);
|
|
11052
|
-
}
|
|
11053
|
-
var Presence2 = (props) => {
|
|
11054
|
-
const { present, children } = props;
|
|
11055
|
-
const presence = usePresence2(present);
|
|
11056
|
-
const child = typeof children === "function" ? children({ present: presence.isPresent }) : React67.Children.only(children);
|
|
11057
|
-
const ref = useComposedRefs2(presence.ref, getElementRef2(child));
|
|
11058
|
-
const forceMount = typeof children === "function";
|
|
11059
|
-
return forceMount || presence.isPresent ? React67.cloneElement(child, { ref }) : null;
|
|
11060
|
-
};
|
|
11061
|
-
Presence2.displayName = "Presence";
|
|
11062
|
-
function usePresence2(present) {
|
|
11063
|
-
const [node, setNode2] = React67.useState();
|
|
11064
|
-
const stylesRef = React67.useRef(null);
|
|
11065
|
-
const prevPresentRef = React67.useRef(present);
|
|
11066
|
-
const prevAnimationNameRef = React67.useRef("none");
|
|
11067
|
-
const initialState = present ? "mounted" : "unmounted";
|
|
11068
|
-
const [state, send] = useStateMachine2(initialState, {
|
|
11069
|
-
mounted: {
|
|
11070
|
-
UNMOUNT: "unmounted",
|
|
11071
|
-
ANIMATION_OUT: "unmountSuspended"
|
|
11072
|
-
},
|
|
11073
|
-
unmountSuspended: {
|
|
11074
|
-
MOUNT: "mounted",
|
|
11075
|
-
ANIMATION_END: "unmounted"
|
|
11076
|
-
},
|
|
11077
|
-
unmounted: {
|
|
11078
|
-
MOUNT: "mounted"
|
|
11079
|
-
}
|
|
11080
|
-
});
|
|
11081
|
-
React67.useEffect(() => {
|
|
11082
|
-
const currentAnimationName = getAnimationName2(stylesRef.current);
|
|
11083
|
-
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
11084
|
-
}, [state]);
|
|
11085
|
-
useLayoutEffect22(() => {
|
|
11086
|
-
const styles = stylesRef.current;
|
|
11087
|
-
const wasPresent = prevPresentRef.current;
|
|
11088
|
-
const hasPresentChanged = wasPresent !== present;
|
|
11089
|
-
if (hasPresentChanged) {
|
|
11090
|
-
const prevAnimationName = prevAnimationNameRef.current;
|
|
11091
|
-
const currentAnimationName = getAnimationName2(styles);
|
|
11092
|
-
if (present) {
|
|
11093
|
-
send("MOUNT");
|
|
11094
|
-
} else if (currentAnimationName === "none" || styles?.display === "none") {
|
|
11095
|
-
send("UNMOUNT");
|
|
11096
|
-
} else {
|
|
11097
|
-
const isAnimating = prevAnimationName !== currentAnimationName;
|
|
11098
|
-
if (wasPresent && isAnimating) {
|
|
11099
|
-
send("ANIMATION_OUT");
|
|
11100
|
-
} else {
|
|
11101
|
-
send("UNMOUNT");
|
|
11102
|
-
}
|
|
11103
|
-
}
|
|
11104
|
-
prevPresentRef.current = present;
|
|
11105
|
-
}
|
|
11106
|
-
}, [present, send]);
|
|
11107
|
-
useLayoutEffect22(() => {
|
|
11108
|
-
if (node) {
|
|
11109
|
-
let timeoutId;
|
|
11110
|
-
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
11111
|
-
const handleAnimationEnd = (event) => {
|
|
11112
|
-
const currentAnimationName = getAnimationName2(stylesRef.current);
|
|
11113
|
-
const isCurrentAnimation = currentAnimationName.includes(event.animationName);
|
|
11114
|
-
if (event.target === node && isCurrentAnimation) {
|
|
11115
|
-
send("ANIMATION_END");
|
|
11116
|
-
if (!prevPresentRef.current) {
|
|
11117
|
-
const currentFillMode = node.style.animationFillMode;
|
|
11118
|
-
node.style.animationFillMode = "forwards";
|
|
11119
|
-
timeoutId = ownerWindow.setTimeout(() => {
|
|
11120
|
-
if (node.style.animationFillMode === "forwards") {
|
|
11121
|
-
node.style.animationFillMode = currentFillMode;
|
|
11122
|
-
}
|
|
11123
|
-
});
|
|
11124
|
-
}
|
|
11125
|
-
}
|
|
11126
|
-
};
|
|
11127
|
-
const handleAnimationStart = (event) => {
|
|
11128
|
-
if (event.target === node) {
|
|
11129
|
-
prevAnimationNameRef.current = getAnimationName2(stylesRef.current);
|
|
11130
|
-
}
|
|
11131
|
-
};
|
|
11132
|
-
node.addEventListener("animationstart", handleAnimationStart);
|
|
11133
|
-
node.addEventListener("animationcancel", handleAnimationEnd);
|
|
11134
|
-
node.addEventListener("animationend", handleAnimationEnd);
|
|
11135
|
-
return () => {
|
|
11136
|
-
ownerWindow.clearTimeout(timeoutId);
|
|
11137
|
-
node.removeEventListener("animationstart", handleAnimationStart);
|
|
11138
|
-
node.removeEventListener("animationcancel", handleAnimationEnd);
|
|
11139
|
-
node.removeEventListener("animationend", handleAnimationEnd);
|
|
11140
|
-
};
|
|
11141
|
-
} else {
|
|
11142
|
-
send("ANIMATION_END");
|
|
11143
|
-
}
|
|
11144
|
-
}, [node, send]);
|
|
11145
|
-
return {
|
|
11146
|
-
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
11147
|
-
ref: React67.useCallback((node2) => {
|
|
11148
|
-
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
11149
|
-
setNode2(node2);
|
|
11150
|
-
}, [])
|
|
11151
|
-
};
|
|
11152
|
-
}
|
|
11153
|
-
function getAnimationName2(styles) {
|
|
11154
|
-
return styles?.animationName || "none";
|
|
11155
|
-
}
|
|
11156
|
-
function getElementRef2(element) {
|
|
11157
|
-
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
11158
|
-
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
11159
|
-
if (mayWarn) {
|
|
11160
|
-
return element.ref;
|
|
11161
|
-
}
|
|
11162
|
-
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
11163
|
-
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
11164
|
-
if (mayWarn) {
|
|
11165
|
-
return element.props.ref;
|
|
11166
|
-
}
|
|
11167
|
-
return element.props.ref || element.ref;
|
|
11168
|
-
}
|
|
11169
10845
|
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis?.document) {
|
|
11170
10846
|
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
11171
|
-
|
|
10847
|
+
React60.useEffect(() => {
|
|
11172
10848
|
const handleKeyDown3 = (event) => {
|
|
11173
10849
|
if (event.key === "Escape") {
|
|
11174
10850
|
onEscapeKeyDown(event);
|
|
@@ -11183,12 +10859,12 @@ var CONTEXT_UPDATE = "dismissableLayer.update";
|
|
|
11183
10859
|
var POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
11184
10860
|
var FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
11185
10861
|
var originalBodyPointerEvents;
|
|
11186
|
-
var DismissableLayerContext =
|
|
10862
|
+
var DismissableLayerContext = React60.createContext({
|
|
11187
10863
|
layers: /* @__PURE__ */ new Set(),
|
|
11188
10864
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
11189
10865
|
branches: /* @__PURE__ */ new Set()
|
|
11190
10866
|
});
|
|
11191
|
-
var DismissableLayer =
|
|
10867
|
+
var DismissableLayer = React60.forwardRef(
|
|
11192
10868
|
(props, forwardedRef) => {
|
|
11193
10869
|
const {
|
|
11194
10870
|
disableOutsidePointerEvents = false,
|
|
@@ -11199,11 +10875,11 @@ var DismissableLayer = React67.forwardRef(
|
|
|
11199
10875
|
onDismiss,
|
|
11200
10876
|
...layerProps
|
|
11201
10877
|
} = props;
|
|
11202
|
-
const context =
|
|
11203
|
-
const [node, setNode2] =
|
|
10878
|
+
const context = React60.useContext(DismissableLayerContext);
|
|
10879
|
+
const [node, setNode2] = React60.useState(null);
|
|
11204
10880
|
const ownerDocument = node?.ownerDocument ?? globalThis?.document;
|
|
11205
|
-
const [, force] =
|
|
11206
|
-
const composedRefs =
|
|
10881
|
+
const [, force] = React60.useState({});
|
|
10882
|
+
const composedRefs = useComposedRefs(forwardedRef, (node2) => setNode2(node2));
|
|
11207
10883
|
const layers = Array.from(context.layers);
|
|
11208
10884
|
const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1);
|
|
11209
10885
|
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
|
|
@@ -11240,7 +10916,7 @@ var DismissableLayer = React67.forwardRef(
|
|
|
11240
10916
|
onDismiss();
|
|
11241
10917
|
}
|
|
11242
10918
|
}, ownerDocument);
|
|
11243
|
-
|
|
10919
|
+
React60.useEffect(() => {
|
|
11244
10920
|
if (!node)
|
|
11245
10921
|
return;
|
|
11246
10922
|
if (disableOutsidePointerEvents) {
|
|
@@ -11258,7 +10934,7 @@ var DismissableLayer = React67.forwardRef(
|
|
|
11258
10934
|
}
|
|
11259
10935
|
};
|
|
11260
10936
|
}, [node, ownerDocument, disableOutsidePointerEvents, context]);
|
|
11261
|
-
|
|
10937
|
+
React60.useEffect(() => {
|
|
11262
10938
|
return () => {
|
|
11263
10939
|
if (!node)
|
|
11264
10940
|
return;
|
|
@@ -11267,13 +10943,13 @@ var DismissableLayer = React67.forwardRef(
|
|
|
11267
10943
|
dispatchUpdate();
|
|
11268
10944
|
};
|
|
11269
10945
|
}, [node, context]);
|
|
11270
|
-
|
|
10946
|
+
React60.useEffect(() => {
|
|
11271
10947
|
const handleUpdate = () => force({});
|
|
11272
10948
|
document.addEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
11273
10949
|
return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);
|
|
11274
10950
|
}, []);
|
|
11275
10951
|
return /* @__PURE__ */ jsx(
|
|
11276
|
-
|
|
10952
|
+
Primitive.div,
|
|
11277
10953
|
{
|
|
11278
10954
|
...layerProps,
|
|
11279
10955
|
ref: composedRefs,
|
|
@@ -11281,9 +10957,9 @@ var DismissableLayer = React67.forwardRef(
|
|
|
11281
10957
|
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
|
|
11282
10958
|
...props.style
|
|
11283
10959
|
},
|
|
11284
|
-
onFocusCapture:
|
|
11285
|
-
onBlurCapture:
|
|
11286
|
-
onPointerDownCapture:
|
|
10960
|
+
onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
10961
|
+
onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
10962
|
+
onPointerDownCapture: composeEventHandlers(
|
|
11287
10963
|
props.onPointerDownCapture,
|
|
11288
10964
|
pointerDownOutside.onPointerDownCapture
|
|
11289
10965
|
)
|
|
@@ -11293,11 +10969,11 @@ var DismissableLayer = React67.forwardRef(
|
|
|
11293
10969
|
);
|
|
11294
10970
|
DismissableLayer.displayName = DISMISSABLE_LAYER_NAME;
|
|
11295
10971
|
var BRANCH_NAME = "DismissableLayerBranch";
|
|
11296
|
-
var DismissableLayerBranch =
|
|
11297
|
-
const context =
|
|
11298
|
-
const ref =
|
|
11299
|
-
const composedRefs =
|
|
11300
|
-
|
|
10972
|
+
var DismissableLayerBranch = React60.forwardRef((props, forwardedRef) => {
|
|
10973
|
+
const context = React60.useContext(DismissableLayerContext);
|
|
10974
|
+
const ref = React60.useRef(null);
|
|
10975
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
10976
|
+
React60.useEffect(() => {
|
|
11301
10977
|
const node = ref.current;
|
|
11302
10978
|
if (node) {
|
|
11303
10979
|
context.branches.add(node);
|
|
@@ -11306,15 +10982,15 @@ var DismissableLayerBranch = React67.forwardRef((props, forwardedRef) => {
|
|
|
11306
10982
|
};
|
|
11307
10983
|
}
|
|
11308
10984
|
}, [context.branches]);
|
|
11309
|
-
return /* @__PURE__ */ jsx(
|
|
10985
|
+
return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });
|
|
11310
10986
|
});
|
|
11311
10987
|
DismissableLayerBranch.displayName = BRANCH_NAME;
|
|
11312
10988
|
function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?.document) {
|
|
11313
10989
|
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
11314
|
-
const isPointerInsideReactTreeRef =
|
|
11315
|
-
const handleClickRef =
|
|
10990
|
+
const isPointerInsideReactTreeRef = React60.useRef(false);
|
|
10991
|
+
const handleClickRef = React60.useRef(() => {
|
|
11316
10992
|
});
|
|
11317
|
-
|
|
10993
|
+
React60.useEffect(() => {
|
|
11318
10994
|
const handlePointerDown = (event) => {
|
|
11319
10995
|
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
11320
10996
|
let handleAndDispatchPointerDownOutsideEvent2 = function() {
|
|
@@ -11354,8 +11030,8 @@ function usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis?
|
|
|
11354
11030
|
}
|
|
11355
11031
|
function useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {
|
|
11356
11032
|
const handleFocusOutside = useCallbackRef(onFocusOutside);
|
|
11357
|
-
const isFocusInsideReactTreeRef =
|
|
11358
|
-
|
|
11033
|
+
const isFocusInsideReactTreeRef = React60.useRef(false);
|
|
11034
|
+
React60.useEffect(() => {
|
|
11359
11035
|
const handleFocus = (event) => {
|
|
11360
11036
|
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
11361
11037
|
const eventDetail = { originalEvent: event };
|
|
@@ -11389,7 +11065,7 @@ function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
|
11389
11065
|
}
|
|
11390
11066
|
var originalBodyUserSelect;
|
|
11391
11067
|
var HOVERCARD_NAME = "HoverCard";
|
|
11392
|
-
var [createHoverCardContext, createHoverCardScope] =
|
|
11068
|
+
var [createHoverCardContext, createHoverCardScope] = createContextScope(HOVERCARD_NAME, [
|
|
11393
11069
|
createPopperScope
|
|
11394
11070
|
]);
|
|
11395
11071
|
var usePopperScope = createPopperScope();
|
|
@@ -11405,28 +11081,28 @@ var HoverCard = (props) => {
|
|
|
11405
11081
|
closeDelay = 300
|
|
11406
11082
|
} = props;
|
|
11407
11083
|
const popperScope = usePopperScope(__scopeHoverCard);
|
|
11408
|
-
const openTimerRef =
|
|
11409
|
-
const closeTimerRef =
|
|
11410
|
-
const hasSelectionRef =
|
|
11411
|
-
const isPointerDownOnContentRef =
|
|
11412
|
-
const [open, setOpen] =
|
|
11084
|
+
const openTimerRef = React60.useRef(0);
|
|
11085
|
+
const closeTimerRef = React60.useRef(0);
|
|
11086
|
+
const hasSelectionRef = React60.useRef(false);
|
|
11087
|
+
const isPointerDownOnContentRef = React60.useRef(false);
|
|
11088
|
+
const [open, setOpen] = useControllableState({
|
|
11413
11089
|
prop: openProp,
|
|
11414
11090
|
defaultProp: defaultOpen ?? false,
|
|
11415
11091
|
onChange: onOpenChange,
|
|
11416
11092
|
caller: HOVERCARD_NAME
|
|
11417
11093
|
});
|
|
11418
|
-
const handleOpen =
|
|
11094
|
+
const handleOpen = React60.useCallback(() => {
|
|
11419
11095
|
clearTimeout(closeTimerRef.current);
|
|
11420
11096
|
openTimerRef.current = window.setTimeout(() => setOpen(true), openDelay);
|
|
11421
11097
|
}, [openDelay, setOpen]);
|
|
11422
|
-
const handleClose =
|
|
11098
|
+
const handleClose = React60.useCallback(() => {
|
|
11423
11099
|
clearTimeout(openTimerRef.current);
|
|
11424
11100
|
if (!hasSelectionRef.current && !isPointerDownOnContentRef.current) {
|
|
11425
11101
|
closeTimerRef.current = window.setTimeout(() => setOpen(false), closeDelay);
|
|
11426
11102
|
}
|
|
11427
11103
|
}, [closeDelay, setOpen]);
|
|
11428
|
-
const handleDismiss =
|
|
11429
|
-
|
|
11104
|
+
const handleDismiss = React60.useCallback(() => setOpen(false), [setOpen]);
|
|
11105
|
+
React60.useEffect(() => {
|
|
11430
11106
|
return () => {
|
|
11431
11107
|
clearTimeout(openTimerRef.current);
|
|
11432
11108
|
clearTimeout(closeTimerRef.current);
|
|
@@ -11449,22 +11125,22 @@ var HoverCard = (props) => {
|
|
|
11449
11125
|
};
|
|
11450
11126
|
HoverCard.displayName = HOVERCARD_NAME;
|
|
11451
11127
|
var TRIGGER_NAME2 = "HoverCardTrigger";
|
|
11452
|
-
var HoverCardTrigger =
|
|
11128
|
+
var HoverCardTrigger = React60.forwardRef(
|
|
11453
11129
|
(props, forwardedRef) => {
|
|
11454
11130
|
const { __scopeHoverCard, ...triggerProps } = props;
|
|
11455
11131
|
const context = useHoverCardContext(TRIGGER_NAME2, __scopeHoverCard);
|
|
11456
11132
|
const popperScope = usePopperScope(__scopeHoverCard);
|
|
11457
11133
|
return /* @__PURE__ */ jsx(Anchor2, { asChild: true, ...popperScope, children: /* @__PURE__ */ jsx(
|
|
11458
|
-
|
|
11134
|
+
Primitive.a,
|
|
11459
11135
|
{
|
|
11460
11136
|
"data-state": context.open ? "open" : "closed",
|
|
11461
11137
|
...triggerProps,
|
|
11462
11138
|
ref: forwardedRef,
|
|
11463
|
-
onPointerEnter:
|
|
11464
|
-
onPointerLeave:
|
|
11465
|
-
onFocus:
|
|
11466
|
-
onBlur:
|
|
11467
|
-
onTouchStart:
|
|
11139
|
+
onPointerEnter: composeEventHandlers(props.onPointerEnter, excludeTouch(context.onOpen)),
|
|
11140
|
+
onPointerLeave: composeEventHandlers(props.onPointerLeave, excludeTouch(context.onClose)),
|
|
11141
|
+
onFocus: composeEventHandlers(props.onFocus, context.onOpen),
|
|
11142
|
+
onBlur: composeEventHandlers(props.onBlur, context.onClose),
|
|
11143
|
+
onTouchStart: composeEventHandlers(props.onTouchStart, (event) => event.preventDefault())
|
|
11468
11144
|
}
|
|
11469
11145
|
) });
|
|
11470
11146
|
}
|
|
@@ -11475,25 +11151,25 @@ var [PortalProvider, usePortalContext] = createHoverCardContext(PORTAL_NAME2, {
|
|
|
11475
11151
|
forceMount: void 0
|
|
11476
11152
|
});
|
|
11477
11153
|
var CONTENT_NAME3 = "HoverCardContent";
|
|
11478
|
-
var HoverCardContent =
|
|
11154
|
+
var HoverCardContent = React60.forwardRef(
|
|
11479
11155
|
(props, forwardedRef) => {
|
|
11480
11156
|
const portalContext = usePortalContext(CONTENT_NAME3, props.__scopeHoverCard);
|
|
11481
11157
|
const { forceMount = portalContext.forceMount, ...contentProps } = props;
|
|
11482
11158
|
const context = useHoverCardContext(CONTENT_NAME3, props.__scopeHoverCard);
|
|
11483
|
-
return /* @__PURE__ */ jsx(
|
|
11159
|
+
return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(
|
|
11484
11160
|
HoverCardContentImpl,
|
|
11485
11161
|
{
|
|
11486
11162
|
"data-state": context.open ? "open" : "closed",
|
|
11487
11163
|
...contentProps,
|
|
11488
|
-
onPointerEnter:
|
|
11489
|
-
onPointerLeave:
|
|
11164
|
+
onPointerEnter: composeEventHandlers(props.onPointerEnter, excludeTouch(context.onOpen)),
|
|
11165
|
+
onPointerLeave: composeEventHandlers(props.onPointerLeave, excludeTouch(context.onClose)),
|
|
11490
11166
|
ref: forwardedRef
|
|
11491
11167
|
}
|
|
11492
11168
|
) });
|
|
11493
11169
|
}
|
|
11494
11170
|
);
|
|
11495
11171
|
HoverCardContent.displayName = CONTENT_NAME3;
|
|
11496
|
-
var HoverCardContentImpl =
|
|
11172
|
+
var HoverCardContentImpl = React60.forwardRef((props, forwardedRef) => {
|
|
11497
11173
|
const {
|
|
11498
11174
|
__scopeHoverCard,
|
|
11499
11175
|
onEscapeKeyDown,
|
|
@@ -11504,10 +11180,10 @@ var HoverCardContentImpl = React67.forwardRef((props, forwardedRef) => {
|
|
|
11504
11180
|
} = props;
|
|
11505
11181
|
const context = useHoverCardContext(CONTENT_NAME3, __scopeHoverCard);
|
|
11506
11182
|
const popperScope = usePopperScope(__scopeHoverCard);
|
|
11507
|
-
const ref =
|
|
11508
|
-
const composedRefs =
|
|
11509
|
-
const [containSelection, setContainSelection] =
|
|
11510
|
-
|
|
11183
|
+
const ref = React60.useRef(null);
|
|
11184
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
11185
|
+
const [containSelection, setContainSelection] = React60.useState(false);
|
|
11186
|
+
React60.useEffect(() => {
|
|
11511
11187
|
if (containSelection) {
|
|
11512
11188
|
const body = document.body;
|
|
11513
11189
|
originalBodyUserSelect = body.style.userSelect || body.style.webkitUserSelect;
|
|
@@ -11519,7 +11195,7 @@ var HoverCardContentImpl = React67.forwardRef((props, forwardedRef) => {
|
|
|
11519
11195
|
};
|
|
11520
11196
|
}
|
|
11521
11197
|
}, [containSelection]);
|
|
11522
|
-
|
|
11198
|
+
React60.useEffect(() => {
|
|
11523
11199
|
if (ref.current) {
|
|
11524
11200
|
const handlePointerUp = () => {
|
|
11525
11201
|
setContainSelection(false);
|
|
@@ -11538,7 +11214,7 @@ var HoverCardContentImpl = React67.forwardRef((props, forwardedRef) => {
|
|
|
11538
11214
|
};
|
|
11539
11215
|
}
|
|
11540
11216
|
}, [context.isPointerDownOnContentRef, context.hasSelectionRef]);
|
|
11541
|
-
|
|
11217
|
+
React60.useEffect(() => {
|
|
11542
11218
|
if (ref.current) {
|
|
11543
11219
|
const tabbables = getTabbableNodes(ref.current);
|
|
11544
11220
|
tabbables.forEach((tabbable) => tabbable.setAttribute("tabindex", "-1"));
|
|
@@ -11552,7 +11228,7 @@ var HoverCardContentImpl = React67.forwardRef((props, forwardedRef) => {
|
|
|
11552
11228
|
onInteractOutside,
|
|
11553
11229
|
onEscapeKeyDown,
|
|
11554
11230
|
onPointerDownOutside,
|
|
11555
|
-
onFocusOutside:
|
|
11231
|
+
onFocusOutside: composeEventHandlers(onFocusOutside, (event) => {
|
|
11556
11232
|
event.preventDefault();
|
|
11557
11233
|
}),
|
|
11558
11234
|
onDismiss: context.onDismiss,
|
|
@@ -11561,7 +11237,7 @@ var HoverCardContentImpl = React67.forwardRef((props, forwardedRef) => {
|
|
|
11561
11237
|
{
|
|
11562
11238
|
...popperScope,
|
|
11563
11239
|
...contentProps,
|
|
11564
|
-
onPointerDown:
|
|
11240
|
+
onPointerDown: composeEventHandlers(contentProps.onPointerDown, (event) => {
|
|
11565
11241
|
if (event.currentTarget.contains(event.target)) {
|
|
11566
11242
|
setContainSelection(true);
|
|
11567
11243
|
}
|
|
@@ -11589,7 +11265,7 @@ var HoverCardContentImpl = React67.forwardRef((props, forwardedRef) => {
|
|
|
11589
11265
|
);
|
|
11590
11266
|
});
|
|
11591
11267
|
var ARROW_NAME2 = "HoverCardArrow";
|
|
11592
|
-
var HoverCardArrow =
|
|
11268
|
+
var HoverCardArrow = React60.forwardRef(
|
|
11593
11269
|
(props, forwardedRef) => {
|
|
11594
11270
|
const { __scopeHoverCard, ...arrowProps } = props;
|
|
11595
11271
|
const popperScope = usePopperScope(__scopeHoverCard);
|
|
@@ -11616,7 +11292,7 @@ var Trigger11 = HoverCardTrigger;
|
|
|
11616
11292
|
var Content22 = HoverCardContent;
|
|
11617
11293
|
var HoverCard2 = Root23;
|
|
11618
11294
|
var HoverCardTrigger2 = Trigger11;
|
|
11619
|
-
var HoverCardContent2 =
|
|
11295
|
+
var HoverCardContent2 = React60.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
11620
11296
|
Content22,
|
|
11621
11297
|
{
|
|
11622
11298
|
ref,
|
|
@@ -11630,42 +11306,32 @@ var HoverCardContent2 = React67.forwardRef(({ className, align = "center", sideO
|
|
|
11630
11306
|
}
|
|
11631
11307
|
));
|
|
11632
11308
|
HoverCardContent2.displayName = Content22.displayName;
|
|
11633
|
-
var DirectionContext =
|
|
11309
|
+
var DirectionContext = React60.createContext(void 0);
|
|
11634
11310
|
function useDirection(localDir) {
|
|
11635
|
-
const globalDir =
|
|
11311
|
+
const globalDir = React60.useContext(DirectionContext);
|
|
11636
11312
|
return localDir || globalDir || "ltr";
|
|
11637
11313
|
}
|
|
11638
|
-
var useReactId2 = React67[" useId ".trim().toString()] || (() => void 0);
|
|
11639
|
-
var count2 = 0;
|
|
11640
|
-
function useId4(deterministicId) {
|
|
11641
|
-
const [id, setId] = React67.useState(useReactId2());
|
|
11642
|
-
useLayoutEffect22(() => {
|
|
11643
|
-
if (!deterministicId)
|
|
11644
|
-
setId((reactId) => reactId ?? String(count2++));
|
|
11645
|
-
}, [deterministicId]);
|
|
11646
|
-
return deterministicId || (id ? `radix-${id}` : "");
|
|
11647
|
-
}
|
|
11648
11314
|
function createCollection(name) {
|
|
11649
11315
|
const PROVIDER_NAME = name + "CollectionProvider";
|
|
11650
|
-
const [createCollectionContext, createCollectionScope2] =
|
|
11316
|
+
const [createCollectionContext, createCollectionScope2] = createContextScope(PROVIDER_NAME);
|
|
11651
11317
|
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(
|
|
11652
11318
|
PROVIDER_NAME,
|
|
11653
11319
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
11654
11320
|
);
|
|
11655
11321
|
const CollectionProvider = (props) => {
|
|
11656
11322
|
const { scope, children } = props;
|
|
11657
|
-
const ref =
|
|
11658
|
-
const itemMap =
|
|
11323
|
+
const ref = React60__default.useRef(null);
|
|
11324
|
+
const itemMap = React60__default.useRef(/* @__PURE__ */ new Map()).current;
|
|
11659
11325
|
return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });
|
|
11660
11326
|
};
|
|
11661
11327
|
CollectionProvider.displayName = PROVIDER_NAME;
|
|
11662
11328
|
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
11663
11329
|
const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);
|
|
11664
|
-
const CollectionSlot =
|
|
11330
|
+
const CollectionSlot = React60__default.forwardRef(
|
|
11665
11331
|
(props, forwardedRef) => {
|
|
11666
11332
|
const { scope, children } = props;
|
|
11667
11333
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
11668
|
-
const composedRefs =
|
|
11334
|
+
const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);
|
|
11669
11335
|
return /* @__PURE__ */ jsx(CollectionSlotImpl, { ref: composedRefs, children });
|
|
11670
11336
|
}
|
|
11671
11337
|
);
|
|
@@ -11673,13 +11339,13 @@ function createCollection(name) {
|
|
|
11673
11339
|
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
11674
11340
|
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
11675
11341
|
const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);
|
|
11676
|
-
const CollectionItemSlot =
|
|
11342
|
+
const CollectionItemSlot = React60__default.forwardRef(
|
|
11677
11343
|
(props, forwardedRef) => {
|
|
11678
11344
|
const { scope, children, ...itemData } = props;
|
|
11679
|
-
const ref =
|
|
11680
|
-
const composedRefs =
|
|
11345
|
+
const ref = React60__default.useRef(null);
|
|
11346
|
+
const composedRefs = useComposedRefs(forwardedRef, ref);
|
|
11681
11347
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
11682
|
-
|
|
11348
|
+
React60__default.useEffect(() => {
|
|
11683
11349
|
context.itemMap.set(ref, { ref, ...itemData });
|
|
11684
11350
|
return () => void context.itemMap.delete(ref);
|
|
11685
11351
|
});
|
|
@@ -11689,7 +11355,7 @@ function createCollection(name) {
|
|
|
11689
11355
|
CollectionItemSlot.displayName = ITEM_SLOT_NAME;
|
|
11690
11356
|
function useCollection2(scope) {
|
|
11691
11357
|
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
11692
|
-
const getItems =
|
|
11358
|
+
const getItems = React60__default.useCallback(() => {
|
|
11693
11359
|
const collectionNode = context.collectionRef.current;
|
|
11694
11360
|
if (!collectionNode)
|
|
11695
11361
|
return [];
|
|
@@ -11709,8 +11375,8 @@ function createCollection(name) {
|
|
|
11709
11375
|
];
|
|
11710
11376
|
}
|
|
11711
11377
|
function usePrevious(value) {
|
|
11712
|
-
const ref =
|
|
11713
|
-
return
|
|
11378
|
+
const ref = React60.useRef({ value, previous: value });
|
|
11379
|
+
return React60.useMemo(() => {
|
|
11714
11380
|
if (ref.current.value !== value) {
|
|
11715
11381
|
ref.current.previous = ref.current.value;
|
|
11716
11382
|
ref.current.value = value;
|
|
@@ -11732,10 +11398,10 @@ var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
|
11732
11398
|
wordWrap: "normal"
|
|
11733
11399
|
});
|
|
11734
11400
|
var NAME3 = "VisuallyHidden";
|
|
11735
|
-
var VisuallyHidden =
|
|
11401
|
+
var VisuallyHidden = React60.forwardRef(
|
|
11736
11402
|
(props, forwardedRef) => {
|
|
11737
11403
|
return /* @__PURE__ */ jsx(
|
|
11738
|
-
|
|
11404
|
+
Primitive.span,
|
|
11739
11405
|
{
|
|
11740
11406
|
...props,
|
|
11741
11407
|
ref: forwardedRef,
|
|
@@ -11749,13 +11415,13 @@ var Root21 = VisuallyHidden;
|
|
|
11749
11415
|
var NAVIGATION_MENU_NAME = "NavigationMenu";
|
|
11750
11416
|
var [Collection, useCollection, createCollectionScope] = createCollection(NAVIGATION_MENU_NAME);
|
|
11751
11417
|
var [FocusGroupCollection, useFocusGroupCollection, createFocusGroupCollectionScope] = createCollection(NAVIGATION_MENU_NAME);
|
|
11752
|
-
var [createNavigationMenuContext, createNavigationMenuScope] =
|
|
11418
|
+
var [createNavigationMenuContext, createNavigationMenuScope] = createContextScope(
|
|
11753
11419
|
NAVIGATION_MENU_NAME,
|
|
11754
11420
|
[createCollectionScope, createFocusGroupCollectionScope]
|
|
11755
11421
|
);
|
|
11756
11422
|
var [NavigationMenuProviderImpl, useNavigationMenuContext] = createNavigationMenuContext(NAVIGATION_MENU_NAME);
|
|
11757
11423
|
var [ViewportContentProvider, useViewportContentContext] = createNavigationMenuContext(NAVIGATION_MENU_NAME);
|
|
11758
|
-
var NavigationMenu =
|
|
11424
|
+
var NavigationMenu = React60.forwardRef(
|
|
11759
11425
|
(props, forwardedRef) => {
|
|
11760
11426
|
const {
|
|
11761
11427
|
__scopeNavigationMenu,
|
|
@@ -11768,14 +11434,14 @@ var NavigationMenu = React67.forwardRef(
|
|
|
11768
11434
|
dir,
|
|
11769
11435
|
...NavigationMenuProps
|
|
11770
11436
|
} = props;
|
|
11771
|
-
const [navigationMenu, setNavigationMenu] =
|
|
11772
|
-
const composedRef =
|
|
11437
|
+
const [navigationMenu, setNavigationMenu] = React60.useState(null);
|
|
11438
|
+
const composedRef = useComposedRefs(forwardedRef, (node) => setNavigationMenu(node));
|
|
11773
11439
|
const direction = useDirection(dir);
|
|
11774
|
-
const openTimerRef =
|
|
11775
|
-
const closeTimerRef =
|
|
11776
|
-
const skipDelayTimerRef =
|
|
11777
|
-
const [isOpenDelayed, setIsOpenDelayed] =
|
|
11778
|
-
const [value, setValue] =
|
|
11440
|
+
const openTimerRef = React60.useRef(0);
|
|
11441
|
+
const closeTimerRef = React60.useRef(0);
|
|
11442
|
+
const skipDelayTimerRef = React60.useRef(0);
|
|
11443
|
+
const [isOpenDelayed, setIsOpenDelayed] = React60.useState(true);
|
|
11444
|
+
const [value, setValue] = useControllableState({
|
|
11779
11445
|
prop: valueProp,
|
|
11780
11446
|
onChange: (value2) => {
|
|
11781
11447
|
const isOpen = value2 !== "";
|
|
@@ -11796,18 +11462,18 @@ var NavigationMenu = React67.forwardRef(
|
|
|
11796
11462
|
defaultProp: defaultValue2 ?? "",
|
|
11797
11463
|
caller: NAVIGATION_MENU_NAME
|
|
11798
11464
|
});
|
|
11799
|
-
const startCloseTimer =
|
|
11465
|
+
const startCloseTimer = React60.useCallback(() => {
|
|
11800
11466
|
window.clearTimeout(closeTimerRef.current);
|
|
11801
11467
|
closeTimerRef.current = window.setTimeout(() => setValue(""), 150);
|
|
11802
11468
|
}, [setValue]);
|
|
11803
|
-
const handleOpen =
|
|
11469
|
+
const handleOpen = React60.useCallback(
|
|
11804
11470
|
(itemValue) => {
|
|
11805
11471
|
window.clearTimeout(closeTimerRef.current);
|
|
11806
11472
|
setValue(itemValue);
|
|
11807
11473
|
},
|
|
11808
11474
|
[setValue]
|
|
11809
11475
|
);
|
|
11810
|
-
const handleDelayedOpen =
|
|
11476
|
+
const handleDelayedOpen = React60.useCallback(
|
|
11811
11477
|
(itemValue) => {
|
|
11812
11478
|
const isOpenItem = value === itemValue;
|
|
11813
11479
|
if (isOpenItem) {
|
|
@@ -11821,7 +11487,7 @@ var NavigationMenu = React67.forwardRef(
|
|
|
11821
11487
|
},
|
|
11822
11488
|
[value, setValue, delayDuration]
|
|
11823
11489
|
);
|
|
11824
|
-
|
|
11490
|
+
React60.useEffect(() => {
|
|
11825
11491
|
return () => {
|
|
11826
11492
|
window.clearTimeout(openTimerRef.current);
|
|
11827
11493
|
window.clearTimeout(closeTimerRef.current);
|
|
@@ -11855,7 +11521,7 @@ var NavigationMenu = React67.forwardRef(
|
|
|
11855
11521
|
},
|
|
11856
11522
|
onItemDismiss: () => setValue(""),
|
|
11857
11523
|
children: /* @__PURE__ */ jsx(
|
|
11858
|
-
|
|
11524
|
+
Primitive.nav,
|
|
11859
11525
|
{
|
|
11860
11526
|
"aria-label": "Main",
|
|
11861
11527
|
"data-orientation": orientation,
|
|
@@ -11870,7 +11536,7 @@ var NavigationMenu = React67.forwardRef(
|
|
|
11870
11536
|
);
|
|
11871
11537
|
NavigationMenu.displayName = NAVIGATION_MENU_NAME;
|
|
11872
11538
|
var SUB_NAME = "NavigationMenuSub";
|
|
11873
|
-
var NavigationMenuSub =
|
|
11539
|
+
var NavigationMenuSub = React60.forwardRef(
|
|
11874
11540
|
(props, forwardedRef) => {
|
|
11875
11541
|
const {
|
|
11876
11542
|
__scopeNavigationMenu,
|
|
@@ -11881,7 +11547,7 @@ var NavigationMenuSub = React67.forwardRef(
|
|
|
11881
11547
|
...subProps
|
|
11882
11548
|
} = props;
|
|
11883
11549
|
const context = useNavigationMenuContext(SUB_NAME, __scopeNavigationMenu);
|
|
11884
|
-
const [value, setValue] =
|
|
11550
|
+
const [value, setValue] = useControllableState({
|
|
11885
11551
|
prop: valueProp,
|
|
11886
11552
|
onChange: onValueChange,
|
|
11887
11553
|
defaultProp: defaultValue2 ?? "",
|
|
@@ -11899,7 +11565,7 @@ var NavigationMenuSub = React67.forwardRef(
|
|
|
11899
11565
|
onTriggerEnter: (itemValue) => setValue(itemValue),
|
|
11900
11566
|
onItemSelect: (itemValue) => setValue(itemValue),
|
|
11901
11567
|
onItemDismiss: () => setValue(""),
|
|
11902
|
-
children: /* @__PURE__ */ jsx(
|
|
11568
|
+
children: /* @__PURE__ */ jsx(Primitive.div, { "data-orientation": orientation, ...subProps, ref: forwardedRef })
|
|
11903
11569
|
}
|
|
11904
11570
|
);
|
|
11905
11571
|
}
|
|
@@ -11921,9 +11587,9 @@ var NavigationMenuProvider = (props) => {
|
|
|
11921
11587
|
onContentEnter,
|
|
11922
11588
|
onContentLeave
|
|
11923
11589
|
} = props;
|
|
11924
|
-
const [viewport, setViewport] =
|
|
11925
|
-
const [viewportContent, setViewportContent] =
|
|
11926
|
-
const [indicatorTrack, setIndicatorTrack] =
|
|
11590
|
+
const [viewport, setViewport] = React60.useState(null);
|
|
11591
|
+
const [viewportContent, setViewportContent] = React60.useState(/* @__PURE__ */ new Map());
|
|
11592
|
+
const [indicatorTrack, setIndicatorTrack] = React60.useState(null);
|
|
11927
11593
|
return /* @__PURE__ */ jsx(
|
|
11928
11594
|
NavigationMenuProviderImpl,
|
|
11929
11595
|
{
|
|
@@ -11932,7 +11598,7 @@ var NavigationMenuProvider = (props) => {
|
|
|
11932
11598
|
rootNavigationMenu,
|
|
11933
11599
|
value,
|
|
11934
11600
|
previousValue: usePrevious(value),
|
|
11935
|
-
baseId:
|
|
11601
|
+
baseId: useId2(),
|
|
11936
11602
|
dir,
|
|
11937
11603
|
orientation,
|
|
11938
11604
|
viewport,
|
|
@@ -11945,13 +11611,13 @@ var NavigationMenuProvider = (props) => {
|
|
|
11945
11611
|
onContentLeave: useCallbackRef(onContentLeave),
|
|
11946
11612
|
onItemSelect: useCallbackRef(onItemSelect),
|
|
11947
11613
|
onItemDismiss: useCallbackRef(onItemDismiss),
|
|
11948
|
-
onViewportContentChange:
|
|
11614
|
+
onViewportContentChange: React60.useCallback((contentValue, contentData) => {
|
|
11949
11615
|
setViewportContent((prevContent) => {
|
|
11950
11616
|
prevContent.set(contentValue, contentData);
|
|
11951
11617
|
return new Map(prevContent);
|
|
11952
11618
|
});
|
|
11953
11619
|
}, []),
|
|
11954
|
-
onViewportContentRemove:
|
|
11620
|
+
onViewportContentRemove: React60.useCallback((contentValue) => {
|
|
11955
11621
|
setViewportContent((prevContent) => {
|
|
11956
11622
|
if (!prevContent.has(contentValue))
|
|
11957
11623
|
return prevContent;
|
|
@@ -11964,29 +11630,29 @@ var NavigationMenuProvider = (props) => {
|
|
|
11964
11630
|
);
|
|
11965
11631
|
};
|
|
11966
11632
|
var LIST_NAME = "NavigationMenuList";
|
|
11967
|
-
var NavigationMenuList =
|
|
11633
|
+
var NavigationMenuList = React60.forwardRef(
|
|
11968
11634
|
(props, forwardedRef) => {
|
|
11969
11635
|
const { __scopeNavigationMenu, ...listProps } = props;
|
|
11970
11636
|
const context = useNavigationMenuContext(LIST_NAME, __scopeNavigationMenu);
|
|
11971
|
-
const list = /* @__PURE__ */ jsx(
|
|
11972
|
-
return /* @__PURE__ */ jsx(
|
|
11637
|
+
const list = /* @__PURE__ */ jsx(Primitive.ul, { "data-orientation": context.orientation, ...listProps, ref: forwardedRef });
|
|
11638
|
+
return /* @__PURE__ */ jsx(Primitive.div, { style: { position: "relative" }, ref: context.onIndicatorTrackChange, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: __scopeNavigationMenu, children: context.isRootMenu ? /* @__PURE__ */ jsx(FocusGroup, { asChild: true, children: list }) : list }) });
|
|
11973
11639
|
}
|
|
11974
11640
|
);
|
|
11975
11641
|
NavigationMenuList.displayName = LIST_NAME;
|
|
11976
11642
|
var ITEM_NAME = "NavigationMenuItem";
|
|
11977
11643
|
var [NavigationMenuItemContextProvider, useNavigationMenuItemContext] = createNavigationMenuContext(ITEM_NAME);
|
|
11978
|
-
var NavigationMenuItem =
|
|
11644
|
+
var NavigationMenuItem = React60.forwardRef(
|
|
11979
11645
|
(props, forwardedRef) => {
|
|
11980
11646
|
const { __scopeNavigationMenu, value: valueProp, ...itemProps } = props;
|
|
11981
|
-
const autoValue =
|
|
11647
|
+
const autoValue = useId2();
|
|
11982
11648
|
const value = valueProp || autoValue || "LEGACY_REACT_AUTO_VALUE";
|
|
11983
|
-
const contentRef =
|
|
11984
|
-
const triggerRef =
|
|
11985
|
-
const focusProxyRef =
|
|
11986
|
-
const restoreContentTabOrderRef =
|
|
11649
|
+
const contentRef = React60.useRef(null);
|
|
11650
|
+
const triggerRef = React60.useRef(null);
|
|
11651
|
+
const focusProxyRef = React60.useRef(null);
|
|
11652
|
+
const restoreContentTabOrderRef = React60.useRef(() => {
|
|
11987
11653
|
});
|
|
11988
|
-
const wasEscapeCloseRef =
|
|
11989
|
-
const handleContentEntry =
|
|
11654
|
+
const wasEscapeCloseRef = React60.useRef(false);
|
|
11655
|
+
const handleContentEntry = React60.useCallback((side = "start") => {
|
|
11990
11656
|
if (contentRef.current) {
|
|
11991
11657
|
restoreContentTabOrderRef.current();
|
|
11992
11658
|
const candidates = getTabbableCandidates(contentRef.current);
|
|
@@ -11994,7 +11660,7 @@ var NavigationMenuItem = React67.forwardRef(
|
|
|
11994
11660
|
focusFirst(side === "start" ? candidates : candidates.reverse());
|
|
11995
11661
|
}
|
|
11996
11662
|
}, []);
|
|
11997
|
-
const handleContentExit =
|
|
11663
|
+
const handleContentExit = React60.useCallback(() => {
|
|
11998
11664
|
if (contentRef.current) {
|
|
11999
11665
|
const candidates = getTabbableCandidates(contentRef.current);
|
|
12000
11666
|
if (candidates.length)
|
|
@@ -12014,27 +11680,27 @@ var NavigationMenuItem = React67.forwardRef(
|
|
|
12014
11680
|
onFocusProxyEnter: handleContentEntry,
|
|
12015
11681
|
onRootContentClose: handleContentExit,
|
|
12016
11682
|
onContentFocusOutside: handleContentExit,
|
|
12017
|
-
children: /* @__PURE__ */ jsx(
|
|
11683
|
+
children: /* @__PURE__ */ jsx(Primitive.li, { ...itemProps, ref: forwardedRef })
|
|
12018
11684
|
}
|
|
12019
11685
|
);
|
|
12020
11686
|
}
|
|
12021
11687
|
);
|
|
12022
11688
|
NavigationMenuItem.displayName = ITEM_NAME;
|
|
12023
11689
|
var TRIGGER_NAME3 = "NavigationMenuTrigger";
|
|
12024
|
-
var NavigationMenuTrigger =
|
|
11690
|
+
var NavigationMenuTrigger = React60.forwardRef((props, forwardedRef) => {
|
|
12025
11691
|
const { __scopeNavigationMenu, disabled, ...triggerProps } = props;
|
|
12026
11692
|
const context = useNavigationMenuContext(TRIGGER_NAME3, props.__scopeNavigationMenu);
|
|
12027
11693
|
const itemContext = useNavigationMenuItemContext(TRIGGER_NAME3, props.__scopeNavigationMenu);
|
|
12028
|
-
const ref =
|
|
12029
|
-
const composedRefs =
|
|
11694
|
+
const ref = React60.useRef(null);
|
|
11695
|
+
const composedRefs = useComposedRefs(ref, itemContext.triggerRef, forwardedRef);
|
|
12030
11696
|
const triggerId = makeTriggerId(context.baseId, itemContext.value);
|
|
12031
11697
|
const contentId = makeContentId(context.baseId, itemContext.value);
|
|
12032
|
-
const hasPointerMoveOpenedRef =
|
|
12033
|
-
const wasClickCloseRef =
|
|
11698
|
+
const hasPointerMoveOpenedRef = React60.useRef(false);
|
|
11699
|
+
const wasClickCloseRef = React60.useRef(false);
|
|
12034
11700
|
const open = itemContext.value === context.value;
|
|
12035
11701
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
12036
11702
|
/* @__PURE__ */ jsx(Collection.ItemSlot, { scope: __scopeNavigationMenu, value: itemContext.value, children: /* @__PURE__ */ jsx(FocusGroupItem, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
12037
|
-
|
|
11703
|
+
Primitive.button,
|
|
12038
11704
|
{
|
|
12039
11705
|
id: triggerId,
|
|
12040
11706
|
disabled,
|
|
@@ -12044,11 +11710,11 @@ var NavigationMenuTrigger = React67.forwardRef((props, forwardedRef) => {
|
|
|
12044
11710
|
"aria-controls": contentId,
|
|
12045
11711
|
...triggerProps,
|
|
12046
11712
|
ref: composedRefs,
|
|
12047
|
-
onPointerEnter:
|
|
11713
|
+
onPointerEnter: composeEventHandlers(props.onPointerEnter, () => {
|
|
12048
11714
|
wasClickCloseRef.current = false;
|
|
12049
11715
|
itemContext.wasEscapeCloseRef.current = false;
|
|
12050
11716
|
}),
|
|
12051
|
-
onPointerMove:
|
|
11717
|
+
onPointerMove: composeEventHandlers(
|
|
12052
11718
|
props.onPointerMove,
|
|
12053
11719
|
whenMouse(() => {
|
|
12054
11720
|
if (disabled || wasClickCloseRef.current || itemContext.wasEscapeCloseRef.current || hasPointerMoveOpenedRef.current)
|
|
@@ -12057,7 +11723,7 @@ var NavigationMenuTrigger = React67.forwardRef((props, forwardedRef) => {
|
|
|
12057
11723
|
hasPointerMoveOpenedRef.current = true;
|
|
12058
11724
|
})
|
|
12059
11725
|
),
|
|
12060
|
-
onPointerLeave:
|
|
11726
|
+
onPointerLeave: composeEventHandlers(
|
|
12061
11727
|
props.onPointerLeave,
|
|
12062
11728
|
whenMouse(() => {
|
|
12063
11729
|
if (disabled)
|
|
@@ -12066,11 +11732,11 @@ var NavigationMenuTrigger = React67.forwardRef((props, forwardedRef) => {
|
|
|
12066
11732
|
hasPointerMoveOpenedRef.current = false;
|
|
12067
11733
|
})
|
|
12068
11734
|
),
|
|
12069
|
-
onClick:
|
|
11735
|
+
onClick: composeEventHandlers(props.onClick, () => {
|
|
12070
11736
|
context.onItemSelect(itemContext.value);
|
|
12071
11737
|
wasClickCloseRef.current = open;
|
|
12072
11738
|
}),
|
|
12073
|
-
onKeyDown:
|
|
11739
|
+
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
12074
11740
|
const verticalEntryKey = context.dir === "rtl" ? "ArrowLeft" : "ArrowRight";
|
|
12075
11741
|
const entryKey = { horizontal: "ArrowDown", vertical: verticalEntryKey }[context.orientation];
|
|
12076
11742
|
if (open && event.key === entryKey) {
|
|
@@ -12105,17 +11771,17 @@ var NavigationMenuTrigger = React67.forwardRef((props, forwardedRef) => {
|
|
|
12105
11771
|
NavigationMenuTrigger.displayName = TRIGGER_NAME3;
|
|
12106
11772
|
var LINK_NAME = "NavigationMenuLink";
|
|
12107
11773
|
var LINK_SELECT = "navigationMenu.linkSelect";
|
|
12108
|
-
var NavigationMenuLink =
|
|
11774
|
+
var NavigationMenuLink = React60.forwardRef(
|
|
12109
11775
|
(props, forwardedRef) => {
|
|
12110
11776
|
const { __scopeNavigationMenu, active, onSelect, ...linkProps } = props;
|
|
12111
11777
|
return /* @__PURE__ */ jsx(FocusGroupItem, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
12112
|
-
|
|
11778
|
+
Primitive.a,
|
|
12113
11779
|
{
|
|
12114
11780
|
"data-active": active ? "" : void 0,
|
|
12115
11781
|
"aria-current": active ? "page" : void 0,
|
|
12116
11782
|
...linkProps,
|
|
12117
11783
|
ref: forwardedRef,
|
|
12118
|
-
onClick:
|
|
11784
|
+
onClick: composeEventHandlers(
|
|
12119
11785
|
props.onClick,
|
|
12120
11786
|
(event) => {
|
|
12121
11787
|
const target = event.target;
|
|
@@ -12141,27 +11807,27 @@ var NavigationMenuLink = React67.forwardRef(
|
|
|
12141
11807
|
);
|
|
12142
11808
|
NavigationMenuLink.displayName = LINK_NAME;
|
|
12143
11809
|
var INDICATOR_NAME2 = "NavigationMenuIndicator";
|
|
12144
|
-
var NavigationMenuIndicator =
|
|
11810
|
+
var NavigationMenuIndicator = React60.forwardRef((props, forwardedRef) => {
|
|
12145
11811
|
const { forceMount, ...indicatorProps } = props;
|
|
12146
11812
|
const context = useNavigationMenuContext(INDICATOR_NAME2, props.__scopeNavigationMenu);
|
|
12147
11813
|
const isVisible = Boolean(context.value);
|
|
12148
|
-
return context.indicatorTrack ?
|
|
12149
|
-
/* @__PURE__ */ jsx(
|
|
11814
|
+
return context.indicatorTrack ? ReactDOM__default.createPortal(
|
|
11815
|
+
/* @__PURE__ */ jsx(Presence, { present: forceMount || isVisible, children: /* @__PURE__ */ jsx(NavigationMenuIndicatorImpl, { ...indicatorProps, ref: forwardedRef }) }),
|
|
12150
11816
|
context.indicatorTrack
|
|
12151
11817
|
) : null;
|
|
12152
11818
|
});
|
|
12153
11819
|
NavigationMenuIndicator.displayName = INDICATOR_NAME2;
|
|
12154
|
-
var NavigationMenuIndicatorImpl =
|
|
11820
|
+
var NavigationMenuIndicatorImpl = React60.forwardRef((props, forwardedRef) => {
|
|
12155
11821
|
const { __scopeNavigationMenu, ...indicatorProps } = props;
|
|
12156
11822
|
const context = useNavigationMenuContext(INDICATOR_NAME2, __scopeNavigationMenu);
|
|
12157
11823
|
const getItems = useCollection(__scopeNavigationMenu);
|
|
12158
|
-
const [activeTrigger, setActiveTrigger] =
|
|
11824
|
+
const [activeTrigger, setActiveTrigger] = React60.useState(
|
|
12159
11825
|
null
|
|
12160
11826
|
);
|
|
12161
|
-
const [position, setPosition] =
|
|
11827
|
+
const [position, setPosition] = React60.useState(null);
|
|
12162
11828
|
const isHorizontal = context.orientation === "horizontal";
|
|
12163
11829
|
const isVisible = Boolean(context.value);
|
|
12164
|
-
|
|
11830
|
+
React60.useEffect(() => {
|
|
12165
11831
|
const items = getItems();
|
|
12166
11832
|
const triggerNode = items.find((item) => item.value === context.value)?.ref.current;
|
|
12167
11833
|
if (triggerNode)
|
|
@@ -12178,7 +11844,7 @@ var NavigationMenuIndicatorImpl = React67.forwardRef((props, forwardedRef) => {
|
|
|
12178
11844
|
useResizeObserver(activeTrigger, handlePositionChange);
|
|
12179
11845
|
useResizeObserver(context.indicatorTrack, handlePositionChange);
|
|
12180
11846
|
return position ? /* @__PURE__ */ jsx(
|
|
12181
|
-
|
|
11847
|
+
Primitive.div,
|
|
12182
11848
|
{
|
|
12183
11849
|
"aria-hidden": true,
|
|
12184
11850
|
"data-state": isVisible ? "visible" : "hidden",
|
|
@@ -12202,11 +11868,11 @@ var NavigationMenuIndicatorImpl = React67.forwardRef((props, forwardedRef) => {
|
|
|
12202
11868
|
) : null;
|
|
12203
11869
|
});
|
|
12204
11870
|
var CONTENT_NAME4 = "NavigationMenuContent";
|
|
12205
|
-
var NavigationMenuContent =
|
|
11871
|
+
var NavigationMenuContent = React60.forwardRef((props, forwardedRef) => {
|
|
12206
11872
|
const { forceMount, ...contentProps } = props;
|
|
12207
11873
|
const context = useNavigationMenuContext(CONTENT_NAME4, props.__scopeNavigationMenu);
|
|
12208
11874
|
const itemContext = useNavigationMenuItemContext(CONTENT_NAME4, props.__scopeNavigationMenu);
|
|
12209
|
-
const composedRefs =
|
|
11875
|
+
const composedRefs = useComposedRefs(itemContext.contentRef, forwardedRef);
|
|
12210
11876
|
const open = itemContext.value === context.value;
|
|
12211
11877
|
const commonProps = {
|
|
12212
11878
|
value: itemContext.value,
|
|
@@ -12217,14 +11883,14 @@ var NavigationMenuContent = React67.forwardRef((props, forwardedRef) => {
|
|
|
12217
11883
|
onRootContentClose: itemContext.onRootContentClose,
|
|
12218
11884
|
...contentProps
|
|
12219
11885
|
};
|
|
12220
|
-
return !context.viewport ? /* @__PURE__ */ jsx(
|
|
11886
|
+
return !context.viewport ? /* @__PURE__ */ jsx(Presence, { present: forceMount || open, children: /* @__PURE__ */ jsx(
|
|
12221
11887
|
NavigationMenuContentImpl,
|
|
12222
11888
|
{
|
|
12223
11889
|
"data-state": getOpenState(open),
|
|
12224
11890
|
...commonProps,
|
|
12225
11891
|
ref: composedRefs,
|
|
12226
|
-
onPointerEnter:
|
|
12227
|
-
onPointerLeave:
|
|
11892
|
+
onPointerEnter: composeEventHandlers(props.onPointerEnter, context.onContentEnter),
|
|
11893
|
+
onPointerLeave: composeEventHandlers(
|
|
12228
11894
|
props.onPointerLeave,
|
|
12229
11895
|
whenMouse(context.onContentLeave)
|
|
12230
11896
|
),
|
|
@@ -12237,22 +11903,22 @@ var NavigationMenuContent = React67.forwardRef((props, forwardedRef) => {
|
|
|
12237
11903
|
) }) : /* @__PURE__ */ jsx(ViewportContentMounter, { forceMount, ...commonProps, ref: composedRefs });
|
|
12238
11904
|
});
|
|
12239
11905
|
NavigationMenuContent.displayName = CONTENT_NAME4;
|
|
12240
|
-
var ViewportContentMounter =
|
|
11906
|
+
var ViewportContentMounter = React60.forwardRef((props, forwardedRef) => {
|
|
12241
11907
|
const context = useNavigationMenuContext(CONTENT_NAME4, props.__scopeNavigationMenu);
|
|
12242
11908
|
const { onViewportContentChange, onViewportContentRemove } = context;
|
|
12243
|
-
|
|
11909
|
+
useLayoutEffect2(() => {
|
|
12244
11910
|
onViewportContentChange(props.value, {
|
|
12245
11911
|
ref: forwardedRef,
|
|
12246
11912
|
...props
|
|
12247
11913
|
});
|
|
12248
11914
|
}, [props, forwardedRef, onViewportContentChange]);
|
|
12249
|
-
|
|
11915
|
+
useLayoutEffect2(() => {
|
|
12250
11916
|
return () => onViewportContentRemove(props.value);
|
|
12251
11917
|
}, [props.value, onViewportContentRemove]);
|
|
12252
11918
|
return null;
|
|
12253
11919
|
});
|
|
12254
11920
|
var ROOT_CONTENT_DISMISS = "navigationMenu.rootContentDismiss";
|
|
12255
|
-
var NavigationMenuContentImpl =
|
|
11921
|
+
var NavigationMenuContentImpl = React60.forwardRef((props, forwardedRef) => {
|
|
12256
11922
|
const {
|
|
12257
11923
|
__scopeNavigationMenu,
|
|
12258
11924
|
value,
|
|
@@ -12264,14 +11930,14 @@ var NavigationMenuContentImpl = React67.forwardRef((props, forwardedRef) => {
|
|
|
12264
11930
|
...contentProps
|
|
12265
11931
|
} = props;
|
|
12266
11932
|
const context = useNavigationMenuContext(CONTENT_NAME4, __scopeNavigationMenu);
|
|
12267
|
-
const ref =
|
|
12268
|
-
const composedRefs =
|
|
11933
|
+
const ref = React60.useRef(null);
|
|
11934
|
+
const composedRefs = useComposedRefs(ref, forwardedRef);
|
|
12269
11935
|
const triggerId = makeTriggerId(context.baseId, value);
|
|
12270
11936
|
const contentId = makeContentId(context.baseId, value);
|
|
12271
11937
|
const getItems = useCollection(__scopeNavigationMenu);
|
|
12272
|
-
const prevMotionAttributeRef =
|
|
11938
|
+
const prevMotionAttributeRef = React60.useRef(null);
|
|
12273
11939
|
const { onItemDismiss } = context;
|
|
12274
|
-
|
|
11940
|
+
React60.useEffect(() => {
|
|
12275
11941
|
const content = ref.current;
|
|
12276
11942
|
if (context.isRootMenu && content) {
|
|
12277
11943
|
const handleClose = () => {
|
|
@@ -12284,7 +11950,7 @@ var NavigationMenuContentImpl = React67.forwardRef((props, forwardedRef) => {
|
|
|
12284
11950
|
return () => content.removeEventListener(ROOT_CONTENT_DISMISS, handleClose);
|
|
12285
11951
|
}
|
|
12286
11952
|
}, [context.isRootMenu, props.value, triggerRef, onItemDismiss, onRootContentClose]);
|
|
12287
|
-
const motionAttribute =
|
|
11953
|
+
const motionAttribute = React60.useMemo(() => {
|
|
12288
11954
|
const items = getItems();
|
|
12289
11955
|
const values = items.map((item) => item.value);
|
|
12290
11956
|
if (context.dir === "rtl")
|
|
@@ -12324,20 +11990,20 @@ var NavigationMenuContentImpl = React67.forwardRef((props, forwardedRef) => {
|
|
|
12324
11990
|
});
|
|
12325
11991
|
ref.current?.dispatchEvent(rootContentDismissEvent);
|
|
12326
11992
|
},
|
|
12327
|
-
onFocusOutside:
|
|
11993
|
+
onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => {
|
|
12328
11994
|
onContentFocusOutside();
|
|
12329
11995
|
const target = event.target;
|
|
12330
11996
|
if (context.rootNavigationMenu?.contains(target))
|
|
12331
11997
|
event.preventDefault();
|
|
12332
11998
|
}),
|
|
12333
|
-
onPointerDownOutside:
|
|
11999
|
+
onPointerDownOutside: composeEventHandlers(props.onPointerDownOutside, (event) => {
|
|
12334
12000
|
const target = event.target;
|
|
12335
12001
|
const isTrigger = getItems().some((item) => item.ref.current?.contains(target));
|
|
12336
12002
|
const isRootViewport = context.isRootMenu && context.viewport?.contains(target);
|
|
12337
12003
|
if (isTrigger || isRootViewport || !context.isRootMenu)
|
|
12338
12004
|
event.preventDefault();
|
|
12339
12005
|
}),
|
|
12340
|
-
onKeyDown:
|
|
12006
|
+
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
12341
12007
|
const isMetaKey = event.altKey || event.ctrlKey || event.metaKey;
|
|
12342
12008
|
const isTabKey = event.key === "Tab" && !isMetaKey;
|
|
12343
12009
|
if (isTabKey) {
|
|
@@ -12353,30 +12019,30 @@ var NavigationMenuContentImpl = React67.forwardRef((props, forwardedRef) => {
|
|
|
12353
12019
|
}
|
|
12354
12020
|
}
|
|
12355
12021
|
}),
|
|
12356
|
-
onEscapeKeyDown:
|
|
12022
|
+
onEscapeKeyDown: composeEventHandlers(props.onEscapeKeyDown, (_event) => {
|
|
12357
12023
|
wasEscapeCloseRef.current = true;
|
|
12358
12024
|
})
|
|
12359
12025
|
}
|
|
12360
12026
|
) });
|
|
12361
12027
|
});
|
|
12362
12028
|
var VIEWPORT_NAME = "NavigationMenuViewport";
|
|
12363
|
-
var NavigationMenuViewport =
|
|
12029
|
+
var NavigationMenuViewport = React60.forwardRef((props, forwardedRef) => {
|
|
12364
12030
|
const { forceMount, ...viewportProps } = props;
|
|
12365
12031
|
const context = useNavigationMenuContext(VIEWPORT_NAME, props.__scopeNavigationMenu);
|
|
12366
12032
|
const open = Boolean(context.value);
|
|
12367
|
-
return /* @__PURE__ */ jsx(
|
|
12033
|
+
return /* @__PURE__ */ jsx(Presence, { present: forceMount || open, children: /* @__PURE__ */ jsx(NavigationMenuViewportImpl, { ...viewportProps, ref: forwardedRef }) });
|
|
12368
12034
|
});
|
|
12369
12035
|
NavigationMenuViewport.displayName = VIEWPORT_NAME;
|
|
12370
|
-
var NavigationMenuViewportImpl =
|
|
12036
|
+
var NavigationMenuViewportImpl = React60.forwardRef((props, forwardedRef) => {
|
|
12371
12037
|
const { __scopeNavigationMenu, children, ...viewportImplProps } = props;
|
|
12372
12038
|
const context = useNavigationMenuContext(VIEWPORT_NAME, __scopeNavigationMenu);
|
|
12373
|
-
const composedRefs =
|
|
12039
|
+
const composedRefs = useComposedRefs(forwardedRef, context.onViewportChange);
|
|
12374
12040
|
const viewportContentContext = useViewportContentContext(
|
|
12375
12041
|
CONTENT_NAME4,
|
|
12376
12042
|
props.__scopeNavigationMenu
|
|
12377
12043
|
);
|
|
12378
|
-
const [size4, setSize] =
|
|
12379
|
-
const [content, setContent2] =
|
|
12044
|
+
const [size4, setSize] = React60.useState(null);
|
|
12045
|
+
const [content, setContent2] = React60.useState(null);
|
|
12380
12046
|
const viewportWidth = size4 ? size4?.width + "px" : void 0;
|
|
12381
12047
|
const viewportHeight = size4 ? size4?.height + "px" : void 0;
|
|
12382
12048
|
const open = Boolean(context.value);
|
|
@@ -12387,7 +12053,7 @@ var NavigationMenuViewportImpl = React67.forwardRef((props, forwardedRef) => {
|
|
|
12387
12053
|
};
|
|
12388
12054
|
useResizeObserver(content, handleSizeChange);
|
|
12389
12055
|
return /* @__PURE__ */ jsx(
|
|
12390
|
-
|
|
12056
|
+
Primitive.div,
|
|
12391
12057
|
{
|
|
12392
12058
|
"data-state": getOpenState(open),
|
|
12393
12059
|
"data-orientation": context.orientation,
|
|
@@ -12400,15 +12066,15 @@ var NavigationMenuViewportImpl = React67.forwardRef((props, forwardedRef) => {
|
|
|
12400
12066
|
["--radix-navigation-menu-viewport-height"]: viewportHeight,
|
|
12401
12067
|
...viewportImplProps.style
|
|
12402
12068
|
},
|
|
12403
|
-
onPointerEnter:
|
|
12404
|
-
onPointerLeave:
|
|
12069
|
+
onPointerEnter: composeEventHandlers(props.onPointerEnter, context.onContentEnter),
|
|
12070
|
+
onPointerLeave: composeEventHandlers(props.onPointerLeave, whenMouse(context.onContentLeave)),
|
|
12405
12071
|
children: Array.from(viewportContentContext.items).map(([value, { ref, forceMount, ...props2 }]) => {
|
|
12406
12072
|
const isActive2 = activeContentValue === value;
|
|
12407
|
-
return /* @__PURE__ */ jsx(
|
|
12073
|
+
return /* @__PURE__ */ jsx(Presence, { present: forceMount || isActive2, children: /* @__PURE__ */ jsx(
|
|
12408
12074
|
NavigationMenuContentImpl,
|
|
12409
12075
|
{
|
|
12410
12076
|
...props2,
|
|
12411
|
-
ref:
|
|
12077
|
+
ref: composeRefs(ref, (node) => {
|
|
12412
12078
|
if (isActive2 && node)
|
|
12413
12079
|
setContent2(node);
|
|
12414
12080
|
})
|
|
@@ -12419,26 +12085,26 @@ var NavigationMenuViewportImpl = React67.forwardRef((props, forwardedRef) => {
|
|
|
12419
12085
|
);
|
|
12420
12086
|
});
|
|
12421
12087
|
var FOCUS_GROUP_NAME = "FocusGroup";
|
|
12422
|
-
var FocusGroup =
|
|
12088
|
+
var FocusGroup = React60.forwardRef(
|
|
12423
12089
|
(props, forwardedRef) => {
|
|
12424
12090
|
const { __scopeNavigationMenu, ...groupProps } = props;
|
|
12425
12091
|
const context = useNavigationMenuContext(FOCUS_GROUP_NAME, __scopeNavigationMenu);
|
|
12426
|
-
return /* @__PURE__ */ jsx(FocusGroupCollection.Provider, { scope: __scopeNavigationMenu, children: /* @__PURE__ */ jsx(FocusGroupCollection.Slot, { scope: __scopeNavigationMenu, children: /* @__PURE__ */ jsx(
|
|
12092
|
+
return /* @__PURE__ */ jsx(FocusGroupCollection.Provider, { scope: __scopeNavigationMenu, children: /* @__PURE__ */ jsx(FocusGroupCollection.Slot, { scope: __scopeNavigationMenu, children: /* @__PURE__ */ jsx(Primitive.div, { dir: context.dir, ...groupProps, ref: forwardedRef }) }) });
|
|
12427
12093
|
}
|
|
12428
12094
|
);
|
|
12429
12095
|
var ARROW_KEYS = ["ArrowRight", "ArrowLeft", "ArrowUp", "ArrowDown"];
|
|
12430
12096
|
var FOCUS_GROUP_ITEM_NAME = "FocusGroupItem";
|
|
12431
|
-
var FocusGroupItem =
|
|
12097
|
+
var FocusGroupItem = React60.forwardRef(
|
|
12432
12098
|
(props, forwardedRef) => {
|
|
12433
12099
|
const { __scopeNavigationMenu, ...groupProps } = props;
|
|
12434
12100
|
const getItems = useFocusGroupCollection(__scopeNavigationMenu);
|
|
12435
12101
|
const context = useNavigationMenuContext(FOCUS_GROUP_ITEM_NAME, __scopeNavigationMenu);
|
|
12436
12102
|
return /* @__PURE__ */ jsx(FocusGroupCollection.ItemSlot, { scope: __scopeNavigationMenu, children: /* @__PURE__ */ jsx(
|
|
12437
|
-
|
|
12103
|
+
Primitive.button,
|
|
12438
12104
|
{
|
|
12439
12105
|
...groupProps,
|
|
12440
12106
|
ref: forwardedRef,
|
|
12441
|
-
onKeyDown:
|
|
12107
|
+
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
|
|
12442
12108
|
const isFocusNavigationKey = ["Home", "End", ...ARROW_KEYS].includes(event.key);
|
|
12443
12109
|
if (isFocusNavigationKey) {
|
|
12444
12110
|
let candidateNodes = getItems().map((item) => item.ref.current);
|
|
@@ -12495,7 +12161,7 @@ function removeFromTabOrder(candidates) {
|
|
|
12495
12161
|
}
|
|
12496
12162
|
function useResizeObserver(element, onResize) {
|
|
12497
12163
|
const handleResize = useCallbackRef(onResize);
|
|
12498
|
-
|
|
12164
|
+
useLayoutEffect2(() => {
|
|
12499
12165
|
let rAF = 0;
|
|
12500
12166
|
if (element) {
|
|
12501
12167
|
const resizeObserver = new ResizeObserver(() => {
|
|
@@ -12530,7 +12196,7 @@ var Link = NavigationMenuLink;
|
|
|
12530
12196
|
var Indicator3 = NavigationMenuIndicator;
|
|
12531
12197
|
var Content12 = NavigationMenuContent;
|
|
12532
12198
|
var Viewport4 = NavigationMenuViewport;
|
|
12533
|
-
var NavigationMenu2 =
|
|
12199
|
+
var NavigationMenu2 = React60.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
12534
12200
|
Root24,
|
|
12535
12201
|
{
|
|
12536
12202
|
ref,
|
|
@@ -12546,7 +12212,7 @@ var NavigationMenu2 = React67.forwardRef(({ className, children, ...props }, ref
|
|
|
12546
12212
|
}
|
|
12547
12213
|
));
|
|
12548
12214
|
NavigationMenu2.displayName = Root24.displayName;
|
|
12549
|
-
var NavigationMenuList2 =
|
|
12215
|
+
var NavigationMenuList2 = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
12550
12216
|
List3,
|
|
12551
12217
|
{
|
|
12552
12218
|
ref,
|
|
@@ -12562,7 +12228,7 @@ var NavigationMenuItem2 = Item4;
|
|
|
12562
12228
|
var navigationMenuTriggerStyle = cva(
|
|
12563
12229
|
"group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"
|
|
12564
12230
|
);
|
|
12565
|
-
var NavigationMenuTrigger2 =
|
|
12231
|
+
var NavigationMenuTrigger2 = React60.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
12566
12232
|
Trigger12,
|
|
12567
12233
|
{
|
|
12568
12234
|
ref,
|
|
@@ -12582,7 +12248,7 @@ var NavigationMenuTrigger2 = React67.forwardRef(({ className, children, ...props
|
|
|
12582
12248
|
}
|
|
12583
12249
|
));
|
|
12584
12250
|
NavigationMenuTrigger2.displayName = Trigger12.displayName;
|
|
12585
|
-
var NavigationMenuContent2 =
|
|
12251
|
+
var NavigationMenuContent2 = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
12586
12252
|
Content12,
|
|
12587
12253
|
{
|
|
12588
12254
|
ref,
|
|
@@ -12595,7 +12261,7 @@ var NavigationMenuContent2 = React67.forwardRef(({ className, ...props }, ref) =
|
|
|
12595
12261
|
));
|
|
12596
12262
|
NavigationMenuContent2.displayName = Content12.displayName;
|
|
12597
12263
|
var NavigationMenuLink2 = Link;
|
|
12598
|
-
var NavigationMenuViewport2 =
|
|
12264
|
+
var NavigationMenuViewport2 = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: cn("absolute left-0 top-full flex justify-center"), children: /* @__PURE__ */ jsx(
|
|
12599
12265
|
Viewport4,
|
|
12600
12266
|
{
|
|
12601
12267
|
className: cn(
|
|
@@ -12607,7 +12273,7 @@ var NavigationMenuViewport2 = React67.forwardRef(({ className, ...props }, ref)
|
|
|
12607
12273
|
}
|
|
12608
12274
|
) }));
|
|
12609
12275
|
NavigationMenuViewport2.displayName = Viewport4.displayName;
|
|
12610
|
-
var NavigationMenuIndicator2 =
|
|
12276
|
+
var NavigationMenuIndicator2 = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
12611
12277
|
Indicator3,
|
|
12612
12278
|
{
|
|
12613
12279
|
ref,
|
|
@@ -12620,19 +12286,99 @@ var NavigationMenuIndicator2 = React67.forwardRef(({ className, ...props }, ref)
|
|
|
12620
12286
|
}
|
|
12621
12287
|
));
|
|
12622
12288
|
NavigationMenuIndicator2.displayName = Indicator3.displayName;
|
|
12623
|
-
|
|
12624
|
-
|
|
12289
|
+
var CACHE_KEY = "moonui_license_cache";
|
|
12290
|
+
var CACHE_DURATION = 24 * 60 * 60 * 1e3;
|
|
12291
|
+
var OFFLINE_GRACE_PERIOD = 7 * 24 * 60 * 60 * 1e3;
|
|
12625
12292
|
function useSubscription() {
|
|
12293
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
12294
|
+
const [hasProAccess, setHasProAccess] = useState(true);
|
|
12295
|
+
const [isAuthenticated, setIsAuthenticated] = useState(true);
|
|
12296
|
+
useEffect(() => {
|
|
12297
|
+
const checkLicense = async () => {
|
|
12298
|
+
try {
|
|
12299
|
+
const cached = localStorage.getItem(CACHE_KEY);
|
|
12300
|
+
if (cached) {
|
|
12301
|
+
const cacheData = JSON.parse(cached);
|
|
12302
|
+
const now = Date.now();
|
|
12303
|
+
if (now - cacheData.timestamp < CACHE_DURATION) {
|
|
12304
|
+
setHasProAccess(cacheData.valid && cacheData.hasLifetimeAccess);
|
|
12305
|
+
setIsAuthenticated(cacheData.valid);
|
|
12306
|
+
setIsLoading(false);
|
|
12307
|
+
return;
|
|
12308
|
+
}
|
|
12309
|
+
if (now - cacheData.timestamp < OFFLINE_GRACE_PERIOD) {
|
|
12310
|
+
validateLicense().catch(() => {
|
|
12311
|
+
setHasProAccess(cacheData.valid && cacheData.hasLifetimeAccess);
|
|
12312
|
+
setIsAuthenticated(cacheData.valid);
|
|
12313
|
+
});
|
|
12314
|
+
setIsLoading(false);
|
|
12315
|
+
return;
|
|
12316
|
+
}
|
|
12317
|
+
}
|
|
12318
|
+
await validateLicense();
|
|
12319
|
+
} catch (error) {
|
|
12320
|
+
console.error("License check error:", error);
|
|
12321
|
+
setHasProAccess(true);
|
|
12322
|
+
setIsAuthenticated(true);
|
|
12323
|
+
} finally {
|
|
12324
|
+
setIsLoading(false);
|
|
12325
|
+
}
|
|
12326
|
+
};
|
|
12327
|
+
checkLicense();
|
|
12328
|
+
}, []);
|
|
12329
|
+
const validateLicense = async () => {
|
|
12330
|
+
const token = process.env.NEXT_PUBLIC_MOONUI_AUTH_TOKEN || localStorage.getItem("moonui_auth_token");
|
|
12331
|
+
if (!token) {
|
|
12332
|
+
setHasProAccess(true);
|
|
12333
|
+
setIsAuthenticated(true);
|
|
12334
|
+
return;
|
|
12335
|
+
}
|
|
12336
|
+
try {
|
|
12337
|
+
const response = await fetch("https://moonui.dev/api/auth/validate", {
|
|
12338
|
+
headers: {
|
|
12339
|
+
"Authorization": `Bearer ${token}`
|
|
12340
|
+
}
|
|
12341
|
+
});
|
|
12342
|
+
if (response.ok) {
|
|
12343
|
+
const data = await response.json();
|
|
12344
|
+
const cacheData = {
|
|
12345
|
+
valid: data.valid,
|
|
12346
|
+
hasLifetimeAccess: data.user?.hasLifetimeAccess || false,
|
|
12347
|
+
timestamp: Date.now(),
|
|
12348
|
+
cacheUntil: data.cacheUntil ? new Date(data.cacheUntil).getTime() : void 0
|
|
12349
|
+
};
|
|
12350
|
+
localStorage.setItem(CACHE_KEY, JSON.stringify(cacheData));
|
|
12351
|
+
setHasProAccess(data.valid && (data.user?.hasLifetimeAccess || data.user?.features?.includes("pro_components")));
|
|
12352
|
+
setIsAuthenticated(data.valid);
|
|
12353
|
+
} else {
|
|
12354
|
+
localStorage.removeItem(CACHE_KEY);
|
|
12355
|
+
setHasProAccess(false);
|
|
12356
|
+
setIsAuthenticated(false);
|
|
12357
|
+
}
|
|
12358
|
+
} catch (error) {
|
|
12359
|
+
const cached = localStorage.getItem(CACHE_KEY);
|
|
12360
|
+
if (cached) {
|
|
12361
|
+
const cacheData = JSON.parse(cached);
|
|
12362
|
+
const now = Date.now();
|
|
12363
|
+
if (now - cacheData.timestamp < OFFLINE_GRACE_PERIOD) {
|
|
12364
|
+
setHasProAccess(cacheData.valid && cacheData.hasLifetimeAccess);
|
|
12365
|
+
setIsAuthenticated(cacheData.valid);
|
|
12366
|
+
return;
|
|
12367
|
+
}
|
|
12368
|
+
}
|
|
12369
|
+
setHasProAccess(false);
|
|
12370
|
+
setIsAuthenticated(false);
|
|
12371
|
+
}
|
|
12372
|
+
};
|
|
12626
12373
|
return {
|
|
12627
|
-
isLoading
|
|
12628
|
-
isAuthenticated
|
|
12374
|
+
isLoading,
|
|
12375
|
+
isAuthenticated,
|
|
12629
12376
|
isAdmin: false,
|
|
12630
|
-
hasProAccess
|
|
12631
|
-
|
|
12632
|
-
subscriptionPlan: "pro",
|
|
12377
|
+
hasProAccess,
|
|
12378
|
+
subscriptionPlan: hasProAccess ? "lifetime" : "free",
|
|
12633
12379
|
subscription: {
|
|
12634
|
-
status: "active",
|
|
12635
|
-
plan: "
|
|
12380
|
+
status: hasProAccess ? "active" : "inactive",
|
|
12381
|
+
plan: hasProAccess ? "lifetime" : "free"
|
|
12636
12382
|
}
|
|
12637
12383
|
};
|
|
12638
12384
|
}
|
|
@@ -12744,7 +12490,7 @@ var calculateSnapPoint = (offset4, velocity, snapPoints, direction, viewportSize
|
|
|
12744
12490
|
(prev, curr) => Math.abs(curr - currentPosition) < Math.abs(prev - currentPosition) ? curr : prev
|
|
12745
12491
|
);
|
|
12746
12492
|
};
|
|
12747
|
-
var MoonUIGestureDrawerProComponent =
|
|
12493
|
+
var MoonUIGestureDrawerProComponent = React60__default.forwardRef(({
|
|
12748
12494
|
isOpen,
|
|
12749
12495
|
onOpenChange,
|
|
12750
12496
|
children,
|
|
@@ -13002,7 +12748,7 @@ var MoonUIGestureDrawerProComponent = React67__default.forwardRef(({
|
|
|
13002
12748
|
return drawerContent;
|
|
13003
12749
|
});
|
|
13004
12750
|
MoonUIGestureDrawerProComponent.displayName = "MoonUIGestureDrawerProComponent";
|
|
13005
|
-
var MoonUIGestureDrawerPro =
|
|
12751
|
+
var MoonUIGestureDrawerPro = React60__default.forwardRef((props, ref) => {
|
|
13006
12752
|
const { hasProAccess, isLoading } = useSubscription();
|
|
13007
12753
|
if (!isLoading && !hasProAccess) {
|
|
13008
12754
|
return /* @__PURE__ */ jsx(MoonUICardPro, { className: "w-fit mx-auto", children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "py-6 text-center", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
|
|
@@ -13037,19 +12783,19 @@ var lightboxVariants = cva(
|
|
|
13037
12783
|
}
|
|
13038
12784
|
}
|
|
13039
12785
|
);
|
|
13040
|
-
var LightboxContext =
|
|
12786
|
+
var LightboxContext = React60.createContext(void 0);
|
|
13041
12787
|
function useLightbox() {
|
|
13042
|
-
const context =
|
|
12788
|
+
const context = React60.useContext(LightboxContext);
|
|
13043
12789
|
if (!context) {
|
|
13044
12790
|
throw new Error("useLightbox must be used within a LightboxProvider");
|
|
13045
12791
|
}
|
|
13046
12792
|
return context;
|
|
13047
12793
|
}
|
|
13048
12794
|
function LightboxProvider({ children, items = [], defaultIndex = 0 }) {
|
|
13049
|
-
const [currentIndex, setCurrentIndex] =
|
|
13050
|
-
const [isOpen, setIsOpen] =
|
|
13051
|
-
const [zoom, setZoom] =
|
|
13052
|
-
const value =
|
|
12795
|
+
const [currentIndex, setCurrentIndex] = React60.useState(defaultIndex);
|
|
12796
|
+
const [isOpen, setIsOpen] = React60.useState(false);
|
|
12797
|
+
const [zoom, setZoom] = React60.useState(1);
|
|
12798
|
+
const value = React60.useMemo(
|
|
13053
12799
|
() => ({
|
|
13054
12800
|
items,
|
|
13055
12801
|
currentIndex,
|
|
@@ -13063,7 +12809,7 @@ function LightboxProvider({ children, items = [], defaultIndex = 0 }) {
|
|
|
13063
12809
|
);
|
|
13064
12810
|
return /* @__PURE__ */ jsx(LightboxContext.Provider, { value, children });
|
|
13065
12811
|
}
|
|
13066
|
-
var LightboxTrigger =
|
|
12812
|
+
var LightboxTrigger = React60.forwardRef(
|
|
13067
12813
|
({ index: index2 = 0, asChild, children, onClick, ...props }, ref) => {
|
|
13068
12814
|
const { setCurrentIndex, setIsOpen, setZoom } = useLightbox();
|
|
13069
12815
|
const handleClick2 = (e) => {
|
|
@@ -13075,7 +12821,7 @@ var LightboxTrigger = React67.forwardRef(
|
|
|
13075
12821
|
if (asChild) {
|
|
13076
12822
|
const child = children;
|
|
13077
12823
|
const { onDrag: onDrag2, onDragStart: onDragStart2, onDragEnd: onDragEnd2, onDragOver: onDragOver2, onDrop: onDrop2, ...filteredProps2 } = props;
|
|
13078
|
-
return
|
|
12824
|
+
return React60.cloneElement(child, {
|
|
13079
12825
|
...child.props,
|
|
13080
12826
|
...filteredProps2,
|
|
13081
12827
|
onClick: handleClick2
|
|
@@ -13086,7 +12832,7 @@ var LightboxTrigger = React67.forwardRef(
|
|
|
13086
12832
|
}
|
|
13087
12833
|
);
|
|
13088
12834
|
LightboxTrigger.displayName = "LightboxTrigger";
|
|
13089
|
-
var LightboxContent =
|
|
12835
|
+
var LightboxContent = React60.forwardRef(
|
|
13090
12836
|
({
|
|
13091
12837
|
className,
|
|
13092
12838
|
backdrop,
|
|
@@ -13104,16 +12850,16 @@ var LightboxContent = React67.forwardRef(
|
|
|
13104
12850
|
}, ref) => {
|
|
13105
12851
|
const { onDrag, onDragStart, onDragEnd, onDragOver, onDrop, onAnimationStart, onAnimationEnd, onAnimationIteration, ...props } = restProps;
|
|
13106
12852
|
const { items, currentIndex, setCurrentIndex, isOpen, setIsOpen, zoom, setZoom } = useLightbox();
|
|
13107
|
-
const [isLoading, setIsLoading] =
|
|
13108
|
-
const [isPlaying, setIsPlaying] =
|
|
13109
|
-
const [isMuted, setIsMuted] =
|
|
13110
|
-
const [isFullscreen, setIsFullscreen] =
|
|
13111
|
-
const [position, setPosition] =
|
|
13112
|
-
const [isDragging, setIsDragging] =
|
|
13113
|
-
const containerRef =
|
|
13114
|
-
const videoRef =
|
|
12853
|
+
const [isLoading, setIsLoading] = React60.useState(true);
|
|
12854
|
+
const [isPlaying, setIsPlaying] = React60.useState(false);
|
|
12855
|
+
const [isMuted, setIsMuted] = React60.useState(true);
|
|
12856
|
+
const [isFullscreen, setIsFullscreen] = React60.useState(false);
|
|
12857
|
+
const [position, setPosition] = React60.useState({ x: 0, y: 0 });
|
|
12858
|
+
const [isDragging, setIsDragging] = React60.useState(false);
|
|
12859
|
+
const containerRef = React60.useRef(null);
|
|
12860
|
+
const videoRef = React60.useRef(null);
|
|
13115
12861
|
const currentItem = items[currentIndex];
|
|
13116
|
-
|
|
12862
|
+
React60.useEffect(() => {
|
|
13117
12863
|
if (currentItem?.type === "video" && autoPlayVideo) {
|
|
13118
12864
|
setIsPlaying(true);
|
|
13119
12865
|
setIsMuted(true);
|
|
@@ -13121,7 +12867,7 @@ var LightboxContent = React67.forwardRef(
|
|
|
13121
12867
|
setIsPlaying(false);
|
|
13122
12868
|
}
|
|
13123
12869
|
}, [currentIndex, currentItem, autoPlayVideo]);
|
|
13124
|
-
|
|
12870
|
+
React60.useEffect(() => {
|
|
13125
12871
|
if (!enableKeyboardNavigation || !isOpen)
|
|
13126
12872
|
return;
|
|
13127
12873
|
const handleKeyDown3 = (e) => {
|
|
@@ -13153,7 +12899,7 @@ var LightboxContent = React67.forwardRef(
|
|
|
13153
12899
|
window.addEventListener("keydown", handleKeyDown3);
|
|
13154
12900
|
return () => window.removeEventListener("keydown", handleKeyDown3);
|
|
13155
12901
|
}, [isOpen, currentIndex, isPlaying, enableKeyboardNavigation]);
|
|
13156
|
-
|
|
12902
|
+
React60.useEffect(() => {
|
|
13157
12903
|
if (videoRef.current && currentItem?.type === "video") {
|
|
13158
12904
|
if (isPlaying) {
|
|
13159
12905
|
videoRef.current.play().catch((err) => {
|
|
@@ -13528,7 +13274,7 @@ var galleryItemVariants = cva(
|
|
|
13528
13274
|
}
|
|
13529
13275
|
}
|
|
13530
13276
|
);
|
|
13531
|
-
var MoonUIMediaGalleryPro =
|
|
13277
|
+
var MoonUIMediaGalleryPro = React60.forwardRef(({
|
|
13532
13278
|
className,
|
|
13533
13279
|
items,
|
|
13534
13280
|
layout,
|
|
@@ -13557,13 +13303,13 @@ var MoonUIMediaGalleryPro = React67.forwardRef(({
|
|
|
13557
13303
|
lightboxProps,
|
|
13558
13304
|
...props
|
|
13559
13305
|
}, ref) => {
|
|
13560
|
-
const [activeCategory, setActiveCategory] =
|
|
13561
|
-
const [activeSort, setActiveSort] =
|
|
13562
|
-
const [showFilters, setShowFilters] =
|
|
13563
|
-
const [loadedImages, setLoadedImages] =
|
|
13564
|
-
const observerRef =
|
|
13565
|
-
const loadMoreRef =
|
|
13566
|
-
const filteredItems =
|
|
13306
|
+
const [activeCategory, setActiveCategory] = React60.useState(defaultCategory);
|
|
13307
|
+
const [activeSort, setActiveSort] = React60.useState(defaultSort);
|
|
13308
|
+
const [showFilters, setShowFilters] = React60.useState(false);
|
|
13309
|
+
const [loadedImages, setLoadedImages] = React60.useState(/* @__PURE__ */ new Set());
|
|
13310
|
+
const observerRef = React60.useRef(null);
|
|
13311
|
+
const loadMoreRef = React60.useRef(null);
|
|
13312
|
+
const filteredItems = React60.useMemo(() => {
|
|
13567
13313
|
if (!enableFiltering || activeCategory === "all")
|
|
13568
13314
|
return items;
|
|
13569
13315
|
return items.filter((item) => {
|
|
@@ -13577,7 +13323,7 @@ var MoonUIMediaGalleryPro = React67.forwardRef(({
|
|
|
13577
13323
|
return true;
|
|
13578
13324
|
});
|
|
13579
13325
|
}, [items, activeCategory, enableFiltering]);
|
|
13580
|
-
const sortedItems =
|
|
13326
|
+
const sortedItems = React60.useMemo(() => {
|
|
13581
13327
|
if (!enableSorting || activeSort === "default")
|
|
13582
13328
|
return filteredItems;
|
|
13583
13329
|
const sortOption = sortOptions.find((opt) => opt.id === activeSort);
|
|
@@ -13591,7 +13337,7 @@ var MoonUIMediaGalleryPro = React67.forwardRef(({
|
|
|
13591
13337
|
{ id: "video", label: "Videos", icon: /* @__PURE__ */ jsx(Video, { className: "h-4 w-4" }) }
|
|
13592
13338
|
];
|
|
13593
13339
|
const finalCategories = categories.length > 0 ? categories : defaultCategories;
|
|
13594
|
-
|
|
13340
|
+
React60.useEffect(() => {
|
|
13595
13341
|
if (!lazyLoad)
|
|
13596
13342
|
return;
|
|
13597
13343
|
observerRef.current = new IntersectionObserver(
|
|
@@ -13609,7 +13355,7 @@ var MoonUIMediaGalleryPro = React67.forwardRef(({
|
|
|
13609
13355
|
observerRef.current?.disconnect();
|
|
13610
13356
|
};
|
|
13611
13357
|
}, [lazyLoad]);
|
|
13612
|
-
|
|
13358
|
+
React60.useEffect(() => {
|
|
13613
13359
|
if (!infiniteScroll || !onLoadMore || !hasMore)
|
|
13614
13360
|
return;
|
|
13615
13361
|
const observer = new IntersectionObserver(
|
|
@@ -13786,7 +13532,7 @@ var MoonUIMediaGalleryPro = React67.forwardRef(({
|
|
|
13786
13532
|
className
|
|
13787
13533
|
),
|
|
13788
13534
|
style: layout === "masonry" ? { columnGap: "1rem" } : void 0,
|
|
13789
|
-
children: loadingState ? /* @__PURE__ */ jsx(Fragment, { children: Array.from({ length: skeletonCount }).map((_, i) => /* @__PURE__ */ jsx(
|
|
13535
|
+
children: loadingState ? /* @__PURE__ */ jsx(Fragment, { children: Array.from({ length: skeletonCount }).map((_, i) => /* @__PURE__ */ jsx(React60.Fragment, { children: renderSkeleton() }, i)) }) : sortedItems.length > 0 ? sortedItems.map((item, index2) => renderGalleryItem(item, index2)) : emptyState || /* @__PURE__ */ jsxs("div", { className: "col-span-full flex flex-col items-center justify-center py-12 text-center", children: [
|
|
13790
13536
|
/* @__PURE__ */ jsx(Image$1, { className: "h-12 w-12 text-muted-foreground mb-4" }),
|
|
13791
13537
|
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: "No media items found" })
|
|
13792
13538
|
] })
|
|
@@ -13803,7 +13549,7 @@ var MoonUIMediaGalleryPro = React67.forwardRef(({
|
|
|
13803
13549
|
return galleryContent;
|
|
13804
13550
|
});
|
|
13805
13551
|
MoonUIMediaGalleryPro.displayName = "MoonUIMediaGalleryPro";
|
|
13806
|
-
var MoonUIGalleryItemPro =
|
|
13552
|
+
var MoonUIGalleryItemPro = React60.forwardRef(({
|
|
13807
13553
|
className,
|
|
13808
13554
|
item,
|
|
13809
13555
|
index: index2 = 0,
|
|
@@ -13816,7 +13562,7 @@ var MoonUIGalleryItemPro = React67.forwardRef(({
|
|
|
13816
13562
|
onLoad,
|
|
13817
13563
|
...props
|
|
13818
13564
|
}, ref) => {
|
|
13819
|
-
const [isLoaded, setIsLoaded] =
|
|
13565
|
+
const [isLoaded, setIsLoaded] = React60.useState(false);
|
|
13820
13566
|
const handleLoad = () => {
|
|
13821
13567
|
setIsLoaded(true);
|
|
13822
13568
|
onLoad?.();
|
|
@@ -13892,7 +13638,7 @@ var moonUIAnimatedButtonProVariants = cva(
|
|
|
13892
13638
|
}
|
|
13893
13639
|
}
|
|
13894
13640
|
);
|
|
13895
|
-
var MoonUIAnimatedButtonProInternal =
|
|
13641
|
+
var MoonUIAnimatedButtonProInternal = React60__default.forwardRef(
|
|
13896
13642
|
({
|
|
13897
13643
|
className,
|
|
13898
13644
|
variant,
|
|
@@ -14086,9 +13832,9 @@ var MoonUIAnimatedButtonProInternal = React67__default.forwardRef(
|
|
|
14086
13832
|
) : (
|
|
14087
13833
|
// Diğer boyutlar için normal akış
|
|
14088
13834
|
/* @__PURE__ */ jsx(Fragment, { children: currentState === "idle" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14089
|
-
|
|
13835
|
+
React60__default.isValidElement(children) && React60__default.cloneElement(children),
|
|
14090
13836
|
typeof children === "string" && children,
|
|
14091
|
-
|
|
13837
|
+
React60__default.isValidElement(children) || typeof children === "string" ? null : children
|
|
14092
13838
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
14093
13839
|
getIcon(),
|
|
14094
13840
|
/* @__PURE__ */ jsxs("span", { className: "ml-2", children: [
|
|
@@ -14133,7 +13879,7 @@ var MoonUIAnimatedButtonProInternal = React67__default.forwardRef(
|
|
|
14133
13879
|
}
|
|
14134
13880
|
);
|
|
14135
13881
|
MoonUIAnimatedButtonProInternal.displayName = "MoonUIAnimatedButtonProInternal";
|
|
14136
|
-
var MoonUIAnimatedButtonPro =
|
|
13882
|
+
var MoonUIAnimatedButtonPro = React60__default.forwardRef(
|
|
14137
13883
|
(props, ref) => {
|
|
14138
13884
|
const { hasProAccess, isLoading } = useSubscription();
|
|
14139
13885
|
if (!isLoading && !hasProAccess) {
|
|
@@ -14284,7 +14030,7 @@ function ErrorBoundaryWrapper(props) {
|
|
|
14284
14030
|
return /* @__PURE__ */ jsx(ErrorBoundaryInternal, { ...props });
|
|
14285
14031
|
}
|
|
14286
14032
|
var ErrorBoundary = ErrorBoundaryWrapper;
|
|
14287
|
-
var FloatingActionButtonInternal =
|
|
14033
|
+
var FloatingActionButtonInternal = React60__default.forwardRef(
|
|
14288
14034
|
({
|
|
14289
14035
|
actions = [],
|
|
14290
14036
|
position = "bottom-right",
|
|
@@ -14415,7 +14161,7 @@ var FloatingActionButtonInternal = React67__default.forwardRef(
|
|
|
14415
14161
|
}
|
|
14416
14162
|
);
|
|
14417
14163
|
FloatingActionButtonInternal.displayName = "FloatingActionButtonInternal";
|
|
14418
|
-
var FloatingActionButton =
|
|
14164
|
+
var FloatingActionButton = React60__default.forwardRef(
|
|
14419
14165
|
({ className, ...props }, ref) => {
|
|
14420
14166
|
const { hasProAccess, isLoading } = useSubscription();
|
|
14421
14167
|
if (!isLoading && !hasProAccess) {
|
|
@@ -14467,7 +14213,7 @@ var hoverCard3DVariants = cva(
|
|
|
14467
14213
|
}
|
|
14468
14214
|
}
|
|
14469
14215
|
);
|
|
14470
|
-
var HoverCard3DInternal =
|
|
14216
|
+
var HoverCard3DInternal = React60__default.forwardRef(
|
|
14471
14217
|
({
|
|
14472
14218
|
children,
|
|
14473
14219
|
className,
|
|
@@ -14751,7 +14497,7 @@ var HoverCard3DInternal = React67__default.forwardRef(
|
|
|
14751
14497
|
}
|
|
14752
14498
|
);
|
|
14753
14499
|
HoverCard3DInternal.displayName = "HoverCard3DInternal";
|
|
14754
|
-
var HoverCard3D =
|
|
14500
|
+
var HoverCard3D = React60__default.forwardRef(
|
|
14755
14501
|
(props, ref) => {
|
|
14756
14502
|
const { hasProAccess, isLoading } = useSubscription();
|
|
14757
14503
|
if (!isLoading && !hasProAccess) {
|
|
@@ -14806,7 +14552,7 @@ var magneticButtonVariants = cva(
|
|
|
14806
14552
|
}
|
|
14807
14553
|
}
|
|
14808
14554
|
);
|
|
14809
|
-
var MagneticButtonInternal =
|
|
14555
|
+
var MagneticButtonInternal = React60__default.forwardRef(
|
|
14810
14556
|
({
|
|
14811
14557
|
children,
|
|
14812
14558
|
className,
|
|
@@ -14918,7 +14664,7 @@ var MagneticButtonInternal = React67__default.forwardRef(
|
|
|
14918
14664
|
}
|
|
14919
14665
|
);
|
|
14920
14666
|
MagneticButtonInternal.displayName = "MagneticButtonInternal";
|
|
14921
|
-
var MagneticButton =
|
|
14667
|
+
var MagneticButton = React60__default.forwardRef(
|
|
14922
14668
|
({ className, ...props }, ref) => {
|
|
14923
14669
|
const { hasProAccess, isLoading } = useSubscription();
|
|
14924
14670
|
if (!isLoading && !hasProAccess) {
|
|
@@ -14938,7 +14684,7 @@ var MagneticButton = React67__default.forwardRef(
|
|
|
14938
14684
|
}
|
|
14939
14685
|
);
|
|
14940
14686
|
MagneticButton.displayName = "MagneticButton";
|
|
14941
|
-
var PinchZoomInternal =
|
|
14687
|
+
var PinchZoomInternal = React60__default.forwardRef(
|
|
14942
14688
|
({
|
|
14943
14689
|
children,
|
|
14944
14690
|
minZoom = 0.5,
|
|
@@ -15352,7 +15098,7 @@ var PinchZoomInternal = React67__default.forwardRef(
|
|
|
15352
15098
|
}
|
|
15353
15099
|
);
|
|
15354
15100
|
PinchZoomInternal.displayName = "PinchZoomInternal";
|
|
15355
|
-
var PinchZoom =
|
|
15101
|
+
var PinchZoom = React60__default.forwardRef(
|
|
15356
15102
|
({ className, ...props }, ref) => {
|
|
15357
15103
|
const { hasProAccess, isLoading } = useSubscription();
|
|
15358
15104
|
if (!isLoading && !hasProAccess) {
|
|
@@ -15372,7 +15118,7 @@ var PinchZoom = React67__default.forwardRef(
|
|
|
15372
15118
|
}
|
|
15373
15119
|
);
|
|
15374
15120
|
PinchZoom.displayName = "PinchZoom";
|
|
15375
|
-
var SpotlightCardInternal =
|
|
15121
|
+
var SpotlightCardInternal = React60__default.forwardRef(
|
|
15376
15122
|
({
|
|
15377
15123
|
children,
|
|
15378
15124
|
className,
|
|
@@ -15501,7 +15247,7 @@ var SpotlightCardInternal = React67__default.forwardRef(
|
|
|
15501
15247
|
}
|
|
15502
15248
|
);
|
|
15503
15249
|
SpotlightCardInternal.displayName = "SpotlightCardInternal";
|
|
15504
|
-
var SpotlightCard =
|
|
15250
|
+
var SpotlightCard = React60__default.forwardRef(
|
|
15505
15251
|
({ className, ...props }, ref) => {
|
|
15506
15252
|
const { hasProAccess, isLoading } = useSubscription();
|
|
15507
15253
|
if (!isLoading && !hasProAccess) {
|
|
@@ -15924,22 +15670,22 @@ function CalendarInternal({
|
|
|
15924
15670
|
] })
|
|
15925
15671
|
] }) }) });
|
|
15926
15672
|
}
|
|
15927
|
-
const [currentDate, setCurrentDate] =
|
|
15928
|
-
const [selectedDate, setSelectedDate] =
|
|
15929
|
-
const [view, setView] =
|
|
15930
|
-
const [eventDialogOpen, setEventDialogOpen] =
|
|
15931
|
-
const [eventDialogMode, setEventDialogMode] =
|
|
15932
|
-
const [selectedEvent, setSelectedEvent] =
|
|
15933
|
-
const [draggedEvent, setDraggedEvent] =
|
|
15934
|
-
const [dragTargetDate, setDragTargetDate] =
|
|
15935
|
-
const [searchQuery, setSearchQuery] =
|
|
15936
|
-
const [filterType, setFilterType] =
|
|
15937
|
-
const [filterPriority, setFilterPriority] =
|
|
15938
|
-
|
|
15939
|
-
const [selectedTags, setSelectedTags] =
|
|
15940
|
-
const [miniCalendarDate, setMiniCalendarDate] =
|
|
15941
|
-
const [isSidebarOpen, setIsSidebarOpen] =
|
|
15942
|
-
const [isDesktopSidebarCollapsed, setIsDesktopSidebarCollapsed] =
|
|
15673
|
+
const [currentDate, setCurrentDate] = React60__default.useState(/* @__PURE__ */ new Date());
|
|
15674
|
+
const [selectedDate, setSelectedDate] = React60__default.useState(null);
|
|
15675
|
+
const [view, setView] = React60__default.useState(defaultView);
|
|
15676
|
+
const [eventDialogOpen, setEventDialogOpen] = React60__default.useState(false);
|
|
15677
|
+
const [eventDialogMode, setEventDialogMode] = React60__default.useState("create");
|
|
15678
|
+
const [selectedEvent, setSelectedEvent] = React60__default.useState(null);
|
|
15679
|
+
const [draggedEvent, setDraggedEvent] = React60__default.useState(null);
|
|
15680
|
+
const [dragTargetDate, setDragTargetDate] = React60__default.useState(null);
|
|
15681
|
+
const [searchQuery, setSearchQuery] = React60__default.useState("");
|
|
15682
|
+
const [filterType, setFilterType] = React60__default.useState("all");
|
|
15683
|
+
const [filterPriority, setFilterPriority] = React60__default.useState("all");
|
|
15684
|
+
React60__default.useState(false);
|
|
15685
|
+
const [selectedTags, setSelectedTags] = React60__default.useState([]);
|
|
15686
|
+
const [miniCalendarDate, setMiniCalendarDate] = React60__default.useState(/* @__PURE__ */ new Date());
|
|
15687
|
+
const [isSidebarOpen, setIsSidebarOpen] = React60__default.useState(false);
|
|
15688
|
+
const [isDesktopSidebarCollapsed, setIsDesktopSidebarCollapsed] = React60__default.useState(false);
|
|
15943
15689
|
const today = /* @__PURE__ */ new Date();
|
|
15944
15690
|
const currentMonth = currentDate.getMonth();
|
|
15945
15691
|
const currentYear = currentDate.getFullYear();
|
|
@@ -15957,14 +15703,14 @@ function CalendarInternal({
|
|
|
15957
15703
|
calendarDays.push(new Date(currentDateIterator));
|
|
15958
15704
|
currentDateIterator.setDate(currentDateIterator.getDate() + 1);
|
|
15959
15705
|
}
|
|
15960
|
-
|
|
15706
|
+
React60__default.useMemo(() => {
|
|
15961
15707
|
const tags = /* @__PURE__ */ new Set();
|
|
15962
15708
|
events.forEach((event) => {
|
|
15963
15709
|
event.tags?.forEach((tag) => tags.add(tag));
|
|
15964
15710
|
});
|
|
15965
15711
|
return Array.from(tags);
|
|
15966
15712
|
}, [events]);
|
|
15967
|
-
const filteredEvents =
|
|
15713
|
+
const filteredEvents = React60__default.useMemo(() => {
|
|
15968
15714
|
return events.filter((event) => {
|
|
15969
15715
|
if (searchQuery && !event.title.toLowerCase().includes(searchQuery.toLowerCase()) && !event.description?.toLowerCase().includes(searchQuery.toLowerCase())) {
|
|
15970
15716
|
return false;
|
|
@@ -23680,10 +23426,10 @@ var Fitter = class {
|
|
|
23680
23426
|
this.placed = addToFragment(this.placed, this.frontier.length, add);
|
|
23681
23427
|
}
|
|
23682
23428
|
};
|
|
23683
|
-
function dropFromFragment(fragment, depth,
|
|
23429
|
+
function dropFromFragment(fragment, depth, count2) {
|
|
23684
23430
|
if (depth == 0)
|
|
23685
|
-
return fragment.cutByIndex(
|
|
23686
|
-
return fragment.replaceChild(0, fragment.firstChild.copy(dropFromFragment(fragment.firstChild.content, depth - 1,
|
|
23431
|
+
return fragment.cutByIndex(count2, fragment.childCount);
|
|
23432
|
+
return fragment.replaceChild(0, fragment.firstChild.copy(dropFromFragment(fragment.firstChild.content, depth - 1, count2)));
|
|
23687
23433
|
}
|
|
23688
23434
|
function addToFragment(fragment, depth, content) {
|
|
23689
23435
|
if (depth == 0)
|
|
@@ -31398,11 +31144,11 @@ function getHTMLFromFragment(fragment, schema) {
|
|
|
31398
31144
|
container.appendChild(documentFragment);
|
|
31399
31145
|
return container.innerHTML;
|
|
31400
31146
|
}
|
|
31401
|
-
function
|
|
31147
|
+
function isFunction2(value) {
|
|
31402
31148
|
return typeof value === "function";
|
|
31403
31149
|
}
|
|
31404
31150
|
function callOrReturn(value, context = void 0, ...props) {
|
|
31405
|
-
if (
|
|
31151
|
+
if (isFunction2(value)) {
|
|
31406
31152
|
if (context) {
|
|
31407
31153
|
return value.bind(context)(...props);
|
|
31408
31154
|
}
|
|
@@ -34987,7 +34733,7 @@ var Editor = class extends EventEmitter {
|
|
|
34987
34733
|
* @returns The new editor state
|
|
34988
34734
|
*/
|
|
34989
34735
|
registerPlugin(plugin, handlePlugins) {
|
|
34990
|
-
const plugins =
|
|
34736
|
+
const plugins = isFunction2(handlePlugins) ? handlePlugins(plugin, [...this.state.plugins]) : [...this.state.plugins, plugin];
|
|
34991
34737
|
const state = this.state.reconfigure({ plugins });
|
|
34992
34738
|
this.view.updateState(state);
|
|
34993
34739
|
return state;
|
|
@@ -35530,7 +35276,7 @@ function markPasteRule(config) {
|
|
|
35530
35276
|
}
|
|
35531
35277
|
|
|
35532
35278
|
// ../../node_modules/@tiptap/react/dist/index.js
|
|
35533
|
-
var
|
|
35279
|
+
var import_react24 = __toESM(require_react(), 1);
|
|
35534
35280
|
var mergeRefs = (...refs) => {
|
|
35535
35281
|
return (node) => {
|
|
35536
35282
|
refs.forEach((ref) => {
|
|
@@ -35575,7 +35321,7 @@ function getInstance() {
|
|
|
35575
35321
|
setRenderer(id, renderer) {
|
|
35576
35322
|
renderers = {
|
|
35577
35323
|
...renderers,
|
|
35578
|
-
[id]:
|
|
35324
|
+
[id]: ReactDOM__default.createPortal(renderer.reactElement, renderer.element, id)
|
|
35579
35325
|
};
|
|
35580
35326
|
subscribers.forEach((subscriber) => subscriber());
|
|
35581
35327
|
},
|
|
@@ -35590,11 +35336,11 @@ function getInstance() {
|
|
|
35590
35336
|
}
|
|
35591
35337
|
};
|
|
35592
35338
|
}
|
|
35593
|
-
var PureEditorContent = class extends
|
|
35339
|
+
var PureEditorContent = class extends React60__default.Component {
|
|
35594
35340
|
constructor(props) {
|
|
35595
35341
|
var _a2;
|
|
35596
35342
|
super(props);
|
|
35597
|
-
this.editorContentRef =
|
|
35343
|
+
this.editorContentRef = React60__default.createRef();
|
|
35598
35344
|
this.initialized = false;
|
|
35599
35345
|
this.state = {
|
|
35600
35346
|
hasContentComponentInitialized: Boolean((_a2 = props.editor) == null ? void 0 : _a2.contentComponent)
|
|
@@ -35672,17 +35418,17 @@ var PureEditorContent = class extends React67__default.Component {
|
|
|
35672
35418
|
};
|
|
35673
35419
|
var EditorContentWithKey = forwardRef(
|
|
35674
35420
|
(props, ref) => {
|
|
35675
|
-
const key =
|
|
35421
|
+
const key = React60__default.useMemo(() => {
|
|
35676
35422
|
return Math.floor(Math.random() * 4294967295).toString();
|
|
35677
35423
|
}, [props.editor]);
|
|
35678
|
-
return
|
|
35424
|
+
return React60__default.createElement(PureEditorContent, {
|
|
35679
35425
|
key,
|
|
35680
35426
|
innerRef: ref,
|
|
35681
35427
|
...props
|
|
35682
35428
|
});
|
|
35683
35429
|
}
|
|
35684
35430
|
);
|
|
35685
|
-
var EditorContent =
|
|
35431
|
+
var EditorContent = React60__default.memo(EditorContentWithKey);
|
|
35686
35432
|
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
35687
35433
|
var EditorStateManager = class {
|
|
35688
35434
|
constructor(initialEditor) {
|
|
@@ -35749,7 +35495,7 @@ function useEditorState(options) {
|
|
|
35749
35495
|
editorStateManager.getSnapshot,
|
|
35750
35496
|
editorStateManager.getServerSnapshot,
|
|
35751
35497
|
options.selector,
|
|
35752
|
-
(_a2 = options.equalityFn) != null ? _a2 :
|
|
35498
|
+
(_a2 = options.equalityFn) != null ? _a2 : import_react24.default
|
|
35753
35499
|
);
|
|
35754
35500
|
useIsomorphicLayoutEffect(() => {
|
|
35755
35501
|
return editorStateManager.watch(options.editor);
|
|
@@ -36026,7 +35772,7 @@ var ReactNodeViewContext = createContext({
|
|
|
36026
35772
|
}
|
|
36027
35773
|
});
|
|
36028
35774
|
var useReactNodeView = () => useContext(ReactNodeViewContext);
|
|
36029
|
-
|
|
35775
|
+
React60__default.forwardRef((props, ref) => {
|
|
36030
35776
|
const { onDragStart } = useReactNodeView();
|
|
36031
35777
|
const Tag5 = props.as || "div";
|
|
36032
35778
|
return (
|
|
@@ -36046,7 +35792,7 @@ React67__default.forwardRef((props, ref) => {
|
|
|
36046
35792
|
)
|
|
36047
35793
|
);
|
|
36048
35794
|
});
|
|
36049
|
-
|
|
35795
|
+
React60__default.createContext({
|
|
36050
35796
|
markViewContentRef: () => {
|
|
36051
35797
|
}
|
|
36052
35798
|
});
|
|
@@ -39689,12 +39435,12 @@ var Branch = class {
|
|
|
39689
39435
|
return branch;
|
|
39690
39436
|
}
|
|
39691
39437
|
emptyItemCount() {
|
|
39692
|
-
let
|
|
39438
|
+
let count2 = 0;
|
|
39693
39439
|
this.items.forEach((item) => {
|
|
39694
39440
|
if (!item.step)
|
|
39695
|
-
|
|
39441
|
+
count2++;
|
|
39696
39442
|
});
|
|
39697
|
-
return
|
|
39443
|
+
return count2;
|
|
39698
39444
|
}
|
|
39699
39445
|
// Compressing a branch means rewriting it to push the air (map-only
|
|
39700
39446
|
// items) out. During collaboration, these naturally accumulate
|
|
@@ -43792,7 +43538,7 @@ function getDecorations({
|
|
|
43792
43538
|
});
|
|
43793
43539
|
return DecorationSet.create(doc3, decorations);
|
|
43794
43540
|
}
|
|
43795
|
-
function
|
|
43541
|
+
function isFunction3(param) {
|
|
43796
43542
|
return typeof param === "function";
|
|
43797
43543
|
}
|
|
43798
43544
|
function LowlightPlugin({
|
|
@@ -43800,7 +43546,7 @@ function LowlightPlugin({
|
|
|
43800
43546
|
lowlight: lowlight2,
|
|
43801
43547
|
defaultLanguage
|
|
43802
43548
|
}) {
|
|
43803
|
-
if (!["highlight", "highlightAuto", "listLanguages"].every((api) =>
|
|
43549
|
+
if (!["highlight", "highlightAuto", "listLanguages"].every((api) => isFunction3(lowlight2[api]))) {
|
|
43804
43550
|
throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");
|
|
43805
43551
|
}
|
|
43806
43552
|
const lowlightPlugin = new Plugin({
|
|
@@ -57619,7 +57365,7 @@ var EditorColorPicker = ({
|
|
|
57619
57365
|
onColorSelect,
|
|
57620
57366
|
currentColor = "#000000"
|
|
57621
57367
|
}) => {
|
|
57622
|
-
const [showAdvanced, setShowAdvanced] =
|
|
57368
|
+
const [showAdvanced, setShowAdvanced] = React60__default.useState(false);
|
|
57623
57369
|
const quickColors = [
|
|
57624
57370
|
"#000000",
|
|
57625
57371
|
// Black
|
|
@@ -60780,7 +60526,7 @@ function SelectableVirtualList(props) {
|
|
|
60780
60526
|
}
|
|
60781
60527
|
var MoonUIVirtualListPro = VirtualList;
|
|
60782
60528
|
var MoonUISelectableVirtualListPro = SelectableVirtualList;
|
|
60783
|
-
var SwipeableCardInternal =
|
|
60529
|
+
var SwipeableCardInternal = React60__default.forwardRef(
|
|
60784
60530
|
({
|
|
60785
60531
|
children,
|
|
60786
60532
|
onSwipeLeft,
|
|
@@ -60858,7 +60604,7 @@ var SwipeableCardInternal = React67__default.forwardRef(
|
|
|
60858
60604
|
}
|
|
60859
60605
|
);
|
|
60860
60606
|
SwipeableCardInternal.displayName = "SwipeableCardInternal";
|
|
60861
|
-
var SwipeableCard =
|
|
60607
|
+
var SwipeableCard = React60__default.forwardRef(
|
|
60862
60608
|
(props, ref) => {
|
|
60863
60609
|
const { hasProAccess, isLoading } = useSubscription();
|
|
60864
60610
|
if (!isLoading && !hasProAccess) {
|
|
@@ -61895,19 +61641,19 @@ function AdvancedChartInternal({
|
|
|
61895
61641
|
animationDuration = 1500,
|
|
61896
61642
|
theme = "default"
|
|
61897
61643
|
}) {
|
|
61898
|
-
const [isFullscreen, setIsFullscreen] =
|
|
61899
|
-
const [showSettings, setShowSettings] =
|
|
61900
|
-
const [zoomLevel, setZoomLevel] =
|
|
61901
|
-
const [selectedTheme, setSelectedTheme] =
|
|
61902
|
-
const [hoveredDataPoint, setHoveredDataPoint] =
|
|
61903
|
-
const [hiddenSeries, setHiddenSeries] =
|
|
61904
|
-
const chartRef =
|
|
61905
|
-
const containerRef =
|
|
61906
|
-
const themeColors =
|
|
61644
|
+
const [isFullscreen, setIsFullscreen] = React60__default.useState(false);
|
|
61645
|
+
const [showSettings, setShowSettings] = React60__default.useState(false);
|
|
61646
|
+
const [zoomLevel, setZoomLevel] = React60__default.useState(100);
|
|
61647
|
+
const [selectedTheme, setSelectedTheme] = React60__default.useState(theme);
|
|
61648
|
+
const [hoveredDataPoint, setHoveredDataPoint] = React60__default.useState(null);
|
|
61649
|
+
const [hiddenSeries, setHiddenSeries] = React60__default.useState(/* @__PURE__ */ new Set());
|
|
61650
|
+
const chartRef = React60__default.useRef(null);
|
|
61651
|
+
const containerRef = React60__default.useRef(null);
|
|
61652
|
+
const themeColors = React60__default.useMemo(() => {
|
|
61907
61653
|
return COLOR_THEMES[selectedTheme] || DEFAULT_COLORS2;
|
|
61908
61654
|
}, [selectedTheme]);
|
|
61909
|
-
const gradientId =
|
|
61910
|
-
const trend =
|
|
61655
|
+
const gradientId = React60__default.useId();
|
|
61656
|
+
const trend = React60__default.useMemo(() => {
|
|
61911
61657
|
if (!data || !Array.isArray(data) || !data.length || !series || !Array.isArray(series) || !series.length)
|
|
61912
61658
|
return null;
|
|
61913
61659
|
const firstSeries = series[0];
|
|
@@ -62794,9 +62540,9 @@ function MetricCard({
|
|
|
62794
62540
|
interactive = true,
|
|
62795
62541
|
glassmorphism = false
|
|
62796
62542
|
}) {
|
|
62797
|
-
const [isHovered, setIsHovered] =
|
|
62798
|
-
const [isMounted, setIsMounted] =
|
|
62799
|
-
|
|
62543
|
+
const [isHovered, setIsHovered] = React60__default.useState(false);
|
|
62544
|
+
const [isMounted, setIsMounted] = React60__default.useState(false);
|
|
62545
|
+
React60__default.useEffect(() => {
|
|
62800
62546
|
setIsMounted(true);
|
|
62801
62547
|
}, []);
|
|
62802
62548
|
const colorClasses = {
|
|
@@ -63120,8 +62866,8 @@ function ChartWidget({
|
|
|
63120
62866
|
glassmorphism = false,
|
|
63121
62867
|
interactive = true
|
|
63122
62868
|
}) {
|
|
63123
|
-
const [colorScheme, setColorScheme] =
|
|
63124
|
-
const [isFullscreen, setIsFullscreen] =
|
|
62869
|
+
const [colorScheme, setColorScheme] = React60__default.useState("default");
|
|
62870
|
+
const [isFullscreen, setIsFullscreen] = React60__default.useState(false);
|
|
63125
62871
|
const colors = CHART_COLORS[colorScheme];
|
|
63126
62872
|
const CustomTooltip2 = ({ active, payload, label }) => {
|
|
63127
62873
|
if (!active || !payload)
|
|
@@ -63396,14 +63142,14 @@ function ActivityFeed({
|
|
|
63396
63142
|
glassmorphism = false,
|
|
63397
63143
|
realtime = false
|
|
63398
63144
|
}) {
|
|
63399
|
-
const [filter, setFilter] =
|
|
63400
|
-
const [notificationsEnabled, setNotificationsEnabled] =
|
|
63401
|
-
const [newItems, setNewItems] =
|
|
63402
|
-
const [isMounted, setIsMounted] =
|
|
63403
|
-
|
|
63145
|
+
const [filter, setFilter] = React60__default.useState("all");
|
|
63146
|
+
const [notificationsEnabled, setNotificationsEnabled] = React60__default.useState(true);
|
|
63147
|
+
const [newItems, setNewItems] = React60__default.useState([]);
|
|
63148
|
+
const [isMounted, setIsMounted] = React60__default.useState(false);
|
|
63149
|
+
React60__default.useEffect(() => {
|
|
63404
63150
|
setIsMounted(true);
|
|
63405
63151
|
}, []);
|
|
63406
|
-
|
|
63152
|
+
React60__default.useEffect(() => {
|
|
63407
63153
|
if (!realtime)
|
|
63408
63154
|
return;
|
|
63409
63155
|
const interval = setInterval(() => {
|
|
@@ -63626,8 +63372,8 @@ function ProgressWidget({
|
|
|
63626
63372
|
glassmorphism = false
|
|
63627
63373
|
}) {
|
|
63628
63374
|
const items = Array.isArray(data) ? data : [data];
|
|
63629
|
-
const [isMounted, setIsMounted] =
|
|
63630
|
-
|
|
63375
|
+
const [isMounted, setIsMounted] = React60__default.useState(false);
|
|
63376
|
+
React60__default.useEffect(() => {
|
|
63631
63377
|
setIsMounted(true);
|
|
63632
63378
|
}, []);
|
|
63633
63379
|
return /* @__PURE__ */ jsxs(MoonUICardPro, { className: cn(
|
|
@@ -63720,8 +63466,8 @@ function ComparisonWidget({
|
|
|
63720
63466
|
className,
|
|
63721
63467
|
glassmorphism = false
|
|
63722
63468
|
}) {
|
|
63723
|
-
const [isMounted, setIsMounted] =
|
|
63724
|
-
|
|
63469
|
+
const [isMounted, setIsMounted] = React60__default.useState(false);
|
|
63470
|
+
React60__default.useEffect(() => {
|
|
63725
63471
|
setIsMounted(true);
|
|
63726
63472
|
}, []);
|
|
63727
63473
|
const maxValue = Math.max(...data.periods.map((p) => p.value));
|
|
@@ -63840,7 +63586,7 @@ function ComparisonWidget({
|
|
|
63840
63586
|
] });
|
|
63841
63587
|
}
|
|
63842
63588
|
|
|
63843
|
-
// node_modules/react-resizable/css/styles.css
|
|
63589
|
+
// ../../node_modules/react-resizable/css/styles.css
|
|
63844
63590
|
styleInject(".react-resizable {\n position: relative;\n}\n.react-resizable-handle {\n position: absolute;\n width: 20px;\n height: 20px;\n background-repeat: no-repeat;\n background-origin: content-box;\n box-sizing: border-box;\n background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+);\n background-position: bottom right;\n padding: 0 3px 3px 0;\n}\n.react-resizable-handle-sw {\n bottom: 0;\n left: 0;\n cursor: sw-resize;\n transform: rotate(90deg);\n}\n.react-resizable-handle-se {\n bottom: 0;\n right: 0;\n cursor: se-resize;\n}\n.react-resizable-handle-nw {\n top: 0;\n left: 0;\n cursor: nw-resize;\n transform: rotate(180deg);\n}\n.react-resizable-handle-ne {\n top: 0;\n right: 0;\n cursor: ne-resize;\n transform: rotate(270deg);\n}\n.react-resizable-handle-w,\n.react-resizable-handle-e {\n top: 50%;\n margin-top: -10px;\n cursor: ew-resize;\n}\n.react-resizable-handle-w {\n left: 0;\n transform: rotate(135deg);\n}\n.react-resizable-handle-e {\n right: 0;\n transform: rotate(315deg);\n}\n.react-resizable-handle-n,\n.react-resizable-handle-s {\n left: 50%;\n margin-left: -10px;\n cursor: ns-resize;\n}\n.react-resizable-handle-n {\n top: 0;\n transform: rotate(225deg);\n}\n.react-resizable-handle-s {\n bottom: 0;\n transform: rotate(45deg);\n}\n");
|
|
63845
63591
|
var ResponsiveGridLayout = WidthProvider(Responsive);
|
|
63846
63592
|
function DashboardGrid({
|
|
@@ -63857,14 +63603,14 @@ function DashboardGrid({
|
|
|
63857
63603
|
margin = [16, 24],
|
|
63858
63604
|
containerPadding = [0, 0]
|
|
63859
63605
|
}) {
|
|
63860
|
-
const [layouts, setLayouts] =
|
|
63861
|
-
const [currentBreakpoint, setCurrentBreakpoint] =
|
|
63862
|
-
const [lockedWidgets, setLockedWidgets] =
|
|
63863
|
-
const [fullscreenWidget, setFullscreenWidget] =
|
|
63864
|
-
const [containerWidth, setContainerWidth] =
|
|
63865
|
-
const containerRef =
|
|
63866
|
-
const [compactType, setCompactType] =
|
|
63867
|
-
|
|
63606
|
+
const [layouts, setLayouts] = React60__default.useState({});
|
|
63607
|
+
const [currentBreakpoint, setCurrentBreakpoint] = React60__default.useState("lg");
|
|
63608
|
+
const [lockedWidgets, setLockedWidgets] = React60__default.useState(/* @__PURE__ */ new Set());
|
|
63609
|
+
const [fullscreenWidget, setFullscreenWidget] = React60__default.useState(null);
|
|
63610
|
+
const [containerWidth, setContainerWidth] = React60__default.useState(1200);
|
|
63611
|
+
const containerRef = React60__default.useRef(null);
|
|
63612
|
+
const [compactType, setCompactType] = React60__default.useState("vertical");
|
|
63613
|
+
React60__default.useEffect(() => {
|
|
63868
63614
|
const updateWidth = () => {
|
|
63869
63615
|
if (containerRef.current) {
|
|
63870
63616
|
const width = containerRef.current.offsetWidth;
|
|
@@ -64310,12 +64056,12 @@ function TimeRangePicker({
|
|
|
64310
64056
|
showComparison = false,
|
|
64311
64057
|
glassmorphism = false
|
|
64312
64058
|
}) {
|
|
64313
|
-
const [isOpen, setIsOpen] =
|
|
64314
|
-
const [customRange, setCustomRange] =
|
|
64059
|
+
const [isOpen, setIsOpen] = React60__default.useState(false);
|
|
64060
|
+
const [customRange, setCustomRange] = React60__default.useState({
|
|
64315
64061
|
from: void 0,
|
|
64316
64062
|
to: void 0
|
|
64317
64063
|
});
|
|
64318
|
-
const [comparisonEnabled, setComparisonEnabled] =
|
|
64064
|
+
const [comparisonEnabled, setComparisonEnabled] = React60__default.useState(false);
|
|
64319
64065
|
const currentRange = value || PRESET_RANGES[2].getRange();
|
|
64320
64066
|
const formatRange = (range) => {
|
|
64321
64067
|
if (range.preset && range.preset !== "custom") {
|
|
@@ -64660,24 +64406,24 @@ function DashboardInternal({
|
|
|
64660
64406
|
logo,
|
|
64661
64407
|
brandName
|
|
64662
64408
|
}) {
|
|
64663
|
-
const [editMode, setEditMode] =
|
|
64664
|
-
const [widgets, setWidgets] =
|
|
64665
|
-
const [selectedTheme, setSelectedTheme] =
|
|
64666
|
-
const [timeRange, setTimeRange] =
|
|
64667
|
-
const [searchQuery, setSearchQuery] =
|
|
64668
|
-
const [showWidgetLibrary, setShowWidgetLibrary] =
|
|
64669
|
-
const [showTemplates, setShowTemplates] =
|
|
64670
|
-
const [refreshing, setRefreshing] =
|
|
64671
|
-
const [showNotifications, setShowNotifications] =
|
|
64672
|
-
|
|
64409
|
+
const [editMode, setEditMode] = React60__default.useState(false);
|
|
64410
|
+
const [widgets, setWidgets] = React60__default.useState(initialWidgets);
|
|
64411
|
+
const [selectedTheme, setSelectedTheme] = React60__default.useState("analytics");
|
|
64412
|
+
const [timeRange, setTimeRange] = React60__default.useState(propTimeRange);
|
|
64413
|
+
const [searchQuery, setSearchQuery] = React60__default.useState("");
|
|
64414
|
+
const [showWidgetLibrary, setShowWidgetLibrary] = React60__default.useState(false);
|
|
64415
|
+
const [showTemplates, setShowTemplates] = React60__default.useState(false);
|
|
64416
|
+
const [refreshing, setRefreshing] = React60__default.useState(false);
|
|
64417
|
+
const [showNotifications, setShowNotifications] = React60__default.useState(false);
|
|
64418
|
+
React60__default.useEffect(() => {
|
|
64673
64419
|
setWidgets(initialWidgets);
|
|
64674
64420
|
}, [initialWidgets]);
|
|
64675
|
-
|
|
64421
|
+
React60__default.useEffect(() => {
|
|
64676
64422
|
if (propTimeRange) {
|
|
64677
64423
|
setTimeRange(propTimeRange);
|
|
64678
64424
|
}
|
|
64679
64425
|
}, [propTimeRange]);
|
|
64680
|
-
|
|
64426
|
+
React60__default.useEffect(() => {
|
|
64681
64427
|
if (!realtime)
|
|
64682
64428
|
return;
|
|
64683
64429
|
const interval = setInterval(() => {
|
|
@@ -65373,7 +65119,7 @@ function formatPhoneNumber(number) {
|
|
|
65373
65119
|
return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)} ${cleaned.slice(6, 8)} ${cleaned.slice(8, 10)}`;
|
|
65374
65120
|
}
|
|
65375
65121
|
}
|
|
65376
|
-
var MoonUIPhoneNumberInputSimple =
|
|
65122
|
+
var MoonUIPhoneNumberInputSimple = React60__default.forwardRef(({
|
|
65377
65123
|
value = "",
|
|
65378
65124
|
onChange,
|
|
65379
65125
|
label,
|
|
@@ -65529,7 +65275,7 @@ function toInternationalFormat(countryCode, phoneNumber) {
|
|
|
65529
65275
|
return `${country.dialCode}${cleaned}`;
|
|
65530
65276
|
}
|
|
65531
65277
|
var defaultValue = { country: "US", number: "" };
|
|
65532
|
-
var PhoneNumberInputInternal =
|
|
65278
|
+
var PhoneNumberInputInternal = React60__default.forwardRef(({
|
|
65533
65279
|
value,
|
|
65534
65280
|
onChange,
|
|
65535
65281
|
defaultCountry = "US",
|
|
@@ -65552,7 +65298,7 @@ var PhoneNumberInputInternal = React67__default.forwardRef(({
|
|
|
65552
65298
|
allowInternationalFormat = true,
|
|
65553
65299
|
...props
|
|
65554
65300
|
}, ref) => {
|
|
65555
|
-
const phoneValue =
|
|
65301
|
+
const phoneValue = React60__default.useMemo(() => {
|
|
65556
65302
|
return value || defaultValue;
|
|
65557
65303
|
}, [value]);
|
|
65558
65304
|
const [isFocused, setIsFocused] = useState(false);
|
|
@@ -65719,7 +65465,7 @@ var PhoneNumberInputInternal = React67__default.forwardRef(({
|
|
|
65719
65465
|
] });
|
|
65720
65466
|
});
|
|
65721
65467
|
PhoneNumberInputInternal.displayName = "PhoneNumberInputInternal";
|
|
65722
|
-
var MoonUIPhoneNumberInputPro =
|
|
65468
|
+
var MoonUIPhoneNumberInputPro = React60__default.forwardRef(
|
|
65723
65469
|
(props, ref) => {
|
|
65724
65470
|
const { hasProAccess, isLoading } = useSubscription();
|
|
65725
65471
|
if (!isLoading && !hasProAccess) {
|
|
@@ -66334,25 +66080,25 @@ async function fetchContributorsCount(owner, repo, token) {
|
|
|
66334
66080
|
if (linkHeader) {
|
|
66335
66081
|
const match = linkHeader.match(/page=(\d+)>; rel="last"/);
|
|
66336
66082
|
if (match) {
|
|
66337
|
-
const
|
|
66083
|
+
const count3 = parseInt(match[1]);
|
|
66338
66084
|
cache.set(cacheKey, {
|
|
66339
|
-
data:
|
|
66085
|
+
data: count3,
|
|
66340
66086
|
timestamp: Date.now(),
|
|
66341
66087
|
expiresAt: Date.now() + getCacheDuration(36e5)
|
|
66342
66088
|
// 30 minutes in docs mode
|
|
66343
66089
|
});
|
|
66344
|
-
return
|
|
66090
|
+
return count3;
|
|
66345
66091
|
}
|
|
66346
66092
|
}
|
|
66347
66093
|
const contributors = await response.json();
|
|
66348
|
-
const
|
|
66094
|
+
const count2 = contributors.length;
|
|
66349
66095
|
cache.set(cacheKey, {
|
|
66350
|
-
data:
|
|
66096
|
+
data: count2,
|
|
66351
66097
|
timestamp: Date.now(),
|
|
66352
66098
|
expiresAt: Date.now() + getCacheDuration(36e5)
|
|
66353
66099
|
// 30 minutes in docs mode
|
|
66354
66100
|
});
|
|
66355
|
-
return
|
|
66101
|
+
return count2;
|
|
66356
66102
|
} catch (error) {
|
|
66357
66103
|
console.error("Failed to fetch contributors:", error);
|
|
66358
66104
|
return 0;
|
|
@@ -66375,10 +66121,10 @@ function calculateStats(repositories) {
|
|
|
66375
66121
|
}
|
|
66376
66122
|
});
|
|
66377
66123
|
const totalRepos = repositories.length;
|
|
66378
|
-
const languages = Array.from(languageMap.entries()).map(([language,
|
|
66124
|
+
const languages = Array.from(languageMap.entries()).map(([language, count2]) => ({
|
|
66379
66125
|
language,
|
|
66380
|
-
count:
|
|
66381
|
-
percentage:
|
|
66126
|
+
count: count2,
|
|
66127
|
+
percentage: count2 / totalRepos * 100,
|
|
66382
66128
|
color: LANGUAGE_COLORS[language] || "#6b7280"
|
|
66383
66129
|
})).sort((a, b) => b.count - a.count);
|
|
66384
66130
|
const recentActivity = repositories.slice(0, 5).map((repo) => ({
|
|
@@ -67387,7 +67133,7 @@ var GitHubStarsInternal = ({
|
|
|
67387
67133
|
const effectiveNotifications = isDocsMode2 ? false : enableNotifications;
|
|
67388
67134
|
const effectiveRefreshInterval = isDocsMode2 ? 36e5 : refreshInterval;
|
|
67389
67135
|
const { notify } = useGitHubNotifications(effectiveNotifications);
|
|
67390
|
-
const handleMilestoneReached =
|
|
67136
|
+
const handleMilestoneReached = React60__default.useCallback((milestone) => {
|
|
67391
67137
|
if (celebrateAt?.includes(milestone.count)) {
|
|
67392
67138
|
confetti({
|
|
67393
67139
|
particleCount: 100,
|
|
@@ -67429,7 +67175,7 @@ var GitHubStarsInternal = ({
|
|
|
67429
67175
|
forceMockData: useMockData
|
|
67430
67176
|
// Force mock data if true
|
|
67431
67177
|
});
|
|
67432
|
-
const handleExport =
|
|
67178
|
+
const handleExport = React60__default.useCallback((format6) => {
|
|
67433
67179
|
if (!enableExport)
|
|
67434
67180
|
return;
|
|
67435
67181
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
@@ -67442,7 +67188,7 @@ var GitHubStarsInternal = ({
|
|
|
67442
67188
|
exportAsCSV(repos, `github-stars-${username}-${timestamp}.csv`);
|
|
67443
67189
|
}
|
|
67444
67190
|
}, [enableExport, repos, stats, username]);
|
|
67445
|
-
const handleDetailedExport =
|
|
67191
|
+
const handleDetailedExport = React60__default.useCallback((e) => {
|
|
67446
67192
|
if (!enableExport)
|
|
67447
67193
|
return;
|
|
67448
67194
|
const dropdown = document.createElement("div");
|
|
@@ -70115,7 +69861,7 @@ var FilePreviewModal = ({
|
|
|
70115
69861
|
] })
|
|
70116
69862
|
] }) });
|
|
70117
69863
|
};
|
|
70118
|
-
var MoonUIFileUploadPro =
|
|
69864
|
+
var MoonUIFileUploadPro = React60__default.forwardRef(
|
|
70119
69865
|
({
|
|
70120
69866
|
accept = "*",
|
|
70121
69867
|
multiple = true,
|
|
@@ -71088,11 +70834,11 @@ var FileUploadItem = ({
|
|
|
71088
70834
|
};
|
|
71089
70835
|
MoonUIFileUploadPro.displayName = "MoonUIFileUploadPro";
|
|
71090
70836
|
function DataTableColumnToggle({ table, trigger }) {
|
|
71091
|
-
const [search, setSearch] =
|
|
70837
|
+
const [search, setSearch] = React60__default.useState("");
|
|
71092
70838
|
const columns = table.getAllColumns().filter(
|
|
71093
70839
|
(column) => column.getCanHide() && column.id !== "select" && column.id !== "actions" && column.id !== "expander"
|
|
71094
70840
|
);
|
|
71095
|
-
const filteredColumns =
|
|
70841
|
+
const filteredColumns = React60__default.useMemo(() => {
|
|
71096
70842
|
if (!search)
|
|
71097
70843
|
return columns;
|
|
71098
70844
|
return columns.filter((column) => {
|
|
@@ -71194,7 +70940,7 @@ function DataTableColumnToggle({ table, trigger }) {
|
|
|
71194
70940
|
] });
|
|
71195
70941
|
}
|
|
71196
70942
|
var ROOT_NAME = "AlertDialog";
|
|
71197
|
-
var [createAlertDialogContext, createAlertDialogScope] =
|
|
70943
|
+
var [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [
|
|
71198
70944
|
createDialogScope
|
|
71199
70945
|
]);
|
|
71200
70946
|
var useDialogScope = createDialogScope();
|
|
@@ -71205,7 +70951,7 @@ var AlertDialog = (props) => {
|
|
|
71205
70951
|
};
|
|
71206
70952
|
AlertDialog.displayName = ROOT_NAME;
|
|
71207
70953
|
var TRIGGER_NAME4 = "AlertDialogTrigger";
|
|
71208
|
-
var AlertDialogTrigger =
|
|
70954
|
+
var AlertDialogTrigger = React60.forwardRef(
|
|
71209
70955
|
(props, forwardedRef) => {
|
|
71210
70956
|
const { __scopeAlertDialog, ...triggerProps } = props;
|
|
71211
70957
|
const dialogScope = useDialogScope(__scopeAlertDialog);
|
|
@@ -71221,7 +70967,7 @@ var AlertDialogPortal = (props) => {
|
|
|
71221
70967
|
};
|
|
71222
70968
|
AlertDialogPortal.displayName = PORTAL_NAME3;
|
|
71223
70969
|
var OVERLAY_NAME = "AlertDialogOverlay";
|
|
71224
|
-
var AlertDialogOverlay =
|
|
70970
|
+
var AlertDialogOverlay = React60.forwardRef(
|
|
71225
70971
|
(props, forwardedRef) => {
|
|
71226
70972
|
const { __scopeAlertDialog, ...overlayProps } = props;
|
|
71227
70973
|
const dialogScope = useDialogScope(__scopeAlertDialog);
|
|
@@ -71232,13 +70978,13 @@ AlertDialogOverlay.displayName = OVERLAY_NAME;
|
|
|
71232
70978
|
var CONTENT_NAME5 = "AlertDialogContent";
|
|
71233
70979
|
var [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME5);
|
|
71234
70980
|
var Slottable = createSlottable("AlertDialogContent");
|
|
71235
|
-
var AlertDialogContent =
|
|
70981
|
+
var AlertDialogContent = React60.forwardRef(
|
|
71236
70982
|
(props, forwardedRef) => {
|
|
71237
70983
|
const { __scopeAlertDialog, children, ...contentProps } = props;
|
|
71238
70984
|
const dialogScope = useDialogScope(__scopeAlertDialog);
|
|
71239
|
-
const contentRef =
|
|
71240
|
-
const composedRefs =
|
|
71241
|
-
const cancelRef =
|
|
70985
|
+
const contentRef = React60.useRef(null);
|
|
70986
|
+
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
70987
|
+
const cancelRef = React60.useRef(null);
|
|
71242
70988
|
return /* @__PURE__ */ jsx(
|
|
71243
70989
|
DialogPrimitive.WarningProvider,
|
|
71244
70990
|
{
|
|
@@ -71252,7 +70998,7 @@ var AlertDialogContent = React67.forwardRef(
|
|
|
71252
70998
|
...dialogScope,
|
|
71253
70999
|
...contentProps,
|
|
71254
71000
|
ref: composedRefs,
|
|
71255
|
-
onOpenAutoFocus:
|
|
71001
|
+
onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, (event) => {
|
|
71256
71002
|
event.preventDefault();
|
|
71257
71003
|
cancelRef.current?.focus({ preventScroll: true });
|
|
71258
71004
|
}),
|
|
@@ -71270,7 +71016,7 @@ var AlertDialogContent = React67.forwardRef(
|
|
|
71270
71016
|
);
|
|
71271
71017
|
AlertDialogContent.displayName = CONTENT_NAME5;
|
|
71272
71018
|
var TITLE_NAME = "AlertDialogTitle";
|
|
71273
|
-
var AlertDialogTitle =
|
|
71019
|
+
var AlertDialogTitle = React60.forwardRef(
|
|
71274
71020
|
(props, forwardedRef) => {
|
|
71275
71021
|
const { __scopeAlertDialog, ...titleProps } = props;
|
|
71276
71022
|
const dialogScope = useDialogScope(__scopeAlertDialog);
|
|
@@ -71279,14 +71025,14 @@ var AlertDialogTitle = React67.forwardRef(
|
|
|
71279
71025
|
);
|
|
71280
71026
|
AlertDialogTitle.displayName = TITLE_NAME;
|
|
71281
71027
|
var DESCRIPTION_NAME = "AlertDialogDescription";
|
|
71282
|
-
var AlertDialogDescription =
|
|
71028
|
+
var AlertDialogDescription = React60.forwardRef((props, forwardedRef) => {
|
|
71283
71029
|
const { __scopeAlertDialog, ...descriptionProps } = props;
|
|
71284
71030
|
const dialogScope = useDialogScope(__scopeAlertDialog);
|
|
71285
71031
|
return /* @__PURE__ */ jsx(DialogPrimitive.Description, { ...dialogScope, ...descriptionProps, ref: forwardedRef });
|
|
71286
71032
|
});
|
|
71287
71033
|
AlertDialogDescription.displayName = DESCRIPTION_NAME;
|
|
71288
71034
|
var ACTION_NAME = "AlertDialogAction";
|
|
71289
|
-
var AlertDialogAction =
|
|
71035
|
+
var AlertDialogAction = React60.forwardRef(
|
|
71290
71036
|
(props, forwardedRef) => {
|
|
71291
71037
|
const { __scopeAlertDialog, ...actionProps } = props;
|
|
71292
71038
|
const dialogScope = useDialogScope(__scopeAlertDialog);
|
|
@@ -71295,12 +71041,12 @@ var AlertDialogAction = React67.forwardRef(
|
|
|
71295
71041
|
);
|
|
71296
71042
|
AlertDialogAction.displayName = ACTION_NAME;
|
|
71297
71043
|
var CANCEL_NAME = "AlertDialogCancel";
|
|
71298
|
-
var AlertDialogCancel =
|
|
71044
|
+
var AlertDialogCancel = React60.forwardRef(
|
|
71299
71045
|
(props, forwardedRef) => {
|
|
71300
71046
|
const { __scopeAlertDialog, ...cancelProps } = props;
|
|
71301
71047
|
const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);
|
|
71302
71048
|
const dialogScope = useDialogScope(__scopeAlertDialog);
|
|
71303
|
-
const ref =
|
|
71049
|
+
const ref = useComposedRefs(forwardedRef, cancelRef);
|
|
71304
71050
|
return /* @__PURE__ */ jsx(DialogPrimitive.Close, { ...dialogScope, ...cancelProps, ref });
|
|
71305
71051
|
}
|
|
71306
71052
|
);
|
|
@@ -71313,7 +71059,7 @@ You can add a description to the \`${CONTENT_NAME5}\` by passing a \`${DESCRIPTI
|
|
|
71313
71059
|
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${CONTENT_NAME5}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
71314
71060
|
|
|
71315
71061
|
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;
|
|
71316
|
-
|
|
71062
|
+
React60.useEffect(() => {
|
|
71317
71063
|
const hasDescription = document.getElementById(
|
|
71318
71064
|
contentRef.current?.getAttribute("aria-describedby")
|
|
71319
71065
|
);
|
|
@@ -71332,7 +71078,7 @@ var Title22 = AlertDialogTitle;
|
|
|
71332
71078
|
var Description22 = AlertDialogDescription;
|
|
71333
71079
|
var AlertDialog2 = Root27;
|
|
71334
71080
|
var AlertDialogPortal2 = Portal22;
|
|
71335
|
-
var AlertDialogOverlay2 =
|
|
71081
|
+
var AlertDialogOverlay2 = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
71336
71082
|
Overlay22,
|
|
71337
71083
|
{
|
|
71338
71084
|
className: cn(
|
|
@@ -71344,7 +71090,7 @@ var AlertDialogOverlay2 = React67.forwardRef(({ className, ...props }, ref) => /
|
|
|
71344
71090
|
}
|
|
71345
71091
|
));
|
|
71346
71092
|
AlertDialogOverlay2.displayName = Overlay22.displayName;
|
|
71347
|
-
var AlertDialogContent2 =
|
|
71093
|
+
var AlertDialogContent2 = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs(AlertDialogPortal2, { children: [
|
|
71348
71094
|
/* @__PURE__ */ jsx(AlertDialogOverlay2, {}),
|
|
71349
71095
|
/* @__PURE__ */ jsx(
|
|
71350
71096
|
Content23,
|
|
@@ -71387,7 +71133,7 @@ var AlertDialogFooter = ({
|
|
|
71387
71133
|
}
|
|
71388
71134
|
);
|
|
71389
71135
|
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
71390
|
-
var AlertDialogTitle2 =
|
|
71136
|
+
var AlertDialogTitle2 = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
71391
71137
|
Title22,
|
|
71392
71138
|
{
|
|
71393
71139
|
ref,
|
|
@@ -71396,7 +71142,7 @@ var AlertDialogTitle2 = React67.forwardRef(({ className, ...props }, ref) => /*
|
|
|
71396
71142
|
}
|
|
71397
71143
|
));
|
|
71398
71144
|
AlertDialogTitle2.displayName = Title22.displayName;
|
|
71399
|
-
var AlertDialogDescription2 =
|
|
71145
|
+
var AlertDialogDescription2 = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
71400
71146
|
Description22,
|
|
71401
71147
|
{
|
|
71402
71148
|
ref,
|
|
@@ -71405,7 +71151,7 @@ var AlertDialogDescription2 = React67.forwardRef(({ className, ...props }, ref)
|
|
|
71405
71151
|
}
|
|
71406
71152
|
));
|
|
71407
71153
|
AlertDialogDescription2.displayName = Description22.displayName;
|
|
71408
|
-
var AlertDialogAction2 =
|
|
71154
|
+
var AlertDialogAction2 = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
71409
71155
|
Action2,
|
|
71410
71156
|
{
|
|
71411
71157
|
ref,
|
|
@@ -71414,7 +71160,7 @@ var AlertDialogAction2 = React67.forwardRef(({ className, ...props }, ref) => /*
|
|
|
71414
71160
|
}
|
|
71415
71161
|
));
|
|
71416
71162
|
AlertDialogAction2.displayName = Action2.displayName;
|
|
71417
|
-
var AlertDialogCancel2 =
|
|
71163
|
+
var AlertDialogCancel2 = React60.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
71418
71164
|
Cancel,
|
|
71419
71165
|
{
|
|
71420
71166
|
ref,
|
|
@@ -71433,8 +71179,8 @@ function DataTableBulkActions({
|
|
|
71433
71179
|
onClearSelection,
|
|
71434
71180
|
className
|
|
71435
71181
|
}) {
|
|
71436
|
-
const [isLoading, setIsLoading] =
|
|
71437
|
-
const [pendingAction, setPendingAction] =
|
|
71182
|
+
const [isLoading, setIsLoading] = React60__default.useState(false);
|
|
71183
|
+
const [pendingAction, setPendingAction] = React60__default.useState(null);
|
|
71438
71184
|
const selectedCount = selectedRows.length;
|
|
71439
71185
|
const handleAction = async (action) => {
|
|
71440
71186
|
if (action.confirmMessage) {
|
|
@@ -71973,7 +71719,7 @@ function DataTable({
|
|
|
71973
71719
|
onColumnFiltersChange,
|
|
71974
71720
|
state: externalState
|
|
71975
71721
|
}) {
|
|
71976
|
-
const columns =
|
|
71722
|
+
const columns = React60__default.useMemo(() => {
|
|
71977
71723
|
return originalColumns.map((col) => {
|
|
71978
71724
|
const { enableHiding, ...restCol } = col;
|
|
71979
71725
|
return {
|
|
@@ -71999,17 +71745,17 @@ function DataTable({
|
|
|
71999
71745
|
] })
|
|
72000
71746
|
] }) }) });
|
|
72001
71747
|
}
|
|
72002
|
-
const [sorting, setSorting] =
|
|
72003
|
-
const [columnFilters, setColumnFilters] =
|
|
72004
|
-
const [columnVisibility, setColumnVisibility] =
|
|
72005
|
-
const [rowSelection, setRowSelection] =
|
|
72006
|
-
const [globalFilter, setGlobalFilter] =
|
|
72007
|
-
const [isPaginationLoading, setIsPaginationLoading] =
|
|
72008
|
-
const [internalExpandedRows, setInternalExpandedRows] =
|
|
72009
|
-
const [filterDrawerOpen, setFilterDrawerOpen] =
|
|
71748
|
+
const [sorting, setSorting] = React60__default.useState([]);
|
|
71749
|
+
const [columnFilters, setColumnFilters] = React60__default.useState([]);
|
|
71750
|
+
const [columnVisibility, setColumnVisibility] = React60__default.useState({});
|
|
71751
|
+
const [rowSelection, setRowSelection] = React60__default.useState({});
|
|
71752
|
+
const [globalFilter, setGlobalFilter] = React60__default.useState("");
|
|
71753
|
+
const [isPaginationLoading, setIsPaginationLoading] = React60__default.useState(false);
|
|
71754
|
+
const [internalExpandedRows, setInternalExpandedRows] = React60__default.useState(/* @__PURE__ */ new Set());
|
|
71755
|
+
const [filterDrawerOpen, setFilterDrawerOpen] = React60__default.useState(false);
|
|
72010
71756
|
const expandedRows = controlledExpandedRows || internalExpandedRows;
|
|
72011
71757
|
const actualPageSize = defaultPageSize || pageSize;
|
|
72012
|
-
const stableData =
|
|
71758
|
+
const stableData = React60__default.useMemo(() => data, [data]);
|
|
72013
71759
|
const table = useReactTable({
|
|
72014
71760
|
data: stableData,
|
|
72015
71761
|
columns,
|
|
@@ -72089,7 +71835,7 @@ function DataTable({
|
|
|
72089
71835
|
autoResetExpanded: false,
|
|
72090
71836
|
getRowId: (row) => row.id || row.orderId || Math.random().toString()
|
|
72091
71837
|
});
|
|
72092
|
-
|
|
71838
|
+
React60__default.useEffect(() => {
|
|
72093
71839
|
if (onRowSelect && selectable) {
|
|
72094
71840
|
const selectedRows = table.getFilteredSelectedRowModel().rows.map((row) => row.original);
|
|
72095
71841
|
onRowSelect(selectedRows);
|
|
@@ -72097,8 +71843,8 @@ function DataTable({
|
|
|
72097
71843
|
}, [rowSelection, onRowSelect, selectable, table]);
|
|
72098
71844
|
table.getState();
|
|
72099
71845
|
const rowModel = table.getRowModel();
|
|
72100
|
-
const rowsRef =
|
|
72101
|
-
|
|
71846
|
+
const rowsRef = React60__default.useRef(rowModel.rows);
|
|
71847
|
+
React60__default.useMemo(() => {
|
|
72102
71848
|
const changed = rowsRef.current !== rowModel.rows;
|
|
72103
71849
|
if (changed) {
|
|
72104
71850
|
rowsRef.current = rowModel.rows;
|
|
@@ -72135,7 +71881,7 @@ function DataTable({
|
|
|
72135
71881
|
includeHeaders: true
|
|
72136
71882
|
});
|
|
72137
71883
|
};
|
|
72138
|
-
const exportFormats =
|
|
71884
|
+
const exportFormats = React60__default.useMemo(() => {
|
|
72139
71885
|
if (!exportable)
|
|
72140
71886
|
return [];
|
|
72141
71887
|
if (exportable === true)
|
|
@@ -72412,8 +72158,8 @@ function getExpandableColumn(expandedRows, onToggle) {
|
|
|
72412
72158
|
};
|
|
72413
72159
|
}
|
|
72414
72160
|
function useExpandableRows(initialExpanded = /* @__PURE__ */ new Set()) {
|
|
72415
|
-
const [expandedRows, setExpandedRows] =
|
|
72416
|
-
const toggleRow =
|
|
72161
|
+
const [expandedRows, setExpandedRows] = React60__default.useState(initialExpanded);
|
|
72162
|
+
const toggleRow = React60__default.useCallback((id) => {
|
|
72417
72163
|
setExpandedRows((prev) => {
|
|
72418
72164
|
const newExpanded = new Set(prev);
|
|
72419
72165
|
if (newExpanded.has(id)) {
|
|
@@ -72424,10 +72170,10 @@ function useExpandableRows(initialExpanded = /* @__PURE__ */ new Set()) {
|
|
|
72424
72170
|
return newExpanded;
|
|
72425
72171
|
});
|
|
72426
72172
|
}, []);
|
|
72427
|
-
const expandAll =
|
|
72173
|
+
const expandAll = React60__default.useCallback((rowIds) => {
|
|
72428
72174
|
setExpandedRows(new Set(rowIds));
|
|
72429
72175
|
}, []);
|
|
72430
|
-
const collapseAll =
|
|
72176
|
+
const collapseAll = React60__default.useCallback(() => {
|
|
72431
72177
|
setExpandedRows(/* @__PURE__ */ new Set());
|
|
72432
72178
|
}, []);
|
|
72433
72179
|
return {
|
|
@@ -72438,7 +72184,7 @@ function useExpandableRows(initialExpanded = /* @__PURE__ */ new Set()) {
|
|
|
72438
72184
|
collapseAll
|
|
72439
72185
|
};
|
|
72440
72186
|
}
|
|
72441
|
-
var TableRow2 =
|
|
72187
|
+
var TableRow2 = React60__default.memo(({
|
|
72442
72188
|
row,
|
|
72443
72189
|
columns,
|
|
72444
72190
|
isExpanded,
|
|
@@ -72489,7 +72235,7 @@ var TableRow2 = React67__default.memo(({
|
|
|
72489
72235
|
});
|
|
72490
72236
|
TableRow2.displayName = "TableRow";
|
|
72491
72237
|
var MoonUIDataTablePro = DataTable;
|
|
72492
|
-
var SearchInput =
|
|
72238
|
+
var SearchInput = React60__default.memo(({
|
|
72493
72239
|
searchInputRef,
|
|
72494
72240
|
searchPlaceholder,
|
|
72495
72241
|
initialValue,
|
|
@@ -72816,7 +72562,7 @@ function SidebarInternal({
|
|
|
72816
72562
|
const hasChildren = item.items && item.items.length > 0;
|
|
72817
72563
|
const isExpanded = expandedSections.includes(item.id);
|
|
72818
72564
|
const shouldShowHoverMenu = collapsed && !isMobile && depth === 0 && (hasChildren || item.title);
|
|
72819
|
-
const ItemWrapper = item.tooltip && !collapsed ? MoonUITooltipTriggerPro :
|
|
72565
|
+
const ItemWrapper = item.tooltip && !collapsed ? MoonUITooltipTriggerPro : React60__default.Fragment;
|
|
72820
72566
|
const itemContent = /* @__PURE__ */ jsxs(
|
|
72821
72567
|
"button",
|
|
72822
72568
|
{
|
|
@@ -72914,7 +72660,7 @@ function SidebarInternal({
|
|
|
72914
72660
|
) })
|
|
72915
72661
|
] }, item.id);
|
|
72916
72662
|
}, [activePath, pinnedItems, expandedSections, collapsed, customStyles, handleItemClick, toggleSection, isMobile, glassmorphism, renderCollapsedHoverContent]);
|
|
72917
|
-
const SidebarHeader =
|
|
72663
|
+
const SidebarHeader = React60__default.memo(() => {
|
|
72918
72664
|
return /* @__PURE__ */ jsxs("div", { className: cn(
|
|
72919
72665
|
"flex items-center gap-3 p-4 border-b",
|
|
72920
72666
|
collapsed && !isMobile && "justify-center px-2"
|
|
@@ -72948,7 +72694,7 @@ function SidebarInternal({
|
|
|
72948
72694
|
)
|
|
72949
72695
|
] });
|
|
72950
72696
|
});
|
|
72951
|
-
const SidebarMenuContent =
|
|
72697
|
+
const SidebarMenuContent = React60__default.memo(() => {
|
|
72952
72698
|
return /* @__PURE__ */ jsx(ScrollArea, { className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "p-4 space-y-6", children: [
|
|
72953
72699
|
pinnedItems.length > 0 && (!collapsed || isMobile) && /* @__PURE__ */ jsxs("div", { children: [
|
|
72954
72700
|
/* @__PURE__ */ jsx("h4", { className: "text-xs font-medium text-muted-foreground mb-2", children: "Pinned" }),
|
|
@@ -72964,7 +72710,7 @@ function SidebarInternal({
|
|
|
72964
72710
|
] }, section.id))
|
|
72965
72711
|
] }) });
|
|
72966
72712
|
});
|
|
72967
|
-
const SidebarFooter =
|
|
72713
|
+
const SidebarFooter = React60__default.memo(() => {
|
|
72968
72714
|
return footer ? /* @__PURE__ */ jsxs("div", { className: "border-t p-4", children: [
|
|
72969
72715
|
/* @__PURE__ */ jsx("div", { className: "space-y-1", children: footer.items.map((item) => renderItem(item)) }),
|
|
72970
72716
|
showThemeToggle && (!collapsed || isMobile) && /* @__PURE__ */ jsxs("div", { className: "mt-3 flex items-center justify-between", children: [
|
|
@@ -72993,7 +72739,7 @@ function SidebarInternal({
|
|
|
72993
72739
|
] })
|
|
72994
72740
|
] }) : null;
|
|
72995
72741
|
});
|
|
72996
|
-
const SidebarContent =
|
|
72742
|
+
const SidebarContent = React60__default.memo(() => {
|
|
72997
72743
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
72998
72744
|
/* @__PURE__ */ jsx(SidebarMenuContent, {}),
|
|
72999
72745
|
/* @__PURE__ */ jsx(SidebarFooter, {})
|
|
@@ -73367,7 +73113,7 @@ function NavbarInternal({
|
|
|
73367
73113
|
}
|
|
73368
73114
|
)
|
|
73369
73115
|
] }),
|
|
73370
|
-
!isMobile && /* @__PURE__ */ jsx(NavigationMenu2, { className: "hidden md:flex", children: /* @__PURE__ */ jsx(NavigationMenuList2, { children: sections.map((section) => /* @__PURE__ */ jsx(
|
|
73116
|
+
!isMobile && /* @__PURE__ */ jsx(NavigationMenu2, { className: "hidden md:flex", children: /* @__PURE__ */ jsx(NavigationMenuList2, { children: sections.map((section) => /* @__PURE__ */ jsx(React60__default.Fragment, { children: section.items.map((item) => {
|
|
73371
73117
|
const hasChildren = item.items && item.items.length > 0;
|
|
73372
73118
|
const isActive2 = item.href === activePath;
|
|
73373
73119
|
if (hasChildren) {
|
|
@@ -74110,9 +73856,9 @@ var FormWizardStep = ({
|
|
|
74110
73856
|
animationDuration = 0.3
|
|
74111
73857
|
}) => {
|
|
74112
73858
|
const { steps, currentStep, goToNext, goToPrevious, goToStep, updateStepData, stepData, error } = useFormWizard();
|
|
74113
|
-
const [direction, setDirection] =
|
|
74114
|
-
const previousStep =
|
|
74115
|
-
|
|
73859
|
+
const [direction, setDirection] = React60__default.useState(0);
|
|
73860
|
+
const previousStep = React60__default.useRef(currentStep);
|
|
73861
|
+
React60__default.useEffect(() => {
|
|
74116
73862
|
setDirection(currentStep > previousStep.current ? 1 : -1);
|
|
74117
73863
|
previousStep.current = currentStep;
|
|
74118
73864
|
}, [currentStep]);
|
|
@@ -74248,7 +73994,7 @@ var FormWizardNavigation = ({
|
|
|
74248
73994
|
)
|
|
74249
73995
|
] });
|
|
74250
73996
|
};
|
|
74251
|
-
var FormWizardInternal =
|
|
73997
|
+
var FormWizardInternal = React60__default.forwardRef(({
|
|
74252
73998
|
steps,
|
|
74253
73999
|
currentStep = 0,
|
|
74254
74000
|
onStepChange,
|
|
@@ -74327,7 +74073,7 @@ var FormWizardInternal = React67__default.forwardRef(({
|
|
|
74327
74073
|
);
|
|
74328
74074
|
});
|
|
74329
74075
|
FormWizardInternal.displayName = "FormWizardInternal";
|
|
74330
|
-
var MoonUIFormWizardPro =
|
|
74076
|
+
var MoonUIFormWizardPro = React60__default.forwardRef(
|
|
74331
74077
|
(props, ref) => {
|
|
74332
74078
|
const { hasProAccess, isLoading } = useSubscription();
|
|
74333
74079
|
if (!isLoading && !hasProAccess) {
|
|
@@ -74797,7 +74543,7 @@ function validateExpiry(expiry) {
|
|
|
74797
74543
|
const expiryDate = new Date(year, month - 1);
|
|
74798
74544
|
return expiryDate > now;
|
|
74799
74545
|
}
|
|
74800
|
-
var MoonUICreditCardInputPro =
|
|
74546
|
+
var MoonUICreditCardInputPro = React60__default.forwardRef(({
|
|
74801
74547
|
value = { number: "", expiry: "", cvc: "", name: "" },
|
|
74802
74548
|
onChange,
|
|
74803
74549
|
showCardPreview = true,
|
|
@@ -75044,7 +74790,7 @@ var quizFormVariants = cva(
|
|
|
75044
74790
|
}
|
|
75045
74791
|
}
|
|
75046
74792
|
);
|
|
75047
|
-
var MoonUIQuizFormProInternal =
|
|
74793
|
+
var MoonUIQuizFormProInternal = React60__default.forwardRef(({
|
|
75048
74794
|
className,
|
|
75049
74795
|
variant,
|
|
75050
74796
|
size: size4,
|
|
@@ -75626,7 +75372,7 @@ var MoonUIQuizFormProInternal = React67__default.forwardRef(({
|
|
|
75626
75372
|
] });
|
|
75627
75373
|
});
|
|
75628
75374
|
MoonUIQuizFormProInternal.displayName = "MoonUIQuizFormProInternal";
|
|
75629
|
-
var MoonUIQuizFormPro2 =
|
|
75375
|
+
var MoonUIQuizFormPro2 = React60__default.forwardRef((props, ref) => {
|
|
75630
75376
|
const { hasProAccess, isLoading } = useSubscription();
|
|
75631
75377
|
if (!isLoading && !hasProAccess) {
|
|
75632
75378
|
return /* @__PURE__ */ jsx(MoonUICardPro, { className: cn("w-full", props.className), children: /* @__PURE__ */ jsx(MoonUICardContentPro, { className: "py-12 text-center", children: /* @__PURE__ */ jsxs("div", { className: "max-w-md mx-auto space-y-4", children: [
|