@underverse-ui/underverse 1.0.94 → 1.0.96
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/api-reference.json +1 -1
- package/dist/index.cjs +217 -138
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +227 -148
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -465,7 +465,7 @@ declare const ToastProvider: React__default.FC<ToastProviderProps>;
|
|
|
465
465
|
|
|
466
466
|
type Side = "top" | "right" | "bottom" | "left";
|
|
467
467
|
type TooltipPlacement = Side;
|
|
468
|
-
|
|
468
|
+
declare const Tooltip: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLElement>, "children" | "content"> & {
|
|
469
469
|
children: React$1.ReactElement;
|
|
470
470
|
content: React$1.ReactNode;
|
|
471
471
|
placement?: TooltipPlacement;
|
|
@@ -478,8 +478,7 @@ interface TooltipProps {
|
|
|
478
478
|
variant?: "default" | "info" | "warning" | "error" | "success";
|
|
479
479
|
/** When true, augment the child directly instead of adding a wrapper. Default: true */
|
|
480
480
|
asChild?: boolean;
|
|
481
|
-
}
|
|
482
|
-
declare const Tooltip: React$1.FC<TooltipProps>;
|
|
481
|
+
} & React$1.RefAttributes<HTMLElement>>;
|
|
483
482
|
|
|
484
483
|
type PopoverPlacement = "top" | "bottom" | "left" | "right" | "top-start" | "bottom-start" | "top-end" | "bottom-end";
|
|
485
484
|
interface PopoverProps {
|
|
@@ -612,6 +611,9 @@ interface Tab {
|
|
|
612
611
|
className?: string;
|
|
613
612
|
}>;
|
|
614
613
|
disabled?: boolean;
|
|
614
|
+
href?: string;
|
|
615
|
+
target?: React$1.HTMLAttributeAnchorTarget;
|
|
616
|
+
rel?: string;
|
|
615
617
|
}
|
|
616
618
|
interface TabsProps {
|
|
617
619
|
tabs: Tab[];
|
package/dist/index.d.ts
CHANGED
|
@@ -465,7 +465,7 @@ declare const ToastProvider: React__default.FC<ToastProviderProps>;
|
|
|
465
465
|
|
|
466
466
|
type Side = "top" | "right" | "bottom" | "left";
|
|
467
467
|
type TooltipPlacement = Side;
|
|
468
|
-
|
|
468
|
+
declare const Tooltip: React$1.ForwardRefExoticComponent<Omit<React$1.HTMLAttributes<HTMLElement>, "children" | "content"> & {
|
|
469
469
|
children: React$1.ReactElement;
|
|
470
470
|
content: React$1.ReactNode;
|
|
471
471
|
placement?: TooltipPlacement;
|
|
@@ -478,8 +478,7 @@ interface TooltipProps {
|
|
|
478
478
|
variant?: "default" | "info" | "warning" | "error" | "success";
|
|
479
479
|
/** When true, augment the child directly instead of adding a wrapper. Default: true */
|
|
480
480
|
asChild?: boolean;
|
|
481
|
-
}
|
|
482
|
-
declare const Tooltip: React$1.FC<TooltipProps>;
|
|
481
|
+
} & React$1.RefAttributes<HTMLElement>>;
|
|
483
482
|
|
|
484
483
|
type PopoverPlacement = "top" | "bottom" | "left" | "right" | "top-start" | "bottom-start" | "top-end" | "bottom-end";
|
|
485
484
|
interface PopoverProps {
|
|
@@ -612,6 +611,9 @@ interface Tab {
|
|
|
612
611
|
className?: string;
|
|
613
612
|
}>;
|
|
614
613
|
disabled?: boolean;
|
|
614
|
+
href?: string;
|
|
615
|
+
target?: React$1.HTMLAttributeAnchorTarget;
|
|
616
|
+
rel?: string;
|
|
615
617
|
}
|
|
616
618
|
interface TabsProps {
|
|
617
619
|
tabs: Tab[];
|
package/dist/index.js
CHANGED
|
@@ -2745,20 +2745,10 @@ function useHydrated() {
|
|
|
2745
2745
|
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
2746
2746
|
}
|
|
2747
2747
|
|
|
2748
|
-
// src/
|
|
2749
|
-
|
|
2750
|
-
var variantStyles2 = {
|
|
2751
|
-
default: "bg-popover text-popover-foreground border-border/50",
|
|
2752
|
-
info: "bg-info text-info-foreground border-info/20",
|
|
2753
|
-
warning: "bg-warning text-warning-foreground border-warning/20",
|
|
2754
|
-
error: "bg-destructive text-destructive-foreground border-destructive/20",
|
|
2755
|
-
success: "bg-success text-success-foreground border-success/20"
|
|
2756
|
-
};
|
|
2757
|
-
var clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
|
2758
|
-
function composeEventHandlers(theirHandler, ourHandler) {
|
|
2748
|
+
// src/utils/react-compose.ts
|
|
2749
|
+
function chainEventHandlers(...handlers) {
|
|
2759
2750
|
return (event) => {
|
|
2760
|
-
|
|
2761
|
-
ourHandler(event);
|
|
2751
|
+
handlers.forEach((handler) => handler?.(event));
|
|
2762
2752
|
};
|
|
2763
2753
|
}
|
|
2764
2754
|
function setRefValue(ref, value) {
|
|
@@ -2774,6 +2764,17 @@ function mergeRefs(...refs) {
|
|
|
2774
2764
|
refs.forEach((ref) => setRefValue(ref, value));
|
|
2775
2765
|
};
|
|
2776
2766
|
}
|
|
2767
|
+
|
|
2768
|
+
// src/components/Tooltip.tsx
|
|
2769
|
+
import { Fragment as Fragment2, jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2770
|
+
var variantStyles2 = {
|
|
2771
|
+
default: "bg-popover text-popover-foreground border-border/50",
|
|
2772
|
+
info: "bg-info text-info-foreground border-info/20",
|
|
2773
|
+
warning: "bg-warning text-warning-foreground border-warning/20",
|
|
2774
|
+
error: "bg-destructive text-destructive-foreground border-destructive/20",
|
|
2775
|
+
success: "bg-success text-success-foreground border-success/20"
|
|
2776
|
+
};
|
|
2777
|
+
var clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
|
2777
2778
|
function getTransformOrigin(side) {
|
|
2778
2779
|
switch (side) {
|
|
2779
2780
|
case "top":
|
|
@@ -2818,7 +2819,7 @@ function computeTooltipPosition(args) {
|
|
|
2818
2819
|
top = clamp(top, padding, viewport.height - contentSize.height - padding);
|
|
2819
2820
|
return { top, left, side };
|
|
2820
2821
|
}
|
|
2821
|
-
var Tooltip = ({
|
|
2822
|
+
var Tooltip = React9.forwardRef(({
|
|
2822
2823
|
children,
|
|
2823
2824
|
content,
|
|
2824
2825
|
placement = "top",
|
|
@@ -2826,8 +2827,9 @@ var Tooltip = ({
|
|
|
2826
2827
|
className,
|
|
2827
2828
|
disabled = false,
|
|
2828
2829
|
variant = "default",
|
|
2829
|
-
asChild = true
|
|
2830
|
-
|
|
2830
|
+
asChild = true,
|
|
2831
|
+
...triggerPassthroughProps
|
|
2832
|
+
}, forwardedRef) => {
|
|
2831
2833
|
const [isOpen, setIsOpen] = React9.useState(false);
|
|
2832
2834
|
const isMounted = useHydrated();
|
|
2833
2835
|
const triggerRef = React9.useRef(null);
|
|
@@ -2942,31 +2944,53 @@ var Tooltip = ({
|
|
|
2942
2944
|
if (panelRef.current) ro.observe(panelRef.current);
|
|
2943
2945
|
return () => ro.disconnect();
|
|
2944
2946
|
}, [isOpen, updatePosition]);
|
|
2947
|
+
const childProps = children.props;
|
|
2948
|
+
const childRef = childProps.ref;
|
|
2949
|
+
const passthroughRef = mergeRefs(forwardedRef, childRef, (node) => {
|
|
2950
|
+
triggerRef.current = node;
|
|
2951
|
+
});
|
|
2945
2952
|
if (disabled || !content) {
|
|
2946
|
-
return children;
|
|
2953
|
+
if (!asChild) return children;
|
|
2954
|
+
return React9.cloneElement(children, {
|
|
2955
|
+
...triggerPassthroughProps,
|
|
2956
|
+
ref: passthroughRef
|
|
2957
|
+
});
|
|
2947
2958
|
}
|
|
2948
|
-
const childProps = children.props;
|
|
2949
|
-
const childRef = children.ref ?? childProps.ref;
|
|
2950
2959
|
const triggerProps = {
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
}),
|
|
2960
|
+
...triggerPassthroughProps,
|
|
2961
|
+
ref: passthroughRef,
|
|
2954
2962
|
"data-underverse-tooltip-trigger": triggerSelector,
|
|
2955
|
-
onMouseEnter:
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2963
|
+
onMouseEnter: chainEventHandlers(
|
|
2964
|
+
triggerPassthroughProps.onMouseEnter,
|
|
2965
|
+
childProps.onMouseEnter,
|
|
2966
|
+
(e) => {
|
|
2967
|
+
triggerRef.current = e.currentTarget;
|
|
2968
|
+
handleMouseEnter();
|
|
2969
|
+
}
|
|
2970
|
+
),
|
|
2971
|
+
onMouseLeave: chainEventHandlers(
|
|
2972
|
+
triggerPassthroughProps.onMouseLeave,
|
|
2973
|
+
childProps.onMouseLeave,
|
|
2974
|
+
(e) => {
|
|
2975
|
+
triggerRef.current = e.currentTarget;
|
|
2976
|
+
handleMouseLeave();
|
|
2977
|
+
}
|
|
2978
|
+
),
|
|
2979
|
+
onFocus: chainEventHandlers(
|
|
2980
|
+
triggerPassthroughProps.onFocus,
|
|
2981
|
+
childProps.onFocus,
|
|
2982
|
+
(e) => {
|
|
2983
|
+
triggerRef.current = e.currentTarget;
|
|
2984
|
+
handleFocus();
|
|
2985
|
+
}
|
|
2986
|
+
),
|
|
2987
|
+
onBlur: chainEventHandlers(
|
|
2988
|
+
triggerPassthroughProps.onBlur,
|
|
2989
|
+
childProps.onBlur,
|
|
2990
|
+
(e) => {
|
|
2991
|
+
handleBlur();
|
|
2992
|
+
}
|
|
2993
|
+
)
|
|
2970
2994
|
};
|
|
2971
2995
|
const trigger = asChild ? React9.cloneElement(children, triggerProps) : /* @__PURE__ */ jsx10("span", { ...triggerProps, children });
|
|
2972
2996
|
return /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
@@ -3010,7 +3034,8 @@ var Tooltip = ({
|
|
|
3010
3034
|
document.body
|
|
3011
3035
|
)
|
|
3012
3036
|
] });
|
|
3013
|
-
};
|
|
3037
|
+
});
|
|
3038
|
+
Tooltip.displayName = "Tooltip";
|
|
3014
3039
|
|
|
3015
3040
|
// src/components/emoji-ui.tsx
|
|
3016
3041
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
@@ -3978,10 +4003,10 @@ var EmojiPicker = ({
|
|
|
3978
4003
|
var EmojiPicker_default = EmojiPicker;
|
|
3979
4004
|
|
|
3980
4005
|
// src/components/TagInput.tsx
|
|
3981
|
-
import { forwardRef as
|
|
4006
|
+
import { forwardRef as forwardRef5, useState as useState7, useRef as useRef5, useId as useId3 } from "react";
|
|
3982
4007
|
import { X as X3, Search as Search3, Loader2 as Loader22 } from "lucide-react";
|
|
3983
4008
|
import { jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3984
|
-
var TagInput =
|
|
4009
|
+
var TagInput = forwardRef5(
|
|
3985
4010
|
({
|
|
3986
4011
|
value = [],
|
|
3987
4012
|
onChange,
|
|
@@ -5935,36 +5960,32 @@ var Popover = ({
|
|
|
5935
5960
|
) : null;
|
|
5936
5961
|
return /* @__PURE__ */ jsxs15(Fragment4, { children: [
|
|
5937
5962
|
(() => {
|
|
5938
|
-
const TriggerComponent = trigger.type;
|
|
5939
5963
|
const triggerProps = trigger.props;
|
|
5940
|
-
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5964
|
+
const childRef = triggerProps.ref;
|
|
5965
|
+
return React18.cloneElement(trigger, {
|
|
5966
|
+
...triggerProps,
|
|
5967
|
+
ref: mergeRefs(childRef, (node) => {
|
|
5968
|
+
triggerRef.current = node;
|
|
5969
|
+
}),
|
|
5970
|
+
"data-underverse-popover-trigger": triggerSelector,
|
|
5971
|
+
onClick: chainEventHandlers(
|
|
5972
|
+
(e) => {
|
|
5946
5973
|
triggerRef.current = e.currentTarget;
|
|
5947
5974
|
e.preventDefault();
|
|
5948
5975
|
e.stopPropagation();
|
|
5949
5976
|
handleTriggerClick();
|
|
5950
|
-
if (typeof triggerProps.onClick === "function") {
|
|
5951
|
-
triggerProps.onClick(e);
|
|
5952
|
-
}
|
|
5953
5977
|
},
|
|
5954
|
-
|
|
5978
|
+
triggerProps.onClick
|
|
5979
|
+
),
|
|
5980
|
+
onFocus: chainEventHandlers(
|
|
5981
|
+
(e) => {
|
|
5955
5982
|
triggerRef.current = e.currentTarget;
|
|
5956
|
-
if (typeof triggerProps.onFocus === "function") {
|
|
5957
|
-
triggerProps.onFocus(e);
|
|
5958
|
-
}
|
|
5959
5983
|
},
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
)
|
|
5966
|
-
}
|
|
5967
|
-
);
|
|
5984
|
+
triggerProps.onFocus
|
|
5985
|
+
),
|
|
5986
|
+
"aria-expanded": isOpen,
|
|
5987
|
+
"aria-haspopup": triggerProps["aria-haspopup"] ?? "dialog"
|
|
5988
|
+
});
|
|
5968
5989
|
})(),
|
|
5969
5990
|
popoverContent
|
|
5970
5991
|
] });
|
|
@@ -6587,6 +6608,32 @@ var variantStyles5 = {
|
|
|
6587
6608
|
inactiveTab: "text-muted-foreground hover:text-foreground"
|
|
6588
6609
|
}
|
|
6589
6610
|
};
|
|
6611
|
+
function getTabsBaseId(tabs) {
|
|
6612
|
+
const key = tabs.map((t) => t.value).join("-");
|
|
6613
|
+
return `tabs-${key || "default"}`;
|
|
6614
|
+
}
|
|
6615
|
+
function getTabTriggerId(baseId, index) {
|
|
6616
|
+
return `${baseId}-tab-${index}`;
|
|
6617
|
+
}
|
|
6618
|
+
function getTabPanelId(baseId, index) {
|
|
6619
|
+
return `${baseId}-panel-${index}`;
|
|
6620
|
+
}
|
|
6621
|
+
function getTabHref(tab, panelId) {
|
|
6622
|
+
return tab.href ?? `#${panelId}`;
|
|
6623
|
+
}
|
|
6624
|
+
function resolveTabValueFromHash(hash, tabs, baseId) {
|
|
6625
|
+
const normalizedHash = hash.replace(/^#/, "");
|
|
6626
|
+
if (!normalizedHash) return null;
|
|
6627
|
+
const matchIndex = tabs.findIndex((tab, index) => {
|
|
6628
|
+
const tabId = getTabTriggerId(baseId, index);
|
|
6629
|
+
const panelId = getTabPanelId(baseId, index);
|
|
6630
|
+
return normalizedHash === tabId || normalizedHash === panelId;
|
|
6631
|
+
});
|
|
6632
|
+
return matchIndex >= 0 ? tabs[matchIndex]?.value ?? null : null;
|
|
6633
|
+
}
|
|
6634
|
+
function shouldHandleTabClickLocally(event, target) {
|
|
6635
|
+
return !(event.metaKey || event.ctrlKey || event.shiftKey || event.altKey || target === "_blank");
|
|
6636
|
+
}
|
|
6590
6637
|
var Tabs = ({
|
|
6591
6638
|
tabs,
|
|
6592
6639
|
defaultValue,
|
|
@@ -6604,14 +6651,33 @@ var Tabs = ({
|
|
|
6604
6651
|
const [active, setActive] = React22.useState(defaultValue || tabs[0]?.value);
|
|
6605
6652
|
const [underlineStyle, setUnderlineStyle] = React22.useState({});
|
|
6606
6653
|
const tabRefs = React22.useRef([]);
|
|
6607
|
-
const baseId = React22.useMemo(() =>
|
|
6608
|
-
const key = tabs.map((t) => t.value).join("-");
|
|
6609
|
-
return `tabs-${key || "default"}`;
|
|
6610
|
-
}, [tabs]);
|
|
6654
|
+
const baseId = React22.useMemo(() => getTabsBaseId(tabs), [tabs]);
|
|
6611
6655
|
const handleTabChange = (value) => {
|
|
6612
6656
|
setActive(value);
|
|
6613
6657
|
onTabChange?.(value);
|
|
6614
6658
|
};
|
|
6659
|
+
const handleTabKeyDown = (event) => {
|
|
6660
|
+
const count = tabs.length;
|
|
6661
|
+
const idx = tabs.findIndex((t) => t.value === active);
|
|
6662
|
+
let next = idx;
|
|
6663
|
+
if (orientation === "horizontal") {
|
|
6664
|
+
if (event.key === "ArrowRight") next = (idx + 1) % count;
|
|
6665
|
+
if (event.key === "ArrowLeft") next = (idx - 1 + count) % count;
|
|
6666
|
+
} else {
|
|
6667
|
+
if (event.key === "ArrowDown") next = (idx + 1) % count;
|
|
6668
|
+
if (event.key === "ArrowUp") next = (idx - 1 + count) % count;
|
|
6669
|
+
}
|
|
6670
|
+
if (event.key === "Home") next = 0;
|
|
6671
|
+
if (event.key === "End") next = count - 1;
|
|
6672
|
+
if (next !== idx) {
|
|
6673
|
+
event.preventDefault();
|
|
6674
|
+
const nextTab = tabs[next];
|
|
6675
|
+
if (!nextTab?.disabled) {
|
|
6676
|
+
handleTabChange(nextTab.value);
|
|
6677
|
+
}
|
|
6678
|
+
tabRefs.current[next]?.focus();
|
|
6679
|
+
}
|
|
6680
|
+
};
|
|
6615
6681
|
React22.useEffect(() => {
|
|
6616
6682
|
if (variant === "underline" && orientation === "horizontal") {
|
|
6617
6683
|
const activeIndex2 = tabs.findIndex((tab) => tab.value === active);
|
|
@@ -6625,6 +6691,18 @@ var Tabs = ({
|
|
|
6625
6691
|
}
|
|
6626
6692
|
}
|
|
6627
6693
|
}, [active, variant, orientation, tabs]);
|
|
6694
|
+
React22.useEffect(() => {
|
|
6695
|
+
if (typeof window === "undefined") return;
|
|
6696
|
+
const syncFromHash = () => {
|
|
6697
|
+
const nextValue = resolveTabValueFromHash(window.location.hash, tabs, baseId);
|
|
6698
|
+
if (nextValue) {
|
|
6699
|
+
setActive(nextValue);
|
|
6700
|
+
}
|
|
6701
|
+
};
|
|
6702
|
+
syncFromHash();
|
|
6703
|
+
window.addEventListener("hashchange", syncFromHash);
|
|
6704
|
+
return () => window.removeEventListener("hashchange", syncFromHash);
|
|
6705
|
+
}, [baseId, tabs]);
|
|
6628
6706
|
const containerClasses = cn(
|
|
6629
6707
|
"relative",
|
|
6630
6708
|
orientation === "horizontal" ? "w-full flex space-x-1 overflow-x-auto" : "flex flex-col space-y-1 shrink-0",
|
|
@@ -6647,59 +6725,69 @@ var Tabs = ({
|
|
|
6647
6725
|
tabs.map((tab, index) => {
|
|
6648
6726
|
const isActive = active === tab.value;
|
|
6649
6727
|
const Icon = tab.icon;
|
|
6650
|
-
const tabId2 =
|
|
6651
|
-
const panelId2 =
|
|
6728
|
+
const tabId2 = getTabTriggerId(baseId, index);
|
|
6729
|
+
const panelId2 = getTabPanelId(baseId, index);
|
|
6730
|
+
const tabHref = getTabHref(tab, panelId2);
|
|
6731
|
+
const sharedClassName = cn(
|
|
6732
|
+
"font-medium transition-all duration-200 cursor-pointer flex items-center gap-2",
|
|
6733
|
+
"focus:outline-none focus-visible:outline-none",
|
|
6734
|
+
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
6735
|
+
sizeStyles6[size].tab,
|
|
6736
|
+
variantStyles5[variant].tab,
|
|
6737
|
+
isActive ? variantStyles5[variant].activeTab : variantStyles5[variant].inactiveTab,
|
|
6738
|
+
orientation === "vertical" && "justify-start w-full",
|
|
6739
|
+
stretch && orientation === "horizontal" && "flex-1 justify-center",
|
|
6740
|
+
tab.href && tab.disabled && "pointer-events-none cursor-not-allowed opacity-50"
|
|
6741
|
+
);
|
|
6742
|
+
const sharedStyle = {
|
|
6743
|
+
boxShadow: "none",
|
|
6744
|
+
transform: "none",
|
|
6745
|
+
outline: "none",
|
|
6746
|
+
border: "none"
|
|
6747
|
+
};
|
|
6748
|
+
const sharedProps = {
|
|
6749
|
+
ref: (el) => {
|
|
6750
|
+
tabRefs.current[index] = el;
|
|
6751
|
+
},
|
|
6752
|
+
id: tabId2,
|
|
6753
|
+
role: "tab",
|
|
6754
|
+
"aria-selected": isActive,
|
|
6755
|
+
"aria-controls": panelId2,
|
|
6756
|
+
tabIndex: isActive ? 0 : -1,
|
|
6757
|
+
className: sharedClassName,
|
|
6758
|
+
style: sharedStyle,
|
|
6759
|
+
onKeyDown: handleTabKeyDown
|
|
6760
|
+
};
|
|
6761
|
+
if (!tab.disabled) {
|
|
6762
|
+
return /* @__PURE__ */ jsxs20(
|
|
6763
|
+
"a",
|
|
6764
|
+
{
|
|
6765
|
+
...sharedProps,
|
|
6766
|
+
href: tabHref,
|
|
6767
|
+
target: tab.target,
|
|
6768
|
+
rel: tab.rel,
|
|
6769
|
+
onClick: (event) => {
|
|
6770
|
+
if (shouldHandleTabClickLocally(event, tab.target)) {
|
|
6771
|
+
event.preventDefault();
|
|
6772
|
+
handleTabChange(tab.value);
|
|
6773
|
+
}
|
|
6774
|
+
},
|
|
6775
|
+
className: cn(sharedClassName, "no-underline"),
|
|
6776
|
+
children: [
|
|
6777
|
+
Icon && /* @__PURE__ */ jsx27(Icon, { className: "h-4 w-4" }),
|
|
6778
|
+
tab.label
|
|
6779
|
+
]
|
|
6780
|
+
},
|
|
6781
|
+
tab.value
|
|
6782
|
+
);
|
|
6783
|
+
}
|
|
6652
6784
|
return /* @__PURE__ */ jsxs20(
|
|
6653
6785
|
"button",
|
|
6654
6786
|
{
|
|
6655
|
-
|
|
6656
|
-
tabRefs.current[index] = el;
|
|
6657
|
-
},
|
|
6787
|
+
...sharedProps,
|
|
6658
6788
|
onClick: () => !tab.disabled && handleTabChange(tab.value),
|
|
6659
6789
|
disabled: tab.disabled,
|
|
6660
|
-
|
|
6661
|
-
boxShadow: "none",
|
|
6662
|
-
transform: "none",
|
|
6663
|
-
outline: "none",
|
|
6664
|
-
border: "none"
|
|
6665
|
-
},
|
|
6666
|
-
className: cn(
|
|
6667
|
-
"font-medium transition-all duration-200 cursor-pointer flex items-center gap-2",
|
|
6668
|
-
"focus:outline-none focus-visible:outline-none",
|
|
6669
|
-
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
6670
|
-
"border-0 bg-transparent outline-none",
|
|
6671
|
-
// Reset button default styles
|
|
6672
|
-
sizeStyles6[size].tab,
|
|
6673
|
-
variantStyles5[variant].tab,
|
|
6674
|
-
isActive ? variantStyles5[variant].activeTab : variantStyles5[variant].inactiveTab,
|
|
6675
|
-
orientation === "vertical" && "justify-start w-full",
|
|
6676
|
-
stretch && orientation === "horizontal" && "flex-1 justify-center"
|
|
6677
|
-
),
|
|
6678
|
-
role: "tab",
|
|
6679
|
-
id: tabId2,
|
|
6680
|
-
"aria-selected": isActive,
|
|
6681
|
-
"aria-controls": panelId2,
|
|
6682
|
-
tabIndex: isActive ? 0 : -1,
|
|
6683
|
-
onKeyDown: (e) => {
|
|
6684
|
-
const count = tabs.length;
|
|
6685
|
-
const idx = tabs.findIndex((t) => t.value === active);
|
|
6686
|
-
let next = idx;
|
|
6687
|
-
if (orientation === "horizontal") {
|
|
6688
|
-
if (e.key === "ArrowRight") next = (idx + 1) % count;
|
|
6689
|
-
if (e.key === "ArrowLeft") next = (idx - 1 + count) % count;
|
|
6690
|
-
} else {
|
|
6691
|
-
if (e.key === "ArrowDown") next = (idx + 1) % count;
|
|
6692
|
-
if (e.key === "ArrowUp") next = (idx - 1 + count) % count;
|
|
6693
|
-
}
|
|
6694
|
-
if (e.key === "Home") next = 0;
|
|
6695
|
-
if (e.key === "End") next = count - 1;
|
|
6696
|
-
if (next !== idx) {
|
|
6697
|
-
e.preventDefault();
|
|
6698
|
-
const nextVal = tabs[next].value;
|
|
6699
|
-
handleTabChange(nextVal);
|
|
6700
|
-
tabRefs.current[next]?.focus();
|
|
6701
|
-
}
|
|
6702
|
-
},
|
|
6790
|
+
className: cn(sharedClassName, "border-0 bg-transparent outline-none"),
|
|
6703
6791
|
children: [
|
|
6704
6792
|
Icon && /* @__PURE__ */ jsx27(Icon, { className: "h-4 w-4" }),
|
|
6705
6793
|
tab.label
|
|
@@ -6843,17 +6931,18 @@ var DropdownMenu = ({
|
|
|
6843
6931
|
index
|
|
6844
6932
|
);
|
|
6845
6933
|
}) : children });
|
|
6846
|
-
const TriggerComponent = trigger.type;
|
|
6847
6934
|
const triggerProps = trigger.props;
|
|
6848
|
-
const
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6935
|
+
const childRef = triggerProps.ref;
|
|
6936
|
+
const enhancedTrigger = React23.cloneElement(trigger, {
|
|
6937
|
+
...triggerProps,
|
|
6938
|
+
ref: mergeRefs(childRef, (node) => {
|
|
6939
|
+
triggerRef.current = node;
|
|
6940
|
+
}),
|
|
6941
|
+
"aria-haspopup": "menu",
|
|
6942
|
+
"aria-expanded": open,
|
|
6943
|
+
onKeyDown: chainEventHandlers((e) => {
|
|
6944
|
+
triggerRef.current = e.currentTarget;
|
|
6945
|
+
if (!disabled) {
|
|
6857
6946
|
if (e.key === "ArrowDown") {
|
|
6858
6947
|
e.preventDefault();
|
|
6859
6948
|
setOpen(true);
|
|
@@ -6869,22 +6958,12 @@ var DropdownMenu = ({
|
|
|
6869
6958
|
e.preventDefault();
|
|
6870
6959
|
setOpen(false);
|
|
6871
6960
|
}
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
if (typeof triggerProps.onFocus === "function") {
|
|
6879
|
-
triggerProps.onFocus(e);
|
|
6880
|
-
}
|
|
6881
|
-
},
|
|
6882
|
-
className: cn(
|
|
6883
|
-
triggerProps.className,
|
|
6884
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
|
|
6885
|
-
)
|
|
6886
|
-
}
|
|
6887
|
-
);
|
|
6961
|
+
}
|
|
6962
|
+
}, triggerProps.onKeyDown),
|
|
6963
|
+
onFocus: chainEventHandlers((e) => {
|
|
6964
|
+
triggerRef.current = e.currentTarget;
|
|
6965
|
+
}, triggerProps.onFocus)
|
|
6966
|
+
});
|
|
6888
6967
|
return /* @__PURE__ */ jsx28(
|
|
6889
6968
|
Popover,
|
|
6890
6969
|
{
|
|
@@ -7816,7 +7895,7 @@ Section.displayName = "Section";
|
|
|
7816
7895
|
var Section_default = Section;
|
|
7817
7896
|
|
|
7818
7897
|
// src/components/ScrollArea.tsx
|
|
7819
|
-
import { forwardRef as
|
|
7898
|
+
import { forwardRef as forwardRef7, useRef as useRef11 } from "react";
|
|
7820
7899
|
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
7821
7900
|
var variantClasses2 = {
|
|
7822
7901
|
default: "bg-background",
|
|
@@ -7824,7 +7903,7 @@ var variantClasses2 = {
|
|
|
7824
7903
|
primary: "bg-primary/5",
|
|
7825
7904
|
accent: "bg-accent/10"
|
|
7826
7905
|
};
|
|
7827
|
-
var ScrollArea =
|
|
7906
|
+
var ScrollArea = forwardRef7(
|
|
7828
7907
|
({
|
|
7829
7908
|
className,
|
|
7830
7909
|
contentClassName,
|
|
@@ -7851,9 +7930,9 @@ var ScrollArea = forwardRef6(
|
|
|
7851
7930
|
ScrollArea.displayName = "ScrollArea";
|
|
7852
7931
|
|
|
7853
7932
|
// src/components/OverlayScrollArea.tsx
|
|
7854
|
-
import { forwardRef as
|
|
7933
|
+
import { forwardRef as forwardRef8, useRef as useRef12 } from "react";
|
|
7855
7934
|
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
7856
|
-
var OverlayScrollArea =
|
|
7935
|
+
var OverlayScrollArea = forwardRef8(
|
|
7857
7936
|
({ className, viewportClassName, viewportProps, enabled = true, overflowHidden = true, overlayScrollbarOptions, children, ...props }, ref) => {
|
|
7858
7937
|
const viewportRef = useRef12(null);
|
|
7859
7938
|
useOverlayScrollbarTarget(viewportRef, {
|
|
@@ -22931,7 +23010,7 @@ import { common, createLowlight } from "lowlight";
|
|
|
22931
23010
|
import { Extension } from "@tiptap/core";
|
|
22932
23011
|
import Suggestion from "@tiptap/suggestion";
|
|
22933
23012
|
import { ReactRenderer } from "@tiptap/react";
|
|
22934
|
-
import React66, { forwardRef as
|
|
23013
|
+
import React66, { forwardRef as forwardRef14, useEffect as useEffect31, useImperativeHandle, useRef as useRef26 } from "react";
|
|
22935
23014
|
import {
|
|
22936
23015
|
FileCode as FileCode2,
|
|
22937
23016
|
Heading1,
|
|
@@ -23135,7 +23214,7 @@ function buildSlashCommandItems({
|
|
|
23135
23214
|
}
|
|
23136
23215
|
].filter((item) => item.title.toLowerCase().includes(query.toLowerCase()));
|
|
23137
23216
|
}
|
|
23138
|
-
var SlashCommandList =
|
|
23217
|
+
var SlashCommandList = forwardRef14((props, ref) => {
|
|
23139
23218
|
const [selectedIndex, setSelectedIndex] = useResettingIndex2(props.items);
|
|
23140
23219
|
const listRef = useRef26(null);
|
|
23141
23220
|
useEffect31(() => {
|
|
@@ -23376,7 +23455,7 @@ import { Extension as Extension3 } from "@tiptap/core";
|
|
|
23376
23455
|
import Suggestion2 from "@tiptap/suggestion";
|
|
23377
23456
|
import { ReactRenderer as ReactRenderer2 } from "@tiptap/react";
|
|
23378
23457
|
import { PluginKey } from "@tiptap/pm/state";
|
|
23379
|
-
import React67, { forwardRef as
|
|
23458
|
+
import React67, { forwardRef as forwardRef15, useImperativeHandle as useImperativeHandle2 } from "react";
|
|
23380
23459
|
import { Smile as Smile2 } from "lucide-react";
|
|
23381
23460
|
import { jsx as jsx75, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
23382
23461
|
function useResettingIndex3(resetToken) {
|
|
@@ -23393,7 +23472,7 @@ function useResettingIndex3(resetToken) {
|
|
|
23393
23472
|
}, [resetToken]);
|
|
23394
23473
|
return [selectedIndex, setSelectedIndex];
|
|
23395
23474
|
}
|
|
23396
|
-
var EmojiList =
|
|
23475
|
+
var EmojiList = forwardRef15((props, ref) => {
|
|
23397
23476
|
const t = useSmartTranslations("UEditor");
|
|
23398
23477
|
const [selectedIndex, setSelectedIndex] = useResettingIndex3(props.items);
|
|
23399
23478
|
const showingCountLabel = formatEmojiCountLabel(t("emojiSuggestion.showingCount"), 64, props.items.length);
|