@kimdw-rtk/ui 0.0.18 → 0.0.21

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 (742) hide show
  1. package/dist/_virtual/cjs.js +5 -0
  2. package/dist/_virtual/cssesc.js +5 -0
  3. package/dist/_virtual/jsx-runtime.js +5 -0
  4. package/dist/_virtual/jsx-runtime2.js +3 -0
  5. package/dist/_virtual/react-jsx-runtime.development.js +3 -0
  6. package/dist/_virtual/react-jsx-runtime.production.min.js +3 -0
  7. package/dist/components/Accordion/Accordion.css.d.ts +3 -6
  8. package/dist/components/Accordion/Accordion.css.d.ts.map +1 -0
  9. package/dist/components/Accordion/Accordion.css.js +27 -0
  10. package/dist/components/Accordion/Accordion.d.ts +6 -11
  11. package/dist/components/Accordion/Accordion.d.ts.map +1 -0
  12. package/dist/components/Accordion/Accordion.js +14 -0
  13. package/dist/components/Accordion/Accordion.spec.d.ts +2 -2
  14. package/dist/components/Accordion/Accordion.spec.d.ts.map +1 -0
  15. package/dist/components/Accordion/AccordionContent.css.d.ts +3 -6
  16. package/dist/components/Accordion/AccordionContent.css.d.ts.map +1 -0
  17. package/dist/components/Accordion/AccordionContent.css.js +25 -0
  18. package/dist/components/Accordion/AccordionContent.d.ts +4 -6
  19. package/dist/components/Accordion/AccordionContent.d.ts.map +1 -0
  20. package/dist/components/Accordion/AccordionContent.js +56 -0
  21. package/dist/components/Accordion/AccordionContext.d.ts +4 -7
  22. package/dist/components/Accordion/AccordionContext.d.ts.map +1 -0
  23. package/dist/components/Accordion/AccordionContext.js +8 -0
  24. package/dist/components/Accordion/AccordionTrigger.css.d.ts +3 -6
  25. package/dist/components/Accordion/AccordionTrigger.css.d.ts.map +1 -0
  26. package/dist/components/Accordion/AccordionTrigger.css.js +42 -0
  27. package/dist/components/Accordion/AccordionTrigger.d.ts +4 -6
  28. package/dist/components/Accordion/AccordionTrigger.d.ts.map +1 -0
  29. package/dist/components/Accordion/AccordionTrigger.js +16 -0
  30. package/dist/components/Accordion/index.d.ts +4 -10
  31. package/dist/components/Accordion/index.d.ts.map +1 -0
  32. package/dist/components/Alert/index.d.ts +4 -6
  33. package/dist/components/Alert/index.d.ts.map +1 -0
  34. package/dist/components/Alert/index.js +14 -0
  35. package/dist/components/Box/Box.css.d.ts +2 -5
  36. package/dist/components/Box/Box.css.d.ts.map +1 -0
  37. package/dist/components/Box/Box.css.js +19 -0
  38. package/dist/components/Box/Box.spec.d.ts +2 -2
  39. package/dist/components/Box/Box.spec.d.ts.map +1 -0
  40. package/dist/components/Box/index.d.ts +7 -11
  41. package/dist/components/Box/index.d.ts.map +1 -0
  42. package/dist/components/Box/index.js +14 -0
  43. package/dist/components/Button/Button.css.d.ts +146 -2
  44. package/dist/components/Button/Button.css.d.ts.map +1 -0
  45. package/dist/components/Button/Button.css.js +185 -0
  46. package/dist/components/Button/Button.spec.d.ts +2 -2
  47. package/dist/components/Button/Button.spec.d.ts.map +1 -0
  48. package/dist/components/Button/index.d.ts +7 -13
  49. package/dist/components/Button/index.d.ts.map +1 -0
  50. package/dist/components/Button/index.js +22 -0
  51. package/dist/components/Card/Card.css.d.ts +61 -2
  52. package/dist/components/Card/Card.css.d.ts.map +1 -0
  53. package/dist/components/Card/Card.css.js +71 -0
  54. package/dist/components/Card/Card.d.ts +7 -13
  55. package/dist/components/Card/Card.d.ts.map +1 -0
  56. package/dist/components/Card/Card.js +14 -0
  57. package/dist/components/Card/Card.spec.d.ts +2 -2
  58. package/dist/components/Card/Card.spec.d.ts.map +1 -0
  59. package/dist/components/Card/CardContent.css.d.ts +2 -3
  60. package/dist/components/Card/CardContent.css.d.ts.map +1 -0
  61. package/dist/components/Card/CardContent.css.js +9 -0
  62. package/dist/components/Card/CardContent.d.ts +4 -9
  63. package/dist/components/Card/CardContent.d.ts.map +1 -0
  64. package/dist/components/Card/CardContent.js +12 -0
  65. package/dist/components/Card/CardInteraction.css.d.ts +2 -3
  66. package/dist/components/Card/CardInteraction.css.d.ts.map +1 -0
  67. package/dist/components/Card/CardInteraction.css.js +11 -0
  68. package/dist/components/Card/CardInteraction.d.ts +4 -9
  69. package/dist/components/Card/CardInteraction.d.ts.map +1 -0
  70. package/dist/components/Card/CardInteraction.js +14 -0
  71. package/dist/components/Card/CardThumbnail.css.d.ts +2 -3
  72. package/dist/components/Card/CardThumbnail.css.d.ts.map +1 -0
  73. package/dist/components/Card/CardThumbnail.css.js +8 -0
  74. package/dist/components/Card/CardThumbnail.d.ts +4 -9
  75. package/dist/components/Card/CardThumbnail.d.ts.map +1 -0
  76. package/dist/components/Card/CardThumbnail.js +12 -0
  77. package/dist/components/Card/index.d.ts +5 -10
  78. package/dist/components/Card/index.d.ts.map +1 -0
  79. package/dist/components/Chip/Chip.css.d.ts +46 -2
  80. package/dist/components/Chip/Chip.css.d.ts.map +1 -0
  81. package/dist/components/Chip/Chip.css.js +59 -0
  82. package/dist/components/Chip/Chip.d.ts +6 -12
  83. package/dist/components/Chip/Chip.d.ts.map +1 -0
  84. package/dist/components/Chip/Chip.js +14 -0
  85. package/dist/components/Chip/Chip.spec.d.ts +2 -2
  86. package/dist/components/Chip/Chip.spec.d.ts.map +1 -0
  87. package/dist/components/Chip/index.d.ts +2 -7
  88. package/dist/components/Chip/index.d.ts.map +1 -0
  89. package/dist/components/Confirm/index.d.ts +4 -6
  90. package/dist/components/Confirm/index.d.ts.map +1 -0
  91. package/dist/components/Confirm/index.js +19 -0
  92. package/dist/components/Dialog/Dialog.css.d.ts +3 -4
  93. package/dist/components/Dialog/Dialog.css.d.ts.map +1 -0
  94. package/dist/components/Dialog/Dialog.css.js +22 -0
  95. package/dist/components/Dialog/Dialog.d.ts +4 -9
  96. package/dist/components/Dialog/Dialog.d.ts.map +1 -0
  97. package/dist/components/Dialog/Dialog.js +13 -0
  98. package/dist/components/Dialog/Dialog.spec.d.ts +2 -2
  99. package/dist/components/Dialog/Dialog.spec.d.ts.map +1 -0
  100. package/dist/components/Dialog/DialogContent.css.d.ts +2 -3
  101. package/dist/components/Dialog/DialogContent.css.d.ts.map +1 -0
  102. package/dist/components/Dialog/DialogContent.css.js +15 -0
  103. package/dist/components/Dialog/DialogContent.d.ts +4 -9
  104. package/dist/components/Dialog/DialogContent.d.ts.map +1 -0
  105. package/dist/components/Dialog/DialogContent.js +13 -0
  106. package/dist/components/Dialog/DialogFooter.css.d.ts +3 -4
  107. package/dist/components/Dialog/DialogFooter.css.d.ts.map +1 -0
  108. package/dist/components/Dialog/DialogFooter.d.ts +4 -9
  109. package/dist/components/Dialog/DialogFooter.d.ts.map +1 -0
  110. package/dist/components/Dialog/DialogFooter.js +12 -0
  111. package/dist/components/Dialog/DialogHeader.css.d.ts +3 -4
  112. package/dist/components/Dialog/DialogHeader.css.d.ts.map +1 -0
  113. package/dist/components/Dialog/DialogHeader.css.js +26 -0
  114. package/dist/components/Dialog/DialogHeader.d.ts +4 -9
  115. package/dist/components/Dialog/DialogHeader.d.ts.map +1 -0
  116. package/dist/components/Dialog/DialogHeader.js +14 -0
  117. package/dist/components/Dialog/index.d.ts +5 -9
  118. package/dist/components/Dialog/index.d.ts.map +1 -0
  119. package/dist/components/Navigation/Navigation.spec.d.ts +2 -2
  120. package/dist/components/Navigation/Navigation.spec.d.ts.map +1 -0
  121. package/dist/components/Navigation/NavigationAside.css.d.ts +2 -3
  122. package/dist/components/Navigation/NavigationAside.css.d.ts.map +1 -0
  123. package/dist/components/Navigation/NavigationAside.css.js +9 -0
  124. package/dist/components/Navigation/NavigationAside.d.ts +4 -9
  125. package/dist/components/Navigation/NavigationAside.d.ts.map +1 -0
  126. package/dist/components/Navigation/NavigationAside.js +12 -0
  127. package/dist/components/Navigation/NavigationBar.css.d.ts +15 -2
  128. package/dist/components/Navigation/NavigationBar.css.d.ts.map +1 -0
  129. package/dist/components/Navigation/NavigationBar.css.js +35 -0
  130. package/dist/components/Navigation/NavigationBar.d.ts +6 -12
  131. package/dist/components/Navigation/NavigationBar.d.ts.map +1 -0
  132. package/dist/components/Navigation/NavigationBar.js +14 -0
  133. package/dist/components/Navigation/NavigationContainer.css.d.ts +2 -3
  134. package/dist/components/Navigation/NavigationContainer.css.d.ts.map +1 -0
  135. package/dist/components/Navigation/NavigationContainer.css.js +12 -0
  136. package/dist/components/Navigation/NavigationContainer.d.ts +4 -9
  137. package/dist/components/Navigation/NavigationContainer.d.ts.map +1 -0
  138. package/dist/components/Navigation/NavigationContainer.js +12 -0
  139. package/dist/components/Navigation/NavigationDrawer.css.d.ts +4 -7
  140. package/dist/components/Navigation/NavigationDrawer.css.d.ts.map +1 -0
  141. package/dist/components/Navigation/NavigationDrawer.css.js +52 -0
  142. package/dist/components/Navigation/NavigationDrawer.d.ts +4 -6
  143. package/dist/components/Navigation/NavigationDrawer.d.ts.map +1 -0
  144. package/dist/components/Navigation/NavigationDrawer.js +27 -0
  145. package/dist/components/Navigation/NavigationItem.css.d.ts +2 -5
  146. package/dist/components/Navigation/NavigationItem.css.d.ts.map +1 -0
  147. package/dist/components/Navigation/NavigationItem.css.js +38 -0
  148. package/dist/components/Navigation/NavigationItem.d.ts +6 -11
  149. package/dist/components/Navigation/NavigationItem.d.ts.map +1 -0
  150. package/dist/components/Navigation/NavigationItem.js +12 -0
  151. package/dist/components/Navigation/NavigationLogo.css.d.ts +2 -3
  152. package/dist/components/Navigation/NavigationLogo.css.d.ts.map +1 -0
  153. package/dist/components/Navigation/NavigationLogo.css.js +7 -0
  154. package/dist/components/Navigation/NavigationLogo.d.ts +4 -9
  155. package/dist/components/Navigation/NavigationLogo.d.ts.map +1 -0
  156. package/dist/components/Navigation/NavigationLogo.js +12 -0
  157. package/dist/components/Navigation/NavigationMenu.css.d.ts +2 -1
  158. package/dist/components/Navigation/NavigationMenu.css.d.ts.map +1 -0
  159. package/dist/components/Navigation/NavigationMenu.css.js +22 -0
  160. package/dist/components/Navigation/NavigationMenu.d.ts +5 -10
  161. package/dist/components/Navigation/NavigationMenu.d.ts.map +1 -0
  162. package/dist/components/Navigation/NavigationMenu.js +14 -0
  163. package/dist/components/Navigation/index.d.ts +8 -16
  164. package/dist/components/Navigation/index.d.ts.map +1 -0
  165. package/dist/components/Range/Range.css.d.ts +49 -2
  166. package/dist/components/Range/Range.css.d.ts.map +1 -0
  167. package/dist/components/Range/Range.css.js +96 -0
  168. package/dist/components/Range/Range.d.ts +6 -12
  169. package/dist/components/Range/Range.d.ts.map +1 -0
  170. package/dist/components/Range/Range.js +40 -0
  171. package/dist/components/Range/Range.spec.d.ts +2 -2
  172. package/dist/components/Range/Range.spec.d.ts.map +1 -0
  173. package/dist/components/Range/index.d.ts +2 -7
  174. package/dist/components/Range/index.d.ts.map +1 -0
  175. package/dist/components/ScrollArea/ScrollArea.css.d.ts +6 -1
  176. package/dist/components/ScrollArea/ScrollArea.css.d.ts.map +1 -0
  177. package/dist/components/ScrollArea/ScrollArea.css.js +35 -0
  178. package/dist/components/ScrollArea/ScrollArea.d.ts +5 -10
  179. package/dist/components/ScrollArea/ScrollArea.d.ts.map +1 -0
  180. package/dist/components/ScrollArea/ScrollArea.js +37 -0
  181. package/dist/components/ScrollArea/ScrollArea.spec.d.ts +2 -2
  182. package/dist/components/ScrollArea/ScrollArea.spec.d.ts.map +1 -0
  183. package/dist/components/ScrollArea/index.d.ts +2 -7
  184. package/dist/components/ScrollArea/index.d.ts.map +1 -0
  185. package/dist/components/Select/Select.css.d.ts +14 -2
  186. package/dist/components/Select/Select.css.d.ts.map +1 -0
  187. package/dist/components/Select/Select.css.js +23 -0
  188. package/dist/components/Select/Select.d.ts +8 -16
  189. package/dist/components/Select/Select.d.ts.map +1 -0
  190. package/dist/components/Select/Select.js +49 -0
  191. package/dist/components/Select/Select.spec.d.ts +2 -2
  192. package/dist/components/Select/Select.spec.d.ts.map +1 -0
  193. package/dist/components/Select/SelectContext.d.ts +5 -7
  194. package/dist/components/Select/SelectContext.d.ts.map +1 -0
  195. package/dist/components/Select/SelectContext.js +33 -0
  196. package/dist/components/Select/SelectOption.css.d.ts +2 -3
  197. package/dist/components/Select/SelectOption.css.d.ts.map +1 -0
  198. package/dist/components/Select/SelectOption.css.js +13 -0
  199. package/dist/components/Select/SelectOption.d.ts +4 -6
  200. package/dist/components/Select/SelectOption.d.ts.map +1 -0
  201. package/dist/components/Select/SelectOption.js +25 -0
  202. package/dist/components/Select/SelectOptionList.css.d.ts +2 -5
  203. package/dist/components/Select/SelectOptionList.css.d.ts.map +1 -0
  204. package/dist/components/Select/SelectOptionList.css.js +58 -0
  205. package/dist/components/Select/SelectOptionList.d.ts +4 -6
  206. package/dist/components/Select/SelectOptionList.d.ts.map +1 -0
  207. package/dist/components/Select/SelectOptionList.js +35 -0
  208. package/dist/components/Select/SelectTrigger.css.d.ts +4 -7
  209. package/dist/components/Select/SelectTrigger.css.d.ts.map +1 -0
  210. package/dist/components/Select/SelectTrigger.css.js +62 -0
  211. package/dist/components/Select/SelectTrigger.d.ts +6 -12
  212. package/dist/components/Select/SelectTrigger.d.ts.map +1 -0
  213. package/dist/components/Select/SelectTrigger.js +21 -0
  214. package/dist/components/Select/index.d.ts +3 -11
  215. package/dist/components/Select/index.d.ts.map +1 -0
  216. package/dist/components/Skeleton/Skeleton.css.d.ts +2 -3
  217. package/dist/components/Skeleton/Skeleton.css.d.ts.map +1 -0
  218. package/dist/components/Skeleton/Skeleton.css.js +22 -0
  219. package/dist/components/Skeleton/Skeleton.spec.d.ts +2 -2
  220. package/dist/components/Skeleton/Skeleton.spec.d.ts.map +1 -0
  221. package/dist/components/Skeleton/index.d.ts +5 -10
  222. package/dist/components/Skeleton/index.d.ts.map +1 -0
  223. package/dist/components/Skeleton/index.js +12 -0
  224. package/dist/components/Table/Table.css.d.ts +3 -1
  225. package/dist/components/Table/Table.css.d.ts.map +1 -0
  226. package/dist/components/Table/Table.css.js +10 -0
  227. package/dist/components/Table/Table.d.ts +5 -10
  228. package/dist/components/Table/Table.d.ts.map +1 -0
  229. package/dist/components/Table/Table.js +14 -0
  230. package/dist/components/Table/Table.spec.d.ts +2 -2
  231. package/dist/components/Table/Table.spec.d.ts.map +1 -0
  232. package/dist/components/Table/TableBody.d.ts +4 -10
  233. package/dist/components/Table/TableBody.d.ts.map +1 -0
  234. package/dist/components/Table/TableBody.js +9 -0
  235. package/dist/components/Table/TableCell.css.d.ts +2 -3
  236. package/dist/components/Table/TableCell.css.d.ts.map +1 -0
  237. package/dist/components/Table/TableCell.css.js +35 -0
  238. package/dist/components/Table/TableCell.d.ts +5 -10
  239. package/dist/components/Table/TableCell.d.ts.map +1 -0
  240. package/dist/components/Table/TableCell.js +10 -0
  241. package/dist/components/Table/TableHead.css.d.ts +2 -3
  242. package/dist/components/Table/TableHead.css.d.ts.map +1 -0
  243. package/dist/components/Table/TableHead.css.js +11 -0
  244. package/dist/components/Table/TableHead.d.ts +5 -10
  245. package/dist/components/Table/TableHead.d.ts.map +1 -0
  246. package/dist/components/Table/TableHead.js +10 -0
  247. package/dist/components/Table/TableHeader.d.ts +4 -10
  248. package/dist/components/Table/TableHeader.d.ts.map +1 -0
  249. package/dist/components/Table/TableHeader.js +9 -0
  250. package/dist/components/Table/TableRow.css.d.ts +2 -3
  251. package/dist/components/Table/TableRow.css.d.ts.map +1 -0
  252. package/dist/components/Table/TableRow.css.js +5 -0
  253. package/dist/components/Table/TableRow.d.ts +4 -10
  254. package/dist/components/Table/TableRow.d.ts.map +1 -0
  255. package/dist/components/Table/TableRow.js +10 -0
  256. package/dist/components/Table/index.d.ts +7 -13
  257. package/dist/components/Table/index.d.ts.map +1 -0
  258. package/dist/components/Tabs/Tabs.d.ts +4 -9
  259. package/dist/components/Tabs/Tabs.d.ts.map +1 -0
  260. package/dist/components/Tabs/Tabs.js +13 -0
  261. package/dist/components/Tabs/Tabs.spec.d.ts +2 -2
  262. package/dist/components/Tabs/Tabs.spec.d.ts.map +1 -0
  263. package/dist/components/Tabs/TabsContent.d.ts +5 -10
  264. package/dist/components/Tabs/TabsContent.d.ts.map +1 -0
  265. package/dist/components/Tabs/TabsContent.js +19 -0
  266. package/dist/components/Tabs/TabsList.css.d.ts +2 -3
  267. package/dist/components/Tabs/TabsList.css.d.ts.map +1 -0
  268. package/dist/components/Tabs/TabsList.css.js +11 -0
  269. package/dist/components/Tabs/TabsList.d.ts +4 -9
  270. package/dist/components/Tabs/TabsList.d.ts.map +1 -0
  271. package/dist/components/Tabs/TabsList.js +12 -0
  272. package/dist/components/Tabs/TabsProvider.d.ts +5 -7
  273. package/dist/components/Tabs/TabsProvider.d.ts.map +1 -0
  274. package/dist/components/Tabs/TabsProvider.js +8 -0
  275. package/dist/components/Tabs/TabsTrigger.css.d.ts +2 -5
  276. package/dist/components/Tabs/TabsTrigger.css.d.ts.map +1 -0
  277. package/dist/components/Tabs/TabsTrigger.css.js +32 -0
  278. package/dist/components/Tabs/TabsTrigger.d.ts +4 -9
  279. package/dist/components/Tabs/TabsTrigger.d.ts.map +1 -0
  280. package/dist/components/Tabs/TabsTrigger.js +21 -0
  281. package/dist/components/Tabs/index.d.ts +5 -9
  282. package/dist/components/Tabs/index.d.ts.map +1 -0
  283. package/dist/components/TextField/TextField.css.d.ts +49 -2
  284. package/dist/components/TextField/TextField.css.d.ts.map +1 -0
  285. package/dist/components/TextField/TextField.css.js +62 -0
  286. package/dist/components/TextField/TextField.spec.d.ts +2 -2
  287. package/dist/components/TextField/TextField.spec.d.ts.map +1 -0
  288. package/dist/components/TextField/index.d.ts +6 -12
  289. package/dist/components/TextField/index.d.ts.map +1 -0
  290. package/dist/components/TextField/index.js +14 -0
  291. package/dist/components/Toast/Toast.css.d.ts +26 -2
  292. package/dist/components/Toast/Toast.css.d.ts.map +1 -0
  293. package/dist/components/Toast/Toast.css.js +65 -0
  294. package/dist/components/Toast/Toast.spec.d.ts +2 -2
  295. package/dist/components/Toast/Toast.spec.d.ts.map +1 -0
  296. package/dist/components/Toast/index.d.ts +6 -12
  297. package/dist/components/Toast/index.d.ts.map +1 -0
  298. package/dist/components/Toast/index.js +17 -0
  299. package/dist/components/Typography/Typography.css.d.ts +10 -2
  300. package/dist/components/Typography/Typography.css.d.ts.map +1 -0
  301. package/dist/components/Typography/Typography.css.js +18 -0
  302. package/dist/components/Typography/Typography.spec.d.ts +2 -2
  303. package/dist/components/Typography/Typography.spec.d.ts.map +1 -0
  304. package/dist/components/Typography/index.d.ts +7 -12
  305. package/dist/components/Typography/index.d.ts.map +1 -0
  306. package/dist/components/Typography/index.js +14 -0
  307. package/dist/components/index.d.ts +19 -64
  308. package/dist/components/index.d.ts.map +1 -0
  309. package/dist/contexts/UIProvider.d.ts +5 -7
  310. package/dist/contexts/UIProvider.d.ts.map +1 -0
  311. package/dist/contexts/UIProvider.js +10 -0
  312. package/dist/contexts/index.d.ts +2 -4
  313. package/dist/contexts/index.d.ts.map +1 -0
  314. package/dist/hooks/index.d.ts +6 -13
  315. package/dist/hooks/index.d.ts.map +1 -0
  316. package/dist/hooks/useDialog/index.d.ts +3 -5
  317. package/dist/hooks/useDialog/index.d.ts.map +1 -0
  318. package/dist/hooks/useDialog/index.js +31 -0
  319. package/dist/hooks/useDialog/useDialog.spec.d.ts +2 -2
  320. package/dist/hooks/useDialog/useDialog.spec.d.ts.map +1 -0
  321. package/dist/hooks/useMouseScroll/index.d.ts +2 -3
  322. package/dist/hooks/useMouseScroll/index.d.ts.map +1 -0
  323. package/dist/hooks/useMouseScroll/index.js +49 -0
  324. package/dist/hooks/usePointerSlider/index.d.ts +2 -3
  325. package/dist/hooks/usePointerSlider/index.d.ts.map +1 -0
  326. package/dist/hooks/usePointerSlider/index.js +46 -0
  327. package/dist/hooks/useRipple/index.d.ts +3 -6
  328. package/dist/hooks/useRipple/index.d.ts.map +1 -0
  329. package/dist/hooks/useRipple/index.js +111 -0
  330. package/dist/hooks/useRipple/ripple.css.d.ts +3 -6
  331. package/dist/hooks/useRipple/ripple.css.d.ts.map +1 -0
  332. package/dist/hooks/useRipple/ripple.css.js +33 -0
  333. package/dist/hooks/useToast/ToastContainer.css.d.ts +2 -3
  334. package/dist/hooks/useToast/ToastContainer.css.d.ts.map +1 -0
  335. package/dist/hooks/useToast/ToastContainer.css.js +13 -0
  336. package/dist/hooks/useToast/ToastContainer.d.ts +4 -6
  337. package/dist/hooks/useToast/ToastContainer.d.ts.map +1 -0
  338. package/dist/hooks/useToast/ToastContainer.js +8 -0
  339. package/dist/hooks/useToast/ToastProvider.d.ts +7 -15
  340. package/dist/hooks/useToast/ToastProvider.d.ts.map +1 -0
  341. package/dist/hooks/useToast/ToastProvider.js +49 -0
  342. package/dist/hooks/useToast/index.d.ts +3 -14
  343. package/dist/hooks/useToast/index.d.ts.map +1 -0
  344. package/dist/hooks/useToast/index.js +13 -0
  345. package/dist/index.d.ts +9 -77
  346. package/dist/index.d.ts.map +1 -0
  347. package/dist/index.js +78 -0
  348. package/dist/node_modules/.pnpm/@emotion_hash@0.9.2/node_modules/@emotion/hash/dist/emotion-hash.esm.js +55 -0
  349. package/dist/node_modules/.pnpm/@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0/node_modules/@vanilla-extract/css/adapter/dist/vanilla-extract-css-adapter.esm.js +51 -0
  350. package/dist/node_modules/.pnpm/@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0/node_modules/@vanilla-extract/css/dist/taggedTemplateLiteral-10998315.esm.js +12 -0
  351. package/dist/node_modules/.pnpm/@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0/node_modules/@vanilla-extract/css/dist/transformCss-0dba36bf.esm.js +955 -0
  352. package/dist/node_modules/.pnpm/@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0/node_modules/@vanilla-extract/css/dist/vanilla-extract-css.esm.js +325 -0
  353. package/dist/node_modules/.pnpm/@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0/node_modules/@vanilla-extract/css/fileScope/dist/vanilla-extract-css-fileScope.esm.js +20 -0
  354. package/dist/node_modules/.pnpm/@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0/node_modules/@vanilla-extract/css/functionSerializer/dist/vanilla-extract-css-functionSerializer.esm.js +11 -0
  355. package/dist/node_modules/.pnpm/@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0/node_modules/@vanilla-extract/css/injectStyles/dist/vanilla-extract-css-injectStyles.esm.js +22 -0
  356. package/dist/node_modules/.pnpm/@vanilla-extract_private@1.0.9/node_modules/@vanilla-extract/private/dist/vanilla-extract-private.esm.js +26 -0
  357. package/dist/node_modules/.pnpm/@vanilla-extract_recipes@0.5.7_@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0_/node_modules/@vanilla-extract/recipes/dist/createRuntimeFn-62c9670f.esm.js +111 -0
  358. package/dist/node_modules/.pnpm/@vanilla-extract_recipes@0.5.7_@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0_/node_modules/@vanilla-extract/recipes/dist/vanilla-extract-recipes.esm.js +43 -0
  359. package/dist/node_modules/.pnpm/@vanilla-extract_sprinkles@1.6.5_@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0_/node_modules/@vanilla-extract/sprinkles/dist/createSprinkles-74286718.esm.js +190 -0
  360. package/dist/node_modules/.pnpm/@vanilla-extract_sprinkles@1.6.5_@vanilla-extract_css@1.17.4_babel-plugin-macros@3.1.0_/node_modules/@vanilla-extract/sprinkles/dist/vanilla-extract-sprinkles.esm.js +146 -0
  361. package/dist/node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js +3 -0
  362. package/dist/node_modules/.pnpm/css-what@6.2.2/node_modules/css-what/lib/es/parse.js +423 -0
  363. package/dist/node_modules/.pnpm/css-what@6.2.2/node_modules/css-what/lib/es/types.js +28 -0
  364. package/dist/node_modules/.pnpm/cssesc@3.0.0/node_modules/cssesc/cssesc.js +119 -0
  365. package/dist/node_modules/.pnpm/dedent@1.6.0_babel-plugin-macros@3.1.0/node_modules/dedent/dist/dedent.js +68 -0
  366. package/dist/node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js +142 -0
  367. package/dist/node_modules/.pnpm/lru-cache@10.4.3/node_modules/lru-cache/dist/esm/index.js +1542 -0
  368. package/dist/node_modules/.pnpm/lucide-react@0.503.0_react@18.3.1/node_modules/lucide-react/dist/esm/Icon.js +45 -0
  369. package/dist/node_modules/.pnpm/lucide-react@0.503.0_react@18.3.1/node_modules/lucide-react/dist/esm/createLucideIcon.js +30 -0
  370. package/dist/node_modules/.pnpm/lucide-react@0.503.0_react@18.3.1/node_modules/lucide-react/dist/esm/defaultAttributes.js +20 -0
  371. package/dist/node_modules/.pnpm/lucide-react@0.503.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/align-justify.js +18 -0
  372. package/dist/node_modules/.pnpm/lucide-react@0.503.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/chevron-down.js +14 -0
  373. package/dist/node_modules/.pnpm/lucide-react@0.503.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/x.js +17 -0
  374. package/dist/node_modules/.pnpm/lucide-react@0.503.0_react@18.3.1/node_modules/lucide-react/dist/esm/shared/src/utils.js +28 -0
  375. package/dist/node_modules/.pnpm/media-query-parser@2.0.2/node_modules/media-query-parser/dist/media-query-parser.esm.js +1378 -0
  376. package/dist/node_modules/.pnpm/modern-ahocorasick@1.1.0/node_modules/modern-ahocorasick/dist/index.js +101 -0
  377. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js +1315 -0
  378. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js +24 -0
  379. package/dist/node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js +19 -0
  380. package/dist/styles/globalStyle.css.d.ts +2 -2
  381. package/dist/styles/globalStyle.css.d.ts.map +1 -0
  382. package/dist/styles/index.d.ts +5 -3
  383. package/dist/styles/index.d.ts.map +1 -0
  384. package/dist/styles/layers.css.d.ts +3 -4
  385. package/dist/styles/layers.css.d.ts.map +1 -0
  386. package/dist/styles/layers.css.js +6 -0
  387. package/dist/styles/overlay.css.d.ts +4 -5
  388. package/dist/styles/overlay.css.d.ts.map +1 -0
  389. package/dist/styles/overlay.css.js +34 -0
  390. package/dist/styles/sprinkles.css.d.ts +7 -8
  391. package/dist/styles/sprinkles.css.d.ts.map +1 -0
  392. package/dist/styles/sprinkles.css.js +124 -0
  393. package/dist/styles/sx.d.ts +3 -5
  394. package/dist/styles/sx.d.ts.map +1 -0
  395. package/dist/styles/sx.js +13 -0
  396. package/dist/tests/uiTest.d.ts +3 -5
  397. package/dist/tests/uiTest.d.ts.map +1 -0
  398. package/dist/themes/darkTheme.css.d.ts +2 -3
  399. package/dist/themes/darkTheme.css.d.ts.map +1 -0
  400. package/dist/themes/darkTheme.css.js +32 -0
  401. package/dist/themes/index.d.ts +4 -3
  402. package/dist/themes/index.d.ts.map +1 -0
  403. package/dist/themes/lightTheme.css.d.ts +2 -3
  404. package/dist/themes/lightTheme.css.d.ts.map +1 -0
  405. package/dist/themes/lightTheme.css.js +32 -0
  406. package/dist/themes/theme.css.d.ts +2 -3
  407. package/dist/themes/theme.css.d.ts.map +1 -0
  408. package/dist/themes/theme.css.js +24 -0
  409. package/dist/tokens/index.d.ts +6 -5
  410. package/dist/tokens/index.d.ts.map +1 -0
  411. package/dist/tokens/scale/color.d.ts +5 -6
  412. package/dist/tokens/scale/color.d.ts.map +1 -0
  413. package/dist/tokens/scale/color.js +602 -0
  414. package/dist/tokens/semantic/breakpoint.d.ts +2 -3
  415. package/dist/tokens/semantic/breakpoint.d.ts.map +1 -0
  416. package/dist/tokens/semantic/breakpoint.js +4 -0
  417. package/dist/tokens/semantic/color.d.ts +2 -3
  418. package/dist/tokens/semantic/color.d.ts.map +1 -0
  419. package/dist/tokens/semantic/color.js +12 -0
  420. package/dist/tokens/semantic/spacing.d.ts +2 -3
  421. package/dist/tokens/semantic/spacing.d.ts.map +1 -0
  422. package/dist/tokens/semantic/spacing.js +11 -0
  423. package/dist/tokens/semantic/typography.d.ts +2 -3
  424. package/dist/tokens/semantic/typography.d.ts.map +1 -0
  425. package/dist/tokens/semantic/typography.js +34 -0
  426. package/dist/types/index.d.ts +2 -5
  427. package/dist/types/index.d.ts.map +1 -0
  428. package/dist/types/ui.types.d.ts +8 -9
  429. package/dist/types/ui.types.d.ts.map +1 -0
  430. package/dist/utils/index.d.ts +2 -2
  431. package/dist/utils/index.d.ts.map +1 -0
  432. package/dist/utils/sprinklesUtils.d.ts +4 -6
  433. package/dist/utils/sprinklesUtils.d.ts.map +1 -0
  434. package/dist/utils/sprinklesUtils.js +22 -0
  435. package/dist/utils/styleUtils.css.d.ts +5 -7
  436. package/dist/utils/styleUtils.css.d.ts.map +1 -0
  437. package/dist/utils/styleUtils.css.js +64 -0
  438. package/package.json +8 -2
  439. package/dist/Button.css-CzeAAfQg.d.ts +0 -156
  440. package/dist/Card.css-CotPlKu4.d.ts +0 -69
  441. package/dist/Chip.css-lxhSCCWQ.d.ts +0 -54
  442. package/dist/NavigationBar.css-Dryo_NT0.d.ts +0 -24
  443. package/dist/NavigationMenu.css-B_dOkuGn.d.ts +0 -8
  444. package/dist/Range.css-DcxHoAAm.d.ts +0 -60
  445. package/dist/ScrollArea.css-CNx8Yliu.d.ts +0 -16
  446. package/dist/Select.css-BlJORB-N.d.ts +0 -22
  447. package/dist/Table.css-5Pm2Q-3j.d.ts +0 -10
  448. package/dist/TextField.css-DmXBuD66.d.ts +0 -57
  449. package/dist/Toast.css-Bm98ZkjT.d.ts +0 -35
  450. package/dist/Typography.css-Fgk6uUbK.d.ts +0 -18
  451. package/dist/components/Accordion/Accordion.css.mjs +0 -29
  452. package/dist/components/Accordion/Accordion.css.mjs.map +0 -1
  453. package/dist/components/Accordion/Accordion.mjs +0 -33
  454. package/dist/components/Accordion/Accordion.mjs.map +0 -1
  455. package/dist/components/Accordion/Accordion.spec.mjs +0 -6
  456. package/dist/components/Accordion/Accordion.spec.mjs.map +0 -1
  457. package/dist/components/Accordion/AccordionContent.css.mjs +0 -27
  458. package/dist/components/Accordion/AccordionContent.css.mjs.map +0 -1
  459. package/dist/components/Accordion/AccordionContent.mjs +0 -63
  460. package/dist/components/Accordion/AccordionContent.mjs.map +0 -1
  461. package/dist/components/Accordion/AccordionContext.mjs +0 -10
  462. package/dist/components/Accordion/AccordionContext.mjs.map +0 -1
  463. package/dist/components/Accordion/AccordionTrigger.css.mjs +0 -44
  464. package/dist/components/Accordion/AccordionTrigger.css.mjs.map +0 -1
  465. package/dist/components/Accordion/AccordionTrigger.mjs +0 -34
  466. package/dist/components/Accordion/AccordionTrigger.mjs.map +0 -1
  467. package/dist/components/Accordion/index.mjs +0 -4
  468. package/dist/components/Accordion/index.mjs.map +0 -1
  469. package/dist/components/Alert/index.mjs +0 -16
  470. package/dist/components/Alert/index.mjs.map +0 -1
  471. package/dist/components/Box/Box.css.mjs +0 -20
  472. package/dist/components/Box/Box.css.mjs.map +0 -1
  473. package/dist/components/Box/Box.spec.mjs +0 -6
  474. package/dist/components/Box/Box.spec.mjs.map +0 -1
  475. package/dist/components/Box/index.mjs +0 -36
  476. package/dist/components/Box/index.mjs.map +0 -1
  477. package/dist/components/Button/Button.css.mjs +0 -194
  478. package/dist/components/Button/Button.css.mjs.map +0 -1
  479. package/dist/components/Button/Button.spec.mjs +0 -22
  480. package/dist/components/Button/Button.spec.mjs.map +0 -1
  481. package/dist/components/Button/index.mjs +0 -51
  482. package/dist/components/Button/index.mjs.map +0 -1
  483. package/dist/components/Card/Card.css.mjs +0 -78
  484. package/dist/components/Card/Card.css.mjs.map +0 -1
  485. package/dist/components/Card/Card.mjs +0 -33
  486. package/dist/components/Card/Card.mjs.map +0 -1
  487. package/dist/components/Card/Card.spec.mjs +0 -19
  488. package/dist/components/Card/Card.spec.mjs.map +0 -1
  489. package/dist/components/Card/CardContent.css.mjs +0 -10
  490. package/dist/components/Card/CardContent.css.mjs.map +0 -1
  491. package/dist/components/Card/CardContent.mjs +0 -22
  492. package/dist/components/Card/CardContent.mjs.map +0 -1
  493. package/dist/components/Card/CardInteraction.css.mjs +0 -12
  494. package/dist/components/Card/CardInteraction.css.mjs.map +0 -1
  495. package/dist/components/Card/CardInteraction.mjs +0 -34
  496. package/dist/components/Card/CardInteraction.mjs.map +0 -1
  497. package/dist/components/Card/CardThumbnail.css.mjs +0 -9
  498. package/dist/components/Card/CardThumbnail.css.mjs.map +0 -1
  499. package/dist/components/Card/CardThumbnail.mjs +0 -22
  500. package/dist/components/Card/CardThumbnail.mjs.map +0 -1
  501. package/dist/components/Card/index.mjs +0 -5
  502. package/dist/components/Card/index.mjs.map +0 -1
  503. package/dist/components/Chip/Chip.css.mjs +0 -66
  504. package/dist/components/Chip/Chip.css.mjs.map +0 -1
  505. package/dist/components/Chip/Chip.mjs +0 -31
  506. package/dist/components/Chip/Chip.mjs.map +0 -1
  507. package/dist/components/Chip/Chip.spec.mjs +0 -6
  508. package/dist/components/Chip/Chip.spec.mjs.map +0 -1
  509. package/dist/components/Chip/index.mjs +0 -2
  510. package/dist/components/Chip/index.mjs.map +0 -1
  511. package/dist/components/Confirm/index.mjs +0 -28
  512. package/dist/components/Confirm/index.mjs.map +0 -1
  513. package/dist/components/Dialog/Dialog.css.mjs +0 -24
  514. package/dist/components/Dialog/Dialog.css.mjs.map +0 -1
  515. package/dist/components/Dialog/Dialog.mjs +0 -28
  516. package/dist/components/Dialog/Dialog.mjs.map +0 -1
  517. package/dist/components/Dialog/Dialog.spec.mjs +0 -22
  518. package/dist/components/Dialog/Dialog.spec.mjs.map +0 -1
  519. package/dist/components/Dialog/DialogContent.css.mjs +0 -16
  520. package/dist/components/Dialog/DialogContent.css.mjs.map +0 -1
  521. package/dist/components/Dialog/DialogContent.mjs +0 -24
  522. package/dist/components/Dialog/DialogContent.mjs.map +0 -1
  523. package/dist/components/Dialog/DialogFooter.css.mjs +0 -20
  524. package/dist/components/Dialog/DialogFooter.css.mjs.map +0 -1
  525. package/dist/components/Dialog/DialogFooter.mjs +0 -25
  526. package/dist/components/Dialog/DialogFooter.mjs.map +0 -1
  527. package/dist/components/Dialog/DialogHeader.css.mjs +0 -28
  528. package/dist/components/Dialog/DialogHeader.css.mjs.map +0 -1
  529. package/dist/components/Dialog/DialogHeader.mjs +0 -33
  530. package/dist/components/Dialog/DialogHeader.mjs.map +0 -1
  531. package/dist/components/Dialog/index.mjs +0 -5
  532. package/dist/components/Dialog/index.mjs.map +0 -1
  533. package/dist/components/Navigation/Navigation.spec.mjs +0 -18
  534. package/dist/components/Navigation/Navigation.spec.mjs.map +0 -1
  535. package/dist/components/Navigation/NavigationAside.css.mjs +0 -10
  536. package/dist/components/Navigation/NavigationAside.css.mjs.map +0 -1
  537. package/dist/components/Navigation/NavigationAside.mjs +0 -16
  538. package/dist/components/Navigation/NavigationAside.mjs.map +0 -1
  539. package/dist/components/Navigation/NavigationBar.css.mjs +0 -37
  540. package/dist/components/Navigation/NavigationBar.css.mjs.map +0 -1
  541. package/dist/components/Navigation/NavigationBar.mjs +0 -23
  542. package/dist/components/Navigation/NavigationBar.mjs.map +0 -1
  543. package/dist/components/Navigation/NavigationContainer.css.mjs +0 -13
  544. package/dist/components/Navigation/NavigationContainer.css.mjs.map +0 -1
  545. package/dist/components/Navigation/NavigationContainer.mjs +0 -21
  546. package/dist/components/Navigation/NavigationContainer.mjs.map +0 -1
  547. package/dist/components/Navigation/NavigationDrawer.css.mjs +0 -55
  548. package/dist/components/Navigation/NavigationDrawer.css.mjs.map +0 -1
  549. package/dist/components/Navigation/NavigationDrawer.mjs +0 -58
  550. package/dist/components/Navigation/NavigationDrawer.mjs.map +0 -1
  551. package/dist/components/Navigation/NavigationItem.css.mjs +0 -38
  552. package/dist/components/Navigation/NavigationItem.css.mjs.map +0 -1
  553. package/dist/components/Navigation/NavigationItem.mjs +0 -23
  554. package/dist/components/Navigation/NavigationItem.mjs.map +0 -1
  555. package/dist/components/Navigation/NavigationLogo.css.mjs +0 -8
  556. package/dist/components/Navigation/NavigationLogo.css.mjs.map +0 -1
  557. package/dist/components/Navigation/NavigationLogo.mjs +0 -27
  558. package/dist/components/Navigation/NavigationLogo.mjs.map +0 -1
  559. package/dist/components/Navigation/NavigationMenu.css.mjs +0 -23
  560. package/dist/components/Navigation/NavigationMenu.css.mjs.map +0 -1
  561. package/dist/components/Navigation/NavigationMenu.mjs +0 -23
  562. package/dist/components/Navigation/NavigationMenu.mjs.map +0 -1
  563. package/dist/components/Navigation/index.mjs +0 -8
  564. package/dist/components/Navigation/index.mjs.map +0 -1
  565. package/dist/components/Range/Range.css.mjs +0 -106
  566. package/dist/components/Range/Range.css.mjs.map +0 -1
  567. package/dist/components/Range/Range.mjs +0 -72
  568. package/dist/components/Range/Range.mjs.map +0 -1
  569. package/dist/components/Range/Range.spec.mjs +0 -6
  570. package/dist/components/Range/Range.spec.mjs.map +0 -1
  571. package/dist/components/Range/index.mjs +0 -2
  572. package/dist/components/Range/index.mjs.map +0 -1
  573. package/dist/components/ScrollArea/ScrollArea.css.mjs +0 -40
  574. package/dist/components/ScrollArea/ScrollArea.css.mjs.map +0 -1
  575. package/dist/components/ScrollArea/ScrollArea.mjs +0 -56
  576. package/dist/components/ScrollArea/ScrollArea.mjs.map +0 -1
  577. package/dist/components/ScrollArea/ScrollArea.spec.mjs +0 -6
  578. package/dist/components/ScrollArea/ScrollArea.spec.mjs.map +0 -1
  579. package/dist/components/ScrollArea/index.mjs +0 -2
  580. package/dist/components/ScrollArea/index.mjs.map +0 -1
  581. package/dist/components/Select/Select.css.mjs +0 -24
  582. package/dist/components/Select/Select.css.mjs.map +0 -1
  583. package/dist/components/Select/Select.mjs +0 -81
  584. package/dist/components/Select/Select.mjs.map +0 -1
  585. package/dist/components/Select/Select.spec.mjs +0 -51
  586. package/dist/components/Select/Select.spec.mjs.map +0 -1
  587. package/dist/components/Select/SelectContext.mjs +0 -39
  588. package/dist/components/Select/SelectContext.mjs.map +0 -1
  589. package/dist/components/Select/SelectOption.css.mjs +0 -14
  590. package/dist/components/Select/SelectOption.css.mjs.map +0 -1
  591. package/dist/components/Select/SelectOption.mjs +0 -26
  592. package/dist/components/Select/SelectOption.mjs.map +0 -1
  593. package/dist/components/Select/SelectOptionList.css.mjs +0 -59
  594. package/dist/components/Select/SelectOptionList.css.mjs.map +0 -1
  595. package/dist/components/Select/SelectOptionList.mjs +0 -45
  596. package/dist/components/Select/SelectOptionList.mjs.map +0 -1
  597. package/dist/components/Select/SelectTrigger.css.mjs +0 -65
  598. package/dist/components/Select/SelectTrigger.css.mjs.map +0 -1
  599. package/dist/components/Select/SelectTrigger.mjs +0 -42
  600. package/dist/components/Select/SelectTrigger.mjs.map +0 -1
  601. package/dist/components/Select/index.mjs +0 -3
  602. package/dist/components/Select/index.mjs.map +0 -1
  603. package/dist/components/Skeleton/Skeleton.css.mjs +0 -23
  604. package/dist/components/Skeleton/Skeleton.css.mjs.map +0 -1
  605. package/dist/components/Skeleton/Skeleton.spec.mjs +0 -6
  606. package/dist/components/Skeleton/Skeleton.spec.mjs.map +0 -1
  607. package/dist/components/Skeleton/index.mjs +0 -23
  608. package/dist/components/Skeleton/index.mjs.map +0 -1
  609. package/dist/components/Table/Table.css.mjs +0 -12
  610. package/dist/components/Table/Table.css.mjs.map +0 -1
  611. package/dist/components/Table/Table.mjs +0 -23
  612. package/dist/components/Table/Table.mjs.map +0 -1
  613. package/dist/components/Table/Table.spec.mjs +0 -6
  614. package/dist/components/Table/Table.spec.mjs.map +0 -1
  615. package/dist/components/Table/TableBody.mjs +0 -14
  616. package/dist/components/Table/TableBody.mjs.map +0 -1
  617. package/dist/components/Table/TableCell.css.mjs +0 -36
  618. package/dist/components/Table/TableCell.css.mjs.map +0 -1
  619. package/dist/components/Table/TableCell.mjs +0 -26
  620. package/dist/components/Table/TableCell.mjs.map +0 -1
  621. package/dist/components/Table/TableHead.css.mjs +0 -12
  622. package/dist/components/Table/TableHead.css.mjs.map +0 -1
  623. package/dist/components/Table/TableHead.mjs +0 -26
  624. package/dist/components/Table/TableHead.mjs.map +0 -1
  625. package/dist/components/Table/TableHeader.mjs +0 -14
  626. package/dist/components/Table/TableHeader.mjs.map +0 -1
  627. package/dist/components/Table/TableRow.css.mjs +0 -6
  628. package/dist/components/Table/TableRow.css.mjs.map +0 -1
  629. package/dist/components/Table/TableRow.mjs +0 -22
  630. package/dist/components/Table/TableRow.mjs.map +0 -1
  631. package/dist/components/Table/index.mjs +0 -7
  632. package/dist/components/Table/index.mjs.map +0 -1
  633. package/dist/components/Tabs/Tabs.mjs +0 -26
  634. package/dist/components/Tabs/Tabs.mjs.map +0 -1
  635. package/dist/components/Tabs/Tabs.spec.mjs +0 -41
  636. package/dist/components/Tabs/Tabs.spec.mjs.map +0 -1
  637. package/dist/components/Tabs/TabsContent.mjs +0 -23
  638. package/dist/components/Tabs/TabsContent.mjs.map +0 -1
  639. package/dist/components/Tabs/TabsList.css.mjs +0 -12
  640. package/dist/components/Tabs/TabsList.css.mjs.map +0 -1
  641. package/dist/components/Tabs/TabsList.mjs +0 -23
  642. package/dist/components/Tabs/TabsList.mjs.map +0 -1
  643. package/dist/components/Tabs/TabsProvider.mjs +0 -11
  644. package/dist/components/Tabs/TabsProvider.mjs.map +0 -1
  645. package/dist/components/Tabs/TabsTrigger.css.mjs +0 -33
  646. package/dist/components/Tabs/TabsTrigger.css.mjs.map +0 -1
  647. package/dist/components/Tabs/TabsTrigger.mjs +0 -34
  648. package/dist/components/Tabs/TabsTrigger.mjs.map +0 -1
  649. package/dist/components/Tabs/index.mjs +0 -5
  650. package/dist/components/Tabs/index.mjs.map +0 -1
  651. package/dist/components/TextField/TextField.css.mjs +0 -69
  652. package/dist/components/TextField/TextField.css.mjs.map +0 -1
  653. package/dist/components/TextField/TextField.spec.mjs +0 -6
  654. package/dist/components/TextField/TextField.spec.mjs.map +0 -1
  655. package/dist/components/TextField/index.mjs +0 -31
  656. package/dist/components/TextField/index.mjs.map +0 -1
  657. package/dist/components/Toast/Toast.css.mjs +0 -70
  658. package/dist/components/Toast/Toast.css.mjs.map +0 -1
  659. package/dist/components/Toast/Toast.spec.mjs +0 -6
  660. package/dist/components/Toast/Toast.spec.mjs.map +0 -1
  661. package/dist/components/Toast/index.mjs +0 -45
  662. package/dist/components/Toast/index.mjs.map +0 -1
  663. package/dist/components/Typography/Typography.css.mjs +0 -19
  664. package/dist/components/Typography/Typography.css.mjs.map +0 -1
  665. package/dist/components/Typography/Typography.spec.mjs +0 -29
  666. package/dist/components/Typography/Typography.spec.mjs.map +0 -1
  667. package/dist/components/Typography/index.mjs +0 -41
  668. package/dist/components/Typography/index.mjs.map +0 -1
  669. package/dist/components/index.mjs +0 -19
  670. package/dist/components/index.mjs.map +0 -1
  671. package/dist/contexts/UIProvider.mjs +0 -22
  672. package/dist/contexts/UIProvider.mjs.map +0 -1
  673. package/dist/contexts/index.mjs +0 -2
  674. package/dist/contexts/index.mjs.map +0 -1
  675. package/dist/hooks/index.mjs +0 -6
  676. package/dist/hooks/index.mjs.map +0 -1
  677. package/dist/hooks/useDialog/index.mjs +0 -49
  678. package/dist/hooks/useDialog/index.mjs.map +0 -1
  679. package/dist/hooks/useDialog/useDialog.spec.mjs +0 -59
  680. package/dist/hooks/useDialog/useDialog.spec.mjs.map +0 -1
  681. package/dist/hooks/useMouseScroll/index.mjs +0 -48
  682. package/dist/hooks/useMouseScroll/index.mjs.map +0 -1
  683. package/dist/hooks/usePointerSlider/index.mjs +0 -58
  684. package/dist/hooks/usePointerSlider/index.mjs.map +0 -1
  685. package/dist/hooks/useRipple/index.mjs +0 -116
  686. package/dist/hooks/useRipple/index.mjs.map +0 -1
  687. package/dist/hooks/useRipple/ripple.css.mjs +0 -35
  688. package/dist/hooks/useRipple/ripple.css.mjs.map +0 -1
  689. package/dist/hooks/useToast/ToastContainer.css.mjs +0 -14
  690. package/dist/hooks/useToast/ToastContainer.css.mjs.map +0 -1
  691. package/dist/hooks/useToast/ToastContainer.mjs +0 -9
  692. package/dist/hooks/useToast/ToastContainer.mjs.map +0 -1
  693. package/dist/hooks/useToast/ToastProvider.mjs +0 -99
  694. package/dist/hooks/useToast/ToastProvider.mjs.map +0 -1
  695. package/dist/hooks/useToast/index.mjs +0 -14
  696. package/dist/hooks/useToast/index.mjs.map +0 -1
  697. package/dist/index.mjs +0 -9
  698. package/dist/index.mjs.map +0 -1
  699. package/dist/styles/globalStyle.css.mjs +0 -27
  700. package/dist/styles/globalStyle.css.mjs.map +0 -1
  701. package/dist/styles/index.mjs +0 -5
  702. package/dist/styles/index.mjs.map +0 -1
  703. package/dist/styles/layers.css.mjs +0 -8
  704. package/dist/styles/layers.css.mjs.map +0 -1
  705. package/dist/styles/overlay.css.mjs +0 -37
  706. package/dist/styles/overlay.css.mjs.map +0 -1
  707. package/dist/styles/sprinkles.css.mjs +0 -141
  708. package/dist/styles/sprinkles.css.mjs.map +0 -1
  709. package/dist/styles/sx.mjs +0 -14
  710. package/dist/styles/sx.mjs.map +0 -1
  711. package/dist/tests/uiTest.mjs +0 -49
  712. package/dist/tests/uiTest.mjs.map +0 -1
  713. package/dist/themes/darkTheme.css.mjs +0 -33
  714. package/dist/themes/darkTheme.css.mjs.map +0 -1
  715. package/dist/themes/index.mjs +0 -7
  716. package/dist/themes/index.mjs.map +0 -1
  717. package/dist/themes/lightTheme.css.mjs +0 -33
  718. package/dist/themes/lightTheme.css.mjs.map +0 -1
  719. package/dist/themes/theme.css.mjs +0 -28
  720. package/dist/themes/theme.css.mjs.map +0 -1
  721. package/dist/tokens/index.mjs +0 -14
  722. package/dist/tokens/index.mjs.map +0 -1
  723. package/dist/tokens/scale/color.mjs +0 -606
  724. package/dist/tokens/scale/color.mjs.map +0 -1
  725. package/dist/tokens/semantic/breakpoint.mjs +0 -10
  726. package/dist/tokens/semantic/breakpoint.mjs.map +0 -1
  727. package/dist/tokens/semantic/color.mjs +0 -14
  728. package/dist/tokens/semantic/color.mjs.map +0 -1
  729. package/dist/tokens/semantic/spacing.mjs +0 -13
  730. package/dist/tokens/semantic/spacing.mjs.map +0 -1
  731. package/dist/tokens/semantic/typography.mjs +0 -36
  732. package/dist/tokens/semantic/typography.mjs.map +0 -1
  733. package/dist/types/index.mjs +0 -2
  734. package/dist/types/index.mjs.map +0 -1
  735. package/dist/types/ui.types.mjs +0 -1
  736. package/dist/types/ui.types.mjs.map +0 -1
  737. package/dist/utils/index.mjs +0 -2
  738. package/dist/utils/index.mjs.map +0 -1
  739. package/dist/utils/sprinklesUtils.mjs +0 -24
  740. package/dist/utils/sprinklesUtils.mjs.map +0 -1
  741. package/dist/utils/styleUtils.css.mjs +0 -65
  742. package/dist/utils/styleUtils.css.mjs.map +0 -1
