emoji-picker-react 4.6.8-rc.3 → 4.6.8

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.
@@ -38,13 +38,6 @@ export function SearchContainer() {
38
38
  );
39
39
  }
40
40
 
41
- const styles = stylesheet.create({
42
- overlay: {
43
- padding: 'var(--epr-header-padding)',
44
- zIndex: 'var(--epr-header-overlay-z-index)'
45
- }
46
- });
47
-
48
41
  export function Search() {
49
42
  const [inc, setInc] = useState(0);
50
43
  const closeAllOpenToggles = useCloseAllOpenToggles();
@@ -58,14 +51,14 @@ export function Search() {
58
51
  const value = input?.value;
59
52
 
60
53
  return (
61
- <Relative className="epr-search-container">
54
+ <Relative className={cx(styles.searchContainer)}>
62
55
  <CssSearch value={value} />
63
56
  <input
64
57
  // eslint-disable-next-line jsx-a11y/no-autofocus
65
58
  autoFocus={autoFocus}
66
59
  aria-label={'Type to search for an emoji'}
67
60
  onFocus={closeAllOpenToggles}
68
- className="epr-search"
61
+ className={cx(styles.search)}
69
62
  type="text"
70
63
  aria-controls="epr-search-id"
71
64
  placeholder={placeholder}
@@ -80,10 +73,7 @@ export function Search() {
80
73
  {searchTerm ? (
81
74
  <div
82
75
  role="status"
83
- className={cx(
84
- 'epr-status-search-results',
85
- 'epr-status-visually-hidden'
86
- )}
76
+ className={cx('epr-status-search-results', styles.visuallyHidden)}
87
77
  aria-live="polite"
88
78
  id="epr-search-id"
89
79
  aria-atomic="true"
@@ -91,15 +81,138 @@ export function Search() {
91
81
  {statusSearchResults}
92
82
  </div>
93
83
  ) : null}
94
- <div className="epr-icn-search" />
84
+ <div className={cx(styles.icnSearch)} />
95
85
  <Button
96
- className={cx('epr-btn-clear-search', 'epr-visible-on-search-only')}
86
+ className={cx(styles.btnClearSearch, 'epr-visible-on-search-only')}
97
87
  onClick={clearSearch}
98
88
  aria-label="Clear"
99
89
  title="Clear"
100
90
  >
101
- <div className="epr-icn-clear-search" />
91
+ <div className={cx(styles.icnClearnSearch)} />
102
92
  </Button>
103
93
  </Relative>
104
94
  );
105
95
  }
96
+
97
+ const styles = stylesheet.create({
98
+ overlay: {
99
+ padding: 'var(--epr-header-padding)',
100
+ zIndex: 'var(--epr-header-overlay-z-index)'
101
+ },
102
+ searchContainer: {
103
+ '.': 'epr-search-container',
104
+ flex: '1',
105
+ display: 'block',
106
+ minWidth: '0'
107
+ },
108
+ visuallyHidden: {
109
+ clip: 'rect(0 0 0 0)',
110
+ clipPath: 'inset(50%)',
111
+ height: '1px',
112
+ overflow: 'hidden',
113
+ position: 'absolute',
114
+ whiteSpace: 'nowrap',
115
+ width: '1px'
116
+ },
117
+ search: {
118
+ outline: 'none',
119
+ transition: 'all 0.2s ease-in-out',
120
+ color: 'var(--epr-search-input-text-color)',
121
+ borderRadius: 'var(--epr-search-input-border-radius)',
122
+ padding: 'var(--epr-search-input-padding)',
123
+ height: 'var(--epr-search-input-height)',
124
+ backgroundColor: 'var(--epr-search-input-bg-color)',
125
+ border: '1px solid var(--epr-search-input-bg-color)',
126
+ width: '100%',
127
+ ':focus': {
128
+ backgroundColor: 'var(--epr-search-input-bg-color-active)',
129
+ border: '1px solid var(--epr-search-border-color)'
130
+ },
131
+ '::placeholder': {
132
+ color: 'var(--epr-search-input-placeholder-color)'
133
+ }
134
+ },
135
+ icnSearch: {
136
+ '.': 'epr-icn-search',
137
+ content: '',
138
+ position: 'absolute',
139
+ top: '50%',
140
+ left: 'var(--epr-search-bar-inner-padding)',
141
+ transform: 'translateY(-50%)',
142
+ width: '20px',
143
+ height: '20px',
144
+ backgroundRepeat: 'no-repeat',
145
+ backgroundPosition: '0 0',
146
+ backgroundSize: '20px'
147
+ },
148
+ btnClearSearch: {
149
+ '.': 'epr-btn-clear-search',
150
+ position: 'absolute',
151
+ right: 'var(--epr-search-bar-inner-padding)',
152
+ height: '30px',
153
+ width: '30px',
154
+ display: 'flex',
155
+ alignItems: 'center',
156
+ justifyContent: 'center',
157
+ top: '50%',
158
+ transform: 'translateY(-50%)',
159
+ padding: '0',
160
+ borderRadius: '50%',
161
+ ':hover': {
162
+ background: 'var(--epr-hover-bg-color)'
163
+ },
164
+ ':focus': {
165
+ background: 'var(--epr-hover-bg-color)'
166
+ }
167
+ },
168
+ icnClearnSearch: {
169
+ '.': 'epr-icn-clear-search',
170
+ backgroundColor: 'transparent',
171
+ backgroundRepeat: 'no-repeat',
172
+ backgroundSize: '20px',
173
+ height: '20px',
174
+ width: '20px',
175
+ ':hover': {
176
+ backgroundPositionY: '-20px'
177
+ },
178
+ ':focus': {
179
+ backgroundPositionY: '-20px'
180
+ }
181
+ },
182
+ '.epr-dark-theme': {
183
+ icnSearch: {
184
+ backgroundPositionY: '-20px'
185
+ },
186
+ icnClearnSearch: {
187
+ backgroundPositionY: '-40px'
188
+ },
189
+ btnClearSearch: {
190
+ ':hover > .epr-icn-clear-search': {
191
+ backgroundPositionY: '-60px'
192
+ }
193
+ }
194
+ },
195
+ '.epr-auto-theme': {
196
+ icnSearch: {
197
+ // @ts-ignore
198
+ '@media (prefers-color-scheme: dark)': {
199
+ backgroundPositionY: '-20px'
200
+ }
201
+ },
202
+ icnClearnSearch: {
203
+ // @ts-ignore
204
+ '@media (prefers-color-scheme: dark)': {
205
+ backgroundPositionY: '-40px'
206
+ }
207
+ },
208
+ btnClearSearch: {
209
+ // @ts-ignore
210
+ '@media (prefers-color-scheme: dark)': {
211
+ // @ts-ignore
212
+ ':hover > .epr-icn-clear-search': {
213
+ backgroundPositionY: '-60px'
214
+ }
215
+ }
216
+ }
217
+ }
218
+ });
@@ -1,3 +1,7 @@
1
+ aside.EmojiPickerReact .epr-cat-btn {
2
+ background-image: svg-load(./svg/CategoryNav.svg);
3
+ }
4
+
1
5
  aside.EmojiPickerReact.epr-main:has(input:not(:placeholder-shown))
2
6
  .epr-category-nav
3
7
  > button.epr-cat-btn:hover {
@@ -18,8 +18,6 @@ import { isCustomCategory } from '../../typeRefinements/typeRefinements';
18
18
  import { Button } from '../atoms/Button';
19
19
  import { useCategoryNavigationRef } from '../context/ElementRefContext';
20
20
 
21
- import CatNavBtn from './svg/CategoryNav.svg';
22
-
23
21
  export function CategoryNavigation() {
24
22
  const [activeCategory, setActiveCategory] = useState<string | null>(null);
25
23
  const scrollCategoryIntoView = useScrollCategoryIntoView();
@@ -98,7 +96,6 @@ const styles = stylesheet.create({
98
96
  height: 'var(--epr-category-navigation-button-size)',
99
97
  width: 'var(--epr-category-navigation-button-size)',
100
98
  backgroundSize: 'calc(var(--epr-category-navigation-button-size) * 10)',
101
- backgroundImage: `url(${CatNavBtn})`,
102
99
  outline: 'none',
103
100
  backgroundPosition: '0 0',
104
101
  ':focus:before': {
@@ -1,80 +0,0 @@
1
- .EmojiPickerReact button.epr-emoji {
2
- position: relative;
3
- width: var(--epr-emoji-fullsize);
4
- height: var(--epr-emoji-fullsize);
5
- box-sizing: border-box;
6
- display: flex;
7
- align-items: center;
8
- justify-content: center;
9
- max-width: var(--epr-emoji-fullsize);
10
- max-height: var(--epr-emoji-fullsize);
11
- border-radius: 8px;
12
- overflow: hidden;
13
- }
14
-
15
- .EmojiPickerReact button.epr-emoji.epr-emoji-has-variations:after {
16
- content: '';
17
- display: block;
18
- width: 0;
19
- height: 0;
20
- right: 0px;
21
- bottom: 1px;
22
- position: absolute;
23
- border-left: 4px solid transparent;
24
- border-right: 4px solid transparent;
25
- transform: rotate(135deg);
26
- border-bottom: 4px solid var(--epr-emoji-variation-indicator-color);
27
- z-index: var(--epr-emoji-variations-indictator-z-index);
28
- }
29
-
30
- .EmojiPickerReact button.epr-emoji .epr-emoji-img {
31
- max-width: var(--epr-emoji-fullsize);
32
- max-height: var(--epr-emoji-fullsize);
33
- min-width: var(--epr-emoji-fullsize);
34
- min-height: var(--epr-emoji-fullsize);
35
- padding: var(--epr-emoji-padding);
36
- }
37
-
38
- .EmojiPickerReact button.epr-emoji .epr-emoji-native {
39
- padding: var(--epr-emoji-padding);
40
- }
41
-
42
- .EmojiPickerReact button.epr-emoji > * {
43
- align-self: center;
44
- justify-self: center;
45
- display: block;
46
- }
47
-
48
- .EmojiPickerReact button.epr-emoji.epr-emoji-has-variations:hover:after {
49
- border-bottom: 4px solid var(--epr-emoji-variation-indicator-color-hover);
50
- }
51
-
52
- .__EmojiPicker__.epr-emoji-img {
53
- font-size: 0;
54
- }
55
-
56
- .__EmojiPicker__.epr-emoji-native {
57
- font-family: 'Segoe UI Emoji', 'Segoe UI Symbol', 'Segoe UI',
58
- 'Apple Color Emoji', 'Twemoji Mozilla', 'Noto Color Emoji', 'Android Emoji',
59
- Times, Symbola, Aegyptus, Code2000, Code2001, Code2002, Musica, serif,
60
- LastResort;
61
- position: relative;
62
- line-height: 100%;
63
- font-size: var(--epr-emoji-size);
64
- text-align: center;
65
- align-self: center;
66
- justify-self: center;
67
- letter-spacing: 0;
68
- }
69
-
70
- .EmojiPickerReact button.epr-emoji > * {
71
- transition: background-color 0.2s;
72
- }
73
-
74
- .EmojiPickerReact button.epr-emoji:hover > * {
75
- background-color: var(--epr-emoji-hover-color);
76
- }
77
-
78
- .EmojiPickerReact button.epr-emoji:focus > * {
79
- background-color: var(--epr-focus-bg-color);
80
- }