@algenium/blocks 1.9.0 → 1.10.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 +161 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -2
- package/dist/index.d.ts +32 -2
- package/dist/index.js +162 -9
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default from 'react';
|
|
2
|
+
import React__default, { ReactNode } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { LucideIcon } from 'lucide-react';
|
|
5
5
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
@@ -247,6 +247,36 @@ type ThemeSwitcherProps = {
|
|
|
247
247
|
};
|
|
248
248
|
declare function ThemeSwitcher({ className, size, shape, variant, align, side, labels: userLabels, }: ThemeSwitcherProps): react_jsx_runtime.JSX.Element;
|
|
249
249
|
|
|
250
|
+
type OrgSwitcherTenant = {
|
|
251
|
+
id: string;
|
|
252
|
+
name: string;
|
|
253
|
+
logo?: string | null;
|
|
254
|
+
role?: string;
|
|
255
|
+
statusBadge?: ReactNode;
|
|
256
|
+
};
|
|
257
|
+
type OrgSwitcherLabels = {
|
|
258
|
+
/** Dropdown section heading */
|
|
259
|
+
heading?: string;
|
|
260
|
+
/** Create action label */
|
|
261
|
+
create?: string;
|
|
262
|
+
/** Empty state when no active tenant */
|
|
263
|
+
empty?: string;
|
|
264
|
+
};
|
|
265
|
+
type OrgSwitcherProps = {
|
|
266
|
+
activeTenant: OrgSwitcherTenant | null;
|
|
267
|
+
tenants: OrgSwitcherTenant[];
|
|
268
|
+
onSelectTenant: (id: string) => void;
|
|
269
|
+
createUrl?: string;
|
|
270
|
+
isLoading?: boolean;
|
|
271
|
+
collapsed?: boolean;
|
|
272
|
+
isMobile?: boolean;
|
|
273
|
+
activeSubtitle?: string;
|
|
274
|
+
labels?: OrgSwitcherLabels;
|
|
275
|
+
className?: string;
|
|
276
|
+
triggerClassName?: string;
|
|
277
|
+
};
|
|
278
|
+
declare function OrgSwitcher({ activeTenant, tenants, onSelectTenant, createUrl, isLoading, collapsed, isMobile, activeSubtitle, labels: userLabels, className, triggerClassName: triggerClassNameProp, }: OrgSwitcherProps): react_jsx_runtime.JSX.Element;
|
|
279
|
+
|
|
250
280
|
type Language = {
|
|
251
281
|
/** Language key/code (e.g., "en", "es") */
|
|
252
282
|
key: string;
|
|
@@ -901,4 +931,4 @@ declare function USAddressInput({ value, onChange, lookupZip, validateAddress, a
|
|
|
901
931
|
|
|
902
932
|
declare function cn(...inputs: ClassValue[]): string;
|
|
903
933
|
|
|
904
|
-
export { type AddressAutocompleteAdapter, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, BLOCKS_DATA_ENVIRONMENTS, type BlocksDataEnvironment, type BlocksLanguage, type BlocksNotification, Button, CalendarContext, type CalendarContextValue, type CalendarData, type CalendarEvent, CalendarSubscribeButton, type CalendarSubscribeButtonProps, CalendarView, type CalendarViewLabels, type CalendarViewMode, type CalendarViewProps, CalendarWidget, type CalendarWidgetLabels, type CalendarWidgetProps, CardInput, type CardInputLabels, type CardInputProps, type CardTokenResult, type ChatConversation, type ChatConversationRoom, type ChatMessageData, type ChatRoomConfig, ChatRoomView, type ChatRoomViewLabels, type ChatRoomViewProps, ChatSidebar, ChatSidebarContext, type ChatSidebarContextValue, type ChatSidebarLabels, type ChatSidebarProps, ChatSidebarProvider, type ChatSidebarProviderProps, type ChatSidebarView, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, EnvironmentBanner, type EnvironmentBannerLabels, type EnvironmentBannerProps, EnvironmentContext, type EnvironmentContextValue, EnvironmentDot, type EnvironmentDotProps, EnvironmentMiniBadge, type EnvironmentMiniBadgeProps, EnvironmentSwitcher, type EnvironmentSwitcherLabels, type EnvironmentSwitcherProps, ErrorState, EventDialog, type EventDialogLabels, type EventDialogProps, EventRsvpBadge, type EventRsvpBadgeProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MiniCalendar, type MiniCalendarProps, type Notification, type NotificationType, NotificationsContext, type NotificationsContextValue, NotificationsWidget, type NotificationsWidgetProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ScrollArea, ScrollBar, Slider, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, USAddressInput, type USAddressInputLabels, type USAddressInputProps, type USAddressValue, UpcomingEvents, type UpcomingEventsProps, type UseChatRoomResult, buttonVariants, cn, defaultLanguages, getEnvironmentDotClass, getEnvironmentLabel, isBlocksDataEnvironment, toggleVariants, useCalendarContext, useChatRoom, useChatSidebar, useDebouncedValue, useDebouncedValueStrict, useEnvironmentContext, useLanguageContext, useNotificationsContext };
|
|
934
|
+
export { type AddressAutocompleteAdapter, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, BLOCKS_DATA_ENVIRONMENTS, type BlocksDataEnvironment, type BlocksLanguage, type BlocksNotification, Button, CalendarContext, type CalendarContextValue, type CalendarData, type CalendarEvent, CalendarSubscribeButton, type CalendarSubscribeButtonProps, CalendarView, type CalendarViewLabels, type CalendarViewMode, type CalendarViewProps, CalendarWidget, type CalendarWidgetLabels, type CalendarWidgetProps, CardInput, type CardInputLabels, type CardInputProps, type CardTokenResult, type ChatConversation, type ChatConversationRoom, type ChatMessageData, type ChatRoomConfig, ChatRoomView, type ChatRoomViewLabels, type ChatRoomViewProps, ChatSidebar, ChatSidebarContext, type ChatSidebarContextValue, type ChatSidebarLabels, type ChatSidebarProps, ChatSidebarProvider, type ChatSidebarProviderProps, type ChatSidebarView, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, EnvironmentBanner, type EnvironmentBannerLabels, type EnvironmentBannerProps, EnvironmentContext, type EnvironmentContextValue, EnvironmentDot, type EnvironmentDotProps, EnvironmentMiniBadge, type EnvironmentMiniBadgeProps, EnvironmentSwitcher, type EnvironmentSwitcherLabels, type EnvironmentSwitcherProps, ErrorState, EventDialog, type EventDialogLabels, type EventDialogProps, EventRsvpBadge, type EventRsvpBadgeProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MiniCalendar, type MiniCalendarProps, type Notification, type NotificationType, NotificationsContext, type NotificationsContextValue, NotificationsWidget, type NotificationsWidgetProps, OrgSwitcher, type OrgSwitcherLabels, type OrgSwitcherProps, type OrgSwitcherTenant, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ScrollArea, ScrollBar, Slider, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, USAddressInput, type USAddressInputLabels, type USAddressInputProps, type USAddressValue, UpcomingEvents, type UpcomingEventsProps, type UseChatRoomResult, buttonVariants, cn, defaultLanguages, getEnvironmentDotClass, getEnvironmentLabel, isBlocksDataEnvironment, toggleVariants, useCalendarContext, useChatRoom, useChatSidebar, useDebouncedValue, useDebouncedValueStrict, useEnvironmentContext, useLanguageContext, useNotificationsContext };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import React__default from 'react';
|
|
2
|
+
import React__default, { ReactNode } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { LucideIcon } from 'lucide-react';
|
|
5
5
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
@@ -247,6 +247,36 @@ type ThemeSwitcherProps = {
|
|
|
247
247
|
};
|
|
248
248
|
declare function ThemeSwitcher({ className, size, shape, variant, align, side, labels: userLabels, }: ThemeSwitcherProps): react_jsx_runtime.JSX.Element;
|
|
249
249
|
|
|
250
|
+
type OrgSwitcherTenant = {
|
|
251
|
+
id: string;
|
|
252
|
+
name: string;
|
|
253
|
+
logo?: string | null;
|
|
254
|
+
role?: string;
|
|
255
|
+
statusBadge?: ReactNode;
|
|
256
|
+
};
|
|
257
|
+
type OrgSwitcherLabels = {
|
|
258
|
+
/** Dropdown section heading */
|
|
259
|
+
heading?: string;
|
|
260
|
+
/** Create action label */
|
|
261
|
+
create?: string;
|
|
262
|
+
/** Empty state when no active tenant */
|
|
263
|
+
empty?: string;
|
|
264
|
+
};
|
|
265
|
+
type OrgSwitcherProps = {
|
|
266
|
+
activeTenant: OrgSwitcherTenant | null;
|
|
267
|
+
tenants: OrgSwitcherTenant[];
|
|
268
|
+
onSelectTenant: (id: string) => void;
|
|
269
|
+
createUrl?: string;
|
|
270
|
+
isLoading?: boolean;
|
|
271
|
+
collapsed?: boolean;
|
|
272
|
+
isMobile?: boolean;
|
|
273
|
+
activeSubtitle?: string;
|
|
274
|
+
labels?: OrgSwitcherLabels;
|
|
275
|
+
className?: string;
|
|
276
|
+
triggerClassName?: string;
|
|
277
|
+
};
|
|
278
|
+
declare function OrgSwitcher({ activeTenant, tenants, onSelectTenant, createUrl, isLoading, collapsed, isMobile, activeSubtitle, labels: userLabels, className, triggerClassName: triggerClassNameProp, }: OrgSwitcherProps): react_jsx_runtime.JSX.Element;
|
|
279
|
+
|
|
250
280
|
type Language = {
|
|
251
281
|
/** Language key/code (e.g., "en", "es") */
|
|
252
282
|
key: string;
|
|
@@ -901,4 +931,4 @@ declare function USAddressInput({ value, onChange, lookupZip, validateAddress, a
|
|
|
901
931
|
|
|
902
932
|
declare function cn(...inputs: ClassValue[]): string;
|
|
903
933
|
|
|
904
|
-
export { type AddressAutocompleteAdapter, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, BLOCKS_DATA_ENVIRONMENTS, type BlocksDataEnvironment, type BlocksLanguage, type BlocksNotification, Button, CalendarContext, type CalendarContextValue, type CalendarData, type CalendarEvent, CalendarSubscribeButton, type CalendarSubscribeButtonProps, CalendarView, type CalendarViewLabels, type CalendarViewMode, type CalendarViewProps, CalendarWidget, type CalendarWidgetLabels, type CalendarWidgetProps, CardInput, type CardInputLabels, type CardInputProps, type CardTokenResult, type ChatConversation, type ChatConversationRoom, type ChatMessageData, type ChatRoomConfig, ChatRoomView, type ChatRoomViewLabels, type ChatRoomViewProps, ChatSidebar, ChatSidebarContext, type ChatSidebarContextValue, type ChatSidebarLabels, type ChatSidebarProps, ChatSidebarProvider, type ChatSidebarProviderProps, type ChatSidebarView, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, EnvironmentBanner, type EnvironmentBannerLabels, type EnvironmentBannerProps, EnvironmentContext, type EnvironmentContextValue, EnvironmentDot, type EnvironmentDotProps, EnvironmentMiniBadge, type EnvironmentMiniBadgeProps, EnvironmentSwitcher, type EnvironmentSwitcherLabels, type EnvironmentSwitcherProps, ErrorState, EventDialog, type EventDialogLabels, type EventDialogProps, EventRsvpBadge, type EventRsvpBadgeProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MiniCalendar, type MiniCalendarProps, type Notification, type NotificationType, NotificationsContext, type NotificationsContextValue, NotificationsWidget, type NotificationsWidgetProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ScrollArea, ScrollBar, Slider, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, USAddressInput, type USAddressInputLabels, type USAddressInputProps, type USAddressValue, UpcomingEvents, type UpcomingEventsProps, type UseChatRoomResult, buttonVariants, cn, defaultLanguages, getEnvironmentDotClass, getEnvironmentLabel, isBlocksDataEnvironment, toggleVariants, useCalendarContext, useChatRoom, useChatSidebar, useDebouncedValue, useDebouncedValueStrict, useEnvironmentContext, useLanguageContext, useNotificationsContext };
|
|
934
|
+
export { type AddressAutocompleteAdapter, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, BLOCKS_DATA_ENVIRONMENTS, type BlocksDataEnvironment, type BlocksLanguage, type BlocksNotification, Button, CalendarContext, type CalendarContextValue, type CalendarData, type CalendarEvent, CalendarSubscribeButton, type CalendarSubscribeButtonProps, CalendarView, type CalendarViewLabels, type CalendarViewMode, type CalendarViewProps, CalendarWidget, type CalendarWidgetLabels, type CalendarWidgetProps, CardInput, type CardInputLabels, type CardInputProps, type CardTokenResult, type ChatConversation, type ChatConversationRoom, type ChatMessageData, type ChatRoomConfig, ChatRoomView, type ChatRoomViewLabels, type ChatRoomViewProps, ChatSidebar, ChatSidebarContext, type ChatSidebarContextValue, type ChatSidebarLabels, type ChatSidebarProps, ChatSidebarProvider, type ChatSidebarProviderProps, type ChatSidebarView, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateProps, EnvironmentBanner, type EnvironmentBannerLabels, type EnvironmentBannerProps, EnvironmentContext, type EnvironmentContextValue, EnvironmentDot, type EnvironmentDotProps, EnvironmentMiniBadge, type EnvironmentMiniBadgeProps, EnvironmentSwitcher, type EnvironmentSwitcherLabels, type EnvironmentSwitcherProps, ErrorState, EventDialog, type EventDialogLabels, type EventDialogProps, EventRsvpBadge, type EventRsvpBadgeProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MiniCalendar, type MiniCalendarProps, type Notification, type NotificationType, NotificationsContext, type NotificationsContextValue, NotificationsWidget, type NotificationsWidgetProps, OrgSwitcher, type OrgSwitcherLabels, type OrgSwitcherProps, type OrgSwitcherTenant, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ScrollArea, ScrollBar, Slider, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, USAddressInput, type USAddressInputLabels, type USAddressInputProps, type USAddressValue, UpcomingEvents, type UpcomingEventsProps, type UseChatRoomResult, buttonVariants, cn, defaultLanguages, getEnvironmentDotClass, getEnvironmentLabel, isBlocksDataEnvironment, toggleVariants, useCalendarContext, useChatRoom, useChatSidebar, useDebouncedValue, useDebouncedValueStrict, useEnvironmentContext, useLanguageContext, useNotificationsContext };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import * as React2 from 'react';
|
|
2
3
|
import { createContext, useContext, useState, useCallback, useEffect, useRef, useMemo, useId } from 'react';
|
|
3
|
-
import { Loader2, AlertTriangle, Inbox, CheckIcon, CircleIcon, ChevronRightIcon, Monitor, Sun, Moon, Languages, FlaskConical, X, Upload, Move, ZoomOut, ZoomIn, RotateCcw, RotateCw, Grid3X3, RefreshCw, XIcon, User, Pencil,
|
|
4
|
+
import { Loader2, AlertTriangle, Inbox, CheckIcon, CircleIcon, ChevronRightIcon, Monitor, Sun, Moon, Building2, ChevronsUpDown, Check, Plus, Languages, FlaskConical, X, Upload, Move, ZoomOut, ZoomIn, RotateCcw, RotateCw, Grid3X3, RefreshCw, XIcon, User, Pencil, Bell, CheckCheck, XCircle, CheckCircle, Info, Trash2, Clock, MapPin, Link, CalendarDays, ExternalLink, ChevronLeft, ChevronRight, HelpCircle, MessageSquare, Wifi, WifiOff, FileIcon, Download, Paperclip, Send, ArrowLeft, CreditCard, Search, CheckCircle2 } from 'lucide-react';
|
|
4
5
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
5
6
|
import { useTheme } from 'next-themes';
|
|
6
7
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
@@ -3634,6 +3635,158 @@ function ThemeSwitcher({
|
|
|
3634
3635
|
}
|
|
3635
3636
|
);
|
|
3636
3637
|
}
|
|
3638
|
+
var defaultLabels2 = {
|
|
3639
|
+
heading: "Organizations",
|
|
3640
|
+
create: "Create organization",
|
|
3641
|
+
empty: "No organization selected"
|
|
3642
|
+
};
|
|
3643
|
+
function TenantAvatar({
|
|
3644
|
+
name,
|
|
3645
|
+
logo,
|
|
3646
|
+
size = "md"
|
|
3647
|
+
}) {
|
|
3648
|
+
const sizeClass = size === "sm" ? "size-6 rounded-md" : "size-8 rounded-lg";
|
|
3649
|
+
const textClass = size === "sm" ? "text-xs" : "text-sm";
|
|
3650
|
+
return /* @__PURE__ */ jsx(
|
|
3651
|
+
"div",
|
|
3652
|
+
{
|
|
3653
|
+
className: cn(
|
|
3654
|
+
"flex shrink-0 items-center justify-center overflow-hidden bg-muted font-medium text-muted-foreground",
|
|
3655
|
+
sizeClass
|
|
3656
|
+
),
|
|
3657
|
+
children: logo ? /* @__PURE__ */ jsx("img", { src: logo, alt: "", className: "size-full object-cover" }) : /* @__PURE__ */ jsx("span", { className: textClass, children: name.charAt(0).toUpperCase() })
|
|
3658
|
+
}
|
|
3659
|
+
);
|
|
3660
|
+
}
|
|
3661
|
+
function SwitcherSkeleton({ className }) {
|
|
3662
|
+
return /* @__PURE__ */ jsxs(
|
|
3663
|
+
"div",
|
|
3664
|
+
{
|
|
3665
|
+
"data-testid": "org-switcher-skeleton",
|
|
3666
|
+
className: cn(
|
|
3667
|
+
"pointer-events-none flex h-12 min-h-12 w-full items-center gap-2 rounded-md px-2",
|
|
3668
|
+
className
|
|
3669
|
+
),
|
|
3670
|
+
children: [
|
|
3671
|
+
/* @__PURE__ */ jsx("div", { className: "size-8 shrink-0 animate-pulse rounded-lg bg-muted" }),
|
|
3672
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
|
|
3673
|
+
/* @__PURE__ */ jsx("div", { className: "h-4 w-24 animate-pulse rounded bg-muted" }),
|
|
3674
|
+
/* @__PURE__ */ jsx("div", { className: "h-3 w-16 animate-pulse rounded bg-muted" })
|
|
3675
|
+
] }),
|
|
3676
|
+
/* @__PURE__ */ jsx("div", { className: "ml-auto size-4 shrink-0 animate-pulse rounded-sm bg-muted" })
|
|
3677
|
+
]
|
|
3678
|
+
}
|
|
3679
|
+
);
|
|
3680
|
+
}
|
|
3681
|
+
var triggerClassName = "flex h-12 min-h-12 w-full items-center gap-2 rounded-md px-2 text-left text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:ring-2 focus-visible:ring-ring data-[state=open]:bg-accent data-[state=open]:text-accent-foreground";
|
|
3682
|
+
function OrgSwitcher({
|
|
3683
|
+
activeTenant,
|
|
3684
|
+
tenants,
|
|
3685
|
+
onSelectTenant,
|
|
3686
|
+
createUrl,
|
|
3687
|
+
isLoading = false,
|
|
3688
|
+
collapsed = false,
|
|
3689
|
+
isMobile = false,
|
|
3690
|
+
activeSubtitle,
|
|
3691
|
+
labels: userLabels,
|
|
3692
|
+
className,
|
|
3693
|
+
triggerClassName: triggerClassNameProp
|
|
3694
|
+
}) {
|
|
3695
|
+
const labels = { ...defaultLabels2, ...userLabels };
|
|
3696
|
+
if (isLoading) {
|
|
3697
|
+
return /* @__PURE__ */ jsx(SwitcherSkeleton, { className });
|
|
3698
|
+
}
|
|
3699
|
+
if (!activeTenant) {
|
|
3700
|
+
if (createUrl) {
|
|
3701
|
+
return /* @__PURE__ */ jsxs(
|
|
3702
|
+
"a",
|
|
3703
|
+
{
|
|
3704
|
+
href: createUrl,
|
|
3705
|
+
"data-testid": "org-switcher-empty",
|
|
3706
|
+
className: cn(triggerClassName, className, triggerClassNameProp),
|
|
3707
|
+
children: [
|
|
3708
|
+
/* @__PURE__ */ jsx("div", { className: "flex size-8 items-center justify-center rounded-lg bg-muted", children: /* @__PURE__ */ jsx(Building2, { className: "size-4 text-muted-foreground" }) }),
|
|
3709
|
+
/* @__PURE__ */ jsx("div", { className: "grid min-w-0 flex-1 text-left leading-tight", children: /* @__PURE__ */ jsx("span", { className: "truncate font-medium", children: labels.empty }) })
|
|
3710
|
+
]
|
|
3711
|
+
}
|
|
3712
|
+
);
|
|
3713
|
+
}
|
|
3714
|
+
return /* @__PURE__ */ jsxs(
|
|
3715
|
+
"div",
|
|
3716
|
+
{
|
|
3717
|
+
"data-testid": "org-switcher-empty",
|
|
3718
|
+
className: cn(triggerClassName, "pointer-events-none", className),
|
|
3719
|
+
children: [
|
|
3720
|
+
/* @__PURE__ */ jsx("div", { className: "flex size-8 items-center justify-center rounded-lg bg-muted", children: /* @__PURE__ */ jsx(Building2, { className: "size-4 text-muted-foreground" }) }),
|
|
3721
|
+
/* @__PURE__ */ jsx("div", { className: "grid min-w-0 flex-1 text-left leading-tight", children: /* @__PURE__ */ jsx("span", { className: "truncate font-medium text-muted-foreground", children: labels.empty }) })
|
|
3722
|
+
]
|
|
3723
|
+
}
|
|
3724
|
+
);
|
|
3725
|
+
}
|
|
3726
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
3727
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
3728
|
+
Button,
|
|
3729
|
+
{
|
|
3730
|
+
type: "button",
|
|
3731
|
+
variant: "ghost",
|
|
3732
|
+
"data-testid": "org-switcher",
|
|
3733
|
+
className: cn(
|
|
3734
|
+
triggerClassName,
|
|
3735
|
+
"h-auto justify-start font-normal",
|
|
3736
|
+
className,
|
|
3737
|
+
triggerClassNameProp
|
|
3738
|
+
),
|
|
3739
|
+
children: [
|
|
3740
|
+
/* @__PURE__ */ jsx(TenantAvatar, { name: activeTenant.name, logo: activeTenant.logo }),
|
|
3741
|
+
!collapsed ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3742
|
+
/* @__PURE__ */ jsxs("div", { className: "grid min-w-0 flex-1 text-left leading-tight", children: [
|
|
3743
|
+
/* @__PURE__ */ jsx("span", { className: "truncate font-semibold", children: activeTenant.name }),
|
|
3744
|
+
activeSubtitle ? /* @__PURE__ */ jsx("span", { className: "truncate text-xs text-muted-foreground", children: activeSubtitle }) : null
|
|
3745
|
+
] }),
|
|
3746
|
+
activeTenant.statusBadge,
|
|
3747
|
+
/* @__PURE__ */ jsx(ChevronsUpDown, { className: "ml-auto size-4 shrink-0 opacity-50" })
|
|
3748
|
+
] }) : null
|
|
3749
|
+
]
|
|
3750
|
+
}
|
|
3751
|
+
) }),
|
|
3752
|
+
/* @__PURE__ */ jsxs(
|
|
3753
|
+
DropdownMenuContent,
|
|
3754
|
+
{
|
|
3755
|
+
className: "min-w-64 rounded-lg",
|
|
3756
|
+
align: "start",
|
|
3757
|
+
side: isMobile ? "bottom" : "right",
|
|
3758
|
+
sideOffset: 4,
|
|
3759
|
+
children: [
|
|
3760
|
+
/* @__PURE__ */ jsx(DropdownMenuLabel, { className: "text-xs text-muted-foreground", children: labels.heading }),
|
|
3761
|
+
tenants.map((tenant, index) => {
|
|
3762
|
+
const isActive = tenant.id === activeTenant.id;
|
|
3763
|
+
return /* @__PURE__ */ jsxs(
|
|
3764
|
+
DropdownMenuItem,
|
|
3765
|
+
{
|
|
3766
|
+
onClick: () => onSelectTenant(tenant.id),
|
|
3767
|
+
className: "gap-2 p-2",
|
|
3768
|
+
children: [
|
|
3769
|
+
/* @__PURE__ */ jsx(TenantAvatar, { name: tenant.name, logo: tenant.logo, size: "sm" }),
|
|
3770
|
+
/* @__PURE__ */ jsx("span", { className: "flex-1 whitespace-normal break-words", children: tenant.name }),
|
|
3771
|
+
tenant.statusBadge,
|
|
3772
|
+
isActive ? /* @__PURE__ */ jsx(Check, { className: "size-4 shrink-0 opacity-70" }) : /* @__PURE__ */ jsx(DropdownMenuShortcut, { children: String.fromCharCode(65 + index) })
|
|
3773
|
+
]
|
|
3774
|
+
},
|
|
3775
|
+
tenant.id
|
|
3776
|
+
);
|
|
3777
|
+
}),
|
|
3778
|
+
createUrl ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3779
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
3780
|
+
/* @__PURE__ */ jsx(DropdownMenuItem, { className: "gap-2 p-2", asChild: true, children: /* @__PURE__ */ jsxs("a", { href: createUrl, children: [
|
|
3781
|
+
/* @__PURE__ */ jsx("div", { className: "flex size-6 items-center justify-center rounded-md border bg-background", children: /* @__PURE__ */ jsx(Plus, { className: "size-4" }) }),
|
|
3782
|
+
/* @__PURE__ */ jsx("div", { className: "font-medium text-muted-foreground", children: labels.create })
|
|
3783
|
+
] }) })
|
|
3784
|
+
] }) : null
|
|
3785
|
+
]
|
|
3786
|
+
}
|
|
3787
|
+
)
|
|
3788
|
+
] });
|
|
3789
|
+
}
|
|
3637
3790
|
var defaultLanguages = [
|
|
3638
3791
|
{ key: "en", label: "EN", nativeName: "English" },
|
|
3639
3792
|
{ key: "es", label: "ES", nativeName: "Espa\xF1ol" }
|
|
@@ -3690,7 +3843,7 @@ function LanguageSwitcher({
|
|
|
3690
3843
|
const onLanguageChange = propOnLanguageChange ?? context?.setLanguage;
|
|
3691
3844
|
const sizes = sizeClasses2[size];
|
|
3692
3845
|
const shapeClass = shapeClasses2[shape];
|
|
3693
|
-
const
|
|
3846
|
+
const defaultLabels5 = {
|
|
3694
3847
|
language: labels.language ?? "Language"
|
|
3695
3848
|
};
|
|
3696
3849
|
if (variant === "mini") {
|
|
@@ -3700,7 +3853,7 @@ function LanguageSwitcher({
|
|
|
3700
3853
|
{
|
|
3701
3854
|
variant: "ghost",
|
|
3702
3855
|
size: "icon",
|
|
3703
|
-
"aria-label":
|
|
3856
|
+
"aria-label": defaultLabels5.language,
|
|
3704
3857
|
className: cn(sizes.buttonMini, shapeClass, className),
|
|
3705
3858
|
children: /* @__PURE__ */ jsx(Languages, { className: sizes.iconMini })
|
|
3706
3859
|
}
|
|
@@ -3785,7 +3938,7 @@ function LanguageSwitcher({
|
|
|
3785
3938
|
}
|
|
3786
3939
|
);
|
|
3787
3940
|
}
|
|
3788
|
-
var
|
|
3941
|
+
var defaultLabels3 = {
|
|
3789
3942
|
environment: "Data environment",
|
|
3790
3943
|
live: "Live",
|
|
3791
3944
|
staging: "Staging",
|
|
@@ -3858,7 +4011,7 @@ function EnvironmentMiniBadge({
|
|
|
3858
4011
|
abbreviated = true
|
|
3859
4012
|
}) {
|
|
3860
4013
|
const ctx = useEnvironmentContext();
|
|
3861
|
-
const labels = { ...
|
|
4014
|
+
const labels = { ...defaultLabels3, ...userLabels };
|
|
3862
4015
|
const environment = propEnvironment ?? ctx?.environment ?? "production";
|
|
3863
4016
|
const text = abbreviated ? abbreviateEnvironment(environment) : getEnvironmentLabel(environment, labels);
|
|
3864
4017
|
return /* @__PURE__ */ jsxs(
|
|
@@ -3915,7 +4068,7 @@ function EnvironmentSwitcher({
|
|
|
3915
4068
|
side = "bottom"
|
|
3916
4069
|
}) {
|
|
3917
4070
|
const ctx = useEnvironmentContext();
|
|
3918
|
-
const labels = { ...
|
|
4071
|
+
const labels = { ...defaultLabels3, ...userLabels };
|
|
3919
4072
|
const environments = propEnvironments ?? ctx?.environments ?? [...BLOCKS_DATA_ENVIRONMENTS];
|
|
3920
4073
|
const environment = propEnvironment ?? ctx?.environment ?? "production";
|
|
3921
4074
|
const setEnvironment = propOnEnvironmentChange ?? ctx?.setEnvironment ?? (() => {
|
|
@@ -4070,7 +4223,7 @@ function EnvironmentSwitcher({
|
|
|
4070
4223
|
}
|
|
4071
4224
|
);
|
|
4072
4225
|
}
|
|
4073
|
-
var
|
|
4226
|
+
var defaultLabels4 = {
|
|
4074
4227
|
stagingMessage: "You are viewing staging data \u2014 changes do not affect live customers.",
|
|
4075
4228
|
developmentMessage: "You are viewing development data \u2014 for testing only.",
|
|
4076
4229
|
dismiss: "Dismiss"
|
|
@@ -4082,7 +4235,7 @@ function EnvironmentBanner({
|
|
|
4082
4235
|
enabled = true
|
|
4083
4236
|
}) {
|
|
4084
4237
|
const ctx = useEnvironmentContext();
|
|
4085
|
-
const labels = { ...
|
|
4238
|
+
const labels = { ...defaultLabels4, ...userLabels };
|
|
4086
4239
|
const [dismissed, setDismissed] = useState(false);
|
|
4087
4240
|
const environment = propEnvironment ?? ctx?.environment ?? "production";
|
|
4088
4241
|
const handleDismiss = useCallback(() => {
|
|
@@ -8167,6 +8320,6 @@ function USAddressInput({
|
|
|
8167
8320
|
] });
|
|
8168
8321
|
}
|
|
8169
8322
|
|
|
8170
|
-
export { AvatarEditor, AvatarEditorDialog, BLOCKS_DATA_ENVIRONMENTS, Button, CalendarContext, CalendarSubscribeButton, CalendarView, CalendarWidget, CardInput, ChatRoomView, ChatSidebar, ChatSidebarContext, ChatSidebarProvider, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, EnvironmentBanner, EnvironmentContext, EnvironmentDot, EnvironmentMiniBadge, EnvironmentSwitcher, ErrorState, EventDialog, EventRsvpBadge, LanguageContext, LanguageSwitcher, LoadingState, MiniCalendar, NotificationsContext, NotificationsWidget, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ScrollArea, ScrollBar, Slider, ThemeSwitcher, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, USAddressInput, UpcomingEvents, buttonVariants, cn, defaultLanguages, getEnvironmentDotClass, getEnvironmentLabel, isBlocksDataEnvironment, toggleVariants, useCalendarContext, useChatRoom, useChatSidebar, useDebouncedValue, useDebouncedValueStrict, useEnvironmentContext, useLanguageContext, useNotificationsContext };
|
|
8323
|
+
export { AvatarEditor, AvatarEditorDialog, BLOCKS_DATA_ENVIRONMENTS, Button, CalendarContext, CalendarSubscribeButton, CalendarView, CalendarWidget, CardInput, ChatRoomView, ChatSidebar, ChatSidebarContext, ChatSidebarProvider, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, EnvironmentBanner, EnvironmentContext, EnvironmentDot, EnvironmentMiniBadge, EnvironmentSwitcher, ErrorState, EventDialog, EventRsvpBadge, LanguageContext, LanguageSwitcher, LoadingState, MiniCalendar, NotificationsContext, NotificationsWidget, OrgSwitcher, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ScrollArea, ScrollBar, Slider, ThemeSwitcher, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, USAddressInput, UpcomingEvents, buttonVariants, cn, defaultLanguages, getEnvironmentDotClass, getEnvironmentLabel, isBlocksDataEnvironment, toggleVariants, useCalendarContext, useChatRoom, useChatSidebar, useDebouncedValue, useDebouncedValueStrict, useEnvironmentContext, useLanguageContext, useNotificationsContext };
|
|
8171
8324
|
//# sourceMappingURL=index.js.map
|
|
8172
8325
|
//# sourceMappingURL=index.js.map
|