@sesionario/blocks 1.42.0-rc.1 → 1.42.0-rc.2
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 +506 -303
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +76 -2
- package/dist/index.d.ts +76 -2
- package/dist/index.js +504 -305
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -14,9 +14,9 @@ var DialogPrimitive = require('@radix-ui/react-dialog');
|
|
|
14
14
|
var nextThemes = require('next-themes');
|
|
15
15
|
var framerMotion = require('framer-motion');
|
|
16
16
|
var DropdownMenuPrimitive = require('@radix-ui/react-dropdown-menu');
|
|
17
|
+
var vaul = require('vaul');
|
|
17
18
|
var SliderPrimitive = require('@radix-ui/react-slider');
|
|
18
19
|
var TogglePrimitive = require('@radix-ui/react-toggle');
|
|
19
|
-
var vaul = require('vaul');
|
|
20
20
|
var PopoverPrimitive = require('@radix-ui/react-popover');
|
|
21
21
|
var cmdk = require('cmdk');
|
|
22
22
|
var RPNInput = require('react-phone-number-input');
|
|
@@ -1949,50 +1949,6 @@ function DropdownMenuShortcut({
|
|
|
1949
1949
|
}
|
|
1950
1950
|
);
|
|
1951
1951
|
}
|
|
1952
|
-
function DropdownMenuSub({
|
|
1953
|
-
...props
|
|
1954
|
-
}) {
|
|
1955
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
1956
|
-
}
|
|
1957
|
-
function DropdownMenuSubTrigger({
|
|
1958
|
-
className,
|
|
1959
|
-
inset,
|
|
1960
|
-
children,
|
|
1961
|
-
...props
|
|
1962
|
-
}) {
|
|
1963
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1964
|
-
DropdownMenuPrimitive__namespace.SubTrigger,
|
|
1965
|
-
{
|
|
1966
|
-
"data-slot": "dropdown-menu-sub-trigger",
|
|
1967
|
-
"data-inset": inset,
|
|
1968
|
-
className: cn(
|
|
1969
|
-
"flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden data-[inset]:pl-8 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[highlighted]:[&_svg:not([class*='text-'])]:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:[&_svg:not([class*='text-'])]:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:[&_svg:not([class*='text-'])]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1970
|
-
className
|
|
1971
|
-
),
|
|
1972
|
-
...props,
|
|
1973
|
-
children: [
|
|
1974
|
-
children,
|
|
1975
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRightIcon, { className: "ml-auto size-4" })
|
|
1976
|
-
]
|
|
1977
|
-
}
|
|
1978
|
-
);
|
|
1979
|
-
}
|
|
1980
|
-
function DropdownMenuSubContent({
|
|
1981
|
-
className,
|
|
1982
|
-
...props
|
|
1983
|
-
}) {
|
|
1984
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1985
|
-
DropdownMenuPrimitive__namespace.SubContent,
|
|
1986
|
-
{
|
|
1987
|
-
"data-slot": "dropdown-menu-sub-content",
|
|
1988
|
-
className: cn(
|
|
1989
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
|
|
1990
|
-
className
|
|
1991
|
-
),
|
|
1992
|
-
...props
|
|
1993
|
-
}
|
|
1994
|
-
);
|
|
1995
|
-
}
|
|
1996
1952
|
var defaultLabels = {
|
|
1997
1953
|
theme: "Theme",
|
|
1998
1954
|
system: "System",
|
|
@@ -2751,6 +2707,181 @@ function VerifiedProfessionalBadge({
|
|
|
2751
2707
|
}
|
|
2752
2708
|
);
|
|
2753
2709
|
}
|
|
2710
|
+
function useMediaQuery(query) {
|
|
2711
|
+
const [matches, setMatches] = React2.useState(false);
|
|
2712
|
+
React2.useEffect(() => {
|
|
2713
|
+
if (typeof window === "undefined" || !window.matchMedia) return;
|
|
2714
|
+
const mql = window.matchMedia(query);
|
|
2715
|
+
const onChange = () => setMatches(mql.matches);
|
|
2716
|
+
onChange();
|
|
2717
|
+
mql.addEventListener("change", onChange);
|
|
2718
|
+
return () => mql.removeEventListener("change", onChange);
|
|
2719
|
+
}, [query]);
|
|
2720
|
+
return matches;
|
|
2721
|
+
}
|
|
2722
|
+
function Drawer({
|
|
2723
|
+
repositionInputs = false,
|
|
2724
|
+
...props
|
|
2725
|
+
}) {
|
|
2726
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2727
|
+
vaul.Drawer.Root,
|
|
2728
|
+
{
|
|
2729
|
+
"data-slot": "drawer",
|
|
2730
|
+
repositionInputs,
|
|
2731
|
+
...props
|
|
2732
|
+
}
|
|
2733
|
+
);
|
|
2734
|
+
}
|
|
2735
|
+
function DrawerPortal({
|
|
2736
|
+
...props
|
|
2737
|
+
}) {
|
|
2738
|
+
return /* @__PURE__ */ jsxRuntime.jsx(vaul.Drawer.Portal, { "data-slot": "drawer-portal", ...props });
|
|
2739
|
+
}
|
|
2740
|
+
function DrawerClose({
|
|
2741
|
+
...props
|
|
2742
|
+
}) {
|
|
2743
|
+
return /* @__PURE__ */ jsxRuntime.jsx(vaul.Drawer.Close, { "data-slot": "drawer-close", ...props });
|
|
2744
|
+
}
|
|
2745
|
+
function DrawerOverlay({
|
|
2746
|
+
className,
|
|
2747
|
+
...props
|
|
2748
|
+
}) {
|
|
2749
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2750
|
+
vaul.Drawer.Overlay,
|
|
2751
|
+
{
|
|
2752
|
+
"data-slot": "drawer-overlay",
|
|
2753
|
+
className: cn(
|
|
2754
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 dark:bg-black/80",
|
|
2755
|
+
className
|
|
2756
|
+
),
|
|
2757
|
+
...props
|
|
2758
|
+
}
|
|
2759
|
+
);
|
|
2760
|
+
}
|
|
2761
|
+
function DrawerContent({
|
|
2762
|
+
className,
|
|
2763
|
+
children,
|
|
2764
|
+
...props
|
|
2765
|
+
}) {
|
|
2766
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DrawerPortal, { "data-slot": "drawer-portal", children: [
|
|
2767
|
+
/* @__PURE__ */ jsxRuntime.jsx(DrawerOverlay, {}),
|
|
2768
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2769
|
+
vaul.Drawer.Content,
|
|
2770
|
+
{
|
|
2771
|
+
"data-slot": "drawer-content",
|
|
2772
|
+
className: cn(
|
|
2773
|
+
"group/drawer-content bg-background fixed z-50 flex h-auto flex-col",
|
|
2774
|
+
"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b",
|
|
2775
|
+
"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t",
|
|
2776
|
+
"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
2777
|
+
"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",
|
|
2778
|
+
className
|
|
2779
|
+
),
|
|
2780
|
+
...props,
|
|
2781
|
+
children: [
|
|
2782
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }),
|
|
2783
|
+
children
|
|
2784
|
+
]
|
|
2785
|
+
}
|
|
2786
|
+
)
|
|
2787
|
+
] });
|
|
2788
|
+
}
|
|
2789
|
+
function DrawerHeader({ className, ...props }) {
|
|
2790
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2791
|
+
"div",
|
|
2792
|
+
{
|
|
2793
|
+
"data-slot": "drawer-header",
|
|
2794
|
+
className: cn(
|
|
2795
|
+
"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",
|
|
2796
|
+
className
|
|
2797
|
+
),
|
|
2798
|
+
...props
|
|
2799
|
+
}
|
|
2800
|
+
);
|
|
2801
|
+
}
|
|
2802
|
+
function DrawerFooter({ className, ...props }) {
|
|
2803
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2804
|
+
"div",
|
|
2805
|
+
{
|
|
2806
|
+
"data-slot": "drawer-footer",
|
|
2807
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
2808
|
+
...props
|
|
2809
|
+
}
|
|
2810
|
+
);
|
|
2811
|
+
}
|
|
2812
|
+
function DrawerTitle({
|
|
2813
|
+
className,
|
|
2814
|
+
...props
|
|
2815
|
+
}) {
|
|
2816
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2817
|
+
vaul.Drawer.Title,
|
|
2818
|
+
{
|
|
2819
|
+
"data-slot": "drawer-title",
|
|
2820
|
+
className: cn("text-foreground font-semibold", className),
|
|
2821
|
+
...props
|
|
2822
|
+
}
|
|
2823
|
+
);
|
|
2824
|
+
}
|
|
2825
|
+
var ResponsiveMenuSurfaceContext = React2.createContext("dropdown");
|
|
2826
|
+
function useResponsiveMenuSurface() {
|
|
2827
|
+
return React2.useContext(ResponsiveMenuSurfaceContext);
|
|
2828
|
+
}
|
|
2829
|
+
function ResponsiveMenu({
|
|
2830
|
+
trigger,
|
|
2831
|
+
children,
|
|
2832
|
+
open,
|
|
2833
|
+
onOpenChange,
|
|
2834
|
+
title,
|
|
2835
|
+
align = "end",
|
|
2836
|
+
side,
|
|
2837
|
+
sideOffset,
|
|
2838
|
+
contentClassName,
|
|
2839
|
+
drawerClassName
|
|
2840
|
+
}) {
|
|
2841
|
+
const isMobile = useMediaQuery("(max-width: 767px)");
|
|
2842
|
+
if (isMobile) {
|
|
2843
|
+
const triggerNode = React2.isValidElement(trigger) ? React2.cloneElement(trigger, {
|
|
2844
|
+
onClick: (event) => {
|
|
2845
|
+
const original = trigger.props.onClick;
|
|
2846
|
+
original?.(event);
|
|
2847
|
+
if (!event.defaultPrevented) {
|
|
2848
|
+
onOpenChange(true);
|
|
2849
|
+
}
|
|
2850
|
+
}
|
|
2851
|
+
}) : /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => onOpenChange(true), children: trigger });
|
|
2852
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ResponsiveMenuSurfaceContext.Provider, { value: "drawer", children: [
|
|
2853
|
+
triggerNode,
|
|
2854
|
+
/* @__PURE__ */ jsxRuntime.jsx(Drawer, { open, onOpenChange, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2855
|
+
DrawerContent,
|
|
2856
|
+
{
|
|
2857
|
+
className: cn(
|
|
2858
|
+
"mx-auto flex max-h-[90vh] max-w-lg flex-col",
|
|
2859
|
+
drawerClassName
|
|
2860
|
+
),
|
|
2861
|
+
"data-testid": "responsive-menu-drawer",
|
|
2862
|
+
children: [
|
|
2863
|
+
title ? /* @__PURE__ */ jsxRuntime.jsx(DrawerHeader, { className: "text-left", children: /* @__PURE__ */ jsxRuntime.jsx(DrawerTitle, { children: title }) }) : /* @__PURE__ */ jsxRuntime.jsx(DrawerHeader, { className: "sr-only", children: /* @__PURE__ */ jsxRuntime.jsx(DrawerTitle, { children: "Menu" }) }),
|
|
2864
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 flex-1 overflow-y-auto p-1 pb-4", children })
|
|
2865
|
+
]
|
|
2866
|
+
}
|
|
2867
|
+
) })
|
|
2868
|
+
] });
|
|
2869
|
+
}
|
|
2870
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ResponsiveMenuSurfaceContext.Provider, { value: "dropdown", children: /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu, { open, onOpenChange, children: [
|
|
2871
|
+
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuTrigger, { asChild: true, children: trigger }),
|
|
2872
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2873
|
+
DropdownMenuContent,
|
|
2874
|
+
{
|
|
2875
|
+
align,
|
|
2876
|
+
side,
|
|
2877
|
+
sideOffset,
|
|
2878
|
+
className: contentClassName,
|
|
2879
|
+
"data-testid": "responsive-menu-dropdown",
|
|
2880
|
+
children
|
|
2881
|
+
}
|
|
2882
|
+
)
|
|
2883
|
+
] }) });
|
|
2884
|
+
}
|
|
2754
2885
|
var defaultLabels3 = {
|
|
2755
2886
|
accountMenu: "Account menu",
|
|
2756
2887
|
settingsMenu: "Settings",
|
|
@@ -2771,6 +2902,8 @@ var defaultLabels3 = {
|
|
|
2771
2902
|
accountSettings: "Account settings"
|
|
2772
2903
|
};
|
|
2773
2904
|
var PLATFORM_ACCOUNT_ORG_COLLAPSE_AT = 4;
|
|
2905
|
+
var menuItemClassName = "relative flex w-full cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive";
|
|
2906
|
+
var radioItemClassName = "relative flex w-full cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden focus:bg-accent focus:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0";
|
|
2774
2907
|
function mergePlatformAccountOrgs(memberOrgs, manageableOrgs) {
|
|
2775
2908
|
const manageableIds = new Set(manageableOrgs.map((org) => org.id));
|
|
2776
2909
|
const byId = /* @__PURE__ */ new Map();
|
|
@@ -2794,6 +2927,82 @@ function mergePlatformAccountOrgs(memberOrgs, manageableOrgs) {
|
|
|
2794
2927
|
}
|
|
2795
2928
|
return Array.from(byId.values());
|
|
2796
2929
|
}
|
|
2930
|
+
function PlatformAccountMenuItem({
|
|
2931
|
+
className,
|
|
2932
|
+
inset,
|
|
2933
|
+
variant = "default",
|
|
2934
|
+
disabled,
|
|
2935
|
+
asChild = false,
|
|
2936
|
+
onSelect,
|
|
2937
|
+
children,
|
|
2938
|
+
onClick
|
|
2939
|
+
}) {
|
|
2940
|
+
const surface = useResponsiveMenuSurface();
|
|
2941
|
+
if (surface === "dropdown") {
|
|
2942
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2943
|
+
DropdownMenuItem,
|
|
2944
|
+
{
|
|
2945
|
+
className,
|
|
2946
|
+
inset,
|
|
2947
|
+
variant,
|
|
2948
|
+
disabled,
|
|
2949
|
+
asChild,
|
|
2950
|
+
onSelect: (event) => {
|
|
2951
|
+
onSelect?.(event);
|
|
2952
|
+
},
|
|
2953
|
+
onClick,
|
|
2954
|
+
children
|
|
2955
|
+
}
|
|
2956
|
+
);
|
|
2957
|
+
}
|
|
2958
|
+
const Comp = asChild ? reactSlot.Slot : "button";
|
|
2959
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2960
|
+
Comp,
|
|
2961
|
+
{
|
|
2962
|
+
type: asChild ? void 0 : "button",
|
|
2963
|
+
role: "menuitem",
|
|
2964
|
+
"data-slot": "dropdown-menu-item",
|
|
2965
|
+
"data-inset": inset || void 0,
|
|
2966
|
+
"data-variant": variant,
|
|
2967
|
+
"data-disabled": disabled || void 0,
|
|
2968
|
+
disabled: asChild ? void 0 : disabled,
|
|
2969
|
+
"aria-disabled": disabled || void 0,
|
|
2970
|
+
className: cn(menuItemClassName, className),
|
|
2971
|
+
onClick: (event) => {
|
|
2972
|
+
if (disabled) {
|
|
2973
|
+
event.preventDefault();
|
|
2974
|
+
return;
|
|
2975
|
+
}
|
|
2976
|
+
onClick?.(event);
|
|
2977
|
+
onSelect?.({ preventDefault: () => void 0 });
|
|
2978
|
+
},
|
|
2979
|
+
children
|
|
2980
|
+
}
|
|
2981
|
+
);
|
|
2982
|
+
}
|
|
2983
|
+
function AccountMenuLabel({
|
|
2984
|
+
className,
|
|
2985
|
+
children
|
|
2986
|
+
}) {
|
|
2987
|
+
const surface = useResponsiveMenuSurface();
|
|
2988
|
+
if (surface === "dropdown") {
|
|
2989
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuLabel, { className, children });
|
|
2990
|
+
}
|
|
2991
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("px-2 py-1.5 text-sm font-medium", className), children });
|
|
2992
|
+
}
|
|
2993
|
+
function AccountMenuSeparator({ className }) {
|
|
2994
|
+
const surface = useResponsiveMenuSurface();
|
|
2995
|
+
if (surface === "dropdown") {
|
|
2996
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, { className });
|
|
2997
|
+
}
|
|
2998
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2999
|
+
"div",
|
|
3000
|
+
{
|
|
3001
|
+
role: "separator",
|
|
3002
|
+
className: cn("bg-border -mx-1 my-1 h-px", className)
|
|
3003
|
+
}
|
|
3004
|
+
);
|
|
3005
|
+
}
|
|
2797
3006
|
function MenuAvatar({
|
|
2798
3007
|
name,
|
|
2799
3008
|
image,
|
|
@@ -2823,7 +3032,7 @@ function MenuAvatar({
|
|
|
2823
3032
|
}
|
|
2824
3033
|
);
|
|
2825
3034
|
}
|
|
2826
|
-
function
|
|
3035
|
+
function LanguageThemeExpand({
|
|
2827
3036
|
languages,
|
|
2828
3037
|
currentLanguage,
|
|
2829
3038
|
onLanguageChange,
|
|
@@ -2831,32 +3040,76 @@ function LanguageThemeSubs({
|
|
|
2831
3040
|
}) {
|
|
2832
3041
|
const { theme, setTheme } = nextThemes.useTheme();
|
|
2833
3042
|
const themeValue = theme ?? "system";
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
3043
|
+
const surface = useResponsiveMenuSurface();
|
|
3044
|
+
const [languageOpen, setLanguageOpen] = React2.useState(false);
|
|
3045
|
+
const [themeOpen, setThemeOpen] = React2.useState(false);
|
|
3046
|
+
function renderRadioOptions(value, onValueChange, options) {
|
|
3047
|
+
if (surface === "dropdown") {
|
|
3048
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuRadioGroup, { value, onValueChange, children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuRadioItem, { value: option.value, children: option.label }, option.value)) });
|
|
3049
|
+
}
|
|
3050
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { role: "group", children: options.map((option) => {
|
|
3051
|
+
const checked = value === option.value;
|
|
3052
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3053
|
+
"button",
|
|
2842
3054
|
{
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
3055
|
+
type: "button",
|
|
3056
|
+
role: "menuitemradio",
|
|
3057
|
+
"aria-checked": checked,
|
|
3058
|
+
className: radioItemClassName,
|
|
3059
|
+
onClick: () => onValueChange(option.value),
|
|
3060
|
+
children: [
|
|
3061
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: checked ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-4" }) : null }),
|
|
3062
|
+
option.label
|
|
3063
|
+
]
|
|
3064
|
+
},
|
|
3065
|
+
option.value
|
|
3066
|
+
);
|
|
3067
|
+
}) });
|
|
3068
|
+
}
|
|
3069
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3070
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3071
|
+
PlatformAccountMenuItem,
|
|
3072
|
+
{
|
|
3073
|
+
className: "gap-2",
|
|
3074
|
+
onSelect: (event) => {
|
|
3075
|
+
event.preventDefault();
|
|
3076
|
+
setLanguageOpen((open) => !open);
|
|
3077
|
+
},
|
|
3078
|
+
children: [
|
|
3079
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.language }),
|
|
3080
|
+
languageOpen ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { className: "size-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "size-4" }),
|
|
3081
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Languages, { className: "size-4" })
|
|
3082
|
+
]
|
|
3083
|
+
}
|
|
3084
|
+
),
|
|
3085
|
+
languageOpen ? renderRadioOptions(
|
|
3086
|
+
currentLanguage,
|
|
3087
|
+
onLanguageChange,
|
|
3088
|
+
languages.map((lang) => ({
|
|
3089
|
+
value: lang.key,
|
|
3090
|
+
label: lang.nativeName
|
|
3091
|
+
}))
|
|
3092
|
+
) : null,
|
|
3093
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3094
|
+
PlatformAccountMenuItem,
|
|
3095
|
+
{
|
|
3096
|
+
className: "gap-2",
|
|
3097
|
+
onSelect: (event) => {
|
|
3098
|
+
event.preventDefault();
|
|
3099
|
+
setThemeOpen((open) => !open);
|
|
3100
|
+
},
|
|
3101
|
+
children: [
|
|
3102
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.theme }),
|
|
3103
|
+
themeOpen ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { className: "size-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "size-4" }),
|
|
3104
|
+
themeValue === "light" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sun, { className: "size-4" }) : themeValue === "dark" ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Moon, { className: "size-4" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Monitor, { className: "size-4" })
|
|
3105
|
+
]
|
|
3106
|
+
}
|
|
3107
|
+
),
|
|
3108
|
+
themeOpen ? renderRadioOptions(themeValue, setTheme, [
|
|
3109
|
+
{ value: "system", label: labels.themeSystem },
|
|
3110
|
+
{ value: "light", label: labels.themeLight },
|
|
3111
|
+
{ value: "dark", label: labels.themeDark }
|
|
3112
|
+
]) : null
|
|
2860
3113
|
] });
|
|
2861
3114
|
}
|
|
2862
3115
|
function OrgMenuRows({
|
|
@@ -2887,7 +3140,7 @@ function OrgMenuRows({
|
|
|
2887
3140
|
"data-testid": `platform-account-org-${org.id}`,
|
|
2888
3141
|
children: [
|
|
2889
3142
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2890
|
-
|
|
3143
|
+
PlatformAccountMenuItem,
|
|
2891
3144
|
{
|
|
2892
3145
|
asChild: true,
|
|
2893
3146
|
className: cn("gap-2", org.canManage && "pr-9"),
|
|
@@ -2905,7 +3158,7 @@ function OrgMenuRows({
|
|
|
2905
3158
|
}
|
|
2906
3159
|
),
|
|
2907
3160
|
org.canManage ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
2908
|
-
|
|
3161
|
+
PlatformAccountMenuItem,
|
|
2909
3162
|
{
|
|
2910
3163
|
asChild: true,
|
|
2911
3164
|
className: "absolute right-0.5 top-1/2 size-7 -translate-y-1/2 justify-center p-0",
|
|
@@ -2918,7 +3171,7 @@ function OrgMenuRows({
|
|
|
2918
3171
|
);
|
|
2919
3172
|
}),
|
|
2920
3173
|
collapsible ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2921
|
-
|
|
3174
|
+
PlatformAccountMenuItem,
|
|
2922
3175
|
{
|
|
2923
3176
|
className: "gap-2",
|
|
2924
3177
|
onSelect: (event) => {
|
|
@@ -2958,6 +3211,7 @@ function PlatformAccountMenu({
|
|
|
2958
3211
|
className
|
|
2959
3212
|
}) {
|
|
2960
3213
|
const labels = { ...defaultLabels3, ...labelsProp };
|
|
3214
|
+
const [open, setOpen] = React2.useState(false);
|
|
2961
3215
|
const [signingOut, setSigningOut] = React2.useState(false);
|
|
2962
3216
|
const mergedOrgs = React2.useMemo(
|
|
2963
3217
|
() => mergePlatformAccountOrgs(memberOrgs, manageableOrgs),
|
|
@@ -3008,120 +3262,180 @@ function PlatformAccountMenu({
|
|
|
3008
3262
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { className: "size-4" })
|
|
3009
3263
|
}
|
|
3010
3264
|
);
|
|
3011
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
{
|
|
3025
|
-
name: user.name,
|
|
3026
|
-
image: user.image,
|
|
3027
|
-
sizeClass: "size-9"
|
|
3028
|
-
}
|
|
3029
|
-
),
|
|
3030
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-col", children: [
|
|
3031
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-center gap-1.5 truncate text-sm font-medium leading-tight", children: [
|
|
3032
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: user.name }),
|
|
3033
|
-
variant === "platform" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3034
|
-
VerifiedProfessionalBadge,
|
|
3035
|
-
{
|
|
3036
|
-
status: verificationStatus,
|
|
3037
|
-
professionLabel,
|
|
3038
|
-
className: "shrink-0"
|
|
3039
|
-
}
|
|
3040
|
-
) : null
|
|
3041
|
-
] }),
|
|
3042
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs text-muted-foreground leading-tight", children: user.email })
|
|
3043
|
-
] })
|
|
3044
|
-
] }),
|
|
3045
|
-
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {}),
|
|
3046
|
-
variant === "platform" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3047
|
-
hasOrgs ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3048
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3049
|
-
OrgMenuRows,
|
|
3050
|
-
{
|
|
3051
|
-
orgs: mergedOrgs,
|
|
3052
|
-
appUrl: urls.appUrl,
|
|
3053
|
-
adminUrl: urls.adminUrl,
|
|
3054
|
-
labels
|
|
3055
|
-
}
|
|
3056
|
-
),
|
|
3057
|
-
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {})
|
|
3058
|
-
] }) : null,
|
|
3059
|
-
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: accountHref, children: [
|
|
3060
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.personalProfile }),
|
|
3061
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { className: "size-4" })
|
|
3062
|
-
] }) }),
|
|
3063
|
-
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: activityHref, children: [
|
|
3064
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.activity }),
|
|
3065
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Activity, { className: "size-4" })
|
|
3066
|
-
] }) }),
|
|
3067
|
-
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: profileHref, children: [
|
|
3068
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.professionalProfile }),
|
|
3069
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { className: "size-4" })
|
|
3070
|
-
] }) }),
|
|
3071
|
-
extraItems,
|
|
3072
|
-
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {})
|
|
3073
|
-
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3074
|
-
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: accountHref, children: [
|
|
3075
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.accountSettings }),
|
|
3076
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { className: "size-4" })
|
|
3077
|
-
] }) }),
|
|
3078
|
-
extraItems,
|
|
3079
|
-
/* @__PURE__ */ jsxRuntime.jsx(DropdownMenuSeparator, {})
|
|
3080
|
-
] }),
|
|
3265
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3266
|
+
ResponsiveMenu,
|
|
3267
|
+
{
|
|
3268
|
+
open,
|
|
3269
|
+
onOpenChange: setOpen,
|
|
3270
|
+
trigger: triggerProp ?? defaultTrigger,
|
|
3271
|
+
align: contentAlign,
|
|
3272
|
+
side: contentSide,
|
|
3273
|
+
sideOffset: contentSideOffset,
|
|
3274
|
+
contentClassName: cn("min-w-60 rounded-lg", contentClassName),
|
|
3275
|
+
title: user ? labels.accountMenu : labels.settingsMenu,
|
|
3276
|
+
children: user ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3277
|
+
/* @__PURE__ */ jsxRuntime.jsxs(AccountMenuLabel, { className: "flex items-center gap-3 p-2 font-normal", children: [
|
|
3081
3278
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3082
|
-
|
|
3279
|
+
MenuAvatar,
|
|
3083
3280
|
{
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
labels
|
|
3281
|
+
name: user.name,
|
|
3282
|
+
image: user.image,
|
|
3283
|
+
sizeClass: "size-9"
|
|
3088
3284
|
}
|
|
3089
3285
|
),
|
|
3090
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
variant
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3286
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-col", children: [
|
|
3287
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 items-center gap-1.5 truncate text-sm font-medium leading-tight", children: [
|
|
3288
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: user.name }),
|
|
3289
|
+
variant === "platform" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
3290
|
+
VerifiedProfessionalBadge,
|
|
3291
|
+
{
|
|
3292
|
+
status: verificationStatus,
|
|
3293
|
+
professionLabel,
|
|
3294
|
+
className: "shrink-0"
|
|
3295
|
+
}
|
|
3296
|
+
) : null
|
|
3297
|
+
] }),
|
|
3298
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs text-muted-foreground leading-tight", children: user.email })
|
|
3299
|
+
] })
|
|
3300
|
+
] }),
|
|
3301
|
+
/* @__PURE__ */ jsxRuntime.jsx(AccountMenuSeparator, {}),
|
|
3302
|
+
variant === "platform" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3303
|
+
hasOrgs ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3304
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3305
|
+
OrgMenuRows,
|
|
3306
|
+
{
|
|
3307
|
+
orgs: mergedOrgs,
|
|
3308
|
+
appUrl: urls.appUrl,
|
|
3309
|
+
adminUrl: urls.adminUrl,
|
|
3310
|
+
labels
|
|
3311
|
+
}
|
|
3312
|
+
),
|
|
3313
|
+
/* @__PURE__ */ jsxRuntime.jsx(AccountMenuSeparator, {})
|
|
3314
|
+
] }) : null,
|
|
3315
|
+
/* @__PURE__ */ jsxRuntime.jsx(PlatformAccountMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: accountHref, children: [
|
|
3316
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.personalProfile }),
|
|
3317
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { className: "size-4" })
|
|
3318
|
+
] }) }),
|
|
3319
|
+
/* @__PURE__ */ jsxRuntime.jsx(PlatformAccountMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: activityHref, children: [
|
|
3320
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.activity }),
|
|
3321
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Activity, { className: "size-4" })
|
|
3322
|
+
] }) }),
|
|
3323
|
+
/* @__PURE__ */ jsxRuntime.jsx(PlatformAccountMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: profileHref, children: [
|
|
3324
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.professionalProfile }),
|
|
3325
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.User, { className: "size-4" })
|
|
3326
|
+
] }) }),
|
|
3327
|
+
extraItems,
|
|
3328
|
+
/* @__PURE__ */ jsxRuntime.jsx(AccountMenuSeparator, {})
|
|
3106
3329
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3107
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3108
|
-
|
|
3109
|
-
{
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3330
|
+
/* @__PURE__ */ jsxRuntime.jsx(PlatformAccountMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: accountHref, children: [
|
|
3331
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.accountSettings }),
|
|
3332
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { className: "size-4" })
|
|
3333
|
+
] }) }),
|
|
3334
|
+
extraItems,
|
|
3335
|
+
/* @__PURE__ */ jsxRuntime.jsx(AccountMenuSeparator, {})
|
|
3336
|
+
] }),
|
|
3337
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3338
|
+
LanguageThemeExpand,
|
|
3339
|
+
{
|
|
3340
|
+
languages,
|
|
3341
|
+
currentLanguage,
|
|
3342
|
+
onLanguageChange,
|
|
3343
|
+
labels
|
|
3344
|
+
}
|
|
3345
|
+
),
|
|
3346
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3347
|
+
PlatformAccountMenuItem,
|
|
3348
|
+
{
|
|
3349
|
+
variant: "destructive",
|
|
3350
|
+
className: "gap-2",
|
|
3351
|
+
disabled: signingOut || !onSignOut,
|
|
3352
|
+
onSelect: (event) => {
|
|
3353
|
+
event.preventDefault();
|
|
3354
|
+
void handleSignOut();
|
|
3355
|
+
},
|
|
3356
|
+
children: [
|
|
3357
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: signingOut ? labels.signingOut : labels.signOut }),
|
|
3358
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogOut, { className: "size-4" })
|
|
3359
|
+
]
|
|
3360
|
+
}
|
|
3361
|
+
)
|
|
3362
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3363
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3364
|
+
LanguageThemeExpand,
|
|
3365
|
+
{
|
|
3366
|
+
languages,
|
|
3367
|
+
currentLanguage,
|
|
3368
|
+
onLanguageChange,
|
|
3369
|
+
labels
|
|
3370
|
+
}
|
|
3371
|
+
),
|
|
3372
|
+
/* @__PURE__ */ jsxRuntime.jsx(AccountMenuSeparator, {}),
|
|
3373
|
+
/* @__PURE__ */ jsxRuntime.jsx(PlatformAccountMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxRuntime.jsxs("a", { href: loginHref, children: [
|
|
3374
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.signIn }),
|
|
3375
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogIn, { className: "size-4" })
|
|
3376
|
+
] }) })
|
|
3377
|
+
] })
|
|
3378
|
+
}
|
|
3379
|
+
);
|
|
3380
|
+
}
|
|
3381
|
+
function defaultFormatTime(isoDate, language) {
|
|
3382
|
+
return new Date(isoDate).toLocaleString(
|
|
3383
|
+
language === "es" ? "es-ES" : "en-US",
|
|
3384
|
+
{
|
|
3385
|
+
dateStyle: "short",
|
|
3386
|
+
timeStyle: "short"
|
|
3387
|
+
}
|
|
3388
|
+
);
|
|
3389
|
+
}
|
|
3390
|
+
function NotificationInbox({
|
|
3391
|
+
notifications,
|
|
3392
|
+
labels,
|
|
3393
|
+
language = "es",
|
|
3394
|
+
formatTime,
|
|
3395
|
+
viewAllHref,
|
|
3396
|
+
renderLeading,
|
|
3397
|
+
emptyIcon: EmptyIcon = lucideReact.Bell,
|
|
3398
|
+
className,
|
|
3399
|
+
listClassName
|
|
3400
|
+
}) {
|
|
3401
|
+
const surface = useResponsiveMenuSurface();
|
|
3402
|
+
const format = formatTime ?? ((iso) => defaultFormatTime(iso, language));
|
|
3403
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3404
|
+
"div",
|
|
3405
|
+
{
|
|
3406
|
+
className: cn("flex flex-col", className),
|
|
3407
|
+
"data-testid": "notification-inbox",
|
|
3408
|
+
children: [
|
|
3409
|
+
surface === "dropdown" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-between border-b px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold", children: labels.title }) }) : null,
|
|
3410
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("max-h-80 overflow-y-auto", listClassName), children: notifications.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(EmptyState, { variant: "compact", icon: EmptyIcon, title: labels.empty }) : /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex flex-col", children: notifications.map((notification, index) => {
|
|
3411
|
+
const leading = renderLeading?.(notification) ?? null;
|
|
3412
|
+
const body = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3413
|
+
leading,
|
|
3414
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1 space-y-1", children: [
|
|
3415
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium leading-none", children: notification.title }),
|
|
3416
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "line-clamp-2 text-xs text-muted-foreground", children: notification.message }),
|
|
3417
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground/70", children: format(notification.createdAt) })
|
|
3418
|
+
] })
|
|
3419
|
+
] });
|
|
3420
|
+
const rowClass = cn(
|
|
3421
|
+
"flex gap-3 px-4 py-3",
|
|
3422
|
+
!notification.read && "bg-muted/30",
|
|
3423
|
+
notification.link && "transition-colors hover:bg-muted/50",
|
|
3424
|
+
index < notifications.length - 1 && "border-b"
|
|
3425
|
+
);
|
|
3426
|
+
return /* @__PURE__ */ jsxRuntime.jsx("li", { children: notification.link ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: notification.link, className: rowClass, children: body }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: rowClass, children: body }) }, notification.id);
|
|
3427
|
+
}) }) }),
|
|
3428
|
+
viewAllHref && labels.viewAll ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t px-4 py-2", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3429
|
+
"a",
|
|
3430
|
+
{
|
|
3431
|
+
href: viewAllHref,
|
|
3432
|
+
className: "block text-center text-sm font-medium text-primary hover:underline",
|
|
3433
|
+
children: labels.viewAll
|
|
3434
|
+
}
|
|
3435
|
+
) }) : null
|
|
3436
|
+
]
|
|
3437
|
+
}
|
|
3438
|
+
);
|
|
3125
3439
|
}
|
|
3126
3440
|
function Slider({
|
|
3127
3441
|
className,
|
|
@@ -3729,110 +4043,7 @@ function AvatarEditor({
|
|
|
3729
4043
|
}
|
|
3730
4044
|
);
|
|
3731
4045
|
}
|
|
3732
|
-
function
|
|
3733
|
-
repositionInputs = false,
|
|
3734
|
-
...props
|
|
3735
|
-
}) {
|
|
3736
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3737
|
-
vaul.Drawer.Root,
|
|
3738
|
-
{
|
|
3739
|
-
"data-slot": "drawer",
|
|
3740
|
-
repositionInputs,
|
|
3741
|
-
...props
|
|
3742
|
-
}
|
|
3743
|
-
);
|
|
3744
|
-
}
|
|
3745
|
-
function DrawerPortal({
|
|
3746
|
-
...props
|
|
3747
|
-
}) {
|
|
3748
|
-
return /* @__PURE__ */ jsxRuntime.jsx(vaul.Drawer.Portal, { "data-slot": "drawer-portal", ...props });
|
|
3749
|
-
}
|
|
3750
|
-
function DrawerClose({
|
|
3751
|
-
...props
|
|
3752
|
-
}) {
|
|
3753
|
-
return /* @__PURE__ */ jsxRuntime.jsx(vaul.Drawer.Close, { "data-slot": "drawer-close", ...props });
|
|
3754
|
-
}
|
|
3755
|
-
function DrawerOverlay({
|
|
3756
|
-
className,
|
|
3757
|
-
...props
|
|
3758
|
-
}) {
|
|
3759
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3760
|
-
vaul.Drawer.Overlay,
|
|
3761
|
-
{
|
|
3762
|
-
"data-slot": "drawer-overlay",
|
|
3763
|
-
className: cn(
|
|
3764
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 dark:bg-black/80",
|
|
3765
|
-
className
|
|
3766
|
-
),
|
|
3767
|
-
...props
|
|
3768
|
-
}
|
|
3769
|
-
);
|
|
3770
|
-
}
|
|
3771
|
-
function DrawerContent({
|
|
3772
|
-
className,
|
|
3773
|
-
children,
|
|
3774
|
-
...props
|
|
3775
|
-
}) {
|
|
3776
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(DrawerPortal, { "data-slot": "drawer-portal", children: [
|
|
3777
|
-
/* @__PURE__ */ jsxRuntime.jsx(DrawerOverlay, {}),
|
|
3778
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3779
|
-
vaul.Drawer.Content,
|
|
3780
|
-
{
|
|
3781
|
-
"data-slot": "drawer-content",
|
|
3782
|
-
className: cn(
|
|
3783
|
-
"group/drawer-content bg-background fixed z-50 flex h-auto flex-col",
|
|
3784
|
-
"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b",
|
|
3785
|
-
"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t",
|
|
3786
|
-
"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm",
|
|
3787
|
-
"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",
|
|
3788
|
-
className
|
|
3789
|
-
),
|
|
3790
|
-
...props,
|
|
3791
|
-
children: [
|
|
3792
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }),
|
|
3793
|
-
children
|
|
3794
|
-
]
|
|
3795
|
-
}
|
|
3796
|
-
)
|
|
3797
|
-
] });
|
|
3798
|
-
}
|
|
3799
|
-
function DrawerHeader({ className, ...props }) {
|
|
3800
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3801
|
-
"div",
|
|
3802
|
-
{
|
|
3803
|
-
"data-slot": "drawer-header",
|
|
3804
|
-
className: cn(
|
|
3805
|
-
"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",
|
|
3806
|
-
className
|
|
3807
|
-
),
|
|
3808
|
-
...props
|
|
3809
|
-
}
|
|
3810
|
-
);
|
|
3811
|
-
}
|
|
3812
|
-
function DrawerFooter({ className, ...props }) {
|
|
3813
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3814
|
-
"div",
|
|
3815
|
-
{
|
|
3816
|
-
"data-slot": "drawer-footer",
|
|
3817
|
-
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
3818
|
-
...props
|
|
3819
|
-
}
|
|
3820
|
-
);
|
|
3821
|
-
}
|
|
3822
|
-
function DrawerTitle({
|
|
3823
|
-
className,
|
|
3824
|
-
...props
|
|
3825
|
-
}) {
|
|
3826
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3827
|
-
vaul.Drawer.Title,
|
|
3828
|
-
{
|
|
3829
|
-
"data-slot": "drawer-title",
|
|
3830
|
-
className: cn("text-foreground font-semibold", className),
|
|
3831
|
-
...props
|
|
3832
|
-
}
|
|
3833
|
-
);
|
|
3834
|
-
}
|
|
3835
|
-
function useMediaQuery(query) {
|
|
4046
|
+
function useMediaQuery2(query) {
|
|
3836
4047
|
const [matches, setMatches] = React2.useState(false);
|
|
3837
4048
|
React2.useEffect(() => {
|
|
3838
4049
|
const media = window.matchMedia(query);
|
|
@@ -3867,7 +4078,7 @@ function AvatarEditorDialog({
|
|
|
3867
4078
|
const [editedValue, setEditedValue] = React2.useState(value ?? null);
|
|
3868
4079
|
const [isSaving, setIsSaving] = React2.useState(false);
|
|
3869
4080
|
const [feedback, setFeedback] = React2.useState(null);
|
|
3870
|
-
const isMobile =
|
|
4081
|
+
const isMobile = useMediaQuery2("(max-width: 640px)");
|
|
3871
4082
|
const caption = (placeholder ?? "").trim();
|
|
3872
4083
|
const handleOpenChange = React2.useCallback(
|
|
3873
4084
|
(open) => {
|
|
@@ -4813,18 +5024,6 @@ function useDebouncedValueStrict(value, delayMs) {
|
|
|
4813
5024
|
}, [value, delayMs]);
|
|
4814
5025
|
return debounced;
|
|
4815
5026
|
}
|
|
4816
|
-
function useMediaQuery2(query) {
|
|
4817
|
-
const [matches, setMatches] = React2.useState(false);
|
|
4818
|
-
React2.useEffect(() => {
|
|
4819
|
-
if (typeof window === "undefined" || !window.matchMedia) return;
|
|
4820
|
-
const mql = window.matchMedia(query);
|
|
4821
|
-
const onChange = () => setMatches(mql.matches);
|
|
4822
|
-
onChange();
|
|
4823
|
-
mql.addEventListener("change", onChange);
|
|
4824
|
-
return () => mql.removeEventListener("change", onChange);
|
|
4825
|
-
}, [query]);
|
|
4826
|
-
return matches;
|
|
4827
|
-
}
|
|
4828
5027
|
function readMetrics() {
|
|
4829
5028
|
if (typeof window === "undefined") {
|
|
4830
5029
|
return { height: 0, offsetTop: 0, keyboardInset: 0 };
|
|
@@ -5753,7 +5952,7 @@ function SearchablePicker(props) {
|
|
|
5753
5952
|
const mode = props.mode ?? "single";
|
|
5754
5953
|
const labels = { ...defaultLabels4, ...userLabels };
|
|
5755
5954
|
const resolvedEmptyLabel = emptyLabel ?? labels.emptyOption;
|
|
5756
|
-
const isMobile =
|
|
5955
|
+
const isMobile = useMediaQuery("(max-width: 767px)");
|
|
5757
5956
|
const generatedId = React2.useId();
|
|
5758
5957
|
const triggerId = id ?? generatedId;
|
|
5759
5958
|
const [uncontrolledOpen, setUncontrolledOpen] = React2.useState(false);
|
|
@@ -8041,7 +8240,7 @@ function SupportMessengerProvider({
|
|
|
8041
8240
|
searchThreshold = 8,
|
|
8042
8241
|
className
|
|
8043
8242
|
}) {
|
|
8044
|
-
const isMobile =
|
|
8243
|
+
const isMobile = useMediaQuery("(max-width: 767px)");
|
|
8045
8244
|
const { height: viewportHeight, keyboardInset } = useVisualViewportMetrics();
|
|
8046
8245
|
const dockRef = React2.useRef(null);
|
|
8047
8246
|
const [listOpen, setListOpen] = React2.useState(false);
|
|
@@ -9243,12 +9442,15 @@ exports.MessageScrollerItem = MessageScrollerItem;
|
|
|
9243
9442
|
exports.MessageScrollerProvider = MessageScrollerProvider;
|
|
9244
9443
|
exports.MessageScrollerViewport = MessageScrollerViewport;
|
|
9245
9444
|
exports.MexicoMap = MexicoMap;
|
|
9445
|
+
exports.NotificationInbox = NotificationInbox;
|
|
9246
9446
|
exports.OrgSwitcher = OrgSwitcher;
|
|
9247
9447
|
exports.PLATFORM_ACCOUNT_ORG_COLLAPSE_AT = PLATFORM_ACCOUNT_ORG_COLLAPSE_AT;
|
|
9248
9448
|
exports.PaymentIcon = PaymentIcon;
|
|
9249
9449
|
exports.PhoneInput = PhoneInput;
|
|
9250
9450
|
exports.PlatformAccountMenu = PlatformAccountMenu;
|
|
9451
|
+
exports.PlatformAccountMenuItem = PlatformAccountMenuItem;
|
|
9251
9452
|
exports.PlatformNavbar = PlatformNavbar;
|
|
9453
|
+
exports.ResponsiveMenu = ResponsiveMenu;
|
|
9252
9454
|
exports.RfcInput = RfcInput;
|
|
9253
9455
|
exports.SafeImage = SafeImage;
|
|
9254
9456
|
exports.ScrollRestorationProvider = ScrollRestorationProvider;
|
|
@@ -9288,9 +9490,10 @@ exports.useDebouncedValue = useDebouncedValue;
|
|
|
9288
9490
|
exports.useDebouncedValueStrict = useDebouncedValueStrict;
|
|
9289
9491
|
exports.useEditableSection = useEditableSection;
|
|
9290
9492
|
exports.useLanguageContext = useLanguageContext;
|
|
9291
|
-
exports.useMediaQuery =
|
|
9493
|
+
exports.useMediaQuery = useMediaQuery;
|
|
9292
9494
|
exports.useRealtimeChannel = useRealtimeChannel;
|
|
9293
9495
|
exports.useRegisterScrollContainer = useRegisterScrollContainer;
|
|
9496
|
+
exports.useResponsiveMenuSurface = useResponsiveMenuSurface;
|
|
9294
9497
|
exports.useRestorableState = useRestorableState;
|
|
9295
9498
|
exports.useScrollFadeXEdges = useScrollFadeXEdges;
|
|
9296
9499
|
exports.useScrollRestorationContext = useScrollRestorationContext;
|