@forgedevstack/bear 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Alert/Alert.cjs +1 -1
- package/dist/components/Alert/Alert.const.cjs +1 -1
- package/dist/components/Alert/Alert.const.d.ts +4 -0
- package/dist/components/Alert/Alert.const.js +9 -15
- package/dist/components/Alert/Alert.js +43 -38
- package/dist/components/AppBar/AppBar.cjs +1 -1
- package/dist/components/AppBar/AppBar.js +20 -16
- package/dist/components/BackTop/BackTop.cjs +1 -0
- package/dist/components/BackTop/BackTop.const.cjs +1 -0
- package/dist/components/BackTop/BackTop.const.d.ts +34 -0
- package/dist/components/BackTop/BackTop.const.js +29 -0
- package/dist/components/BackTop/BackTop.d.ts +21 -0
- package/dist/components/BackTop/BackTop.js +87 -0
- package/dist/components/BackTop/BackTop.types.d.ts +28 -0
- package/dist/components/BackTop/index.d.ts +3 -0
- package/dist/components/Badge/Badge.constants.d.ts +4 -4
- package/dist/components/Badge/Badge.types.d.ts +3 -3
- package/dist/components/BottomSheet/BottomSheet.cjs +1 -0
- package/dist/components/BottomSheet/BottomSheet.d.ts +3 -0
- package/dist/components/BottomSheet/BottomSheet.js +103 -0
- package/dist/components/BottomSheet/BottomSheet.types.d.ts +13 -0
- package/dist/components/BottomSheet/index.d.ts +2 -0
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.constants.cjs +38 -48
- package/dist/components/Button/Button.constants.d.ts +22 -3
- package/dist/components/Button/Button.constants.js +51 -50
- package/dist/components/Button/Button.d.ts +14 -7
- package/dist/components/Button/Button.js +123 -43
- package/dist/components/Button/Button.types.d.ts +26 -4
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.js +3 -2
- package/dist/components/Card/Card.const.d.ts +2 -2
- package/dist/components/Card/Card.types.d.ts +2 -2
- package/dist/components/Chat/Chat.cjs +1 -0
- package/dist/components/Chat/Chat.const.cjs +1 -0
- package/dist/components/Chat/Chat.const.d.ts +26 -0
- package/dist/components/Chat/Chat.const.js +29 -0
- package/dist/components/Chat/Chat.d.ts +21 -0
- package/dist/components/Chat/Chat.js +179 -0
- package/dist/components/Chat/Chat.types.d.ts +55 -0
- package/dist/components/Chat/index.d.ts +2 -0
- package/dist/components/Confetti/Confetti.cjs +1 -0
- package/dist/components/Confetti/Confetti.const.cjs +1 -0
- package/dist/components/Confetti/Confetti.const.d.ts +16 -0
- package/dist/components/Confetti/Confetti.const.js +36 -0
- package/dist/components/Confetti/Confetti.d.ts +23 -0
- package/dist/components/Confetti/Confetti.js +94 -0
- package/dist/components/Confetti/Confetti.types.d.ts +50 -0
- package/dist/components/Confetti/index.d.ts +4 -0
- package/dist/components/Confetti/useConfetti.cjs +1 -0
- package/dist/components/Confetti/useConfetti.d.ts +13 -0
- package/dist/components/Confetti/useConfetti.js +12 -0
- package/dist/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/DatePicker/DatePicker.js +3 -2
- package/dist/components/DiffViewer/DiffViewer.cjs +1 -0
- package/dist/components/DiffViewer/DiffViewer.const.cjs +1 -0
- package/dist/components/DiffViewer/DiffViewer.const.d.ts +18 -0
- package/dist/components/DiffViewer/DiffViewer.const.js +21 -0
- package/dist/components/DiffViewer/DiffViewer.d.ts +18 -0
- package/dist/components/DiffViewer/DiffViewer.js +127 -0
- package/dist/components/DiffViewer/DiffViewer.types.d.ts +40 -0
- package/dist/components/DiffViewer/DiffViewer.utils.cjs +3 -0
- package/dist/components/DiffViewer/DiffViewer.utils.d.ts +9 -0
- package/dist/components/DiffViewer/DiffViewer.utils.js +39 -0
- package/dist/components/DiffViewer/index.d.ts +2 -0
- package/dist/components/Drawer/Drawer.cjs +1 -1
- package/dist/components/Drawer/Drawer.js +35 -35
- package/dist/components/EmojiPicker/EmojiPicker.cjs +1 -0
- package/dist/components/EmojiPicker/EmojiPicker.const.cjs +1 -0
- package/dist/components/EmojiPicker/EmojiPicker.const.d.ts +5 -0
- package/dist/components/EmojiPicker/EmojiPicker.const.js +10 -0
- package/dist/components/EmojiPicker/EmojiPicker.d.ts +3 -0
- package/dist/components/EmojiPicker/EmojiPicker.js +63 -0
- package/dist/components/EmojiPicker/EmojiPicker.types.d.ts +6 -0
- package/dist/components/EmojiPicker/index.d.ts +3 -0
- package/dist/components/FloatingChat/FloatingChat.cjs +1 -0
- package/dist/components/FloatingChat/FloatingChat.const.cjs +1 -0
- package/dist/components/FloatingChat/FloatingChat.const.d.ts +12 -0
- package/dist/components/FloatingChat/FloatingChat.const.js +15 -0
- package/dist/components/FloatingChat/FloatingChat.d.ts +19 -0
- package/dist/components/FloatingChat/FloatingChat.js +144 -0
- package/dist/components/FloatingChat/FloatingChat.types.d.ts +44 -0
- package/dist/components/FloatingChat/index.d.ts +2 -0
- package/dist/components/JsonViewer/JsonViewer.cjs +1 -0
- package/dist/components/JsonViewer/JsonViewer.const.cjs +1 -0
- package/dist/components/JsonViewer/JsonViewer.const.d.ts +4 -0
- package/dist/components/JsonViewer/JsonViewer.const.js +24 -0
- package/dist/components/JsonViewer/JsonViewer.d.ts +17 -0
- package/dist/components/JsonViewer/JsonViewer.js +195 -0
- package/dist/components/JsonViewer/JsonViewer.types.d.ts +54 -0
- package/dist/components/JsonViewer/index.d.ts +2 -0
- package/dist/components/Kanban/Kanban.cjs +1 -0
- package/dist/components/Kanban/Kanban.d.ts +3 -0
- package/dist/components/Kanban/Kanban.js +91 -0
- package/dist/components/Kanban/Kanban.types.d.ts +21 -0
- package/dist/components/Kanban/index.d.ts +2 -0
- package/dist/components/MentionsInput/MentionsInput.cjs +1 -0
- package/dist/components/MentionsInput/MentionsInput.d.ts +3 -0
- package/dist/components/MentionsInput/MentionsInput.js +140 -0
- package/dist/components/MentionsInput/MentionsInput.types.d.ts +21 -0
- package/dist/components/MentionsInput/index.d.ts +2 -0
- package/dist/components/QRCode/QRCode.cjs +1 -0
- package/dist/components/QRCode/QRCode.const.cjs +1 -0
- package/dist/components/QRCode/QRCode.const.d.ts +21 -0
- package/dist/components/QRCode/QRCode.const.js +11 -0
- package/dist/components/QRCode/QRCode.d.ts +29 -0
- package/dist/components/QRCode/QRCode.js +68 -0
- package/dist/components/QRCode/QRCode.types.d.ts +32 -0
- package/dist/components/QRCode/QRCode.utils.cjs +1 -0
- package/dist/components/QRCode/QRCode.utils.d.ts +12 -0
- package/dist/components/QRCode/QRCode.utils.js +74 -0
- package/dist/components/QRCode/index.d.ts +3 -0
- package/dist/components/RichEditor/RichEditor.cjs +1 -1
- package/dist/components/RichEditor/RichEditor.const.cjs +2 -2
- package/dist/components/RichEditor/RichEditor.const.d.ts +4 -1
- package/dist/components/RichEditor/RichEditor.const.js +51 -18
- package/dist/components/RichEditor/RichEditor.js +106 -105
- package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.cjs +1 -1
- package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.js +105 -95
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.cjs +1 -1
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.d.ts +2 -0
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.js +47 -29
- package/dist/components/SegmentedControl/SegmentedControl.cjs +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +3 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +58 -0
- package/dist/components/SegmentedControl/SegmentedControl.types.d.ts +16 -0
- package/dist/components/SegmentedControl/index.d.ts +2 -0
- package/dist/components/SignPad/SignPad.cjs +1 -1
- package/dist/components/SignPad/SignPad.js +98 -90
- package/dist/components/SliderRange/SliderRange.cjs +1 -0
- package/dist/components/SliderRange/SliderRange.d.ts +3 -0
- package/dist/components/SliderRange/SliderRange.js +142 -0
- package/dist/components/SliderRange/SliderRange.types.d.ts +17 -0
- package/dist/components/SliderRange/index.d.ts +2 -0
- package/dist/components/Spinner/Spinner.types.d.ts +2 -2
- package/dist/components/TagsInput/TagsInput.cjs +1 -0
- package/dist/components/TagsInput/TagsInput.d.ts +3 -0
- package/dist/components/TagsInput/TagsInput.js +100 -0
- package/dist/components/TagsInput/TagsInput.types.d.ts +16 -0
- package/dist/components/TagsInput/index.d.ts +2 -0
- package/dist/components/Terminal/Terminal.cjs +1 -0
- package/dist/components/Terminal/Terminal.const.cjs +1 -0
- package/dist/components/Terminal/Terminal.const.d.ts +32 -0
- package/dist/components/Terminal/Terminal.const.js +42 -0
- package/dist/components/Terminal/Terminal.d.ts +27 -0
- package/dist/components/Terminal/Terminal.js +155 -0
- package/dist/components/Terminal/Terminal.types.d.ts +49 -0
- package/dist/components/Terminal/index.d.ts +2 -0
- package/dist/components/Tour/Tour.cjs +1 -0
- package/dist/components/Tour/Tour.const.cjs +1 -0
- package/dist/components/Tour/Tour.const.d.ts +25 -0
- package/dist/components/Tour/Tour.const.js +38 -0
- package/dist/components/Tour/Tour.d.ts +17 -0
- package/dist/components/Tour/Tour.js +179 -0
- package/dist/components/Tour/Tour.types.d.ts +80 -0
- package/dist/components/Tour/index.d.ts +4 -0
- package/dist/components/Tour/useTour.cjs +1 -0
- package/dist/components/Tour/useTour.d.ts +14 -0
- package/dist/components/Tour/useTour.js +27 -0
- package/dist/components/Typography/Typography.cjs +1 -1
- package/dist/components/Typography/Typography.d.ts +5 -1
- package/dist/components/Typography/Typography.js +93 -57
- package/dist/components/Typography/Typography.types.d.ts +29 -2
- package/dist/components/VirtualList/VirtualList.cjs +1 -0
- package/dist/components/VirtualList/VirtualList.d.ts +3 -0
- package/dist/components/VirtualList/VirtualList.js +68 -0
- package/dist/components/VirtualList/VirtualList.types.d.ts +10 -0
- package/dist/components/VirtualList/index.d.ts +2 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +35 -1
- package/dist/components/index.js +240 -198
- package/dist/context/BearProvider.cjs +1 -1
- package/dist/context/BearProvider.d.ts +110 -5
- package/dist/context/BearProvider.js +198 -53
- package/dist/context/defaultTheme.cjs +1 -1
- package/dist/context/defaultTheme.js +11 -11
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.ts +18 -0
- package/dist/hooks/index.js +56 -35
- package/dist/hooks/useBearComponent/index.d.ts +2 -0
- package/dist/hooks/useBearComponent/useBearComponent.cjs +1 -0
- package/dist/hooks/useBearComponent/useBearComponent.d.ts +71 -0
- package/dist/hooks/useBearComponent/useBearComponent.js +54 -0
- package/dist/hooks/useBearComponent/useBearComponent.types.d.ts +40 -0
- package/dist/hooks/useDragDrop/index.d.ts +2 -0
- package/dist/hooks/useDragDrop/useDragDrop.cjs +1 -0
- package/dist/hooks/useDragDrop/useDragDrop.d.ts +22 -0
- package/dist/hooks/useDragDrop/useDragDrop.js +56 -0
- package/dist/hooks/useDragDrop/useDragDrop.types.d.ts +55 -0
- package/dist/hooks/useIdle/index.d.ts +2 -0
- package/dist/hooks/useIdle/useIdle.cjs +1 -0
- package/dist/hooks/useIdle/useIdle.d.ts +22 -0
- package/dist/hooks/useIdle/useIdle.js +66 -0
- package/dist/hooks/useIdle/useIdle.types.d.ts +29 -0
- package/dist/hooks/useLazyLoad/index.d.ts +2 -0
- package/dist/hooks/useLazyLoad/useLazyLoad.cjs +1 -0
- package/dist/hooks/useLazyLoad/useLazyLoad.d.ts +26 -0
- package/dist/hooks/useLazyLoad/useLazyLoad.js +27 -0
- package/dist/hooks/useLazyLoad/useLazyLoad.types.d.ts +25 -0
- package/dist/hooks/useLongPress/index.d.ts +2 -0
- package/dist/hooks/useLongPress/useLongPress.cjs +1 -0
- package/dist/hooks/useLongPress/useLongPress.d.ts +17 -0
- package/dist/hooks/useLongPress/useLongPress.js +44 -0
- package/dist/hooks/useLongPress/useLongPress.types.d.ts +26 -0
- package/dist/hooks/useOnline/index.d.ts +2 -0
- package/dist/hooks/useOnline/useOnline.cjs +1 -0
- package/dist/hooks/useOnline/useOnline.d.ts +16 -0
- package/dist/hooks/useOnline/useOnline.js +25 -0
- package/dist/hooks/useOnline/useOnline.types.d.ts +15 -0
- package/dist/hooks/usePageVisibility/index.d.ts +2 -0
- package/dist/hooks/usePageVisibility/usePageVisibility.cjs +1 -0
- package/dist/hooks/usePageVisibility/usePageVisibility.d.ts +19 -0
- package/dist/hooks/usePageVisibility/usePageVisibility.js +26 -0
- package/dist/hooks/usePageVisibility/usePageVisibility.types.d.ts +15 -0
- package/dist/hooks/useSpotlight/index.d.ts +2 -0
- package/dist/hooks/useSpotlight/useSpotlight.cjs +1 -0
- package/dist/hooks/useSpotlight/useSpotlight.d.ts +24 -0
- package/dist/hooks/useSpotlight/useSpotlight.js +49 -0
- package/dist/hooks/useSpotlight/useSpotlight.types.d.ts +23 -0
- package/dist/hooks/useWebSocket/index.d.ts +2 -0
- package/dist/hooks/useWebSocket/useWebSocket.cjs +1 -0
- package/dist/hooks/useWebSocket/useWebSocket.d.ts +22 -0
- package/dist/hooks/useWebSocket/useWebSocket.js +75 -0
- package/dist/hooks/useWebSocket/useWebSocket.types.d.ts +44 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +327 -264
- package/dist/styles.css +1 -1
- package/dist/types/component.types.d.ts +125 -42
- package/dist/types/theme.types.d.ts +82 -0
- package/package.json +1 -1
|
@@ -1,126 +1,136 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { jsxs as n, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as C, useRef as _, useEffect as w } from "react";
|
|
3
|
+
import { createPortal as N } from "react-dom";
|
|
4
|
+
import { cn as i } from "../../../../utils/cn.js";
|
|
5
|
+
import { RICH_EDITOR_COLORS as S, RICH_EDITOR_BUTTON_DISABLED_CLASSES as B, RICH_EDITOR_BUTTON_INACTIVE_CLASSES as T, RICH_EDITOR_BUTTON_BASE_CLASSES as O } from "../../RichEditor.const.js";
|
|
6
|
+
import { useMediaQuery as z } from "../../../../hooks/useMediaQuery.js";
|
|
7
|
+
import { FormatColorTextIcon as A, HighlightIcon as L } from "../../../Icon/icons/editor.js";
|
|
8
|
+
import { CheckIcon as M } from "../../../Icon/icons/status.js";
|
|
9
|
+
const Q = (R) => {
|
|
8
10
|
const {
|
|
9
|
-
value:
|
|
10
|
-
onChange:
|
|
11
|
-
title:
|
|
12
|
-
disabled:
|
|
13
|
-
type:
|
|
14
|
-
recentColors:
|
|
15
|
-
onApplyLast:
|
|
16
|
-
} =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
value: a,
|
|
12
|
+
onChange: v,
|
|
13
|
+
title: E,
|
|
14
|
+
disabled: l,
|
|
15
|
+
type: c = "text",
|
|
16
|
+
recentColors: d = [],
|
|
17
|
+
onApplyLast: g
|
|
18
|
+
} = R, [s, m] = C(!1), [h, b] = C({ top: 0, left: 0 }), u = _(null), p = _(null), o = z("(max-width: 640px)");
|
|
19
|
+
w(() => {
|
|
20
|
+
if (s && o && p.current && typeof document < "u") {
|
|
21
|
+
const t = p.current.getBoundingClientRect(), r = t.top, k = window.innerHeight - t.bottom;
|
|
22
|
+
k >= 240 || k >= r ? b({ top: t.bottom + 4, left: Math.max(8, Math.min(t.left, window.innerWidth - 220)) }) : b({ top: t.top - 244, left: Math.max(8, Math.min(t.left, window.innerWidth - 220)) });
|
|
23
|
+
}
|
|
24
|
+
}, [s, o]), w(() => {
|
|
25
|
+
const t = (r) => {
|
|
26
|
+
u.current && !u.current.contains(r.target) && m(!1);
|
|
20
27
|
};
|
|
21
|
-
return document.addEventListener("mousedown",
|
|
28
|
+
return document.addEventListener("mousedown", t), () => document.removeEventListener("mousedown", t);
|
|
22
29
|
}, []);
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
const f = (t) => {
|
|
31
|
+
v(t), m(!1);
|
|
32
|
+
}, I = c === "text" ? A : L, x = d[0] || a, y = /* @__PURE__ */ n(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: i(
|
|
36
|
+
"Bear-RichEditor__color-menu p-3 bg-white dark:bg-zinc-800 border border-gray-200 dark:border-zinc-700 rounded-lg shadow-xl min-w-[200px] max-w-[min(90vw,240px)]",
|
|
37
|
+
o ? "fixed z-[9999]" : "absolute bottom-full left-0 mb-1"
|
|
38
|
+
),
|
|
39
|
+
style: o ? { top: h.top, left: h.left } : void 0,
|
|
40
|
+
children: [
|
|
41
|
+
d.length > 0 && /* @__PURE__ */ n("div", { className: "mb-3", children: [
|
|
42
|
+
/* @__PURE__ */ e("p", { className: "text-xs text-gray-500 dark:text-gray-400 mb-1.5", children: "Recent" }),
|
|
43
|
+
/* @__PURE__ */ e("div", { className: "flex gap-1 flex-wrap", children: d.slice(0, 6).map((t, r) => /* @__PURE__ */ e(
|
|
44
|
+
"button",
|
|
45
|
+
{
|
|
46
|
+
type: "button",
|
|
47
|
+
onClick: () => f(t),
|
|
48
|
+
className: i(
|
|
49
|
+
"w-6 h-6 rounded-full border border-gray-300 dark:border-zinc-600 transition-transform hover:scale-110 touch-manipulation",
|
|
50
|
+
a === t && "ring-2 ring-pink-500 ring-offset-1 dark:ring-offset-zinc-800"
|
|
51
|
+
),
|
|
52
|
+
style: { backgroundColor: t },
|
|
53
|
+
title: t
|
|
54
|
+
},
|
|
55
|
+
`recent-${r}`
|
|
56
|
+
)) })
|
|
57
|
+
] }),
|
|
58
|
+
/* @__PURE__ */ e("div", { className: "grid grid-cols-8 gap-1", children: S.map((t) => /* @__PURE__ */ e(
|
|
59
|
+
"button",
|
|
60
|
+
{
|
|
61
|
+
type: "button",
|
|
62
|
+
onClick: () => f(t),
|
|
63
|
+
className: i(
|
|
64
|
+
"Bear-RichEditor__color-swatch w-5 h-5 rounded-full border border-gray-300 dark:border-zinc-600 transition-transform hover:scale-110 touch-manipulation",
|
|
65
|
+
a === t && "ring-2 ring-pink-500 ring-offset-1 dark:ring-offset-zinc-800"
|
|
66
|
+
),
|
|
67
|
+
style: { backgroundColor: t },
|
|
68
|
+
title: t
|
|
69
|
+
},
|
|
70
|
+
t
|
|
71
|
+
)) }),
|
|
72
|
+
/* @__PURE__ */ n(
|
|
73
|
+
"button",
|
|
74
|
+
{
|
|
75
|
+
type: "button",
|
|
76
|
+
onClick: () => f(""),
|
|
77
|
+
className: "w-full mt-2 px-2 py-1.5 text-xs text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-zinc-700 rounded transition-colors touch-manipulation",
|
|
78
|
+
children: [
|
|
79
|
+
"Remove ",
|
|
80
|
+
c === "text" ? "color" : "highlight"
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
return /* @__PURE__ */ n("div", { ref: u, className: "Bear-RichEditor__color-picker relative flex items-center", children: [
|
|
88
|
+
/* @__PURE__ */ n(
|
|
28
89
|
"button",
|
|
29
90
|
{
|
|
91
|
+
ref: p,
|
|
30
92
|
type: "button",
|
|
31
|
-
title:
|
|
32
|
-
disabled:
|
|
33
|
-
onClick: () =>
|
|
34
|
-
className:
|
|
93
|
+
title: E,
|
|
94
|
+
disabled: l,
|
|
95
|
+
onClick: () => m(!s),
|
|
96
|
+
className: i(
|
|
35
97
|
"Bear-RichEditor__color-trigger",
|
|
36
|
-
|
|
37
|
-
|
|
98
|
+
O,
|
|
99
|
+
T,
|
|
38
100
|
"flex items-center gap-0.5",
|
|
39
|
-
|
|
101
|
+
l && `Bear-RichEditor__color-trigger--disabled ${B}`
|
|
40
102
|
),
|
|
41
103
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ e(I, { size: 16 }),
|
|
105
|
+
/* @__PURE__ */ e(
|
|
44
106
|
"span",
|
|
45
107
|
{
|
|
46
108
|
className: "w-3 h-1 rounded-sm mt-0.5",
|
|
47
|
-
style: { backgroundColor:
|
|
109
|
+
style: { backgroundColor: a || (c === "text" ? "#000000" : "#fef08a") }
|
|
48
110
|
}
|
|
49
111
|
)
|
|
50
112
|
]
|
|
51
113
|
}
|
|
52
114
|
),
|
|
53
|
-
|
|
115
|
+
x && g && /* @__PURE__ */ e(
|
|
54
116
|
"button",
|
|
55
117
|
{
|
|
56
118
|
type: "button",
|
|
57
|
-
title: `Apply ${
|
|
58
|
-
disabled:
|
|
59
|
-
onClick: () =>
|
|
60
|
-
className:
|
|
119
|
+
title: `Apply ${c === "text" ? "text" : "highlight"} color`,
|
|
120
|
+
disabled: l,
|
|
121
|
+
onClick: () => g(x),
|
|
122
|
+
className: i(
|
|
61
123
|
"Bear-RichEditor__color-apply",
|
|
62
124
|
"p-0.5 rounded transition-colors",
|
|
63
125
|
"text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-zinc-700",
|
|
64
|
-
|
|
126
|
+
l && "opacity-50 cursor-not-allowed"
|
|
65
127
|
),
|
|
66
|
-
children: /* @__PURE__ */
|
|
128
|
+
children: /* @__PURE__ */ e(M, { size: 12 })
|
|
67
129
|
}
|
|
68
130
|
),
|
|
69
|
-
|
|
70
|
-
"div",
|
|
71
|
-
{
|
|
72
|
-
className: "Bear-RichEditor__color-menu absolute bottom-full left-0 mb-1 p-3 bg-white dark:bg-zinc-800 border border-gray-200 dark:border-zinc-700 rounded-lg shadow-xl min-w-[200px]",
|
|
73
|
-
style: { zIndex: 9999 },
|
|
74
|
-
children: [
|
|
75
|
-
l.length > 0 && /* @__PURE__ */ r("div", { className: "mb-3", children: [
|
|
76
|
-
/* @__PURE__ */ t("p", { className: "text-xs text-gray-500 dark:text-gray-400 mb-1.5", children: "Recent" }),
|
|
77
|
-
/* @__PURE__ */ t("div", { className: "flex gap-1", children: l.slice(0, 6).map((e, g) => /* @__PURE__ */ t(
|
|
78
|
-
"button",
|
|
79
|
-
{
|
|
80
|
-
type: "button",
|
|
81
|
-
onClick: () => d(e),
|
|
82
|
-
className: a(
|
|
83
|
-
"w-6 h-6 rounded-full border border-gray-300 dark:border-zinc-600 transition-transform hover:scale-110",
|
|
84
|
-
o === e && "ring-2 ring-pink-500 ring-offset-1 dark:ring-offset-zinc-800"
|
|
85
|
-
),
|
|
86
|
-
style: { backgroundColor: e },
|
|
87
|
-
title: e
|
|
88
|
-
},
|
|
89
|
-
`recent-${g}`
|
|
90
|
-
)) })
|
|
91
|
-
] }),
|
|
92
|
-
/* @__PURE__ */ t("div", { className: "grid grid-cols-8 gap-1", children: v.map((e) => /* @__PURE__ */ t(
|
|
93
|
-
"button",
|
|
94
|
-
{
|
|
95
|
-
type: "button",
|
|
96
|
-
onClick: () => d(e),
|
|
97
|
-
className: a(
|
|
98
|
-
"Bear-RichEditor__color-swatch",
|
|
99
|
-
"w-5 h-5 rounded-full border border-gray-300 dark:border-zinc-600 transition-transform hover:scale-110",
|
|
100
|
-
o === e && "ring-2 ring-pink-500 ring-offset-1 dark:ring-offset-zinc-800"
|
|
101
|
-
),
|
|
102
|
-
style: { backgroundColor: e },
|
|
103
|
-
title: e
|
|
104
|
-
},
|
|
105
|
-
e
|
|
106
|
-
)) }),
|
|
107
|
-
/* @__PURE__ */ r(
|
|
108
|
-
"button",
|
|
109
|
-
{
|
|
110
|
-
type: "button",
|
|
111
|
-
onClick: () => d(""),
|
|
112
|
-
className: "w-full mt-2 px-2 py-1.5 text-xs text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-zinc-700 rounded transition-colors",
|
|
113
|
-
children: [
|
|
114
|
-
"Remove ",
|
|
115
|
-
i === "text" ? "color" : "highlight"
|
|
116
|
-
]
|
|
117
|
-
}
|
|
118
|
-
)
|
|
119
|
-
]
|
|
120
|
-
}
|
|
121
|
-
)
|
|
131
|
+
s && (o && typeof document < "u" ? N(y, document.body) : y)
|
|
122
132
|
] });
|
|
123
133
|
};
|
|
124
134
|
export {
|
|
125
|
-
|
|
135
|
+
Q as ToolbarColorPicker
|
|
126
136
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),E=require("react-dom"),h=require("../../../../utils/cn.cjs"),l=require("../../RichEditor.const.cjs"),p=()=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"12",cy:"12",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"6",cy:"12",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"18",cy:"12",r:"1.5",fill:"currentColor"})]}),R=({children:_,disabled:u,isMobile:r})=>{const[o,d]=t.useState(!1),c=t.useRef(null),i=t.useRef(null),[a,g]=t.useState({top:0,left:0});t.useEffect(()=>{const n=m=>{var x;if(c.current&&!c.current.contains(m.target)){const s=m.target;(x=s.closest)!=null&&x.call(s,".Bear-RichEditor__more-menu")||d(!1)}};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[]),t.useEffect(()=>{if(o&&r&&i.current&&typeof document<"u"){const n=i.current.getBoundingClientRect();g({top:n.bottom+4,left:Math.max(8,n.right-220)})}},[o,r]);const f=e.jsx("div",{className:h.cn("Bear-RichEditor__more-menu p-2 bg-white dark:bg-zinc-800 border border-gray-200 dark:border-zinc-700 rounded-lg shadow-xl min-w-[200px] max-w-[min(90vw,280px)] max-h-[70vh] overflow-y-auto",r?"fixed z-[9999]":"absolute top-full right-0 mt-1 z-50"),style:r?{top:a.top,left:a.left}:void 0,children:e.jsx("div",{className:"flex flex-wrap items-center gap-0.5",children:_})});return e.jsxs("div",{ref:c,className:"Bear-RichEditor__more relative",children:[e.jsx("button",{ref:i,type:"button",title:"More options",disabled:u,onClick:()=>d(!o),className:h.cn("Bear-RichEditor__more-trigger",l.RICH_EDITOR_BUTTON_BASE_CLASSES,l.RICH_EDITOR_BUTTON_INACTIVE_CLASSES,"flex items-center justify-center",o&&"bg-pink-500 text-white",u&&`Bear-RichEditor__more-trigger--disabled ${l.RICH_EDITOR_BUTTON_DISABLED_CLASSES}`),children:e.jsx(p,{})}),o&&(r&&typeof document<"u"?E.createPortal(f,document.body):f)]})};exports.ToolbarMore=R;
|
|
@@ -2,6 +2,8 @@ import { FC, ReactNode } from 'react';
|
|
|
2
2
|
export interface ToolbarMoreProps {
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
disabled?: boolean;
|
|
5
|
+
/** When true, render menu via portal for mobile (avoids clipping) */
|
|
6
|
+
isMobile?: boolean;
|
|
5
7
|
}
|
|
6
8
|
export declare const ToolbarMore: FC<ToolbarMoreProps>;
|
|
7
9
|
export default ToolbarMore;
|
|
@@ -1,45 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/* @__PURE__ */ e("
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsx as e, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import { useState as f, useRef as p, useEffect as h } from "react";
|
|
3
|
+
import { createPortal as C } from "react-dom";
|
|
4
|
+
import { cn as _ } from "../../../../utils/cn.js";
|
|
5
|
+
import { RICH_EDITOR_BUTTON_DISABLED_CLASSES as R, RICH_EDITOR_BUTTON_INACTIVE_CLASSES as v, RICH_EDITOR_BUTTON_BASE_CLASSES as w } from "../../RichEditor.const.js";
|
|
6
|
+
const B = () => /* @__PURE__ */ g("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
7
|
+
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "1.5", fill: "currentColor" }),
|
|
8
|
+
/* @__PURE__ */ e("circle", { cx: "6", cy: "12", r: "1.5", fill: "currentColor" }),
|
|
9
|
+
/* @__PURE__ */ e("circle", { cx: "18", cy: "12", r: "1.5", fill: "currentColor" })
|
|
10
|
+
] }), b = ({ children: x, disabled: l, isMobile: t }) => {
|
|
11
|
+
const [r, s] = f(!1), n = p(null), i = p(null), [d, E] = f({ top: 0, left: 0 });
|
|
12
|
+
h(() => {
|
|
13
|
+
const o = (u) => {
|
|
14
|
+
var a;
|
|
15
|
+
if (n.current && !n.current.contains(u.target)) {
|
|
16
|
+
const c = u.target;
|
|
17
|
+
(a = c.closest) != null && a.call(c, ".Bear-RichEditor__more-menu") || s(!1);
|
|
18
|
+
}
|
|
13
19
|
};
|
|
14
|
-
return document.addEventListener("mousedown",
|
|
15
|
-
}, []),
|
|
20
|
+
return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
|
|
21
|
+
}, []), h(() => {
|
|
22
|
+
if (r && t && i.current && typeof document < "u") {
|
|
23
|
+
const o = i.current.getBoundingClientRect();
|
|
24
|
+
E({ top: o.bottom + 4, left: Math.max(8, o.right - 220) });
|
|
25
|
+
}
|
|
26
|
+
}, [r, t]);
|
|
27
|
+
const m = /* @__PURE__ */ e(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
className: _(
|
|
31
|
+
"Bear-RichEditor__more-menu p-2 bg-white dark:bg-zinc-800 border border-gray-200 dark:border-zinc-700 rounded-lg shadow-xl min-w-[200px] max-w-[min(90vw,280px)] max-h-[70vh] overflow-y-auto",
|
|
32
|
+
t ? "fixed z-[9999]" : "absolute top-full right-0 mt-1 z-50"
|
|
33
|
+
),
|
|
34
|
+
style: t ? { top: d.top, left: d.left } : void 0,
|
|
35
|
+
children: /* @__PURE__ */ e("div", { className: "flex flex-wrap items-center gap-0.5", children: x })
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
return /* @__PURE__ */ g("div", { ref: n, className: "Bear-RichEditor__more relative", children: [
|
|
16
39
|
/* @__PURE__ */ e(
|
|
17
40
|
"button",
|
|
18
41
|
{
|
|
42
|
+
ref: i,
|
|
19
43
|
type: "button",
|
|
20
44
|
title: "More options",
|
|
21
|
-
disabled:
|
|
22
|
-
onClick: () =>
|
|
23
|
-
className:
|
|
45
|
+
disabled: l,
|
|
46
|
+
onClick: () => s(!r),
|
|
47
|
+
className: _(
|
|
24
48
|
"Bear-RichEditor__more-trigger",
|
|
25
|
-
|
|
26
|
-
|
|
49
|
+
w,
|
|
50
|
+
v,
|
|
27
51
|
"flex items-center justify-center",
|
|
28
52
|
r && "bg-pink-500 text-white",
|
|
29
|
-
|
|
53
|
+
l && `Bear-RichEditor__more-trigger--disabled ${R}`
|
|
30
54
|
),
|
|
31
|
-
children: /* @__PURE__ */ e(
|
|
55
|
+
children: /* @__PURE__ */ e(B, {})
|
|
32
56
|
}
|
|
33
57
|
),
|
|
34
|
-
r &&
|
|
35
|
-
"div",
|
|
36
|
-
{
|
|
37
|
-
className: "Bear-RichEditor__more-menu absolute top-full right-0 mt-1 p-2 bg-white dark:bg-zinc-800 border border-gray-200 dark:border-zinc-700 rounded-lg shadow-xl z-50 min-w-[200px]",
|
|
38
|
-
children: /* @__PURE__ */ e("div", { className: "flex flex-wrap items-center gap-0.5", children: c })
|
|
39
|
-
}
|
|
40
|
-
)
|
|
58
|
+
r && (t && typeof document < "u" ? C(m, document.body) : m)
|
|
41
59
|
] });
|
|
42
60
|
};
|
|
43
61
|
export {
|
|
44
|
-
|
|
62
|
+
b as ToolbarMore
|
|
45
63
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),f=require("react"),i=require("../../utils/cn.cjs"),y={sm:"bear-h-8 bear-text-sm",md:"bear-h-10 bear-text-base",lg:"bear-h-12 bear-text-lg"},p=({items:t,value:b,defaultValue:d,onChange:a,size:c="md",fullWidth:l=!1,disabled:r=!1,className:u})=>{var o;const[x,g]=f.useState(d??((o=t[0])==null?void 0:o.value)??""),n=b??x,v=(e,m)=>{m||r||(b===void 0&&g(e),a==null||a(e))};return s.jsx("div",{role:"group","aria-label":"Segmented control",className:i.cn("Bear-SegmentedControl bear-relative bear-inline-flex bear-rounded-lg bear-bg-gray-200 dark:bear-bg-zinc-800 bear-p-1",l&&"bear-w-full",r&&"bear-opacity-50 bear-pointer-events-none",u),children:t.map(e=>s.jsx("button",{type:"button",role:"tab","aria-selected":e.value===n,"aria-disabled":e.disabled||r,disabled:e.disabled||r,onClick:()=>v(e.value,e.disabled),className:i.cn("Bear-SegmentedControl__item bear-relative bear-flex-1 bear-flex bear-items-center bear-justify-center bear-rounded-md bear-font-medium bear-transition-all bear-duration-200 bear-text-gray-600 dark:bear-text-zinc-400 hover:bear-text-gray-900 dark:hover:bear-text-zinc-200",e.value===n&&"bear-bg-white dark:bear-bg-zinc-700 bear-text-gray-900 dark:bear-text-white bear-shadow-sm",(e.disabled||r)&&"bear-cursor-not-allowed bear-opacity-50",y[c],l?"bear-min-w-0":"bear-px-4"),children:e.label},e.value))})};exports.SegmentedControl=p;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useState as g } from "react";
|
|
3
|
+
import { cn as d } from "../../utils/cn.js";
|
|
4
|
+
const p = {
|
|
5
|
+
sm: "bear-h-8 bear-text-sm",
|
|
6
|
+
md: "bear-h-10 bear-text-base",
|
|
7
|
+
lg: "bear-h-12 bear-text-lg"
|
|
8
|
+
}, w = ({
|
|
9
|
+
items: t,
|
|
10
|
+
value: b,
|
|
11
|
+
defaultValue: i,
|
|
12
|
+
onChange: r,
|
|
13
|
+
size: c = "md",
|
|
14
|
+
fullWidth: l = !1,
|
|
15
|
+
disabled: a = !1,
|
|
16
|
+
className: u
|
|
17
|
+
}) => {
|
|
18
|
+
var o;
|
|
19
|
+
const [m, x] = g(i ?? ((o = t[0]) == null ? void 0 : o.value) ?? ""), n = b ?? m, v = (e, f) => {
|
|
20
|
+
f || a || (b === void 0 && x(e), r == null || r(e));
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ s(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
role: "group",
|
|
26
|
+
"aria-label": "Segmented control",
|
|
27
|
+
className: d(
|
|
28
|
+
"Bear-SegmentedControl bear-relative bear-inline-flex bear-rounded-lg bear-bg-gray-200 dark:bear-bg-zinc-800 bear-p-1",
|
|
29
|
+
l && "bear-w-full",
|
|
30
|
+
a && "bear-opacity-50 bear-pointer-events-none",
|
|
31
|
+
u
|
|
32
|
+
),
|
|
33
|
+
children: t.map((e) => /* @__PURE__ */ s(
|
|
34
|
+
"button",
|
|
35
|
+
{
|
|
36
|
+
type: "button",
|
|
37
|
+
role: "tab",
|
|
38
|
+
"aria-selected": e.value === n,
|
|
39
|
+
"aria-disabled": e.disabled || a,
|
|
40
|
+
disabled: e.disabled || a,
|
|
41
|
+
onClick: () => v(e.value, e.disabled),
|
|
42
|
+
className: d(
|
|
43
|
+
"Bear-SegmentedControl__item bear-relative bear-flex-1 bear-flex bear-items-center bear-justify-center bear-rounded-md bear-font-medium bear-transition-all bear-duration-200 bear-text-gray-600 dark:bear-text-zinc-400 hover:bear-text-gray-900 dark:hover:bear-text-zinc-200",
|
|
44
|
+
e.value === n && "bear-bg-white dark:bear-bg-zinc-700 bear-text-gray-900 dark:bear-text-white bear-shadow-sm",
|
|
45
|
+
(e.disabled || a) && "bear-cursor-not-allowed bear-opacity-50",
|
|
46
|
+
p[c],
|
|
47
|
+
l ? "bear-min-w-0" : "bear-px-4"
|
|
48
|
+
),
|
|
49
|
+
children: e.label
|
|
50
|
+
},
|
|
51
|
+
e.value
|
|
52
|
+
))
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
w as SegmentedControl
|
|
58
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface SegmentedControlItem {
|
|
3
|
+
value: string;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface SegmentedControlProps {
|
|
8
|
+
items: SegmentedControlItem[];
|
|
9
|
+
value?: string;
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
onChange?: (value: string) => void;
|
|
12
|
+
size?: 'sm' | 'md' | 'lg';
|
|
13
|
+
fullWidth?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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;
|