asterui 0.12.25 → 0.12.27

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 (167) hide show
  1. package/dist/components/Cascader.d.ts +2 -0
  2. package/dist/components/Descriptions.d.ts +35 -3
  3. package/dist/components/Empty.d.ts +10 -1
  4. package/dist/components/Image.d.ts +13 -1
  5. package/dist/components/List.d.ts +74 -8
  6. package/dist/components/Table.d.ts +64 -10
  7. package/dist/components/Tag.d.ts +16 -4
  8. package/dist/components/Timeline.d.ts +62 -7
  9. package/dist/components/Tree.d.ts +2 -0
  10. package/dist/index.d.ts +6 -8
  11. package/dist/index.js +151 -152
  12. package/dist/index.js.map +1 -1
  13. package/dist/index10.js +1 -1
  14. package/dist/index100.js +5 -32
  15. package/dist/index100.js.map +1 -1
  16. package/dist/index101.js +13 -5
  17. package/dist/index101.js.map +1 -1
  18. package/dist/index102.js +43 -11
  19. package/dist/index102.js.map +1 -1
  20. package/dist/index103.js +11 -44
  21. package/dist/index103.js.map +1 -1
  22. package/dist/index104.js +12 -10
  23. package/dist/index104.js.map +1 -1
  24. package/dist/index105.js +7 -14
  25. package/dist/index105.js.map +1 -1
  26. package/dist/index106.js +12 -7
  27. package/dist/index106.js.map +1 -1
  28. package/dist/index107.js +29 -11
  29. package/dist/index107.js.map +1 -1
  30. package/dist/index108.js +16 -29
  31. package/dist/index108.js.map +1 -1
  32. package/dist/index109.js +31 -16
  33. package/dist/index109.js.map +1 -1
  34. package/dist/index110.js +517 -30
  35. package/dist/index110.js.map +1 -1
  36. package/dist/index111.js +45 -515
  37. package/dist/index111.js.map +1 -1
  38. package/dist/index15.js.map +1 -1
  39. package/dist/index22.js +1 -1
  40. package/dist/index23.js +127 -93
  41. package/dist/index23.js.map +1 -1
  42. package/dist/index39.js +162 -115
  43. package/dist/index39.js.map +1 -1
  44. package/dist/index40.js +398 -40
  45. package/dist/index40.js.map +1 -1
  46. package/dist/index41.js +132 -389
  47. package/dist/index41.js.map +1 -1
  48. package/dist/index42.js +252 -91
  49. package/dist/index42.js.map +1 -1
  50. package/dist/index43.js +143 -247
  51. package/dist/index43.js.map +1 -1
  52. package/dist/index44.js +15 -154
  53. package/dist/index44.js.map +1 -1
  54. package/dist/index45.js +17 -15
  55. package/dist/index45.js.map +1 -1
  56. package/dist/index46.js +136 -16
  57. package/dist/index46.js.map +1 -1
  58. package/dist/index47.js +118 -133
  59. package/dist/index47.js.map +1 -1
  60. package/dist/index48.js +35 -13
  61. package/dist/index48.js.map +1 -1
  62. package/dist/index49.js +34 -35
  63. package/dist/index49.js.map +1 -1
  64. package/dist/index50.js +81 -34
  65. package/dist/index50.js.map +1 -1
  66. package/dist/index51.js +166 -71
  67. package/dist/index51.js.map +1 -1
  68. package/dist/index52.js +144 -167
  69. package/dist/index52.js.map +1 -1
  70. package/dist/index53.js +11 -152
  71. package/dist/index53.js.map +1 -1
  72. package/dist/index54.js +55 -10
  73. package/dist/index54.js.map +1 -1
  74. package/dist/index55.js +12 -55
  75. package/dist/index55.js.map +1 -1
  76. package/dist/index56.js +7 -14
  77. package/dist/index56.js.map +1 -1
  78. package/dist/index57.js +333 -6
  79. package/dist/index57.js.map +1 -1
  80. package/dist/index58.js +47 -334
  81. package/dist/index58.js.map +1 -1
  82. package/dist/index59.js +122 -47
  83. package/dist/index59.js.map +1 -1
  84. package/dist/index60.js +108 -120
  85. package/dist/index60.js.map +1 -1
  86. package/dist/index61.js +167 -107
  87. package/dist/index61.js.map +1 -1
  88. package/dist/index62.js +29 -167
  89. package/dist/index62.js.map +1 -1
  90. package/dist/index63.js +120 -30
  91. package/dist/index63.js.map +1 -1
  92. package/dist/index64.js +80 -116
  93. package/dist/index64.js.map +1 -1
  94. package/dist/index65.js +19 -85
  95. package/dist/index65.js.map +1 -1
  96. package/dist/index66.js +73 -19
  97. package/dist/index66.js.map +1 -1
  98. package/dist/index67.js +54 -71
  99. package/dist/index67.js.map +1 -1
  100. package/dist/index68.js +44 -56
  101. package/dist/index68.js.map +1 -1
  102. package/dist/index69.js +49 -42
  103. package/dist/index69.js.map +1 -1
  104. package/dist/index70.js +121 -50
  105. package/dist/index70.js.map +1 -1
  106. package/dist/index71.js +102 -118
  107. package/dist/index71.js.map +1 -1
  108. package/dist/index72.js +72 -105
  109. package/dist/index72.js.map +1 -1
  110. package/dist/index73.js +67 -73
  111. package/dist/index73.js.map +1 -1
  112. package/dist/index74.js +19 -66
  113. package/dist/index74.js.map +1 -1
  114. package/dist/index75.js +55 -18
  115. package/dist/index75.js.map +1 -1
  116. package/dist/index76.js +251 -55
  117. package/dist/index76.js.map +1 -1
  118. package/dist/index77.js +22 -254
  119. package/dist/index77.js.map +1 -1
  120. package/dist/index78.js +31 -22
  121. package/dist/index78.js.map +1 -1
  122. package/dist/index79.js +93 -30
  123. package/dist/index79.js.map +1 -1
  124. package/dist/index80.js +626 -86
  125. package/dist/index80.js.map +1 -1
  126. package/dist/index81.js +73 -322
  127. package/dist/index81.js.map +1 -1
  128. package/dist/index82.js +39 -79
  129. package/dist/index82.js.map +1 -1
  130. package/dist/index83.js +23 -40
  131. package/dist/index83.js.map +1 -1
  132. package/dist/index84.js +207 -23
  133. package/dist/index84.js.map +1 -1
  134. package/dist/index85.js +149 -122
  135. package/dist/index85.js.map +1 -1
  136. package/dist/index86.js +152 -147
  137. package/dist/index86.js.map +1 -1
  138. package/dist/index87.js +143 -156
  139. package/dist/index87.js.map +1 -1
  140. package/dist/index88.js +35 -65
  141. package/dist/index88.js.map +1 -1
  142. package/dist/index89.js +234 -35
  143. package/dist/index89.js.map +1 -1
  144. package/dist/index90.js +31 -231
  145. package/dist/index90.js.map +1 -1
  146. package/dist/index91.js +210 -34
  147. package/dist/index91.js.map +1 -1
  148. package/dist/index92.js +418 -187
  149. package/dist/index92.js.map +1 -1
  150. package/dist/index93.js +686 -376
  151. package/dist/index93.js.map +1 -1
  152. package/dist/index94.js +165 -738
  153. package/dist/index94.js.map +1 -1
  154. package/dist/index95.js +253 -173
  155. package/dist/index95.js.map +1 -1
  156. package/dist/index96.js +64 -256
  157. package/dist/index96.js.map +1 -1
  158. package/dist/index97.js +121 -61
  159. package/dist/index97.js.map +1 -1
  160. package/dist/index98.js +14 -126
  161. package/dist/index98.js.map +1 -1
  162. package/dist/index99.js +31 -12
  163. package/dist/index99.js.map +1 -1
  164. package/package.json +1 -1
  165. package/dist/components/Indicator.d.ts +0 -7
  166. package/dist/index112.js +0 -53
  167. package/dist/index112.js.map +0 -1
