@orioro/react-reactions 0.0.1

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.
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Thanks to animate.css
3
+ * https://github.com/animate-css/animate.css/blob/main/source/attention_seekers/bounce.css
4
+ */
5
+ @keyframes react-reactions--bounce {
6
+ from,
7
+ 20%,
8
+ 53%,
9
+ to {
10
+ animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
11
+ transform: translate3d(0, 0, 0);
12
+ }
13
+
14
+ 40%,
15
+ 43% {
16
+ animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
17
+ transform: translate3d(0, -30px, 0) scaleY(1.1);
18
+ }
19
+
20
+ 70% {
21
+ animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
22
+ transform: translate3d(0, -15px, 0) scaleY(1.05);
23
+ }
24
+
25
+ 80% {
26
+ transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
27
+ transform: translate3d(0, 0, 0) scaleY(0.95);
28
+ }
29
+
30
+ 90% {
31
+ transform: translate3d(0, -4px, 0) scaleY(1.02);
32
+ }
33
+ }
34
+
35
+ .react-reactions--bounce {
36
+ animation-name: react-reactions--bounce;
37
+ animation-duration: 1s;
38
+ }
39
+
40
+ /**
41
+ * Thanks to animate.css
42
+ * https://github.com/animate-css/animate.css/blob/main/source/attention_seekers/headShake.css
43
+ */
44
+ @keyframes react-reactions--shake {
45
+ 0% {
46
+ transform: translateX(0);
47
+ }
48
+
49
+ 6.5% {
50
+ transform: translateX(-6px) rotateY(-9deg);
51
+ }
52
+
53
+ 18.5% {
54
+ transform: translateX(5px) rotateY(7deg);
55
+ }
56
+
57
+ 31.5% {
58
+ transform: translateX(-3px) rotateY(-5deg);
59
+ }
60
+
61
+ 43.5% {
62
+ transform: translateX(2px) rotateY(3deg);
63
+ }
64
+
65
+ 50% {
66
+ transform: translateX(0);
67
+ }
68
+ }
69
+
70
+ .react-reactions--shake {
71
+ animation-timing-function: ease-in-out;
72
+ animation-name: react-reactions--shake;
73
+ animation-duration: 1s;
74
+ }
@@ -0,0 +1,23 @@
1
+ export type User = {
2
+ id: string | number;
3
+ name?: string;
4
+ description?: string;
5
+ pictureUrl?: string;
6
+ };
7
+ export type Emoji = {
8
+ id: string;
9
+ native: string;
10
+ unified: string;
11
+ [key: string]: any;
12
+ };
13
+ export type Reaction = {
14
+ id: string | number;
15
+ targetId: string | number | symbol;
16
+ emoji: Emoji;
17
+ user: User;
18
+ isPersisting?: boolean;
19
+ };
20
+ export type ReactionGroup = {
21
+ emojiId: string;
22
+ reactions: Reaction[];
23
+ };
@@ -0,0 +1,3 @@
1
+ import { Reaction } from '../types';
2
+ export declare function hashReactionSet(reactions: Reaction[]): string;
3
+ export declare function areReactionSetsEqual(setA: Reaction[], setB: Reaction[]): boolean;
@@ -0,0 +1,3 @@
1
+ type GroupedItems<T> = Record<string, T[]>;
2
+ export declare function arrayGroupBy<T>(array: T[], iteratee: (item: T) => string): GroupedItems<T>;
3
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './arrayGroupBy';
2
+ export * from './areReactionSetsEqual';
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@orioro/react-reactions",
3
+ "version": "0.0.1",
4
+ "packageManager": "yarn@4.0.2",
5
+ "type": "module",
6
+ "main": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": "./dist/index.mjs",
10
+ "./*": "./dist/*"
11
+ },
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "scripts": {
19
+ "build": "rm -rf dist && npm run emoji-data && rollup --config ./rollup.config.mjs",
20
+ "storybook": "storybook dev -p 6006",
21
+ "build-storybook": "storybook build",
22
+ "emoji-data": "node scripts/pt-emoji-data.mjs"
23
+ },
24
+ "devDependencies": {
25
+ "@orioro/dev": "workspace:^",
26
+ "mkdirp": "^3.0.1",
27
+ "rollup": "^4.13.0",
28
+ "rollup-plugin-import-css": "^3.5.0",
29
+ "storybook": "^8.0.0"
30
+ },
31
+ "dependencies": {
32
+ "@emoji-mart/data": "^1.2.1",
33
+ "@emoji-mart/react": "^1.1.1",
34
+ "@mdi/js": "^7.4.47",
35
+ "@mdi/react": "^1.6.1",
36
+ "@orioro/react-ui-core": "workspace:^",
37
+ "@radix-ui/react-popover": "^1.1.1",
38
+ "@radix-ui/themes": "^3.0.1",
39
+ "emoji-mart": "^5.6.0",
40
+ "framer-motion": "^11.2.12",
41
+ "react": "^18.2.0",
42
+ "react-use": "^17.5.0",
43
+ "styled-components": "^6.1.8"
44
+ }
45
+ }