reaxify 0.0.83 → 0.0.85

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.
Files changed (46) hide show
  1. package/dist/components/Badge/index.cjs.js +1 -1
  2. package/dist/components/Badge/index.es.js +12 -12
  3. package/dist/components/Drawer/index.cjs.js +1 -1
  4. package/dist/components/Drawer/index.d.ts +2 -4
  5. package/dist/components/Drawer/index.es.js +16 -21
  6. package/dist/components/Menu/index.cjs.js +1 -1
  7. package/dist/components/Menu/index.d.ts +3 -3
  8. package/dist/components/Menu/index.es.js +71 -77
  9. package/dist/components/Modal/index.cjs.js +1 -1
  10. package/dist/components/Modal/index.d.ts +2 -4
  11. package/dist/components/Modal/index.es.js +36 -41
  12. package/dist/helpers/scrollIntoView.cjs.js +1 -1
  13. package/dist/helpers/scrollIntoView.d.ts +1 -1
  14. package/dist/helpers/scrollIntoView.es.js +4 -3
  15. package/dist/hooks/index.cjs.js +1 -1
  16. package/dist/hooks/index.d.ts +0 -1
  17. package/dist/hooks/index.es.js +6 -8
  18. package/dist/node_modules/@tanstack/hotkeys/dist/constants.cjs.js +1 -0
  19. package/dist/node_modules/@tanstack/hotkeys/dist/constants.es.js +206 -0
  20. package/dist/node_modules/@tanstack/hotkeys/dist/format.cjs.js +1 -0
  21. package/dist/node_modules/@tanstack/hotkeys/dist/format.es.js +10 -0
  22. package/dist/node_modules/@tanstack/hotkeys/dist/hotkey-manager.cjs.js +1 -0
  23. package/dist/node_modules/@tanstack/hotkeys/dist/hotkey-manager.es.js +276 -0
  24. package/dist/node_modules/@tanstack/hotkeys/dist/manager.utils.cjs.js +1 -0
  25. package/dist/node_modules/@tanstack/hotkeys/dist/manager.utils.es.js +48 -0
  26. package/dist/node_modules/@tanstack/hotkeys/dist/match.cjs.js +1 -0
  27. package/dist/node_modules/@tanstack/hotkeys/dist/match.es.js +27 -0
  28. package/dist/node_modules/@tanstack/hotkeys/dist/parse.cjs.js +1 -0
  29. package/dist/node_modules/@tanstack/hotkeys/dist/parse.es.js +72 -0
  30. package/dist/node_modules/@tanstack/react-hotkeys/dist/HotkeysProvider.cjs.js +1 -0
  31. package/dist/node_modules/@tanstack/react-hotkeys/dist/HotkeysProvider.es.js +10 -0
  32. package/dist/node_modules/@tanstack/react-hotkeys/dist/useHotkey.cjs.js +1 -0
  33. package/dist/node_modules/@tanstack/react-hotkeys/dist/useHotkey.es.js +35 -0
  34. package/dist/node_modules/@tanstack/react-hotkeys/dist/utils.cjs.js +1 -0
  35. package/dist/node_modules/@tanstack/react-hotkeys/dist/utils.es.js +7 -0
  36. package/dist/node_modules/@tanstack/store/dist/esm/alien.cjs.js +1 -0
  37. package/dist/node_modules/@tanstack/store/dist/esm/alien.es.js +129 -0
  38. package/dist/node_modules/@tanstack/store/dist/esm/atom.cjs.js +1 -0
  39. package/dist/node_modules/@tanstack/store/dist/esm/atom.es.js +124 -0
  40. package/dist/node_modules/@tanstack/store/dist/esm/store.cjs.js +1 -0
  41. package/dist/node_modules/@tanstack/store/dist/esm/store.es.js +24 -0
  42. package/dist/types/index.d.ts +2 -2
  43. package/package.json +4 -3
  44. package/dist/hooks/useKeyDown.cjs.js +0 -1
  45. package/dist/hooks/useKeyDown.d.ts +0 -6
  46. package/dist/hooks/useKeyDown.es.js +0 -17
