emoji-picker-react 4.0.0-rc.1 → 4.0.0-rc.12
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 +104 -137
- package/dist/DomUtils/classNames.d.ts +6 -0
- package/dist/DomUtils/emojiElementRef.d.ts +10 -0
- package/dist/DomUtils/isDarkTheme.d.ts +1 -0
- package/dist/components/body/EmojiCategory.d.ts +2 -1
- package/dist/components/context/PickerContext.d.ts +3 -2
- package/dist/components/emoji/Emoji.d.ts +4 -2
- package/dist/config/categoryConfig.d.ts +2 -11
- package/dist/config/cdnUrls.d.ts +1 -1
- package/dist/config/config.d.ts +1 -14
- package/dist/config/useConfig.d.ts +2 -4
- package/dist/data/emojis.d.ts +1 -39
- package/dist/data/skinToneVariations.d.ts +1 -8
- package/dist/dataUtils/emojiSelectors.d.ts +1 -2
- package/dist/dataUtils/recentlyUsed.d.ts +1 -1
- package/dist/emoji-picker-react.cjs.development.css +2 -2
- package/dist/emoji-picker-react.cjs.development.js +15313 -5948
- package/dist/emoji-picker-react.cjs.development.js.map +1 -1
- package/dist/emoji-picker-react.cjs.production.min.js +1 -1
- package/dist/emoji-picker-react.cjs.production.min.js.map +1 -1
- package/dist/emoji-picker-react.esm.js +15295 -5921
- package/dist/emoji-picker-react.esm.js.map +1 -1
- package/dist/hooks/preloadEmoji.d.ts +1 -1
- package/dist/hooks/useDebouncedState.d.ts +1 -0
- package/dist/hooks/useFilter.d.ts +2 -0
- package/dist/index.d.ts +2 -1
- package/dist/types/exposedTypes.d.ts +31 -2
- package/package.json +7 -7
- package/src/DomUtils/classNames.ts +6 -0
- package/src/DomUtils/emojiElementRef.ts +42 -0
- package/src/DomUtils/isDarkTheme.ts +7 -0
- package/src/EmojiPickerReact.css +8 -1
- package/src/components/body/EmojiCategory.css +4 -0
- package/src/components/body/EmojiCategory.tsx +15 -2
- package/src/components/body/EmojiList.tsx +3 -0
- package/src/components/body/RecentlyUsed.tsx +9 -3
- package/src/components/context/PickerContext.tsx +24 -4
- package/src/components/emoji/Emoji.tsx +10 -3
- package/src/components/footer/Preview.tsx +12 -4
- package/src/components/header/Search.tsx +7 -3
- package/src/components/main/PickerMain.tsx +4 -3
- package/src/config/categoryConfig.ts +3 -11
- package/src/config/cdnUrls.ts +1 -1
- package/src/config/config.ts +6 -16
- package/src/config/useConfig.ts +13 -4
- package/src/data/emojis.json +1 -0
- package/src/data/emojis.ts +1 -5348
- package/src/data/skinToneVariations.ts +1 -8
- package/src/dataUtils/emojiSelectors.ts +3 -3
- package/src/dataUtils/recentlyUsed.ts +3 -3
- package/src/hooks/preloadEmoji.ts +1 -1
- package/src/hooks/useDebouncedState.ts +21 -0
- package/src/hooks/useFilter.ts +51 -23
- package/src/hooks/useMouseDownHandlers.ts +8 -6
- package/src/index.tsx +8 -1
- package/src/types/exposedTypes.ts +35 -3
package/README.md
CHANGED
|
@@ -1,181 +1,148 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Emoji Picker React (v4)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
An emoji picker component for React applications.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[Try it live](https://codesandbox.io/s/floral-rgb-z2gkzp?file=/src/App.tsx)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## What to know before using
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- This package assumes it runs in the browser. I have taken many steps to prevent it from failing on the server, but still, it is recommended to only render the component on the client. See troubleshooting section for more information.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Installation
|
|
12
12
|
|
|
13
|
-
The recommended workflow is to run TSDX in one terminal:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm start # or yarn start
|
|
17
13
|
```
|
|
18
|
-
|
|
19
|
-
This builds to `/dist` and runs the project in watch mode so any edits you save inside `src` causes a rebuild to `/dist`.
|
|
20
|
-
|
|
21
|
-
Then run either Storybook or the example playground:
|
|
22
|
-
|
|
23
|
-
### Storybook
|
|
24
|
-
|
|
25
|
-
Run inside another terminal:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
yarn storybook
|
|
14
|
+
npm install emoji-picker-react
|
|
29
15
|
```
|
|
30
16
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
> NOTE: Stories should reference the components as if using the library, similar to the example playground. This means importing from the root project directory. This has been aliased in the tsconfig and the storybook webpack config as a helper.
|
|
34
|
-
|
|
35
|
-
### Example
|
|
17
|
+
## Usage:
|
|
36
18
|
|
|
37
|
-
|
|
19
|
+
```jsx
|
|
20
|
+
import EmojiPicker from 'emoji-picker-react';
|
|
38
21
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
22
|
+
function App() {
|
|
23
|
+
return (
|
|
24
|
+
<div>
|
|
25
|
+
<EmojiPicker />
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
43
29
|
```
|
|
44
30
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
To do a one-off build, use `npm run build` or `yarn build`.
|
|
48
|
-
|
|
49
|
-
To run tests, use `npm test` or `yarn test`.
|
|
50
|
-
|
|
51
|
-
## Configuration
|
|
52
|
-
|
|
53
|
-
Code quality is set up for you with `prettier`, `husky`, and `lint-staged`. Adjust the respective fields in `package.json` accordingly.
|
|
54
|
-
|
|
55
|
-
### Jest
|
|
56
|
-
|
|
57
|
-
Jest tests are set up to run with `npm test` or `yarn test`.
|
|
58
|
-
|
|
59
|
-
### Bundle analysis
|
|
31
|
+
## Features
|
|
60
32
|
|
|
61
|
-
|
|
33
|
+
- Custom click handler
|
|
34
|
+
- Dark mode
|
|
35
|
+
- Customizable styles via css variables
|
|
36
|
+
- Default skin tone selection
|
|
37
|
+
- Skin tone change
|
|
38
|
+
- Different emoji sets (Google, Apple, Facebook, Twitter)
|
|
39
|
+
- Native Emoji support
|
|
62
40
|
|
|
63
|
-
|
|
41
|
+
# Props
|
|
64
42
|
|
|
65
|
-
|
|
43
|
+
The following props are accepted by them picker:
|
|
66
44
|
|
|
67
|
-
|
|
68
|
-
/example
|
|
69
|
-
index.html
|
|
70
|
-
index.tsx # test your component here in a demo app
|
|
71
|
-
package.json
|
|
72
|
-
tsconfig.json
|
|
73
|
-
/src
|
|
74
|
-
index.tsx # EDIT THIS
|
|
75
|
-
/test
|
|
76
|
-
blah.test.tsx # EDIT THIS
|
|
77
|
-
/stories
|
|
78
|
-
Thing.stories.tsx # EDIT THIS
|
|
79
|
-
/.storybook
|
|
80
|
-
main.js
|
|
81
|
-
preview.js
|
|
82
|
-
.gitignore
|
|
83
|
-
package.json
|
|
84
|
-
README.md # EDIT THIS
|
|
85
|
-
tsconfig.json
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
#### React Testing Library
|
|
89
|
-
|
|
90
|
-
We do not set up `react-testing-library` for you yet, we welcome contributions and documentation on this.
|
|
91
|
-
|
|
92
|
-
### Rollup
|
|
45
|
+
- `onEmojiClick`: `(event: MouseEvent, emoji: EmojiClickData) => void` - Callback function when an emoji is clicked. The callback receives the event and the emoji data. The emoji data is comprised of the following properties:
|
|
93
46
|
|
|
94
|
-
|
|
47
|
+
```ts
|
|
48
|
+
{
|
|
49
|
+
activeSkinTone: SkinTones;
|
|
50
|
+
unified: string;
|
|
51
|
+
unifiedWithoutSkinTone: string;
|
|
52
|
+
emoji: string;
|
|
53
|
+
names: string[];
|
|
54
|
+
getImageUrl: (emojiStyle: EmojiStyle) => string;
|
|
55
|
+
}
|
|
56
|
+
```
|
|
95
57
|
|
|
96
|
-
|
|
58
|
+
- `theme`: `Theme` - The theme of the picker. Can be `light`, `dark` or auto. Default is `light`.
|
|
59
|
+
The `Theme` enum can be imported from the package.
|
|
97
60
|
|
|
98
|
-
|
|
61
|
+
```ts
|
|
62
|
+
import { Theme } from 'emoji-picker-react';
|
|
63
|
+
```
|
|
99
64
|
|
|
100
|
-
|
|
65
|
+
- `emojiStyle`: `EmojiStyle` - The emoji style to use. Can be either `apple`, `google`, `facebook`, `twitter` or `native`. Default is `apple`.
|
|
66
|
+
The `EmojiStyle` enum can be imported from the package.
|
|
101
67
|
|
|
102
|
-
|
|
68
|
+
```ts
|
|
69
|
+
import { EmojiStyle } from 'emoji-picker-react';
|
|
70
|
+
```
|
|
103
71
|
|
|
104
|
-
|
|
72
|
+
* `autoFocusSearch`: `boolean` - Whether to focus the search input on mount. Defaults to `true`.
|
|
105
73
|
|
|
106
|
-
|
|
107
|
-
- `size` which comments cost comparison of your library on every pull request using [size-limit](https://github.com/ai/size-limit)
|
|
74
|
+
* `defaultSkinTone`: `SkinTones` - The default skin tone to use when an emoji is clicked. Defaults to `SkinTones.Neutral`. Possible skin tones are:
|
|
108
75
|
|
|
109
|
-
|
|
76
|
+
- ✋ 'neutral'
|
|
77
|
+
- ✋🏻 '1f3fb'
|
|
78
|
+
- ✋🏼 '1f3fc'
|
|
79
|
+
- ✋🏽 '1f3fd'
|
|
80
|
+
- ✋🏾 '1f3fe'
|
|
81
|
+
- ✋🏿 '1f3ff'
|
|
110
82
|
|
|
111
|
-
|
|
83
|
+
The skin tones typescript enum can be imported directly from the package:
|
|
112
84
|
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
declare var __DEV__: boolean;
|
|
116
|
-
|
|
117
|
-
// inside your code...
|
|
118
|
-
if (__DEV__) {
|
|
119
|
-
console.log('foo');
|
|
120
|
-
}
|
|
85
|
+
```ts
|
|
86
|
+
import { SkinTones } from 'emoji-picker-react';
|
|
121
87
|
```
|
|
122
88
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
## Module Formats
|
|
126
|
-
|
|
127
|
-
CJS, ESModules, and UMD module formats are supported.
|
|
89
|
+
- `skinTonesDisabled`: `boolean` - Whether to disable the skin tone selection. Defaults to `false`.
|
|
128
90
|
|
|
129
|
-
|
|
91
|
+
- `showPreview`: `boolean` - Whether to show the preview of the selected emoji. Defaults to `true`.
|
|
130
92
|
|
|
131
|
-
|
|
93
|
+
- `searchPlaceholder`: `string` - The placeholder text for the search input. Defaults to `Search`.
|
|
132
94
|
|
|
133
|
-
|
|
95
|
+
- categories: Allows full config over ordering, naming and display of categories.
|
|
96
|
+
To only sort/omit categories, you can simply pass an array of category names to display:
|
|
134
97
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
netlify init
|
|
145
|
-
# build command: yarn build && cd example && yarn && yarn build
|
|
146
|
-
# directory to deploy: example/dist
|
|
147
|
-
# pick yes for netlify.toml
|
|
148
|
-
```
|
|
98
|
+
- 'recently_used',
|
|
99
|
+
- 'smileys_people',
|
|
100
|
+
- 'animals_nature',
|
|
101
|
+
- 'food_drink',
|
|
102
|
+
- 'travel_places',
|
|
103
|
+
- 'activities',
|
|
104
|
+
- 'objects',
|
|
105
|
+
- 'symbols',
|
|
106
|
+
- 'flags'
|
|
149
107
|
|
|
150
|
-
|
|
108
|
+
For a more in-depth configuration, you can pass an array with category config:
|
|
151
109
|
|
|
152
|
-
|
|
110
|
+
```ts
|
|
111
|
+
[
|
|
112
|
+
{
|
|
113
|
+
category: 'recently_used',
|
|
114
|
+
name: 'Recently Used'
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
category: 'smileys_people',
|
|
118
|
+
name: 'Faces...'
|
|
119
|
+
}
|
|
120
|
+
];
|
|
121
|
+
```
|
|
153
122
|
|
|
154
|
-
|
|
123
|
+
# Troubleshooting
|
|
155
124
|
|
|
156
|
-
|
|
125
|
+
## Next.js
|
|
157
126
|
|
|
158
|
-
|
|
127
|
+
To avoid errors such as "document is not defined" on the server side, you should make sure the library is only imported on the client side. Here is how to do that:
|
|
159
128
|
|
|
160
|
-
|
|
129
|
+
```javascript
|
|
130
|
+
import dynamic from 'next/dynamic';
|
|
161
131
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
132
|
+
const Picker = dynamic(
|
|
133
|
+
() => {
|
|
134
|
+
return import('emoji-picker-react');
|
|
135
|
+
},
|
|
136
|
+
{ ssr: false }
|
|
137
|
+
);
|
|
138
|
+
```
|
|
167
139
|
|
|
168
|
-
|
|
140
|
+
## Vite
|
|
169
141
|
|
|
170
|
-
|
|
142
|
+
For reference, if you only need to shim global, you can add
|
|
171
143
|
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
+ "react": "../../../node_modules/react",
|
|
177
|
-
+ "react-dom": "../../../node_modules/react-dom"
|
|
178
|
-
},
|
|
144
|
+
```html
|
|
145
|
+
<script>
|
|
146
|
+
window.global = window;
|
|
147
|
+
</script>
|
|
179
148
|
```
|
|
180
|
-
|
|
181
|
-
An alternative to fixing this problem would be to remove aliases altogether and define the dependencies referenced as aliases as dev dependencies instead. [However, that might cause other problems.](https://github.com/palmerhq/tsdx/issues/64)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare type EmojiRef = {
|
|
2
|
+
current: null | HTMLElement;
|
|
3
|
+
};
|
|
4
|
+
export declare const emojiRef: Record<string, EmojiRef>;
|
|
5
|
+
export declare function getEmojiRef(unified: string): EmojiRef;
|
|
6
|
+
export declare function iterateEmojiRef(callback: (ref: HTMLElement, unified: string) => void): void;
|
|
7
|
+
export declare function hideEmoji(unified: string): void;
|
|
8
|
+
export declare function showEmoji(unified: string): void;
|
|
9
|
+
export declare function hideElement(element: HTMLElement | null): void;
|
|
10
|
+
export declare function showElement(element: HTMLElement | null): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isSystemDarkTheme(): boolean;
|
|
@@ -5,6 +5,7 @@ declare type Props = Readonly<{
|
|
|
5
5
|
categoryConfig: CategoryConfig;
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
hidden?: boolean;
|
|
8
|
+
hiddenOnSearch?: boolean;
|
|
8
9
|
}>;
|
|
9
|
-
export declare function EmojiCategory({ categoryConfig, children, hidden }: Props): JSX.Element;
|
|
10
|
+
export declare function EmojiCategory({ categoryConfig, children, hidden, hiddenOnSearch }: Props): JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { SkinTones } from '../../data/skinToneVariations';
|
|
3
2
|
import { DataEmoji } from '../../dataUtils/DataTypes';
|
|
4
3
|
import { FilterDict } from '../../hooks/useFilter';
|
|
4
|
+
import { SkinTones } from '../../types/exposedTypes';
|
|
5
5
|
export declare function PickerContextProvider({ children }: Props): JSX.Element;
|
|
6
6
|
declare type ReactState<T> = [T, React.Dispatch<React.SetStateAction<T>>];
|
|
7
7
|
declare type Props = Readonly<{
|
|
@@ -9,13 +9,14 @@ declare type Props = Readonly<{
|
|
|
9
9
|
}>;
|
|
10
10
|
export declare function useFilterRef(): React.MutableRefObject<Record<string, Record<string, DataEmoji>>>;
|
|
11
11
|
export declare function useDisallowClickRef(): React.MutableRefObject<boolean>;
|
|
12
|
-
export declare function useSearchTermState():
|
|
12
|
+
export declare function useSearchTermState(): [string, (term: string) => void];
|
|
13
13
|
export declare function useActiveCategoryState(): [ActiveCategoryState, (nextActive: string) => void, (nextActive: string) => void];
|
|
14
14
|
export declare function useActiveSkinToneState(): [SkinTones, (skinTone: SkinTones) => void];
|
|
15
15
|
export declare function useEmojisThatFailedToLoadState(): ReactState<Set<string>>;
|
|
16
16
|
export declare function useIsPastInitialLoad(): boolean;
|
|
17
17
|
export declare function useEmojiVariationPickerState(): ReactState<DataEmoji | null>;
|
|
18
18
|
export declare function useSkinToneFanOpenState(): ReactState<boolean>;
|
|
19
|
+
export declare function useUpdateRecentlyUsed(): [number, () => void];
|
|
19
20
|
export declare type FilterState = Record<string, FilterDict>;
|
|
20
21
|
declare type ActiveCategoryState = null | string;
|
|
21
22
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { EmojiStyle } from '../../config/config';
|
|
3
2
|
import { DataEmoji } from '../../dataUtils/DataTypes';
|
|
3
|
+
import { EmojiRef } from '../../DomUtils/emojiElementRef';
|
|
4
|
+
import { EmojiStyle } from '../../types/exposedTypes';
|
|
4
5
|
import './Emoji.css';
|
|
5
6
|
declare type Props = Readonly<{
|
|
6
7
|
hidden?: boolean;
|
|
@@ -9,6 +10,7 @@ declare type Props = Readonly<{
|
|
|
9
10
|
unified: string;
|
|
10
11
|
showVariations?: boolean;
|
|
11
12
|
size?: number;
|
|
13
|
+
emojiRef?: EmojiRef;
|
|
12
14
|
}>;
|
|
13
|
-
export declare function Emoji({ emoji, unified, hidden, emojiStyle, showVariations, size }: Props): JSX.Element;
|
|
15
|
+
export declare function Emoji({ emoji, unified, hidden, emojiStyle, showVariations, size, emojiRef }: Props): JSX.Element;
|
|
14
16
|
export {};
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
SMILEYS_PEOPLE = "smileys_people",
|
|
4
|
-
ANIMALS_NATURE = "animals_nature",
|
|
5
|
-
FOOD_DRINK = "food_drink",
|
|
6
|
-
TRAVEL_PLACES = "travel_places",
|
|
7
|
-
ACTIVITIES = "activities",
|
|
8
|
-
OBJECTS = "objects",
|
|
9
|
-
SYMBOLS = "symbols",
|
|
10
|
-
FLAGS = "flags"
|
|
11
|
-
}
|
|
1
|
+
import { Categories } from '../types/exposedTypes';
|
|
2
|
+
export { Categories };
|
|
12
3
|
export declare const baseCategoriesConfig: CategoryConfig[];
|
|
13
4
|
export declare function categoryFromCategoryConfig(category: CategoryConfig): Categories;
|
|
14
5
|
export declare function categoryNameFromCategoryConfig(category: CategoryConfig): string;
|
package/dist/config/cdnUrls.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { EmojiStyle } from
|
|
1
|
+
import { EmojiStyle } from "../types/exposedTypes";
|
|
2
2
|
export declare function cdnUrl(emojiStyle: EmojiStyle): string;
|
package/dist/config/config.d.ts
CHANGED
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
import { SkinTones } from '../
|
|
2
|
-
import { EmojiClickData } from '../types/exposedTypes';
|
|
1
|
+
import { EmojiClickData, EmojiStyle, SkinTones, Theme } from '../types/exposedTypes';
|
|
3
2
|
import { CategoriesConfig } from './categoryConfig';
|
|
4
|
-
export declare enum EmojiStyle {
|
|
5
|
-
NATIVE = "native",
|
|
6
|
-
APPLE = "apple",
|
|
7
|
-
TWITTER = "twitter",
|
|
8
|
-
GOOGLE = "google",
|
|
9
|
-
FACEBOOK = "facebook"
|
|
10
|
-
}
|
|
11
|
-
export declare enum Theme {
|
|
12
|
-
DARK = "dark",
|
|
13
|
-
LIGHT = "light",
|
|
14
|
-
AUTO = "auto"
|
|
15
|
-
}
|
|
16
3
|
export declare function mergeConfig(userConfig?: PickerConfig): {
|
|
17
4
|
categories: CategoriesConfig;
|
|
18
5
|
searchPlaceHolder: string;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { SkinTones } from '../
|
|
2
|
-
import { EmojiClickData } from '../types/exposedTypes';
|
|
1
|
+
import { EmojiClickData, EmojiStyle, SkinTones, Theme } from '../types/exposedTypes';
|
|
3
2
|
import { CategoriesConfig } from './categoryConfig';
|
|
4
|
-
import { EmojiStyle } from './config';
|
|
5
3
|
export declare function useSearchPlaceHolderConfig(): string;
|
|
6
4
|
export declare function useDefaultSkinToneConfig(): SkinTones;
|
|
7
5
|
export declare function useSkinTonesDisabledConfig(): boolean;
|
|
@@ -10,4 +8,4 @@ export declare function useAutoFocusSearchConfig(): boolean;
|
|
|
10
8
|
export declare function useCategoriesConfig(): CategoriesConfig;
|
|
11
9
|
export declare function useOnEmojiClickConfig(): (event: MouseEvent, emoji: EmojiClickData) => void;
|
|
12
10
|
export declare function useShowPreviewConfig(): boolean;
|
|
13
|
-
export declare function useThemeConfig():
|
|
11
|
+
export declare function useThemeConfig(): Theme;
|
package/dist/data/emojis.d.ts
CHANGED
|
@@ -1,40 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
smileys_people: ({
|
|
3
|
-
n: string[];
|
|
4
|
-
u: string;
|
|
5
|
-
v?: undefined;
|
|
6
|
-
} | {
|
|
7
|
-
n: string[];
|
|
8
|
-
u: string;
|
|
9
|
-
v: string[];
|
|
10
|
-
})[];
|
|
11
|
-
animals_nature: {
|
|
12
|
-
n: string[];
|
|
13
|
-
u: string;
|
|
14
|
-
}[];
|
|
15
|
-
food_drink: {
|
|
16
|
-
n: string[];
|
|
17
|
-
u: string;
|
|
18
|
-
}[];
|
|
19
|
-
travel_places: {
|
|
20
|
-
n: string[];
|
|
21
|
-
u: string;
|
|
22
|
-
}[];
|
|
23
|
-
activities: {
|
|
24
|
-
n: string[];
|
|
25
|
-
u: string;
|
|
26
|
-
}[];
|
|
27
|
-
objects: {
|
|
28
|
-
n: string[];
|
|
29
|
-
u: string;
|
|
30
|
-
}[];
|
|
31
|
-
symbols: {
|
|
32
|
-
n: string[];
|
|
33
|
-
u: string;
|
|
34
|
-
}[];
|
|
35
|
-
flags: {
|
|
36
|
-
n: string[];
|
|
37
|
-
u: string;
|
|
38
|
-
}[];
|
|
39
|
-
};
|
|
1
|
+
import emojis from './emojis.json';
|
|
40
2
|
export default emojis;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
NEUTRAL = "neutral",
|
|
3
|
-
LIGHT = "1f3fb",
|
|
4
|
-
MEDIUM_LIGHT = "1f3fc",
|
|
5
|
-
MEDIUM = "1f3fd",
|
|
6
|
-
MEDIUM_DARK = "1f3fe",
|
|
7
|
-
DARK = "1f3ff"
|
|
8
|
-
}
|
|
1
|
+
import { SkinTones } from '../types/exposedTypes';
|
|
9
2
|
declare const skinToneVariations: SkinTones[];
|
|
10
3
|
export default skinToneVariations;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Categories } from './../config/categoryConfig';
|
|
2
|
-
import { EmojiStyle } from '../config/config';
|
|
3
2
|
import { DataEmoji, DataEmojis } from './DataTypes';
|
|
4
|
-
import { SkinTones } from '../
|
|
3
|
+
import { EmojiStyle, SkinTones } from '../types/exposedTypes';
|
|
5
4
|
export declare function emojiNames(emoji: DataEmoji): string[];
|
|
6
5
|
export declare function emojiName(emoji: DataEmoji): string;
|
|
7
6
|
export declare function emojiUrl(emojiStyle: EmojiStyle, emoji: DataEmoji, skinTone?: string): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.EmojiPickerReact button.epr-emoji{padding:var(--epr-emoji-padding);position:relative}.EmojiPickerReact button.epr-emoji.epr-emoji-has-variations:after{border-bottom:4px solid var(--epr-emoji-variation-indicator-color);border-left:4px solid transparent;border-right:4px solid transparent;bottom:0;content:"";display:block;height:0;position:absolute;right:-2px;transform:rotate(135deg);width:0;z-index:var(--epr-emoji-variations-indictator-z-index)}.EmojiPickerReact button.epr-emoji>*{font-size:var(--epr-emoji-size);height:var(--epr-emoji-size);width:var(--epr-emoji-size)}.EmojiPickerReact button.epr-emoji.epr-emoji-has-variations:hover:after{border-bottom:4px solid var(--epr-emoji-variation-indicator-color-hover)}.EmojiPickerReact button.epr-emoji>.epr-emoji-img{font-size:0}.EmojiPickerReact button.epr-emoji>.epr-emoji-native{font-family:Noto Color Emoji,Apple Color Emoji,Segoe UI Emoji,Times,Symbola,Aegyptus,Code2000,Code2001,Code2002,Musica,serif,LastResort;line-height:100%}.EmojiPickerReact button.epr-emoji:hover{background-color:var(--epr-emoji-hover-color);border-radius:8px}
|
|
2
|
-
.EmojiPickerReact li.epr-emoji-category>.epr-emoji-category-label{align-items:center;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background-color:var(--epr-category-label-background-color);color:var(--epr-category-label-text-color);display:flex;font-weight:700;height:var(--epr-category-label-height);padding:var(--epr-category-label-padding);position:-webkit-sticky;position:sticky;text-transform:capitalize;top:0;width:100%;z-index:var(--epr-category-label-z-index)}.EmojiPickerReact.epr-search-active li.epr-emoji-category>.epr-emoji-category-label{opacity:.4;position:relative}.EmojiPickerReact li.epr-emoji-category{display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--epr-emoji-gap);justify-content:space-around;padding:var(--epr-category-padding);position:relative}.EmojiPickerReact li.epr-emoji-category:after{content:"";display:inline-block;flex:1}
|
|
2
|
+
.EmojiPickerReact li.epr-emoji-category>.epr-emoji-category-label{align-items:center;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background-color:var(--epr-category-label-background-color);color:var(--epr-category-label-text-color);display:flex;font-weight:700;height:var(--epr-category-label-height);padding:var(--epr-category-label-padding);position:-webkit-sticky;position:sticky;text-transform:capitalize;top:0;width:100%;z-index:var(--epr-category-label-z-index)}.EmojiPickerReact.epr-search-active li.epr-emoji-category>.epr-emoji-category-label{opacity:.4;position:relative}.EmojiPickerReact li.epr-emoji-category{display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--epr-emoji-gap);justify-content:space-around;padding:var(--epr-category-padding);position:relative}.EmojiPickerReact li.epr-emoji-category:after{content:"";display:inline-block;flex:1}.EmojiPickerReact li.epr-emoji-category:not(:has(.epr-visible)){display:none}
|
|
3
3
|
.EmojiPickerReact ul.epr-emoji-list{list-style:none;margin:0;padding:0}
|
|
4
4
|
.EmojiPickerReact .epr-emoji-variation-picker{align-items:center;background:var(--epr-emoji-variation-picker-bg-color);border:1px solid var(--epr-picker-border-color);border-radius:3px;box-shadow:0 2px 5px rgba(0,0,0,.2);display:flex;height:0;height:var(--epr-emoji-variation-picker-height);justify-content:space-around;left:5px;opacity:0;padding:5px;pointer-events:none;position:absolute;right:5px;top:0;top:-100%;visibility:hidden;z-index:var(--epr-skin-variation-picker-z-index)}.EmojiPickerReact .epr-emoji-variation-picker.visible{opacity:1;pointer-events:all;visibility:visible}.EmojiPickerReact .epr-emoji-variation-picker .EmojiPickerReact .epr-emoji-variation-picker button.epr-emoji:hover{background:none}.EmojiPickerReact .epr-emoji-variation-picker .epr-emoji-pointer{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='50' height='15' xml:space='preserve'%3E%3Cg stroke-miterlimit='10'%3E%3Cpath fill='%23FFF' stroke='%23E8E7E7' d='m1.86-.43 9.83 11.53c.59.69 1.56.69 2.14 0L23.66-.43'/%3E%3Cpath fill='%23010202' stroke='%23151617' d='m26.86-.43 9.83 11.53c.59.69 1.56.69 2.14 0L48.66-.43'/%3E%3C/g%3E%3C/svg%3E");background-position:0 0;background-repeat:no-repeat;background-size:50px 15px;content:"";height:15px;position:absolute;top:-10px;width:25px}.EmojiPickerReact.epr-dark-theme .epr-emoji-variation-picker .epr-emoji-pointer{background-position:-25px 0}.EmojiPickerReact .epr-emoji-variation-picker .epr-emoji-pointer{top:100%;transform:translateX(-7px)}.EmojiPickerReact .epr-emoji-variation-picker .epr-emoji-pointer.pointing-up{top:0;transform:rotate(180deg) translateY(100%) translateX(7px)}
|
|
5
5
|
.EmojiPickerReact .epr-body{flex:1;overflow-x:hidden;overflow-y:scroll;position:relative}
|
|
@@ -10,4 +10,4 @@
|
|
|
10
10
|
.EmojiPickerReact .epr-skin-tones{align-items:center;display:flex;flex-basis:30px;justify-content:flex-end;transition:all .3s ease-in-out}.EmojiPickerReact .epr-skin-tones.open{flex-basis:170px}.EmojiPickerReact .epr-skin-tone-select{height:16px;position:relative;width:16px}.EmojiPickerReact .epr-skin-tones.open .epr-tone{transition:transform .3s ease-in-out,opacity .3s ease-in-out}.EmojiPickerReact .epr-skin-tones:not(.open) .epr-tone{opacity:0;z-index:0}.EmojiPickerReact .epr-skin-tones .epr-tone{border-radius:4px;box-shadow:0 0 0 0 var(--epr-active-skin-hover-color);cursor:pointer;display:block;height:100%;position:absolute;right:0;transition:transform .3s ease-in-out,opacity .5s ease-in-out;width:100%;z-index:1}.EmojiPickerReact .epr-skin-tones .epr-tone:hover{box-shadow:0 0 0 5px var(--epr-active-skin-hover-color)}.EmojiPickerReact .epr-skin-tones.open .epr-skin-tone-select .epr-tone.active:after{border:1px solid var(--epr-active-skin-tone-indicator-border-color);border-radius:5px;bottom:-2px;content:"";left:-2px;position:absolute;right:-2px;top:-2px}.EmojiPickerReact .epr-skin-tones .epr-tone.active{opacity:1;z-index:1}.EmojiPickerReact .epr-skin-tones .epr-tone.epr-tone-neutral{background-color:#ffd225}.EmojiPickerReact .epr-skin-tones .epr-tone.epr-tone-1f3fb{background-color:#ffdfbd}.EmojiPickerReact .epr-skin-tones .epr-tone.epr-tone-1f3fc{background-color:#e9c197}.EmojiPickerReact .epr-skin-tones .epr-tone.epr-tone-1f3fd{background-color:#c88e62}.EmojiPickerReact .epr-skin-tones .epr-tone.epr-tone-1f3fe{background-color:#a86637}.EmojiPickerReact .epr-skin-tones .epr-tone.epr-tone-1f3ff{background-color:#60463a}
|
|
11
11
|
.EmojiPickerReact .epr-header .epr-header-overlay{padding:var(--epr-header-padding);z-index:var(--epr-header-overlay-z-index)}
|
|
12
12
|
aside.EmojiPickerReact.epr-main{border-color:var(--epr-picker-border-color);border-radius:var(--epr-picker-border-radius);border-style:solid;border-width:1px;display:flex;flex-direction:column;height:var(--epr-picker-height);position:relative;width:var(--epr-picker-width)}
|
|
13
|
-
.EmojiPickerReact{--highlight-color:#007aeb;--hover-backdrop-color:#f1f8ff;--text-color-base:#858585;--epr-header-height:70px;--epr-picker-width:350px;--epr-picker-height:500px;--epr-emoji-size:33px;--epr-category-navigation-button-size:30px;--epr-emoji-variation-picker-bg-color:var(--epr-background-color);--epr-emoji-variation-picker-height:55px;--epr-preview-height:70px;--epr-preview-text-color:var(--text-color-base);--epr-preview-text-size:14px;--epr-preview-text-padding:0 10px;--epr-search-bar-bg-color:#f6f6f6;--epr-active-category-indicator-color:var(--highlight-color);--epr-active-skin-tone-indicator-border-color:var(--highlight-color);--epr-search-border-color:var(--highlight-color);--epr-active-skin-hover-color:var(--hover-backdrop-color);--epr-emoji-hover-color:var(--hover-backdrop-color);--epr-category-label-text-color:var(--text-color-base);--epr-category-label-background-color:#ffffffe6;--epr-emoji-padding:5px;--epr-header-padding:15px 10px;--epr-emoji-gap:4px;--epr-category-padding:0 10px;--epr-search-input-padding:0 30px;--epr-search-input-border-radius:8px;--epr-search-input-height:40px;--epr-category-label-padding:0 10px;--epr-category-label-height:40px;--epr-header-overlay-z-index:3;--epr-emoji-variations-indictator-z-index:1;--epr-category-label-z-index:2;--epr-skin-variation-picker-z-index:5;--epr-picker-border-radius:8px;--epr-search-bar-text-color:var(--text-color-base);--epr-search-bar-placeholder-color:var(--text-color-base);--epr-picker-border-color:#e7e7e7;--epr-background-color:#fff;--epr-preview-border-color:var(--epr-picker-border-color);--epr-search-bar-bg-color-active:var(--epr-search-bar-bg-color);--epr-emoji-variation-indicator-color:rgba(0,0,0,.1);--epr-emoji-variation-indicator-color-hover:rgba(0,0,0,.4)}.EmojiPickerReact.epr-dark-theme{--epr-emoji-variation-picker-bg-color:#000;--highlight-color:silver;--text-color-base:var(--highlight-color);--hover-backdrop-color:#363636f6;--epr-search-bar-bg-color:#333;--epr-category-label-background-color:#222222e6;--epr-picker-border-color:#151617;--epr-background-color:#222;--epr-search-bar-bg-color-active:#000;--epr-emoji-variation-indicator-color:hsla(0,0%,100%,.1);--epr-emoji-variation-indicator-color-hover:hsla(0,0%,100%,.4)}.EmojiPickerReact{background-color:var(--epr-background-color);overflow:hidden}.EmojiPickerReact .hidden{display:none!important;opacity:0!important;pointer-events:none!important;visibility:hidden!important}.EmojiPickerReact *{box-sizing:border-box;font-family:sans-serif}.EmojiPickerReact button{background:none;border:0;cursor:pointer}
|
|
13
|
+
.EmojiPickerReact{--highlight-color:#007aeb;--hover-backdrop-color:#f1f8ff;--text-color-base:#858585;--epr-header-height:70px;--epr-picker-width:350px;--epr-picker-height:500px;--epr-emoji-size:33px;--epr-category-navigation-button-size:30px;--epr-emoji-variation-picker-bg-color:var(--epr-background-color);--epr-emoji-variation-picker-height:55px;--epr-preview-height:70px;--epr-preview-text-color:var(--text-color-base);--epr-preview-text-size:14px;--epr-preview-text-padding:0 10px;--epr-search-bar-bg-color:#f6f6f6;--epr-active-category-indicator-color:var(--highlight-color);--epr-active-skin-tone-indicator-border-color:var(--highlight-color);--epr-search-border-color:var(--highlight-color);--epr-active-skin-hover-color:var(--hover-backdrop-color);--epr-emoji-hover-color:var(--hover-backdrop-color);--epr-category-label-text-color:var(--text-color-base);--epr-category-label-background-color:#ffffffe6;--epr-emoji-padding:5px;--epr-header-padding:15px 10px;--epr-emoji-gap:4px;--epr-category-padding:0 10px;--epr-search-input-padding:0 30px;--epr-search-input-border-radius:8px;--epr-search-input-height:40px;--epr-category-label-padding:0 10px;--epr-category-label-height:40px;--epr-header-overlay-z-index:3;--epr-emoji-variations-indictator-z-index:1;--epr-category-label-z-index:2;--epr-skin-variation-picker-z-index:5;--epr-picker-border-radius:8px;--epr-search-bar-text-color:var(--text-color-base);--epr-search-bar-placeholder-color:var(--text-color-base);--epr-picker-border-color:#e7e7e7;--epr-background-color:#fff;--epr-preview-border-color:var(--epr-picker-border-color);--epr-search-bar-bg-color-active:var(--epr-search-bar-bg-color);--epr-emoji-variation-indicator-color:rgba(0,0,0,.1);--epr-emoji-variation-indicator-color-hover:rgba(0,0,0,.4)}.EmojiPickerReact.epr-dark-theme{--epr-emoji-variation-picker-bg-color:#000;--highlight-color:silver;--text-color-base:var(--highlight-color);--hover-backdrop-color:#363636f6;--epr-search-bar-bg-color:#333;--epr-category-label-background-color:#222222e6;--epr-picker-border-color:#151617;--epr-background-color:#222;--epr-search-bar-bg-color-active:#000;--epr-emoji-variation-indicator-color:hsla(0,0%,100%,.1);--epr-emoji-variation-indicator-color-hover:hsla(0,0%,100%,.4)}.EmojiPickerReact{background-color:var(--epr-background-color);overflow:hidden}.EmojiPickerReact .epr-hidden,.EmojiPickerReact.epr-search-active .epr-hidden-on-search{display:none!important;opacity:0!important;pointer-events:none!important;visibility:hidden!important}.EmojiPickerReact *{box-sizing:border-box;font-family:sans-serif}.EmojiPickerReact button{background:none;border:0;cursor:pointer}
|