@forgedevstack/bear 1.1.1 → 1.1.4

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 (276) hide show
  1. package/dist/components/ActionIcon/ActionIcon.cjs +1 -0
  2. package/dist/components/ActionIcon/ActionIcon.const.cjs +1 -0
  3. package/dist/components/ActionIcon/ActionIcon.const.d.ts +7 -0
  4. package/dist/components/ActionIcon/ActionIcon.const.js +68 -0
  5. package/dist/components/ActionIcon/ActionIcon.d.ts +4 -0
  6. package/dist/components/ActionIcon/ActionIcon.js +42 -0
  7. package/dist/components/ActionIcon/ActionIcon.types.d.ts +11 -0
  8. package/dist/components/ActionIcon/index.d.ts +2 -0
  9. package/dist/components/Affix/Affix.cjs +1 -0
  10. package/dist/components/Affix/Affix.const.cjs +1 -0
  11. package/dist/components/Affix/Affix.const.d.ts +6 -0
  12. package/dist/components/Affix/Affix.const.js +9 -0
  13. package/dist/components/Affix/Affix.d.ts +4 -0
  14. package/dist/components/Affix/Affix.js +69 -0
  15. package/dist/components/Affix/Affix.types.d.ts +10 -0
  16. package/dist/components/Affix/index.d.ts +2 -0
  17. package/dist/components/AlertDialog/AlertDialog.cjs +1 -0
  18. package/dist/components/AlertDialog/AlertDialog.const.cjs +1 -0
  19. package/dist/components/AlertDialog/AlertDialog.const.d.ts +5 -0
  20. package/dist/components/AlertDialog/AlertDialog.const.js +8 -0
  21. package/dist/components/AlertDialog/AlertDialog.d.ts +4 -0
  22. package/dist/components/AlertDialog/AlertDialog.js +107 -0
  23. package/dist/components/AlertDialog/AlertDialog.types.d.ts +34 -0
  24. package/dist/components/AlertDialog/index.d.ts +3 -0
  25. package/dist/components/Anchor/Anchor.cjs +1 -0
  26. package/dist/components/Anchor/Anchor.const.cjs +1 -0
  27. package/dist/components/Anchor/Anchor.const.d.ts +9 -0
  28. package/dist/components/Anchor/Anchor.const.js +11 -0
  29. package/dist/components/Anchor/Anchor.d.ts +4 -0
  30. package/dist/components/Anchor/Anchor.js +91 -0
  31. package/dist/components/Anchor/Anchor.types.d.ts +16 -0
  32. package/dist/components/Anchor/index.d.ts +2 -0
  33. package/dist/components/AspectRatio/AspectRatio.cjs +1 -0
  34. package/dist/components/AspectRatio/AspectRatio.d.ts +3 -0
  35. package/dist/components/AspectRatio/AspectRatio.js +29 -0
  36. package/dist/components/AspectRatio/AspectRatio.types.d.ts +9 -0
  37. package/dist/components/AspectRatio/index.d.ts +2 -0
  38. package/dist/components/Blockquote/Blockquote.cjs +1 -0
  39. package/dist/components/Blockquote/Blockquote.const.cjs +1 -0
  40. package/dist/components/Blockquote/Blockquote.const.d.ts +5 -0
  41. package/dist/components/Blockquote/Blockquote.const.js +19 -0
  42. package/dist/components/Blockquote/Blockquote.d.ts +4 -0
  43. package/dist/components/Blockquote/Blockquote.js +56 -0
  44. package/dist/components/Blockquote/Blockquote.types.d.ts +9 -0
  45. package/dist/components/Blockquote/index.d.ts +2 -0
  46. package/dist/components/Button/Button.cjs +1 -1
  47. package/dist/components/Button/Button.constants.cjs +2 -2
  48. package/dist/components/Button/Button.constants.d.ts +1 -0
  49. package/dist/components/Button/Button.constants.js +10 -3
  50. package/dist/components/Button/Button.js +92 -84
  51. package/dist/components/Button/Button.types.d.ts +2 -0
  52. package/dist/components/CheckboxCard/CheckboxCard.cjs +1 -0
  53. package/dist/components/CheckboxCard/CheckboxCard.const.cjs +1 -0
  54. package/dist/components/CheckboxCard/CheckboxCard.const.d.ts +7 -0
  55. package/dist/components/CheckboxCard/CheckboxCard.const.js +22 -0
  56. package/dist/components/CheckboxCard/CheckboxCard.d.ts +5 -0
  57. package/dist/components/CheckboxCard/CheckboxCard.js +132 -0
  58. package/dist/components/CheckboxCard/CheckboxCard.types.d.ts +21 -0
  59. package/dist/components/CheckboxCard/index.d.ts +2 -0
  60. package/dist/components/ColorPicker/ColorPicker.cjs +1 -1
  61. package/dist/components/ColorPicker/ColorPicker.const.cjs +1 -0
  62. package/dist/components/ColorPicker/ColorPicker.const.d.ts +26 -0
  63. package/dist/components/ColorPicker/ColorPicker.const.js +38 -0
  64. package/dist/components/ColorPicker/ColorPicker.js +61 -78
  65. package/dist/components/ColorSwatch/ColorSwatch.cjs +1 -0
  66. package/dist/components/ColorSwatch/ColorSwatch.const.cjs +1 -0
  67. package/dist/components/ColorSwatch/ColorSwatch.const.d.ts +16 -0
  68. package/dist/components/ColorSwatch/ColorSwatch.const.js +19 -0
  69. package/dist/components/ColorSwatch/ColorSwatch.d.ts +5 -0
  70. package/dist/components/ColorSwatch/ColorSwatch.js +92 -0
  71. package/dist/components/ColorSwatch/ColorSwatch.types.d.ts +23 -0
  72. package/dist/components/ColorSwatch/ColorSwatch.utils.cjs +1 -0
  73. package/dist/components/ColorSwatch/ColorSwatch.utils.d.ts +6 -0
  74. package/dist/components/ColorSwatch/ColorSwatch.utils.js +14 -0
  75. package/dist/components/ColorSwatch/index.d.ts +2 -0
  76. package/dist/components/ContextMenu/ContextMenu.cjs +1 -0
  77. package/dist/components/ContextMenu/ContextMenu.const.cjs +1 -0
  78. package/dist/components/ContextMenu/ContextMenu.const.d.ts +9 -0
  79. package/dist/components/ContextMenu/ContextMenu.const.js +12 -0
  80. package/dist/components/ContextMenu/ContextMenu.d.ts +4 -0
  81. package/dist/components/ContextMenu/ContextMenu.js +64 -0
  82. package/dist/components/ContextMenu/ContextMenu.types.d.ts +23 -0
  83. package/dist/components/ContextMenu/index.d.ts +2 -0
  84. package/dist/components/DateRangePicker/DateRangePicker.cjs +1 -0
  85. package/dist/components/DateRangePicker/DateRangePicker.const.cjs +1 -0
  86. package/dist/components/DateRangePicker/DateRangePicker.const.d.ts +27 -0
  87. package/dist/components/DateRangePicker/DateRangePicker.const.js +74 -0
  88. package/dist/components/DateRangePicker/DateRangePicker.d.ts +4 -0
  89. package/dist/components/DateRangePicker/DateRangePicker.js +115 -0
  90. package/dist/components/DateRangePicker/DateRangePicker.types.d.ts +26 -0
  91. package/dist/components/DateRangePicker/DateRangePicker.utils.cjs +1 -0
  92. package/dist/components/DateRangePicker/DateRangePicker.utils.d.ts +4 -0
  93. package/dist/components/DateRangePicker/DateRangePicker.utils.js +22 -0
  94. package/dist/components/DateRangePicker/index.d.ts +2 -0
  95. package/dist/components/Descriptions/Descriptions.cjs +1 -0
  96. package/dist/components/Descriptions/Descriptions.const.cjs +1 -0
  97. package/dist/components/Descriptions/Descriptions.const.d.ts +24 -0
  98. package/dist/components/Descriptions/Descriptions.const.js +27 -0
  99. package/dist/components/Descriptions/Descriptions.d.ts +4 -0
  100. package/dist/components/Descriptions/Descriptions.js +65 -0
  101. package/dist/components/Descriptions/Descriptions.types.d.ts +16 -0
  102. package/dist/components/Descriptions/index.d.ts +2 -0
  103. package/dist/components/Fieldset/Fieldset.cjs +1 -0
  104. package/dist/components/Fieldset/Fieldset.const.cjs +1 -0
  105. package/dist/components/Fieldset/Fieldset.const.d.ts +5 -0
  106. package/dist/components/Fieldset/Fieldset.const.js +16 -0
  107. package/dist/components/Fieldset/Fieldset.d.ts +4 -0
  108. package/dist/components/Fieldset/Fieldset.js +47 -0
  109. package/dist/components/Fieldset/Fieldset.types.d.ts +10 -0
  110. package/dist/components/Fieldset/index.d.ts +2 -0
  111. package/dist/components/FormField/FormField.cjs +1 -0
  112. package/dist/components/FormField/FormField.const.cjs +1 -0
  113. package/dist/components/FormField/FormField.const.d.ts +20 -0
  114. package/dist/components/FormField/FormField.const.js +23 -0
  115. package/dist/components/FormField/FormField.d.ts +3 -0
  116. package/dist/components/FormField/FormField.js +127 -0
  117. package/dist/components/FormField/FormField.types.d.ts +23 -0
  118. package/dist/components/FormField/index.d.ts +2 -0
  119. package/dist/components/ImageGallery/ImageGallery.cjs +1 -0
  120. package/dist/components/ImageGallery/ImageGallery.const.cjs +1 -0
  121. package/dist/components/ImageGallery/ImageGallery.const.d.ts +13 -0
  122. package/dist/components/ImageGallery/ImageGallery.const.js +16 -0
  123. package/dist/components/ImageGallery/ImageGallery.d.ts +4 -0
  124. package/dist/components/ImageGallery/ImageGallery.js +61 -0
  125. package/dist/components/ImageGallery/ImageGallery.types.d.ts +22 -0
  126. package/dist/components/ImageGallery/index.d.ts +2 -0
  127. package/dist/components/Indicator/Indicator.cjs +1 -0
  128. package/dist/components/Indicator/Indicator.const.cjs +1 -0
  129. package/dist/components/Indicator/Indicator.const.d.ts +15 -0
  130. package/dist/components/Indicator/Indicator.const.js +26 -0
  131. package/dist/components/Indicator/Indicator.d.ts +4 -0
  132. package/dist/components/Indicator/Indicator.js +56 -0
  133. package/dist/components/Indicator/Indicator.types.d.ts +16 -0
  134. package/dist/components/Indicator/index.d.ts +2 -0
  135. package/dist/components/InfiniteScroll/InfiniteScroll.cjs +1 -0
  136. package/dist/components/InfiniteScroll/InfiniteScroll.const.cjs +1 -0
  137. package/dist/components/InfiniteScroll/InfiniteScroll.const.d.ts +7 -0
  138. package/dist/components/InfiniteScroll/InfiniteScroll.const.js +10 -0
  139. package/dist/components/InfiniteScroll/InfiniteScroll.d.ts +4 -0
  140. package/dist/components/InfiniteScroll/InfiniteScroll.js +51 -0
  141. package/dist/components/InfiniteScroll/InfiniteScroll.types.d.ts +13 -0
  142. package/dist/components/InfiniteScroll/index.d.ts +2 -0
  143. package/dist/components/Input/Input.cjs +1 -1
  144. package/dist/components/Input/Input.js +114 -44
  145. package/dist/components/Input/Input.types.d.ts +20 -0
  146. package/dist/components/Input/Input.utils.cjs +1 -0
  147. package/dist/components/Input/Input.utils.d.ts +2 -0
  148. package/dist/components/Input/Input.utils.js +15 -0
  149. package/dist/components/Input/components/ClearIcon/ClearIcon.cjs +1 -0
  150. package/dist/components/Input/components/ClearIcon/ClearIcon.d.ts +7 -0
  151. package/dist/components/Input/components/ClearIcon/ClearIcon.js +25 -0
  152. package/dist/components/Input/components/ClearIcon/index.d.ts +1 -0
  153. package/dist/components/Input/index.d.ts +1 -1
  154. package/dist/components/InputGroup/InputGroup.cjs +1 -0
  155. package/dist/components/InputGroup/InputGroup.d.ts +4 -0
  156. package/dist/components/InputGroup/InputGroup.js +63 -0
  157. package/dist/components/InputGroup/InputGroup.types.d.ts +23 -0
  158. package/dist/components/InputGroup/index.d.ts +2 -0
  159. package/dist/components/LoadingOverlay/LoadingOverlay.cjs +1 -0
  160. package/dist/components/LoadingOverlay/LoadingOverlay.const.cjs +1 -0
  161. package/dist/components/LoadingOverlay/LoadingOverlay.const.d.ts +6 -0
  162. package/dist/components/LoadingOverlay/LoadingOverlay.const.js +9 -0
  163. package/dist/components/LoadingOverlay/LoadingOverlay.d.ts +4 -0
  164. package/dist/components/LoadingOverlay/LoadingOverlay.js +42 -0
  165. package/dist/components/LoadingOverlay/LoadingOverlay.types.d.ts +11 -0
  166. package/dist/components/LoadingOverlay/index.d.ts +2 -0
  167. package/dist/components/NumberFormatter/NumberFormatter.cjs +1 -0
  168. package/dist/components/NumberFormatter/NumberFormatter.const.cjs +1 -0
  169. package/dist/components/NumberFormatter/NumberFormatter.const.d.ts +5 -0
  170. package/dist/components/NumberFormatter/NumberFormatter.const.js +8 -0
  171. package/dist/components/NumberFormatter/NumberFormatter.d.ts +4 -0
  172. package/dist/components/NumberFormatter/NumberFormatter.js +53 -0
  173. package/dist/components/NumberFormatter/NumberFormatter.types.d.ts +20 -0
  174. package/dist/components/NumberFormatter/NumberFormatter.utils.cjs +1 -0
  175. package/dist/components/NumberFormatter/NumberFormatter.utils.d.ts +2 -0
  176. package/dist/components/NumberFormatter/NumberFormatter.utils.js +19 -0
  177. package/dist/components/NumberFormatter/index.d.ts +2 -0
  178. package/dist/components/PasswordInput/PasswordInput.cjs +1 -0
  179. package/dist/components/PasswordInput/PasswordInput.d.ts +3 -0
  180. package/dist/components/PasswordInput/PasswordInput.js +61 -0
  181. package/dist/components/PasswordInput/PasswordInput.types.d.ts +18 -0
  182. package/dist/components/PasswordInput/index.d.ts +2 -0
  183. package/dist/components/Popconfirm/Popconfirm.cjs +1 -0
  184. package/dist/components/Popconfirm/Popconfirm.const.cjs +1 -0
  185. package/dist/components/Popconfirm/Popconfirm.const.d.ts +13 -0
  186. package/dist/components/Popconfirm/Popconfirm.const.js +20 -0
  187. package/dist/components/Popconfirm/Popconfirm.d.ts +4 -0
  188. package/dist/components/Popconfirm/Popconfirm.js +65 -0
  189. package/dist/components/Popconfirm/Popconfirm.types.d.ts +16 -0
  190. package/dist/components/Popconfirm/index.d.ts +2 -0
  191. package/dist/components/RadioCard/RadioCard.cjs +1 -0
  192. package/dist/components/RadioCard/RadioCard.const.cjs +1 -0
  193. package/dist/components/RadioCard/RadioCard.const.d.ts +7 -0
  194. package/dist/components/RadioCard/RadioCard.const.js +22 -0
  195. package/dist/components/RadioCard/RadioCard.d.ts +5 -0
  196. package/dist/components/RadioCard/RadioCard.js +111 -0
  197. package/dist/components/RadioCard/RadioCard.types.d.ts +22 -0
  198. package/dist/components/RadioCard/index.d.ts +2 -0
  199. package/dist/components/ResizableTextarea/ResizableTextarea.cjs +1 -1
  200. package/dist/components/ResizableTextarea/ResizableTextarea.js +90 -54
  201. package/dist/components/ResizableTextarea/ResizableTextarea.types.d.ts +10 -0
  202. package/dist/components/Result/Result.cjs +1 -0
  203. package/dist/components/Result/Result.const.cjs +1 -0
  204. package/dist/components/Result/Result.const.d.ts +10 -0
  205. package/dist/components/Result/Result.const.js +20 -0
  206. package/dist/components/Result/Result.d.ts +4 -0
  207. package/dist/components/Result/Result.icons.cjs +1 -0
  208. package/dist/components/Result/Result.icons.d.ts +3 -0
  209. package/dist/components/Result/Result.icons.js +31 -0
  210. package/dist/components/Result/Result.js +35 -0
  211. package/dist/components/Result/Result.types.d.ts +10 -0
  212. package/dist/components/Result/index.d.ts +2 -0
  213. package/dist/components/RichEditor/RichEditor.cjs +1 -1
  214. package/dist/components/RichEditor/RichEditor.js +186 -169
  215. package/dist/components/RichEditor/RichEditor.types.d.ts +4 -0
  216. package/dist/components/RingProgress/RingProgress.cjs +1 -0
  217. package/dist/components/RingProgress/RingProgress.const.cjs +1 -0
  218. package/dist/components/RingProgress/RingProgress.const.d.ts +4 -0
  219. package/dist/components/RingProgress/RingProgress.const.js +7 -0
  220. package/dist/components/RingProgress/RingProgress.d.ts +4 -0
  221. package/dist/components/RingProgress/RingProgress.js +67 -0
  222. package/dist/components/RingProgress/RingProgress.types.d.ts +15 -0
  223. package/dist/components/RingProgress/index.d.ts +2 -0
  224. package/dist/components/SignPad/SignPad.cjs +1 -1
  225. package/dist/components/SignPad/SignPad.const.cjs +1 -1
  226. package/dist/components/SignPad/SignPad.const.js +10 -11
  227. package/dist/components/SignPad/SignPad.d.ts +4 -6
  228. package/dist/components/SignPad/SignPad.js +108 -116
  229. package/dist/components/SignPad/SignPad.types.d.ts +2 -2
  230. package/dist/components/SplitButton/SplitButton.cjs +1 -0
  231. package/dist/components/SplitButton/SplitButton.const.cjs +1 -0
  232. package/dist/components/SplitButton/SplitButton.const.d.ts +25 -0
  233. package/dist/components/SplitButton/SplitButton.const.js +27 -0
  234. package/dist/components/SplitButton/SplitButton.d.ts +4 -0
  235. package/dist/components/SplitButton/SplitButton.js +73 -0
  236. package/dist/components/SplitButton/SplitButton.types.d.ts +21 -0
  237. package/dist/components/SplitButton/index.d.ts +2 -0
  238. package/dist/components/Spoiler/Spoiler.cjs +1 -0
  239. package/dist/components/Spoiler/Spoiler.const.cjs +1 -0
  240. package/dist/components/Spoiler/Spoiler.const.d.ts +6 -0
  241. package/dist/components/Spoiler/Spoiler.const.js +9 -0
  242. package/dist/components/Spoiler/Spoiler.d.ts +4 -0
  243. package/dist/components/Spoiler/Spoiler.js +59 -0
  244. package/dist/components/Spoiler/Spoiler.types.d.ts +10 -0
  245. package/dist/components/Spoiler/index.d.ts +2 -0
  246. package/dist/components/TimePicker/components/TimePickerDialDropdown/TimePickerDialDropdown.cjs +1 -1
  247. package/dist/components/TimePicker/components/TimePickerDialDropdown/TimePickerDialDropdown.js +63 -57
  248. package/dist/components/TimePicker/helpers/ClockFaceSvg.cjs +1 -1
  249. package/dist/components/TimePicker/helpers/ClockFaceSvg.d.ts +0 -7
  250. package/dist/components/TimePicker/helpers/ClockFaceSvg.js +32 -31
  251. package/dist/components/TreeSelect/TreeSelect.cjs +1 -0
  252. package/dist/components/TreeSelect/TreeSelect.const.cjs +1 -0
  253. package/dist/components/TreeSelect/TreeSelect.const.d.ts +19 -0
  254. package/dist/components/TreeSelect/TreeSelect.const.js +22 -0
  255. package/dist/components/TreeSelect/TreeSelect.d.ts +4 -0
  256. package/dist/components/TreeSelect/TreeSelect.js +128 -0
  257. package/dist/components/TreeSelect/TreeSelect.types.d.ts +25 -0
  258. package/dist/components/TreeSelect/TreeSelect.utils.cjs +1 -0
  259. package/dist/components/TreeSelect/TreeSelect.utils.d.ts +5 -0
  260. package/dist/components/TreeSelect/TreeSelect.utils.js +25 -0
  261. package/dist/components/TreeSelect/index.d.ts +2 -0
  262. package/dist/components/index.cjs +1 -1
  263. package/dist/components/index.d.ts +54 -0
  264. package/dist/components/index.js +349 -292
  265. package/dist/index.cjs +1 -1
  266. package/dist/index.js +439 -382
  267. package/dist/postcss/bear-plugin.cjs +86 -0
  268. package/dist/styles/_alerts.css +14 -0
  269. package/dist/styles/_base.css +56 -0
  270. package/dist/styles/_buttons.css +108 -0
  271. package/dist/styles/_effects.css +90 -0
  272. package/dist/styles/_marquee.css +25 -0
  273. package/dist/styles/main.css +5 -0
  274. package/dist/styles.css +1 -1
  275. package/dist/types/component.types.d.ts +13 -0
  276. package/package.json +10 -6
