emoji-picker-react 4.6.6 → 4.6.7

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.6",
2
+ "version": "4.6.7",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -99,6 +99,6 @@
99
99
  "typescript": "^4.7.4"
100
100
  },
101
101
  "dependencies": {
102
- "flairup": "0.0.16"
102
+ "flairup": "0.0.24"
103
103
  }
104
104
  }
@@ -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,7 @@
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;
1
+ aside.EmojiPickerReact .epr-cat-btn {
2
+ background-image: svg-load(./svg/CategoryNav.svg);
34
3
  }
35
4
 
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
5
  aside.EmojiPickerReact.epr-main:has(input:not(:placeholder-shown))
53
6
  .epr-category-nav
54
7
  > button.epr-cat-btn:hover {
@@ -64,10 +17,6 @@ aside.EmojiPickerReact.epr-main:has(input:not(:placeholder-shown))
64
17
  opacity: 1;
65
18
  background-position-y: var(--epr-category-navigation-button-size);
66
19
  }
67
- .EmojiPickerReact .epr-category-nav > button.epr-cat-btn {
68
- background-image: svg-load(./svg/CategoryNav.svg);
69
- background-position: 0 0;
70
- }
71
20
 
72
21
  .EmojiPickerReact.epr-dark-theme .epr-category-nav > button.epr-cat-btn {
73
22
  background-position-y: calc(var(--epr-category-navigation-button-size) * 2);
@@ -4,6 +4,7 @@ import { useState } from 'react';
4
4
  import './CategoryNavigation.css';
5
5
 
6
6
  import { ClassNames } from '../../DomUtils/classNames';
7
+ import { stylesheet } from '../../Stylesheet/stylesheet';
7
8
  import {
8
9
  categoryFromCategoryConfig,
9
10
  categoryNameFromCategoryConfig
@@ -29,7 +30,7 @@ export function CategoryNavigation() {
29
30
 
30
31
  return (
31
32
  <div
32
- className="epr-category-nav"
33
+ className={cx(styles.nav)}
33
34
  role="tablist"
34
35
  aria-label="Category navigation"
35
36
  id="epr-category-nav-id"
@@ -46,7 +47,7 @@ export function CategoryNavigation() {
46
47
  return (
47
48
  <Button
48
49
  tabIndex={isSearchMode || isActiveCategory ? -1 : 0}
49
- className={cx('epr-cat-btn', `epr-icn-${category}`, {
50
+ className={cx(styles.catBtn, `epr-icn-${category}`, {
50
51
  [ClassNames.active]: isActiveCategory
51
52
  })}
52
53
  key={category}
@@ -64,3 +65,48 @@ export function CategoryNavigation() {
64
65
  </div>
65
66
  );
66
67
  }
68
+
69
+ const styles = stylesheet.create({
70
+ nav: {
71
+ '.': 'epr-category-nav',
72
+ display: 'flex',
73
+ flexDirection: 'row',
74
+ justifyContent: 'space-around',
75
+ padding: 'var(--epr-header-padding)'
76
+ },
77
+ '.epr-search-active': {
78
+ nav: {
79
+ opacity: '0.3',
80
+ cursor: 'default',
81
+ pointerEvents: 'none'
82
+ }
83
+ },
84
+ '.epr-main:has(input:not(:placeholder-shown))': {
85
+ nav: {
86
+ opacity: '0.3',
87
+ cursor: 'default',
88
+ pointerEvents: 'none'
89
+ }
90
+ },
91
+ catBtn: {
92
+ '.': 'epr-cat-btn',
93
+ display: 'inline-block',
94
+ transition: 'opacity 0.2s ease-in-out',
95
+ position: 'relative',
96
+ height: 'var(--epr-category-navigation-button-size)',
97
+ width: 'var(--epr-category-navigation-button-size)',
98
+ backgroundSize: 'calc(var(--epr-category-navigation-button-size) * 10)',
99
+ outline: 'none',
100
+ backgroundPosition: '0 0',
101
+ ':focus:before': {
102
+ content: '',
103
+ position: 'absolute',
104
+ top: '-2px',
105
+ left: '-2px',
106
+ right: '-2px',
107
+ bottom: '-2px',
108
+ border: '2px solid var(--epr-category-icon-active-color)',
109
+ borderRadius: '50%'
110
+ }
111
+ }
112
+ });
package/src/svg.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ declare module '*.svg' {
2
+ const content: any;
3
+ export default content;
4
+ }