@sesionario/blocks 1.1.1 → 1.3.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/README.md +2 -0
- package/dist/index.cjs +328 -56
- 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 +325 -58
- package/dist/index.js.map +1 -1
- package/package.json +6 -4
package/dist/index.d.cts
CHANGED
|
@@ -69,6 +69,21 @@ type EmptyStateProps = {
|
|
|
69
69
|
};
|
|
70
70
|
declare function EmptyState({ title, description, action, icon: Icon, variant, className, }: EmptyStateProps): React.JSX.Element;
|
|
71
71
|
|
|
72
|
+
type ConfirmDestructiveDialogProps = {
|
|
73
|
+
open: boolean;
|
|
74
|
+
onOpenChange: (open: boolean) => void;
|
|
75
|
+
title: string;
|
|
76
|
+
description: string;
|
|
77
|
+
confirmLabel?: string;
|
|
78
|
+
cancelLabel?: string;
|
|
79
|
+
onConfirm: () => void;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Shared confirm step for destructive actions (delete, mute, etc.).
|
|
83
|
+
* Prefer this over window.confirm so focus stays in the app and copy is clear.
|
|
84
|
+
*/
|
|
85
|
+
declare function ConfirmDestructiveDialog({ open, onOpenChange, title, description, confirmLabel, cancelLabel, onConfirm, }: ConfirmDestructiveDialogProps): React.JSX.Element;
|
|
86
|
+
|
|
72
87
|
declare function Empty({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
73
88
|
declare function EmptyHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
74
89
|
declare const emptyMediaVariants: (props?: ({
|
|
@@ -763,4 +778,21 @@ declare function ChatMessageList({ messages, currentUserId, emptyTitle, emptyDes
|
|
|
763
778
|
|
|
764
779
|
declare function cn(...inputs: ClassValue[]): string;
|
|
765
780
|
|
|
766
|
-
|
|
781
|
+
type AvatarColors = {
|
|
782
|
+
backgroundColor: string;
|
|
783
|
+
color: string;
|
|
784
|
+
};
|
|
785
|
+
/**
|
|
786
|
+
* Word-based initials from a display name (max letters, default 2).
|
|
787
|
+
* Empty / whitespace-only names yield `"?"`.
|
|
788
|
+
*/
|
|
789
|
+
declare function getInitials(name: string, max?: number): string;
|
|
790
|
+
/**
|
|
791
|
+
* Deterministic background + contrasting foreground from a full name.
|
|
792
|
+
* Same name (case-insensitive) always maps to the same colors.
|
|
793
|
+
*/
|
|
794
|
+
declare function getAvatarColors(name: string): AvatarColors;
|
|
795
|
+
/** CSS style object for `AvatarFallback` (or any letter-avatar container). */
|
|
796
|
+
declare function avatarFallbackStyle(name: string): Pick<AvatarColors, "backgroundColor" | "color">;
|
|
797
|
+
|
|
798
|
+
export { type AutoplayState, type AvatarColors, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type DescribedPlaybackError, type EmojiCategoryData, type EmojiCategoryKey, type EmojiDatum, EmojiPicker, type EmojiPickerLabels, type EmojiPickerLocale, EmojiPickerPopover, type EmojiPickerPopoverProps, type EmojiPickerProps, type EmojiSkinTone, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, type FeatureEntry, type HlsPlayerMode, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, Message, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, type MexicoMapProps, type MexicoState, type MexicoStateId, OrgSwitcher, type OrgSwitcherLabels, type OrgSwitcherProps, type OrgSwitcherTenant, PhoneInput, type PhoneInputProps, type PlaybackErrorContext, type PlaybackErrorDetail, type PlaybackErrorKind, type PlaybackState, type PlaybackStats, type ProfessionalVerificationStatus, type QualityLevel, SearchCommand, type SearchCommandLabels, type SearchCommandProps, type SearchCommandSelection, type SearchHit, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, avatarFallbackStyle, bubbleVariants, cn, createLiveHlsConfig, createVodHlsConfig, defaultLanguages, describePlaybackError, fuzzyMatch, getAvatarColors, getInitials, markerVariants, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, usePlaybackStats, useSearchHotkey };
|
package/dist/index.d.ts
CHANGED
|
@@ -69,6 +69,21 @@ type EmptyStateProps = {
|
|
|
69
69
|
};
|
|
70
70
|
declare function EmptyState({ title, description, action, icon: Icon, variant, className, }: EmptyStateProps): React.JSX.Element;
|
|
71
71
|
|
|
72
|
+
type ConfirmDestructiveDialogProps = {
|
|
73
|
+
open: boolean;
|
|
74
|
+
onOpenChange: (open: boolean) => void;
|
|
75
|
+
title: string;
|
|
76
|
+
description: string;
|
|
77
|
+
confirmLabel?: string;
|
|
78
|
+
cancelLabel?: string;
|
|
79
|
+
onConfirm: () => void;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Shared confirm step for destructive actions (delete, mute, etc.).
|
|
83
|
+
* Prefer this over window.confirm so focus stays in the app and copy is clear.
|
|
84
|
+
*/
|
|
85
|
+
declare function ConfirmDestructiveDialog({ open, onOpenChange, title, description, confirmLabel, cancelLabel, onConfirm, }: ConfirmDestructiveDialogProps): React.JSX.Element;
|
|
86
|
+
|
|
72
87
|
declare function Empty({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
73
88
|
declare function EmptyHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
74
89
|
declare const emptyMediaVariants: (props?: ({
|
|
@@ -763,4 +778,21 @@ declare function ChatMessageList({ messages, currentUserId, emptyTitle, emptyDes
|
|
|
763
778
|
|
|
764
779
|
declare function cn(...inputs: ClassValue[]): string;
|
|
765
780
|
|
|
766
|
-
|
|
781
|
+
type AvatarColors = {
|
|
782
|
+
backgroundColor: string;
|
|
783
|
+
color: string;
|
|
784
|
+
};
|
|
785
|
+
/**
|
|
786
|
+
* Word-based initials from a display name (max letters, default 2).
|
|
787
|
+
* Empty / whitespace-only names yield `"?"`.
|
|
788
|
+
*/
|
|
789
|
+
declare function getInitials(name: string, max?: number): string;
|
|
790
|
+
/**
|
|
791
|
+
* Deterministic background + contrasting foreground from a full name.
|
|
792
|
+
* Same name (case-insensitive) always maps to the same colors.
|
|
793
|
+
*/
|
|
794
|
+
declare function getAvatarColors(name: string): AvatarColors;
|
|
795
|
+
/** CSS style object for `AvatarFallback` (or any letter-avatar container). */
|
|
796
|
+
declare function avatarFallbackStyle(name: string): Pick<AvatarColors, "backgroundColor" | "color">;
|
|
797
|
+
|
|
798
|
+
export { type AutoplayState, type AvatarColors, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type DescribedPlaybackError, type EmojiCategoryData, type EmojiCategoryKey, type EmojiDatum, EmojiPicker, type EmojiPickerLabels, type EmojiPickerLocale, EmojiPickerPopover, type EmojiPickerPopoverProps, type EmojiPickerProps, type EmojiSkinTone, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, type FeatureEntry, type HlsPlayerMode, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, Message, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, type MexicoMapProps, type MexicoState, type MexicoStateId, OrgSwitcher, type OrgSwitcherLabels, type OrgSwitcherProps, type OrgSwitcherTenant, PhoneInput, type PhoneInputProps, type PlaybackErrorContext, type PlaybackErrorDetail, type PlaybackErrorKind, type PlaybackState, type PlaybackStats, type ProfessionalVerificationStatus, type QualityLevel, SearchCommand, type SearchCommandLabels, type SearchCommandProps, type SearchCommandSelection, type SearchHit, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, avatarFallbackStyle, bubbleVariants, cn, createLiveHlsConfig, createVodHlsConfig, defaultLanguages, describePlaybackError, fuzzyMatch, getAvatarColors, getInitials, markerVariants, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, usePlaybackStats, useSearchHotkey };
|
package/dist/index.js
CHANGED
|
@@ -6,10 +6,11 @@ import { clsx } from 'clsx';
|
|
|
6
6
|
import { twMerge } from 'tailwind-merge';
|
|
7
7
|
import { cva } from 'class-variance-authority';
|
|
8
8
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
9
|
+
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
10
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
9
11
|
import { useTheme } from 'next-themes';
|
|
10
|
-
import { AnimatePresence, motion } from 'framer-motion';
|
|
12
|
+
import { useReducedMotion, AnimatePresence, motion } from 'framer-motion';
|
|
11
13
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
12
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
13
14
|
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
14
15
|
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
15
16
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
@@ -212,6 +213,217 @@ function EmptyState({
|
|
|
212
213
|
}
|
|
213
214
|
);
|
|
214
215
|
}
|
|
216
|
+
var buttonVariants = cva(
|
|
217
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
218
|
+
{
|
|
219
|
+
variants: {
|
|
220
|
+
variant: {
|
|
221
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
222
|
+
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
223
|
+
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",
|
|
224
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
225
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 dark:hover:text-foreground",
|
|
226
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
227
|
+
},
|
|
228
|
+
size: {
|
|
229
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
230
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
231
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
232
|
+
icon: "size-9",
|
|
233
|
+
"icon-sm": "size-8",
|
|
234
|
+
"icon-lg": "size-10"
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
defaultVariants: {
|
|
238
|
+
variant: "default",
|
|
239
|
+
size: "default"
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
);
|
|
243
|
+
function Button({
|
|
244
|
+
className,
|
|
245
|
+
variant = "default",
|
|
246
|
+
size = "default",
|
|
247
|
+
asChild = false,
|
|
248
|
+
...props
|
|
249
|
+
}) {
|
|
250
|
+
const Comp = asChild ? Slot : "button";
|
|
251
|
+
return /* @__PURE__ */ jsx(
|
|
252
|
+
Comp,
|
|
253
|
+
{
|
|
254
|
+
"data-slot": "button",
|
|
255
|
+
"data-variant": variant,
|
|
256
|
+
"data-size": size,
|
|
257
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
258
|
+
...props
|
|
259
|
+
}
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
function AlertDialog({
|
|
263
|
+
...props
|
|
264
|
+
}) {
|
|
265
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Root, { "data-slot": "alert-dialog", ...props });
|
|
266
|
+
}
|
|
267
|
+
function AlertDialogPortal({
|
|
268
|
+
...props
|
|
269
|
+
}) {
|
|
270
|
+
return /* @__PURE__ */ jsx(AlertDialogPrimitive.Portal, { "data-slot": "alert-dialog-portal", ...props });
|
|
271
|
+
}
|
|
272
|
+
function AlertDialogOverlay({
|
|
273
|
+
className,
|
|
274
|
+
...props
|
|
275
|
+
}) {
|
|
276
|
+
return /* @__PURE__ */ jsx(
|
|
277
|
+
AlertDialogPrimitive.Overlay,
|
|
278
|
+
{
|
|
279
|
+
"data-slot": "alert-dialog-overlay",
|
|
280
|
+
className: cn(
|
|
281
|
+
"fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
|
|
282
|
+
className
|
|
283
|
+
),
|
|
284
|
+
...props
|
|
285
|
+
}
|
|
286
|
+
);
|
|
287
|
+
}
|
|
288
|
+
function AlertDialogContent({
|
|
289
|
+
className,
|
|
290
|
+
size = "default",
|
|
291
|
+
...props
|
|
292
|
+
}) {
|
|
293
|
+
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
|
|
294
|
+
/* @__PURE__ */ jsx(AlertDialogOverlay, {}),
|
|
295
|
+
/* @__PURE__ */ jsx(
|
|
296
|
+
AlertDialogPrimitive.Content,
|
|
297
|
+
{
|
|
298
|
+
"data-slot": "alert-dialog-content",
|
|
299
|
+
"data-size": size,
|
|
300
|
+
className: cn(
|
|
301
|
+
"group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg",
|
|
302
|
+
className
|
|
303
|
+
),
|
|
304
|
+
...props
|
|
305
|
+
}
|
|
306
|
+
)
|
|
307
|
+
] });
|
|
308
|
+
}
|
|
309
|
+
function AlertDialogHeader({
|
|
310
|
+
className,
|
|
311
|
+
...props
|
|
312
|
+
}) {
|
|
313
|
+
return /* @__PURE__ */ jsx(
|
|
314
|
+
"div",
|
|
315
|
+
{
|
|
316
|
+
"data-slot": "alert-dialog-header",
|
|
317
|
+
className: cn(
|
|
318
|
+
"flex flex-col gap-1.5 text-center sm:text-left",
|
|
319
|
+
className
|
|
320
|
+
),
|
|
321
|
+
...props
|
|
322
|
+
}
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
function AlertDialogFooter({
|
|
326
|
+
className,
|
|
327
|
+
...props
|
|
328
|
+
}) {
|
|
329
|
+
return /* @__PURE__ */ jsx(
|
|
330
|
+
"div",
|
|
331
|
+
{
|
|
332
|
+
"data-slot": "alert-dialog-footer",
|
|
333
|
+
className: cn(
|
|
334
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
335
|
+
className
|
|
336
|
+
),
|
|
337
|
+
...props
|
|
338
|
+
}
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
function AlertDialogTitle({
|
|
342
|
+
className,
|
|
343
|
+
...props
|
|
344
|
+
}) {
|
|
345
|
+
return /* @__PURE__ */ jsx(
|
|
346
|
+
AlertDialogPrimitive.Title,
|
|
347
|
+
{
|
|
348
|
+
"data-slot": "alert-dialog-title",
|
|
349
|
+
className: cn("text-lg font-semibold", className),
|
|
350
|
+
...props
|
|
351
|
+
}
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
function AlertDialogDescription({
|
|
355
|
+
className,
|
|
356
|
+
...props
|
|
357
|
+
}) {
|
|
358
|
+
return /* @__PURE__ */ jsx(
|
|
359
|
+
AlertDialogPrimitive.Description,
|
|
360
|
+
{
|
|
361
|
+
"data-slot": "alert-dialog-description",
|
|
362
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
363
|
+
...props
|
|
364
|
+
}
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
function AlertDialogAction({
|
|
368
|
+
className,
|
|
369
|
+
variant = "default",
|
|
370
|
+
size = "default",
|
|
371
|
+
...props
|
|
372
|
+
}) {
|
|
373
|
+
return /* @__PURE__ */ jsx(Button, { variant, size, asChild: true, children: /* @__PURE__ */ jsx(
|
|
374
|
+
AlertDialogPrimitive.Action,
|
|
375
|
+
{
|
|
376
|
+
"data-slot": "alert-dialog-action",
|
|
377
|
+
className: cn(className),
|
|
378
|
+
...props
|
|
379
|
+
}
|
|
380
|
+
) });
|
|
381
|
+
}
|
|
382
|
+
function AlertDialogCancel({
|
|
383
|
+
className,
|
|
384
|
+
variant = "outline",
|
|
385
|
+
size = "default",
|
|
386
|
+
...props
|
|
387
|
+
}) {
|
|
388
|
+
return /* @__PURE__ */ jsx(Button, { variant, size, asChild: true, children: /* @__PURE__ */ jsx(
|
|
389
|
+
AlertDialogPrimitive.Cancel,
|
|
390
|
+
{
|
|
391
|
+
"data-slot": "alert-dialog-cancel",
|
|
392
|
+
className: cn(className),
|
|
393
|
+
...props
|
|
394
|
+
}
|
|
395
|
+
) });
|
|
396
|
+
}
|
|
397
|
+
function ConfirmDestructiveDialog({
|
|
398
|
+
open,
|
|
399
|
+
onOpenChange,
|
|
400
|
+
title,
|
|
401
|
+
description,
|
|
402
|
+
confirmLabel = "Eliminar",
|
|
403
|
+
cancelLabel = "Cancelar",
|
|
404
|
+
onConfirm
|
|
405
|
+
}) {
|
|
406
|
+
return /* @__PURE__ */ jsx(AlertDialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(AlertDialogContent, { size: "sm", children: [
|
|
407
|
+
/* @__PURE__ */ jsxs(AlertDialogHeader, { children: [
|
|
408
|
+
/* @__PURE__ */ jsx(AlertDialogTitle, { children: title }),
|
|
409
|
+
/* @__PURE__ */ jsx(AlertDialogDescription, { children: description })
|
|
410
|
+
] }),
|
|
411
|
+
/* @__PURE__ */ jsxs(AlertDialogFooter, { children: [
|
|
412
|
+
/* @__PURE__ */ jsx(AlertDialogCancel, { children: cancelLabel }),
|
|
413
|
+
/* @__PURE__ */ jsx(
|
|
414
|
+
AlertDialogAction,
|
|
415
|
+
{
|
|
416
|
+
variant: "destructive",
|
|
417
|
+
onClick: () => {
|
|
418
|
+
onConfirm();
|
|
419
|
+
onOpenChange(false);
|
|
420
|
+
},
|
|
421
|
+
children: confirmLabel
|
|
422
|
+
}
|
|
423
|
+
)
|
|
424
|
+
] })
|
|
425
|
+
] }) });
|
|
426
|
+
}
|
|
215
427
|
var miniMenuContentClassName = "max-h-none overflow-x-visible overflow-y-visible";
|
|
216
428
|
var miniMenuContentDefaults = {
|
|
217
429
|
sideOffset: 8,
|
|
@@ -318,52 +530,6 @@ function DropdownMenuShortcut({
|
|
|
318
530
|
}
|
|
319
531
|
);
|
|
320
532
|
}
|
|
321
|
-
var buttonVariants = cva(
|
|
322
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
323
|
-
{
|
|
324
|
-
variants: {
|
|
325
|
-
variant: {
|
|
326
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
327
|
-
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
328
|
-
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",
|
|
329
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
330
|
-
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 dark:hover:text-foreground",
|
|
331
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
332
|
-
},
|
|
333
|
-
size: {
|
|
334
|
-
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
335
|
-
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
336
|
-
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
337
|
-
icon: "size-9",
|
|
338
|
-
"icon-sm": "size-8",
|
|
339
|
-
"icon-lg": "size-10"
|
|
340
|
-
}
|
|
341
|
-
},
|
|
342
|
-
defaultVariants: {
|
|
343
|
-
variant: "default",
|
|
344
|
-
size: "default"
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
);
|
|
348
|
-
function Button({
|
|
349
|
-
className,
|
|
350
|
-
variant = "default",
|
|
351
|
-
size = "default",
|
|
352
|
-
asChild = false,
|
|
353
|
-
...props
|
|
354
|
-
}) {
|
|
355
|
-
const Comp = asChild ? Slot : "button";
|
|
356
|
-
return /* @__PURE__ */ jsx(
|
|
357
|
-
Comp,
|
|
358
|
-
{
|
|
359
|
-
"data-slot": "button",
|
|
360
|
-
"data-variant": variant,
|
|
361
|
-
"data-size": size,
|
|
362
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
363
|
-
...props
|
|
364
|
-
}
|
|
365
|
-
);
|
|
366
|
-
}
|
|
367
533
|
var defaultLabels = {
|
|
368
534
|
theme: "Theme",
|
|
369
535
|
system: "System",
|
|
@@ -413,6 +579,7 @@ function ThemeSwitcher({
|
|
|
413
579
|
}) {
|
|
414
580
|
const { theme, setTheme } = useTheme();
|
|
415
581
|
const [mounted, setMounted] = useState(false);
|
|
582
|
+
const reduceMotion = useReducedMotion();
|
|
416
583
|
const sizes = sizeClasses[size];
|
|
417
584
|
const shapeClass = shapeClasses[shape];
|
|
418
585
|
const labels = { ...defaultLabels, ...userLabels };
|
|
@@ -496,11 +663,17 @@ function ThemeSwitcher({
|
|
|
496
663
|
"button",
|
|
497
664
|
{
|
|
498
665
|
"aria-label": labels[key],
|
|
666
|
+
"aria-pressed": isActive,
|
|
499
667
|
className: cn("relative", sizes.button, shapeClass),
|
|
500
668
|
onClick: () => handleThemeClick(key),
|
|
501
669
|
type: "button",
|
|
502
670
|
children: [
|
|
503
|
-
|
|
671
|
+
reduceMotion ? isActive ? /* @__PURE__ */ jsx(
|
|
672
|
+
"div",
|
|
673
|
+
{
|
|
674
|
+
className: cn("absolute inset-0 bg-secondary", shapeClass)
|
|
675
|
+
}
|
|
676
|
+
) : null : /* @__PURE__ */ jsx(AnimatePresence, { children: isActive && /* @__PURE__ */ jsx(
|
|
504
677
|
motion.div,
|
|
505
678
|
{
|
|
506
679
|
className: cn("absolute inset-0 bg-secondary", shapeClass),
|
|
@@ -529,6 +702,88 @@ function ThemeSwitcher({
|
|
|
529
702
|
}
|
|
530
703
|
);
|
|
531
704
|
}
|
|
705
|
+
|
|
706
|
+
// src/lib/avatar.ts
|
|
707
|
+
var EMPTY_COLORS = {
|
|
708
|
+
backgroundColor: "#9ca3af",
|
|
709
|
+
color: "#111111"
|
|
710
|
+
};
|
|
711
|
+
var AVATAR_PALETTE = [
|
|
712
|
+
"#4f6d8c",
|
|
713
|
+
// slate blue
|
|
714
|
+
"#3d7a6a",
|
|
715
|
+
// teal
|
|
716
|
+
"#6b5b8a",
|
|
717
|
+
// muted purple
|
|
718
|
+
"#8a5a4a",
|
|
719
|
+
// warm brown
|
|
720
|
+
"#4a7a8a",
|
|
721
|
+
// steel cyan
|
|
722
|
+
"#7a6b4a",
|
|
723
|
+
// olive
|
|
724
|
+
"#5a6b8a",
|
|
725
|
+
// periwinkle
|
|
726
|
+
"#8a4a5a",
|
|
727
|
+
// rose
|
|
728
|
+
"#4a8a6b",
|
|
729
|
+
// green
|
|
730
|
+
"#6b4a7a",
|
|
731
|
+
// plum
|
|
732
|
+
"#8a6b4a",
|
|
733
|
+
// amber brown
|
|
734
|
+
"#4a5a8a",
|
|
735
|
+
// indigo
|
|
736
|
+
"#7a4a6b",
|
|
737
|
+
// mauve
|
|
738
|
+
"#5a8a4a",
|
|
739
|
+
// leaf
|
|
740
|
+
"#8a5a7a",
|
|
741
|
+
// dusty pink
|
|
742
|
+
"#3d6b7a"
|
|
743
|
+
// deep teal
|
|
744
|
+
];
|
|
745
|
+
function hashString(input) {
|
|
746
|
+
let hash = 2166136261;
|
|
747
|
+
for (let i = 0; i < input.length; i++) {
|
|
748
|
+
hash ^= input.charCodeAt(i);
|
|
749
|
+
hash = Math.imul(hash, 16777619);
|
|
750
|
+
}
|
|
751
|
+
return hash >>> 0;
|
|
752
|
+
}
|
|
753
|
+
function srgbToLinear(channel) {
|
|
754
|
+
const c = channel / 255;
|
|
755
|
+
return c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
756
|
+
}
|
|
757
|
+
function relativeLuminance(hex) {
|
|
758
|
+
const normalized = hex.replace("#", "");
|
|
759
|
+
const r = Number.parseInt(normalized.slice(0, 2), 16);
|
|
760
|
+
const g = Number.parseInt(normalized.slice(2, 4), 16);
|
|
761
|
+
const b = Number.parseInt(normalized.slice(4, 6), 16);
|
|
762
|
+
return 0.2126 * srgbToLinear(r) + 0.7152 * srgbToLinear(g) + 0.0722 * srgbToLinear(b);
|
|
763
|
+
}
|
|
764
|
+
function contrastingTextColor(backgroundHex) {
|
|
765
|
+
return relativeLuminance(backgroundHex) > 0.179 ? "#111111" : "#ffffff";
|
|
766
|
+
}
|
|
767
|
+
function getInitials(name, max = 2) {
|
|
768
|
+
const parts = name.trim().split(/\s+/).filter(Boolean);
|
|
769
|
+
if (parts.length === 0) return "?";
|
|
770
|
+
const letters = parts.slice(0, Math.max(1, max)).map((part) => part.charAt(0)).join("");
|
|
771
|
+
return letters.toUpperCase() || "?";
|
|
772
|
+
}
|
|
773
|
+
function getAvatarColors(name) {
|
|
774
|
+
const normalized = name.trim().toLowerCase();
|
|
775
|
+
if (!normalized) {
|
|
776
|
+
return { ...EMPTY_COLORS };
|
|
777
|
+
}
|
|
778
|
+
const backgroundColor = AVATAR_PALETTE[hashString(normalized) % AVATAR_PALETTE.length];
|
|
779
|
+
return {
|
|
780
|
+
backgroundColor,
|
|
781
|
+
color: contrastingTextColor(backgroundColor)
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
function avatarFallbackStyle(name) {
|
|
785
|
+
return getAvatarColors(name);
|
|
786
|
+
}
|
|
532
787
|
var defaultLabels2 = {
|
|
533
788
|
heading: "Organizations",
|
|
534
789
|
create: "Create organization",
|
|
@@ -545,10 +800,11 @@ function TenantAvatar({
|
|
|
545
800
|
"div",
|
|
546
801
|
{
|
|
547
802
|
className: cn(
|
|
548
|
-
"flex shrink-0 items-center justify-center overflow-hidden
|
|
803
|
+
"flex shrink-0 items-center justify-center overflow-hidden font-medium",
|
|
549
804
|
sizeClass
|
|
550
805
|
),
|
|
551
|
-
|
|
806
|
+
style: logo ? void 0 : avatarFallbackStyle(name),
|
|
807
|
+
children: logo ? /* @__PURE__ */ jsx("img", { src: logo, alt: "", className: "size-full object-cover" }) : /* @__PURE__ */ jsx("span", { className: textClass, children: getInitials(name) })
|
|
552
808
|
}
|
|
553
809
|
);
|
|
554
810
|
}
|
|
@@ -765,6 +1021,7 @@ function LanguageSwitcher({
|
|
|
765
1021
|
const onLanguageChange = propOnLanguageChange ?? context?.setLanguage;
|
|
766
1022
|
const sizes = sizeClasses2[size];
|
|
767
1023
|
const shapeClass = shapeClasses2[shape];
|
|
1024
|
+
const reduceMotion = useReducedMotion();
|
|
768
1025
|
const defaultLabels4 = {
|
|
769
1026
|
language: labels.language ?? "Language"
|
|
770
1027
|
};
|
|
@@ -826,11 +1083,17 @@ function LanguageSwitcher({
|
|
|
826
1083
|
"button",
|
|
827
1084
|
{
|
|
828
1085
|
"aria-label": label,
|
|
1086
|
+
"aria-pressed": isActive,
|
|
829
1087
|
className: cn("relative font-semibold", sizes.button, shapeClass),
|
|
830
1088
|
onClick: () => onLanguageChange?.(key),
|
|
831
1089
|
type: "button",
|
|
832
1090
|
children: [
|
|
833
|
-
|
|
1091
|
+
reduceMotion ? isActive ? /* @__PURE__ */ jsx(
|
|
1092
|
+
"div",
|
|
1093
|
+
{
|
|
1094
|
+
className: cn("absolute inset-0 bg-secondary", shapeClass)
|
|
1095
|
+
}
|
|
1096
|
+
) : null : /* @__PURE__ */ jsx(AnimatePresence, { children: isActive && /* @__PURE__ */ jsx(
|
|
834
1097
|
motion.div,
|
|
835
1098
|
{
|
|
836
1099
|
className: cn("absolute inset-0 bg-secondary", shapeClass),
|
|
@@ -4168,7 +4431,7 @@ function VerifiedProfessionalBadge({
|
|
|
4168
4431
|
showLabel = false,
|
|
4169
4432
|
className
|
|
4170
4433
|
}) {
|
|
4171
|
-
if (status === "unverified") {
|
|
4434
|
+
if (status === "unverified" || status === "pending_review" && !showLabel) {
|
|
4172
4435
|
return null;
|
|
4173
4436
|
}
|
|
4174
4437
|
const label = LABELS[status];
|
|
@@ -4537,9 +4800,6 @@ function MessageScrollerButton({
|
|
|
4537
4800
|
}
|
|
4538
4801
|
);
|
|
4539
4802
|
}
|
|
4540
|
-
function initials(name) {
|
|
4541
|
-
return name.split(/\s+/).filter(Boolean).slice(0, 2).map((p) => p[0]?.toUpperCase() ?? "").join("");
|
|
4542
|
-
}
|
|
4543
4803
|
function ChatMessageList({
|
|
4544
4804
|
messages,
|
|
4545
4805
|
currentUserId,
|
|
@@ -4561,7 +4821,14 @@ function ChatMessageList({
|
|
|
4561
4821
|
"Mensaje eliminado \xB7 ",
|
|
4562
4822
|
m.senderName
|
|
4563
4823
|
] }) }) : /* @__PURE__ */ jsxs(Message, { align, children: [
|
|
4564
|
-
!mine ? /* @__PURE__ */ jsx(MessageAvatar, { children: /* @__PURE__ */ jsx(
|
|
4824
|
+
!mine ? /* @__PURE__ */ jsx(MessageAvatar, { children: /* @__PURE__ */ jsx(
|
|
4825
|
+
"span",
|
|
4826
|
+
{
|
|
4827
|
+
className: "flex size-8 items-center justify-center rounded-full text-xs font-medium",
|
|
4828
|
+
style: avatarFallbackStyle(m.senderName),
|
|
4829
|
+
children: getInitials(m.senderName)
|
|
4830
|
+
}
|
|
4831
|
+
) }) : null,
|
|
4565
4832
|
/* @__PURE__ */ jsxs(MessageContent, { children: [
|
|
4566
4833
|
!mine ? /* @__PURE__ */ jsx(MessageHeader, { children: m.senderName }) : null,
|
|
4567
4834
|
/* @__PURE__ */ jsx(
|
|
@@ -4580,6 +4847,6 @@ function ChatMessageList({
|
|
|
4580
4847
|
] }) });
|
|
4581
4848
|
}
|
|
4582
4849
|
|
|
4583
|
-
export { AvatarEditor, AvatarEditorDialog, Bubble, BubbleContent, BubbleGroup, BubbleReactions, ChatMessageList, EmojiPicker, EmojiPickerPopover, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, ErrorState, LanguageContext, LanguageSwitcher, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, Message, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, OrgSwitcher, PhoneInput, SearchCommand, ThemeSwitcher, VerifiedProfessionalBadge, VideoPlayer, bubbleVariants, cn, createLiveHlsConfig, createVodHlsConfig, defaultLanguages, describePlaybackError, fuzzyMatch, markerVariants, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, usePlaybackStats, useSearchHotkey };
|
|
4850
|
+
export { AvatarEditor, AvatarEditorDialog, Bubble, BubbleContent, BubbleGroup, BubbleReactions, ChatMessageList, ConfirmDestructiveDialog, EmojiPicker, EmojiPickerPopover, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, ErrorState, LanguageContext, LanguageSwitcher, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, Message, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, OrgSwitcher, PhoneInput, SearchCommand, ThemeSwitcher, VerifiedProfessionalBadge, VideoPlayer, avatarFallbackStyle, bubbleVariants, cn, createLiveHlsConfig, createVodHlsConfig, defaultLanguages, describePlaybackError, fuzzyMatch, getAvatarColors, getInitials, markerVariants, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, usePlaybackStats, useSearchHotkey };
|
|
4584
4851
|
//# sourceMappingURL=index.js.map
|
|
4585
4852
|
//# sourceMappingURL=index.js.map
|