@sesionario/blocks 1.15.0 → 1.17.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.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import * as React7 from 'react';
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, BadgeCheck, Settings, User, Activity, LayoutDashboard, Users, 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';
3
+ import { createContext, useContext, useState, useRef, useEffect, useLayoutEffect, useCallback, useMemo, useId } 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, LayoutDashboard, LogOut, LogIn, Upload, Move, ZoomOut, ZoomIn, RotateCcw, RotateCw, Grid3X3, RefreshCw, Pencil, Play, AlertCircle, VolumeX, Pause, Volume1, Volume2, PictureInPicture2, Minimize, Maximize, ArrowDownIcon, MessageCircleDashedIcon, MessageCircle, ChevronUp, ChevronDown, XIcon, ChevronRightIcon, 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';
@@ -1642,6 +1642,53 @@ function LanguageSwitcher({
1642
1642
  }
1643
1643
  );
1644
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
+ }
1645
1692
  function PlatformNavbar({
1646
1693
  logo,
1647
1694
  leading,
@@ -1650,6 +1697,8 @@ function PlatformNavbar({
1650
1697
  className,
1651
1698
  innerClassName
1652
1699
  }) {
1700
+ const hasCenter = center != null && center !== false;
1701
+ const { scrollerRef, fadeStyle } = useScrollFadeXEdges(hasCenter);
1653
1702
  return /* @__PURE__ */ jsx(
1654
1703
  "header",
1655
1704
  {
@@ -1668,7 +1717,15 @@ function PlatformNavbar({
1668
1717
  children: [
1669
1718
  /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", children: logo }),
1670
1719
  leading ? /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", children: leading }) : null,
1671
- /* @__PURE__ */ jsx("div", { className: "flex min-w-0 flex-1 items-center overflow-x-auto", children: center }),
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
+ ),
1672
1729
  right ? /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", children: right }) : null
1673
1730
  ]
1674
1731
  }
@@ -1748,6 +1805,9 @@ var defaultLabels3 = {
1748
1805
  backoffice: "Backoffice",
1749
1806
  memberOrgs: "My organizations",
1750
1807
  managementOrgs: "Management team",
1808
+ showMoreOrgs: "Show more",
1809
+ showLessOrgs: "Show less",
1810
+ manageOrg: "Manage organization",
1751
1811
  language: "Language",
1752
1812
  theme: "Theme",
1753
1813
  themeLight: "Light",
@@ -1758,6 +1818,30 @@ var defaultLabels3 = {
1758
1818
  signingOut: "Signing out\u2026",
1759
1819
  accountSettings: "Account settings"
1760
1820
  };
1821
+ var PLATFORM_ACCOUNT_ORG_COLLAPSE_AT = 4;
1822
+ function mergePlatformAccountOrgs(memberOrgs, manageableOrgs) {
1823
+ const manageableIds = new Set(manageableOrgs.map((org) => org.id));
1824
+ const byId = /* @__PURE__ */ new Map();
1825
+ for (const org of memberOrgs) {
1826
+ byId.set(org.id, {
1827
+ ...org,
1828
+ canManage: manageableIds.has(org.id)
1829
+ });
1830
+ }
1831
+ for (const org of manageableOrgs) {
1832
+ const existing = byId.get(org.id);
1833
+ if (existing) {
1834
+ byId.set(org.id, {
1835
+ ...existing,
1836
+ canManage: true,
1837
+ logo: existing.logo ?? org.logo
1838
+ });
1839
+ } else {
1840
+ byId.set(org.id, { ...org, canManage: true });
1841
+ }
1842
+ }
1843
+ return Array.from(byId.values());
1844
+ }
1761
1845
  function MenuAvatar({
1762
1846
  name,
1763
1847
  image,
@@ -1825,6 +1909,85 @@ function LanguageThemeSubs({
1825
1909
  ] })
1826
1910
  ] });
1827
1911
  }
1912
+ function OrgMenuRows({
1913
+ orgs,
1914
+ appUrl,
1915
+ adminUrl,
1916
+ labels
1917
+ }) {
1918
+ const [expanded, setExpanded] = useState(false);
1919
+ const collapsible = orgs.length > PLATFORM_ACCOUNT_ORG_COLLAPSE_AT;
1920
+ const visibleOrgs = collapsible && !expanded ? orgs.slice(0, PLATFORM_ACCOUNT_ORG_COLLAPSE_AT) : orgs;
1921
+ if (orgs.length === 0) return null;
1922
+ return /* @__PURE__ */ jsxs(
1923
+ "div",
1924
+ {
1925
+ className: cn(
1926
+ expanded && orgs.length > PLATFORM_ACCOUNT_ORG_COLLAPSE_AT ? "max-h-64 overflow-y-auto scroll-fade-b" : void 0
1927
+ ),
1928
+ "data-testid": "platform-account-orgs",
1929
+ children: [
1930
+ visibleOrgs.map((org) => {
1931
+ const orgHomeHref = `${appUrl}/o/${org.slug}`;
1932
+ const manageHref = `${adminUrl}/api/auth/org/select?id=${encodeURIComponent(org.id)}`;
1933
+ return /* @__PURE__ */ jsxs(
1934
+ "div",
1935
+ {
1936
+ className: "relative flex items-center",
1937
+ "data-testid": `platform-account-org-${org.id}`,
1938
+ children: [
1939
+ /* @__PURE__ */ jsx(
1940
+ DropdownMenuItem,
1941
+ {
1942
+ asChild: true,
1943
+ className: cn("min-w-0 flex-1 gap-2", org.canManage && "pr-9"),
1944
+ children: /* @__PURE__ */ jsxs("a", { href: orgHomeHref, children: [
1945
+ /* @__PURE__ */ jsx(
1946
+ MenuAvatar,
1947
+ {
1948
+ name: org.name,
1949
+ image: org.logo,
1950
+ sizeClass: "size-6"
1951
+ }
1952
+ ),
1953
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: org.name })
1954
+ ] })
1955
+ }
1956
+ ),
1957
+ org.canManage ? /* @__PURE__ */ jsx(
1958
+ DropdownMenuItem,
1959
+ {
1960
+ asChild: true,
1961
+ className: "absolute right-1 top-1/2 size-7 -translate-y-1/2 p-0",
1962
+ children: /* @__PURE__ */ jsx("a", { href: manageHref, "aria-label": labels.manageOrg, children: /* @__PURE__ */ jsx(Settings, { className: "size-3.5" }) })
1963
+ }
1964
+ ) : null
1965
+ ]
1966
+ },
1967
+ org.id
1968
+ );
1969
+ }),
1970
+ collapsible ? /* @__PURE__ */ jsx(
1971
+ DropdownMenuItem,
1972
+ {
1973
+ className: "gap-2",
1974
+ onSelect: (event) => {
1975
+ event.preventDefault();
1976
+ setExpanded((value) => !value);
1977
+ },
1978
+ children: expanded ? /* @__PURE__ */ jsxs(Fragment, { children: [
1979
+ /* @__PURE__ */ jsx(ChevronUp, { className: "size-4" }),
1980
+ labels.showLessOrgs
1981
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1982
+ /* @__PURE__ */ jsx(ChevronDown, { className: "size-4" }),
1983
+ labels.showMoreOrgs
1984
+ ] })
1985
+ }
1986
+ ) : null
1987
+ ]
1988
+ }
1989
+ );
1990
+ }
1828
1991
  function PlatformAccountMenu({
1829
1992
  variant = "platform",
1830
1993
  isPending = false,
@@ -1840,10 +2003,19 @@ function PlatformAccountMenu({
1840
2003
  labels: labelsProp,
1841
2004
  onSignOut,
1842
2005
  extraItems,
2006
+ trigger: triggerProp,
2007
+ contentSide,
2008
+ contentAlign = "end",
2009
+ contentSideOffset,
2010
+ contentClassName,
1843
2011
  className
1844
2012
  }) {
1845
2013
  const labels = { ...defaultLabels3, ...labelsProp };
1846
2014
  const [signingOut, setSigningOut] = useState(false);
2015
+ const mergedOrgs = useMemo(
2016
+ () => mergePlatformAccountOrgs(memberOrgs, manageableOrgs),
2017
+ [memberOrgs, manageableOrgs]
2018
+ );
1847
2019
  const loginHref = `${urls.authAppUrl}${urls.loginPath ?? "/login"}`;
1848
2020
  const accountHref = `${urls.authAppUrl}${urls.accountPath ?? "/account"}`;
1849
2021
  const activityHref = `${urls.authAppUrl}${urls.activityPath ?? "/account/activity"}`;
@@ -1869,7 +2041,7 @@ function PlatformAccountMenu({
1869
2041
  }
1870
2042
  );
1871
2043
  }
1872
- const trigger = user ? /* @__PURE__ */ jsx(
2044
+ const defaultTrigger = user ? /* @__PURE__ */ jsx(
1873
2045
  Button,
1874
2046
  {
1875
2047
  variant: "ghost",
@@ -1889,129 +2061,118 @@ function PlatformAccountMenu({
1889
2061
  }
1890
2062
  );
1891
2063
  return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
1892
- /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: trigger }),
1893
- /* @__PURE__ */ jsx(DropdownMenuContent, { align: "end", className: "min-w-60 rounded-lg", children: user ? /* @__PURE__ */ jsxs(Fragment, { children: [
1894
- /* @__PURE__ */ jsxs(DropdownMenuLabel, { className: "flex items-center gap-3 p-2 font-normal", children: [
1895
- /* @__PURE__ */ jsx(
1896
- MenuAvatar,
1897
- {
1898
- name: user.name,
1899
- image: user.image,
1900
- sizeClass: "size-9"
1901
- }
1902
- ),
1903
- /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col", children: [
1904
- /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-1.5 truncate text-sm font-medium leading-tight", children: [
1905
- /* @__PURE__ */ jsx("span", { className: "truncate", children: user.name }),
1906
- variant === "platform" ? /* @__PURE__ */ jsx(
1907
- VerifiedProfessionalBadge,
2064
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: triggerProp ?? defaultTrigger }),
2065
+ /* @__PURE__ */ jsx(
2066
+ DropdownMenuContent,
2067
+ {
2068
+ side: contentSide,
2069
+ align: contentAlign,
2070
+ sideOffset: contentSideOffset,
2071
+ className: cn("min-w-60 rounded-lg", contentClassName),
2072
+ children: user ? /* @__PURE__ */ jsxs(Fragment, { children: [
2073
+ /* @__PURE__ */ jsxs(DropdownMenuLabel, { className: "flex items-center gap-3 p-2 font-normal", children: [
2074
+ /* @__PURE__ */ jsx(
2075
+ MenuAvatar,
1908
2076
  {
1909
- status: verificationStatus,
1910
- className: "shrink-0"
2077
+ name: user.name,
2078
+ image: user.image,
2079
+ sizeClass: "size-9"
1911
2080
  }
1912
- ) : null
1913
- ] }),
1914
- /* @__PURE__ */ jsx("span", { className: "truncate text-xs text-muted-foreground leading-tight", children: user.email })
1915
- ] })
1916
- ] }),
1917
- /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
1918
- variant === "platform" ? /* @__PURE__ */ jsxs(Fragment, { children: [
1919
- /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: accountHref, children: [
1920
- /* @__PURE__ */ jsx(User, { className: "size-4" }),
1921
- labels.personalProfile
1922
- ] }) }),
1923
- /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: activityHref, children: [
1924
- /* @__PURE__ */ jsx(Activity, { className: "size-4" }),
1925
- labels.activity
1926
- ] }) }),
1927
- /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: profileHref, children: [
1928
- /* @__PURE__ */ jsx(User, { className: "size-4" }),
1929
- labels.professionalProfile
1930
- ] }) }),
1931
- /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: urls.appUrl, children: [
1932
- /* @__PURE__ */ jsx(LayoutDashboard, { className: "size-4" }),
1933
- labels.mainApp
1934
- ] }) }),
1935
- /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: urls.adminUrl, children: [
1936
- /* @__PURE__ */ jsx(Building2, { className: "size-4" }),
1937
- labels.orgManagement
1938
- ] }) }),
1939
- isAdmin && urls.backofficeUrl ? /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: urls.backofficeUrl, children: [
1940
- /* @__PURE__ */ jsx(LayoutDashboard, { className: "size-4" }),
1941
- labels.backoffice
1942
- ] }) }) : null,
1943
- memberOrgs.length > 0 ? /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [
1944
- /* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { className: "gap-2", children: [
1945
- /* @__PURE__ */ jsx(Users, { className: "size-4" }),
1946
- labels.memberOrgs
2081
+ ),
2082
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col", children: [
2083
+ /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 items-center gap-1.5 truncate text-sm font-medium leading-tight", children: [
2084
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: user.name }),
2085
+ variant === "platform" ? /* @__PURE__ */ jsx(
2086
+ VerifiedProfessionalBadge,
2087
+ {
2088
+ status: verificationStatus,
2089
+ className: "shrink-0"
2090
+ }
2091
+ ) : null
2092
+ ] }),
2093
+ /* @__PURE__ */ jsx("span", { className: "truncate text-xs text-muted-foreground leading-tight", children: user.email })
2094
+ ] })
1947
2095
  ] }),