@@ -0,0 +1,1542 @@
1
+ /**
2
+ * @module LRUCache
3
+ */
4
+ const perf = typeof performance === 'object' &&
5
+ performance &&
6
+ typeof performance.now === 'function'
7
+ ? performance
8
+ : Date;
9
+ const warned = new Set();
10
+ /* c8 ignore start */
11
+ const PROCESS = (typeof process === 'object' && !!process ? process : {});
12
+ /* c8 ignore start */
13
+ const emitWarning = (msg, type, code, fn) => {
14
+ typeof PROCESS.emitWarning === 'function'
15
+ ? PROCESS.emitWarning(msg, type, code, fn)
16
+ : console.error(`[${code}] ${type}: ${msg}`);
17
+ };
18
+ let AC = globalThis.AbortController;
19
+ let AS = globalThis.AbortSignal;
20
+ /* c8 ignore start */
21
+ if (typeof AC === 'undefined') {
22
+ //@ts-ignore
23
+ AS = class AbortSignal {
24
+ onabort;
25
+ _onabort = [];
26
+ reason;
27
+ aborted = false;
28
+ addEventListener(_, fn) {
29
+ this._onabort.push(fn);
30
+ }
31
+ };
32
+ //@ts-ignore
33
+ AC = class AbortController {
34
+ constructor() {
35
+ warnACPolyfill();
36
+ }
37
+ signal = new AS();
38
+ abort(reason) {
39
+ if (this.signal.aborted)
40
+ return;
41
+ //@ts-ignore
42
+ this.signal.reason = reason;
43
+ //@ts-ignore
44
+ this.signal.aborted = true;
45
+ //@ts-ignore
46
+ for (const fn of this.signal._onabort) {
47
+ fn(reason);
48
+ }
49
+ this.signal.onabort?.(reason);
50
+ }
51
+ };
52
+ let printACPolyfillWarning = PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1';
53
+ const warnACPolyfill = () => {
54
+ if (!printACPolyfillWarning)
55
+ return;
56
+ printACPolyfillWarning = false;
57
+ emitWarning('AbortController is not defined. If using lru-cache in ' +
58
+ 'node 14, load an AbortController polyfill from the ' +
59
+ '`node-abort-controller` package. A minimal polyfill is ' +
60
+ 'provided for use by LRUCache.fetch(), but it should not be ' +
61
+ 'relied upon in other contexts (eg, passing it to other APIs that ' +
62
+ 'use AbortController/AbortSignal might have undesirable effects). ' +
63
+ 'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.', 'NO_ABORT_CONTROLLER', 'ENOTSUP', warnACPolyfill);
64
+ };
65
+ }
66
+ /* c8 ignore stop */
67
+ const shouldWarn = (code) => !warned.has(code);
68
+ const isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n);
69
+ /* c8 ignore start */
70
+ // This is a little bit ridiculous, tbh.
71
+ // The maximum array length is 2^32-1 or thereabouts on most JS impls.
72
+ // And well before that point, you're caching the entire world, I mean,
73
+ // that's ~32GB of just integers for the next/prev links, plus whatever
74
+ // else to hold that many keys and values. Just filling the memory with
75
+ // zeroes at init time is brutal when you get that big.
76
+ // But why not be complete?
77
+ // Maybe in the future, these limits will have expanded.
78
+ const getUintArray = (max) => !isPosInt(max)
79
+ ? null
80
+ : max <= Math.pow(2, 8)
81
+ ? Uint8Array
82
+ : max <= Math.pow(2, 16)
83
+ ? Uint16Array
84
+ : max <= Math.pow(2, 32)
85
+ ? Uint32Array
86
+ : max <= Number.MAX_SAFE_INTEGER
87
+ ? ZeroArray
88
+ : null;
89
+ /* c8 ignore stop */
90
+ class ZeroArray extends Array {
91
+ constructor(size) {
92
+ super(size);
93
+ this.fill(0);
94
+ }
95
+ }
96
+ class Stack {
97
+ heap;
98
+ length;
99
+ // private constructor
100
+ static #constructing = false;
101
+ static create(max) {
102
+ const HeapCls = getUintArray(max);
103
+ if (!HeapCls)
104
+ return [];
105
+ Stack.#constructing = true;
106
+ const s = new Stack(max, HeapCls);
107
+ Stack.#constructing = false;
108
+ return s;
109
+ }
110
+ constructor(max, HeapCls) {
111
+ /* c8 ignore start */
112
+ if (!Stack.#constructing) {
113
+ throw new TypeError('instantiate Stack using Stack.create(n)');
114
+ }
115
+ /* c8 ignore stop */
116
+ this.heap = new HeapCls(max);
117
+ this.length = 0;
118
+ }
119
+ push(n) {
120
+ this.heap[this.length++] = n;
121
+ }
122
+ pop() {
123
+ return this.heap[--this.length];
124
+ }
125
+ }
126
+ /**
127
+ * Default export, the thing you're using this module to get.
128
+ *
129
+ * The `K` and `V` types define the key and value types, respectively. The
130
+ * optional `FC` type defines the type of the `context` object passed to
131
+ * `cache.fetch()` and `cache.memo()`.
132
+ *
133
+ * Keys and values **must not** be `null` or `undefined`.
134
+ *
135
+ * All properties from the options object (with the exception of `max`,
136
+ * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are
137
+ * added as normal public members. (The listed options are read-only getters.)
138
+ *
139
+ * Changing any of these will alter the defaults for subsequent method calls.
140
+ */
141
+ class LRUCache {
142
+ // options that cannot be changed without disaster
143
+ #max;
144
+ #maxSize;
145
+ #dispose;
146
+ #disposeAfter;
147
+ #fetchMethod;
148
+ #memoMethod;
149
+ /**
150
+ * {@link LRUCache.OptionsBase.ttl}
151
+ */
152
+ ttl;
153
+ /**
154
+ * {@link LRUCache.OptionsBase.ttlResolution}
155
+ */
156
+ ttlResolution;
157
+ /**
158
+ * {@link LRUCache.OptionsBase.ttlAutopurge}
159
+ */
160
+ ttlAutopurge;
161
+ /**
162
+ * {@link LRUCache.OptionsBase.updateAgeOnGet}
163
+ */
164
+ updateAgeOnGet;
165
+ /**
166
+ * {@link LRUCache.OptionsBase.updateAgeOnHas}
167
+ */
168
+ updateAgeOnHas;
169
+ /**
170
+ * {@link LRUCache.OptionsBase.allowStale}
171
+ */
172
+ allowStale;
173
+ /**
174
+ * {@link LRUCache.OptionsBase.noDisposeOnSet}
175
+ */
176
+ noDisposeOnSet;
177
+ /**
178
+ * {@link LRUCache.OptionsBase.noUpdateTTL}
179
+ */
180
+ noUpdateTTL;
181
+ /**
182
+ * {@link LRUCache.OptionsBase.maxEntrySize}
183
+ */
184
+ maxEntrySize;
185
+ /**
186
+ * {@link LRUCache.OptionsBase.sizeCalculation}
187
+ */
188
+ sizeCalculation;
189
+ /**
190
+ * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}
191
+ */
192
+ noDeleteOnFetchRejection;
193
+ /**
194
+ * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}
195
+ */
196
+ noDeleteOnStaleGet;
197
+ /**
198
+ * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}
199
+ */
200
+ allowStaleOnFetchAbort;
201
+ /**
202
+ * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}
203
+ */
204
+ allowStaleOnFetchRejection;
205
+ /**
206
+ * {@link LRUCache.OptionsBase.ignoreFetchAbort}
207
+ */
208
+ ignoreFetchAbort;
209
+ // computed properties
210
+ #size;
211
+ #calculatedSize;
212
+ #keyMap;
213
+ #keyList;
214
+ #valList;
215
+ #next;
216
+ #prev;
217
+ #head;
218
+ #tail;
219
+ #free;
220
+ #disposed;
221
+ #sizes;
222
+ #starts;
223
+ #ttls;
224
+ #hasDispose;
225
+ #hasFetchMethod;
226
+ #hasDisposeAfter;
227
+ /**
228
+ * Do not call this method unless you need to inspect the
229
+ * inner workings of the cache. If anything returned by this
230
+ * object is modified in any way, strange breakage may occur.
231
+ *
232
+ * These fields are private for a reason!
233
+ *
234
+ * @internal
235
+ */
236
+ static unsafeExposeInternals(c) {
237
+ return {
238
+ // properties
239
+ starts: c.#starts,
240
+ ttls: c.#ttls,
241
+ sizes: c.#sizes,
242
+ keyMap: c.#keyMap,
243
+ keyList: c.#keyList,
244
+ valList: c.#valList,
245
+ next: c.#next,
246
+ prev: c.#prev,
247
+ get head() {
248
+ return c.#head;
249
+ },
250
+ get tail() {
251
+ return c.#tail;
252
+ },
253
+ free: c.#free,
254
+ // methods
255
+ isBackgroundFetch: (p) => c.#isBackgroundFetch(p),
256
+ backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context),
257
+ moveToTail: (index) => c.#moveToTail(index),
258
+ indexes: (options) => c.#indexes(options),
259
+ rindexes: (options) => c.#rindexes(options),
260
+ isStale: (index) => c.#isStale(index),
261
+ };
262
+ }
263
+ // Protected read-only members
264
+ /**
265
+ * {@link LRUCache.OptionsBase.max} (read-only)
266
+ */
267
+ get max() {
268
+ return this.#max;
269
+ }
270
+ /**
271
+ * {@link LRUCache.OptionsBase.maxSize} (read-only)
272
+ */
273
+ get maxSize() {
274
+ return this.#maxSize;
275
+ }
276
+ /**
277
+ * The total computed size of items in the cache (read-only)
278
+ */
279
+ get calculatedSize() {
280
+ return this.#calculatedSize;
281
+ }
282
+ /**
283
+ * The number of items stored in the cache (read-only)
284
+ */
285
+ get size() {
286
+ return this.#size;
287
+ }
288
+ /**
289
+ * {@link LRUCache.OptionsBase.fetchMethod} (read-only)
290
+ */
291
+ get fetchMethod() {
292
+ return this.#fetchMethod;
293
+ }
294
+ get memoMethod() {
295
+ return this.#memoMethod;
296
+ }
297
+ /**
298
+ * {@link LRUCache.OptionsBase.dispose} (read-only)
299
+ */
300
+ get dispose() {
301
+ return this.#dispose;
302
+ }
303
+ /**
304
+ * {@link LRUCache.OptionsBase.disposeAfter} (read-only)
305
+ */
306
+ get disposeAfter() {
307
+ return this.#disposeAfter;
308
+ }
309
+ constructor(options) {
310
+ const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, } = options;
311
+ if (max !== 0 && !isPosInt(max)) {
312
+ throw new TypeError('max option must be a nonnegative integer');
313
+ }
314
+ const UintArray = max ? getUintArray(max) : Array;
315
+ if (!UintArray) {
316
+ throw new Error('invalid max value: ' + max);
317
+ }
318
+ this.#max = max;
319
+ this.#maxSize = maxSize;
320
+ this.maxEntrySize = maxEntrySize || this.#maxSize;
321
+ this.sizeCalculation = sizeCalculation;
322
+ if (this.sizeCalculation) {
323
+ if (!this.#maxSize && !this.maxEntrySize) {
324
+ throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize');
325
+ }
326
+ if (typeof this.sizeCalculation !== 'function') {
327
+ throw new TypeError('sizeCalculation set to non-function');
328
+ }
329
+ }
330
+ if (memoMethod !== undefined &&
331
+ typeof memoMethod !== 'function') {
332
+ throw new TypeError('memoMethod must be a function if defined');
333
+ }
334
+ this.#memoMethod = memoMethod;
335
+ if (fetchMethod !== undefined &&
336
+ typeof fetchMethod !== 'function') {
337
+ throw new TypeError('fetchMethod must be a function if specified');
338
+ }
339
+ this.#fetchMethod = fetchMethod;
340
+ this.#hasFetchMethod = !!fetchMethod;
341
+ this.#keyMap = new Map();
342
+ this.#keyList = new Array(max).fill(undefined);
343
+ this.#valList = new Array(max).fill(undefined);
344
+ this.#next = new UintArray(max);
345
+ this.#prev = new UintArray(max);
346
+ this.#head = 0;
347
+ this.#tail = 0;
348
+ this.#free = Stack.create(max);
349
+ this.#size = 0;
350
+ this.#calculatedSize = 0;
351
+ if (typeof dispose === 'function') {
352
+ this.#dispose = dispose;
353
+ }
354
+ if (typeof disposeAfter === 'function') {
355
+ this.#disposeAfter = disposeAfter;
356
+ this.#disposed = [];
357
+ }
358
+ else {
359
+ this.#disposeAfter = undefined;
360
+ this.#disposed = undefined;
361
+ }
362
+ this.#hasDispose = !!this.#dispose;
363
+ this.#hasDisposeAfter = !!this.#disposeAfter;
364
+ this.noDisposeOnSet = !!noDisposeOnSet;
365
+ this.noUpdateTTL = !!noUpdateTTL;
366
+ this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;
367
+ this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;
368
+ this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;
369
+ this.ignoreFetchAbort = !!ignoreFetchAbort;
370
+ // NB: maxEntrySize is set to maxSize if it's set
371
+ if (this.maxEntrySize !== 0) {
372
+ if (this.#maxSize !== 0) {
373
+ if (!isPosInt(this.#maxSize)) {
374
+ throw new TypeError('maxSize must be a positive integer if specified');
375
+ }
376
+ }
377
+ if (!isPosInt(this.maxEntrySize)) {
378
+ throw new TypeError('maxEntrySize must be a positive integer if specified');
379
+ }
380
+ this.#initializeSizeTracking();
381
+ }
382
+ this.allowStale = !!allowStale;
383
+ this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;
384
+ this.updateAgeOnGet = !!updateAgeOnGet;
385
+ this.updateAgeOnHas = !!updateAgeOnHas;
386
+ this.ttlResolution =
387
+ isPosInt(ttlResolution) || ttlResolution === 0
388
+ ? ttlResolution
389
+ : 1;
390
+ this.ttlAutopurge = !!ttlAutopurge;
391
+ this.ttl = ttl || 0;
392
+ if (this.ttl) {
393
+ if (!isPosInt(this.ttl)) {
394
+ throw new TypeError('ttl must be a positive integer if specified');
395
+ }
396
+ this.#initializeTTLTracking();
397
+ }
398
+ // do not allow completely unbounded caches
399
+ if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {
400
+ throw new TypeError('At least one of max, maxSize, or ttl is required');
401
+ }
402
+ if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {
403
+ const code = 'LRU_CACHE_UNBOUNDED';
404
+ if (shouldWarn(code)) {
405
+ warned.add(code);
406
+ const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' +
407
+ 'result in unbounded memory consumption.';
408
+ emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache);
409
+ }
410
+ }
411
+ }
412
+ /**
413
+ * Return the number of ms left in the item's TTL. If item is not in cache,
414
+ * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.
415
+ */
416
+ getRemainingTTL(key) {
417
+ return this.#keyMap.has(key) ? Infinity : 0;
418
+ }
419
+ #initializeTTLTracking() {
420
+ const ttls = new ZeroArray(this.#max);
421
+ const starts = new ZeroArray(this.#max);
422
+ this.#ttls = ttls;
423
+ this.#starts = starts;
424
+ this.#setItemTTL = (index, ttl, start = perf.now()) => {
425
+ starts[index] = ttl !== 0 ? start : 0;
426
+ ttls[index] = ttl;
427
+ if (ttl !== 0 && this.ttlAutopurge) {
428
+ const t = setTimeout(() => {
429
+ if (this.#isStale(index)) {
430
+ this.#delete(this.#keyList[index], 'expire');
431
+ }
432
+ }, ttl + 1);
433
+ // unref() not supported on all platforms
434
+ /* c8 ignore start */
435
+ if (t.unref) {
436
+ t.unref();
437
+ }
438
+ /* c8 ignore stop */
439
+ }
440
+ };
441
+ this.#updateItemAge = index => {
442
+ starts[index] = ttls[index] !== 0 ? perf.now() : 0;
443
+ };
444
+ this.#statusTTL = (status, index) => {
445
+ if (ttls[index]) {
446
+ const ttl = ttls[index];
447
+ const start = starts[index];
448
+ /* c8 ignore next */
449
+ if (!ttl || !start)
450
+ return;
451
+ status.ttl = ttl;
452
+ status.start = start;
453
+ status.now = cachedNow || getNow();
454
+ const age = status.now - start;
455
+ status.remainingTTL = ttl - age;
456
+ }
457
+ };
458
+ // debounce calls to perf.now() to 1s so we're not hitting
459
+ // that costly call repeatedly.
460
+ let cachedNow = 0;
461
+ const getNow = () => {
462
+ const n = perf.now();
463
+ if (this.ttlResolution > 0) {
464
+ cachedNow = n;
465
+ const t = setTimeout(() => (cachedNow = 0), this.ttlResolution);
466
+ // not available on all platforms
467
+ /* c8 ignore start */
468
+ if (t.unref) {
469
+ t.unref();
470
+ }
471
+ /* c8 ignore stop */
472
+ }
473
+ return n;
474
+ };
475
+ this.getRemainingTTL = key => {
476
+ const index = this.#keyMap.get(key);
477
+ if (index === undefined) {
478
+ return 0;
479
+ }
480
+ const ttl = ttls[index];
481
+ const start = starts[index];
482
+ if (!ttl || !start) {
483
+ return Infinity;
484
+ }
485
+ const age = (cachedNow || getNow()) - start;
486
+ return ttl - age;
487
+ };
488
+ this.#isStale = index => {
489
+ const s = starts[index];
490
+ const t = ttls[index];
491
+ return !!t && !!s && (cachedNow || getNow()) - s > t;
492
+ };
493
+ }
494
+ // conditionally set private methods related to TTL
495
+ #updateItemAge = () => { };
496
+ #statusTTL = () => { };
497
+ #setItemTTL = () => { };
498
+ /* c8 ignore stop */
499
+ #isStale = () => false;
500
+ #initializeSizeTracking() {
501
+ const sizes = new ZeroArray(this.#max);
502
+ this.#calculatedSize = 0;
503
+ this.#sizes = sizes;
504
+ this.#removeItemSize = index => {
505
+ this.#calculatedSize -= sizes[index];
506
+ sizes[index] = 0;
507
+ };
508
+ this.#requireSize = (k, v, size, sizeCalculation) => {
509
+ // provisionally accept background fetches.
510
+ // actual value size will be checked when they return.
511
+ if (this.#isBackgroundFetch(v)) {
512
+ return 0;
513
+ }
514
+ if (!isPosInt(size)) {
515
+ if (sizeCalculation) {
516
+ if (typeof sizeCalculation !== 'function') {
517
+ throw new TypeError('sizeCalculation must be a function');
518
+ }
519
+ size = sizeCalculation(v, k);
520
+ if (!isPosInt(size)) {
521
+ throw new TypeError('sizeCalculation return invalid (expect positive integer)');
522
+ }
523
+ }
524
+ else {
525
+ throw new TypeError('invalid size value (must be positive integer). ' +
526
+ 'When maxSize or maxEntrySize is used, sizeCalculation ' +
527
+ 'or size must be set.');
528
+ }
529
+ }
530
+ return size;
531
+ };
532
+ this.#addItemSize = (index, size, status) => {
533
+ sizes[index] = size;
534
+ if (this.#maxSize) {
535
+ const maxSize = this.#maxSize - sizes[index];
536
+ while (this.#calculatedSize > maxSize) {
537
+ this.#evict(true);
538
+ }
539
+ }
540
+ this.#calculatedSize += sizes[index];
541
+ if (status) {
542
+ status.entrySize = size;
543
+ status.totalCalculatedSize = this.#calculatedSize;
544
+ }
545
+ };
546
+ }
547
+ #removeItemSize = _i => { };
548
+ #addItemSize = (_i, _s, _st) => { };
549
+ #requireSize = (_k, _v, size, sizeCalculation) => {
550
+ if (size || sizeCalculation) {
551
+ throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache');
552
+ }
553
+ return 0;
554
+ };
555
+ *#indexes({ allowStale = this.allowStale } = {}) {
556
+ if (this.#size) {
557
+ for (let i = this.#tail; true;) {
558
+ if (!this.#isValidIndex(i)) {
559
+ break;
560
+ }
561
+ if (allowStale || !this.#isStale(i)) {
562
+ yield i;
563
+ }
564
+ if (i === this.#head) {
565
+ break;
566
+ }
567
+ else {
568
+ i = this.#prev[i];
569
+ }
570
+ }
571
+ }
572
+ }
573
+ *#rindexes({ allowStale = this.allowStale } = {}) {
574
+ if (this.#size) {
575
+ for (let i = this.#head; true;) {
576
+ if (!this.#isValidIndex(i)) {
577
+ break;
578
+ }
579
+ if (allowStale || !this.#isStale(i)) {
580
+ yield i;
581
+ }
582
+ if (i === this.#tail) {
583
+ break;
584
+ }
585
+ else {
586
+ i = this.#next[i];
587
+ }
588
+ }
589
+ }
590
+ }
591
+ #isValidIndex(index) {
592
+ return (index !== undefined &&
593
+ this.#keyMap.get(this.#keyList[index]) === index);
594
+ }
595
+ /**
596
+ * Return a generator yielding `[key, value]` pairs,
597
+ * in order from most recently used to least recently used.
598
+ */
599
+ *entries() {
600
+ for (const i of this.#indexes()) {
601
+ if (this.#valList[i] !== undefined &&
602
+ this.#keyList[i] !== undefined &&
603
+ !this.#isBackgroundFetch(this.#valList[i])) {
604
+ yield [this.#keyList[i], this.#valList[i]];
605
+ }
606
+ }
607
+ }
608
+ /**
609
+ * Inverse order version of {@link LRUCache.entries}
610
+ *
611
+ * Return a generator yielding `[key, value]` pairs,
612
+ * in order from least recently used to most recently used.
613
+ */
614
+ *rentries() {
615
+ for (const i of this.#rindexes()) {
616
+ if (this.#valList[i] !== undefined &&
617
+ this.#keyList[i] !== undefined &&
618
+ !this.#isBackgroundFetch(this.#valList[i])) {
619
+ yield [this.#keyList[i], this.#valList[i]];
620
+ }
621
+ }
622
+ }
623
+ /**
624
+ * Return a generator yielding the keys in the cache,
625
+ * in order from most recently used to least recently used.
626
+ */
627
+ *keys() {
628
+ for (const i of this.#indexes()) {
629
+ const k = this.#keyList[i];
630
+ if (k !== undefined &&
631
+ !this.#isBackgroundFetch(this.#valList[i])) {
632
+ yield k;
633
+ }
634
+ }
635
+ }
636
+ /**
637
+ * Inverse order version of {@link LRUCache.keys}
638
+ *
639
+ * Return a generator yielding the keys in the cache,
640
+ * in order from least recently used to most recently used.
641
+ */
642
+ *rkeys() {
643
+ for (const i of this.#rindexes()) {
644
+ const k = this.#keyList[i];
645
+ if (k !== undefined &&
646
+ !this.#isBackgroundFetch(this.#valList[i])) {
647
+ yield k;
648
+ }
649
+ }
650
+ }
651
+ /**
652
+ * Return a generator yielding the values in the cache,
653
+ * in order from most recently used to least recently used.
654
+ */
655
+ *values() {
656
+ for (const i of this.#indexes()) {
657
+ const v = this.#valList[i];
658
+ if (v !== undefined &&
659
+ !this.#isBackgroundFetch(this.#valList[i])) {
660
+ yield this.#valList[i];
661
+ }
662
+ }
663
+ }
664
+ /**
665
+ * Inverse order version of {@link LRUCache.values}
666
+ *
667
+ * Return a generator yielding the values in the cache,
668
+ * in order from least recently used to most recently used.
669
+ */
670
+ *rvalues() {
671
+ for (const i of this.#rindexes()) {
672
+ const v = this.#valList[i];
673
+ if (v !== undefined &&
674
+ !this.#isBackgroundFetch(this.#valList[i])) {
675
+ yield this.#valList[i];
676
+ }
677
+ }
678
+ }
679
+ /**
680
+ * Iterating over the cache itself yields the same results as
681
+ * {@link LRUCache.entries}
682
+ */
683
+ [Symbol.iterator]() {
684
+ return this.entries();
685
+ }
686
+ /**
687
+ * A String value that is used in the creation of the default string
688
+ * description of an object. Called by the built-in method
689
+ * `Object.prototype.toString`.
690
+ */
691
+ [Symbol.toStringTag] = 'LRUCache';
692
+ /**
693
+ * Find a value for which the supplied fn method returns a truthy value,
694
+ * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.
695
+ */
696
+ find(fn, getOptions = {}) {
697
+ for (const i of this.#indexes()) {
698
+ const v = this.#valList[i];
699
+ const value = this.#isBackgroundFetch(v)
700
+ ? v.__staleWhileFetching
701
+ : v;
702
+ if (value === undefined)
703
+ continue;
704
+ if (fn(value, this.#keyList[i], this)) {
705
+ return this.get(this.#keyList[i], getOptions);
706
+ }
707
+ }
708
+ }
709
+ /**
710
+ * Call the supplied function on each item in the cache, in order from most
711
+ * recently used to least recently used.
712
+ *
713
+ * `fn` is called as `fn(value, key, cache)`.
714
+ *
715
+ * If `thisp` is provided, function will be called in the `this`-context of
716
+ * the provided object, or the cache if no `thisp` object is provided.
717
+ *
718
+ * Does not update age or recenty of use, or iterate over stale values.
719
+ */
720
+ forEach(fn, thisp = this) {
721
+ for (const i of this.#indexes()) {
722
+ const v = this.#valList[i];
723
+ const value = this.#isBackgroundFetch(v)
724
+ ? v.__staleWhileFetching
725
+ : v;
726
+ if (value === undefined)
727
+ continue;
728
+ fn.call(thisp, value, this.#keyList[i], this);
729
+ }
730
+ }
731
+ /**
732
+ * The same as {@link LRUCache.forEach} but items are iterated over in
733
+ * reverse order. (ie, less recently used items are iterated over first.)
734
+ */
735
+ rforEach(fn, thisp = this) {
736
+ for (const i of this.#rindexes()) {
737
+ const v = this.#valList[i];
738
+ const value = this.#isBackgroundFetch(v)
739
+ ? v.__staleWhileFetching
740
+ : v;
741
+ if (value === undefined)
742
+ continue;
743
+ fn.call(thisp, value, this.#keyList[i], this);
744
+ }
745
+ }
746
+ /**
747
+ * Delete any stale entries. Returns true if anything was removed,
748
+ * false otherwise.
749
+ */
750
+ purgeStale() {
751
+ let deleted = false;
752
+ for (const i of this.#rindexes({ allowStale: true })) {
753
+ if (this.#isStale(i)) {
754
+ this.#delete(this.#keyList[i], 'expire');
755
+ deleted = true;
756
+ }
757
+ }
758
+ return deleted;
759
+ }
760
+ /**
761
+ * Get the extended info about a given entry, to get its value, size, and
762
+ * TTL info simultaneously. Returns `undefined` if the key is not present.
763
+ *
764
+ * Unlike {@link LRUCache#dump}, which is designed to be portable and survive
765
+ * serialization, the `start` value is always the current timestamp, and the
766
+ * `ttl` is a calculated remaining time to live (negative if expired).
767
+ *
768
+ * Always returns stale values, if their info is found in the cache, so be
769
+ * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})
770
+ * if relevant.
771
+ */
772
+ info(key) {
773
+ const i = this.#keyMap.get(key);
774
+ if (i === undefined)
775
+ return undefined;
776
+ const v = this.#valList[i];
777
+ const value = this.#isBackgroundFetch(v)
778
+ ? v.__staleWhileFetching
779
+ : v;
780
+ if (value === undefined)
781
+ return undefined;
782
+ const entry = { value };
783
+ if (this.#ttls && this.#starts) {
784
+ const ttl = this.#ttls[i];
785
+ const start = this.#starts[i];
786
+ if (ttl && start) {
787
+ const remain = ttl - (perf.now() - start);
788
+ entry.ttl = remain;
789
+ entry.start = Date.now();
790
+ }
791
+ }
792
+ if (this.#sizes) {
793
+ entry.size = this.#sizes[i];
794
+ }
795
+ return entry;
796
+ }
797
+ /**
798
+ * Return an array of [key, {@link LRUCache.Entry}] tuples which can be
799
+ * passed to {@link LRLUCache#load}.
800
+ *
801
+ * The `start` fields are calculated relative to a portable `Date.now()`
802
+ * timestamp, even if `performance.now()` is available.
803
+ *
804
+ * Stale entries are always included in the `dump`, even if
805
+ * {@link LRUCache.OptionsBase.allowStale} is false.
806
+ *
807
+ * Note: this returns an actual array, not a generator, so it can be more
808
+ * easily passed around.
809
+ */
810
+ dump() {
811
+ const arr = [];
812
+ for (const i of this.#indexes({ allowStale: true })) {
813
+ const key = this.#keyList[i];
814
+ const v = this.#valList[i];
815
+ const value = this.#isBackgroundFetch(v)
816
+ ? v.__staleWhileFetching
817
+ : v;
818
+ if (value === undefined || key === undefined)
819
+ continue;
820
+ const entry = { value };
821
+ if (this.#ttls && this.#starts) {
822
+ entry.ttl = this.#ttls[i];
823
+ // always dump the start relative to a portable timestamp
824
+ // it's ok for this to be a bit slow, it's a rare operation.
825
+ const age = perf.now() - this.#starts[i];
826
+ entry.start = Math.floor(Date.now() - age);
827
+ }
828
+ if (this.#sizes) {
829
+ entry.size = this.#sizes[i];
830
+ }
831
+ arr.unshift([key, entry]);
832
+ }
833
+ return arr;
834
+ }
835
+ /**
836
+ * Reset the cache and load in the items in entries in the order listed.
837
+ *
838
+ * The shape of the resulting cache may be different if the same options are
839
+ * not used in both caches.
840
+ *
841
+ * The `start` fields are assumed to be calculated relative to a portable
842
+ * `Date.now()` timestamp, even if `performance.now()` is available.
843
+ */
844
+ load(arr) {
845
+ this.clear();
846
+ for (const [key, entry] of arr) {
847
+ if (entry.start) {
848
+ // entry.start is a portable timestamp, but we may be using
849
+ // node's performance.now(), so calculate the offset, so that
850
+ // we get the intended remaining TTL, no matter how long it's
851
+ // been on ice.
852
+ //
853
+ // it's ok for this to be a bit slow, it's a rare operation.
854
+ const age = Date.now() - entry.start;
855
+ entry.start = perf.now() - age;
856
+ }
857
+ this.set(key, entry.value, entry);
858
+ }
859
+ }
860
+ /**
861
+ * Add a value to the cache.
862
+ *
863
+ * Note: if `undefined` is specified as a value, this is an alias for
864
+ * {@link LRUCache#delete}
865
+ *
866
+ * Fields on the {@link LRUCache.SetOptions} options param will override
867
+ * their corresponding values in the constructor options for the scope
868
+ * of this single `set()` operation.
869
+ *
870
+ * If `start` is provided, then that will set the effective start
871
+ * time for the TTL calculation. Note that this must be a previous
872
+ * value of `performance.now()` if supported, or a previous value of
873
+ * `Date.now()` if not.
874
+ *
875
+ * Options object may also include `size`, which will prevent
876
+ * calling the `sizeCalculation` function and just use the specified
877
+ * number if it is a positive integer, and `noDisposeOnSet` which
878
+ * will prevent calling a `dispose` function in the case of
879
+ * overwrites.
880
+ *
881
+ * If the `size` (or return value of `sizeCalculation`) for a given
882
+ * entry is greater than `maxEntrySize`, then the item will not be
883
+ * added to the cache.
884
+ *
885
+ * Will update the recency of the entry.
886
+ *
887
+ * If the value is `undefined`, then this is an alias for
888
+ * `cache.delete(key)`. `undefined` is never stored in the cache.
889
+ */
890
+ set(k, v, setOptions = {}) {
891
+ if (v === undefined) {
892
+ this.delete(k);
893
+ return this;
894
+ }
895
+ const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions;
896
+ let { noUpdateTTL = this.noUpdateTTL } = setOptions;
897
+ const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation);
898
+ // if the item doesn't fit, don't do anything
899
+ // NB: maxEntrySize set to maxSize by default
900
+ if (this.maxEntrySize && size > this.maxEntrySize) {
901
+ if (status) {
902
+ status.set = 'miss';
903
+ status.maxEntrySizeExceeded = true;
904
+ }
905
+ // have to delete, in case something is there already.
906
+ this.#delete(k, 'set');
907
+ return this;
908
+ }
909
+ let index = this.#size === 0 ? undefined : this.#keyMap.get(k);
910
+ if (index === undefined) {
911
+ // addition
912
+ index = (this.#size === 0
913
+ ? this.#tail
914
+ : this.#free.length !== 0
915
+ ? this.#free.pop()
916
+ : this.#size === this.#max
917
+ ? this.#evict(false)
918
+ : this.#size);
919
+ this.#keyList[index] = k;
920
+ this.#valList[index] = v;
921
+ this.#keyMap.set(k, index);
922
+ this.#next[this.#tail] = index;
923
+ this.#prev[index] = this.#tail;
924
+ this.#tail = index;
925
+ this.#size++;
926
+ this.#addItemSize(index, size, status);
927
+ if (status)
928
+ status.set = 'add';
929
+ noUpdateTTL = false;
930
+ }
931
+ else {
932
+ // update
933
+ this.#moveToTail(index);
934
+ const oldVal = this.#valList[index];
935
+ if (v !== oldVal) {
936
+ if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {
937
+ oldVal.__abortController.abort(new Error('replaced'));
938
+ const { __staleWhileFetching: s } = oldVal;
939
+ if (s !== undefined && !noDisposeOnSet) {
940
+ if (this.#hasDispose) {
941
+ this.#dispose?.(s, k, 'set');
942
+ }
943
+ if (this.#hasDisposeAfter) {
944
+ this.#disposed?.push([s, k, 'set']);
945
+ }
946
+ }
947
+ }
948
+ else if (!noDisposeOnSet) {
949
+ if (this.#hasDispose) {
950
+ this.#dispose?.(oldVal, k, 'set');
951
+ }
952
+ if (this.#hasDisposeAfter) {
953
+ this.#disposed?.push([oldVal, k, 'set']);
954
+ }
955
+ }
956
+ this.#removeItemSize(index);
957
+ this.#addItemSize(index, size, status);
958
+ this.#valList[index] = v;
959
+ if (status) {
960
+ status.set = 'replace';
961
+ const oldValue = oldVal && this.#isBackgroundFetch(oldVal)
962
+ ? oldVal.__staleWhileFetching
963
+ : oldVal;
964
+ if (oldValue !== undefined)
965
+ status.oldValue = oldValue;
966
+ }
967
+ }
968
+ else if (status) {
969
+ status.set = 'update';
970
+ }
971
+ }
972
+ if (ttl !== 0 && !this.#ttls) {
973
+ this.#initializeTTLTracking();
974
+ }
975
+ if (this.#ttls) {
976
+ if (!noUpdateTTL) {
977
+ this.#setItemTTL(index, ttl, start);
978
+ }
979
+ if (status)
980
+ this.#statusTTL(status, index);
981
+ }
982
+ if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {
983
+ const dt = this.#disposed;
984
+ let task;
985
+ while ((task = dt?.shift())) {
986
+ this.#disposeAfter?.(...task);
987
+ }
988
+ }
989
+ return this;
990
+ }
991
+ /**
992
+ * Evict the least recently used item, returning its value or
993
+ * `undefined` if cache is empty.
994
+ */
995
+ pop() {
996
+ try {
997
+ while (this.#size) {
998
+ const val = this.#valList[this.#head];
999
+ this.#evict(true);
1000
+ if (this.#isBackgroundFetch(val)) {
1001
+ if (val.__staleWhileFetching) {
1002
+ return val.__staleWhileFetching;
1003
+ }
1004
+ }
1005
+ else if (val !== undefined) {
1006
+ return val;
1007
+ }
1008
+ }
1009
+ }
1010
+ finally {
1011
+ if (this.#hasDisposeAfter && this.#disposed) {
1012
+ const dt = this.#disposed;
1013
+ let task;
1014
+ while ((task = dt?.shift())) {
1015
+ this.#disposeAfter?.(...task);
1016
+ }
1017
+ }
1018
+ }
1019
+ }
1020
+ #evict(free) {
1021
+ const head = this.#head;
1022
+ const k = this.#keyList[head];
1023
+ const v = this.#valList[head];
1024
+ if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {
1025
+ v.__abortController.abort(new Error('evicted'));
1026
+ }
1027
+ else if (this.#hasDispose || this.#hasDisposeAfter) {
1028
+ if (this.#hasDispose) {
1029
+ this.#dispose?.(v, k, 'evict');
1030
+ }
1031
+ if (this.#hasDisposeAfter) {
1032
+ this.#disposed?.push([v, k, 'evict']);
1033
+ }
1034
+ }
1035
+ this.#removeItemSize(head);
1036
+ // if we aren't about to use the index, then null these out
1037
+ if (free) {
1038
+ this.#keyList[head] = undefined;
1039
+ this.#valList[head] = undefined;
1040
+ this.#free.push(head);
1041
+ }
1042
+ if (this.#size === 1) {
1043
+ this.#head = this.#tail = 0;
1044
+ this.#free.length = 0;
1045
+ }
1046
+ else {
1047
+ this.#head = this.#next[head];
1048
+ }
1049
+ this.#keyMap.delete(k);
1050
+ this.#size--;
1051
+ return head;
1052
+ }
1053
+ /**
1054
+ * Check if a key is in the cache, without updating the recency of use.
1055
+ * Will return false if the item is stale, even though it is technically
1056
+ * in the cache.
1057
+ *
1058
+ * Check if a key is in the cache, without updating the recency of
1059
+ * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set
1060
+ * to `true` in either the options or the constructor.
1061
+ *
1062
+ * Will return `false` if the item is stale, even though it is technically in
1063
+ * the cache. The difference can be determined (if it matters) by using a
1064
+ * `status` argument, and inspecting the `has` field.
1065
+ *
1066
+ * Will not update item age unless
1067
+ * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.
1068
+ */
1069
+ has(k, hasOptions = {}) {
1070
+ const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;
1071
+ const index = this.#keyMap.get(k);
1072
+ if (index !== undefined) {
1073
+ const v = this.#valList[index];
1074
+ if (this.#isBackgroundFetch(v) &&
1075
+ v.__staleWhileFetching === undefined) {
1076
+ return false;
1077
+ }
1078
+ if (!this.#isStale(index)) {
1079
+ if (updateAgeOnHas) {
1080
+ this.#updateItemAge(index);
1081
+ }
1082
+ if (status) {
1083
+ status.has = 'hit';
1084
+ this.#statusTTL(status, index);
1085
+ }
1086
+ return true;
1087
+ }
1088
+ else if (status) {
1089
+ status.has = 'stale';
1090
+ this.#statusTTL(status, index);
1091
+ }
1092
+ }
1093
+ else if (status) {
1094
+ status.has = 'miss';
1095
+ }
1096
+ return false;
1097
+ }
1098
+ /**
1099
+ * Like {@link LRUCache#get} but doesn't update recency or delete stale
1100
+ * items.
1101
+ *
1102
+ * Returns `undefined` if the item is stale, unless
1103
+ * {@link LRUCache.OptionsBase.allowStale} is set.
1104
+ */
1105
+ peek(k, peekOptions = {}) {
1106
+ const { allowStale = this.allowStale } = peekOptions;
1107
+ const index = this.#keyMap.get(k);
1108
+ if (index === undefined ||
1109
+ (!allowStale && this.#isStale(index))) {
1110
+ return;
1111
+ }
1112
+ const v = this.#valList[index];
1113
+ // either stale and allowed, or forcing a refresh of non-stale value
1114
+ return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
1115
+ }
1116
+ #backgroundFetch(k, index, options, context) {
1117
+ const v = index === undefined ? undefined : this.#valList[index];
1118
+ if (this.#isBackgroundFetch(v)) {
1119
+ return v;
1120
+ }
1121
+ const ac = new AC();
1122
+ const { signal } = options;
1123
+ // when/if our AC signals, then stop listening to theirs.
1124
+ signal?.addEventListener('abort', () => ac.abort(signal.reason), {
1125
+ signal: ac.signal,
1126
+ });
1127
+ const fetchOpts = {
1128
+ signal: ac.signal,
1129
+ options,
1130
+ context,
1131
+ };
1132
+ const cb = (v, updateCache = false) => {
1133
+ const { aborted } = ac.signal;
1134
+ const ignoreAbort = options.ignoreFetchAbort && v !== undefined;
1135
+ if (options.status) {
1136
+ if (aborted && !updateCache) {
1137
+ options.status.fetchAborted = true;
1138
+ options.status.fetchError = ac.signal.reason;
1139
+ if (ignoreAbort)
1140
+ options.status.fetchAbortIgnored = true;
1141
+ }
1142
+ else {
1143
+ options.status.fetchResolved = true;
1144
+ }
1145
+ }
1146
+ if (aborted && !ignoreAbort && !updateCache) {
1147
+ return fetchFail(ac.signal.reason);
1148
+ }
1149
+ // either we didn't abort, and are still here, or we did, and ignored
1150
+ const bf = p;
1151
+ if (this.#valList[index] === p) {
1152
+ if (v === undefined) {
1153
+ if (bf.__staleWhileFetching) {
1154
+ this.#valList[index] = bf.__staleWhileFetching;
1155
+ }
1156
+ else {
1157
+ this.#delete(k, 'fetch');
1158
+ }
1159
+ }
1160
+ else {
1161
+ if (options.status)
1162
+ options.status.fetchUpdated = true;
1163
+ this.set(k, v, fetchOpts.options);
1164
+ }
1165
+ }
1166
+ return v;
1167
+ };
1168
+ const eb = (er) => {
1169
+ if (options.status) {
1170
+ options.status.fetchRejected = true;
1171
+ options.status.fetchError = er;
1172
+ }
1173
+ return fetchFail(er);
1174
+ };
1175
+ const fetchFail = (er) => {
1176
+ const { aborted } = ac.signal;
1177
+ const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;
1178
+ const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
1179
+ const noDelete = allowStale || options.noDeleteOnFetchRejection;
1180
+ const bf = p;
1181
+ if (this.#valList[index] === p) {
1182
+ // if we allow stale on fetch rejections, then we need to ensure that
1183
+ // the stale value is not removed from the cache when the fetch fails.
1184
+ const del = !noDelete || bf.__staleWhileFetching === undefined;
1185
+ if (del) {
1186
+ this.#delete(k, 'fetch');
1187
+ }
1188
+ else if (!allowStaleAborted) {
1189
+ // still replace the *promise* with the stale value,
1190
+ // since we are done with the promise at this point.
1191
+ // leave it untouched if we're still waiting for an
1192
+ // aborted background fetch that hasn't yet returned.
1193
+ this.#valList[index] = bf.__staleWhileFetching;
1194
+ }
1195
+ }
1196
+ if (allowStale) {
1197
+ if (options.status && bf.__staleWhileFetching !== undefined) {
1198
+ options.status.returnedStale = true;
1199
+ }
1200
+ return bf.__staleWhileFetching;
1201
+ }
1202
+ else if (bf.__returned === bf) {
1203
+ throw er;
1204
+ }
1205
+ };
1206
+ const pcall = (res, rej) => {
1207
+ const fmp = this.#fetchMethod?.(k, v, fetchOpts);
1208
+ if (fmp && fmp instanceof Promise) {
1209
+ fmp.then(v => res(v === undefined ? undefined : v), rej);
1210
+ }
1211
+ // ignored, we go until we finish, regardless.
1212
+ // defer check until we are actually aborting,
1213
+ // so fetchMethod can override.
1214
+ ac.signal.addEventListener('abort', () => {
1215
+ if (!options.ignoreFetchAbort ||
1216
+ options.allowStaleOnFetchAbort) {
1217
+ res(undefined);
1218
+ // when it eventually resolves, update the cache.
1219
+ if (options.allowStaleOnFetchAbort) {
1220
+ res = v => cb(v, true);
1221
+ }
1222
+ }
1223
+ });
1224
+ };
1225
+ if (options.status)
1226
+ options.status.fetchDispatched = true;
1227
+ const p = new Promise(pcall).then(cb, eb);
1228
+ const bf = Object.assign(p, {
1229
+ __abortController: ac,
1230
+ __staleWhileFetching: v,
1231
+ __returned: undefined,
1232
+ });
1233
+ if (index === undefined) {
1234
+ // internal, don't expose status.
1235
+ this.set(k, bf, { ...fetchOpts.options, status: undefined });
1236
+ index = this.#keyMap.get(k);
1237
+ }
1238
+ else {
1239
+ this.#valList[index] = bf;
1240
+ }
1241
+ return bf;
1242
+ }
1243
+ #isBackgroundFetch(p) {
1244
+ if (!this.#hasFetchMethod)
1245
+ return false;
1246
+ const b = p;
1247
+ return (!!b &&
1248
+ b instanceof Promise &&
1249
+ b.hasOwnProperty('__staleWhileFetching') &&
1250
+ b.__abortController instanceof AC);
1251
+ }
1252
+ async fetch(k, fetchOptions = {}) {
1253
+ const {
1254
+ // get options
1255
+ allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet,
1256
+ // set options
1257
+ ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL,
1258
+ // fetch exclusive options
1259
+ noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions;
1260
+ if (!this.#hasFetchMethod) {
1261
+ if (status)
1262
+ status.fetch = 'get';
1263
+ return this.get(k, {
1264
+ allowStale,
1265
+ updateAgeOnGet,
1266
+ noDeleteOnStaleGet,
1267
+ status,
1268
+ });
1269
+ }
1270
+ const options = {
1271
+ allowStale,
1272
+ updateAgeOnGet,
1273
+ noDeleteOnStaleGet,
1274
+ ttl,
1275
+ noDisposeOnSet,
1276
+ size,
1277
+ sizeCalculation,
1278
+ noUpdateTTL,
1279
+ noDeleteOnFetchRejection,
1280
+ allowStaleOnFetchRejection,
1281
+ allowStaleOnFetchAbort,
1282
+ ignoreFetchAbort,
1283
+ status,
1284
+ signal,
1285
+ };
1286
+ let index = this.#keyMap.get(k);
1287
+ if (index === undefined) {
1288
+ if (status)
1289
+ status.fetch = 'miss';
1290
+ const p = this.#backgroundFetch(k, index, options, context);
1291
+ return (p.__returned = p);
1292
+ }
1293
+ else {
1294
+ // in cache, maybe already fetching
1295
+ const v = this.#valList[index];
1296
+ if (this.#isBackgroundFetch(v)) {
1297
+ const stale = allowStale && v.__staleWhileFetching !== undefined;
1298
+ if (status) {
1299
+ status.fetch = 'inflight';
1300
+ if (stale)
1301
+ status.returnedStale = true;
1302
+ }
1303
+ return stale ? v.__staleWhileFetching : (v.__returned = v);
1304
+ }
1305
+ // if we force a refresh, that means do NOT serve the cached value,
1306
+ // unless we are already in the process of refreshing the cache.
1307
+ const isStale = this.#isStale(index);
1308
+ if (!forceRefresh && !isStale) {
1309
+ if (status)
1310
+ status.fetch = 'hit';
1311
+ this.#moveToTail(index);
1312
+ if (updateAgeOnGet) {
1313
+ this.#updateItemAge(index);
1314
+ }
1315
+ if (status)
1316
+ this.#statusTTL(status, index);
1317
+ return v;
1318
+ }
1319
+ // ok, it is stale or a forced refresh, and not already fetching.
1320
+ // refresh the cache.
1321
+ const p = this.#backgroundFetch(k, index, options, context);
1322
+ const hasStale = p.__staleWhileFetching !== undefined;
1323
+ const staleVal = hasStale && allowStale;
1324
+ if (status) {
1325
+ status.fetch = isStale ? 'stale' : 'refresh';
1326
+ if (staleVal && isStale)
1327
+ status.returnedStale = true;
1328
+ }
1329
+ return staleVal ? p.__staleWhileFetching : (p.__returned = p);
1330
+ }
1331
+ }
1332
+ async forceFetch(k, fetchOptions = {}) {
1333
+ const v = await this.fetch(k, fetchOptions);
1334
+ if (v === undefined)
1335
+ throw new Error('fetch() returned undefined');
1336
+ return v;
1337
+ }
1338
+ memo(k, memoOptions = {}) {
1339
+ const memoMethod = this.#memoMethod;
1340
+ if (!memoMethod) {
1341
+ throw new Error('no memoMethod provided to constructor');
1342
+ }
1343
+ const { context, forceRefresh, ...options } = memoOptions;
1344
+ const v = this.get(k, options);
1345
+ if (!forceRefresh && v !== undefined)
1346
+ return v;
1347
+ const vv = memoMethod(k, v, {
1348
+ options,
1349
+ context,
1350
+ });
1351
+ this.set(k, vv, options);
1352
+ return vv;
1353
+ }
1354
+ /**
1355
+ * Return a value from the cache. Will update the recency of the cache
1356
+ * entry found.
1357
+ *
1358
+ * If the key is not found, get() will return `undefined`.
1359
+ */
1360
+ get(k, getOptions = {}) {
1361
+ const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions;
1362
+ const index = this.#keyMap.get(k);
1363
+ if (index !== undefined) {
1364
+ const value = this.#valList[index];
1365
+ const fetching = this.#isBackgroundFetch(value);
1366
+ if (status)
1367
+ this.#statusTTL(status, index);
1368
+ if (this.#isStale(index)) {
1369
+ if (status)
1370
+ status.get = 'stale';
1371
+ // delete only if not an in-flight background fetch
1372
+ if (!fetching) {
1373
+ if (!noDeleteOnStaleGet) {
1374
+ this.#delete(k, 'expire');
1375
+ }
1376
+ if (status && allowStale)
1377
+ status.returnedStale = true;
1378
+ return allowStale ? value : undefined;
1379
+ }
1380
+ else {
1381
+ if (status &&
1382
+ allowStale &&
1383
+ value.__staleWhileFetching !== undefined) {
1384
+ status.returnedStale = true;
1385
+ }
1386
+ return allowStale ? value.__staleWhileFetching : undefined;
1387
+ }
1388
+ }
1389
+ else {
1390
+ if (status)
1391
+ status.get = 'hit';
1392
+ // if we're currently fetching it, we don't actually have it yet
1393
+ // it's not stale, which means this isn't a staleWhileRefetching.
1394
+ // If it's not stale, and fetching, AND has a __staleWhileFetching
1395
+ // value, then that means the user fetched with {forceRefresh:true},
1396
+ // so it's safe to return that value.
1397
+ if (fetching) {
1398
+ return value.__staleWhileFetching;
1399
+ }
1400
+ this.#moveToTail(index);
1401
+ if (updateAgeOnGet) {
1402
+ this.#updateItemAge(index);
1403
+ }
1404
+ return value;
1405
+ }
1406
+ }
1407
+ else if (status) {
1408
+ status.get = 'miss';
1409
+ }
1410
+ }
1411
+ #connect(p, n) {
1412
+ this.#prev[n] = p;
1413
+ this.#next[p] = n;
1414
+ }
1415
+ #moveToTail(index) {
1416
+ // if tail already, nothing to do
1417
+ // if head, move head to next[index]
1418
+ // else
1419
+ // move next[prev[index]] to next[index] (head has no prev)
1420
+ // move prev[next[index]] to prev[index]
1421
+ // prev[index] = tail
1422
+ // next[tail] = index
1423
+ // tail = index
1424
+ if (index !== this.#tail) {
1425
+ if (index === this.#head) {
1426
+ this.#head = this.#next[index];
1427
+ }
1428
+ else {
1429
+ this.#connect(this.#prev[index], this.#next[index]);
1430
+ }
1431
+ this.#connect(this.#tail, index);
1432
+ this.#tail = index;
1433
+ }
1434
+ }
1435
+ /**
1436
+ * Deletes a key out of the cache.
1437
+ *
1438
+ * Returns true if the key was deleted, false otherwise.
1439
+ */
1440
+ delete(k) {
1441
+ return this.#delete(k, 'delete');
1442
+ }
1443
+ #delete(k, reason) {
1444
+ let deleted = false;
1445
+ if (this.#size !== 0) {
1446
+ const index = this.#keyMap.get(k);
1447
+ if (index !== undefined) {
1448
+ deleted = true;
1449
+ if (this.#size === 1) {
1450
+ this.#clear(reason);
1451
+ }
1452
+ else {
1453
+ this.#removeItemSize(index);
1454
+ const v = this.#valList[index];
1455
+ if (this.#isBackgroundFetch(v)) {
1456
+ v.__abortController.abort(new Error('deleted'));
1457
+ }
1458
+ else if (this.#hasDispose || this.#hasDisposeAfter) {
1459
+ if (this.#hasDispose) {
1460
+ this.#dispose?.(v, k, reason);
1461
+ }
1462
+ if (this.#hasDisposeAfter) {
1463
+ this.#disposed?.push([v, k, reason]);
1464
+ }
1465
+ }
1466
+ this.#keyMap.delete(k);
1467
+ this.#keyList[index] = undefined;
1468
+ this.#valList[index] = undefined;
1469
+ if (index === this.#tail) {
1470
+ this.#tail = this.#prev[index];
1471
+ }
1472
+ else if (index === this.#head) {
1473
+ this.#head = this.#next[index];
1474
+ }
1475
+ else {
1476
+ const pi = this.#prev[index];
1477
+ this.#next[pi] = this.#next[index];
1478
+ const ni = this.#next[index];
1479
+ this.#prev[ni] = this.#prev[index];
1480
+ }
1481
+ this.#size--;
1482
+ this.#free.push(index);
1483
+ }
1484
+ }
1485
+ }
1486
+ if (this.#hasDisposeAfter && this.#disposed?.length) {
1487
+ const dt = this.#disposed;
1488
+ let task;
1489
+ while ((task = dt?.shift())) {
1490
+ this.#disposeAfter?.(...task);
1491
+ }
1492
+ }
1493
+ return deleted;
1494
+ }
1495
+ /**
1496
+ * Clear the cache entirely, throwing away all values.
1497
+ */
1498
+ clear() {
1499
+ return this.#clear('delete');
1500
+ }
1501
+ #clear(reason) {
1502
+ for (const index of this.#rindexes({ allowStale: true })) {
1503
+ const v = this.#valList[index];
1504
+ if (this.#isBackgroundFetch(v)) {
1505
+ v.__abortController.abort(new Error('deleted'));
1506
+ }
1507
+ else {
1508
+ const k = this.#keyList[index];
1509
+ if (this.#hasDispose) {
1510
+ this.#dispose?.(v, k, reason);
1511
+ }
1512
+ if (this.#hasDisposeAfter) {
1513
+ this.#disposed?.push([v, k, reason]);
1514
+ }
1515
+ }
1516
+ }
1517
+ this.#keyMap.clear();
1518
+ this.#valList.fill(undefined);
1519
+ this.#keyList.fill(undefined);
1520
+ if (this.#ttls && this.#starts) {
1521
+ this.#ttls.fill(0);
1522
+ this.#starts.fill(0);
1523
+ }
1524
+ if (this.#sizes) {
1525
+ this.#sizes.fill(0);
1526
+ }
1527
+ this.#head = 0;
1528
+ this.#tail = 0;
1529
+ this.#free.length = 0;
1530
+ this.#calculatedSize = 0;
1531
+ this.#size = 0;
1532
+ if (this.#hasDisposeAfter && this.#disposed) {
1533
+ const dt = this.#disposed;
1534
+ let task;
1535
+ while ((task = dt?.shift())) {
1536
+ this.#disposeAfter?.(...task);
1537
+ }
1538
+ }
1539
+ }
1540
+ }
1541
+
1542
+ export { LRUCache };