@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,67 @@
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import { cn as T } from "../../utils/cn.js";
3
+ import "react";
4
+ import { Typography as k } from "../Typography/Typography.js";
5
+ import { DEFAULT_SIZE as x, TRACK_COLOR as N, DEFAULT_THICKNESS as O, ROOT_CLASS as S } from "./RingProgress.const.js";
6
+ const j = ({
7
+ sections: d,
8
+ size: t = x,
9
+ thickness: a = O,
10
+ roundCaps: g = !1,
11
+ label: o,
12
+ rootColor: s,
13
+ className: v,
14
+ testId: y,
15
+ ...b
16
+ }) => {
17
+ const l = d.reduce((r, i) => r + i.value, 0), c = (t - a) / 2, m = 2 * Math.PI * c, f = t / 2, h = t / 2;
18
+ let p = 0;
19
+ return /* @__PURE__ */ n(
20
+ "div",
21
+ {
22
+ className: T(S, v),
23
+ "data-testid": y,
24
+ ...b,
25
+ children: [
26
+ /* @__PURE__ */ n("svg", { width: t, height: t, className: "bear-rotate-[-90deg]", children: [
27
+ /* @__PURE__ */ e(
28
+ "circle",
29
+ {
30
+ cx: f,
31
+ cy: h,
32
+ r: c,
33
+ fill: "none",
34
+ strokeWidth: a,
35
+ className: s ? void 0 : N,
36
+ style: s ? { stroke: s } : void 0
37
+ }
38
+ ),
39
+ l > 0 && d.map((r, i) => {
40
+ const u = r.value / l * m, L = -p;
41
+ return p += u, /* @__PURE__ */ n("g", { children: [
42
+ /* @__PURE__ */ e(
43
+ "circle",
44
+ {
45
+ cx: f,
46
+ cy: h,
47
+ r: c,
48
+ fill: "none",
49
+ strokeWidth: a,
50
+ stroke: r.color,
51
+ strokeDasharray: `${u} ${m}`,
52
+ strokeDashoffset: L,
53
+ strokeLinecap: g ? "round" : "butt"
54
+ }
55
+ ),
56
+ r.tooltip && /* @__PURE__ */ e("title", { children: r.tooltip })
57
+ ] }, i);
58
+ })
59
+ ] }),
60
+ o !== void 0 && /* @__PURE__ */ e("div", { className: "bear-absolute bear-inset-0 bear-flex bear-items-center bear-justify-center", children: typeof o == "string" ? /* @__PURE__ */ e(k, { variant: "body2", color: "secondary", children: o }) : o })
61
+ ]
62
+ }
63
+ );
64
+ };
65
+ export {
66
+ j as RingProgress
67
+ };
@@ -0,0 +1,15 @@
1
+ import { ReactNode, HTMLAttributes } from 'react';
2
+ export interface RingProgressSection {
3
+ value: number;
4
+ color: string;
5
+ tooltip?: string;
6
+ }
7
+ export interface RingProgressProps extends HTMLAttributes<HTMLDivElement> {
8
+ sections: RingProgressSection[];
9
+ size?: number;
10
+ thickness?: number;
11
+ roundCaps?: boolean;
12
+ label?: ReactNode;
13
+ rootColor?: string;
14
+ testId?: string;
15
+ }
@@ -0,0 +1,2 @@
1
+ export { RingProgress, default } from './RingProgress';
2
+ export type { RingProgressProps, RingProgressSection } from './RingProgress.types';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),a=require("react"),_=require("../../utils/cn.cjs"),G=require("../Button/Button.cjs"),s=require("./SignPad.const.cjs"),V=y=>{const{onChange:o,width:h=s.SIGN_PAD_DEFAULT_WIDTH,height:f=s.SIGN_PAD_DEFAULT_HEIGHT,strokeColor:B,strokeWidth:m=s.SIGN_PAD_DEFAULT_STROKE_WIDTH,backgroundColor:O,placeholder:U=s.SIGN_PAD_DEFAULT_PLACEHOLDER,disabled:r=!1,readOnly:c=!1,showClear:C=!0,showSave:L=!1,clearText:M="Clear",saveText:j="Save",outputFormat:A=s.SIGN_PAD_DEFAULT_OUTPUT_FORMAT,outputQuality:P=s.SIGN_PAD_DEFAULT_OUTPUT_QUALITY,className:F,testId:H,id:K,...W}=y,l=a.useRef(null),[D,N]=a.useState(!1),[u,I]=a.useState(!1),[v,E]=a.useState(null),[b,q]=a.useState(!1);a.useEffect(()=>{const e=()=>{const n=document.documentElement.classList.contains("dark");q(n)};e();const t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>t.disconnect()},[]);const x=B||(b?s.SIGN_PAD_STROKE_DARK:s.SIGN_PAD_STROKE_LIGHT),S=O||(b?s.SIGN_PAD_BG_DARK:s.SIGN_PAD_BG_LIGHT);a.useEffect(()=>{const e=l.current;if(!e)return;const t=e.getContext("2d");t&&(e.width=h,e.height=f,t.fillStyle=S,t.fillRect(0,0,h,f))},[h,f,S,b]),a.useEffect(()=>{const e=l.current;if(!e||r||c)return;const t=n=>n.preventDefault();return e.addEventListener("touchstart",t,{passive:!1}),e.addEventListener("touchmove",t,{passive:!1}),()=>{e.removeEventListener("touchstart",t),e.removeEventListener("touchmove",t)}},[r,c]);const g=a.useCallback(e=>{const t=l.current;if(!t)return{x:0,y:0};const n=t.getBoundingClientRect(),d=t.width/n.width,p=t.height/n.height;if("touches"in e){const w=e.touches[0];return{x:(w.clientX-n.left)*d,y:(w.clientY-n.top)*p}}return{x:(e.clientX-n.left)*d,y:(e.clientY-n.top)*p}},[]),k=a.useCallback(e=>{if(r||c)return;const t=g(e);N(!0),E(t)},[r,c,g]),R=a.useCallback(e=>{if(!D||r||c)return;const t=l.current,n=t==null?void 0:t.getContext("2d");if(!t||!n||!v)return;const d=g(e);n.beginPath(),n.moveTo(v.x,v.y),n.lineTo(d.x,d.y),n.strokeStyle=x,n.lineWidth=m,n.lineCap="round",n.lineJoin="round",n.stroke(),E(d),I(!0)},[D,r,c,v,x,m,g]),T=a.useCallback(()=>{if(D&&u){const e=l.current;if(e&&o){const t=e.toDataURL(A,P);o(t)}}N(!1),E(null)},[D,u,o,A,P]),X=a.useCallback(()=>{const e=l.current,t=e==null?void 0:e.getContext("2d");!e||!t||(t.fillStyle=S==="transparent"?"rgba(0,0,0,0)":S,t.clearRect(0,0,e.width,e.height),t.fillRect(0,0,e.width,e.height),I(!1),o==null||o(null))},[S,o]),Y=a.useCallback(()=>{const e=l.current;if(!e||!u)return;const t=e.toDataURL(A,P);o==null||o(t)},[u,o,A,P]);return i.jsxs("div",{id:K,"data-testid":H,className:_.cn("Bear-SignPad bear-max-w-full bear-w-full",s.SIGN_PAD_ROOT_CLASSES,r&&"Bear-SignPad--disabled bear-opacity-50",c&&"Bear-SignPad--readonly",F),...W,children:[i.jsxs("div",{className:_.cn("Bear-SignPad__canvas-wrapper bear-max-w-full bear-overflow-hidden","touch-none",s.SIGN_PAD_CANVAS_WRAPPER_CLASSES,!r&&!c&&s.SIGN_PAD_CANVAS_WRAPPER_HOVER,r&&"bear-cursor-not-allowed",!r&&!c&&"bear-cursor-crosshair"),children:[i.jsx("canvas",{ref:l,className:"Bear-SignPad__canvas bear-block bear-rounded-lg bear-max-w-full touch-none",style:{width:h,height:f,touchAction:"none"},onMouseDown:k,onMouseMove:R,onMouseUp:T,onMouseLeave:T,onTouchStart:k,onTouchMove:R,onTouchEnd:T}),!u&&i.jsx("div",{className:_.cn("Bear-SignPad__placeholder",s.SIGN_PAD_PLACEHOLDER_CLASSES),children:U}),i.jsx("div",{className:_.cn("Bear-SignPad__line",s.SIGN_PAD_LINE_CLASSES)}),i.jsx("span",{className:_.cn("Bear-SignPad__x-mark",s.SIGN_PAD_X_MARK_CLASSES),children:"×"})]}),(C||L)&&i.jsxs("div",{className:_.cn("Bear-SignPad__actions",s.SIGN_PAD_ACTIONS_CLASSES),children:[C&&i.jsx(G.Button,{size:"sm",variant:"ghost",onClick:X,disabled:r||!u,children:M}),L&&i.jsx(G.Button,{size:"sm",variant:"primary",onClick:Y,disabled:r||!u,children:j})]})]})};exports.SignPad=V;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),r=require("react"),S=require("../../utils/cn.cjs"),y=require("../Button/Button.cjs"),s=require("./SignPad.const.cjs"),V=B=>{const{onChange:a,width:p,height:b=s.SIGN_PAD_DEFAULT_HEIGHT,strokeColor:O,strokeWidth:T=s.SIGN_PAD_DEFAULT_STROKE_WIDTH,backgroundColor:M,placeholder:U=s.SIGN_PAD_DEFAULT_PLACEHOLDER,disabled:o=!1,readOnly:c=!1,showClear:N=!0,showSave:m=!1,clearText:j="Clear",saveText:F="Save",outputFormat:P=s.SIGN_PAD_DEFAULT_OUTPUT_FORMAT,outputQuality:v=s.SIGN_PAD_DEFAULT_OUTPUT_QUALITY,className:H,testId:K,id:q,...W}=B,i=r.useRef(null),w=r.useRef(null),A=r.useRef(null),g=r.useRef(!1),[h,L]=r.useState(!1),[E,z]=r.useState(!1);r.useEffect(()=>{const e=()=>{z(document.documentElement.classList.contains("dark"))};e();const t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>t.disconnect()},[]);const k=O||(E?s.SIGN_PAD_STROKE_DARK:s.SIGN_PAD_STROKE_LIGHT),C=M||(E?s.SIGN_PAD_BG_DARK:s.SIGN_PAD_BG_LIGHT),_=r.useCallback(()=>{const e=i.current,t=e==null?void 0:e.getContext("2d");!e||!t||(t.fillStyle=C==="transparent"?"rgba(0,0,0,0)":C,t.fillRect(0,0,e.width,e.height))},[C]);r.useEffect(()=>{const e=i.current,t=w.current;if(!e||!t)return;const n=()=>{const d=t.getBoundingClientRect(),f=p??Math.round(d.width),G=b;(e.width!==f||e.height!==G)&&(e.width=f,e.height=G,_())};n();const l=new ResizeObserver(n);return l.observe(t),()=>l.disconnect()},[p,b,_]),r.useEffect(()=>{_()},[_,E]),r.useEffect(()=>{const e=i.current;if(!e||o||c)return;const t=n=>n.preventDefault();return e.addEventListener("touchstart",t,{passive:!1}),e.addEventListener("touchmove",t,{passive:!1}),()=>{e.removeEventListener("touchstart",t),e.removeEventListener("touchmove",t)}},[o,c]);const D=r.useCallback(e=>{const t=i.current;if(!t)return{x:0,y:0};const n=t.getBoundingClientRect(),l=t.width/n.width,d=t.height/n.height;if("touches"in e){const f=e.touches[0];return{x:(f.clientX-n.left)*l,y:(f.clientY-n.top)*d}}return{x:(e.clientX-n.left)*l,y:(e.clientY-n.top)*d}},[]),I=r.useCallback(e=>{if(o||c)return;const t=D(e);g.current=!0,A.current=t},[o,c,D]),x=r.useCallback(e=>{if(!g.current||o||c)return;const t=i.current,n=t==null?void 0:t.getContext("2d"),l=A.current;if(!t||!n||!l)return;const d=D(e);n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(d.x,d.y),n.strokeStyle=k,n.lineWidth=T,n.lineCap="round",n.lineJoin="round",n.stroke(),A.current=d,L(!0)},[o,c,k,T,D]),R=r.useCallback(()=>{if(g.current){const e=i.current;if(e&&a){const t=e.toDataURL(P,v);a(t)}}g.current=!1,A.current=null},[a,P,v]),X=r.useCallback(()=>{const e=i.current,t=e==null?void 0:e.getContext("2d");!e||!t||(t.clearRect(0,0,e.width,e.height),_(),L(!1),a==null||a(null))},[_,a]),Y=r.useCallback(()=>{const e=i.current;if(!e||!h)return;const t=e.toDataURL(P,v);a==null||a(t)},[h,a,P,v]);return u.jsxs("div",{id:q,"data-testid":K,className:S.cn("Bear-SignPad bear-w-full",s.SIGN_PAD_ROOT_CLASSES,o&&"Bear-SignPad--disabled bear-opacity-50",c&&"Bear-SignPad--readonly",H),...W,children:[u.jsxs("div",{ref:w,className:S.cn("Bear-SignPad__canvas-wrapper bear-w-full bear-overflow-hidden","touch-none",s.SIGN_PAD_CANVAS_WRAPPER_CLASSES,!o&&!c&&s.SIGN_PAD_CANVAS_WRAPPER_HOVER,o&&"bear-cursor-not-allowed",!o&&!c&&"bear-cursor-crosshair"),children:[u.jsx("canvas",{ref:i,className:"Bear-SignPad__canvas bear-block bear-rounded-lg bear-w-full touch-none",style:{height:b,touchAction:"none"},onMouseDown:I,onMouseMove:x,onMouseUp:R,onMouseLeave:R,onTouchStart:I,onTouchMove:x,onTouchEnd:R}),!h&&u.jsx("div",{className:S.cn("Bear-SignPad__placeholder",s.SIGN_PAD_PLACEHOLDER_CLASSES),children:U}),u.jsx("div",{className:S.cn("Bear-SignPad__line",s.SIGN_PAD_LINE_CLASSES)}),u.jsx("span",{className:S.cn("Bear-SignPad__x-mark",s.SIGN_PAD_X_MARK_CLASSES),children:"×"})]}),(N||m)&&u.jsxs("div",{className:S.cn("Bear-SignPad__actions",s.SIGN_PAD_ACTIONS_CLASSES),children:[N&&u.jsx(y.Button,{size:"sm",variant:"ghost",onClick:X,disabled:o||!h,children:j}),m&&u.jsx(y.Button,{size:"sm",variant:"primary",onClick:Y,disabled:o||!h,children:F})]})]})};exports.SignPad=V;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=400,e=200,A=2,S="Sign here",r="image/png",D=.92,a="#1f2937",b="#f3f4f6",t="#ffffff",P="#18181b",I="bear-inline-flex bear-flex-col bear-gap-2",E="bear-relative bear-rounded-lg bear-border-2 bear-border-dashed bear-border-gray-300 dark:bear-border-zinc-600",o="hover:bear-border-pink-400 dark:hover:bear-border-pink-500",T="bear-absolute bear-inset-0 bear-flex bear-items-center bear-justify-center bear-text-gray-400 dark:bear-text-zinc-500 bear-text-sm bear-pointer-events-none",G="bear-absolute bear-bottom-8 bear-left-4 bear-right-4 bear-border-b bear-border-gray-300 dark:bear-border-zinc-600",N="bear-absolute bear-bottom-6 bear-left-4 bear-text-gray-400 dark:bear-text-zinc-500 bear-text-lg bear-font-bold",L="bear-flex bear-gap-2 bear-justify-end";exports.SIGN_PAD_ACTIONS_CLASSES=L;exports.SIGN_PAD_BG_DARK=P;exports.SIGN_PAD_BG_LIGHT=t;exports.SIGN_PAD_CANVAS_WRAPPER_CLASSES=E;exports.SIGN_PAD_CANVAS_WRAPPER_HOVER=o;exports.SIGN_PAD_DEFAULT_HEIGHT=e;exports.SIGN_PAD_DEFAULT_OUTPUT_FORMAT=r;exports.SIGN_PAD_DEFAULT_OUTPUT_QUALITY=D;exports.SIGN_PAD_DEFAULT_PLACEHOLDER=S;exports.SIGN_PAD_DEFAULT_STROKE_WIDTH=A;exports.SIGN_PAD_DEFAULT_WIDTH=_;exports.SIGN_PAD_LINE_CLASSES=G;exports.SIGN_PAD_PLACEHOLDER_CLASSES=T;exports.SIGN_PAD_ROOT_CLASSES=I;exports.SIGN_PAD_STROKE_DARK=b;exports.SIGN_PAD_STROKE_LIGHT=a;exports.SIGN_PAD_X_MARK_CLASSES=N;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=200,e=2,S="Sign here",A="image/png",r=.92,a="#1f2937",b="#f3f4f6",t="#ffffff",D="#18181b",P="bear-inline-flex bear-flex-col bear-gap-2",E="bear-relative bear-rounded-lg bear-border-2 bear-border-dashed bear-border-gray-300 dark:bear-border-zinc-600",I="hover:bear-border-pink-400 dark:hover:bear-border-pink-500",o="bear-absolute bear-inset-0 bear-flex bear-items-center bear-justify-center bear-text-gray-400 dark:bear-text-zinc-500 bear-text-sm bear-pointer-events-none",G="bear-absolute bear-bottom-8 bear-left-4 bear-right-4 bear-border-b bear-border-gray-300 dark:bear-border-zinc-600",T="bear-absolute bear-bottom-6 bear-left-4 bear-text-gray-400 dark:bear-text-zinc-500 bear-text-lg bear-font-bold",N="bear-flex bear-gap-2 bear-justify-end";exports.SIGN_PAD_ACTIONS_CLASSES=N;exports.SIGN_PAD_BG_DARK=D;exports.SIGN_PAD_BG_LIGHT=t;exports.SIGN_PAD_CANVAS_WRAPPER_CLASSES=E;exports.SIGN_PAD_CANVAS_WRAPPER_HOVER=I;exports.SIGN_PAD_DEFAULT_HEIGHT=_;exports.SIGN_PAD_DEFAULT_OUTPUT_FORMAT=A;exports.SIGN_PAD_DEFAULT_OUTPUT_QUALITY=r;exports.SIGN_PAD_DEFAULT_PLACEHOLDER=S;exports.SIGN_PAD_DEFAULT_STROKE_WIDTH=e;exports.SIGN_PAD_LINE_CLASSES=G;exports.SIGN_PAD_PLACEHOLDER_CLASSES=o;exports.SIGN_PAD_ROOT_CLASSES=P;exports.SIGN_PAD_STROKE_DARK=b;exports.SIGN_PAD_STROKE_LIGHT=a;exports.SIGN_PAD_X_MARK_CLASSES=T;
@@ -1,20 +1,19 @@
1
- const e = 400, r = 200, _ = 2, a = "Sign here", b = "image/png", t = 0.92, A = "#1f2937", o = "#f3f4f6", S = "#ffffff", n = "#18181b", D = "bear-inline-flex bear-flex-col bear-gap-2", s = "bear-relative bear-rounded-lg bear-border-2 bear-border-dashed bear-border-gray-300 dark:bear-border-zinc-600", I = "hover:bear-border-pink-400 dark:hover:bear-border-pink-500", P = "bear-absolute bear-inset-0 bear-flex bear-items-center bear-justify-center bear-text-gray-400 dark:bear-text-zinc-500 bear-text-sm bear-pointer-events-none", c = "bear-absolute bear-bottom-8 bear-left-4 bear-right-4 bear-border-b bear-border-gray-300 dark:bear-border-zinc-600", E = "bear-absolute bear-bottom-6 bear-left-4 bear-text-gray-400 dark:bear-text-zinc-500 bear-text-lg bear-font-bold", G = "bear-flex bear-gap-2 bear-justify-end";
1
+ const e = 200, r = 2, a = "Sign here", b = "image/png", _ = 0.92, t = "#1f2937", o = "#f3f4f6", A = "#ffffff", S = "#18181b", n = "bear-inline-flex bear-flex-col bear-gap-2", s = "bear-relative bear-rounded-lg bear-border-2 bear-border-dashed bear-border-gray-300 dark:bear-border-zinc-600", D = "hover:bear-border-pink-400 dark:hover:bear-border-pink-500", P = "bear-absolute bear-inset-0 bear-flex bear-items-center bear-justify-center bear-text-gray-400 dark:bear-text-zinc-500 bear-text-sm bear-pointer-events-none", c = "bear-absolute bear-bottom-8 bear-left-4 bear-right-4 bear-border-b bear-border-gray-300 dark:bear-border-zinc-600", E = "bear-absolute bear-bottom-6 bear-left-4 bear-text-gray-400 dark:bear-text-zinc-500 bear-text-lg bear-font-bold", I = "bear-flex bear-gap-2 bear-justify-end";
2
2
  export {
3
- G as SIGN_PAD_ACTIONS_CLASSES,
4
- n as SIGN_PAD_BG_DARK,
5
- S as SIGN_PAD_BG_LIGHT,
3
+ I as SIGN_PAD_ACTIONS_CLASSES,
4
+ S as SIGN_PAD_BG_DARK,
5
+ A as SIGN_PAD_BG_LIGHT,
6
6
  s as SIGN_PAD_CANVAS_WRAPPER_CLASSES,
7
- I as SIGN_PAD_CANVAS_WRAPPER_HOVER,
8
- r as SIGN_PAD_DEFAULT_HEIGHT,
7
+ D as SIGN_PAD_CANVAS_WRAPPER_HOVER,
8
+ e as SIGN_PAD_DEFAULT_HEIGHT,
9
9
  b as SIGN_PAD_DEFAULT_OUTPUT_FORMAT,
10
- t as SIGN_PAD_DEFAULT_OUTPUT_QUALITY,
10
+ _ as SIGN_PAD_DEFAULT_OUTPUT_QUALITY,
11
11
  a as SIGN_PAD_DEFAULT_PLACEHOLDER,
12
- _ as SIGN_PAD_DEFAULT_STROKE_WIDTH,
13
- e as SIGN_PAD_DEFAULT_WIDTH,
12
+ r as SIGN_PAD_DEFAULT_STROKE_WIDTH,
14
13
  c as SIGN_PAD_LINE_CLASSES,
15
14
  P as SIGN_PAD_PLACEHOLDER_CLASSES,
16
- D as SIGN_PAD_ROOT_CLASSES,
15
+ n as SIGN_PAD_ROOT_CLASSES,
17
16
  o as SIGN_PAD_STROKE_DARK,
18
- A as SIGN_PAD_STROKE_LIGHT,
17
+ t as SIGN_PAD_STROKE_LIGHT,
19
18
  E as SIGN_PAD_X_MARK_CLASSES
20
19
  };
