@forgedevstack/bear 1.1.3 → 1.1.8

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 (356) hide show
  1. package/README.md +19 -0
  2. package/dist/components/ActionIcon/ActionIcon.cjs +1 -0
  3. package/dist/components/ActionIcon/ActionIcon.const.cjs +1 -0
  4. package/dist/components/ActionIcon/ActionIcon.const.d.ts +7 -0
  5. package/dist/components/ActionIcon/ActionIcon.const.js +68 -0
  6. package/dist/components/ActionIcon/ActionIcon.d.ts +4 -0
  7. package/dist/components/ActionIcon/ActionIcon.js +42 -0
  8. package/dist/components/ActionIcon/ActionIcon.types.d.ts +11 -0
  9. package/dist/components/ActionIcon/index.d.ts +2 -0
  10. package/dist/components/Affix/Affix.cjs +1 -0
  11. package/dist/components/Affix/Affix.const.cjs +1 -0
  12. package/dist/components/Affix/Affix.const.d.ts +6 -0
  13. package/dist/components/Affix/Affix.const.js +9 -0
  14. package/dist/components/Affix/Affix.d.ts +4 -0
  15. package/dist/components/Affix/Affix.js +69 -0
  16. package/dist/components/Affix/Affix.types.d.ts +10 -0
  17. package/dist/components/Affix/index.d.ts +2 -0
  18. package/dist/components/Anchor/Anchor.cjs +1 -0
  19. package/dist/components/Anchor/Anchor.const.cjs +1 -0
  20. package/dist/components/Anchor/Anchor.const.d.ts +9 -0
  21. package/dist/components/Anchor/Anchor.const.js +11 -0
  22. package/dist/components/Anchor/Anchor.d.ts +4 -0
  23. package/dist/components/Anchor/Anchor.js +83 -0
  24. package/dist/components/Anchor/Anchor.types.d.ts +16 -0
  25. package/dist/components/Anchor/Anchor.utils.cjs +1 -0
  26. package/dist/components/Anchor/Anchor.utils.d.ts +2 -0
  27. package/dist/components/Anchor/Anchor.utils.js +12 -0
  28. package/dist/components/Anchor/index.d.ts +2 -0
  29. package/dist/components/Autocomplete/Autocomplete.cjs +1 -1
  30. package/dist/components/Autocomplete/Autocomplete.js +60 -67
  31. package/dist/components/Autocomplete/Autocomplete.utils.cjs +1 -0
  32. package/dist/components/Autocomplete/Autocomplete.utils.d.ts +2 -0
  33. package/dist/components/Autocomplete/Autocomplete.utils.js +12 -0
  34. package/dist/components/BackTop/BackTop.cjs +1 -1
  35. package/dist/components/BackTop/BackTop.js +10 -11
  36. package/dist/components/Blockquote/Blockquote.cjs +1 -0
  37. package/dist/components/Blockquote/Blockquote.const.cjs +1 -0
  38. package/dist/components/Blockquote/Blockquote.const.d.ts +5 -0
  39. package/dist/components/Blockquote/Blockquote.const.js +19 -0
  40. package/dist/components/Blockquote/Blockquote.d.ts +4 -0
  41. package/dist/components/Blockquote/Blockquote.js +56 -0
  42. package/dist/components/Blockquote/Blockquote.types.d.ts +9 -0
  43. package/dist/components/Blockquote/index.d.ts +2 -0
  44. package/dist/components/Button/Button.cjs +1 -1
  45. package/dist/components/Button/Button.constants.cjs +2 -2
  46. package/dist/components/Button/Button.constants.d.ts +1 -0
  47. package/dist/components/Button/Button.constants.js +12 -5
  48. package/dist/components/Button/Button.d.ts +0 -27
  49. package/dist/components/Button/Button.js +93 -105
  50. package/dist/components/Button/Button.types.d.ts +1 -0
  51. package/dist/components/Button/Button.utils.cjs +1 -0
  52. package/dist/components/Button/Button.utils.d.ts +2 -0
  53. package/dist/components/Button/Button.utils.js +5 -0
  54. package/dist/components/Button/useSpotlight.cjs +1 -0
  55. package/dist/components/Button/useSpotlight.d.ts +21 -0
  56. package/dist/components/Button/useSpotlight.js +28 -0
  57. package/dist/components/Chart/Chart.cjs +1 -1
  58. package/dist/components/Chart/Chart.const.cjs +1 -0
  59. package/dist/components/Chart/Chart.const.js +21 -0
  60. package/dist/components/Chart/Chart.js +55 -71
  61. package/dist/components/Chart/Chart.utils.cjs +1 -0
  62. package/dist/components/Chart/Chart.utils.js +5 -0
  63. package/dist/components/CheckboxCard/CheckboxCard.cjs +1 -0
  64. package/dist/components/CheckboxCard/CheckboxCard.const.cjs +1 -0
  65. package/dist/components/CheckboxCard/CheckboxCard.const.d.ts +7 -0
  66. package/dist/components/CheckboxCard/CheckboxCard.const.js +22 -0
  67. package/dist/components/CheckboxCard/CheckboxCard.d.ts +5 -0
  68. package/dist/components/CheckboxCard/CheckboxCard.js +132 -0
  69. package/dist/components/CheckboxCard/CheckboxCard.types.d.ts +21 -0
  70. package/dist/components/CheckboxCard/index.d.ts +2 -0
  71. package/dist/components/ColorPicker/ColorPicker.cjs +1 -1
  72. package/dist/components/ColorPicker/ColorPicker.const.cjs +1 -0
  73. package/dist/components/ColorPicker/ColorPicker.const.d.ts +26 -0
  74. package/dist/components/ColorPicker/ColorPicker.const.js +38 -0
  75. package/dist/components/ColorPicker/ColorPicker.js +61 -78
  76. package/dist/components/ColorSwatch/ColorSwatch.cjs +1 -0
  77. package/dist/components/ColorSwatch/ColorSwatch.const.cjs +1 -0
  78. package/dist/components/ColorSwatch/ColorSwatch.const.d.ts +16 -0
  79. package/dist/components/ColorSwatch/ColorSwatch.const.js +19 -0
  80. package/dist/components/ColorSwatch/ColorSwatch.d.ts +5 -0
  81. package/dist/components/ColorSwatch/ColorSwatch.js +92 -0
  82. package/dist/components/ColorSwatch/ColorSwatch.types.d.ts +23 -0
  83. package/dist/components/ColorSwatch/ColorSwatch.utils.cjs +1 -0
  84. package/dist/components/ColorSwatch/ColorSwatch.utils.d.ts +6 -0
  85. package/dist/components/ColorSwatch/ColorSwatch.utils.js +14 -0
  86. package/dist/components/ColorSwatch/index.d.ts +2 -0
  87. package/dist/components/Confetti/Confetti.cjs +1 -1
  88. package/dist/components/Confetti/Confetti.js +37 -34
  89. package/dist/components/ContextMenu/ContextMenu.cjs +1 -0
  90. package/dist/components/ContextMenu/ContextMenu.const.cjs +1 -0
  91. package/dist/components/ContextMenu/ContextMenu.const.d.ts +9 -0
  92. package/dist/components/ContextMenu/ContextMenu.const.js +12 -0
  93. package/dist/components/ContextMenu/ContextMenu.d.ts +4 -0
  94. package/dist/components/ContextMenu/ContextMenu.js +65 -0
  95. package/dist/components/ContextMenu/ContextMenu.types.d.ts +23 -0
  96. package/dist/components/ContextMenu/ContextMenu.utils.cjs +1 -0
  97. package/dist/components/ContextMenu/ContextMenu.utils.d.ts +5 -0
  98. package/dist/components/ContextMenu/ContextMenu.utils.js +4 -0
  99. package/dist/components/ContextMenu/index.d.ts +2 -0
  100. package/dist/components/CountdownTimer/CountdownTimer.cjs +1 -1
  101. package/dist/components/CountdownTimer/CountdownTimer.js +62 -71
  102. package/dist/components/CountdownTimer/CountdownTimer.utils.cjs +1 -0
  103. package/dist/components/CountdownTimer/CountdownTimer.utils.d.ts +3 -0
  104. package/dist/components/CountdownTimer/CountdownTimer.utils.js +16 -0
  105. package/dist/components/DateRangePicker/DateRangePicker.cjs +1 -0
  106. package/dist/components/DateRangePicker/DateRangePicker.const.cjs +1 -0
  107. package/dist/components/DateRangePicker/DateRangePicker.const.d.ts +27 -0
  108. package/dist/components/DateRangePicker/DateRangePicker.const.js +74 -0
  109. package/dist/components/DateRangePicker/DateRangePicker.d.ts +4 -0
  110. package/dist/components/DateRangePicker/DateRangePicker.js +115 -0
  111. package/dist/components/DateRangePicker/DateRangePicker.types.d.ts +26 -0
  112. package/dist/components/DateRangePicker/DateRangePicker.utils.cjs +1 -0
  113. package/dist/components/DateRangePicker/DateRangePicker.utils.d.ts +4 -0
  114. package/dist/components/DateRangePicker/DateRangePicker.utils.js +22 -0
  115. package/dist/components/DateRangePicker/index.d.ts +2 -0
  116. package/dist/components/Descriptions/Descriptions.cjs +1 -0
  117. package/dist/components/Descriptions/Descriptions.const.cjs +1 -0
  118. package/dist/components/Descriptions/Descriptions.const.d.ts +24 -0
  119. package/dist/components/Descriptions/Descriptions.const.js +27 -0
  120. package/dist/components/Descriptions/Descriptions.d.ts +4 -0
  121. package/dist/components/Descriptions/Descriptions.js +65 -0
  122. package/dist/components/Descriptions/Descriptions.types.d.ts +16 -0
  123. package/dist/components/Descriptions/index.d.ts +2 -0
  124. package/dist/components/Dock/Dock.cjs +1 -1
  125. package/dist/components/Dock/Dock.js +38 -43
  126. package/dist/components/Dock/Dock.utils.cjs +1 -0
  127. package/dist/components/Dock/Dock.utils.d.ts +1 -0
  128. package/dist/components/Dock/Dock.utils.js +10 -0
  129. package/dist/components/Dropdown/Dropdown.cjs +1 -1
  130. package/dist/components/Dropdown/Dropdown.js +59 -60
  131. package/dist/components/Fieldset/Fieldset.cjs +1 -0
  132. package/dist/components/Fieldset/Fieldset.const.cjs +1 -0
  133. package/dist/components/Fieldset/Fieldset.const.d.ts +5 -0
  134. package/dist/components/Fieldset/Fieldset.const.js +16 -0
  135. package/dist/components/Fieldset/Fieldset.d.ts +4 -0
  136. package/dist/components/Fieldset/Fieldset.js +47 -0
  137. package/dist/components/Fieldset/Fieldset.types.d.ts +10 -0
  138. package/dist/components/Fieldset/index.d.ts +2 -0
  139. package/dist/components/FileTree/FileTree.cjs +1 -1
  140. package/dist/components/FileTree/FileTree.js +20 -32
  141. package/dist/components/FileTree/FileTree.utils.cjs +1 -0
  142. package/dist/components/FileTree/FileTree.utils.d.ts +4 -0
  143. package/dist/components/FileTree/FileTree.utils.js +15 -0
  144. package/dist/components/GradientText/GradientText.cjs +1 -1
  145. package/dist/components/GradientText/GradientText.js +27 -29
  146. package/dist/components/Icon/icons/bear.cjs +1 -0
  147. package/dist/components/Icon/icons/bear.d.ts +12 -0
  148. package/dist/components/Icon/icons/bear.js +47 -0
  149. package/dist/components/Icon/index.cjs +1 -1
  150. package/dist/components/Icon/index.d.ts +18 -0
  151. package/dist/components/Icon/index.js +17 -15
  152. package/dist/components/ImageGallery/ImageGallery.cjs +1 -0
  153. package/dist/components/ImageGallery/ImageGallery.const.cjs +1 -0
  154. package/dist/components/ImageGallery/ImageGallery.const.d.ts +13 -0
  155. package/dist/components/ImageGallery/ImageGallery.const.js +16 -0
  156. package/dist/components/ImageGallery/ImageGallery.d.ts +4 -0
  157. package/dist/components/ImageGallery/ImageGallery.js +61 -0
  158. package/dist/components/ImageGallery/ImageGallery.types.d.ts +22 -0
  159. package/dist/components/ImageGallery/index.d.ts +2 -0
  160. package/dist/components/Indicator/Indicator.cjs +1 -0
  161. package/dist/components/Indicator/Indicator.const.cjs +1 -0
  162. package/dist/components/Indicator/Indicator.const.d.ts +15 -0
  163. package/dist/components/Indicator/Indicator.const.js +26 -0
  164. package/dist/components/Indicator/Indicator.d.ts +4 -0
  165. package/dist/components/Indicator/Indicator.js +56 -0
  166. package/dist/components/Indicator/Indicator.types.d.ts +16 -0
  167. package/dist/components/Indicator/index.d.ts +2 -0
  168. package/dist/components/InfiniteScroll/InfiniteScroll.cjs +1 -0
  169. package/dist/components/InfiniteScroll/InfiniteScroll.const.cjs +1 -0
  170. package/dist/components/InfiniteScroll/InfiniteScroll.const.d.ts +7 -0
  171. package/dist/components/InfiniteScroll/InfiniteScroll.const.js +9 -0
  172. package/dist/components/InfiniteScroll/InfiniteScroll.d.ts +4 -0
  173. package/dist/components/InfiniteScroll/InfiniteScroll.js +51 -0
  174. package/dist/components/InfiniteScroll/InfiniteScroll.types.d.ts +13 -0
  175. package/dist/components/InfiniteScroll/index.d.ts +2 -0
  176. package/dist/components/Input/Input.cjs +1 -1
  177. package/dist/components/Input/Input.js +99 -66
  178. package/dist/components/Input/Input.types.d.ts +10 -0
  179. package/dist/components/Input/Input.utils.cjs +1 -0
  180. package/dist/components/Input/Input.utils.d.ts +2 -0
  181. package/dist/components/Input/Input.utils.js +15 -0
  182. package/dist/components/Input/index.d.ts +1 -1
  183. package/dist/components/LoadingOverlay/LoadingOverlay.cjs +1 -0
  184. package/dist/components/LoadingOverlay/LoadingOverlay.const.cjs +1 -0
  185. package/dist/components/LoadingOverlay/LoadingOverlay.const.d.ts +6 -0
  186. package/dist/components/LoadingOverlay/LoadingOverlay.const.js +9 -0
  187. package/dist/components/LoadingOverlay/LoadingOverlay.d.ts +4 -0
  188. package/dist/components/LoadingOverlay/LoadingOverlay.js +42 -0
  189. package/dist/components/LoadingOverlay/LoadingOverlay.types.d.ts +11 -0
  190. package/dist/components/LoadingOverlay/index.d.ts +2 -0
  191. package/dist/components/MentionsInput/MentionsInput.cjs +1 -1
  192. package/dist/components/MentionsInput/MentionsInput.js +64 -68
  193. package/dist/components/MentionsInput/MentionsInput.utils.cjs +1 -0
  194. package/dist/components/MentionsInput/MentionsInput.utils.d.ts +2 -0
  195. package/dist/components/MentionsInput/MentionsInput.utils.js +9 -0
  196. package/dist/components/NumberFormatter/NumberFormatter.cjs +1 -0
  197. package/dist/components/NumberFormatter/NumberFormatter.const.cjs +1 -0
  198. package/dist/components/NumberFormatter/NumberFormatter.const.d.ts +5 -0
  199. package/dist/components/NumberFormatter/NumberFormatter.const.js +8 -0
  200. package/dist/components/NumberFormatter/NumberFormatter.d.ts +4 -0
  201. package/dist/components/NumberFormatter/NumberFormatter.js +53 -0
  202. package/dist/components/NumberFormatter/NumberFormatter.types.d.ts +20 -0
  203. package/dist/components/NumberFormatter/NumberFormatter.utils.cjs +1 -0
  204. package/dist/components/NumberFormatter/NumberFormatter.utils.d.ts +2 -0
  205. package/dist/components/NumberFormatter/NumberFormatter.utils.js +19 -0
  206. package/dist/components/NumberFormatter/index.d.ts +2 -0
  207. package/dist/components/PageNav/PageNav.cjs +1 -0
  208. package/dist/components/PageNav/PageNav.const.cjs +1 -0
  209. package/dist/components/PageNav/PageNav.const.d.ts +22 -0
  210. package/dist/components/PageNav/PageNav.const.js +42 -0
  211. package/dist/components/PageNav/PageNav.d.ts +3 -0
  212. package/dist/components/PageNav/PageNav.js +81 -0
  213. package/dist/components/PageNav/PageNav.types.d.ts +17 -0
  214. package/dist/components/PageNav/index.d.ts +2 -0
  215. package/dist/components/Popconfirm/Popconfirm.cjs +1 -0
  216. package/dist/components/Popconfirm/Popconfirm.const.cjs +1 -0
  217. package/dist/components/Popconfirm/Popconfirm.const.d.ts +13 -0
  218. package/dist/components/Popconfirm/Popconfirm.const.js +20 -0
  219. package/dist/components/Popconfirm/Popconfirm.d.ts +4 -0
  220. package/dist/components/Popconfirm/Popconfirm.js +65 -0
  221. package/dist/components/Popconfirm/Popconfirm.types.d.ts +16 -0
  222. package/dist/components/Popconfirm/index.d.ts +2 -0
  223. package/dist/components/Progress/Progress.cjs +1 -1
  224. package/dist/components/Progress/Progress.js +6 -6
  225. package/dist/components/PropsPlayground/PropsPlayground.cjs +1 -0
  226. package/dist/components/PropsPlayground/PropsPlayground.const.cjs +1 -0
  227. package/dist/components/PropsPlayground/PropsPlayground.const.d.ts +11 -0
  228. package/dist/components/PropsPlayground/PropsPlayground.const.js +23 -0
  229. package/dist/components/PropsPlayground/PropsPlayground.d.ts +3 -0
  230. package/dist/components/PropsPlayground/PropsPlayground.js +221 -0
  231. package/dist/components/PropsPlayground/PropsPlayground.types.d.ts +29 -0
  232. package/dist/components/PropsPlayground/PropsPlayground.utils.cjs +1 -0
  233. package/dist/components/PropsPlayground/PropsPlayground.utils.d.ts +2 -0
  234. package/dist/components/PropsPlayground/PropsPlayground.utils.js +9 -0
  235. package/dist/components/PropsPlayground/index.d.ts +2 -0
  236. package/dist/components/RadioCard/RadioCard.cjs +1 -0
  237. package/dist/components/RadioCard/RadioCard.const.cjs +1 -0
  238. package/dist/components/RadioCard/RadioCard.const.d.ts +7 -0
  239. package/dist/components/RadioCard/RadioCard.const.js +22 -0
  240. package/dist/components/RadioCard/RadioCard.d.ts +5 -0
  241. package/dist/components/RadioCard/RadioCard.js +111 -0
  242. package/dist/components/RadioCard/RadioCard.types.d.ts +22 -0
  243. package/dist/components/RadioCard/index.d.ts +2 -0
  244. package/dist/components/Result/Result.cjs +1 -0
  245. package/dist/components/Result/Result.const.cjs +1 -0
  246. package/dist/components/Result/Result.const.d.ts +10 -0
  247. package/dist/components/Result/Result.const.js +20 -0
  248. package/dist/components/Result/Result.d.ts +4 -0
  249. package/dist/components/Result/Result.icons.cjs +1 -0
  250. package/dist/components/Result/Result.icons.d.ts +3 -0
  251. package/dist/components/Result/Result.icons.js +31 -0
  252. package/dist/components/Result/Result.js +35 -0
  253. package/dist/components/Result/Result.types.d.ts +10 -0
  254. package/dist/components/Result/index.d.ts +2 -0
  255. package/dist/components/RingProgress/RingProgress.cjs +1 -0
  256. package/dist/components/RingProgress/RingProgress.const.cjs +1 -0
  257. package/dist/components/RingProgress/RingProgress.const.d.ts +4 -0
  258. package/dist/components/RingProgress/RingProgress.const.js +7 -0
  259. package/dist/components/RingProgress/RingProgress.d.ts +4 -0
  260. package/dist/components/RingProgress/RingProgress.js +67 -0
  261. package/dist/components/RingProgress/RingProgress.types.d.ts +15 -0
  262. package/dist/components/RingProgress/index.d.ts +2 -0
  263. package/dist/components/Select/Select.cjs +1 -1
  264. package/dist/components/Select/Select.js +28 -30
  265. package/dist/components/SignPad/SignPad.cjs +1 -1
  266. package/dist/components/SignPad/SignPad.const.cjs +1 -1
  267. package/dist/components/SignPad/SignPad.const.js +10 -11
  268. package/dist/components/SignPad/SignPad.d.ts +4 -6
  269. package/dist/components/SignPad/SignPad.js +114 -122
  270. package/dist/components/SignPad/SignPad.types.d.ts +2 -2
  271. package/dist/components/Skeleton/Skeleton.cjs +1 -1
  272. package/dist/components/Skeleton/Skeleton.js +89 -94
  273. package/dist/components/Skeleton/Skeleton.utils.cjs +1 -0
  274. package/dist/components/Skeleton/Skeleton.utils.d.ts +1 -0
  275. package/dist/components/Skeleton/Skeleton.utils.js +10 -0
  276. package/dist/components/SliderRange/SliderRange.cjs +1 -1
  277. package/dist/components/SliderRange/SliderRange.js +61 -63
  278. package/dist/components/SliderRange/SliderRange.utils.cjs +1 -0
  279. package/dist/components/SliderRange/SliderRange.utils.d.ts +1 -0
  280. package/dist/components/SliderRange/SliderRange.utils.js +7 -0
  281. package/dist/components/SplitButton/SplitButton.cjs +1 -0
  282. package/dist/components/SplitButton/SplitButton.const.cjs +1 -0
  283. package/dist/components/SplitButton/SplitButton.const.d.ts +25 -0
  284. package/dist/components/SplitButton/SplitButton.const.js +27 -0
  285. package/dist/components/SplitButton/SplitButton.d.ts +4 -0
  286. package/dist/components/SplitButton/SplitButton.js +73 -0
  287. package/dist/components/SplitButton/SplitButton.types.d.ts +21 -0
  288. package/dist/components/SplitButton/index.d.ts +2 -0
  289. package/dist/components/Spoiler/Spoiler.cjs +1 -0
  290. package/dist/components/Spoiler/Spoiler.const.cjs +1 -0
  291. package/dist/components/Spoiler/Spoiler.const.d.ts +6 -0
  292. package/dist/components/Spoiler/Spoiler.const.js +9 -0
  293. package/dist/components/Spoiler/Spoiler.d.ts +4 -0
  294. package/dist/components/Spoiler/Spoiler.js +59 -0
  295. package/dist/components/Spoiler/Spoiler.types.d.ts +10 -0
  296. package/dist/components/Spoiler/index.d.ts +2 -0
  297. package/dist/components/Spotlight/Spotlight.cjs +1 -1
  298. package/dist/components/Spotlight/Spotlight.js +62 -73
  299. package/dist/components/Spotlight/Spotlight.utils.cjs +1 -0
  300. package/dist/components/Spotlight/Spotlight.utils.d.ts +3 -0
  301. package/dist/components/Spotlight/Spotlight.utils.js +18 -0
  302. package/dist/components/Tabs/Tabs.cjs +1 -1
  303. package/dist/components/Tabs/Tabs.js +39 -38
  304. package/dist/components/Tabs/Tabs.types.d.ts +3 -1
  305. package/dist/components/TimePicker/components/TimePickerDialDropdown/TimePickerDialDropdown.cjs +1 -1
  306. package/dist/components/TimePicker/components/TimePickerDialDropdown/TimePickerDialDropdown.js +63 -57
  307. package/dist/components/TimePicker/helpers/ClockFaceSvg.cjs +1 -1
  308. package/dist/components/TimePicker/helpers/ClockFaceSvg.d.ts +0 -7
  309. package/dist/components/TimePicker/helpers/ClockFaceSvg.js +32 -31
  310. package/dist/components/Toast/Toast.cjs +1 -1
  311. package/dist/components/Toast/Toast.js +18 -17
  312. package/dist/components/Toast/Toast.utils.cjs +1 -0
  313. package/dist/components/Toast/Toast.utils.d.ts +1 -0
  314. package/dist/components/Toast/Toast.utils.js +4 -0
  315. package/dist/components/Tooltip/Tooltip.cjs +1 -1
  316. package/dist/components/Tooltip/Tooltip.js +10 -11
  317. package/dist/components/Tour/Tour.cjs +1 -1
  318. package/dist/components/Tour/Tour.js +1 -2
  319. package/dist/components/TreeSelect/TreeSelect.cjs +1 -0
  320. package/dist/components/TreeSelect/TreeSelect.const.cjs +1 -0
  321. package/dist/components/TreeSelect/TreeSelect.const.d.ts +19 -0
  322. package/dist/components/TreeSelect/TreeSelect.const.js +22 -0
  323. package/dist/components/TreeSelect/TreeSelect.d.ts +4 -0
  324. package/dist/components/TreeSelect/TreeSelect.js +128 -0
  325. package/dist/components/TreeSelect/TreeSelect.types.d.ts +25 -0
  326. package/dist/components/TreeSelect/TreeSelect.utils.cjs +1 -0
  327. package/dist/components/TreeSelect/TreeSelect.utils.d.ts +5 -0
  328. package/dist/components/TreeSelect/TreeSelect.utils.js +25 -0
  329. package/dist/components/TreeSelect/index.d.ts +2 -0
  330. package/dist/components/VirtualList/VirtualList.cjs +1 -1
  331. package/dist/components/VirtualList/VirtualList.js +38 -43
  332. package/dist/components/index.cjs +1 -1
  333. package/dist/components/index.d.ts +48 -0
  334. package/dist/components/index.js +351 -300
  335. package/dist/hooks/index.cjs +1 -1
  336. package/dist/hooks/index.d.ts +2 -0
  337. package/dist/hooks/index.js +60 -58
  338. package/dist/hooks/useResizeObserver/index.d.ts +2 -0
  339. package/dist/hooks/useResizeObserver/useResizeObserver.cjs +1 -0
  340. package/dist/hooks/useResizeObserver/useResizeObserver.d.ts +3 -0
  341. package/dist/hooks/useResizeObserver/useResizeObserver.js +20 -0
  342. package/dist/hooks/useResizeObserver/useResizeObserver.types.d.ts +8 -0
  343. package/dist/icons.cjs +1 -0
  344. package/dist/icons.d.ts +2 -0
  345. package/dist/icons.js +6 -0
  346. package/dist/index.cjs +1 -1
  347. package/dist/index.js +443 -390
  348. package/dist/postcss/bear-plugin.cjs +86 -0
  349. package/dist/styles/_alerts.css +14 -0
  350. package/dist/styles/_base.css +60 -0
  351. package/dist/styles/_buttons.css +108 -0
  352. package/dist/styles/_effects.css +90 -0
  353. package/dist/styles/_marquee.css +25 -0
  354. package/dist/styles/main.css +5 -0
  355. package/dist/styles.css +1 -1
  356. package/package.json +15 -3