@@ -0,0 +1,124 @@
1
+ "use client";
2
+ import { ReactiveFlags as t, createReactiveSystem as _ } from "./alien.es.js";
3
+ function k(s, r, i) {
4
+ var o, n, d;
5
+ const c = typeof s == "object", e = c ? s : void 0;
6
+ return {
7
+ next: (o = c ? s.next : s) == null ? void 0 : o.bind(e),
8
+ error: (n = c ? s.error : r) == null ? void 0 : n.bind(e),
9
+ complete: (d = c ? s.complete : i) == null ? void 0 : d.bind(
10
+ e
11
+ )
12
+ };
13
+ }
14
+ const g = [];
15
+ let p = 0;
16
+ const { link: b, unlink: D, propagate: R, checkDirty: T, shallowPropagate: y } = _({
17
+ update(s) {
18
+ return s._update();
19
+ },
20
+ // eslint-disable-next-line no-shadow
21
+ notify(s) {
22
+ g[h++] = s, s.flags &= ~t.Watching;
23
+ },
24
+ unwatched(s) {
25
+ s.depsTail !== void 0 && (s.depsTail = void 0, s.flags = t.Mutable | t.Dirty, v(s));
26
+ }
27
+ });
28
+ let l = 0, h = 0, f;
29
+ function v(s) {
30
+ const r = s.depsTail;
31
+ let i = r !== void 0 ? r.nextDep : s.deps;
32
+ for (; i !== void 0; )
33
+ i = D(i, s);
34
+ }
35
+ function m() {
36
+ for (; l < h; ) {
37
+ const s = g[l];
38
+ g[l++] = void 0, s.notify();
39
+ }
40
+ l = 0, h = 0;
41
+ }
42
+ function P(s, r) {
43
+ const i = typeof s == "function", c = s, e = {
44
+ _snapshot: i ? void 0 : s,
45
+ subs: void 0,
46
+ subsTail: void 0,
47
+ deps: void 0,
48
+ depsTail: void 0,
49
+ flags: i ? t.None : t.Mutable,
50
+ get() {
51
+ return f !== void 0 && b(e, f, p), e._snapshot;
52
+ },
53
+ subscribe(o) {
54
+ const n = k(o), d = { current: !1 }, u = C(() => {
55
+ var a;
56
+ e.get(), d.current ? (a = n.next) == null || a.call(n, e._snapshot) : d.current = !0;
57
+ });
58
+ return {
59
+ unsubscribe: () => {
60
+ u.stop();
61
+ }
62
+ };
63
+ },
64
+ _update(o) {
65
+ const n = f, d = Object.is;
66
+ if (i)
67
+ f = e, ++p, e.depsTail = void 0;
68
+ else if (o === void 0)
69
+ return !1;
70
+ i && (e.flags = t.Mutable | t.RecursedCheck);
71
+ try {
72
+ const u = e._snapshot, a = typeof o == "function" ? o(u) : o === void 0 && i ? c(u) : o;
73
+ return u === void 0 || !d(u, a) ? (e._snapshot = a, !0) : !1;
74
+ } finally {
75
+ f = n, i && (e.flags &= ~t.RecursedCheck), v(e);
76
+ }
77
+ }
78
+ };
79
+ return i ? (e.flags = t.Mutable | t.Dirty, e.get = function() {
80
+ const o = e.flags;
81
+ if (o & t.Dirty || o & t.Pending && T(e.deps, e)) {
82
+ if (e._update()) {
83
+ const n = e.subs;
84
+ n !== void 0 && y(n);
85
+ }
86
+ } else o & t.Pending && (e.flags = o & ~t.Pending);
87
+ return f !== void 0 && b(e, f, p), e._snapshot;
88
+ }) : e.set = function(o) {
89
+ if (e._update(o)) {
90
+ const n = e.subs;
91
+ n !== void 0 && (R(n), y(n), m());
92
+ }
93
+ }, e;
94
+ }
95
+ function C(s) {
96
+ const r = () => {
97
+ const c = f;
98
+ f = i, ++p, i.depsTail = void 0, i.flags = t.Watching | t.RecursedCheck;
99
+ try {
100
+ return s();
101
+ } finally {
102
+ f = c, i.flags &= ~t.RecursedCheck, v(i);
103
+ }
104
+ }, i = {
105
+ deps: void 0,
106
+ depsTail: void 0,
107
+ subs: void 0,
108
+ subsTail: void 0,
109
+ flags: t.Watching | t.RecursedCheck,
110
+ notify() {
111
+ const c = this.flags;
112
+ c & t.Dirty || c & t.Pending && T(this.deps, this) ? r() : this.flags = t.Watching;
113
+ },
114
+ stop() {
115
+ this.flags = t.None, this.depsTail = void 0, v(this);
116
+ }
117
+ };
118
+ return r(), i;
119
+ }
120
+ export {
121
+ P as createAtom,
122
+ m as flush,
123
+ k as toObserver
124
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./atom.cjs.js");class r{constructor(t){this.atom=e.createAtom(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(e.toObserver(t))}}exports.Store=r;
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { createAtom as e, toObserver as s } from "./atom.es.js";
3
+ class a {
4
+ constructor(t) {
5
+ this.atom = e(
6
+ t
7
+ );
8
+ }
9
+ setState(t) {
10
+ this.atom.set(t);
11
+ }
12
+ get state() {
13
+ return this.atom.get();
14
+ }
15
+ get() {
16
+ return this.state;
17
+ }
18
+ subscribe(t) {
19
+ return this.atom.subscribe(s(t));
20
+ }
21
+ }
22
+ export {
23
+ a as Store
24
+ };
@@ -30,8 +30,8 @@ export type ChildrenProps = {
30
30
  children?: ReactNode;
31
31
  };
32
32
  export type ToggleProps = {
33
- open?: boolean;
34
- onClose?: VoidFunction;
33
+ open: boolean;
34
+ onClose: VoidFunction;
35
35
  };
36
36
  export type RecursivePartial<T> = {
37
37
  [P in keyof T]?: RecursivePartial<T[P]>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "reaxify",
3
3
  "private": false,
4
- "version": "0.0.83",
4
+ "version": "0.0.85",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "files": [
@@ -51,15 +51,16 @@
51
51
  "build-storybook": "storybook build"
52
52
  },
53
53
  "dependencies": {
54
+ "@tanstack/react-hotkeys": "^0.9.1",
54
55
  "iconsax-react": "^0.0.8",
55
56
  "react-animate-height": "^3.2.3",
56
57
  "react-transition-group": "^4.4.5",
57
58
  "tailwind-merge": "^3.3.1"
58
59
  },
59
60
  "peerDependencies": {
61
+ "axios": ">=1.0.0",
60
62
  "react": ">=19.0.0",
61
- "react-dom": ">=19.0.0",
62
- "axios": ">=1.0.0"
63
+ "react-dom": ">=19.0.0"
63
64
  },
64
65
  "devDependencies": {
65
66
  "@chromatic-com/storybook": "^1.9.0",
@@ -1 +0,0 @@
1
- "use client";"use strict";const s=require("react");function o(r,{skip:t=!1,targetKey:e=null}={}){const u=s.useRef(r);u.current=r,s.useEffect(()=>{if(t)return;const c=n=>e?Array.isArray(e)?e.includes(n):n===e:!0,i=n=>{c(n.key)&&u.current(n.key)};return window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}},[e,t])}module.exports=o;
@@ -1,6 +0,0 @@
1
- type Options = {
2
- skip?: boolean;
3
- targetKey?: null | string | string[];
4
- };
5
- export default function useKeyDown(callback: (key: string) => void, { skip, targetKey }?: Options): void;
6
- export {};
@@ -1,17 +0,0 @@
1
- "use client";
2
- import { useRef as f, useEffect as s } from "react";
3
- function d(r, { skip: u = !1, targetKey: e = null } = {}) {
4
- const t = f(r);
5
- t.current = r, s(() => {
6
- if (u) return;
7
- const o = (n) => e ? Array.isArray(e) ? e.includes(n) : n === e : !0, i = (n) => {
8
- o(n.key) && t.current(n.key);
9
- };
10
- return window.addEventListener("keydown", i), () => {
11
- window.removeEventListener("keydown", i);
12
- };
13
- }, [e, u]);
14
- }
15
- export {
16
- d as default
17
- };