emoji-picker-react 4.6.5 → 4.6.6-rc.2

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.6.5",
2
+ "version": "4.6.6-rc.2",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -99,6 +99,7 @@
99
99
  "typescript": "^4.7.4"
100
100
  },
101
101
  "dependencies": {
102
- "flairup": "0.0.16"
102
+ "flairup": "0.0.24",
103
+ "rollup-plugin-svg": "^2.0.0"
103
104
  }
104
105
  }
@@ -28,10 +28,3 @@ aside.EmojiPickerReact.epr-main:has(input:placeholder-shown)
28
28
  box-sizing: border-box;
29
29
  font-family: sans-serif;
30
30
  }
31
-
32
- .EmojiPickerReact button.epr-btn {
33
- cursor: pointer;
34
- border: 0;
35
- background: none;
36
- outline: none;
37
- }
@@ -1,6 +1,8 @@
1
1
  import { cx } from 'flairup';
2
2
  import * as React from 'react';
3
3
 
4
+ import { stylesheet } from '../../Stylesheet/stylesheet';
5
+
4
6
  interface Props
5
7
  extends React.DetailedHTMLProps<
6
8
  React.ButtonHTMLAttributes<HTMLButtonElement>,
@@ -11,8 +13,22 @@ interface Props
11
13
 
12
14
  export function Button(props: Props) {
13
15
  return (
14
- <button type="button" {...props} className={cx('epr-btn', props.className)}>
16
+ <button
17
+ type="button"
18
+ {...props}
19
+ className={cx(styles.button, props.className)}
20
+ >
15
21
  {props.children}
16
22
  </button>
17
23
  );
18
24
  }
25
+
26
+ const styles = stylesheet.create({
27
+ button: {
28
+ '.': 'epr-btn',
29
+ cursor: 'pointer',
30
+ border: '0',
31
+ background: 'none',
32
+ outline: 'none'
33
+ }
34
+ });
@@ -1,54 +1,3 @@
1
- .EmojiPickerReact .epr-category-nav {
2
- display: flex;
3
- flex-direction: row;
4
- justify-content: space-around;
5
- padding: var(--epr-header-padding);
6
- }
7
-
8
- .EmojiPickerReact .epr-category-nav > button.epr-cat-btn {
9
- display: inline-block;
10
- transition: opacity 0.2s ease-in-out;
11
- position: relative;
12
- height: var(--epr-category-navigation-button-size);
13
- width: var(--epr-category-navigation-button-size);
14
- background-size: calc(var(--epr-category-navigation-button-size) * 10);
15
- outline: none;
16
- }
17
-
18
- .EmojiPickerReact .epr-category-nav > button.epr-cat-btn:focus:before {
19
- content: '';
20
- position: absolute;
21
- top: -2px;
22
- left: -2px;
23
- right: -2px;
24
- bottom: -2px;
25
- border: 2px solid var(--epr-category-icon-active-color);
26
- border-radius: 50%;
27
- }
28
-
29
- aside.EmojiPickerReact.epr-main:has(input:not(:placeholder-shown))
30
- .epr-category-nav {
31
- opacity: 0.3;
32
- cursor: default;
33
- pointer-events: none;
34
- }
35
-
36
- .EmojiPickerReact.epr-search-active .epr-category-nav {
37
- opacity: 0.3;
38
- cursor: default;
39
- pointer-events: none;
40
- }
41
- aside.EmojiPickerReact.epr-main:has(input:not(:placeholder-shown))
42
- .epr-category-nav {
43
- opacity: 0.3;
44
- cursor: default;
45
- pointer-events: none;
46
- }
47
- .EmojiPickerReact.epr-search-active .epr-category-nav {
48
- opacity: 0.3;
49
- cursor: default;
50
- pointer-events: none;
51
- }
52
1
  aside.EmojiPickerReact.epr-main:has(input:not(:placeholder-shown))
53
2
  .epr-category-nav
