@forgedevstack/bear 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AnimatedCounter/AnimatedCounter.cjs +1 -0
- package/dist/components/AnimatedCounter/AnimatedCounter.const.cjs +1 -0
- package/dist/components/AnimatedCounter/AnimatedCounter.const.d.ts +5 -0
- package/dist/components/AnimatedCounter/AnimatedCounter.const.js +7 -0
- package/dist/components/AnimatedCounter/AnimatedCounter.d.ts +3 -0
- package/dist/components/AnimatedCounter/AnimatedCounter.js +59 -0
- package/dist/components/AnimatedCounter/AnimatedCounter.types.d.ts +26 -0
- package/dist/components/AnimatedCounter/AnimatedCounter.utils.cjs +1 -0
- package/dist/components/AnimatedCounter/AnimatedCounter.utils.d.ts +6 -0
- package/dist/components/AnimatedCounter/AnimatedCounter.utils.js +13 -0
- package/dist/components/AnimatedCounter/index.d.ts +2 -0
- package/dist/components/Autocomplete/Autocomplete.cjs +1 -1
- package/dist/components/Autocomplete/Autocomplete.const.cjs +1 -0
- package/dist/components/Autocomplete/Autocomplete.const.d.ts +1 -0
- package/dist/components/Autocomplete/Autocomplete.const.js +4 -0
- package/dist/components/Autocomplete/Autocomplete.js +110 -72
- package/dist/components/BottomSheet/BottomSheet.cjs +1 -1
- package/dist/components/BottomSheet/BottomSheet.js +74 -53
- package/dist/components/BottomSheet/BottomSheet.types.d.ts +2 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +126 -46
- package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +11 -4
- package/dist/components/Breadcrumbs/index.d.ts +1 -1
- package/dist/components/Cascader/Cascader.cjs +1 -1
- package/dist/components/Cascader/Cascader.const.cjs +1 -1
- package/dist/components/Cascader/Cascader.const.d.ts +1 -1
- package/dist/components/Cascader/Cascader.const.js +1 -1
- package/dist/components/Cascader/Cascader.js +109 -146
- package/dist/components/Cascader/components/CascaderPanel/CascaderPanel.cjs +1 -0
- package/dist/components/Cascader/components/CascaderPanel/CascaderPanel.d.ts +3 -0
- package/dist/components/Cascader/components/CascaderPanel/CascaderPanel.js +50 -0
- package/dist/components/Cascader/components/CascaderPanel/index.d.ts +1 -0
- package/dist/components/Chart/BarChart.cjs +1 -0
- package/dist/components/Chart/BarChart.d.ts +3 -0
- package/dist/components/Chart/BarChart.js +65 -0
- package/dist/components/Chart/Chart.cjs +1 -1
- package/dist/components/Chart/Chart.const.cjs +1 -1
- package/dist/components/Chart/Chart.const.d.ts +7 -0
- package/dist/components/Chart/Chart.const.js +12 -2
- package/dist/components/Chart/Chart.d.ts +1 -13
- package/dist/components/Chart/Chart.js +18 -204
- package/dist/components/Chart/Chart.types.d.ts +7 -1
- package/dist/components/Chart/LineChart.cjs +1 -0
- package/dist/components/Chart/LineChart.d.ts +3 -0
- package/dist/components/Chart/LineChart.js +73 -0
- package/dist/components/Chart/PieChart.cjs +1 -0
- package/dist/components/Chart/PieChart.d.ts +3 -0
- package/dist/components/Chart/PieChart.js +110 -0
- package/dist/components/Chart/index.d.ts +4 -1
- package/dist/components/ColorPicker/ColorPicker.cjs +1 -1
- package/dist/components/ColorPicker/ColorPicker.const.cjs +1 -1
- package/dist/components/ColorPicker/ColorPicker.const.d.ts +4 -2
- package/dist/components/ColorPicker/ColorPicker.const.js +8 -6
- package/dist/components/ColorPicker/ColorPicker.js +135 -73
- package/dist/components/ColorPicker/ColorPicker.utils.cjs +1 -0
- package/dist/components/ColorPicker/ColorPicker.utils.d.ts +17 -0
- package/dist/components/ColorPicker/ColorPicker.utils.js +43 -0
- package/dist/components/CountdownTimer/CountdownTimer.cjs +1 -1
- package/dist/components/CountdownTimer/CountdownTimer.const.cjs +1 -1
- package/dist/components/CountdownTimer/CountdownTimer.const.d.ts +2 -0
- package/dist/components/CountdownTimer/CountdownTimer.const.js +29 -17
- package/dist/components/CountdownTimer/CountdownTimer.js +91 -61
- package/dist/components/CountdownTimer/CountdownTimer.types.d.ts +11 -2
- package/dist/components/CreditInput/CreditInput.cjs +1 -1
- package/dist/components/CreditInput/CreditInput.js +80 -78
- package/dist/components/CurrencyInput/CurrencyInput.cjs +1 -0
- package/dist/components/CurrencyInput/CurrencyInput.const.cjs +1 -0
- package/dist/components/CurrencyInput/CurrencyInput.const.d.ts +4 -0
- package/dist/components/CurrencyInput/CurrencyInput.const.js +19 -0
- package/dist/components/CurrencyInput/CurrencyInput.d.ts +3 -0
- package/dist/components/CurrencyInput/CurrencyInput.js +60 -0
- package/dist/components/CurrencyInput/CurrencyInput.types.d.ts +22 -0
- package/dist/components/CurrencyInput/CurrencyInput.utils.cjs +1 -0
- package/dist/components/CurrencyInput/CurrencyInput.utils.d.ts +2 -0
- package/dist/components/CurrencyInput/CurrencyInput.utils.js +14 -0
- package/dist/components/CurrencyInput/index.d.ts +2 -0
- package/dist/components/DateRangePicker/DateRangePicker.cjs +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.js +89 -84
- package/dist/components/DiffSquares/DiffSquares.cjs +1 -0
- package/dist/components/DiffSquares/DiffSquares.const.cjs +1 -0
- package/dist/components/DiffSquares/DiffSquares.const.d.ts +3 -0
- package/dist/components/DiffSquares/DiffSquares.const.js +6 -0
- package/dist/components/DiffSquares/DiffSquares.d.ts +3 -0
- package/dist/components/DiffSquares/DiffSquares.js +70 -0
- package/dist/components/DiffSquares/DiffSquares.types.d.ts +23 -0
- package/dist/components/DiffSquares/DiffSquares.utils.cjs +1 -0
- package/dist/components/DiffSquares/DiffSquares.utils.d.ts +3 -0
- package/dist/components/DiffSquares/DiffSquares.utils.js +12 -0
- package/dist/components/DiffSquares/index.d.ts +2 -0
- package/dist/components/DiffViewer/DiffViewer.cjs +1 -1
- package/dist/components/DiffViewer/DiffViewer.const.cjs +1 -1
- package/dist/components/DiffViewer/DiffViewer.const.d.ts +6 -0
- package/dist/components/DiffViewer/DiffViewer.const.js +17 -4
- package/dist/components/DiffViewer/DiffViewer.d.ts +0 -14
- package/dist/components/DiffViewer/DiffViewer.js +97 -105
- package/dist/components/DiffViewer/DiffViewer.types.d.ts +5 -0
- package/dist/components/DiffViewer/index.d.ts +1 -1
- package/dist/components/Drawer/Drawer.cjs +1 -1
- package/dist/components/Drawer/Drawer.js +41 -41
- package/dist/components/Dropdown/Dropdown.cjs +1 -1
- package/dist/components/Dropdown/Dropdown.const.cjs +1 -0
- package/dist/components/Dropdown/Dropdown.const.d.ts +7 -0
- package/dist/components/Dropdown/Dropdown.const.js +10 -0
- package/dist/components/Dropdown/Dropdown.d.ts +0 -1
- package/dist/components/Dropdown/Dropdown.js +102 -92
- package/dist/components/Dropdown/Dropdown.types.d.ts +2 -0
- package/dist/components/Gauge/Gauge.cjs +1 -1
- package/dist/components/Gauge/Gauge.js +61 -50
- package/dist/components/Gauge/Gauge.types.d.ts +2 -0
- package/dist/components/GlowCard/GlowCard.cjs +1 -0
- package/dist/components/GlowCard/GlowCard.const.cjs +1 -0
- package/dist/components/GlowCard/GlowCard.const.d.ts +11 -0
- package/dist/components/GlowCard/GlowCard.const.js +13 -0
- package/dist/components/GlowCard/GlowCard.d.ts +3 -0
- package/dist/components/GlowCard/GlowCard.js +185 -0
- package/dist/components/GlowCard/GlowCard.types.d.ts +21 -0
- package/dist/components/GlowCard/index.d.ts +2 -0
- package/dist/components/Heatmap/Heatmap.cjs +1 -0
- package/dist/components/Heatmap/Heatmap.const.cjs +1 -0
- package/dist/components/Heatmap/Heatmap.const.d.ts +8 -0
- package/dist/components/Heatmap/Heatmap.const.js +11 -0
- package/dist/components/Heatmap/Heatmap.d.ts +3 -0
- package/dist/components/Heatmap/Heatmap.js +103 -0
- package/dist/components/Heatmap/Heatmap.types.d.ts +34 -0
- package/dist/components/Heatmap/Heatmap.utils.cjs +1 -0
- package/dist/components/Heatmap/Heatmap.utils.d.ts +2 -0
- package/dist/components/Heatmap/Heatmap.utils.js +18 -0
- package/dist/components/Heatmap/index.d.ts +2 -0
- package/dist/components/HoverCard/HoverCard.cjs +6 -6
- package/dist/components/HoverCard/HoverCard.js +72 -54
- package/dist/components/Icon/icons/status.js +1 -1
- package/dist/components/ImageAnnotation/ImageAnnotation.cjs +1 -0
- package/dist/components/ImageAnnotation/ImageAnnotation.const.cjs +1 -0
- package/dist/components/ImageAnnotation/ImageAnnotation.const.d.ts +3 -0
- package/dist/components/ImageAnnotation/ImageAnnotation.const.js +6 -0
- package/dist/components/ImageAnnotation/ImageAnnotation.d.ts +3 -0
- package/dist/components/ImageAnnotation/ImageAnnotation.js +113 -0
- package/dist/components/ImageAnnotation/ImageAnnotation.types.d.ts +28 -0
- package/dist/components/ImageAnnotation/index.d.ts +2 -0
- package/dist/components/MediaPlayer/MediaPlayer.cjs +1 -0
- package/dist/components/MediaPlayer/MediaPlayer.const.cjs +1 -0
- package/dist/components/MediaPlayer/MediaPlayer.const.d.ts +36 -0
- package/dist/components/MediaPlayer/MediaPlayer.const.js +11 -0
- package/dist/components/MediaPlayer/MediaPlayer.d.ts +3 -0
- package/dist/components/MediaPlayer/MediaPlayer.js +279 -0
- package/dist/components/MediaPlayer/MediaPlayer.types.d.ts +69 -0
- package/dist/components/MediaPlayer/MediaPlayer.utils.cjs +1 -0
- package/dist/components/MediaPlayer/MediaPlayer.utils.d.ts +1 -0
- package/dist/components/MediaPlayer/MediaPlayer.utils.js +7 -0
- package/dist/components/MediaPlayer/index.d.ts +2 -0
- package/dist/components/MentionsInput/MentionsInput.cjs +1 -1
- package/dist/components/MentionsInput/MentionsInput.js +106 -83
- package/dist/components/Menu/Menu.cjs +1 -1
- package/dist/components/Menu/Menu.js +91 -80
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.const.cjs +1 -1
- package/dist/components/Modal/Modal.const.d.ts +1 -1
- package/dist/components/Modal/Modal.const.js +1 -1
- package/dist/components/Modal/Modal.js +50 -44
- package/dist/components/Modal/Modal.types.d.ts +6 -0
- package/dist/components/MultiSelect/MultiSelect.cjs +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +123 -78
- package/dist/components/NavigableSelect/NavigableSelect.cjs +1 -1
- package/dist/components/NavigableSelect/NavigableSelect.const.cjs +1 -1
- package/dist/components/NavigableSelect/NavigableSelect.const.d.ts +1 -1
- package/dist/components/NavigableSelect/NavigableSelect.const.js +1 -1
- package/dist/components/NavigableSelect/NavigableSelect.js +167 -143
- package/dist/components/NotificationCenter/NotificationCenter.cjs +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.const.cjs +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.const.d.ts +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.const.js +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.js +87 -81
- package/dist/components/OTPInput/OTPInput.cjs +1 -1
- package/dist/components/OTPInput/OTPInput.const.cjs +1 -0
- package/dist/components/OTPInput/OTPInput.const.d.ts +6 -0
- package/dist/components/OTPInput/OTPInput.const.js +14 -0
- package/dist/components/OTPInput/OTPInput.js +99 -65
- package/dist/components/OTPInput/OTPInput.types.d.ts +7 -0
- package/dist/components/PhoneInput/PhoneInput.cjs +1 -1
- package/dist/components/PhoneInput/PhoneInput.const.cjs +1 -1
- package/dist/components/PhoneInput/PhoneInput.const.d.ts +1 -1
- package/dist/components/PhoneInput/PhoneInput.const.js +1 -1
- package/dist/components/PhoneInput/PhoneInput.js +88 -83
- package/dist/components/Popconfirm/Popconfirm.cjs +1 -1
- package/dist/components/Popconfirm/Popconfirm.const.cjs +1 -1
- package/dist/components/Popconfirm/Popconfirm.const.d.ts +1 -3
- package/dist/components/Popconfirm/Popconfirm.const.js +12 -18
- package/dist/components/Popconfirm/Popconfirm.js +71 -51
- package/dist/components/Popover/Popover.cjs +1 -1
- package/dist/components/Popover/Popover.js +36 -31
- package/dist/components/Portal/Portal.cjs +1 -1
- package/dist/components/Portal/Portal.d.ts +0 -3
- package/dist/components/Portal/Portal.js +4 -10
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.js +71 -51
- package/dist/components/Stepper/Stepper.cjs +1 -1
- package/dist/components/Stepper/Stepper.const.cjs +1 -1
- package/dist/components/Stepper/Stepper.const.d.ts +26 -4
- package/dist/components/Stepper/Stepper.const.js +39 -20
- package/dist/components/Stepper/Stepper.d.ts +3 -10
- package/dist/components/Stepper/Stepper.js +189 -130
- package/dist/components/Stepper/Stepper.types.d.ts +14 -0
- package/dist/components/Stepper/Stepper.utils.cjs +1 -0
- package/dist/components/Stepper/Stepper.utils.d.ts +12 -0
- package/dist/components/Stepper/Stepper.utils.js +19 -0
- package/dist/components/Stepper/components/StepperControls.cjs +1 -0
- package/dist/components/Stepper/components/StepperControls.d.ts +2 -0
- package/dist/components/Stepper/components/StepperControls.js +32 -0
- package/dist/components/Stepper/index.d.ts +2 -1
- package/dist/components/Tabs/TabList.cjs +1 -1
- package/dist/components/Tabs/TabList.js +72 -57
- package/dist/components/Tabs/Tabs.types.d.ts +4 -2
- package/dist/components/Tabs/index.d.ts +2 -2
- package/dist/components/TagCloud/TagCloud.cjs +1 -0
- package/dist/components/TagCloud/TagCloud.const.cjs +1 -0
- package/dist/components/TagCloud/TagCloud.const.d.ts +5 -0
- package/dist/components/TagCloud/TagCloud.const.js +8 -0
- package/dist/components/TagCloud/TagCloud.d.ts +3 -0
- package/dist/components/TagCloud/TagCloud.js +76 -0
- package/dist/components/TagCloud/TagCloud.types.d.ts +26 -0
- package/dist/components/TagCloud/index.d.ts +2 -0
- package/dist/components/TimePicker/components/TimePickerDialDropdown/TimePickerDialDropdown.cjs +1 -1
- package/dist/components/TimePicker/components/TimePickerDialDropdown/TimePickerDialDropdown.js +26 -26
- package/dist/components/TimePicker/helpers/ClockFaceSvg.cjs +1 -1
- package/dist/components/TimePicker/helpers/ClockFaceSvg.js +17 -17
- package/dist/components/TimelineChart/TimelineChart.cjs +1 -0
- package/dist/components/TimelineChart/TimelineChart.const.cjs +1 -0
- package/dist/components/TimelineChart/TimelineChart.const.d.ts +6 -0
- package/dist/components/TimelineChart/TimelineChart.const.js +9 -0
- package/dist/components/TimelineChart/TimelineChart.d.ts +3 -0
- package/dist/components/TimelineChart/TimelineChart.js +65 -0
- package/dist/components/TimelineChart/TimelineChart.types.d.ts +31 -0
- package/dist/components/TimelineChart/index.d.ts +2 -0
- package/dist/components/Toast/Toast.cjs +1 -1
- package/dist/components/Toast/Toast.js +86 -82
- package/dist/components/Toast/Toast.types.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.js +52 -44
- package/dist/components/TreeSelect/TreeSelect.cjs +1 -1
- package/dist/components/TreeSelect/TreeSelect.const.cjs +1 -1
- package/dist/components/TreeSelect/TreeSelect.const.d.ts +1 -1
- package/dist/components/TreeSelect/TreeSelect.const.js +3 -3
- package/dist/components/TreeSelect/TreeSelect.js +120 -88
- package/dist/components/Watermark/Watermark.cjs +1 -1
- package/dist/components/Watermark/Watermark.const.cjs +1 -1
- package/dist/components/Watermark/Watermark.const.d.ts +6 -3
- package/dist/components/Watermark/Watermark.const.js +13 -11
- package/dist/components/Watermark/Watermark.js +87 -61
- package/dist/components/Watermark/Watermark.types.d.ts +2 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +22 -4
- package/dist/components/index.js +319 -296
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +55 -54
- package/dist/hooks/useClickOutside.cjs +1 -1
- package/dist/hooks/useClickOutside.d.ts +4 -11
- package/dist/hooks/useClickOutside.js +26 -7
- package/dist/index.cjs +1 -1
- package/dist/index.js +412 -388
- package/dist/styles/_effects.css +32 -0
- package/dist/styles.css +1 -1
- package/dist/utils/maxVisible.utils.cjs +1 -0
- package/dist/utils/maxVisible.utils.d.ts +12 -0
- package/dist/utils/maxVisible.utils.js +15 -0
- package/package.json +1 -1
- package/dist/components/HoverCard/HoverCard.utils.cjs +0 -1
- package/dist/components/HoverCard/HoverCard.utils.js +0 -23
|
@@ -1,159 +1,163 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { generateId as
|
|
5
|
-
const
|
|
6
|
-
success: /* @__PURE__ */
|
|
1
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as N, useContext as T, useState as k, useCallback as n, useRef as E, useEffect as y } from "react";
|
|
3
|
+
import { cn as I } from "../../utils/cn.js";
|
|
4
|
+
import { generateId as S } from "./Toast.utils.js";
|
|
5
|
+
const _ = {
|
|
6
|
+
success: /* @__PURE__ */ l("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
|
|
7
7
|
/* @__PURE__ */ e("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
|
|
8
8
|
/* @__PURE__ */ e("polyline", { points: "22 4 12 14.01 9 11.01" })
|
|
9
9
|
] }),
|
|
10
|
-
info: /* @__PURE__ */
|
|
10
|
+
info: /* @__PURE__ */ l("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
|
|
11
11
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
|
|
12
12
|
/* @__PURE__ */ e("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
|
|
13
13
|
/* @__PURE__ */ e("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
|
|
14
14
|
] }),
|
|
15
|
-
warning: /* @__PURE__ */
|
|
15
|
+
warning: /* @__PURE__ */ l("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
|
|
16
16
|
/* @__PURE__ */ e("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
|
|
17
17
|
/* @__PURE__ */ e("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
18
18
|
/* @__PURE__ */ e("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
19
19
|
] }),
|
|
20
|
-
error: /* @__PURE__ */
|
|
20
|
+
error: /* @__PURE__ */ l("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
|
|
21
21
|
/* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
|
|
22
22
|
/* @__PURE__ */ e("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
|
|
23
23
|
/* @__PURE__ */ e("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
|
|
24
24
|
] })
|
|
25
|
-
},
|
|
25
|
+
}, B = () => /* @__PURE__ */ l("svg", { width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
|
|
26
26
|
/* @__PURE__ */ e("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
27
27
|
/* @__PURE__ */ e("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
28
|
-
] }),
|
|
28
|
+
] }), W = {
|
|
29
29
|
success: "bear-bg-green-500 bear-text-white",
|
|
30
30
|
info: "bear-bg-blue-500 bear-text-white",
|
|
31
31
|
warning: "bear-bg-amber-500 bear-text-white",
|
|
32
32
|
error: "bear-bg-red-500 bear-text-white"
|
|
33
|
-
},
|
|
33
|
+
}, C = {
|
|
34
34
|
"top-left": "bear-top-4 bear-left-4",
|
|
35
35
|
"top-center": "bear-top-4 bear-left-1/2 bear-transform bear--translate-x-1/2",
|
|
36
36
|
"top-right": "bear-top-4 bear-right-4",
|
|
37
37
|
"bottom-left": "bear-bottom-4 bear-left-4",
|
|
38
38
|
"bottom-center": "bear-bottom-4 bear-left-1/2 bear-transform bear--translate-x-1/2",
|
|
39
39
|
"bottom-right": "bear-bottom-4 bear-right-4"
|
|
40
|
-
}, w =
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
40
|
+
}, w = N(null), M = () => {
|
|
41
|
+
const i = T(w);
|
|
42
|
+
if (!i)
|
|
43
43
|
throw new Error("useToast must be used within a ToastProvider");
|
|
44
|
-
return
|
|
45
|
-
},
|
|
46
|
-
message:
|
|
44
|
+
return i;
|
|
45
|
+
}, L = ({
|
|
46
|
+
message: i,
|
|
47
47
|
title: b,
|
|
48
|
-
severity:
|
|
48
|
+
severity: h = "info",
|
|
49
49
|
duration: o = 5e3,
|
|
50
|
-
closable:
|
|
50
|
+
closable: c = !0,
|
|
51
51
|
icon: t,
|
|
52
|
-
action:
|
|
53
|
-
onClose:
|
|
52
|
+
action: d,
|
|
53
|
+
onClose: s,
|
|
54
54
|
onRemove: x,
|
|
55
|
-
className:
|
|
55
|
+
className: p,
|
|
56
|
+
autoScroll: m = !1
|
|
56
57
|
}) => {
|
|
57
|
-
const [
|
|
58
|
-
|
|
58
|
+
const [v, g] = k(!1), u = E(null);
|
|
59
|
+
y(() => {
|
|
60
|
+
m && u.current && u.current.scrollIntoView({ behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
61
|
+
}, [m]), y(() => {
|
|
59
62
|
if (o > 0) {
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
x(),
|
|
63
|
+
const f = setTimeout(() => {
|
|
64
|
+
g(!0), setTimeout(() => {
|
|
65
|
+
x(), s == null || s();
|
|
63
66
|
}, 200);
|
|
64
67
|
}, o);
|
|
65
|
-
return () => clearTimeout(
|
|
68
|
+
return () => clearTimeout(f);
|
|
66
69
|
}
|
|
67
|
-
}, [o, x,
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
x(),
|
|
70
|
+
}, [o, x, s]);
|
|
71
|
+
const r = () => {
|
|
72
|
+
g(!0), setTimeout(() => {
|
|
73
|
+
x(), s == null || s();
|
|
71
74
|
}, 200);
|
|
72
|
-
},
|
|
73
|
-
return /* @__PURE__ */
|
|
75
|
+
}, a = () => t === !1 ? null : t || _[h];
|
|
76
|
+
return /* @__PURE__ */ l(
|
|
74
77
|
"div",
|
|
75
78
|
{
|
|
79
|
+
ref: u,
|
|
76
80
|
role: "alert",
|
|
77
|
-
className:
|
|
81
|
+
className: I(
|
|
78
82
|
"bear-flex bear-items-start bear-gap-3 bear-p-4 bear-rounded-lg bear-shadow-lg bear-min-w-[300px] bear-max-w-[400px]",
|
|
79
83
|
"bear-transition-all bear-duration-200",
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
v ? "bear-opacity-0 bear-translate-x-2" : "bear-opacity-100 bear-translate-x-0",
|
|
85
|
+
W[h],
|
|
86
|
+
p
|
|
83
87
|
),
|
|
84
88
|
children: [
|
|
85
|
-
|
|
86
|
-
/* @__PURE__ */
|
|
89
|
+
a() && /* @__PURE__ */ e("span", { className: "bear-flex-shrink-0 bear-mt-0.5", children: a() }),
|
|
90
|
+
/* @__PURE__ */ l("div", { className: "bear-flex-1 bear-min-w-0", children: [
|
|
87
91
|
b && /* @__PURE__ */ e("div", { className: "bear-font-semibold bear-mb-0.5", children: b }),
|
|
88
|
-
/* @__PURE__ */ e("div", { className: "bear-text-sm bear-opacity-90", children:
|
|
92
|
+
/* @__PURE__ */ e("div", { className: "bear-text-sm bear-opacity-90", children: i })
|
|
89
93
|
] }),
|
|
90
|
-
|
|
91
|
-
|
|
94
|
+
d && /* @__PURE__ */ e("div", { className: "bear-flex-shrink-0", children: d }),
|
|
95
|
+
c && /* @__PURE__ */ e(
|
|
92
96
|
"button",
|
|
93
97
|
{
|
|
94
98
|
type: "button",
|
|
95
|
-
onClick:
|
|
99
|
+
onClick: r,
|
|
96
100
|
className: "bear-flex-shrink-0 bear-p-1 bear-rounded hover:bear-bg-white/20 bear-transition-colors bear-bg-transparent bear-border-none bear-cursor-pointer",
|
|
97
101
|
"aria-label": "Close",
|
|
98
|
-
children: /* @__PURE__ */ e(
|
|
102
|
+
children: /* @__PURE__ */ e(B, {})
|
|
99
103
|
}
|
|
100
104
|
)
|
|
101
105
|
]
|
|
102
106
|
}
|
|
103
107
|
);
|
|
104
|
-
},
|
|
105
|
-
position:
|
|
108
|
+
}, P = ({
|
|
109
|
+
position: i = "top-right",
|
|
106
110
|
maxToasts: b = 5,
|
|
107
|
-
className:
|
|
111
|
+
className: h
|
|
108
112
|
}) => {
|
|
109
|
-
const o =
|
|
113
|
+
const o = T(w);
|
|
110
114
|
if (!o) return null;
|
|
111
|
-
const { _toasts:
|
|
115
|
+
const { _toasts: c, _removeToast: t } = o, d = c.slice(0, b);
|
|
112
116
|
return /* @__PURE__ */ e(
|
|
113
117
|
"div",
|
|
114
118
|
{
|
|
115
|
-
className:
|
|
116
|
-
"bear-fixed bear-z-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
className: I(
|
|
120
|
+
"bear-fixed bear-z-[11000] bear-flex bear-flex-col bear-gap-2",
|
|
121
|
+
C[i],
|
|
122
|
+
h
|
|
119
123
|
),
|
|
120
|
-
children:
|
|
121
|
-
|
|
124
|
+
children: d.map((s) => /* @__PURE__ */ e(
|
|
125
|
+
L,
|
|
122
126
|
{
|
|
123
|
-
...
|
|
124
|
-
onRemove: () => t(
|
|
127
|
+
...s,
|
|
128
|
+
onRemove: () => t(s.id)
|
|
125
129
|
},
|
|
126
|
-
|
|
130
|
+
s.id
|
|
127
131
|
))
|
|
128
132
|
}
|
|
129
133
|
);
|
|
130
|
-
},
|
|
131
|
-
children:
|
|
134
|
+
}, O = ({
|
|
135
|
+
children: i,
|
|
132
136
|
position: b = "top-right"
|
|
133
137
|
}) => {
|
|
134
|
-
const [
|
|
135
|
-
o((
|
|
136
|
-
}, []), t =
|
|
137
|
-
const
|
|
138
|
-
return o((
|
|
139
|
-
}, []),
|
|
140
|
-
toast:
|
|
141
|
-
success:
|
|
138
|
+
const [h, o] = k([]), c = n((r) => {
|
|
139
|
+
o((a) => a.filter((f) => f.id !== r));
|
|
140
|
+
}, []), t = n((r) => {
|
|
141
|
+
const a = r.id || S();
|
|
142
|
+
return o((f) => [...f, { ...r, id: a }]), a;
|
|
143
|
+
}, []), d = n((r) => t(r), [t]), s = n((r, a) => t({ message: r, severity: "success", ...a }), [t]), x = n((r, a) => t({ message: r, severity: "info", ...a }), [t]), p = n((r, a) => t({ message: r, severity: "warning", ...a }), [t]), m = n((r, a) => t({ message: r, severity: "error", ...a }), [t]), v = n((r) => c(r), [c]), g = n(() => o([]), []), u = {
|
|
144
|
+
toast: d,
|
|
145
|
+
success: s,
|
|
142
146
|
info: x,
|
|
143
|
-
warning:
|
|
144
|
-
error:
|
|
145
|
-
dismiss:
|
|
146
|
-
dismissAll:
|
|
147
|
-
_toasts:
|
|
148
|
-
_removeToast:
|
|
147
|
+
warning: p,
|
|
148
|
+
error: m,
|
|
149
|
+
dismiss: v,
|
|
150
|
+
dismissAll: g,
|
|
151
|
+
_toasts: h,
|
|
152
|
+
_removeToast: c
|
|
149
153
|
};
|
|
150
|
-
return /* @__PURE__ */
|
|
151
|
-
|
|
152
|
-
/* @__PURE__ */ e(
|
|
154
|
+
return /* @__PURE__ */ l(w.Provider, { value: u, children: [
|
|
155
|
+
i,
|
|
156
|
+
/* @__PURE__ */ e(P, { position: b })
|
|
153
157
|
] });
|
|
154
158
|
};
|
|
155
159
|
export {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
160
|
+
P as ToastContainer,
|
|
161
|
+
O as ToastProvider,
|
|
162
|
+
M as useToast
|
|
159
163
|
};
|
|
@@ -22,6 +22,8 @@ export interface ToastProps {
|
|
|
22
22
|
onClose?: () => void;
|
|
23
23
|
/** Additional CSS class */
|
|
24
24
|
className?: string;
|
|
25
|
+
/** Scroll the toast into view when it appears */
|
|
26
|
+
autoScroll?: boolean;
|
|
25
27
|
}
|
|
26
28
|
export interface ToastContainerProps {
|
|
27
29
|
/** Position of toast container */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),t=require("react"),M=require("react-dom"),B=require("../../utils/cn.cjs"),j=({content:p,children:w,position:x,placement:R,delay:v=200,className:y,disabled:T=!1})=>{const u=R||x||"top",[i,b]=t.useState(!1),[f,E]=t.useState({x:0,y:0}),d=t.useRef(null),h=t.useRef(null),s=t.useRef(),c=t.useCallback(()=>{if(!d.current||!h.current)return;const e=d.current.getBoundingClientRect(),r=h.current.getBoundingClientRect(),l=8;let o=0,n=0;switch(u){case"top":o=e.left+(e.width-r.width)/2,n=e.top-r.height-l;break;case"bottom":o=e.left+(e.width-r.width)/2,n=e.bottom+l;break;case"left":o=e.left-r.width-l,n=e.top+(e.height-r.height)/2;break;case"right":o=e.right+l,n=e.top+(e.height-r.height)/2;break}o=Math.max(8,Math.min(o,window.innerWidth-r.width-8)),n=Math.max(8,Math.min(n,window.innerHeight-r.height-8)),E({x:o,y:n})},[u]),g=()=>{T||(s.current=setTimeout(()=>{b(!0)},v))},m=()=>{s.current&&clearTimeout(s.current),b(!1)};return t.useEffect(()=>{i&&c()},[i,c]),t.useEffect(()=>{if(!i)return;const e=()=>{requestAnimationFrame(()=>c())};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[i,c]),t.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]),a.jsxs(a.Fragment,{children:[a.jsx("div",{ref:d,onMouseEnter:g,onMouseLeave:m,onFocus:g,onBlur:m,className:"Bear-Tooltip__trigger bear-inline-block",children:w}),i&&M.createPortal(a.jsx("div",{ref:h,role:"tooltip",style:{left:f.x,top:f.y},className:B.cn("bear-fixed bear-z-[11000]","Bear-Tooltip",`Bear-Tooltip--${u}`,"bear-px-3 bear-py-2 bear-rounded-lg","bear-bg-gray-800 bear-text-white bear-text-sm","bear-border bear-border-gray-700","bear-shadow-lg","bear-animate-in bear-fade-in bear-duration-150",y),children:a.jsx("span",{className:"Bear-Tooltip__content",children:p})}),document.body)]})};exports.Tooltip=j;
|
|
@@ -1,81 +1,89 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { cn as
|
|
5
|
-
const
|
|
1
|
+
import { jsxs as k, Fragment as L, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useState as w, useRef as h, useCallback as C, useEffect as b } from "react";
|
|
3
|
+
import { createPortal as _ } from "react-dom";
|
|
4
|
+
import { cn as z } from "../../utils/cn.js";
|
|
5
|
+
const V = ({
|
|
6
6
|
content: x,
|
|
7
|
-
children:
|
|
8
|
-
position:
|
|
9
|
-
placement:
|
|
10
|
-
delay:
|
|
11
|
-
className:
|
|
12
|
-
disabled:
|
|
7
|
+
children: v,
|
|
8
|
+
position: y,
|
|
9
|
+
placement: M,
|
|
10
|
+
delay: R = 200,
|
|
11
|
+
className: T,
|
|
12
|
+
disabled: B = !1
|
|
13
13
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
if (!
|
|
16
|
-
const e =
|
|
14
|
+
const c = M || y || "top", [i, m] = w(!1), [f, E] = w({ x: 0, y: 0 }), l = h(null), u = h(null), n = h(), a = C(() => {
|
|
15
|
+
if (!l.current || !u.current) return;
|
|
16
|
+
const e = l.current.getBoundingClientRect(), t = u.current.getBoundingClientRect(), s = 8;
|
|
17
17
|
let r = 0, o = 0;
|
|
18
|
-
switch (
|
|
18
|
+
switch (c) {
|
|
19
19
|
case "top":
|
|
20
|
-
r = e.left + (e.width - t.width) / 2, o = e.top - t.height -
|
|
20
|
+
r = e.left + (e.width - t.width) / 2, o = e.top - t.height - s;
|
|
21
21
|
break;
|
|
22
22
|
case "bottom":
|
|
23
|
-
r = e.left + (e.width - t.width) / 2, o = e.bottom +
|
|
23
|
+
r = e.left + (e.width - t.width) / 2, o = e.bottom + s;
|
|
24
24
|
break;
|
|
25
25
|
case "left":
|
|
26
|
-
r = e.left - t.width -
|
|
26
|
+
r = e.left - t.width - s, o = e.top + (e.height - t.height) / 2;
|
|
27
27
|
break;
|
|
28
28
|
case "right":
|
|
29
|
-
r = e.right +
|
|
29
|
+
r = e.right + s, o = e.top + (e.height - t.height) / 2;
|
|
30
30
|
break;
|
|
31
31
|
}
|
|
32
|
-
r = Math.max(8, Math.min(r, window.innerWidth - t.width - 8)), o = Math.max(8, Math.min(o, window.innerHeight - t.height - 8)),
|
|
33
|
-
}, [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
},
|
|
32
|
+
r = Math.max(8, Math.min(r, window.innerWidth - t.width - 8)), o = Math.max(8, Math.min(o, window.innerHeight - t.height - 8)), E({ x: r, y: o });
|
|
33
|
+
}, [c]), g = () => {
|
|
34
|
+
B || (n.current = setTimeout(() => {
|
|
35
|
+
m(!0);
|
|
36
|
+
}, R));
|
|
37
37
|
}, p = () => {
|
|
38
|
-
|
|
38
|
+
n.current && clearTimeout(n.current), m(!1);
|
|
39
39
|
};
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
}, [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
return b(() => {
|
|
41
|
+
i && a();
|
|
42
|
+
}, [i, a]), b(() => {
|
|
43
|
+
if (!i) return;
|
|
44
|
+
const e = () => {
|
|
45
|
+
requestAnimationFrame(() => a());
|
|
46
|
+
};
|
|
47
|
+
return e(), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
48
|
+
window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
49
|
+
};
|
|
50
|
+
}, [i, a]), b(() => () => {
|
|
51
|
+
n.current && clearTimeout(n.current);
|
|
52
|
+
}, []), /* @__PURE__ */ k(L, { children: [
|
|
53
|
+
/* @__PURE__ */ d(
|
|
46
54
|
"div",
|
|
47
55
|
{
|
|
48
|
-
ref:
|
|
56
|
+
ref: l,
|
|
49
57
|
onMouseEnter: g,
|
|
50
58
|
onMouseLeave: p,
|
|
51
59
|
onFocus: g,
|
|
52
60
|
onBlur: p,
|
|
53
61
|
className: "Bear-Tooltip__trigger bear-inline-block",
|
|
54
|
-
children:
|
|
62
|
+
children: v
|
|
55
63
|
}
|
|
56
64
|
),
|
|
57
|
-
|
|
58
|
-
/* @__PURE__ */
|
|
65
|
+
i && _(
|
|
66
|
+
/* @__PURE__ */ d(
|
|
59
67
|
"div",
|
|
60
68
|
{
|
|
61
|
-
ref:
|
|
69
|
+
ref: u,
|
|
62
70
|
role: "tooltip",
|
|
63
71
|
style: {
|
|
64
|
-
left:
|
|
65
|
-
top:
|
|
72
|
+
left: f.x,
|
|
73
|
+
top: f.y
|
|
66
74
|
},
|
|
67
|
-
className:
|
|
68
|
-
"bear-fixed bear-z-[
|
|
75
|
+
className: z(
|
|
76
|
+
"bear-fixed bear-z-[11000]",
|
|
69
77
|
"Bear-Tooltip",
|
|
70
|
-
`Bear-Tooltip--${
|
|
78
|
+
`Bear-Tooltip--${c}`,
|
|
71
79
|
"bear-px-3 bear-py-2 bear-rounded-lg",
|
|
72
80
|
"bear-bg-gray-800 bear-text-white bear-text-sm",
|
|
73
81
|
"bear-border bear-border-gray-700",
|
|
74
82
|
"bear-shadow-lg",
|
|
75
83
|
"bear-animate-in bear-fade-in bear-duration-150",
|
|
76
|
-
|
|
84
|
+
T
|
|
77
85
|
),
|
|
78
|
-
children: /* @__PURE__ */
|
|
86
|
+
children: /* @__PURE__ */ d("span", { className: "Bear-Tooltip__content", children: x })
|
|
79
87
|
}
|
|
80
88
|
),
|
|
81
89
|
document.body
|
|
@@ -83,5 +91,5 @@ const z = ({
|
|
|
83
91
|
] });
|
|
84
92
|
};
|
|
85
93
|
export {
|
|
86
|
-
|
|
94
|
+
V as Tooltip
|
|
87
95
|
};
|
|
@@ -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"),l=require("react"),x=require("../../utils/cn.cjs"),Z=require("../Portal/Portal.cjs"),s=require("./TreeSelect.const.cjs"),N=require("./TreeSelect.utils.cjs"),U=1e4,I=({node:a,depth:i,selected:d,expanded:n,multiple:o,onToggleExpand:f,onSelect:p})=>{const u=a.children&&a.children.length>0,E=n.has(a.id),h=d.has(a.id);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:x.cn(s.NODE_CLASSES,h&&s.NODE_SELECTED_CLASSES,a.disabled&&s.NODE_DISABLED_CLASSES),style:{paddingLeft:i*s.INDENT_PX+12},onClick:()=>!a.disabled&&p(a.id),role:"treeitem","aria-selected":h,"aria-expanded":u?E:void 0,children:[u?e.jsx("svg",{className:x.cn(s.CHEVRON_CLASSES,E&&"bear-rotate-90"),onClick:m=>{m.stopPropagation(),f(a.id)},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}):e.jsx("span",{className:"bear-w-4 bear-mr-1"}),o&&e.jsx("span",{className:x.cn("bear-w-4 bear-h-4 bear-mr-2 bear-border bear-rounded bear-flex bear-items-center bear-justify-center bear-text-xs",h?"bear-bg-pink-500 bear-border-pink-500 bear-text-white":"bear-border-gray-300 dark:bear-border-zinc-600"),children:h&&"✓"}),a.icon&&e.jsx("span",{className:"bear-mr-1.5",children:a.icon}),e.jsx("span",{className:"bear-truncate",children:a.label})]}),u&&E&&a.children.map(m=>e.jsx(I,{node:m,depth:i+1,selected:d,expanded:n,multiple:o,onToggleExpand:f,onSelect:p},m.id))]})},J=a=>{const{nodes:i,value:d,onChange:n,multiple:o=!1,label:f,placeholder:p="Select…",disabled:u=!1,clearable:E=!0,searchable:h=!0,expandAll:m=!1,size:O="md",error:w,helperText:C,maxHeight:P=s.DEFAULT_MAX_HEIGHT,className:D,testId:M,...z}=a,[b,j]=l.useState(!1),[L,v]=l.useState(""),y=l.useRef(null),_=l.useRef(null),g=l.useRef(null),[A,B]=l.useState({top:0,left:0,width:0}),q=l.useMemo(()=>N.collectAllIds(i),[i]),[H,G]=l.useState(()=>m?q:new Set),S=l.useMemo(()=>d?new Set(Array.isArray(d)?d:[d]):new Set,[d]);l.useEffect(()=>{if(!b)return;const r=()=>{var c;const t=(c=_.current)==null?void 0:c.getBoundingClientRect();t&&B({top:t.bottom+4,left:Math.max(8,Math.min(t.left,window.innerWidth-t.width-8)),width:t.width})};return r(),window.addEventListener("resize",r),window.addEventListener("scroll",r,!0),()=>{window.removeEventListener("resize",r),window.removeEventListener("scroll",r,!0)}},[b]),l.useEffect(()=>{if(!b)return;const r=t=>{var k,T;const c=t.target;(k=y.current)!=null&&k.contains(c)||(T=g.current)!=null&&T.contains(c)||(j(!1),v(""))};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[b]);const W=l.useCallback(r=>{G(t=>{const c=new Set(t);return c.has(r)?c.delete(r):c.add(r),c})},[]),F=l.useCallback(r=>{if(o){const t=new Set(S);t.has(r)?t.delete(r):t.add(r),n==null||n(Array.from(t))}else n==null||n(r),j(!1),v("")},[o,S,n]),V=l.useCallback(()=>{n==null||n(o?[]:"")},[o,n]),R=L?N.filterNodes(i,L):i,X=()=>{if(S.size===0)return e.jsx("span",{className:"bear-text-gray-400 dark:bear-text-zinc-500",children:p});if(o)return e.jsx("div",{className:"bear-flex bear-flex-wrap bear-gap-1",children:Array.from(S).map(t=>{const c=N.findNodeById(i,t);return c?e.jsx("span",{className:s.TAG_CLASSES,children:c.label},t):null})});const r=N.findNodeById(i,Array.from(S)[0]);return(r==null?void 0:r.label)??p};return e.jsxs("div",{ref:y,className:x.cn(s.ROOT_CLASSES,D),"data-testid":M,...z,children:[f&&e.jsx("label",{className:s.LABEL_CLASSES,children:f}),e.jsxs("button",{ref:_,type:"button",disabled:u,onClick:()=>!u&&j(!b),className:x.cn(s.TRIGGER_CLASSES,s.SIZE_CLASSES[O],u&&"bear-opacity-50 bear-cursor-not-allowed"),children:[e.jsx("span",{className:"bear-flex-1 bear-text-left bear-truncate",children:X()}),e.jsxs("div",{className:"bear-flex bear-items-center bear-gap-1",children:[E&&S.size>0&&e.jsx("span",{className:"bear-text-gray-400 hover:bear-text-gray-600 bear-cursor-pointer",onClick:r=>{r.stopPropagation(),V()},children:"✕"}),e.jsx("svg",{className:x.cn("bear-w-4 bear-h-4 bear-text-gray-400 bear-transition-transform",b&&"bear-rotate-180"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),b&&e.jsx(Z.Portal,{children:e.jsxs("div",{ref:g,className:x.cn(s.DROPDOWN_CLASSES,"bear-fixed"),style:{top:A.top,left:A.left,width:A.width,zIndex:U},children:[h&&e.jsx("input",{className:s.SEARCH_CLASSES,placeholder:"Search…",value:L,onChange:r=>v(r.target.value),autoFocus:!0}),e.jsx("div",{style:{maxHeight:P},className:"bear-overflow-y-auto",role:"tree",children:R.length>0?R.map(r=>e.jsx(I,{node:r,depth:0,selected:S,expanded:H,multiple:o,onToggleExpand:W,onSelect:F},r.id)):e.jsx("div",{className:"bear-py-6 bear-text-center bear-text-sm bear-text-gray-400",children:"No results"})})]})}),w&&e.jsx("p",{className:s.ERROR_CLASSES,children:w}),!w&&C&&e.jsx("p",{className:s.HELPER_CLASSES,children:C})]})};exports.TreeSelect=J;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=280,r=20,a={sm:"bear-py-1.5 bear-px-3 bear-text-sm",md:"bear-py-2 bear-px-4 bear-text-base",lg:"bear-py-2.5 bear-px-5 bear-text-lg"},b="Bear-TreeSelect bear-relative bear-inline-block bear-w-full",t="bear-w-full bear-flex bear-items-center bear-justify-between bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-800 bear-text-gray-900 dark:bear-text-white bear-transition-colors focus:bear-ring-2 focus:bear-ring-pink-500 bear-outline-none",S="bear-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=280,r=20,a={sm:"bear-py-1.5 bear-px-3 bear-text-sm",md:"bear-py-2 bear-px-4 bear-text-base",lg:"bear-py-2.5 bear-px-5 bear-text-lg"},b="Bear-TreeSelect bear-relative bear-inline-block bear-w-full",t="bear-w-full bear-flex bear-items-center bear-justify-between bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-800 bear-text-gray-900 dark:bear-text-white bear-transition-colors focus:bear-ring-2 focus:bear-ring-pink-500 bear-outline-none",S="bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-xl bear-shadow-xl bear-overflow-hidden",n="bear-w-full bear-px-3 bear-py-2 bear-text-sm bear-bg-transparent bear-border-b bear-border-gray-200 dark:bear-border-zinc-700 bear-outline-none bear-text-gray-900 dark:bear-text-white",E="bear-flex bear-items-center bear-py-1.5 bear-px-3 bear-cursor-pointer bear-transition-colors hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-700 bear-text-sm bear-text-gray-700 dark:bear-text-zinc-300",o="bear-bg-pink-50 dark:bear-bg-pink-900/20 bear-text-pink-700 dark:bear-text-pink-300",i="bear-opacity-40 bear-cursor-not-allowed",s="bear-w-4 bear-h-4 bear-mr-1 bear-text-gray-400 dark:bear-text-zinc-500 bear-transition-transform bear-cursor-pointer",c="bear-inline-flex bear-items-center bear-gap-1 bear-bg-pink-100 dark:bear-bg-pink-900/30 bear-text-pink-700 dark:bear-text-pink-300 bear-rounded bear-px-1.5 bear-py-0.5 bear-text-xs",d="Bear-TreeSelect__label bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-zinc-300 bear-mb-1.5",x="bear-mt-1 bear-text-xs bear-text-red-500",A="bear-mt-1 bear-text-xs bear-text-gray-500 dark:bear-text-zinc-500";exports.CHEVRON_CLASSES=s;exports.DEFAULT_MAX_HEIGHT=e;exports.DROPDOWN_CLASSES=S;exports.ERROR_CLASSES=x;exports.HELPER_CLASSES=A;exports.INDENT_PX=r;exports.LABEL_CLASSES=d;exports.NODE_CLASSES=E;exports.NODE_DISABLED_CLASSES=i;exports.NODE_SELECTED_CLASSES=o;exports.ROOT_CLASSES=b;exports.SEARCH_CLASSES=n;exports.SIZE_CLASSES=a;exports.TAG_CLASSES=c;exports.TRIGGER_CLASSES=t;
|
|
@@ -7,7 +7,7 @@ export declare const SIZE_CLASSES: {
|
|
|
7
7
|
};
|
|
8
8
|
export declare const ROOT_CLASSES = "Bear-TreeSelect bear-relative bear-inline-block bear-w-full";
|
|
9
9
|
export declare const TRIGGER_CLASSES = "bear-w-full bear-flex bear-items-center bear-justify-between bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-800 bear-text-gray-900 dark:bear-text-white bear-transition-colors focus:bear-ring-2 focus:bear-ring-pink-500 bear-outline-none";
|
|
10
|
-
export declare const DROPDOWN_CLASSES = "bear-
|
|
10
|
+
export declare const DROPDOWN_CLASSES = "bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-xl bear-shadow-xl bear-overflow-hidden";
|
|
11
11
|
export declare const SEARCH_CLASSES = "bear-w-full bear-px-3 bear-py-2 bear-text-sm bear-bg-transparent bear-border-b bear-border-gray-200 dark:bear-border-zinc-700 bear-outline-none bear-text-gray-900 dark:bear-text-white";
|
|
12
12
|
export declare const NODE_CLASSES = "bear-flex bear-items-center bear-py-1.5 bear-px-3 bear-cursor-pointer bear-transition-colors hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-700 bear-text-sm bear-text-gray-700 dark:bear-text-zinc-300";
|
|
13
13
|
export declare const NODE_SELECTED_CLASSES = "bear-bg-pink-50 dark:bear-bg-pink-900/20 bear-text-pink-700 dark:bear-text-pink-300";
|
|
@@ -2,13 +2,13 @@ const e = 280, r = 20, a = {
|
|
|
2
2
|
sm: "bear-py-1.5 bear-px-3 bear-text-sm",
|
|
3
3
|
md: "bear-py-2 bear-px-4 bear-text-base",
|
|
4
4
|
lg: "bear-py-2.5 bear-px-5 bear-text-lg"
|
|
5
|
-
}, b = "Bear-TreeSelect bear-relative bear-inline-block bear-w-full", t = "bear-w-full bear-flex bear-items-center bear-justify-between bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-800 bear-text-gray-900 dark:bear-text-white bear-transition-colors focus:bear-ring-2 focus:bear-ring-pink-500 bear-outline-none", n = "bear-
|
|
5
|
+
}, b = "Bear-TreeSelect bear-relative bear-inline-block bear-w-full", t = "bear-w-full bear-flex bear-items-center bear-justify-between bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-800 bear-text-gray-900 dark:bear-text-white bear-transition-colors focus:bear-ring-2 focus:bear-ring-pink-500 bear-outline-none", n = "bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-xl bear-shadow-xl bear-overflow-hidden", o = "bear-w-full bear-px-3 bear-py-2 bear-text-sm bear-bg-transparent bear-border-b bear-border-gray-200 dark:bear-border-zinc-700 bear-outline-none bear-text-gray-900 dark:bear-text-white", i = "bear-flex bear-items-center bear-py-1.5 bear-px-3 bear-cursor-pointer bear-transition-colors hover:bear-bg-gray-50 dark:hover:bear-bg-zinc-700 bear-text-sm bear-text-gray-700 dark:bear-text-zinc-300", S = "bear-bg-pink-50 dark:bear-bg-pink-900/20 bear-text-pink-700 dark:bear-text-pink-300", s = "bear-opacity-40 bear-cursor-not-allowed", x = "bear-w-4 bear-h-4 bear-mr-1 bear-text-gray-400 dark:bear-text-zinc-500 bear-transition-transform bear-cursor-pointer", c = "bear-inline-flex bear-items-center bear-gap-1 bear-bg-pink-100 dark:bear-bg-pink-900/30 bear-text-pink-700 dark:bear-text-pink-300 bear-rounded bear-px-1.5 bear-py-0.5 bear-text-xs", d = "Bear-TreeSelect__label bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-zinc-300 bear-mb-1.5", E = "bear-mt-1 bear-text-xs bear-text-red-500", l = "bear-mt-1 bear-text-xs bear-text-gray-500 dark:bear-text-zinc-500";
|
|
6
6
|
export {
|
|
7
7
|
x as CHEVRON_CLASSES,
|
|
8
8
|
e as DEFAULT_MAX_HEIGHT,
|
|
9
9
|
n as DROPDOWN_CLASSES,
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
E as ERROR_CLASSES,
|
|
11
|
+
l as HELPER_CLASSES,
|
|
12
12
|
r as INDENT_PX,
|
|
13
13
|
d as LABEL_CLASSES,
|
|
14
14
|
i as NODE_CLASSES,
|