@forgedevstack/bear 1.2.0 → 1.2.2

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 (268) hide show
  1. package/dist/components/AnimatedCounter/AnimatedCounter.cjs +1 -0
  2. package/dist/components/AnimatedCounter/AnimatedCounter.const.cjs +1 -0
  3. package/dist/components/AnimatedCounter/AnimatedCounter.const.d.ts +5 -0
  4. package/dist/components/AnimatedCounter/AnimatedCounter.const.js +7 -0
  5. package/dist/components/AnimatedCounter/AnimatedCounter.d.ts +3 -0
  6. package/dist/components/AnimatedCounter/AnimatedCounter.js +59 -0
  7. package/dist/components/AnimatedCounter/AnimatedCounter.types.d.ts +26 -0
  8. package/dist/components/AnimatedCounter/AnimatedCounter.utils.cjs +1 -0
  9. package/dist/components/AnimatedCounter/AnimatedCounter.utils.d.ts +6 -0
  10. package/dist/components/AnimatedCounter/AnimatedCounter.utils.js +13 -0
  11. package/dist/components/AnimatedCounter/index.d.ts +2 -0
  12. package/dist/components/Autocomplete/Autocomplete.cjs +1 -1
  13. package/dist/components/Autocomplete/Autocomplete.const.cjs +1 -0
  14. package/dist/components/Autocomplete/Autocomplete.const.d.ts +1 -0
  15. package/dist/components/Autocomplete/Autocomplete.const.js +4 -0
  16. package/dist/components/Autocomplete/Autocomplete.js +110 -72
  17. package/dist/components/BottomSheet/BottomSheet.cjs +1 -1
  18. package/dist/components/BottomSheet/BottomSheet.js +74 -53
  19. package/dist/components/BottomSheet/BottomSheet.types.d.ts +2 -0
  20. package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
  21. package/dist/components/Breadcrumbs/Breadcrumbs.js +126 -46
  22. package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +11 -4
  23. package/dist/components/Breadcrumbs/index.d.ts +1 -1
  24. package/dist/components/Cascader/Cascader.cjs +1 -1
  25. package/dist/components/Cascader/Cascader.const.cjs +1 -1
  26. package/dist/components/Cascader/Cascader.const.d.ts +1 -1
  27. package/dist/components/Cascader/Cascader.const.js +1 -1
  28. package/dist/components/Cascader/Cascader.js +109 -146
  29. package/dist/components/Cascader/components/CascaderPanel/CascaderPanel.cjs +1 -0
  30. package/dist/components/Cascader/components/CascaderPanel/CascaderPanel.d.ts +3 -0
  31. package/dist/components/Cascader/components/CascaderPanel/CascaderPanel.js +50 -0
  32. package/dist/components/Cascader/components/CascaderPanel/index.d.ts +1 -0
  33. package/dist/components/Chart/BarChart.cjs +1 -0
  34. package/dist/components/Chart/BarChart.d.ts +3 -0
  35. package/dist/components/Chart/BarChart.js +65 -0
  36. package/dist/components/Chart/Chart.cjs +1 -1
  37. package/dist/components/Chart/Chart.const.cjs +1 -1
  38. package/dist/components/Chart/Chart.const.d.ts +7 -0
  39. package/dist/components/Chart/Chart.const.js +12 -2
  40. package/dist/components/Chart/Chart.d.ts +1 -13
  41. package/dist/components/Chart/Chart.js +18 -204
  42. package/dist/components/Chart/Chart.types.d.ts +7 -1
  43. package/dist/components/Chart/LineChart.cjs +1 -0
  44. package/dist/components/Chart/LineChart.d.ts +3 -0
  45. package/dist/components/Chart/LineChart.js +73 -0
  46. package/dist/components/Chart/PieChart.cjs +1 -0
  47. package/dist/components/Chart/PieChart.d.ts +3 -0
  48. package/dist/components/Chart/PieChart.js +110 -0
  49. package/dist/components/Chart/index.d.ts +4 -1
  50. package/dist/components/ColorPicker/ColorPicker.cjs +1 -1
  51. package/dist/components/ColorPicker/ColorPicker.const.cjs +1 -1
  52. package/dist/components/ColorPicker/ColorPicker.const.d.ts +4 -2
  53. package/dist/components/ColorPicker/ColorPicker.const.js +8 -6
  54. package/dist/components/ColorPicker/ColorPicker.js +135 -73
  55. package/dist/components/ColorPicker/ColorPicker.utils.cjs +1 -0
  56. package/dist/components/ColorPicker/ColorPicker.utils.d.ts +17 -0
  57. package/dist/components/ColorPicker/ColorPicker.utils.js +43 -0
  58. package/dist/components/CountdownTimer/CountdownTimer.cjs +1 -1
  59. package/dist/components/CountdownTimer/CountdownTimer.const.cjs +1 -1
  60. package/dist/components/CountdownTimer/CountdownTimer.const.d.ts +2 -0
  61. package/dist/components/CountdownTimer/CountdownTimer.const.js +29 -17
  62. package/dist/components/CountdownTimer/CountdownTimer.js +91 -61
  63. package/dist/components/CountdownTimer/CountdownTimer.types.d.ts +11 -2
  64. package/dist/components/CreditInput/CreditInput.cjs +1 -1
  65. package/dist/components/CreditInput/CreditInput.js +80 -78
  66. package/dist/components/CurrencyInput/CurrencyInput.cjs +1 -0
  67. package/dist/components/CurrencyInput/CurrencyInput.const.cjs +1 -0
  68. package/dist/components/CurrencyInput/CurrencyInput.const.d.ts +4 -0
  69. package/dist/components/CurrencyInput/CurrencyInput.const.js +19 -0
  70. package/dist/components/CurrencyInput/CurrencyInput.d.ts +3 -0
  71. package/dist/components/CurrencyInput/CurrencyInput.js +60 -0
  72. package/dist/components/CurrencyInput/CurrencyInput.types.d.ts +22 -0
  73. package/dist/components/CurrencyInput/CurrencyInput.utils.cjs +1 -0
  74. package/dist/components/CurrencyInput/CurrencyInput.utils.d.ts +2 -0
  75. package/dist/components/CurrencyInput/CurrencyInput.utils.js +14 -0
  76. package/dist/components/CurrencyInput/index.d.ts +2 -0
  77. package/dist/components/DateRangePicker/DateRangePicker.cjs +1 -1
  78. package/dist/components/DateRangePicker/DateRangePicker.js +89 -84
  79. package/dist/components/DiffSquares/DiffSquares.cjs +1 -0
  80. package/dist/components/DiffSquares/DiffSquares.const.cjs +1 -0
  81. package/dist/components/DiffSquares/DiffSquares.const.d.ts +3 -0
  82. package/dist/components/DiffSquares/DiffSquares.const.js +6 -0
  83. package/dist/components/DiffSquares/DiffSquares.d.ts +3 -0
  84. package/dist/components/DiffSquares/DiffSquares.js +70 -0
  85. package/dist/components/DiffSquares/DiffSquares.types.d.ts +23 -0
  86. package/dist/components/DiffSquares/DiffSquares.utils.cjs +1 -0
  87. package/dist/components/DiffSquares/DiffSquares.utils.d.ts +3 -0
  88. package/dist/components/DiffSquares/DiffSquares.utils.js +12 -0
  89. package/dist/components/DiffSquares/index.d.ts +2 -0
  90. package/dist/components/DiffViewer/DiffViewer.cjs +1 -1
  91. package/dist/components/DiffViewer/DiffViewer.const.cjs +1 -1
  92. package/dist/components/DiffViewer/DiffViewer.const.d.ts +6 -0
  93. package/dist/components/DiffViewer/DiffViewer.const.js +17 -4
  94. package/dist/components/DiffViewer/DiffViewer.d.ts +0 -14
  95. package/dist/components/DiffViewer/DiffViewer.js +97 -105
  96. package/dist/components/DiffViewer/DiffViewer.types.d.ts +5 -0
  97. package/dist/components/DiffViewer/index.d.ts +1 -1
  98. package/dist/components/Drawer/Drawer.cjs +1 -1
  99. package/dist/components/Drawer/Drawer.js +41 -41
  100. package/dist/components/Dropdown/Dropdown.cjs +1 -1
  101. package/dist/components/Dropdown/Dropdown.const.cjs +1 -0
  102. package/dist/components/Dropdown/Dropdown.const.d.ts +7 -0
  103. package/dist/components/Dropdown/Dropdown.const.js +10 -0
  104. package/dist/components/Dropdown/Dropdown.d.ts +0 -1
  105. package/dist/components/Dropdown/Dropdown.js +102 -92
  106. package/dist/components/Dropdown/Dropdown.types.d.ts +2 -0
  107. package/dist/components/Gauge/Gauge.cjs +1 -1
  108. package/dist/components/Gauge/Gauge.js +61 -50
  109. package/dist/components/Gauge/Gauge.types.d.ts +2 -0
  110. package/dist/components/GlowCard/GlowCard.cjs +1 -0
  111. package/dist/components/GlowCard/GlowCard.const.cjs +1 -0
  112. package/dist/components/GlowCard/GlowCard.const.d.ts +11 -0
  113. package/dist/components/GlowCard/GlowCard.const.js +13 -0
  114. package/dist/components/GlowCard/GlowCard.d.ts +3 -0
  115. package/dist/components/GlowCard/GlowCard.js +185 -0
  116. package/dist/components/GlowCard/GlowCard.types.d.ts +21 -0
  117. package/dist/components/GlowCard/index.d.ts +2 -0
  118. package/dist/components/Heatmap/Heatmap.cjs +1 -0
  119. package/dist/components/Heatmap/Heatmap.const.cjs +1 -0
  120. package/dist/components/Heatmap/Heatmap.const.d.ts +8 -0
  121. package/dist/components/Heatmap/Heatmap.const.js +11 -0
  122. package/dist/components/Heatmap/Heatmap.d.ts +3 -0
  123. package/dist/components/Heatmap/Heatmap.js +103 -0
  124. package/dist/components/Heatmap/Heatmap.types.d.ts +34 -0
  125. package/dist/components/Heatmap/Heatmap.utils.cjs +1 -0
  126. package/dist/components/Heatmap/Heatmap.utils.d.ts +2 -0
  127. package/dist/components/Heatmap/Heatmap.utils.js +18 -0
  128. package/dist/components/Heatmap/index.d.ts +2 -0
  129. package/dist/components/HoverCard/HoverCard.cjs +6 -6
  130. package/dist/components/HoverCard/HoverCard.js +72 -54
  131. package/dist/components/Icon/icons/status.js +1 -1
  132. package/dist/components/ImageAnnotation/ImageAnnotation.cjs +1 -0
  133. package/dist/components/ImageAnnotation/ImageAnnotation.const.cjs +1 -0
  134. package/dist/components/ImageAnnotation/ImageAnnotation.const.d.ts +3 -0
  135. package/dist/components/ImageAnnotation/ImageAnnotation.const.js +6 -0
  136. package/dist/components/ImageAnnotation/ImageAnnotation.d.ts +3 -0
  137. package/dist/components/ImageAnnotation/ImageAnnotation.js +113 -0
  138. package/dist/components/ImageAnnotation/ImageAnnotation.types.d.ts +28 -0
  139. package/dist/components/ImageAnnotation/index.d.ts +2 -0
  140. package/dist/components/MediaPlayer/MediaPlayer.cjs +1 -0
  141. package/dist/components/MediaPlayer/MediaPlayer.const.cjs +1 -0
  142. package/dist/components/MediaPlayer/MediaPlayer.const.d.ts +36 -0
  143. package/dist/components/MediaPlayer/MediaPlayer.const.js +11 -0
  144. package/dist/components/MediaPlayer/MediaPlayer.d.ts +3 -0
  145. package/dist/components/MediaPlayer/MediaPlayer.js +279 -0
  146. package/dist/components/MediaPlayer/MediaPlayer.types.d.ts +69 -0
  147. package/dist/components/MediaPlayer/MediaPlayer.utils.cjs +1 -0
  148. package/dist/components/MediaPlayer/MediaPlayer.utils.d.ts +1 -0
  149. package/dist/components/MediaPlayer/MediaPlayer.utils.js +7 -0
  150. package/dist/components/MediaPlayer/index.d.ts +2 -0
  151. package/dist/components/MentionsInput/MentionsInput.cjs +1 -1
  152. package/dist/components/MentionsInput/MentionsInput.js +106 -83
  153. package/dist/components/Menu/Menu.cjs +1 -1
  154. package/dist/components/Menu/Menu.js +91 -80
  155. package/dist/components/Modal/Modal.cjs +1 -1
  156. package/dist/components/Modal/Modal.const.cjs +1 -1
  157. package/dist/components/Modal/Modal.const.d.ts +1 -1
  158. package/dist/components/Modal/Modal.const.js +1 -1
  159. package/dist/components/Modal/Modal.js +50 -44
  160. package/dist/components/Modal/Modal.types.d.ts +6 -0
  161. package/dist/components/MultiSelect/MultiSelect.cjs +1 -1
  162. package/dist/components/MultiSelect/MultiSelect.js +123 -78
  163. package/dist/components/NavigableSelect/NavigableSelect.cjs +1 -1
  164. package/dist/components/NavigableSelect/NavigableSelect.const.cjs +1 -1
  165. package/dist/components/NavigableSelect/NavigableSelect.const.d.ts +1 -1
  166. package/dist/components/NavigableSelect/NavigableSelect.const.js +1 -1
  167. package/dist/components/NavigableSelect/NavigableSelect.js +167 -143
  168. package/dist/components/NotificationCenter/NotificationCenter.cjs +1 -1
  169. package/dist/components/NotificationCenter/NotificationCenter.const.cjs +1 -1
  170. package/dist/components/NotificationCenter/NotificationCenter.const.d.ts +1 -1
  171. package/dist/components/NotificationCenter/NotificationCenter.const.js +1 -1
  172. package/dist/components/NotificationCenter/NotificationCenter.js +87 -81
  173. package/dist/components/OTPInput/OTPInput.cjs +1 -1
  174. package/dist/components/OTPInput/OTPInput.const.cjs +1 -0
  175. package/dist/components/OTPInput/OTPInput.const.d.ts +6 -0
  176. package/dist/components/OTPInput/OTPInput.const.js +14 -0
  177. package/dist/components/OTPInput/OTPInput.js +99 -65
  178. package/dist/components/OTPInput/OTPInput.types.d.ts +7 -0
  179. package/dist/components/PhoneInput/PhoneInput.cjs +1 -1
  180. package/dist/components/PhoneInput/PhoneInput.const.cjs +1 -1
  181. package/dist/components/PhoneInput/PhoneInput.const.d.ts +1 -1
  182. package/dist/components/PhoneInput/PhoneInput.const.js +1 -1
  183. package/dist/components/PhoneInput/PhoneInput.js +88 -83
  184. package/dist/components/Popconfirm/Popconfirm.cjs +1 -1
  185. package/dist/components/Popconfirm/Popconfirm.const.cjs +1 -1
  186. package/dist/components/Popconfirm/Popconfirm.const.d.ts +1 -3
  187. package/dist/components/Popconfirm/Popconfirm.const.js +12 -18
  188. package/dist/components/Popconfirm/Popconfirm.js +71 -51
  189. package/dist/components/Popover/Popover.cjs +1 -1
  190. package/dist/components/Popover/Popover.js +36 -31
  191. package/dist/components/Portal/Portal.cjs +1 -1
  192. package/dist/components/Portal/Portal.d.ts +0 -3
  193. package/dist/components/Portal/Portal.js +4 -10
  194. package/dist/components/Select/Select.cjs +1 -1
  195. package/dist/components/Select/Select.js +71 -51
  196. package/dist/components/Stepper/Stepper.cjs +1 -1
  197. package/dist/components/Stepper/Stepper.const.cjs +1 -1
  198. package/dist/components/Stepper/Stepper.const.d.ts +26 -4
  199. package/dist/components/Stepper/Stepper.const.js +39 -20
  200. package/dist/components/Stepper/Stepper.d.ts +3 -10
  201. package/dist/components/Stepper/Stepper.js +189 -130
  202. package/dist/components/Stepper/Stepper.types.d.ts +14 -0
  203. package/dist/components/Stepper/Stepper.utils.cjs +1 -0
  204. package/dist/components/Stepper/Stepper.utils.d.ts +12 -0
  205. package/dist/components/Stepper/Stepper.utils.js +19 -0
  206. package/dist/components/Stepper/components/StepperControls.cjs +1 -0
  207. package/dist/components/Stepper/components/StepperControls.d.ts +2 -0
  208. package/dist/components/Stepper/components/StepperControls.js +32 -0
  209. package/dist/components/Stepper/index.d.ts +2 -1
  210. package/dist/components/Tabs/TabList.cjs +1 -1
  211. package/dist/components/Tabs/TabList.js +72 -57
  212. package/dist/components/Tabs/Tabs.types.d.ts +4 -2
  213. package/dist/components/Tabs/index.d.ts +2 -2
  214. package/dist/components/TagCloud/TagCloud.cjs +1 -0
  215. package/dist/components/TagCloud/TagCloud.const.cjs +1 -0
  216. package/dist/components/TagCloud/TagCloud.const.d.ts +5 -0
  217. package/dist/components/TagCloud/TagCloud.const.js +8 -0
  218. package/dist/components/TagCloud/TagCloud.d.ts +3 -0
  219. package/dist/components/TagCloud/TagCloud.js +76 -0
  220. package/dist/components/TagCloud/TagCloud.types.d.ts +26 -0
  221. package/dist/components/TagCloud/index.d.ts +2 -0
  222. package/dist/components/TimePicker/components/TimePickerDialDropdown/TimePickerDialDropdown.cjs +1 -1
  223. package/dist/components/TimePicker/components/TimePickerDialDropdown/TimePickerDialDropdown.js +26 -26
  224. package/dist/components/TimePicker/helpers/ClockFaceSvg.cjs +1 -1
  225. package/dist/components/TimePicker/helpers/ClockFaceSvg.js +17 -17
  226. package/dist/components/TimelineChart/TimelineChart.cjs +1 -0
  227. package/dist/components/TimelineChart/TimelineChart.const.cjs +1 -0
  228. package/dist/components/TimelineChart/TimelineChart.const.d.ts +6 -0
  229. package/dist/components/TimelineChart/TimelineChart.const.js +9 -0
  230. package/dist/components/TimelineChart/TimelineChart.d.ts +3 -0
  231. package/dist/components/TimelineChart/TimelineChart.js +65 -0
  232. package/dist/components/TimelineChart/TimelineChart.types.d.ts +31 -0
  233. package/dist/components/TimelineChart/index.d.ts +2 -0
  234. package/dist/components/Toast/Toast.cjs +1 -1
  235. package/dist/components/Toast/Toast.js +86 -82
  236. package/dist/components/Toast/Toast.types.d.ts +2 -0
  237. package/dist/components/Tooltip/Tooltip.cjs +1 -1
  238. package/dist/components/Tooltip/Tooltip.js +52 -44
  239. package/dist/components/TreeSelect/TreeSelect.cjs +1 -1
  240. package/dist/components/TreeSelect/TreeSelect.const.cjs +1 -1
  241. package/dist/components/TreeSelect/TreeSelect.const.d.ts +1 -1
  242. package/dist/components/TreeSelect/TreeSelect.const.js +3 -3
  243. package/dist/components/TreeSelect/TreeSelect.js +120 -88
  244. package/dist/components/Watermark/Watermark.cjs +1 -1
  245. package/dist/components/Watermark/Watermark.const.cjs +1 -1
  246. package/dist/components/Watermark/Watermark.const.d.ts +6 -3
  247. package/dist/components/Watermark/Watermark.const.js +13 -11
  248. package/dist/components/Watermark/Watermark.js +87 -61
  249. package/dist/components/Watermark/Watermark.types.d.ts +2 -0
  250. package/dist/components/index.cjs +1 -1
  251. package/dist/components/index.d.ts +22 -4
  252. package/dist/components/index.js +319 -296
  253. package/dist/hooks/index.cjs +1 -1
  254. package/dist/hooks/index.d.ts +1 -1
  255. package/dist/hooks/index.js +55 -54
  256. package/dist/hooks/useClickOutside.cjs +1 -1
  257. package/dist/hooks/useClickOutside.d.ts +4 -11
  258. package/dist/hooks/useClickOutside.js +26 -7
  259. package/dist/index.cjs +1 -1
  260. package/dist/index.js +412 -388
  261. package/dist/styles/_effects.css +32 -0
  262. package/dist/styles.css +1 -1
  263. package/dist/utils/maxVisible.utils.cjs +1 -0
  264. package/dist/utils/maxVisible.utils.d.ts +12 -0
  265. package/dist/utils/maxVisible.utils.js +15 -0
  266. package/package.json +1 -1
  267. package/dist/components/HoverCard/HoverCard.utils.cjs +0 -1
  268. package/dist/components/HoverCard/HoverCard.utils.js +0 -23
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),e=require("react"),v=require("../../utils/cn.cjs"),x=require("../Typography/Typography.cjs"),a=require("./AnimatedCounter.const.cjs"),T=require("./AnimatedCounter.utils.cjs"),M=({value:o,from:t=0,duration:l=a.DEFAULT_DURATION,decimals:b=a.DEFAULT_DECIMALS,prefix:E="",suffix:q="",separator:C=a.DEFAULT_SEPARATOR,easing:F=a.DEFAULT_EASING,animateOnView:u=!0,typographyProps:n,testId:N,className:D,...I})=>{const[_,R]=e.useState(t),[d,U]=e.useState(!u),A=e.useRef(null),m=T.EASING_FUNCTIONS[F],i=e.useCallback(()=>{const s=performance.now(),r=o-t,c=h=>{const j=h-s,f=Math.min(j/l,1);R(t+r*m(f)),f<1&&requestAnimationFrame(c)};requestAnimationFrame(c)},[o,t,l,m]);e.useEffect(()=>{if(!u){i();return}const s=A.current;if(!s)return;const r=new IntersectionObserver(([c])=>{c.isIntersecting&&!d&&(U(!0),i())},{threshold:.1});return r.observe(s),()=>r.disconnect()},[u,i,d]);const L=`${E}${T.formatNumber(_,b,C)}${q}`;return S.jsx(x.Typography,{variant:"h3",component:"span",...n,className:v.cn("Bear-AnimatedCounter bear-tabular-nums",n==null?void 0:n.className,D),"data-testid":N,children:S.jsx("span",{ref:A,...I,children:L})})};exports.AnimatedCounter=M;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=2e3,E=0,T=",",D="easeOut";exports.DEFAULT_DECIMALS=E;exports.DEFAULT_DURATION=A;exports.DEFAULT_EASING=D;exports.DEFAULT_SEPARATOR=T;
@@ -0,0 +1,5 @@
1
+ export declare const DEFAULT_DURATION = 2000;
2
+ export declare const DEFAULT_DECIMALS = 0;
3
+ export declare const DEFAULT_SEPARATOR = ",";
4
+ export declare const DEFAULT_EASING: "easeOut";
5
+ export declare const FRAME_INTERVAL = 16;
@@ -0,0 +1,7 @@
1
+ const A = 2e3, E = 0, t = ",", D = "easeOut";
2
+ export {
3
+ E as DEFAULT_DECIMALS,
4
+ A as DEFAULT_DURATION,
5
+ D as DEFAULT_EASING,
6
+ t as DEFAULT_SEPARATOR
7
+ };
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { AnimatedCounterProps } from './AnimatedCounter.types';
3
+ export declare const AnimatedCounter: FC<AnimatedCounterProps>;
@@ -0,0 +1,59 @@
1
+ import { jsx as A } from "react/jsx-runtime";
2
+ import { useState as d, useRef as v, useCallback as $, useEffect as k } from "react";
3
+ import { cn as p } from "../../utils/cn.js";
4
+ import { Typography as q } from "../Typography/Typography.js";
5
+ import { DEFAULT_DURATION as x, DEFAULT_DECIMALS as G, DEFAULT_SEPARATOR as M, DEFAULT_EASING as O } from "./AnimatedCounter.const.js";
6
+ import { EASING_FUNCTIONS as j, formatNumber as B } from "./AnimatedCounter.utils.js";
7
+ const V = ({
8
+ value: c,
9
+ from: e = 0,
10
+ duration: i = x,
11
+ decimals: E = G,
12
+ prefix: F = "",
13
+ suffix: N = "",
14
+ separator: S = M,
15
+ easing: T = O,
16
+ animateOnView: a = !0,
17
+ typographyProps: t,
18
+ testId: b,
19
+ className: D,
20
+ ...I
21
+ }) => {
22
+ const [U, C] = d(e), [m, L] = d(!a), u = v(null), f = j[T], o = $(() => {
23
+ const n = performance.now(), r = c - e, s = (R) => {
24
+ const h = R - n, l = Math.min(h / i, 1);
25
+ C(e + r * f(l)), l < 1 && requestAnimationFrame(s);
26
+ };
27
+ requestAnimationFrame(s);
28
+ }, [c, e, i, f]);
29
+ k(() => {
30
+ if (!a) {
31
+ o();
32
+ return;
33
+ }
34
+ const n = u.current;
35
+ if (!n) return;
36
+ const r = new IntersectionObserver(
37
+ ([s]) => {
38
+ s.isIntersecting && !m && (L(!0), o());
39
+ },
40
+ { threshold: 0.1 }
41
+ );
42
+ return r.observe(n), () => r.disconnect();
43
+ }, [a, o, m]);
44
+ const _ = `${F}${B(U, E, S)}${N}`;
45
+ return /* @__PURE__ */ A(
46
+ q,
47
+ {
48
+ variant: "h3",
49
+ component: "span",
50
+ ...t,
51
+ className: p("Bear-AnimatedCounter bear-tabular-nums", t == null ? void 0 : t.className, D),
52
+ "data-testid": b,
53
+ children: /* @__PURE__ */ A("span", { ref: u, ...I, children: _ })
54
+ }
55
+ );
56
+ };
57
+ export {
58
+ V as AnimatedCounter
59
+ };
@@ -0,0 +1,26 @@
1
+ import { HTMLAttributes } from 'react';
2
+ import { TypographyProps } from '../Typography/Typography.types';
3
+ export interface AnimatedCounterProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
4
+ /** Target value to count to */
5
+ value: number;
6
+ /** Starting value */
7
+ from?: number;
8
+ /** Animation duration in ms */
9
+ duration?: number;
10
+ /** Decimal places */
11
+ decimals?: number;
12
+ /** Prefix string (e.g. '$') */
13
+ prefix?: string;
14
+ /** Suffix string (e.g. '%') */
15
+ suffix?: string;
16
+ /** Thousand separator */
17
+ separator?: string;
18
+ /** Easing function */
19
+ easing?: 'linear' | 'easeOut' | 'easeInOut';
20
+ /** Start animation when element enters viewport */
21
+ animateOnView?: boolean;
22
+ /** Typography props for the number */
23
+ typographyProps?: Partial<TypographyProps>;
24
+ /** Test ID */
25
+ testId?: string;
26
+ }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c={linear:e=>e,easeOut:e=>1-Math.pow(1-e,3),easeInOut:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2};function s(e,r,a){const n=e.toFixed(r),[i,t]=n.split("."),o=i.replace(/\B(?=(\d{3})+(?!\d))/g,a);return t?`${o}.${t}`:o}exports.EASING_FUNCTIONS=c;exports.formatNumber=s;
@@ -0,0 +1,6 @@
1
+ export declare const EASING_FUNCTIONS: {
2
+ readonly linear: (t: number) => number;
3
+ readonly easeOut: (t: number) => number;
4
+ readonly easeInOut: (t: number) => number;
5
+ };
6
+ export declare function formatNumber(num: number, decimals: number, separator: string): string;
@@ -0,0 +1,13 @@
1
+ const i = {
2
+ linear: (e) => e,
3
+ easeOut: (e) => 1 - Math.pow(1 - e, 3),
4
+ easeInOut: (e) => e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2
5
+ };
6
+ function s(e, o, a) {
7
+ const r = e.toFixed(o), [c, t] = r.split("."), n = c.replace(/\B(?=(\d{3})+(?!\d))/g, a);
8
+ return t ? `${n}.${t}` : n;
9
+ }
10
+ export {
11
+ i as EASING_FUNCTIONS,
12
+ s as formatNumber
13
+ };
@@ -0,0 +1,2 @@
1
+ export { AnimatedCounter } from './AnimatedCounter';
2
+ export type { AnimatedCounterProps } from './AnimatedCounter.types';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),d=require("../../utils/cn.cjs"),I=require("./Autocomplete.utils.cjs"),O=({options:j,value:o="",onChange:n,onSelect:u,placeholder:N="Start typing...",label:y,helperText:h,error:c,disabled:i=!1,freeSolo:p=!1,loading:w=!1,filterOptions:A=I.defaultFilter,className:D,testId:E})=>{const[f,s]=t.useState(!1),[b,g]=t.useState(-1),x=t.useRef(null),k=t.useRef(null),m=t.useRef(null),l=A(j,o);t.useEffect(()=>{const e=a=>{x.current&&!x.current.contains(a.target)&&s(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),t.useEffect(()=>{g(-1)},[o]),t.useEffect(()=>{if(b>=0&&m.current){const e=m.current.children[b];e&&e.scrollIntoView({block:"nearest"})}},[b]);const R=e=>{const a=e.target.value;n==null||n(a),s(!0)},v=e=>{var a;n==null||n(e.label),u==null||u(e),s(!1),(a=k.current)==null||a.blur()},z=e=>{if(!f){(e.key==="ArrowDown"||e.key==="ArrowUp")&&(s(!0),e.preventDefault());return}switch(e.key){case"ArrowDown":e.preventDefault(),g(a=>a<l.length-1?a+1:0);break;case"ArrowUp":e.preventDefault(),g(a=>a>0?a-1:l.length-1);break;case"Enter":e.preventDefault(),b>=0&&l[b]?v(l[b]):p&&o&&s(!1);break;case"Escape":s(!1);break}};return r.jsxs("div",{className:d.cn("bear-w-full bear-relative",D),ref:x,"data-testid":E,children:[y&&r.jsx("label",{className:"bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-200 bear-mb-1.5",children:y}),r.jsxs("div",{className:"bear-relative",children:[r.jsx("input",{ref:k,type:"text",value:o,onChange:R,onFocus:()=>s(!0),onKeyDown:z,placeholder:N,disabled:i,className:d.cn("bear-w-full bear-px-4 bear-py-2.5 bear-pr-10 bear-rounded-lg bear-border","bear-bg-white dark:bear-bg-gray-900","bear-text-sm bear-text-gray-900 dark:bear-text-white","placeholder:bear-text-gray-400","bear-transition-colors bear-outline-none",c?"bear-border-red-500 focus:bear-ring-2 focus:bear-ring-red-500/20":"bear-border-gray-300 dark:bear-border-gray-600 focus:bear-border-amber-500 focus:bear-ring-2 focus:bear-ring-amber-500/20",i&&"bear-opacity-50 bear-cursor-not-allowed bear-bg-gray-100 dark:bear-bg-gray-800")}),r.jsx("div",{className:"bear-absolute bear-right-3 bear-top-1/2 bear-transform bear--translate-y-1/2",children:w?r.jsxs("svg",{className:"bear-animate-spin bear-w-4 bear-h-4 bear-text-gray-400",viewBox:"0 0 24 24",fill:"none",children:[r.jsx("circle",{className:"bear-opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"bear-opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):r.jsx("svg",{className:"bear-w-4 bear-h-4 bear-text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})})]}),f&&!i&&l.length>0&&r.jsx("div",{ref:m,className:"bear-absolute bear-z-50 bear-w-full bear-mt-1 bear-py-1 bear-bg-white dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-rounded-lg bear-shadow-lg bear-max-h-60 bear-overflow-auto",children:l.map((e,a)=>r.jsxs("button",{type:"button",disabled:e.disabled,onClick:()=>v(e),className:d.cn("bear-w-full bear-px-4 bear-py-2 bear-text-left bear-text-sm bear-transition-colors","bear-text-gray-900 dark:bear-text-white",a===b?"bear-bg-amber-50 dark:bear-bg-amber-900/20":"hover:bear-bg-gray-50 dark:hover:bear-bg-gray-700",e.disabled&&"bear-opacity-50 bear-cursor-not-allowed"),children:[r.jsx("div",{className:"bear-font-medium",children:e.label}),e.description&&r.jsx("div",{className:"bear-text-xs bear-text-gray-500 dark:bear-text-gray-400 bear-mt-0.5",children:e.description})]},e.value))}),f&&!i&&l.length===0&&o&&!w&&r.jsx("div",{className:"bear-absolute bear-z-50 bear-w-full bear-mt-1 bear-py-3 bear-px-4 bear-bg-white dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-rounded-lg bear-shadow-lg bear-text-sm bear-text-gray-500",children:p?"Press Enter to use this value":"No results found"}),(h||c)&&r.jsx("p",{className:d.cn("bear-mt-1.5 bear-text-xs",c?"bear-text-red-500":"bear-text-gray-500 dark:bear-text-gray-400"),children:c||h})]})};exports.Autocomplete=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),x=require("../../utils/cn.cjs"),D=require("../Portal/Portal.cjs"),V=require("./Autocomplete.utils.cjs"),M=require("./Autocomplete.const.cjs"),C=({options:z,value:b="",onChange:i,onSelect:g,placeholder:I="Start typing...",label:k,helperText:v,error:u,disabled:f=!1,freeSolo:j=!1,loading:E=!1,filterOptions:q=V.defaultFilter,className:_,testId:B})=>{const[c,s]=a.useState(!1),[n,m]=a.useState(-1),[l,T]=a.useState({top:0,left:0,width:0}),N=a.useRef(null),P=a.useRef(null),h=a.useRef(null),A=a.useRef(null),w=a.useRef(null),o=q(z,b),y=c&&!f&&o.length>0,p=c&&!f&&o.length===0&&!!b&&!E;a.useEffect(()=>{if(!y&&!p)return;const e=()=>{var d;const r=(d=P.current)==null?void 0:d.getBoundingClientRect();r&&T({top:r.bottom+4,left:Math.max(8,Math.min(r.left,window.innerWidth-r.width-8)),width:r.width})};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[y,p]),a.useEffect(()=>{if(!c)return;const e=r=>{var R,O;const d=r.target;(R=N.current)!=null&&R.contains(d)||(O=h.current)!=null&&O.contains(d)||s(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[c]),a.useEffect(()=>{m(-1)},[b]),a.useEffect(()=>{if(n>=0&&w.current){const e=w.current.children[n];e&&e.scrollIntoView({block:"nearest"})}},[n]);const U=e=>{const r=e.target.value;i==null||i(r),s(!0)},L=e=>{var r;i==null||i(e.label),g==null||g(e),s(!1),(r=A.current)==null||r.blur()},W=e=>{if(!c){(e.key==="ArrowDown"||e.key==="ArrowUp")&&(s(!0),e.preventDefault());return}switch(e.key){case"ArrowDown":e.preventDefault(),m(r=>r<o.length-1?r+1:0);break;case"ArrowUp":e.preventDefault(),m(r=>r>0?r-1:o.length-1);break;case"Enter":e.preventDefault(),n>=0&&o[n]?L(o[n]):j&&b&&s(!1);break;case"Escape":s(!1);break}};return t.jsxs("div",{className:x.cn("bear-w-full bear-relative",_),ref:N,"data-testid":B,children:[k&&t.jsx("label",{className:"bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-200 bear-mb-1.5",children:k}),t.jsxs("div",{className:"bear-relative",ref:P,children:[t.jsx("input",{ref:A,type:"text",value:b,onChange:U,onFocus:()=>s(!0),onKeyDown:W,placeholder:I,disabled:f,className:x.cn("bear-w-full bear-px-4 bear-py-2.5 bear-pr-10 bear-rounded-lg bear-border","bear-bg-white dark:bear-bg-gray-900","bear-text-sm bear-text-gray-900 dark:bear-text-white","placeholder:bear-text-gray-400","bear-transition-colors bear-outline-none",u?"bear-border-red-500 focus:bear-ring-2 focus:bear-ring-red-500/20":"bear-border-gray-300 dark:bear-border-gray-600 focus:bear-border-amber-500 focus:bear-ring-2 focus:bear-ring-amber-500/20",f&&"bear-opacity-50 bear-cursor-not-allowed bear-bg-gray-100 dark:bear-bg-gray-800")}),t.jsx("div",{className:"bear-absolute bear-right-3 bear-top-1/2 bear-transform bear--translate-y-1/2",children:E?t.jsxs("svg",{className:"bear-animate-spin bear-w-4 bear-h-4 bear-text-gray-400",viewBox:"0 0 24 24",fill:"none",children:[t.jsx("circle",{className:"bear-opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.jsx("path",{className:"bear-opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):t.jsx("svg",{className:"bear-w-4 bear-h-4 bear-text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})})]}),y&&t.jsx(D.Portal,{children:t.jsx("div",{ref:h,className:"bear-fixed bear-rounded-lg bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-shadow-lg bear-bg-white dark:bear-bg-gray-800",style:{top:l.top,left:l.left,width:l.width,zIndex:M.AUTOCOMPLETE_PANEL_Z},children:t.jsx("div",{ref:w,className:"bear-max-h-60 bear-overflow-auto bear-py-1",children:o.map((e,r)=>t.jsxs("button",{type:"button",disabled:e.disabled,onClick:()=>L(e),className:x.cn("bear-w-full bear-px-4 bear-py-2 bear-text-left bear-text-sm bear-transition-colors","bear-text-gray-900 dark:bear-text-white",r===n?"bear-bg-amber-50 dark:bear-bg-amber-900/20":"hover:bear-bg-gray-50 dark:hover:bear-bg-gray-700",e.disabled&&"bear-opacity-50 bear-cursor-not-allowed"),children:[t.jsx("div",{className:"bear-font-medium",children:e.label}),e.description&&t.jsx("div",{className:"bear-text-xs bear-text-gray-500 dark:bear-text-gray-400 bear-mt-0.5",children:e.description})]},e.value))})})}),p&&t.jsx(D.Portal,{children:t.jsx("div",{ref:h,className:"bear-fixed bear-py-3 bear-px-4 bear-bg-white dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-rounded-lg bear-shadow-lg bear-text-sm bear-text-gray-500",style:{top:l.top,left:l.left,width:l.width,zIndex:M.AUTOCOMPLETE_PANEL_Z},children:j?"Press Enter to use this value":"No results found"})}),(v||u)&&t.jsx("p",{className:x.cn("bear-mt-1.5 bear-text-xs",u?"bear-text-red-500":"bear-text-gray-500 dark:bear-text-gray-400"),children:u||v})]})};exports.Autocomplete=C;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=11e3;exports.AUTOCOMPLETE_PANEL_Z=e;
@@ -0,0 +1 @@
1
+ export declare const AUTOCOMPLETE_PANEL_Z = 11000;
@@ -0,0 +1,4 @@
1
+ const E = 11e3;
2
+ export {
3
+ E as AUTOCOMPLETE_PANEL_Z
4
+ };
@@ -1,130 +1,168 @@
1
- import { jsxs as d, jsx as a } from "react/jsx-runtime";
2
- import { useState as A, useRef as h, useEffect as x } from "react";
3
- import { cn as c } from "../../utils/cn.js";
4
- import { defaultFilter as V } from "./Autocomplete.utils.js";
5
- const M = ({
6
- options: E,
7
- value: o = "",
8
- onChange: l,
9
- onSelect: u,
10
- placeholder: z = "Start typing...",
11
- label: p,
12
- helperText: w,
13
- error: n,
14
- disabled: i = !1,
15
- freeSolo: k = !1,
16
- loading: v = !1,
17
- filterOptions: I = V,
18
- className: L,
19
- testId: O
1
+ import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
+ import { useState as N, useRef as c, useEffect as h } from "react";
3
+ import { cn as g } from "../../utils/cn.js";
4
+ import { Portal as B } from "../Portal/Portal.js";
5
+ import { defaultFilter as T } from "./Autocomplete.utils.js";
6
+ import { AUTOCOMPLETE_PANEL_Z as W } from "./Autocomplete.const.js";
7
+ const Y = ({
8
+ options: j,
9
+ value: b = "",
10
+ onChange: o,
11
+ onSelect: w,
12
+ placeholder: U = "Start typing...",
13
+ label: E,
14
+ helperText: L,
15
+ error: u,
16
+ disabled: f = !1,
17
+ freeSolo: P = !1,
18
+ loading: A = !1,
19
+ filterOptions: V = T,
20
+ className: F,
21
+ testId: H
20
22
  }) => {
21
- const [m, t] = A(!1), [b, f] = A(-1), g = h(null), N = h(null), y = h(null), s = I(E, o);
22
- x(() => {
23
+ const [l, a] = N(!1), [n, p] = N(-1), [i, K] = N({ top: 0, left: 0, width: 0 }), D = c(null), z = c(null), y = c(null), I = c(null), x = c(null), s = V(j, b), k = l && !f && s.length > 0, v = l && !f && s.length === 0 && !!b && !A;
24
+ h(() => {
25
+ if (!k && !v) return;
26
+ const e = () => {
27
+ var d;
28
+ const r = (d = z.current) == null ? void 0 : d.getBoundingClientRect();
29
+ r && K({
30
+ top: r.bottom + 4,
31
+ left: Math.max(8, Math.min(r.left, window.innerWidth - r.width - 8)),
32
+ width: r.width
33
+ });
34
+ };
35
+ return e(), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
36
+ window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
37
+ };
38
+ }, [k, v]), h(() => {
39
+ if (!l) return;
23
40
  const e = (r) => {
24
- g.current && !g.current.contains(r.target) && t(!1);
41
+ var M, O;
42
+ const d = r.target;
43
+ (M = D.current) != null && M.contains(d) || (O = y.current) != null && O.contains(d) || a(!1);
25
44
  };
26
45
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
27
- }, []), x(() => {
28
- f(-1);
29
- }, [o]), x(() => {
30
- if (b >= 0 && y.current) {
31
- const e = y.current.children[b];
46
+ }, [l]), h(() => {
47
+ p(-1);
48
+ }, [b]), h(() => {
49
+ if (n >= 0 && x.current) {
50
+ const e = x.current.children[n];
32
51
  e && e.scrollIntoView({ block: "nearest" });
33
52
  }
34
- }, [b]);
35
- const R = (e) => {
53
+ }, [n]);
54
+ const _ = (e) => {
36
55
  const r = e.target.value;
37
- l == null || l(r), t(!0);
38
- }, D = (e) => {
56
+ o == null || o(r), a(!0);
57
+ }, R = (e) => {
39
58
  var r;
40
- l == null || l(e.label), u == null || u(e), t(!1), (r = N.current) == null || r.blur();
41
- }, j = (e) => {
42
- if (!m) {
43
- (e.key === "ArrowDown" || e.key === "ArrowUp") && (t(!0), e.preventDefault());
59
+ o == null || o(e.label), w == null || w(e), a(!1), (r = I.current) == null || r.blur();
60
+ }, C = (e) => {
61
+ if (!l) {
62
+ (e.key === "ArrowDown" || e.key === "ArrowUp") && (a(!0), e.preventDefault());
44
63
  return;
45
64
  }
46
65
  switch (e.key) {
47
66
  case "ArrowDown":
48
- e.preventDefault(), f(
67
+ e.preventDefault(), p(
49
68
  (r) => r < s.length - 1 ? r + 1 : 0
50
69
  );
51
70
  break;
52
71
  case "ArrowUp":
53
- e.preventDefault(), f(
72
+ e.preventDefault(), p(
54
73
  (r) => r > 0 ? r - 1 : s.length - 1
55
74
  );
56
75
  break;
57
76
  case "Enter":
58
- e.preventDefault(), b >= 0 && s[b] ? D(s[b]) : k && o && t(!1);
77
+ e.preventDefault(), n >= 0 && s[n] ? R(s[n]) : P && b && a(!1);
59
78
  break;
60
79
  case "Escape":
61
- t(!1);
80
+ a(!1);
62
81
  break;
63
82
  }
64
83
  };
65
- return /* @__PURE__ */ d("div", { className: c("bear-w-full bear-relative", L), ref: g, "data-testid": O, children: [
66
- p && /* @__PURE__ */ a("label", { className: "bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-200 bear-mb-1.5", children: p }),
67
- /* @__PURE__ */ d("div", { className: "bear-relative", children: [
68
- /* @__PURE__ */ a(
84
+ return /* @__PURE__ */ m("div", { className: g("bear-w-full bear-relative", F), ref: D, "data-testid": H, children: [
85
+ E && /* @__PURE__ */ t("label", { className: "bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-200 bear-mb-1.5", children: E }),
86
+ /* @__PURE__ */ m("div", { className: "bear-relative", ref: z, children: [
87
+ /* @__PURE__ */ t(
69
88
  "input",
70
89
  {
71
- ref: N,
90
+ ref: I,
72
91
  type: "text",
73
- value: o,
74
- onChange: R,
75
- onFocus: () => t(!0),
76
- onKeyDown: j,
77
- placeholder: z,
78
- disabled: i,
79
- className: c(
92
+ value: b,
93
+ onChange: _,
94
+ onFocus: () => a(!0),
95
+ onKeyDown: C,
96
+ placeholder: U,
97
+ disabled: f,
98
+ className: g(
80
99
  "bear-w-full bear-px-4 bear-py-2.5 bear-pr-10 bear-rounded-lg bear-border",
81
100
  "bear-bg-white dark:bear-bg-gray-900",
82
101
  "bear-text-sm bear-text-gray-900 dark:bear-text-white",
83
102
  "placeholder:bear-text-gray-400",
84
103
  "bear-transition-colors bear-outline-none",
85
- n ? "bear-border-red-500 focus:bear-ring-2 focus:bear-ring-red-500/20" : "bear-border-gray-300 dark:bear-border-gray-600 focus:bear-border-amber-500 focus:bear-ring-2 focus:bear-ring-amber-500/20",
86
- i && "bear-opacity-50 bear-cursor-not-allowed bear-bg-gray-100 dark:bear-bg-gray-800"
104
+ u ? "bear-border-red-500 focus:bear-ring-2 focus:bear-ring-red-500/20" : "bear-border-gray-300 dark:bear-border-gray-600 focus:bear-border-amber-500 focus:bear-ring-2 focus:bear-ring-amber-500/20",
105
+ f && "bear-opacity-50 bear-cursor-not-allowed bear-bg-gray-100 dark:bear-bg-gray-800"
87
106
  )
88
107
  }
89
108
  ),
90
- /* @__PURE__ */ a("div", { className: "bear-absolute bear-right-3 bear-top-1/2 bear-transform bear--translate-y-1/2", children: v ? /* @__PURE__ */ d("svg", { className: "bear-animate-spin bear-w-4 bear-h-4 bear-text-gray-400", viewBox: "0 0 24 24", fill: "none", children: [
91
- /* @__PURE__ */ a("circle", { className: "bear-opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
92
- /* @__PURE__ */ a("path", { className: "bear-opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
93
- ] }) : /* @__PURE__ */ a("svg", { className: "bear-w-4 bear-h-4 bear-text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ a("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }) })
109
+ /* @__PURE__ */ t("div", { className: "bear-absolute bear-right-3 bear-top-1/2 bear-transform bear--translate-y-1/2", children: A ? /* @__PURE__ */ m("svg", { className: "bear-animate-spin bear-w-4 bear-h-4 bear-text-gray-400", viewBox: "0 0 24 24", fill: "none", children: [
110
+ /* @__PURE__ */ t("circle", { className: "bear-opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
111
+ /* @__PURE__ */ t("path", { className: "bear-opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
112
+ ] }) : /* @__PURE__ */ t("svg", { className: "bear-w-4 bear-h-4 bear-text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }) })
94
113
  ] }),
95
- m && !i && s.length > 0 && /* @__PURE__ */ a(
114
+ k && /* @__PURE__ */ t(B, { children: /* @__PURE__ */ t(
96
115
  "div",
97
116
  {
98
117
  ref: y,
99
- className: "bear-absolute bear-z-50 bear-w-full bear-mt-1 bear-py-1 bear-bg-white dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-rounded-lg bear-shadow-lg bear-max-h-60 bear-overflow-auto",
100
- children: s.map((e, r) => /* @__PURE__ */ d(
118
+ className: "bear-fixed bear-rounded-lg bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-shadow-lg bear-bg-white dark:bear-bg-gray-800",
119
+ style: {
120
+ top: i.top,
121
+ left: i.left,
122
+ width: i.width,
123
+ zIndex: W
124
+ },
125
+ children: /* @__PURE__ */ t("div", { ref: x, className: "bear-max-h-60 bear-overflow-auto bear-py-1", children: s.map((e, r) => /* @__PURE__ */ m(
101
126
  "button",
102
127
  {
103
128
  type: "button",
104
129
  disabled: e.disabled,
105
- onClick: () => D(e),
106
- className: c(
130
+ onClick: () => R(e),
131
+ className: g(
107
132
  "bear-w-full bear-px-4 bear-py-2 bear-text-left bear-text-sm bear-transition-colors",
108
133
  "bear-text-gray-900 dark:bear-text-white",
109
- r === b ? "bear-bg-amber-50 dark:bear-bg-amber-900/20" : "hover:bear-bg-gray-50 dark:hover:bear-bg-gray-700",
134
+ r === n ? "bear-bg-amber-50 dark:bear-bg-amber-900/20" : "hover:bear-bg-gray-50 dark:hover:bear-bg-gray-700",
110
135
  e.disabled && "bear-opacity-50 bear-cursor-not-allowed"
111
136
  ),
112
137
  children: [
113
- /* @__PURE__ */ a("div", { className: "bear-font-medium", children: e.label }),
114
- e.description && /* @__PURE__ */ a("div", { className: "bear-text-xs bear-text-gray-500 dark:bear-text-gray-400 bear-mt-0.5", children: e.description })
138
+ /* @__PURE__ */ t("div", { className: "bear-font-medium", children: e.label }),
139
+ e.description && /* @__PURE__ */ t("div", { className: "bear-text-xs bear-text-gray-500 dark:bear-text-gray-400 bear-mt-0.5", children: e.description })
115
140
  ]
116
141
  },
117
142
  e.value
118
- ))
143
+ )) })
144
+ }
145
+ ) }),
146
+ v && /* @__PURE__ */ t(B, { children: /* @__PURE__ */ t(
147
+ "div",
148
+ {
149
+ ref: y,
150
+ className: "bear-fixed bear-py-3 bear-px-4 bear-bg-white dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-rounded-lg bear-shadow-lg bear-text-sm bear-text-gray-500",
151
+ style: {
152
+ top: i.top,
153
+ left: i.left,
154
+ width: i.width,
155
+ zIndex: W
156
+ },
157
+ children: P ? "Press Enter to use this value" : "No results found"
119
158
  }
120
- ),
121
- m && !i && s.length === 0 && o && !v && /* @__PURE__ */ a("div", { className: "bear-absolute bear-z-50 bear-w-full bear-mt-1 bear-py-3 bear-px-4 bear-bg-white dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-rounded-lg bear-shadow-lg bear-text-sm bear-text-gray-500", children: k ? "Press Enter to use this value" : "No results found" }),
122
- (w || n) && /* @__PURE__ */ a("p", { className: c(
159
+ ) }),
160
+ (L || u) && /* @__PURE__ */ t("p", { className: g(
123
161
  "bear-mt-1.5 bear-text-xs",
124
- n ? "bear-text-red-500" : "bear-text-gray-500 dark:bear-text-gray-400"
125
- ), children: n || w })
162
+ u ? "bear-text-red-500" : "bear-text-gray-500 dark:bear-text-gray-400"
163
+ ), children: u || L })
126
164
  ] });
127
165
  };
128
166
  export {
129
- M as Autocomplete
167
+ Y as Autocomplete
130
168
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),p=require("react-dom"),f=require("../../utils/cn.cjs"),N=require("../Icon/index.cjs"),x=300,S={sm:"bear-max-h-[40%]",md:"bear-max-h-[60%]",lg:"bear-max-h-[80%]",full:"bear-max-h-[95%]"},q=({isOpen:n,onClose:s,title:b,children:h,size:v="md",showCloseButton:i=!0,closeOnBackdrop:y=!0,closeOnEscape:d=!0,showHandle:k=!0,className:g})=>{const[a,u]=r.useState(n),[c,o]=r.useState(!1),[j,m]=r.useState(!1);r.useEffect(()=>{if(n){u(!0),o(!1);const t=requestAnimationFrame(()=>m(!0));return()=>cancelAnimationFrame(t)}if(a){m(!1),o(!0);const t=setTimeout(()=>{u(!1),o(!1)},x);return()=>clearTimeout(t)}},[n,a]);const l=r.useCallback(t=>{d&&t.key==="Escape"&&s()},[d,s]);if(r.useEffect(()=>(a&&(document.addEventListener("keydown",l),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",l),document.body.style.overflow=""}),[a,l]),!a)return null;const w=e.jsxs("div",{className:"bear-fixed bear-inset-0 bear-z-50 bear-flex bear-items-end bear-justify-center",children:[e.jsx("div",{className:f.cn("bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity",c?"bear-opacity-0":"bear-opacity-100"),style:{transitionDuration:`${x}ms`},onClick:y?s:void 0,"aria-hidden":"true"}),e.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":b?"bottom-sheet-title":void 0,className:f.cn("Bear-BottomSheet bear-relative bear-w-full bear-rounded-t-2xl bear-shadow-2xl bear-overflow-hidden bear-transition-transform bear-duration-300","bear-bg-white dark:bear-bg-neutral-900 bear-border-t bear-border-neutral-200 dark:bear-border-neutral-700",S[v],j&&!c?"bear-translate-y-0":"bear-translate-y-full",g),children:[k&&e.jsx("div",{className:"bear-flex bear-justify-center bear-pt-2 bear-pb-1",children:e.jsx("div",{className:"bear-w-12 bear-h-1 bear-rounded-full bear-bg-neutral-300 dark:bear-bg-neutral-600","aria-hidden":!0})}),(b||i)&&e.jsxs("div",{className:"bear-flex bear-items-center bear-justify-between bear-px-4 bear-py-3 bear-border-b bear-border-neutral-200 dark:bear-border-neutral-700",children:[b&&e.jsx("h2",{id:"bottom-sheet-title",className:"bear-text-lg bear-font-semibold bear-text-neutral-900 dark:bear-text-white",children:b}),i&&e.jsx("button",{onClick:s,className:"bear-p-1 bear-rounded-lg bear-text-neutral-500 dark:bear-text-neutral-400 hover:bear-text-neutral-900 dark:hover:bear-text-white hover:bear-bg-neutral-100 dark:hover:bear-bg-neutral-700 bear-transition-colors","aria-label":"Close",children:e.jsx(N.XIcon,{className:"bear-w-5 bear-h-5"})})]}),e.jsx("div",{className:"bear-flex-1 bear-overflow-y-auto bear-p-4 bear-text-neutral-700 dark:bear-text-neutral-300",children:h})]})]});return p.createPortal(w,document.body)};exports.BottomSheet=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),S=require("react-dom"),s=require("../../utils/cn.cjs"),q=require("../Icon/index.cjs"),h=300,E={sm:"bear-max-h-[40%]",md:"bear-max-h-[60%]",lg:"bear-max-h-[80%]",full:"bear-max-h-[95%]"},I=({isOpen:l,onClose:b,title:n,children:x,size:v="md",showCloseButton:d=!0,closeOnBackdrop:y=!0,closeOnEscape:u=!0,showHandle:k=!0,enableScroll:g=!0,isSticky:j=!1,className:w})=>{const[a,c]=r.useState(l),[m,o]=r.useState(!1),[p,f]=r.useState(!1);r.useEffect(()=>{if(l){c(!0),o(!1);const t=requestAnimationFrame(()=>f(!0));return()=>cancelAnimationFrame(t)}if(a){f(!1),o(!0);const t=setTimeout(()=>{c(!1),o(!1)},h);return()=>clearTimeout(t)}},[l,a]);const i=r.useCallback(t=>{u&&t.key==="Escape"&&b()},[u,b]);if(r.useEffect(()=>(a&&(document.addEventListener("keydown",i),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",i),document.body.style.overflow=""}),[a,i]),!a)return null;const N=e.jsxs("div",{className:"bear-fixed bear-inset-0 bear-z-[11000] bear-flex bear-items-end bear-justify-center",children:[e.jsx("div",{className:s.cn("bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity",m?"bear-opacity-0":"bear-opacity-100"),style:{transitionDuration:`${h}ms`},onClick:y?b:void 0,"aria-hidden":"true"}),e.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":n?"bottom-sheet-title":void 0,className:s.cn("Bear-BottomSheet bear-relative bear-w-full bear-rounded-t-2xl bear-shadow-2xl bear-transition-transform bear-duration-300","bear-flex bear-flex-col bear-min-h-0 bear-overflow-hidden","bear-bg-white dark:bear-bg-neutral-900 bear-border-t bear-border-neutral-200 dark:bear-border-neutral-700",E[v],p&&!m?"bear-translate-y-0":"bear-translate-y-full",w),children:[k&&e.jsx("div",{className:"bear-flex bear-justify-center bear-pt-2 bear-pb-1",children:e.jsx("div",{className:"bear-w-12 bear-h-1 bear-rounded-full bear-bg-neutral-300 dark:bear-bg-neutral-600","aria-hidden":!0})}),(n||d)&&e.jsxs("div",{className:s.cn("bear-flex bear-items-center bear-justify-between bear-px-4 bear-py-3 bear-border-b bear-border-neutral-200 dark:bear-border-neutral-700 bear-shrink-0",j&&"bear-sticky bear-top-0 bear-z-10 bear-bg-white dark:bear-bg-neutral-900"),children:[n&&e.jsx("h2",{id:"bottom-sheet-title",className:"bear-text-lg bear-font-semibold bear-text-neutral-900 dark:bear-text-white",children:n}),d&&e.jsx("button",{onClick:b,className:"bear-p-1 bear-rounded-lg bear-text-neutral-500 dark:bear-text-neutral-400 hover:bear-text-neutral-900 dark:hover:bear-text-white hover:bear-bg-neutral-100 dark:hover:bear-bg-neutral-700 bear-transition-colors","aria-label":"Close",children:e.jsx(q.XIcon,{className:"bear-w-5 bear-h-5"})})]}),e.jsx("div",{className:s.cn("bear-flex-1 bear-min-h-0 bear-p-4 bear-text-neutral-700 dark:bear-text-neutral-300",g?"bear-overflow-y-auto":"bear-overflow-hidden"),children:x})]})]});return S.createPortal(N,document.body)};exports.BottomSheet=I;