@sesionario/blocks 1.41.0 → 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 +565 -303
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +97 -2
- package/dist/index.d.ts +97 -2
- package/dist/index.js +557 -305
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as React2 from 'react';
|
|
3
|
-
import { createContext, forwardRef, useContext, useState, useRef, useId, useEffect, useCallback, useLayoutEffect, useMemo } from 'react';
|
|
4
|
-
import { ChevronsUpDown, CheckIcon, Smile, SearchIcon, Search, Clock, Flag, Hash, Lightbulb, Trophy, Plane, Apple, Leaf, Hand, Loader2, AlertTriangle, Inbox, X, ChevronLeft, ChevronRight, Monitor, Sun, Moon, Building2, Check, Plus, Languages, BadgeCheck, Settings, User, Activity, LogOut, LogIn, Upload, Move, ZoomOut, ZoomIn, RotateCcw, RotateCw, Grid3X3, RefreshCw, Pencil, ArrowDownIcon, MessageCircleDashedIcon, MessageCircle, XIcon, ChevronUp, ChevronDown,
|
|
3
|
+
import { createContext, forwardRef, useContext, useState, useRef, useId, useEffect, useCallback, useLayoutEffect, isValidElement, cloneElement, useMemo } from 'react';
|
|
4
|
+
import { ChevronsUpDown, CheckIcon, Smile, SearchIcon, Search, Clock, Flag, Hash, Lightbulb, Trophy, Plane, Apple, Leaf, Hand, Loader2, AlertTriangle, Inbox, X, ChevronLeft, ChevronRight, Monitor, Sun, Moon, Building2, Check, Plus, Languages, BadgeCheck, Settings, User, Activity, LogOut, LogIn, Bell, Upload, Move, ZoomOut, ZoomIn, RotateCcw, RotateCw, Grid3X3, RefreshCw, Pencil, ArrowDownIcon, MessageCircleDashedIcon, MessageCircle, XIcon, ChevronUp, ChevronDown, CircleIcon } from 'lucide-react';
|
|
5
5
|
import { clsx } from 'clsx';
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
7
|
import { cva } from 'class-variance-authority';
|
|
@@ -13,9 +13,9 @@ import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
|
13
13
|
import { useTheme } from 'next-themes';
|
|
14
14
|
import { useReducedMotion, AnimatePresence, motion } from 'framer-motion';
|
|
15
15
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
16
|
+
import { Drawer as Drawer$1 } from 'vaul';
|
|
16
17
|
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
17
18
|
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
18
|
-
import { Drawer as Drawer$1 } from 'vaul';
|
|
19
19
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
20
20
|
import { Command as Command$1 } from 'cmdk';
|
|
21
21
|
import * as RPNInput from 'react-phone-number-input';
|
|
@@ -1918,50 +1918,6 @@ function DropdownMenuShortcut({
|
|
|
1918
1918
|
}
|
|
1919
1919
|
);
|
|
1920
1920
|
}
|
|
1921
|
-
function DropdownMenuSub({
|
|
1922
|
-
...props
|
|
1923
|
-
}) {
|
|
1924
|
-
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
1925
|
-
}
|
|
1926
|
-
function DropdownMenuSubTrigger({
|
|
1927
|
-
className,
|
|
1928
|
-
inset,
|
|
1929
|
-
children,
|
|
1930
|
-
...props
|
|
1931
|
-
}) {
|
|
1932
|
-
return /* @__PURE__ */ jsxs(
|
|
1933
|
-
DropdownMenuPrimitive.SubTrigger,
|
|
1934
|
-
{
|
|
1935
|
-
"data-slot": "dropdown-menu-sub-trigger",
|
|
1936
|
-
"data-inset": inset,
|
|
1937
|
-
className: cn(
|
|
1938
|
-
"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",
|
|
1939
|
-
className
|
|
1940
|
-
),
|
|
1941
|
-
...props,
|
|
1942
|
-
children: [
|
|
1943
|
-
children,
|
|
1944
|
-
/* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto size-4" })
|
|
1945
|
-
]
|
|
1946
|
-
}
|
|
1947
|
-
);
|
|
1948
|
-
}
|
|
1949
|
-
function DropdownMenuSubContent({
|
|
1950
|
-
className,
|
|
1951
|
-
...props
|
|
1952
|
-
}) {
|
|
1953
|
-
return /* @__PURE__ */ jsx(
|
|
1954
|
-
DropdownMenuPrimitive.SubContent,
|
|
1955
|
-
{
|
|
1956
|
-
"data-slot": "dropdown-menu-sub-content",
|
|
1957
|
-
className: cn(
|
|
1958
|
-
"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",
|
|
1959
|
-
className
|
|
1960
|
-
),
|
|
1961
|
-
...props
|
|
1962
|
-
}
|
|
1963
|
-
);
|
|
1964
|
-
}
|
|
1965
1921
|
var defaultLabels = {
|
|
1966
1922
|
theme: "Theme",
|
|
1967
1923
|
system: "System",
|
|
@@ -2720,6 +2676,181 @@ function VerifiedProfessionalBadge({
|
|
|
2720
2676
|
}
|
|
2721
2677
|
);
|
|
2722
2678
|
}
|
|
2679
|
+
function useMediaQuery(query) {
|
|
2680
|
+
const [matches, setMatches] = useState(false);
|
|
2681
|
+
useEffect(() => {
|
|
2682
|
+
if (typeof window === "undefined" || !window.matchMedia) return;
|
|
2683
|
+
const mql = window.matchMedia(query);
|
|
2684
|
+
const onChange = () => setMatches(mql.matches);
|
|
2685
|
+
onChange();
|
|
2686
|
+
mql.addEventListener("change", onChange);
|
|
2687
|
+
return () => mql.removeEventListener("change", onChange);
|
|
2688
|
+
}, [query]);
|
|
2689
|
+
return matches;
|
|
2690
|
+
}
|
|
2691
|
+
function Drawer({
|
|
2692
|
+
repositionInputs = false,
|
|
2693
|
+
...props
|
|
2694
|
+
}) {
|
|
2695
|
+
return /* @__PURE__ */ jsx(
|
|
2696
|
+
Drawer$1.Root,
|
|
2697
|
+
{
|
|
2698
|
+
"data-slot": "drawer",
|
|
2699
|
+
repositionInputs,
|
|
2700
|
+
...props
|
|
2701
|
+
}
|
|
2702
|
+
);
|
|
2703
|
+
}
|
|
2704
|
+
function DrawerPortal({
|
|
2705
|
+
...props
|
|
2706
|
+
}) {
|
|
2707
|
+
return /* @__PURE__ */ jsx(Drawer$1.Portal, { "data-slot": "drawer-portal", ...props });
|
|
2708
|
+
}
|
|
2709
|
+
function DrawerClose({
|
|
2710
|
+
...props
|
|
2711
|
+
}) {
|
|
2712
|
+
return /* @__PURE__ */ jsx(Drawer$1.Close, { "data-slot": "drawer-close", ...props });
|
|
2713
|
+
}
|
|
2714
|
+
function DrawerOverlay({
|
|
2715
|
+
className,
|
|
2716
|
+
...props
|
|
2717
|
+
}) {
|
|
2718
|
+
return /* @__PURE__ */ jsx(
|
|
2719
|
+
Drawer$1.Overlay,
|
|
2720
|
+
{
|
|
2721
|
+
"data-slot": "drawer-overlay",
|
|
2722
|
+
className: cn(
|
|
2723
|
+
"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",
|
|
2724
|
+
className
|
|
2725
|
+
),
|
|
2726
|
+
...props
|
|
2727
|
+
}
|
|
2728
|
+
);
|
|
2729
|
+
}
|
|
2730
|
+
function DrawerContent({
|
|
2731
|
+
className,
|
|
2732
|
+
children,
|
|
2733
|
+
...props
|
|
2734
|
+
}) {
|
|
2735
|
+
return /* @__PURE__ */ jsxs(DrawerPortal, { "data-slot": "drawer-portal", children: [
|
|
2736
|
+
/* @__PURE__ */ jsx(DrawerOverlay, {}),
|
|
2737
|
+
/* @__PURE__ */ jsxs(
|
|
2738
|
+
Drawer$1.Content,
|
|
2739
|
+
{
|
|
2740
|
+
"data-slot": "drawer-content",
|
|
2741
|
+
className: cn(
|
|
2742
|
+
"group/drawer-content bg-background fixed z-50 flex h-auto flex-col",
|
|
2743
|
+
"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",
|
|
2744
|
+
"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",
|
|
2745
|
+
"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",
|
|
2746
|
+
"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",
|
|
2747
|
+
className
|
|
2748
|
+
),
|
|
2749
|
+
...props,
|
|
2750
|
+
children: [
|
|
2751
|
+
/* @__PURE__ */ 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" }),
|
|
2752
|
+
children
|
|
2753
|
+
]
|
|
2754
|
+
}
|
|
2755
|
+
)
|
|
2756
|
+
] });
|
|
2757
|
+
}
|
|
2758
|
+
function DrawerHeader({ className, ...props }) {
|
|
2759
|
+
return /* @__PURE__ */ jsx(
|
|
2760
|
+
"div",
|
|
2761
|
+
{
|
|
2762
|
+
"data-slot": "drawer-header",
|
|
2763
|
+
className: cn(
|
|
2764
|
+
"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",
|
|
2765
|
+
className
|
|
2766
|
+
),
|
|
2767
|
+
...props
|
|
2768
|
+
}
|
|
2769
|
+
);
|
|
2770
|
+
}
|
|
2771
|
+
function DrawerFooter({ className, ...props }) {
|
|
2772
|
+
return /* @__PURE__ */ jsx(
|
|
2773
|
+
"div",
|
|
2774
|
+
{
|
|
2775
|
+
"data-slot": "drawer-footer",
|
|
2776
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
2777
|
+
...props
|
|
2778
|
+
}
|
|
2779
|
+
);
|
|
2780
|
+
}
|
|
2781
|
+
function DrawerTitle({
|
|
2782
|
+
className,
|
|
2783
|
+
...props
|
|
2784
|
+
}) {
|
|
2785
|
+
return /* @__PURE__ */ jsx(
|
|
2786
|
+
Drawer$1.Title,
|
|
2787
|
+
{
|
|
2788
|
+
"data-slot": "drawer-title",
|
|
2789
|
+
className: cn("text-foreground font-semibold", className),
|
|
2790
|
+
...props
|
|
2791
|
+
}
|
|
2792
|
+
);
|
|
2793
|
+
}
|
|
2794
|
+
var ResponsiveMenuSurfaceContext = createContext("dropdown");
|
|
2795
|
+
function useResponsiveMenuSurface() {
|
|
2796
|
+
return useContext(ResponsiveMenuSurfaceContext);
|
|
2797
|
+
}
|
|
2798
|
+
function ResponsiveMenu({
|
|
2799
|
+
trigger,
|
|
2800
|
+
children,
|
|
2801
|
+
open,
|
|
2802
|
+
onOpenChange,
|
|
2803
|
+
title,
|
|
2804
|
+
align = "end",
|
|
2805
|
+
side,
|
|
2806
|
+
sideOffset,
|
|
2807
|
+
contentClassName,
|
|
2808
|
+
drawerClassName
|
|
2809
|
+
}) {
|
|
2810
|
+
const isMobile = useMediaQuery("(max-width: 767px)");
|
|
2811
|
+
if (isMobile) {
|
|
2812
|
+
const triggerNode = isValidElement(trigger) ? cloneElement(trigger, {
|
|
2813
|
+
onClick: (event) => {
|
|
2814
|
+
const original = trigger.props.onClick;
|
|
2815
|
+
original?.(event);
|
|
2816
|
+
if (!event.defaultPrevented) {
|
|
2817
|
+
onOpenChange(true);
|
|
2818
|
+
}
|
|
2819
|
+
}
|
|
2820
|
+
}) : /* @__PURE__ */ jsx("button", { type: "button", onClick: () => onOpenChange(true), children: trigger });
|
|
2821
|
+
return /* @__PURE__ */ jsxs(ResponsiveMenuSurfaceContext.Provider, { value: "drawer", children: [
|
|
2822
|
+
triggerNode,
|
|
2823
|
+
/* @__PURE__ */ jsx(Drawer, { open, onOpenChange, children: /* @__PURE__ */ jsxs(
|
|
2824
|
+
DrawerContent,
|
|
2825
|
+
{
|
|
2826
|
+
className: cn(
|
|
2827
|
+
"mx-auto flex max-h-[90vh] max-w-lg flex-col",
|
|
2828
|
+
drawerClassName
|
|
2829
|
+
),
|
|
2830
|
+
"data-testid": "responsive-menu-drawer",
|
|
2831
|
+
children: [
|
|
2832
|
+
title ? /* @__PURE__ */ jsx(DrawerHeader, { className: "text-left", children: /* @__PURE__ */ jsx(DrawerTitle, { children: title }) }) : /* @__PURE__ */ jsx(DrawerHeader, { className: "sr-only", children: /* @__PURE__ */ jsx(DrawerTitle, { children: "Menu" }) }),
|
|
2833
|
+
/* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-y-auto p-1 pb-4", children })
|
|
2834
|
+
]
|
|
2835
|
+
}
|
|
2836
|
+
) })
|
|
2837
|
+
] });
|
|
2838
|
+
}
|
|
2839
|
+
return /* @__PURE__ */ jsx(ResponsiveMenuSurfaceContext.Provider, { value: "dropdown", children: /* @__PURE__ */ jsxs(DropdownMenu, { open, onOpenChange, children: [
|
|
2840
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: trigger }),
|
|
2841
|
+
/* @__PURE__ */ jsx(
|
|
2842
|
+
DropdownMenuContent,
|
|
2843
|
+
{
|
|
2844
|
+
align,
|
|
2845
|
+
side,
|
|
2846
|
+
sideOffset,
|
|
2847
|
+
className: contentClassName,
|
|
2848
|
+
"data-testid": "responsive-menu-dropdown",
|
|
2849
|
+
children
|
|
2850
|
+
}
|
|
2851
|
+
)
|
|
2852
|
+
] }) });
|
|
2853
|
+
}
|
|
2723
2854
|
var defaultLabels3 = {
|
|
2724
2855
|
accountMenu: "Account menu",
|
|
2725
2856
|
settingsMenu: "Settings",
|
|
@@ -2740,6 +2871,8 @@ var defaultLabels3 = {
|
|
|
2740
2871
|
accountSettings: "Account settings"
|
|
2741
2872
|
};
|
|
2742
2873
|
var PLATFORM_ACCOUNT_ORG_COLLAPSE_AT = 4;
|
|
2874
|
+
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";
|
|
2875
|
+
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";
|
|
2743
2876
|
function mergePlatformAccountOrgs(memberOrgs, manageableOrgs) {
|
|
2744
2877
|
const manageableIds = new Set(manageableOrgs.map((org) => org.id));
|
|
2745
2878
|
const byId = /* @__PURE__ */ new Map();
|
|
@@ -2763,6 +2896,82 @@ function mergePlatformAccountOrgs(memberOrgs, manageableOrgs) {
|
|
|
2763
2896
|
}
|
|
2764
2897
|
return Array.from(byId.values());
|
|
2765
2898
|
}
|
|
2899
|
+
function PlatformAccountMenuItem({
|
|
2900
|
+
className,
|
|
2901
|
+
inset,
|
|
2902
|
+
variant = "default",
|
|
2903
|
+
disabled,
|
|
2904
|
+
asChild = false,
|
|
2905
|
+
onSelect,
|
|
2906
|
+
children,
|
|
2907
|
+
onClick
|
|
2908
|
+
}) {
|
|
2909
|
+
const surface = useResponsiveMenuSurface();
|
|
2910
|
+
if (surface === "dropdown") {
|
|
2911
|
+
return /* @__PURE__ */ jsx(
|
|
2912
|
+
DropdownMenuItem,
|
|
2913
|
+
{
|
|
2914
|
+
className,
|
|
2915
|
+
inset,
|
|
2916
|
+
variant,
|
|
2917
|
+
disabled,
|
|
2918
|
+
asChild,
|
|
2919
|
+
onSelect: (event) => {
|
|
2920
|
+
onSelect?.(event);
|
|
2921
|
+
},
|
|
2922
|
+
onClick,
|
|
2923
|
+
children
|
|
2924
|
+
}
|
|
2925
|
+
);
|
|
2926
|
+
}
|
|
2927
|
+
const Comp = asChild ? Slot : "button";
|
|
2928
|
+
return /* @__PURE__ */ jsx(
|
|
2929
|
+
Comp,
|
|
2930
|
+
{
|
|
2931
|
+
type: asChild ? void 0 : "button",
|
|
2932
|
+
role: "menuitem",
|
|
2933
|
+
"data-slot": "dropdown-menu-item",
|
|
2934
|
+
"data-inset": inset || void 0,
|
|
2935
|
+
"data-variant": variant,
|
|
2936
|
+
"data-disabled": disabled || void 0,
|
|
2937
|
+
disabled: asChild ? void 0 : disabled,
|
|
2938
|
+
"aria-disabled": disabled || void 0,
|
|
2939
|
+
className: cn(menuItemClassName, className),
|
|
2940
|
+
onClick: (event) => {
|
|
2941
|
+
if (disabled) {
|
|
2942
|
+
event.preventDefault();
|
|
2943
|
+
return;
|
|
2944
|
+
}
|
|
2945
|
+
onClick?.(event);
|
|
2946
|
+
onSelect?.({ preventDefault: () => void 0 });
|
|
2947
|
+
},
|
|
2948
|
+
children
|
|
2949
|
+
}
|
|
2950
|
+
);
|
|
2951
|
+
}
|
|
2952
|
+
function AccountMenuLabel({
|
|
2953
|
+
className,
|
|
2954
|
+
children
|
|
2955
|
+
}) {
|
|
2956
|
+
const surface = useResponsiveMenuSurface();
|
|
2957
|
+
if (surface === "dropdown") {
|
|
2958
|
+
return /* @__PURE__ */ jsx(DropdownMenuLabel, { className, children });
|
|
2959
|
+
}
|
|
2960
|
+
return /* @__PURE__ */ jsx("div", { className: cn("px-2 py-1.5 text-sm font-medium", className), children });
|
|
2961
|
+
}
|
|
2962
|
+
function AccountMenuSeparator({ className }) {
|
|
2963
|
+
const surface = useResponsiveMenuSurface();
|
|
2964
|
+
if (surface === "dropdown") {
|
|
2965
|
+
return /* @__PURE__ */ jsx(DropdownMenuSeparator, { className });
|
|
2966
|
+
}
|
|
2967
|
+
return /* @__PURE__ */ jsx(
|
|
2968
|
+
"div",
|
|
2969
|
+
{
|
|
2970
|
+
role: "separator",
|
|
2971
|
+
className: cn("bg-border -mx-1 my-1 h-px", className)
|
|
2972
|
+
}
|
|
2973
|
+
);
|
|
2974
|
+
}
|
|
2766
2975
|
function MenuAvatar({
|
|
2767
2976
|
name,
|
|
2768
2977
|
image,
|
|
@@ -2792,7 +3001,7 @@ function MenuAvatar({
|
|
|
2792
3001
|
}
|
|
2793
3002
|
);
|
|
2794
3003
|
}
|
|
2795
|
-
function
|
|
3004
|
+
function LanguageThemeExpand({
|
|
2796
3005
|
languages,
|
|
2797
3006
|
currentLanguage,
|
|
2798
3007
|
onLanguageChange,
|
|
@@ -2800,32 +3009,76 @@ function LanguageThemeSubs({
|
|
|
2800
3009
|
}) {
|
|
2801
3010
|
const { theme, setTheme } = useTheme();
|
|
2802
3011
|
const themeValue = theme ?? "system";
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
3012
|
+
const surface = useResponsiveMenuSurface();
|
|
3013
|
+
const [languageOpen, setLanguageOpen] = useState(false);
|
|
3014
|
+
const [themeOpen, setThemeOpen] = useState(false);
|
|
3015
|
+
function renderRadioOptions(value, onValueChange, options) {
|
|
3016
|
+
if (surface === "dropdown") {
|
|
3017
|
+
return /* @__PURE__ */ jsx(DropdownMenuRadioGroup, { value, onValueChange, children: options.map((option) => /* @__PURE__ */ jsx(DropdownMenuRadioItem, { value: option.value, children: option.label }, option.value)) });
|
|
3018
|
+
}
|
|
3019
|
+
return /* @__PURE__ */ jsx("div", { role: "group", children: options.map((option) => {
|
|
3020
|
+
const checked = value === option.value;
|
|
3021
|
+
return /* @__PURE__ */ jsxs(
|
|
3022
|
+
"button",
|
|
2811
3023
|
{
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
3024
|
+
type: "button",
|
|
3025
|
+
role: "menuitemradio",
|
|
3026
|
+
"aria-checked": checked,
|
|
3027
|
+
className: radioItemClassName,
|
|
3028
|
+
onClick: () => onValueChange(option.value),
|
|
3029
|
+
children: [
|
|
3030
|
+
/* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: checked ? /* @__PURE__ */ jsx(Check, { className: "size-4" }) : null }),
|
|
3031
|
+
option.label
|
|
3032
|
+
]
|
|
3033
|
+
},
|
|
3034
|
+
option.value
|
|
3035
|
+
);
|
|
3036
|
+
}) });
|
|
3037
|
+
}
|
|
3038
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3039
|
+
/* @__PURE__ */ jsxs(
|
|
3040
|
+
PlatformAccountMenuItem,
|
|
3041
|
+
{
|
|
3042
|
+
className: "gap-2",
|
|
3043
|
+
onSelect: (event) => {
|
|
3044
|
+
event.preventDefault();
|
|
3045
|
+
setLanguageOpen((open) => !open);
|
|
3046
|
+
},
|
|
3047
|
+
children: [
|
|
3048
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.language }),
|
|
3049
|
+
languageOpen ? /* @__PURE__ */ jsx(ChevronUp, { className: "size-4" }) : /* @__PURE__ */ jsx(ChevronDown, { className: "size-4" }),
|
|
3050
|
+
/* @__PURE__ */ jsx(Languages, { className: "size-4" })
|
|
3051
|
+
]
|
|
3052
|
+
}
|
|
3053
|
+
),
|
|
3054
|
+
languageOpen ? renderRadioOptions(
|
|
3055
|
+
currentLanguage,
|
|
3056
|
+
onLanguageChange,
|
|
3057
|
+
languages.map((lang) => ({
|
|
3058
|
+
value: lang.key,
|
|
3059
|
+
label: lang.nativeName
|
|
3060
|
+
}))
|
|
3061
|
+
) : null,
|
|
3062
|
+
/* @__PURE__ */ jsxs(
|
|
3063
|
+
PlatformAccountMenuItem,
|
|
3064
|
+
{
|
|
3065
|
+
className: "gap-2",
|
|
3066
|
+
onSelect: (event) => {
|
|
3067
|
+
event.preventDefault();
|
|
3068
|
+
setThemeOpen((open) => !open);
|
|
3069
|
+
},
|
|
3070
|
+
children: [
|
|
3071
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.theme }),
|
|
3072
|
+
themeOpen ? /* @__PURE__ */ jsx(ChevronUp, { className: "size-4" }) : /* @__PURE__ */ jsx(ChevronDown, { className: "size-4" }),
|
|
3073
|
+
themeValue === "light" ? /* @__PURE__ */ jsx(Sun, { className: "size-4" }) : themeValue === "dark" ? /* @__PURE__ */ jsx(Moon, { className: "size-4" }) : /* @__PURE__ */ jsx(Monitor, { className: "size-4" })
|
|
3074
|
+
]
|
|
3075
|
+
}
|
|
3076
|
+
),
|
|
3077
|
+
themeOpen ? renderRadioOptions(themeValue, setTheme, [
|
|
3078
|
+
{ value: "system", label: labels.themeSystem },
|
|
3079
|
+
{ value: "light", label: labels.themeLight },
|
|
3080
|
+
{ value: "dark", label: labels.themeDark }
|
|
3081
|
+
]) : null
|
|
2829
3082
|
] });
|
|
2830
3083
|
}
|
|
2831
3084
|
function OrgMenuRows({
|
|
@@ -2856,7 +3109,7 @@ function OrgMenuRows({
|
|
|
2856
3109
|
"data-testid": `platform-account-org-${org.id}`,
|
|
2857
3110
|
children: [
|
|
2858
3111
|
/* @__PURE__ */ jsx(
|
|
2859
|
-
|
|
3112
|
+
PlatformAccountMenuItem,
|
|
2860
3113
|
{
|
|
2861
3114
|
asChild: true,
|
|
2862
3115
|
className: cn("gap-2", org.canManage && "pr-9"),
|
|
@@ -2874,7 +3127,7 @@ function OrgMenuRows({
|
|
|
2874
3127
|
}
|
|
2875
3128
|
),
|
|
2876
3129
|
org.canManage ? /* @__PURE__ */ jsx(
|
|
2877
|
-
|
|
3130
|
+
PlatformAccountMenuItem,
|
|
2878
3131
|
{
|
|
2879
3132
|
asChild: true,
|
|
2880
3133
|
className: "absolute right-0.5 top-1/2 size-7 -translate-y-1/2 justify-center p-0",
|
|
@@ -2887,7 +3140,7 @@ function OrgMenuRows({
|
|
|
2887
3140
|
);
|
|
2888
3141
|
}),
|
|
2889
3142
|
collapsible ? /* @__PURE__ */ jsxs(
|
|
2890
|
-
|
|
3143
|
+
PlatformAccountMenuItem,
|
|
2891
3144
|
{
|
|
2892
3145
|
className: "gap-2",
|
|
2893
3146
|
onSelect: (event) => {
|
|
@@ -2927,6 +3180,7 @@ function PlatformAccountMenu({
|
|
|
2927
3180
|
className
|
|
2928
3181
|
}) {
|
|
2929
3182
|
const labels = { ...defaultLabels3, ...labelsProp };
|
|
3183
|
+
const [open, setOpen] = useState(false);
|
|
2930
3184
|
const [signingOut, setSigningOut] = useState(false);
|
|
2931
3185
|
const mergedOrgs = useMemo(
|
|
2932
3186
|
() => mergePlatformAccountOrgs(memberOrgs, manageableOrgs),
|
|
@@ -2977,120 +3231,180 @@ function PlatformAccountMenu({
|
|
|
2977
3231
|
children: /* @__PURE__ */ jsx(Settings, { className: "size-4" })
|
|
2978
3232
|
}
|
|
2979
3233
|
);
|
|
2980
|
-
return /* @__PURE__ */
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
{
|
|
2994
|
-
name: user.name,
|
|
2995
|
-
image: user.image,
|
|
2996
|
-
sizeClass: "size-9"
|
|
2997
|
-
}
|
|
2998
|
-
),
|
|
2999
|
-
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col", children: [
|
|
3000
|
-
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-1.5 truncate text-sm font-medium leading-tight", children: [
|
|
3001
|
-
/* @__PURE__ */ jsx("span", { className: "truncate", children: user.name }),
|
|
3002
|
-
variant === "platform" ? /* @__PURE__ */ jsx(
|
|
3003
|
-
VerifiedProfessionalBadge,
|
|
3004
|
-
{
|
|
3005
|
-
status: verificationStatus,
|
|
3006
|
-
professionLabel,
|
|
3007
|
-
className: "shrink-0"
|
|
3008
|
-
}
|
|
3009
|
-
) : null
|
|
3010
|
-
] }),
|
|
3011
|
-
/* @__PURE__ */ jsx("span", { className: "truncate text-xs text-muted-foreground leading-tight", children: user.email })
|
|
3012
|
-
] })
|
|
3013
|
-
] }),
|
|
3014
|
-
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
3015
|
-
variant === "platform" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3016
|
-
hasOrgs ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3017
|
-
/* @__PURE__ */ jsx(
|
|
3018
|
-
OrgMenuRows,
|
|
3019
|
-
{
|
|
3020
|
-
orgs: mergedOrgs,
|
|
3021
|
-
appUrl: urls.appUrl,
|
|
3022
|
-
adminUrl: urls.adminUrl,
|
|
3023
|
-
labels
|
|
3024
|
-
}
|
|
3025
|
-
),
|
|
3026
|
-
/* @__PURE__ */ jsx(DropdownMenuSeparator, {})
|
|
3027
|
-
] }) : null,
|
|
3028
|
-
/* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: accountHref, children: [
|
|
3029
|
-
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.personalProfile }),
|
|
3030
|
-
/* @__PURE__ */ jsx(User, { className: "size-4" })
|
|
3031
|
-
] }) }),
|
|
3032
|
-
/* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: activityHref, children: [
|
|
3033
|
-
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.activity }),
|
|
3034
|
-
/* @__PURE__ */ jsx(Activity, { className: "size-4" })
|
|
3035
|
-
] }) }),
|
|
3036
|
-
/* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: profileHref, children: [
|
|
3037
|
-
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.professionalProfile }),
|
|
3038
|
-
/* @__PURE__ */ jsx(User, { className: "size-4" })
|
|
3039
|
-
] }) }),
|
|
3040
|
-
extraItems,
|
|
3041
|
-
/* @__PURE__ */ jsx(DropdownMenuSeparator, {})
|
|
3042
|
-
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3043
|
-
/* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: accountHref, children: [
|
|
3044
|
-
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.accountSettings }),
|
|
3045
|
-
/* @__PURE__ */ jsx(Settings, { className: "size-4" })
|
|
3046
|
-
] }) }),
|
|
3047
|
-
extraItems,
|
|
3048
|
-
/* @__PURE__ */ jsx(DropdownMenuSeparator, {})
|
|
3049
|
-
] }),
|
|
3234
|
+
return /* @__PURE__ */ jsx(
|
|
3235
|
+
ResponsiveMenu,
|
|
3236
|
+
{
|
|
3237
|
+
open,
|
|
3238
|
+
onOpenChange: setOpen,
|
|
3239
|
+
trigger: triggerProp ?? defaultTrigger,
|
|
3240
|
+
align: contentAlign,
|
|
3241
|
+
side: contentSide,
|
|
3242
|
+
sideOffset: contentSideOffset,
|
|
3243
|
+
contentClassName: cn("min-w-60 rounded-lg", contentClassName),
|
|
3244
|
+
title: user ? labels.accountMenu : labels.settingsMenu,
|
|
3245
|
+
children: user ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3246
|
+
/* @__PURE__ */ jsxs(AccountMenuLabel, { className: "flex items-center gap-3 p-2 font-normal", children: [
|
|
3050
3247
|
/* @__PURE__ */ jsx(
|
|
3051
|
-
|
|
3248
|
+
MenuAvatar,
|
|
3052
3249
|
{
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
labels
|
|
3250
|
+
name: user.name,
|
|
3251
|
+
image: user.image,
|
|
3252
|
+
sizeClass: "size-9"
|
|
3057
3253
|
}
|
|
3058
3254
|
),
|
|
3059
|
-
/* @__PURE__ */ jsxs(
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
variant
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3255
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col", children: [
|
|
3256
|
+
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-1.5 truncate text-sm font-medium leading-tight", children: [
|
|
3257
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: user.name }),
|
|
3258
|
+
variant === "platform" ? /* @__PURE__ */ jsx(
|
|
3259
|
+
VerifiedProfessionalBadge,
|
|
3260
|
+
{
|
|
3261
|
+
status: verificationStatus,
|
|
3262
|
+
professionLabel,
|
|
3263
|
+
className: "shrink-0"
|
|
3264
|
+
}
|
|
3265
|
+
) : null
|
|
3266
|
+
] }),
|
|
3267
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-xs text-muted-foreground leading-tight", children: user.email })
|
|
3268
|
+
] })
|
|
3269
|
+
] }),
|
|
3270
|
+
/* @__PURE__ */ jsx(AccountMenuSeparator, {}),
|
|
3271
|
+
variant === "platform" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3272
|
+
hasOrgs ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3273
|
+
/* @__PURE__ */ jsx(
|
|
3274
|
+
OrgMenuRows,
|
|
3275
|
+
{
|
|
3276
|
+
orgs: mergedOrgs,
|
|
3277
|
+
appUrl: urls.appUrl,
|
|
3278
|
+
adminUrl: urls.adminUrl,
|
|
3279
|
+
labels
|
|
3280
|
+
}
|
|
3281
|
+
),
|
|
3282
|
+
/* @__PURE__ */ jsx(AccountMenuSeparator, {})
|
|
3283
|
+
] }) : null,
|
|
3284
|
+
/* @__PURE__ */ jsx(PlatformAccountMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: accountHref, children: [
|
|
3285
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.personalProfile }),
|
|
3286
|
+
/* @__PURE__ */ jsx(User, { className: "size-4" })
|
|
3287
|
+
] }) }),
|
|
3288
|
+
/* @__PURE__ */ jsx(PlatformAccountMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: activityHref, children: [
|
|
3289
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.activity }),
|
|
3290
|
+
/* @__PURE__ */ jsx(Activity, { className: "size-4" })
|
|
3291
|
+
] }) }),
|
|
3292
|
+
/* @__PURE__ */ jsx(PlatformAccountMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: profileHref, children: [
|
|
3293
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.professionalProfile }),
|
|
3294
|
+
/* @__PURE__ */ jsx(User, { className: "size-4" })
|
|
3295
|
+
] }) }),
|
|
3296
|
+
extraItems,
|
|
3297
|
+
/* @__PURE__ */ jsx(AccountMenuSeparator, {})
|
|
3075
3298
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3076
|
-
/* @__PURE__ */ jsx(
|
|
3077
|
-
|
|
3078
|
-
{
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3299
|
+
/* @__PURE__ */ jsx(PlatformAccountMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: accountHref, children: [
|
|
3300
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.accountSettings }),
|
|
3301
|
+
/* @__PURE__ */ jsx(Settings, { className: "size-4" })
|
|
3302
|
+
] }) }),
|
|
3303
|
+
extraItems,
|
|
3304
|
+
/* @__PURE__ */ jsx(AccountMenuSeparator, {})
|
|
3305
|
+
] }),
|
|
3306
|
+
/* @__PURE__ */ jsx(
|
|
3307
|
+
LanguageThemeExpand,
|
|
3308
|
+
{
|
|
3309
|
+
languages,
|
|
3310
|
+
currentLanguage,
|
|
3311
|
+
onLanguageChange,
|
|
3312
|
+
labels
|
|
3313
|
+
}
|
|
3314
|
+
),
|
|
3315
|
+
/* @__PURE__ */ jsxs(
|
|
3316
|
+
PlatformAccountMenuItem,
|
|
3317
|
+
{
|
|
3318
|
+
variant: "destructive",
|
|
3319
|
+
className: "gap-2",
|
|
3320
|
+
disabled: signingOut || !onSignOut,
|
|
3321
|
+
onSelect: (event) => {
|
|
3322
|
+
event.preventDefault();
|
|
3323
|
+
void handleSignOut();
|
|
3324
|
+
},
|
|
3325
|
+
children: [
|
|
3326
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: signingOut ? labels.signingOut : labels.signOut }),
|
|
3327
|
+
/* @__PURE__ */ jsx(LogOut, { className: "size-4" })
|
|
3328
|
+
]
|
|
3329
|
+
}
|
|
3330
|
+
)
|
|
3331
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3332
|
+
/* @__PURE__ */ jsx(
|
|
3333
|
+
LanguageThemeExpand,
|
|
3334
|
+
{
|
|
3335
|
+
languages,
|
|
3336
|
+
currentLanguage,
|
|
3337
|
+
onLanguageChange,
|
|
3338
|
+
labels
|
|
3339
|
+
}
|
|
3340
|
+
),
|
|
3341
|
+
/* @__PURE__ */ jsx(AccountMenuSeparator, {}),
|
|
3342
|
+
/* @__PURE__ */ jsx(PlatformAccountMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: loginHref, children: [
|
|
3343
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.signIn }),
|
|
3344
|
+
/* @__PURE__ */ jsx(LogIn, { className: "size-4" })
|
|
3345
|
+
] }) })
|
|
3346
|
+
] })
|
|
3347
|
+
}
|
|
3348
|
+
);
|
|
3349
|
+
}
|
|
3350
|
+
function defaultFormatTime(isoDate, language) {
|
|
3351
|
+
return new Date(isoDate).toLocaleString(
|
|
3352
|
+
language === "es" ? "es-ES" : "en-US",
|
|
3353
|
+
{
|
|
3354
|
+
dateStyle: "short",
|
|
3355
|
+
timeStyle: "short"
|
|
3356
|
+
}
|
|
3357
|
+
);
|
|
3358
|
+
}
|
|
3359
|
+
function NotificationInbox({
|
|
3360
|
+
notifications,
|
|
3361
|
+
labels,
|
|
3362
|
+
language = "es",
|
|
3363
|
+
formatTime,
|
|
3364
|
+
viewAllHref,
|
|
3365
|
+
renderLeading,
|
|
3366
|
+
emptyIcon: EmptyIcon = Bell,
|
|
3367
|
+
className,
|
|
3368
|
+
listClassName
|
|
3369
|
+
}) {
|
|
3370
|
+
const surface = useResponsiveMenuSurface();
|
|
3371
|
+
const format = formatTime ?? ((iso) => defaultFormatTime(iso, language));
|
|
3372
|
+
return /* @__PURE__ */ jsxs(
|
|
3373
|
+
"div",
|
|
3374
|
+
{
|
|
3375
|
+
className: cn("flex flex-col", className),
|
|
3376
|
+
"data-testid": "notification-inbox",
|
|
3377
|
+
children: [
|
|
3378
|
+
surface === "dropdown" ? /* @__PURE__ */ jsx("div", { className: "flex items-center justify-between border-b px-4 py-3", children: /* @__PURE__ */ jsx("h4", { className: "font-semibold", children: labels.title }) }) : null,
|
|
3379
|
+
/* @__PURE__ */ jsx("div", { className: cn("max-h-80 overflow-y-auto", listClassName), children: notifications.length === 0 ? /* @__PURE__ */ jsx(EmptyState, { variant: "compact", icon: EmptyIcon, title: labels.empty }) : /* @__PURE__ */ jsx("ul", { className: "flex flex-col", children: notifications.map((notification, index) => {
|
|
3380
|
+
const leading = renderLeading?.(notification) ?? null;
|
|
3381
|
+
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3382
|
+
leading,
|
|
3383
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1 space-y-1", children: [
|
|
3384
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium leading-none", children: notification.title }),
|
|
3385
|
+
/* @__PURE__ */ jsx("p", { className: "line-clamp-2 text-xs text-muted-foreground", children: notification.message }),
|
|
3386
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground/70", children: format(notification.createdAt) })
|
|
3387
|
+
] })
|
|
3388
|
+
] });
|
|
3389
|
+
const rowClass = cn(
|
|
3390
|
+
"flex gap-3 px-4 py-3",
|
|
3391
|
+
!notification.read && "bg-muted/30",
|
|
3392
|
+
notification.link && "transition-colors hover:bg-muted/50",
|
|
3393
|
+
index < notifications.length - 1 && "border-b"
|
|
3394
|
+
);
|
|
3395
|
+
return /* @__PURE__ */ jsx("li", { children: notification.link ? /* @__PURE__ */ jsx("a", { href: notification.link, className: rowClass, children: body }) : /* @__PURE__ */ jsx("div", { className: rowClass, children: body }) }, notification.id);
|
|
3396
|
+
}) }) }),
|
|
3397
|
+
viewAllHref && labels.viewAll ? /* @__PURE__ */ jsx("div", { className: "border-t px-4 py-2", children: /* @__PURE__ */ jsx(
|
|
3398
|
+
"a",
|
|
3399
|
+
{
|
|
3400
|
+
href: viewAllHref,
|
|
3401
|
+
className: "block text-center text-sm font-medium text-primary hover:underline",
|
|
3402
|
+
children: labels.viewAll
|
|
3403
|
+
}
|
|
3404
|
+
) }) : null
|
|
3405
|
+
]
|
|
3406
|
+
}
|
|
3407
|
+
);
|
|
3094
3408
|
}
|
|
3095
3409
|
function Slider({
|
|
3096
3410
|
className,
|
|
@@ -3698,110 +4012,7 @@ function AvatarEditor({
|
|
|
3698
4012
|
}
|
|
3699
4013
|
);
|
|
3700
4014
|
}
|
|
3701
|
-
function
|
|
3702
|
-
repositionInputs = false,
|
|
3703
|
-
...props
|
|
3704
|
-
}) {
|
|
3705
|
-
return /* @__PURE__ */ jsx(
|
|
3706
|
-
Drawer$1.Root,
|
|
3707
|
-
{
|
|
3708
|
-
"data-slot": "drawer",
|
|
3709
|
-
repositionInputs,
|
|
3710
|
-
...props
|
|
3711
|
-
}
|
|
3712
|
-
);
|
|
3713
|
-
}
|
|
3714
|
-
function DrawerPortal({
|
|
3715
|
-
...props
|
|
3716
|
-
}) {
|
|
3717
|
-
return /* @__PURE__ */ jsx(Drawer$1.Portal, { "data-slot": "drawer-portal", ...props });
|
|
3718
|
-
}
|
|
3719
|
-
function DrawerClose({
|
|
3720
|
-
...props
|
|
3721
|
-
}) {
|
|
3722
|
-
return /* @__PURE__ */ jsx(Drawer$1.Close, { "data-slot": "drawer-close", ...props });
|
|
3723
|
-
}
|
|
3724
|
-
function DrawerOverlay({
|
|
3725
|
-
className,
|
|
3726
|
-
...props
|
|
3727
|
-
}) {
|
|
3728
|
-
return /* @__PURE__ */ jsx(
|
|
3729
|
-
Drawer$1.Overlay,
|
|
3730
|
-
{
|
|
3731
|
-
"data-slot": "drawer-overlay",
|
|
3732
|
-
className: cn(
|
|
3733
|
-
"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",
|
|
3734
|
-
className
|
|
3735
|
-
),
|
|
3736
|
-
...props
|
|
3737
|
-
}
|
|
3738
|
-
);
|
|
3739
|
-
}
|
|
3740
|
-
function DrawerContent({
|
|
3741
|
-
className,
|
|
3742
|
-
children,
|
|
3743
|
-
...props
|
|
3744
|
-
}) {
|
|
3745
|
-
return /* @__PURE__ */ jsxs(DrawerPortal, { "data-slot": "drawer-portal", children: [
|
|
3746
|
-
/* @__PURE__ */ jsx(DrawerOverlay, {}),
|
|
3747
|
-
/* @__PURE__ */ jsxs(
|
|
3748
|
-
Drawer$1.Content,
|
|
3749
|
-
{
|
|
3750
|
-
"data-slot": "drawer-content",
|
|
3751
|
-
className: cn(
|
|
3752
|
-
"group/drawer-content bg-background fixed z-50 flex h-auto flex-col",
|
|
3753
|
-
"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",
|
|
3754
|
-
"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",
|
|
3755
|
-
"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",
|
|
3756
|
-
"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",
|
|
3757
|
-
className
|
|
3758
|
-
),
|
|
3759
|
-
...props,
|
|
3760
|
-
children: [
|
|
3761
|
-
/* @__PURE__ */ 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" }),
|
|
3762
|
-
children
|
|
3763
|
-
]
|
|
3764
|
-
}
|
|
3765
|
-
)
|
|
3766
|
-
] });
|
|
3767
|
-
}
|
|
3768
|
-
function DrawerHeader({ className, ...props }) {
|
|
3769
|
-
return /* @__PURE__ */ jsx(
|
|
3770
|
-
"div",
|
|
3771
|
-
{
|
|
3772
|
-
"data-slot": "drawer-header",
|
|
3773
|
-
className: cn(
|
|
3774
|
-
"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",
|
|
3775
|
-
className
|
|
3776
|
-
),
|
|
3777
|
-
...props
|
|
3778
|
-
}
|
|
3779
|
-
);
|
|
3780
|
-
}
|
|
3781
|
-
function DrawerFooter({ className, ...props }) {
|
|
3782
|
-
return /* @__PURE__ */ jsx(
|
|
3783
|
-
"div",
|
|
3784
|
-
{
|
|
3785
|
-
"data-slot": "drawer-footer",
|
|
3786
|
-
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
3787
|
-
...props
|
|
3788
|
-
}
|
|
3789
|
-
);
|
|
3790
|
-
}
|
|
3791
|
-
function DrawerTitle({
|
|
3792
|
-
className,
|
|
3793
|
-
...props
|
|
3794
|
-
}) {
|
|
3795
|
-
return /* @__PURE__ */ jsx(
|
|
3796
|
-
Drawer$1.Title,
|
|
3797
|
-
{
|
|
3798
|
-
"data-slot": "drawer-title",
|
|
3799
|
-
className: cn("text-foreground font-semibold", className),
|
|
3800
|
-
...props
|
|
3801
|
-
}
|
|
3802
|
-
);
|
|
3803
|
-
}
|
|
3804
|
-
function useMediaQuery(query) {
|
|
4015
|
+
function useMediaQuery2(query) {
|
|
3805
4016
|
const [matches, setMatches] = useState(false);
|
|
3806
4017
|
useEffect(() => {
|
|
3807
4018
|
const media = window.matchMedia(query);
|
|
@@ -3836,7 +4047,7 @@ function AvatarEditorDialog({
|
|
|
3836
4047
|
const [editedValue, setEditedValue] = useState(value ?? null);
|
|
3837
4048
|
const [isSaving, setIsSaving] = useState(false);
|
|
3838
4049
|
const [feedback, setFeedback] = useState(null);
|
|
3839
|
-
const isMobile =
|
|
4050
|
+
const isMobile = useMediaQuery2("(max-width: 640px)");
|
|
3840
4051
|
const caption = (placeholder ?? "").trim();
|
|
3841
4052
|
const handleOpenChange = useCallback(
|
|
3842
4053
|
(open) => {
|
|
@@ -4782,18 +4993,6 @@ function useDebouncedValueStrict(value, delayMs) {
|
|
|
4782
4993
|
}, [value, delayMs]);
|
|
4783
4994
|
return debounced;
|
|
4784
4995
|
}
|
|
4785
|
-
function useMediaQuery2(query) {
|
|
4786
|
-
const [matches, setMatches] = useState(false);
|
|
4787
|
-
useEffect(() => {
|
|
4788
|
-
if (typeof window === "undefined" || !window.matchMedia) return;
|
|
4789
|
-
const mql = window.matchMedia(query);
|
|
4790
|
-
const onChange = () => setMatches(mql.matches);
|
|
4791
|
-
onChange();
|
|
4792
|
-
mql.addEventListener("change", onChange);
|
|
4793
|
-
return () => mql.removeEventListener("change", onChange);
|
|
4794
|
-
}, [query]);
|
|
4795
|
-
return matches;
|
|
4796
|
-
}
|
|
4797
4996
|
function readMetrics() {
|
|
4798
4997
|
if (typeof window === "undefined") {
|
|
4799
4998
|
return { height: 0, offsetTop: 0, keyboardInset: 0 };
|
|
@@ -5722,7 +5921,7 @@ function SearchablePicker(props) {
|
|
|
5722
5921
|
const mode = props.mode ?? "single";
|
|
5723
5922
|
const labels = { ...defaultLabels4, ...userLabels };
|
|
5724
5923
|
const resolvedEmptyLabel = emptyLabel ?? labels.emptyOption;
|
|
5725
|
-
const isMobile =
|
|
5924
|
+
const isMobile = useMediaQuery("(max-width: 767px)");
|
|
5726
5925
|
const generatedId = useId();
|
|
5727
5926
|
const triggerId = id ?? generatedId;
|
|
5728
5927
|
const [uncontrolledOpen, setUncontrolledOpen] = useState(false);
|
|
@@ -6438,6 +6637,59 @@ var FlagComponent = ({ country, countryName }) => {
|
|
|
6438
6637
|
return /* @__PURE__ */ jsx("span", { className: "flex h-4 w-6 overflow-hidden rounded-sm bg-foreground/20 [&_svg:not([class*='size-'])]:size-full", children: Flag2 && /* @__PURE__ */ jsx(Flag2, { title: countryName }) });
|
|
6439
6638
|
};
|
|
6440
6639
|
|
|
6640
|
+
// src/lib/rfc.ts
|
|
6641
|
+
var RFC_PERSONA_FISICA_RE = /^[A-ZÑ&]{4}\d{6}[A-Z0-9]{2}[0-9A]$/;
|
|
6642
|
+
var RFC_PERSONA_MORAL_RE = /^[A-ZÑ&]{3}\d{6}[A-Z0-9]{2}[0-9A]$/;
|
|
6643
|
+
var RFC_INPUT_CHARS_RE = /[^A-ZÑ&0-9]/g;
|
|
6644
|
+
function normalizeRfc(rfc) {
|
|
6645
|
+
return rfc.trim().toUpperCase().replace(/\s|-/g, "");
|
|
6646
|
+
}
|
|
6647
|
+
function formatRfcInput(raw, kind = "both") {
|
|
6648
|
+
const cleaned = raw.toUpperCase().replace(RFC_INPUT_CHARS_RE, "");
|
|
6649
|
+
const max = kind === "moral" ? 12 : 13;
|
|
6650
|
+
return cleaned.slice(0, max);
|
|
6651
|
+
}
|
|
6652
|
+
function isValidPersonaFisicaRfc(rfc) {
|
|
6653
|
+
const value = normalizeRfc(rfc);
|
|
6654
|
+
return value.length === 13 && RFC_PERSONA_FISICA_RE.test(value);
|
|
6655
|
+
}
|
|
6656
|
+
function isValidPersonaMoralRfc(rfc) {
|
|
6657
|
+
const value = normalizeRfc(rfc);
|
|
6658
|
+
return value.length === 12 && RFC_PERSONA_MORAL_RE.test(value);
|
|
6659
|
+
}
|
|
6660
|
+
function isValidRfc(rfc) {
|
|
6661
|
+
return isValidPersonaFisicaRfc(rfc) || isValidPersonaMoralRfc(rfc);
|
|
6662
|
+
}
|
|
6663
|
+
var RfcInput = React2.forwardRef(
|
|
6664
|
+
({
|
|
6665
|
+
className,
|
|
6666
|
+
value,
|
|
6667
|
+
onChange,
|
|
6668
|
+
kind = "both",
|
|
6669
|
+
autoComplete = "off",
|
|
6670
|
+
...props
|
|
6671
|
+
}, ref) => {
|
|
6672
|
+
const maxLength = kind === "moral" ? 12 : 13;
|
|
6673
|
+
return /* @__PURE__ */ jsx(
|
|
6674
|
+
Input,
|
|
6675
|
+
{
|
|
6676
|
+
...props,
|
|
6677
|
+
ref,
|
|
6678
|
+
type: "text",
|
|
6679
|
+
autoCapitalize: "characters",
|
|
6680
|
+
autoCorrect: "off",
|
|
6681
|
+
spellCheck: false,
|
|
6682
|
+
autoComplete,
|
|
6683
|
+
maxLength,
|
|
6684
|
+
value,
|
|
6685
|
+
className: cn("uppercase tracking-wide", className),
|
|
6686
|
+
onChange: (event) => onChange(formatRfcInput(event.target.value, kind))
|
|
6687
|
+
}
|
|
6688
|
+
);
|
|
6689
|
+
}
|
|
6690
|
+
);
|
|
6691
|
+
RfcInput.displayName = "RfcInput";
|
|
6692
|
+
|
|
6441
6693
|
// src/data/mexicoStates.ts
|
|
6442
6694
|
var MEXICO_STATES = [
|
|
6443
6695
|
{ id: "MXAGU", name: "Aguascalientes" },
|
|
@@ -7957,7 +8209,7 @@ function SupportMessengerProvider({
|
|
|
7957
8209
|
searchThreshold = 8,
|
|
7958
8210
|
className
|
|
7959
8211
|
}) {
|
|
7960
|
-
const isMobile =
|
|
8212
|
+
const isMobile = useMediaQuery("(max-width: 767px)");
|
|
7961
8213
|
const { height: viewportHeight, keyboardInset } = useVisualViewportMetrics();
|
|
7962
8214
|
const dockRef = useRef(null);
|
|
7963
8215
|
const [listOpen, setListOpen] = useState(false);
|
|
@@ -9092,6 +9344,6 @@ function MembershipInvitePanel({
|
|
|
9092
9344
|
] });
|
|
9093
9345
|
}
|
|
9094
9346
|
|
|
9095
|
-
export { AvatarEditor, AvatarEditorDialog, BrandX, Bubble, BubbleContent, BubbleGroup, BubbleReactions, ChatMessageList, ConfirmDestructiveDialog, DEFAULT_EDITABLE_SECTION_LABELS, DataList, DataListItem, DropdownMenuItem, DropdownMenuSeparator, EditableSection, EmojiInput, EmojiPicker, EmojiPickerPopover, EmojiTextarea, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, ErrorState, ExpandableText, FieldMessage, ImageLightbox, LanguageContext, LanguageSwitcher, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, MediaCarousel, MediaViewerDialog, MembershipInvitePanel, Message, MessageAvatar, MessageComposer, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, OrgSwitcher, PLATFORM_ACCOUNT_ORG_COLLAPSE_AT, PaymentIcon, PhoneInput, PlatformAccountMenu, PlatformNavbar, SafeImage, ScrollRestorationProvider, SearchCommand, SearchablePicker, SupportMessengerProvider, ThemeSwitcher, VerifiedProfessionalBadge, ZOOM_PAN_MAX_SCALE, ZOOM_PAN_MIN_SCALE, ZOOM_PAN_SWIPE_COMMIT_PX, ZOOM_PAN_SWIPE_SNAP_MS, avatarFallbackStyle, blurDataUrlFromBlob, bubbleVariants, cn, createSupportChatClient, defaultLanguages, formatPaymentCardBrand, fuzzyMatch, getAvatarColors, getInitials, insertAtCaret, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, normalizePaymentCardBrand, paymentIconBrandFromStripe, paymentTypeFromStripeBrand, prefersReducedMotion, useDebouncedValue, useDebouncedValueStrict, useEditableSection, useLanguageContext,
|
|
9347
|
+
export { AvatarEditor, AvatarEditorDialog, BrandX, Bubble, BubbleContent, BubbleGroup, BubbleReactions, ChatMessageList, ConfirmDestructiveDialog, DEFAULT_EDITABLE_SECTION_LABELS, DataList, DataListItem, DropdownMenuItem, DropdownMenuSeparator, EditableSection, EmojiInput, EmojiPicker, EmojiPickerPopover, EmojiTextarea, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, ErrorState, ExpandableText, FieldMessage, ImageLightbox, LanguageContext, LanguageSwitcher, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, MediaCarousel, MediaViewerDialog, MembershipInvitePanel, Message, MessageAvatar, MessageComposer, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, NotificationInbox, OrgSwitcher, PLATFORM_ACCOUNT_ORG_COLLAPSE_AT, PaymentIcon, PhoneInput, PlatformAccountMenu, PlatformAccountMenuItem, PlatformNavbar, ResponsiveMenu, RfcInput, SafeImage, ScrollRestorationProvider, SearchCommand, SearchablePicker, SupportMessengerProvider, ThemeSwitcher, VerifiedProfessionalBadge, ZOOM_PAN_MAX_SCALE, ZOOM_PAN_MIN_SCALE, ZOOM_PAN_SWIPE_COMMIT_PX, ZOOM_PAN_SWIPE_SNAP_MS, avatarFallbackStyle, blurDataUrlFromBlob, bubbleVariants, cn, createSupportChatClient, defaultLanguages, formatPaymentCardBrand, formatRfcInput, fuzzyMatch, getAvatarColors, getInitials, insertAtCaret, isValidPersonaFisicaRfc, isValidPersonaMoralRfc, isValidRfc, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, normalizePaymentCardBrand, normalizeRfc, paymentIconBrandFromStripe, paymentTypeFromStripeBrand, prefersReducedMotion, useDebouncedValue, useDebouncedValueStrict, useEditableSection, useLanguageContext, useMediaQuery, useRealtimeChannel, useRegisterScrollContainer, useResponsiveMenuSurface, useRestorableState, useScrollFadeXEdges, useScrollRestorationContext, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional, useVisualViewportMetrics, useZoomPanGestures, zoomToward };
|
|
9096
9348
|
//# sourceMappingURL=index.js.map
|
|
9097
9349
|
//# sourceMappingURL=index.js.map
|