emoji-picker-react 4.7.8 → 4.7.10

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/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.7.8",
2
+ "version": "4.7.10",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -98,6 +98,6 @@
98
98
  "rollup-plugin-svg": "^2.0.0"
99
99
  },
100
100
  "dependencies": {
101
- "flairup": "0.0.32"
101
+ "flairup": "0.0.35"
102
102
  }
103
103
  }
@@ -1,4 +1,4 @@
1
- import { createSheet } from 'flairup';
1
+ import { Styles, createSheet } from 'flairup';
2
2
  import * as React from 'react';
3
3
 
4
4
  import { ClassNames } from '../DomUtils/classNames';
@@ -84,3 +84,16 @@ export const commonInteractionStyles = stylesheet.create({
84
84
  }
85
85
  }
86
86
  });
87
+
88
+ export function darkMode(key: string, value: Styles) {
89
+ return {
90
+ '.epr-dark-theme': {
91
+ [key]: value
92
+ },
93
+ '.epr-auto-theme': {
94
+ [key]: {
95
+ '@media (prefers-color-scheme: dark)': value
96
+ }
97
+ }
98
+ };
99
+ }
@@ -1,7 +1,7 @@
1
1
  import { cx } from 'flairup';
2
2
  import * as React from 'react';
3
3
 
4
- import { stylesheet } from '../../Stylesheet/stylesheet';
4
+ import { darkMode, stylesheet } from '../../Stylesheet/stylesheet';
5
5
  import { Button } from '../atoms/Button';
6
6
  import { useReactionsModeState } from '../context/PickerContext';
7
7
 
@@ -61,18 +61,8 @@ const styles = stylesheet.create({
61
61
  }
62
62
  }
63
63
  },
64
- '.epr-dark-theme': {
65
- plusSign: {
66
- ':after': { backgroundPositionY: '-40px' },
67
- ':hover:after': { backgroundPositionY: '-60px' }
68
- }
69
- },
70
- '.epr-auto-theme': {
71
- plusSign: {
72
- '@media (prefers-color-scheme: dark)': {
73
- ':after': { backgroundPositionY: '-40px' },
74
- ':hover:after': { backgroundPositionY: '-60px' }
75
- }
76
- }
77
- }
64
+ ...darkMode('plusSign', {
65
+ ':after': { backgroundPositionY: '-40px' },
66
+ ':hover:after': { backgroundPositionY: '-60px' }
67
+ })
78
68
  });
@@ -10,7 +10,7 @@ import {
10
10
  emojiTrueOffsetTop,
11
11
  emojiTruOffsetLeft
12
12
  } from '../../DomUtils/selectors';
13
- import { stylesheet } from '../../Stylesheet/stylesheet';
13
+ import { darkMode, stylesheet } from '../../Stylesheet/stylesheet';
14
14
  import {
15
15
  useEmojiStyleConfig,
16
16
  useGetEmojiUrlConfig
@@ -230,16 +230,7 @@ const styles = stylesheet.create({
230
230
  transform: 'translateX(-18px)',
231
231
  backgroundImage: `url(${SVGTriangle})`
232
232
  },
233
- '.epr-dark-theme': {
234
- pointer: {
235
- backgroundPosition: '-25px 0'
236
- }
237
- },
238
- '.epr-auto-theme': {
239
- pointer: {
240
- '@media (prefers-color-scheme: dark)': {
241
- backgroundPosition: '-25px 0'
242
- }
243
- }
244
- }
233
+ ...darkMode('pointer', {
234
+ backgroundPosition: '-25px 0'
235
+ })
245
236
  });
@@ -3,6 +3,7 @@ import * as React from 'react';
3
3
 
4
4
  import {
5
5
  commonInteractionStyles,
6
+ darkMode,
6
7
  stylesheet
7
8
  } from '../../../Stylesheet/stylesheet';
8
9
  import { useClearSearch } from '../../../hooks/useFilter';
@@ -72,20 +73,8 @@ const styles = stylesheet.create({
72
73
  backgroundPositionY: '-20px'
73
74
  }
74
75
  },
