@sesionario/blocks 1.8.0 → 1.9.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.d.cts CHANGED
@@ -629,6 +629,8 @@ declare function useDebouncedValue<T>(value: T, delayMs: number): T;
629
629
  */
630
630
  declare function useDebouncedValueStrict<T>(value: T, delayMs: number): T | undefined;
631
631
 
632
+ declare function useMediaQuery(query: string): boolean;
633
+
632
634
  interface UseSearchHotkeyOptions {
633
635
  /** Initial open state. Defaults to `false`. */
634
636
  defaultOpen?: boolean;
@@ -647,6 +649,93 @@ interface UseSearchHotkeyResult {
647
649
  */
648
650
  declare function useSearchHotkey(options?: UseSearchHotkeyOptions): UseSearchHotkeyResult;
649
651
 
652
+ type SearchablePickerLabels = {
653
+ placeholder?: string;
654
+ searchPlaceholder?: string;
655
+ empty?: string;
656
+ loading?: string;
657
+ error?: string;
658
+ recommended?: string;
659
+ recent?: string;
660
+ results?: string;
661
+ done?: string;
662
+ cancel?: string;
663
+ clear?: string;
664
+ /** Interpolates selected count, e.g. `(n) => \`${n} seleccionados\``. */
665
+ selectedCount?: (count: number) => string;
666
+ emptyOption?: string;
667
+ loadMore?: string;
668
+ dialogTitle?: string;
669
+ };
670
+ type SearchablePickerPinned<T> = {
671
+ recommended?: T[];
672
+ recent?: T[];
673
+ };
674
+ type SearchablePickerCreateOption = {
675
+ label: string;
676
+ onSelect: () => void;
677
+ };
678
+ type SearchablePickerBaseProps<T> = {
679
+ /** Static option list. Filtered client-side with `fuzzyMatch`. */
680
+ options?: T[];
681
+ /**
682
+ * Remote fetcher. When provided with a non-empty query (≥ `minQueryLength`),
683
+ * results replace the static filtered list. Empty query still shows `options`
684
+ * and pinned groups (hybrid mode).
685
+ */
686
+ fetchOptions?: (query: string) => Promise<T[]>;
687
+ getOptionValue: (item: T) => string;
688
+ getOptionLabel: (item: T) => string;
689
+ getOptionKeywords?: (item: T) => string[];
690
+ renderOption?: (item: T, state: {
691
+ selected: boolean;
692
+ }) => ReactNode;
693
+ /** Custom trigger content. Receives the resolved selected item(s). */
694
+ renderValue?: (item: T | T[] | null) => ReactNode;
695
+ pinned?: SearchablePickerPinned<T>;
696
+ labels?: SearchablePickerLabels;
697
+ /** Minimum query length before calling `fetchOptions`. Default 0 (fetch on any query). */
698
+ minQueryLength?: number;
699
+ /** Debounce delay for `fetchOptions`. Default 200ms. */
700
+ debounceMs?: number;
701
+ disabled?: boolean;
702
+ open?: boolean;
703
+ onOpenChange?: (open: boolean) => void;
704
+ clearable?: boolean;
705
+ /** Show a leading “none / empty” option in single mode. */
706
+ allowEmpty?: boolean;
707
+ emptyLabel?: string;
708
+ /**
709
+ * Keep the panel open after selecting an item.
710
+ * Defaults to `false` for single and `true` for multiple.
711
+ */
712
+ keepOpenOnSelect?: boolean;
713
+ /** Cap for multiple selection. */
714
+ maxSelected?: number;
715
+ createOption?: SearchablePickerCreateOption;
716
+ /** Called when the user activates the load-more sentinel (remote pagination). */
717
+ onLoadMore?: () => void | Promise<void>;
718
+ hasMore?: boolean;
719
+ className?: string;
720
+ triggerClassName?: string;
721
+ id?: string;
722
+ "aria-labelledby"?: string;
723
+ "aria-label"?: string;
724
+ };
725
+ type SearchablePickerSingleProps<T> = SearchablePickerBaseProps<T> & {
726
+ mode?: "single";
727
+ value?: string | null;
728
+ onValueChange?: (value: string | null) => void;
729
+ };
730
+ type SearchablePickerMultipleProps<T> = SearchablePickerBaseProps<T> & {
731
+ mode: "multiple";
732
+ value?: string[];
733
+ onValueChange?: (value: string[]) => void;
734
+ };
735
+ type SearchablePickerProps<T> = SearchablePickerSingleProps<T> | SearchablePickerMultipleProps<T>;
736
+
737
+ declare function SearchablePicker<T>(props: SearchablePickerProps<T>): React.JSX.Element;
738
+
650
739
  /**
651
740
  * A search result returned by search-svc's `GET /search` after ACL
652
741
  * hydration. Mirrors `search-svc/src/domain/search/types.ts` `SearchHit` —
@@ -968,4 +1057,4 @@ declare function useSupportConversation({ client, getWsUrl, conversationId: conv
968
1057
 
969
1058
  declare function cn(...inputs: ClassValue[]): string;
970
1059
 
971
- export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ConversationKind, type DescribedPlaybackError, type EmojiCategoryData, type EmojiCategoryKey, type EmojiDatum, EmojiInput, type EmojiInputProps, EmojiPicker, type EmojiPickerLabels, type EmojiPickerLocale, EmojiPickerPopover, type EmojiPickerPopoverProps, type EmojiPickerProps, type EmojiSkinTone, EmojiTextarea, type EmojiTextareaProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, ExpandableText, type ExpandableTextProps, type FeatureEntry, type FindOrCreateConversationInput, type HlsPlayerMode, ImageLightbox, type ImageLightboxLabels, type ImageLightboxProps, 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, type OpenThreadRequest, 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, type SupportChatClient, type SupportConversation, type SupportMessage, type SupportMessengerItem, type SupportMessengerLabels, SupportMessengerProvider, type SupportMessengerProviderProps, type SupportMessengerTab, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, type UseSupportConversationOptions, type UseSupportConversationResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describePlaybackError, fuzzyMatch, insertAtCaret, markerVariants, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, usePlaybackStats, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
1060
+ export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ConversationKind, type DescribedPlaybackError, type EmojiCategoryData, type EmojiCategoryKey, type EmojiDatum, EmojiInput, type EmojiInputProps, EmojiPicker, type EmojiPickerLabels, type EmojiPickerLocale, EmojiPickerPopover, type EmojiPickerPopoverProps, type EmojiPickerProps, type EmojiSkinTone, EmojiTextarea, type EmojiTextareaProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, ExpandableText, type ExpandableTextProps, type FeatureEntry, type FindOrCreateConversationInput, type HlsPlayerMode, ImageLightbox, type ImageLightboxLabels, type ImageLightboxProps, 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, type OpenThreadRequest, 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, SearchablePicker, type SearchablePickerCreateOption, type SearchablePickerLabels, type SearchablePickerMultipleProps, type SearchablePickerPinned, type SearchablePickerProps, type SearchablePickerSingleProps, type SupportChatClient, type SupportConversation, type SupportMessage, type SupportMessengerItem, type SupportMessengerLabels, SupportMessengerProvider, type SupportMessengerProviderProps, type SupportMessengerTab, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, type UseSupportConversationOptions, type UseSupportConversationResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describePlaybackError, fuzzyMatch, insertAtCaret, markerVariants, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
package/dist/index.d.ts CHANGED
@@ -629,6 +629,8 @@ declare function useDebouncedValue<T>(value: T, delayMs: number): T;
629
629
  */
630
630
  declare function useDebouncedValueStrict<T>(value: T, delayMs: number): T | undefined;
631
631
 
632
+ declare function useMediaQuery(query: string): boolean;
633
+
632
634
  interface UseSearchHotkeyOptions {
633
635
  /** Initial open state. Defaults to `false`. */
634
636
  defaultOpen?: boolean;
@@ -647,6 +649,93 @@ interface UseSearchHotkeyResult {
647
649
  */
648
650
  declare function useSearchHotkey(options?: UseSearchHotkeyOptions): UseSearchHotkeyResult;
649
651
 
652
+ type SearchablePickerLabels = {
653
+ placeholder?: string;
654
+ searchPlaceholder?: string;
655
+ empty?: string;
656
+ loading?: string;
657
+ error?: string;
658
+ recommended?: string;
659
+ recent?: string;
660
+ results?: string;
661
+ done?: string;
662
+ cancel?: string;
663
+ clear?: string;
664
+ /** Interpolates selected count, e.g. `(n) => \`${n} seleccionados\``. */
665
+ selectedCount?: (count: number) => string;
666
+ emptyOption?: string;
667
+ loadMore?: string;
668
+ dialogTitle?: string;
669
+ };
670
+ type SearchablePickerPinned<T> = {
671
+ recommended?: T[];
672
+ recent?: T[];
673
+ };
674
+ type SearchablePickerCreateOption = {
675
+ label: string;
676
+ onSelect: () => void;
677
+ };
678
+ type SearchablePickerBaseProps<T> = {
679
+ /** Static option list. Filtered client-side with `fuzzyMatch`. */
680
+ options?: T[];
681
+ /**
682
+ * Remote fetcher. When provided with a non-empty query (≥ `minQueryLength`),
683
+ * results replace the static filtered list. Empty query still shows `options`
684
+ * and pinned groups (hybrid mode).
685
+ */
686
+ fetchOptions?: (query: string) => Promise<T[]>;
687
+ getOptionValue: (item: T) => string;
688
+ getOptionLabel: (item: T) => string;
689
+ getOptionKeywords?: (item: T) => string[];
690
+ renderOption?: (item: T, state: {
691
+ selected: boolean;
692
+ }) => ReactNode;
693
+ /** Custom trigger content. Receives the resolved selected item(s). */
694
+ renderValue?: (item: T | T[] | null) => ReactNode;
695
+ pinned?: SearchablePickerPinned<T>;
696
+ labels?: SearchablePickerLabels;
697
+ /** Minimum query length before calling `fetchOptions`. Default 0 (fetch on any query). */
698
+ minQueryLength?: number;
699
+ /** Debounce delay for `fetchOptions`. Default 200ms. */
700
+ debounceMs?: number;
701
+ disabled?: boolean;
702
+ open?: boolean;
703
+ onOpenChange?: (open: boolean) => void;
704
+ clearable?: boolean;
705
+ /** Show a leading “none / empty” option in single mode. */
706
+ allowEmpty?: boolean;
707
+ emptyLabel?: string;
708
+ /**
709
+ * Keep the panel open after selecting an item.
710
+ * Defaults to `false` for single and `true` for multiple.
711
+ */
712
+ keepOpenOnSelect?: boolean;
713
+ /** Cap for multiple selection. */
714
+ maxSelected?: number;
715
+ createOption?: SearchablePickerCreateOption;
716
+ /** Called when the user activates the load-more sentinel (remote pagination). */
717
+ onLoadMore?: () => void | Promise<void>;
718
+ hasMore?: boolean;
719
+ className?: string;
720
+ triggerClassName?: string;
721
+ id?: string;
722
+ "aria-labelledby"?: string;
723
+ "aria-label"?: string;
724
+ };
725
+ type SearchablePickerSingleProps<T> = SearchablePickerBaseProps<T> & {
726
+ mode?: "single";
727
+ value?: string | null;
728
+ onValueChange?: (value: string | null) => void;
729
+ };
730
+ type SearchablePickerMultipleProps<T> = SearchablePickerBaseProps<T> & {
731
+ mode: "multiple";
732
+ value?: string[];
733
+ onValueChange?: (value: string[]) => void;
734
+ };
735
+ type SearchablePickerProps<T> = SearchablePickerSingleProps<T> | SearchablePickerMultipleProps<T>;
736
+
737
+ declare function SearchablePicker<T>(props: SearchablePickerProps<T>): React.JSX.Element;
738
+
650
739
  /**
651
740
  * A search result returned by search-svc's `GET /search` after ACL
652
741
  * hydration. Mirrors `search-svc/src/domain/search/types.ts` `SearchHit` —
@@ -968,4 +1057,4 @@ declare function useSupportConversation({ client, getWsUrl, conversationId: conv
968
1057
 
969
1058
  declare function cn(...inputs: ClassValue[]): string;
970
1059
 
971
- export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ConversationKind, type DescribedPlaybackError, type EmojiCategoryData, type EmojiCategoryKey, type EmojiDatum, EmojiInput, type EmojiInputProps, EmojiPicker, type EmojiPickerLabels, type EmojiPickerLocale, EmojiPickerPopover, type EmojiPickerPopoverProps, type EmojiPickerProps, type EmojiSkinTone, EmojiTextarea, type EmojiTextareaProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, ExpandableText, type ExpandableTextProps, type FeatureEntry, type FindOrCreateConversationInput, type HlsPlayerMode, ImageLightbox, type ImageLightboxLabels, type ImageLightboxProps, 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, type OpenThreadRequest, 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, type SupportChatClient, type SupportConversation, type SupportMessage, type SupportMessengerItem, type SupportMessengerLabels, SupportMessengerProvider, type SupportMessengerProviderProps, type SupportMessengerTab, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, type UseSupportConversationOptions, type UseSupportConversationResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describePlaybackError, fuzzyMatch, insertAtCaret, markerVariants, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, usePlaybackStats, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
1060
+ export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ConversationKind, type DescribedPlaybackError, type EmojiCategoryData, type EmojiCategoryKey, type EmojiDatum, EmojiInput, type EmojiInputProps, EmojiPicker, type EmojiPickerLabels, type EmojiPickerLocale, EmojiPickerPopover, type EmojiPickerPopoverProps, type EmojiPickerProps, type EmojiSkinTone, EmojiTextarea, type EmojiTextareaProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, ExpandableText, type ExpandableTextProps, type FeatureEntry, type FindOrCreateConversationInput, type HlsPlayerMode, ImageLightbox, type ImageLightboxLabels, type ImageLightboxProps, 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, type OpenThreadRequest, 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, SearchablePicker, type SearchablePickerCreateOption, type SearchablePickerLabels, type SearchablePickerMultipleProps, type SearchablePickerPinned, type SearchablePickerProps, type SearchablePickerSingleProps, type SupportChatClient, type SupportConversation, type SupportMessage, type SupportMessengerItem, type SupportMessengerLabels, SupportMessengerProvider, type SupportMessengerProviderProps, type SupportMessengerTab, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, type UseSupportConversationOptions, type UseSupportConversationResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describePlaybackError, fuzzyMatch, insertAtCaret, markerVariants, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };