@forgedevstack/bear 1.3.1 → 1.3.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 (269) hide show
  1. package/README.md +26 -0
  2. package/dist/components/Accordion/components/AccordionItem/AccordionItem.cjs +1 -1
  3. package/dist/components/Accordion/components/AccordionItem/AccordionItem.js +1 -1
  4. package/dist/components/Alert/Alert.cjs +1 -1
  5. package/dist/components/Alert/Alert.js +1 -1
  6. package/dist/components/Avatar/Avatar.cjs +1 -1
  7. package/dist/components/Avatar/Avatar.js +1 -1
  8. package/dist/components/BackTop/BackTop.cjs +1 -1
  9. package/dist/components/BackTop/BackTop.js +1 -1
  10. package/dist/components/Banner/Banner.const.cjs +1 -1
  11. package/dist/components/Banner/Banner.const.js +1 -1
  12. package/dist/components/Blockquote/Blockquote.cjs +1 -1
  13. package/dist/components/Blockquote/Blockquote.js +1 -1
  14. package/dist/components/BottomSheet/BottomSheet.cjs +1 -1
  15. package/dist/components/BottomSheet/BottomSheet.js +1 -1
  16. package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
  17. package/dist/components/Breadcrumbs/Breadcrumbs.js +1 -1
  18. package/dist/components/Calendar/Calendar.cjs +1 -1
  19. package/dist/components/Calendar/Calendar.js +1 -1
  20. package/dist/components/Chart/BarChart.cjs +1 -1
  21. package/dist/components/Chart/BarChart.d.ts +1 -2
  22. package/dist/components/Chart/BarChart.js +81 -61
  23. package/dist/components/Chart/Chart.cjs +1 -1
  24. package/dist/components/Chart/Chart.const.cjs +1 -1
  25. package/dist/components/Chart/Chart.const.d.ts +24 -3
  26. package/dist/components/Chart/Chart.const.js +39 -16
  27. package/dist/components/Chart/Chart.d.ts +1 -5
  28. package/dist/components/Chart/Chart.js +19 -23
  29. package/dist/components/Chart/Chart.types.d.ts +11 -19
  30. package/dist/components/Chart/Chart.utils.cjs +1 -1
  31. package/dist/components/Chart/Chart.utils.d.ts +8 -18
  32. package/dist/components/Chart/Chart.utils.js +39 -3
  33. package/dist/components/Chart/FunnelChart.cjs +1 -0
  34. package/dist/components/Chart/FunnelChart.d.ts +2 -0
  35. package/dist/components/Chart/FunnelChart.js +59 -0
  36. package/dist/components/Chart/LineChart.cjs +1 -1
  37. package/dist/components/Chart/LineChart.d.ts +1 -2
  38. package/dist/components/Chart/LineChart.js +51 -55
  39. package/dist/components/Chart/PieChart.cjs +1 -1
  40. package/dist/components/Chart/PieChart.d.ts +1 -2
  41. package/dist/components/Chart/PieChart.js +121 -106
  42. package/dist/components/Chart/PieChart.types.d.ts +8 -0
  43. package/dist/components/Chart/RadarChart.cjs +1 -0
  44. package/dist/components/Chart/RadarChart.d.ts +2 -0
  45. package/dist/components/Chart/RadarChart.js +100 -0
  46. package/dist/components/Chart/index.d.ts +3 -1
  47. package/dist/components/Chat/Chat.cjs +1 -1
  48. package/dist/components/Chat/Chat.js +1 -1
  49. package/dist/components/CurrencyInput/CurrencyInput.cjs +1 -1
  50. package/dist/components/CurrencyInput/CurrencyInput.js +1 -1
  51. package/dist/components/DatePicker/DatePicker.cjs +1 -1
  52. package/dist/components/DatePicker/DatePicker.js +1 -1
  53. package/dist/components/DateRangePicker/DateRangePicker.cjs +1 -1
  54. package/dist/components/DateRangePicker/DateRangePicker.js +1 -1
  55. package/dist/components/Drawer/Drawer.cjs +1 -1
  56. package/dist/components/Drawer/Drawer.const.cjs +1 -1
  57. package/dist/components/Drawer/Drawer.const.d.ts +2 -11
  58. package/dist/components/Drawer/Drawer.const.js +6 -55
  59. package/dist/components/Drawer/Drawer.d.ts +1 -2
  60. package/dist/components/Drawer/Drawer.js +87 -131
  61. package/dist/components/Drawer/Drawer.types.d.ts +16 -3
  62. package/dist/components/Drawer/Drawer.utils.d.ts +0 -4
  63. package/dist/components/Drawer/components/DrawerHeader/DrawerHeader.cjs +1 -0
  64. package/dist/components/Drawer/components/DrawerHeader/DrawerHeader.d.ts +2 -0
  65. package/dist/components/Drawer/components/DrawerHeader/DrawerHeader.js +26 -0
  66. package/dist/components/Drawer/components/DrawerHeader/DrawerHeader.types.d.ts +20 -0
  67. package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderClose.cjs +1 -0
  68. package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderClose.d.ts +2 -0
  69. package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderClose.js +17 -0
  70. package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderTitle.cjs +1 -0
  71. package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderTitle.d.ts +2 -0
  72. package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderTitle.js +9 -0
  73. package/dist/components/Drawer/components/DrawerHeader/index.d.ts +2 -0
  74. package/dist/components/Drawer/components/index.d.ts +1 -0
  75. package/dist/components/Drawer/helpers/DrawerOptionalHeader.cjs +1 -0
  76. package/dist/components/Drawer/helpers/DrawerOptionalHeader.d.ts +2 -0
  77. package/dist/components/Drawer/helpers/DrawerOptionalHeader.js +9 -0
  78. package/dist/components/Drawer/helpers/index.d.ts +1 -0
  79. package/dist/components/Drawer/hooks/index.d.ts +1 -0
  80. package/dist/components/Drawer/hooks/useDrawer.cjs +1 -0
  81. package/dist/components/Drawer/hooks/useDrawer.d.ts +2 -0
  82. package/dist/components/Drawer/hooks/useDrawer.js +51 -0
  83. package/dist/components/Editable/Editable.cjs +1 -1
  84. package/dist/components/Editable/Editable.js +1 -1
  85. package/dist/components/FileTree/FileTree.cjs +1 -1
  86. package/dist/components/FileTree/FileTree.js +1 -1
  87. package/dist/components/FloatingChat/FloatingChat.cjs +1 -1
  88. package/dist/components/FloatingChat/FloatingChat.js +1 -1
  89. package/dist/components/Gauge/Gauge.cjs +1 -1
  90. package/dist/components/Gauge/Gauge.const.cjs +1 -1
  91. package/dist/components/Gauge/Gauge.const.d.ts +5 -0
  92. package/dist/components/Gauge/Gauge.const.js +11 -6
  93. package/dist/components/Gauge/Gauge.d.ts +1 -2
  94. package/dist/components/Gauge/Gauge.js +69 -45
  95. package/dist/components/Gauge/Gauge.types.d.ts +11 -2
  96. package/dist/components/Gauge/helpers/GaugeLinearBar.cjs +1 -0
  97. package/dist/components/Gauge/helpers/GaugeLinearBar.d.ts +2 -0
  98. package/dist/components/Gauge/helpers/GaugeLinearBar.js +40 -0
  99. package/dist/components/Heatmap/Heatmap.cjs +1 -1
  100. package/dist/components/Heatmap/Heatmap.const.cjs +1 -1
  101. package/dist/components/Heatmap/Heatmap.const.d.ts +2 -0
  102. package/dist/components/Heatmap/Heatmap.const.js +8 -6
  103. package/dist/components/Heatmap/Heatmap.js +51 -47
  104. package/dist/components/Heatmap/Heatmap.types.d.ts +1 -1
  105. package/dist/components/Icon/Icon.d.ts +2 -39
  106. package/dist/components/Icon/Icon.types.d.ts +1 -17
  107. package/dist/components/Icon/icons/action.d.ts +1 -85
  108. package/dist/components/Icon/icons/bear.d.ts +1 -12
  109. package/dist/components/Icon/icons/charts.d.ts +1 -0
  110. package/dist/components/Icon/icons/commerce.d.ts +1 -25
  111. package/dist/components/Icon/icons/communication.d.ts +1 -48
  112. package/dist/components/Icon/icons/content.d.ts +1 -53
  113. package/dist/components/Icon/icons/device.d.ts +1 -27
  114. package/dist/components/Icon/icons/editor.d.ts +1 -54
  115. package/dist/components/Icon/icons/file.d.ts +1 -25
  116. package/dist/components/Icon/icons/index.d.ts +1 -9
  117. package/dist/components/Icon/icons/media.d.ts +1 -64
  118. package/dist/components/Icon/icons/misc.d.ts +1 -96
  119. package/dist/components/Icon/icons/navigation.d.ts +1 -56
  120. package/dist/components/Icon/icons/social.d.ts +1 -24
  121. package/dist/components/Icon/icons/status.d.ts +1 -61
  122. package/dist/components/Icon/index.d.ts +2 -605
  123. package/dist/components/ImageAnnotation/ImageAnnotation.cjs +1 -1
  124. package/dist/components/ImageAnnotation/ImageAnnotation.js +1 -1
  125. package/dist/components/JsonViewer/JsonViewer.cjs +1 -1
  126. package/dist/components/JsonViewer/JsonViewer.js +1 -1
  127. package/dist/components/MediaPlayer/MediaPlayer.cjs +1 -1
  128. package/dist/components/MediaPlayer/MediaPlayer.js +1 -1
  129. package/dist/components/Modal/Modal.cjs +1 -1
  130. package/dist/components/Modal/Modal.js +1 -1
  131. package/dist/components/PageNav/PageNav.cjs +1 -1
  132. package/dist/components/PageNav/PageNav.js +1 -1
  133. package/dist/components/PasswordInput/PasswordInput.cjs +1 -1
  134. package/dist/components/PasswordInput/PasswordInput.js +5 -5
  135. package/dist/components/PropsPlayground/PropsPlayground.cjs +1 -1
  136. package/dist/components/PropsPlayground/PropsPlayground.js +1 -1
  137. package/dist/components/Rating/components/StarIcon/StarIcon.cjs +1 -1
  138. package/dist/components/Rating/components/StarIcon/StarIcon.js +1 -1
  139. package/dist/components/Result/Result.utils.cjs +1 -1
  140. package/dist/components/Result/Result.utils.js +1 -1
  141. package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.cjs +1 -1
  142. package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.js +1 -1
  143. package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -1
  144. package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.js +1 -1
  145. package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.cjs +1 -1
  146. package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.js +1 -1
  147. package/dist/components/RichEditor/components/ToolbarSignature/ToolbarSignature.cjs +1 -1
  148. package/dist/components/RichEditor/components/ToolbarSignature/ToolbarSignature.js +1 -1
  149. package/dist/components/RichEditor/helpers/IconRender.cjs +1 -1
  150. package/dist/components/RichEditor/helpers/IconRender.js +16 -16
  151. package/dist/components/RichEditor/helpers/toolbarItemRender.cjs +1 -1
  152. package/dist/components/RichEditor/helpers/toolbarItemRender.js +23 -23
  153. package/dist/components/RingProgress/RingProgress.cjs +1 -1
  154. package/dist/components/RingProgress/RingProgress.const.cjs +1 -1
  155. package/dist/components/RingProgress/RingProgress.const.d.ts +3 -0
  156. package/dist/components/RingProgress/RingProgress.const.js +7 -4
  157. package/dist/components/RingProgress/RingProgress.js +38 -37
  158. package/dist/components/RingProgress/RingProgress.types.d.ts +1 -0
  159. package/dist/components/Select/Select.cjs +1 -1
  160. package/dist/components/Select/Select.js +1 -1
  161. package/dist/components/Sidebar/Sidebar.cjs +1 -1
  162. package/dist/components/Sidebar/Sidebar.js +16 -15
  163. package/dist/components/Sidebar/Sidebar.types.d.ts +1 -1
  164. package/dist/components/Sidebar/Sidebar.utils.cjs +1 -0
  165. package/dist/components/Sidebar/Sidebar.utils.d.ts +2 -0
  166. package/dist/components/Sidebar/Sidebar.utils.js +11 -0
  167. package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.cjs +1 -1
  168. package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.js +1 -1
  169. package/dist/components/Sidebar/components/SidebarItem/SidebarItem.cjs +1 -1
  170. package/dist/components/Sidebar/components/SidebarItem/SidebarItem.js +55 -51
  171. package/dist/components/Sidebar/index.d.ts +1 -0
  172. package/dist/components/SliderRange/SliderRange.cjs +1 -1
  173. package/dist/components/SliderRange/SliderRange.js +19 -19
  174. package/dist/components/Sparkline/Sparkline.cjs +1 -1
  175. package/dist/components/Sparkline/Sparkline.const.cjs +1 -1
  176. package/dist/components/Sparkline/Sparkline.const.d.ts +5 -0
  177. package/dist/components/Sparkline/Sparkline.const.js +9 -4
  178. package/dist/components/Sparkline/Sparkline.d.ts +1 -2
  179. package/dist/components/Sparkline/Sparkline.js +75 -53
  180. package/dist/components/Sparkline/Sparkline.types.d.ts +2 -0
  181. package/dist/components/Sparkline/Sparkline.utils.cjs +1 -1
  182. package/dist/components/Sparkline/Sparkline.utils.d.ts +7 -12
  183. package/dist/components/Sparkline/Sparkline.utils.js +33 -20
  184. package/dist/components/Sparkline/index.d.ts +2 -2
  185. package/dist/components/Stepper/Stepper.cjs +1 -1
  186. package/dist/components/Stepper/Stepper.js +1 -1
  187. package/dist/components/Tabs/TabList.cjs +1 -1
  188. package/dist/components/Tabs/TabList.js +1 -1
  189. package/dist/components/TimePicker/TimePicker.cjs +1 -1
  190. package/dist/components/TimePicker/TimePicker.js +1 -1
  191. package/dist/components/TimelineChart/TimelineChart.cjs +1 -1
  192. package/dist/components/TimelineChart/TimelineChart.const.cjs +1 -1
  193. package/dist/components/TimelineChart/TimelineChart.const.d.ts +3 -0
  194. package/dist/components/TimelineChart/TimelineChart.const.js +7 -4
  195. package/dist/components/TimelineChart/TimelineChart.js +56 -42
  196. package/dist/components/TimelineChart/TimelineChart.types.d.ts +1 -1
  197. package/dist/components/TreeSelect/TreeSelect.cjs +1 -1
  198. package/dist/components/TreeSelect/TreeSelect.js +1 -1
  199. package/dist/components/TreeSelect/components/TreeSelectExpandControl/TreeSelectExpandControl.cjs +1 -1
  200. package/dist/components/TreeSelect/components/TreeSelectExpandControl/TreeSelectExpandControl.js +1 -1
  201. package/dist/components/TreeView/TreeView.cjs +1 -1
  202. package/dist/components/TreeView/TreeView.js +3 -2
  203. package/dist/components/TreeView/components/TreeViewExpandControl/TreeViewExpandControl.cjs +1 -1
  204. package/dist/components/TreeView/components/TreeViewExpandControl/TreeViewExpandControl.js +1 -1
  205. package/dist/components/TreeView/components/TreeViewNodeIcon/TreeViewNodeIcon.cjs +1 -1
  206. package/dist/components/TreeView/components/TreeViewNodeIcon/TreeViewNodeIcon.js +1 -1
  207. package/dist/components/index.cjs +1 -1
  208. package/dist/components/index.d.ts +2 -2
  209. package/dist/components/index.js +409 -406
  210. package/dist/constants/generals.const.cjs +1 -1
  211. package/dist/constants/generals.const.d.ts +4 -0
  212. package/dist/constants/generals.const.js +50 -47
  213. package/dist/icons.cjs +1 -1
  214. package/dist/icons.d.ts +2 -2
  215. package/dist/icons.js +1 -6
  216. package/dist/index.cjs +1 -1
  217. package/dist/index.js +551 -548
  218. package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.cjs +1 -0
  219. package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.const.cjs +1 -0
  220. package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.const.js +14 -0
  221. package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.js +35 -0
  222. package/dist/node_modules/@forgedevstack/bear-icons/dist/action.cjs +1 -0
  223. package/dist/node_modules/@forgedevstack/bear-icons/dist/action.js +26 -0
  224. package/dist/node_modules/@forgedevstack/bear-icons/dist/cn.utils.cjs +1 -0
  225. package/dist/node_modules/@forgedevstack/bear-icons/dist/cn.utils.js +4 -0
  226. package/dist/node_modules/@forgedevstack/bear-icons/dist/editor.cjs +1 -0
  227. package/dist/node_modules/@forgedevstack/bear-icons/dist/editor.js +130 -0
  228. package/dist/node_modules/@forgedevstack/bear-icons/dist/misc.cjs +1 -0
  229. package/dist/node_modules/@forgedevstack/bear-icons/dist/misc.js +12 -0
  230. package/dist/node_modules/@forgedevstack/bear-icons/dist/navigation.cjs +1 -0
  231. package/dist/node_modules/@forgedevstack/bear-icons/dist/navigation.js +18 -0
  232. package/dist/node_modules/@forgedevstack/bear-icons/dist/status.cjs +1 -0
  233. package/dist/node_modules/@forgedevstack/bear-icons/dist/status.js +6 -0
  234. package/dist/styles/_drawer.css +213 -0
  235. package/dist/styles/_overlays.css +0 -1
  236. package/dist/styles/main.css +1 -0
  237. package/dist/styles.css +226 -25
  238. package/package.json +5 -1
  239. package/dist/components/Icon/Icon.cjs +0 -1
  240. package/dist/components/Icon/Icon.const.d.ts +0 -1
  241. package/dist/components/Icon/Icon.js +0 -45
  242. package/dist/components/Icon/icons/action.cjs +0 -1
  243. package/dist/components/Icon/icons/action.js +0 -351
  244. package/dist/components/Icon/icons/bear.cjs +0 -1
  245. package/dist/components/Icon/icons/bear.js +0 -47
  246. package/dist/components/Icon/icons/commerce.cjs +0 -1
  247. package/dist/components/Icon/icons/commerce.js +0 -124
  248. package/dist/components/Icon/icons/communication.cjs +0 -1
  249. package/dist/components/Icon/icons/communication.js +0 -184
  250. package/dist/components/Icon/icons/content.cjs +0 -1
  251. package/dist/components/Icon/icons/content.js +0 -231
  252. package/dist/components/Icon/icons/device.cjs +0 -1
  253. package/dist/components/Icon/icons/device.js +0 -122
  254. package/dist/components/Icon/icons/editor.cjs +0 -1
  255. package/dist/components/Icon/icons/editor.js +0 -285
  256. package/dist/components/Icon/icons/file.cjs +0 -1
  257. package/dist/components/Icon/icons/file.js +0 -120
  258. package/dist/components/Icon/icons/media.cjs +0 -1
  259. package/dist/components/Icon/icons/media.js +0 -306
  260. package/dist/components/Icon/icons/misc.cjs +0 -1
  261. package/dist/components/Icon/icons/misc.js +0 -450
  262. package/dist/components/Icon/icons/navigation.cjs +0 -1
  263. package/dist/components/Icon/icons/navigation.js +0 -215
  264. package/dist/components/Icon/icons/social.cjs +0 -1
  265. package/dist/components/Icon/icons/social.js +0 -89
  266. package/dist/components/Icon/icons/status.cjs +0 -1
  267. package/dist/components/Icon/icons/status.js +0 -271
  268. package/dist/components/Icon/index.cjs +0 -1
  269. package/dist/components/Icon/index.js +0 -79
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),T=require("../../utils/cn.cjs");require("react");const x=require("../../utils/useBearId.cjs"),D=require("../Typography/Typography.cjs"),i=require("../Flex/Flex.cjs"),r=require("./Gauge.const.cjs"),L=require("./hooks/useGauge.cjs"),b=require("./helpers/GaugeArcSvg.cjs"),F=u=>{const{value:c,min:l=r.GAUGE_DEFAULT_MIN,max:o=r.GAUGE_DEFAULT_MAX,size:t=r.GAUGE_DEFAULT_SIZE,strokeWidth:s=r.GAUGE_DEFAULT_STROKE_WIDTH,color:g=r.GAUGE_DEFAULT_COLOR,trackColor:d,showLabel:A=!0,label:G,animated:_=!0,fillDurationMs:E=r.GAUGE_DEFAULT_FILL_DURATION_MS,arcAngle:U=r.GAUGE_DEFAULT_ARC_ANGLE,gradient:n,className:h,...m}=u,f=x.useBearId("Gauge","gradient"),e=L.useGauge({value:c,min:l,max:o,strokeWidth:s,arcAngle:U,animated:_,fillDurationMs:E});return a.jsxs(i.Flex,{align:"center",justify:"center",className:T.cn("bear-relative bear-inline-flex",h),style:{width:t,height:t},...m,children:[a.jsx(b.GaugeArcSvg,{radius:e.radius,strokeWidth:s,circumference:e.circumference,dashOffset:e.dashOffset,startAngle:e.startAngle,color:g,trackColor:d,gradientId:n?f:void 0,gradient:n,animated:e.animated,fillDurationMs:e.fillDurationMs}),A&&a.jsx(i.Flex,{align:"center",justify:"center",className:"bear-absolute bear-inset-0",children:G||a.jsxs(D.Typography,{variant:"h4",className:"bear-text-[var(--bear-text-primary)]",children:[Math.round(e.percentage),"%"]})})]})};exports.Gauge=F;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),_=require("../../utils/cn.cjs");require("react");const I=require("../../utils/useBearId.cjs"),N=require("../Typography/Typography.cjs"),i=require("../Flex/Flex.cjs"),e=require("./Gauge.const.cjs"),D=require("./hooks/useGauge.cjs"),b=require("./helpers/GaugeArcSvg.cjs"),R=require("./helpers/GaugeLinearBar.cjs"),y=s=>{const{value:E,min:U=e.GAUGE_DEFAULT_MIN,max:f=e.GAUGE_DEFAULT_MAX,size:t=e.GAUGE_DEFAULT_SIZE,strokeWidth:c=e.GAUGE_DEFAULT_STROKE_WIDTH,color:l=e.GAUGE_DEFAULT_COLOR,trackColor:u,showLabel:A=!0,label:G,animated:m=!0,fillDurationMs:h=e.GAUGE_DEFAULT_FILL_DURATION_MS,arcAngle:x=e.GAUGE_DEFAULT_ARC_ANGLE,variant:g=e.GAUGE_VARIANT_ARC,gradient:n,className:o,...d}=s,L=g===e.GAUGE_VARIANT_RING?s.arcAngle??e.GAUGE_RING_ARC_ANGLE:x,T=I.useBearId("Gauge","gradient"),r=D.useGauge({value:E,min:U,max:f,strokeWidth:c,arcAngle:L,animated:m,fillDurationMs:h});return g===e.GAUGE_VARIANT_LINEAR?a.jsx(i.Flex,{align:"center",justify:"center",className:_.cn("bear-relative bear-inline-flex",o),style:{width:t},...d,children:a.jsx(R.GaugeLinearBar,{percentage:r.percentage,color:l,trackColor:u,gradient:n,animated:r.animated,fillDurationMs:r.fillDurationMs,showLabel:A,label:G})}):a.jsxs(i.Flex,{align:"center",justify:"center",className:_.cn("bear-relative bear-inline-flex",o),style:{width:t,height:t},...d,children:[a.jsx(b.GaugeArcSvg,{radius:r.radius,strokeWidth:c,circumference:r.circumference,dashOffset:r.dashOffset,startAngle:r.startAngle,color:l,trackColor:u,gradientId:n?T:void 0,gradient:n,animated:r.animated,fillDurationMs:r.fillDurationMs}),A&&a.jsx(i.Flex,{align:"center",justify:"center",className:"bear-absolute bear-inset-0",children:G||a.jsxs(N.Typography,{variant:"h4",className:"bear-text-[var(--bear-text-primary)]",children:[Math.round(r.percentage),"%"]})})]})};exports.Gauge=y;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=0,E=100,_=120,G=10,U="var(--bear-primary-500, #ec4899)",T=270,L=900,D=50,I="cubic-bezier(0.4, 0, 0.2, 1)";exports.GAUGE_ANIMATION_EASING=I;exports.GAUGE_DEFAULT_ARC_ANGLE=T;exports.GAUGE_DEFAULT_COLOR=U;exports.GAUGE_DEFAULT_FILL_DURATION_MS=L;exports.GAUGE_DEFAULT_MAX=E;exports.GAUGE_DEFAULT_MIN=A;exports.GAUGE_DEFAULT_SIZE=_;exports.GAUGE_DEFAULT_STROKE_WIDTH=G;exports.GAUGE_VIEWBOX_CENTER=D;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=0,G=100,_=120,E=10,U="var(--bear-primary-500, #ec4899)",T=270,I=900,N=50,R="cubic-bezier(0.4, 0, 0.2, 1)",L="arc",c="linear",t="ring",n=360,o=8;exports.GAUGE_ANIMATION_EASING=R;exports.GAUGE_DEFAULT_ARC_ANGLE=T;exports.GAUGE_DEFAULT_COLOR=U;exports.GAUGE_DEFAULT_FILL_DURATION_MS=I;exports.GAUGE_DEFAULT_MAX=G;exports.GAUGE_DEFAULT_MIN=A;exports.GAUGE_DEFAULT_SIZE=_;exports.GAUGE_DEFAULT_STROKE_WIDTH=E;exports.GAUGE_LINEAR_TRACK_HEIGHT=o;exports.GAUGE_RING_ARC_ANGLE=n;exports.GAUGE_VARIANT_ARC=L;exports.GAUGE_VARIANT_LINEAR=c;exports.GAUGE_VARIANT_RING=t;exports.GAUGE_VIEWBOX_CENTER=N;
@@ -7,3 +7,8 @@ export declare const GAUGE_DEFAULT_ARC_ANGLE = 270;
7
7
  export declare const GAUGE_DEFAULT_FILL_DURATION_MS = 900;
8
8
  export declare const GAUGE_VIEWBOX_CENTER = 50;
9
9
  export declare const GAUGE_ANIMATION_EASING = "cubic-bezier(0.4, 0, 0.2, 1)";
10
+ export declare const GAUGE_VARIANT_ARC = "arc";
11
+ export declare const GAUGE_VARIANT_LINEAR = "linear";
12
+ export declare const GAUGE_VARIANT_RING = "ring";
13
+ export declare const GAUGE_RING_ARC_ANGLE = 360;
14
+ export declare const GAUGE_LINEAR_TRACK_HEIGHT = 8;
@@ -1,12 +1,17 @@
1
- const A = 0, E = 100, _ = 120, G = 10, U = "var(--bear-primary-500, #ec4899)", c = 270, T = 900, L = 50, o = "cubic-bezier(0.4, 0, 0.2, 1)";
1
+ const A = 0, G = 100, _ = 120, E = 10, U = "var(--bear-primary-500, #ec4899)", c = 270, I = 900, T = 50, n = "cubic-bezier(0.4, 0, 0.2, 1)", o = "arc", t = "linear", N = "ring", R = 360, s = 8;
2
2
  export {
3
- o as GAUGE_ANIMATION_EASING,
3
+ n as GAUGE_ANIMATION_EASING,
4
4
  c as GAUGE_DEFAULT_ARC_ANGLE,
5
5
  U as GAUGE_DEFAULT_COLOR,
6
- T as GAUGE_DEFAULT_FILL_DURATION_MS,
7
- E as GAUGE_DEFAULT_MAX,
6
+ I as GAUGE_DEFAULT_FILL_DURATION_MS,
7
+ G as GAUGE_DEFAULT_MAX,
8
8
  A as GAUGE_DEFAULT_MIN,
9
9
  _ as GAUGE_DEFAULT_SIZE,
10
- G as GAUGE_DEFAULT_STROKE_WIDTH,
11
- L as GAUGE_VIEWBOX_CENTER
10
+ E as GAUGE_DEFAULT_STROKE_WIDTH,
11
+ s as GAUGE_LINEAR_TRACK_HEIGHT,
12
+ R as GAUGE_RING_ARC_ANGLE,
13
+ o as GAUGE_VARIANT_ARC,
14
+ t as GAUGE_VARIANT_LINEAR,
15
+ N as GAUGE_VARIANT_RING,
16
+ T as GAUGE_VIEWBOX_CENTER
12
17
  };