@@ -3,14 +3,12 @@ import { SignPadProps } from './SignPad.types';
3
3
  /**
4
4
  * SignPad - Digital signature capture component
5
5
  *
6
+ * Canvas fills 100% of its container width. Height is configurable.
7
+ * Uses ResizeObserver so drawing works correctly at any size.
8
+ *
6
9
  * @example
7
10
  * ```tsx
8
- * const [signature, setSignature] = useState<string | null>(null);
9
- *
10
- * <SignPad
11
- * onChange={setSignature}
12
- * placeholder="Sign here"
13
- * />
11
+ * <SignPad onChange={setSignature} placeholder="Sign here" />
14
12
  * ```
15
13
  */
16
14
  export declare const SignPad: FC<SignPadProps>;
@@ -1,169 +1,161 @@
1
- import { jsxs as p, jsx as l } from "react/jsx-runtime";
2
- import { useRef as J, useState as m, useEffect as L, useCallback as u } from "react";
3
- import { cn as d } from "../../utils/cn.js";
4
- import { Button as O } from "../Button/Button.js";
5
- import { SIGN_PAD_DEFAULT_WIDTH as q, SIGN_PAD_DEFAULT_HEIGHT as Z, SIGN_PAD_DEFAULT_STROKE_WIDTH as $, SIGN_PAD_DEFAULT_PLACEHOLDER as ee, SIGN_PAD_DEFAULT_OUTPUT_FORMAT as te, SIGN_PAD_DEFAULT_OUTPUT_QUALITY as ne, SIGN_PAD_BG_DARK as re, SIGN_PAD_BG_LIGHT as oe, SIGN_PAD_STROKE_DARK as ae, SIGN_PAD_STROKE_LIGHT as se, SIGN_PAD_PLACEHOLDER_CLASSES as ce, SIGN_PAD_LINE_CLASSES as ie, SIGN_PAD_X_MARK_CLASSES as le, SIGN_PAD_CANVAS_WRAPPER_HOVER as ue, SIGN_PAD_CANVAS_WRAPPER_CLASSES as de, SIGN_PAD_ACTIONS_CLASSES as _e, SIGN_PAD_ROOT_CLASSES as Se } from "./SignPad.const.js";
6
- const ve = (U) => {
1
+ import { jsxs as b, jsx as d } from "react/jsx-runtime";
2
+ import { useRef as p, useState as B, useEffect as D, useCallback as l } from "react";
3
+ import { cn as _ } from "../../utils/cn.js";
4
+ import { Button as M } from "../Button/Button.js";
5
+ import { SIGN_PAD_DEFAULT_HEIGHT as Z, SIGN_PAD_DEFAULT_STROKE_WIDTH as $, SIGN_PAD_DEFAULT_PLACEHOLDER as ee, SIGN_PAD_DEFAULT_OUTPUT_FORMAT as te, SIGN_PAD_DEFAULT_OUTPUT_QUALITY as re, SIGN_PAD_BG_DARK as ne, SIGN_PAD_BG_LIGHT as oe, SIGN_PAD_STROKE_DARK as se, SIGN_PAD_STROKE_LIGHT as ae, SIGN_PAD_PLACEHOLDER_CLASSES as ce, SIGN_PAD_LINE_CLASSES as ie, SIGN_PAD_X_MARK_CLASSES as le, SIGN_PAD_CANVAS_WRAPPER_HOVER as ue, SIGN_PAD_CANVAS_WRAPPER_CLASSES as de, SIGN_PAD_ACTIONS_CLASSES as _e, SIGN_PAD_ROOT_CLASSES as he } from "./SignPad.const.js";
6
+ const ge = (U) => {
7
7
  const {
8
8
  onChange: o,
9
- width: S = q,
10
- height: h = Z,
11
- strokeColor: B,
12
- strokeWidth: N = $,
13
- backgroundColor: M,
14
- placeholder: F = ee,
15
- disabled: r = !1,
16
- readOnly: a = !1,
17
- showClear: I = !0,
18
- showSave: b = !1,
19
- clearText: H = "Clear",
20
- saveText: K = "Save",
9
+ width: w,
10
+ height: m = Z,
11
+ strokeColor: F,
12
+ strokeWidth: C = $,
13
+ backgroundColor: H,
14
+ placeholder: K = ee,
15
+ disabled: n = !1,
16
+ readOnly: s = !1,
17
+ showClear: L = !0,
18
+ showSave: R = !1,
19
+ clearText: W = "Clear",
20
+ saveText: z = "Save",
21
21
  outputFormat: f = te,
22
- outputQuality: A = ne,
23
- className: W,
24
- testId: X,
25
- id: Y,
26
- ...V
27
- } = U, s = J(null), [D, C] = m(!1), [c, R] = m(!1), [P, E] = m(null), [g, j] = m(!1);
28
- L(() => {
22
+ outputQuality: A = re,
23
+ className: X,
24
+ testId: Y,
25
+ id: V,
26
+ ...j
27
+ } = U, a = p(null), I = p(null), v = p(null), P = p(!1), [h, G] = B(!1), [E, Q] = B(!1);
28
+ D(() => {
29
29
  const e = () => {
30
- const n = document.documentElement.classList.contains("dark");
31
- j(n);
30
+ Q(document.documentElement.classList.contains("dark"));
32
31
  };
33
32
  e();
34
33
  const t = new MutationObserver(e);
35
34
  return t.observe(document.documentElement, { attributes: !0, attributeFilter: ["class"] }), () => t.disconnect();
36
35
  }, []);
37
- const w = B || (g ? ae : se), _ = M || (g ? re : oe);
38
- L(() => {
39
- const e = s.current;
40
- if (!e) return;
41
- const t = e.getContext("2d");
42
- t && (e.width = S, e.height = h, t.fillStyle = _, t.fillRect(0, 0, S, h));
43
- }, [S, h, _, g]), L(() => {
44
- const e = s.current;
45
- if (!e || r || a) return;
46
- const t = (n) => n.preventDefault();
36
+ const k = F || (E ? se : ae), N = H || (E ? ne : oe), u = l(() => {
37
+ const e = a.current, t = e == null ? void 0 : e.getContext("2d");
38
+ !e || !t || (t.fillStyle = N === "transparent" ? "rgba(0,0,0,0)" : N, t.fillRect(0, 0, e.width, e.height));
39
+ }, [N]);
40
+ D(() => {
41
+ const e = a.current, t = I.current;
42
+ if (!e || !t) return;
43
+ const r = () => {
44
+ const i = t.getBoundingClientRect(), S = w ?? Math.round(i.width), y = m;
45
+ (e.width !== S || e.height !== y) && (e.width = S, e.height = y, u());
46
+ };
47
+ r();
48
+ const c = new ResizeObserver(r);
49
+ return c.observe(t), () => c.disconnect();
50
+ }, [w, m, u]), D(() => {
51
+ u();
52
+ }, [u, E]), D(() => {
53
+ const e = a.current;
54
+ if (!e || n || s) return;
55
+ const t = (r) => r.preventDefault();
47
56
  return e.addEventListener("touchstart", t, { passive: !1 }), e.addEventListener("touchmove", t, { passive: !1 }), () => {
48
57
  e.removeEventListener("touchstart", t), e.removeEventListener("touchmove", t);
49
58
  };
50
- }, [r, a]);
51
- const v = u((e) => {
52
- const t = s.current;
59
+ }, [n, s]);
60
+ const g = l((e) => {
61
+ const t = a.current;
53
62
  if (!t) return { x: 0, y: 0 };
54
- const n = t.getBoundingClientRect(), i = t.width / n.width, x = t.height / n.height;
63
+ const r = t.getBoundingClientRect(), c = t.width / r.width, i = t.height / r.height;
55
64
  if ("touches" in e) {
56
- const y = e.touches[0];
65
+ const S = e.touches[0];
57
66
  return {
58
- x: (y.clientX - n.left) * i,
59
- y: (y.clientY - n.top) * x
67
+ x: (S.clientX - r.left) * c,
68
+ y: (S.clientY - r.top) * i
60
69
  };
61
70
  }
62
71
  return {
63
- x: (e.clientX - n.left) * i,
64
- y: (e.clientY - n.top) * x
72
+ x: (e.clientX - r.left) * c,
73
+ y: (e.clientY - r.top) * i
65
74
  };
66
- }, []), G = u((e) => {
67
- if (r || a) return;
68
- const t = v(e);
69
- C(!0), E(t);
70
- }, [r, a, v]), k = u((e) => {
71
- if (!D || r || a) return;
72
- const t = s.current, n = t == null ? void 0 : t.getContext("2d");
73
- if (!t || !n || !P) return;
74
- const i = v(e);
75
- n.beginPath(), n.moveTo(P.x, P.y), n.lineTo(i.x, i.y), n.strokeStyle = w, n.lineWidth = N, n.lineCap = "round", n.lineJoin = "round", n.stroke(), E(i), R(!0);
76
- }, [D, r, a, P, w, N, v]), T = u(() => {
77
- if (D && c) {
78
- const e = s.current;
75
+ }, []), x = l((e) => {
76
+ if (n || s) return;
77
+ const t = g(e);
78
+ P.current = !0, v.current = t;
79
+ }, [n, s, g]), O = l((e) => {
80
+ if (!P.current || n || s) return;
81
+ const t = a.current, r = t == null ? void 0 : t.getContext("2d"), c = v.current;
82
+ if (!t || !r || !c) return;
83
+ const i = g(e);
84
+ r.beginPath(), r.moveTo(c.x, c.y), r.lineTo(i.x, i.y), r.strokeStyle = k, r.lineWidth = C, r.lineCap = "round", r.lineJoin = "round", r.stroke(), v.current = i, G(!0);
85
+ }, [n, s, k, C, g]), T = l(() => {
86
+ if (P.current) {
87
+ const e = a.current;
79
88
  if (e && o) {
80
89
  const t = e.toDataURL(f, A);
81
90
  o(t);
82
91
  }
83
92
  }
84
- C(!1), E(null);
85
- }, [D, c, o, f, A]), z = u(() => {
86
- const e = s.current, t = e == null ? void 0 : e.getContext("2d");
87
- !e || !t || (t.fillStyle = _ === "transparent" ? "rgba(0,0,0,0)" : _, t.clearRect(0, 0, e.width, e.height), t.fillRect(0, 0, e.width, e.height), R(!1), o == null || o(null));
88
- }, [_, o]), Q = u(() => {
89
- const e = s.current;
90
- if (!e || !c) return;
93
+ P.current = !1, v.current = null;
94
+ }, [o, f, A]), J = l(() => {
95
+ const e = a.current, t = e == null ? void 0 : e.getContext("2d");
96
+ !e || !t || (t.clearRect(0, 0, e.width, e.height), u(), G(!1), o == null || o(null));
97
+ }, [u, o]), q = l(() => {
98
+ const e = a.current;
99
+ if (!e || !h) return;
91
100
  const t = e.toDataURL(f, A);
92
101
  o == null || o(t);
93
- }, [c, o, f, A]);
94
- return /* @__PURE__ */ p(
102
+ }, [h, o, f, A]);
103
+ return /* @__PURE__ */ b(
95
104
  "div",
96
105
  {
97
- id: Y,
98
- "data-testid": X,
99
- className: d(
100
- "Bear-SignPad bear-max-w-full bear-w-full",
101
- Se,
102
- r && "Bear-SignPad--disabled bear-opacity-50",
103
- a && "Bear-SignPad--readonly",
104
- W
106
+ id: V,
107
+ "data-testid": Y,
108
+ className: _(
109
+ "Bear-SignPad bear-w-full",
110
+ he,
111
+ n && "Bear-SignPad--disabled bear-opacity-50",
112
+ s && "Bear-SignPad--readonly",
113
+ X
105
114
  ),
106
- ...V,
115
+ ...j,
107
116
  children: [
108
- /* @__PURE__ */ p(
117
+ /* @__PURE__ */ b(
109
118
  "div",
110
119
  {
111
- className: d(
112
- "Bear-SignPad__canvas-wrapper bear-max-w-full bear-overflow-hidden",
120
+ ref: I,
121
+ className: _(
122
+ "Bear-SignPad__canvas-wrapper bear-w-full bear-overflow-hidden",
113
123
  "touch-none",
114
124
  de,
115
- !r && !a && ue,
116
- r && "bear-cursor-not-allowed",
117
- !r && !a && "bear-cursor-crosshair"
125
+ !n && !s && ue,
126
+ n && "bear-cursor-not-allowed",
127
+ !n && !s && "bear-cursor-crosshair"
118
128
  ),
119
129
  children: [
120
- /* @__PURE__ */ l(
130
+ /* @__PURE__ */ d(
121
131
  "canvas",
122
132
  {
123
- ref: s,
124
- className: "Bear-SignPad__canvas bear-block bear-rounded-lg bear-max-w-full touch-none",
125
- style: { width: S, height: h, touchAction: "none" },
126
- onMouseDown: G,
127
- onMouseMove: k,
133
+ ref: a,
134
+ className: "Bear-SignPad__canvas bear-block bear-rounded-lg bear-w-full touch-none",
135
+ style: { height: m, touchAction: "none" },
136
+ onMouseDown: x,
137
+ onMouseMove: O,
128
138
  onMouseUp: T,
129
139
  onMouseLeave: T,
130
- onTouchStart: G,
131
- onTouchMove: k,
140
+ onTouchStart: x,
141
+ onTouchMove: O,
132
142
  onTouchEnd: T
133
143
  }
134
144
  ),
135
- !c && /* @__PURE__ */ l("div", { className: d("Bear-SignPad__placeholder", ce), children: F }),
136
- /* @__PURE__ */ l("div", { className: d("Bear-SignPad__line", ie) }),
137
- /* @__PURE__ */ l("span", { className: d("Bear-SignPad__x-mark", le), children: "×" })
145
+ !h && /* @__PURE__ */ d("div", { className: _("Bear-SignPad__placeholder", ce), children: K }),
146
+ /* @__PURE__ */ d("div", { className: _("Bear-SignPad__line", ie) }),
147
+ /* @__PURE__ */ d("span", { className: _("Bear-SignPad__x-mark", le), children: "×" })
138
148
  ]
139
149
  }
140
150
  ),
141
- (I || b) && /* @__PURE__ */ p("div", { className: d("Bear-SignPad__actions", _e), children: [
142
- I && /* @__PURE__ */ l(
143
- O,
144
- {
145
- size: "sm",
146
- variant: "ghost",
147
- onClick: z,
148
- disabled: r || !c,
149
- children: H
150
- }
151
- ),
152
- b && /* @__PURE__ */ l(
153
- O,
154
- {
155
- size: "sm",
156
- variant: "primary",
157
- onClick: Q,
158
- disabled: r || !c,
159
- children: K
160
- }
161
- )
151
+ (L || R) && /* @__PURE__ */ b("div", { className: _("Bear-SignPad__actions", _e), children: [
152
+ L && /* @__PURE__ */ d(M, { size: "sm", variant: "ghost", onClick: J, disabled: n || !h, children: W }),
153
+ R && /* @__PURE__ */ d(M, { size: "sm", variant: "primary", onClick: q, disabled: n || !h, children: z })
162
154
  ] })
163
155
  ]
164
156
  }
165
157
  );
166
158
  };
167
159
  export {
168
- ve as SignPad
160
+ ge as SignPad
169
161
  };
@@ -2,9 +2,9 @@ import { HTMLAttributes } from 'react';
2
2
  export interface SignPadProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
3
3
  /** Callback when signature changes - receives base64 image data */
4
4
  onChange?: (signature: string | null) => void;
5
- /** Width of the canvas */
5
+ /** Canvas resolution width (internal pixels). CSS width is always 100% of container. */
6
6
  width?: number;
7
- /** Height of the canvas */
7
+ /** Canvas resolution height (internal pixels). Also sets the CSS height. */
8
8
  height?: number;
9
9
  /** Stroke color */
10
10
  strokeColor?: string;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("react"),t=require("../../utils/cn.cjs"),n=require("./SplitButton.const.cjs"),j=u=>{const{label:b,icon:m,options:C,variant:N="primary",size:c="md",disabled:f=!1,loading:d=!1,onClick:A,dropdownAlign:E="left",className:_,testId:h,...L}=u,[r,l]=i.useState(!1),o=i.useRef(null);i.useEffect(()=>{const e=R=>{o.current&&!o.current.contains(R.target)&&l(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);const O=i.useCallback(e=>{e.disabled||(e.onClick(),l(!1))},[]),S=n.VARIANT_CLASSES[N],p=n.SIZE_CLASSES[c],x=n.ARROW_SIZE_CLASSES[c],a=f||d;return s.jsxs("div",{ref:o,className:t.cn(n.ROOT_CLASSES,_),"data-testid":h,children:[s.jsxs("button",{type:"button",className:t.cn(n.MAIN_BTN_CLASSES,S,p,a&&"bear-opacity-50 bear-cursor-not-allowed"),onClick:A,disabled:a,...L,children:[d?s.jsx("span",{className:n.SPINNER_CLASSES}):m,b]}),s.jsx("button",{type:"button",className:t.cn(n.ARROW_BTN_CLASSES,S,x,a&&"bear-opacity-50 bear-cursor-not-allowed"),onClick:()=>!a&&l(!r),disabled:a,"aria-label":"More options","aria-expanded":r,children:s.jsx("svg",{className:t.cn("bear-w-4 bear-h-4 bear-transition-transform",r&&"bear-rotate-180"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})}),r&&s.jsx("div",{className:t.cn(n.DROPDOWN_CLASSES,E==="right"?"bear-right-0":"bear-left-0","bear-top-full"),children:C.map(e=>s.jsxs("div",{className:t.cn(n.OPTION_CLASSES,e.danger&&n.OPTION_DANGER_CLASSES,e.disabled&&n.OPTION_DISABLED_CLASSES),onClick:()=>O(e),role:"menuitem",children:[e.icon&&s.jsx("span",{className:"bear-w-4 bear-h-4 bear-flex-shrink-0",children:e.icon}),e.label]},e.id))})]})};exports.SplitButton=j;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r={primary:"bear-bg-pink-500 bear-text-white hover:bear-bg-pink-600",secondary:"bear-bg-gray-600 bear-text-white hover:bear-bg-gray-700",outline:"bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-text-gray-700 dark:bear-text-zinc-300 hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-700",danger:"bear-bg-red-500 bear-text-white hover:bear-bg-red-600"},e={sm:"bear-text-sm bear-py-1.5 bear-px-3",md:"bear-text-sm bear-py-2 bear-px-4",lg:"bear-text-base bear-py-2.5 bear-px-5"},a={sm:"bear-py-1.5 bear-px-2",md:"bear-py-2 bear-px-2.5",lg:"bear-py-2.5 bear-px-3"},b="Bear-SplitButton bear-relative bear-inline-flex",t="bear-font-medium bear-transition-colors bear-rounded-l-lg bear-flex bear-items-center bear-gap-1.5",S="bear-rounded-r-lg bear-border-l bear-border-white/20 bear-transition-colors bear-flex bear-items-center bear-justify-center",o="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-lg bear-shadow-xl bear-py-1 bear-min-w-[160px] bear-animate-in",n="bear-flex bear-items-center bear-gap-2 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",d="bear-text-red-600 dark:bear-text-red-400 hover:bear-bg-red-50 dark:hover:bear-bg-red-900/20",i="bear-opacity-40 bear-cursor-not-allowed",A="bear-w-4 bear-h-4 bear-border-2 bear-border-current/30 bear-border-t-current bear-rounded-full bear-animate-spin";exports.ARROW_BTN_CLASSES=S;exports.ARROW_SIZE_CLASSES=a;exports.DROPDOWN_CLASSES=o;exports.MAIN_BTN_CLASSES=t;exports.OPTION_CLASSES=n;exports.OPTION_DANGER_CLASSES=d;exports.OPTION_DISABLED_CLASSES=i;exports.ROOT_CLASSES=b;exports.SIZE_CLASSES=e;exports.SPINNER_CLASSES=A;exports.VARIANT_CLASSES=r;
@@ -0,0 +1,25 @@
1
+ export declare const VARIANT_CLASSES: {
2
+ readonly primary: "bear-bg-pink-500 bear-text-white hover:bear-bg-pink-600";
3
+ readonly secondary: "bear-bg-gray-600 bear-text-white hover:bear-bg-gray-700";
4
+ readonly outline: "bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-text-gray-700 dark:bear-text-zinc-300 hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-700";
5
+ readonly danger: "bear-bg-red-500 bear-text-white hover:bear-bg-red-600";
6
+ };
7
+ export declare const SIZE_CLASSES: {
8
+ readonly sm: "bear-text-sm bear-py-1.5 bear-px-3";
9
+ readonly md: "bear-text-sm bear-py-2 bear-px-4";
10
+ readonly lg: "bear-text-base bear-py-2.5 bear-px-5";
11
+ };
12
+ export declare const ARROW_SIZE_CLASSES: {
13
+ readonly sm: "bear-py-1.5 bear-px-2";
14
+ readonly md: "bear-py-2 bear-px-2.5";
15
+ readonly lg: "bear-py-2.5 bear-px-3";
16
+ };
17
+ export declare const ROOT_CLASSES = "Bear-SplitButton bear-relative bear-inline-flex";
18
+ export declare const MAIN_BTN_CLASSES = "bear-font-medium bear-transition-colors bear-rounded-l-lg bear-flex bear-items-center bear-gap-1.5";
19
+ export declare const ARROW_BTN_CLASSES = "bear-rounded-r-lg bear-border-l bear-border-white/20 bear-transition-colors bear-flex bear-items-center bear-justify-center";
20
+ 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-lg bear-shadow-xl bear-py-1 bear-min-w-[160px] bear-animate-in";
21
+ export declare const OPTION_CLASSES = "bear-flex bear-items-center bear-gap-2 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";
22
+ export declare const OPTION_DANGER_CLASSES = "bear-text-red-600 dark:bear-text-red-400 hover:bear-bg-red-50 dark:hover:bear-bg-red-900/20";
23
+ export declare const OPTION_DISABLED_CLASSES = "bear-opacity-40 bear-cursor-not-allowed";
24
+ export declare const DIVIDER_CLASSES = "bear-border-l bear-border-white/30";
25
+ export declare const SPINNER_CLASSES = "bear-w-4 bear-h-4 bear-border-2 bear-border-current/30 bear-border-t-current bear-rounded-full bear-animate-spin";
@@ -0,0 +1,27 @@
1
+ const r = {
2
+ primary: "bear-bg-pink-500 bear-text-white hover:bear-bg-pink-600",
3
+ secondary: "bear-bg-gray-600 bear-text-white hover:bear-bg-gray-700",
4
+ outline: "bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-text-gray-700 dark:bear-text-zinc-300 hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-700",
5
+ danger: "bear-bg-red-500 bear-text-white hover:bear-bg-red-600"
6
+ }, e = {
7
+ sm: "bear-text-sm bear-py-1.5 bear-px-3",
8
+ md: "bear-text-sm bear-py-2 bear-px-4",
9
+ lg: "bear-text-base bear-py-2.5 bear-px-5"
10
+ }, a = {
11
+ sm: "bear-py-1.5 bear-px-2",
12
+ md: "bear-py-2 bear-px-2.5",
13
+ lg: "bear-py-2.5 bear-px-3"
14
+ }, b = "Bear-SplitButton bear-relative bear-inline-flex", t = "bear-font-medium bear-transition-colors bear-rounded-l-lg bear-flex bear-items-center bear-gap-1.5", o = "bear-rounded-r-lg bear-border-l bear-border-white/20 bear-transition-colors bear-flex bear-items-center bear-justify-center", n = "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-lg bear-shadow-xl bear-py-1 bear-min-w-[160px] bear-animate-in", d = "bear-flex bear-items-center bear-gap-2 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", i = "bear-text-red-600 dark:bear-text-red-400 hover:bear-bg-red-50 dark:hover:bear-bg-red-900/20", S = "bear-opacity-40 bear-cursor-not-allowed", s = "bear-w-4 bear-h-4 bear-border-2 bear-border-current/30 bear-border-t-current bear-rounded-full bear-animate-spin";
15
+ export {
16
+ o as ARROW_BTN_CLASSES,
17
+ a as ARROW_SIZE_CLASSES,
18
+ n as DROPDOWN_CLASSES,
19
+ t as MAIN_BTN_CLASSES,
20
+ d as OPTION_CLASSES,
21
+ i as OPTION_DANGER_CLASSES,
22
+ S as OPTION_DISABLED_CLASSES,
23
+ b as ROOT_CLASSES,
24
+ e as SIZE_CLASSES,
25
+ s as SPINNER_CLASSES,
26
+ r as VARIANT_CLASSES
27
+ };
@@ -0,0 +1,4 @@
1
+ import { FC } from 'react';
2
+ import { SplitButtonProps } from './SplitButton.types';
3
+ export declare const SplitButton: FC<SplitButtonProps>;
4
+ export default SplitButton;
@@ -0,0 +1,73 @@
1
+ import { jsxs as o, jsx as a } from "react/jsx-runtime";
2
+ import { useState as I, useRef as R, useEffect as v, useCallback as w } from "react";
3
+ import { cn as n } from "../../utils/cn.js";
4
+ import { SPINNER_CLASSES as g, SIZE_CLASSES as T, VARIANT_CLASSES as x, MAIN_BTN_CLASSES as D, ARROW_SIZE_CLASSES as y, ARROW_BTN_CLASSES as B, OPTION_DISABLED_CLASSES as P, OPTION_DANGER_CLASSES as W, OPTION_CLASSES as j, DROPDOWN_CLASSES as z, ROOT_CLASSES as M } from "./SplitButton.const.js";
5
+ const F = (S) => {
6
+ const {
7
+ label: b,
8
+ icon: m,
9
+ options: u,
10
+ variant: f = "primary",
11
+ size: l = "md",
12
+ disabled: C = !1,
13
+ loading: c = !1,
14
+ onClick: N,
15
+ dropdownAlign: A = "left",
16
+ className: E,
17
+ testId: p,
18
+ ...h
19
+ } = S, [s, t] = I(!1), i = R(null);
20
+ v(() => {
21
+ const e = (k) => {
22
+ i.current && !i.current.contains(k.target) && t(!1);
23
+ };
24
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
25
+ }, []);
26
+ const L = w((e) => {
27
+ e.disabled || (e.onClick(), t(!1));
28
+ }, []), d = x[f], _ = T[l], O = y[l], r = C || c;
29
+ return /* @__PURE__ */ o("div", { ref: i, className: n(M, E), "data-testid": p, children: [
30
+ /* @__PURE__ */ o(
31
+ "button",
32
+ {
33
+ type: "button",
34
+ className: n(D, d, _, r && "bear-opacity-50 bear-cursor-not-allowed"),
35
+ onClick: N,
36
+ disabled: r,
37
+ ...h,
38
+ children: [
39
+ c ? /* @__PURE__ */ a("span", { className: g }) : m,
40
+ b
41
+ ]
42
+ }
43
+ ),
44
+ /* @__PURE__ */ a(
45
+ "button",
46
+ {
47
+ type: "button",
48
+ className: n(B, d, O, r && "bear-opacity-50 bear-cursor-not-allowed"),
49
+ onClick: () => !r && t(!s),
50
+ disabled: r,
51
+ "aria-label": "More options",
52
+ "aria-expanded": s,
53
+ children: /* @__PURE__ */ a("svg", { className: n("bear-w-4 bear-h-4 bear-transition-transform", s && "bear-rotate-180"), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ a("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" }) })
54
+ }
55
+ ),
56
+ s && /* @__PURE__ */ a("div", { className: n(z, A === "right" ? "bear-right-0" : "bear-left-0", "bear-top-full"), children: u.map((e) => /* @__PURE__ */ o(
57
+ "div",
58
+ {
59
+ className: n(j, e.danger && W, e.disabled && P),
60
+ onClick: () => L(e),
61
+ role: "menuitem",
62
+ children: [
63
+ e.icon && /* @__PURE__ */ a("span", { className: "bear-w-4 bear-h-4 bear-flex-shrink-0", children: e.icon }),
64
+ e.label
65
+ ]
66
+ },
67
+ e.id
68
+ )) })
69
+ ] });
70
+ };
71
+ export {
72
+ F as SplitButton
73
+ };