1948
- /* @__PURE__ */ jsx(DropdownMenuSubContent, { className: "min-w-48 max-h-64 overflow-y-auto", children: memberOrgs.map((org) => /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsx("a", { href: `${urls.appUrl}/o/${org.slug}`, children: org.name }) }, org.id)) })
1949
- ] }) : null,
1950
- manageableOrgs.length > 0 ? /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [
1951
- /* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { className: "gap-2", children: [
1952
- /* @__PURE__ */ jsx(Building2, { className: "size-4" }),
1953
- labels.managementOrgs
2096
+ /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
2097
+ variant === "platform" ? /* @__PURE__ */ jsxs(Fragment, { children: [
2098
+ /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: accountHref, children: [
2099
+ /* @__PURE__ */ jsx(User, { className: "size-4" }),
2100
+ labels.personalProfile
2101
+ ] }) }),
2102
+ /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: activityHref, children: [
2103
+ /* @__PURE__ */ jsx(Activity, { className: "size-4" }),
2104
+ labels.activity
2105
+ ] }) }),
2106
+ /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: profileHref, children: [
2107
+ /* @__PURE__ */ jsx(User, { className: "size-4" }),
2108
+ labels.professionalProfile
2109
+ ] }) }),
2110
+ /* @__PURE__ */ jsx(
2111
+ OrgMenuRows,
2112
+ {
2113
+ orgs: mergedOrgs,
2114
+ appUrl: urls.appUrl,
2115
+ adminUrl: urls.adminUrl,
2116
+ labels
2117
+ }
2118
+ ),
2119
+ extraItems,
2120
+ isAdmin && urls.backofficeUrl ? /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: urls.backofficeUrl, children: [
2121
+ /* @__PURE__ */ jsx(LayoutDashboard, { className: "size-4" }),
2122
+ labels.backoffice
2123
+ ] }) }) : null,
2124
+ /* @__PURE__ */ jsx(DropdownMenuSeparator, {})
2125
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
2126
+ /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: accountHref, children: [
2127
+ /* @__PURE__ */ jsx(Settings, { className: "size-4" }),
2128
+ labels.accountSettings
2129
+ ] }) }),
2130
+ extraItems,
2131
+ /* @__PURE__ */ jsx(DropdownMenuSeparator, {})
1954
2132
  ] }),