@@ -1,3 +1,2 @@
1
- import { FC } from 'react';
2
1
  import { GaugeProps } from './Gauge.types';
3
- export declare const Gauge: FC<GaugeProps>;
2
+ export declare const Gauge: (props: GaugeProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,70 +1,94 @@
1
- import { jsxs as i, jsx as n } from "react/jsx-runtime";
2
- import { cn as h } from "../../utils/cn.js";
1
+ import { jsx as r, jsxs as _ } from "react/jsx-runtime";
2
+ import { cn as d } from "../../utils/cn.js";
3
3
  import "react";
4
4
  import { useBearId as D } from "../../utils/useBearId.js";
5
- import { Typography as L } from "../Typography/Typography.js";
6
- import { Flex as s } from "../Flex/Flex.js";
7
- import { GAUGE_DEFAULT_MIN as T, GAUGE_DEFAULT_MAX as b, GAUGE_DEFAULT_SIZE as F, GAUGE_DEFAULT_STROKE_WIDTH as x, GAUGE_DEFAULT_COLOR as I, GAUGE_DEFAULT_FILL_DURATION_MS as M, GAUGE_DEFAULT_ARC_ANGLE as N } from "./Gauge.const.js";
8
- import { useGauge as v } from "./hooks/useGauge.js";
9
- import { GaugeArcSvg as y } from "./helpers/GaugeArcSvg.js";
10
- const B = (o) => {
5
+ import { Typography as I } from "../Typography/Typography.js";
6
+ import { Flex as i } from "../Flex/Flex.js";
7
+ import { GAUGE_DEFAULT_MIN as T, GAUGE_DEFAULT_MAX as R, GAUGE_DEFAULT_SIZE as b, GAUGE_DEFAULT_STROKE_WIDTH as v, GAUGE_DEFAULT_COLOR as x, GAUGE_DEFAULT_FILL_DURATION_MS as F, GAUGE_DEFAULT_ARC_ANGLE as M, GAUGE_VARIANT_ARC as y, GAUGE_VARIANT_RING as O, GAUGE_RING_ARC_ANGLE as j, GAUGE_VARIANT_LINEAR as C } from "./Gauge.const.js";
8
+ import { useGauge as S } from "./hooks/useGauge.js";
9
+ import { GaugeArcSvg as w } from "./helpers/GaugeArcSvg.js";
10
+ import { GaugeLinearBar as V } from "./helpers/GaugeLinearBar.js";
11
+ const P = (n) => {
11
12
  const {
12
- value: l,
13
- min: m = T,
14
- max: c = b,
15
- size: r = F,
16
- strokeWidth: a = x,
17
- color: u = I,
18
- trackColor: A,
19
- showLabel: d = !0,
20
- label: f,
21
- animated: g = !0,
22
- fillDurationMs: G = M,
23
- arcAngle: _ = N,
13
+ value: f,
14
+ min: g = T,
15
+ max: E = R,
16
+ size: a = b,
17
+ strokeWidth: l = v,
18
+ color: s = x,
19
+ trackColor: o,
20
+ showLabel: A = !0,
21
+ label: c,
22
+ animated: U = !0,
23
+ fillDurationMs: h = F,
24
+ arcAngle: p = M,
25
+ variant: m = y,
24
26
  gradient: t,
25
- className: E,
26
- ...U
27
- } = o, p = D("Gauge", "gradient"), e = v({
28
- value: l,
29
- min: m,
30
- max: c,
31
- strokeWidth: a,
32
- arcAngle: _,
33
- animated: g,
34
- fillDurationMs: G
27
+ className: G,
28
+ ...u
29
+ } = n, L = m === O ? n.arcAngle ?? j : p, N = D("Gauge", "gradient"), e = S({
30
+ value: f,
31
+ min: g,
32
+ max: E,
33
+ strokeWidth: l,
34
+ arcAngle: L,
35
+ animated: U,
36
+ fillDurationMs: h
35
37
  });
36
- return /* @__PURE__ */ i(
37
- s,
38
+ return m === C ? /* @__PURE__ */ r(
39
+ i,
38
40
  {
39
41
  align: "center",
40
42
  justify: "center",
41
- className: h("bear-relative bear-inline-flex", E),
42
- style: { width: r, height: r },
43
- ...U,
43
+ className: d("bear-relative bear-inline-flex", G),
44
+ style: { width: a },
45
+ ...u,
46
+ children: /* @__PURE__ */ r(
47
+ V,
48
+ {
49
+ percentage: e.percentage,
50
+ color: s,
51
+ trackColor: o,
52
+ gradient: t,
53
+ animated: e.animated,
54
+ fillDurationMs: e.fillDurationMs,
55
+ showLabel: A,
56
+ label: c
57
+ }
58
+ )
59
+ }
60
+ ) : /* @__PURE__ */ _(
61
+ i,
62
+ {
63
+ align: "center",
64
+ justify: "center",
65
+ className: d("bear-relative bear-inline-flex", G),
66
+ style: { width: a, height: a },
67
+ ...u,
44
68
  children: [
45
- /* @__PURE__ */ n(
46
- y,
69
+ /* @__PURE__ */ r(
70
+ w,
47
71
  {
48
72
  radius: e.radius,
49
- strokeWidth: a,
73
+ strokeWidth: l,
50
74
  circumference: e.circumference,
51
75
  dashOffset: e.dashOffset,
52
76
  startAngle: e.startAngle,
53
- color: u,
54
- trackColor: A,
55
- gradientId: t ? p : void 0,
77
+ color: s,
78
+ trackColor: o,
79
+ gradientId: t ? N : void 0,
56
80
  gradient: t,
57
81
  animated: e.animated,
58
82
  fillDurationMs: e.fillDurationMs
59
83
  }
60
84
  ),
61
- d && /* @__PURE__ */ n(
62
- s,
85
+ A && /* @__PURE__ */ r(
86
+ i,
63
87
  {
64
88
  align: "center",
65
89
  justify: "center",
66
90
  className: "bear-absolute bear-inset-0",
67
- children: f || /* @__PURE__ */ i(L, { variant: "h4", className: "bear-text-[var(--bear-text-primary)]", children: [
91
+ children: c || /* @__PURE__ */ _(I, { variant: "h4", className: "bear-text-[var(--bear-text-primary)]", children: [
68
92
  Math.round(e.percentage),
69
93
  "%"
70
94
  ] })
@@ -75,5 +99,5 @@ const B = (o) => {
75
99
  );
76
100
  };
77
101
  export {
78
- B as Gauge
102
+ P as Gauge
79
103
  };
@@ -24,8 +24,17 @@ export interface GaugeProps extends HTMLAttributes<HTMLDivElement> {
24
24
  animated?: boolean;
25
25
  /** Fill transition duration in ms when animated */
26
26
  fillDurationMs?: number;
27
- /** Arc angle (180 for half, 270 for 3/4, 360 for full) */
28
27
  arcAngle?: number;
29
- /** Gradient colors [start, end] */
28
+ variant?: 'arc' | 'linear' | 'ring';
30
29
  gradient?: [string, string];
31
30
  }
31
+ export interface GaugeLinearBarProps {
32
+ percentage: number;
33
+ color: string;
34
+ trackColor?: string;
35
+ gradient?: [string, string];
36
+ animated: boolean;
37
+ fillDurationMs: number;
38
+ showLabel: boolean;
39
+ label?: ReactNode;
40
+ }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("../../Flex/Flex.cjs"),n=require("../../Box/Box.cjs"),b=require("../../Typography/Typography.cjs"),i=require("../Gauge.const.cjs"),h=t=>{const{percentage:o,color:l,trackColor:u,gradient:r,animated:a,fillDurationMs:s,showLabel:c,label:d}=t;return e.jsxs(g.Flex,{direction:"column",gap:2,className:"Bear-Gauge Bear-Gauge--linear bear-w-full",children:[e.jsx(n.Box,{className:"Bear-Gauge__linear-track bear-w-full bear-overflow-hidden bear-rounded-full",style:{height:i.GAUGE_LINEAR_TRACK_HEIGHT,backgroundColor:u??"var(--bear-border-default)"},children:e.jsx(n.Box,{className:"Bear-Gauge__linear-fill bear-h-full bear-rounded-full",style:{width:`${o}%`,background:r?`linear-gradient(90deg, ${r[0]}, ${r[1]})`:l,transitionProperty:a?"width":void 0,transitionDuration:a?`${s}ms`:void 0,transitionTimingFunction:a?i.GAUGE_ANIMATION_EASING:void 0}})}),c&&(d||e.jsxs(b.Typography,{variant:"caption",color:"muted",children:[Math.round(o),"%"]}))]})};exports.GaugeLinearBar=h;
@@ -0,0 +1,2 @@
1
+ import { GaugeLinearBarProps } from '../Gauge.types';
2
+ export declare const GaugeLinearBar: (props: GaugeLinearBarProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,40 @@
1
+ import { jsxs as o, jsx as i } from "react/jsx-runtime";
2
+ import { Flex as m } from "../../Flex/Flex.js";
3
+ import { Box as l } from "../../Box/Box.js";
4
+ import { Typography as g } from "../../Typography/Typography.js";
5
+ import { GAUGE_LINEAR_TRACK_HEIGHT as f, GAUGE_ANIMATION_EASING as b } from "../Gauge.const.js";
6
+ const N = (n) => {
7
+ const { percentage: e, color: t, trackColor: d, gradient: r, animated: a, fillDurationMs: u, showLabel: c, label: s } = n;
8
+ return /* @__PURE__ */ o(m, { direction: "column", gap: 2, className: "Bear-Gauge Bear-Gauge--linear bear-w-full", children: [
9
+ /* @__PURE__ */ i(
10
+ l,
11
+ {
12
+ className: "Bear-Gauge__linear-track bear-w-full bear-overflow-hidden bear-rounded-full",
13
+ style: {
14
+ height: f,
15
+ backgroundColor: d ?? "var(--bear-border-default)"
16
+ },
17
+ children: /* @__PURE__ */ i(
18
+ l,
19
+ {
20
+ className: "Bear-Gauge__linear-fill bear-h-full bear-rounded-full",
21
+ style: {
22
+ width: `${e}%`,
23
+ background: r ? `linear-gradient(90deg, ${r[0]}, ${r[1]})` : t,
24
+ transitionProperty: a ? "width" : void 0,
25
+ transitionDuration: a ? `${u}ms` : void 0,
26
+ transitionTimingFunction: a ? b : void 0
27
+ }
28
+ }
29
+ )
30
+ }
31
+ ),
32
+ c && (s || /* @__PURE__ */ o(g, { variant: "caption", color: "muted", children: [
33
+ Math.round(e),
34
+ "%"
35
+ ] }))
36
+ ] });
37
+ };
38
+ export {
39
+ N as GaugeLinearBar
40
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),l=require("react"),S=require("../../utils/cn.cjs"),W=require("../Popover/Popover.cjs"),N=require("../Typography/Typography.cjs"),o=require("./Heatmap.const.cjs"),k=require("./Heatmap.utils.cjs"),I=({data:v,startDate:d,endDate:h,colorScale:u=o.DEFAULT_COLOR_SCALE,cellSize:m=o.DEFAULT_CELL_SIZE,cellGap:p=o.DEFAULT_CELL_GAP,showDayLabels:y=!0,showMonthLabels:b=!0,emptyColor:L,tooltipFormat:E,onCellClick:x,renderTooltip:i,testId:D,className:O,...q})=>{const[g,H]=l.useState(null),[P,_]=l.useState(!1),R=l.useRef(new Map),{weeks:M,dataMap:T,maxValue:f}=l.useMemo(()=>{const e=h?new Date(h):new Date,a=d?new Date(d):new Date(e.getFullYear()-1,e.getMonth(),e.getDate()),c=new Map;let r=0;for(const n of v)c.set(n.date,n),n.value>r&&(r=n.value);return{weeks:k.getWeeks(a,e),dataMap:c,maxValue:r}},[v,d,h]),C=l.useCallback(e=>{if(e===0||f===0)return L??o.DEFAULT_EMPTY_COLOR;const a=Math.min(Math.floor(e/f*(u.length-1)),u.length-1);return u[a]},[f,L,u]),j=y?28:0,F=l.useCallback(e=>{!e||!i||(H(e),_(!0))},[i]),U=l.useCallback(()=>{_(!1),H(null)},[]);return s.jsxs("div",{className:S.cn("Bear-Heatmap relative inline-block",O),"data-testid":D,...q,children:[b&&s.jsx("div",{className:"Bear-Heatmap__months flex mb-1",style:{paddingLeft:j},children:M.map((e,a)=>{const c=e[0],r=a===0||c.getDate()<=o.DAYS_IN_WEEK;return s.jsx(N.Typography,{variant:"caption",className:"Bear-Heatmap__month text-gray-400 dark:text-gray-500 text-[10px]",style:{width:m+p,textAlign:"left"},children:r?o.MONTH_LABELS[c.getMonth()]:""},a)})}),s.jsxs("div",{className:"Bear-Heatmap__grid flex",children:[y&&s.jsx("div",{className:"Bear-Heatmap__days flex flex-col mr-1",style:{gap:p},children:o.DAY_LABELS.map((e,a)=>s.jsx(N.Typography,{variant:"caption",className:"Bear-Heatmap__day text-gray-400 dark:text-gray-500 text-[10px] flex items-center justify-end",style:{height:m,width:j-o.LABEL_PAD},children:e},a))}),s.jsx("div",{className:"Bear-Heatmap__weeks flex",style:{gap:p},children:M.map((e,a)=>s.jsx("div",{className:"Bear-Heatmap__week flex flex-col",style:{gap:p},children:e.map((c,r)=>{const n=k.toKey(c),t=T.get(n),w=(t==null?void 0:t.value)??0,Y=C(w),A=s.jsx("div",{ref:B=>{B&&R.current.set(n,B)},className:"Bear-Heatmap__cell rounded-sm cursor-pointer transition-transform hover:scale-125",style:{width:m,height:m,backgroundColor:Y},title:i?void 0:t?E?E(t):`${n}: ${w}`:n,onClick:()=>t&&(x==null?void 0:x(t)),onMouseEnter:()=>F(t),onMouseLeave:U},r);return i&&t&&(g==null?void 0:g.date)===t.date?s.jsx(W.Popover,{content:i(t),trigger:"hover",placement:"top",open:P,onOpenChange:_,arrow:!1,children:A},r):A})},a))})]})]})};exports.Heatmap=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),l=require("react"),N=require("../../utils/cn.cjs"),W=require("../Popover/Popover.cjs"),k=require("../Typography/Typography.cjs"),n=require("./Heatmap.const.cjs"),b=require("./Heatmap.utils.cjs"),K=({data:L,startDate:p,endDate:_,colorScale:u=n.DEFAULT_COLOR_SCALE,cellSize:d=n.DEFAULT_CELL_SIZE,cellGap:m=n.DEFAULT_CELL_GAP,showDayLabels:v=!0,showMonthLabels:C=!0,emptyColor:y,tooltipFormat:E,onCellClick:h,renderTooltip:i,cellShape:D=n.CELL_SHAPE_SQUARE,testId:O,className:P,...R})=>{const[x,H]=l.useState(null),[q,g]=l.useState(!1),S=l.useRef(new Map),{weeks:A,dataMap:T,maxValue:f}=l.useMemo(()=>{const e=_?new Date(_):new Date,a=p?new Date(p):new Date(e.getFullYear()-1,e.getMonth(),e.getDate()),c=new Map;let o=0;for(const r of L)c.set(r.date,r),r.value>o&&(o=r.value);return{weeks:b.getWeeks(a,e),dataMap:c,maxValue:o}},[L,p,_]),U=l.useCallback(e=>{if(e===0||f===0)return y??n.DEFAULT_EMPTY_COLOR;const a=Math.min(Math.floor(e/f*(u.length-1)),u.length-1);return u[a]},[f,y,u]),M=v?28:0,F=l.useCallback(e=>{!e||!i||(H(e),g(!0))},[i]),Y=l.useCallback(()=>{g(!1),H(null)},[]);return s.jsxs("div",{className:N.cn("Bear-Heatmap relative inline-block",P),"data-testid":O,...R,children:[C&&s.jsx("div",{className:"Bear-Heatmap__months flex mb-1",style:{paddingLeft:M},children:A.map((e,a)=>{const c=e[0],o=a===0||c.getDate()<=n.DAYS_IN_WEEK;return s.jsx(k.Typography,{variant:"caption",className:"Bear-Heatmap__month text-gray-400 dark:text-gray-500 text-[10px]",style:{width:d+m,textAlign:"left"},children:o?n.MONTH_LABELS[c.getMonth()]:""},a)})}),s.jsxs("div",{className:"Bear-Heatmap__grid flex",children:[v&&s.jsx("div",{className:"Bear-Heatmap__days flex flex-col mr-1",style:{gap:m},children:n.DAY_LABELS.map((e,a)=>s.jsx(k.Typography,{variant:"caption",className:"Bear-Heatmap__day text-gray-400 dark:text-gray-500 text-[10px] flex items-center justify-end",style:{height:d,width:M-n.LABEL_PAD},children:e},a))}),s.jsx("div",{className:"Bear-Heatmap__weeks flex",style:{gap:m},children:A.map((e,a)=>s.jsx("div",{className:"Bear-Heatmap__week flex flex-col",style:{gap:m},children:e.map((c,o)=>{const r=b.toKey(c),t=T.get(r),j=(t==null?void 0:t.value)??0,I=U(j),w=s.jsx("div",{ref:B=>{B&&S.current.set(r,B)},className:N.cn("Bear-Heatmap__cell cursor-pointer transition-transform hover:scale-125",D===n.CELL_SHAPE_CIRCLE?"rounded-full":"rounded-sm"),style:{width:d,height:d,backgroundColor:I},title:i?void 0:t?E?E(t):`${r}: ${j}`:r,onClick:()=>t&&(h==null?void 0:h(t)),onMouseEnter:()=>F(t),onMouseLeave:Y},o);return i&&t&&(x==null?void 0:x.date)===t.date?s.jsx(W.Popover,{content:i(t),trigger:"hover",placement:"top",open:q,onOpenChange:g,arrow:!1,children:w},o):w})},a))})]})]})};exports.Heatmap=K;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=12,E=3,A=["#161b22","#0e4429","#006d32","#26a641","#39d353"],_="#ebedf0",t=["","Mon","","Wed","","Fri",""],D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],e=7,o=4;exports.DAYS_IN_WEEK=e;exports.DAY_LABELS=t;exports.DEFAULT_CELL_GAP=E;exports.DEFAULT_CELL_SIZE=L;exports.DEFAULT_COLOR_SCALE=A;exports.DEFAULT_EMPTY_COLOR=_;exports.LABEL_PAD=o;exports.MONTH_LABELS=D;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=12,E=3,_=["#161b22","#0e4429","#006d32","#26a641","#39d353"],A="#ebedf0",S=["","Mon","","Wed","","Fri",""],C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],t=7,c=4,e="square",o="circle";exports.CELL_SHAPE_CIRCLE=o;exports.CELL_SHAPE_SQUARE=e;exports.DAYS_IN_WEEK=t;exports.DAY_LABELS=S;exports.DEFAULT_CELL_GAP=E;exports.DEFAULT_CELL_SIZE=L;exports.DEFAULT_COLOR_SCALE=_;exports.DEFAULT_EMPTY_COLOR=A;exports.LABEL_PAD=c;exports.MONTH_LABELS=C;
@@ -6,3 +6,5 @@ export declare const DAY_LABELS: string[];
6
6
  export declare const MONTH_LABELS: string[];
7
7
  export declare const DAYS_IN_WEEK = 7;
8
8
  export declare const LABEL_PAD = 4;
9
+ export declare const CELL_SHAPE_SQUARE = "square";
10
+ export declare const CELL_SHAPE_CIRCLE = "circle";
@@ -1,11 +1,13 @@
1
- const L = 12, A = 3, E = ["#161b22", "#0e4429", "#006d32", "#26a641", "#39d353"], _ = "#ebedf0", n = ["", "Mon", "", "Wed", "", "Fri", ""], o = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], c = 7, t = 4;
1
+ const L = 12, E = 3, A = ["#161b22", "#0e4429", "#006d32", "#26a641", "#39d353"], _ = "#ebedf0", c = ["", "Mon", "", "Wed", "", "Fri", ""], n = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], o = 7, t = 4, s = "square", e = "circle";
2
2
  export {
3
- c as DAYS_IN_WEEK,
4
- n as DAY_LABELS,
5
- A as DEFAULT_CELL_GAP,
3
+ e as CELL_SHAPE_CIRCLE,
4
+ s as CELL_SHAPE_SQUARE,
5
+ o as DAYS_IN_WEEK,
6
+ c as DAY_LABELS,
7
+ E as DEFAULT_CELL_GAP,
6
8
  L as DEFAULT_CELL_SIZE,
7
- E as DEFAULT_COLOR_SCALE,
9
+ A as DEFAULT_COLOR_SCALE,
8
10
  _ as DEFAULT_EMPTY_COLOR,
9
11
  t as LABEL_PAD,
10
- o as MONTH_LABELS
12
+ n as MONTH_LABELS
11
13
  };
@@ -1,103 +1,107 @@
1
1
  import { jsxs as N, jsx as s } from "react/jsx-runtime";
2
- import { useState as D, useRef as I, useMemo as K, useCallback as g } from "react";
3
- import { cn as V } from "../../utils/cn.js";
2
+ import { useState as D, useRef as K, useMemo as V, useCallback as g } from "react";
3
+ import { cn as k } from "../../utils/cn.js";
4
4
  import { Popover as $ } from "../Popover/Popover.js";
5
- import { Typography as k } from "../Typography/Typography.js";
6
- import { DEFAULT_EMPTY_COLOR as Z, DEFAULT_COLOR_SCALE as q, DAYS_IN_WEEK as J, MONTH_LABELS as Q, DEFAULT_CELL_SIZE as S, DEFAULT_CELL_GAP as X, DAY_LABELS as G, LABEL_PAD as z } from "./Heatmap.const.js";
7
- import { getWeeks as ee, toKey as te } from "./Heatmap.utils.js";
8
- const le = ({
9
- data: x,
5
+ import { Typography as O } from "../Typography/Typography.js";
6
+ import { DEFAULT_EMPTY_COLOR as Q, DEFAULT_COLOR_SCALE as Z, DAYS_IN_WEEK as q, MONTH_LABELS as J, DEFAULT_CELL_SIZE as X, DEFAULT_CELL_GAP as G, DAY_LABELS as z, LABEL_PAD as ee, CELL_SHAPE_SQUARE as te, CELL_SHAPE_CIRCLE as ae } from "./Heatmap.const.js";
7
+ import { getWeeks as re, toKey as ne } from "./Heatmap.utils.js";
8
+ const de = ({
9
+ data: L,
10
10
  startDate: p,
11
11
  endDate: d,
12
- colorScale: i = q,
13
- cellSize: l = S,
14
- cellGap: c = X,
15
- showDayLabels: v = !0,
16
- showMonthLabels: O = !0,
17
- emptyColor: L,
18
- tooltipFormat: y,
12
+ colorScale: i = Z,
13
+ cellSize: l = X,
14
+ cellGap: c = G,
15
+ showDayLabels: x = !0,
16
+ showMonthLabels: C = !0,
17
+ emptyColor: E,
18
+ tooltipFormat: v,
19
19
  onCellClick: f,
20
20
  renderTooltip: m,
21
- testId: b,
22
- className: P,
23
- ...F
21
+ cellShape: P = te,
22
+ testId: R,
23
+ className: b,
24
+ ...U
24
25
  }) => {
25
- const [h, E] = D(null), [R, u] = D(!1), U = I(/* @__PURE__ */ new Map()), { weeks: w, dataMap: Y, maxValue: _ } = K(() => {
26
+ const [_, y] = D(null), [F, u] = D(!1), Y = K(/* @__PURE__ */ new Map()), { weeks: A, dataMap: j, maxValue: h } = V(() => {
26
27
  const e = d ? new Date(d) : /* @__PURE__ */ new Date(), a = p ? new Date(p) : new Date(e.getFullYear() - 1, e.getMonth(), e.getDate()), o = /* @__PURE__ */ new Map();
27
28
  let n = 0;
28
- for (const r of x)
29
+ for (const r of L)
29
30
  o.set(r.date, r), r.value > n && (n = r.value);
30
- return { weeks: ee(a, e), dataMap: o, maxValue: n };
31
- }, [x, p, d]), j = g(
31
+ return { weeks: re(a, e), dataMap: o, maxValue: n };
32
+ }, [L, p, d]), I = g(
32
33
  (e) => {
33
- if (e === 0 || _ === 0) return L ?? Z;
34
- const a = Math.min(Math.floor(e / _ * (i.length - 1)), i.length - 1);
34
+ if (e === 0 || h === 0) return E ?? Q;
35
+ const a = Math.min(Math.floor(e / h * (i.length - 1)), i.length - 1);
35
36
  return i[a];
36
37
  },
37
- [_, L, i]
38
- ), A = v ? 28 : 0, C = g((e) => {
39
- !e || !m || (E(e), u(!0));
38
+ [h, E, i]
39
+ ), H = x ? 28 : 0, S = g((e) => {
40
+ !e || !m || (y(e), u(!0));
40
41
  }, [m]), T = g(() => {
41
- u(!1), E(null);
42
+ u(!1), y(null);
42
43
  }, []);
43
- return /* @__PURE__ */ N("div", { className: V("Bear-Heatmap relative inline-block", P), "data-testid": b, ...F, children: [
44
- O && /* @__PURE__ */ s("div", { className: "Bear-Heatmap__months flex mb-1", style: { paddingLeft: A }, children: w.map((e, a) => {
45
- const o = e[0], n = a === 0 || o.getDate() <= J;
44
+ return /* @__PURE__ */ N("div", { className: k("Bear-Heatmap relative inline-block", b), "data-testid": R, ...U, children: [
45
+ C && /* @__PURE__ */ s("div", { className: "Bear-Heatmap__months flex mb-1", style: { paddingLeft: H }, children: A.map((e, a) => {
46
+ const o = e[0], n = a === 0 || o.getDate() <= q;
46
47
  return /* @__PURE__ */ s(
47
- k,
48
+ O,
48
49
  {
49
50
  variant: "caption",
50
51
  className: "Bear-Heatmap__month text-gray-400 dark:text-gray-500 text-[10px]",
51
52
  style: { width: l + c, textAlign: "left" },
52
- children: n ? Q[o.getMonth()] : ""
53
+ children: n ? J[o.getMonth()] : ""
53
54
  },
54
55
  a
55
56
  );
56
57
  }) }),
57
58
  /* @__PURE__ */ N("div", { className: "Bear-Heatmap__grid flex", children: [
58
- v && /* @__PURE__ */ s("div", { className: "Bear-Heatmap__days flex flex-col mr-1", style: { gap: c }, children: G.map((e, a) => /* @__PURE__ */ s(
59
- k,
59
+ x && /* @__PURE__ */ s("div", { className: "Bear-Heatmap__days flex flex-col mr-1", style: { gap: c }, children: z.map((e, a) => /* @__PURE__ */ s(
60
+ O,
60
61
  {
61
62
  variant: "caption",
62
63
  className: "Bear-Heatmap__day text-gray-400 dark:text-gray-500 text-[10px] flex items-center justify-end",
63
- style: { height: l, width: A - z },
64
+ style: { height: l, width: H - ee },
64
65
  children: e
65
66
  },
66
67
  a
67
68
  )) }),
68
- /* @__PURE__ */ s("div", { className: "Bear-Heatmap__weeks flex", style: { gap: c }, children: w.map((e, a) => /* @__PURE__ */ s("div", { className: "Bear-Heatmap__week flex flex-col", style: { gap: c }, children: e.map((o, n) => {
69
- const r = te(o), t = Y.get(r), M = (t == null ? void 0 : t.value) ?? 0, W = j(M), B = /* @__PURE__ */ s(
69
+ /* @__PURE__ */ s("div", { className: "Bear-Heatmap__weeks flex", style: { gap: c }, children: A.map((e, a) => /* @__PURE__ */ s("div", { className: "Bear-Heatmap__week flex flex-col", style: { gap: c }, children: e.map((o, n) => {
70
+ const r = ne(o), t = j.get(r), w = (t == null ? void 0 : t.value) ?? 0, W = I(w), M = /* @__PURE__ */ s(
70
71
  "div",
71
72
  {
72
- ref: (H) => {
73
- H && U.current.set(r, H);
73
+ ref: (B) => {
74
+ B && Y.current.set(r, B);
74
75
  },
75
- className: "Bear-Heatmap__cell rounded-sm cursor-pointer transition-transform hover:scale-125",
76
+ className: k(
77
+ "Bear-Heatmap__cell cursor-pointer transition-transform hover:scale-125",
78
+ P === ae ? "rounded-full" : "rounded-sm"
79
+ ),
76
80
  style: { width: l, height: l, backgroundColor: W },
77
- title: m ? void 0 : t ? y ? y(t) : `${r}: ${M}` : r,
81
+ title: m ? void 0 : t ? v ? v(t) : `${r}: ${w}` : r,
78
82
  onClick: () => t && (f == null ? void 0 : f(t)),
79
- onMouseEnter: () => C(t),
83
+ onMouseEnter: () => S(t),
80
84
  onMouseLeave: T
81
85
  },
82
86
  n
83
87
  );
84
- return m && t && (h == null ? void 0 : h.date) === t.date ? /* @__PURE__ */ s(
88
+ return m && t && (_ == null ? void 0 : _.date) === t.date ? /* @__PURE__ */ s(
85
89
  $,
86
90
  {
87
91
  content: m(t),
88
92
  trigger: "hover",
89
93
  placement: "top",
90
- open: R,
94
+ open: F,
91
95
  onOpenChange: u,
92
96
  arrow: !1,
93
- children: B
97
+ children: M
94
98
  },
95
99
  n
96
- ) : B;
100
+ ) : M;
97
101
  }) }, a)) })
98
102
  ] })
99
103
  ] });
100
104
  };
101
105
  export {
102
- le as Heatmap
106
+ de as Heatmap
103
107
  };
@@ -30,6 +30,6 @@ export interface HeatmapProps extends Omit<HTMLAttributes<HTMLDivElement>, 'chil
30
30
  onCellClick?: (cell: HeatmapCell) => void;
31
31
  /** Render custom hover content per cell */
32
32
  renderTooltip?: (cell: HeatmapCell) => ReactNode;
33
- /** Test ID */
33
+ cellShape?: 'square' | 'circle';
34
34
  testId?: string;
35
35
  }
@@ -1,39 +1,2 @@
1
- import { FC } from 'react';
2
- import { IconProps } from './Icon.types';
3
- /**
4
- * Icon wrapper component for SVG icons
5
- * Allows customizing size, color, and animation
6
- *
7
- * @example
8
- * ```tsx
9
- * <Icon size="md" color="#f97316">
10
- * <path d="M12 2L2 7l10 5 10-5-10-5z" />
11
- * </Icon>
12
- *
13
- * // Or use the pre-made icons
14
- * <EmberIcon.Check size="sm" color="green" />
15
- * ```
16
- */
17
- export declare const Icon: FC<IconProps>;
18
- export declare const CheckIcon: FC<Omit<IconProps, 'children'>>;
19
- export declare const XIcon: FC<Omit<IconProps, 'children'>>;
20
- export declare const ChevronDownIcon: FC<Omit<IconProps, 'children'>>;
21
- export declare const ChevronRightIcon: FC<Omit<IconProps, 'children'>>;
22
- export declare const PlusIcon: FC<Omit<IconProps, 'children'>>;
23
- export declare const MinusIcon: FC<Omit<IconProps, 'children'>>;
24
- export declare const SearchIcon: FC<Omit<IconProps, 'children'>>;
25
- export declare const MenuIcon: FC<Omit<IconProps, 'children'>>;
26
- export declare const SettingsIcon: FC<Omit<IconProps, 'children'>>;
27
- export declare const BearPawIcon: FC<Omit<IconProps, 'children'>>;
28
- export declare const BearIcons: {
29
- Check: FC<Omit<IconProps, "children">>;
30
- X: FC<Omit<IconProps, "children">>;
31
- ChevronDown: FC<Omit<IconProps, "children">>;
32
- ChevronRight: FC<Omit<IconProps, "children">>;
33
- Plus: FC<Omit<IconProps, "children">>;
34
- Minus: FC<Omit<IconProps, "children">>;
35
- Search: FC<Omit<IconProps, "children">>;
36
- Menu: FC<Omit<IconProps, "children">>;
37
- Settings: FC<Omit<IconProps, "children">>;
38
- BearPaw: FC<Omit<IconProps, "children">>;
39
- };
1
+ export * from '@forgedevstack/bear-icons';
2
+ export { default } from '@forgedevstack/bear-icons';
@@ -1,17 +1 @@
1
- import { SVGAttributes, ReactNode } from 'react';
2
- import { BearSize } from '../../types';
3
- export interface IconProps extends SVGAttributes<SVGElement> {
4
- id?: string;
5
- /** Icon size */
6
- size?: BearSize | number;
7
- /** Icon color (CSS color value) */
8
- color?: string;
9
- /** Stroke width for stroke-based icons */
10
- strokeWidth?: number;
11
- /** Whether icon should spin */
12
- spin?: boolean;
13
- /** Test ID */
14
- testId?: string;
15
- /** The SVG path or children */
16
- children: ReactNode;
17
- }
1
+ export type { IconProps, IconSize } from '@forgedevstack/bear-icons';