75
- '.epr-dark-theme': {
76
- icnClearnSearch: {
77
- backgroundPositionY: '-40px'
78
- },
79
- btnClearSearch: HoverDark
80
- },
81
- '.epr-auto-theme': {
82
- icnClearnSearch: {
83
- '@media (prefers-color-scheme: dark)': {
84
- backgroundPositionY: '-40px'
85
- }
86
- },
87
- btnClearSearch: {
88
- '@media (prefers-color-scheme: dark)': HoverDark
89
- }
90
- }
76
+ ...darkMode('icnClearnSearch', {
77
+ backgroundPositionY: '-40px'
78
+ }),
79
+ ...darkMode('btnClearSearch', HoverDark)
91
80
  });
@@ -1,7 +1,7 @@
1
1
  import { cx } from 'flairup';
2
2
  import * as React from 'react';
3
3
 
4
- import { stylesheet } from '../../../Stylesheet/stylesheet';
4
+ import { darkMode, stylesheet } from '../../../Stylesheet/stylesheet';
5
5
 
6
6
  import SVGMagnifier from './svg/magnifier.svg';
7
7
 
@@ -24,16 +24,7 @@ const styles = stylesheet.create({
24
24
  backgroundSize: '20px',
25
25
  backgroundImage: `url(${SVGMagnifier})`
26
26
  },
27
- '.epr-dark-theme': {
28
- icnSearch: {
29
- backgroundPositionY: '-20px'
30
- }
31
- },
32
- '.epr-auto-theme': {
33
- icnSearch: {
34
- '@media (prefers-color-scheme: dark)': {
35
- backgroundPositionY: '-20px'
36
- }
37
- }
38
- }
27
+ ...darkMode('icnSearch', {
28
+ backgroundPositionY: '-20px'
29
+ })
39
30
  });
@@ -2,7 +2,7 @@ import { cx } from 'flairup';
2
2
  import * as React from 'react';
3
3
  import { useState } from 'react';
4
4
 
5
- import { stylesheet } from '../../../Stylesheet/stylesheet';
5
+ import { darkMode, stylesheet } from '../../../Stylesheet/stylesheet';
6
6
  import {
7
7
  useAutoFocusSearchConfig,
8
8
  useSearchDisabledConfig,
@@ -161,29 +161,12 @@ const styles = stylesheet.create({
161
161
  backgroundPositionY: '-20px'
162
162
  }
163
163
  },
164
- '.epr-dark-theme': {
165
- icnClearnSearch: {
166
- backgroundPositionY: '-40px'
167
- },
168
- btnClearSearch: {
169
- ':hover > .epr-icn-clear-search': {
170
- backgroundPositionY: '-60px'
171
- }
164
+ ...darkMode('icnClearnSearch', {
165
+ backgroundPositionY: '-40px'
166
+ }),
167
+ ...darkMode('btnClearSearch', {
168
+ ':hover > .epr-icn-clear-search': {
169
+ backgroundPositionY: '-60px'
172
170
  }
173
- },
174
- '.epr-auto-theme': {
175
- icnClearnSearch: {
176
- '@media (prefers-color-scheme: dark)': {
177
- backgroundPositionY: '-40px'
178
- }
179
- },
180
- btnClearSearch: {
181
- '@media (prefers-color-scheme: dark)': {
182
- // @ts-ignore
183
- ':hover > .epr-icn-clear-search': {
184
- backgroundPositionY: '-60px'
185
- }
186
- }
187
- }
188
- }
171
+ })
189
172
  });
@@ -4,6 +4,7 @@ import * as React from 'react';
4
4
  import { ClassNames } from '../../DomUtils/classNames';
5
5
  import {
6
6
  commonInteractionStyles,
7
+ darkMode,
7
8
  stylesheet
8
9
  } from '../../Stylesheet/stylesheet';
9
10
  import {
@@ -128,14 +129,11 @@ const styles = stylesheet.create({
128
129
  'calc(var(--epr-category-navigation-button-size) * -3)'
129
130
  }
130
131
  },
132
+ ...darkMode('catBtn', DarkPositionY),
131
133
  '.epr-dark-theme': {
132
- catBtn: DarkPositionY,
133
134
  ...DarkInactivePosition
134
135
  },
135
136
  '.epr-auto-theme': {
136
- catBtn: {
137
- '@media (prefers-color-scheme: dark)': DarkPositionY
138
- },
139
137
  ...DarkInactivePosition
140
138
  }
141
139
  });