1955
- /* @__PURE__ */ jsx(DropdownMenuSubContent, { className: "min-w-48 max-h-64 overflow-y-auto", children: manageableOrgs.map((org) => /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsx(
1956
- "a",
2133
+ /* @__PURE__ */ jsx(
2134
+ LanguageThemeSubs,
1957
2135
  {
1958
- href: `${urls.adminUrl}/api/auth/org/select?id=${encodeURIComponent(org.id)}`,
1959
- children: org.name
2136
+ languages,
2137
+ currentLanguage,
2138
+ onLanguageChange,
2139
+ labels
1960
2140
  }
1961
- ) }, org.id)) })
1962
- ] }) : null,
1963
- extraItems,
1964
- /* @__PURE__ */ jsx(DropdownMenuSeparator, {})
1965
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1966
- /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: accountHref, children: [
1967
- /* @__PURE__ */ jsx(Settings, { className: "size-4" }),
1968
- labels.accountSettings
1969
- ] }) }),
1970
- extraItems,
1971
- /* @__PURE__ */ jsx(DropdownMenuSeparator, {})
1972
- ] }),
1973
- /* @__PURE__ */ jsx(
1974
- LanguageThemeSubs,
1975
- {
1976
- languages,
1977
- currentLanguage,
1978
- onLanguageChange,
1979
- labels
1980
- }
1981
- ),
1982
- /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
1983
- /* @__PURE__ */ jsxs(
1984
- DropdownMenuItem,
1985
- {
1986
- variant: "destructive",
1987
- className: "gap-2",
1988
- disabled: signingOut || !onSignOut,
1989
- onSelect: (event) => {
1990
- event.preventDefault();
1991
- void handleSignOut();
1992
- },
1993
- children: [
1994
- /* @__PURE__ */ jsx(LogOut, { className: "size-4" }),
1995
- signingOut ? labels.signingOut : labels.signOut
1996
- ]
1997
- }
1998
- )
1999
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
2000
- /* @__PURE__ */ jsx(
2001
- LanguageThemeSubs,
2002
- {
2003
- languages,
2004
- currentLanguage,
2005
- onLanguageChange,
2006
- labels
2007
- }
2008
- ),
2009
- /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
2010
- /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: loginHref, children: [
2011
- /* @__PURE__ */ jsx(LogIn, { className: "size-4" }),
2012
- labels.signIn
2013
- ] }) })
2014
- ] }) })
2141
+ ),
2142
+ /* @__PURE__ */ jsxs(
2143
+ DropdownMenuItem,
2144
+ {
2145
+ variant: "destructive",
2146
+ className: "gap-2",
2147
+ disabled: signingOut || !onSignOut,
2148
+ onSelect: (event) => {
2149
+ event.preventDefault();
2150
+ void handleSignOut();
2151
+ },
2152
+ children: [
2153
+ /* @__PURE__ */ jsx(LogOut, { className: "size-4" }),
2154
+ signingOut ? labels.signingOut : labels.signOut
2155
+ ]
2156
+ }
2157
+ )
2158
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
2159
+ /* @__PURE__ */ jsx(
2160
+ LanguageThemeSubs,
2161
+ {
2162
+ languages,
2163
+ currentLanguage,
2164
+ onLanguageChange,
2165
+ labels
2166
+ }
2167
+ ),
2168
+ /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
2169
+ /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: loginHref, children: [
2170
+ /* @__PURE__ */ jsx(LogIn, { className: "size-4" }),
2171
+ labels.signIn
2172
+ ] }) })
2173
+ ] })
2174
+ }
2175
+ )
2015
2176
  ] });
2016
2177
  }
2017
2178
  function Slider({
@@ -7534,6 +7695,6 @@ function useRealtimeChannel({
7534
7695
  }, [enabled, reconnectDelayMs]);
7535
7696
  }
7536
7697
 
7537
- 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, 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, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
7698
+ 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, PLATFORM_ACCOUNT_ORG_COLLAPSE_AT, PhoneInput, PlatformAccountMenu, PlatformNavbar, SearchCommand, SearchablePicker, SupportMessengerProvider, ThemeSwitcher, VerifiedProfessionalBadge, VideoPlayer, avatarFallbackStyle, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, fuzzyMatch, getAvatarColors, getInitials, insertAtCaret, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, useMediaQuery2 as useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
7538
7699
  //# sourceMappingURL=index.js.map
7539
7700
  //# sourceMappingURL=index.js.map