54
3
  > button.epr-cat-btn:hover {
@@ -64,10 +13,6 @@ aside.EmojiPickerReact.epr-main:has(input:not(:placeholder-shown))
64
13
  opacity: 1;
65
14
  background-position-y: var(--epr-category-navigation-button-size);
66
15
  }
67
- .EmojiPickerReact .epr-category-nav > button.epr-cat-btn {
68
- background-image: svg-load(./svg/CategoryNav.svg);
69
- background-position: 0 0;
70
- }
71
16
 
72
17
  .EmojiPickerReact.epr-dark-theme .epr-category-nav > button.epr-cat-btn {
73
18
  background-position-y: calc(var(--epr-category-navigation-button-size) * 2);
@@ -16,6 +16,9 @@ import { useShouldHideCustomEmojis } from '../../hooks/useShouldHideCustomEmojis
16
16
  import { isCustomCategory } from '../../typeRefinements/typeRefinements';
17
17
  import { Button } from '../atoms/Button';
18
18
  import { useCategoryNavigationRef } from '../context/ElementRefContext';
19
+ import { stylesheet } from '../../Stylesheet/stylesheet';
20
+
21
+ import IcnNav from './svg/CategoryNav.svg';
19
22
 
20
23
  export function CategoryNavigation() {
21
24
  const [activeCategory, setActiveCategory] = useState<string | null>(null);
@@ -29,7 +32,7 @@ export function CategoryNavigation() {
29
32
 
30
33
  return (
31
34
  <div
32
- className="epr-category-nav"
35
+ className={cx(styles.nav)}
33
36
  role="tablist"
34
37
  aria-label="Category navigation"
35
38
  id="epr-category-nav-id"
@@ -46,7 +49,7 @@ export function CategoryNavigation() {
46
49
  return (
47
50
  <Button
48
51
  tabIndex={isSearchMode || isActiveCategory ? -1 : 0}
49
- className={cx('epr-cat-btn', `epr-icn-${category}`, {
52
+ className={cx(styles.catBtn, `epr-icn-${category}`, {
50
53
  [ClassNames.active]: isActiveCategory
51
54
  })}
52
55
  key={category}
@@ -64,3 +67,49 @@ export function CategoryNavigation() {
64
67
  </div>
65
68
  );
66
69
  }
70
+
71
+ const styles = stylesheet.create({
72
+ nav: {
73
+ '.': 'epr-category-nav',
74
+ display: 'flex',
75
+ flexDirection: 'row',
76
+ justifyContent: 'space-around',
77
+ padding: 'var(--epr-header-padding)'
78
+ },
79
+ '.epr-search-active': {
80
+ nav: {
81
+ opacity: '0.3',
82
+ cursor: 'default',
83
+ pointerEvents: 'none'
84
+ }
85
+ },
86
+ '.epr-main:has(input:not(:placeholder-shown))': {
87
+ nav: {
88
+ opacity: '0.3',
89
+ cursor: 'default',
90
+ pointerEvents: 'none'
91
+ }
92
+ },
93
+ catBtn: {
94
+ '.': 'epr-cat-btn',
95
+ display: 'inline-block',
96
+ transition: 'opacity 0.2s ease-in-out',
97
+ position: 'relative',
98
+ height: 'var(--epr-category-navigation-button-size)',
99
+ width: 'var(--epr-category-navigation-button-size)',
100
+ backgroundSize: 'calc(var(--epr-category-navigation-button-size) * 10)',
101
+ outline: 'none',
102
+ backgroundImage: `url(${IcnNav})`,
103
+ backgroundPosition: '0 0',
104
+ ':focus:before': {
105
+ content: '',
106
+ position: 'absolute',
107
+ top: '-2px',
108
+ left: '-2px',
109
+ right: '-2px',
110
+ bottom: '-2px',
111
+ border: '2px solid var(--epr-category-icon-active-color)',
112
+ borderRadius: '50%'
113
+ }
114
+ }
115
+ });
package/src/svg.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ declare module '*.svg' {
2
+ const content: any;
3
+ export default content;
4
+ }