package/dist/index104.js CHANGED
@@ -1,16 +1,18 @@
1
- import { useState as r, useEffect as c } from "react";
2
- function i(e, t = 300) {
3
- const [o, u] = r(e);
1
+ import { useRef as s, useEffect as c } from "react";
2
+ function m(t, n = !0) {
3
+ const r = s(null);
4
4
  return c(() => {
5
- const n = setTimeout(() => {
6
- u(e);
7
- }, t);
8
- return () => {
9
- clearTimeout(n);
5
+ if (!n) return;
6
+ const e = (o) => {
7
+ const u = r.current;
8
+ !u || u.contains(o.target) || t(o);
10
9
  };
11
- }, [e, t]), o;
10
+ return document.addEventListener("mousedown", e), document.addEventListener("touchstart", e), () => {
11
+ document.removeEventListener("mousedown", e), document.removeEventListener("touchstart", e);
12
+ };
13
+ }, [t, n]), r;
12
14
  }
13
15
  export {
14
- i as useDebounce
16
+ m as useClickOutside
15
17
  };
16
18
  //# sourceMappingURL=index104.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index104.js","sources":["../src/hooks/useDebounce.ts"],"sourcesContent":["import { useState, useEffect } from 'react'\n\n/**\n * Hook that delays updating a value until after a specified delay.\n * Useful for search inputs to avoid excessive API calls.\n *\n * @param value - Value to debounce\n * @param delay - Delay in milliseconds (default: 300)\n * @returns Debounced value\n *\n * @example\n * const [search, setSearch] = useState('')\n * const debouncedSearch = useDebounce(search, 500)\n *\n * useEffect(() => {\n * // This runs 500ms after user stops typing\n * fetchResults(debouncedSearch)\n * }, [debouncedSearch])\n */\nexport function useDebounce<T>(value: T, delay = 300): T {\n const [debouncedValue, setDebouncedValue] = useState<T>(value)\n\n useEffect(() => {\n const timer = setTimeout(() => {\n setDebouncedValue(value)\n }, delay)\n\n return () => {\n clearTimeout(timer)\n }\n }, [value, delay])\n\n return debouncedValue\n}\n"],"names":["useDebounce","value","delay","debouncedValue","setDebouncedValue","useState","useEffect","timer"],"mappings":";AAmBO,SAASA,EAAeC,GAAUC,IAAQ,KAAQ;AACvD,QAAM,CAACC,GAAgBC,CAAiB,IAAIC,EAAYJ,CAAK;AAE7D,SAAAK,EAAU,MAAM;AACd,UAAMC,IAAQ,WAAW,MAAM;AAC7B,MAAAH,EAAkBH,CAAK;AAAA,IACzB,GAAGC,CAAK;AAER,WAAO,MAAM;AACX,mBAAaK,CAAK;AAAA,IACpB;AAAA,EACF,GAAG,CAACN,GAAOC,CAAK,CAAC,GAEVC;AACT;"}
