import * as React from 'react'; type EmojiClickData = { activeSkinTone: SkinTones; unified: string; unifiedWithoutSkinTone: string; emoji: string; names: string[]; imageUrl: string; getImageUrl: (emojiStyle?: EmojiStyleValue) => string; isCustom: boolean; }; type CategoryConfig = { category: Categories; name: string; icon?: React.ReactNode; /** * Selects a `CustomEmoji` group for `Categories.CUSTOM` entries. Each * grouped entry renders its own section and nav tab; ungrouped entries * share the classic customs bucket. */ group?: string; }; type CategoryIcons = Partial>; type EmojiData = { categories: Partial>; emojis: Record; }; interface DataEmoji$1 { n: string[]; u: string; v?: string[]; a: string; } declare enum SuggestionMode { RECENT = "recent", FREQUENT = "frequent" } type SuggestionModeValue = SuggestionMode | 'recent' | 'frequent'; declare enum EmojiStyle { NATIVE = "native", APPLE = "apple", TWITTER = "twitter", GOOGLE = "google", FACEBOOK = "facebook" } type EmojiStyleValue = EmojiStyle | 'native' | 'apple' | 'twitter' | 'google' | 'facebook'; declare enum Theme { DARK = "dark", LIGHT = "light", AUTO = "auto" } type ThemeValue = Theme | 'dark' | 'light' | 'auto'; declare enum SkinTones { NEUTRAL = "neutral", LIGHT = "1f3fb", MEDIUM_LIGHT = "1f3fc", MEDIUM = "1f3fd", MEDIUM_DARK = "1f3fe", DARK = "1f3ff" } /** A skin tone as the enum or its literal value (`'neutral'`, `'1f3fb'`, …). */ type SkinTonesValue = SkinTones | 'neutral' | '1f3fb' | '1f3fc' | '1f3fd' | '1f3fe' | '1f3ff'; declare enum Categories { SUGGESTED = "suggested", CUSTOM = "custom", SMILEYS_PEOPLE = "smileys_people", ANIMALS_NATURE = "animals_nature", FOOD_DRINK = "food_drink", TRAVEL_PLACES = "travel_places", ACTIVITIES = "activities", OBJECTS = "objects", SYMBOLS = "symbols", FLAGS = "flags" } declare enum SkinTonePickerLocation { SEARCH = "SEARCH", PREVIEW = "PREVIEW", /** * No built-in placement: render the `SkinTone` primitive wherever you * want it, or drive the tone through `skinTone` / `useSkinTone()`. */ NONE = "NONE" } declare enum EmojiProperties { name = "n", unified = "u", variations = "v", added_in = "a", imgUrl = "imgUrl" } interface DataEmoji extends WithName { /** Exact rendered identity; canonical unified remains the search identity. */ renderUnified?: string; /** Stored recent identity when the active tone has no matching variation. */ fallbackUnified?: string; [EmojiProperties.unified]: string; [EmojiProperties.variations]?: string[]; [EmojiProperties.added_in]: string; [EmojiProperties.imgUrl]?: string; } type WithName = { [EmojiProperties.name]: string[]; }; type CustomEmoji = { names: string[]; [EmojiProperties.imgUrl]: string; id: string; /** * Optional group name. Customs sharing a group render as their own * category section; ungrouped customs keep the single shared bucket. * Reference the group from a `{ category: Categories.CUSTOM, group }` * entry in the `categories` prop to place and name the section. * https://github.com/ealush/emoji-picker-react/issues/510 */ group?: string; }; type GetEmojiUrl = (unified: string, style: EmojiStyleValue) => string; /** * Asynchronous dataset source, e.g. * `() => import('emoji-picker-react/data/emojis-fr')`. * Hoist it (module scope or useCallback): a new function identity loads * again. */ type EmojiDataLoaderOptions = { signal?: AbortSignal; }; type EmojiDataLoader = (options: EmojiDataLoaderOptions) => Promise; type EmojiDataInput = EmojiData | EmojiDataLoader; type CategoriesConfig = CategoryConfig[]; type UserCategoryConfig = Array; /** * Every user-facing string the picker renders or announces. All keys are * optional on the `labels` prop; anything omitted keeps its English * default. Category names come from `categories` / localized `emojiData`, * and the preview caption from `previewConfig.defaultCaption`. */ type PickerLabels = { searchPlaceholder: string; /** Accessible name of the search input. */ searchLabel: string; searchClear: string; /** Live-region announcement and visible empty state. */ searchResultsNone: string; searchResultsOne: string; /** `%n` is replaced with the result count. */ searchResultsMany: string; categoryNavigation: string; reactions: string; expandReactions: string; /** Shown by the Loading part while the dataset loads. */ loading: string; loadingError: string; retryLoading: string; skinToneNeutral: string; skinToneLight: string; skinToneMediumLight: string; skinToneMedium: string; skinToneMediumDark: string; skinToneDark: string; }; type PickerConfigInternal = { emojiVersion: string | null; searchPlaceHolder: string; searchPlaceholder: string; searchClearButtonLabel: string; defaultSkinTone: SkinTonesValue; skinTonesDisabled: boolean; autoFocusSearch: boolean; /** * Keep focus in the search input while the arrow keys move a highlight * through the grid, so typing continues; Enter selects the highlighted * emoji. Default: arrows move focus into the grid. */ keepSearchFocus: boolean; /** * Turns off skin-tone variations in the grid: no long press, no Space * menu, no variation marker. The active skin tone still applies. */ variationsDisabled: boolean; emojiStyle: EmojiStyleValue; categories: CategoriesConfig; theme: ThemeValue; suggestedEmojisMode: SuggestionModeValue; lazyLoadEmojis: boolean; previewConfig: PreviewConfig; className: string; height: PickerDimensions; width: PickerDimensions; style: React.CSSProperties; getEmojiUrl: GetEmojiUrl; searchDisabled: boolean; skinTonePickerLocation: SkinTonePickerLocation; unicodeToHide: Set; customEmojis: CustomEmoji[]; reactionsDefaultOpen: boolean; reactions: string[]; open: boolean; allowExpandReactions: boolean; hiddenEmojis: string[]; emojiData?: EmojiData; categoryIcons: CategoryIcons; nonce?: string; /** * Controlled search value (raw user text). When present, it is the * accepted visible source of truth; user edits emit `onSearchChange` * proposals instead of committing locally. */ searchValue?: string; /** Uncontrolled initial search value, read once per mounted lifetime. */ defaultSearchValue?: string; /** Emitted synchronously with each committed (uncontrolled) or proposed (controlled) user edit. */ onSearchChange?: (value: string) => void; /** Accessible label for the search input. Defaults to English. */ searchLabel?: string; /** * Caller-defined Suggested category contents/order (unified or custom * IDs). While present, `suggestedEmojisMode` is ignored for contents. */ suggestedEmojis?: string[]; /** Observes compact-reactions vs full-picker transitions. */ onReactionsModeChange?: (reactionsOpen: boolean) => void; /** * Localized user-facing strings. Takes precedence over the individual * `searchPlaceholder` / `searchLabel` / `searchClearButtonLabel` props. */ labels?: Partial; /** * Controlled active skin tone. Pair with `onSkinToneChange`; while * present, `defaultSkinTone` is ignored. */ skinTone?: SkinTonesValue; /** * Emit the picker's CSS inside this cascade layer (e.g. "epr"), for * layered CSS frameworks such as Tailwind v4 whose utilities cannot * beat unlayered CSS. Declare the layer first in your CSS: * `@layer epr, theme, base, components, utilities;`. Default: unlayered. */ cssLayer?: string; /** * Emojis per row. The picker then sizes its width to fit those columns * unless you set a width; a narrower container shows fewer columns. * Default: as many as the width fits. */ columns?: number; }; type PreviewConfig = { defaultEmoji: string; defaultCaption: string; showPreview: boolean; }; type ConfigExternal = { previewConfig: Partial; onEmojiClick: MouseDownEvent; onReactionClick: MouseDownEvent; onSkinToneChange: OnSkinToneChange; /** * User-supplied allowlist/order/merge input. Bare `Categories` members * are accepted alongside full configs (as in v4 usage and this repo's * own tests); the merged internal representation stays `CategoriesConfig`. */ categories: UserCategoryConfig; /** * Dataset: an object (synchronous, SSR-safe), or a loader such as * `() => import('emoji-picker-react/data/emojis-fr')` to code-split it. * Omitted: the bundled English dataset. */ emojiData: EmojiDataInput; } & Omit; type PickerConfig = Partial; type PickerDimensions = string | number; type MouseDownEvent = (emoji: EmojiClickData, event: MouseEvent, api?: OnEmojiClickApi) => void; type OnSkinToneChange = (skinTone: SkinTones) => void; /** The `onEmojiClick` / `onReactionClick` callback signature. */ type EmojiClickHandler = MouseDownEvent; /** The `onSkinToneChange` callback signature. */ type SkinToneChangeHandler = OnSkinToneChange; /** Third argument of `onEmojiClick` / `onReactionClick`. */ type OnEmojiClickApi = { /** Return to the compact reactions bar (no-op when reactions are off). */ collapseToReactions: () => void; }; /** The emoji a custom `Emoji` cell renders. */ type ListEmoji = { /** True while hovered or keyboard-focused. */ isActive: boolean; /** Unified code including the active skin tone, e.g. `1f44d-1f3fd`. */ unified: string; names: string[]; /** Native emoji text (custom emojis: their id). */ emoji: string; isCustom: boolean; /** Active image style URL, or undefined for standard native emojis. */ imageUrl?: string; /** Whether a long press opens skin tone variations. */ hasVariations: boolean; }; /** * Props for a custom emoji cell. Spread everything except `emoji` onto a * `