@algenium/blocks 1.4.0 → 1.5.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 +104 -40
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -1
- package/dist/index.d.ts +33 -1
- package/dist/index.js +101 -41
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -290,6 +290,38 @@ type EnvironmentSwitcherLabels = {
|
|
|
290
290
|
staging?: string;
|
|
291
291
|
development?: string;
|
|
292
292
|
};
|
|
293
|
+
/** Tailwind background class for the environment status dot. */
|
|
294
|
+
declare function getEnvironmentDotClass(env: BlocksDataEnvironment): string;
|
|
295
|
+
/** Resolved menu label for an environment (uses merged `labels`). */
|
|
296
|
+
declare function getEnvironmentLabel(env: BlocksDataEnvironment, labels: Required<EnvironmentSwitcherLabels>): string;
|
|
297
|
+
declare const environmentDotSizeClasses: {
|
|
298
|
+
readonly xs: "size-1.5";
|
|
299
|
+
readonly sm: "size-2";
|
|
300
|
+
readonly md: "size-2.5";
|
|
301
|
+
};
|
|
302
|
+
type EnvironmentDotProps = {
|
|
303
|
+
env: BlocksDataEnvironment;
|
|
304
|
+
size?: keyof typeof environmentDotSizeClasses;
|
|
305
|
+
className?: string;
|
|
306
|
+
};
|
|
307
|
+
/** Non-interactive colored dot for an environment (e.g. overlays, menus). */
|
|
308
|
+
declare function EnvironmentDot({ env, size, className, }: EnvironmentDotProps): react_jsx_runtime.JSX.Element;
|
|
309
|
+
type EnvironmentMiniBadgeProps = {
|
|
310
|
+
className?: string;
|
|
311
|
+
/** Current environment; falls back to `EnvironmentContext` when omitted. */
|
|
312
|
+
environment?: BlocksDataEnvironment;
|
|
313
|
+
labels?: EnvironmentSwitcherLabels;
|
|
314
|
+
/**
|
|
315
|
+
* When true (default), shows short Prod / Stg / Dev text.
|
|
316
|
+
* When false, uses `getEnvironmentLabel` with merged labels (i18n-friendly).
|
|
317
|
+
*/
|
|
318
|
+
abbreviated?: boolean;
|
|
319
|
+
};
|
|
320
|
+
/**
|
|
321
|
+
* Compact pill (dot + label) for embedding in other controls (e.g. org switcher trigger).
|
|
322
|
+
* Not a button — parent provides interaction.
|
|
323
|
+
*/
|
|
324
|
+
declare function EnvironmentMiniBadge({ className, environment: propEnvironment, labels: userLabels, abbreviated, }: EnvironmentMiniBadgeProps): react_jsx_runtime.JSX.Element;
|
|
293
325
|
type EnvironmentSwitcherProps = {
|
|
294
326
|
className?: string;
|
|
295
327
|
/** Current environment. Overrides context when set. */
|
|
@@ -723,4 +755,4 @@ declare function ScrollBar({ className, orientation, ...props }: React.Component
|
|
|
723
755
|
|
|
724
756
|
declare function cn(...inputs: ClassValue[]): string;
|
|
725
757
|
|
|
726
|
-
export { 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, 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, EnvironmentBanner, type EnvironmentBannerLabels, type EnvironmentBannerProps, EnvironmentContext, type EnvironmentContextValue, EnvironmentSwitcher, type EnvironmentSwitcherLabels, type EnvironmentSwitcherProps, EventDialog, type EventDialogLabels, type EventDialogProps, EventRsvpBadge, type EventRsvpBadgeProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, 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, UpcomingEvents, type UpcomingEventsProps, type UseChatRoomResult, buttonVariants, cn, defaultLanguages, isBlocksDataEnvironment, toggleVariants, useCalendarContext, useChatRoom, useChatSidebar, useEnvironmentContext, useLanguageContext, useNotificationsContext };
|
|
758
|
+
export { 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, 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, EnvironmentBanner, type EnvironmentBannerLabels, type EnvironmentBannerProps, EnvironmentContext, type EnvironmentContextValue, EnvironmentDot, type EnvironmentDotProps, EnvironmentMiniBadge, type EnvironmentMiniBadgeProps, EnvironmentSwitcher, type EnvironmentSwitcherLabels, type EnvironmentSwitcherProps, EventDialog, type EventDialogLabels, type EventDialogProps, EventRsvpBadge, type EventRsvpBadgeProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, 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, UpcomingEvents, type UpcomingEventsProps, type UseChatRoomResult, buttonVariants, cn, defaultLanguages, getEnvironmentDotClass, getEnvironmentLabel, isBlocksDataEnvironment, toggleVariants, useCalendarContext, useChatRoom, useChatSidebar, useEnvironmentContext, useLanguageContext, useNotificationsContext };
|
package/dist/index.d.ts
CHANGED
|
@@ -290,6 +290,38 @@ type EnvironmentSwitcherLabels = {
|
|
|
290
290
|
staging?: string;
|
|
291
291
|
development?: string;
|
|
292
292
|
};
|
|
293
|
+
/** Tailwind background class for the environment status dot. */
|
|
294
|
+
declare function getEnvironmentDotClass(env: BlocksDataEnvironment): string;
|
|
295
|
+
/** Resolved menu label for an environment (uses merged `labels`). */
|
|
296
|
+
declare function getEnvironmentLabel(env: BlocksDataEnvironment, labels: Required<EnvironmentSwitcherLabels>): string;
|
|
297
|
+
declare const environmentDotSizeClasses: {
|
|
298
|
+
readonly xs: "size-1.5";
|
|
299
|
+
readonly sm: "size-2";
|
|
300
|
+
readonly md: "size-2.5";
|
|
301
|
+
};
|
|
302
|
+
type EnvironmentDotProps = {
|
|
303
|
+
env: BlocksDataEnvironment;
|
|
304
|
+
size?: keyof typeof environmentDotSizeClasses;
|
|
305
|
+
className?: string;
|
|
306
|
+
};
|
|
307
|
+
/** Non-interactive colored dot for an environment (e.g. overlays, menus). */
|
|
308
|
+
declare function EnvironmentDot({ env, size, className, }: EnvironmentDotProps): react_jsx_runtime.JSX.Element;
|
|
309
|
+
type EnvironmentMiniBadgeProps = {
|
|
310
|
+
className?: string;
|
|
311
|
+
/** Current environment; falls back to `EnvironmentContext` when omitted. */
|
|
312
|
+
environment?: BlocksDataEnvironment;
|
|
313
|
+
labels?: EnvironmentSwitcherLabels;
|
|
314
|
+
/**
|
|
315
|
+
* When true (default), shows short Prod / Stg / Dev text.
|
|
316
|
+
* When false, uses `getEnvironmentLabel` with merged labels (i18n-friendly).
|
|
317
|
+
*/
|
|
318
|
+
abbreviated?: boolean;
|
|
319
|
+
};
|
|
320
|
+
/**
|
|
321
|
+
* Compact pill (dot + label) for embedding in other controls (e.g. org switcher trigger).
|
|
322
|
+
* Not a button — parent provides interaction.
|
|
323
|
+
*/
|
|
324
|
+
declare function EnvironmentMiniBadge({ className, environment: propEnvironment, labels: userLabels, abbreviated, }: EnvironmentMiniBadgeProps): react_jsx_runtime.JSX.Element;
|
|
293
325
|
type EnvironmentSwitcherProps = {
|
|
294
326
|
className?: string;
|
|
295
327
|
/** Current environment. Overrides context when set. */
|
|
@@ -723,4 +755,4 @@ declare function ScrollBar({ className, orientation, ...props }: React.Component
|
|
|
723
755
|
|
|
724
756
|
declare function cn(...inputs: ClassValue[]): string;
|
|
725
757
|
|
|
726
|
-
export { 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, 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, EnvironmentBanner, type EnvironmentBannerLabels, type EnvironmentBannerProps, EnvironmentContext, type EnvironmentContextValue, EnvironmentSwitcher, type EnvironmentSwitcherLabels, type EnvironmentSwitcherProps, EventDialog, type EventDialogLabels, type EventDialogProps, EventRsvpBadge, type EventRsvpBadgeProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, 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, UpcomingEvents, type UpcomingEventsProps, type UseChatRoomResult, buttonVariants, cn, defaultLanguages, isBlocksDataEnvironment, toggleVariants, useCalendarContext, useChatRoom, useChatSidebar, useEnvironmentContext, useLanguageContext, useNotificationsContext };
|
|
758
|
+
export { 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, 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, EnvironmentBanner, type EnvironmentBannerLabels, type EnvironmentBannerProps, EnvironmentContext, type EnvironmentContextValue, EnvironmentDot, type EnvironmentDotProps, EnvironmentMiniBadge, type EnvironmentMiniBadgeProps, EnvironmentSwitcher, type EnvironmentSwitcherLabels, type EnvironmentSwitcherProps, EventDialog, type EventDialogLabels, type EventDialogProps, EventRsvpBadge, type EventRsvpBadgeProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, 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, UpcomingEvents, type UpcomingEventsProps, type UseChatRoomResult, buttonVariants, cn, defaultLanguages, getEnvironmentDotClass, getEnvironmentLabel, isBlocksDataEnvironment, toggleVariants, useCalendarContext, useChatRoom, useChatSidebar, useEnvironmentContext, useLanguageContext, useNotificationsContext };
|
package/dist/index.js
CHANGED
|
@@ -3140,7 +3140,7 @@ function DropdownMenuItem({
|
|
|
3140
3140
|
"data-inset": inset,
|
|
3141
3141
|
"data-variant": variant,
|
|
3142
3142
|
className: cn(
|
|
3143
|
-
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground
|
|
3143
|
+
"relative flex 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 data-[highlighted]:[&_svg:not([class*='text-'])]:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:[&_svg:not([class*='text-'])]:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:data-[highlighted]:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 dark:data-[variant=destructive]:data-[highlighted]:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:data-[highlighted]:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
3144
3144
|
className
|
|
3145
3145
|
),
|
|
3146
3146
|
...props
|
|
@@ -3158,7 +3158,7 @@ function DropdownMenuCheckboxItem({
|
|
|
3158
3158
|
{
|
|
3159
3159
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
3160
3160
|
className: cn(
|
|
3161
|
-
"
|
|
3161
|
+
"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",
|
|
3162
3162
|
className
|
|
3163
3163
|
),
|
|
3164
3164
|
checked,
|
|
@@ -3191,7 +3191,7 @@ function DropdownMenuRadioItem({
|
|
|
3191
3191
|
{
|
|
3192
3192
|
"data-slot": "dropdown-menu-radio-item",
|
|
3193
3193
|
className: cn(
|
|
3194
|
-
"
|
|
3194
|
+
"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",
|
|
3195
3195
|
className
|
|
3196
3196
|
),
|
|
3197
3197
|
...props,
|
|
@@ -3266,7 +3266,7 @@ function DropdownMenuSubTrigger({
|
|
|
3266
3266
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
3267
3267
|
"data-inset": inset,
|
|
3268
3268
|
className: cn(
|
|
3269
|
-
"
|
|
3269
|
+
"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",
|
|
3270
3270
|
className
|
|
3271
3271
|
),
|
|
3272
3272
|
...props,
|
|
@@ -3342,9 +3342,9 @@ var buttonVariants = cva(
|
|
|
3342
3342
|
variant: {
|
|
3343
3343
|
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
3344
3344
|
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
3345
|
-
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:
|
|
3345
|
+
outline: "border bg-background text-foreground shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:text-foreground dark:hover:bg-muted dark:hover:text-foreground",
|
|
3346
3346
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
3347
|
-
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
3347
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 dark:hover:text-foreground",
|
|
3348
3348
|
link: "text-primary underline-offset-4 hover:underline"
|
|
3349
3349
|
},
|
|
3350
3350
|
size: {
|
|
@@ -3536,7 +3536,7 @@ function ThemeSwitcher({
|
|
|
3536
3536
|
onClick: () => handleThemeClick(key),
|
|
3537
3537
|
className: cn(
|
|
3538
3538
|
"gap-2 cursor-pointer",
|
|
3539
|
-
currentTheme === key && "bg-accent"
|
|
3539
|
+
currentTheme === key && "bg-accent text-accent-foreground [&_svg]:text-accent-foreground"
|
|
3540
3540
|
),
|
|
3541
3541
|
children: [
|
|
3542
3542
|
/* @__PURE__ */ jsx(Icon, { className: "h-4 w-4" }),
|
|
@@ -3694,7 +3694,7 @@ function LanguageSwitcher({
|
|
|
3694
3694
|
onClick: () => onLanguageChange?.(key),
|
|
3695
3695
|
className: cn(
|
|
3696
3696
|
"justify-center text-xs font-semibold cursor-pointer px-3",
|
|
3697
|
-
currentLanguage === key && "bg-accent"
|
|
3697
|
+
currentLanguage === key && "bg-accent text-accent-foreground"
|
|
3698
3698
|
),
|
|
3699
3699
|
children: nativeName
|
|
3700
3700
|
},
|
|
@@ -3766,6 +3766,90 @@ var defaultLabels2 = {
|
|
|
3766
3766
|
staging: "Staging",
|
|
3767
3767
|
development: "Development"
|
|
3768
3768
|
};
|
|
3769
|
+
function getEnvironmentDotClass(env) {
|
|
3770
|
+
switch (env) {
|
|
3771
|
+
case "production":
|
|
3772
|
+
return "bg-emerald-500";
|
|
3773
|
+
case "staging":
|
|
3774
|
+
return "bg-orange-500";
|
|
3775
|
+
case "development":
|
|
3776
|
+
return "bg-amber-400";
|
|
3777
|
+
default:
|
|
3778
|
+
return "bg-muted-foreground";
|
|
3779
|
+
}
|
|
3780
|
+
}
|
|
3781
|
+
function getEnvironmentLabel(env, labels) {
|
|
3782
|
+
switch (env) {
|
|
3783
|
+
case "production":
|
|
3784
|
+
return labels.live;
|
|
3785
|
+
case "staging":
|
|
3786
|
+
return labels.staging;
|
|
3787
|
+
case "development":
|
|
3788
|
+
return labels.development;
|
|
3789
|
+
default:
|
|
3790
|
+
return env;
|
|
3791
|
+
}
|
|
3792
|
+
}
|
|
3793
|
+
function abbreviateEnvironment(env) {
|
|
3794
|
+
switch (env) {
|
|
3795
|
+
case "production":
|
|
3796
|
+
return "Prod";
|
|
3797
|
+
case "staging":
|
|
3798
|
+
return "Stg";
|
|
3799
|
+
case "development":
|
|
3800
|
+
return "Dev";
|
|
3801
|
+
default:
|
|
3802
|
+
return env;
|
|
3803
|
+
}
|
|
3804
|
+
}
|
|
3805
|
+
var environmentDotSizeClasses = {
|
|
3806
|
+
xs: "size-1.5",
|
|
3807
|
+
sm: "size-2",
|
|
3808
|
+
md: "size-2.5"
|
|
3809
|
+
};
|
|
3810
|
+
function EnvironmentDot({
|
|
3811
|
+
env,
|
|
3812
|
+
size = "sm",
|
|
3813
|
+
className
|
|
3814
|
+
}) {
|
|
3815
|
+
const sizeClass = environmentDotSizeClasses[size];
|
|
3816
|
+
return /* @__PURE__ */ jsx(
|
|
3817
|
+
"span",
|
|
3818
|
+
{
|
|
3819
|
+
className: cn(
|
|
3820
|
+
"rounded-full shrink-0 ring-1 ring-background",
|
|
3821
|
+
sizeClass,
|
|
3822
|
+
getEnvironmentDotClass(env),
|
|
3823
|
+
className
|
|
3824
|
+
),
|
|
3825
|
+
"aria-hidden": true
|
|
3826
|
+
}
|
|
3827
|
+
);
|
|
3828
|
+
}
|
|
3829
|
+
function EnvironmentMiniBadge({
|
|
3830
|
+
className,
|
|
3831
|
+
environment: propEnvironment,
|
|
3832
|
+
labels: userLabels,
|
|
3833
|
+
abbreviated = true
|
|
3834
|
+
}) {
|
|
3835
|
+
const ctx = useEnvironmentContext();
|
|
3836
|
+
const labels = { ...defaultLabels2, ...userLabels };
|
|
3837
|
+
const environment = propEnvironment ?? ctx?.environment ?? "production";
|
|
3838
|
+
const text = abbreviated ? abbreviateEnvironment(environment) : getEnvironmentLabel(environment, labels);
|
|
3839
|
+
return /* @__PURE__ */ jsxs(
|
|
3840
|
+
"span",
|
|
3841
|
+
{
|
|
3842
|
+
className: cn(
|
|
3843
|
+
"inline-flex max-w-[4.5rem] items-center gap-1 rounded-full border border-border bg-muted/60 px-1.5 py-0.5 text-[10px] font-semibold tabular-nums text-foreground",
|
|
3844
|
+
className
|
|
3845
|
+
),
|
|
3846
|
+
children: [
|
|
3847
|
+
/* @__PURE__ */ jsx(EnvironmentDot, { env: environment, size: "xs" }),
|
|
3848
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: text })
|
|
3849
|
+
]
|
|
3850
|
+
}
|
|
3851
|
+
);
|
|
3852
|
+
}
|
|
3769
3853
|
var sizeClasses3 = {
|
|
3770
3854
|
sm: {
|
|
3771
3855
|
container: "h-7 p-0.5 text-xs",
|
|
@@ -3793,30 +3877,6 @@ var shapeClasses3 = {
|
|
|
3793
3877
|
rounded: "rounded-md",
|
|
3794
3878
|
pill: "rounded-full"
|
|
3795
3879
|
};
|
|
3796
|
-
function envDotClass(env) {
|
|
3797
|
-
switch (env) {
|
|
3798
|
-
case "production":
|
|
3799
|
-
return "bg-emerald-500";
|
|
3800
|
-
case "staging":
|
|
3801
|
-
return "bg-orange-500";
|
|
3802
|
-
case "development":
|
|
3803
|
-
return "bg-amber-400";
|
|
3804
|
-
default:
|
|
3805
|
-
return "bg-muted-foreground";
|
|
3806
|
-
}
|
|
3807
|
-
}
|
|
3808
|
-
function labelForEnv(env, labels) {
|
|
3809
|
-
switch (env) {
|
|
3810
|
-
case "production":
|
|
3811
|
-
return labels.live;
|
|
3812
|
-
case "staging":
|
|
3813
|
-
return labels.staging;
|
|
3814
|
-
case "development":
|
|
3815
|
-
return labels.development;
|
|
3816
|
-
default:
|
|
3817
|
-
return env;
|
|
3818
|
-
}
|
|
3819
|
-
}
|
|
3820
3880
|
function EnvironmentSwitcher({
|
|
3821
3881
|
className,
|
|
3822
3882
|
environment: propEnvironment,
|
|
@@ -3867,12 +3927,12 @@ function EnvironmentSwitcher({
|
|
|
3867
3927
|
className: cn(
|
|
3868
3928
|
"rounded-full shrink-0 ring-1 ring-background",
|
|
3869
3929
|
sizes.dot,
|
|
3870
|
-
|
|
3930
|
+
getEnvironmentDotClass(environment)
|
|
3871
3931
|
),
|
|
3872
3932
|
"aria-hidden": true
|
|
3873
3933
|
}
|
|
3874
3934
|
),
|
|
3875
|
-
/* @__PURE__ */ jsx("span", { className: "max-w-[5.5rem] truncate", children:
|
|
3935
|
+
/* @__PURE__ */ jsx("span", { className: "max-w-[5.5rem] truncate", children: getEnvironmentLabel(environment, labels) })
|
|
3876
3936
|
]
|
|
3877
3937
|
}
|
|
3878
3938
|
) }) }),
|
|
@@ -3892,7 +3952,7 @@ function EnvironmentSwitcher({
|
|
|
3892
3952
|
onClick: () => handleSelect(env),
|
|
3893
3953
|
className: cn(
|
|
3894
3954
|
"gap-2 cursor-pointer",
|
|
3895
|
-
environment === env && "bg-accent"
|
|
3955
|
+
environment === env && "bg-accent text-accent-foreground [&_svg]:text-accent-foreground"
|
|
3896
3956
|
),
|
|
3897
3957
|
children: [
|
|
3898
3958
|
/* @__PURE__ */ jsx(
|
|
@@ -3901,12 +3961,12 @@ function EnvironmentSwitcher({
|
|
|
3901
3961
|
className: cn(
|
|
3902
3962
|
"rounded-full shrink-0 ring-1 ring-background",
|
|
3903
3963
|
sizes.dot,
|
|
3904
|
-
|
|
3964
|
+
getEnvironmentDotClass(env)
|
|
3905
3965
|
),
|
|
3906
3966
|
"aria-hidden": true
|
|
3907
3967
|
}
|
|
3908
3968
|
),
|
|
3909
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
3969
|
+
/* @__PURE__ */ jsx("span", { children: getEnvironmentLabel(env, labels) })
|
|
3910
3970
|
]
|
|
3911
3971
|
},
|
|
3912
3972
|
env
|
|
@@ -3937,7 +3997,7 @@ function EnvironmentSwitcher({
|
|
|
3937
3997
|
"button",
|
|
3938
3998
|
{
|
|
3939
3999
|
type: "button",
|
|
3940
|
-
"aria-label":
|
|
4000
|
+
"aria-label": getEnvironmentLabel(env, labels),
|
|
3941
4001
|
"aria-pressed": isActive,
|
|
3942
4002
|
className: cn(
|
|
3943
4003
|
"relative min-w-0 font-semibold capitalize",
|
|
@@ -3971,12 +4031,12 @@ function EnvironmentSwitcher({
|
|
|
3971
4031
|
className: cn(
|
|
3972
4032
|
"rounded-full shrink-0 ring-1 ring-background",
|
|
3973
4033
|
"h-1.5 w-1.5",
|
|
3974
|
-
|
|
4034
|
+
getEnvironmentDotClass(env)
|
|
3975
4035
|
),
|
|
3976
4036
|
"aria-hidden": true
|
|
3977
4037
|
}
|
|
3978
4038
|
),
|
|
3979
|
-
|
|
4039
|
+
getEnvironmentLabel(env, labels)
|
|
3980
4040
|
]
|
|
3981
4041
|
}
|
|
3982
4042
|
)
|
|
@@ -7263,6 +7323,6 @@ function formatRelativeTime(dateStr) {
|
|
|
7263
7323
|
return date.toLocaleDateString([], { month: "short", day: "numeric" });
|
|
7264
7324
|
}
|
|
7265
7325
|
|
|
7266
|
-
export { AvatarEditor, AvatarEditorDialog, BLOCKS_DATA_ENVIRONMENTS, Button, CalendarContext, CalendarSubscribeButton, CalendarView, CalendarWidget, 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, EnvironmentBanner, EnvironmentContext, EnvironmentSwitcher, EventDialog, EventRsvpBadge, LanguageContext, LanguageSwitcher, MiniCalendar, NotificationsContext, NotificationsWidget, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ScrollArea, ScrollBar, Slider, ThemeSwitcher, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UpcomingEvents, buttonVariants, cn, defaultLanguages, isBlocksDataEnvironment, toggleVariants, useCalendarContext, useChatRoom, useChatSidebar, useEnvironmentContext, useLanguageContext, useNotificationsContext };
|
|
7326
|
+
export { AvatarEditor, AvatarEditorDialog, BLOCKS_DATA_ENVIRONMENTS, Button, CalendarContext, CalendarSubscribeButton, CalendarView, CalendarWidget, 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, EnvironmentBanner, EnvironmentContext, EnvironmentDot, EnvironmentMiniBadge, EnvironmentSwitcher, EventDialog, EventRsvpBadge, LanguageContext, LanguageSwitcher, MiniCalendar, NotificationsContext, NotificationsWidget, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, ScrollArea, ScrollBar, Slider, ThemeSwitcher, Toggle, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, UpcomingEvents, buttonVariants, cn, defaultLanguages, getEnvironmentDotClass, getEnvironmentLabel, isBlocksDataEnvironment, toggleVariants, useCalendarContext, useChatRoom, useChatSidebar, useEnvironmentContext, useLanguageContext, useNotificationsContext };
|
|
7267
7327
|
//# sourceMappingURL=index.js.map
|
|
7268
7328
|
//# sourceMappingURL=index.js.map
|