1
+ {"version":3,"file":"index104.js","sources":["../src/hooks/useClickOutside.ts"],"sourcesContent":["import { useEffect, useRef, type RefObject } from 'react'\n\n/**\n * Hook that detects clicks outside of a referenced element.\n * Useful for closing dropdowns, modals, or menus.\n *\n * @param handler - Callback when click outside is detected\n * @param enabled - Whether the listener is active (default: true)\n * @returns Ref to attach to the element\n *\n * @example\n * const ref = useClickOutside(() => setIsOpen(false))\n *\n * <div ref={ref}>\n * <Dropdown>...</Dropdown>\n * </div>\n */\nexport function useClickOutside<T extends HTMLElement = HTMLElement>(\n handler: (event: MouseEvent | TouchEvent) => void,\n enabled = true\n): RefObject<T | null> {\n const ref = useRef<T>(null)\n\n useEffect(() => {\n if (!enabled) return\n\n const listener = (event: MouseEvent | TouchEvent) => {\n const el = ref.current\n if (!el || el.contains(event.target as Node)) {\n return\n }\n handler(event)\n }\n\n document.addEventListener('mousedown', listener)\n document.addEventListener('touchstart', listener)\n\n return () => {\n document.removeEventListener('mousedown', listener)\n document.removeEventListener('touchstart', listener)\n }\n }, [handler, enabled])\n\n return ref\n}\n"],"names":["useClickOutside","handler","enabled","ref","useRef","useEffect","listener","event","el"],"mappings":";AAiBO,SAASA,EACdC,GACAC,IAAU,IACW;AACrB,QAAMC,IAAMC,EAAU,IAAI;AAE1B,SAAAC,EAAU,MAAM;AACd,QAAI,CAACH,EAAS;AAEd,UAAMI,IAAW,CAACC,MAAmC;AACnD,YAAMC,IAAKL,EAAI;AACf,MAAI,CAACK,KAAMA,EAAG,SAASD,EAAM,MAAc,KAG3CN,EAAQM,CAAK;AAAA,IACf;AAEA,oBAAS,iBAAiB,aAAaD,CAAQ,GAC/C,SAAS,iBAAiB,cAAcA,CAAQ,GAEzC,MAAM;AACX,eAAS,oBAAoB,aAAaA,CAAQ,GAClD,SAAS,oBAAoB,cAAcA,CAAQ;AAAA,IACrD;AAAA,EACF,GAAG,CAACL,GAASC,CAAO,CAAC,GAEdC;AACT;"}
package/dist/index105.js CHANGED
@@ -1,18 +1,11 @@
1
- import { useRef as s, useEffect as c } from "react";
2
- function m(t, n = !0) {
3
- const r = s(null);
4
- return c(() => {
5
- if (!n) return;
6
- const e = (o) => {
7
- const u = r.current;
8
- !u || u.contains(o.target) || t(o);
9
- };
10
- return document.addEventListener("mousedown", e), document.addEventListener("touchstart", e), () => {
11
- document.removeEventListener("mousedown", e), document.removeEventListener("touchstart", e);
12
- };
13
- }, [t, n]), r;
1
+ import { useRef as t, useEffect as o } from "react";
2
+ function f(r) {
3
+ const e = t(void 0);
4
+ return o(() => {
5
+ e.current = r;
6
+ }, [r]), e.current;
14
7
  }
15
8
  export {
16
- m as useClickOutside
9
+ f as usePrevious
17
10
  };
18
11
  //# sourceMappingURL=index105.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index105.js","sources":["../src/hooks/useClickOutside.ts"],"sourcesContent":["import { useEffect, useRef, type RefObject } from 'react'\n\n/**\n * Hook that detects clicks outside of a referenced element.\n * Useful for closing dropdowns, modals, or menus.\n *\n * @param handler - Callback when click outside is detected\n * @param enabled - Whether the listener is active (default: true)\n * @returns Ref to attach to the element\n *\n * @example\n * const ref = useClickOutside(() => setIsOpen(false))\n *\n * <div ref={ref}>\n * <Dropdown>...</Dropdown>\n * </div>\n */\nexport function useClickOutside<T extends HTMLElement = HTMLElement>(\n handler: (event: MouseEvent | TouchEvent) => void,\n enabled = true\n): RefObject<T | null> {\n const ref = useRef<T>(null)\n\n useEffect(() => {\n if (!enabled) return\n\n const listener = (event: MouseEvent | TouchEvent) => {\n const el = ref.current\n if (!el || el.contains(event.target as Node)) {\n return\n }\n handler(event)\n }\n\n document.addEventListener('mousedown', listener)\n document.addEventListener('touchstart', listener)\n\n return () => {\n document.removeEventListener('mousedown', listener)\n document.removeEventListener('touchstart', listener)\n }\n }, [handler, enabled])\n\n return ref\n}\n"],"names":["useClickOutside","handler","enabled","ref","useRef","useEffect","listener","event","el"],"mappings":";AAiBO,SAASA,EACdC,GACAC,IAAU,IACW;AACrB,QAAMC,IAAMC,EAAU,IAAI;AAE1B,SAAAC,EAAU,MAAM;AACd,QAAI,CAACH,EAAS;AAEd,UAAMI,IAAW,CAACC,MAAmC;AACnD,YAAMC,IAAKL,EAAI;AACf,MAAI,CAACK,KAAMA,EAAG,SAASD,EAAM,MAAc,KAG3CN,EAAQM,CAAK;AAAA,IACf;AAEA,oBAAS,iBAAiB,aAAaD,CAAQ,GAC/C,SAAS,iBAAiB,cAAcA,CAAQ,GAEzC,MAAM;AACX,eAAS,oBAAoB,aAAaA,CAAQ,GAClD,SAAS,oBAAoB,cAAcA,CAAQ;AAAA,IACrD;AAAA,EACF,GAAG,CAACL,GAASC,CAAO,CAAC,GAEdC;AACT;"}
1
+ {"version":3,"file":"index105.js","sources":["../src/hooks/usePrevious.ts"],"sourcesContent":["import { useRef, useEffect } from 'react'\n\n/**\n * Hook that returns the previous value of a variable.\n * Useful for comparing current and previous values in effects.\n *\n * @param value - Current value\n * @returns Previous value (undefined on first render)\n *\n * @example\n * const [count, setCount] = useState(0)\n * const prevCount = usePrevious(count)\n *\n * // prevCount is the value from previous render\n * console.log(`Changed from ${prevCount} to ${count}`)\n */\nexport function usePrevious<T>(value: T): T | undefined {\n const ref = useRef<T | undefined>(undefined)\n\n useEffect(() => {\n ref.current = value\n }, [value])\n\n return ref.current\n}\n"],"names":["usePrevious","value","ref","useRef","useEffect"],"mappings":";AAgBO,SAASA,EAAeC,GAAyB;AACtD,QAAMC,IAAMC,EAAsB,MAAS;AAE3C,SAAAC,EAAU,MAAM;AACd,IAAAF,EAAI,UAAUD;AAAA,EAChB,GAAG,CAACA,CAAK,CAAC,GAEHC,EAAI;AACb;"}
package/dist/index106.js CHANGED
@@ -1,11 +1,16 @@
1
- import { useRef as t, useEffect as o } from "react";
2
- function f(r) {
3
- const e = t(void 0);
4
- return o(() => {
5
- e.current = r;
6
- }, [r]), e.current;
1
+ import { useState as u, useRef as v, useEffect as a } from "react";
2
+ function f() {
3
+ const [o, t] = u(!1), n = v(null);
4
+ return a(() => {
5
+ const e = n.current;
6
+ if (!e) return;
7
+ const r = () => t(!0), s = () => t(!1);
8
+ return e.addEventListener("mouseenter", r), e.addEventListener("mouseleave", s), () => {
9
+ e.removeEventListener("mouseenter", r), e.removeEventListener("mouseleave", s);
10
+ };
11
+ }, []), { ref: n, isHovered: o };
7
12
  }
8
13
  export {
9
- f as usePrevious
14
+ f as useHover
10
15
  };
11
16
  //# sourceMappingURL=index106.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index106.js","sources":["../src/hooks/usePrevious.ts"],"sourcesContent":["import { useRef, useEffect } from 'react'\n\n/**\n * Hook that returns the previous value of a variable.\n * Useful for comparing current and previous values in effects.\n *\n * @param value - Current value\n * @returns Previous value (undefined on first render)\n *\n * @example\n * const [count, setCount] = useState(0)\n * const prevCount = usePrevious(count)\n *\n * // prevCount is the value from previous render\n * console.log(`Changed from ${prevCount} to ${count}`)\n */\nexport function usePrevious<T>(value: T): T | undefined {\n const ref = useRef<T | undefined>(undefined)\n\n useEffect(() => {\n ref.current = value\n }, [value])\n\n return ref.current\n}\n"],"names":["usePrevious","value","ref","useRef","useEffect"],"mappings":";AAgBO,SAASA,EAAeC,GAAyB;AACtD,QAAMC,IAAMC,EAAsB,MAAS;AAE3C,SAAAC,EAAU,MAAM;AACd,IAAAF,EAAI,UAAUD;AAAA,EAChB,GAAG,CAACA,CAAK,CAAC,GAEHC,EAAI;AACb;"}
1
+ {"version":3,"file":"index106.js","sources":["../src/hooks/useHover.ts"],"sourcesContent":["import { useState, useRef, useEffect, type RefObject } from 'react'\n\nexport interface UseHoverReturn<T extends HTMLElement> {\n ref: RefObject<T | null>\n isHovered: boolean\n}\n\n/**\n * Hook that tracks hover state of an element.\n *\n * @returns Object with ref and isHovered state\n *\n * @example\n * const { ref, isHovered } = useHover<HTMLDivElement>()\n *\n * <div ref={ref} className={isHovered ? 'bg-blue-500' : 'bg-gray-500'}>\n * Hover me!\n * </div>\n */\nexport function useHover<T extends HTMLElement = HTMLElement>(): UseHoverReturn<T> {\n const [isHovered, setIsHovered] = useState(false)\n const ref = useRef<T>(null)\n\n useEffect(() => {\n const node = ref.current\n if (!node) return\n\n const handleMouseEnter = () => setIsHovered(true)\n const handleMouseLeave = () => setIsHovered(false)\n\n node.addEventListener('mouseenter', handleMouseEnter)\n node.addEventListener('mouseleave', handleMouseLeave)\n\n return () => {\n node.removeEventListener('mouseenter', handleMouseEnter)\n node.removeEventListener('mouseleave', handleMouseLeave)\n }\n }, [])\n\n return { ref, isHovered }\n}\n"],"names":["useHover","isHovered","setIsHovered","useState","ref","useRef","useEffect","node","handleMouseEnter","handleMouseLeave"],"mappings":";AAmBO,SAASA,IAAmE;AACjF,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1CC,IAAMC,EAAU,IAAI;AAE1B,SAAAC,EAAU,MAAM;AACd,UAAMC,IAAOH,EAAI;AACjB,QAAI,CAACG,EAAM;AAEX,UAAMC,IAAmB,MAAMN,EAAa,EAAI,GAC1CO,IAAmB,MAAMP,EAAa,EAAK;AAEjD,WAAAK,EAAK,iBAAiB,cAAcC,CAAgB,GACpDD,EAAK,iBAAiB,cAAcE,CAAgB,GAE7C,MAAM;AACX,MAAAF,EAAK,oBAAoB,cAAcC,CAAgB,GACvDD,EAAK,oBAAoB,cAAcE,CAAgB;AAAA,IACzD;AAAA,EACF,GAAG,CAAA,CAAE,GAEE,EAAE,KAAAL,GAAK,WAAAH,EAAA;AAChB;"}
package/dist/index107.js CHANGED
@@ -1,16 +1,34 @@
1
- import { useState as u, useRef as v, useEffect as a } from "react";
2
- function f() {
3
- const [o, t] = u(!1), n = v(null);
4
- return a(() => {
5
- const e = n.current;
6
- if (!e) return;
7
- const r = () => t(!0), s = () => t(!1);
8
- return e.addEventListener("mouseenter", r), e.addEventListener("mouseleave", s), () => {
9
- e.removeEventListener("mouseenter", r), e.removeEventListener("mouseleave", s);
1
+ import { useState as v, useCallback as i, useEffect as l } from "react";
2
+ function c(n, f = {}) {
3
+ const { target: u, event: o = "keydown", preventDefault: r = !1 } = f, [a, d] = v(!1), t = i(
4
+ (e) => {
5
+ e.key === n && (r && e.preventDefault(), d(!0));
6
+ },
7
+ [n, r]
8
+ ), s = i(
9
+ (e) => {
10
+ e.key === n && d(!1);
11
+ },
12
+ [n]
13
+ );
14
+ return l(() => {
15
+ const e = u ?? window;
16
+ return o === "keydown" ? (e.addEventListener("keydown", t), e.addEventListener("keyup", s)) : e.addEventListener("keyup", t), () => {
17
+ e.removeEventListener("keydown", t), e.removeEventListener("keyup", s);
10
18
  };
11
- }, []), { ref: n, isHovered: o };
19
+ }, [u, o, t, s]), a;
20
+ }
21
+ function y(n, f, u = {}) {
22
+ const { target: o, event: r = "keydown", preventDefault: a = !1 } = u;
23
+ l(() => {
24
+ const d = o ?? window, t = (s) => {
25
+ s.key === n && (a && s.preventDefault(), f(s));
26
+ };
27
+ return d.addEventListener(r, t), () => d.removeEventListener(r, t);
28
+ }, [o, n, f, r, a]);
12
29
  }
13
30
  export {
14
- f as useHover
31
+ c as useKeyPress,
32
+ y as useKeyPressCallback
15
33
  };
16
34
  //# sourceMappingURL=index107.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index107.js","sources":["../src/hooks/useHover.ts"],"sourcesContent":["import { useState, useRef, useEffect, type RefObject } from 'react'\n\nexport interface UseHoverReturn<T extends HTMLElement> {\n ref: RefObject<T | null>\n isHovered: boolean\n}\n\n/**\n * Hook that tracks hover state of an element.\n *\n * @returns Object with ref and isHovered state\n *\n * @example\n * const { ref, isHovered } = useHover<HTMLDivElement>()\n *\n * <div ref={ref} className={isHovered ? 'bg-blue-500' : 'bg-gray-500'}>\n * Hover me!\n * </div>\n */\nexport function useHover<T extends HTMLElement = HTMLElement>(): UseHoverReturn<T> {\n const [isHovered, setIsHovered] = useState(false)\n const ref = useRef<T>(null)\n\n useEffect(() => {\n const node = ref.current\n if (!node) return\n\n const handleMouseEnter = () => setIsHovered(true)\n const handleMouseLeave = () => setIsHovered(false)\n\n node.addEventListener('mouseenter', handleMouseEnter)\n node.addEventListener('mouseleave', handleMouseLeave)\n\n return () => {\n node.removeEventListener('mouseenter', handleMouseEnter)\n node.removeEventListener('mouseleave', handleMouseLeave)\n }\n }, [])\n\n return { ref, isHovered }\n}\n"],"names":["useHover","isHovered","setIsHovered","useState","ref","useRef","useEffect","node","handleMouseEnter","handleMouseLeave"],"mappings":";AAmBO,SAASA,IAAmE;AACjF,QAAM,CAACC,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1CC,IAAMC,EAAU,IAAI;AAE1B,SAAAC,EAAU,MAAM;AACd,UAAMC,IAAOH,EAAI;AACjB,QAAI,CAACG,EAAM;AAEX,UAAMC,IAAmB,MAAMN,EAAa,EAAI,GAC1CO,IAAmB,MAAMP,EAAa,EAAK;AAEjD,WAAAK,EAAK,iBAAiB,cAAcC,CAAgB,GACpDD,EAAK,iBAAiB,cAAcE,CAAgB,GAE7C,MAAM;AACX,MAAAF,EAAK,oBAAoB,cAAcC,CAAgB,GACvDD,EAAK,oBAAoB,cAAcE,CAAgB;AAAA,IACzD;AAAA,EACF,GAAG,CAAA,CAAE,GAEE,EAAE,KAAAL,GAAK,WAAAH,EAAA;AAChB;"}
1
+ {"version":3,"file":"index107.js","sources":["../src/hooks/useKeyPress.ts"],"sourcesContent":["import { useState, useEffect, useCallback } from 'react'\n\nexport interface UseKeyPressOptions {\n /** Target element (default: window) */\n target?: HTMLElement | Window | null\n /** Event type: 'keydown' | 'keyup' (default: 'keydown') */\n event?: 'keydown' | 'keyup'\n /** Prevent default browser behavior */\n preventDefault?: boolean\n}\n\n/**\n * Hook that detects when a specific key is pressed.\n *\n * @param targetKey - Key to detect (e.g., 'Enter', 'Escape', 'a')\n * @param options - Configuration options\n * @returns Whether the key is currently pressed\n *\n * @example\n * const enterPressed = useKeyPress('Enter')\n * const escapePressed = useKeyPress('Escape')\n *\n * useEffect(() => {\n * if (escapePressed) closeModal()\n * }, [escapePressed])\n *\n * @example\n * // With callback for immediate action\n * useKeyPress('Escape', { preventDefault: true })\n */\nexport function useKeyPress(\n targetKey: string,\n options: UseKeyPressOptions = {}\n): boolean {\n const { target, event = 'keydown', preventDefault = false } = options\n const [keyPressed, setKeyPressed] = useState(false)\n\n const downHandler = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === targetKey) {\n if (preventDefault) e.preventDefault()\n setKeyPressed(true)\n }\n },\n [targetKey, preventDefault]\n )\n\n const upHandler = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === targetKey) {\n setKeyPressed(false)\n }\n },\n [targetKey]\n )\n\n useEffect(() => {\n const targetElement = target ?? window\n\n if (event === 'keydown') {\n targetElement.addEventListener('keydown', downHandler as EventListener)\n targetElement.addEventListener('keyup', upHandler as EventListener)\n } else {\n targetElement.addEventListener('keyup', downHandler as EventListener)\n }\n\n return () => {\n targetElement.removeEventListener('keydown', downHandler as EventListener)\n targetElement.removeEventListener('keyup', upHandler as EventListener)\n }\n }, [target, event, downHandler, upHandler])\n\n return keyPressed\n}\n\n/**\n * Hook that calls a callback when a specific key is pressed.\n *\n * @param targetKey - Key to detect\n * @param callback - Function to call when key is pressed\n * @param options - Configuration options\n *\n * @example\n * useKeyPressCallback('Escape', () => closeModal())\n * useKeyPressCallback('Enter', () => submitForm(), { preventDefault: true })\n */\nexport function useKeyPressCallback(\n targetKey: string,\n callback: (event: KeyboardEvent) => void,\n options: UseKeyPressOptions = {}\n): void {\n const { target, event = 'keydown', preventDefault = false } = options\n\n useEffect(() => {\n const targetElement = target ?? window\n\n const handler = (e: KeyboardEvent) => {\n if (e.key === targetKey) {\n if (preventDefault) e.preventDefault()\n callback(e)\n }\n }\n\n targetElement.addEventListener(event, handler as EventListener)\n return () => targetElement.removeEventListener(event, handler as EventListener)\n }, [target, targetKey, callback, event, preventDefault])\n}\n"],"names":["useKeyPress","targetKey","options","target","event","preventDefault","keyPressed","setKeyPressed","useState","downHandler","useCallback","upHandler","useEffect","targetElement","useKeyPressCallback","callback","handler","e"],"mappings":";AA8BO,SAASA,EACdC,GACAC,IAA8B,IACrB;AACT,QAAM,EAAE,QAAAC,GAAQ,OAAAC,IAAQ,WAAW,gBAAAC,IAAiB,OAAUH,GACxD,CAACI,GAAYC,CAAa,IAAIC,EAAS,EAAK,GAE5CC,IAAcC;AAAA,IAClB,CAAC,MAAqB;AACpB,MAAI,EAAE,QAAQT,MACRI,OAAkB,eAAA,GACtBE,EAAc,EAAI;AAAA,IAEtB;AAAA,IACA,CAACN,GAAWI,CAAc;AAAA,EAAA,GAGtBM,IAAYD;AAAA,IAChB,CAAC,MAAqB;AACpB,MAAI,EAAE,QAAQT,KACZM,EAAc,EAAK;AAAA,IAEvB;AAAA,IACA,CAACN,CAAS;AAAA,EAAA;AAGZ,SAAAW,EAAU,MAAM;AACd,UAAMC,IAAgBV,KAAU;AAEhC,WAAIC,MAAU,aACZS,EAAc,iBAAiB,WAAWJ,CAA4B,GACtEI,EAAc,iBAAiB,SAASF,CAA0B,KAElEE,EAAc,iBAAiB,SAASJ,CAA4B,GAG/D,MAAM;AACX,MAAAI,EAAc,oBAAoB,WAAWJ,CAA4B,GACzEI,EAAc,oBAAoB,SAASF,CAA0B;AAAA,IACvE;AAAA,EACF,GAAG,CAACR,GAAQC,GAAOK,GAAaE,CAAS,CAAC,GAEnCL;AACT;AAaO,SAASQ,EACdb,GACAc,GACAb,IAA8B,CAAA,GACxB;AACN,QAAM,EAAE,QAAAC,GAAQ,OAAAC,IAAQ,WAAW,gBAAAC,IAAiB,OAAUH;AAE9D,EAAAU,EAAU,MAAM;AACd,UAAMC,IAAgBV,KAAU,QAE1Ba,IAAU,CAACC,MAAqB;AACpC,MAAIA,EAAE,QAAQhB,MACRI,OAAkB,eAAA,GACtBU,EAASE,CAAC;AAAA,IAEd;AAEA,WAAAJ,EAAc,iBAAiBT,GAAOY,CAAwB,GACvD,MAAMH,EAAc,oBAAoBT,GAAOY,CAAwB;AAAA,EAChF,GAAG,CAACb,GAAQF,GAAWc,GAAUX,GAAOC,CAAc,CAAC;AACzD;"}
package/dist/index108.js CHANGED
@@ -1,34 +1,21 @@
1
- import { useState as v, useCallback as i, useEffect as l } from "react";
2
- function c(n, f = {}) {
3
- const { target: u, event: o = "keydown", preventDefault: r = !1 } = f, [a, d] = v(!1), t = i(
4
- (e) => {
5
- e.key === n && (r && e.preventDefault(), d(!0));
6
- },
7
- [n, r]
8
- ), s = i(
9
- (e) => {
10
- e.key === n && d(!1);
11
- },
12
- [n]
13
- );
14
- return l(() => {
15
- const e = u ?? window;
16
- return o === "keydown" ? (e.addEventListener("keydown", t), e.addEventListener("keyup", s)) : e.addEventListener("keyup", t), () => {
17
- e.removeEventListener("keydown", t), e.removeEventListener("keyup", s);
1
+ import { useState as t, useEffect as d } from "react";
2
+ function r() {
3
+ const [i, n] = t(() => typeof window > "u" ? { width: 0, height: 0 } : {
4
+ width: window.innerWidth,
5
+ height: window.innerHeight
6
+ });
7
+ return d(() => {
8
+ if (typeof window > "u") return;
9
+ const e = () => {
10
+ n({
11
+ width: window.innerWidth,
12
+ height: window.innerHeight
13
+ });
18
14
  };
19
- }, [u, o, t, s]), a;
20
- }
21
- function y(n, f, u = {}) {
22
- const { target: o, event: r = "keydown", preventDefault: a = !1 } = u;
23
- l(() => {
24
- const d = o ?? window, t = (s) => {
25
- s.key === n && (a && s.preventDefault(), f(s));
26
- };
27
- return d.addEventListener(r, t), () => d.removeEventListener(r, t);
28
- }, [o, n, f, r, a]);
15
+ return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
16
+ }, []), i;
29
17
  }
30
18
  export {
31
- c as useKeyPress,
32
- y as useKeyPressCallback
19
+ r as useWindowSize
33
20
  };
34
21
  //# sourceMappingURL=index108.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index108.js","sources":["../src/hooks/useKeyPress.ts"],"sourcesContent":["import { useState, useEffect, useCallback } from 'react'\n\nexport interface UseKeyPressOptions {\n /** Target element (default: window) */\n target?: HTMLElement | Window | null\n /** Event type: 'keydown' | 'keyup' (default: 'keydown') */\n event?: 'keydown' | 'keyup'\n /** Prevent default browser behavior */\n preventDefault?: boolean\n}\n\n/**\n * Hook that detects when a specific key is pressed.\n *\n * @param targetKey - Key to detect (e.g., 'Enter', 'Escape', 'a')\n * @param options - Configuration options\n * @returns Whether the key is currently pressed\n *\n * @example\n * const enterPressed = useKeyPress('Enter')\n * const escapePressed = useKeyPress('Escape')\n *\n * useEffect(() => {\n * if (escapePressed) closeModal()\n * }, [escapePressed])\n *\n * @example\n * // With callback for immediate action\n * useKeyPress('Escape', { preventDefault: true })\n */\nexport function useKeyPress(\n targetKey: string,\n options: UseKeyPressOptions = {}\n): boolean {\n const { target, event = 'keydown', preventDefault = false } = options\n const [keyPressed, setKeyPressed] = useState(false)\n\n const downHandler = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === targetKey) {\n if (preventDefault) e.preventDefault()\n setKeyPressed(true)\n }\n },\n [targetKey, preventDefault]\n )\n\n const upHandler = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === targetKey) {\n setKeyPressed(false)\n }\n },\n [targetKey]\n )\n\n useEffect(() => {\n const targetElement = target ?? window\n\n if (event === 'keydown') {\n targetElement.addEventListener('keydown', downHandler as EventListener)\n targetElement.addEventListener('keyup', upHandler as EventListener)\n } else {\n targetElement.addEventListener('keyup', downHandler as EventListener)\n }\n\n return () => {\n targetElement.removeEventListener('keydown', downHandler as EventListener)\n targetElement.removeEventListener('keyup', upHandler as EventListener)\n }\n }, [target, event, downHandler, upHandler])\n\n return keyPressed\n}\n\n/**\n * Hook that calls a callback when a specific key is pressed.\n *\n * @param targetKey - Key to detect\n * @param callback - Function to call when key is pressed\n * @param options - Configuration options\n *\n * @example\n * useKeyPressCallback('Escape', () => closeModal())\n * useKeyPressCallback('Enter', () => submitForm(), { preventDefault: true })\n */\nexport function useKeyPressCallback(\n targetKey: string,\n callback: (event: KeyboardEvent) => void,\n options: UseKeyPressOptions = {}\n): void {\n const { target, event = 'keydown', preventDefault = false } = options\n\n useEffect(() => {\n const targetElement = target ?? window\n\n const handler = (e: KeyboardEvent) => {\n if (e.key === targetKey) {\n if (preventDefault) e.preventDefault()\n callback(e)\n }\n }\n\n targetElement.addEventListener(event, handler as EventListener)\n return () => targetElement.removeEventListener(event, handler as EventListener)\n }, [target, targetKey, callback, event, preventDefault])\n}\n"],"names":["useKeyPress","targetKey","options","target","event","preventDefault","keyPressed","setKeyPressed","useState","downHandler","useCallback","upHandler","useEffect","targetElement","useKeyPressCallback","callback","handler","e"],"mappings":";AA8BO,SAASA,EACdC,GACAC,IAA8B,IACrB;AACT,QAAM,EAAE,QAAAC,GAAQ,OAAAC,IAAQ,WAAW,gBAAAC,IAAiB,OAAUH,GACxD,CAACI,GAAYC,CAAa,IAAIC,EAAS,EAAK,GAE5CC,IAAcC;AAAA,IAClB,CAAC,MAAqB;AACpB,MAAI,EAAE,QAAQT,MACRI,OAAkB,eAAA,GACtBE,EAAc,EAAI;AAAA,IAEtB;AAAA,IACA,CAACN,GAAWI,CAAc;AAAA,EAAA,GAGtBM,IAAYD;AAAA,IAChB,CAAC,MAAqB;AACpB,MAAI,EAAE,QAAQT,KACZM,EAAc,EAAK;AAAA,IAEvB;AAAA,IACA,CAACN,CAAS;AAAA,EAAA;AAGZ,SAAAW,EAAU,MAAM;AACd,UAAMC,IAAgBV,KAAU;AAEhC,WAAIC,MAAU,aACZS,EAAc,iBAAiB,WAAWJ,CAA4B,GACtEI,EAAc,iBAAiB,SAASF,CAA0B,KAElEE,EAAc,iBAAiB,SAASJ,CAA4B,GAG/D,MAAM;AACX,MAAAI,EAAc,oBAAoB,WAAWJ,CAA4B,GACzEI,EAAc,oBAAoB,SAASF,CAA0B;AAAA,IACvE;AAAA,EACF,GAAG,CAACR,GAAQC,GAAOK,GAAaE,CAAS,CAAC,GAEnCL;AACT;AAaO,SAASQ,EACdb,GACAc,GACAb,IAA8B,CAAA,GACxB;AACN,QAAM,EAAE,QAAAC,GAAQ,OAAAC,IAAQ,WAAW,gBAAAC,IAAiB,OAAUH;AAE9D,EAAAU,EAAU,MAAM;AACd,UAAMC,IAAgBV,KAAU,QAE1Ba,IAAU,CAACC,MAAqB;AACpC,MAAIA,EAAE,QAAQhB,MACRI,OAAkB,eAAA,GACtBU,EAASE,CAAC;AAAA,IAEd;AAEA,WAAAJ,EAAc,iBAAiBT,GAAOY,CAAwB,GACvD,MAAMH,EAAc,oBAAoBT,GAAOY,CAAwB;AAAA,EAChF,GAAG,CAACb,GAAQF,GAAWc,GAAUX,GAAOC,CAAc,CAAC;AACzD;"}
1
+ {"version":3,"file":"index108.js","sources":["../src/hooks/useWindowSize.ts"],"sourcesContent":["import { useState, useEffect } from 'react'\n\nexport interface WindowSize {\n width: number\n height: number\n}\n\n/**\n * Hook that tracks window dimensions.\n * Updates on window resize.\n *\n * @returns Object with current width and height\n *\n * @example\n * const { width, height } = useWindowSize()\n *\n * return (\n * <div>\n * Window: {width} x {height}\n * {width < 768 && <MobileNav />}\n * </div>\n * )\n */\nexport function useWindowSize(): WindowSize {\n const [windowSize, setWindowSize] = useState<WindowSize>(() => {\n if (typeof window === 'undefined') {\n return { width: 0, height: 0 }\n }\n return {\n width: window.innerWidth,\n height: window.innerHeight,\n }\n })\n\n useEffect(() => {\n if (typeof window === 'undefined') return\n\n const handleResize = () => {\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n })\n }\n\n window.addEventListener('resize', handleResize)\n return () => window.removeEventListener('resize', handleResize)\n }, [])\n\n return windowSize\n}\n"],"names":["useWindowSize","windowSize","setWindowSize","useState","useEffect","handleResize"],"mappings":";AAuBO,SAASA,IAA4B;AAC1C,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAqB,MACnD,OAAO,SAAW,MACb,EAAE,OAAO,GAAG,QAAQ,EAAA,IAEtB;AAAA,IACL,OAAO,OAAO;AAAA,IACd,QAAQ,OAAO;AAAA,EAAA,CAElB;AAED,SAAAC,EAAU,MAAM;AACd,QAAI,OAAO,SAAW,IAAa;AAEnC,UAAMC,IAAe,MAAM;AACzB,MAAAH,EAAc;AAAA,QACZ,OAAO,OAAO;AAAA,QACd,QAAQ,OAAO;AAAA,MAAA,CAChB;AAAA,IACH;AAEA,kBAAO,iBAAiB,UAAUG,CAAY,GACvC,MAAM,OAAO,oBAAoB,UAAUA,CAAY;AAAA,EAChE,GAAG,CAAA,CAAE,GAEEJ;AACT;"}
package/dist/index109.js CHANGED
@@ -1,21 +1,36 @@
1
- import { useState as t, useEffect as d } from "react";
2
- function r() {
3
- const [i, n] = t(() => typeof window > "u" ? { width: 0, height: 0 } : {
4
- width: window.innerWidth,
5
- height: window.innerHeight
1
+ import * as r from "react";
2
+ import { flushSync as c } from "react-dom";
3
+ import { Virtualizer as f, elementScroll as i, observeElementOffset as m, observeElementRect as d } from "./index110.js";
4
+ import { defaultKeyExtractor as R, defaultRangeExtractor as g, measureElement as z } from "./index110.js";
5
+ const a = typeof document < "u" ? r.useLayoutEffect : r.useEffect;
6
+ function p(e) {
7
+ const n = r.useReducer(() => ({}), {})[1], o = {
8
+ ...e,
9
+ onChange: (l, u) => {
10
+ var s;
11
+ u ? c(n) : n(), (s = e.onChange) == null || s.call(e, l, u);
12
+ }
13
+ }, [t] = r.useState(
14
+ () => new f(o)
15
+ );
16
+ return t.setOptions(o), a(() => t._didMount(), []), a(() => t._willUpdate()), t;
17
+ }
18
+ function h(e) {
19
+ return p({
20
+ observeElementRect: d,
21
+ observeElementOffset: m,
22
+ scrollToFn: i,
23
+ ...e
6
24
  });
7
- return d(() => {
8
- if (typeof window > "u") return;
9
- const e = () => {
10
- n({
11
- width: window.innerWidth,
12
- height: window.innerHeight
13
- });
14
- };
15
- return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
16
- }, []), i;
17
25
  }
18
26
  export {
19
- r as useWindowSize
27
+ f as Virtualizer,
28
+ R as defaultKeyExtractor,
29
+ g as defaultRangeExtractor,
30
+ i as elementScroll,
31
+ z as measureElement,
32
+ m as observeElementOffset,
33
+ d as observeElementRect,
34
+ h as useVirtualizer
20
35
  };
21
36
  //# sourceMappingURL=index109.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index109.js","sources":["../src/hooks/useWindowSize.ts"],"sourcesContent":["import { useState, useEffect } from 'react'\n\nexport interface WindowSize {\n width: number\n height: number\n}\n\n/**\n * Hook that tracks window dimensions.\n * Updates on window resize.\n *\n * @returns Object with current width and height\n *\n * @example\n * const { width, height } = useWindowSize()\n *\n * return (\n * <div>\n * Window: {width} x {height}\n * {width < 768 && <MobileNav />}\n * </div>\n * )\n */\nexport function useWindowSize(): WindowSize {\n const [windowSize, setWindowSize] = useState<WindowSize>(() => {\n if (typeof window === 'undefined') {\n return { width: 0, height: 0 }\n }\n return {\n width: window.innerWidth,\n height: window.innerHeight,\n }\n })\n\n useEffect(() => {\n if (typeof window === 'undefined') return\n\n const handleResize = () => {\n setWindowSize({\n width: window.innerWidth,\n height: window.innerHeight,\n })\n }\n\n window.addEventListener('resize', handleResize)\n return () => window.removeEventListener('resize', handleResize)\n }, [])\n\n return windowSize\n}\n"],"names":["useWindowSize","windowSize","setWindowSize","useState","useEffect","handleResize"],"mappings":";AAuBO,SAASA,IAA4B;AAC1C,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAqB,MACnD,OAAO,SAAW,MACb,EAAE,OAAO,GAAG,QAAQ,EAAA,IAEtB;AAAA,IACL,OAAO,OAAO;AAAA,IACd,QAAQ,OAAO;AAAA,EAAA,CAElB;AAED,SAAAC,EAAU,MAAM;AACd,QAAI,OAAO,SAAW,IAAa;AAEnC,UAAMC,IAAe,MAAM;AACzB,MAAAH,EAAc;AAAA,QACZ,OAAO,OAAO;AAAA,QACd,QAAQ,OAAO;AAAA,MAAA,CAChB;AAAA,IACH;AAEA,kBAAO,iBAAiB,UAAUG,CAAY,GACvC,MAAM,OAAO,oBAAoB,UAAUA,CAAY;AAAA,EAChE,GAAG,CAAA,CAAE,GAEEJ;AACT;"}
1
+ {"version":3,"file":"index109.js","sources":["../../../node_modules/.pnpm/@tanstack+react-virtual@3.13.13_react-dom@19.2.0_react@19.2.0__react@19.2.0/node_modules/@tanstack/react-virtual/dist/esm/index.js"],"sourcesContent":["import * as React from \"react\";\nimport { flushSync } from \"react-dom\";\nimport { Virtualizer, elementScroll, observeElementOffset, observeElementRect, windowScroll, observeWindowOffset, observeWindowRect } from \"@tanstack/virtual-core\";\nexport * from \"@tanstack/virtual-core\";\nconst useIsomorphicLayoutEffect = typeof document !== \"undefined\" ? React.useLayoutEffect : React.useEffect;\nfunction useVirtualizerBase(options) {\n const rerender = React.useReducer(() => ({}), {})[1];\n const resolvedOptions = {\n ...options,\n onChange: (instance2, sync) => {\n var _a;\n if (sync) {\n flushSync(rerender);\n } else {\n rerender();\n }\n (_a = options.onChange) == null ? void 0 : _a.call(options, instance2, sync);\n }\n };\n const [instance] = React.useState(\n () => new Virtualizer(resolvedOptions)\n );\n instance.setOptions(resolvedOptions);\n useIsomorphicLayoutEffect(() => {\n return instance._didMount();\n }, []);\n useIsomorphicLayoutEffect(() => {\n return instance._willUpdate();\n });\n return instance;\n}\nfunction useVirtualizer(options) {\n return useVirtualizerBase({\n observeElementRect,\n observeElementOffset,\n scrollToFn: elementScroll,\n ...options\n });\n}\nfunction useWindowVirtualizer(options) {\n return useVirtualizerBase({\n getScrollElement: () => typeof document !== \"undefined\" ? window : null,\n observeElementRect: observeWindowRect,\n observeElementOffset: observeWindowOffset,\n scrollToFn: windowScroll,\n initialOffset: () => typeof document !== \"undefined\" ? window.scrollY : 0,\n ...options\n });\n}\nexport {\n useVirtualizer,\n useWindowVirtualizer\n};\n//# sourceMappingURL=index.js.map\n"],"names":["useIsomorphicLayoutEffect","React","useVirtualizerBase","options","rerender","resolvedOptions","instance2","sync","_a","flushSync","instance","Virtualizer","useVirtualizer","observeElementRect","observeElementOffset","elementScroll"],"mappings":";;;;AAIA,MAAMA,IAA4B,OAAO,WAAa,MAAcC,EAAM,kBAAkBA,EAAM;AAClG,SAASC,EAAmBC,GAAS;AACnC,QAAMC,IAAWH,EAAM,WAAW,OAAO,CAAA,IAAK,CAAA,CAAE,EAAE,CAAC,GAC7CI,IAAkB;AAAA,IACtB,GAAGF;AAAA,IACH,UAAU,CAACG,GAAWC,MAAS;AAC7B,UAAIC;AACJ,MAAID,IACFE,EAAUL,CAAQ,IAElBA,EAAQ,IAETI,IAAKL,EAAQ,aAAa,QAAgBK,EAAG,KAAKL,GAASG,GAAWC,CAAI;AAAA,IAC7E;AAAA,EACJ,GACQ,CAACG,CAAQ,IAAIT,EAAM;AAAA,IACvB,MAAM,IAAIU,EAAYN,CAAe;AAAA,EACzC;AACE,SAAAK,EAAS,WAAWL,CAAe,GACnCL,EAA0B,MACjBU,EAAS,UAAS,GACxB,CAAA,CAAE,GACLV,EAA0B,MACjBU,EAAS,YAAW,CAC5B,GACMA;AACT;AACA,SAASE,EAAeT,GAAS;AAC/B,SAAOD,EAAmB;AAAA,IACxB,oBAAAW;AAAA,IACA,sBAAAC;AAAA,IACA,YAAYC;AAAA,IACZ,GAAGZ;AAAA,EACP,CAAG;AACH;","x_google_ignoreList":[0]}