@refraction-ui/react 0.3.3 → 0.3.5
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.cjs +988 -771
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +979 -771
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React42 from 'react';
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
3
|
import * as ReactDOM from 'react-dom';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
@@ -69,6 +69,7 @@ __export(index_exports, {
|
|
|
69
69
|
AccordionContent: () => AccordionContent,
|
|
70
70
|
AccordionItem: () => AccordionItem,
|
|
71
71
|
AccordionTrigger: () => AccordionTrigger,
|
|
72
|
+
AltHintState: () => AltHintState,
|
|
72
73
|
AnimatedText: () => AnimatedText,
|
|
73
74
|
AppShell: () => AppShell,
|
|
74
75
|
AuthGuard: () => AuthGuard,
|
|
@@ -169,6 +170,7 @@ __export(index_exports, {
|
|
|
169
170
|
ResizableDivider: () => ResizableDivider,
|
|
170
171
|
ResizableLayout: () => ResizableLayout,
|
|
171
172
|
ResizablePane: () => ResizablePane,
|
|
173
|
+
SANE_DEFAULTS: () => SANE_DEFAULTS,
|
|
172
174
|
STATUS_COLORS: () => STATUS_COLORS2,
|
|
173
175
|
STATUS_LABELS: () => STATUS_LABELS2,
|
|
174
176
|
SearchBar: () => SearchBar,
|
|
@@ -179,6 +181,10 @@ __export(index_exports, {
|
|
|
179
181
|
SelectItem: () => SelectItem,
|
|
180
182
|
SelectTrigger: () => SelectTrigger,
|
|
181
183
|
ShortcutBadge: () => ShortcutBadge,
|
|
184
|
+
ShortcutContext: () => ShortcutContext,
|
|
185
|
+
ShortcutHint: () => ShortcutHint,
|
|
186
|
+
ShortcutProvider: () => ShortcutProvider,
|
|
187
|
+
ShortcutRegistry: () => ShortcutRegistry,
|
|
182
188
|
Sidebar: () => Sidebar,
|
|
183
189
|
Skeleton: () => Skeleton,
|
|
184
190
|
SkeletonText: () => SkeletonText,
|
|
@@ -207,6 +213,7 @@ __export(index_exports, {
|
|
|
207
213
|
TypewriterText: () => TypewriterText,
|
|
208
214
|
VersionSelector: () => VersionSelector,
|
|
209
215
|
VideoPlayer: () => VideoPlayer,
|
|
216
|
+
altHintState: () => altHintState,
|
|
210
217
|
animatedTextVariants: () => animatedTextVariants,
|
|
211
218
|
avatarFallbackVariants: () => avatarFallbackVariants,
|
|
212
219
|
avatarImageVariants: () => avatarImageVariants,
|
|
@@ -264,6 +271,7 @@ __export(index_exports, {
|
|
|
264
271
|
getAssignableRoles: () => getAssignableRoles,
|
|
265
272
|
getDefaultPortal: () => getDefaultPortal,
|
|
266
273
|
getInitials: () => getInitials,
|
|
274
|
+
globalShortcutRegistry: () => globalShortcutRegistry,
|
|
267
275
|
hasAllRoles: () => hasAllRoles,
|
|
268
276
|
hasAnyRole: () => hasAnyRole,
|
|
269
277
|
hasRole: () => hasRole,
|
|
@@ -353,6 +361,7 @@ __export(index_exports, {
|
|
|
353
361
|
tooltipContentVariants: () => tooltipContentVariants,
|
|
354
362
|
typewriterVariants: () => typewriterVariants,
|
|
355
363
|
useAuth: () => useAuth,
|
|
364
|
+
useShortcut: () => useShortcut,
|
|
356
365
|
useTheme: () => useTheme,
|
|
357
366
|
useToast: () => useToast,
|
|
358
367
|
versionSelectorOptionVariants: () => optionVariants2,
|
|
@@ -474,14 +483,14 @@ function applyThemeToDOM(resolved, attribute = "class") {
|
|
|
474
483
|
}
|
|
475
484
|
|
|
476
485
|
// ../react-theme/dist/index.js
|
|
477
|
-
var ThemeContext =
|
|
486
|
+
var ThemeContext = React42.createContext(null);
|
|
478
487
|
function ThemeProvider({
|
|
479
488
|
children,
|
|
480
489
|
defaultMode = "system",
|
|
481
490
|
storageKey = "rfr-theme",
|
|
482
491
|
attribute = "class"
|
|
483
492
|
}) {
|
|
484
|
-
const themeRef =
|
|
493
|
+
const themeRef = React42.useRef(null);
|
|
485
494
|
if (!themeRef.current) {
|
|
486
495
|
const isBrowser = typeof window !== "undefined";
|
|
487
496
|
themeRef.current = createTheme(
|
|
@@ -490,8 +499,8 @@ function ThemeProvider({
|
|
|
490
499
|
isBrowser ? createMediaQueryAdapter() : void 0
|
|
491
500
|
);
|
|
492
501
|
}
|
|
493
|
-
const [state, setState] =
|
|
494
|
-
|
|
502
|
+
const [state, setState] = React42.useState(() => themeRef.current.getState());
|
|
503
|
+
React42.useEffect(() => {
|
|
495
504
|
const theme = themeRef.current;
|
|
496
505
|
applyThemeToDOM(theme.getState().resolved, attribute);
|
|
497
506
|
const unsub = theme.subscribe((newState) => {
|
|
@@ -503,7 +512,7 @@ function ThemeProvider({
|
|
|
503
512
|
theme.destroy();
|
|
504
513
|
};
|
|
505
514
|
}, [attribute]);
|
|
506
|
-
const contextValue =
|
|
515
|
+
const contextValue = React42.useMemo(
|
|
507
516
|
() => ({
|
|
508
517
|
mode: state.mode,
|
|
509
518
|
resolved: state.resolved,
|
|
@@ -511,10 +520,10 @@ function ThemeProvider({
|
|
|
511
520
|
}),
|
|
512
521
|
[state.mode, state.resolved]
|
|
513
522
|
);
|
|
514
|
-
return
|
|
523
|
+
return React42.createElement(ThemeContext.Provider, { value: contextValue }, children);
|
|
515
524
|
}
|
|
516
525
|
function useTheme() {
|
|
517
|
-
const context =
|
|
526
|
+
const context = React42.useContext(ThemeContext);
|
|
518
527
|
if (!context) {
|
|
519
528
|
throw new Error("useTheme must be used within a <ThemeProvider>");
|
|
520
529
|
}
|
|
@@ -526,7 +535,7 @@ var modes = [
|
|
|
526
535
|
{ value: "system", label: "System", icon: "monitor" }
|
|
527
536
|
];
|
|
528
537
|
var icons = {
|
|
529
|
-
sun:
|
|
538
|
+
sun: React42.createElement(
|
|
530
539
|
"svg",
|
|
531
540
|
{
|
|
532
541
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -539,10 +548,10 @@ var icons = {
|
|
|
539
548
|
strokeLinecap: "round",
|
|
540
549
|
strokeLinejoin: "round"
|
|
541
550
|
},
|
|
542
|
-
|
|
543
|
-
|
|
551
|
+
React42.createElement("circle", { cx: 12, cy: 12, r: 5 }),
|
|
552
|
+
React42.createElement("path", { d: "M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42" })
|
|
544
553
|
),
|
|
545
|
-
moon:
|
|
554
|
+
moon: React42.createElement(
|
|
546
555
|
"svg",
|
|
547
556
|
{
|
|
548
557
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -555,9 +564,9 @@ var icons = {
|
|
|
555
564
|
strokeLinecap: "round",
|
|
556
565
|
strokeLinejoin: "round"
|
|
557
566
|
},
|
|
558
|
-
|
|
567
|
+
React42.createElement("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
|
|
559
568
|
),
|
|
560
|
-
monitor:
|
|
569
|
+
monitor: React42.createElement(
|
|
561
570
|
"svg",
|
|
562
571
|
{
|
|
563
572
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -570,15 +579,15 @@ var icons = {
|
|
|
570
579
|
strokeLinecap: "round",
|
|
571
580
|
strokeLinejoin: "round"
|
|
572
581
|
},
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
582
|
+
React42.createElement("rect", { x: 2, y: 3, width: 20, height: 14, rx: 2, ry: 2 }),
|
|
583
|
+
React42.createElement("line", { x1: 8, y1: 21, x2: 16, y2: 21 }),
|
|
584
|
+
React42.createElement("line", { x1: 12, y1: 17, x2: 12, y2: 21 })
|
|
576
585
|
)
|
|
577
586
|
};
|
|
578
587
|
function ThemeToggle({ className, variant = "segmented" }) {
|
|
579
588
|
const { mode, setMode } = useTheme();
|
|
580
589
|
if (variant === "segmented") {
|
|
581
|
-
return
|
|
590
|
+
return React42.createElement(
|
|
582
591
|
"div",
|
|
583
592
|
{
|
|
584
593
|
className: `inline-flex items-center gap-1 rounded-lg border p-1 ${className ?? ""}`,
|
|
@@ -586,7 +595,7 @@ function ThemeToggle({ className, variant = "segmented" }) {
|
|
|
586
595
|
"aria-label": "Theme"
|
|
587
596
|
},
|
|
588
597
|
modes.map(
|
|
589
|
-
({ value, label, icon }) =>
|
|
598
|
+
({ value, label, icon }) => React42.createElement("button", {
|
|
590
599
|
key: value,
|
|
591
600
|
type: "button",
|
|
592
601
|
role: "radio",
|
|
@@ -598,9 +607,9 @@ function ThemeToggle({ className, variant = "segmented" }) {
|
|
|
598
607
|
)
|
|
599
608
|
);
|
|
600
609
|
}
|
|
601
|
-
const [open, setOpen] =
|
|
602
|
-
const ref =
|
|
603
|
-
|
|
610
|
+
const [open, setOpen] = React42.useState(false);
|
|
611
|
+
const ref = React42.useRef(null);
|
|
612
|
+
React42.useEffect(() => {
|
|
604
613
|
if (!open) return;
|
|
605
614
|
const handler = (e) => {
|
|
606
615
|
if (ref.current && !ref.current.contains(e.target)) setOpen(false);
|
|
@@ -609,24 +618,24 @@ function ThemeToggle({ className, variant = "segmented" }) {
|
|
|
609
618
|
return () => document.removeEventListener("mousedown", handler);
|
|
610
619
|
}, [open]);
|
|
611
620
|
const currentIcon = modes.find((m) => m.value === mode)?.icon ?? "monitor";
|
|
612
|
-
return
|
|
621
|
+
return React42.createElement(
|
|
613
622
|
"div",
|
|
614
623
|
{ ref, className: `relative ${className ?? ""}` },
|
|
615
|
-
|
|
624
|
+
React42.createElement("button", {
|
|
616
625
|
type: "button",
|
|
617
626
|
"aria-label": "Toggle theme",
|
|
618
627
|
"aria-expanded": open,
|
|
619
628
|
className: "inline-flex items-center justify-center rounded-md p-2 text-sm transition-colors hover:bg-muted",
|
|
620
629
|
onClick: () => setOpen(!open)
|
|
621
630
|
}, icons[currentIcon]),
|
|
622
|
-
open &&
|
|
631
|
+
open && React42.createElement(
|
|
623
632
|
"div",
|
|
624
633
|
{
|
|
625
634
|
className: "absolute right-0 top-full mt-1 z-50 min-w-[8rem] rounded-md border bg-popover p-1 shadow-md",
|
|
626
635
|
role: "menu"
|
|
627
636
|
},
|
|
628
637
|
modes.map(
|
|
629
|
-
({ value, label, icon }) =>
|
|
638
|
+
({ value, label, icon }) => React42.createElement("button", {
|
|
630
639
|
key: value,
|
|
631
640
|
type: "button",
|
|
632
641
|
role: "menuitem",
|
|
@@ -644,7 +653,7 @@ function ThemeScript({
|
|
|
644
653
|
storageKey = "rfr-theme",
|
|
645
654
|
attribute = "class"
|
|
646
655
|
}) {
|
|
647
|
-
return
|
|
656
|
+
return React42.createElement("script", {
|
|
648
657
|
dangerouslySetInnerHTML: {
|
|
649
658
|
__html: getThemeScript(storageKey, attribute)
|
|
650
659
|
}
|
|
@@ -762,14 +771,14 @@ function cva(config) {
|
|
|
762
771
|
return classes.filter(Boolean).join(" ");
|
|
763
772
|
};
|
|
764
773
|
}
|
|
765
|
-
var AccordionContext =
|
|
766
|
-
var Accordion =
|
|
774
|
+
var AccordionContext = React42.createContext(null);
|
|
775
|
+
var Accordion = React42.forwardRef(
|
|
767
776
|
({ className, type = "single", collapsible, value: controlledValue, defaultValue, onValueChange, ...props }, ref) => {
|
|
768
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
777
|
+
const [uncontrolledValue, setUncontrolledValue] = React42.useState(
|
|
769
778
|
defaultValue ?? (type === "multiple" ? [] : "")
|
|
770
779
|
);
|
|
771
780
|
const value = controlledValue !== void 0 ? controlledValue : uncontrolledValue;
|
|
772
|
-
const handleValueChange =
|
|
781
|
+
const handleValueChange = React42.useCallback(
|
|
773
782
|
(itemValue) => {
|
|
774
783
|
if (type === "single") {
|
|
775
784
|
const newValue = value === itemValue && collapsible ? "" : itemValue;
|
|
@@ -788,20 +797,20 @@ var Accordion = React41.forwardRef(
|
|
|
788
797
|
}
|
|
789
798
|
);
|
|
790
799
|
Accordion.displayName = "Accordion";
|
|
791
|
-
var AccordionItemContext =
|
|
792
|
-
var AccordionItem =
|
|
800
|
+
var AccordionItemContext = React42.createContext(null);
|
|
801
|
+
var AccordionItem = React42.forwardRef(
|
|
793
802
|
({ className, value, ...props }, ref) => {
|
|
794
|
-
const context =
|
|
803
|
+
const context = React42.useContext(AccordionContext);
|
|
795
804
|
if (!context) throw new Error("AccordionItem must be within Accordion");
|
|
796
805
|
const isOpen = context.type === "single" ? context.value === value : Array.isArray(context.value) && context.value.includes(value);
|
|
797
806
|
return /* @__PURE__ */ jsx(AccordionItemContext.Provider, { value: { value, isOpen }, children: /* @__PURE__ */ jsx("div", { ref, className: cn("border-b border-border", className), "data-state": isOpen ? "open" : "closed", ...props }) });
|
|
798
807
|
}
|
|
799
808
|
);
|
|
800
809
|
AccordionItem.displayName = "AccordionItem";
|
|
801
|
-
var AccordionTrigger =
|
|
810
|
+
var AccordionTrigger = React42.forwardRef(
|
|
802
811
|
({ className, children, ...props }, ref) => {
|
|
803
|
-
const accordionContext =
|
|
804
|
-
const itemContext =
|
|
812
|
+
const accordionContext = React42.useContext(AccordionContext);
|
|
813
|
+
const itemContext = React42.useContext(AccordionItemContext);
|
|
805
814
|
if (!accordionContext || !itemContext) throw new Error("AccordionTrigger missing context");
|
|
806
815
|
return /* @__PURE__ */ jsx("h3", { className: "flex m-0 p-0", children: /* @__PURE__ */ jsxs(
|
|
807
816
|
"button",
|
|
@@ -840,9 +849,9 @@ var AccordionTrigger = React41.forwardRef(
|
|
|
840
849
|
}
|
|
841
850
|
);
|
|
842
851
|
AccordionTrigger.displayName = "AccordionTrigger";
|
|
843
|
-
var AccordionContent =
|
|
852
|
+
var AccordionContent = React42.forwardRef(
|
|
844
853
|
({ className, children, ...props }, ref) => {
|
|
845
|
-
const itemContext =
|
|
854
|
+
const itemContext = React42.useContext(AccordionItemContext);
|
|
846
855
|
if (!itemContext) throw new Error("AccordionContent missing context");
|
|
847
856
|
return /* @__PURE__ */ jsx(
|
|
848
857
|
"div",
|
|
@@ -924,16 +933,16 @@ var typewriterVariants = cva({
|
|
|
924
933
|
cursor: "blinking"
|
|
925
934
|
}
|
|
926
935
|
});
|
|
927
|
-
var AnimatedText =
|
|
936
|
+
var AnimatedText = React42.forwardRef(
|
|
928
937
|
({ words, interval = 2500, transitionDuration = 1e3, className, ...props }, ref) => {
|
|
929
|
-
const apiRef =
|
|
938
|
+
const apiRef = React42.useRef(
|
|
930
939
|
createAnimatedText({ words})
|
|
931
940
|
);
|
|
932
941
|
const api = apiRef.current;
|
|
933
|
-
const [currentIndex, setCurrentIndex] =
|
|
934
|
-
const [isExiting, setIsExiting] =
|
|
942
|
+
const [currentIndex, setCurrentIndex] = React42.useState(0);
|
|
943
|
+
const [isExiting, setIsExiting] = React42.useState(false);
|
|
935
944
|
const prefersReducedMotion = typeof globalThis !== "undefined" && typeof globalThis.matchMedia === "function" && globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
936
|
-
|
|
945
|
+
React42.useEffect(() => {
|
|
937
946
|
if (words.length <= 1) return;
|
|
938
947
|
const tick = setInterval(() => {
|
|
939
948
|
if (prefersReducedMotion) {
|
|
@@ -969,13 +978,13 @@ var AnimatedText = React41.forwardRef(
|
|
|
969
978
|
}
|
|
970
979
|
);
|
|
971
980
|
AnimatedText.displayName = "AnimatedText";
|
|
972
|
-
var TypewriterText =
|
|
981
|
+
var TypewriterText = React42.forwardRef(
|
|
973
982
|
({ text, speed = 50, startDelay = 0, className, ...props }, ref) => {
|
|
974
|
-
const apiRef =
|
|
983
|
+
const apiRef = React42.useRef(createTypewriter({ text}));
|
|
975
984
|
const api = apiRef.current;
|
|
976
|
-
const [currentIndex, setCurrentIndex] =
|
|
985
|
+
const [currentIndex, setCurrentIndex] = React42.useState(0);
|
|
977
986
|
const prefersReducedMotion = typeof globalThis !== "undefined" && typeof globalThis.matchMedia === "function" && globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
978
|
-
|
|
987
|
+
React42.useEffect(() => {
|
|
979
988
|
if (prefersReducedMotion) {
|
|
980
989
|
api.state.currentIndex = text.length;
|
|
981
990
|
setCurrentIndex(text.length);
|
|
@@ -1136,24 +1145,24 @@ function getAssignableRoles(user) {
|
|
|
1136
1145
|
}
|
|
1137
1146
|
|
|
1138
1147
|
// ../react-auth/dist/index.js
|
|
1139
|
-
var AuthContext =
|
|
1148
|
+
var AuthContext = React42.createContext(null);
|
|
1140
1149
|
function AuthProvider({ children, ...config }) {
|
|
1141
|
-
const authRef =
|
|
1150
|
+
const authRef = React42.useRef(null);
|
|
1142
1151
|
if (!authRef.current) {
|
|
1143
1152
|
if (!config.adapter && !config.testMode) {
|
|
1144
1153
|
throw new Error("[refraction-ui/react-auth] You must provide an `adapter` to AuthProvider.");
|
|
1145
1154
|
}
|
|
1146
1155
|
authRef.current = createAuth(config.adapter, config);
|
|
1147
1156
|
}
|
|
1148
|
-
const [state, setState] =
|
|
1149
|
-
|
|
1157
|
+
const [state, setState] = React42.useState(() => authRef.current.getState());
|
|
1158
|
+
React42.useEffect(() => {
|
|
1150
1159
|
const unsub = authRef.current.subscribe(setState);
|
|
1151
1160
|
return () => {
|
|
1152
1161
|
unsub();
|
|
1153
1162
|
authRef.current.destroy();
|
|
1154
1163
|
};
|
|
1155
1164
|
}, []);
|
|
1156
|
-
const value =
|
|
1165
|
+
const value = React42.useMemo(
|
|
1157
1166
|
() => ({
|
|
1158
1167
|
user: state.user,
|
|
1159
1168
|
isLoading: state.status === "loading",
|
|
@@ -1167,10 +1176,10 @@ function AuthProvider({ children, ...config }) {
|
|
|
1167
1176
|
}),
|
|
1168
1177
|
[state.user, state.status]
|
|
1169
1178
|
);
|
|
1170
|
-
return
|
|
1179
|
+
return React42.createElement(AuthContext.Provider, { value }, children);
|
|
1171
1180
|
}
|
|
1172
1181
|
function useAuth() {
|
|
1173
|
-
const ctx =
|
|
1182
|
+
const ctx = React42.useContext(AuthContext);
|
|
1174
1183
|
if (!ctx) {
|
|
1175
1184
|
throw new Error("useAuth must be used within an <AuthProvider>");
|
|
1176
1185
|
}
|
|
@@ -1184,15 +1193,15 @@ function AuthGuard({
|
|
|
1184
1193
|
}) {
|
|
1185
1194
|
const { isLoading, isAuthenticated, user } = useAuth();
|
|
1186
1195
|
if (isLoading) {
|
|
1187
|
-
return
|
|
1196
|
+
return React42.createElement(React42.Fragment, null, fallback ?? null);
|
|
1188
1197
|
}
|
|
1189
1198
|
if (!isAuthenticated) {
|
|
1190
|
-
return
|
|
1199
|
+
return React42.createElement(React42.Fragment, null, fallback ?? null);
|
|
1191
1200
|
}
|
|
1192
1201
|
if (roles && roles.length > 0 && !hasAnyRole(user, roles)) {
|
|
1193
|
-
return
|
|
1202
|
+
return React42.createElement(React42.Fragment, null, unauthorized ?? null);
|
|
1194
1203
|
}
|
|
1195
|
-
return
|
|
1204
|
+
return React42.createElement(React42.Fragment, null, children);
|
|
1196
1205
|
}
|
|
1197
1206
|
|
|
1198
1207
|
// ../badge/dist/index.js
|
|
@@ -1232,7 +1241,7 @@ var badgeVariants = cva({
|
|
|
1232
1241
|
size: "md"
|
|
1233
1242
|
}
|
|
1234
1243
|
});
|
|
1235
|
-
var Badge =
|
|
1244
|
+
var Badge = React42.forwardRef(
|
|
1236
1245
|
({ variant, size, className, children, ...props }, ref) => {
|
|
1237
1246
|
const api = createBadge({ variant});
|
|
1238
1247
|
const classes = cn(badgeVariants({ variant, size }), className);
|
|
@@ -1279,7 +1288,7 @@ var bottomNavTabVariants = cva({
|
|
|
1279
1288
|
active: "false"
|
|
1280
1289
|
}
|
|
1281
1290
|
});
|
|
1282
|
-
var BottomNav =
|
|
1291
|
+
var BottomNav = React42.forwardRef(
|
|
1283
1292
|
({ tabs = [], currentPath, className, ...props }, ref) => {
|
|
1284
1293
|
const api = createBottomNav({ currentPath });
|
|
1285
1294
|
const classes = cn(bottomNavVariants(), className);
|
|
@@ -1352,7 +1361,7 @@ var breadcrumbItemVariants = cva({
|
|
|
1352
1361
|
}
|
|
1353
1362
|
});
|
|
1354
1363
|
var breadcrumbSeparatorStyles = "text-muted-foreground/50 select-none";
|
|
1355
|
-
var Breadcrumbs =
|
|
1364
|
+
var Breadcrumbs = React42.forwardRef(
|
|
1356
1365
|
({
|
|
1357
1366
|
pathname,
|
|
1358
1367
|
items,
|
|
@@ -1459,31 +1468,341 @@ var buttonVariants = cva({
|
|
|
1459
1468
|
size: "default"
|
|
1460
1469
|
}
|
|
1461
1470
|
});
|
|
1462
|
-
|
|
1463
|
-
|
|
1471
|
+
|
|
1472
|
+
// ../keyboard-shortcut/dist/index.js
|
|
1473
|
+
var MODIFIER_KEYS = /* @__PURE__ */ new Set(["Ctrl", "Control", "Alt", "Shift", "Meta", "Cmd", "Command"]);
|
|
1474
|
+
var KEY_DISPLAY = {
|
|
1475
|
+
"Ctrl": "Ctrl",
|
|
1476
|
+
"Control": "Ctrl",
|
|
1477
|
+
"Alt": "Alt",
|
|
1478
|
+
"Shift": "Shift",
|
|
1479
|
+
"Meta": "Meta",
|
|
1480
|
+
"Cmd": "Cmd",
|
|
1481
|
+
"Command": "Cmd",
|
|
1482
|
+
"Enter": "\u21B5",
|
|
1483
|
+
"Backspace": "\u232B",
|
|
1484
|
+
"Delete": "Del",
|
|
1485
|
+
"Escape": "Esc",
|
|
1486
|
+
"ArrowUp": "\u2191",
|
|
1487
|
+
"ArrowDown": "\u2193",
|
|
1488
|
+
"ArrowLeft": "\u2190",
|
|
1489
|
+
"ArrowRight": "\u2192",
|
|
1490
|
+
"Tab": "Tab",
|
|
1491
|
+
" ": "Space"
|
|
1492
|
+
};
|
|
1493
|
+
var MAC_KEY_DISPLAY = {
|
|
1494
|
+
"Ctrl": "\u2303",
|
|
1495
|
+
"Control": "\u2303",
|
|
1496
|
+
"Alt": "\u2325",
|
|
1497
|
+
"Shift": "\u21E7",
|
|
1498
|
+
"Meta": "\u2318",
|
|
1499
|
+
"Cmd": "\u2318",
|
|
1500
|
+
"Command": "\u2318",
|
|
1501
|
+
"Enter": "\u21B5",
|
|
1502
|
+
"Backspace": "\u232B",
|
|
1503
|
+
"Delete": "\u2326",
|
|
1504
|
+
"Escape": "\u238B",
|
|
1505
|
+
"ArrowUp": "\u2191",
|
|
1506
|
+
"ArrowDown": "\u2193",
|
|
1507
|
+
"ArrowLeft": "\u2190",
|
|
1508
|
+
"ArrowRight": "\u2192",
|
|
1509
|
+
"Tab": "\u21E5",
|
|
1510
|
+
" ": "\u2423"
|
|
1511
|
+
};
|
|
1512
|
+
function normalizeKey(key) {
|
|
1513
|
+
if (key === "Command" || key === "Cmd") return "Meta";
|
|
1514
|
+
if (key === "Control") return "Ctrl";
|
|
1515
|
+
return key;
|
|
1516
|
+
}
|
|
1517
|
+
function isMac() {
|
|
1518
|
+
if (typeof navigator !== "undefined") {
|
|
1519
|
+
return navigator.platform?.includes("Mac") || navigator.userAgent?.includes("Mac");
|
|
1520
|
+
}
|
|
1521
|
+
return false;
|
|
1522
|
+
}
|
|
1523
|
+
function formatShortcut(keys, mac) {
|
|
1524
|
+
const displayMap = mac ? MAC_KEY_DISPLAY : KEY_DISPLAY;
|
|
1525
|
+
return keys.map((key) => displayMap[key] ?? key.toUpperCase()).join(mac ? "" : "+");
|
|
1526
|
+
}
|
|
1527
|
+
function createKeyboardShortcut(props) {
|
|
1528
|
+
const {
|
|
1529
|
+
keys,
|
|
1530
|
+
onTrigger,
|
|
1531
|
+
enabled: enabledProp = true,
|
|
1532
|
+
preventDefault: preventDefaultProp = true
|
|
1533
|
+
} = props;
|
|
1534
|
+
const normalizedKeys = keys.map(normalizeKey);
|
|
1535
|
+
const modifiers = normalizedKeys.filter((k) => MODIFIER_KEYS.has(k));
|
|
1536
|
+
const regularKeys = normalizedKeys.filter((k) => !MODIFIER_KEYS.has(k));
|
|
1537
|
+
function handler(event) {
|
|
1538
|
+
if (!enabledProp) return false;
|
|
1539
|
+
const ctrlRequired = modifiers.includes("Ctrl");
|
|
1540
|
+
const altRequired = modifiers.includes("Alt");
|
|
1541
|
+
const shiftRequired = modifiers.includes("Shift");
|
|
1542
|
+
const metaRequired = modifiers.includes("Meta");
|
|
1543
|
+
if (ctrlRequired !== (event.ctrlKey || event.metaKey && !metaRequired)) ;
|
|
1544
|
+
const ctrlMatch = ctrlRequired ? event.ctrlKey : !event.ctrlKey;
|
|
1545
|
+
const altMatch = altRequired ? event.altKey : !event.altKey;
|
|
1546
|
+
const shiftMatch = shiftRequired ? event.shiftKey : !event.shiftKey;
|
|
1547
|
+
const metaMatch = metaRequired ? event.metaKey : !event.metaKey;
|
|
1548
|
+
if (!ctrlMatch || !altMatch || !shiftMatch || !metaMatch) return false;
|
|
1549
|
+
if (regularKeys.length > 0) {
|
|
1550
|
+
const eventKey = event.key.length === 1 ? event.key.toUpperCase() : event.key;
|
|
1551
|
+
const targetKey = regularKeys[0].length === 1 ? regularKeys[0].toUpperCase() : regularKeys[0];
|
|
1552
|
+
if (eventKey !== targetKey) return false;
|
|
1553
|
+
}
|
|
1554
|
+
if (preventDefaultProp) {
|
|
1555
|
+
event.preventDefault();
|
|
1556
|
+
}
|
|
1557
|
+
onTrigger();
|
|
1558
|
+
return true;
|
|
1559
|
+
}
|
|
1560
|
+
const mac = isMac();
|
|
1561
|
+
const display = formatShortcut(keys, false);
|
|
1562
|
+
const platformDisplay = formatShortcut(keys, mac);
|
|
1563
|
+
const badgeAriaProps = {
|
|
1564
|
+
"aria-hidden": true,
|
|
1565
|
+
role: "presentation"
|
|
1566
|
+
};
|
|
1567
|
+
return {
|
|
1568
|
+
handler,
|
|
1569
|
+
display,
|
|
1570
|
+
platformDisplay,
|
|
1571
|
+
enabled: enabledProp,
|
|
1572
|
+
keys,
|
|
1573
|
+
badgeAriaProps
|
|
1574
|
+
};
|
|
1575
|
+
}
|
|
1576
|
+
var SANE_DEFAULTS = {
|
|
1577
|
+
save: ["Meta", "s"],
|
|
1578
|
+
search: ["Meta", "k"],
|
|
1579
|
+
close: ["Escape"],
|
|
1580
|
+
submit: ["Meta", "Enter"],
|
|
1581
|
+
undo: ["Meta", "z"],
|
|
1582
|
+
redo: ["Meta", "Shift", "z"],
|
|
1583
|
+
copy: ["Meta", "c"],
|
|
1584
|
+
paste: ["Meta", "v"],
|
|
1585
|
+
cut: ["Meta", "x"],
|
|
1586
|
+
new: ["Meta", "n"],
|
|
1587
|
+
print: ["Meta", "p"],
|
|
1588
|
+
help: ["?"]
|
|
1589
|
+
};
|
|
1590
|
+
var ShortcutRegistry = class {
|
|
1591
|
+
shortcuts = /* @__PURE__ */ new Map();
|
|
1592
|
+
register(keys, handler) {
|
|
1593
|
+
const keyStr = keys.map((k) => k.toLowerCase()).sort().join("+");
|
|
1594
|
+
if (this.shortcuts.has(keyStr)) {
|
|
1595
|
+
console.warn(`Shortcut ${keyStr} is already registered.`);
|
|
1596
|
+
}
|
|
1597
|
+
this.shortcuts.set(keyStr, handler);
|
|
1598
|
+
}
|
|
1599
|
+
unregister(keys) {
|
|
1600
|
+
const keyStr = keys.map((k) => k.toLowerCase()).sort().join("+");
|
|
1601
|
+
this.shortcuts.delete(keyStr);
|
|
1602
|
+
}
|
|
1603
|
+
};
|
|
1604
|
+
var globalShortcutRegistry = new ShortcutRegistry();
|
|
1605
|
+
var AltHintState = class {
|
|
1606
|
+
showHints = false;
|
|
1607
|
+
listeners = /* @__PURE__ */ new Set();
|
|
1608
|
+
initialized = false;
|
|
1609
|
+
init() {
|
|
1610
|
+
if (this.initialized || typeof window === "undefined") return;
|
|
1611
|
+
this.initialized = true;
|
|
1612
|
+
const handleKeyDown = (e) => {
|
|
1613
|
+
if (e.key === "Alt") {
|
|
1614
|
+
this.setShowHints(true);
|
|
1615
|
+
}
|
|
1616
|
+
};
|
|
1617
|
+
const handleKeyUp = (e) => {
|
|
1618
|
+
if (e.key === "Alt") {
|
|
1619
|
+
this.setShowHints(false);
|
|
1620
|
+
}
|
|
1621
|
+
};
|
|
1622
|
+
const handleBlur = () => {
|
|
1623
|
+
this.setShowHints(false);
|
|
1624
|
+
};
|
|
1625
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
1626
|
+
window.addEventListener("keyup", handleKeyUp);
|
|
1627
|
+
window.addEventListener("blur", handleBlur);
|
|
1628
|
+
}
|
|
1629
|
+
setShowHints(value) {
|
|
1630
|
+
if (this.showHints !== value) {
|
|
1631
|
+
this.showHints = value;
|
|
1632
|
+
this.listeners.forEach((listener) => listener(value));
|
|
1633
|
+
}
|
|
1634
|
+
}
|
|
1635
|
+
subscribe(listener) {
|
|
1636
|
+
this.listeners.add(listener);
|
|
1637
|
+
listener(this.showHints);
|
|
1638
|
+
return () => {
|
|
1639
|
+
this.listeners.delete(listener);
|
|
1640
|
+
};
|
|
1641
|
+
}
|
|
1642
|
+
get snapshot() {
|
|
1643
|
+
return this.showHints;
|
|
1644
|
+
}
|
|
1645
|
+
};
|
|
1646
|
+
var altHintState = new AltHintState();
|
|
1647
|
+
var shortcutBadgeStyles = "inline-flex items-center gap-0.5 rounded border bg-muted px-1.5 py-0.5 text-xs font-mono text-muted-foreground";
|
|
1648
|
+
var shortcutKeyStyles = "inline-flex items-center justify-center min-w-[1.25rem] rounded bg-background px-1 py-0.5 text-xs font-mono border shadow-sm";
|
|
1649
|
+
var shortcutSeparatorStyles = "text-muted-foreground text-xs";
|
|
1650
|
+
var ShortcutContext = React42.createContext(false);
|
|
1651
|
+
function ShortcutProvider({ children }) {
|
|
1652
|
+
const [showHints, setShowHints] = React42.useState(altHintState.snapshot);
|
|
1653
|
+
React42.useEffect(() => {
|
|
1654
|
+
altHintState.init();
|
|
1655
|
+
return altHintState.subscribe(setShowHints);
|
|
1656
|
+
}, []);
|
|
1657
|
+
return /* @__PURE__ */ jsx(ShortcutContext.Provider, { value: showHints, children });
|
|
1658
|
+
}
|
|
1659
|
+
function useShortcut({
|
|
1660
|
+
shortcut,
|
|
1661
|
+
action,
|
|
1662
|
+
onTrigger,
|
|
1663
|
+
enabled = true,
|
|
1664
|
+
preventDefault = true
|
|
1665
|
+
}) {
|
|
1666
|
+
const showHints = React42.useContext(ShortcutContext);
|
|
1667
|
+
const keys = React42.useMemo(() => {
|
|
1668
|
+
if (shortcut) {
|
|
1669
|
+
return shortcut.split("+").map((s) => s.trim());
|
|
1670
|
+
}
|
|
1671
|
+
if (action && SANE_DEFAULTS[action]) {
|
|
1672
|
+
return SANE_DEFAULTS[action];
|
|
1673
|
+
}
|
|
1674
|
+
return [];
|
|
1675
|
+
}, [shortcut, action]);
|
|
1676
|
+
const apiRef = React42.useRef(
|
|
1677
|
+
createKeyboardShortcut({ keys, onTrigger, enabled, preventDefault })
|
|
1678
|
+
);
|
|
1679
|
+
React42.useEffect(() => {
|
|
1680
|
+
apiRef.current = createKeyboardShortcut({ keys, onTrigger, enabled, preventDefault });
|
|
1681
|
+
}, [keys, onTrigger, enabled, preventDefault]);
|
|
1682
|
+
React42.useEffect(() => {
|
|
1683
|
+
if (!enabled || keys.length === 0) return;
|
|
1684
|
+
const handler = () => {
|
|
1685
|
+
apiRef.current.handler(new KeyboardEvent("keydown"));
|
|
1686
|
+
};
|
|
1687
|
+
globalShortcutRegistry.register(keys, handler);
|
|
1688
|
+
const handleKeyDown = (e) => {
|
|
1689
|
+
apiRef.current.handler(e);
|
|
1690
|
+
};
|
|
1691
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
1692
|
+
return () => {
|
|
1693
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
1694
|
+
globalShortcutRegistry.unregister(keys);
|
|
1695
|
+
};
|
|
1696
|
+
}, [enabled, keys]);
|
|
1697
|
+
return { keys, showHints };
|
|
1698
|
+
}
|
|
1699
|
+
function ShortcutHint({ shortcut, action, className, platform = true, ...props }) {
|
|
1700
|
+
const showHints = React42.useContext(ShortcutContext);
|
|
1701
|
+
const keys = React42.useMemo(() => {
|
|
1702
|
+
if (shortcut) {
|
|
1703
|
+
return shortcut.split("+").map((s) => s.trim());
|
|
1704
|
+
}
|
|
1705
|
+
if (action && SANE_DEFAULTS[action]) {
|
|
1706
|
+
return SANE_DEFAULTS[action];
|
|
1707
|
+
}
|
|
1708
|
+
return [];
|
|
1709
|
+
}, [shortcut, action]);
|
|
1710
|
+
if (!showHints || keys.length === 0) return null;
|
|
1711
|
+
return /* @__PURE__ */ jsx("div", { className: cn("absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none z-10", className), children: /* @__PURE__ */ jsx(ShortcutBadge, { keys, platform, ...props }) });
|
|
1712
|
+
}
|
|
1713
|
+
function KeyboardShortcut({
|
|
1714
|
+
keys,
|
|
1715
|
+
onTrigger,
|
|
1716
|
+
enabled = true,
|
|
1717
|
+
preventDefault = true
|
|
1718
|
+
}) {
|
|
1719
|
+
const apiRef = React42.useRef(
|
|
1720
|
+
createKeyboardShortcut({ keys, onTrigger, enabled, preventDefault })
|
|
1721
|
+
);
|
|
1722
|
+
React42.useEffect(() => {
|
|
1723
|
+
apiRef.current = createKeyboardShortcut({ keys, onTrigger, enabled, preventDefault });
|
|
1724
|
+
}, [keys, onTrigger, enabled, preventDefault]);
|
|
1725
|
+
React42.useEffect(() => {
|
|
1726
|
+
if (!enabled) return;
|
|
1727
|
+
const handleKeyDown = (e) => {
|
|
1728
|
+
apiRef.current.handler(e);
|
|
1729
|
+
};
|
|
1730
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
1731
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
1732
|
+
}, [enabled]);
|
|
1733
|
+
return null;
|
|
1734
|
+
}
|
|
1735
|
+
KeyboardShortcut.displayName = "KeyboardShortcut";
|
|
1736
|
+
function ShortcutBadge({ keys, platform = true, className }) {
|
|
1737
|
+
const api = createKeyboardShortcut({ keys, onTrigger: () => {
|
|
1738
|
+
}, enabled: false });
|
|
1739
|
+
const displayKeys = platform ? api.platformDisplay : api.display;
|
|
1740
|
+
const isMacDisplay = platform && displayKeys !== api.display;
|
|
1741
|
+
return React42.createElement(
|
|
1742
|
+
"kbd",
|
|
1743
|
+
{ ...api.badgeAriaProps, className: cn(shortcutBadgeStyles, className) },
|
|
1744
|
+
isMacDisplay ? React42.createElement("span", null, displayKeys) : keys.map(
|
|
1745
|
+
(key, i) => React42.createElement(
|
|
1746
|
+
React42.Fragment,
|
|
1747
|
+
{ key: i },
|
|
1748
|
+
i > 0 && React42.createElement("span", { className: shortcutSeparatorStyles }, "+"),
|
|
1749
|
+
React42.createElement(
|
|
1750
|
+
"span",
|
|
1751
|
+
{ className: shortcutKeyStyles },
|
|
1752
|
+
formatShortcut([key], false)
|
|
1753
|
+
)
|
|
1754
|
+
)
|
|
1755
|
+
)
|
|
1756
|
+
);
|
|
1757
|
+
}
|
|
1758
|
+
ShortcutBadge.displayName = "ShortcutBadge";
|
|
1759
|
+
var Button = React42.forwardRef(
|
|
1760
|
+
({ variant, size, loading, asChild, className, disabled, children, shortcut, action, ...props }, ref) => {
|
|
1464
1761
|
const api = createButton({ disabled, loading, type: props.type });
|
|
1465
1762
|
const classes = cn(buttonVariants({ variant, size }), className);
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1763
|
+
const internalRef = React42.useRef(null);
|
|
1764
|
+
const mergedRef = React42.useCallback(
|
|
1765
|
+
(node) => {
|
|
1766
|
+
internalRef.current = node;
|
|
1767
|
+
if (typeof ref === "function") ref(node);
|
|
1768
|
+
else if (ref) ref.current = node;
|
|
1769
|
+
},
|
|
1770
|
+
[ref]
|
|
1771
|
+
);
|
|
1772
|
+
useShortcut({
|
|
1773
|
+
shortcut,
|
|
1774
|
+
action,
|
|
1775
|
+
enabled: !disabled && !loading && (!!shortcut || !!action),
|
|
1776
|
+
onTrigger: () => {
|
|
1777
|
+
internalRef.current?.click();
|
|
1778
|
+
}
|
|
1779
|
+
});
|
|
1780
|
+
if (asChild && React42.isValidElement(children)) {
|
|
1781
|
+
return React42.cloneElement(children, {
|
|
1782
|
+
ref: mergedRef,
|
|
1783
|
+
className: cn(classes, children.props.className, "relative"),
|
|
1470
1784
|
type: getButtonType({ type: props.type }),
|
|
1471
1785
|
...api.ariaProps,
|
|
1472
1786
|
...api.dataAttributes,
|
|
1473
|
-
...props
|
|
1787
|
+
...props,
|
|
1788
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1789
|
+
(shortcut || action) && /* @__PURE__ */ jsx(ShortcutHint, { shortcut, action, className: "right-4" }),
|
|
1790
|
+
children.props.children
|
|
1791
|
+
] })
|
|
1474
1792
|
});
|
|
1475
1793
|
}
|
|
1476
1794
|
return /* @__PURE__ */ jsxs(
|
|
1477
1795
|
"button",
|
|
1478
1796
|
{
|
|
1479
|
-
ref,
|
|
1797
|
+
ref: mergedRef,
|
|
1480
1798
|
type: getButtonType({ type: props.type }),
|
|
1481
|
-
className: classes,
|
|
1799
|
+
className: cn(classes, "relative"),
|
|
1482
1800
|
disabled: disabled || loading,
|
|
1483
1801
|
...api.ariaProps,
|
|
1484
1802
|
...api.dataAttributes,
|
|
1485
1803
|
...props,
|
|
1486
1804
|
children: [
|
|
1805
|
+
(shortcut || action) && /* @__PURE__ */ jsx(ShortcutHint, { shortcut, action, className: "right-4" }),
|
|
1487
1806
|
loading && /* @__PURE__ */ jsxs(
|
|
1488
1807
|
"svg",
|
|
1489
1808
|
{
|
|
@@ -1671,15 +1990,15 @@ function Calendar({
|
|
|
1671
1990
|
maxDate,
|
|
1672
1991
|
disabledDates
|
|
1673
1992
|
}) {
|
|
1674
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
1675
|
-
const [uncontrolledMonth, setUncontrolledMonth] =
|
|
1993
|
+
const [uncontrolledValue, setUncontrolledValue] = React42.useState(defaultValue);
|
|
1994
|
+
const [uncontrolledMonth, setUncontrolledMonth] = React42.useState(
|
|
1676
1995
|
() => month ?? value ?? defaultValue ?? /* @__PURE__ */ new Date()
|
|
1677
1996
|
);
|
|
1678
1997
|
const isValueControlled = value !== void 0;
|
|
1679
1998
|
const isMonthControlled = month !== void 0;
|
|
1680
1999
|
const selectedValue = isValueControlled ? value : uncontrolledValue;
|
|
1681
2000
|
const displayMonth = isMonthControlled ? month : uncontrolledMonth;
|
|
1682
|
-
const handleSelect =
|
|
2001
|
+
const handleSelect = React42.useCallback(
|
|
1683
2002
|
(date) => {
|
|
1684
2003
|
if (!isValueControlled) {
|
|
1685
2004
|
setUncontrolledValue(date);
|
|
@@ -1688,7 +2007,7 @@ function Calendar({
|
|
|
1688
2007
|
},
|
|
1689
2008
|
[isValueControlled, onSelect]
|
|
1690
2009
|
);
|
|
1691
|
-
const handleMonthChange =
|
|
2010
|
+
const handleMonthChange = React42.useCallback(
|
|
1692
2011
|
(m) => {
|
|
1693
2012
|
if (!isMonthControlled) {
|
|
1694
2013
|
setUncontrolledMonth(m);
|
|
@@ -1714,28 +2033,28 @@ function Calendar({
|
|
|
1714
2033
|
return "default";
|
|
1715
2034
|
}
|
|
1716
2035
|
const monthLabel = `${MONTH_NAMES[api.state.currentMonth.getMonth()]} ${api.state.currentMonth.getFullYear()}`;
|
|
1717
|
-
return
|
|
2036
|
+
return React42.createElement(
|
|
1718
2037
|
"div",
|
|
1719
2038
|
{
|
|
1720
2039
|
className: cn(calendarVariants(), className),
|
|
1721
2040
|
...api.ariaProps
|
|
1722
2041
|
},
|
|
1723
2042
|
// Header row: prev, month label, next
|
|
1724
|
-
|
|
2043
|
+
React42.createElement(CalendarHeader, {
|
|
1725
2044
|
label: monthLabel,
|
|
1726
2045
|
labelId: api.ids.label,
|
|
1727
2046
|
onPrevMonth: api.prevMonth,
|
|
1728
2047
|
onNextMonth: api.nextMonth
|
|
1729
2048
|
}),
|
|
1730
2049
|
// Day-of-week headers
|
|
1731
|
-
|
|
2050
|
+
React42.createElement(
|
|
1732
2051
|
"div",
|
|
1733
2052
|
{
|
|
1734
2053
|
className: "grid grid-cols-7 gap-1 mb-1",
|
|
1735
2054
|
role: "row"
|
|
1736
2055
|
},
|
|
1737
2056
|
DAY_HEADERS.map(
|
|
1738
|
-
(d) =>
|
|
2057
|
+
(d) => React42.createElement(
|
|
1739
2058
|
"div",
|
|
1740
2059
|
{
|
|
1741
2060
|
key: d,
|
|
@@ -1748,7 +2067,7 @@ function Calendar({
|
|
|
1748
2067
|
)
|
|
1749
2068
|
),
|
|
1750
2069
|
// Day grid
|
|
1751
|
-
|
|
2070
|
+
React42.createElement(
|
|
1752
2071
|
"div",
|
|
1753
2072
|
{
|
|
1754
2073
|
className: "grid grid-cols-7 gap-1",
|
|
@@ -1757,7 +2076,7 @@ function Calendar({
|
|
|
1757
2076
|
api.days.map((day, i) => {
|
|
1758
2077
|
const dayAriaProps = api.getDayAriaProps(day);
|
|
1759
2078
|
const state = getDayState(day);
|
|
1760
|
-
return
|
|
2079
|
+
return React42.createElement(
|
|
1761
2080
|
"button",
|
|
1762
2081
|
{
|
|
1763
2082
|
key: i,
|
|
@@ -1781,12 +2100,12 @@ function CalendarHeader({
|
|
|
1781
2100
|
onNextMonth,
|
|
1782
2101
|
className
|
|
1783
2102
|
}) {
|
|
1784
|
-
return
|
|
2103
|
+
return React42.createElement(
|
|
1785
2104
|
"div",
|
|
1786
2105
|
{
|
|
1787
2106
|
className: cn("flex items-center justify-between mb-2", className)
|
|
1788
2107
|
},
|
|
1789
|
-
|
|
2108
|
+
React42.createElement(
|
|
1790
2109
|
"button",
|
|
1791
2110
|
{
|
|
1792
2111
|
type: "button",
|
|
@@ -1796,7 +2115,7 @@ function CalendarHeader({
|
|
|
1796
2115
|
},
|
|
1797
2116
|
"\u2039"
|
|
1798
2117
|
),
|
|
1799
|
-
|
|
2118
|
+
React42.createElement(
|
|
1800
2119
|
"div",
|
|
1801
2120
|
{
|
|
1802
2121
|
id: labelId,
|
|
@@ -1805,7 +2124,7 @@ function CalendarHeader({
|
|
|
1805
2124
|
},
|
|
1806
2125
|
label
|
|
1807
2126
|
),
|
|
1808
|
-
|
|
2127
|
+
React42.createElement(
|
|
1809
2128
|
"button",
|
|
1810
2129
|
{
|
|
1811
2130
|
type: "button",
|
|
@@ -1938,7 +2257,7 @@ var codeEditorVariants = cva({
|
|
|
1938
2257
|
size: "default"
|
|
1939
2258
|
}
|
|
1940
2259
|
});
|
|
1941
|
-
var CodeEditor =
|
|
2260
|
+
var CodeEditor = React42.forwardRef(
|
|
1942
2261
|
({
|
|
1943
2262
|
value = "",
|
|
1944
2263
|
onChange,
|
|
@@ -2054,9 +2373,9 @@ var collapsibleContentVariants = cva({
|
|
|
2054
2373
|
});
|
|
2055
2374
|
|
|
2056
2375
|
// ../react-collapsible/dist/index.js
|
|
2057
|
-
var CollapsibleContext =
|
|
2376
|
+
var CollapsibleContext = React42.createContext(null);
|
|
2058
2377
|
function useCollapsibleContext() {
|
|
2059
|
-
const ctx =
|
|
2378
|
+
const ctx = React42.useContext(CollapsibleContext);
|
|
2060
2379
|
if (!ctx) {
|
|
2061
2380
|
throw new Error(
|
|
2062
2381
|
"Collapsible compound components must be used within <Collapsible>"
|
|
@@ -2072,10 +2391,10 @@ function Collapsible({
|
|
|
2072
2391
|
children,
|
|
2073
2392
|
className
|
|
2074
2393
|
}) {
|
|
2075
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
2394
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React42.useState(defaultOpen);
|
|
2076
2395
|
const isControlled = controlledOpen !== void 0;
|
|
2077
2396
|
const open = isControlled ? controlledOpen : uncontrolledOpen;
|
|
2078
|
-
const handleOpenChange =
|
|
2397
|
+
const handleOpenChange = React42.useCallback(
|
|
2079
2398
|
(next) => {
|
|
2080
2399
|
if (!isControlled) {
|
|
2081
2400
|
setUncontrolledOpen(next);
|
|
@@ -2084,12 +2403,12 @@ function Collapsible({
|
|
|
2084
2403
|
},
|
|
2085
2404
|
[isControlled, onOpenChange]
|
|
2086
2405
|
);
|
|
2087
|
-
const apiRef =
|
|
2406
|
+
const apiRef = React42.useRef(null);
|
|
2088
2407
|
if (apiRef.current === null) {
|
|
2089
2408
|
apiRef.current = createCollapsible({ open, defaultOpen, disabled });
|
|
2090
2409
|
}
|
|
2091
2410
|
const contentId = apiRef.current.contentProps.id;
|
|
2092
|
-
const ctx =
|
|
2411
|
+
const ctx = React42.useMemo(
|
|
2093
2412
|
() => ({
|
|
2094
2413
|
open,
|
|
2095
2414
|
onOpenChange: handleOpenChange,
|
|
@@ -2098,10 +2417,10 @@ function Collapsible({
|
|
|
2098
2417
|
}),
|
|
2099
2418
|
[open, handleOpenChange, disabled, contentId]
|
|
2100
2419
|
);
|
|
2101
|
-
return
|
|
2420
|
+
return React42.createElement(
|
|
2102
2421
|
CollapsibleContext.Provider,
|
|
2103
2422
|
{ value: ctx },
|
|
2104
|
-
|
|
2423
|
+
React42.createElement(
|
|
2105
2424
|
"div",
|
|
2106
2425
|
{
|
|
2107
2426
|
"data-state": open ? "open" : "closed",
|
|
@@ -2113,7 +2432,7 @@ function Collapsible({
|
|
|
2113
2432
|
);
|
|
2114
2433
|
}
|
|
2115
2434
|
Collapsible.displayName = "Collapsible";
|
|
2116
|
-
var CollapsibleTrigger =
|
|
2435
|
+
var CollapsibleTrigger = React42.forwardRef(({ onClick, disabled: disabledProp, children, ...props }, ref) => {
|
|
2117
2436
|
const { open, onOpenChange, disabled: ctxDisabled, contentId } = useCollapsibleContext();
|
|
2118
2437
|
const disabled = disabledProp ?? ctxDisabled;
|
|
2119
2438
|
const handleClick = (e) => {
|
|
@@ -2122,7 +2441,7 @@ var CollapsibleTrigger = React41.forwardRef(({ onClick, disabled: disabledProp,
|
|
|
2122
2441
|
}
|
|
2123
2442
|
onClick?.(e);
|
|
2124
2443
|
};
|
|
2125
|
-
return
|
|
2444
|
+
return React42.createElement(
|
|
2126
2445
|
"button",
|
|
2127
2446
|
{
|
|
2128
2447
|
ref,
|
|
@@ -2139,11 +2458,11 @@ var CollapsibleTrigger = React41.forwardRef(({ onClick, disabled: disabledProp,
|
|
|
2139
2458
|
);
|
|
2140
2459
|
});
|
|
2141
2460
|
CollapsibleTrigger.displayName = "CollapsibleTrigger";
|
|
2142
|
-
var CollapsibleContent =
|
|
2461
|
+
var CollapsibleContent = React42.forwardRef(({ className, children, ...props }, ref) => {
|
|
2143
2462
|
const { open, contentId } = useCollapsibleContext();
|
|
2144
2463
|
const dataState = open ? "open" : "closed";
|
|
2145
2464
|
if (!open) return null;
|
|
2146
|
-
return
|
|
2465
|
+
return React42.createElement(
|
|
2147
2466
|
"div",
|
|
2148
2467
|
{
|
|
2149
2468
|
ref,
|
|
@@ -2288,9 +2607,9 @@ var commandGroupVariants = cva({
|
|
|
2288
2607
|
});
|
|
2289
2608
|
|
|
2290
2609
|
// ../react-command/dist/index.js
|
|
2291
|
-
var CommandContext =
|
|
2610
|
+
var CommandContext = React42.createContext(null);
|
|
2292
2611
|
function useCommandContext() {
|
|
2293
|
-
const ctx =
|
|
2612
|
+
const ctx = React42.useContext(CommandContext);
|
|
2294
2613
|
if (!ctx) {
|
|
2295
2614
|
throw new Error("Command compound components must be used within <Command>");
|
|
2296
2615
|
}
|
|
@@ -2303,11 +2622,11 @@ function Command({
|
|
|
2303
2622
|
className,
|
|
2304
2623
|
children
|
|
2305
2624
|
}) {
|
|
2306
|
-
const [items, setItems] =
|
|
2307
|
-
const [search, setSearch] =
|
|
2308
|
-
const [selectedIndex, setSelectedIndex] =
|
|
2309
|
-
const apiRef =
|
|
2310
|
-
const api =
|
|
2625
|
+
const [items, setItems] = React42.useState([]);
|
|
2626
|
+
const [search, setSearch] = React42.useState("");
|
|
2627
|
+
const [selectedIndex, setSelectedIndex] = React42.useState(0);
|
|
2628
|
+
const apiRef = React42.useRef(null);
|
|
2629
|
+
const api = React42.useMemo(() => {
|
|
2311
2630
|
const instance = createCommand({ open, onOpenChange, filter }, items);
|
|
2312
2631
|
if (search) {
|
|
2313
2632
|
instance.search(search);
|
|
@@ -2316,23 +2635,23 @@ function Command({
|
|
|
2316
2635
|
return instance;
|
|
2317
2636
|
}, [open, onOpenChange, filter, items, search]);
|
|
2318
2637
|
const filteredItems = api.state.filteredItems;
|
|
2319
|
-
const handleSearch =
|
|
2638
|
+
const handleSearch = React42.useCallback((query) => {
|
|
2320
2639
|
setSearch(query);
|
|
2321
2640
|
setSelectedIndex(0);
|
|
2322
2641
|
}, []);
|
|
2323
|
-
const handleSelect =
|
|
2642
|
+
const handleSelect = React42.useCallback((index) => {
|
|
2324
2643
|
setSelectedIndex(index);
|
|
2325
2644
|
}, []);
|
|
2326
|
-
const registerItem =
|
|
2645
|
+
const registerItem = React42.useCallback((item) => {
|
|
2327
2646
|
setItems((prev) => {
|
|
2328
2647
|
if (prev.some((i) => i.id === item.id)) return prev;
|
|
2329
2648
|
return [...prev, item];
|
|
2330
2649
|
});
|
|
2331
2650
|
}, []);
|
|
2332
|
-
const unregisterItem =
|
|
2651
|
+
const unregisterItem = React42.useCallback((id) => {
|
|
2333
2652
|
setItems((prev) => prev.filter((i) => i.id !== id));
|
|
2334
2653
|
}, []);
|
|
2335
|
-
const handleKeyDown =
|
|
2654
|
+
const handleKeyDown = React42.useCallback(
|
|
2336
2655
|
(e) => {
|
|
2337
2656
|
const handler = createKeyboardHandler({
|
|
2338
2657
|
[Keys.ArrowDown]: (ev) => {
|
|
@@ -2359,7 +2678,7 @@ function Command({
|
|
|
2359
2678
|
},
|
|
2360
2679
|
[filteredItems.length, onOpenChange]
|
|
2361
2680
|
);
|
|
2362
|
-
const ctx =
|
|
2681
|
+
const ctx = React42.useMemo(
|
|
2363
2682
|
() => ({
|
|
2364
2683
|
search,
|
|
2365
2684
|
onSearch: handleSearch,
|
|
@@ -2374,10 +2693,10 @@ function Command({
|
|
|
2374
2693
|
}),
|
|
2375
2694
|
[search, handleSearch, selectedIndex, handleSelect, items, filteredItems, registerItem, unregisterItem, api.ids.list, api.ids.input]
|
|
2376
2695
|
);
|
|
2377
|
-
return
|
|
2696
|
+
return React42.createElement(
|
|
2378
2697
|
CommandContext.Provider,
|
|
2379
2698
|
{ value: ctx },
|
|
2380
|
-
|
|
2699
|
+
React42.createElement(
|
|
2381
2700
|
"div",
|
|
2382
2701
|
{
|
|
2383
2702
|
className: cn(commandVariants(), className),
|
|
@@ -2389,14 +2708,14 @@ function Command({
|
|
|
2389
2708
|
);
|
|
2390
2709
|
}
|
|
2391
2710
|
Command.displayName = "Command";
|
|
2392
|
-
var CommandInput =
|
|
2711
|
+
var CommandInput = React42.forwardRef(
|
|
2393
2712
|
({ className, onChange, ...props }, ref) => {
|
|
2394
2713
|
const { search, onSearch, inputId, listId } = useCommandContext();
|
|
2395
2714
|
const handleChange = (e) => {
|
|
2396
2715
|
onSearch(e.target.value);
|
|
2397
2716
|
onChange?.(e);
|
|
2398
2717
|
};
|
|
2399
|
-
return
|
|
2718
|
+
return React42.createElement("input", {
|
|
2400
2719
|
ref,
|
|
2401
2720
|
id: inputId,
|
|
2402
2721
|
type: "text",
|
|
@@ -2411,10 +2730,10 @@ var CommandInput = React41.forwardRef(
|
|
|
2411
2730
|
}
|
|
2412
2731
|
);
|
|
2413
2732
|
CommandInput.displayName = "CommandInput";
|
|
2414
|
-
var CommandList =
|
|
2733
|
+
var CommandList = React42.forwardRef(
|
|
2415
2734
|
({ className, children, ...props }, ref) => {
|
|
2416
2735
|
const { listId } = useCommandContext();
|
|
2417
|
-
return
|
|
2736
|
+
return React42.createElement(
|
|
2418
2737
|
"div",
|
|
2419
2738
|
{
|
|
2420
2739
|
ref,
|
|
@@ -2429,11 +2748,11 @@ var CommandList = React41.forwardRef(
|
|
|
2429
2748
|
}
|
|
2430
2749
|
);
|
|
2431
2750
|
CommandList.displayName = "CommandList";
|
|
2432
|
-
var CommandEmpty =
|
|
2751
|
+
var CommandEmpty = React42.forwardRef(
|
|
2433
2752
|
({ className, children, ...props }, ref) => {
|
|
2434
2753
|
const { filteredItems } = useCommandContext();
|
|
2435
2754
|
if (filteredItems.length > 0) return null;
|
|
2436
|
-
return
|
|
2755
|
+
return React42.createElement(
|
|
2437
2756
|
"div",
|
|
2438
2757
|
{
|
|
2439
2758
|
ref,
|
|
@@ -2446,9 +2765,9 @@ var CommandEmpty = React41.forwardRef(
|
|
|
2446
2765
|
}
|
|
2447
2766
|
);
|
|
2448
2767
|
CommandEmpty.displayName = "CommandEmpty";
|
|
2449
|
-
var CommandGroup =
|
|
2768
|
+
var CommandGroup = React42.forwardRef(
|
|
2450
2769
|
({ className, heading, children, ...props }, ref) => {
|
|
2451
|
-
return
|
|
2770
|
+
return React42.createElement(
|
|
2452
2771
|
"div",
|
|
2453
2772
|
{
|
|
2454
2773
|
ref,
|
|
@@ -2457,7 +2776,7 @@ var CommandGroup = React41.forwardRef(
|
|
|
2457
2776
|
"aria-label": heading,
|
|
2458
2777
|
...props
|
|
2459
2778
|
},
|
|
2460
|
-
heading ?
|
|
2779
|
+
heading ? React42.createElement(
|
|
2461
2780
|
"div",
|
|
2462
2781
|
{ className: "px-2 py-1.5 text-xs font-medium text-muted-foreground" },
|
|
2463
2782
|
heading
|
|
@@ -2467,10 +2786,10 @@ var CommandGroup = React41.forwardRef(
|
|
|
2467
2786
|
}
|
|
2468
2787
|
);
|
|
2469
2788
|
CommandGroup.displayName = "CommandGroup";
|
|
2470
|
-
var CommandItem =
|
|
2789
|
+
var CommandItem = React42.forwardRef(
|
|
2471
2790
|
({ className, value, disabled, onSelect: onItemSelect, children, ...props }, ref) => {
|
|
2472
2791
|
const state = disabled ? "disabled" : "default";
|
|
2473
|
-
return
|
|
2792
|
+
return React42.createElement(
|
|
2474
2793
|
"div",
|
|
2475
2794
|
{
|
|
2476
2795
|
ref,
|
|
@@ -2491,9 +2810,9 @@ var CommandItem = React41.forwardRef(
|
|
|
2491
2810
|
}
|
|
2492
2811
|
);
|
|
2493
2812
|
CommandItem.displayName = "CommandItem";
|
|
2494
|
-
var CommandSeparator =
|
|
2813
|
+
var CommandSeparator = React42.forwardRef(
|
|
2495
2814
|
({ className, ...props }, ref) => {
|
|
2496
|
-
return
|
|
2815
|
+
return React42.createElement("div", {
|
|
2497
2816
|
ref,
|
|
2498
2817
|
role: "separator",
|
|
2499
2818
|
className: cn("-mx-1 h-px bg-border", className),
|
|
@@ -2540,7 +2859,7 @@ var contentProtectionVariants = cva({
|
|
|
2540
2859
|
var watermarkVariants = cva({
|
|
2541
2860
|
base: "pointer-events-none absolute inset-0 z-50 overflow-hidden"
|
|
2542
2861
|
});
|
|
2543
|
-
var ContentProtection =
|
|
2862
|
+
var ContentProtection = React42.forwardRef(
|
|
2544
2863
|
({
|
|
2545
2864
|
enabled,
|
|
2546
2865
|
disableCopy,
|
|
@@ -2787,10 +3106,10 @@ function DataTable({
|
|
|
2787
3106
|
className,
|
|
2788
3107
|
emptyMessage = "No data available"
|
|
2789
3108
|
}) {
|
|
2790
|
-
const [sortBy, setSortBy] =
|
|
2791
|
-
const [sortDir, setSortDir] =
|
|
2792
|
-
const [filters, setFilters] =
|
|
2793
|
-
const api =
|
|
3109
|
+
const [sortBy, setSortBy] = React42.useState(controlledSortBy ?? null);
|
|
3110
|
+
const [sortDir, setSortDir] = React42.useState(controlledSortDir);
|
|
3111
|
+
const [filters, setFilters] = React42.useState(controlledFilters ?? {});
|
|
3112
|
+
const api = React42.useMemo(
|
|
2794
3113
|
() => createDataTable({
|
|
2795
3114
|
columns,
|
|
2796
3115
|
data,
|
|
@@ -2801,7 +3120,7 @@ function DataTable({
|
|
|
2801
3120
|
}),
|
|
2802
3121
|
[columns, data, sortBy, sortDir, onSort, filters]
|
|
2803
3122
|
);
|
|
2804
|
-
const handleSort =
|
|
3123
|
+
const handleSort = React42.useCallback(
|
|
2805
3124
|
(columnId) => {
|
|
2806
3125
|
const col = columns.find((c) => c.id === columnId);
|
|
2807
3126
|
if (!col?.sortable) return;
|
|
@@ -2815,7 +3134,7 @@ function DataTable({
|
|
|
2815
3134
|
},
|
|
2816
3135
|
[columns, sortBy, sortDir, onSort]
|
|
2817
3136
|
);
|
|
2818
|
-
const handleFilter =
|
|
3137
|
+
const handleFilter = React42.useCallback(
|
|
2819
3138
|
(columnId, value) => {
|
|
2820
3139
|
setFilters((prev) => ({ ...prev, [columnId]: value }));
|
|
2821
3140
|
},
|
|
@@ -2823,26 +3142,26 @@ function DataTable({
|
|
|
2823
3142
|
);
|
|
2824
3143
|
const sortedData = api.state.sortedData;
|
|
2825
3144
|
const hasFilterable = columns.some((c) => c.filterable);
|
|
2826
|
-
return
|
|
3145
|
+
return React42.createElement(
|
|
2827
3146
|
"div",
|
|
2828
3147
|
{ className: "relative w-full overflow-auto" },
|
|
2829
|
-
|
|
3148
|
+
React42.createElement(
|
|
2830
3149
|
"table",
|
|
2831
3150
|
{
|
|
2832
3151
|
className: cn(tableVariants(), className),
|
|
2833
3152
|
role: "table"
|
|
2834
3153
|
},
|
|
2835
3154
|
// thead
|
|
2836
|
-
|
|
3155
|
+
React42.createElement(
|
|
2837
3156
|
"thead",
|
|
2838
3157
|
null,
|
|
2839
3158
|
// Header row
|
|
2840
|
-
|
|
3159
|
+
React42.createElement(
|
|
2841
3160
|
"tr",
|
|
2842
3161
|
{ role: "row" },
|
|
2843
3162
|
...columns.map((col) => {
|
|
2844
3163
|
const headerProps = api.getHeaderProps(col);
|
|
2845
|
-
return
|
|
3164
|
+
return React42.createElement(
|
|
2846
3165
|
"th",
|
|
2847
3166
|
{
|
|
2848
3167
|
key: col.id,
|
|
@@ -2851,19 +3170,19 @@ function DataTable({
|
|
|
2851
3170
|
onClick: col.sortable ? () => handleSort(col.id) : void 0
|
|
2852
3171
|
},
|
|
2853
3172
|
col.header,
|
|
2854
|
-
col.sortable && sortBy === col.id ?
|
|
3173
|
+
col.sortable && sortBy === col.id ? React42.createElement("span", { "aria-hidden": true }, sortDir === "asc" ? " \u2191" : " \u2193") : null
|
|
2855
3174
|
);
|
|
2856
3175
|
})
|
|
2857
3176
|
),
|
|
2858
3177
|
// Filter row
|
|
2859
|
-
hasFilterable ?
|
|
3178
|
+
hasFilterable ? React42.createElement(
|
|
2860
3179
|
"tr",
|
|
2861
3180
|
{ role: "row", "data-filter-row": "true" },
|
|
2862
3181
|
...columns.map(
|
|
2863
|
-
(col) =>
|
|
3182
|
+
(col) => React42.createElement(
|
|
2864
3183
|
"th",
|
|
2865
3184
|
{ key: `filter-${col.id}` },
|
|
2866
|
-
col.filterable ?
|
|
3185
|
+
col.filterable ? React42.createElement("input", {
|
|
2867
3186
|
type: "text",
|
|
2868
3187
|
"aria-label": `Filter ${col.header}`,
|
|
2869
3188
|
value: filters[col.id] ?? "",
|
|
@@ -2875,13 +3194,13 @@ function DataTable({
|
|
|
2875
3194
|
) : null
|
|
2876
3195
|
),
|
|
2877
3196
|
// tbody
|
|
2878
|
-
|
|
3197
|
+
React42.createElement(
|
|
2879
3198
|
"tbody",
|
|
2880
3199
|
null,
|
|
2881
|
-
sortedData.length === 0 ?
|
|
3200
|
+
sortedData.length === 0 ? React42.createElement(
|
|
2882
3201
|
"tr",
|
|
2883
3202
|
{ role: "row" },
|
|
2884
|
-
|
|
3203
|
+
React42.createElement(
|
|
2885
3204
|
"td",
|
|
2886
3205
|
{
|
|
2887
3206
|
colSpan: columns.length,
|
|
@@ -2891,7 +3210,7 @@ function DataTable({
|
|
|
2891
3210
|
emptyMessage
|
|
2892
3211
|
)
|
|
2893
3212
|
) : sortedData.map(
|
|
2894
|
-
(row, rowIndex) =>
|
|
3213
|
+
(row, rowIndex) => React42.createElement(
|
|
2895
3214
|
"tr",
|
|
2896
3215
|
{
|
|
2897
3216
|
key: rowIndex,
|
|
@@ -2899,7 +3218,7 @@ function DataTable({
|
|
|
2899
3218
|
className: rowVariants()
|
|
2900
3219
|
},
|
|
2901
3220
|
...columns.map(
|
|
2902
|
-
(col) =>
|
|
3221
|
+
(col) => React42.createElement(
|
|
2903
3222
|
"td",
|
|
2904
3223
|
{
|
|
2905
3224
|
key: col.id,
|
|
@@ -3009,7 +3328,7 @@ function DeviceFrame({
|
|
|
3009
3328
|
children
|
|
3010
3329
|
}) {
|
|
3011
3330
|
const api = createDeviceFrame({ device, orientation });
|
|
3012
|
-
return
|
|
3331
|
+
return React42.createElement(
|
|
3013
3332
|
"div",
|
|
3014
3333
|
{
|
|
3015
3334
|
className: cn(deviceFrameVariants({ device, orientation }), className),
|
|
@@ -3021,13 +3340,13 @@ function DeviceFrame({
|
|
|
3021
3340
|
...api.dataAttributes
|
|
3022
3341
|
},
|
|
3023
3342
|
// Notch decoration
|
|
3024
|
-
api.dimensions.notch ?
|
|
3343
|
+
api.dimensions.notch ? React42.createElement("div", {
|
|
3025
3344
|
className: "absolute top-0 left-1/2 -translate-x-1/2 w-[40%] h-[30px] bg-black rounded-b-2xl z-10",
|
|
3026
3345
|
"aria-hidden": "true",
|
|
3027
3346
|
"data-part": "notch"
|
|
3028
3347
|
}) : null,
|
|
3029
3348
|
// Screen area
|
|
3030
|
-
|
|
3349
|
+
React42.createElement(
|
|
3031
3350
|
"div",
|
|
3032
3351
|
{
|
|
3033
3352
|
className: "relative w-full h-full overflow-hidden bg-white",
|
|
@@ -3036,7 +3355,7 @@ function DeviceFrame({
|
|
|
3036
3355
|
children
|
|
3037
3356
|
),
|
|
3038
3357
|
// Home indicator decoration
|
|
3039
|
-
api.dimensions.homeIndicator ?
|
|
3358
|
+
api.dimensions.homeIndicator ? React42.createElement("div", {
|
|
3040
3359
|
className: "absolute bottom-2 left-1/2 -translate-x-1/2 w-[35%] h-[5px] bg-gray-300 rounded-full z-10",
|
|
3041
3360
|
"aria-hidden": "true",
|
|
3042
3361
|
"data-part": "home-indicator"
|
|
@@ -3125,9 +3444,9 @@ var dialogContentVariants = cva({
|
|
|
3125
3444
|
});
|
|
3126
3445
|
|
|
3127
3446
|
// ../react-dialog/dist/index.js
|
|
3128
|
-
var DialogContext =
|
|
3447
|
+
var DialogContext = React42.createContext(null);
|
|
3129
3448
|
function useDialogContext() {
|
|
3130
|
-
const ctx =
|
|
3449
|
+
const ctx = React42.useContext(DialogContext);
|
|
3131
3450
|
if (!ctx) {
|
|
3132
3451
|
throw new Error("Dialog compound components must be used within <Dialog>");
|
|
3133
3452
|
}
|
|
@@ -3140,10 +3459,10 @@ function Dialog({
|
|
|
3140
3459
|
modal = true,
|
|
3141
3460
|
children
|
|
3142
3461
|
}) {
|
|
3143
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
3462
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React42.useState(defaultOpen);
|
|
3144
3463
|
const isControlled = controlledOpen !== void 0;
|
|
3145
3464
|
const open = isControlled ? controlledOpen : uncontrolledOpen;
|
|
3146
|
-
const handleOpenChange =
|
|
3465
|
+
const handleOpenChange = React42.useCallback(
|
|
3147
3466
|
(next) => {
|
|
3148
3467
|
if (!isControlled) {
|
|
3149
3468
|
setUncontrolledOpen(next);
|
|
@@ -3152,12 +3471,12 @@ function Dialog({
|
|
|
3152
3471
|
},
|
|
3153
3472
|
[isControlled, onOpenChange]
|
|
3154
3473
|
);
|
|
3155
|
-
const apiRef =
|
|
3474
|
+
const apiRef = React42.useRef(null);
|
|
3156
3475
|
if (apiRef.current === null) {
|
|
3157
3476
|
apiRef.current = createDialog({ open, modal });
|
|
3158
3477
|
}
|
|
3159
3478
|
const api = apiRef.current;
|
|
3160
|
-
const ctx =
|
|
3479
|
+
const ctx = React42.useMemo(
|
|
3161
3480
|
() => ({
|
|
3162
3481
|
open,
|
|
3163
3482
|
onOpenChange: handleOpenChange,
|
|
@@ -3168,17 +3487,17 @@ function Dialog({
|
|
|
3168
3487
|
}),
|
|
3169
3488
|
[open, handleOpenChange, modal, api.ids.content, api.ids.title, api.ids.description]
|
|
3170
3489
|
);
|
|
3171
|
-
return
|
|
3490
|
+
return React42.createElement(DialogContext.Provider, { value: ctx }, children);
|
|
3172
3491
|
}
|
|
3173
3492
|
Dialog.displayName = "Dialog";
|
|
3174
|
-
var DialogTrigger =
|
|
3493
|
+
var DialogTrigger = React42.forwardRef(
|
|
3175
3494
|
({ onClick, children, ...props }, ref) => {
|
|
3176
3495
|
const { open, onOpenChange, contentId } = useDialogContext();
|
|
3177
3496
|
const handleClick = (e) => {
|
|
3178
3497
|
onOpenChange(!open);
|
|
3179
3498
|
onClick?.(e);
|
|
3180
3499
|
};
|
|
3181
|
-
return
|
|
3500
|
+
return React42.createElement(
|
|
3182
3501
|
"button",
|
|
3183
3502
|
{
|
|
3184
3503
|
ref,
|
|
@@ -3194,7 +3513,7 @@ var DialogTrigger = React41.forwardRef(
|
|
|
3194
3513
|
}
|
|
3195
3514
|
);
|
|
3196
3515
|
DialogTrigger.displayName = "DialogTrigger";
|
|
3197
|
-
var DialogOverlay =
|
|
3516
|
+
var DialogOverlay = React42.forwardRef(
|
|
3198
3517
|
({ className, onClick, ...props }, ref) => {
|
|
3199
3518
|
const { open, onOpenChange } = useDialogContext();
|
|
3200
3519
|
if (!open) return null;
|
|
@@ -3204,7 +3523,7 @@ var DialogOverlay = React41.forwardRef(
|
|
|
3204
3523
|
}
|
|
3205
3524
|
onClick?.(e);
|
|
3206
3525
|
};
|
|
3207
|
-
return
|
|
3526
|
+
return React42.createElement("div", {
|
|
3208
3527
|
ref,
|
|
3209
3528
|
className: cn(overlayStyles, className),
|
|
3210
3529
|
"data-state": open ? "open" : "closed",
|
|
@@ -3214,10 +3533,10 @@ var DialogOverlay = React41.forwardRef(
|
|
|
3214
3533
|
}
|
|
3215
3534
|
);
|
|
3216
3535
|
DialogOverlay.displayName = "DialogOverlay";
|
|
3217
|
-
var DialogContent =
|
|
3536
|
+
var DialogContent = React42.forwardRef(
|
|
3218
3537
|
({ className, children, onKeyDown, ...props }, ref) => {
|
|
3219
3538
|
const { open, onOpenChange, modal, contentId, titleId, descriptionId } = useDialogContext();
|
|
3220
|
-
|
|
3539
|
+
React42.useMemo(
|
|
3221
3540
|
() => createDialog({ open, modal }),
|
|
3222
3541
|
[open, modal]
|
|
3223
3542
|
);
|
|
@@ -3232,7 +3551,7 @@ var DialogContent = React41.forwardRef(
|
|
|
3232
3551
|
onKeyDown?.(e);
|
|
3233
3552
|
};
|
|
3234
3553
|
if (!open) return null;
|
|
3235
|
-
const content =
|
|
3554
|
+
const content = React42.createElement(
|
|
3236
3555
|
"div",
|
|
3237
3556
|
{
|
|
3238
3557
|
ref,
|
|
@@ -3255,9 +3574,9 @@ var DialogContent = React41.forwardRef(
|
|
|
3255
3574
|
}
|
|
3256
3575
|
);
|
|
3257
3576
|
DialogContent.displayName = "DialogContent";
|
|
3258
|
-
var DialogHeader =
|
|
3577
|
+
var DialogHeader = React42.forwardRef(
|
|
3259
3578
|
({ className, ...props }, ref) => {
|
|
3260
|
-
return
|
|
3579
|
+
return React42.createElement("div", {
|
|
3261
3580
|
ref,
|
|
3262
3581
|
className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className),
|
|
3263
3582
|
...props
|
|
@@ -3265,9 +3584,9 @@ var DialogHeader = React41.forwardRef(
|
|
|
3265
3584
|
}
|
|
3266
3585
|
);
|
|
3267
3586
|
DialogHeader.displayName = "DialogHeader";
|
|
3268
|
-
var DialogFooter =
|
|
3587
|
+
var DialogFooter = React42.forwardRef(
|
|
3269
3588
|
({ className, ...props }, ref) => {
|
|
3270
|
-
return
|
|
3589
|
+
return React42.createElement("div", {
|
|
3271
3590
|
ref,
|
|
3272
3591
|
className: cn(
|
|
3273
3592
|
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
@@ -3278,10 +3597,10 @@ var DialogFooter = React41.forwardRef(
|
|
|
3278
3597
|
}
|
|
3279
3598
|
);
|
|
3280
3599
|
DialogFooter.displayName = "DialogFooter";
|
|
3281
|
-
var DialogTitle =
|
|
3600
|
+
var DialogTitle = React42.forwardRef(
|
|
3282
3601
|
({ className, ...props }, ref) => {
|
|
3283
3602
|
const { titleId } = useDialogContext();
|
|
3284
|
-
return
|
|
3603
|
+
return React42.createElement("h2", {
|
|
3285
3604
|
ref,
|
|
3286
3605
|
id: titleId,
|
|
3287
3606
|
className: cn("text-lg font-semibold leading-none tracking-tight", className),
|
|
@@ -3290,9 +3609,9 @@ var DialogTitle = React41.forwardRef(
|
|
|
3290
3609
|
}
|
|
3291
3610
|
);
|
|
3292
3611
|
DialogTitle.displayName = "DialogTitle";
|
|
3293
|
-
var DialogDescription =
|
|
3612
|
+
var DialogDescription = React42.forwardRef(({ className, ...props }, ref) => {
|
|
3294
3613
|
const { descriptionId } = useDialogContext();
|
|
3295
|
-
return
|
|
3614
|
+
return React42.createElement("p", {
|
|
3296
3615
|
ref,
|
|
3297
3616
|
id: descriptionId,
|
|
3298
3617
|
className: cn("text-sm text-muted-foreground", className),
|
|
@@ -3300,14 +3619,14 @@ var DialogDescription = React41.forwardRef(({ className, ...props }, ref) => {
|
|
|
3300
3619
|
});
|
|
3301
3620
|
});
|
|
3302
3621
|
DialogDescription.displayName = "DialogDescription";
|
|
3303
|
-
var DialogClose =
|
|
3622
|
+
var DialogClose = React42.forwardRef(
|
|
3304
3623
|
({ onClick, children, ...props }, ref) => {
|
|
3305
3624
|
const { onOpenChange } = useDialogContext();
|
|
3306
3625
|
const handleClick = (e) => {
|
|
3307
3626
|
onOpenChange(false);
|
|
3308
3627
|
onClick?.(e);
|
|
3309
3628
|
};
|
|
3310
|
-
return
|
|
3629
|
+
return React42.createElement(
|
|
3311
3630
|
"button",
|
|
3312
3631
|
{
|
|
3313
3632
|
ref,
|
|
@@ -3412,9 +3731,9 @@ var menuItemVariants = cva({
|
|
|
3412
3731
|
});
|
|
3413
3732
|
|
|
3414
3733
|
// ../react-dropdown-menu/dist/index.js
|
|
3415
|
-
var DropdownMenuContext =
|
|
3734
|
+
var DropdownMenuContext = React42.createContext(null);
|
|
3416
3735
|
function useDropdownMenuContext() {
|
|
3417
|
-
const ctx =
|
|
3736
|
+
const ctx = React42.useContext(DropdownMenuContext);
|
|
3418
3737
|
if (!ctx) {
|
|
3419
3738
|
throw new Error("DropdownMenu compound components must be used within <DropdownMenu>");
|
|
3420
3739
|
}
|
|
@@ -3426,10 +3745,10 @@ function DropdownMenu({
|
|
|
3426
3745
|
onOpenChange,
|
|
3427
3746
|
children
|
|
3428
3747
|
}) {
|
|
3429
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
3748
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React42.useState(defaultOpen);
|
|
3430
3749
|
const isControlled = controlledOpen !== void 0;
|
|
3431
3750
|
const open = isControlled ? controlledOpen : uncontrolledOpen;
|
|
3432
|
-
const handleOpenChange =
|
|
3751
|
+
const handleOpenChange = React42.useCallback(
|
|
3433
3752
|
(next) => {
|
|
3434
3753
|
if (!isControlled) {
|
|
3435
3754
|
setUncontrolledOpen(next);
|
|
@@ -3438,12 +3757,12 @@ function DropdownMenu({
|
|
|
3438
3757
|
},
|
|
3439
3758
|
[isControlled, onOpenChange]
|
|
3440
3759
|
);
|
|
3441
|
-
const apiRef =
|
|
3760
|
+
const apiRef = React42.useRef(null);
|
|
3442
3761
|
if (apiRef.current === null) {
|
|
3443
3762
|
apiRef.current = createDropdownMenu({ open });
|
|
3444
3763
|
}
|
|
3445
3764
|
const api = apiRef.current;
|
|
3446
|
-
const ctx =
|
|
3765
|
+
const ctx = React42.useMemo(
|
|
3447
3766
|
() => ({
|
|
3448
3767
|
open,
|
|
3449
3768
|
onOpenChange: handleOpenChange,
|
|
@@ -3451,17 +3770,17 @@ function DropdownMenu({
|
|
|
3451
3770
|
}),
|
|
3452
3771
|
[open, handleOpenChange, api.ids.content]
|
|
3453
3772
|
);
|
|
3454
|
-
return
|
|
3773
|
+
return React42.createElement(DropdownMenuContext.Provider, { value: ctx }, children);
|
|
3455
3774
|
}
|
|
3456
3775
|
DropdownMenu.displayName = "DropdownMenu";
|
|
3457
|
-
var DropdownMenuTrigger =
|
|
3776
|
+
var DropdownMenuTrigger = React42.forwardRef(
|
|
3458
3777
|
({ onClick, children, ...props }, ref) => {
|
|
3459
3778
|
const { open, onOpenChange, contentId } = useDropdownMenuContext();
|
|
3460
3779
|
const handleClick = (e) => {
|
|
3461
3780
|
onOpenChange(!open);
|
|
3462
3781
|
onClick?.(e);
|
|
3463
3782
|
};
|
|
3464
|
-
return
|
|
3783
|
+
return React42.createElement(
|
|
3465
3784
|
"button",
|
|
3466
3785
|
{
|
|
3467
3786
|
ref,
|
|
@@ -3477,7 +3796,7 @@ var DropdownMenuTrigger = React41.forwardRef(
|
|
|
3477
3796
|
}
|
|
3478
3797
|
);
|
|
3479
3798
|
DropdownMenuTrigger.displayName = "DropdownMenuTrigger";
|
|
3480
|
-
var DropdownMenuContent =
|
|
3799
|
+
var DropdownMenuContent = React42.forwardRef(
|
|
3481
3800
|
({ className, children, onKeyDown, ...props }, ref) => {
|
|
3482
3801
|
const { open, onOpenChange, contentId } = useDropdownMenuContext();
|
|
3483
3802
|
const handleKeyDown = (e) => {
|
|
@@ -3491,7 +3810,7 @@ var DropdownMenuContent = React41.forwardRef(
|
|
|
3491
3810
|
onKeyDown?.(e);
|
|
3492
3811
|
};
|
|
3493
3812
|
if (!open) return null;
|
|
3494
|
-
const content =
|
|
3813
|
+
const content = React42.createElement(
|
|
3495
3814
|
"div",
|
|
3496
3815
|
{
|
|
3497
3816
|
ref,
|
|
@@ -3512,7 +3831,7 @@ var DropdownMenuContent = React41.forwardRef(
|
|
|
3512
3831
|
}
|
|
3513
3832
|
);
|
|
3514
3833
|
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
3515
|
-
var DropdownMenuItem =
|
|
3834
|
+
var DropdownMenuItem = React42.forwardRef(
|
|
3516
3835
|
({ className, disabled, onSelect, onClick, children, ...props }, ref) => {
|
|
3517
3836
|
const { onOpenChange } = useDropdownMenuContext();
|
|
3518
3837
|
const handleClick = (e) => {
|
|
@@ -3529,7 +3848,7 @@ var DropdownMenuItem = React41.forwardRef(
|
|
|
3529
3848
|
onOpenChange(false);
|
|
3530
3849
|
}
|
|
3531
3850
|
};
|
|
3532
|
-
return
|
|
3851
|
+
return React42.createElement(
|
|
3533
3852
|
"div",
|
|
3534
3853
|
{
|
|
3535
3854
|
ref,
|
|
@@ -3547,9 +3866,9 @@ var DropdownMenuItem = React41.forwardRef(
|
|
|
3547
3866
|
}
|
|
3548
3867
|
);
|
|
3549
3868
|
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
3550
|
-
var DropdownMenuSeparator =
|
|
3869
|
+
var DropdownMenuSeparator = React42.forwardRef(
|
|
3551
3870
|
({ className, ...props }, ref) => {
|
|
3552
|
-
return
|
|
3871
|
+
return React42.createElement("div", {
|
|
3553
3872
|
ref,
|
|
3554
3873
|
role: "separator",
|
|
3555
3874
|
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
@@ -3558,9 +3877,9 @@ var DropdownMenuSeparator = React41.forwardRef(
|
|
|
3558
3877
|
}
|
|
3559
3878
|
);
|
|
3560
3879
|
DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
3561
|
-
var DropdownMenuLabel =
|
|
3880
|
+
var DropdownMenuLabel = React42.forwardRef(
|
|
3562
3881
|
({ className, ...props }, ref) => {
|
|
3563
|
-
return
|
|
3882
|
+
return React42.createElement("div", {
|
|
3564
3883
|
ref,
|
|
3565
3884
|
className: cn("px-2 py-1.5 text-sm font-semibold", className),
|
|
3566
3885
|
...props
|
|
@@ -3672,15 +3991,15 @@ function FeedbackDialog({
|
|
|
3672
3991
|
type = "general",
|
|
3673
3992
|
className
|
|
3674
3993
|
}) {
|
|
3675
|
-
const [open, setOpen] =
|
|
3676
|
-
const [comment, setComment] =
|
|
3677
|
-
const [email, setEmail] =
|
|
3678
|
-
const [honeypot, setHoneypot] =
|
|
3679
|
-
const [isSubmitting, setIsSubmitting] =
|
|
3680
|
-
const [isSubmitted, setIsSubmitted] =
|
|
3994
|
+
const [open, setOpen] = React42.useState(controlledOpen ?? false);
|
|
3995
|
+
const [comment, setComment] = React42.useState("");
|
|
3996
|
+
const [email, setEmail] = React42.useState("");
|
|
3997
|
+
const [honeypot, setHoneypot] = React42.useState("");
|
|
3998
|
+
const [isSubmitting, setIsSubmitting] = React42.useState(false);
|
|
3999
|
+
const [isSubmitted, setIsSubmitted] = React42.useState(false);
|
|
3681
4000
|
const isControlled = controlledOpen !== void 0;
|
|
3682
4001
|
const isOpen = isControlled ? controlledOpen : open;
|
|
3683
|
-
const handleOpenChange =
|
|
4002
|
+
const handleOpenChange = React42.useCallback(
|
|
3684
4003
|
(next) => {
|
|
3685
4004
|
if (!isControlled) {
|
|
3686
4005
|
setOpen(next);
|
|
@@ -3689,11 +4008,11 @@ function FeedbackDialog({
|
|
|
3689
4008
|
},
|
|
3690
4009
|
[isControlled, onOpenChange]
|
|
3691
4010
|
);
|
|
3692
|
-
const apiRef =
|
|
4011
|
+
const apiRef = React42.useRef(null);
|
|
3693
4012
|
if (apiRef.current === null) {
|
|
3694
4013
|
apiRef.current = createFeedbackDialog({ open: isOpen, onOpenChange: handleOpenChange, onSubmit, type });
|
|
3695
4014
|
}
|
|
3696
|
-
const handleSubmit =
|
|
4015
|
+
const handleSubmit = React42.useCallback(async () => {
|
|
3697
4016
|
if (honeypot) return;
|
|
3698
4017
|
if (!comment.trim()) return;
|
|
3699
4018
|
setIsSubmitting(true);
|
|
@@ -3710,7 +4029,7 @@ function FeedbackDialog({
|
|
|
3710
4029
|
setIsSubmitting(false);
|
|
3711
4030
|
}
|
|
3712
4031
|
}, [comment, email, honeypot, type, onSubmit]);
|
|
3713
|
-
const handleReset =
|
|
4032
|
+
const handleReset = React42.useCallback(() => {
|
|
3714
4033
|
setComment("");
|
|
3715
4034
|
setEmail("");
|
|
3716
4035
|
setHoneypot("");
|
|
@@ -3720,15 +4039,15 @@ function FeedbackDialog({
|
|
|
3720
4039
|
if (!isOpen) return null;
|
|
3721
4040
|
const api = apiRef.current;
|
|
3722
4041
|
if (isSubmitted) {
|
|
3723
|
-
return
|
|
4042
|
+
return React42.createElement(
|
|
3724
4043
|
"div",
|
|
3725
4044
|
{
|
|
3726
4045
|
className: cn(feedbackDialogVariants({ type }), className),
|
|
3727
4046
|
...api.ariaProps,
|
|
3728
4047
|
"data-state": "submitted"
|
|
3729
4048
|
},
|
|
3730
|
-
|
|
3731
|
-
|
|
4049
|
+
React42.createElement("p", { "data-testid": "success-message" }, "Thank you for your feedback!"),
|
|
4050
|
+
React42.createElement(
|
|
3732
4051
|
"button",
|
|
3733
4052
|
{
|
|
3734
4053
|
type: "button",
|
|
@@ -3741,22 +4060,22 @@ function FeedbackDialog({
|
|
|
3741
4060
|
)
|
|
3742
4061
|
);
|
|
3743
4062
|
}
|
|
3744
|
-
return
|
|
4063
|
+
return React42.createElement(
|
|
3745
4064
|
"div",
|
|
3746
4065
|
{
|
|
3747
4066
|
className: cn(feedbackDialogVariants({ type }), className),
|
|
3748
4067
|
...api.ariaProps,
|
|
3749
4068
|
"data-state": "open"
|
|
3750
4069
|
},
|
|
3751
|
-
|
|
3752
|
-
|
|
4070
|
+
React42.createElement("h2", { id: `${api.ariaProps.id}-title` }, "Send Feedback"),
|
|
4071
|
+
React42.createElement("textarea", {
|
|
3753
4072
|
"aria-label": "Feedback comment",
|
|
3754
4073
|
value: comment,
|
|
3755
4074
|
onChange: (e) => setComment(e.target.value),
|
|
3756
4075
|
placeholder: "Your feedback...",
|
|
3757
4076
|
disabled: isSubmitting
|
|
3758
4077
|
}),
|
|
3759
|
-
|
|
4078
|
+
React42.createElement("input", {
|
|
3760
4079
|
type: "email",
|
|
3761
4080
|
"aria-label": "Email",
|
|
3762
4081
|
value: email,
|
|
@@ -3765,7 +4084,7 @@ function FeedbackDialog({
|
|
|
3765
4084
|
disabled: isSubmitting
|
|
3766
4085
|
}),
|
|
3767
4086
|
// Honeypot field — hidden from real users
|
|
3768
|
-
|
|
4087
|
+
React42.createElement("input", {
|
|
3769
4088
|
type: "text",
|
|
3770
4089
|
"aria-hidden": true,
|
|
3771
4090
|
tabIndex: -1,
|
|
@@ -3775,7 +4094,7 @@ function FeedbackDialog({
|
|
|
3775
4094
|
autoComplete: "off",
|
|
3776
4095
|
name: "website"
|
|
3777
4096
|
}),
|
|
3778
|
-
|
|
4097
|
+
React42.createElement(
|
|
3779
4098
|
"button",
|
|
3780
4099
|
{
|
|
3781
4100
|
type: "button",
|
|
@@ -3787,9 +4106,9 @@ function FeedbackDialog({
|
|
|
3787
4106
|
);
|
|
3788
4107
|
}
|
|
3789
4108
|
FeedbackDialog.displayName = "FeedbackDialog";
|
|
3790
|
-
var FeedbackButton =
|
|
4109
|
+
var FeedbackButton = React42.forwardRef(
|
|
3791
4110
|
({ children, ...props }, ref) => {
|
|
3792
|
-
return
|
|
4111
|
+
return React42.createElement(
|
|
3793
4112
|
"button",
|
|
3794
4113
|
{
|
|
3795
4114
|
ref,
|
|
@@ -3816,7 +4135,7 @@ function createFooter(props = {}) {
|
|
|
3816
4135
|
var footerVariants = cva({
|
|
3817
4136
|
base: "border-t bg-background py-8"
|
|
3818
4137
|
});
|
|
3819
|
-
var Footer =
|
|
4138
|
+
var Footer = React42.forwardRef(
|
|
3820
4139
|
({
|
|
3821
4140
|
copyright,
|
|
3822
4141
|
socialLinks = [],
|
|
@@ -3954,34 +4273,34 @@ function InlineEditor({
|
|
|
3954
4273
|
onCancel,
|
|
3955
4274
|
className
|
|
3956
4275
|
}) {
|
|
3957
|
-
const [isEditing, setIsEditing] =
|
|
3958
|
-
const [editValue, setEditValue] =
|
|
3959
|
-
const apiRef =
|
|
4276
|
+
const [isEditing, setIsEditing] = React42.useState(false);
|
|
4277
|
+
const [editValue, setEditValue] = React42.useState(initialValue);
|
|
4278
|
+
const apiRef = React42.useRef(null);
|
|
3960
4279
|
if (apiRef.current === null) {
|
|
3961
4280
|
apiRef.current = createInlineEditor({ value: initialValue, onSave, onCancel });
|
|
3962
4281
|
}
|
|
3963
4282
|
const api = apiRef.current;
|
|
3964
|
-
const handleStartEditing =
|
|
4283
|
+
const handleStartEditing = React42.useCallback(() => {
|
|
3965
4284
|
setIsEditing(true);
|
|
3966
4285
|
setEditValue(initialValue);
|
|
3967
4286
|
}, [initialValue]);
|
|
3968
|
-
const handleCancel =
|
|
4287
|
+
const handleCancel = React42.useCallback(() => {
|
|
3969
4288
|
setIsEditing(false);
|
|
3970
4289
|
setEditValue(initialValue);
|
|
3971
4290
|
onCancel?.();
|
|
3972
4291
|
}, [initialValue, onCancel]);
|
|
3973
|
-
const handleSave =
|
|
4292
|
+
const handleSave = React42.useCallback(() => {
|
|
3974
4293
|
setIsEditing(false);
|
|
3975
4294
|
onSave?.(editValue);
|
|
3976
4295
|
}, [editValue, onSave]);
|
|
3977
|
-
const handleInsert =
|
|
4296
|
+
const handleInsert = React42.useCallback(
|
|
3978
4297
|
(syntax) => {
|
|
3979
4298
|
setEditValue((prev) => prev + syntax);
|
|
3980
4299
|
},
|
|
3981
4300
|
[]
|
|
3982
4301
|
);
|
|
3983
4302
|
if (!isEditing) {
|
|
3984
|
-
return
|
|
4303
|
+
return React42.createElement(
|
|
3985
4304
|
"div",
|
|
3986
4305
|
{
|
|
3987
4306
|
className: cn(editorVariants({ state: "viewing" }), className),
|
|
@@ -3996,20 +4315,20 @@ function InlineEditor({
|
|
|
3996
4315
|
}
|
|
3997
4316
|
}
|
|
3998
4317
|
},
|
|
3999
|
-
|
|
4318
|
+
React42.createElement("div", { className: previewVariants() }, editValue || initialValue)
|
|
4000
4319
|
);
|
|
4001
4320
|
}
|
|
4002
|
-
return
|
|
4321
|
+
return React42.createElement(
|
|
4003
4322
|
"div",
|
|
4004
4323
|
{
|
|
4005
4324
|
className: cn(editorVariants({ state: "editing" }), className)
|
|
4006
4325
|
},
|
|
4007
4326
|
// Toolbar
|
|
4008
|
-
|
|
4327
|
+
React42.createElement(
|
|
4009
4328
|
"div",
|
|
4010
4329
|
{ className: toolbarVariants(), role: "toolbar", "aria-label": "Formatting toolbar" },
|
|
4011
4330
|
...api.toolbarActions.map(
|
|
4012
|
-
(action) =>
|
|
4331
|
+
(action) => React42.createElement(
|
|
4013
4332
|
"button",
|
|
4014
4333
|
{
|
|
4015
4334
|
key: action.name,
|
|
@@ -4023,16 +4342,16 @@ function InlineEditor({
|
|
|
4023
4342
|
)
|
|
4024
4343
|
),
|
|
4025
4344
|
// Editor area: side-by-side textarea + preview
|
|
4026
|
-
|
|
4345
|
+
React42.createElement(
|
|
4027
4346
|
"div",
|
|
4028
4347
|
{ className: "flex gap-2 p-2" },
|
|
4029
|
-
|
|
4348
|
+
React42.createElement("textarea", {
|
|
4030
4349
|
value: editValue,
|
|
4031
4350
|
onChange: (e) => setEditValue(e.target.value),
|
|
4032
4351
|
className: "flex-1 min-h-[100px] resize-y border rounded p-2",
|
|
4033
4352
|
"aria-label": "Editor content"
|
|
4034
4353
|
}),
|
|
4035
|
-
|
|
4354
|
+
React42.createElement(
|
|
4036
4355
|
"div",
|
|
4037
4356
|
{
|
|
4038
4357
|
className: cn("flex-1", previewVariants()),
|
|
@@ -4042,15 +4361,15 @@ function InlineEditor({
|
|
|
4042
4361
|
)
|
|
4043
4362
|
),
|
|
4044
4363
|
// Action buttons
|
|
4045
|
-
|
|
4364
|
+
React42.createElement(
|
|
4046
4365
|
"div",
|
|
4047
4366
|
{ className: "flex justify-end gap-2 p-2 border-t" },
|
|
4048
|
-
|
|
4367
|
+
React42.createElement(
|
|
4049
4368
|
"button",
|
|
4050
4369
|
{ type: "button", onClick: handleCancel },
|
|
4051
4370
|
"Cancel"
|
|
4052
4371
|
),
|
|
4053
|
-
|
|
4372
|
+
React42.createElement(
|
|
4054
4373
|
"button",
|
|
4055
4374
|
{ type: "button", onClick: handleSave },
|
|
4056
4375
|
"Save"
|
|
@@ -4106,7 +4425,7 @@ var inputVariants = cva({
|
|
|
4106
4425
|
size: "default"
|
|
4107
4426
|
}
|
|
4108
4427
|
});
|
|
4109
|
-
var Input =
|
|
4428
|
+
var Input = React42.forwardRef(
|
|
4110
4429
|
({ type = "text", size, className, disabled, readOnly, required, "aria-invalid": ariaInvalid, ...props }, ref) => {
|
|
4111
4430
|
const api = createInput({
|
|
4112
4431
|
disabled,
|
|
@@ -4199,7 +4518,7 @@ var inputGroupButtonVariants = cva({
|
|
|
4199
4518
|
orientation: "horizontal"
|
|
4200
4519
|
}
|
|
4201
4520
|
});
|
|
4202
|
-
var InputGroup =
|
|
4521
|
+
var InputGroup = React42.forwardRef(
|
|
4203
4522
|
({ orientation = "horizontal", className, children, ...props }, ref) => {
|
|
4204
4523
|
const api = createInputGroup({
|
|
4205
4524
|
orientation,
|
|
@@ -4221,7 +4540,7 @@ var InputGroup = React41.forwardRef(
|
|
|
4221
4540
|
}
|
|
4222
4541
|
);
|
|
4223
4542
|
InputGroup.displayName = "InputGroup";
|
|
4224
|
-
var InputGroupAddon =
|
|
4543
|
+
var InputGroupAddon = React42.forwardRef(
|
|
4225
4544
|
({ orientation = "horizontal", className, children, ...props }, ref) => {
|
|
4226
4545
|
return /* @__PURE__ */ jsx(
|
|
4227
4546
|
"div",
|
|
@@ -4235,7 +4554,7 @@ var InputGroupAddon = React41.forwardRef(
|
|
|
4235
4554
|
}
|
|
4236
4555
|
);
|
|
4237
4556
|
InputGroupAddon.displayName = "InputGroupAddon";
|
|
4238
|
-
var InputGroupText =
|
|
4557
|
+
var InputGroupText = React42.forwardRef(
|
|
4239
4558
|
({ className, children, ...props }, ref) => {
|
|
4240
4559
|
return /* @__PURE__ */ jsx(
|
|
4241
4560
|
"span",
|
|
@@ -4249,7 +4568,7 @@ var InputGroupText = React41.forwardRef(
|
|
|
4249
4568
|
}
|
|
4250
4569
|
);
|
|
4251
4570
|
InputGroupText.displayName = "InputGroupText";
|
|
4252
|
-
var InputGroupButton =
|
|
4571
|
+
var InputGroupButton = React42.forwardRef(
|
|
4253
4572
|
({ orientation = "horizontal", className, children, ...props }, ref) => {
|
|
4254
4573
|
return /* @__PURE__ */ jsx(
|
|
4255
4574
|
"button",
|
|
@@ -4315,7 +4634,7 @@ function createLocalStorage() {
|
|
|
4315
4634
|
}
|
|
4316
4635
|
};
|
|
4317
4636
|
}
|
|
4318
|
-
var InstallPrompt =
|
|
4637
|
+
var InstallPrompt = React42.forwardRef(
|
|
4319
4638
|
({
|
|
4320
4639
|
delay = 3e3,
|
|
4321
4640
|
storageKey,
|
|
@@ -4325,14 +4644,14 @@ var InstallPrompt = React41.forwardRef(
|
|
|
4325
4644
|
className,
|
|
4326
4645
|
...props
|
|
4327
4646
|
}, ref) => {
|
|
4328
|
-
const storageRef =
|
|
4647
|
+
const storageRef = React42.useRef(void 0);
|
|
4329
4648
|
if (typeof window !== "undefined" && !storageRef.current) {
|
|
4330
4649
|
storageRef.current = createLocalStorage();
|
|
4331
4650
|
}
|
|
4332
4651
|
const api = createInstallPrompt({ storageKey }, storageRef.current);
|
|
4333
|
-
const [visible, setVisible] =
|
|
4334
|
-
const promptEventRef =
|
|
4335
|
-
|
|
4652
|
+
const [visible, setVisible] = React42.useState(false);
|
|
4653
|
+
const promptEventRef = React42.useRef(null);
|
|
4654
|
+
React42.useEffect(() => {
|
|
4336
4655
|
if (api.state.isDismissed) return;
|
|
4337
4656
|
const handleBeforeInstall = (e) => {
|
|
4338
4657
|
e.preventDefault();
|
|
@@ -4573,7 +4892,7 @@ function sanitizeHtml(html) {
|
|
|
4573
4892
|
sanitized = sanitized.replace(/(href|src)\s*=\s*["']?\s*javascript\s*:[^"'>]*/gi, '$1=""');
|
|
4574
4893
|
return sanitized;
|
|
4575
4894
|
}
|
|
4576
|
-
var MarkdownRenderer =
|
|
4895
|
+
var MarkdownRenderer = React42.forwardRef(
|
|
4577
4896
|
({ content, components, linkResolver, className, size }, ref) => {
|
|
4578
4897
|
const coreProps = { content, components, linkResolver };
|
|
4579
4898
|
const api = createMarkdownRenderer(coreProps);
|
|
@@ -4662,20 +4981,20 @@ var mobileNavLinkVariants = cva({
|
|
|
4662
4981
|
base: "block w-full px-4 py-2 text-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2",
|
|
4663
4982
|
variants: {}
|
|
4664
4983
|
});
|
|
4665
|
-
var MobileNavContext =
|
|
4984
|
+
var MobileNavContext = React42.createContext(null);
|
|
4666
4985
|
function useMobileNavContext() {
|
|
4667
|
-
const ctx =
|
|
4986
|
+
const ctx = React42.useContext(MobileNavContext);
|
|
4668
4987
|
if (!ctx) {
|
|
4669
4988
|
throw new Error("MobileNav compound components must be used within <MobileNav>");
|
|
4670
4989
|
}
|
|
4671
4990
|
return ctx;
|
|
4672
4991
|
}
|
|
4673
|
-
var MobileNav =
|
|
4992
|
+
var MobileNav = React42.forwardRef(
|
|
4674
4993
|
({ open: controlledOpen, onOpenChange, defaultOpen = false, className, children, ...props }, ref) => {
|
|
4675
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
4994
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React42.useState(defaultOpen);
|
|
4676
4995
|
const isControlled = controlledOpen !== void 0;
|
|
4677
4996
|
const open = isControlled ? controlledOpen : uncontrolledOpen;
|
|
4678
|
-
const setOpen =
|
|
4997
|
+
const setOpen = React42.useCallback(
|
|
4679
4998
|
(value) => {
|
|
4680
4999
|
if (!isControlled) {
|
|
4681
5000
|
setUncontrolledOpen(value);
|
|
@@ -4685,11 +5004,11 @@ var MobileNav = React41.forwardRef(
|
|
|
4685
5004
|
[isControlled, onOpenChange]
|
|
4686
5005
|
);
|
|
4687
5006
|
const api = createMobileNav({ open, onOpenChange: setOpen, id: props.id });
|
|
4688
|
-
const handleKeyDown =
|
|
5007
|
+
const handleKeyDown = React42.useMemo(
|
|
4689
5008
|
() => createKeyboardHandler(api.keyboardHandlers),
|
|
4690
5009
|
[open]
|
|
4691
5010
|
);
|
|
4692
|
-
const contextValue =
|
|
5011
|
+
const contextValue = React42.useMemo(
|
|
4693
5012
|
() => ({ open, setOpen, contentId: api.contentProps.id }),
|
|
4694
5013
|
[open, setOpen, api.contentProps.id]
|
|
4695
5014
|
);
|
|
@@ -4706,7 +5025,7 @@ var MobileNav = React41.forwardRef(
|
|
|
4706
5025
|
}
|
|
4707
5026
|
);
|
|
4708
5027
|
MobileNav.displayName = "MobileNav";
|
|
4709
|
-
var MobileNavTrigger =
|
|
5028
|
+
var MobileNavTrigger = React42.forwardRef(
|
|
4710
5029
|
({ className, children, ...props }, ref) => {
|
|
4711
5030
|
const { open, setOpen, contentId } = useMobileNavContext();
|
|
4712
5031
|
return /* @__PURE__ */ jsx(
|
|
@@ -4747,7 +5066,7 @@ var MobileNavTrigger = React41.forwardRef(
|
|
|
4747
5066
|
}
|
|
4748
5067
|
);
|
|
4749
5068
|
MobileNavTrigger.displayName = "MobileNavTrigger";
|
|
4750
|
-
var MobileNavContent =
|
|
5069
|
+
var MobileNavContent = React42.forwardRef(
|
|
4751
5070
|
({ className, children, ...props }, ref) => {
|
|
4752
5071
|
const { open, contentId } = useMobileNavContext();
|
|
4753
5072
|
const state = open ? "open" : "closed";
|
|
@@ -4766,7 +5085,7 @@ var MobileNavContent = React41.forwardRef(
|
|
|
4766
5085
|
}
|
|
4767
5086
|
);
|
|
4768
5087
|
MobileNavContent.displayName = "MobileNavContent";
|
|
4769
|
-
var MobileNavLink =
|
|
5088
|
+
var MobileNavLink = React42.forwardRef(
|
|
4770
5089
|
({ className, children, ...props }, ref) => {
|
|
4771
5090
|
return /* @__PURE__ */ jsx(
|
|
4772
5091
|
"a",
|
|
@@ -4825,7 +5144,7 @@ var navLinkVariants = cva({
|
|
|
4825
5144
|
active: "false"
|
|
4826
5145
|
}
|
|
4827
5146
|
});
|
|
4828
|
-
var Navbar =
|
|
5147
|
+
var Navbar = React42.forwardRef(
|
|
4829
5148
|
({
|
|
4830
5149
|
links = [],
|
|
4831
5150
|
currentPath,
|
|
@@ -4920,19 +5239,19 @@ var popoverContentVariants = cva({
|
|
|
4920
5239
|
side: "bottom"
|
|
4921
5240
|
}
|
|
4922
5241
|
});
|
|
4923
|
-
var PopoverContext =
|
|
5242
|
+
var PopoverContext = React42.createContext(null);
|
|
4924
5243
|
function usePopoverContext() {
|
|
4925
|
-
const ctx =
|
|
5244
|
+
const ctx = React42.useContext(PopoverContext);
|
|
4926
5245
|
if (!ctx) {
|
|
4927
5246
|
throw new Error("Popover compound components must be used within <Popover>");
|
|
4928
5247
|
}
|
|
4929
5248
|
return ctx;
|
|
4930
5249
|
}
|
|
4931
5250
|
function Popover({ open: controlledOpen, defaultOpen = false, onOpenChange, placement, children }) {
|
|
4932
|
-
const [internalOpen, setInternalOpen] =
|
|
5251
|
+
const [internalOpen, setInternalOpen] = React42.useState(controlledOpen ?? defaultOpen);
|
|
4933
5252
|
const isControlled = controlledOpen !== void 0;
|
|
4934
5253
|
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
4935
|
-
const handleOpenChange =
|
|
5254
|
+
const handleOpenChange = React42.useCallback(
|
|
4936
5255
|
(value) => {
|
|
4937
5256
|
if (!isControlled) {
|
|
4938
5257
|
setInternalOpen(value);
|
|
@@ -4941,18 +5260,18 @@ function Popover({ open: controlledOpen, defaultOpen = false, onOpenChange, plac
|
|
|
4941
5260
|
},
|
|
4942
5261
|
[isControlled, onOpenChange]
|
|
4943
5262
|
);
|
|
4944
|
-
const api =
|
|
5263
|
+
const api = React42.useMemo(
|
|
4945
5264
|
() => createPopover({ open: isOpen, onOpenChange: handleOpenChange, placement }),
|
|
4946
5265
|
[isOpen, handleOpenChange, placement]
|
|
4947
5266
|
);
|
|
4948
|
-
const ctx =
|
|
5267
|
+
const ctx = React42.useMemo(
|
|
4949
5268
|
() => ({ api, open: isOpen, setOpen: handleOpenChange }),
|
|
4950
5269
|
[api, isOpen, handleOpenChange]
|
|
4951
5270
|
);
|
|
4952
|
-
return
|
|
5271
|
+
return React42.createElement(PopoverContext.Provider, { value: ctx }, children);
|
|
4953
5272
|
}
|
|
4954
5273
|
Popover.displayName = "Popover";
|
|
4955
|
-
var PopoverTrigger =
|
|
5274
|
+
var PopoverTrigger = React42.forwardRef(
|
|
4956
5275
|
({ onClick, children, ...props }, ref) => {
|
|
4957
5276
|
const { api, setOpen, open } = usePopoverContext();
|
|
4958
5277
|
const handleClick = (e) => {
|
|
@@ -4975,7 +5294,7 @@ var PopoverTrigger = React41.forwardRef(
|
|
|
4975
5294
|
}
|
|
4976
5295
|
);
|
|
4977
5296
|
PopoverTrigger.displayName = "PopoverTrigger";
|
|
4978
|
-
var PopoverContent =
|
|
5297
|
+
var PopoverContent = React42.forwardRef(
|
|
4979
5298
|
({ side, className, children, onKeyDown, ...props }, ref) => {
|
|
4980
5299
|
const { api, open, setOpen } = usePopoverContext();
|
|
4981
5300
|
const handleKeyDown = (e) => {
|
|
@@ -5004,7 +5323,7 @@ var PopoverContent = React41.forwardRef(
|
|
|
5004
5323
|
}
|
|
5005
5324
|
);
|
|
5006
5325
|
PopoverContent.displayName = "PopoverContent";
|
|
5007
|
-
var PopoverClose =
|
|
5326
|
+
var PopoverClose = React42.forwardRef(
|
|
5008
5327
|
({ onClick, children, ...props }, ref) => {
|
|
5009
5328
|
const { setOpen } = usePopoverContext();
|
|
5010
5329
|
const handleClick = (e) => {
|
|
@@ -5125,9 +5444,9 @@ var searchResultVariants = cva({
|
|
|
5125
5444
|
});
|
|
5126
5445
|
|
|
5127
5446
|
// ../react-search-bar/dist/index.js
|
|
5128
|
-
var SearchBarContext =
|
|
5447
|
+
var SearchBarContext = React42.createContext(null);
|
|
5129
5448
|
function useSearchBarContext() {
|
|
5130
|
-
const ctx =
|
|
5449
|
+
const ctx = React42.useContext(SearchBarContext);
|
|
5131
5450
|
if (!ctx) {
|
|
5132
5451
|
throw new Error("SearchBar compound components must be used within <SearchBar>");
|
|
5133
5452
|
}
|
|
@@ -5145,11 +5464,11 @@ function SearchBar({
|
|
|
5145
5464
|
children,
|
|
5146
5465
|
...inputProps
|
|
5147
5466
|
}) {
|
|
5148
|
-
const [internalValue, setInternalValue] =
|
|
5467
|
+
const [internalValue, setInternalValue] = React42.useState(controlledValue ?? defaultValue);
|
|
5149
5468
|
const isControlled = controlledValue !== void 0;
|
|
5150
5469
|
const currentValue = isControlled ? controlledValue : internalValue;
|
|
5151
|
-
const debounceRef =
|
|
5152
|
-
const handleValueChange =
|
|
5470
|
+
const debounceRef = React42.useRef(void 0);
|
|
5471
|
+
const handleValueChange = React42.useCallback(
|
|
5153
5472
|
(val) => {
|
|
5154
5473
|
if (!isControlled) {
|
|
5155
5474
|
setInternalValue(val);
|
|
@@ -5158,8 +5477,8 @@ function SearchBar({
|
|
|
5158
5477
|
},
|
|
5159
5478
|
[isControlled, onValueChange]
|
|
5160
5479
|
);
|
|
5161
|
-
const [isSearching, setIsSearching] =
|
|
5162
|
-
const handleSearch =
|
|
5480
|
+
const [isSearching, setIsSearching] = React42.useState(loading);
|
|
5481
|
+
const handleSearch = React42.useCallback(
|
|
5163
5482
|
(val) => {
|
|
5164
5483
|
if (debounceRef.current !== void 0) {
|
|
5165
5484
|
clearTimeout(debounceRef.current);
|
|
@@ -5176,7 +5495,7 @@ function SearchBar({
|
|
|
5176
5495
|
},
|
|
5177
5496
|
[onSearch, debounceMs]
|
|
5178
5497
|
);
|
|
5179
|
-
const handleChange =
|
|
5498
|
+
const handleChange = React42.useCallback(
|
|
5180
5499
|
(e) => {
|
|
5181
5500
|
const val = e.target.value;
|
|
5182
5501
|
handleValueChange(val);
|
|
@@ -5184,14 +5503,14 @@ function SearchBar({
|
|
|
5184
5503
|
},
|
|
5185
5504
|
[handleValueChange, handleSearch]
|
|
5186
5505
|
);
|
|
5187
|
-
const clear =
|
|
5506
|
+
const clear = React42.useCallback(() => {
|
|
5188
5507
|
if (debounceRef.current !== void 0) {
|
|
5189
5508
|
clearTimeout(debounceRef.current);
|
|
5190
5509
|
}
|
|
5191
5510
|
handleValueChange("");
|
|
5192
5511
|
setIsSearching(false);
|
|
5193
5512
|
}, [handleValueChange]);
|
|
5194
|
-
const api =
|
|
5513
|
+
const api = React42.useMemo(
|
|
5195
5514
|
() => createSearchBar({
|
|
5196
5515
|
value: currentValue,
|
|
5197
5516
|
onValueChange: handleValueChange,
|
|
@@ -5202,7 +5521,7 @@ function SearchBar({
|
|
|
5202
5521
|
}),
|
|
5203
5522
|
[currentValue, handleValueChange, onSearch, debounceMs, placeholder, loading]
|
|
5204
5523
|
);
|
|
5205
|
-
const handleKeyDown =
|
|
5524
|
+
const handleKeyDown = React42.useCallback(
|
|
5206
5525
|
(e) => {
|
|
5207
5526
|
if (e.key === "Escape") {
|
|
5208
5527
|
clear();
|
|
@@ -5216,18 +5535,18 @@ function SearchBar({
|
|
|
5216
5535
|
},
|
|
5217
5536
|
[clear, onSearch, currentValue]
|
|
5218
5537
|
);
|
|
5219
|
-
const ctx =
|
|
5538
|
+
const ctx = React42.useMemo(
|
|
5220
5539
|
() => ({ api, value: currentValue, isSearching, setValue: handleValueChange, clear }),
|
|
5221
5540
|
[api, currentValue, isSearching, handleValueChange, clear]
|
|
5222
5541
|
);
|
|
5223
|
-
return
|
|
5542
|
+
return React42.createElement(
|
|
5224
5543
|
SearchBarContext.Provider,
|
|
5225
5544
|
{ value: ctx },
|
|
5226
|
-
|
|
5545
|
+
React42.createElement(
|
|
5227
5546
|
"div",
|
|
5228
5547
|
{ className: cn(searchBarVariants(), className) },
|
|
5229
|
-
|
|
5230
|
-
|
|
5548
|
+
React42.createElement("span", { className: "rfr-search-icon", "aria-hidden": "true" }, "\u{1F50D}"),
|
|
5549
|
+
React42.createElement("input", {
|
|
5231
5550
|
...inputProps,
|
|
5232
5551
|
role: api.inputProps.role,
|
|
5233
5552
|
"aria-expanded": api.inputProps["aria-expanded"],
|
|
@@ -5239,8 +5558,8 @@ function SearchBar({
|
|
|
5239
5558
|
onKeyDown: handleKeyDown,
|
|
5240
5559
|
className: "rfr-search-input flex-1 bg-transparent outline-none"
|
|
5241
5560
|
}),
|
|
5242
|
-
isSearching &&
|
|
5243
|
-
currentValue.length > 0 && !isSearching &&
|
|
5561
|
+
isSearching && React42.createElement("span", { className: "rfr-search-spinner", "aria-label": "Loading" }, "\u23F3"),
|
|
5562
|
+
currentValue.length > 0 && !isSearching && React42.createElement(
|
|
5244
5563
|
"button",
|
|
5245
5564
|
{
|
|
5246
5565
|
type: "button",
|
|
@@ -5255,11 +5574,11 @@ function SearchBar({
|
|
|
5255
5574
|
);
|
|
5256
5575
|
}
|
|
5257
5576
|
SearchBar.displayName = "SearchBar";
|
|
5258
|
-
var SearchResults =
|
|
5577
|
+
var SearchResults = React42.forwardRef(
|
|
5259
5578
|
({ className, children, ...props }, ref) => {
|
|
5260
5579
|
const { api, value } = useSearchBarContext();
|
|
5261
5580
|
if (value.length === 0) return null;
|
|
5262
|
-
return
|
|
5581
|
+
return React42.createElement(
|
|
5263
5582
|
"ul",
|
|
5264
5583
|
{
|
|
5265
5584
|
ref,
|
|
@@ -5273,9 +5592,9 @@ var SearchResults = React41.forwardRef(
|
|
|
5273
5592
|
}
|
|
5274
5593
|
);
|
|
5275
5594
|
SearchResults.displayName = "SearchResults";
|
|
5276
|
-
var SearchResultItem =
|
|
5595
|
+
var SearchResultItem = React42.forwardRef(
|
|
5277
5596
|
({ className, children, ...props }, ref) => {
|
|
5278
|
-
return
|
|
5597
|
+
return React42.createElement(
|
|
5279
5598
|
"li",
|
|
5280
5599
|
{
|
|
5281
5600
|
ref,
|
|
@@ -5336,7 +5655,7 @@ var sidebarItemVariants = cva({
|
|
|
5336
5655
|
active: "false"
|
|
5337
5656
|
}
|
|
5338
5657
|
});
|
|
5339
|
-
var Sidebar =
|
|
5658
|
+
var Sidebar = React42.forwardRef(
|
|
5340
5659
|
({
|
|
5341
5660
|
sections = [],
|
|
5342
5661
|
currentPath,
|
|
@@ -5406,7 +5725,7 @@ var skeletonVariants = cva({
|
|
|
5406
5725
|
});
|
|
5407
5726
|
|
|
5408
5727
|
// ../react-skeleton/dist/index.js
|
|
5409
|
-
var Skeleton =
|
|
5728
|
+
var Skeleton = React42.forwardRef(
|
|
5410
5729
|
({ shape, width, height, animate, className, style, ...props }, ref) => {
|
|
5411
5730
|
const api = createSkeleton({ shape, animate });
|
|
5412
5731
|
const classes = cn(skeletonVariants({ shape }), className);
|
|
@@ -5415,7 +5734,7 @@ var Skeleton = React41.forwardRef(
|
|
|
5415
5734
|
...width !== void 0 ? { width } : {},
|
|
5416
5735
|
...height !== void 0 ? { height } : {}
|
|
5417
5736
|
};
|
|
5418
|
-
return
|
|
5737
|
+
return React42.createElement("div", {
|
|
5419
5738
|
ref,
|
|
5420
5739
|
className: classes,
|
|
5421
5740
|
style: Object.keys(mergedStyle).length > 0 ? mergedStyle : void 0,
|
|
@@ -5427,13 +5746,13 @@ var Skeleton = React41.forwardRef(
|
|
|
5427
5746
|
);
|
|
5428
5747
|
Skeleton.displayName = "Skeleton";
|
|
5429
5748
|
var lineWidths = ["100%", "92%", "85%", "96%", "78%", "88%", "94%", "82%"];
|
|
5430
|
-
var SkeletonText =
|
|
5749
|
+
var SkeletonText = React42.forwardRef(
|
|
5431
5750
|
({ lines = 3, animate, className, ...props }, ref) => {
|
|
5432
5751
|
const children = [];
|
|
5433
5752
|
for (let i = 0; i < lines; i++) {
|
|
5434
5753
|
const width = lineWidths[i % lineWidths.length];
|
|
5435
5754
|
children.push(
|
|
5436
|
-
|
|
5755
|
+
React42.createElement(Skeleton, {
|
|
5437
5756
|
key: i,
|
|
5438
5757
|
shape: "text",
|
|
5439
5758
|
width,
|
|
@@ -5441,7 +5760,7 @@ var SkeletonText = React41.forwardRef(
|
|
|
5441
5760
|
})
|
|
5442
5761
|
);
|
|
5443
5762
|
}
|
|
5444
|
-
return
|
|
5763
|
+
return React42.createElement(
|
|
5445
5764
|
"div",
|
|
5446
5765
|
{
|
|
5447
5766
|
ref,
|
|
@@ -5549,9 +5868,9 @@ var tabsTriggerVariants = cva({
|
|
|
5549
5868
|
});
|
|
5550
5869
|
|
|
5551
5870
|
// ../react-tabs/dist/index.js
|
|
5552
|
-
var TabsContext =
|
|
5871
|
+
var TabsContext = React42.createContext(null);
|
|
5553
5872
|
function useTabsContext() {
|
|
5554
|
-
const ctx =
|
|
5873
|
+
const ctx = React42.useContext(TabsContext);
|
|
5555
5874
|
if (!ctx) {
|
|
5556
5875
|
throw new Error("Tabs compound components must be used within <Tabs>");
|
|
5557
5876
|
}
|
|
@@ -5565,10 +5884,10 @@ function Tabs({
|
|
|
5565
5884
|
className,
|
|
5566
5885
|
children
|
|
5567
5886
|
}) {
|
|
5568
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
5887
|
+
const [uncontrolledValue, setUncontrolledValue] = React42.useState(defaultValue);
|
|
5569
5888
|
const isControlled = controlledValue !== void 0;
|
|
5570
5889
|
const value = isControlled ? controlledValue : uncontrolledValue;
|
|
5571
|
-
const handleValueChange =
|
|
5890
|
+
const handleValueChange = React42.useCallback(
|
|
5572
5891
|
(next) => {
|
|
5573
5892
|
if (!isControlled) {
|
|
5574
5893
|
setUncontrolledValue(next);
|
|
@@ -5577,12 +5896,12 @@ function Tabs({
|
|
|
5577
5896
|
},
|
|
5578
5897
|
[isControlled, onValueChange]
|
|
5579
5898
|
);
|
|
5580
|
-
const apiRef =
|
|
5899
|
+
const apiRef = React42.useRef(null);
|
|
5581
5900
|
if (apiRef.current === null) {
|
|
5582
5901
|
apiRef.current = createTabs({ value, orientation });
|
|
5583
5902
|
}
|
|
5584
5903
|
const api = apiRef.current;
|
|
5585
|
-
const ctx =
|
|
5904
|
+
const ctx = React42.useMemo(
|
|
5586
5905
|
() => ({
|
|
5587
5906
|
value,
|
|
5588
5907
|
onValueChange: handleValueChange,
|
|
@@ -5591,17 +5910,17 @@ function Tabs({
|
|
|
5591
5910
|
}),
|
|
5592
5911
|
[value, handleValueChange, orientation, api.idPrefix]
|
|
5593
5912
|
);
|
|
5594
|
-
return
|
|
5913
|
+
return React42.createElement(
|
|
5595
5914
|
"div",
|
|
5596
5915
|
{ className, "data-orientation": orientation },
|
|
5597
|
-
|
|
5916
|
+
React42.createElement(TabsContext.Provider, { value: ctx }, children)
|
|
5598
5917
|
);
|
|
5599
5918
|
}
|
|
5600
5919
|
Tabs.displayName = "Tabs";
|
|
5601
|
-
var TabsList =
|
|
5920
|
+
var TabsList = React42.forwardRef(
|
|
5602
5921
|
({ className, ...props }, ref) => {
|
|
5603
5922
|
const { orientation } = useTabsContext();
|
|
5604
|
-
return
|
|
5923
|
+
return React42.createElement("div", {
|
|
5605
5924
|
ref,
|
|
5606
5925
|
role: "tablist",
|
|
5607
5926
|
"aria-orientation": orientation,
|
|
@@ -5611,7 +5930,7 @@ var TabsList = React41.forwardRef(
|
|
|
5611
5930
|
}
|
|
5612
5931
|
);
|
|
5613
5932
|
TabsList.displayName = "TabsList";
|
|
5614
|
-
var TabsTrigger =
|
|
5933
|
+
var TabsTrigger = React42.forwardRef(
|
|
5615
5934
|
({ value, className, onClick, onKeyDown, children, ...props }, ref) => {
|
|
5616
5935
|
const { value: activeValue, onValueChange, orientation, idPrefix } = useTabsContext();
|
|
5617
5936
|
const isSelected = activeValue === value;
|
|
@@ -5624,7 +5943,7 @@ var TabsTrigger = React41.forwardRef(
|
|
|
5624
5943
|
const handleKeyDown = (e) => {
|
|
5625
5944
|
onKeyDown?.(e);
|
|
5626
5945
|
};
|
|
5627
|
-
return
|
|
5946
|
+
return React42.createElement(
|
|
5628
5947
|
"button",
|
|
5629
5948
|
{
|
|
5630
5949
|
ref,
|
|
@@ -5645,14 +5964,14 @@ var TabsTrigger = React41.forwardRef(
|
|
|
5645
5964
|
}
|
|
5646
5965
|
);
|
|
5647
5966
|
TabsTrigger.displayName = "TabsTrigger";
|
|
5648
|
-
var TabsContent =
|
|
5967
|
+
var TabsContent = React42.forwardRef(
|
|
5649
5968
|
({ value, className, children, ...props }, ref) => {
|
|
5650
5969
|
const { value: activeValue, idPrefix } = useTabsContext();
|
|
5651
5970
|
const isSelected = activeValue === value;
|
|
5652
5971
|
const tabId = `${idPrefix}-tab-${value}`;
|
|
5653
5972
|
const panelId = `${idPrefix}-panel-${value}`;
|
|
5654
5973
|
if (!isSelected) return null;
|
|
5655
|
-
return
|
|
5974
|
+
return React42.createElement(
|
|
5656
5975
|
"div",
|
|
5657
5976
|
{
|
|
5658
5977
|
ref,
|
|
@@ -5716,7 +6035,7 @@ var textareaVariants = cva({
|
|
|
5716
6035
|
size: "default"
|
|
5717
6036
|
}
|
|
5718
6037
|
});
|
|
5719
|
-
var Textarea =
|
|
6038
|
+
var Textarea = React42.forwardRef(
|
|
5720
6039
|
({ size, className, disabled, readOnly, required, rows, maxRows, "aria-invalid": ariaInvalid, ...props }, ref) => {
|
|
5721
6040
|
const api = createTextarea({
|
|
5722
6041
|
disabled,
|
|
@@ -5873,30 +6192,30 @@ var toastVariants = cva({
|
|
|
5873
6192
|
});
|
|
5874
6193
|
|
|
5875
6194
|
// ../react-toast/dist/index.js
|
|
5876
|
-
var ToastContext =
|
|
6195
|
+
var ToastContext = React42.createContext(null);
|
|
5877
6196
|
function useToastContext() {
|
|
5878
|
-
const ctx =
|
|
6197
|
+
const ctx = React42.useContext(ToastContext);
|
|
5879
6198
|
if (!ctx) {
|
|
5880
6199
|
throw new Error("useToast must be used within a <ToastProvider>");
|
|
5881
6200
|
}
|
|
5882
6201
|
return ctx;
|
|
5883
6202
|
}
|
|
5884
6203
|
function ToastProvider({ children }) {
|
|
5885
|
-
const managerRef =
|
|
6204
|
+
const managerRef = React42.useRef(null);
|
|
5886
6205
|
if (managerRef.current === null) {
|
|
5887
6206
|
managerRef.current = createToastManager();
|
|
5888
6207
|
}
|
|
5889
|
-
const ctx =
|
|
6208
|
+
const ctx = React42.useMemo(
|
|
5890
6209
|
() => ({ manager: managerRef.current }),
|
|
5891
6210
|
[]
|
|
5892
6211
|
);
|
|
5893
|
-
return
|
|
6212
|
+
return React42.createElement(ToastContext.Provider, { value: ctx }, children);
|
|
5894
6213
|
}
|
|
5895
6214
|
ToastProvider.displayName = "ToastProvider";
|
|
5896
6215
|
function useToast() {
|
|
5897
6216
|
const { manager } = useToastContext();
|
|
5898
|
-
const [toasts, setToasts] =
|
|
5899
|
-
|
|
6217
|
+
const [toasts, setToasts] = React42.useState(manager.toasts);
|
|
6218
|
+
React42.useEffect(() => {
|
|
5900
6219
|
setToasts(manager.toasts);
|
|
5901
6220
|
const unsub = manager.subscribe(setToasts);
|
|
5902
6221
|
return unsub;
|
|
@@ -5907,13 +6226,13 @@ function useToast() {
|
|
|
5907
6226
|
toasts
|
|
5908
6227
|
};
|
|
5909
6228
|
}
|
|
5910
|
-
var Toast =
|
|
6229
|
+
var Toast = React42.forwardRef(
|
|
5911
6230
|
({ entry, onDismiss, className, children, onMouseEnter, onMouseLeave, ...props }, ref) => {
|
|
5912
|
-
const api =
|
|
6231
|
+
const api = React42.useMemo(
|
|
5913
6232
|
() => createToast({ variant: entry.variant, duration: entry.duration }),
|
|
5914
6233
|
[entry.variant, entry.duration]
|
|
5915
6234
|
);
|
|
5916
|
-
|
|
6235
|
+
React42.useEffect(() => {
|
|
5917
6236
|
api.startTimer();
|
|
5918
6237
|
return () => api.pauseTimer();
|
|
5919
6238
|
}, [api]);
|
|
@@ -5925,7 +6244,7 @@ var Toast = React41.forwardRef(
|
|
|
5925
6244
|
api.resumeTimer();
|
|
5926
6245
|
onMouseLeave?.(e);
|
|
5927
6246
|
};
|
|
5928
|
-
return
|
|
6247
|
+
return React42.createElement(
|
|
5929
6248
|
"div",
|
|
5930
6249
|
{
|
|
5931
6250
|
ref,
|
|
@@ -5935,9 +6254,9 @@ var Toast = React41.forwardRef(
|
|
|
5935
6254
|
onMouseLeave: handleMouseLeave,
|
|
5936
6255
|
...props
|
|
5937
6256
|
},
|
|
5938
|
-
|
|
6257
|
+
React42.createElement("div", { className: "flex-1" }, entry.message),
|
|
5939
6258
|
children,
|
|
5940
|
-
onDismiss &&
|
|
6259
|
+
onDismiss && React42.createElement(
|
|
5941
6260
|
"button",
|
|
5942
6261
|
{
|
|
5943
6262
|
type: "button",
|
|
@@ -5951,10 +6270,10 @@ var Toast = React41.forwardRef(
|
|
|
5951
6270
|
}
|
|
5952
6271
|
);
|
|
5953
6272
|
Toast.displayName = "Toast";
|
|
5954
|
-
var Toaster =
|
|
6273
|
+
var Toaster = React42.forwardRef(
|
|
5955
6274
|
({ className, ...props }, ref) => {
|
|
5956
6275
|
const { toasts, dismiss } = useToast();
|
|
5957
|
-
return
|
|
6276
|
+
return React42.createElement(
|
|
5958
6277
|
"div",
|
|
5959
6278
|
{
|
|
5960
6279
|
ref,
|
|
@@ -5965,7 +6284,7 @@ var Toaster = React41.forwardRef(
|
|
|
5965
6284
|
...props
|
|
5966
6285
|
},
|
|
5967
6286
|
toasts.map(
|
|
5968
|
-
(entry) =>
|
|
6287
|
+
(entry) => React42.createElement(Toast, {
|
|
5969
6288
|
key: entry.id,
|
|
5970
6289
|
entry,
|
|
5971
6290
|
onDismiss: dismiss
|
|
@@ -6052,9 +6371,9 @@ var tooltipContentVariants = cva({
|
|
|
6052
6371
|
side: "top"
|
|
6053
6372
|
}
|
|
6054
6373
|
});
|
|
6055
|
-
var TooltipContext =
|
|
6374
|
+
var TooltipContext = React42.createContext(null);
|
|
6056
6375
|
function useTooltipContext() {
|
|
6057
|
-
const ctx =
|
|
6376
|
+
const ctx = React42.useContext(TooltipContext);
|
|
6058
6377
|
if (!ctx) {
|
|
6059
6378
|
throw new Error("Tooltip compound components must be used within <Tooltip>");
|
|
6060
6379
|
}
|
|
@@ -6068,11 +6387,11 @@ function Tooltip({
|
|
|
6068
6387
|
delayDuration = 300,
|
|
6069
6388
|
children
|
|
6070
6389
|
}) {
|
|
6071
|
-
const [internalOpen, setInternalOpen] =
|
|
6390
|
+
const [internalOpen, setInternalOpen] = React42.useState(controlledOpen ?? defaultOpen);
|
|
6072
6391
|
const isControlled = controlledOpen !== void 0;
|
|
6073
6392
|
const isOpen = isControlled ? controlledOpen : internalOpen;
|
|
6074
|
-
const timerRef =
|
|
6075
|
-
const handleOpenChange =
|
|
6393
|
+
const timerRef = React42.useRef(null);
|
|
6394
|
+
const handleOpenChange = React42.useCallback(
|
|
6076
6395
|
(value) => {
|
|
6077
6396
|
if (!isControlled) {
|
|
6078
6397
|
setInternalOpen(value);
|
|
@@ -6081,17 +6400,17 @@ function Tooltip({
|
|
|
6081
6400
|
},
|
|
6082
6401
|
[isControlled, onOpenChange]
|
|
6083
6402
|
);
|
|
6084
|
-
const api =
|
|
6403
|
+
const api = React42.useMemo(
|
|
6085
6404
|
() => createTooltip({ open: isOpen, onOpenChange: handleOpenChange, placement, delayDuration }),
|
|
6086
6405
|
[isOpen, handleOpenChange, placement, delayDuration]
|
|
6087
6406
|
);
|
|
6088
|
-
const cancelDelay =
|
|
6407
|
+
const cancelDelay = React42.useCallback(() => {
|
|
6089
6408
|
if (timerRef.current !== null) {
|
|
6090
6409
|
clearTimeout(timerRef.current);
|
|
6091
6410
|
timerRef.current = null;
|
|
6092
6411
|
}
|
|
6093
6412
|
}, []);
|
|
6094
|
-
const openWithDelay =
|
|
6413
|
+
const openWithDelay = React42.useCallback(() => {
|
|
6095
6414
|
cancelDelay();
|
|
6096
6415
|
if (delayDuration <= 0) {
|
|
6097
6416
|
handleOpenChange(true);
|
|
@@ -6102,21 +6421,21 @@ function Tooltip({
|
|
|
6102
6421
|
timerRef.current = null;
|
|
6103
6422
|
}, delayDuration);
|
|
6104
6423
|
}, [cancelDelay, delayDuration, handleOpenChange]);
|
|
6105
|
-
|
|
6424
|
+
React42.useEffect(() => {
|
|
6106
6425
|
return () => {
|
|
6107
6426
|
if (timerRef.current !== null) {
|
|
6108
6427
|
clearTimeout(timerRef.current);
|
|
6109
6428
|
}
|
|
6110
6429
|
};
|
|
6111
6430
|
}, []);
|
|
6112
|
-
const ctx =
|
|
6431
|
+
const ctx = React42.useMemo(
|
|
6113
6432
|
() => ({ api, open: isOpen, setOpen: handleOpenChange, openWithDelay, cancelDelay }),
|
|
6114
6433
|
[api, isOpen, handleOpenChange, openWithDelay, cancelDelay]
|
|
6115
6434
|
);
|
|
6116
|
-
return
|
|
6435
|
+
return React42.createElement(TooltipContext.Provider, { value: ctx }, children);
|
|
6117
6436
|
}
|
|
6118
6437
|
Tooltip.displayName = "Tooltip";
|
|
6119
|
-
var TooltipTrigger =
|
|
6438
|
+
var TooltipTrigger = React42.forwardRef(
|
|
6120
6439
|
({ onMouseEnter, onMouseLeave, onFocus, onBlur, children, ...props }, ref) => {
|
|
6121
6440
|
const { api, setOpen, openWithDelay, cancelDelay } = useTooltipContext();
|
|
6122
6441
|
const handleMouseEnter = (e) => {
|
|
@@ -6153,7 +6472,7 @@ var TooltipTrigger = React41.forwardRef(
|
|
|
6153
6472
|
}
|
|
6154
6473
|
);
|
|
6155
6474
|
TooltipTrigger.displayName = "TooltipTrigger";
|
|
6156
|
-
var TooltipContent =
|
|
6475
|
+
var TooltipContent = React42.forwardRef(
|
|
6157
6476
|
({ side, className, children, ...props }, ref) => {
|
|
6158
6477
|
const { api, open } = useTooltipContext();
|
|
6159
6478
|
if (!open) return null;
|
|
@@ -6273,7 +6592,7 @@ var overlayVariants = cva({
|
|
|
6273
6592
|
visibility: "visible"
|
|
6274
6593
|
}
|
|
6275
6594
|
});
|
|
6276
|
-
var VideoPlayer =
|
|
6595
|
+
var VideoPlayer = React42.forwardRef(
|
|
6277
6596
|
({
|
|
6278
6597
|
src,
|
|
6279
6598
|
poster,
|
|
@@ -6283,9 +6602,9 @@ var VideoPlayer = React41.forwardRef(
|
|
|
6283
6602
|
className,
|
|
6284
6603
|
...props
|
|
6285
6604
|
}, ref) => {
|
|
6286
|
-
const [, setTick] =
|
|
6287
|
-
const rerender =
|
|
6288
|
-
const apiRef =
|
|
6605
|
+
const [, setTick] = React42.useState(0);
|
|
6606
|
+
const rerender = React42.useCallback(() => setTick((t) => t + 1), []);
|
|
6607
|
+
const apiRef = React42.useRef(
|
|
6289
6608
|
createVideoPlayer({ muted: initialMuted})
|
|
6290
6609
|
);
|
|
6291
6610
|
const api = apiRef.current;
|
|
@@ -6452,7 +6771,7 @@ var progressBarVariants = cva({
|
|
|
6452
6771
|
size: "md"
|
|
6453
6772
|
}
|
|
6454
6773
|
});
|
|
6455
|
-
var StatsGrid =
|
|
6774
|
+
var StatsGrid = React42.forwardRef(
|
|
6456
6775
|
({ stats, badges = [], className, ...props }, ref) => {
|
|
6457
6776
|
const api = createProgressDisplay({ stats, badges });
|
|
6458
6777
|
return /* @__PURE__ */ jsx(
|
|
@@ -6481,7 +6800,7 @@ var StatsGrid = React41.forwardRef(
|
|
|
6481
6800
|
}
|
|
6482
6801
|
);
|
|
6483
6802
|
StatsGrid.displayName = "StatsGrid";
|
|
6484
|
-
var ProgressBar =
|
|
6803
|
+
var ProgressBar = React42.forwardRef(
|
|
6485
6804
|
({ value, max = 100, size, className, ...props }, ref) => {
|
|
6486
6805
|
const percent = Math.min(100, Math.max(0, value / max * 100));
|
|
6487
6806
|
return /* @__PURE__ */ jsx(
|
|
@@ -6506,7 +6825,7 @@ var ProgressBar = React41.forwardRef(
|
|
|
6506
6825
|
}
|
|
6507
6826
|
);
|
|
6508
6827
|
ProgressBar.displayName = "ProgressBar";
|
|
6509
|
-
var BadgeDisplay =
|
|
6828
|
+
var BadgeDisplay = React42.forwardRef(
|
|
6510
6829
|
({ badges, className, ...props }, ref) => {
|
|
6511
6830
|
const api = createProgressDisplay({ stats: [], badges });
|
|
6512
6831
|
return /* @__PURE__ */ jsx(
|
|
@@ -6674,7 +6993,7 @@ var slideTypeBadgeVariants = cva({
|
|
|
6674
6993
|
type: "lesson"
|
|
6675
6994
|
}
|
|
6676
6995
|
});
|
|
6677
|
-
var SlideViewer =
|
|
6996
|
+
var SlideViewer = React42.forwardRef(
|
|
6678
6997
|
({
|
|
6679
6998
|
slides,
|
|
6680
6999
|
initialSlide,
|
|
@@ -6684,9 +7003,9 @@ var SlideViewer = React41.forwardRef(
|
|
|
6684
7003
|
size,
|
|
6685
7004
|
renderSlide
|
|
6686
7005
|
}, ref) => {
|
|
6687
|
-
const [, setTick] =
|
|
7006
|
+
const [, setTick] = React42.useState(0);
|
|
6688
7007
|
const rerender = () => setTick((t) => t + 1);
|
|
6689
|
-
const apiRef =
|
|
7008
|
+
const apiRef = React42.useRef(
|
|
6690
7009
|
createSlideViewer({ slides, initialSlide, onSlideChange, onComplete })
|
|
6691
7010
|
);
|
|
6692
7011
|
const api = apiRef.current;
|
|
@@ -6888,7 +7207,7 @@ var optionVariants = cva({
|
|
|
6888
7207
|
});
|
|
6889
7208
|
|
|
6890
7209
|
// ../react-language-selector/dist/index.js
|
|
6891
|
-
var LanguageSelectorContext =
|
|
7210
|
+
var LanguageSelectorContext = React42.createContext(null);
|
|
6892
7211
|
function LanguageSelector({
|
|
6893
7212
|
value: controlledValue,
|
|
6894
7213
|
onValueChange,
|
|
@@ -6898,10 +7217,10 @@ function LanguageSelector({
|
|
|
6898
7217
|
className
|
|
6899
7218
|
}) {
|
|
6900
7219
|
const initialValues = Array.isArray(controlledValue) ? controlledValue : controlledValue ? [controlledValue] : [];
|
|
6901
|
-
const [selectedValues, setSelectedValues] =
|
|
6902
|
-
const [isOpen, setIsOpen] =
|
|
6903
|
-
const containerRef =
|
|
6904
|
-
const handleValueChange =
|
|
7220
|
+
const [selectedValues, setSelectedValues] = React42.useState(initialValues);
|
|
7221
|
+
const [isOpen, setIsOpen] = React42.useState(false);
|
|
7222
|
+
const containerRef = React42.useRef(null);
|
|
7223
|
+
const handleValueChange = React42.useCallback(
|
|
6905
7224
|
(val) => {
|
|
6906
7225
|
const arr = Array.isArray(val) ? val : [val];
|
|
6907
7226
|
setSelectedValues(arr);
|
|
@@ -6909,7 +7228,7 @@ function LanguageSelector({
|
|
|
6909
7228
|
},
|
|
6910
7229
|
[onValueChange]
|
|
6911
7230
|
);
|
|
6912
|
-
const api =
|
|
7231
|
+
const api = React42.useMemo(
|
|
6913
7232
|
() => createLanguageSelector({
|
|
6914
7233
|
value: multiple ? selectedValues : selectedValues[0],
|
|
6915
7234
|
onValueChange: handleValueChange,
|
|
@@ -6917,7 +7236,7 @@ function LanguageSelector({
|
|
|
6917
7236
|
}),
|
|
6918
7237
|
[selectedValues, handleValueChange, options, multiple]
|
|
6919
7238
|
);
|
|
6920
|
-
const handleToggle =
|
|
7239
|
+
const handleToggle = React42.useCallback(
|
|
6921
7240
|
(val) => {
|
|
6922
7241
|
if (multiple) {
|
|
6923
7242
|
const index = selectedValues.indexOf(val);
|
|
@@ -6932,10 +7251,10 @@ function LanguageSelector({
|
|
|
6932
7251
|
},
|
|
6933
7252
|
[multiple, selectedValues, onValueChange]
|
|
6934
7253
|
);
|
|
6935
|
-
const handleTriggerClick =
|
|
7254
|
+
const handleTriggerClick = React42.useCallback(() => {
|
|
6936
7255
|
setIsOpen((prev) => !prev);
|
|
6937
7256
|
}, []);
|
|
6938
|
-
const handleKeyDown =
|
|
7257
|
+
const handleKeyDown = React42.useCallback(
|
|
6939
7258
|
(e) => {
|
|
6940
7259
|
if (e.key === "Escape") {
|
|
6941
7260
|
setIsOpen(false);
|
|
@@ -6950,7 +7269,7 @@ function LanguageSelector({
|
|
|
6950
7269
|
},
|
|
6951
7270
|
[isOpen]
|
|
6952
7271
|
);
|
|
6953
|
-
|
|
7272
|
+
React42.useEffect(() => {
|
|
6954
7273
|
if (!isOpen) return;
|
|
6955
7274
|
function handleClickOutside(e) {
|
|
6956
7275
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
@@ -6960,7 +7279,7 @@ function LanguageSelector({
|
|
|
6960
7279
|
document.addEventListener("mousedown", handleClickOutside);
|
|
6961
7280
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
6962
7281
|
}, [isOpen]);
|
|
6963
|
-
const ctx =
|
|
7282
|
+
const ctx = React42.useMemo(
|
|
6964
7283
|
() => ({
|
|
6965
7284
|
api,
|
|
6966
7285
|
isOpen,
|
|
@@ -6971,7 +7290,7 @@ function LanguageSelector({
|
|
|
6971
7290
|
}),
|
|
6972
7291
|
[api, isOpen, handleToggle, options, multiple]
|
|
6973
7292
|
);
|
|
6974
|
-
const grouped =
|
|
7293
|
+
const grouped = React42.useMemo(() => {
|
|
6975
7294
|
const groups = /* @__PURE__ */ new Map();
|
|
6976
7295
|
const ungrouped = [];
|
|
6977
7296
|
for (const opt of options) {
|
|
@@ -6986,14 +7305,14 @@ function LanguageSelector({
|
|
|
6986
7305
|
return { groups, ungrouped };
|
|
6987
7306
|
}, [options]);
|
|
6988
7307
|
const displayLabel = selectedValues.length > 0 ? options.filter((o) => selectedValues.includes(o.value)).map((o) => o.label).join(", ") : placeholder;
|
|
6989
|
-
return
|
|
7308
|
+
return React42.createElement(
|
|
6990
7309
|
LanguageSelectorContext.Provider,
|
|
6991
7310
|
{ value: ctx },
|
|
6992
|
-
|
|
7311
|
+
React42.createElement(
|
|
6993
7312
|
"div",
|
|
6994
7313
|
{ ref: containerRef, className: cn("rfr-language-selector relative inline-block", className) },
|
|
6995
7314
|
// Trigger
|
|
6996
|
-
|
|
7315
|
+
React42.createElement(
|
|
6997
7316
|
"button",
|
|
6998
7317
|
{
|
|
6999
7318
|
type: "button",
|
|
@@ -7005,11 +7324,11 @@ function LanguageSelector({
|
|
|
7005
7324
|
onClick: handleTriggerClick,
|
|
7006
7325
|
onKeyDown: handleKeyDown
|
|
7007
7326
|
},
|
|
7008
|
-
|
|
7009
|
-
|
|
7327
|
+
React42.createElement("span", null, displayLabel),
|
|
7328
|
+
React42.createElement("span", { "aria-hidden": "true", className: "ml-2" }, "\u25BE")
|
|
7010
7329
|
),
|
|
7011
7330
|
// Dropdown
|
|
7012
|
-
isOpen &&
|
|
7331
|
+
isOpen && React42.createElement(
|
|
7013
7332
|
"ul",
|
|
7014
7333
|
{
|
|
7015
7334
|
role: api.contentProps.role,
|
|
@@ -7018,21 +7337,21 @@ function LanguageSelector({
|
|
|
7018
7337
|
className: "absolute top-full left-0 w-full mt-1 rounded-md border bg-popover text-popover-foreground shadow-md z-50 overflow-auto max-h-60"
|
|
7019
7338
|
},
|
|
7020
7339
|
...[...grouped.groups.entries()].map(
|
|
7021
|
-
([group, opts]) =>
|
|
7340
|
+
([group, opts]) => React42.createElement(
|
|
7022
7341
|
"li",
|
|
7023
7342
|
{ key: group, role: "presentation" },
|
|
7024
|
-
|
|
7343
|
+
React42.createElement(
|
|
7025
7344
|
"div",
|
|
7026
7345
|
{ className: "px-3 py-1 text-xs font-semibold text-muted-foreground uppercase" },
|
|
7027
7346
|
group
|
|
7028
7347
|
),
|
|
7029
|
-
|
|
7348
|
+
React42.createElement(
|
|
7030
7349
|
"ul",
|
|
7031
7350
|
{ role: "group", "aria-label": group },
|
|
7032
7351
|
...opts.map((opt) => {
|
|
7033
7352
|
const optProps = api.getOptionProps(opt.value);
|
|
7034
7353
|
const isSelected = selectedValues.includes(opt.value);
|
|
7035
|
-
return
|
|
7354
|
+
return React42.createElement(
|
|
7036
7355
|
"li",
|
|
7037
7356
|
{
|
|
7038
7357
|
key: opt.value,
|
|
@@ -7040,8 +7359,8 @@ function LanguageSelector({
|
|
|
7040
7359
|
className: optionVariants({ selected: isSelected ? "true" : "false" }),
|
|
7041
7360
|
onClick: () => handleToggle(opt.value)
|
|
7042
7361
|
},
|
|
7043
|
-
isSelected &&
|
|
7044
|
-
|
|
7362
|
+
isSelected && React42.createElement("span", { "aria-hidden": "true" }, "\u2713"),
|
|
7363
|
+
React42.createElement("span", null, opt.label)
|
|
7045
7364
|
);
|
|
7046
7365
|
})
|
|
7047
7366
|
)
|
|
@@ -7050,7 +7369,7 @@ function LanguageSelector({
|
|
|
7050
7369
|
...grouped.ungrouped.map((opt) => {
|
|
7051
7370
|
const optProps = api.getOptionProps(opt.value);
|
|
7052
7371
|
const isSelected = selectedValues.includes(opt.value);
|
|
7053
|
-
return
|
|
7372
|
+
return React42.createElement(
|
|
7054
7373
|
"li",
|
|
7055
7374
|
{
|
|
7056
7375
|
key: opt.value,
|
|
@@ -7058,8 +7377,8 @@ function LanguageSelector({
|
|
|
7058
7377
|
className: optionVariants({ selected: isSelected ? "true" : "false" }),
|
|
7059
7378
|
onClick: () => handleToggle(opt.value)
|
|
7060
7379
|
},
|
|
7061
|
-
isSelected &&
|
|
7062
|
-
|
|
7380
|
+
isSelected && React42.createElement("span", { "aria-hidden": "true" }, "\u2713"),
|
|
7381
|
+
React42.createElement("span", null, opt.label)
|
|
7063
7382
|
);
|
|
7064
7383
|
})
|
|
7065
7384
|
)
|
|
@@ -7184,7 +7503,7 @@ var latestBadgeVariants = cva({
|
|
|
7184
7503
|
});
|
|
7185
7504
|
|
|
7186
7505
|
// ../react-version-selector/dist/index.js
|
|
7187
|
-
var VersionSelectorContext =
|
|
7506
|
+
var VersionSelectorContext = React42.createContext(null);
|
|
7188
7507
|
function VersionSelector({
|
|
7189
7508
|
value: controlledValue,
|
|
7190
7509
|
onValueChange,
|
|
@@ -7192,17 +7511,17 @@ function VersionSelector({
|
|
|
7192
7511
|
placeholder = "Select version...",
|
|
7193
7512
|
className
|
|
7194
7513
|
}) {
|
|
7195
|
-
const [selectedVersion, setSelectedVersion] =
|
|
7196
|
-
const [isOpen, setIsOpen] =
|
|
7197
|
-
const containerRef =
|
|
7198
|
-
const handleValueChange =
|
|
7514
|
+
const [selectedVersion, setSelectedVersion] = React42.useState(controlledValue ?? "");
|
|
7515
|
+
const [isOpen, setIsOpen] = React42.useState(false);
|
|
7516
|
+
const containerRef = React42.useRef(null);
|
|
7517
|
+
const handleValueChange = React42.useCallback(
|
|
7199
7518
|
(val) => {
|
|
7200
7519
|
setSelectedVersion(val);
|
|
7201
7520
|
onValueChange?.(val);
|
|
7202
7521
|
},
|
|
7203
7522
|
[onValueChange]
|
|
7204
7523
|
);
|
|
7205
|
-
const api =
|
|
7524
|
+
const api = React42.useMemo(
|
|
7206
7525
|
() => createVersionSelector({
|
|
7207
7526
|
value: selectedVersion,
|
|
7208
7527
|
onValueChange: handleValueChange,
|
|
@@ -7210,7 +7529,7 @@ function VersionSelector({
|
|
|
7210
7529
|
}),
|
|
7211
7530
|
[selectedVersion, handleValueChange, versions]
|
|
7212
7531
|
);
|
|
7213
|
-
const handleSelect =
|
|
7532
|
+
const handleSelect = React42.useCallback(
|
|
7214
7533
|
(val) => {
|
|
7215
7534
|
setSelectedVersion(val);
|
|
7216
7535
|
onValueChange?.(val);
|
|
@@ -7218,10 +7537,10 @@ function VersionSelector({
|
|
|
7218
7537
|
},
|
|
7219
7538
|
[onValueChange]
|
|
7220
7539
|
);
|
|
7221
|
-
const handleTriggerClick =
|
|
7540
|
+
const handleTriggerClick = React42.useCallback(() => {
|
|
7222
7541
|
setIsOpen((prev) => !prev);
|
|
7223
7542
|
}, []);
|
|
7224
|
-
const handleKeyDown =
|
|
7543
|
+
const handleKeyDown = React42.useCallback(
|
|
7225
7544
|
(e) => {
|
|
7226
7545
|
if (e.key === "Escape") {
|
|
7227
7546
|
setIsOpen(false);
|
|
@@ -7236,7 +7555,7 @@ function VersionSelector({
|
|
|
7236
7555
|
},
|
|
7237
7556
|
[isOpen]
|
|
7238
7557
|
);
|
|
7239
|
-
|
|
7558
|
+
React42.useEffect(() => {
|
|
7240
7559
|
if (!isOpen) return;
|
|
7241
7560
|
function handleClickOutside(e) {
|
|
7242
7561
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
@@ -7246,7 +7565,7 @@ function VersionSelector({
|
|
|
7246
7565
|
document.addEventListener("mousedown", handleClickOutside);
|
|
7247
7566
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
7248
7567
|
}, [isOpen]);
|
|
7249
|
-
const ctx =
|
|
7568
|
+
const ctx = React42.useMemo(
|
|
7250
7569
|
() => ({
|
|
7251
7570
|
api,
|
|
7252
7571
|
isOpen,
|
|
@@ -7258,14 +7577,14 @@ function VersionSelector({
|
|
|
7258
7577
|
);
|
|
7259
7578
|
const selectedOpt = versions.find((v) => v.value === selectedVersion);
|
|
7260
7579
|
const displayLabel = selectedOpt ? selectedOpt.label : placeholder;
|
|
7261
|
-
return
|
|
7580
|
+
return React42.createElement(
|
|
7262
7581
|
VersionSelectorContext.Provider,
|
|
7263
7582
|
{ value: ctx },
|
|
7264
|
-
|
|
7583
|
+
React42.createElement(
|
|
7265
7584
|
"div",
|
|
7266
7585
|
{ ref: containerRef, className: cn("rfr-version-selector relative inline-block", className) },
|
|
7267
7586
|
// Trigger
|
|
7268
|
-
|
|
7587
|
+
React42.createElement(
|
|
7269
7588
|
"button",
|
|
7270
7589
|
{
|
|
7271
7590
|
type: "button",
|
|
@@ -7277,16 +7596,16 @@ function VersionSelector({
|
|
|
7277
7596
|
onClick: handleTriggerClick,
|
|
7278
7597
|
onKeyDown: handleKeyDown
|
|
7279
7598
|
},
|
|
7280
|
-
|
|
7281
|
-
selectedOpt?.isLatest &&
|
|
7599
|
+
React42.createElement("span", null, displayLabel),
|
|
7600
|
+
selectedOpt?.isLatest && React42.createElement(
|
|
7282
7601
|
"span",
|
|
7283
7602
|
{ className: cn(latestBadgeVariants(), "ml-2") },
|
|
7284
7603
|
"Latest"
|
|
7285
7604
|
),
|
|
7286
|
-
|
|
7605
|
+
React42.createElement("span", { "aria-hidden": "true", className: "ml-2" }, "\u25BE")
|
|
7287
7606
|
),
|
|
7288
7607
|
// Dropdown
|
|
7289
|
-
isOpen &&
|
|
7608
|
+
isOpen && React42.createElement(
|
|
7290
7609
|
"ul",
|
|
7291
7610
|
{
|
|
7292
7611
|
role: api.contentProps.role,
|
|
@@ -7296,7 +7615,7 @@ function VersionSelector({
|
|
|
7296
7615
|
...versions.map((ver) => {
|
|
7297
7616
|
const optProps = api.getOptionProps(ver.value);
|
|
7298
7617
|
const isSelected = selectedVersion === ver.value;
|
|
7299
|
-
return
|
|
7618
|
+
return React42.createElement(
|
|
7300
7619
|
"li",
|
|
7301
7620
|
{
|
|
7302
7621
|
key: ver.value,
|
|
@@ -7304,8 +7623,8 @@ function VersionSelector({
|
|
|
7304
7623
|
className: optionVariants2({ selected: isSelected ? "true" : "false" }),
|
|
7305
7624
|
onClick: () => handleSelect(ver.value)
|
|
7306
7625
|
},
|
|
7307
|
-
|
|
7308
|
-
ver.isLatest &&
|
|
7626
|
+
React42.createElement("span", null, ver.label),
|
|
7627
|
+
ver.isLatest && React42.createElement(
|
|
7309
7628
|
"span",
|
|
7310
7629
|
{ className: latestBadgeVariants() },
|
|
7311
7630
|
"Latest"
|
|
@@ -7448,15 +7767,15 @@ var resizablePaneVariants = cva({
|
|
|
7448
7767
|
orientation: "horizontal"
|
|
7449
7768
|
}
|
|
7450
7769
|
});
|
|
7451
|
-
var ResizableLayoutContext =
|
|
7770
|
+
var ResizableLayoutContext = React42.createContext(null);
|
|
7452
7771
|
function useResizableLayoutContext() {
|
|
7453
|
-
const ctx =
|
|
7772
|
+
const ctx = React42.useContext(ResizableLayoutContext);
|
|
7454
7773
|
if (!ctx) {
|
|
7455
7774
|
throw new Error("Resizable compound components must be used within <ResizableLayout>");
|
|
7456
7775
|
}
|
|
7457
7776
|
return ctx;
|
|
7458
7777
|
}
|
|
7459
|
-
var ResizableLayout =
|
|
7778
|
+
var ResizableLayout = React42.forwardRef(
|
|
7460
7779
|
({
|
|
7461
7780
|
orientation = "horizontal",
|
|
7462
7781
|
defaultSizes = [50, 50],
|
|
@@ -7469,7 +7788,7 @@ var ResizableLayout = React41.forwardRef(
|
|
|
7469
7788
|
children,
|
|
7470
7789
|
...props
|
|
7471
7790
|
}, ref) => {
|
|
7472
|
-
const apiRef =
|
|
7791
|
+
const apiRef = React42.useRef(null);
|
|
7473
7792
|
if (!apiRef.current) {
|
|
7474
7793
|
apiRef.current = createResizableLayout({
|
|
7475
7794
|
orientation,
|
|
@@ -7480,22 +7799,22 @@ var ResizableLayout = React41.forwardRef(
|
|
|
7480
7799
|
});
|
|
7481
7800
|
}
|
|
7482
7801
|
const api = apiRef.current;
|
|
7483
|
-
const [sizes, setSizesState] =
|
|
7484
|
-
const setSizes =
|
|
7802
|
+
const [sizes, setSizesState] = React42.useState(api.sizes);
|
|
7803
|
+
const setSizes = React42.useCallback(
|
|
7485
7804
|
(newSizes) => {
|
|
7486
7805
|
setSizesState([...newSizes]);
|
|
7487
7806
|
onSizesChange?.(newSizes);
|
|
7488
7807
|
},
|
|
7489
7808
|
[onSizesChange]
|
|
7490
7809
|
);
|
|
7491
|
-
const cssVars =
|
|
7810
|
+
const cssVars = React42.useMemo(() => {
|
|
7492
7811
|
const vars = {};
|
|
7493
7812
|
for (let i = 0; i < sizes.length; i++) {
|
|
7494
7813
|
vars[`--rfr-pane-${i}-size`] = `${sizes[i]}%`;
|
|
7495
7814
|
}
|
|
7496
7815
|
return vars;
|
|
7497
7816
|
}, [sizes]);
|
|
7498
|
-
const contextValue =
|
|
7817
|
+
const contextValue = React42.useMemo(
|
|
7499
7818
|
() => ({ api, orientation, sizes, setSizes }),
|
|
7500
7819
|
[api, orientation, sizes, setSizes]
|
|
7501
7820
|
);
|
|
@@ -7513,7 +7832,7 @@ var ResizableLayout = React41.forwardRef(
|
|
|
7513
7832
|
}
|
|
7514
7833
|
);
|
|
7515
7834
|
ResizableLayout.displayName = "ResizableLayout";
|
|
7516
|
-
var ResizablePane =
|
|
7835
|
+
var ResizablePane = React42.forwardRef(
|
|
7517
7836
|
({ index, className, style, children, ...props }, ref) => {
|
|
7518
7837
|
const { orientation, sizes } = useResizableLayoutContext();
|
|
7519
7838
|
const size = sizes[index] ?? 50;
|
|
@@ -7537,12 +7856,12 @@ var ResizablePane = React41.forwardRef(
|
|
|
7537
7856
|
}
|
|
7538
7857
|
);
|
|
7539
7858
|
ResizablePane.displayName = "ResizablePane";
|
|
7540
|
-
var ResizableDivider =
|
|
7859
|
+
var ResizableDivider = React42.forwardRef(
|
|
7541
7860
|
({ index, className, ...props }, ref) => {
|
|
7542
7861
|
const { api, orientation, setSizes } = useResizableLayoutContext();
|
|
7543
|
-
const startPosRef =
|
|
7544
|
-
const containerSizeRef =
|
|
7545
|
-
const onPointerDown =
|
|
7862
|
+
const startPosRef = React42.useRef(0);
|
|
7863
|
+
const containerSizeRef = React42.useRef(0);
|
|
7864
|
+
const onPointerDown = React42.useCallback(
|
|
7546
7865
|
(e) => {
|
|
7547
7866
|
e.preventDefault();
|
|
7548
7867
|
const target = e.currentTarget;
|
|
@@ -7556,7 +7875,7 @@ var ResizableDivider = React41.forwardRef(
|
|
|
7556
7875
|
},
|
|
7557
7876
|
[api, index, orientation]
|
|
7558
7877
|
);
|
|
7559
|
-
const onPointerMove =
|
|
7878
|
+
const onPointerMove = React42.useCallback(
|
|
7560
7879
|
(e) => {
|
|
7561
7880
|
if (containerSizeRef.current === 0) return;
|
|
7562
7881
|
const currentPos = orientation === "horizontal" ? e.clientX : e.clientY;
|
|
@@ -7567,7 +7886,7 @@ var ResizableDivider = React41.forwardRef(
|
|
|
7567
7886
|
},
|
|
7568
7887
|
[api, orientation, setSizes]
|
|
7569
7888
|
);
|
|
7570
|
-
const onPointerUp =
|
|
7889
|
+
const onPointerUp = React42.useCallback(
|
|
7571
7890
|
(e) => {
|
|
7572
7891
|
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
7573
7892
|
containerSizeRef.current = 0;
|
|
@@ -7820,26 +8139,26 @@ function createAuthShell(config) {
|
|
|
7820
8139
|
}
|
|
7821
8140
|
|
|
7822
8141
|
// ../react-app-shell/dist/index.js
|
|
7823
|
-
var AppShellContext =
|
|
8142
|
+
var AppShellContext = React42.createContext(null);
|
|
7824
8143
|
function useAppShell() {
|
|
7825
|
-
const ctx =
|
|
8144
|
+
const ctx = React42.useContext(AppShellContext);
|
|
7826
8145
|
if (!ctx) {
|
|
7827
8146
|
throw new Error("useAppShell must be used within <AppShell>");
|
|
7828
8147
|
}
|
|
7829
8148
|
return ctx;
|
|
7830
8149
|
}
|
|
7831
8150
|
function AppShellRoot({ config, children, className }) {
|
|
7832
|
-
const apiRef =
|
|
8151
|
+
const apiRef = React42.useRef(null);
|
|
7833
8152
|
if (apiRef.current === null) {
|
|
7834
8153
|
apiRef.current = createAppShell(config);
|
|
7835
8154
|
}
|
|
7836
8155
|
const api = apiRef.current;
|
|
7837
|
-
const [state, setState] =
|
|
7838
|
-
|
|
8156
|
+
const [state, setState] = React42.useState(() => api.state);
|
|
8157
|
+
React42.useEffect(() => {
|
|
7839
8158
|
setState(api.state);
|
|
7840
8159
|
return api.subscribe((s) => setState(s));
|
|
7841
8160
|
}, [api]);
|
|
7842
|
-
|
|
8161
|
+
React42.useEffect(() => {
|
|
7843
8162
|
if (typeof window === "undefined") return;
|
|
7844
8163
|
const { mobileBreakpoint, tabletBreakpoint } = api.config;
|
|
7845
8164
|
const mobileQuery = window.matchMedia(`(max-width: ${mobileBreakpoint - 1}px)`);
|
|
@@ -7860,14 +8179,14 @@ function AppShellRoot({ config, children, className }) {
|
|
|
7860
8179
|
};
|
|
7861
8180
|
}, [api]);
|
|
7862
8181
|
const cssVars = api.getCSSVariables();
|
|
7863
|
-
const ctxValue =
|
|
8182
|
+
const ctxValue = React42.useMemo(
|
|
7864
8183
|
() => ({ api, state }),
|
|
7865
8184
|
[api, state]
|
|
7866
8185
|
);
|
|
7867
|
-
return
|
|
8186
|
+
return React42.createElement(
|
|
7868
8187
|
AppShellContext.Provider,
|
|
7869
8188
|
{ value: ctxValue },
|
|
7870
|
-
|
|
8189
|
+
React42.createElement(
|
|
7871
8190
|
"div",
|
|
7872
8191
|
{
|
|
7873
8192
|
className: cn("flex h-screen w-full overflow-hidden", className),
|
|
@@ -7897,7 +8216,7 @@ function Sidebar2({ children, className }) {
|
|
|
7897
8216
|
"w-[var(--shell-sidebar-full-width)]",
|
|
7898
8217
|
state.sidebarOpen ? "translate-x-0" : isRight ? "translate-x-full" : "-translate-x-full"
|
|
7899
8218
|
] : ["relative", "w-[var(--shell-sidebar-width)]"];
|
|
7900
|
-
return
|
|
8219
|
+
return React42.createElement(
|
|
7901
8220
|
"aside",
|
|
7902
8221
|
{
|
|
7903
8222
|
...api.sidebarAriaProps,
|
|
@@ -7910,7 +8229,7 @@ function Sidebar2({ children, className }) {
|
|
|
7910
8229
|
}
|
|
7911
8230
|
Sidebar2.displayName = "AppShell.Sidebar";
|
|
7912
8231
|
function Main({ children, className }) {
|
|
7913
|
-
return
|
|
8232
|
+
return React42.createElement(
|
|
7914
8233
|
"div",
|
|
7915
8234
|
{
|
|
7916
8235
|
className: cn("flex flex-1 flex-col min-w-0 h-full", className)
|
|
@@ -7921,7 +8240,7 @@ function Main({ children, className }) {
|
|
|
7921
8240
|
Main.displayName = "AppShell.Main";
|
|
7922
8241
|
function Header({ children, className }) {
|
|
7923
8242
|
const { api, state } = useAppShell();
|
|
7924
|
-
const hamburger = state.isMobile ?
|
|
8243
|
+
const hamburger = state.isMobile ? React42.createElement(
|
|
7925
8244
|
"button",
|
|
7926
8245
|
{
|
|
7927
8246
|
type: "button",
|
|
@@ -7931,7 +8250,7 @@ function Header({ children, className }) {
|
|
|
7931
8250
|
onClick: () => api.toggleSidebar(),
|
|
7932
8251
|
className: "inline-flex items-center justify-center p-2 mr-2"
|
|
7933
8252
|
},
|
|
7934
|
-
|
|
8253
|
+
React42.createElement(
|
|
7935
8254
|
"svg",
|
|
7936
8255
|
{
|
|
7937
8256
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7945,12 +8264,12 @@ function Header({ children, className }) {
|
|
|
7945
8264
|
strokeLinejoin: "round",
|
|
7946
8265
|
"aria-hidden": "true"
|
|
7947
8266
|
},
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
8267
|
+
React42.createElement("line", { x1: 3, y1: 6, x2: 21, y2: 6 }),
|
|
8268
|
+
React42.createElement("line", { x1: 3, y1: 12, x2: 21, y2: 12 }),
|
|
8269
|
+
React42.createElement("line", { x1: 3, y1: 18, x2: 21, y2: 18 })
|
|
7951
8270
|
)
|
|
7952
8271
|
) : null;
|
|
7953
|
-
return
|
|
8272
|
+
return React42.createElement(
|
|
7954
8273
|
"header",
|
|
7955
8274
|
{
|
|
7956
8275
|
...api.headerAriaProps,
|
|
@@ -7969,7 +8288,7 @@ Header.displayName = "AppShell.Header";
|
|
|
7969
8288
|
function Content({ children, className, maxWidth }) {
|
|
7970
8289
|
const { api } = useAppShell();
|
|
7971
8290
|
const mwClass = maxWidth ? `max-w-${maxWidth}` : "";
|
|
7972
|
-
return
|
|
8291
|
+
return React42.createElement(
|
|
7973
8292
|
"main",
|
|
7974
8293
|
{
|
|
7975
8294
|
...api.mainAriaProps,
|
|
@@ -7988,7 +8307,7 @@ function MobileNav2({ children, className }) {
|
|
|
7988
8307
|
const { api, state } = useAppShell();
|
|
7989
8308
|
if (!state.isMobile) return null;
|
|
7990
8309
|
if (api.config.mobileNavPosition === "none") return null;
|
|
7991
|
-
return
|
|
8310
|
+
return React42.createElement(
|
|
7992
8311
|
"nav",
|
|
7993
8312
|
{
|
|
7994
8313
|
...api.mobileNavAriaProps,
|
|
@@ -8007,7 +8326,7 @@ MobileNav2.displayName = "AppShell.MobileNav";
|
|
|
8007
8326
|
function Overlay({ className }) {
|
|
8008
8327
|
const { api, state } = useAppShell();
|
|
8009
8328
|
if (!state.isMobile || !state.sidebarOpen) return null;
|
|
8010
|
-
return
|
|
8329
|
+
return React42.createElement("div", {
|
|
8011
8330
|
...api.overlayAriaProps,
|
|
8012
8331
|
className: cn(
|
|
8013
8332
|
"fixed inset-0 z-30 bg-black/50 transition-opacity",
|
|
@@ -8026,29 +8345,29 @@ var AppShell = Object.assign(AppShellRoot, {
|
|
|
8026
8345
|
MobileNav: MobileNav2,
|
|
8027
8346
|
Overlay
|
|
8028
8347
|
});
|
|
8029
|
-
var PageShellContext =
|
|
8348
|
+
var PageShellContext = React42.createContext(null);
|
|
8030
8349
|
function usePageShell() {
|
|
8031
|
-
const ctx =
|
|
8350
|
+
const ctx = React42.useContext(PageShellContext);
|
|
8032
8351
|
if (!ctx) {
|
|
8033
8352
|
throw new Error("PageShell compound components must be used within <PageShell>");
|
|
8034
8353
|
}
|
|
8035
8354
|
return ctx;
|
|
8036
8355
|
}
|
|
8037
8356
|
function PageShellRoot({ config, children, className }) {
|
|
8038
|
-
const apiRef =
|
|
8357
|
+
const apiRef = React42.useRef(null);
|
|
8039
8358
|
if (apiRef.current === null) {
|
|
8040
8359
|
apiRef.current = createPageShell(config);
|
|
8041
8360
|
}
|
|
8042
8361
|
const api = apiRef.current;
|
|
8043
8362
|
const cssVars = api.getCSSVariables();
|
|
8044
|
-
const ctxValue =
|
|
8363
|
+
const ctxValue = React42.useMemo(
|
|
8045
8364
|
() => ({ api }),
|
|
8046
8365
|
[api]
|
|
8047
8366
|
);
|
|
8048
|
-
return
|
|
8367
|
+
return React42.createElement(
|
|
8049
8368
|
PageShellContext.Provider,
|
|
8050
8369
|
{ value: ctxValue },
|
|
8051
|
-
|
|
8370
|
+
React42.createElement(
|
|
8052
8371
|
"div",
|
|
8053
8372
|
{
|
|
8054
8373
|
className: cn("flex min-h-screen flex-col", className),
|
|
@@ -8064,7 +8383,7 @@ function Nav({ children, className }) {
|
|
|
8064
8383
|
const { api } = usePageShell();
|
|
8065
8384
|
const stickyClass = api.config.navSticky ? "sticky top-0 z-40" : "";
|
|
8066
8385
|
const transparentClass = api.config.navTransparent ? "bg-transparent" : "bg-background border-b";
|
|
8067
|
-
return
|
|
8386
|
+
return React42.createElement(
|
|
8068
8387
|
"nav",
|
|
8069
8388
|
{
|
|
8070
8389
|
...api.navAriaProps,
|
|
@@ -8089,7 +8408,7 @@ function Section({
|
|
|
8089
8408
|
}) {
|
|
8090
8409
|
const { api } = usePageShell();
|
|
8091
8410
|
const sectionClasses = api.getSectionClasses({ fullWidth, maxWidth, padding, background });
|
|
8092
|
-
return
|
|
8411
|
+
return React42.createElement(
|
|
8093
8412
|
"section",
|
|
8094
8413
|
{
|
|
8095
8414
|
className: cn("py-12", sectionClasses, className)
|
|
@@ -8101,7 +8420,7 @@ Section.displayName = "PageShell.Section";
|
|
|
8101
8420
|
function Footer2({ children, className, columns }) {
|
|
8102
8421
|
const { api } = usePageShell();
|
|
8103
8422
|
const cols = columns ?? api.config.footerColumns;
|
|
8104
|
-
return
|
|
8423
|
+
return React42.createElement(
|
|
8105
8424
|
"footer",
|
|
8106
8425
|
{
|
|
8107
8426
|
...api.footerAriaProps,
|
|
@@ -8110,7 +8429,7 @@ function Footer2({ children, className, columns }) {
|
|
|
8110
8429
|
className
|
|
8111
8430
|
)
|
|
8112
8431
|
},
|
|
8113
|
-
|
|
8432
|
+
React42.createElement(
|
|
8114
8433
|
"div",
|
|
8115
8434
|
{
|
|
8116
8435
|
className: `mx-auto max-w-[var(--page-max-width)] grid gap-8`,
|
|
@@ -8128,28 +8447,28 @@ Object.assign(PageShellRoot, {
|
|
|
8128
8447
|
Section,
|
|
8129
8448
|
Footer: Footer2
|
|
8130
8449
|
});
|
|
8131
|
-
var AuthShellContext =
|
|
8450
|
+
var AuthShellContext = React42.createContext(null);
|
|
8132
8451
|
function useAuthShell() {
|
|
8133
|
-
const ctx =
|
|
8452
|
+
const ctx = React42.useContext(AuthShellContext);
|
|
8134
8453
|
if (!ctx) {
|
|
8135
8454
|
throw new Error("AuthShell compound components must be used within <AuthShell>");
|
|
8136
8455
|
}
|
|
8137
8456
|
return ctx;
|
|
8138
8457
|
}
|
|
8139
8458
|
function AuthShellRoot({ config, children, className }) {
|
|
8140
|
-
const apiRef =
|
|
8459
|
+
const apiRef = React42.useRef(null);
|
|
8141
8460
|
if (apiRef.current === null) {
|
|
8142
8461
|
apiRef.current = createAuthShell(config);
|
|
8143
8462
|
}
|
|
8144
8463
|
const api = apiRef.current;
|
|
8145
|
-
const ctxValue =
|
|
8464
|
+
const ctxValue = React42.useMemo(
|
|
8146
8465
|
() => ({ api }),
|
|
8147
8466
|
[api]
|
|
8148
8467
|
);
|
|
8149
|
-
return
|
|
8468
|
+
return React42.createElement(
|
|
8150
8469
|
AuthShellContext.Provider,
|
|
8151
8470
|
{ value: ctxValue },
|
|
8152
|
-
|
|
8471
|
+
React42.createElement(
|
|
8153
8472
|
"div",
|
|
8154
8473
|
{
|
|
8155
8474
|
...api.ariaProps,
|
|
@@ -8163,7 +8482,7 @@ function AuthShellRoot({ config, children, className }) {
|
|
|
8163
8482
|
AuthShellRoot.displayName = "AuthShell";
|
|
8164
8483
|
function Card({ children, className }) {
|
|
8165
8484
|
const { api } = useAuthShell();
|
|
8166
|
-
return
|
|
8485
|
+
return React42.createElement(
|
|
8167
8486
|
"div",
|
|
8168
8487
|
{
|
|
8169
8488
|
className: cn(api.cardClasses, className),
|
|
@@ -8251,7 +8570,7 @@ var avatarFallbackVariants = cva({
|
|
|
8251
8570
|
size: "md"
|
|
8252
8571
|
}
|
|
8253
8572
|
});
|
|
8254
|
-
var AvatarContext =
|
|
8573
|
+
var AvatarContext = React42.createContext({
|
|
8255
8574
|
size: "md",
|
|
8256
8575
|
imageLoaded: false,
|
|
8257
8576
|
imageError: false,
|
|
@@ -8260,10 +8579,10 @@ var AvatarContext = React41.createContext({
|
|
|
8260
8579
|
setImageError: () => {
|
|
8261
8580
|
}
|
|
8262
8581
|
});
|
|
8263
|
-
var Avatar =
|
|
8582
|
+
var Avatar = React42.forwardRef(
|
|
8264
8583
|
({ size = "md", className, children, ...props }, ref) => {
|
|
8265
|
-
const [imageLoaded, setImageLoaded] =
|
|
8266
|
-
const [imageError, setImageError] =
|
|
8584
|
+
const [imageLoaded, setImageLoaded] = React42.useState(false);
|
|
8585
|
+
const [imageError, setImageError] = React42.useState(false);
|
|
8267
8586
|
const api = createAvatar({ size });
|
|
8268
8587
|
return /* @__PURE__ */ jsx(AvatarContext.Provider, { value: { size, imageLoaded, imageError, setImageLoaded, setImageError }, children: /* @__PURE__ */ jsx(
|
|
8269
8588
|
"span",
|
|
@@ -8279,9 +8598,9 @@ var Avatar = React41.forwardRef(
|
|
|
8279
8598
|
}
|
|
8280
8599
|
);
|
|
8281
8600
|
Avatar.displayName = "Avatar";
|
|
8282
|
-
var AvatarImage =
|
|
8601
|
+
var AvatarImage = React42.forwardRef(
|
|
8283
8602
|
({ className, src, alt = "", onLoad, onError, ...props }, ref) => {
|
|
8284
|
-
const { setImageLoaded, setImageError } =
|
|
8603
|
+
const { setImageLoaded, setImageError } = React42.useContext(AvatarContext);
|
|
8285
8604
|
const handleLoad = (e) => {
|
|
8286
8605
|
setImageLoaded(true);
|
|
8287
8606
|
onLoad?.(e);
|
|
@@ -8305,9 +8624,9 @@ var AvatarImage = React41.forwardRef(
|
|
|
8305
8624
|
}
|
|
8306
8625
|
);
|
|
8307
8626
|
AvatarImage.displayName = "AvatarImage";
|
|
8308
|
-
var AvatarFallback =
|
|
8627
|
+
var AvatarFallback = React42.forwardRef(
|
|
8309
8628
|
({ className, children, ...props }, ref) => {
|
|
8310
|
-
const { size } =
|
|
8629
|
+
const { size } = React42.useContext(AvatarContext);
|
|
8311
8630
|
return /* @__PURE__ */ jsx(
|
|
8312
8631
|
"span",
|
|
8313
8632
|
{
|
|
@@ -8424,28 +8743,28 @@ var avatarPresenceDotVariants = cva({
|
|
|
8424
8743
|
// ../react-avatar-group/dist/index.js
|
|
8425
8744
|
function AvatarGroup({ users, max, size = "md", className }) {
|
|
8426
8745
|
const api = createAvatarGroup({ users, max});
|
|
8427
|
-
return
|
|
8746
|
+
return React42.createElement(
|
|
8428
8747
|
"div",
|
|
8429
8748
|
{ ...api.ariaProps, className: cn(avatarGroupStyles, className) },
|
|
8430
8749
|
api.visibleUsers.map(
|
|
8431
|
-
(user) =>
|
|
8750
|
+
(user) => React42.createElement(
|
|
8432
8751
|
"div",
|
|
8433
8752
|
{
|
|
8434
8753
|
key: user.id,
|
|
8435
8754
|
className: avatarVariants2({ size }),
|
|
8436
8755
|
...api.getAvatarAriaProps(user)
|
|
8437
8756
|
},
|
|
8438
|
-
user.src ?
|
|
8757
|
+
user.src ? React42.createElement("img", {
|
|
8439
8758
|
src: user.src,
|
|
8440
8759
|
alt: user.name,
|
|
8441
8760
|
className: avatarImageStyles
|
|
8442
|
-
}) :
|
|
8443
|
-
user.status &&
|
|
8761
|
+
}) : React42.createElement("span", null, api.getInitials(user.name)),
|
|
8762
|
+
user.status && React42.createElement("span", {
|
|
8444
8763
|
className: avatarPresenceDotVariants({ size, status: user.status })
|
|
8445
8764
|
})
|
|
8446
8765
|
)
|
|
8447
8766
|
),
|
|
8448
|
-
api.overflowCount > 0 &&
|
|
8767
|
+
api.overflowCount > 0 && React42.createElement(
|
|
8449
8768
|
"div",
|
|
8450
8769
|
{
|
|
8451
8770
|
className: avatarOverflowBadgeVariants({ size }),
|
|
@@ -8529,7 +8848,7 @@ var cardContentVariants = cva({
|
|
|
8529
8848
|
var cardFooterVariants = cva({
|
|
8530
8849
|
base: "flex items-center p-6 pt-0"
|
|
8531
8850
|
});
|
|
8532
|
-
var Card2 =
|
|
8851
|
+
var Card2 = React42.forwardRef(
|
|
8533
8852
|
({ className, ...props }, ref) => {
|
|
8534
8853
|
const api = createCard();
|
|
8535
8854
|
return /* @__PURE__ */ jsx(
|
|
@@ -8545,7 +8864,7 @@ var Card2 = React41.forwardRef(
|
|
|
8545
8864
|
}
|
|
8546
8865
|
);
|
|
8547
8866
|
Card2.displayName = "Card";
|
|
8548
|
-
var CardHeader =
|
|
8867
|
+
var CardHeader = React42.forwardRef(
|
|
8549
8868
|
({ className, ...props }, ref) => {
|
|
8550
8869
|
const api = createCardHeader();
|
|
8551
8870
|
return /* @__PURE__ */ jsx(
|
|
@@ -8560,7 +8879,7 @@ var CardHeader = React41.forwardRef(
|
|
|
8560
8879
|
}
|
|
8561
8880
|
);
|
|
8562
8881
|
CardHeader.displayName = "CardHeader";
|
|
8563
|
-
var CardTitle =
|
|
8882
|
+
var CardTitle = React42.forwardRef(
|
|
8564
8883
|
({ className, ...props }, ref) => {
|
|
8565
8884
|
const api = createCardTitle();
|
|
8566
8885
|
return /* @__PURE__ */ jsx(
|
|
@@ -8575,7 +8894,7 @@ var CardTitle = React41.forwardRef(
|
|
|
8575
8894
|
}
|
|
8576
8895
|
);
|
|
8577
8896
|
CardTitle.displayName = "CardTitle";
|
|
8578
|
-
var CardDescription =
|
|
8897
|
+
var CardDescription = React42.forwardRef(
|
|
8579
8898
|
({ className, ...props }, ref) => {
|
|
8580
8899
|
const api = createCardDescription();
|
|
8581
8900
|
return /* @__PURE__ */ jsx(
|
|
@@ -8590,7 +8909,7 @@ var CardDescription = React41.forwardRef(
|
|
|
8590
8909
|
}
|
|
8591
8910
|
);
|
|
8592
8911
|
CardDescription.displayName = "CardDescription";
|
|
8593
|
-
var CardContent =
|
|
8912
|
+
var CardContent = React42.forwardRef(
|
|
8594
8913
|
({ className, ...props }, ref) => {
|
|
8595
8914
|
const api = createCardContent();
|
|
8596
8915
|
return /* @__PURE__ */ jsx(
|
|
@@ -8605,7 +8924,7 @@ var CardContent = React41.forwardRef(
|
|
|
8605
8924
|
}
|
|
8606
8925
|
);
|
|
8607
8926
|
CardContent.displayName = "CardContent";
|
|
8608
|
-
var CardFooter =
|
|
8927
|
+
var CardFooter = React42.forwardRef(
|
|
8609
8928
|
({ className, ...props }, ref) => {
|
|
8610
8929
|
const api = createCardFooter();
|
|
8611
8930
|
return /* @__PURE__ */ jsx(
|
|
@@ -8686,7 +9005,7 @@ var checkboxVariants = cva({
|
|
|
8686
9005
|
size: "default"
|
|
8687
9006
|
}
|
|
8688
9007
|
});
|
|
8689
|
-
var Checkbox =
|
|
9008
|
+
var Checkbox = React42.forwardRef(
|
|
8690
9009
|
({ checked = false, onCheckedChange, disabled = false, size = "default", className, ...props }, ref) => {
|
|
8691
9010
|
const api = createCheckbox({ checked, disabled });
|
|
8692
9011
|
const checkedVariant = checked === "indeterminate" ? "indeterminate" : checked ? "true" : "false";
|
|
@@ -8997,13 +9316,13 @@ function DatePicker({
|
|
|
8997
9316
|
className,
|
|
8998
9317
|
disabled = false
|
|
8999
9318
|
}) {
|
|
9000
|
-
const [open, setOpen] =
|
|
9001
|
-
const [currentMonth, setCurrentMonth] =
|
|
9319
|
+
const [open, setOpen] = React42.useState(false);
|
|
9320
|
+
const [currentMonth, setCurrentMonth] = React42.useState(
|
|
9002
9321
|
() => value ? new Date(value.getFullYear(), value.getMonth(), 1) : new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1)
|
|
9003
9322
|
);
|
|
9004
|
-
const [view, setView] =
|
|
9005
|
-
const containerRef =
|
|
9006
|
-
const api =
|
|
9323
|
+
const [view, setView] = React42.useState("calendar");
|
|
9324
|
+
const containerRef = React42.useRef(null);
|
|
9325
|
+
const api = React42.useMemo(
|
|
9007
9326
|
() => createDatePicker({
|
|
9008
9327
|
value,
|
|
9009
9328
|
onChange,
|
|
@@ -9017,7 +9336,7 @@ function DatePicker({
|
|
|
9017
9336
|
}),
|
|
9018
9337
|
[value, onChange, minDate, maxDate, showTime, format, placeholder, open]
|
|
9019
9338
|
);
|
|
9020
|
-
|
|
9339
|
+
React42.useMemo(() => {
|
|
9021
9340
|
createDatePicker({
|
|
9022
9341
|
value,
|
|
9023
9342
|
minDate,
|
|
@@ -9032,7 +9351,7 @@ function DatePicker({
|
|
|
9032
9351
|
});
|
|
9033
9352
|
return tempApi.days;
|
|
9034
9353
|
}, [value, minDate, maxDate, currentMonth]);
|
|
9035
|
-
|
|
9354
|
+
React42.useEffect(() => {
|
|
9036
9355
|
if (!open) return;
|
|
9037
9356
|
function handleClick(e) {
|
|
9038
9357
|
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
@@ -9042,7 +9361,7 @@ function DatePicker({
|
|
|
9042
9361
|
document.addEventListener("mousedown", handleClick);
|
|
9043
9362
|
return () => document.removeEventListener("mousedown", handleClick);
|
|
9044
9363
|
}, [open]);
|
|
9045
|
-
|
|
9364
|
+
React42.useEffect(() => {
|
|
9046
9365
|
if (!open) return;
|
|
9047
9366
|
function handleKeyDown(e) {
|
|
9048
9367
|
if (e.key === "Escape") {
|
|
@@ -9080,10 +9399,10 @@ function DatePicker({
|
|
|
9080
9399
|
onChange?.(newDate);
|
|
9081
9400
|
};
|
|
9082
9401
|
const monthLabel = currentMonth.toLocaleDateString("en-US", { month: "long", year: "numeric" });
|
|
9083
|
-
return
|
|
9402
|
+
return React42.createElement(
|
|
9084
9403
|
"div",
|
|
9085
9404
|
{ ref: containerRef, className: cn("relative inline-block", className) },
|
|
9086
|
-
|
|
9405
|
+
React42.createElement(
|
|
9087
9406
|
"button",
|
|
9088
9407
|
{
|
|
9089
9408
|
type: "button",
|
|
@@ -9095,17 +9414,17 @@ function DatePicker({
|
|
|
9095
9414
|
},
|
|
9096
9415
|
displayValue
|
|
9097
9416
|
),
|
|
9098
|
-
open &&
|
|
9417
|
+
open && React42.createElement(
|
|
9099
9418
|
"div",
|
|
9100
9419
|
{
|
|
9101
9420
|
className: datePickerDropdownStyles,
|
|
9102
9421
|
role: "dialog",
|
|
9103
9422
|
"aria-modal": true
|
|
9104
9423
|
},
|
|
9105
|
-
|
|
9424
|
+
React42.createElement(
|
|
9106
9425
|
"div",
|
|
9107
9426
|
{ className: "flex items-center justify-between mb-3" },
|
|
9108
|
-
|
|
9427
|
+
React42.createElement(
|
|
9109
9428
|
"button",
|
|
9110
9429
|
{
|
|
9111
9430
|
type: "button",
|
|
@@ -9115,8 +9434,8 @@ function DatePicker({
|
|
|
9115
9434
|
},
|
|
9116
9435
|
"\u2039"
|
|
9117
9436
|
),
|
|
9118
|
-
|
|
9119
|
-
|
|
9437
|
+
React42.createElement("span", { className: "text-sm font-medium" }, monthLabel),
|
|
9438
|
+
React42.createElement(
|
|
9120
9439
|
"button",
|
|
9121
9440
|
{
|
|
9122
9441
|
type: "button",
|
|
@@ -9127,11 +9446,11 @@ function DatePicker({
|
|
|
9127
9446
|
"\u203A"
|
|
9128
9447
|
)
|
|
9129
9448
|
),
|
|
9130
|
-
|
|
9449
|
+
React42.createElement(
|
|
9131
9450
|
"div",
|
|
9132
9451
|
{ className: "grid grid-cols-7 gap-0 text-center", role: "grid" },
|
|
9133
9452
|
["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map(
|
|
9134
|
-
(d) =>
|
|
9453
|
+
(d) => React42.createElement("div", { key: d, className: "text-xs text-muted-foreground py-1 font-medium" }, d)
|
|
9135
9454
|
),
|
|
9136
9455
|
api.days.map((day, i) => {
|
|
9137
9456
|
let state = "default";
|
|
@@ -9139,7 +9458,7 @@ function DatePicker({
|
|
|
9139
9458
|
else if (day.isSelected) state = "selected";
|
|
9140
9459
|
else if (day.isToday) state = "today";
|
|
9141
9460
|
else if (!day.isCurrentMonth) state = "outside";
|
|
9142
|
-
return
|
|
9461
|
+
return React42.createElement(
|
|
9143
9462
|
"button",
|
|
9144
9463
|
{
|
|
9145
9464
|
key: i,
|
|
@@ -9154,11 +9473,11 @@ function DatePicker({
|
|
|
9154
9473
|
);
|
|
9155
9474
|
})
|
|
9156
9475
|
),
|
|
9157
|
-
showTime &&
|
|
9476
|
+
showTime && React42.createElement(
|
|
9158
9477
|
"div",
|
|
9159
9478
|
{ className: datePickerTimeStyles },
|
|
9160
|
-
|
|
9161
|
-
|
|
9479
|
+
React42.createElement("span", { className: "text-sm text-muted-foreground" }, "Time:"),
|
|
9480
|
+
React42.createElement("input", {
|
|
9162
9481
|
type: "number",
|
|
9163
9482
|
min: 0,
|
|
9164
9483
|
max: 23,
|
|
@@ -9167,8 +9486,8 @@ function DatePicker({
|
|
|
9167
9486
|
className: datePickerTimeInputStyles,
|
|
9168
9487
|
"aria-label": "Hours"
|
|
9169
9488
|
}),
|
|
9170
|
-
|
|
9171
|
-
|
|
9489
|
+
React42.createElement("span", { className: "text-muted-foreground" }, ":"),
|
|
9490
|
+
React42.createElement("input", {
|
|
9172
9491
|
type: "number",
|
|
9173
9492
|
min: 0,
|
|
9174
9493
|
max: 59,
|
|
@@ -9558,10 +9877,10 @@ var emojiPickerSectionLabelStyles = "px-2 py-1 text-xs font-medium text-muted-fo
|
|
|
9558
9877
|
|
|
9559
9878
|
// ../react-emoji-picker/dist/index.js
|
|
9560
9879
|
function EmojiPicker({ onSelect, recentEmojis: initialRecent = [], className }) {
|
|
9561
|
-
const [search, setSearch] =
|
|
9562
|
-
const [activeCategory, setActiveCategory] =
|
|
9563
|
-
const [recentEmojis, setRecentEmojis] =
|
|
9564
|
-
const api =
|
|
9880
|
+
const [search, setSearch] = React42.useState("");
|
|
9881
|
+
const [activeCategory, setActiveCategory] = React42.useState("smileys");
|
|
9882
|
+
const [recentEmojis, setRecentEmojis] = React42.useState(initialRecent);
|
|
9883
|
+
const api = React42.useMemo(
|
|
9565
9884
|
() => createEmojiPicker({
|
|
9566
9885
|
onSelect: void 0,
|
|
9567
9886
|
search,
|
|
@@ -9569,7 +9888,7 @@ function EmojiPicker({ onSelect, recentEmojis: initialRecent = [], className })
|
|
|
9569
9888
|
}),
|
|
9570
9889
|
[search, recentEmojis]
|
|
9571
9890
|
);
|
|
9572
|
-
const filteredEmojis =
|
|
9891
|
+
const filteredEmojis = React42.useMemo(() => {
|
|
9573
9892
|
if (search.trim()) {
|
|
9574
9893
|
const query = search.toLowerCase().trim();
|
|
9575
9894
|
const allEmojis = EMOJI_CATEGORIES.flatMap((cat) => EMOJI_DATA[cat]);
|
|
@@ -9589,22 +9908,22 @@ function EmojiPicker({ onSelect, recentEmojis: initialRecent = [], className })
|
|
|
9589
9908
|
setActiveCategory(cat);
|
|
9590
9909
|
setSearch("");
|
|
9591
9910
|
};
|
|
9592
|
-
return
|
|
9911
|
+
return React42.createElement(
|
|
9593
9912
|
"div",
|
|
9594
9913
|
{ className: cn(emojiPickerContainerStyles, className), ...api.ariaProps },
|
|
9595
9914
|
// Search input
|
|
9596
|
-
|
|
9915
|
+
React42.createElement("input", {
|
|
9597
9916
|
...api.searchInputProps,
|
|
9598
9917
|
className: emojiPickerSearchStyles,
|
|
9599
9918
|
value: search,
|
|
9600
9919
|
onChange: (e) => setSearch(e.target.value)
|
|
9601
9920
|
}),
|
|
9602
9921
|
// Category tabs
|
|
9603
|
-
!search &&
|
|
9922
|
+
!search && React42.createElement(
|
|
9604
9923
|
"div",
|
|
9605
9924
|
{ className: emojiPickerCategoryBarStyles },
|
|
9606
9925
|
api.categoryTabs.map(
|
|
9607
|
-
(tab) =>
|
|
9926
|
+
(tab) => React42.createElement(
|
|
9608
9927
|
"button",
|
|
9609
9928
|
{
|
|
9610
9929
|
key: tab.category,
|
|
@@ -9621,15 +9940,15 @@ function EmojiPicker({ onSelect, recentEmojis: initialRecent = [], className })
|
|
|
9621
9940
|
)
|
|
9622
9941
|
),
|
|
9623
9942
|
// Recent emojis section
|
|
9624
|
-
!search && recentEmojis.length > 0 &&
|
|
9943
|
+
!search && recentEmojis.length > 0 && React42.createElement(
|
|
9625
9944
|
"div",
|
|
9626
9945
|
null,
|
|
9627
|
-
|
|
9628
|
-
|
|
9946
|
+
React42.createElement("div", { className: emojiPickerSectionLabelStyles }, "Recent"),
|
|
9947
|
+
React42.createElement(
|
|
9629
9948
|
"div",
|
|
9630
9949
|
{ className: emojiPickerGridStyles },
|
|
9631
9950
|
recentEmojis.map(
|
|
9632
|
-
(emoji, i) =>
|
|
9951
|
+
(emoji, i) => React42.createElement(
|
|
9633
9952
|
"button",
|
|
9634
9953
|
{
|
|
9635
9954
|
key: `recent-${emoji.emoji}-${i}`,
|
|
@@ -9644,19 +9963,19 @@ function EmojiPicker({ onSelect, recentEmojis: initialRecent = [], className })
|
|
|
9644
9963
|
)
|
|
9645
9964
|
),
|
|
9646
9965
|
// Emoji grid
|
|
9647
|
-
|
|
9966
|
+
React42.createElement(
|
|
9648
9967
|
"div",
|
|
9649
9968
|
null,
|
|
9650
|
-
!search &&
|
|
9969
|
+
!search && React42.createElement(
|
|
9651
9970
|
"div",
|
|
9652
9971
|
{ className: emojiPickerSectionLabelStyles },
|
|
9653
9972
|
CATEGORY_LABELS[activeCategory]
|
|
9654
9973
|
),
|
|
9655
|
-
|
|
9974
|
+
React42.createElement(
|
|
9656
9975
|
"div",
|
|
9657
9976
|
{ className: emojiPickerGridStyles },
|
|
9658
9977
|
filteredEmojis.map(
|
|
9659
|
-
(emoji, i) =>
|
|
9978
|
+
(emoji, i) => React42.createElement(
|
|
9660
9979
|
"button",
|
|
9661
9980
|
{
|
|
9662
9981
|
key: `${emoji.emoji}-${i}`,
|
|
@@ -9668,7 +9987,7 @@ function EmojiPicker({ onSelect, recentEmojis: initialRecent = [], className })
|
|
|
9668
9987
|
emoji.emoji
|
|
9669
9988
|
)
|
|
9670
9989
|
),
|
|
9671
|
-
filteredEmojis.length === 0 &&
|
|
9990
|
+
filteredEmojis.length === 0 && React42.createElement(
|
|
9672
9991
|
"div",
|
|
9673
9992
|
{ className: "col-span-8 text-center text-sm text-muted-foreground py-4" },
|
|
9674
9993
|
"No emojis found"
|
|
@@ -9868,10 +10187,10 @@ function FileUpload({
|
|
|
9868
10187
|
className,
|
|
9869
10188
|
children
|
|
9870
10189
|
}) {
|
|
9871
|
-
const [files, setFiles] =
|
|
9872
|
-
const [isDragging, setIsDragging] =
|
|
9873
|
-
const inputRef =
|
|
9874
|
-
const api =
|
|
10190
|
+
const [files, setFiles] = React42.useState([]);
|
|
10191
|
+
const [isDragging, setIsDragging] = React42.useState(false);
|
|
10192
|
+
const inputRef = React42.useRef(null);
|
|
10193
|
+
const api = React42.useMemo(
|
|
9875
10194
|
() => createFileUpload({
|
|
9876
10195
|
accept,
|
|
9877
10196
|
maxSize,
|
|
@@ -9936,17 +10255,17 @@ function FileUpload({
|
|
|
9936
10255
|
handleClick();
|
|
9937
10256
|
}
|
|
9938
10257
|
};
|
|
9939
|
-
return
|
|
10258
|
+
return React42.createElement(
|
|
9940
10259
|
"div",
|
|
9941
10260
|
{ className },
|
|
9942
10261
|
// Hidden file input
|
|
9943
|
-
|
|
10262
|
+
React42.createElement("input", {
|
|
9944
10263
|
ref: inputRef,
|
|
9945
10264
|
...api.inputProps,
|
|
9946
10265
|
onChange: handleInputChange
|
|
9947
10266
|
}),
|
|
9948
10267
|
// Drop zone
|
|
9949
|
-
|
|
10268
|
+
React42.createElement(
|
|
9950
10269
|
"div",
|
|
9951
10270
|
{
|
|
9952
10271
|
...api.dropZoneProps,
|
|
@@ -9960,21 +10279,21 @@ function FileUpload({
|
|
|
9960
10279
|
onDragOver: handleDragOver,
|
|
9961
10280
|
onDrop: handleDrop
|
|
9962
10281
|
},
|
|
9963
|
-
children ??
|
|
9964
|
-
|
|
10282
|
+
children ?? React42.createElement(
|
|
10283
|
+
React42.Fragment,
|
|
9965
10284
|
null,
|
|
9966
|
-
|
|
9967
|
-
|
|
10285
|
+
React42.createElement("div", { className: "text-2xl mb-2" }, "\u{1F4C1}"),
|
|
10286
|
+
React42.createElement(
|
|
9968
10287
|
"p",
|
|
9969
10288
|
{ className: "text-sm text-muted-foreground" },
|
|
9970
10289
|
"Drag & drop files here, or click to select"
|
|
9971
10290
|
),
|
|
9972
|
-
accept &&
|
|
10291
|
+
accept && React42.createElement(
|
|
9973
10292
|
"p",
|
|
9974
10293
|
{ className: "text-xs text-muted-foreground mt-1" },
|
|
9975
10294
|
`Accepted: ${accept}`
|
|
9976
10295
|
),
|
|
9977
|
-
maxSize &&
|
|
10296
|
+
maxSize && React42.createElement(
|
|
9978
10297
|
"p",
|
|
9979
10298
|
{ className: "text-xs text-muted-foreground" },
|
|
9980
10299
|
`Max size: ${formatFileSize(maxSize)}`
|
|
@@ -9982,37 +10301,37 @@ function FileUpload({
|
|
|
9982
10301
|
)
|
|
9983
10302
|
),
|
|
9984
10303
|
// File list
|
|
9985
|
-
files.length > 0 &&
|
|
10304
|
+
files.length > 0 && React42.createElement(
|
|
9986
10305
|
"div",
|
|
9987
10306
|
{ className: fileUploadFileListStyles },
|
|
9988
10307
|
files.map(
|
|
9989
|
-
(file) =>
|
|
10308
|
+
(file) => React42.createElement(
|
|
9990
10309
|
"div",
|
|
9991
10310
|
{ key: file.id, className: fileUploadFileItemStyles },
|
|
9992
|
-
|
|
10311
|
+
React42.createElement(
|
|
9993
10312
|
"div",
|
|
9994
10313
|
{ className: "flex-1 min-w-0" },
|
|
9995
|
-
|
|
9996
|
-
|
|
10314
|
+
React42.createElement("div", { className: "font-medium truncate" }, file.name),
|
|
10315
|
+
React42.createElement(
|
|
9997
10316
|
"div",
|
|
9998
10317
|
{ className: "text-xs text-muted-foreground" },
|
|
9999
10318
|
formatFileSize(file.size)
|
|
10000
10319
|
),
|
|
10001
|
-
file.status === "uploading" &&
|
|
10320
|
+
file.status === "uploading" && React42.createElement(
|
|
10002
10321
|
"div",
|
|
10003
10322
|
{ className: cn(fileUploadProgressStyles, "mt-1") },
|
|
10004
|
-
|
|
10323
|
+
React42.createElement("div", {
|
|
10005
10324
|
className: fileUploadProgressBarStyles,
|
|
10006
10325
|
style: { width: `${file.progress}%` }
|
|
10007
10326
|
})
|
|
10008
10327
|
),
|
|
10009
|
-
file.error &&
|
|
10328
|
+
file.error && React42.createElement(
|
|
10010
10329
|
"div",
|
|
10011
10330
|
{ className: "text-xs text-destructive mt-0.5" },
|
|
10012
10331
|
file.error
|
|
10013
10332
|
)
|
|
10014
10333
|
),
|
|
10015
|
-
|
|
10334
|
+
React42.createElement(
|
|
10016
10335
|
"button",
|
|
10017
10336
|
{
|
|
10018
10337
|
type: "button",
|
|
@@ -10032,162 +10351,6 @@ function FileUpload({
|
|
|
10032
10351
|
}
|
|
10033
10352
|
FileUpload.displayName = "FileUpload";
|
|
10034
10353
|
|
|
10035
|
-
// ../keyboard-shortcut/dist/index.js
|
|
10036
|
-
var MODIFIER_KEYS = /* @__PURE__ */ new Set(["Ctrl", "Control", "Alt", "Shift", "Meta", "Cmd", "Command"]);
|
|
10037
|
-
var KEY_DISPLAY = {
|
|
10038
|
-
"Ctrl": "Ctrl",
|
|
10039
|
-
"Control": "Ctrl",
|
|
10040
|
-
"Alt": "Alt",
|
|
10041
|
-
"Shift": "Shift",
|
|
10042
|
-
"Meta": "Meta",
|
|
10043
|
-
"Cmd": "Cmd",
|
|
10044
|
-
"Command": "Cmd",
|
|
10045
|
-
"Enter": "\u21B5",
|
|
10046
|
-
"Backspace": "\u232B",
|
|
10047
|
-
"Delete": "Del",
|
|
10048
|
-
"Escape": "Esc",
|
|
10049
|
-
"ArrowUp": "\u2191",
|
|
10050
|
-
"ArrowDown": "\u2193",
|
|
10051
|
-
"ArrowLeft": "\u2190",
|
|
10052
|
-
"ArrowRight": "\u2192",
|
|
10053
|
-
"Tab": "Tab",
|
|
10054
|
-
" ": "Space"
|
|
10055
|
-
};
|
|
10056
|
-
var MAC_KEY_DISPLAY = {
|
|
10057
|
-
"Ctrl": "\u2303",
|
|
10058
|
-
"Control": "\u2303",
|
|
10059
|
-
"Alt": "\u2325",
|
|
10060
|
-
"Shift": "\u21E7",
|
|
10061
|
-
"Meta": "\u2318",
|
|
10062
|
-
"Cmd": "\u2318",
|
|
10063
|
-
"Command": "\u2318",
|
|
10064
|
-
"Enter": "\u21B5",
|
|
10065
|
-
"Backspace": "\u232B",
|
|
10066
|
-
"Delete": "\u2326",
|
|
10067
|
-
"Escape": "\u238B",
|
|
10068
|
-
"ArrowUp": "\u2191",
|
|
10069
|
-
"ArrowDown": "\u2193",
|
|
10070
|
-
"ArrowLeft": "\u2190",
|
|
10071
|
-
"ArrowRight": "\u2192",
|
|
10072
|
-
"Tab": "\u21E5",
|
|
10073
|
-
" ": "\u2423"
|
|
10074
|
-
};
|
|
10075
|
-
function normalizeKey(key) {
|
|
10076
|
-
if (key === "Command" || key === "Cmd") return "Meta";
|
|
10077
|
-
if (key === "Control") return "Ctrl";
|
|
10078
|
-
return key;
|
|
10079
|
-
}
|
|
10080
|
-
function isMac() {
|
|
10081
|
-
if (typeof navigator !== "undefined") {
|
|
10082
|
-
return navigator.platform?.includes("Mac") || navigator.userAgent?.includes("Mac");
|
|
10083
|
-
}
|
|
10084
|
-
return false;
|
|
10085
|
-
}
|
|
10086
|
-
function formatShortcut(keys, mac) {
|
|
10087
|
-
const displayMap = mac ? MAC_KEY_DISPLAY : KEY_DISPLAY;
|
|
10088
|
-
return keys.map((key) => displayMap[key] ?? key.toUpperCase()).join(mac ? "" : "+");
|
|
10089
|
-
}
|
|
10090
|
-
function createKeyboardShortcut(props) {
|
|
10091
|
-
const {
|
|
10092
|
-
keys,
|
|
10093
|
-
onTrigger,
|
|
10094
|
-
enabled: enabledProp = true,
|
|
10095
|
-
preventDefault: preventDefaultProp = true
|
|
10096
|
-
} = props;
|
|
10097
|
-
const normalizedKeys = keys.map(normalizeKey);
|
|
10098
|
-
const modifiers = normalizedKeys.filter((k) => MODIFIER_KEYS.has(k));
|
|
10099
|
-
const regularKeys = normalizedKeys.filter((k) => !MODIFIER_KEYS.has(k));
|
|
10100
|
-
function handler(event) {
|
|
10101
|
-
if (!enabledProp) return false;
|
|
10102
|
-
const ctrlRequired = modifiers.includes("Ctrl");
|
|
10103
|
-
const altRequired = modifiers.includes("Alt");
|
|
10104
|
-
const shiftRequired = modifiers.includes("Shift");
|
|
10105
|
-
const metaRequired = modifiers.includes("Meta");
|
|
10106
|
-
if (ctrlRequired !== (event.ctrlKey || event.metaKey && !metaRequired)) ;
|
|
10107
|
-
const ctrlMatch = ctrlRequired ? event.ctrlKey : !event.ctrlKey;
|
|
10108
|
-
const altMatch = altRequired ? event.altKey : !event.altKey;
|
|
10109
|
-
const shiftMatch = shiftRequired ? event.shiftKey : !event.shiftKey;
|
|
10110
|
-
const metaMatch = metaRequired ? event.metaKey : !event.metaKey;
|
|
10111
|
-
if (!ctrlMatch || !altMatch || !shiftMatch || !metaMatch) return false;
|
|
10112
|
-
if (regularKeys.length > 0) {
|
|
10113
|
-
const eventKey = event.key.length === 1 ? event.key.toUpperCase() : event.key;
|
|
10114
|
-
const targetKey = regularKeys[0].length === 1 ? regularKeys[0].toUpperCase() : regularKeys[0];
|
|
10115
|
-
if (eventKey !== targetKey) return false;
|
|
10116
|
-
}
|
|
10117
|
-
if (preventDefaultProp) {
|
|
10118
|
-
event.preventDefault();
|
|
10119
|
-
}
|
|
10120
|
-
onTrigger();
|
|
10121
|
-
return true;
|
|
10122
|
-
}
|
|
10123
|
-
const mac = isMac();
|
|
10124
|
-
const display = formatShortcut(keys, false);
|
|
10125
|
-
const platformDisplay = formatShortcut(keys, mac);
|
|
10126
|
-
const badgeAriaProps = {
|
|
10127
|
-
"aria-hidden": true,
|
|
10128
|
-
role: "presentation"
|
|
10129
|
-
};
|
|
10130
|
-
return {
|
|
10131
|
-
handler,
|
|
10132
|
-
display,
|
|
10133
|
-
platformDisplay,
|
|
10134
|
-
enabled: enabledProp,
|
|
10135
|
-
keys,
|
|
10136
|
-
badgeAriaProps
|
|
10137
|
-
};
|
|
10138
|
-
}
|
|
10139
|
-
var shortcutBadgeStyles = "inline-flex items-center gap-0.5 rounded border bg-muted px-1.5 py-0.5 text-xs font-mono text-muted-foreground";
|
|
10140
|
-
var shortcutKeyStyles = "inline-flex items-center justify-center min-w-[1.25rem] rounded bg-background px-1 py-0.5 text-xs font-mono border shadow-sm";
|
|
10141
|
-
var shortcutSeparatorStyles = "text-muted-foreground text-xs";
|
|
10142
|
-
|
|
10143
|
-
// ../react-keyboard-shortcut/dist/index.js
|
|
10144
|
-
function KeyboardShortcut({
|
|
10145
|
-
keys,
|
|
10146
|
-
onTrigger,
|
|
10147
|
-
enabled = true,
|
|
10148
|
-
preventDefault = true
|
|
10149
|
-
}) {
|
|
10150
|
-
const apiRef = React41.useRef(
|
|
10151
|
-
createKeyboardShortcut({ keys, onTrigger, enabled, preventDefault })
|
|
10152
|
-
);
|
|
10153
|
-
React41.useEffect(() => {
|
|
10154
|
-
apiRef.current = createKeyboardShortcut({ keys, onTrigger, enabled, preventDefault });
|
|
10155
|
-
}, [keys, onTrigger, enabled, preventDefault]);
|
|
10156
|
-
React41.useEffect(() => {
|
|
10157
|
-
if (!enabled) return;
|
|
10158
|
-
const handleKeyDown = (e) => {
|
|
10159
|
-
apiRef.current.handler(e);
|
|
10160
|
-
};
|
|
10161
|
-
document.addEventListener("keydown", handleKeyDown);
|
|
10162
|
-
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
10163
|
-
}, [enabled]);
|
|
10164
|
-
return null;
|
|
10165
|
-
}
|
|
10166
|
-
KeyboardShortcut.displayName = "KeyboardShortcut";
|
|
10167
|
-
function ShortcutBadge({ keys, platform = true, className }) {
|
|
10168
|
-
const api = createKeyboardShortcut({ keys, onTrigger: () => {
|
|
10169
|
-
}, enabled: false });
|
|
10170
|
-
const displayKeys = platform ? api.platformDisplay : api.display;
|
|
10171
|
-
const isMacDisplay = platform && displayKeys !== api.display;
|
|
10172
|
-
return React41.createElement(
|
|
10173
|
-
"kbd",
|
|
10174
|
-
{ ...api.badgeAriaProps, className: cn(shortcutBadgeStyles, className) },
|
|
10175
|
-
isMacDisplay ? React41.createElement("span", null, displayKeys) : keys.map(
|
|
10176
|
-
(key, i) => React41.createElement(
|
|
10177
|
-
React41.Fragment,
|
|
10178
|
-
{ key: i },
|
|
10179
|
-
i > 0 && React41.createElement("span", { className: shortcutSeparatorStyles }, "+"),
|
|
10180
|
-
React41.createElement(
|
|
10181
|
-
"span",
|
|
10182
|
-
{ className: shortcutKeyStyles },
|
|
10183
|
-
formatShortcut([key], false)
|
|
10184
|
-
)
|
|
10185
|
-
)
|
|
10186
|
-
)
|
|
10187
|
-
);
|
|
10188
|
-
}
|
|
10189
|
-
ShortcutBadge.displayName = "ShortcutBadge";
|
|
10190
|
-
|
|
10191
10354
|
// ../otp-input/dist/index.js
|
|
10192
10355
|
function createOtpInput(props = {}) {
|
|
10193
10356
|
const {
|
|
@@ -10353,7 +10516,7 @@ var otpInputSlotVariants = cva({
|
|
|
10353
10516
|
filled: "false"
|
|
10354
10517
|
}
|
|
10355
10518
|
});
|
|
10356
|
-
var OtpInput =
|
|
10519
|
+
var OtpInput = React42.forwardRef(
|
|
10357
10520
|
({
|
|
10358
10521
|
length = 6,
|
|
10359
10522
|
value = "",
|
|
@@ -10365,15 +10528,15 @@ var OtpInput = React41.forwardRef(
|
|
|
10365
10528
|
className,
|
|
10366
10529
|
...props
|
|
10367
10530
|
}, ref) => {
|
|
10368
|
-
const inputRefs =
|
|
10369
|
-
const [focusedIndex, setFocusedIndex] =
|
|
10370
|
-
const [values, setValues] =
|
|
10531
|
+
const inputRefs = React42.useRef([]);
|
|
10532
|
+
const [focusedIndex, setFocusedIndex] = React42.useState(autoFocus ? 0 : -1);
|
|
10533
|
+
const [values, setValues] = React42.useState(
|
|
10371
10534
|
() => Array.from({ length }, (_, i) => value.charAt(i) || "")
|
|
10372
10535
|
);
|
|
10373
|
-
|
|
10536
|
+
React42.useEffect(() => {
|
|
10374
10537
|
setValues(Array.from({ length }, (_, i) => value.charAt(i) || ""));
|
|
10375
10538
|
}, [value, length]);
|
|
10376
|
-
|
|
10539
|
+
React42.useEffect(() => {
|
|
10377
10540
|
if (autoFocus && inputRefs.current[0]) {
|
|
10378
10541
|
inputRefs.current[0].focus();
|
|
10379
10542
|
}
|
|
@@ -10553,13 +10716,13 @@ function PresenceIndicator({
|
|
|
10553
10716
|
className
|
|
10554
10717
|
}) {
|
|
10555
10718
|
const api = createPresence({ status, showLabel, label });
|
|
10556
|
-
return
|
|
10719
|
+
return React42.createElement(
|
|
10557
10720
|
"span",
|
|
10558
10721
|
{ ...api.ariaProps, className: cn(presenceContainerStyles, className) },
|
|
10559
|
-
|
|
10722
|
+
React42.createElement("span", {
|
|
10560
10723
|
className: presenceDotVariants({ status, size })
|
|
10561
10724
|
}),
|
|
10562
|
-
api.showLabel &&
|
|
10725
|
+
api.showLabel && React42.createElement("span", { className: presenceLabelStyles }, api.label)
|
|
10563
10726
|
);
|
|
10564
10727
|
}
|
|
10565
10728
|
PresenceIndicator.displayName = "PresenceIndicator";
|
|
@@ -10647,7 +10810,7 @@ var radioCircleVariants = cva({
|
|
|
10647
10810
|
});
|
|
10648
10811
|
|
|
10649
10812
|
// ../react-radio/dist/index.js
|
|
10650
|
-
var RadioContext =
|
|
10813
|
+
var RadioContext = React42.createContext(null);
|
|
10651
10814
|
function RadioGroup({
|
|
10652
10815
|
children,
|
|
10653
10816
|
className,
|
|
@@ -10658,25 +10821,25 @@ function RadioGroup({
|
|
|
10658
10821
|
disabled = false,
|
|
10659
10822
|
orientation = "vertical"
|
|
10660
10823
|
}) {
|
|
10661
|
-
const [internalValue, setInternalValue] =
|
|
10824
|
+
const [internalValue, setInternalValue] = React42.useState(defaultValue);
|
|
10662
10825
|
const isControlled = controlledValue !== void 0;
|
|
10663
10826
|
const currentValue = isControlled ? controlledValue : internalValue;
|
|
10664
10827
|
const api = createRadioGroup({ value: currentValue, name, disabled, orientation });
|
|
10665
|
-
const handleChange =
|
|
10828
|
+
const handleChange = React42.useCallback(
|
|
10666
10829
|
(val) => {
|
|
10667
10830
|
if (!isControlled) setInternalValue(val);
|
|
10668
10831
|
onValueChange?.(val);
|
|
10669
10832
|
},
|
|
10670
10833
|
[isControlled, onValueChange]
|
|
10671
10834
|
);
|
|
10672
|
-
const ctx =
|
|
10835
|
+
const ctx = React42.useMemo(
|
|
10673
10836
|
() => ({ value: currentValue, onValueChange: handleChange, name, disabled }),
|
|
10674
10837
|
[currentValue, handleChange, name, disabled]
|
|
10675
10838
|
);
|
|
10676
|
-
return
|
|
10839
|
+
return React42.createElement(
|
|
10677
10840
|
RadioContext.Provider,
|
|
10678
10841
|
{ value: ctx },
|
|
10679
|
-
|
|
10842
|
+
React42.createElement(
|
|
10680
10843
|
"div",
|
|
10681
10844
|
{ ...api.groupProps, className: cn(radioGroupVariants({ orientation }), className) },
|
|
10682
10845
|
children
|
|
@@ -10684,17 +10847,17 @@ function RadioGroup({
|
|
|
10684
10847
|
);
|
|
10685
10848
|
}
|
|
10686
10849
|
function RadioItem({ value, children, disabled = false, className }) {
|
|
10687
|
-
const ctx =
|
|
10850
|
+
const ctx = React42.useContext(RadioContext);
|
|
10688
10851
|
if (!ctx) throw new Error("RadioItem must be used within RadioGroup");
|
|
10689
10852
|
const isChecked = ctx.value === value;
|
|
10690
10853
|
const isDisabled = ctx.disabled || disabled;
|
|
10691
|
-
return
|
|
10854
|
+
return React42.createElement(
|
|
10692
10855
|
"label",
|
|
10693
10856
|
{
|
|
10694
10857
|
className: cn(radioItemVariants({ disabled: isDisabled ? "true" : "false" }), className),
|
|
10695
10858
|
"data-state": isChecked ? "checked" : "unchecked"
|
|
10696
10859
|
},
|
|
10697
|
-
|
|
10860
|
+
React42.createElement(
|
|
10698
10861
|
"button",
|
|
10699
10862
|
{
|
|
10700
10863
|
type: "button",
|
|
@@ -10706,12 +10869,12 @@ function RadioItem({ value, children, disabled = false, className }) {
|
|
|
10706
10869
|
className: cn(radioCircleVariants({ checked: isChecked ? "true" : "false" })),
|
|
10707
10870
|
onClick: () => !isDisabled && ctx.onValueChange(value)
|
|
10708
10871
|
},
|
|
10709
|
-
isChecked &&
|
|
10872
|
+
isChecked && React42.createElement(
|
|
10710
10873
|
"span",
|
|
10711
10874
|
{ className: "block h-2 w-2 rounded-full bg-primary-foreground mx-auto" }
|
|
10712
10875
|
)
|
|
10713
10876
|
),
|
|
10714
|
-
children &&
|
|
10877
|
+
children && React42.createElement("span", { className: "text-sm" }, children)
|
|
10715
10878
|
);
|
|
10716
10879
|
}
|
|
10717
10880
|
RadioGroup.displayName = "RadioGroup";
|
|
@@ -10783,11 +10946,11 @@ function ReactionBar({
|
|
|
10783
10946
|
className
|
|
10784
10947
|
}) {
|
|
10785
10948
|
const api = createReactionBar({ reactions, onToggle, onAdd });
|
|
10786
|
-
return
|
|
10949
|
+
return React42.createElement(
|
|
10787
10950
|
"div",
|
|
10788
10951
|
{ ...api.ariaProps, className: cn(reactionBarStyles, className) },
|
|
10789
10952
|
api.reactions.map(
|
|
10790
|
-
(reaction, i) =>
|
|
10953
|
+
(reaction, i) => React42.createElement(
|
|
10791
10954
|
"button",
|
|
10792
10955
|
{
|
|
10793
10956
|
key: `${reaction.emoji}-${i}`,
|
|
@@ -10798,11 +10961,11 @@ function ReactionBar({
|
|
|
10798
10961
|
onClick: () => api.toggle(reaction.emoji),
|
|
10799
10962
|
...api.getReactionAriaProps(reaction)
|
|
10800
10963
|
},
|
|
10801
|
-
|
|
10802
|
-
|
|
10964
|
+
React42.createElement("span", { className: reactionEmojiStyles }, reaction.emoji),
|
|
10965
|
+
React42.createElement("span", { className: reactionCountStyles }, reaction.count)
|
|
10803
10966
|
)
|
|
10804
10967
|
),
|
|
10805
|
-
showAddButton &&
|
|
10968
|
+
showAddButton && React42.createElement(
|
|
10806
10969
|
"button",
|
|
10807
10970
|
{
|
|
10808
10971
|
type: "button",
|
|
@@ -10940,7 +11103,7 @@ var selectContentVariants = cva({
|
|
|
10940
11103
|
}
|
|
10941
11104
|
});
|
|
10942
11105
|
var selectItemVariants = cva({
|
|
10943
|
-
base: "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
11106
|
+
base: "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
|
|
10944
11107
|
variants: {
|
|
10945
11108
|
selected: {
|
|
10946
11109
|
true: "bg-accent/50",
|
|
@@ -10951,7 +11114,7 @@ var selectItemVariants = cva({
|
|
|
10951
11114
|
selected: "false"
|
|
10952
11115
|
}
|
|
10953
11116
|
});
|
|
10954
|
-
var SelectContext =
|
|
11117
|
+
var SelectContext = React42.createContext({
|
|
10955
11118
|
value: void 0,
|
|
10956
11119
|
onValueChange: () => {
|
|
10957
11120
|
},
|
|
@@ -10971,7 +11134,7 @@ function Select({
|
|
|
10971
11134
|
children,
|
|
10972
11135
|
placeholder = "Select an option"
|
|
10973
11136
|
}) {
|
|
10974
|
-
const [open, setOpen] =
|
|
11137
|
+
const [open, setOpen] = React42.useState(false);
|
|
10975
11138
|
const api = createSelect({ value, disabled, open, placeholder });
|
|
10976
11139
|
return /* @__PURE__ */ jsx(
|
|
10977
11140
|
SelectContext.Provider,
|
|
@@ -10994,9 +11157,9 @@ function Select({
|
|
|
10994
11157
|
}
|
|
10995
11158
|
);
|
|
10996
11159
|
}
|
|
10997
|
-
var SelectTrigger =
|
|
11160
|
+
var SelectTrigger = React42.forwardRef(
|
|
10998
11161
|
({ className, children, size = "default", ...props }, ref) => {
|
|
10999
|
-
const { open, setOpen, disabled, triggerId, contentId } =
|
|
11162
|
+
const { open, setOpen, disabled, triggerId, contentId } = React42.useContext(SelectContext);
|
|
11000
11163
|
const api = createSelect({ disabled, open });
|
|
11001
11164
|
const handleClick = () => {
|
|
11002
11165
|
if (!disabled) {
|
|
@@ -11053,9 +11216,48 @@ var SelectTrigger = React41.forwardRef(
|
|
|
11053
11216
|
}
|
|
11054
11217
|
);
|
|
11055
11218
|
SelectTrigger.displayName = "SelectTrigger";
|
|
11056
|
-
var SelectContent =
|
|
11057
|
-
({ className, children, ...props },
|
|
11058
|
-
const { open, contentId, triggerId } =
|
|
11219
|
+
var SelectContent = React42.forwardRef(
|
|
11220
|
+
({ className, children, ...props }, forwardedRef) => {
|
|
11221
|
+
const { open, contentId, triggerId, setOpen } = React42.useContext(SelectContext);
|
|
11222
|
+
const containerRef = React42.useRef(null);
|
|
11223
|
+
const ref = React42.useCallback(
|
|
11224
|
+
(node) => {
|
|
11225
|
+
containerRef.current = node;
|
|
11226
|
+
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
11227
|
+
else if (forwardedRef) forwardedRef.current = node;
|
|
11228
|
+
},
|
|
11229
|
+
[forwardedRef]
|
|
11230
|
+
);
|
|
11231
|
+
React42.useEffect(() => {
|
|
11232
|
+
if (open && containerRef.current) {
|
|
11233
|
+
const firstOption = containerRef.current.querySelector('[role="option"]:not([aria-disabled="true"])');
|
|
11234
|
+
if (firstOption) {
|
|
11235
|
+
setTimeout(() => firstOption.focus(), 0);
|
|
11236
|
+
}
|
|
11237
|
+
}
|
|
11238
|
+
}, [open]);
|
|
11239
|
+
const handleKeyDown = (e) => {
|
|
11240
|
+
if (!containerRef.current) return;
|
|
11241
|
+
const options = Array.from(
|
|
11242
|
+
containerRef.current.querySelectorAll('[role="option"]:not([aria-disabled="true"])')
|
|
11243
|
+
);
|
|
11244
|
+
if (!options.length) return;
|
|
11245
|
+
const currentIndex = options.indexOf(document.activeElement);
|
|
11246
|
+
if (e.key === "ArrowDown") {
|
|
11247
|
+
e.preventDefault();
|
|
11248
|
+
const nextIndex = currentIndex < options.length - 1 ? currentIndex + 1 : 0;
|
|
11249
|
+
options[nextIndex]?.focus();
|
|
11250
|
+
} else if (e.key === "ArrowUp") {
|
|
11251
|
+
e.preventDefault();
|
|
11252
|
+
const prevIndex = currentIndex > 0 ? currentIndex - 1 : options.length - 1;
|
|
11253
|
+
options[prevIndex]?.focus();
|
|
11254
|
+
} else if (e.key === "Escape") {
|
|
11255
|
+
e.preventDefault();
|
|
11256
|
+
setOpen(false);
|
|
11257
|
+
const trigger = document.getElementById(triggerId);
|
|
11258
|
+
if (trigger) trigger.focus();
|
|
11259
|
+
}
|
|
11260
|
+
};
|
|
11059
11261
|
if (!open) return null;
|
|
11060
11262
|
return /* @__PURE__ */ jsx(
|
|
11061
11263
|
"div",
|
|
@@ -11066,6 +11268,8 @@ var SelectContent = React41.forwardRef(
|
|
|
11066
11268
|
role: "listbox",
|
|
11067
11269
|
"aria-labelledby": triggerId,
|
|
11068
11270
|
"data-state": open ? "open" : "closed",
|
|
11271
|
+
onKeyDown: handleKeyDown,
|
|
11272
|
+
tabIndex: -1,
|
|
11069
11273
|
...props,
|
|
11070
11274
|
children
|
|
11071
11275
|
}
|
|
@@ -11073,14 +11277,16 @@ var SelectContent = React41.forwardRef(
|
|
|
11073
11277
|
}
|
|
11074
11278
|
);
|
|
11075
11279
|
SelectContent.displayName = "SelectContent";
|
|
11076
|
-
var SelectItem =
|
|
11280
|
+
var SelectItem = React42.forwardRef(
|
|
11077
11281
|
({ className, children, value: itemValue, disabled: itemDisabled = false, ...props }, ref) => {
|
|
11078
|
-
const { value, onValueChange, setOpen } =
|
|
11282
|
+
const { value, onValueChange, setOpen, triggerId } = React42.useContext(SelectContext);
|
|
11079
11283
|
const isSelected = value === itemValue;
|
|
11080
11284
|
const handleClick = () => {
|
|
11081
11285
|
if (!itemDisabled) {
|
|
11082
11286
|
onValueChange(itemValue);
|
|
11083
11287
|
setOpen(false);
|
|
11288
|
+
const trigger = document.getElementById(triggerId);
|
|
11289
|
+
if (trigger) setTimeout(() => trigger.focus(), 0);
|
|
11084
11290
|
}
|
|
11085
11291
|
};
|
|
11086
11292
|
const handleKeyDown = (e) => {
|
|
@@ -11088,6 +11294,8 @@ var SelectItem = React41.forwardRef(
|
|
|
11088
11294
|
e.preventDefault();
|
|
11089
11295
|
onValueChange(itemValue);
|
|
11090
11296
|
setOpen(false);
|
|
11297
|
+
const trigger = document.getElementById(triggerId);
|
|
11298
|
+
if (trigger) setTimeout(() => trigger.focus(), 0);
|
|
11091
11299
|
}
|
|
11092
11300
|
};
|
|
11093
11301
|
return /* @__PURE__ */ jsxs(
|
|
@@ -11207,11 +11415,11 @@ function StatusIndicator({
|
|
|
11207
11415
|
}) {
|
|
11208
11416
|
const api = createStatusIndicator({ type, label, pulse });
|
|
11209
11417
|
const dotClassName = api.pulse ? statusPulseVariants({ type }) : statusDotVariants({ type });
|
|
11210
|
-
return
|
|
11418
|
+
return React42.createElement(
|
|
11211
11419
|
"span",
|
|
11212
11420
|
{ ...api.ariaProps, className: cn(statusContainerStyles, className) },
|
|
11213
|
-
|
|
11214
|
-
showLabel &&
|
|
11421
|
+
React42.createElement("span", { className: dotClassName }),
|
|
11422
|
+
showLabel && React42.createElement("span", { className: statusLabelStyles }, api.label)
|
|
11215
11423
|
);
|
|
11216
11424
|
}
|
|
11217
11425
|
StatusIndicator.displayName = "StatusIndicator";
|
|
@@ -11298,7 +11506,7 @@ var switchThumbVariants = cva({
|
|
|
11298
11506
|
{ checked: "true", size: "lg", class: "translate-x-5" }
|
|
11299
11507
|
]
|
|
11300
11508
|
});
|
|
11301
|
-
var Switch =
|
|
11509
|
+
var Switch = React42.forwardRef(
|
|
11302
11510
|
({ checked = false, onCheckedChange, disabled = false, size = "default", className, ...props }, ref) => {
|
|
11303
11511
|
const api = createSwitch({ checked, disabled });
|
|
11304
11512
|
const handleClick = () => {
|
|
@@ -11437,41 +11645,41 @@ function MessageComponent({
|
|
|
11437
11645
|
message,
|
|
11438
11646
|
api
|
|
11439
11647
|
}) {
|
|
11440
|
-
return
|
|
11648
|
+
return React42.createElement(
|
|
11441
11649
|
"div",
|
|
11442
11650
|
{ className: threadMessageStyles, ...api.getMessageAriaProps(message) },
|
|
11443
11651
|
// Avatar
|
|
11444
|
-
|
|
11652
|
+
React42.createElement(
|
|
11445
11653
|
"div",
|
|
11446
11654
|
{ className: threadAvatarStyles },
|
|
11447
|
-
message.author.avatarUrl ?
|
|
11655
|
+
message.author.avatarUrl ? React42.createElement("img", {
|
|
11448
11656
|
src: message.author.avatarUrl,
|
|
11449
11657
|
alt: message.author.name,
|
|
11450
11658
|
className: "h-full w-full object-cover"
|
|
11451
11659
|
}) : message.author.name.charAt(0).toUpperCase()
|
|
11452
11660
|
),
|
|
11453
11661
|
// Content
|
|
11454
|
-
|
|
11662
|
+
React42.createElement(
|
|
11455
11663
|
"div",
|
|
11456
11664
|
{ className: threadContentStyles },
|
|
11457
|
-
|
|
11665
|
+
React42.createElement(
|
|
11458
11666
|
"div",
|
|
11459
11667
|
{ className: "flex items-baseline" },
|
|
11460
|
-
|
|
11461
|
-
|
|
11668
|
+
React42.createElement("span", { className: threadAuthorStyles }, message.author.name),
|
|
11669
|
+
React42.createElement(
|
|
11462
11670
|
"span",
|
|
11463
11671
|
{ className: threadTimestampStyles },
|
|
11464
11672
|
api.formatTimestamp(message.timestamp)
|
|
11465
11673
|
),
|
|
11466
|
-
message.edited &&
|
|
11674
|
+
message.edited && React42.createElement("span", { className: threadEditedStyles }, "(edited)")
|
|
11467
11675
|
),
|
|
11468
|
-
|
|
11676
|
+
React42.createElement("div", { className: threadBodyStyles }, message.content),
|
|
11469
11677
|
// Reactions
|
|
11470
|
-
message.reactions && message.reactions.length > 0 &&
|
|
11678
|
+
message.reactions && message.reactions.length > 0 && React42.createElement(
|
|
11471
11679
|
"div",
|
|
11472
11680
|
{ className: threadReactionsStyles },
|
|
11473
11681
|
message.reactions.map(
|
|
11474
|
-
(reaction, i) =>
|
|
11682
|
+
(reaction, i) => React42.createElement(
|
|
11475
11683
|
"button",
|
|
11476
11684
|
{
|
|
11477
11685
|
key: `${reaction.emoji}-${i}`,
|
|
@@ -11487,25 +11695,25 @@ function MessageComponent({
|
|
|
11487
11695
|
)
|
|
11488
11696
|
),
|
|
11489
11697
|
// Reply indicator
|
|
11490
|
-
message.replies && message.replies.length > 0 &&
|
|
11698
|
+
message.replies && message.replies.length > 0 && React42.createElement(
|
|
11491
11699
|
"div",
|
|
11492
11700
|
{ className: threadReplyIndicatorStyles },
|
|
11493
11701
|
`${message.replies.length} ${message.replies.length === 1 ? "reply" : "replies"}`
|
|
11494
11702
|
),
|
|
11495
11703
|
// Attachments
|
|
11496
11704
|
message.attachments && message.attachments.map(
|
|
11497
|
-
(attachment) =>
|
|
11705
|
+
(attachment) => React42.createElement(
|
|
11498
11706
|
"div",
|
|
11499
11707
|
{ key: attachment.id, className: threadAttachmentStyles },
|
|
11500
|
-
|
|
11501
|
-
|
|
11708
|
+
React42.createElement("span", null, "\u{1F4CE}"),
|
|
11709
|
+
React42.createElement("span", { className: "truncate" }, attachment.name)
|
|
11502
11710
|
)
|
|
11503
11711
|
),
|
|
11504
11712
|
// Actions (reply button)
|
|
11505
|
-
|
|
11713
|
+
React42.createElement(
|
|
11506
11714
|
"div",
|
|
11507
11715
|
{ className: threadActionsStyles },
|
|
11508
|
-
|
|
11716
|
+
React42.createElement(
|
|
11509
11717
|
"button",
|
|
11510
11718
|
{
|
|
11511
11719
|
type: "button",
|
|
@@ -11527,11 +11735,11 @@ function ThreadView({
|
|
|
11527
11735
|
className
|
|
11528
11736
|
}) {
|
|
11529
11737
|
const api = createThreadView({ messages, onReply, onReact, currentUserId });
|
|
11530
|
-
return
|
|
11738
|
+
return React42.createElement(
|
|
11531
11739
|
"div",
|
|
11532
11740
|
{ ...api.ariaProps, className: cn(threadContainerStyles, className) },
|
|
11533
11741
|
messages.map(
|
|
11534
|
-
(message) =>
|
|
11742
|
+
(message) => React42.createElement(MessageComponent, {
|
|
11535
11743
|
key: message.id,
|
|
11536
11744
|
message,
|
|
11537
11745
|
api
|
|
@@ -11565,11 +11773,11 @@ function observeHeadings(headingIds, callback, options) {
|
|
|
11565
11773
|
});
|
|
11566
11774
|
return () => observer.disconnect();
|
|
11567
11775
|
}
|
|
11568
|
-
var TableOfContents =
|
|
11776
|
+
var TableOfContents = React42.forwardRef(
|
|
11569
11777
|
({ className, containerRef, selectors = "h2, h3, h4", onActiveIdChange, ...props }, ref) => {
|
|
11570
|
-
const [headings, setHeadings] =
|
|
11571
|
-
const [activeId, setActiveId] =
|
|
11572
|
-
|
|
11778
|
+
const [headings, setHeadings] = React42.useState([]);
|
|
11779
|
+
const [activeId, setActiveId] = React42.useState("");
|
|
11780
|
+
React42.useEffect(() => {
|
|
11573
11781
|
const container = containerRef?.current || document.body;
|
|
11574
11782
|
if (!container) return;
|
|
11575
11783
|
const parsedHeadings = parseHeadings(container, selectors);
|
|
@@ -11608,14 +11816,14 @@ var TableOfContents = React41.forwardRef(
|
|
|
11608
11816
|
}
|
|
11609
11817
|
);
|
|
11610
11818
|
TableOfContents.displayName = "TableOfContents";
|
|
11611
|
-
var CarouselContext =
|
|
11612
|
-
var Carousel =
|
|
11819
|
+
var CarouselContext = React42.createContext(null);
|
|
11820
|
+
var Carousel = React42.forwardRef(
|
|
11613
11821
|
({ className, type = "single", collapsible, value: controlledValue, defaultValue, onValueChange, ...props }, ref) => {
|
|
11614
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
11822
|
+
const [uncontrolledValue, setUncontrolledValue] = React42.useState(
|
|
11615
11823
|
defaultValue ?? (type === "multiple" ? [] : "")
|
|
11616
11824
|
);
|
|
11617
11825
|
const value = controlledValue !== void 0 ? controlledValue : uncontrolledValue;
|
|
11618
|
-
const handleValueChange =
|
|
11826
|
+
const handleValueChange = React42.useCallback(
|
|
11619
11827
|
(itemValue) => {
|
|
11620
11828
|
if (type === "single") {
|
|
11621
11829
|
const newValue = value === itemValue && collapsible ? "" : itemValue;
|
|
@@ -11634,20 +11842,20 @@ var Carousel = React41.forwardRef(
|
|
|
11634
11842
|
}
|
|
11635
11843
|
);
|
|
11636
11844
|
Carousel.displayName = "Carousel";
|
|
11637
|
-
var CarouselItemContext =
|
|
11638
|
-
var CarouselItem =
|
|
11845
|
+
var CarouselItemContext = React42.createContext(null);
|
|
11846
|
+
var CarouselItem = React42.forwardRef(
|
|
11639
11847
|
({ className, value, ...props }, ref) => {
|
|
11640
|
-
const context =
|
|
11848
|
+
const context = React42.useContext(CarouselContext);
|
|
11641
11849
|
if (!context) throw new Error("CarouselItem must be within Carousel");
|
|
11642
11850
|
const isOpen = context.type === "single" ? context.value === value : Array.isArray(context.value) && context.value.includes(value);
|
|
11643
11851
|
return /* @__PURE__ */ jsx(CarouselItemContext.Provider, { value: { value, isOpen }, children: /* @__PURE__ */ jsx("div", { ref, className: cn("border-b border-border", className), "data-state": isOpen ? "open" : "closed", ...props }) });
|
|
11644
11852
|
}
|
|
11645
11853
|
);
|
|
11646
11854
|
CarouselItem.displayName = "CarouselItem";
|
|
11647
|
-
var CarouselTrigger =
|
|
11855
|
+
var CarouselTrigger = React42.forwardRef(
|
|
11648
11856
|
({ className, children, ...props }, ref) => {
|
|
11649
|
-
const carouselContext =
|
|
11650
|
-
const itemContext =
|
|
11857
|
+
const carouselContext = React42.useContext(CarouselContext);
|
|
11858
|
+
const itemContext = React42.useContext(CarouselItemContext);
|
|
11651
11859
|
if (!carouselContext || !itemContext) throw new Error("CarouselTrigger missing context");
|
|
11652
11860
|
return /* @__PURE__ */ jsx("h3", { className: "flex m-0 p-0", children: /* @__PURE__ */ jsxs(
|
|
11653
11861
|
"button",
|
|
@@ -11686,9 +11894,9 @@ var CarouselTrigger = React41.forwardRef(
|
|
|
11686
11894
|
}
|
|
11687
11895
|
);
|
|
11688
11896
|
CarouselTrigger.displayName = "CarouselTrigger";
|
|
11689
|
-
var CarouselContent =
|
|
11897
|
+
var CarouselContent = React42.forwardRef(
|
|
11690
11898
|
({ className, children, ...props }, ref) => {
|
|
11691
|
-
const itemContext =
|
|
11899
|
+
const itemContext = React42.useContext(CarouselItemContext);
|
|
11692
11900
|
if (!itemContext) throw new Error("CarouselContent missing context");
|
|
11693
11901
|
return /* @__PURE__ */ jsx(
|
|
11694
11902
|
"div",
|
|
@@ -11707,7 +11915,7 @@ var CarouselContent = React41.forwardRef(
|
|
|
11707
11915
|
}
|
|
11708
11916
|
);
|
|
11709
11917
|
CarouselContent.displayName = "CarouselContent";
|
|
11710
|
-
var Pagination =
|
|
11918
|
+
var Pagination = React42.forwardRef(
|
|
11711
11919
|
({ className, ...props }, ref) => {
|
|
11712
11920
|
return /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props });
|
|
11713
11921
|
}
|
|
@@ -11736,7 +11944,7 @@ function createLinkCard(_props = {}) {
|
|
|
11736
11944
|
dataAttributes: { "data-slot": "link-card" }
|
|
11737
11945
|
};
|
|
11738
11946
|
}
|
|
11739
|
-
var LinkCard =
|
|
11947
|
+
var LinkCard = React42.forwardRef(
|
|
11740
11948
|
({ className, ...props }, ref) => {
|
|
11741
11949
|
const api = createLinkCard(props);
|
|
11742
11950
|
return /* @__PURE__ */ jsx(
|
|
@@ -11758,7 +11966,7 @@ function createCardGrid(_props = {}) {
|
|
|
11758
11966
|
dataAttributes: { "data-slot": "card-grid" }
|
|
11759
11967
|
};
|
|
11760
11968
|
}
|
|
11761
|
-
var CardGrid =
|
|
11969
|
+
var CardGrid = React42.forwardRef(
|
|
11762
11970
|
({ className, columns = 3, ...props }, ref) => {
|
|
11763
11971
|
const api = createCardGrid({ });
|
|
11764
11972
|
return /* @__PURE__ */ jsx(
|
|
@@ -11783,7 +11991,7 @@ function createPayment(props = {}) {
|
|
|
11783
11991
|
}
|
|
11784
11992
|
};
|
|
11785
11993
|
}
|
|
11786
|
-
var Payment =
|
|
11994
|
+
var Payment = React42.forwardRef(
|
|
11787
11995
|
({ className, disabled, ...props }, ref) => {
|
|
11788
11996
|
const api = createPayment({ disabled });
|
|
11789
11997
|
return /* @__PURE__ */ jsx(
|
|
@@ -11802,27 +12010,27 @@ var Payment = React41.forwardRef(
|
|
|
11802
12010
|
}
|
|
11803
12011
|
);
|
|
11804
12012
|
Payment.displayName = "Payment";
|
|
11805
|
-
var PaymentHeader =
|
|
12013
|
+
var PaymentHeader = React42.forwardRef(
|
|
11806
12014
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-6 flex flex-col gap-1.5", className), ...props })
|
|
11807
12015
|
);
|
|
11808
12016
|
PaymentHeader.displayName = "PaymentHeader";
|
|
11809
|
-
var PaymentTitle =
|
|
12017
|
+
var PaymentTitle = React42.forwardRef(
|
|
11810
12018
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx("h3", { ref, className: cn("text-xl font-semibold leading-none tracking-tight", className), ...props })
|
|
11811
12019
|
);
|
|
11812
12020
|
PaymentTitle.displayName = "PaymentTitle";
|
|
11813
|
-
var PaymentDescription =
|
|
12021
|
+
var PaymentDescription = React42.forwardRef(
|
|
11814
12022
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx("p", { ref, className: cn("text-sm text-muted-foreground", className), ...props })
|
|
11815
12023
|
);
|
|
11816
12024
|
PaymentDescription.displayName = "PaymentDescription";
|
|
11817
|
-
var PaymentContent =
|
|
12025
|
+
var PaymentContent = React42.forwardRef(
|
|
11818
12026
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("flex flex-col gap-4", className), ...props })
|
|
11819
12027
|
);
|
|
11820
12028
|
PaymentContent.displayName = "PaymentContent";
|
|
11821
|
-
var PaymentFooter =
|
|
12029
|
+
var PaymentFooter = React42.forwardRef(
|
|
11822
12030
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mt-6 flex flex-col gap-3", className), ...props })
|
|
11823
12031
|
);
|
|
11824
12032
|
PaymentFooter.displayName = "PaymentFooter";
|
|
11825
|
-
var PaymentButton =
|
|
12033
|
+
var PaymentButton = React42.forwardRef(
|
|
11826
12034
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
11827
12035
|
"button",
|
|
11828
12036
|
{
|
|
@@ -11837,6 +12045,6 @@ var PaymentButton = React41.forwardRef(
|
|
|
11837
12045
|
);
|
|
11838
12046
|
PaymentButton.displayName = "PaymentButton";
|
|
11839
12047
|
|
|
11840
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AnimatedText, AppShell, AuthGuard, AuthProvider, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, BadgeDisplay, BottomNav, Breadcrumbs, Button, CATEGORY_LABELS, Calendar, CalendarHeader, Callout, Card2 as Card, CardContent, CardDescription, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselTrigger, Checkbox, CodeBlock, CodeEditor, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, ContentProtection, DataTable, DatePicker, DeviceFrame, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, EMOJI_CATEGORIES, EMOJI_DATA, EmojiPicker, FeedbackButton, FeedbackDialog, FileUpload, Footer, InlineEditor, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InstallPrompt, KeyboardShortcut, LanguageSelector, LinkCard, MarkdownRenderer, MobileNav, MobileNavContent, MobileNavLink, MobileNavTrigger, Navbar, OtpInput, STATUS_COLORS as PRESENCE_STATUS_COLORS, STATUS_LABELS as PRESENCE_STATUS_LABELS, Pagination, Payment, Popover, PopoverClose, PopoverContent, PopoverTrigger, PresenceIndicator, ProgressBar, RadioGroup, RadioItem, ReactionBar, ResizableDivider, ResizableLayout, ResizablePane, STATUS_COLORS2 as STATUS_COLORS, STATUS_LABELS2 as STATUS_LABELS, SearchBar, SearchResultItem, SearchResults, Select, SelectContent, SelectItem, SelectTrigger, ShortcutBadge, Sidebar, Skeleton, SkeletonText, SkipToContent, SlideViewer, StatsGrid, StatusIndicator, Steps, Switch, TableOfContents, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, ThemeScript, ThemeToggle, ThreadView, Toast, ToastProvider, Toaster, Tooltip, TooltipContent, TooltipTrigger, TypewriterText, VersionSelector, VideoPlayer, animatedTextVariants, avatarFallbackVariants, avatarImageVariants, avatarTokens, avatarVariants, badgeGridVariants, badgeItemVariants, badgeVariants, bottomNavTabVariants, bottomNavVariants, breadcrumbItemVariants, breadcrumbSeparatorStyles, breadcrumbsVariants, buttonTokens, buttonVariants, calendarVariants, canAccessAdmin, canAccessReviewer, cardContentVariants, cardDescriptionVariants, cardFooterVariants, cardHeaderVariants, cardTitleVariants, cardTokens, cardVariants, cellVariants, checkIconPath, checkboxTokens, checkboxVariants, codeEditorTokens, codeEditorVariants, collapsibleContentVariants, commandGroupVariants, commandInputVariants, commandItemVariants, commandVariants, contentProtectionVariants, controlsVariants, dayVariants, deviceFrameVariants, dialogContentVariants, editorVariants, emojiPickerContainerStyles, emojiPickerEmojiButtonStyles, emojiPickerGridStyles, feedbackDialogVariants, fileUploadDropZoneVariants, fileUploadFileItemStyles, fileUploadFileListStyles, footerVariants, formatFileSize, formatRelativeTime, formatShortcut, formatTimestamp, getAssignableRoles, getDefaultPortal, getInitials, hasAllRoles, hasAnyRole, hasRole, headerVariants, indeterminateIconPath, inputGroupAddonVariants, inputGroupButtonVariants, inputGroupTokens, inputGroupVariants, inputVariants, installPromptVariants, latestBadgeVariants, markdownRendererTokens, menuContentVariants, menuItemVariants, mobileNavContentVariants, mobileNavLinkVariants, mobileNavTokens, mobileNavTriggerVariants, mobileNavVariants, navLinkVariants, navbarVariants, optionVariants, otpInputContainerVariants, otpInputSlotVariants, otpInputTokens, overlayStyles, overlayVariants, playerVariants, popoverContentVariants, previewVariants, progressBarVariants, proseVariants, radioCircleVariants, radioGroupVariants, radioItemVariants, reactionAddButtonStyles, reactionBarStyles, reactionCountStyles, reactionEmojiStyles, reactionPillVariants, resizableDividerVariants, resizableLayoutTokens, resizableLayoutVariants, resizablePaneVariants, rowVariants, searchBarVariants, searchResultVariants, selectContentVariants, selectItemVariants, selectTokens, selectTriggerVariants, selectorVariants, shortcutBadgeStyles, shortcutKeyStyles, shortcutSeparatorStyles, sidebarItemVariants, sidebarVariants, skeletonVariants, slideTypeBadgeVariants, progressBarVariants2 as slideViewerProgressBarVariants, slideViewerTokens, slideViewerVariants, statCardVariants, statsGridVariants, statusContainerStyles, statusDotVariants, statusLabelStyles, statusPulseVariants, switchThumbVariants, switchTokens, switchVariants, tableVariants, tabsListVariants, tabsTriggerVariants, textareaVariants, threadAuthorStyles, threadAvatarStyles, threadBodyStyles, threadContainerStyles, threadContentStyles, threadMessageStyles, threadReactionsStyles, threadTimestampStyles, toastVariants, toolbarVariants, tooltipContentVariants, typewriterVariants, useAuth, useTheme, useToast, optionVariants2 as versionSelectorOptionVariants, versionSelectorVariants, watermarkVariants };
|
|
12048
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, AltHintState, AnimatedText, AppShell, AuthGuard, AuthProvider, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, BadgeDisplay, BottomNav, Breadcrumbs, Button, CATEGORY_LABELS, Calendar, CalendarHeader, Callout, Card2 as Card, CardContent, CardDescription, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselTrigger, Checkbox, CodeBlock, CodeEditor, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, ContentProtection, DataTable, DatePicker, DeviceFrame, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, EMOJI_CATEGORIES, EMOJI_DATA, EmojiPicker, FeedbackButton, FeedbackDialog, FileUpload, Footer, InlineEditor, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InstallPrompt, KeyboardShortcut, LanguageSelector, LinkCard, MarkdownRenderer, MobileNav, MobileNavContent, MobileNavLink, MobileNavTrigger, Navbar, OtpInput, STATUS_COLORS as PRESENCE_STATUS_COLORS, STATUS_LABELS as PRESENCE_STATUS_LABELS, Pagination, Payment, Popover, PopoverClose, PopoverContent, PopoverTrigger, PresenceIndicator, ProgressBar, RadioGroup, RadioItem, ReactionBar, ResizableDivider, ResizableLayout, ResizablePane, SANE_DEFAULTS, STATUS_COLORS2 as STATUS_COLORS, STATUS_LABELS2 as STATUS_LABELS, SearchBar, SearchResultItem, SearchResults, Select, SelectContent, SelectItem, SelectTrigger, ShortcutBadge, ShortcutContext, ShortcutHint, ShortcutProvider, ShortcutRegistry, Sidebar, Skeleton, SkeletonText, SkipToContent, SlideViewer, StatsGrid, StatusIndicator, Steps, Switch, TableOfContents, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, ThemeScript, ThemeToggle, ThreadView, Toast, ToastProvider, Toaster, Tooltip, TooltipContent, TooltipTrigger, TypewriterText, VersionSelector, VideoPlayer, altHintState, animatedTextVariants, avatarFallbackVariants, avatarImageVariants, avatarTokens, avatarVariants, badgeGridVariants, badgeItemVariants, badgeVariants, bottomNavTabVariants, bottomNavVariants, breadcrumbItemVariants, breadcrumbSeparatorStyles, breadcrumbsVariants, buttonTokens, buttonVariants, calendarVariants, canAccessAdmin, canAccessReviewer, cardContentVariants, cardDescriptionVariants, cardFooterVariants, cardHeaderVariants, cardTitleVariants, cardTokens, cardVariants, cellVariants, checkIconPath, checkboxTokens, checkboxVariants, codeEditorTokens, codeEditorVariants, collapsibleContentVariants, commandGroupVariants, commandInputVariants, commandItemVariants, commandVariants, contentProtectionVariants, controlsVariants, dayVariants, deviceFrameVariants, dialogContentVariants, editorVariants, emojiPickerContainerStyles, emojiPickerEmojiButtonStyles, emojiPickerGridStyles, feedbackDialogVariants, fileUploadDropZoneVariants, fileUploadFileItemStyles, fileUploadFileListStyles, footerVariants, formatFileSize, formatRelativeTime, formatShortcut, formatTimestamp, getAssignableRoles, getDefaultPortal, getInitials, globalShortcutRegistry, hasAllRoles, hasAnyRole, hasRole, headerVariants, indeterminateIconPath, inputGroupAddonVariants, inputGroupButtonVariants, inputGroupTokens, inputGroupVariants, inputVariants, installPromptVariants, latestBadgeVariants, markdownRendererTokens, menuContentVariants, menuItemVariants, mobileNavContentVariants, mobileNavLinkVariants, mobileNavTokens, mobileNavTriggerVariants, mobileNavVariants, navLinkVariants, navbarVariants, optionVariants, otpInputContainerVariants, otpInputSlotVariants, otpInputTokens, overlayStyles, overlayVariants, playerVariants, popoverContentVariants, previewVariants, progressBarVariants, proseVariants, radioCircleVariants, radioGroupVariants, radioItemVariants, reactionAddButtonStyles, reactionBarStyles, reactionCountStyles, reactionEmojiStyles, reactionPillVariants, resizableDividerVariants, resizableLayoutTokens, resizableLayoutVariants, resizablePaneVariants, rowVariants, searchBarVariants, searchResultVariants, selectContentVariants, selectItemVariants, selectTokens, selectTriggerVariants, selectorVariants, shortcutBadgeStyles, shortcutKeyStyles, shortcutSeparatorStyles, sidebarItemVariants, sidebarVariants, skeletonVariants, slideTypeBadgeVariants, progressBarVariants2 as slideViewerProgressBarVariants, slideViewerTokens, slideViewerVariants, statCardVariants, statsGridVariants, statusContainerStyles, statusDotVariants, statusLabelStyles, statusPulseVariants, switchThumbVariants, switchTokens, switchVariants, tableVariants, tabsListVariants, tabsTriggerVariants, textareaVariants, threadAuthorStyles, threadAvatarStyles, threadBodyStyles, threadContainerStyles, threadContentStyles, threadMessageStyles, threadReactionsStyles, threadTimestampStyles, toastVariants, toolbarVariants, tooltipContentVariants, typewriterVariants, useAuth, useShortcut, useTheme, useToast, optionVariants2 as versionSelectorOptionVariants, versionSelectorVariants, watermarkVariants };
|
|
11841
12049
|
//# sourceMappingURL=index.js.map
|
|
11842
12050
|
//# sourceMappingURL=index.js.map
|