@@ -0,0 +1,9 @@
1
+ export declare const MENU_CLASSES = "Bear-ContextMenu bear-fixed bear-z-[99999] bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-lg bear-shadow-xl bear-py-1 bear-min-w-[180px] bear-animate-in";
2
+ export declare const ITEM_CLASSES = "bear-flex bear-items-center bear-justify-between bear-px-3 bear-py-1.5 bear-text-sm bear-cursor-pointer bear-transition-colors bear-text-gray-700 dark:bear-text-zinc-300 hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-700";
3
+ export declare const ITEM_DISABLED_CLASSES = "bear-opacity-40 bear-cursor-not-allowed";
4
+ export declare const ITEM_DANGER_CLASSES = "bear-text-red-600 dark:bear-text-red-400 hover:bear-bg-red-50 dark:hover:bear-bg-red-900/20";
5
+ export declare const DIVIDER_CLASSES = "bear-my-1 bear-border-t bear-border-gray-200 dark:bear-border-zinc-700";
6
+ export declare const ICON_CLASSES = "bear-mr-2 bear-w-4 bear-h-4 bear-flex-shrink-0";
7
+ export declare const SHORTCUT_CLASSES = "bear-text-xs bear-text-gray-400 dark:bear-text-zinc-500 bear-ml-4";
8
+ export declare const SUB_INDICATOR_CLASSES = "bear-ml-2 bear-text-gray-400 dark:bear-text-zinc-500";
9
+ export declare const SUB_MENU_OFFSET = 4;
@@ -0,0 +1,12 @@
1
+ const r = "Bear-ContextMenu bear-fixed bear-z-[99999] bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-lg bear-shadow-xl bear-py-1 bear-min-w-[180px] bear-animate-in", e = "bear-flex bear-items-center bear-justify-between bear-px-3 bear-py-1.5 bear-text-sm bear-cursor-pointer bear-transition-colors bear-text-gray-700 dark:bear-text-zinc-300 hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-700", a = "bear-opacity-40 bear-cursor-not-allowed", b = "bear-text-red-600 dark:bear-text-red-400 hover:bear-bg-red-50 dark:hover:bear-bg-red-900/20", t = "bear-my-1 bear-border-t bear-border-gray-200 dark:bear-border-zinc-700", o = "bear-mr-2 bear-w-4 bear-h-4 bear-flex-shrink-0", n = "bear-text-xs bear-text-gray-400 dark:bear-text-zinc-500 bear-ml-4", S = "bear-ml-2 bear-text-gray-400 dark:bear-text-zinc-500", d = 4;
2
+ export {
3
+ t as DIVIDER_CLASSES,
4
+ o as ICON_CLASSES,
5
+ e as ITEM_CLASSES,
6
+ b as ITEM_DANGER_CLASSES,
7
+ a as ITEM_DISABLED_CLASSES,
8
+ r as MENU_CLASSES,
9
+ n as SHORTCUT_CLASSES,
10
+ S as SUB_INDICATOR_CLASSES,
11
+ d as SUB_MENU_OFFSET
12
+ };
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { ContextMenuProps } from './ContextMenu.types';
3
+ export declare const ContextMenu: FC<ContextMenuProps>;
4
+ export default ContextMenu;
@@ -0,0 +1,64 @@
1
+ import { jsxs as d, jsx as n } from "react/jsx-runtime";
2
+ import { useState as S, useRef as L, useCallback as m, useEffect as N } from "react";
3
+ import { cn as _ } from "../../utils/cn.js";
4
+ import { SUB_MENU_OFFSET as h, MENU_CLASSES as A, DIVIDER_CLASSES as I, ICON_CLASSES as M, SHORTCUT_CLASSES as y, SUB_INDICATOR_CLASSES as k, ITEM_DANGER_CLASSES as C, ITEM_DISABLED_CLASSES as D, ITEM_CLASSES as R } from "./ContextMenu.const.js";
5
+ const T = (c) => "type" in c && c.type === "divider", b = ({ items: c, position: o, onClose: l }) => {
6
+ const [r, a] = S(null), [i, u] = S({ x: 0, y: 0 }), f = L(null), E = m((s) => {
7
+ var e;
8
+ s.disabled || s.children || ((e = s.onClick) == null || e.call(s), l());
9
+ }, [l]), p = m((s, e) => {
10
+ if (s.children) {
11
+ const t = e.currentTarget.getBoundingClientRect();
12
+ u({ x: t.right + h, y: t.top }), a(s.id);
13
+ } else
14
+ a(null);
15
+ }, []);
16
+ return /* @__PURE__ */ n("div", { ref: f, className: A, style: { left: o.x, top: o.y }, role: "menu", children: c.map((s) => {
17
+ if (T(s)) return /* @__PURE__ */ n("div", { className: I, role: "separator" }, s.id);
18
+ const e = s;
19
+ return /* @__PURE__ */ d("div", { children: [
20
+ /* @__PURE__ */ d(
21
+ "div",
22
+ {
23
+ className: _(R, e.disabled && D, e.danger && C),
24
+ onClick: () => E(e),
25
+ onMouseEnter: (t) => p(e, t),
26
+ role: "menuitem",
27
+ "aria-disabled": e.disabled,
28
+ children: [
29
+ /* @__PURE__ */ d("span", { className: "bear-flex bear-items-center", children: [
30
+ e.icon && /* @__PURE__ */ n("span", { className: M, children: e.icon }),
31
+ e.label
32
+ ] }),
33
+ /* @__PURE__ */ d("span", { className: "bear-flex bear-items-center", children: [
34
+ e.shortcut && /* @__PURE__ */ n("span", { className: y, children: e.shortcut }),
35
+ e.children && /* @__PURE__ */ n("span", { className: k, children: "▸" })
36
+ ] })
37
+ ]
38
+ }
39
+ ),
40
+ e.children && r === e.id && /* @__PURE__ */ n(b, { items: e.children, position: i, onClose: l })
41
+ ] }, e.id);
42
+ }) });
43
+ }, j = ({ items: c, children: o, disabled: l = !1, onOpenChange: r, testId: a }) => {
44
+ const [i, u] = S(!1), [f, E] = S({ x: 0, y: 0 }), p = L(null), s = m(() => {
45
+ u(!1), r == null || r(!1);
46
+ }, [r]), e = m((t) => {
47
+ l || (t.preventDefault(), E({ x: t.clientX, y: t.clientY }), u(!0), r == null || r(!0));
48
+ }, [l, r]);
49
+ return N(() => {
50
+ if (!i) return;
51
+ const t = () => s(), v = (x) => {
52
+ x.key === "Escape" && s();
53
+ };
54
+ return document.addEventListener("mousedown", t), document.addEventListener("keydown", v), () => {
55
+ document.removeEventListener("mousedown", t), document.removeEventListener("keydown", v);
56
+ };
57
+ }, [i, s]), /* @__PURE__ */ d("div", { ref: p, onContextMenu: e, "data-testid": a, children: [
58
+ o,
59
+ i && /* @__PURE__ */ n(b, { items: c, position: f, onClose: s })
60
+ ] });
61
+ };
62
+ export {
63
+ j as ContextMenu
64
+ };
@@ -0,0 +1,23 @@
1
+ import { ReactNode } from 'react';
2
+ export interface ContextMenuItem {
3
+ id: string;
4
+ label: string;
5
+ icon?: ReactNode;
6
+ shortcut?: string;
7
+ disabled?: boolean;
8
+ danger?: boolean;
9
+ children?: ContextMenuItem[];
10
+ onClick?: () => void;
11
+ }
12
+ export interface ContextMenuDivider {
13
+ id: string;
14
+ type: 'divider';
15
+ }
16
+ export type ContextMenuEntry = ContextMenuItem | ContextMenuDivider;
17
+ export interface ContextMenuProps {
18
+ items: ContextMenuEntry[];
19
+ children: ReactNode;
20
+ disabled?: boolean;
21
+ onOpenChange?: (open: boolean) => void;
22
+ testId?: string;
23
+ }
@@ -0,0 +1,2 @@
1
+ export { ContextMenu } from './ContextMenu';
2
+ export type { ContextMenuProps, ContextMenuEntry, ContextMenuItem, ContextMenuDivider } from './ContextMenu.types';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),l=require("react"),L=require("../../utils/cn.cjs"),t=require("./DateRangePicker.const.cjs"),d=require("./DateRangePicker.utils.cjs"),B=({year:k,month:i,range:a,onDayClick:A,onNav:N,minDate:b,maxDate:C})=>{const j=d.getCalendarDays(k,i),m=new Date;return m.setHours(0,0,0,0),e.jsxs("div",{className:"bear-w-64",children:[e.jsxs("div",{className:t.CALENDAR_HEADER_CLASSES,children:[e.jsx("button",{type:"button",onClick:()=>N(-1),className:t.NAV_BTN_CLASSES,"aria-label":"Previous month",children:e.jsx("svg",{className:"bear-w-4 bear-h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),e.jsxs("span",{className:"bear-text-sm bear-font-semibold bear-text-gray-900 dark:bear-text-white",children:[t.MONTH_LABELS[i]," ",k]}),e.jsx("button",{type:"button",onClick:()=>N(1),className:t.NAV_BTN_CLASSES,"aria-label":"Next month",children:e.jsx("svg",{className:"bear-w-4 bear-h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]}),e.jsx("div",{className:"bear-grid bear-grid-cols-7 bear-gap-0.5 bear-mb-1",children:t.DAY_LABELS.map(r=>e.jsx("div",{className:"bear-text-xs bear-text-center bear-font-medium bear-text-gray-400 dark:bear-text-zinc-500 bear-py-1",children:r},r))}),e.jsx("div",{className:"bear-grid bear-grid-cols-7 bear-gap-0.5",children:j.map((r,_)=>{if(!r)return e.jsx("div",{},`e-${_}`);const x=b&&r<b||C&&r>C,o=d.isSameDay(r,a.start)||d.isSameDay(r,a.end),S=d.isInRange(r,a.start,a.end),g=d.isSameDay(r,m);return e.jsx("button",{type:"button",disabled:!!x,onClick:()=>A(r),className:L.cn(t.DAY_BASE_CLASSES,x?t.DAY_DISABLED_CLASSES:t.DAY_HOVER_CLASSES,o&&t.DAY_SELECTED_CLASSES,!o&&S&&t.DAY_IN_RANGE_CLASSES,!o&&!S&&g&&t.DAY_TODAY_CLASSES,!o&&!S&&!x&&"bear-text-gray-700 dark:bear-text-zinc-300"),children:r.getDate()},r.getTime())})})]})},G=k=>{const{value:i,onChange:a,label:A,placeholder:N="Select date range",disabled:b=!1,clearable:C=!0,minDate:j,maxDate:m,presets:r,showPresets:_=!0,size:x="md",error:o,helperText:S,className:g,testId:Y,...M}=k,[R,f]=l.useState(!1),[n,h]=l.useState(i??{start:null,end:null}),[y,p]=l.useState("start"),D=l.useRef(null),w=new Date,[u,O]=l.useState(w.getMonth()),[E,I]=l.useState(w.getFullYear()),z=u===11?0:u+1,H=u===11?E+1:E;l.useEffect(()=>{i&&h(i)},[i]),l.useEffect(()=>{const s=c=>{D.current&&!D.current.contains(c.target)&&f(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]);const T=l.useCallback(s=>{if(y==="start")h({start:s,end:null}),p("end");else{const c=s>=(n.start??s)?{start:n.start,end:s}:{start:s,end:n.start};h(c),p("start"),a==null||a(c)}},[y,n.start,a]),V=l.useCallback(s=>{h(s),a==null||a(s),f(!1),p("start")},[a]),q=l.useCallback(()=>{const s={start:null,end:null};h(s),a==null||a(s),p("start")},[a]),W=l.useCallback(s=>{let c=u+s,v=E;c<0&&(c=11,v--),c>11&&(c=0,v++),O(c),I(v)},[u,E]),P=r??(_?t.getDefaultPresets():[]),$=n.start?`${d.formatDate(n.start)}${n.end?` – ${d.formatDate(n.end)}`:""}`:N;return e.jsxs("div",{ref:D,className:L.cn(t.ROOT_CLASSES,g),"data-testid":Y,...M,children:[A&&e.jsx("label",{className:t.LABEL_CLASSES,children:A}),e.jsxs("button",{type:"button",disabled:b,onClick:()=>!b&&f(!R),className:L.cn(t.TRIGGER_CLASSES,t.SIZE_CLASSES[x],b&&"bear-opacity-50 bear-cursor-not-allowed"),children:[e.jsx("span",{className:L.cn(!n.start&&"bear-text-gray-400 dark:bear-text-zinc-500"),children:$}),e.jsx("svg",{className:"bear-w-4 bear-h-4 bear-ml-2 bear-text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})]}),R&&e.jsx("div",{className:t.DROPDOWN_CLASSES,children:e.jsxs("div",{className:"bear-flex bear-gap-4",children:[P.length>0&&e.jsxs("div",{className:"bear-border-r bear-border-gray-200 dark:bear-border-zinc-700 bear-pr-3 bear-space-y-1 bear-min-w-[120px]",children:[P.map(s=>e.jsx("button",{type:"button",onClick:()=>V(s.range()),className:t.PRESET_BTN_CLASSES,children:s.label},s.label)),C&&n.start&&e.jsx("button",{type:"button",onClick:q,className:L.cn(t.PRESET_BTN_CLASSES,"bear-text-red-500"),children:"Clear"})]}),e.jsx(B,{year:E,month:u,range:n,onDayClick:T,onNav:W,minDate:j,maxDate:m}),e.jsx(B,{year:H,month:z,range:n,onDayClick:T,onNav:()=>{},minDate:j,maxDate:m})]})}),o&&e.jsx("p",{className:t.ERROR_CLASSES,children:o}),!o&&S&&e.jsx("p",{className:t.HELPER_CLASSES,children:S})]})};exports.DateRangePicker=G;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=7,b=6,S=["Su","Mo","Tu","We","Th","Fr","Sa"],n=["January","February","March","April","May","June","July","August","September","October","November","December"],o={sm:"bear-py-1.5 bear-px-3 bear-text-sm",md:"bear-py-2 bear-px-4 bear-text-base",lg:"bear-py-2.5 bear-px-5 bear-text-lg"},E="Bear-DateRangePicker bear-relative bear-inline-block",A="bear-w-full bear-flex bear-items-center bear-justify-between bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-800 bear-text-gray-900 dark:bear-text-white bear-transition-colors focus:bear-ring-2 focus:bear-ring-pink-500 bear-outline-none",s="bear-absolute bear-z-[9999] bear-mt-1 bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-xl bear-shadow-xl bear-p-4",_="bear-flex bear-items-center bear-justify-between bear-mb-2",L="bear-p-1 bear-rounded hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700 bear-text-gray-500 dark:bear-text-zinc-400",c="bear-w-8 bear-h-8 bear-text-sm bear-rounded-full bear-transition-colors bear-cursor-pointer",D="bear-bg-pink-500 bear-text-white",i="bear-bg-pink-100 dark:bear-bg-pink-900/30 bear-text-pink-800 dark:bear-text-pink-200",g="hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700",l="bear-text-gray-300 dark:bear-text-zinc-600 bear-cursor-not-allowed",d="bear-ring-1 bear-ring-pink-400",u="bear-w-full bear-text-left bear-px-3 bear-py-1.5 bear-text-sm bear-rounded bear-transition-colors hover:bear-bg-pink-50 dark:hover:bear-bg-pink-900/20 bear-text-gray-700 dark:bear-text-zinc-300",C="Bear-DateRangePicker__label bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-zinc-300 bear-mb-1.5",x="bear-mt-1 bear-text-xs bear-text-red-500",R="bear-mt-1 bear-text-xs bear-text-gray-500 dark:bear-text-zinc-500",k=()=>{const e=new Date;return e.setHours(0,0,0,0),[{label:"Today",range:()=>({start:new Date(e),end:new Date(e)})},{label:"Last 7 days",range:()=>{const r=new Date(e);return r.setDate(r.getDate()-6),{start:r,end:new Date(e)}}},{label:"Last 30 days",range:()=>{const r=new Date(e);return r.setDate(r.getDate()-29),{start:r,end:new Date(e)}}},{label:"This month",range:()=>({start:new Date(e.getFullYear(),e.getMonth(),1),end:new Date(e)})},{label:"Last month",range:()=>{const r=new Date(e.getFullYear(),e.getMonth()-1,1),a=new Date(e.getFullYear(),e.getMonth(),0);return{start:r,end:a}}}]};exports.CALENDAR_HEADER_CLASSES=_;exports.CALENDAR_ROWS=b;exports.DAYS_IN_WEEK=t;exports.DAY_BASE_CLASSES=c;exports.DAY_DISABLED_CLASSES=l;exports.DAY_HOVER_CLASSES=g;exports.DAY_IN_RANGE_CLASSES=i;exports.DAY_LABELS=S;exports.DAY_SELECTED_CLASSES=D;exports.DAY_TODAY_CLASSES=d;exports.DROPDOWN_CLASSES=s;exports.ERROR_CLASSES=x;exports.HELPER_CLASSES=R;exports.LABEL_CLASSES=C;exports.MONTH_LABELS=n;exports.NAV_BTN_CLASSES=L;exports.PRESET_BTN_CLASSES=u;exports.ROOT_CLASSES=E;exports.SIZE_CLASSES=o;exports.TRIGGER_CLASSES=A;exports.getDefaultPresets=k;
@@ -0,0 +1,27 @@
1
+ import { DateRangePreset } from './DateRangePicker.types';
2
+ export declare const DAYS_IN_WEEK = 7;
3
+ export declare const MONTHS_IN_YEAR = 12;
4
+ export declare const CALENDAR_ROWS = 6;
5
+ export declare const DAY_LABELS: readonly ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
6
+ export declare const MONTH_LABELS: readonly ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
7
+ export declare const SIZE_CLASSES: {
8
+ readonly sm: "bear-py-1.5 bear-px-3 bear-text-sm";
9
+ readonly md: "bear-py-2 bear-px-4 bear-text-base";
10
+ readonly lg: "bear-py-2.5 bear-px-5 bear-text-lg";
11
+ };
12
+ export declare const ROOT_CLASSES = "Bear-DateRangePicker bear-relative bear-inline-block";
13
+ export declare const TRIGGER_CLASSES = "bear-w-full bear-flex bear-items-center bear-justify-between bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-800 bear-text-gray-900 dark:bear-text-white bear-transition-colors focus:bear-ring-2 focus:bear-ring-pink-500 bear-outline-none";
14
+ export declare const DROPDOWN_CLASSES = "bear-absolute bear-z-[9999] bear-mt-1 bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-xl bear-shadow-xl bear-p-4";
15
+ export declare const CALENDAR_HEADER_CLASSES = "bear-flex bear-items-center bear-justify-between bear-mb-2";
16
+ export declare const NAV_BTN_CLASSES = "bear-p-1 bear-rounded hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700 bear-text-gray-500 dark:bear-text-zinc-400";
17
+ export declare const DAY_BASE_CLASSES = "bear-w-8 bear-h-8 bear-text-sm bear-rounded-full bear-transition-colors bear-cursor-pointer";
18
+ export declare const DAY_SELECTED_CLASSES = "bear-bg-pink-500 bear-text-white";
19
+ export declare const DAY_IN_RANGE_CLASSES = "bear-bg-pink-100 dark:bear-bg-pink-900/30 bear-text-pink-800 dark:bear-text-pink-200";
20
+ export declare const DAY_HOVER_CLASSES = "hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700";
21
+ export declare const DAY_DISABLED_CLASSES = "bear-text-gray-300 dark:bear-text-zinc-600 bear-cursor-not-allowed";
22
+ export declare const DAY_TODAY_CLASSES = "bear-ring-1 bear-ring-pink-400";
23
+ export declare const PRESET_BTN_CLASSES = "bear-w-full bear-text-left bear-px-3 bear-py-1.5 bear-text-sm bear-rounded bear-transition-colors hover:bear-bg-pink-50 dark:hover:bear-bg-pink-900/20 bear-text-gray-700 dark:bear-text-zinc-300";
24
+ export declare const LABEL_CLASSES = "Bear-DateRangePicker__label bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-zinc-300 bear-mb-1.5";
25
+ export declare const ERROR_CLASSES = "bear-mt-1 bear-text-xs bear-text-red-500";
26
+ export declare const HELPER_CLASSES = "bear-mt-1 bear-text-xs bear-text-gray-500 dark:bear-text-zinc-500";
27
+ export declare const getDefaultPresets: () => DateRangePreset[];
@@ -0,0 +1,74 @@
1
+ const t = 7, b = 6, n = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], o = [
2
+ "January",
3
+ "February",
4
+ "March",
5
+ "April",
6
+ "May",
7
+ "June",
8
+ "July",
9
+ "August",
10
+ "September",
11
+ "October",
12
+ "November",
13
+ "December"
14
+ ], s = {
15
+ sm: "bear-py-1.5 bear-px-3 bear-text-sm",
16
+ md: "bear-py-2 bear-px-4 bear-text-base",
17
+ lg: "bear-py-2.5 bear-px-5 bear-text-lg"
18
+ }, S = "Bear-DateRangePicker bear-relative bear-inline-block", c = "bear-w-full bear-flex bear-items-center bear-justify-between bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-800 bear-text-gray-900 dark:bear-text-white bear-transition-colors focus:bear-ring-2 focus:bear-ring-pink-500 bear-outline-none", i = "bear-absolute bear-z-[9999] bear-mt-1 bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-xl bear-shadow-xl bear-p-4", g = "bear-flex bear-items-center bear-justify-between bear-mb-2", l = "bear-p-1 bear-rounded hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700 bear-text-gray-500 dark:bear-text-zinc-400", d = "bear-w-8 bear-h-8 bear-text-sm bear-rounded-full bear-transition-colors bear-cursor-pointer", A = "bear-bg-pink-500 bear-text-white", E = "bear-bg-pink-100 dark:bear-bg-pink-900/30 bear-text-pink-800 dark:bear-text-pink-200", x = "hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700", D = "bear-text-gray-300 dark:bear-text-zinc-600 bear-cursor-not-allowed", u = "bear-ring-1 bear-ring-pink-400", _ = "bear-w-full bear-text-left bear-px-3 bear-py-1.5 bear-text-sm bear-rounded bear-transition-colors hover:bear-bg-pink-50 dark:hover:bear-bg-pink-900/20 bear-text-gray-700 dark:bear-text-zinc-300", L = "Bear-DateRangePicker__label bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-zinc-300 bear-mb-1.5", k = "bear-mt-1 bear-text-xs bear-text-red-500", y = "bear-mt-1 bear-text-xs bear-text-gray-500 dark:bear-text-zinc-500", p = () => {
19
+ const e = /* @__PURE__ */ new Date();
20
+ return e.setHours(0, 0, 0, 0), [
21
+ {
22
+ label: "Today",
23
+ range: () => ({ start: new Date(e), end: new Date(e) })
24
+ },
25
+ {
26
+ label: "Last 7 days",
27
+ range: () => {
28
+ const r = new Date(e);
29
+ return r.setDate(r.getDate() - 6), { start: r, end: new Date(e) };
30
+ }
31
+ },
32
+ {
33
+ label: "Last 30 days",
34
+ range: () => {
35
+ const r = new Date(e);
36
+ return r.setDate(r.getDate() - 29), { start: r, end: new Date(e) };
37
+ }
38
+ },
39
+ {
40
+ label: "This month",
41
+ range: () => ({ start: new Date(e.getFullYear(), e.getMonth(), 1), end: new Date(e) })
42
+ },
43
+ {
44
+ label: "Last month",
45
+ range: () => {
46
+ const r = new Date(e.getFullYear(), e.getMonth() - 1, 1), a = new Date(e.getFullYear(), e.getMonth(), 0);
47
+ return { start: r, end: a };
48
+ }
49
+ }
50
+ ];
51
+ };
52
+ export {
53
+ g as CALENDAR_HEADER_CLASSES,
54
+ b as CALENDAR_ROWS,
55
+ t as DAYS_IN_WEEK,
56
+ d as DAY_BASE_CLASSES,
57
+ D as DAY_DISABLED_CLASSES,
58
+ x as DAY_HOVER_CLASSES,
59
+ E as DAY_IN_RANGE_CLASSES,
60
+ n as DAY_LABELS,
61
+ A as DAY_SELECTED_CLASSES,
62
+ u as DAY_TODAY_CLASSES,
63
+ i as DROPDOWN_CLASSES,
64
+ k as ERROR_CLASSES,
65
+ y as HELPER_CLASSES,
66
+ L as LABEL_CLASSES,
67
+ o as MONTH_LABELS,
68
+ l as NAV_BTN_CLASSES,
69
+ _ as PRESET_BTN_CLASSES,
70
+ S as ROOT_CLASSES,
71
+ s as SIZE_CLASSES,
72
+ c as TRIGGER_CLASSES,
73
+ p as getDefaultPresets
74
+ };
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { DateRangePickerProps } from './DateRangePicker.types';
3
+ export declare const DateRangePicker: FC<DateRangePickerProps>;
4
+ export default DateRangePicker;
@@ -0,0 +1,115 @@
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
+ import { useState as p, useRef as Q, useEffect as O, useCallback as g } from "react";
3
+ import { cn as E } from "../../utils/cn.js";
4
+ import { getDefaultPresets as U, LABEL_CLASSES as X, SIZE_CLASSES as ee, TRIGGER_CLASSES as te, DROPDOWN_CLASSES as re, PRESET_BTN_CLASSES as P, ERROR_CLASSES as ae, HELPER_CLASSES as se, ROOT_CLASSES as ne, CALENDAR_HEADER_CLASSES as le, NAV_BTN_CLASSES as I, MONTH_LABELS as oe, DAY_LABELS as ce, DAY_TODAY_CLASSES as ie, DAY_IN_RANGE_CLASSES as de, DAY_SELECTED_CLASSES as be, DAY_DISABLED_CLASSES as me, DAY_HOVER_CLASSES as Se, DAY_BASE_CLASSES as ue } from "./DateRangePicker.const.js";
5
+ import { formatDate as z, getCalendarDays as he, isSameDay as w, isInRange as pe } from "./DateRangePicker.utils.js";
6
+ const H = ({ year: L, month: o, range: r, onDayClick: A, onNav: N, minDate: i, maxDate: f }) => {
7
+ const k = he(L, o), m = /* @__PURE__ */ new Date();
8
+ return m.setHours(0, 0, 0, 0), /* @__PURE__ */ c("div", { className: "bear-w-64", children: [
9
+ /* @__PURE__ */ c("div", { className: le, children: [
10
+ /* @__PURE__ */ e("button", { type: "button", onClick: () => N(-1), className: I, "aria-label": "Previous month", children: /* @__PURE__ */ e("svg", { className: "bear-w-4 bear-h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }) }),
11
+ /* @__PURE__ */ c("span", { className: "bear-text-sm bear-font-semibold bear-text-gray-900 dark:bear-text-white", children: [
12
+ oe[o],
13
+ " ",
14
+ L
15
+ ] }),
16
+ /* @__PURE__ */ e("button", { type: "button", onClick: () => N(1), className: I, "aria-label": "Next month", children: /* @__PURE__ */ e("svg", { className: "bear-w-4 bear-h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) }) })
17
+ ] }),
18
+ /* @__PURE__ */ e("div", { className: "bear-grid bear-grid-cols-7 bear-gap-0.5 bear-mb-1", children: ce.map((a) => /* @__PURE__ */ e("div", { className: "bear-text-xs bear-text-center bear-font-medium bear-text-gray-400 dark:bear-text-zinc-500 bear-py-1", children: a }, a)) }),
19
+ /* @__PURE__ */ e("div", { className: "bear-grid bear-grid-cols-7 bear-gap-0.5", children: k.map((a, _) => {
20
+ if (!a) return /* @__PURE__ */ e("div", {}, `e-${_}`);
21
+ const S = i && a < i || f && a > f, l = w(a, r.start) || w(a, r.end), d = pe(a, r.start, r.end), D = w(a, m);
22
+ return /* @__PURE__ */ e(
23
+ "button",
24
+ {
25
+ type: "button",
26
+ disabled: !!S,
27
+ onClick: () => A(a),
28
+ className: E(
29
+ ue,
30
+ S ? me : Se,
31
+ l && be,
32
+ !l && d && de,
33
+ !l && !d && D && ie,
34
+ !l && !d && !S && "bear-text-gray-700 dark:bear-text-zinc-300"
35
+ ),
36
+ children: a.getDate()
37
+ },
38
+ a.getTime()
39
+ );
40
+ }) })
41
+ ] });
42
+ }, ke = (L) => {
43
+ const {
44
+ value: o,
45
+ onChange: r,
46
+ label: A,
47
+ placeholder: N = "Select date range",
48
+ disabled: i = !1,
49
+ clearable: f = !0,
50
+ minDate: k,
51
+ maxDate: m,
52
+ presets: a,
53
+ showPresets: _ = !0,
54
+ size: S = "md",
55
+ error: l,
56
+ helperText: d,
57
+ className: D,
58
+ testId: j,
59
+ ...V
60
+ } = L, [y, v] = p(!1), [s, u] = p(o ?? { start: null, end: null }), [T, C] = p("start"), x = Q(null), Y = /* @__PURE__ */ new Date(), [b, W] = p(Y.getMonth()), [h, $] = p(Y.getFullYear()), G = b === 11 ? 0 : b + 1, F = b === 11 ? h + 1 : h;
61
+ O(() => {
62
+ o && u(o);
63
+ }, [o]), O(() => {
64
+ const t = (n) => {
65
+ x.current && !x.current.contains(n.target) && v(!1);
66
+ };
67
+ return document.addEventListener("mousedown", t), () => document.removeEventListener("mousedown", t);
68
+ }, []);
69
+ const B = g((t) => {
70
+ if (T === "start")
71
+ u({ start: t, end: null }), C("end");
72
+ else {
73
+ const n = t >= (s.start ?? t) ? { start: s.start, end: t } : { start: t, end: s.start };
74
+ u(n), C("start"), r == null || r(n);
75
+ }
76
+ }, [T, s.start, r]), Z = g((t) => {
77
+ u(t), r == null || r(t), v(!1), C("start");
78
+ }, [r]), q = g(() => {
79
+ const t = { start: null, end: null };
80
+ u(t), r == null || r(t), C("start");
81
+ }, [r]), J = g((t) => {
82
+ let n = b + t, R = h;
83
+ n < 0 && (n = 11, R--), n > 11 && (n = 0, R++), W(n), $(R);
84
+ }, [b, h]), M = a ?? (_ ? U() : []), K = s.start ? `${z(s.start)}${s.end ? ` – ${z(s.end)}` : ""}` : N;
85
+ return /* @__PURE__ */ c("div", { ref: x, className: E(ne, D), "data-testid": j, ...V, children: [
86
+ A && /* @__PURE__ */ e("label", { className: X, children: A }),
87
+ /* @__PURE__ */ c(
88
+ "button",
89
+ {
90
+ type: "button",
91
+ disabled: i,
92
+ onClick: () => !i && v(!y),
93
+ className: E(te, ee[S], i && "bear-opacity-50 bear-cursor-not-allowed"),
94
+ children: [
95
+ /* @__PURE__ */ e("span", { className: E(!s.start && "bear-text-gray-400 dark:bear-text-zinc-500"), children: K }),
96
+ /* @__PURE__ */ e("svg", { className: "bear-w-4 bear-h-4 bear-ml-2 bear-text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) })
97
+ ]
98
+ }
99
+ ),
100
+ y && /* @__PURE__ */ e("div", { className: re, children: /* @__PURE__ */ c("div", { className: "bear-flex bear-gap-4", children: [
101
+ M.length > 0 && /* @__PURE__ */ c("div", { className: "bear-border-r bear-border-gray-200 dark:bear-border-zinc-700 bear-pr-3 bear-space-y-1 bear-min-w-[120px]", children: [
102
+ M.map((t) => /* @__PURE__ */ e("button", { type: "button", onClick: () => Z(t.range()), className: P, children: t.label }, t.label)),
103
+ f && s.start && /* @__PURE__ */ e("button", { type: "button", onClick: q, className: E(P, "bear-text-red-500"), children: "Clear" })
104
+ ] }),
105
+ /* @__PURE__ */ e(H, { year: h, month: b, range: s, onDayClick: B, onNav: J, minDate: k, maxDate: m }),
106
+ /* @__PURE__ */ e(H, { year: F, month: G, range: s, onDayClick: B, onNav: () => {
107
+ }, minDate: k, maxDate: m })
108
+ ] }) }),
109
+ l && /* @__PURE__ */ e("p", { className: ae, children: l }),
110
+ !l && d && /* @__PURE__ */ e("p", { className: se, children: d })
111
+ ] });
112
+ };
113
+ export {
114
+ ke as DateRangePicker
115
+ };
@@ -0,0 +1,26 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export interface DateRange {
3
+ start: Date | null;
4
+ end: Date | null;
5
+ }
6
+ export interface DateRangePreset {
7
+ label: string;
8
+ range: () => DateRange;
9
+ }
10
+ export interface DateRangePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
11
+ value?: DateRange;
12
+ onChange?: (range: DateRange) => void;
13
+ label?: string;
14
+ placeholder?: string;
15
+ disabled?: boolean;
16
+ clearable?: boolean;
17
+ format?: string;
18
+ minDate?: Date;
19
+ maxDate?: Date;
20
+ presets?: DateRangePreset[];
21
+ showPresets?: boolean;
22
+ size?: 'sm' | 'md' | 'lg';
23
+ error?: string;
24
+ helperText?: string;
25
+ testId?: string;
26
+ }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./DateRangePicker.const.cjs"),l=(t,e)=>!t||!e?!1:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate(),i=(t,e,n)=>{if(!e||!n)return!1;const s=t.getTime();return s>e.getTime()&&s<n.getTime()},u=t=>{if(!t)return"";const e=(t.getMonth()+1).toString().padStart(2,"0"),n=t.getDate().toString().padStart(2,"0");return`${e}/${n}/${t.getFullYear()}`},D=(t,e)=>{const n=new Date(t,e,1).getDay(),s=new Date(t,e+1,0).getDate(),g=o.CALENDAR_ROWS*o.DAYS_IN_WEEK,r=[];for(let a=0;a<n;a++)r.push(null);for(let a=1;a<=s;a++)r.push(new Date(t,e,a));for(;r.length<g;)r.push(null);return r};exports.formatDate=u;exports.getCalendarDays=D;exports.isInRange=i;exports.isSameDay=l;
@@ -0,0 +1,4 @@
1
+ export declare const isSameDay: (a: Date | null, b: Date | null) => boolean;
2
+ export declare const isInRange: (day: Date, start: Date | null, end: Date | null) => boolean;
3
+ export declare const formatDate: (d: Date | null) => string;
4
+ export declare const getCalendarDays: (year: number, month: number) => (Date | null)[];
@@ -0,0 +1,22 @@
1
+ import { CALENDAR_ROWS as l, DAYS_IN_WEEK as g } from "./DateRangePicker.const.js";
2
+ const i = (t, e) => !t || !e ? !1 : t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate(), D = (t, e, n) => {
3
+ if (!e || !n) return !1;
4
+ const o = t.getTime();
5
+ return o > e.getTime() && o < n.getTime();
6
+ }, c = (t) => {
7
+ if (!t) return "";
8
+ const e = (t.getMonth() + 1).toString().padStart(2, "0"), n = t.getDate().toString().padStart(2, "0");
9
+ return `${e}/${n}/${t.getFullYear()}`;
10
+ }, f = (t, e) => {
11
+ const n = new Date(t, e, 1).getDay(), o = new Date(t, e + 1, 0).getDate(), s = l * g, a = [];
12
+ for (let r = 0; r < n; r++) a.push(null);
13
+ for (let r = 1; r <= o; r++) a.push(new Date(t, e, r));
14
+ for (; a.length < s; ) a.push(null);
15
+ return a;
16
+ };
17
+ export {
18
+ c as formatDate,
19
+ f as getCalendarDays,
20
+ D as isInRange,
21
+ i as isSameDay
22
+ };
@@ -0,0 +1,2 @@
1
+ export { DateRangePicker } from './DateRangePicker';
2
+ export type { DateRangePickerProps, DateRange, DateRangePreset } from './DateRangePicker.types';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),n=require("../../utils/cn.cjs");require("react");const S=require("../Typography/Typography.cjs"),e=require("./Descriptions.const.cjs"),N=b=>{const{title:p,items:d,columns:y=e.DEFAULT_COLUMNS,bordered:c=!1,size:D="md",layout:o="horizontal",labelWidth:L,className:A,testId:R,...g}=b,_=e.SIZE_CLASSES[D],v=c?e.BORDERED_LABEL_CELL_CLASSES:e.UNBORDERED_LABEL_CELL_CLASSES,B=c?e.BORDERED_VALUE_CELL_CLASSES:e.UNBORDERED_VALUE_CELL_CLASSES,h=(r,s)=>a.jsx("tr",{className:"Bear-Descriptions__row",children:r.flatMap((l,m)=>{const u=l.span??1,C=s*100+m;return[a.jsx("td",{colSpan:u,className:n.cn("Bear-Descriptions__label-cell",_.label,v,o==="vertical"&&"bear-align-top"),style:L?{width:L}:void 0,children:a.jsx(S.Typography,{variant:"body2",weight:"medium",color:"secondary",children:l.label})},`${C}-l`),a.jsx("td",{colSpan:u,className:n.cn("Bear-Descriptions__value-cell",_.cell,B,o==="vertical"&&"bear-align-top"),children:typeof l.value=="string"?a.jsx(S.Typography,{variant:"body2",className:"bear-text-gray-900 dark:bear-text-zinc-100",children:l.value}):l.value},`${C}-v`)]})},s),i=[];let t=[],E=0;d.forEach(r=>{const s=r.span??1;E+s>y&&t.length>0&&(i.push(t),t=[],E=0),t.push(r),E+=s}),t.length>0&&i.push(t);const x=c?e.BORDERED_TABLE_CLASSES:e.UNBORDERED_TABLE_CLASSES;return a.jsxs("div",{className:n.cn(e.ROOT_CLASS,A),"data-testid":R,...g,children:[p&&a.jsx(S.Typography,{variant:"h6",className:n.cn(e.TITLE_CLASSES,"bear-text-gray-900 dark:bear-text-zinc-100"),children:p}),a.jsx("table",{className:n.cn(e.TABLE_CLASSES,x),children:a.jsx("tbody",{children:o==="horizontal"?i.map((r,s)=>h(r,s)):d.map((r,s)=>h([r],s))})})]})};exports.Descriptions=N;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r="Bear-Descriptions",e=3,a="bear-mb-4",b="bear-w-full",E="bear-border-collapse bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-lg bear-overflow-hidden",S="bear-border-separate",L={sm:{cell:"bear-px-3 bear-py-2 bear-text-sm",label:"bear-px-3 bear-py-2 bear-text-sm"},md:{cell:"bear-px-4 bear-py-3 bear-text-sm",label:"bear-px-4 bear-py-3 bear-text-sm"},lg:{cell:"bear-px-5 bear-py-4 bear-text-base",label:"bear-px-5 bear-py-4 bear-text-base"}},t="bear-bg-gray-50 dark:bear-bg-zinc-800/50 bear-text-gray-600 dark:bear-text-zinc-400 bear-font-medium bear-border-b bear-border-r bear-border-gray-200 dark:bear-border-zinc-700",_="bear-border-b bear-border-r bear-border-gray-200 dark:bear-border-zinc-700 bear-text-gray-900 dark:bear-text-zinc-100",A="bear-text-gray-600 dark:bear-text-zinc-400 bear-font-medium",o="bear-text-gray-900 dark:bear-text-zinc-100";exports.BORDERED_LABEL_CELL_CLASSES=t;exports.BORDERED_TABLE_CLASSES=E;exports.BORDERED_VALUE_CELL_CLASSES=_;exports.DEFAULT_COLUMNS=e;exports.ROOT_CLASS=r;exports.SIZE_CLASSES=L;exports.TABLE_CLASSES=b;exports.TITLE_CLASSES=a;exports.UNBORDERED_LABEL_CELL_CLASSES=A;exports.UNBORDERED_TABLE_CLASSES=S;exports.UNBORDERED_VALUE_CELL_CLASSES=o;
@@ -0,0 +1,24 @@
1
+ export declare const ROOT_CLASS = "Bear-Descriptions";
2
+ export declare const DEFAULT_COLUMNS = 3;
3
+ export declare const TITLE_CLASSES = "bear-mb-4";
4
+ export declare const TABLE_CLASSES = "bear-w-full";
5
+ export declare const BORDERED_TABLE_CLASSES = "bear-border-collapse bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-lg bear-overflow-hidden";
6
+ export declare const UNBORDERED_TABLE_CLASSES = "bear-border-separate";
7
+ export declare const SIZE_CLASSES: {
8
+ readonly sm: {
9
+ readonly cell: "bear-px-3 bear-py-2 bear-text-sm";
10
+ readonly label: "bear-px-3 bear-py-2 bear-text-sm";
11
+ };
12
+ readonly md: {
13
+ readonly cell: "bear-px-4 bear-py-3 bear-text-sm";
14
+ readonly label: "bear-px-4 bear-py-3 bear-text-sm";
15
+ };
16
+ readonly lg: {
17
+ readonly cell: "bear-px-5 bear-py-4 bear-text-base";
18
+ readonly label: "bear-px-5 bear-py-4 bear-text-base";
19
+ };
20
+ };
21
+ export declare const BORDERED_LABEL_CELL_CLASSES = "bear-bg-gray-50 dark:bear-bg-zinc-800/50 bear-text-gray-600 dark:bear-text-zinc-400 bear-font-medium bear-border-b bear-border-r bear-border-gray-200 dark:bear-border-zinc-700";
22
+ export declare const BORDERED_VALUE_CELL_CLASSES = "bear-border-b bear-border-r bear-border-gray-200 dark:bear-border-zinc-700 bear-text-gray-900 dark:bear-text-zinc-100";
23
+ export declare const UNBORDERED_LABEL_CELL_CLASSES = "bear-text-gray-600 dark:bear-text-zinc-400 bear-font-medium";
24
+ export declare const UNBORDERED_VALUE_CELL_CLASSES = "bear-text-gray-900 dark:bear-text-zinc-100";
@@ -0,0 +1,27 @@
1
+ const r = "Bear-Descriptions", e = 3, a = "bear-mb-4", b = "bear-w-full", t = "bear-border-collapse bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-lg bear-overflow-hidden", E = "bear-border-separate", o = {
2
+ sm: {
3
+ cell: "bear-px-3 bear-py-2 bear-text-sm",
4
+ label: "bear-px-3 bear-py-2 bear-text-sm"
5
+ },
6
+ md: {
7
+ cell: "bear-px-4 bear-py-3 bear-text-sm",
8
+ label: "bear-px-4 bear-py-3 bear-text-sm"
9
+ },
10
+ lg: {
11
+ cell: "bear-px-5 bear-py-4 bear-text-base",
12
+ label: "bear-px-5 bear-py-4 bear-text-base"
13
+ }
14
+ }, S = "bear-bg-gray-50 dark:bear-bg-zinc-800/50 bear-text-gray-600 dark:bear-text-zinc-400 bear-font-medium bear-border-b bear-border-r bear-border-gray-200 dark:bear-border-zinc-700", L = "bear-border-b bear-border-r bear-border-gray-200 dark:bear-border-zinc-700 bear-text-gray-900 dark:bear-text-zinc-100", d = "bear-text-gray-600 dark:bear-text-zinc-400 bear-font-medium", c = "bear-text-gray-900 dark:bear-text-zinc-100";
15
+ export {
16
+ S as BORDERED_LABEL_CELL_CLASSES,
17
+ t as BORDERED_TABLE_CLASSES,
18
+ L as BORDERED_VALUE_CELL_CLASSES,
19
+ e as DEFAULT_COLUMNS,
20
+ r as ROOT_CLASS,
21
+ o as SIZE_CLASSES,
22
+ b as TABLE_CLASSES,
23
+ a as TITLE_CLASSES,
24
+ d as UNBORDERED_LABEL_CELL_CLASSES,
25
+ E as UNBORDERED_TABLE_CLASSES,
26
+ c as UNBORDERED_VALUE_CELL_CLASSES
27
+ };
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { DescriptionsProps } from './Descriptions.types';
3
+ export declare const Descriptions: FC<DescriptionsProps>;
4
+ export default Descriptions;
@@ -0,0 +1,65 @@
1
+ import { jsxs as f, jsx as s } from "react/jsx-runtime";
2
+ import { cn as r } from "../../utils/cn.js";
3
+ import "react";
4
+ import { Typography as E } from "../Typography/Typography.js";
5
+ import { DEFAULT_COLUMNS as g, TITLE_CLASSES as O, BORDERED_TABLE_CLASSES as T, UNBORDERED_TABLE_CLASSES as U, TABLE_CLASSES as x, ROOT_CLASS as z, BORDERED_LABEL_CELL_CLASSES as w, UNBORDERED_LABEL_CELL_CLASSES as j, SIZE_CLASSES as k, BORDERED_VALUE_CELL_CLASSES as I, UNBORDERED_VALUE_CELL_CLASSES as M } from "./Descriptions.const.js";
6
+ const Z = (m) => {
7
+ const {
8
+ title: S,
9
+ items: L,
10
+ columns: b = g,
11
+ bordered: n = !1,
12
+ size: A = "md",
13
+ layout: o = "horizontal",
14
+ labelWidth: d,
15
+ className: D,
16
+ testId: u,
17
+ ...R
18
+ } = m, p = k[A], B = n ? w : j, v = n ? I : M, _ = (a, e) => /* @__PURE__ */ s("tr", { className: "Bear-Descriptions__row", children: a.flatMap((t, N) => {
19
+ const h = t.span ?? 1, C = e * 100 + N;
20
+ return [
21
+ /* @__PURE__ */ s(
22
+ "td",
23
+ {
24
+ colSpan: h,
25
+ className: r(
26
+ "Bear-Descriptions__label-cell",
27
+ p.label,
28
+ B,
29
+ o === "vertical" && "bear-align-top"
30
+ ),
31
+ style: d ? { width: d } : void 0,
32
+ children: /* @__PURE__ */ s(E, { variant: "body2", weight: "medium", color: "secondary", children: t.label })
33
+ },
34
+ `${C}-l`
35
+ ),
36
+ /* @__PURE__ */ s(
37
+ "td",
38
+ {
39
+ colSpan: h,
40
+ className: r(
41
+ "Bear-Descriptions__value-cell",
42
+ p.cell,
43
+ v,
44
+ o === "vertical" && "bear-align-top"
45
+ ),
46
+ children: typeof t.value == "string" ? /* @__PURE__ */ s(E, { variant: "body2", className: "bear-text-gray-900 dark:bear-text-zinc-100", children: t.value }) : t.value
47
+ },
48
+ `${C}-v`
49
+ )
50
+ ];
51
+ }) }, e), c = [];
52
+ let l = [], i = 0;
53
+ L.forEach((a) => {
54
+ const e = a.span ?? 1;
55
+ i + e > b && l.length > 0 && (c.push(l), l = [], i = 0), l.push(a), i += e;
56
+ }), l.length > 0 && c.push(l);
57
+ const y = n ? T : U;
58
+ return /* @__PURE__ */ f("div", { className: r(z, D), "data-testid": u, ...R, children: [
59
+ S && /* @__PURE__ */ s(E, { variant: "h6", className: r(O, "bear-text-gray-900 dark:bear-text-zinc-100"), children: S }),
60
+ /* @__PURE__ */ s("table", { className: r(x, y), children: /* @__PURE__ */ s("tbody", { children: o === "horizontal" ? c.map((a, e) => _(a, e)) : L.map((a, e) => _([a], e)) }) })
61
+ ] });
62
+ };
63
+ export {
64
+ Z as Descriptions
65
+ };
@@ -0,0 +1,16 @@
1
+ import { ReactNode, HTMLAttributes } from 'react';
2
+ export interface DescriptionItem {
3
+ label: string;
4
+ value: ReactNode;
5
+ span?: number;
6
+ }
7
+ export interface DescriptionsProps extends HTMLAttributes<HTMLDivElement> {
8
+ title?: string;
9
+ items: DescriptionItem[];
10
+ columns?: number;
11
+ bordered?: boolean;
12
+ size?: 'sm' | 'md' | 'lg';
13
+ layout?: 'horizontal' | 'vertical';
14
+ labelWidth?: number;
15
+ testId?: string;
16
+ }
@@ -0,0 +1,2 @@
1
+ export { Descriptions, default } from './Descriptions';
2
+ export type { DescriptionsProps, DescriptionItem } from './Descriptions.types';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),y=require("../../utils/cn.cjs");require("react");const i=require("../Typography/Typography.cjs"),e=require("./Fieldset.const.cjs"),n=({legend:t,description:s,variant:c="default",radius:o="md",disabled:a=!1,children:l,testId:d,className:S,...u})=>r.jsxs("fieldset",{disabled:a,className:y.cn(e.ROOT_CLASS,e.VARIANT_CLASSES[c],e.RADIUS_MAP[o],a&&"bear-opacity-50 bear-pointer-events-none",S),"data-testid":d,...u,children:[t&&r.jsx("legend",{className:e.LEGEND_CLASSES,children:r.jsx(i.Typography,{variant:"body2",weight:"medium",children:t})}),s&&r.jsx(i.Typography,{variant:"caption",color:"secondary",className:t?e.DESCRIPTION_CLASSES:"bear-mb-3 bear-block",children:s}),l]});n.displayName="Fieldset";exports.Fieldset=n;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r={default:"bear-border bear-border-gray-200 dark:bear-border-gray-700 bear-bg-transparent",filled:"bear-border-0 bear-bg-gray-50 dark:bear-bg-gray-800/50",unstyled:"bear-border-0 bear-bg-transparent"},e={sm:"bear-rounded-sm",md:"bear-rounded-md",lg:"bear-rounded-lg"},a="bear-px-2 bear-ml-2 bear-text-gray-900 dark:bear-text-gray-100",b="bear-mt-1 bear-mb-3 bear-text-gray-600 dark:bear-text-gray-400",t="Bear-Fieldset bear-w-full bear-p-4 bear-pt-5";exports.DESCRIPTION_CLASSES=b;exports.LEGEND_CLASSES=a;exports.RADIUS_MAP=e;exports.ROOT_CLASS=t;exports.VARIANT_CLASSES=r;
@@ -0,0 +1,5 @@
1
+ export declare const VARIANT_CLASSES: Record<'default' | 'filled' | 'unstyled', string>;
2
+ export declare const RADIUS_MAP: Record<'sm' | 'md' | 'lg', string>;
3
+ export declare const LEGEND_CLASSES = "bear-px-2 bear-ml-2 bear-text-gray-900 dark:bear-text-gray-100";
4
+ export declare const DESCRIPTION_CLASSES = "bear-mt-1 bear-mb-3 bear-text-gray-600 dark:bear-text-gray-400";
5
+ export declare const ROOT_CLASS = "Bear-Fieldset bear-w-full bear-p-4 bear-pt-5";