@@ -0,0 +1,23 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export type SwatchSize = 'sm' | 'md' | 'lg' | 'xl';
3
+ export interface ColorSwatchProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
4
+ color: string;
5
+ selected?: boolean;
6
+ size?: SwatchSize;
7
+ rounded?: boolean;
8
+ label?: string;
9
+ onClick?: () => void;
10
+ testId?: string;
11
+ }
12
+ export interface ColorSwatchGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
13
+ colors: string[];
14
+ value?: string | string[];
15
+ onChange?: (value: string | string[]) => void;
16
+ multiple?: boolean;
17
+ size?: SwatchSize;
18
+ rounded?: boolean;
19
+ gap?: number;
20
+ columns?: number;
21
+ showLabel?: boolean;
22
+ testId?: string;
23
+ }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./ColorSwatch.const.cjs"),l=t=>{const n=t.replace("#","");if(n.length!==3&&n.length!==6)return null;const o=n.length===3?n.split("").map(r=>r+r).join(""):n,e=parseInt(o,16);return{r:e>>16&255,g:e>>8&255,b:e&255}},c=t=>{const n=l(t);return n?n.r*.299+n.g*.587+n.b*.114>s.LIGHT_THRESHOLD:!1};exports.hexToRgb=l;exports.isLightColor=c;
@@ -0,0 +1,6 @@
1
+ export declare const hexToRgb: (hex: string) => {
2
+ r: number;
3
+ g: number;
4
+ b: number;
5
+ } | null;
6
+ export declare const isLightColor: (color: string) => boolean;
@@ -0,0 +1,14 @@
1
+ import { LIGHT_THRESHOLD as o } from "./ColorSwatch.const.js";
2
+ const s = (t) => {
3
+ const n = t.replace("#", "");
4
+ if (n.length !== 3 && n.length !== 6) return null;
5
+ const e = n.length === 3 ? n.split("").map((l) => l + l).join("") : n, r = parseInt(e, 16);
6
+ return { r: r >> 16 & 255, g: r >> 8 & 255, b: r & 255 };
7
+ }, i = (t) => {
8
+ const n = s(t);
9
+ return n ? n.r * 0.299 + n.g * 0.587 + n.b * 0.114 > o : !1;
10
+ };
11
+ export {
12
+ s as hexToRgb,
13
+ i as isLightColor
14
+ };
@@ -0,0 +1,2 @@
1
+ export { ColorSwatch, ColorSwatchGroup } from './ColorSwatch';
2
+ export type { ColorSwatchProps, ColorSwatchGroupProps, SwatchSize } from './ColorSwatch.types';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react/jsx-runtime"),n=require("react"),g=require("../../utils/cn.cjs"),r=require("./Confetti.const.cjs"),v=({active:E=!1,count:c=r.CONFETTI_DEFAULTS.COUNT,duration:h=r.CONFETTI_DEFAULTS.DURATION,colors:T=r.CONFETTI_COLORS,originX:I=r.CONFETTI_DEFAULTS.ORIGIN_X,originY:f=r.CONFETTI_DEFAULTS.ORIGIN_Y,spread:F=r.CONFETTI_DEFAULTS.SPREAD,velocity:S=r.CONFETTI_DEFAULTS.VELOCITY,gravity:O=r.CONFETTI_DEFAULTS.GRAVITY,autoHide:N=r.CONFETTI_DEFAULTS.AUTO_HIDE,onComplete:o,className:x,testId:y})=>{const[m,d]=n.useState([]),[b,A]=n.useState(!1),a=n.useRef(),i=n.useRef(0),_=n.useCallback(()=>{const t=[],l=F*Math.PI/180;for(let s=0;s<c;s++){const e=-Math.PI/2+(Math.random()-.5)*l,C=S*(.5+Math.random()*.5);t.push({id:s,x:I*100,y:f*100,rotation:Math.random()*360,color:T[Math.floor(Math.random()*T.length)],size:r.CONFETTI_SIZE_RANGE.min+Math.random()*(r.CONFETTI_SIZE_RANGE.max-r.CONFETTI_SIZE_RANGE.min),velocity:{x:Math.cos(e)*C,y:Math.sin(e)*C},rotationSpeed:(Math.random()-.5)*20,shape:r.CONFETTI_SHAPES[Math.floor(Math.random()*r.CONFETTI_SHAPES.length)]})}return t},[c,T,I,f,F,S]),u=n.useCallback(t=>{if(i.current||(i.current=t),t-i.current>=h&&N){A(!1),d([]),o==null||o();return}d(s=>s.map(e=>({...e,x:e.x+e.velocity.x*.1,y:e.y+e.velocity.y*.1,rotation:e.rotation+e.rotationSpeed,velocity:{x:e.velocity.x*.99,y:e.velocity.y+O}}))),a.current=requestAnimationFrame(u)},[h,O,N,o]);n.useEffect(()=>(E?(A(!0),d(_()),i.current=0,a.current=requestAnimationFrame(u)):a.current&&cancelAnimationFrame(a.current),()=>{a.current&&cancelAnimationFrame(a.current)}),[E,_,u]);const M=t=>{const l={position:"absolute",left:`${t.x}%`,top:`${t.y}%`,width:t.size,height:t.size,transform:`rotate(${t.rotation}deg)`,backgroundColor:t.shape!=="triangle"?t.color:"transparent",borderRadius:t.shape==="circle"?"50%":0,borderLeft:t.shape==="triangle"?`${t.size/2}px solid transparent`:void 0,borderRight:t.shape==="triangle"?`${t.size/2}px solid transparent`:void 0,borderBottom:t.shape==="triangle"?`${t.size}px solid ${t.color}`:void 0,opacity:.9};return R.jsx("div",{style:l},t.id)};return!b||m.length===0?null:R.jsx("div",{className:g.cn("Bear-Confetti","bear-fixed bear-inset-0 bear-pointer-events-none bear-overflow-hidden",x),style:{zIndex:99999},"data-testid":y,children:m.map(M)})};exports.Confetti=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react/jsx-runtime"),a=require("react"),R=require("../../utils/cn.cjs"),r=require("./Confetti.const.cjs"),v=({active:c=!1,count:E=r.CONFETTI_DEFAULTS.COUNT,duration:h=r.CONFETTI_DEFAULTS.DURATION,colors:T=r.CONFETTI_COLORS,originX:f=r.CONFETTI_DEFAULTS.ORIGIN_X,originY:I=r.CONFETTI_DEFAULTS.ORIGIN_Y,spread:F=r.CONFETTI_DEFAULTS.SPREAD,velocity:S=r.CONFETTI_DEFAULTS.VELOCITY,gravity:N=r.CONFETTI_DEFAULTS.GRAVITY,autoHide:O=r.CONFETTI_DEFAULTS.AUTO_HIDE,onComplete:o,className:x,testId:y})=>{const[m,d]=a.useState([]),[M,A]=a.useState(!1),n=a.useRef(),i=a.useRef(0),_=a.useCallback(()=>{const t=[],l=F*Math.PI/180;for(let s=0;s<E;s++){const e=-Math.PI/2+(Math.random()-.5)*l,b=S*(.5+Math.random()*.5);t.push({id:s,x:f*100,y:I*100,rotation:Math.random()*360,color:T[Math.floor(Math.random()*T.length)],size:r.CONFETTI_SIZE_RANGE.min+Math.random()*(r.CONFETTI_SIZE_RANGE.max-r.CONFETTI_SIZE_RANGE.min),velocity:{x:Math.cos(e)*b,y:Math.sin(e)*b},rotationSpeed:(Math.random()-.5)*20,shape:r.CONFETTI_SHAPES[Math.floor(Math.random()*r.CONFETTI_SHAPES.length)]})}return t},[E,T,f,I,F,S]),u=a.useCallback(t=>{if(i.current||(i.current=t),t-i.current>=h&&O){A(!1),d([]),o==null||o();return}d(s=>s.map(e=>({...e,x:e.x+e.velocity.x*.1,y:e.y+e.velocity.y*.1,rotation:e.rotation+e.rotationSpeed,velocity:{x:e.velocity.x*.99,y:e.velocity.y+N}}))),n.current=requestAnimationFrame(u)},[h,N,O,o]);a.useEffect(()=>(c?(A(!0),d(_()),i.current=0,n.current=requestAnimationFrame(u)):n.current&&cancelAnimationFrame(n.current),()=>{n.current&&cancelAnimationFrame(n.current)}),[c,_,u]);const g=t=>{const l={left:`${t.x}%`,top:`${t.y}%`,width:t.size,height:t.size,transform:`rotate(${t.rotation}deg)`,backgroundColor:t.shape!=="triangle"?t.color:"transparent",borderLeft:t.shape==="triangle"?`${t.size/2}px solid transparent`:void 0,borderRight:t.shape==="triangle"?`${t.size/2}px solid transparent`:void 0,borderBottom:t.shape==="triangle"?`${t.size}px solid ${t.color}`:void 0};return C.jsx("div",{className:R.cn("bear-absolute bear-opacity-90",t.shape==="circle"&&"bear-rounded-full"),style:l},t.id)};return!M||m.length===0?null:C.jsx("div",{className:R.cn("Bear-Confetti","bear-fixed bear-inset-0 bear-pointer-events-none bear-overflow-hidden bear-z-[99999]",x),"data-testid":y,children:m.map(g)})};exports.Confetti=v;
@@ -1,30 +1,30 @@
1
- import { jsx as g } from "react/jsx-runtime";
2
- import { useState as v, useRef as N, useCallback as S, useEffect as C } from "react";
3
- import { cn as D } from "../../utils/cn.js";
4
- import { CONFETTI_DEFAULTS as a, CONFETTI_SHAPES as F, CONFETTI_COLORS as G, CONFETTI_SIZE_RANGE as f } from "./Confetti.const.js";
1
+ import { jsx as N } from "react/jsx-runtime";
2
+ import { useState as g, useRef as v, useCallback as S, useEffect as D } from "react";
3
+ import { cn as F } from "../../utils/cn.js";
4
+ import { CONFETTI_DEFAULTS as a, CONFETTI_SHAPES as _, CONFETTI_COLORS as G, CONFETTI_SIZE_RANGE as f } from "./Confetti.const.js";
5
5
  const k = ({
6
6
  active: m = !1,
7
7
  count: u = a.COUNT,
8
8
  duration: c = a.DURATION,
9
9
  colors: l = G,
10
- originX: I = a.ORIGIN_X,
11
- originY: x = a.ORIGIN_Y,
12
- spread: y = a.SPREAD,
10
+ originX: b = a.ORIGIN_X,
11
+ originY: I = a.ORIGIN_Y,
12
+ spread: x = a.SPREAD,
13
13
  velocity: T = a.VELOCITY,
14
- gravity: b = a.GRAVITY,
14
+ gravity: y = a.GRAVITY,
15
15
  autoHide: M = a.AUTO_HIDE,
16
16
  onComplete: o,
17
- className: _,
18
- testId: z
17
+ className: z,
18
+ testId: P
19
19
  }) => {
20
- const [R, d] = v([]), [P, E] = v(!1), n = N(), s = N(0), O = S(() => {
21
- const t = [], i = y * Math.PI / 180;
20
+ const [E, d] = g([]), [$, O] = g(!1), n = v(), s = v(0), R = S(() => {
21
+ const t = [], i = x * Math.PI / 180;
22
22
  for (let e = 0; e < u; e++) {
23
23
  const r = -Math.PI / 2 + (Math.random() - 0.5) * i, A = T * (0.5 + Math.random() * 0.5);
24
24
  t.push({
25
25
  id: e,
26
- x: I * 100,
27
- y: x * 100,
26
+ x: b * 100,
27
+ y: I * 100,
28
28
  rotation: Math.random() * 360,
29
29
  color: l[Math.floor(Math.random() * l.length)],
30
30
  size: f.min + Math.random() * (f.max - f.min),
@@ -33,13 +33,13 @@ const k = ({
33
33
  y: Math.sin(r) * A
34
34
  },
35
35
  rotationSpeed: (Math.random() - 0.5) * 20,
36
- shape: F[Math.floor(Math.random() * F.length)]
36
+ shape: _[Math.floor(Math.random() * _.length)]
37
37
  });
38
38
  }
39
39
  return t;
40
- }, [u, l, I, x, y, T]), h = S((t) => {
40
+ }, [u, l, b, I, x, T]), h = S((t) => {
41
41
  if (s.current || (s.current = t), t - s.current >= c && M) {
42
- E(!1), d([]), o == null || o();
42
+ O(!1), d([]), o == null || o();
43
43
  return;
44
44
  }
45
45
  d(
@@ -50,42 +50,45 @@ const k = ({
50
50
  rotation: r.rotation + r.rotationSpeed,
51
51
  velocity: {
52
52
  x: r.velocity.x * 0.99,
53
- y: r.velocity.y + b
53
+ y: r.velocity.y + y
54
54
  }
55
55
  }))
56
56
  ), n.current = requestAnimationFrame(h);
57
- }, [c, b, M, o]);
58
- C(() => (m ? (E(!0), d(O()), s.current = 0, n.current = requestAnimationFrame(h)) : n.current && cancelAnimationFrame(n.current), () => {
57
+ }, [c, y, M, o]);
58
+ D(() => (m ? (O(!0), d(R()), s.current = 0, n.current = requestAnimationFrame(h)) : n.current && cancelAnimationFrame(n.current), () => {
59
59
  n.current && cancelAnimationFrame(n.current);
60
- }), [m, O, h]);
61
- const $ = (t) => {
60
+ }), [m, R, h]);
61
+ const C = (t) => {
62
62
  const i = {
63
- position: "absolute",
64
63
  left: `${t.x}%`,
65
64
  top: `${t.y}%`,
66
65
  width: t.size,
67
66
  height: t.size,
68
67
  transform: `rotate(${t.rotation}deg)`,
69
68
  backgroundColor: t.shape !== "triangle" ? t.color : "transparent",
70
- borderRadius: t.shape === "circle" ? "50%" : 0,
71
69
  borderLeft: t.shape === "triangle" ? `${t.size / 2}px solid transparent` : void 0,
72
70
  borderRight: t.shape === "triangle" ? `${t.size / 2}px solid transparent` : void 0,
73
- borderBottom: t.shape === "triangle" ? `${t.size}px solid ${t.color}` : void 0,
74
- opacity: 0.9
71
+ borderBottom: t.shape === "triangle" ? `${t.size}px solid ${t.color}` : void 0
75
72
  };
76
- return /* @__PURE__ */ g("div", { style: i }, t.id);
73
+ return /* @__PURE__ */ N(
74
+ "div",
75
+ {
76
+ className: F("bear-absolute bear-opacity-90", t.shape === "circle" && "bear-rounded-full"),
77
+ style: i
78
+ },
79
+ t.id
80
+ );
77
81
  };
78
- return !P || R.length === 0 ? null : /* @__PURE__ */ g(
82
+ return !$ || E.length === 0 ? null : /* @__PURE__ */ N(
79
83
  "div",
80
84
  {
81
- className: D(
85
+ className: F(
82
86
  "Bear-Confetti",
83
- "bear-fixed bear-inset-0 bear-pointer-events-none bear-overflow-hidden",
84
- _
87
+ "bear-fixed bear-inset-0 bear-pointer-events-none bear-overflow-hidden bear-z-[99999]",
88
+ z
85
89
  ),
86
- style: { zIndex: 99999 },
87
- "data-testid": z,
88
- children: R.map($)
90
+ "data-testid": P,
91
+ children: E.map(C)
89
92
  }
90
93
  );
91
94
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),r=require("react"),_=require("../../utils/cn.cjs"),l=require("./ContextMenu.const.cjs"),j=require("./ContextMenu.utils.cjs"),b=({items:S,position:a,onClose:i})=>{const[c,o]=r.useState(null),[u,d]=r.useState({x:0,y:0}),x=r.useRef(null),E=r.useCallback(s=>{var e;s.disabled||s.children||((e=s.onClick)==null||e.call(s),i())},[i]),f=r.useCallback((s,e)=>{if(s.children){const n=e.currentTarget.getBoundingClientRect();d({x:n.right+l.SUB_MENU_OFFSET,y:n.top}),o(s.id)}else o(null)},[]);return t.jsx("div",{ref:x,className:l.MENU_CLASSES,style:{left:a.x,top:a.y},role:"menu",children:S.map(s=>{if(j.isDivider(s))return t.jsx("div",{className:l.DIVIDER_CLASSES,role:"separator"},s.id);const e=s;return t.jsxs("div",{children:[t.jsxs("div",{className:_.cn(l.ITEM_CLASSES,e.disabled&&l.ITEM_DISABLED_CLASSES,e.danger&&l.ITEM_DANGER_CLASSES),onClick:()=>E(e),onMouseEnter:n=>f(e,n),role:"menuitem","aria-disabled":e.disabled,children:[t.jsxs("span",{className:"bear-flex bear-items-center",children:[e.icon&&t.jsx("span",{className:l.ICON_CLASSES,children:e.icon}),e.label]}),t.jsxs("span",{className:"bear-flex bear-items-center",children:[e.shortcut&&t.jsx("span",{className:l.SHORTCUT_CLASSES,children:e.shortcut}),e.children&&t.jsx("span",{className:l.SUB_INDICATOR_CLASSES,children:"▸"})]})]}),e.children&&c===e.id&&t.jsx(b,{items:e.children,position:u,onClose:i})]},e.id)})})},v=({items:S,children:a,disabled:i=!1,onOpenChange:c,testId:o})=>{const[u,d]=r.useState(!1),[x,E]=r.useState({x:0,y:0}),f=r.useRef(null),s=r.useCallback(()=>{d(!1),c==null||c(!1)},[c]),e=r.useCallback(n=>{i||(n.preventDefault(),E({x:n.clientX,y:n.clientY}),d(!0),c==null||c(!0))},[i,c]);return r.useEffect(()=>{if(!u)return;const n=()=>s(),m=M=>{M.key==="Escape"&&s()};return document.addEventListener("mousedown",n),document.addEventListener("keydown",m),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("keydown",m)}},[u,s]),t.jsxs("div",{ref:f,onContextMenu:e,"data-testid":o,children:[a,u&&t.jsx(b,{items:S,position:x,onClose:s})]})};exports.ContextMenu=v;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r="Bear-ContextMenu bear-fixed bear-z-[99999] bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-lg bear-shadow-xl bear-py-1 bear-min-w-[180px] bear-animate-in",e="bear-flex bear-items-center bear-justify-between bear-px-3 bear-py-1.5 bear-text-sm bear-cursor-pointer bear-transition-colors bear-text-gray-700 dark:bear-text-zinc-300 hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-700",a="bear-opacity-40 bear-cursor-not-allowed",b="bear-text-red-600 dark:bear-text-red-400 hover:bear-bg-red-50 dark:hover:bear-bg-red-900/20",S="bear-my-1 bear-border-t bear-border-gray-200 dark:bear-border-zinc-700",t="bear-mr-2 bear-w-4 bear-h-4 bear-flex-shrink-0",o="bear-text-xs bear-text-gray-400 dark:bear-text-zinc-500 bear-ml-4",E="bear-ml-2 bear-text-gray-400 dark:bear-text-zinc-500",n=4;exports.DIVIDER_CLASSES=S;exports.ICON_CLASSES=t;exports.ITEM_CLASSES=e;exports.ITEM_DANGER_CLASSES=b;exports.ITEM_DISABLED_CLASSES=a;exports.MENU_CLASSES=r;exports.SHORTCUT_CLASSES=o;exports.SUB_INDICATOR_CLASSES=E;exports.SUB_MENU_OFFSET=n;
@@ -0,0 +1,9 @@
1
+ export declare const MENU_CLASSES = "Bear-ContextMenu bear-fixed bear-z-[99999] bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-lg bear-shadow-xl bear-py-1 bear-min-w-[180px] bear-animate-in";
2
+ export declare const ITEM_CLASSES = "bear-flex bear-items-center bear-justify-between bear-px-3 bear-py-1.5 bear-text-sm bear-cursor-pointer bear-transition-colors bear-text-gray-700 dark:bear-text-zinc-300 hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-700";
3
+ export declare const ITEM_DISABLED_CLASSES = "bear-opacity-40 bear-cursor-not-allowed";
4
+ export declare const ITEM_DANGER_CLASSES = "bear-text-red-600 dark:bear-text-red-400 hover:bear-bg-red-50 dark:hover:bear-bg-red-900/20";
5
+ export declare const DIVIDER_CLASSES = "bear-my-1 bear-border-t bear-border-gray-200 dark:bear-border-zinc-700";
6
+ export declare const ICON_CLASSES = "bear-mr-2 bear-w-4 bear-h-4 bear-flex-shrink-0";
7
+ export declare const SHORTCUT_CLASSES = "bear-text-xs bear-text-gray-400 dark:bear-text-zinc-500 bear-ml-4";
8
+ export declare const SUB_INDICATOR_CLASSES = "bear-ml-2 bear-text-gray-400 dark:bear-text-zinc-500";
9
+ export declare const SUB_MENU_OFFSET = 4;
@@ -0,0 +1,12 @@
1
+ const r = "Bear-ContextMenu bear-fixed bear-z-[99999] bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-lg bear-shadow-xl bear-py-1 bear-min-w-[180px] bear-animate-in", e = "bear-flex bear-items-center bear-justify-between bear-px-3 bear-py-1.5 bear-text-sm bear-cursor-pointer bear-transition-colors bear-text-gray-700 dark:bear-text-zinc-300 hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-700", a = "bear-opacity-40 bear-cursor-not-allowed", b = "bear-text-red-600 dark:bear-text-red-400 hover:bear-bg-red-50 dark:hover:bear-bg-red-900/20", t = "bear-my-1 bear-border-t bear-border-gray-200 dark:bear-border-zinc-700", o = "bear-mr-2 bear-w-4 bear-h-4 bear-flex-shrink-0", n = "bear-text-xs bear-text-gray-400 dark:bear-text-zinc-500 bear-ml-4", S = "bear-ml-2 bear-text-gray-400 dark:bear-text-zinc-500", d = 4;
2
+ export {
3
+ t as DIVIDER_CLASSES,
4
+ o as ICON_CLASSES,
5
+ e as ITEM_CLASSES,
6
+ b as ITEM_DANGER_CLASSES,
7
+ a as ITEM_DISABLED_CLASSES,
8
+ r as MENU_CLASSES,
9
+ n as SHORTCUT_CLASSES,
10
+ S as SUB_INDICATOR_CLASSES,
11
+ d as SUB_MENU_OFFSET
12
+ };
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { ContextMenuProps } from './ContextMenu.types';
3
+ export declare const ContextMenu: FC<ContextMenuProps>;
4
+ export default ContextMenu;
@@ -0,0 +1,65 @@
1
+ import { jsxs as i, jsx as n } from "react/jsx-runtime";
2
+ import { useState as u, useRef as b, useCallback as S, useEffect as N } from "react";
3
+ import { cn as _ } from "../../utils/cn.js";
4
+ import { SUB_MENU_OFFSET as h, MENU_CLASSES as A, DIVIDER_CLASSES as I, ICON_CLASSES as M, SHORTCUT_CLASSES as k, SUB_INDICATOR_CLASSES as y, ITEM_DANGER_CLASSES as C, ITEM_DISABLED_CLASSES as D, ITEM_CLASSES as R } from "./ContextMenu.const.js";
5
+ import { isDivider as T } from "./ContextMenu.utils.js";
6
+ const v = ({ items: m, position: o, onClose: c }) => {
7
+ const [r, d] = u(null), [l, a] = u({ x: 0, y: 0 }), f = b(null), E = S((s) => {
8
+ var e;
9
+ s.disabled || s.children || ((e = s.onClick) == null || e.call(s), c());
10
+ }, [c]), p = S((s, e) => {
11
+ if (s.children) {
12
+ const t = e.currentTarget.getBoundingClientRect();
13
+ a({ x: t.right + h, y: t.top }), d(s.id);
14
+ } else
15
+ d(null);
16
+ }, []);
17
+ return /* @__PURE__ */ n("div", { ref: f, className: A, style: { left: o.x, top: o.y }, role: "menu", children: m.map((s) => {
18
+ if (T(s)) return /* @__PURE__ */ n("div", { className: I, role: "separator" }, s.id);
19
+ const e = s;
20
+ return /* @__PURE__ */ i("div", { children: [
21
+ /* @__PURE__ */ i(
22
+ "div",
23
+ {
24
+ className: _(R, e.disabled && D, e.danger && C),
25
+ onClick: () => E(e),
26
+ onMouseEnter: (t) => p(e, t),
27
+ role: "menuitem",
28
+ "aria-disabled": e.disabled,
29
+ children: [
30
+ /* @__PURE__ */ i("span", { className: "bear-flex bear-items-center", children: [
31
+ e.icon && /* @__PURE__ */ n("span", { className: M, children: e.icon }),
32
+ e.label
33
+ ] }),
34
+ /* @__PURE__ */ i("span", { className: "bear-flex bear-items-center", children: [
35
+ e.shortcut && /* @__PURE__ */ n("span", { className: k, children: e.shortcut }),
36
+ e.children && /* @__PURE__ */ n("span", { className: y, children: "▸" })
37
+ ] })
38
+ ]
39
+ }
40
+ ),
41
+ e.children && r === e.id && /* @__PURE__ */ n(v, { items: e.children, position: l, onClose: c })
42
+ ] }, e.id);
43
+ }) });
44
+ }, F = ({ items: m, children: o, disabled: c = !1, onOpenChange: r, testId: d }) => {
45
+ const [l, a] = u(!1), [f, E] = u({ x: 0, y: 0 }), p = b(null), s = S(() => {
46
+ a(!1), r == null || r(!1);
47
+ }, [r]), e = S((t) => {
48
+ c || (t.preventDefault(), E({ x: t.clientX, y: t.clientY }), a(!0), r == null || r(!0));
49
+ }, [c, r]);
50
+ return N(() => {
51
+ if (!l) return;
52
+ const t = () => s(), L = (x) => {
53
+ x.key === "Escape" && s();
54
+ };
55
+ return document.addEventListener("mousedown", t), document.addEventListener("keydown", L), () => {
56
+ document.removeEventListener("mousedown", t), document.removeEventListener("keydown", L);
57
+ };
58
+ }, [l, s]), /* @__PURE__ */ i("div", { ref: p, onContextMenu: e, "data-testid": d, children: [
59
+ o,
60
+ l && /* @__PURE__ */ n(v, { items: m, position: f, onClose: s })
61
+ ] });
62
+ };
63
+ export {
64
+ F as ContextMenu
65
+ };
@@ -0,0 +1,23 @@
1
+ import { ReactNode } from 'react';
2
+ export interface ContextMenuItem {
3
+ id: string;
4
+ label: string;
5
+ icon?: ReactNode;
6
+ shortcut?: string;
7
+ disabled?: boolean;
8
+ danger?: boolean;
9
+ children?: ContextMenuItem[];
10
+ onClick?: () => void;
11
+ }
12
+ export interface ContextMenuDivider {
13
+ id: string;
14
+ type: 'divider';
15
+ }
16
+ export type ContextMenuEntry = ContextMenuItem | ContextMenuDivider;
17
+ export interface ContextMenuProps {
18
+ items: ContextMenuEntry[];
19
+ children: ReactNode;
20
+ disabled?: boolean;
21
+ onOpenChange?: (open: boolean) => void;
22
+ testId?: string;
23
+ }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=i=>"type"in i&&i.type==="divider";exports.isDivider=e;
@@ -0,0 +1,5 @@
1
+ import { ContextMenuEntry } from './ContextMenu.types';
2
+ export declare const isDivider: (entry: ContextMenuEntry) => entry is {
3
+ id: string;
4
+ type: "divider";
5
+ };
@@ -0,0 +1,4 @@
1
+ const e = (i) => "type" in i && i.type === "divider";
2
+ export {
3
+ e as isDivider
4
+ };
@@ -0,0 +1,2 @@
1
+ export { ContextMenu } from './ContextMenu';
2
+ export type { ContextMenuProps, ContextMenuEntry, ContextMenuItem, ContextMenuDivider } from './ContextMenu.types';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),s=require("react"),b=require("../../utils/cn.cjs"),e=require("./CountdownTimer.const.cjs"),S=n=>String(n).padStart(e.PAD_LENGTH,"0"),y=(n,o)=>{const r=Math.max(0,n-o);return{days:Math.floor(r/e.MS_PER_DAY),hours:Math.floor(r%e.MS_PER_DAY/e.MS_PER_HOUR),minutes:Math.floor(r%e.MS_PER_HOUR/e.MS_PER_MINUTE),seconds:Math.floor(r%e.MS_PER_MINUTE/e.MS_PER_SECOND),totalSeconds:Math.floor(r/e.MS_PER_SECOND),isComplete:r<=0}},Z=n=>{const{targetDate:o,duration:r,variant:f="default",size:m="md",showDays:M=!0,showHours:R=!0,showMinutes:D=!0,showSeconds:I=!0,showLabels:L=!0,showSeparator:P=!0,separator:v=e.DEFAULT_SEPARATOR,labels:p,onComplete:d,onTick:u,paused:w=!1,render:C,className:N,style:j,testId:k}=n,c=s.useMemo(()=>({...e.DEFAULT_LABELS,...p}),[p]),x=s.useRef(!1),B=s.useCallback(()=>o?new Date(o).getTime():r?Date.now()+r*e.MS_PER_SECOND:Date.now(),[o,r]),[_]=s.useState(B),[i,O]=s.useState(()=>y(_,Date.now()));if(s.useEffect(()=>{if(w)return;const t=()=>{const h=y(_,Date.now());O(h),u==null||u(h),h.isComplete&&!x.current&&(x.current=!0,d==null||d())};t();const g=setInterval(t,e.UPDATE_INTERVAL);return()=>clearInterval(g)},[_,w,d,u]),C)return a.jsx(a.Fragment,{children:C(i)});const A=e.SIZE_DIGIT_CLASSES[m]??e.SIZE_DIGIT_CLASSES.md,U=e.SIZE_LABEL_CLASSES[m]??e.SIZE_LABEL_CLASSES.md,G=e.SIZE_GAP_CLASSES[m]??e.SIZE_GAP_CLASSES.md,l=[];M&&l.push({value:S(i.days),label:c.days}),R&&l.push({value:S(i.hours),label:c.hours}),D&&l.push({value:S(i.minutes),label:c.minutes}),I&&l.push({value:S(i.seconds),label:c.seconds});const E=f==="card",T=f==="flip";return a.jsx("div",{className:b.cn("Bear-CountdownTimer","bear-flex bear-items-center",G,N),style:j,"data-testid":k,role:"timer","aria-label":"Countdown timer",children:l.map((t,g)=>a.jsxs("div",{className:"Bear-CountdownTimer__segment bear-flex bear-items-center",children:[g>0&&P&&!E&&a.jsx("span",{className:b.cn("Bear-CountdownTimer__separator",A,e.SEPARATOR_MARGIN,"bear-text-gray-400 dark:bear-text-gray-500"),"aria-hidden":"true",children:v}),a.jsxs("div",{className:"Bear-CountdownTimer__unit bear-flex bear-flex-col bear-items-center",children:[a.jsx("div",{className:b.cn("Bear-CountdownTimer__digit",A,"bear-tabular-nums bear-tracking-wider",E&&["bear-px-3 bear-py-2 bear-rounded-lg","bear-bg-gray-100 dark:bear-bg-gray-800","bear-border bear-border-gray-200 dark:bear-border-gray-700"],T&&["bear-px-3 bear-py-2 bear-rounded-lg","bear-bg-gray-900 dark:bear-bg-gray-100","bear-text-white dark:bear-text-gray-900","bear-shadow-lg"],!E&&!T&&"bear-text-[var(--bear-text-primary)]"),children:t.value}),L&&a.jsx("span",{className:b.cn("Bear-CountdownTimer__label",U,"bear-mt-1 bear-uppercase bear-tracking-widest","bear-text-gray-500 dark:bear-text-gray-400"),children:t.label})]})]},t.label))})};exports.CountdownTimer=Z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),d=require("../../utils/cn.cjs"),e=require("./CountdownTimer.const.cjs"),s=require("./CountdownTimer.utils.cjs"),G=y=>{const{targetDate:c,duration:b,variant:w="default",size:m="md",showDays:A=!0,showHours:L=!0,showMinutes:v=!0,showSeconds:I=!0,showLabels:D=!0,showSeparator:R=!0,separator:N=e.DEFAULT_SEPARATOR,labels:E,onComplete:o,onTick:l,paused:C=!1,render:h,className:j,style:k,testId:B}=y,u=t.useMemo(()=>({...e.DEFAULT_LABELS,...E}),[E]),x=t.useRef(!1),P=t.useCallback(()=>c?new Date(c).getTime():b?Date.now()+b*e.MS_PER_SECOND:Date.now(),[c,b]),[S]=t.useState(P),[n,Z]=t.useState(()=>s.calcRemaining(S,Date.now()));if(t.useEffect(()=>{if(C)return;const a=()=>{const p=s.calcRemaining(S,Date.now());Z(p),l==null||l(p),p.isComplete&&!x.current&&(x.current=!0,o==null||o())};a();const _=setInterval(a,e.UPDATE_INTERVAL);return()=>clearInterval(_)},[S,C,o,l]),h)return r.jsx(r.Fragment,{children:h(n)});const f=e.SIZE_DIGIT_CLASSES[m]??e.SIZE_DIGIT_CLASSES.md,q=e.SIZE_LABEL_CLASSES[m]??e.SIZE_LABEL_CLASSES.md,F=e.SIZE_GAP_CLASSES[m]??e.SIZE_GAP_CLASSES.md,i=[];A&&i.push({value:s.pad(n.days),label:u.days}),L&&i.push({value:s.pad(n.hours),label:u.hours}),v&&i.push({value:s.pad(n.minutes),label:u.minutes}),I&&i.push({value:s.pad(n.seconds),label:u.seconds});const g=w==="card",T=w==="flip";return r.jsx("div",{className:d.cn("Bear-CountdownTimer","bear-flex bear-items-center",F,j),style:k,"data-testid":B,role:"timer","aria-label":"Countdown timer",children:i.map((a,_)=>r.jsxs("div",{className:"Bear-CountdownTimer__segment bear-flex bear-items-center",children:[_>0&&R&&!g&&r.jsx("span",{className:d.cn("Bear-CountdownTimer__separator",f,e.SEPARATOR_MARGIN,"bear-text-gray-400 dark:bear-text-gray-500"),"aria-hidden":"true",children:N}),r.jsxs("div",{className:"Bear-CountdownTimer__unit bear-flex bear-flex-col bear-items-center",children:[r.jsx("div",{className:d.cn("Bear-CountdownTimer__digit",f,"bear-tabular-nums bear-tracking-wider",g&&["bear-px-3 bear-py-2 bear-rounded-lg","bear-bg-gray-100 dark:bear-bg-gray-800","bear-border bear-border-gray-200 dark:bear-border-gray-700"],T&&["bear-px-3 bear-py-2 bear-rounded-lg","bear-bg-gray-900 dark:bear-bg-gray-100","bear-text-white dark:bear-text-gray-900","bear-shadow-lg"],!g&&!T&&"bear-text-[var(--bear-text-primary)]"),children:a.value}),D&&r.jsx("span",{className:d.cn("Bear-CountdownTimer__label",q,"bear-mt-1 bear-uppercase bear-tracking-widest","bear-text-gray-500 dark:bear-text-gray-400"),children:a.label})]})]},a.label))})};exports.CountdownTimer=G;
@@ -1,115 +1,106 @@
1
- import { jsx as o, Fragment as J, jsxs as T } from "react/jsx-runtime";
2
- import { useMemo as K, useRef as Q, useCallback as W, useState as A, useEffect as X } from "react";
3
- import { cn as u } from "../../utils/cn.js";
4
- import { DEFAULT_SEPARATOR as $, DEFAULT_LABELS as ee, MS_PER_SECOND as h, UPDATE_INTERVAL as re, SEPARATOR_MARGIN as ae, SIZE_DIGIT_CLASSES as v, SIZE_LABEL_CLASSES as D, SIZE_GAP_CLASSES as M, MS_PER_MINUTE as R, MS_PER_HOUR as L, MS_PER_DAY as N, PAD_LENGTH as te } from "./CountdownTimer.const.js";
5
- const b = (a) => String(a).padStart(te, "0"), I = (a, t) => {
6
- const e = Math.max(0, a - t);
7
- return {
8
- days: Math.floor(e / N),
9
- hours: Math.floor(e % N / L),
10
- minutes: Math.floor(e % L / R),
11
- seconds: Math.floor(e % R / h),
12
- totalSeconds: Math.floor(e / h),
13
- isComplete: e <= 0
14
- };
15
- }, ie = (a) => {
1
+ import { jsx as t, Fragment as H, jsxs as C } from "react/jsx-runtime";
2
+ import { useMemo as V, useRef as q, useCallback as J, useState as E, useEffect as K } from "react";
3
+ import { cn as o } from "../../utils/cn.js";
4
+ import { DEFAULT_SEPARATOR as Q, DEFAULT_LABELS as W, MS_PER_SECOND as X, UPDATE_INTERVAL as Y, SEPARATOR_MARGIN as $, SIZE_DIGIT_CLASSES as T, SIZE_LABEL_CLASSES as A, SIZE_GAP_CLASSES as v } from "./CountdownTimer.const.js";
5
+ import { calcRemaining as D, pad as l } from "./CountdownTimer.utils.js";
6
+ const ne = (L) => {
16
7
  const {
17
- targetDate: t,
18
- duration: e,
19
- variant: _ = "default",
20
- size: c = "md",
21
- showDays: P = !0,
22
- showHours: k = !0,
23
- showMinutes: B = !0,
24
- showSeconds: F = !0,
25
- showLabels: U = !0,
26
- showSeparator: G = !0,
27
- separator: O = $,
28
- labels: S,
29
- onComplete: l,
30
- onTick: i,
31
- paused: w = !1,
32
- render: E,
33
- className: H,
34
- style: Z,
35
- testId: j
36
- } = a, d = K(() => ({ ...ee, ...S }), [S]), y = Q(!1), z = W(() => t ? new Date(t).getTime() : e ? Date.now() + e * h : Date.now(), [t, e]), [m] = A(z), [s, V] = A(() => I(m, Date.now()));
37
- if (X(() => {
38
- if (w) return;
39
- const r = () => {
40
- const p = I(m, Date.now());
41
- V(p), i == null || i(p), p.isComplete && !y.current && (y.current = !0, l == null || l());
8
+ targetDate: d,
9
+ duration: b,
10
+ variant: f = "default",
11
+ size: u = "md",
12
+ showDays: I = !0,
13
+ showHours: N = !0,
14
+ showMinutes: k = !0,
15
+ showSeconds: R = !0,
16
+ showLabels: B = !0,
17
+ showSeparator: P = !0,
18
+ separator: F = Q,
19
+ labels: w,
20
+ onComplete: s,
21
+ onTick: n,
22
+ paused: h = !1,
23
+ render: _,
24
+ className: M,
25
+ style: G,
26
+ testId: O
27
+ } = L, i = V(() => ({ ...W, ...w }), [w]), S = q(!1), U = J(() => d ? new Date(d).getTime() : b ? Date.now() + b * X : Date.now(), [d, b]), [c] = E(U), [r, Z] = E(() => D(c, Date.now()));
28
+ if (K(() => {
29
+ if (h) return;
30
+ const e = () => {
31
+ const p = D(c, Date.now());
32
+ Z(p), n == null || n(p), p.isComplete && !S.current && (S.current = !0, s == null || s());
42
33
  };
43
- r();
44
- const f = setInterval(r, re);
45
- return () => clearInterval(f);
46
- }, [m, w, l, i]), E) return /* @__PURE__ */ o(J, { children: E(s) });
47
- const x = v[c] ?? v.md, Y = D[c] ?? D.md, q = M[c] ?? M.md, n = [];
48
- P && n.push({ value: b(s.days), label: d.days }), k && n.push({ value: b(s.hours), label: d.hours }), B && n.push({ value: b(s.minutes), label: d.minutes }), F && n.push({ value: b(s.seconds), label: d.seconds });
49
- const g = _ === "card", C = _ === "flip";
50
- return /* @__PURE__ */ o(
34
+ e();
35
+ const g = setInterval(e, Y);
36
+ return () => clearInterval(g);
37
+ }, [c, h, s, n]), _) return /* @__PURE__ */ t(H, { children: _(r) });
38
+ const y = T[u] ?? T.md, j = A[u] ?? A.md, z = v[u] ?? v.md, a = [];
39
+ I && a.push({ value: l(r.days), label: i.days }), N && a.push({ value: l(r.hours), label: i.hours }), k && a.push({ value: l(r.minutes), label: i.minutes }), R && a.push({ value: l(r.seconds), label: i.seconds });
40
+ const m = f === "card", x = f === "flip";
41
+ return /* @__PURE__ */ t(
51
42
  "div",
52
43
  {
53
- className: u("Bear-CountdownTimer", "bear-flex bear-items-center", q, H),
54
- style: Z,
55
- "data-testid": j,
44
+ className: o("Bear-CountdownTimer", "bear-flex bear-items-center", z, M),
45
+ style: G,
46
+ "data-testid": O,
56
47
  role: "timer",
57
48
  "aria-label": "Countdown timer",
58
- children: n.map((r, f) => /* @__PURE__ */ T("div", { className: "Bear-CountdownTimer__segment bear-flex bear-items-center", children: [
59
- f > 0 && G && !g && /* @__PURE__ */ o(
49
+ children: a.map((e, g) => /* @__PURE__ */ C("div", { className: "Bear-CountdownTimer__segment bear-flex bear-items-center", children: [
50
+ g > 0 && P && !m && /* @__PURE__ */ t(
60
51
  "span",
61
52
  {
62
- className: u(
53
+ className: o(
63
54
  "Bear-CountdownTimer__separator",
64
- x,
65
- ae,
55
+ y,
56
+ $,
66
57
  "bear-text-gray-400 dark:bear-text-gray-500"
67
58
  ),
68
59
  "aria-hidden": "true",
69
- children: O
60
+ children: F
70
61
  }
71
62
  ),
72
- /* @__PURE__ */ T("div", { className: "Bear-CountdownTimer__unit bear-flex bear-flex-col bear-items-center", children: [
73
- /* @__PURE__ */ o(
63
+ /* @__PURE__ */ C("div", { className: "Bear-CountdownTimer__unit bear-flex bear-flex-col bear-items-center", children: [
64
+ /* @__PURE__ */ t(
74
65
  "div",
75
66
  {
76
- className: u(
67
+ className: o(
77
68
  "Bear-CountdownTimer__digit",
78
- x,
69
+ y,
79
70
  "bear-tabular-nums bear-tracking-wider",
80
- g && [
71
+ m && [
81
72
  "bear-px-3 bear-py-2 bear-rounded-lg",
82
73
  "bear-bg-gray-100 dark:bear-bg-gray-800",
83
74
  "bear-border bear-border-gray-200 dark:bear-border-gray-700"
84
75
  ],
85
- C && [
76
+ x && [
86
77
  "bear-px-3 bear-py-2 bear-rounded-lg",
87
78
  "bear-bg-gray-900 dark:bear-bg-gray-100",
88
79
  "bear-text-white dark:bear-text-gray-900",
89
80
  "bear-shadow-lg"
90
81
  ],
91
- !g && !C && "bear-text-[var(--bear-text-primary)]"
82
+ !m && !x && "bear-text-[var(--bear-text-primary)]"
92
83
  ),
93
- children: r.value
84
+ children: e.value
94
85
  }
95
86
  ),
96
- U && /* @__PURE__ */ o(
87
+ B && /* @__PURE__ */ t(
97
88
  "span",
98
89
  {
99
- className: u(
90
+ className: o(
100
91
  "Bear-CountdownTimer__label",
101
- Y,
92
+ j,
102
93
  "bear-mt-1 bear-uppercase bear-tracking-widest",
103
94
  "bear-text-gray-500 dark:bear-text-gray-400"
104
95
  ),
105
- children: r.label
96
+ children: e.label
106
97
  }
107
98
  )
108
99
  ] })
109
- ] }, r.label))
100
+ ] }, e.label))
110
101
  }
111
102
  );
112
103
  };
113
104
  export {
114
- ie as CountdownTimer
105
+ ne as CountdownTimer
115
106
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./CountdownTimer.const.cjs"),n=a=>String(a).padStart(o.PAD_LENGTH,"0"),_=(a,e)=>{const t=Math.max(0,a-e);return{days:Math.floor(t/o.MS_PER_DAY),hours:Math.floor(t%o.MS_PER_DAY/o.MS_PER_HOUR),minutes:Math.floor(t%o.MS_PER_HOUR/o.MS_PER_MINUTE),seconds:Math.floor(t%o.MS_PER_MINUTE/o.MS_PER_SECOND),totalSeconds:Math.floor(t/o.MS_PER_SECOND),isComplete:t<=0}};exports.calcRemaining=_;exports.pad=n;
@@ -0,0 +1,3 @@
1
+ import { CountdownTime } from './CountdownTimer.types';
2
+ export declare const pad: (n: number) => string;
3
+ export declare const calcRemaining: (target: number, now: number) => CountdownTime;
@@ -0,0 +1,16 @@
1
+ import { MS_PER_SECOND as a, MS_PER_MINUTE as r, MS_PER_HOUR as M, MS_PER_DAY as n, PAD_LENGTH as _ } from "./CountdownTimer.const.js";
2
+ const f = (t) => String(t).padStart(_, "0"), l = (t, s) => {
3
+ const o = Math.max(0, t - s);
4
+ return {
5
+ days: Math.floor(o / n),
6
+ hours: Math.floor(o % n / M),
7
+ minutes: Math.floor(o % M / r),
8
+ seconds: Math.floor(o % r / a),
9
+ totalSeconds: Math.floor(o / a),
10
+ isComplete: o <= 0
11
+ };
12
+ };
13
+ export {
14
+ l as calcRemaining,
15
+ f as pad
16
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),L=require("../../utils/cn.cjs"),t=require("./DateRangePicker.const.cjs"),d=require("./DateRangePicker.utils.cjs"),B=({year:k,month:i,range:a,onDayClick:A,onNav:N,minDate:b,maxDate:C})=>{const j=d.getCalendarDays(k,i),m=new Date;return m.setHours(0,0,0,0),e.jsxs("div",{className:"bear-w-64",children:[e.jsxs("div",{className:t.CALENDAR_HEADER_CLASSES,children:[e.jsx("button",{type:"button",onClick:()=>N(-1),className:t.NAV_BTN_CLASSES,"aria-label":"Previous month",children:e.jsx("svg",{className:"bear-w-4 bear-h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),e.jsxs("span",{className:"bear-text-sm bear-font-semibold bear-text-gray-900 dark:bear-text-white",children:[t.MONTH_LABELS[i]," ",k]}),e.jsx("button",{type:"button",onClick:()=>N(1),className:t.NAV_BTN_CLASSES,"aria-label":"Next month",children:e.jsx("svg",{className:"bear-w-4 bear-h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]}),e.jsx("div",{className:"bear-grid bear-grid-cols-7 bear-gap-0.5 bear-mb-1",children:t.DAY_LABELS.map(r=>e.jsx("div",{className:"bear-text-xs bear-text-center bear-font-medium bear-text-gray-400 dark:bear-text-zinc-500 bear-py-1",children:r},r))}),e.jsx("div",{className:"bear-grid bear-grid-cols-7 bear-gap-0.5",children:j.map((r,_)=>{if(!r)return e.jsx("div",{},`e-${_}`);const x=b&&r<b||C&&r>C,o=d.isSameDay(r,a.start)||d.isSameDay(r,a.end),S=d.isInRange(r,a.start,a.end),g=d.isSameDay(r,m);return e.jsx("button",{type:"button",disabled:!!x,onClick:()=>A(r),className:L.cn(t.DAY_BASE_CLASSES,x?t.DAY_DISABLED_CLASSES:t.DAY_HOVER_CLASSES,o&&t.DAY_SELECTED_CLASSES,!o&&S&&t.DAY_IN_RANGE_CLASSES,!o&&!S&&g&&t.DAY_TODAY_CLASSES,!o&&!S&&!x&&"bear-text-gray-700 dark:bear-text-zinc-300"),children:r.getDate()},r.getTime())})})]})},G=k=>{const{value:i,onChange:a,label:A,placeholder:N="Select date range",disabled:b=!1,clearable:C=!0,minDate:j,maxDate:m,presets:r,showPresets:_=!0,size:x="md",error:o,helperText:S,className:g,testId:Y,...M}=k,[R,f]=l.useState(!1),[n,h]=l.useState(i??{start:null,end:null}),[y,p]=l.useState("start"),D=l.useRef(null),w=new Date,[u,O]=l.useState(w.getMonth()),[E,I]=l.useState(w.getFullYear()),z=u===11?0:u+1,H=u===11?E+1:E;l.useEffect(()=>{i&&h(i)},[i]),l.useEffect(()=>{const s=c=>{D.current&&!D.current.contains(c.target)&&f(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]);const T=l.useCallback(s=>{if(y==="start")h({start:s,end:null}),p("end");else{const c=s>=(n.start??s)?{start:n.start,end:s}:{start:s,end:n.start};h(c),p("start"),a==null||a(c)}},[y,n.start,a]),V=l.useCallback(s=>{h(s),a==null||a(s),f(!1),p("start")},[a]),q=l.useCallback(()=>{const s={start:null,end:null};h(s),a==null||a(s),p("start")},[a]),W=l.useCallback(s=>{let c=u+s,v=E;c<0&&(c=11,v--),c>11&&(c=0,v++),O(c),I(v)},[u,E]),P=r??(_?t.getDefaultPresets():[]),$=n.start?`${d.formatDate(n.start)}${n.end?` – ${d.formatDate(n.end)}`:""}`:N;return e.jsxs("div",{ref:D,className:L.cn(t.ROOT_CLASSES,g),"data-testid":Y,...M,children:[A&&e.jsx("label",{className:t.LABEL_CLASSES,children:A}),e.jsxs("button",{type:"button",disabled:b,onClick:()=>!b&&f(!R),className:L.cn(t.TRIGGER_CLASSES,t.SIZE_CLASSES[x],b&&"bear-opacity-50 bear-cursor-not-allowed"),children:[e.jsx("span",{className:L.cn(!n.start&&"bear-text-gray-400 dark:bear-text-zinc-500"),children:$}),e.jsx("svg",{className:"bear-w-4 bear-h-4 bear-ml-2 bear-text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})]}),R&&e.jsx("div",{className:t.DROPDOWN_CLASSES,children:e.jsxs("div",{className:"bear-flex bear-gap-4",children:[P.length>0&&e.jsxs("div",{className:"bear-border-r bear-border-gray-200 dark:bear-border-zinc-700 bear-pr-3 bear-space-y-1 bear-min-w-[120px]",children:[P.map(s=>e.jsx("button",{type:"button",onClick:()=>V(s.range()),className:t.PRESET_BTN_CLASSES,children:s.label},s.label)),C&&n.start&&e.jsx("button",{type:"button",onClick:q,className:L.cn(t.PRESET_BTN_CLASSES,"bear-text-red-500"),children:"Clear"})]}),e.jsx(B,{year:E,month:u,range:n,onDayClick:T,onNav:W,minDate:j,maxDate:m}),e.jsx(B,{year:H,month:z,range:n,onDayClick:T,onNav:()=>{},minDate:j,maxDate:m})]})}),o&&e.jsx("p",{className:t.ERROR_CLASSES,children:o}),!o&&S&&e.jsx("p",{className:t.HELPER_CLASSES,children:S})]})};exports.DateRangePicker=G;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=7,b=6,S=["Su","Mo","Tu","We","Th","Fr","Sa"],n=["January","February","March","April","May","June","July","August","September","October","November","December"],o={sm:"bear-py-1.5 bear-px-3 bear-text-sm",md:"bear-py-2 bear-px-4 bear-text-base",lg:"bear-py-2.5 bear-px-5 bear-text-lg"},E="Bear-DateRangePicker bear-relative bear-inline-block",A="bear-w-full bear-flex bear-items-center bear-justify-between bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-800 bear-text-gray-900 dark:bear-text-white bear-transition-colors focus:bear-ring-2 focus:bear-ring-pink-500 bear-outline-none",s="bear-absolute bear-z-[9999] bear-mt-1 bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-xl bear-shadow-xl bear-p-4",_="bear-flex bear-items-center bear-justify-between bear-mb-2",L="bear-p-1 bear-rounded hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700 bear-text-gray-500 dark:bear-text-zinc-400",c="bear-w-8 bear-h-8 bear-text-sm bear-rounded-full bear-transition-colors bear-cursor-pointer",D="bear-bg-pink-500 bear-text-white",i="bear-bg-pink-100 dark:bear-bg-pink-900/30 bear-text-pink-800 dark:bear-text-pink-200",g="hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700",l="bear-text-gray-300 dark:bear-text-zinc-600 bear-cursor-not-allowed",d="bear-ring-1 bear-ring-pink-400",u="bear-w-full bear-text-left bear-px-3 bear-py-1.5 bear-text-sm bear-rounded bear-transition-colors hover:bear-bg-pink-50 dark:hover:bear-bg-pink-900/20 bear-text-gray-700 dark:bear-text-zinc-300",C="Bear-DateRangePicker__label bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-zinc-300 bear-mb-1.5",x="bear-mt-1 bear-text-xs bear-text-red-500",R="bear-mt-1 bear-text-xs bear-text-gray-500 dark:bear-text-zinc-500",k=()=>{const e=new Date;return e.setHours(0,0,0,0),[{label:"Today",range:()=>({start:new Date(e),end:new Date(e)})},{label:"Last 7 days",range:()=>{const r=new Date(e);return r.setDate(r.getDate()-6),{start:r,end:new Date(e)}}},{label:"Last 30 days",range:()=>{const r=new Date(e);return r.setDate(r.getDate()-29),{start:r,end:new Date(e)}}},{label:"This month",range:()=>({start:new Date(e.getFullYear(),e.getMonth(),1),end:new Date(e)})},{label:"Last month",range:()=>{const r=new Date(e.getFullYear(),e.getMonth()-1,1),a=new Date(e.getFullYear(),e.getMonth(),0);return{start:r,end:a}}}]};exports.CALENDAR_HEADER_CLASSES=_;exports.CALENDAR_ROWS=b;exports.DAYS_IN_WEEK=t;exports.DAY_BASE_CLASSES=c;exports.DAY_DISABLED_CLASSES=l;exports.DAY_HOVER_CLASSES=g;exports.DAY_IN_RANGE_CLASSES=i;exports.DAY_LABELS=S;exports.DAY_SELECTED_CLASSES=D;exports.DAY_TODAY_CLASSES=d;exports.DROPDOWN_CLASSES=s;exports.ERROR_CLASSES=x;exports.HELPER_CLASSES=R;exports.LABEL_CLASSES=C;exports.MONTH_LABELS=n;exports.NAV_BTN_CLASSES=L;exports.PRESET_BTN_CLASSES=u;exports.ROOT_CLASSES=E;exports.SIZE_CLASSES=o;exports.TRIGGER_CLASSES=A;exports.getDefaultPresets=k;