@sesionario/blocks 1.14.0 → 1.16.0
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 +521 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +132 -12
- package/dist/index.d.ts +132 -12
- package/dist/index.js +518 -69
- 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 React7 from 'react';
|
|
3
3
|
import { createContext, useContext, useState, useRef, useEffect, useLayoutEffect, useCallback, useId, 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, Upload, Move, ZoomOut, ZoomIn, RotateCcw, RotateCw, Grid3X3, RefreshCw,
|
|
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, Users, LayoutDashboard, LogOut, LogIn, Upload, Move, ZoomOut, ZoomIn, RotateCcw, RotateCw, Grid3X3, RefreshCw, Pencil, Play, AlertCircle, VolumeX, Pause, Volume1, Volume2, PictureInPicture2, Minimize, Maximize, ArrowDownIcon, MessageCircleDashedIcon, MessageCircle, ChevronRightIcon, XIcon, 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';
|
|
@@ -926,6 +926,38 @@ function DropdownMenuItem({
|
|
|
926
926
|
}
|
|
927
927
|
);
|
|
928
928
|
}
|
|
929
|
+
function DropdownMenuRadioGroup({
|
|
930
|
+
...props
|
|
931
|
+
}) {
|
|
932
|
+
return /* @__PURE__ */ jsx(
|
|
933
|
+
DropdownMenuPrimitive.RadioGroup,
|
|
934
|
+
{
|
|
935
|
+
"data-slot": "dropdown-menu-radio-group",
|
|
936
|
+
...props
|
|
937
|
+
}
|
|
938
|
+
);
|
|
939
|
+
}
|
|
940
|
+
function DropdownMenuRadioItem({
|
|
941
|
+
className,
|
|
942
|
+
children,
|
|
943
|
+
...props
|
|
944
|
+
}) {
|
|
945
|
+
return /* @__PURE__ */ jsxs(
|
|
946
|
+
DropdownMenuPrimitive.RadioItem,
|
|
947
|
+
{
|
|
948
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
949
|
+
className: cn(
|
|
950
|
+
"relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[highlighted]:[&_svg:not([class*='text-'])]:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:[&_svg:not([class*='text-'])]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
951
|
+
className
|
|
952
|
+
),
|
|
953
|
+
...props,
|
|
954
|
+
children: [
|
|
955
|
+
/* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CircleIcon, { className: "size-2 fill-current" }) }) }),
|
|
956
|
+
children
|
|
957
|
+
]
|
|
958
|
+
}
|
|
959
|
+
);
|
|
960
|
+
}
|
|
929
961
|
function DropdownMenuLabel({
|
|
930
962
|
className,
|
|
931
963
|
inset,
|
|
@@ -973,6 +1005,50 @@ function DropdownMenuShortcut({
|
|
|
973
1005
|
}
|
|
974
1006
|
);
|
|
975
1007
|
}
|
|
1008
|
+
function DropdownMenuSub({
|
|
1009
|
+
...props
|
|
1010
|
+
}) {
|
|
1011
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
1012
|
+
}
|
|
1013
|
+
function DropdownMenuSubTrigger({
|
|
1014
|
+
className,
|
|
1015
|
+
inset,
|
|
1016
|
+
children,
|
|
1017
|
+
...props
|
|
1018
|
+
}) {
|
|
1019
|
+
return /* @__PURE__ */ jsxs(
|
|
1020
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
1021
|
+
{
|
|
1022
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
1023
|
+
"data-inset": inset,
|
|
1024
|
+
className: cn(
|
|
1025
|
+
"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",
|
|
1026
|
+
className
|
|
1027
|
+
),
|
|
1028
|
+
...props,
|
|
1029
|
+
children: [
|
|
1030
|
+
children,
|
|
1031
|
+
/* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto size-4" })
|
|
1032
|
+
]
|
|
1033
|
+
}
|
|
1034
|
+
);
|
|
1035
|
+
}
|
|
1036
|
+
function DropdownMenuSubContent({
|
|
1037
|
+
className,
|
|
1038
|
+
...props
|
|
1039
|
+
}) {
|
|
1040
|
+
return /* @__PURE__ */ jsx(
|
|
1041
|
+
DropdownMenuPrimitive.SubContent,
|
|
1042
|
+
{
|
|
1043
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
1044
|
+
className: cn(
|
|
1045
|
+
"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",
|
|
1046
|
+
className
|
|
1047
|
+
),
|
|
1048
|
+
...props
|
|
1049
|
+
}
|
|
1050
|
+
);
|
|
1051
|
+
}
|
|
976
1052
|
var defaultLabels = {
|
|
977
1053
|
theme: "Theme",
|
|
978
1054
|
system: "System",
|
|
@@ -1465,7 +1541,7 @@ function LanguageSwitcher({
|
|
|
1465
1541
|
const sizes = sizeClasses2[size];
|
|
1466
1542
|
const shapeClass = shapeClasses2[shape];
|
|
1467
1543
|
const reduceMotion = useReducedMotion();
|
|
1468
|
-
const
|
|
1544
|
+
const defaultLabels6 = {
|
|
1469
1545
|
language: labels.language ?? "Language"
|
|
1470
1546
|
};
|
|
1471
1547
|
if (variant === "mini") {
|
|
@@ -1475,7 +1551,7 @@ function LanguageSwitcher({
|
|
|
1475
1551
|
{
|
|
1476
1552
|
variant: "ghost",
|
|
1477
1553
|
size: "icon",
|
|
1478
|
-
"aria-label":
|
|
1554
|
+
"aria-label": defaultLabels6.language,
|
|
1479
1555
|
className: cn(sizes.buttonMini, shapeClass, className),
|
|
1480
1556
|
children: /* @__PURE__ */ jsx(Languages, { className: sizes.iconMini })
|
|
1481
1557
|
}
|
|
@@ -1566,6 +1642,440 @@ function LanguageSwitcher({
|
|
|
1566
1642
|
}
|
|
1567
1643
|
);
|
|
1568
1644
|
}
|
|
1645
|
+
var SCROLL_EDGE_EPSILON_PX = 1;
|
|
1646
|
+
function measureScrollEdges(el) {
|
|
1647
|
+
const { scrollLeft, scrollWidth, clientWidth } = el;
|
|
1648
|
+
return {
|
|
1649
|
+
canScrollLeft: scrollLeft > SCROLL_EDGE_EPSILON_PX,
|
|
1650
|
+
canScrollRight: scrollLeft + clientWidth < scrollWidth - SCROLL_EDGE_EPSILON_PX
|
|
1651
|
+
};
|
|
1652
|
+
}
|
|
1653
|
+
function useScrollFadeXEdges(enabled = true) {
|
|
1654
|
+
const scrollerRef = useRef(null);
|
|
1655
|
+
const [edges, setEdges] = useState({
|
|
1656
|
+
canScrollLeft: false,
|
|
1657
|
+
canScrollRight: false
|
|
1658
|
+
});
|
|
1659
|
+
useEffect(() => {
|
|
1660
|
+
if (!enabled) {
|
|
1661
|
+
setEdges({ canScrollLeft: false, canScrollRight: false });
|
|
1662
|
+
return;
|
|
1663
|
+
}
|
|
1664
|
+
const el = scrollerRef.current;
|
|
1665
|
+
if (!el) return;
|
|
1666
|
+
function updateEdges() {
|
|
1667
|
+
const scroller = scrollerRef.current;
|
|
1668
|
+
if (!scroller) return;
|
|
1669
|
+
const next = measureScrollEdges(scroller);
|
|
1670
|
+
setEdges(
|
|
1671
|
+
(prev) => prev.canScrollLeft === next.canScrollLeft && prev.canScrollRight === next.canScrollRight ? prev : next
|
|
1672
|
+
);
|
|
1673
|
+
}
|
|
1674
|
+
updateEdges();
|
|
1675
|
+
el.addEventListener("scroll", updateEdges, { passive: true });
|
|
1676
|
+
const resizeObserver = new ResizeObserver(updateEdges);
|
|
1677
|
+
resizeObserver.observe(el);
|
|
1678
|
+
const mutationObserver = new MutationObserver(updateEdges);
|
|
1679
|
+
mutationObserver.observe(el, { childList: true, subtree: true });
|
|
1680
|
+
return () => {
|
|
1681
|
+
el.removeEventListener("scroll", updateEdges);
|
|
1682
|
+
resizeObserver.disconnect();
|
|
1683
|
+
mutationObserver.disconnect();
|
|
1684
|
+
};
|
|
1685
|
+
}, [enabled]);
|
|
1686
|
+
const fadeStyle = {
|
|
1687
|
+
"--scroll-fade-left": edges.canScrollLeft ? "transparent" : "#000",
|
|
1688
|
+
"--scroll-fade-right": edges.canScrollRight ? "transparent" : "#000"
|
|
1689
|
+
};
|
|
1690
|
+
return { scrollerRef, fadeStyle, edges };
|
|
1691
|
+
}
|
|
1692
|
+
function PlatformNavbar({
|
|
1693
|
+
logo,
|
|
1694
|
+
leading,
|
|
1695
|
+
center,
|
|
1696
|
+
right,
|
|
1697
|
+
className,
|
|
1698
|
+
innerClassName
|
|
1699
|
+
}) {
|
|
1700
|
+
const hasCenter = center != null && center !== false;
|
|
1701
|
+
const { scrollerRef, fadeStyle } = useScrollFadeXEdges(hasCenter);
|
|
1702
|
+
return /* @__PURE__ */ jsx(
|
|
1703
|
+
"header",
|
|
1704
|
+
{
|
|
1705
|
+
className: cn(
|
|
1706
|
+
"sticky top-0 z-30 shrink-0 border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",
|
|
1707
|
+
className
|
|
1708
|
+
),
|
|
1709
|
+
"data-testid": "platform-navbar",
|
|
1710
|
+
children: /* @__PURE__ */ jsxs(
|
|
1711
|
+
"div",
|
|
1712
|
+
{
|
|
1713
|
+
className: cn(
|
|
1714
|
+
"flex h-14 min-h-14 items-center gap-2 px-4 md:px-6",
|
|
1715
|
+
innerClassName
|
|
1716
|
+
),
|
|
1717
|
+
children: [
|
|
1718
|
+
/* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", children: logo }),
|
|
1719
|
+
leading ? /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", children: leading }) : null,
|
|
1720
|
+
/* @__PURE__ */ jsx(
|
|
1721
|
+
"div",
|
|
1722
|
+
{
|
|
1723
|
+
ref: scrollerRef,
|
|
1724
|
+
className: "flex min-w-0 flex-1 items-center overflow-x-auto scroll-fade-x-edges scrollbar-none",
|
|
1725
|
+
style: fadeStyle,
|
|
1726
|
+
children: center
|
|
1727
|
+
}
|
|
1728
|
+
),
|
|
1729
|
+
right ? /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", children: right }) : null
|
|
1730
|
+
]
|
|
1731
|
+
}
|
|
1732
|
+
)
|
|
1733
|
+
}
|
|
1734
|
+
);
|
|
1735
|
+
}
|
|
1736
|
+
var LABELS = {
|
|
1737
|
+
verified: "M\xE9dico verificado",
|
|
1738
|
+
pending_review: "Verificaci\xF3n en revisi\xF3n"
|
|
1739
|
+
};
|
|
1740
|
+
var sizeClasses3 = {
|
|
1741
|
+
sm: {
|
|
1742
|
+
icon: "size-3.5",
|
|
1743
|
+
text: "text-xs",
|
|
1744
|
+
gap: "gap-1",
|
|
1745
|
+
padding: "px-1.5 py-0.5"
|
|
1746
|
+
},
|
|
1747
|
+
md: {
|
|
1748
|
+
icon: "size-4",
|
|
1749
|
+
text: "text-sm",
|
|
1750
|
+
gap: "gap-1.5",
|
|
1751
|
+
padding: "px-2 py-0.5"
|
|
1752
|
+
}
|
|
1753
|
+
};
|
|
1754
|
+
function VerifiedProfessionalBadge({
|
|
1755
|
+
status,
|
|
1756
|
+
size = "md",
|
|
1757
|
+
showLabel = false,
|
|
1758
|
+
className
|
|
1759
|
+
}) {
|
|
1760
|
+
if (status === "unverified" || status === "pending_review" && !showLabel) {
|
|
1761
|
+
return null;
|
|
1762
|
+
}
|
|
1763
|
+
const label = LABELS[status];
|
|
1764
|
+
const sizes = sizeClasses3[size];
|
|
1765
|
+
const Icon = status === "verified" ? BadgeCheck : Clock;
|
|
1766
|
+
const colorClass = status === "verified" ? "text-primary" : "text-muted-foreground";
|
|
1767
|
+
if (!showLabel) {
|
|
1768
|
+
return /* @__PURE__ */ jsx(
|
|
1769
|
+
Icon,
|
|
1770
|
+
{
|
|
1771
|
+
className: cn(sizes.icon, colorClass, className),
|
|
1772
|
+
"aria-label": label,
|
|
1773
|
+
children: /* @__PURE__ */ jsx("title", { children: label })
|
|
1774
|
+
}
|
|
1775
|
+
);
|
|
1776
|
+
}
|
|
1777
|
+
return /* @__PURE__ */ jsxs(
|
|
1778
|
+
"span",
|
|
1779
|
+
{
|
|
1780
|
+
title: label,
|
|
1781
|
+
"aria-label": label,
|
|
1782
|
+
className: cn(
|
|
1783
|
+
"inline-flex w-fit items-center rounded-full font-medium",
|
|
1784
|
+
sizes.gap,
|
|
1785
|
+
sizes.text,
|
|
1786
|
+
sizes.padding,
|
|
1787
|
+
status === "verified" ? "bg-primary/10 text-primary" : "bg-muted text-muted-foreground",
|
|
1788
|
+
className
|
|
1789
|
+
),
|
|
1790
|
+
children: [
|
|
1791
|
+
/* @__PURE__ */ jsx(Icon, { className: sizes.icon, "aria-hidden": "true" }),
|
|
1792
|
+
/* @__PURE__ */ jsx("span", { children: label })
|
|
1793
|
+
]
|
|
1794
|
+
}
|
|
1795
|
+
);
|
|
1796
|
+
}
|
|
1797
|
+
var defaultLabels3 = {
|
|
1798
|
+
accountMenu: "Account menu",
|
|
1799
|
+
settingsMenu: "Settings",
|
|
1800
|
+
personalProfile: "Personal profile",
|
|
1801
|
+
activity: "Activity",
|
|
1802
|
+
professionalProfile: "Professional profile",
|
|
1803
|
+
mainApp: "Main app",
|
|
1804
|
+
orgManagement: "Organization management",
|
|
1805
|
+
backoffice: "Backoffice",
|
|
1806
|
+
memberOrgs: "My organizations",
|
|
1807
|
+
managementOrgs: "Management team",
|
|
1808
|
+
language: "Language",
|
|
1809
|
+
theme: "Theme",
|
|
1810
|
+
themeLight: "Light",
|
|
1811
|
+
themeDark: "Dark",
|
|
1812
|
+
themeSystem: "System",
|
|
1813
|
+
signIn: "Sign in",
|
|
1814
|
+
signOut: "Sign out",
|
|
1815
|
+
signingOut: "Signing out\u2026",
|
|
1816
|
+
accountSettings: "Account settings"
|
|
1817
|
+
};
|
|
1818
|
+
function MenuAvatar({
|
|
1819
|
+
name,
|
|
1820
|
+
image,
|
|
1821
|
+
sizeClass
|
|
1822
|
+
}) {
|
|
1823
|
+
const initials = getInitials(name);
|
|
1824
|
+
return /* @__PURE__ */ jsx(
|
|
1825
|
+
"span",
|
|
1826
|
+
{
|
|
1827
|
+
className: cn(
|
|
1828
|
+
"relative flex shrink-0 overflow-hidden rounded-full",
|
|
1829
|
+
sizeClass
|
|
1830
|
+
),
|
|
1831
|
+
children: image ? /* @__PURE__ */ jsx(
|
|
1832
|
+
"img",
|
|
1833
|
+
{
|
|
1834
|
+
src: image,
|
|
1835
|
+
alt: "",
|
|
1836
|
+
className: "aspect-square size-full object-cover"
|
|
1837
|
+
}
|
|
1838
|
+
) : /* @__PURE__ */ jsx(
|
|
1839
|
+
"span",
|
|
1840
|
+
{
|
|
1841
|
+
className: "flex size-full items-center justify-center text-xs font-semibold",
|
|
1842
|
+
style: avatarFallbackStyle(name),
|
|
1843
|
+
children: initials
|
|
1844
|
+
}
|
|
1845
|
+
)
|
|
1846
|
+
}
|
|
1847
|
+
);
|
|
1848
|
+
}
|
|
1849
|
+
function LanguageThemeSubs({
|
|
1850
|
+
languages,
|
|
1851
|
+
currentLanguage,
|
|
1852
|
+
onLanguageChange,
|
|
1853
|
+
labels
|
|
1854
|
+
}) {
|
|
1855
|
+
const { theme, setTheme } = useTheme();
|
|
1856
|
+
const themeValue = theme ?? "system";
|
|
1857
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1858
|
+
/* @__PURE__ */ jsxs(DropdownMenuSub, { children: [
|
|
1859
|
+
/* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { className: "gap-2", children: [
|
|
1860
|
+
/* @__PURE__ */ jsx(Languages, { className: "size-4" }),
|
|
1861
|
+
labels.language
|
|
1862
|
+
] }),
|
|
1863
|
+
/* @__PURE__ */ jsx(DropdownMenuSubContent, { className: "min-w-40", children: /* @__PURE__ */ jsx(
|
|
1864
|
+
DropdownMenuRadioGroup,
|
|
1865
|
+
{
|
|
1866
|
+
value: currentLanguage,
|
|
1867
|
+
onValueChange: onLanguageChange,
|
|
1868
|
+
children: languages.map((lang) => /* @__PURE__ */ jsx(DropdownMenuRadioItem, { value: lang.key, children: lang.nativeName }, lang.key))
|
|
1869
|
+
}
|
|
1870
|
+
) })
|
|
1871
|
+
] }),
|
|
1872
|
+
/* @__PURE__ */ jsxs(DropdownMenuSub, { children: [
|
|
1873
|
+
/* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { className: "gap-2", children: [
|
|
1874
|
+
themeValue === "light" ? /* @__PURE__ */ jsx(Sun, { className: "size-4" }) : themeValue === "dark" ? /* @__PURE__ */ jsx(Moon, { className: "size-4" }) : /* @__PURE__ */ jsx(Monitor, { className: "size-4" }),
|
|
1875
|
+
labels.theme
|
|
1876
|
+
] }),
|
|
1877
|
+
/* @__PURE__ */ jsx(DropdownMenuSubContent, { className: "min-w-40", children: /* @__PURE__ */ jsxs(DropdownMenuRadioGroup, { value: themeValue, onValueChange: setTheme, children: [
|
|
1878
|
+
/* @__PURE__ */ jsx(DropdownMenuRadioItem, { value: "system", children: labels.themeSystem }),
|
|
1879
|
+
/* @__PURE__ */ jsx(DropdownMenuRadioItem, { value: "light", children: labels.themeLight }),
|
|
1880
|
+
/* @__PURE__ */ jsx(DropdownMenuRadioItem, { value: "dark", children: labels.themeDark })
|
|
1881
|
+
] }) })
|
|
1882
|
+
] })
|
|
1883
|
+
] });
|
|
1884
|
+
}
|
|
1885
|
+
function PlatformAccountMenu({
|
|
1886
|
+
variant = "platform",
|
|
1887
|
+
isPending = false,
|
|
1888
|
+
user = null,
|
|
1889
|
+
isAdmin = false,
|
|
1890
|
+
verificationStatus = "unverified",
|
|
1891
|
+
urls,
|
|
1892
|
+
memberOrgs = [],
|
|
1893
|
+
manageableOrgs = [],
|
|
1894
|
+
languages = defaultLanguages,
|
|
1895
|
+
currentLanguage,
|
|
1896
|
+
onLanguageChange,
|
|
1897
|
+
labels: labelsProp,
|
|
1898
|
+
onSignOut,
|
|
1899
|
+
extraItems,
|
|
1900
|
+
trigger: triggerProp,
|
|
1901
|
+
contentSide,
|
|
1902
|
+
contentAlign = "end",
|
|
1903
|
+
contentSideOffset,
|
|
1904
|
+
contentClassName,
|
|
1905
|
+
className
|
|
1906
|
+
}) {
|
|
1907
|
+
const labels = { ...defaultLabels3, ...labelsProp };
|
|
1908
|
+
const [signingOut, setSigningOut] = useState(false);
|
|
1909
|
+
const loginHref = `${urls.authAppUrl}${urls.loginPath ?? "/login"}`;
|
|
1910
|
+
const accountHref = `${urls.authAppUrl}${urls.accountPath ?? "/account"}`;
|
|
1911
|
+
const activityHref = `${urls.authAppUrl}${urls.activityPath ?? "/account/activity"}`;
|
|
1912
|
+
const profileHref = `${urls.appUrl}${urls.professionalProfilePath ?? "/profile"}`;
|
|
1913
|
+
async function handleSignOut() {
|
|
1914
|
+
if (!onSignOut) return;
|
|
1915
|
+
setSigningOut(true);
|
|
1916
|
+
try {
|
|
1917
|
+
await onSignOut();
|
|
1918
|
+
} finally {
|
|
1919
|
+
setSigningOut(false);
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1922
|
+
if (isPending) {
|
|
1923
|
+
return /* @__PURE__ */ jsx(
|
|
1924
|
+
"div",
|
|
1925
|
+
{
|
|
1926
|
+
className: cn(
|
|
1927
|
+
"size-9 shrink-0 animate-pulse rounded-full bg-muted",
|
|
1928
|
+
className
|
|
1929
|
+
),
|
|
1930
|
+
"aria-hidden": true
|
|
1931
|
+
}
|
|
1932
|
+
);
|
|
1933
|
+
}
|
|
1934
|
+
const defaultTrigger = user ? /* @__PURE__ */ jsx(
|
|
1935
|
+
Button,
|
|
1936
|
+
{
|
|
1937
|
+
variant: "ghost",
|
|
1938
|
+
size: "icon",
|
|
1939
|
+
className: cn("size-9 rounded-full", className),
|
|
1940
|
+
"aria-label": labels.accountMenu,
|
|
1941
|
+
children: /* @__PURE__ */ jsx(MenuAvatar, { name: user.name, image: user.image, sizeClass: "size-8" })
|
|
1942
|
+
}
|
|
1943
|
+
) : /* @__PURE__ */ jsx(
|
|
1944
|
+
Button,
|
|
1945
|
+
{
|
|
1946
|
+
variant: "ghost",
|
|
1947
|
+
size: "icon",
|
|
1948
|
+
className: cn("size-9", className),
|
|
1949
|
+
"aria-label": labels.settingsMenu,
|
|
1950
|
+
children: /* @__PURE__ */ jsx(Settings, { className: "size-4" })
|
|
1951
|
+
}
|
|
1952
|
+
);
|
|
1953
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
1954
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: triggerProp ?? defaultTrigger }),
|
|
1955
|
+
/* @__PURE__ */ jsx(
|
|
1956
|
+
DropdownMenuContent,
|
|
1957
|
+
{
|
|
1958
|
+
side: contentSide,
|
|
1959
|
+
align: contentAlign,
|
|
1960
|
+
sideOffset: contentSideOffset,
|
|
1961
|
+
className: cn("min-w-60 rounded-lg", contentClassName),
|
|
1962
|
+
children: user ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1963
|
+
/* @__PURE__ */ jsxs(DropdownMenuLabel, { className: "flex items-center gap-3 p-2 font-normal", children: [
|
|
1964
|
+
/* @__PURE__ */ jsx(
|
|
1965
|
+
MenuAvatar,
|
|
1966
|
+
{
|
|
1967
|
+
name: user.name,
|
|
1968
|
+
image: user.image,
|
|
1969
|
+
sizeClass: "size-9"
|
|
1970
|
+
}
|
|
1971
|
+
),
|
|
1972
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col", children: [
|
|
1973
|
+
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-1.5 truncate text-sm font-medium leading-tight", children: [
|
|
1974
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: user.name }),
|
|
1975
|
+
variant === "platform" ? /* @__PURE__ */ jsx(
|
|
1976
|
+
VerifiedProfessionalBadge,
|
|
1977
|
+
{
|
|
1978
|
+
status: verificationStatus,
|
|
1979
|
+
className: "shrink-0"
|
|
1980
|
+
}
|
|
1981
|
+
) : null
|
|
1982
|
+
] }),
|
|
1983
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-xs text-muted-foreground leading-tight", children: user.email })
|
|
1984
|
+
] })
|
|
1985
|
+
] }),
|
|
1986
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
1987
|
+
variant === "platform" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1988
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: accountHref, children: [
|
|
1989
|
+
/* @__PURE__ */ jsx(User, { className: "size-4" }),
|
|
1990
|
+
labels.personalProfile
|
|
1991
|
+
] }) }),
|
|
1992
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: activityHref, children: [
|
|
1993
|
+
/* @__PURE__ */ jsx(Activity, { className: "size-4" }),
|
|
1994
|
+
labels.activity
|
|
1995
|
+
] }) }),
|
|
1996
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: profileHref, children: [
|
|
1997
|
+
/* @__PURE__ */ jsx(User, { className: "size-4" }),
|
|
1998
|
+
labels.professionalProfile
|
|
1999
|
+
] }) }),
|
|
2000
|
+
memberOrgs.length > 0 ? /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [
|
|
2001
|
+
/* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { className: "gap-2", children: [
|
|
2002
|
+
/* @__PURE__ */ jsx(Users, { className: "size-4" }),
|
|
2003
|
+
labels.memberOrgs
|
|
2004
|
+
] }),
|
|
2005
|
+
/* @__PURE__ */ jsx(DropdownMenuSubContent, { className: "min-w-48 max-h-64 overflow-y-auto scroll-fade-b", children: memberOrgs.map((org) => /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsx("a", { href: `${urls.appUrl}/o/${org.slug}`, children: org.name }) }, org.id)) })
|
|
2006
|
+
] }) : null,
|
|
2007
|
+
manageableOrgs.length > 0 ? /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [
|
|
2008
|
+
/* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { className: "gap-2", children: [
|
|
2009
|
+
/* @__PURE__ */ jsx(Building2, { className: "size-4" }),
|
|
2010
|
+
labels.managementOrgs
|
|
2011
|
+
] }),
|
|
2012
|
+
/* @__PURE__ */ jsx(DropdownMenuSubContent, { className: "min-w-48 max-h-64 overflow-y-auto scroll-fade-b", children: manageableOrgs.map((org) => /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
2013
|
+
"a",
|
|
2014
|
+
{
|
|
2015
|
+
href: `${urls.adminUrl}/api/auth/org/select?id=${encodeURIComponent(org.id)}`,
|
|
2016
|
+
children: org.name
|
|
2017
|
+
}
|
|
2018
|
+
) }, org.id)) })
|
|
2019
|
+
] }) : null,
|
|
2020
|
+
extraItems,
|
|
2021
|
+
isAdmin && urls.backofficeUrl ? /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: urls.backofficeUrl, children: [
|
|
2022
|
+
/* @__PURE__ */ jsx(LayoutDashboard, { className: "size-4" }),
|
|
2023
|
+
labels.backoffice
|
|
2024
|
+
] }) }) : null,
|
|
2025
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {})
|
|
2026
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2027
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: accountHref, children: [
|
|
2028
|
+
/* @__PURE__ */ jsx(Settings, { className: "size-4" }),
|
|
2029
|
+
labels.accountSettings
|
|
2030
|
+
] }) }),
|
|
2031
|
+
extraItems,
|
|
2032
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {})
|
|
2033
|
+
] }),
|
|
2034
|
+
/* @__PURE__ */ jsx(
|
|
2035
|
+
LanguageThemeSubs,
|
|
2036
|
+
{
|
|
2037
|
+
languages,
|
|
2038
|
+
currentLanguage,
|
|
2039
|
+
onLanguageChange,
|
|
2040
|
+
labels
|
|
2041
|
+
}
|
|
2042
|
+
),
|
|
2043
|
+
/* @__PURE__ */ jsxs(
|
|
2044
|
+
DropdownMenuItem,
|
|
2045
|
+
{
|
|
2046
|
+
variant: "destructive",
|
|
2047
|
+
className: "gap-2",
|
|
2048
|
+
disabled: signingOut || !onSignOut,
|
|
2049
|
+
onSelect: (event) => {
|
|
2050
|
+
event.preventDefault();
|
|
2051
|
+
void handleSignOut();
|
|
2052
|
+
},
|
|
2053
|
+
children: [
|
|
2054
|
+
/* @__PURE__ */ jsx(LogOut, { className: "size-4" }),
|
|
2055
|
+
signingOut ? labels.signingOut : labels.signOut
|
|
2056
|
+
]
|
|
2057
|
+
}
|
|
2058
|
+
)
|
|
2059
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2060
|
+
/* @__PURE__ */ jsx(
|
|
2061
|
+
LanguageThemeSubs,
|
|
2062
|
+
{
|
|
2063
|
+
languages,
|
|
2064
|
+
currentLanguage,
|
|
2065
|
+
onLanguageChange,
|
|
2066
|
+
labels
|
|
2067
|
+
}
|
|
2068
|
+
),
|
|
2069
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
2070
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: loginHref, children: [
|
|
2071
|
+
/* @__PURE__ */ jsx(LogIn, { className: "size-4" }),
|
|
2072
|
+
labels.signIn
|
|
2073
|
+
] }) })
|
|
2074
|
+
] })
|
|
2075
|
+
}
|
|
2076
|
+
)
|
|
2077
|
+
] });
|
|
2078
|
+
}
|
|
1569
2079
|
function Slider({
|
|
1570
2080
|
className,
|
|
1571
2081
|
defaultValue,
|
|
@@ -4884,7 +5394,7 @@ function SearchablePickerList({
|
|
|
4884
5394
|
] })
|
|
4885
5395
|
] });
|
|
4886
5396
|
}
|
|
4887
|
-
var
|
|
5397
|
+
var defaultLabels4 = {
|
|
4888
5398
|
placeholder: "Seleccionar\u2026",
|
|
4889
5399
|
searchPlaceholder: "Buscar\u2026",
|
|
4890
5400
|
empty: "No se encontraron resultados",
|
|
@@ -4957,7 +5467,7 @@ function SearchablePicker(props) {
|
|
|
4957
5467
|
"aria-label": ariaLabel
|
|
4958
5468
|
} = props;
|
|
4959
5469
|
const mode = props.mode ?? "single";
|
|
4960
|
-
const labels = { ...
|
|
5470
|
+
const labels = { ...defaultLabels4, ...userLabels };
|
|
4961
5471
|
const resolvedEmptyLabel = emptyLabel ?? labels.emptyOption;
|
|
4962
5472
|
const isMobile = useMediaQuery2("(max-width: 767px)");
|
|
4963
5473
|
const generatedId = useId();
|
|
@@ -5297,7 +5807,7 @@ function SearchablePicker(props) {
|
|
|
5297
5807
|
clearButton
|
|
5298
5808
|
] });
|
|
5299
5809
|
}
|
|
5300
|
-
var
|
|
5810
|
+
var defaultLabels5 = {
|
|
5301
5811
|
placeholder: "Buscar en toda la plataforma\u2026",
|
|
5302
5812
|
dialogTitle: "Buscar",
|
|
5303
5813
|
dialogDescription: "Busca funcionalidades, eventos, documentos y m\xE1s",
|
|
@@ -5331,7 +5841,7 @@ function SearchCommand({
|
|
|
5331
5841
|
debounceMs = 200,
|
|
5332
5842
|
className
|
|
5333
5843
|
}) {
|
|
5334
|
-
const labels = { ...
|
|
5844
|
+
const labels = { ...defaultLabels5, ...userLabels };
|
|
5335
5845
|
const [query, setQuery] = useState("");
|
|
5336
5846
|
const [hits, setHits] = useState([]);
|
|
5337
5847
|
const [isLoading, setIsLoading] = useState(false);
|
|
@@ -5773,67 +6283,6 @@ function MexicoMap({ selected, onToggle, className }) {
|
|
|
5773
6283
|
}
|
|
5774
6284
|
);
|
|
5775
6285
|
}
|
|
5776
|
-
var LABELS = {
|
|
5777
|
-
verified: "M\xE9dico verificado",
|
|
5778
|
-
pending_review: "Verificaci\xF3n en revisi\xF3n"
|
|
5779
|
-
};
|
|
5780
|
-
var sizeClasses3 = {
|
|
5781
|
-
sm: {
|
|
5782
|
-
icon: "size-3.5",
|
|
5783
|
-
text: "text-xs",
|
|
5784
|
-
gap: "gap-1",
|
|
5785
|
-
padding: "px-1.5 py-0.5"
|
|
5786
|
-
},
|
|
5787
|
-
md: {
|
|
5788
|
-
icon: "size-4",
|
|
5789
|
-
text: "text-sm",
|
|
5790
|
-
gap: "gap-1.5",
|
|
5791
|
-
padding: "px-2 py-0.5"
|
|
5792
|
-
}
|
|
5793
|
-
};
|
|
5794
|
-
function VerifiedProfessionalBadge({
|
|
5795
|
-
status,
|
|
5796
|
-
size = "md",
|
|
5797
|
-
showLabel = false,
|
|
5798
|
-
className
|
|
5799
|
-
}) {
|
|
5800
|
-
if (status === "unverified" || status === "pending_review" && !showLabel) {
|
|
5801
|
-
return null;
|
|
5802
|
-
}
|
|
5803
|
-
const label = LABELS[status];
|
|
5804
|
-
const sizes = sizeClasses3[size];
|
|
5805
|
-
const Icon = status === "verified" ? BadgeCheck : Clock;
|
|
5806
|
-
const colorClass = status === "verified" ? "text-primary" : "text-muted-foreground";
|
|
5807
|
-
if (!showLabel) {
|
|
5808
|
-
return /* @__PURE__ */ jsx(
|
|
5809
|
-
Icon,
|
|
5810
|
-
{
|
|
5811
|
-
className: cn(sizes.icon, colorClass, className),
|
|
5812
|
-
"aria-label": label,
|
|
5813
|
-
children: /* @__PURE__ */ jsx("title", { children: label })
|
|
5814
|
-
}
|
|
5815
|
-
);
|
|
5816
|
-
}
|
|
5817
|
-
return /* @__PURE__ */ jsxs(
|
|
5818
|
-
"span",
|
|
5819
|
-
{
|
|
5820
|
-
title: label,
|
|
5821
|
-
"aria-label": label,
|
|
5822
|
-
className: cn(
|
|
5823
|
-
"inline-flex w-fit items-center rounded-full font-medium",
|
|
5824
|
-
sizes.gap,
|
|
5825
|
-
sizes.text,
|
|
5826
|
-
sizes.padding,
|
|
5827
|
-
status === "verified" ? "bg-primary/10 text-primary" : "bg-muted text-muted-foreground",
|
|
5828
|
-
className
|
|
5829
|
-
),
|
|
5830
|
-
children: [
|
|
5831
|
-
/* @__PURE__ */ jsx(Icon, { className: sizes.icon, "aria-hidden": "true" }),
|
|
5832
|
-
/* @__PURE__ */ jsx("span", { children: label })
|
|
5833
|
-
]
|
|
5834
|
-
}
|
|
5835
|
-
);
|
|
5836
|
-
}
|
|
5837
6286
|
function MessageGroup({ className, ...props }) {
|
|
5838
6287
|
return /* @__PURE__ */ jsx(
|
|
5839
6288
|
"div",
|
|
@@ -7147,6 +7596,6 @@ function useRealtimeChannel({
|
|
|
7147
7596
|
}, [enabled, reconnectDelayMs]);
|
|
7148
7597
|
}
|
|
7149
7598
|
|
|
7150
|
-
export { AvatarEditor, AvatarEditorDialog, Bubble, BubbleContent, BubbleGroup, BubbleReactions, ChatMessageList, ConfirmDestructiveDialog, EmojiInput, EmojiPicker, EmojiPickerPopover, EmojiTextarea, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, ErrorState, ExpandableText, ImageLightbox, LanguageContext, LanguageSwitcher, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, Message, MessageAvatar, MessageComposer, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, OrgSwitcher, PhoneInput, SearchCommand, SearchablePicker, SupportMessengerProvider, ThemeSwitcher, VerifiedProfessionalBadge, VideoPlayer, avatarFallbackStyle, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, fuzzyMatch, getAvatarColors, getInitials, insertAtCaret, markerVariants, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, useMediaQuery2 as useMediaQuery, usePlaybackStats, useRealtimeChannel, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
|
|
7599
|
+
export { AvatarEditor, AvatarEditorDialog, Bubble, BubbleContent, BubbleGroup, BubbleReactions, ChatMessageList, ConfirmDestructiveDialog, DropdownMenuItem, DropdownMenuSeparator, EmojiInput, EmojiPicker, EmojiPickerPopover, EmojiTextarea, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, ErrorState, ExpandableText, ImageLightbox, LanguageContext, LanguageSwitcher, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, Message, MessageAvatar, MessageComposer, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, OrgSwitcher, PhoneInput, PlatformAccountMenu, PlatformNavbar, SearchCommand, SearchablePicker, SupportMessengerProvider, ThemeSwitcher, VerifiedProfessionalBadge, VideoPlayer, avatarFallbackStyle, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, fuzzyMatch, getAvatarColors, getInitials, insertAtCaret, markerVariants, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, useMediaQuery2 as useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
|
|
7151
7600
|
//# sourceMappingURL=index.js.map
|
|
7152
7601
|
//# sourceMappingURL=index.js.map
|