emoji-picker-react 4.6.6-rc.4 → 4.6.6
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/dist/emoji-picker-react.cjs.development.css +2 -2
- package/dist/emoji-picker-react.cjs.development.js +21 -77
- 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 +23 -79
- package/dist/emoji-picker-react.esm.js.map +1 -1
- package/package.json +3 -4
- package/src/EmojiPickerReact.css +7 -0
- package/src/components/atoms/Button.tsx +1 -17
- package/src/components/navigation/CategoryNavigation.css +55 -0
- package/src/components/navigation/CategoryNavigation.tsx +2 -51
- package/src/svg.d.ts +0 -4
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "4.6.6
|
|
2
|
+
"version": "4.6.6",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -96,10 +96,9 @@
|
|
|
96
96
|
"tiny-invariant": "^1.2.0",
|
|
97
97
|
"tsdx": "^0.14.1",
|
|
98
98
|
"tslib": "^2.4.0",
|
|
99
|
-
"typescript": "^4.7.4"
|
|
100
|
-
"rollup-plugin-svg": "^2.0.0"
|
|
99
|
+
"typescript": "^4.7.4"
|
|
101
100
|
},
|
|
102
101
|
"dependencies": {
|
|
103
|
-
"flairup": "0.0.
|
|
102
|
+
"flairup": "0.0.16"
|
|
104
103
|
}
|
|
105
104
|
}
|
package/src/EmojiPickerReact.css
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { cx } from 'flairup';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
-
import { stylesheet } from '../../Stylesheet/stylesheet';
|
|
5
|
-
|
|
6
4
|
interface Props
|
|
7
5
|
extends React.DetailedHTMLProps<
|
|
8
6
|
React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
@@ -13,22 +11,8 @@ interface Props
|
|
|
13
11
|
|
|
14
12
|
export function Button(props: Props) {
|
|
15
13
|
return (
|
|
16
|
-
<button
|
|
17
|
-
type="button"
|
|
18
|
-
{...props}
|
|
19
|
-
className={cx(styles.button, props.className)}
|
|
20
|
-
>
|
|
14
|
+
<button type="button" {...props} className={cx('epr-btn', props.className)}>
|
|
21
15
|
{props.children}
|
|
22
16
|
</button>
|
|
23
17
|
);
|
|
24
18
|
}
|
|
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,3 +1,54 @@
|
|
|
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
|
+
}
|
|
1
52
|
aside.EmojiPickerReact.epr-main:has(input:not(:placeholder-shown))
|
|
2
53
|
.epr-category-nav
|
|
3
54
|
> button.epr-cat-btn:hover {
|
|
@@ -13,6 +64,10 @@ aside.EmojiPickerReact.epr-main:has(input:not(:placeholder-shown))
|
|
|
13
64
|
opacity: 1;
|
|
14
65
|
background-position-y: var(--epr-category-navigation-button-size);
|
|
15
66
|
}
|
|
67
|
+
.EmojiPickerReact .epr-category-nav > button.epr-cat-btn {
|
|
68
|
+
background-image: svg-load(./svg/CategoryNav.svg);
|
|
69
|
+
background-position: 0 0;
|
|
70
|
+
}
|
|
16
71
|
|
|
17
72
|
.EmojiPickerReact.epr-dark-theme .epr-category-nav > button.epr-cat-btn {
|
|
18
73
|
background-position-y: calc(var(--epr-category-navigation-button-size) * 2);
|
|
@@ -4,7 +4,6 @@ import { useState } from 'react';
|
|
|
4
4
|
import './CategoryNavigation.css';
|
|
5
5
|
|
|
6
6
|
import { ClassNames } from '../../DomUtils/classNames';
|
|
7
|
-
import { stylesheet } from '../../Stylesheet/stylesheet';
|
|
8
7
|
import {
|
|
9
8
|
categoryFromCategoryConfig,
|
|
10
9
|
categoryNameFromCategoryConfig
|
|
@@ -18,8 +17,6 @@ import { isCustomCategory } from '../../typeRefinements/typeRefinements';
|
|
|
18
17
|
import { Button } from '../atoms/Button';
|
|
19
18
|
import { useCategoryNavigationRef } from '../context/ElementRefContext';
|
|
20
19
|
|
|
21
|
-
import IcnNav from './svg/CategoryNav.svg';
|
|
22
|
-
|
|
23
20
|
export function CategoryNavigation() {
|
|
24
21
|
const [activeCategory, setActiveCategory] = useState<string | null>(null);
|
|
25
22
|
const scrollCategoryIntoView = useScrollCategoryIntoView();
|
|
@@ -32,7 +29,7 @@ export function CategoryNavigation() {
|
|
|
32
29
|
|
|
33
30
|
return (
|
|
34
31
|
<div
|
|
35
|
-
className=
|
|
32
|
+
className="epr-category-nav"
|
|
36
33
|
role="tablist"
|
|
37
34
|
aria-label="Category navigation"
|
|
38
35
|
id="epr-category-nav-id"
|
|
@@ -49,7 +46,7 @@ export function CategoryNavigation() {
|
|
|
49
46
|
return (
|
|
50
47
|
<Button
|
|
51
48
|
tabIndex={isSearchMode || isActiveCategory ? -1 : 0}
|
|
52
|
-
className={cx(
|
|
49
|
+
className={cx('epr-cat-btn', `epr-icn-${category}`, {
|
|
53
50
|
[ClassNames.active]: isActiveCategory
|
|
54
51
|
})}
|
|
55
52
|
key={category}
|
|
@@ -67,49 +64,3 @@ export function CategoryNavigation() {
|
|
|
67
64
|
</div>
|
|
68
65
|
);
|
|
69
66
|
}
|
|
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(data:image/svg+xml;utf8,${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
DELETED