@forgedevstack/bear 1.0.3 → 1.0.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.
- package/dist/components/Accordion/Accordion.cjs +1 -1
- package/dist/components/Accordion/Accordion.const.cjs +1 -0
- package/dist/components/Accordion/Accordion.const.d.ts +10 -0
- package/dist/components/Accordion/Accordion.const.js +8 -0
- package/dist/components/Accordion/Accordion.d.ts +1 -0
- package/dist/components/Accordion/Accordion.js +49 -44
- package/dist/components/Accordion/Accordion.types.d.ts +2 -0
- package/dist/components/Accordion/index.d.ts +3 -2
- package/dist/components/ActivityItem/ActivityItem.cjs +1 -0
- package/dist/components/ActivityItem/ActivityItem.d.ts +7 -0
- package/dist/components/ActivityItem/ActivityItem.js +44 -0
- package/dist/components/ActivityItem/ActivityItem.types.d.ts +17 -0
- package/dist/components/ActivityItem/index.d.ts +2 -0
- package/dist/components/Alert/Alert.cjs +1 -1
- package/dist/components/Alert/Alert.const.cjs +1 -0
- package/dist/components/Alert/Alert.const.d.ts +14 -0
- package/dist/components/Alert/Alert.const.js +27 -0
- package/dist/components/Alert/Alert.js +54 -63
- package/dist/components/Alert/Alert.types.d.ts +3 -1
- package/dist/components/Avatar/Avatar.cjs +1 -1
- package/dist/components/Avatar/Avatar.const.cjs +1 -0
- package/dist/components/Avatar/Avatar.const.d.ts +28 -0
- package/dist/components/Avatar/Avatar.const.js +28 -0
- package/dist/components/Avatar/Avatar.js +49 -60
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Badge/Badge.cjs +1 -1
- package/dist/components/Badge/Badge.js +24 -22
- package/dist/components/BearLogo/EmberLogo.cjs +17 -0
- package/dist/components/BearLogo/EmberLogo.js +91 -0
- package/dist/components/BearLogo/index.d.ts +2 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.const.cjs +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.const.d.ts +16 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.const.js +19 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +49 -34
- package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +8 -1
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.constants.cjs +1 -1
- package/dist/components/Button/Button.constants.d.ts +2 -2
- package/dist/components/Button/Button.constants.js +2 -2
- package/dist/components/Button/Button.js +41 -46
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.helpers.cjs +1 -0
- package/dist/components/Calendar/Calendar.helpers.d.ts +10 -0
- package/dist/components/Calendar/Calendar.helpers.js +9 -0
- package/dist/components/Calendar/Calendar.js +112 -115
- package/dist/components/Card/Card.cjs +1 -1
- package/dist/components/Card/Card.const.cjs +1 -0
- package/dist/components/Card/Card.const.d.ts +13 -0
- package/dist/components/Card/Card.const.js +32 -0
- package/dist/components/Card/Card.d.ts +1 -0
- package/dist/components/Card/Card.js +101 -105
- package/dist/components/Card/index.d.ts +3 -2
- package/dist/components/Chart/Chart.cjs +1 -0
- package/dist/components/Chart/Chart.const.d.ts +15 -0
- package/dist/components/Chart/Chart.d.ts +18 -0
- package/dist/components/Chart/Chart.js +225 -0
- package/dist/components/Chart/Chart.types.d.ts +51 -0
- package/dist/components/Chart/Chart.utils.d.ts +31 -0
- package/dist/components/Chart/index.d.ts +2 -0
- package/dist/components/CodeBlock/CodeBlock.cjs +2 -2
- package/dist/components/CodeBlock/CodeBlock.js +65 -52
- package/dist/components/CodeBlock/CodeBlock.types.d.ts +12 -1
- package/dist/components/Editable/Editable.cjs +1 -1
- package/dist/components/Editable/Editable.js +115 -115
- package/dist/components/Gauge/Gauge.cjs +1 -0
- package/dist/components/Gauge/Gauge.d.ts +3 -0
- package/dist/components/Gauge/Gauge.js +92 -0
- package/dist/components/Gauge/Gauge.types.d.ts +27 -0
- package/dist/components/Gauge/index.d.ts +2 -0
- package/dist/components/Icon/icons/editor.cjs +1 -1
- package/dist/components/Icon/icons/editor.d.ts +1 -0
- package/dist/components/Icon/icons/editor.js +66 -61
- package/dist/components/Icon/icons/misc.cjs +1 -1
- package/dist/components/Icon/icons/misc.d.ts +13 -0
- package/dist/components/Icon/icons/misc.js +157 -88
- package/dist/components/Icon/index.d.ts +22 -0
- package/dist/components/Input/Input.cjs +1 -1
- package/dist/components/Input/Input.js +36 -35
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.const.cjs +1 -0
- package/dist/components/Modal/Modal.const.d.ts +10 -0
- package/dist/components/Modal/Modal.const.js +17 -0
- package/dist/components/Modal/Modal.d.ts +11 -0
- package/dist/components/Modal/Modal.js +80 -77
- package/dist/components/Modal/Modal.types.d.ts +6 -1
- package/dist/components/Modal/index.d.ts +3 -2
- package/dist/components/Rating/Rating.cjs +1 -1
- package/dist/components/Rating/Rating.const.cjs +1 -0
- package/dist/components/Rating/Rating.const.d.ts +14 -0
- package/dist/components/Rating/Rating.const.js +22 -0
- package/dist/components/Rating/Rating.d.ts +5 -10
- package/dist/components/Rating/Rating.js +135 -93
- package/dist/components/Rating/Rating.types.d.ts +27 -25
- package/dist/components/Rating/index.d.ts +2 -2
- package/dist/components/RichEditor/RichEditor.cjs +1 -10
- package/dist/components/RichEditor/RichEditor.const.cjs +141 -0
- package/dist/components/RichEditor/RichEditor.const.d.ts +137 -0
- package/dist/components/RichEditor/RichEditor.const.js +279 -0
- package/dist/components/RichEditor/RichEditor.d.ts +14 -0
- package/dist/components/RichEditor/RichEditor.js +341 -129
- package/dist/components/RichEditor/RichEditor.types.d.ts +38 -1
- package/dist/components/RichEditor/components/ToolbarButton/ToolbarButton.cjs +1 -0
- package/dist/components/RichEditor/components/ToolbarButton/ToolbarButton.d.ts +4 -0
- package/dist/components/RichEditor/components/ToolbarButton/ToolbarButton.js +25 -0
- package/dist/components/RichEditor/components/ToolbarButton/index.d.ts +1 -0
- package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.cjs +1 -0
- package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.d.ts +4 -0
- package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.js +126 -0
- package/dist/components/RichEditor/components/ToolbarColorPicker/index.d.ts +1 -0
- package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -0
- package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.d.ts +4 -0
- package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.js +57 -0
- package/dist/components/RichEditor/components/ToolbarDropdown/index.d.ts +1 -0
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.cjs +1 -0
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.d.ts +7 -0
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.js +45 -0
- package/dist/components/RichEditor/components/ToolbarMore/index.d.ts +2 -0
- package/dist/components/RichEditor/components/index.d.ts +4 -0
- package/dist/components/RichEditor/helpers/formatHelpers.cjs +1 -0
- package/dist/components/RichEditor/helpers/formatHelpers.d.ts +57 -0
- package/dist/components/RichEditor/helpers/formatHelpers.js +26 -0
- package/dist/components/RichEditor/helpers/index.d.ts +1 -0
- package/dist/components/RichEditor/index.d.ts +4 -2
- package/dist/components/Sidebar/Sidebar.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.const.cjs +1 -0
- package/dist/components/Sidebar/Sidebar.const.d.ts +16 -0
- package/dist/components/Sidebar/Sidebar.const.js +22 -0
- package/dist/components/Sidebar/Sidebar.d.ts +14 -2
- package/dist/components/Sidebar/Sidebar.js +50 -138
- package/dist/components/Sidebar/Sidebar.types.d.ts +7 -3
- package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.cjs +1 -0
- package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.d.ts +4 -0
- package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.js +45 -0
- package/dist/components/Sidebar/components/SidebarGroup/index.d.ts +2 -0
- package/dist/components/Sidebar/components/SidebarItem/SidebarItem.cjs +1 -0
- package/dist/components/Sidebar/components/SidebarItem/SidebarItem.d.ts +4 -0
- package/dist/components/Sidebar/components/SidebarItem/SidebarItem.js +66 -0
- package/dist/components/Sidebar/components/SidebarItem/index.d.ts +2 -0
- package/dist/components/Sidebar/components/index.d.ts +2 -0
- package/dist/components/Sidebar/index.d.ts +5 -2
- package/dist/components/SignPad/SignPad.cjs +1 -0
- package/dist/components/SignPad/SignPad.const.cjs +1 -0
- package/dist/components/SignPad/SignPad.const.d.ts +19 -0
- package/dist/components/SignPad/SignPad.const.js +20 -0
- package/dist/components/SignPad/SignPad.d.ts +17 -0
- package/dist/components/SignPad/SignPad.js +161 -0
- package/dist/components/SignPad/SignPad.types.d.ts +37 -0
- package/dist/components/SignPad/index.d.ts +3 -0
- package/dist/components/Skeleton/Skeleton.cjs +1 -1
- package/dist/components/Skeleton/Skeleton.const.cjs +36 -0
- package/dist/components/Skeleton/Skeleton.const.d.ts +12 -0
- package/dist/components/Skeleton/Skeleton.const.js +58 -0
- package/dist/components/Skeleton/Skeleton.d.ts +15 -24
- package/dist/components/Skeleton/Skeleton.js +132 -103
- package/dist/components/Skeleton/Skeleton.types.d.ts +18 -8
- package/dist/components/Skeleton/index.d.ts +2 -2
- package/dist/components/Sparkline/Sparkline.cjs +1 -0
- package/dist/components/Sparkline/Sparkline.const.cjs +1 -0
- package/dist/components/Sparkline/Sparkline.const.d.ts +16 -0
- package/dist/components/Sparkline/Sparkline.const.js +16 -0
- package/dist/components/Sparkline/Sparkline.d.ts +3 -0
- package/dist/components/Sparkline/Sparkline.js +80 -0
- package/dist/components/Sparkline/Sparkline.types.d.ts +19 -0
- package/dist/components/Sparkline/Sparkline.utils.cjs +1 -0
- package/dist/components/Sparkline/Sparkline.utils.d.ts +27 -0
- package/dist/components/Sparkline/Sparkline.utils.js +30 -0
- package/dist/components/Sparkline/index.d.ts +5 -0
- package/dist/components/SpeedDial/SpeedDial.cjs +12 -1
- package/dist/components/SpeedDial/SpeedDial.const.cjs +1 -0
- package/dist/components/SpeedDial/SpeedDial.const.d.ts +22 -0
- package/dist/components/SpeedDial/SpeedDial.const.js +26 -0
- package/dist/components/SpeedDial/SpeedDial.d.ts +5 -7
- package/dist/components/SpeedDial/SpeedDial.js +154 -144
- package/dist/components/SpeedDial/SpeedDial.types.d.ts +26 -29
- package/dist/components/SpeedDial/index.d.ts +1 -1
- package/dist/components/Spinner/Spinner.cjs +1 -1
- package/dist/components/Spinner/Spinner.js +17 -15
- package/dist/components/StatCard/StatCard.cjs +1 -0
- package/dist/components/StatCard/StatCard.d.ts +7 -0
- package/dist/components/StatCard/StatCard.js +36 -0
- package/dist/components/StatCard/StatCard.types.d.ts +13 -0
- package/dist/components/StatCard/index.d.ts +2 -0
- package/dist/components/Stepper/Stepper.cjs +1 -1
- package/dist/components/Stepper/Stepper.const.cjs +1 -0
- package/dist/components/Stepper/Stepper.const.d.ts +29 -0
- package/dist/components/Stepper/Stepper.const.js +46 -0
- package/dist/components/Stepper/Stepper.d.ts +10 -3
- package/dist/components/Stepper/Stepper.js +143 -92
- package/dist/components/Stepper/Stepper.types.d.ts +63 -13
- package/dist/components/Stepper/index.d.ts +2 -2
- package/dist/components/Switch/Switch.cjs +1 -1
- package/dist/components/Switch/Switch.js +74 -47
- package/dist/components/Switch/Switch.types.d.ts +11 -1
- package/dist/components/Tabs/Tabs.cjs +1 -1
- package/dist/components/Tabs/Tabs.js +33 -29
- package/dist/components/TimePicker/TimePicker.cjs +1 -1
- package/dist/components/TimePicker/TimePicker.constants.cjs +1 -1
- package/dist/components/TimePicker/TimePicker.constants.d.ts +14 -0
- package/dist/components/TimePicker/TimePicker.constants.js +18 -4
- package/dist/components/TimePicker/TimePicker.js +92 -91
- package/dist/components/Timeline/Timeline.cjs +1 -1
- package/dist/components/Timeline/Timeline.const.cjs +1 -0
- package/dist/components/Timeline/Timeline.const.d.ts +40 -0
- package/dist/components/Timeline/Timeline.const.js +58 -0
- package/dist/components/Timeline/Timeline.d.ts +16 -2
- package/dist/components/Timeline/Timeline.js +131 -63
- package/dist/components/Timeline/Timeline.types.d.ts +30 -11
- package/dist/components/Timeline/index.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.js +37 -35
- package/dist/components/Typography/Typography.cjs +1 -1
- package/dist/components/Typography/Typography.js +38 -36
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +17 -5
- package/dist/components/index.js +216 -195
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.ts +24 -0
- package/dist/hooks/index.js +42 -14
- package/dist/hooks/useBounce/index.d.ts +2 -0
- package/dist/hooks/useBounce/useBounce.cjs +1 -0
- package/dist/hooks/useBounce/useBounce.d.ts +2 -0
- package/dist/hooks/useBounce/useBounce.js +36 -0
- package/dist/hooks/useBounce/useBounce.types.d.ts +27 -0
- package/dist/hooks/useClickOutside/index.d.ts +2 -0
- package/dist/hooks/useClickOutside/useClickOutside.d.ts +22 -0
- package/dist/hooks/useClickOutside/useClickOutside.types.d.ts +10 -0
- package/dist/hooks/useClipboard/index.d.ts +2 -0
- package/dist/hooks/useClipboard/useClipboard.cjs +1 -0
- package/dist/hooks/useClipboard/useClipboard.d.ts +15 -0
- package/dist/hooks/useClipboard/useClipboard.js +22 -0
- package/dist/hooks/useClipboard/useClipboard.types.d.ts +20 -0
- package/dist/hooks/useDebounce/index.d.ts +2 -0
- package/dist/hooks/useDebounce/useDebounce.cjs +1 -0
- package/dist/hooks/useDebounce/useDebounce.d.ts +32 -0
- package/dist/hooks/useDebounce/useDebounce.js +39 -0
- package/dist/hooks/useDebounce/useDebounce.types.d.ts +20 -0
- package/dist/hooks/useFloat/index.d.ts +2 -0
- package/dist/hooks/useFloat/useFloat.cjs +1 -0
- package/dist/hooks/useFloat/useFloat.d.ts +2 -0
- package/dist/hooks/useFloat/useFloat.js +37 -0
- package/dist/hooks/useFloat/useFloat.types.d.ts +25 -0
- package/dist/hooks/useIntersectionObserver/index.d.ts +2 -0
- package/dist/hooks/useIntersectionObserver/useIntersectionObserver.cjs +1 -0
- package/dist/hooks/useIntersectionObserver/useIntersectionObserver.d.ts +25 -0
- package/dist/hooks/useIntersectionObserver/useIntersectionObserver.js +39 -0
- package/dist/hooks/useIntersectionObserver/useIntersectionObserver.types.d.ts +22 -0
- package/dist/hooks/useKeyPress/index.d.ts +2 -0
- package/dist/hooks/useKeyPress/useKeyPress.cjs +1 -0
- package/dist/hooks/useKeyPress/useKeyPress.d.ts +22 -0
- package/dist/hooks/useKeyPress/useKeyPress.js +39 -0
- package/dist/hooks/useKeyPress/useKeyPress.types.d.ts +19 -0
- package/dist/hooks/useLocalStorage/index.d.ts +2 -0
- package/dist/hooks/useLocalStorage/useLocalStorage.cjs +1 -0
- package/dist/hooks/useLocalStorage/useLocalStorage.d.ts +11 -0
- package/dist/hooks/useLocalStorage/useLocalStorage.js +47 -0
- package/dist/hooks/useLocalStorage/useLocalStorage.types.d.ts +16 -0
- package/dist/hooks/useMediaQuery/index.d.ts +3 -0
- package/dist/hooks/useMediaQuery/useMediaQuery.d.ts +12 -0
- package/dist/hooks/useMediaQuery/useMediaQuery.types.d.ts +21 -0
- package/dist/hooks/useParallax/index.d.ts +2 -0
- package/dist/hooks/useParallax/useParallax.cjs +1 -0
- package/dist/hooks/useParallax/useParallax.d.ts +2 -0
- package/dist/hooks/useParallax/useParallax.js +36 -0
- package/dist/hooks/useParallax/useParallax.types.d.ts +19 -0
- package/dist/hooks/usePulse/index.d.ts +2 -0
- package/dist/hooks/usePulse/usePulse.cjs +1 -0
- package/dist/hooks/usePulse/usePulse.d.ts +2 -0
- package/dist/hooks/usePulse/usePulse.js +38 -0
- package/dist/hooks/usePulse/usePulse.types.d.ts +29 -0
- package/dist/hooks/useShake/index.d.ts +2 -0
- package/dist/hooks/useShake/useShake.cjs +1 -0
- package/dist/hooks/useShake/useShake.d.ts +2 -0
- package/dist/hooks/useShake/useShake.js +14 -0
- package/dist/hooks/useShake/useShake.types.d.ts +19 -0
- package/dist/hooks/useSlide/index.d.ts +2 -0
- package/dist/hooks/useSlide/useSlide.cjs +1 -0
- package/dist/hooks/useSlide/useSlide.d.ts +2 -0
- package/dist/hooks/useSlide/useSlide.js +68 -0
- package/dist/hooks/useSlide/useSlide.types.d.ts +36 -0
- package/dist/hooks/useThrottle/index.d.ts +2 -0
- package/dist/hooks/useThrottle/useThrottle.cjs +1 -0
- package/dist/hooks/useThrottle/useThrottle.d.ts +26 -0
- package/dist/hooks/useThrottle/useThrottle.js +44 -0
- package/dist/hooks/useThrottle/useThrottle.types.d.ts +8 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +273 -224
- package/dist/styles.css +1 -1
- package/package.json +14 -21
- package/dist/components/RichEditor/RichEditor.icons.cjs +0 -1
- package/dist/components/RichEditor/RichEditor.icons.d.ts +0 -16
- package/dist/components/RichEditor/RichEditor.icons.js +0 -62
- package/dist/components/RichEditor/RichEditor.utils.cjs +0 -1
- package/dist/components/RichEditor/RichEditor.utils.d.ts +0 -3
- package/dist/components/RichEditor/RichEditor.utils.js +0 -22
|
@@ -1,99 +1,141 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { cn as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
...T
|
|
30
|
-
}) => {
|
|
31
|
-
const [j, D] = y($), [M, F] = y(null), f = h !== void 0, L = f ? h : j, u = M !== null && !s && !e ? M : L, p = q[B], H = S((t) => {
|
|
32
|
-
s || e || (f || D(t), l == null || l(t));
|
|
33
|
-
}, [f, l, s, e]), P = S((t) => {
|
|
34
|
-
s || e || !a || F(t);
|
|
35
|
-
}, [s, e, a]), U = S(() => {
|
|
36
|
-
s || e || !a || F(null);
|
|
37
|
-
}, [s, e, a]), b = A(() => ({ FilledStar: ({ size: o, color: i }) => /* @__PURE__ */ r("svg", { width: o, height: o, viewBox: "0 0 24 24", fill: i, stroke: "none", children: /* @__PURE__ */ r("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }) }), EmptyStar: ({ size: o, color: i }) => /* @__PURE__ */ r("svg", { width: o, height: o, viewBox: "0 0 24 24", fill: "none", stroke: i, strokeWidth: "2", children: /* @__PURE__ */ r("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }) }), HalfStar: ({ size: o, color: i, emptyColor: _ }) => /* @__PURE__ */ d("svg", { width: o, height: o, viewBox: "0 0 24 24", children: [
|
|
38
|
-
/* @__PURE__ */ r("defs", { children: /* @__PURE__ */ d("linearGradient", { id: "halfGrad", children: [
|
|
39
|
-
/* @__PURE__ */ r("stop", { offset: "50%", stopColor: i }),
|
|
40
|
-
/* @__PURE__ */ r("stop", { offset: "50%", stopColor: _, stopOpacity: "0" })
|
|
41
|
-
] }) }),
|
|
42
|
-
/* @__PURE__ */ r(
|
|
43
|
-
"polygon",
|
|
1
|
+
import { jsx as n, jsxs as L, Fragment as K } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Q, useState as U, useCallback as v, useMemo as w } from "react";
|
|
3
|
+
import { cn as d } from "../../utils/cn.js";
|
|
4
|
+
import { RATING_DEFAULT_LABELS as O, RATING_DEFAULT_MAX as y, RATING_STAR_READONLY_CLASSES as H, RATING_STAR_DISABLED_CLASSES as b, RATING_STAR_BASE_CLASSES as tt, RATING_SIZE_CLASSES as et, RATING_DEFAULT_COLOR as rt, RATING_DEFAULT_EMPTY_COLOR as st, RATING_BASE_CLASSES as nt } from "./Rating.const.js";
|
|
5
|
+
const at = ({ size: a, filled: S, half: h, color: u, emptyColor: s }) => /* @__PURE__ */ n(
|
|
6
|
+
"svg",
|
|
7
|
+
{
|
|
8
|
+
width: a,
|
|
9
|
+
height: a,
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
fill: "none",
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
children: h ? /* @__PURE__ */ L(K, { children: [
|
|
14
|
+
/* @__PURE__ */ n("defs", { children: /* @__PURE__ */ L("linearGradient", { id: `half-${a}`, children: [
|
|
15
|
+
/* @__PURE__ */ n("stop", { offset: "50%", stopColor: u }),
|
|
16
|
+
/* @__PURE__ */ n("stop", { offset: "50%", stopColor: s })
|
|
17
|
+
] }) }),
|
|
18
|
+
/* @__PURE__ */ n(
|
|
19
|
+
"path",
|
|
20
|
+
{
|
|
21
|
+
d: "M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",
|
|
22
|
+
fill: `url(#half-${a})`,
|
|
23
|
+
stroke: u,
|
|
24
|
+
strokeWidth: "1"
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
] }) : /* @__PURE__ */ n(
|
|
28
|
+
"path",
|
|
44
29
|
{
|
|
45
|
-
|
|
46
|
-
fill:
|
|
47
|
-
stroke:
|
|
48
|
-
strokeWidth: "
|
|
30
|
+
d: "M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",
|
|
31
|
+
fill: S ? u : s,
|
|
32
|
+
stroke: S ? u : s,
|
|
33
|
+
strokeWidth: "1"
|
|
49
34
|
}
|
|
50
35
|
)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
36
|
+
}
|
|
37
|
+
), it = Q(
|
|
38
|
+
({
|
|
39
|
+
value: a,
|
|
40
|
+
defaultValue: S = 0,
|
|
41
|
+
max: h = y,
|
|
42
|
+
size: u = "md",
|
|
43
|
+
onChange: s,
|
|
44
|
+
allowHalf: i = !1,
|
|
45
|
+
allowClear: M = !0,
|
|
46
|
+
disabled: c = !1,
|
|
47
|
+
readOnly: o = !1,
|
|
48
|
+
filledIcon: T,
|
|
49
|
+
emptyIcon: g,
|
|
50
|
+
halfIcon: m,
|
|
51
|
+
color: k = rt,
|
|
52
|
+
emptyColor: G = st,
|
|
53
|
+
showValue: x = !1,
|
|
54
|
+
labelFormatter: p,
|
|
55
|
+
labels: _ = O,
|
|
56
|
+
testId: X,
|
|
57
|
+
className: j,
|
|
58
|
+
...W
|
|
59
|
+
}, Y) => {
|
|
60
|
+
const [$, z] = U(S), [I, E] = U(null), A = a !== void 0 ? a : $, l = I !== null ? I : A, N = et[u], B = v(
|
|
61
|
+
(t, e = !1) => {
|
|
62
|
+
if (c || o) return;
|
|
63
|
+
const r = e && i ? t + 0.5 : t + 1, f = M && r === A ? 0 : r;
|
|
64
|
+
z(f), s == null || s(f);
|
|
65
|
+
},
|
|
66
|
+
[c, o, i, M, A, s]
|
|
67
|
+
), C = v(
|
|
68
|
+
(t, e) => {
|
|
69
|
+
if (c || o) return;
|
|
70
|
+
const r = e.currentTarget.getBoundingClientRect(), f = e.clientX - r.left < r.width / 2;
|
|
71
|
+
E(i && f ? t + 0.5 : t + 1);
|
|
72
|
+
},
|
|
73
|
+
[c, o, i]
|
|
74
|
+
), D = v(() => {
|
|
75
|
+
E(null);
|
|
76
|
+
}, []), P = (t) => l >= t + 1 ? "filled" : l >= t + 0.5 && i ? "half" : "empty", V = w(() => {
|
|
77
|
+
if (p) return p(l);
|
|
78
|
+
const t = Math.ceil(l) - 1;
|
|
79
|
+
return _[t] || "";
|
|
80
|
+
}, [l, p, _]), Z = w(() => Array.from({ length: h }).map((t, e) => {
|
|
81
|
+
const r = P(e), f = d(
|
|
82
|
+
tt,
|
|
83
|
+
c && b,
|
|
84
|
+
o && H,
|
|
85
|
+
!c && !o && "hover:scale-110"
|
|
86
|
+
), q = () => r === "filled" && T ? T : r === "half" && m ? m : r === "empty" && g ? g : /* @__PURE__ */ n(
|
|
87
|
+
at,
|
|
88
|
+
{
|
|
89
|
+
size: N.icon,
|
|
90
|
+
filled: r === "filled",
|
|
91
|
+
half: r === "half",
|
|
92
|
+
color: k,
|
|
93
|
+
emptyColor: G
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
return /* @__PURE__ */ n(
|
|
97
|
+
"span",
|
|
98
|
+
{
|
|
99
|
+
className: f,
|
|
100
|
+
onClick: (R) => {
|
|
101
|
+
const F = R.currentTarget.getBoundingClientRect(), J = R.clientX - F.left < F.width / 2;
|
|
102
|
+
B(e, J);
|
|
89
103
|
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
104
|
+
onMouseMove: (R) => C(e, R),
|
|
105
|
+
onMouseLeave: D,
|
|
106
|
+
role: "radio",
|
|
107
|
+
"aria-checked": A >= e + 1,
|
|
108
|
+
"aria-label": _[e],
|
|
109
|
+
children: q()
|
|
110
|
+
},
|
|
111
|
+
e
|
|
112
|
+
);
|
|
113
|
+
}), [h, l, c, o, T, g, m, N, k, G, B, C, D, A, _, i]);
|
|
114
|
+
return /* @__PURE__ */ L(
|
|
115
|
+
"div",
|
|
116
|
+
{
|
|
117
|
+
ref: Y,
|
|
118
|
+
className: d(nt, j),
|
|
119
|
+
role: "radiogroup",
|
|
120
|
+
"aria-label": "Rating",
|
|
121
|
+
"data-testid": X,
|
|
122
|
+
...W,
|
|
123
|
+
children: [
|
|
124
|
+
Z,
|
|
125
|
+
x && /* @__PURE__ */ L("span", { className: d("Bear-Rating__value ml-2 text-gray-600 dark:text-gray-400", N.text), children: [
|
|
126
|
+
l.toFixed(i ? 1 : 0),
|
|
127
|
+
V && /* @__PURE__ */ L("span", { className: "ml-1 text-gray-400 dark:text-gray-500", children: [
|
|
128
|
+
"(",
|
|
129
|
+
V,
|
|
130
|
+
")"
|
|
131
|
+
] })
|
|
132
|
+
] })
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
it.displayName = "Rating";
|
|
97
139
|
export {
|
|
98
|
-
|
|
140
|
+
it as Rating
|
|
99
141
|
};
|
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
2
|
-
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type RatingSize = 'sm' | 'md' | 'lg';
|
|
3
3
|
export interface RatingProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
4
|
-
/** Current
|
|
4
|
+
/** Current value (0-max) */
|
|
5
5
|
value?: number;
|
|
6
|
-
/** Default
|
|
6
|
+
/** Default value (uncontrolled) */
|
|
7
7
|
defaultValue?: number;
|
|
8
8
|
/** Maximum rating value */
|
|
9
9
|
max?: number;
|
|
10
|
-
/**
|
|
11
|
-
size?:
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
/**
|
|
10
|
+
/** Size of rating icons */
|
|
11
|
+
size?: RatingSize;
|
|
12
|
+
/** Called when value changes */
|
|
13
|
+
onChange?: (value: number) => void;
|
|
14
|
+
/** Allow half values */
|
|
15
|
+
allowHalf?: boolean;
|
|
16
|
+
/** Allow clearing the rating */
|
|
17
|
+
allowClear?: boolean;
|
|
18
|
+
/** Disabled state */
|
|
15
19
|
disabled?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
|
|
20
|
+
/** Read-only state */
|
|
21
|
+
readOnly?: boolean;
|
|
22
|
+
/** Custom filled icon */
|
|
23
|
+
filledIcon?: ReactNode;
|
|
24
|
+
/** Custom empty icon */
|
|
25
|
+
emptyIcon?: ReactNode;
|
|
26
|
+
/** Custom half-filled icon */
|
|
27
|
+
halfIcon?: ReactNode;
|
|
18
28
|
/** Color of filled stars */
|
|
19
29
|
color?: string;
|
|
20
|
-
/**
|
|
30
|
+
/** Color of empty stars */
|
|
21
31
|
emptyColor?: string;
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
/** Custom empty icon */
|
|
25
|
-
emptyIcon?: React.ReactNode;
|
|
26
|
-
/** Custom half icon */
|
|
27
|
-
halfIcon?: React.ReactNode;
|
|
28
|
-
/** Whether to highlight on hover */
|
|
29
|
-
highlightOnHover?: boolean;
|
|
30
|
-
/** Change handler */
|
|
31
|
-
onChange?: (value: number) => void;
|
|
32
|
-
/** Show rating label */
|
|
33
|
-
showLabel?: boolean;
|
|
32
|
+
/** Show value text */
|
|
33
|
+
showValue?: boolean;
|
|
34
34
|
/** Custom label formatter */
|
|
35
|
-
|
|
35
|
+
labelFormatter?: (value: number) => string;
|
|
36
36
|
/** Test ID */
|
|
37
37
|
testId?: string;
|
|
38
|
+
/** Accessibility labels for each rating */
|
|
39
|
+
labels?: string[];
|
|
38
40
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Rating
|
|
2
|
-
export type { RatingProps } from './Rating.types';
|
|
1
|
+
export { Rating } from './Rating';
|
|
2
|
+
export type { RatingProps, RatingSize } from './Rating.types';
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
p-1.5 rounded transition-colors
|
|
3
|
-
${l?"bg-pink-500 text-white":"text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700"}
|
|
4
|
-
${i?"opacity-50 cursor-not-allowed":"cursor-pointer"}
|
|
5
|
-
`,children:a}),q=({value:a,defaultValue:m="",onChange:l,placeholder:k="Start typing...",disabled:i=!1,readOnly:b=!1,minHeight:g=150,maxHeight:u,toolbar:p=e.DEFAULT_TOOLBAR,className:y="",...L})=>{const n=d.useRef(null),[C,j]=d.useState(new Set);d.useEffect(()=>{n.current&&a!==void 0&&n.current.innerHTML!==a&&(n.current.innerHTML=a)},[a]),d.useEffect(()=>{n.current&&m&&!a&&(n.current.innerHTML=m)},[]);const c=d.useCallback(()=>{const t=new Set;e.queryCommandState("bold")&&t.add("bold"),e.queryCommandState("italic")&&t.add("italic"),e.queryCommandState("underline")&&t.add("underline"),e.queryCommandState("strikeThrough")&&t.add("strikethrough"),e.queryCommandState("insertUnorderedList")&&t.add("bulletList"),e.queryCommandState("insertOrderedList")&&t.add("orderedList"),j(t)},[]),f=d.useCallback(()=>{n.current&&l&&l(n.current.innerHTML),c()},[l,c]),I=d.useCallback(t=>{var s;if(!(i||b)){switch((s=n.current)==null||s.focus(),t){case"bold":e.execCommand("bold");break;case"italic":e.execCommand("italic");break;case"underline":e.execCommand("underline");break;case"strikethrough":e.execCommand("strikeThrough");break;case"heading1":e.execCommand("formatBlock","<h1>");break;case"heading2":e.execCommand("formatBlock","<h2>");break;case"heading3":e.execCommand("formatBlock","<h3>");break;case"bulletList":e.execCommand("insertUnorderedList");break;case"orderedList":e.execCommand("insertOrderedList");break;case"blockquote":e.execCommand("formatBlock","<blockquote>");break;case"code":e.execCommand("formatBlock","<pre>");break;case"link":const h=prompt("Enter URL:");h&&e.execCommand("createLink",h);break}c(),f()}},[i,b,c,f]),v=(t,s)=>{if(t==="divider")return r.jsx("div",{className:"w-px h-5 bg-gray-300 dark:bg-gray-600 mx-1"},`divider-${s}`);const x={bold:{icon:r.jsx(o.BoldIcon,{}),title:"Bold"},italic:{icon:r.jsx(o.ItalicIcon,{}),title:"Italic"},underline:{icon:r.jsx(o.UnderlineIcon,{}),title:"Underline"},strikethrough:{icon:r.jsx(o.StrikethroughIcon,{}),title:"Strikethrough"},heading1:{icon:r.jsx(o.Heading1Icon,{}),title:"Heading 1"},heading2:{icon:r.jsx(o.Heading2Icon,{}),title:"Heading 2"},bulletList:{icon:r.jsx(o.BulletListIcon,{}),title:"Bullet List"},orderedList:{icon:r.jsx(o.OrderedListIcon,{}),title:"Numbered List"},blockquote:{icon:r.jsx(o.BlockquoteIcon,{}),title:"Quote"},code:{icon:r.jsx(o.CodeIcon,{}),title:"Code Block"},link:{icon:r.jsx(o.LinkIcon,{}),title:"Insert Link"}}[t];return x?r.jsx(S,{icon:x.icon,title:x.title,active:C.has(t),onClick:()=>I(t),disabled:i||b},t):null};return r.jsxs("div",{className:`bear-rich-editor rounded-lg border border-gray-300 dark:border-gray-600 overflow-hidden bg-white dark:bg-gray-900 ${y}`,...L,children:[p.length>0&&r.jsx("div",{className:"bear-rich-editor-toolbar flex flex-wrap items-center gap-0.5 p-2 border-b border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800",children:p.map((t,s)=>v(t,s))}),r.jsx("div",{ref:n,contentEditable:!i&&!b,onInput:f,onSelect:c,onKeyUp:c,onMouseUp:c,"data-placeholder":k,className:`
|
|
6
|
-
bear-rich-editor-content p-3 outline-none prose prose-sm dark:prose-invert max-w-none
|
|
7
|
-
text-gray-900 dark:text-white
|
|
8
|
-
[&:empty]:before:content-[attr(data-placeholder)] [&:empty]:before:text-gray-400 [&:empty]:before:pointer-events-none
|
|
9
|
-
${i?"opacity-50 cursor-not-allowed":""}
|
|
10
|
-
`,style:{minHeight:typeof g=="number"?`${g}px`:g,maxHeight:u?typeof u=="number"?`${u}px`:u:void 0,overflowY:u?"auto":void 0}})]})};exports.RichEditor=q;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),c=require("react"),T=require("../../utils/cn.cjs"),u=require("./helpers/formatHelpers.cjs"),f=require("./RichEditor.const.cjs"),C=require("./components/ToolbarButton/ToolbarButton.cjs"),oe=require("./components/ToolbarDropdown/ToolbarDropdown.cjs"),H=require("./components/ToolbarColorPicker/ToolbarColorPicker.cjs"),re=require("./components/ToolbarMore/ToolbarMore.cjs"),i=require("../Icon/icons/editor.cjs"),ie=6,se=S=>{const{value:x,defaultValue:k="",onChange:j,placeholder:z="Start typing...",disabled:o=!1,readOnly:r=!1,minHeight:p=f.RICH_EDITOR_MIN_HEIGHT,maxHeight:b,toolbar:y=f.RICH_EDITOR_DEFAULT_TOOLBAR,className:B="",testId:A,id:O,allowImagePaste:E=!0,...v}=S,a=c.useRef(null),[D,F]=c.useState(new Set),[N,_]=c.useState("p"),[q,w]=c.useState("#000000"),[U,M]=c.useState("#fef08a"),[P,V]=c.useState([]),[J,G]=c.useState([]);c.useEffect(()=>{const e="bear-rich-editor-styles";if(!document.getElementById(e)){const n=document.createElement("style");n.id=e,n.textContent=f.RICH_EDITOR_CONTENT_STYLES,document.head.appendChild(n)}},[]),c.useEffect(()=>{a.current&&x!==void 0&&a.current.innerHTML!==x&&(a.current.innerHTML=x)},[x]),c.useEffect(()=>{a.current&&k&&!x&&(a.current.innerHTML=k)},[]);const I=c.useCallback(()=>{F(u.getActiveFormats());const e=u.queryCommandValue("formatBlock");e&&_(e.toLowerCase().replace(/[<>]/g,""))},[]),l=c.useCallback(()=>{a.current&&j&&j(a.current.innerHTML),I()},[j,I]),$=c.useCallback(e=>{var d;if(o||r)return;(d=a.current)==null||d.focus();const n=f.RICH_EDITOR_BUTTON_CONFIG[e];if(!n)return;const g="value"in n?n.value:void 0;g?u.execCommand(n.command,g):u.execCommand(n.command),I(),l()},[o,r,I,l]),Y=c.useCallback(e=>{var n;o||r||((n=a.current)==null||n.focus(),u.execCommand("formatBlock",e),_(e),l())},[o,r,l]),K=c.useCallback(()=>{var d;if(o||r)return;const e=window.getSelection(),n=e&&e.toString().length>0,g=prompt("Enter URL:",n?"":"https://");g&&((d=a.current)==null||d.focus(),u.insertLink(g),l())},[o,r,l]),m=c.useCallback((e,n)=>{if(!e)return;(n==="text"?V:G)(d=>{const s=d.filter(h=>h!==e);return[e,...s].slice(0,ie)})},[]),Q=c.useCallback(e=>{var n;o||r||((n=a.current)==null||n.focus(),u.setTextColor(e),w(e),m(e,"text"),l())},[o,r,l,m]),W=c.useCallback(e=>{var n;o||r||((n=a.current)==null||n.focus(),u.setHighlightColor(e),M(e),m(e,"highlight"),l())},[o,r,l,m]),X=c.useCallback(e=>{var n;o||r||((n=a.current)==null||n.focus(),u.setTextColor(e),l())},[o,r,l]),Z=c.useCallback(e=>{var n;o||r||((n=a.current)==null||n.focus(),u.setHighlightColor(e),l())},[o,r,l]),ee=c.useCallback(async e=>{var g;if(!E)return;const n=(g=e.clipboardData)==null?void 0:g.items;if(n)for(let d=0;d<n.length;d++){const s=n[d];if(s.type.startsWith("image/")){e.preventDefault();const h=s.getAsFile();if(h){const R=await u.fileToDataUrl(h);u.insertImage(R),l()}return}}},[E,l]),te=c.useCallback(()=>{if(o||r)return;const e=document.createElement("input");e.type="file",e.accept="image/*",e.onchange=async n=>{var d,s;const g=(d=n.target.files)==null?void 0:d[0];if(g){const h=await u.fileToDataUrl(g);(s=a.current)==null||s.focus(),u.insertImage(h),l()}},e.click()},[o,r,l]),ne={bold:t.jsx(i.BoldIcon,{size:16}),italic:t.jsx(i.ItalicIcon,{size:16}),underline:t.jsx(i.UnderlineIcon,{size:16}),strikethrough:t.jsx(i.StrikethroughIcon,{size:16}),heading1:t.jsx(i.Heading1Icon,{size:16}),heading2:t.jsx(i.Heading2Icon,{size:16}),heading3:t.jsx(i.Heading3Icon,{size:16}),bulletList:t.jsx(i.ListBulletIcon,{size:16}),orderedList:t.jsx(i.ListNumberedIcon,{size:16}),blockquote:t.jsx(i.QuoteIcon,{size:16}),code:t.jsx(i.CodeIcon,{size:16}),link:t.jsx(i.InsertLinkIcon,{size:16}),alignLeft:t.jsx(i.AlignLeftIcon,{size:16}),alignCenter:t.jsx(i.AlignCenterIcon,{size:16}),alignRight:t.jsx(i.AlignRightIcon,{size:16}),alignJustify:t.jsx(i.AlignJustifyIcon,{size:16}),image:t.jsx(i.InsertPhotoIcon,{size:16}),indent:t.jsx(i.IndentIncreaseIcon,{size:16}),outdent:t.jsx(i.IndentDecreaseIcon,{size:16}),clearFormat:t.jsx(i.FormatClearIcon,{size:16}),table:t.jsx(i.TableIcon,{size:16})},L=(e,n)=>{if(e==="divider")return t.jsx("div",{className:T.cn("Bear-RichEditor__divider",f.RICH_EDITOR_DIVIDER_CLASSES)},`divider-${n}`);if(e==="headingDropdown")return t.jsx(oe.ToolbarDropdown,{options:f.RICH_EDITOR_HEADING_OPTIONS,value:N,onChange:Y,title:"Text Style",disabled:o||r,icon:t.jsx(i.TextIcon,{size:16})},"heading-dropdown");if(e==="textColor")return t.jsx(H.ToolbarColorPicker,{value:q,onChange:Q,title:"Text Color",disabled:o||r,type:"text",recentColors:P,onApplyLast:X},"text-color");if(e==="highlightColor")return t.jsx(H.ToolbarColorPicker,{value:U,onChange:W,title:"Highlight Color",disabled:o||r,type:"highlight",recentColors:J,onApplyLast:Z},"highlight-color");if(e==="link")return t.jsx(C.ToolbarButton,{icon:t.jsx(i.InsertLinkIcon,{size:16}),title:"Insert Link",onClick:K,disabled:o||r},"link");if(e==="image")return t.jsx(C.ToolbarButton,{icon:t.jsx(i.InsertPhotoIcon,{size:16}),title:"Insert Image",onClick:te,disabled:o||r},"image");if(e==="alignLeft")return t.jsx(C.ToolbarButton,{icon:t.jsx(i.AlignLeftIcon,{size:16}),title:"Align Left",onClick:()=>{var s;(s=a.current)==null||s.focus(),u.execCommand("justifyLeft"),l()},disabled:o||r},"alignLeft");if(e==="alignCenter")return t.jsx(C.ToolbarButton,{icon:t.jsx(i.AlignCenterIcon,{size:16}),title:"Align Center",onClick:()=>{var s;(s=a.current)==null||s.focus(),u.execCommand("justifyCenter"),l()},disabled:o||r},"alignCenter");if(e==="alignRight")return t.jsx(C.ToolbarButton,{icon:t.jsx(i.AlignRightIcon,{size:16}),title:"Align Right",onClick:()=>{var s;(s=a.current)==null||s.focus(),u.execCommand("justifyRight"),l()},disabled:o||r},"alignRight");if(e==="alignJustify")return t.jsx(C.ToolbarButton,{icon:t.jsx(i.AlignJustifyIcon,{size:16}),title:"Justify",onClick:()=>{var s;(s=a.current)==null||s.focus(),u.execCommand("justifyFull"),l()},disabled:o||r},"alignJustify");if(e==="indent")return t.jsx(C.ToolbarButton,{icon:t.jsx(i.IndentIncreaseIcon,{size:16}),title:"Increase Indent",onClick:()=>{var s;(s=a.current)==null||s.focus(),u.execCommand("indent"),l()},disabled:o||r},"indent");if(e==="outdent")return t.jsx(C.ToolbarButton,{icon:t.jsx(i.IndentDecreaseIcon,{size:16}),title:"Decrease Indent",onClick:()=>{var s;(s=a.current)==null||s.focus(),u.execCommand("outdent"),l()},disabled:o||r},"outdent");if(e==="clearFormat")return t.jsx(C.ToolbarButton,{icon:t.jsx(i.FormatClearIcon,{size:16}),title:"Clear Formatting",onClick:()=>{var s;(s=a.current)==null||s.focus(),u.execCommand("removeFormat"),l()},disabled:o||r},"clearFormat");if(e==="more"){const s=["alignLeft","alignCenter","alignRight","alignJustify","indent","outdent","blockquote","code","clearFormat"];return t.jsx(re.ToolbarMore,{disabled:o||r,children:s.map((h,R)=>L(h,R+1e3))},"more")}const g=f.RICH_EDITOR_BUTTON_CONFIG[e],d=ne[e];return!g||!d?null:t.jsx(C.ToolbarButton,{icon:d,title:g.title,active:D.has(e),onClick:()=>$(e),disabled:o||r},e)};return t.jsxs("div",{id:O,"data-testid":A,className:T.cn("Bear-RichEditor",f.RICH_EDITOR_ROOT_CLASSES,o&&"Bear-RichEditor--disabled",r&&"Bear-RichEditor--readonly",B),...v,children:[y.length>0&&t.jsx("div",{className:T.cn("Bear-RichEditor__toolbar",f.RICH_EDITOR_TOOLBAR_CLASSES),children:y.map((e,n)=>L(e,n))}),t.jsx("div",{ref:a,contentEditable:!o&&!r,onInput:l,onSelect:I,onKeyUp:I,onMouseUp:I,onPaste:ee,"data-placeholder":z,className:T.cn("Bear-RichEditor__content",f.RICH_EDITOR_CONTENT_CLASSES,"[&:empty]:before:bear-content-[attr(data-placeholder)] [&:empty]:before:bear-text-gray-400 [&:empty]:before:bear-pointer-events-none",o&&"Bear-RichEditor__content--disabled bear-opacity-50 bear-cursor-not-allowed"),style:{minHeight:typeof p=="number"?`${p}px`:p,maxHeight:b?typeof b=="number"?`${b}px`:b:void 0,overflowY:b?"auto":void 0}})]})};exports.RichEditor=se;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=150,a=["headingDropdown","divider","bold","italic","underline","strikethrough","divider","textColor","highlightColor","divider","alignLeft","alignCenter","alignRight","alignJustify","divider","bulletList","orderedList","divider","indent","outdent","divider","blockquote","code","link","image","divider","clearFormat"],o="Bear-RichEditor rounded-lg border border-gray-200 dark:border-zinc-700 overflow-hidden bg-white dark:bg-zinc-900 shadow-sm",r="flex flex-wrap items-center gap-0.5 p-2 border-b border-gray-200 dark:border-zinc-700 bg-gray-50 dark:bg-zinc-800",i="p-4 outline-none max-w-none text-gray-900 dark:text-gray-100 bg-white dark:bg-zinc-900 min-h-[100px]",n="w-px h-5 bg-gray-300 dark:bg-zinc-600 mx-1",d="p-1.5 rounded transition-colors",l="bg-pink-500 text-white",c="text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-zinc-700",m="opacity-50 cursor-not-allowed",_=[{value:"p",label:"Paragraph",preview:e.jsx("span",{className:"bear-text-sm bear-font-normal",children:"Normal text"})},{value:"h1",label:"Heading 1",preview:e.jsx("span",{className:"bear-text-2xl bear-font-bold",children:"Heading 1"})},{value:"h2",label:"Heading 2",preview:e.jsx("span",{className:"bear-text-xl bear-font-bold",children:"Heading 2"})},{value:"h3",label:"Heading 3",preview:e.jsx("span",{className:"bear-text-lg bear-font-semibold",children:"Heading 3"})},{value:"h4",label:"Heading 4",preview:e.jsx("span",{className:"bear-text-base bear-font-semibold",children:"Heading 4"})},{value:"h5",label:"Heading 5",preview:e.jsx("span",{className:"bear-text-sm bear-font-semibold",children:"Heading 5"})},{value:"h6",label:"Heading 6",preview:e.jsx("span",{className:"bear-text-xs bear-font-semibold bear-uppercase",children:"Heading 6"})}],g={bold:{title:"Bold (Ctrl+B)",command:"bold"},italic:{title:"Italic (Ctrl+I)",command:"italic"},underline:{title:"Underline (Ctrl+U)",command:"underline"},strikethrough:{title:"Strikethrough",command:"strikeThrough"},heading1:{title:"Heading 1",command:"formatBlock",value:"h1"},heading2:{title:"Heading 2",command:"formatBlock",value:"h2"},heading3:{title:"Heading 3",command:"formatBlock",value:"h3"},heading4:{title:"Heading 4",command:"formatBlock",value:"h4"},heading5:{title:"Heading 5",command:"formatBlock",value:"h5"},heading6:{title:"Heading 6",command:"formatBlock",value:"h6"},paragraph:{title:"Paragraph",command:"formatBlock",value:"p"},bulletList:{title:"Bullet List",command:"insertUnorderedList"},orderedList:{title:"Numbered List",command:"insertOrderedList"},blockquote:{title:"Quote",command:"formatBlock",value:"blockquote"},code:{title:"Code Block",command:"formatBlock",value:"pre"},link:{title:"Insert Link",command:"createLink"},image:{title:"Insert Image",command:"insertImage"},textColor:{title:"Text Color",command:"foreColor"},highlightColor:{title:"Highlight Color",command:"hiliteColor"},alignLeft:{title:"Align Left",command:"justifyLeft"},alignCenter:{title:"Align Center",command:"justifyCenter"},alignRight:{title:"Align Right",command:"justifyRight"},alignJustify:{title:"Justify",command:"justifyFull"},indent:{title:"Increase Indent",command:"indent"},outdent:{title:"Decrease Indent",command:"outdent"},clearFormat:{title:"Clear Formatting",command:"removeFormat"},table:{title:"Insert Table",command:"insertTable"}},s=["#000000","#374151","#6b7280","#9ca3af","#d1d5db","#ffffff","#991b1b","#dc2626","#ef4444","#f87171","#fca5a5","#fee2e2","#9a3412","#ea580c","#f97316","#fb923c","#fdba74","#fed7aa","#854d0e","#ca8a04","#eab308","#facc15","#fde047","#fef08a","#166534","#16a34a","#22c55e","#4ade80","#86efac","#bbf7d0","#1e40af","#2563eb","#3b82f6","#60a5fa","#93c5fd","#bfdbfe","#6b21a8","#9333ea","#a855f7","#c084fc","#d8b4fe","#e9d5ff","#9d174d","#db2777","#ec4899","#f472b6","#f9a8d4","#fbcfe8"],h=`
|
|
2
|
+
.Bear-RichEditor__content {
|
|
3
|
+
line-height: 1.6;
|
|
4
|
+
}
|
|
5
|
+
.Bear-RichEditor__content h1 {
|
|
6
|
+
font-size: 2rem;
|
|
7
|
+
font-weight: bold;
|
|
8
|
+
margin: 0.67em 0;
|
|
9
|
+
line-height: 1.2;
|
|
10
|
+
}
|
|
11
|
+
.Bear-RichEditor__content h2 {
|
|
12
|
+
font-size: 1.5rem;
|
|
13
|
+
font-weight: bold;
|
|
14
|
+
margin: 0.83em 0;
|
|
15
|
+
line-height: 1.3;
|
|
16
|
+
}
|
|
17
|
+
.Bear-RichEditor__content h3 {
|
|
18
|
+
font-size: 1.25rem;
|
|
19
|
+
font-weight: 600;
|
|
20
|
+
margin: 1em 0;
|
|
21
|
+
line-height: 1.4;
|
|
22
|
+
}
|
|
23
|
+
.Bear-RichEditor__content h4 {
|
|
24
|
+
font-size: 1.125rem;
|
|
25
|
+
font-weight: 600;
|
|
26
|
+
margin: 1.33em 0;
|
|
27
|
+
}
|
|
28
|
+
.Bear-RichEditor__content h5 {
|
|
29
|
+
font-size: 1rem;
|
|
30
|
+
font-weight: 600;
|
|
31
|
+
margin: 1.67em 0;
|
|
32
|
+
}
|
|
33
|
+
.Bear-RichEditor__content h6 {
|
|
34
|
+
font-size: 0.875rem;
|
|
35
|
+
font-weight: 600;
|
|
36
|
+
text-transform: uppercase;
|
|
37
|
+
letter-spacing: 0.05em;
|
|
38
|
+
margin: 2em 0;
|
|
39
|
+
}
|
|
40
|
+
.Bear-RichEditor__content p {
|
|
41
|
+
margin: 0.5em 0;
|
|
42
|
+
}
|
|
43
|
+
.Bear-RichEditor__content ul {
|
|
44
|
+
list-style-type: disc !important;
|
|
45
|
+
padding-left: 1.5em !important;
|
|
46
|
+
margin: 0.5em 0 !important;
|
|
47
|
+
display: block !important;
|
|
48
|
+
}
|
|
49
|
+
.Bear-RichEditor__content ol {
|
|
50
|
+
list-style-type: decimal !important;
|
|
51
|
+
padding-left: 1.5em !important;
|
|
52
|
+
margin: 0.5em 0 !important;
|
|
53
|
+
display: block !important;
|
|
54
|
+
}
|
|
55
|
+
.Bear-RichEditor__content li {
|
|
56
|
+
margin: 0.25em 0 !important;
|
|
57
|
+
display: list-item !important;
|
|
58
|
+
}
|
|
59
|
+
.Bear-RichEditor__content blockquote {
|
|
60
|
+
border-left: 4px solid #ec4899;
|
|
61
|
+
padding-left: 1em;
|
|
62
|
+
margin: 1em 0;
|
|
63
|
+
color: #6b7280;
|
|
64
|
+
font-style: italic;
|
|
65
|
+
background: rgba(236, 72, 153, 0.05);
|
|
66
|
+
padding: 0.5em 1em;
|
|
67
|
+
border-radius: 0 0.375rem 0.375rem 0;
|
|
68
|
+
}
|
|
69
|
+
.Bear-RichEditor__content pre {
|
|
70
|
+
background: #f3f4f6;
|
|
71
|
+
color: #374151;
|
|
72
|
+
padding: 1em;
|
|
73
|
+
border-radius: 0.5rem;
|
|
74
|
+
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
|
|
75
|
+
font-size: 0.875em;
|
|
76
|
+
overflow-x: auto;
|
|
77
|
+
margin: 1em 0;
|
|
78
|
+
white-space: pre-wrap;
|
|
79
|
+
word-break: break-word;
|
|
80
|
+
border: 1px solid #e5e7eb;
|
|
81
|
+
}
|
|
82
|
+
.Bear-RichEditor__content code {
|
|
83
|
+
background: #f3f4f6;
|
|
84
|
+
color: #374151;
|
|
85
|
+
padding: 0.125em 0.25em;
|
|
86
|
+
border-radius: 0.25rem;
|
|
87
|
+
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
|
|
88
|
+
font-size: 0.875em;
|
|
89
|
+
}
|
|
90
|
+
.Bear-RichEditor__content a {
|
|
91
|
+
color: #ec4899;
|
|
92
|
+
text-decoration: underline;
|
|
93
|
+
cursor: pointer;
|
|
94
|
+
}
|
|
95
|
+
.Bear-RichEditor__content a:hover {
|
|
96
|
+
color: #db2777;
|
|
97
|
+
}
|
|
98
|
+
.Bear-RichEditor__content img {
|
|
99
|
+
max-width: 100%;
|
|
100
|
+
height: auto;
|
|
101
|
+
border-radius: 0.5rem;
|
|
102
|
+
margin: 1em 0;
|
|
103
|
+
display: block;
|
|
104
|
+
}
|
|
105
|
+
.Bear-RichEditor__content table {
|
|
106
|
+
border-collapse: collapse;
|
|
107
|
+
width: 100%;
|
|
108
|
+
margin: 1em 0;
|
|
109
|
+
}
|
|
110
|
+
.Bear-RichEditor__content th,
|
|
111
|
+
.Bear-RichEditor__content td {
|
|
112
|
+
border: 1px solid #d1d5db;
|
|
113
|
+
padding: 0.5em;
|
|
114
|
+
text-align: left;
|
|
115
|
+
}
|
|
116
|
+
.Bear-RichEditor__content th {
|
|
117
|
+
background: #f3f4f6;
|
|
118
|
+
font-weight: 600;
|
|
119
|
+
}
|
|
120
|
+
/* Dark mode styles */
|
|
121
|
+
.dark .Bear-RichEditor__content pre {
|
|
122
|
+
background: #1f2937;
|
|
123
|
+
color: #e5e7eb;
|
|
124
|
+
border-color: #374151;
|
|
125
|
+
}
|
|
126
|
+
.dark .Bear-RichEditor__content code {
|
|
127
|
+
background: #374151;
|
|
128
|
+
color: #e5e7eb;
|
|
129
|
+
}
|
|
130
|
+
.dark .Bear-RichEditor__content blockquote {
|
|
131
|
+
color: #9ca3af;
|
|
132
|
+
background: rgba(236, 72, 153, 0.1);
|
|
133
|
+
}
|
|
134
|
+
.dark .Bear-RichEditor__content th {
|
|
135
|
+
background: #374151;
|
|
136
|
+
}
|
|
137
|
+
.dark .Bear-RichEditor__content th,
|
|
138
|
+
.dark .Bear-RichEditor__content td {
|
|
139
|
+
border-color: #4b5563;
|
|
140
|
+
}
|
|
141
|
+
`;exports.RICH_EDITOR_BUTTON_ACTIVE_CLASSES=l;exports.RICH_EDITOR_BUTTON_BASE_CLASSES=d;exports.RICH_EDITOR_BUTTON_CONFIG=g;exports.RICH_EDITOR_BUTTON_DISABLED_CLASSES=m;exports.RICH_EDITOR_BUTTON_INACTIVE_CLASSES=c;exports.RICH_EDITOR_COLORS=s;exports.RICH_EDITOR_CONTENT_CLASSES=i;exports.RICH_EDITOR_CONTENT_STYLES=h;exports.RICH_EDITOR_DEFAULT_TOOLBAR=a;exports.RICH_EDITOR_DIVIDER_CLASSES=n;exports.RICH_EDITOR_HEADING_OPTIONS=_;exports.RICH_EDITOR_MIN_HEIGHT=t;exports.RICH_EDITOR_ROOT_CLASSES=o;exports.RICH_EDITOR_TOOLBAR_CLASSES=r;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { ToolbarOption, DropdownOption } from './RichEditor.types';
|
|
2
|
+
export declare const RICH_EDITOR_MIN_HEIGHT = 150;
|
|
3
|
+
export declare const RICH_EDITOR_DEFAULT_TOOLBAR: ToolbarOption[];
|
|
4
|
+
export declare const RICH_EDITOR_COMPACT_TOOLBAR: ToolbarOption[];
|
|
5
|
+
export declare const RICH_EDITOR_SIMPLE_TOOLBAR: ToolbarOption[];
|
|
6
|
+
export declare const RICH_EDITOR_ROOT_CLASSES = "Bear-RichEditor rounded-lg border border-gray-200 dark:border-zinc-700 overflow-hidden bg-white dark:bg-zinc-900 shadow-sm";
|
|
7
|
+
export declare const RICH_EDITOR_TOOLBAR_CLASSES = "flex flex-wrap items-center gap-0.5 p-2 border-b border-gray-200 dark:border-zinc-700 bg-gray-50 dark:bg-zinc-800";
|
|
8
|
+
export declare const RICH_EDITOR_CONTENT_CLASSES = "p-4 outline-none max-w-none text-gray-900 dark:text-gray-100 bg-white dark:bg-zinc-900 min-h-[100px]";
|
|
9
|
+
export declare const RICH_EDITOR_DIVIDER_CLASSES = "w-px h-5 bg-gray-300 dark:bg-zinc-600 mx-1";
|
|
10
|
+
export declare const RICH_EDITOR_BUTTON_BASE_CLASSES = "p-1.5 rounded transition-colors";
|
|
11
|
+
export declare const RICH_EDITOR_BUTTON_ACTIVE_CLASSES = "bg-pink-500 text-white";
|
|
12
|
+
export declare const RICH_EDITOR_BUTTON_INACTIVE_CLASSES = "text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-zinc-700";
|
|
13
|
+
export declare const RICH_EDITOR_BUTTON_DISABLED_CLASSES = "opacity-50 cursor-not-allowed";
|
|
14
|
+
export declare const RICH_EDITOR_COLOR_PICKER_Z_INDEX = 9999;
|
|
15
|
+
export declare const RICH_EDITOR_HEADING_OPTIONS: DropdownOption[];
|
|
16
|
+
export declare const RICH_EDITOR_BUTTON_CONFIG: {
|
|
17
|
+
readonly bold: {
|
|
18
|
+
readonly title: "Bold (Ctrl+B)";
|
|
19
|
+
readonly command: "bold";
|
|
20
|
+
};
|
|
21
|
+
readonly italic: {
|
|
22
|
+
readonly title: "Italic (Ctrl+I)";
|
|
23
|
+
readonly command: "italic";
|
|
24
|
+
};
|
|
25
|
+
readonly underline: {
|
|
26
|
+
readonly title: "Underline (Ctrl+U)";
|
|
27
|
+
readonly command: "underline";
|
|
28
|
+
};
|
|
29
|
+
readonly strikethrough: {
|
|
30
|
+
readonly title: "Strikethrough";
|
|
31
|
+
readonly command: "strikeThrough";
|
|
32
|
+
};
|
|
33
|
+
readonly heading1: {
|
|
34
|
+
readonly title: "Heading 1";
|
|
35
|
+
readonly command: "formatBlock";
|
|
36
|
+
readonly value: "h1";
|
|
37
|
+
};
|
|
38
|
+
readonly heading2: {
|
|
39
|
+
readonly title: "Heading 2";
|
|
40
|
+
readonly command: "formatBlock";
|
|
41
|
+
readonly value: "h2";
|
|
42
|
+
};
|
|
43
|
+
readonly heading3: {
|
|
44
|
+
readonly title: "Heading 3";
|
|
45
|
+
readonly command: "formatBlock";
|
|
46
|
+
readonly value: "h3";
|
|
47
|
+
};
|
|
48
|
+
readonly heading4: {
|
|
49
|
+
readonly title: "Heading 4";
|
|
50
|
+
readonly command: "formatBlock";
|
|
51
|
+
readonly value: "h4";
|
|
52
|
+
};
|
|
53
|
+
readonly heading5: {
|
|
54
|
+
readonly title: "Heading 5";
|
|
55
|
+
readonly command: "formatBlock";
|
|
56
|
+
readonly value: "h5";
|
|
57
|
+
};
|
|
58
|
+
readonly heading6: {
|
|
59
|
+
readonly title: "Heading 6";
|
|
60
|
+
readonly command: "formatBlock";
|
|
61
|
+
readonly value: "h6";
|
|
62
|
+
};
|
|
63
|
+
readonly paragraph: {
|
|
64
|
+
readonly title: "Paragraph";
|
|
65
|
+
readonly command: "formatBlock";
|
|
66
|
+
readonly value: "p";
|
|
67
|
+
};
|
|
68
|
+
readonly bulletList: {
|
|
69
|
+
readonly title: "Bullet List";
|
|
70
|
+
readonly command: "insertUnorderedList";
|
|
71
|
+
};
|
|
72
|
+
readonly orderedList: {
|
|
73
|
+
readonly title: "Numbered List";
|
|
74
|
+
readonly command: "insertOrderedList";
|
|
75
|
+
};
|
|
76
|
+
readonly blockquote: {
|
|
77
|
+
readonly title: "Quote";
|
|
78
|
+
readonly command: "formatBlock";
|
|
79
|
+
readonly value: "blockquote";
|
|
80
|
+
};
|
|
81
|
+
readonly code: {
|
|
82
|
+
readonly title: "Code Block";
|
|
83
|
+
readonly command: "formatBlock";
|
|
84
|
+
readonly value: "pre";
|
|
85
|
+
};
|
|
86
|
+
readonly link: {
|
|
87
|
+
readonly title: "Insert Link";
|
|
88
|
+
readonly command: "createLink";
|
|
89
|
+
};
|
|
90
|
+
readonly image: {
|
|
91
|
+
readonly title: "Insert Image";
|
|
92
|
+
readonly command: "insertImage";
|
|
93
|
+
};
|
|
94
|
+
readonly textColor: {
|
|
95
|
+
readonly title: "Text Color";
|
|
96
|
+
readonly command: "foreColor";
|
|
97
|
+
};
|
|
98
|
+
readonly highlightColor: {
|
|
99
|
+
readonly title: "Highlight Color";
|
|
100
|
+
readonly command: "hiliteColor";
|
|
101
|
+
};
|
|
102
|
+
readonly alignLeft: {
|
|
103
|
+
readonly title: "Align Left";
|
|
104
|
+
readonly command: "justifyLeft";
|
|
105
|
+
};
|
|
106
|
+
readonly alignCenter: {
|
|
107
|
+
readonly title: "Align Center";
|
|
108
|
+
readonly command: "justifyCenter";
|
|
109
|
+
};
|
|
110
|
+
readonly alignRight: {
|
|
111
|
+
readonly title: "Align Right";
|
|
112
|
+
readonly command: "justifyRight";
|
|
113
|
+
};
|
|
114
|
+
readonly alignJustify: {
|
|
115
|
+
readonly title: "Justify";
|
|
116
|
+
readonly command: "justifyFull";
|
|
117
|
+
};
|
|
118
|
+
readonly indent: {
|
|
119
|
+
readonly title: "Increase Indent";
|
|
120
|
+
readonly command: "indent";
|
|
121
|
+
};
|
|
122
|
+
readonly outdent: {
|
|
123
|
+
readonly title: "Decrease Indent";
|
|
124
|
+
readonly command: "outdent";
|
|
125
|
+
};
|
|
126
|
+
readonly clearFormat: {
|
|
127
|
+
readonly title: "Clear Formatting";
|
|
128
|
+
readonly command: "removeFormat";
|
|
129
|
+
};
|
|
130
|
+
readonly table: {
|
|
131
|
+
readonly title: "Insert Table";
|
|
132
|
+
readonly command: "insertTable";
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
export declare const FORMAT_BLOCK_MAP: Record<string, string>;
|
|
136
|
+
export declare const RICH_EDITOR_COLORS: string[];
|
|
137
|
+
export declare const RICH_EDITOR_CONTENT_STYLES = "\n .Bear-RichEditor__content {\n line-height: 1.6;\n }\n .Bear-RichEditor__content h1 { \n font-size: 2rem; \n font-weight: bold; \n margin: 0.67em 0; \n line-height: 1.2;\n }\n .Bear-RichEditor__content h2 { \n font-size: 1.5rem; \n font-weight: bold; \n margin: 0.83em 0; \n line-height: 1.3;\n }\n .Bear-RichEditor__content h3 { \n font-size: 1.25rem; \n font-weight: 600; \n margin: 1em 0; \n line-height: 1.4;\n }\n .Bear-RichEditor__content h4 { \n font-size: 1.125rem; \n font-weight: 600; \n margin: 1.33em 0;\n }\n .Bear-RichEditor__content h5 { \n font-size: 1rem; \n font-weight: 600; \n margin: 1.67em 0;\n }\n .Bear-RichEditor__content h6 { \n font-size: 0.875rem; \n font-weight: 600; \n text-transform: uppercase;\n letter-spacing: 0.05em;\n margin: 2em 0;\n }\n .Bear-RichEditor__content p { \n margin: 0.5em 0; \n }\n .Bear-RichEditor__content ul { \n list-style-type: disc !important; \n padding-left: 1.5em !important; \n margin: 0.5em 0 !important; \n display: block !important;\n }\n .Bear-RichEditor__content ol { \n list-style-type: decimal !important; \n padding-left: 1.5em !important; \n margin: 0.5em 0 !important;\n display: block !important;\n }\n .Bear-RichEditor__content li { \n margin: 0.25em 0 !important;\n display: list-item !important;\n }\n .Bear-RichEditor__content blockquote { \n border-left: 4px solid #ec4899; \n padding-left: 1em; \n margin: 1em 0; \n color: #6b7280; \n font-style: italic;\n background: rgba(236, 72, 153, 0.05);\n padding: 0.5em 1em;\n border-radius: 0 0.375rem 0.375rem 0;\n }\n .Bear-RichEditor__content pre { \n background: #f3f4f6; \n color: #374151;\n padding: 1em; \n border-radius: 0.5rem; \n font-family: ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, monospace; \n font-size: 0.875em;\n overflow-x: auto; \n margin: 1em 0;\n white-space: pre-wrap;\n word-break: break-word;\n border: 1px solid #e5e7eb;\n }\n .Bear-RichEditor__content code {\n background: #f3f4f6;\n color: #374151;\n padding: 0.125em 0.25em;\n border-radius: 0.25rem;\n font-family: ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, monospace;\n font-size: 0.875em;\n }\n .Bear-RichEditor__content a { \n color: #ec4899; \n text-decoration: underline;\n cursor: pointer;\n }\n .Bear-RichEditor__content a:hover {\n color: #db2777;\n }\n .Bear-RichEditor__content img { \n max-width: 100%; \n height: auto; \n border-radius: 0.5rem; \n margin: 1em 0;\n display: block;\n }\n .Bear-RichEditor__content table {\n border-collapse: collapse;\n width: 100%;\n margin: 1em 0;\n }\n .Bear-RichEditor__content th,\n .Bear-RichEditor__content td {\n border: 1px solid #d1d5db;\n padding: 0.5em;\n text-align: left;\n }\n .Bear-RichEditor__content th {\n background: #f3f4f6;\n font-weight: 600;\n }\n /* Dark mode styles */\n .dark .Bear-RichEditor__content pre {\n background: #1f2937;\n color: #e5e7eb;\n border-color: #374151;\n }\n .dark .Bear-RichEditor__content code {\n background: #374151;\n color: #e5e7eb;\n }\n .dark .Bear-RichEditor__content blockquote {\n color: #9ca3af;\n background: rgba(236, 72, 153, 0.1);\n }\n .dark .Bear-RichEditor__content th {\n background: #374151;\n }\n .dark .Bear-RichEditor__content th,\n .dark .Bear-RichEditor__content td {\n border-color: #4b5563;\n }\n";
|