@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,11 +1,11 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as g, jsx as x } from "react/jsx-runtime";
|
|
2
|
+
import { useState as L, useRef as k, useCallback as B, useEffect as u } from "react";
|
|
3
3
|
import { createPortal as T } from "react-dom";
|
|
4
4
|
import { cn as c } from "../../utils/cn.js";
|
|
5
|
-
const W =
|
|
5
|
+
const W = 11e3;
|
|
6
6
|
function Z(b, t, a) {
|
|
7
|
-
const e = { position: "fixed", zIndex: W }, s = b.split("-")[0],
|
|
8
|
-
return s === "bottom" ? (e.top = t.bottom + a,
|
|
7
|
+
const e = { position: "fixed", zIndex: W }, s = b.split("-")[0], n = b.includes("start"), o = b.includes("end");
|
|
8
|
+
return s === "bottom" ? (e.top = t.bottom + a, n ? e.left = t.left : o ? e.left = t.right : e.left = t.left + t.width / 2) : s === "top" ? (e.bottom = window.innerHeight - t.top + a, n ? e.left = t.left : o ? e.left = t.right : e.left = t.left + t.width / 2) : s === "left" ? (e.right = window.innerWidth - t.left + a, n ? e.top = t.top : o ? e.bottom = window.innerHeight - t.bottom : e.top = t.top + t.height / 2) : (e.left = t.right + a, n ? e.top = t.top : o ? e.bottom = window.innerHeight - t.bottom : e.top = t.top + t.height / 2), s === "bottom" || s === "top" ? !n && !o ? e.transform = "translateX(-50%)" : o && (e.transform = "translateX(-100%)") : !n && !o ? e.transform = "translateY(-50%)" : o && (e.transform = "translateY(-100%)"), e;
|
|
9
9
|
}
|
|
10
10
|
const F = ({
|
|
11
11
|
children: b,
|
|
@@ -13,36 +13,41 @@ const F = ({
|
|
|
13
13
|
placement: a = "bottom",
|
|
14
14
|
trigger: e = "click",
|
|
15
15
|
open: s,
|
|
16
|
-
onOpenChange:
|
|
16
|
+
onOpenChange: n,
|
|
17
17
|
className: o,
|
|
18
|
-
contentClassName:
|
|
18
|
+
contentClassName: z,
|
|
19
19
|
arrow: N = !0,
|
|
20
20
|
closeOnClickOutside: p = !0,
|
|
21
21
|
closeOnEscape: m = !0,
|
|
22
|
-
offset:
|
|
22
|
+
offset: w = 8
|
|
23
23
|
}) => {
|
|
24
|
-
const [I, M] =
|
|
25
|
-
M(
|
|
26
|
-
}, [
|
|
24
|
+
const [I, M] = L(!1), [P, R] = L({}), d = k(null), h = k(null), i = s !== void 0 ? s : I, l = B((r) => {
|
|
25
|
+
M(r), n == null || n(r);
|
|
26
|
+
}, [n]);
|
|
27
27
|
u(() => {
|
|
28
|
-
if (i
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
if (!i || !d.current) return;
|
|
29
|
+
const r = () => {
|
|
30
|
+
if (!d.current) return;
|
|
31
|
+
const f = d.current.getBoundingClientRect();
|
|
32
|
+
R(Z(a, f, w));
|
|
33
|
+
};
|
|
34
|
+
return r(), window.addEventListener("resize", r), window.addEventListener("scroll", r, !0), () => {
|
|
35
|
+
window.removeEventListener("resize", r), window.removeEventListener("scroll", r, !0);
|
|
36
|
+
};
|
|
37
|
+
}, [i, a, w]), u(() => {
|
|
33
38
|
if (!p) return;
|
|
34
|
-
const
|
|
35
|
-
var
|
|
36
|
-
const
|
|
37
|
-
(
|
|
39
|
+
const r = (f) => {
|
|
40
|
+
var E, y;
|
|
41
|
+
const v = f.target;
|
|
42
|
+
(E = d.current) != null && E.contains(v) || (y = h.current) != null && y.contains(v) || l(!1);
|
|
38
43
|
};
|
|
39
|
-
return i && document.addEventListener("mousedown",
|
|
44
|
+
return i && document.addEventListener("mousedown", r), () => document.removeEventListener("mousedown", r);
|
|
40
45
|
}, [i, p, l]), u(() => {
|
|
41
46
|
if (!m) return;
|
|
42
|
-
const
|
|
43
|
-
|
|
47
|
+
const r = (f) => {
|
|
48
|
+
f.key === "Escape" && l(!1);
|
|
44
49
|
};
|
|
45
|
-
return i && document.addEventListener("keydown",
|
|
50
|
+
return i && document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
|
|
46
51
|
}, [i, m, l]);
|
|
47
52
|
const S = () => {
|
|
48
53
|
e === "click" && l(!i);
|
|
@@ -56,33 +61,33 @@ const F = ({
|
|
|
56
61
|
left: "bear-left-full bear-top-1/2 -bear-translate-y-1/2 bear-border-l-zinc-700 bear-border-y-transparent bear-border-r-transparent",
|
|
57
62
|
right: "bear-right-full bear-top-1/2 -bear-translate-y-1/2 bear-border-r-zinc-700 bear-border-y-transparent bear-border-l-transparent"
|
|
58
63
|
}, D = a.split("-")[0], Y = i && typeof document < "u" && T(
|
|
59
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ g(
|
|
60
65
|
"div",
|
|
61
66
|
{
|
|
62
|
-
ref:
|
|
67
|
+
ref: h,
|
|
63
68
|
"data-bear-popover": !0,
|
|
64
69
|
className: c(
|
|
65
70
|
"bear-bg-zinc-800 bear-border bear-border-zinc-700 bear-rounded-lg bear-shadow-xl bear-p-3",
|
|
66
|
-
|
|
71
|
+
z
|
|
67
72
|
),
|
|
68
73
|
style: P,
|
|
69
74
|
children: [
|
|
70
75
|
t,
|
|
71
|
-
N && /* @__PURE__ */
|
|
76
|
+
N && /* @__PURE__ */ x("div", { className: c("bear-absolute bear-w-0 bear-h-0 bear-border-8", j[D]) })
|
|
72
77
|
]
|
|
73
78
|
}
|
|
74
79
|
),
|
|
75
80
|
document.body
|
|
76
81
|
);
|
|
77
|
-
return /* @__PURE__ */
|
|
82
|
+
return /* @__PURE__ */ g(
|
|
78
83
|
"div",
|
|
79
84
|
{
|
|
80
|
-
ref:
|
|
85
|
+
ref: d,
|
|
81
86
|
className: c("bear-relative bear-inline-block", o),
|
|
82
87
|
onMouseEnter: H,
|
|
83
88
|
onMouseLeave: X,
|
|
84
89
|
children: [
|
|
85
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ x("div", { onClick: S, className: "bear-cursor-pointer", children: b }),
|
|
86
91
|
Y
|
|
87
92
|
]
|
|
88
93
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("react-dom"),u=({children:e,target:r,disabled:o=!1})=>o?t.jsx(t.Fragment,{children:e}):typeof document>"u"?null:n.createPortal(e,r??document.body);exports.Portal=u;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
2
|
export interface PortalProps {
|
|
3
|
-
/** Content to render in the portal */
|
|
4
3
|
children: ReactNode;
|
|
5
|
-
/** Target DOM element (defaults to document.body) */
|
|
6
4
|
target?: HTMLElement | null;
|
|
7
|
-
/** Disable portalling — render inline instead */
|
|
8
5
|
disabled?: boolean;
|
|
9
6
|
}
|
|
10
7
|
export declare const Portal: FC<PortalProps>;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const i = ({ children: t, target: e, disabled: o = !1 }) => {
|
|
5
|
-
const [r, m] = u(!1);
|
|
6
|
-
return a(() => {
|
|
7
|
-
m(!0);
|
|
8
|
-
}, []), o || !r ? /* @__PURE__ */ f(s, { children: t }) : n(t, e ?? document.body);
|
|
9
|
-
};
|
|
1
|
+
import { jsx as o, Fragment as n } from "react/jsx-runtime";
|
|
2
|
+
import { createPortal as f } from "react-dom";
|
|
3
|
+
const a = ({ children: r, target: t, disabled: e = !1 }) => e ? /* @__PURE__ */ o(n, { children: r }) : typeof document > "u" ? null : f(r, t ?? document.body);
|
|
10
4
|
export {
|
|
11
|
-
|
|
5
|
+
a as Portal
|
|
12
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),o=require("../../utils/cn.cjs"),S=require("../../hooks/useClickOutside.cjs");require("../../context/BearProvider.cjs");require("../../hooks/useBearComponent/useBearComponent.cjs");const g=require("../Icon/index.cjs"),R=require("../Portal/Portal.cjs"),E={sm:"bear-h-8 bear-text-sm bear-px-3",md:"bear-h-10 bear-text-base bear-px-4",lg:"bear-h-12 bear-text-lg bear-px-5"},P=({options:x,value:s,onChange:n,placeholder:y="Select an option",label:m,error:d,disabled:i=!1,size:j="md",fullWidth:k=!1,className:p})=>{const[a,c]=t.useState(!1),[u,C]=t.useState({top:0,left:0,width:0}),f=t.useRef(null),v=t.useRef(null),w=!!d,l=x.find(e=>e.value===s),N=t.useCallback(()=>c(!1),[]);S.useClickOutsideMultiple([f,v],N,{enabled:a});const q=e=>{n==null||n(e),c(!1)};return t.useEffect(()=>{if(!a)return;const e=()=>{var h;const b=(h=f.current)==null?void 0:h.getBoundingClientRect();b&&C({top:b.bottom+4,left:Math.max(8,Math.min(b.left,window.innerWidth-b.width-8)),width:b.width})};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[a]),r.jsxs("div",{ref:f,className:o.cn("bear-relative bear-flex bear-flex-col bear-gap-1.5",k&&"bear-w-full"),children:[m&&r.jsx("label",{className:"bear-text-sm bear-font-medium",style:{color:"var(--bear-text-secondary)"},children:m}),r.jsxs("button",{type:"button",disabled:i,onClick:()=>!i&&c(!a),className:o.cn("bear-flex bear-items-center bear-justify-between bear-w-full","bear-rounded-lg bear-border bear-text-left bear-outline-none bear-transition-all bear-duration-200","focus:bear-ring-2 focus:bear-ring-offset-2 focus:bear-ring-offset-[var(--bear-bg-primary)]",w?"bear-border-red-500 focus:bear-ring-red-500":"focus:bear-border-bear-500 focus:bear-ring-bear-500 dark:focus:bear-border-bear-500 dark:focus:bear-ring-bear-500",i&&"bear-opacity-50 bear-cursor-not-allowed",E[j],p),style:{backgroundColor:"var(--bear-bg-primary)",borderColor:w?void 0:"var(--bear-border-default)",color:l?"var(--bear-text-primary)":"var(--bear-text-muted)"},children:[r.jsx("span",{children:(l==null?void 0:l.label)||y}),r.jsx(g.ChevronDownIcon,{className:o.cn("bear-w-4 bear-h-4 bear-shrink-0 bear-transition-transform",a&&"bear-rotate-180"),style:{color:"var(--bear-text-muted)"}})]}),a&&r.jsx(R.Portal,{children:r.jsx("div",{ref:v,className:"bear-fixed bear-rounded-lg bear-border bear-shadow-lg bear-overflow-hidden",style:{backgroundColor:"var(--bear-bg-primary)",borderColor:"var(--bear-border-default)",top:u.top,left:u.left,width:u.width,zIndex:1e4},children:r.jsx("div",{className:"bear-max-h-60 bear-overflow-y-auto",children:x.map(e=>r.jsxs("button",{type:"button",disabled:e.disabled,onClick:()=>!e.disabled&&q(e.value),className:o.cn("bear-flex bear-items-center bear-justify-between bear-w-full bear-px-4 bear-py-2","bear-text-left bear-transition-colors",e.disabled&&"bear-cursor-not-allowed",e.value===s&&"bear-bg-bear-100 bear-text-bear-700 dark:bear-bg-bear-600/20 dark:bear-text-bear-300",!e.disabled&&e.value!==s&&"hover:bear-bg-[var(--bear-bg-tertiary)]"),style:e.disabled?{color:"var(--bear-text-muted)"}:e.value===s?void 0:{color:"var(--bear-text-secondary)"},children:[e.label,e.value===s&&r.jsx(g.CheckIcon,{className:"bear-w-4 bear-h-4 bear-shrink-0 bear-text-bear-600 dark:bear-text-bear-400"})]},e.value))})})}),d&&r.jsx("p",{className:"bear-text-sm bear-text-red-500",children:d})]})};exports.Select=P;
|
|
@@ -1,106 +1,126 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { cn as
|
|
4
|
-
import {
|
|
1
|
+
import { jsxs as u, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as p, useRef as g, useCallback as I, useEffect as L } from "react";
|
|
3
|
+
import { cn as o } from "../../utils/cn.js";
|
|
4
|
+
import { useClickOutsideMultiple as M } from "../../hooks/useClickOutside.js";
|
|
5
5
|
import "../../context/BearProvider.js";
|
|
6
6
|
import "../../hooks/useBearComponent/useBearComponent.js";
|
|
7
|
-
import { ChevronDownIcon as
|
|
8
|
-
|
|
7
|
+
import { ChevronDownIcon as P, CheckIcon as R } from "../Icon/index.js";
|
|
8
|
+
import { Portal as S } from "../Portal/Portal.js";
|
|
9
|
+
const B = {
|
|
9
10
|
sm: "bear-h-8 bear-text-sm bear-px-3",
|
|
10
11
|
md: "bear-h-10 bear-text-base bear-px-4",
|
|
11
12
|
lg: "bear-h-12 bear-text-lg bear-px-5"
|
|
12
|
-
},
|
|
13
|
-
options:
|
|
14
|
-
value:
|
|
15
|
-
onChange:
|
|
16
|
-
placeholder:
|
|
17
|
-
label:
|
|
18
|
-
error:
|
|
19
|
-
disabled:
|
|
20
|
-
size:
|
|
21
|
-
fullWidth:
|
|
22
|
-
className:
|
|
13
|
+
}, J = ({
|
|
14
|
+
options: m,
|
|
15
|
+
value: t,
|
|
16
|
+
onChange: s,
|
|
17
|
+
placeholder: y = "Select an option",
|
|
18
|
+
label: x,
|
|
19
|
+
error: n,
|
|
20
|
+
disabled: d = !1,
|
|
21
|
+
size: k = "md",
|
|
22
|
+
fullWidth: N = !1,
|
|
23
|
+
className: C
|
|
23
24
|
}) => {
|
|
24
|
-
const [
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
25
|
+
const [a, i] = p(!1), [c, E] = p({ top: 0, left: 0, width: 0 }), f = g(null), v = g(null), w = !!n, l = m.find((e) => e.value === t), j = I(() => i(!1), []);
|
|
26
|
+
M([f, v], j, { enabled: a });
|
|
27
|
+
const z = (e) => {
|
|
28
|
+
s == null || s(e), i(!1);
|
|
28
29
|
};
|
|
29
|
-
return
|
|
30
|
+
return L(() => {
|
|
31
|
+
if (!a) return;
|
|
32
|
+
const e = () => {
|
|
33
|
+
var h;
|
|
34
|
+
const b = (h = f.current) == null ? void 0 : h.getBoundingClientRect();
|
|
35
|
+
b && E({
|
|
36
|
+
top: b.bottom + 4,
|
|
37
|
+
left: Math.max(8, Math.min(b.left, window.innerWidth - b.width - 8)),
|
|
38
|
+
width: b.width
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
return e(), window.addEventListener("resize", e), window.addEventListener("scroll", e, !0), () => {
|
|
42
|
+
window.removeEventListener("resize", e), window.removeEventListener("scroll", e, !0);
|
|
43
|
+
};
|
|
44
|
+
}, [a]), /* @__PURE__ */ u(
|
|
30
45
|
"div",
|
|
31
46
|
{
|
|
32
|
-
ref:
|
|
33
|
-
className:
|
|
47
|
+
ref: f,
|
|
48
|
+
className: o("bear-relative bear-flex bear-flex-col bear-gap-1.5", N && "bear-w-full"),
|
|
34
49
|
children: [
|
|
35
|
-
|
|
36
|
-
/* @__PURE__ */
|
|
50
|
+
x && /* @__PURE__ */ r("label", { className: "bear-text-sm bear-font-medium", style: { color: "var(--bear-text-secondary)" }, children: x }),
|
|
51
|
+
/* @__PURE__ */ u(
|
|
37
52
|
"button",
|
|
38
53
|
{
|
|
39
54
|
type: "button",
|
|
40
|
-
disabled:
|
|
41
|
-
onClick: () => !
|
|
42
|
-
className:
|
|
55
|
+
disabled: d,
|
|
56
|
+
onClick: () => !d && i(!a),
|
|
57
|
+
className: o(
|
|
43
58
|
"bear-flex bear-items-center bear-justify-between bear-w-full",
|
|
44
59
|
"bear-rounded-lg bear-border bear-text-left bear-outline-none bear-transition-all bear-duration-200",
|
|
45
60
|
"focus:bear-ring-2 focus:bear-ring-offset-2 focus:bear-ring-offset-[var(--bear-bg-primary)]",
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
61
|
+
w ? "bear-border-red-500 focus:bear-ring-red-500" : "focus:bear-border-bear-500 focus:bear-ring-bear-500 dark:focus:bear-border-bear-500 dark:focus:bear-ring-bear-500",
|
|
62
|
+
d && "bear-opacity-50 bear-cursor-not-allowed",
|
|
63
|
+
B[k],
|
|
64
|
+
C
|
|
50
65
|
),
|
|
51
66
|
style: {
|
|
52
67
|
backgroundColor: "var(--bear-bg-primary)",
|
|
53
|
-
borderColor:
|
|
54
|
-
color:
|
|
68
|
+
borderColor: w ? void 0 : "var(--bear-border-default)",
|
|
69
|
+
color: l ? "var(--bear-text-primary)" : "var(--bear-text-muted)"
|
|
55
70
|
},
|
|
56
71
|
children: [
|
|
57
|
-
/* @__PURE__ */ r("span", { children: (
|
|
72
|
+
/* @__PURE__ */ r("span", { children: (l == null ? void 0 : l.label) || y }),
|
|
58
73
|
/* @__PURE__ */ r(
|
|
59
|
-
|
|
74
|
+
P,
|
|
60
75
|
{
|
|
61
|
-
className:
|
|
76
|
+
className: o("bear-w-4 bear-h-4 bear-shrink-0 bear-transition-transform", a && "bear-rotate-180"),
|
|
62
77
|
style: { color: "var(--bear-text-muted)" }
|
|
63
78
|
}
|
|
64
79
|
)
|
|
65
80
|
]
|
|
66
81
|
}
|
|
67
82
|
),
|
|
68
|
-
|
|
83
|
+
a && /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(
|
|
69
84
|
"div",
|
|
70
85
|
{
|
|
71
|
-
|
|
86
|
+
ref: v,
|
|
87
|
+
className: "bear-fixed bear-rounded-lg bear-border bear-shadow-lg bear-overflow-hidden",
|
|
72
88
|
style: {
|
|
73
89
|
backgroundColor: "var(--bear-bg-primary)",
|
|
74
|
-
borderColor: "var(--bear-border-default)"
|
|
90
|
+
borderColor: "var(--bear-border-default)",
|
|
91
|
+
top: c.top,
|
|
92
|
+
left: c.left,
|
|
93
|
+
width: c.width,
|
|
94
|
+
zIndex: 1e4
|
|
75
95
|
},
|
|
76
|
-
children: /* @__PURE__ */ r("div", { className: "bear-max-h-60 bear-overflow-y-auto", children:
|
|
96
|
+
children: /* @__PURE__ */ r("div", { className: "bear-max-h-60 bear-overflow-y-auto", children: m.map((e) => /* @__PURE__ */ u(
|
|
77
97
|
"button",
|
|
78
98
|
{
|
|
79
99
|
type: "button",
|
|
80
100
|
disabled: e.disabled,
|
|
81
|
-
onClick: () => !e.disabled &&
|
|
82
|
-
className:
|
|
101
|
+
onClick: () => !e.disabled && z(e.value),
|
|
102
|
+
className: o(
|
|
83
103
|
"bear-flex bear-items-center bear-justify-between bear-w-full bear-px-4 bear-py-2",
|
|
84
104
|
"bear-text-left bear-transition-colors",
|
|
85
105
|
e.disabled && "bear-cursor-not-allowed",
|
|
86
|
-
e.value ===
|
|
87
|
-
!e.disabled && e.value !==
|
|
106
|
+
e.value === t && "bear-bg-bear-100 bear-text-bear-700 dark:bear-bg-bear-600/20 dark:bear-text-bear-300",
|
|
107
|
+
!e.disabled && e.value !== t && "hover:bear-bg-[var(--bear-bg-tertiary)]"
|
|
88
108
|
),
|
|
89
|
-
style: e.disabled ? { color: "var(--bear-text-muted)" } : e.value ===
|
|
109
|
+
style: e.disabled ? { color: "var(--bear-text-muted)" } : e.value === t ? void 0 : { color: "var(--bear-text-secondary)" },
|
|
90
110
|
children: [
|
|
91
111
|
e.label,
|
|
92
|
-
e.value ===
|
|
112
|
+
e.value === t && /* @__PURE__ */ r(R, { className: "bear-w-4 bear-h-4 bear-shrink-0 bear-text-bear-600 dark:bear-text-bear-400" })
|
|
93
113
|
]
|
|
94
114
|
},
|
|
95
115
|
e.value
|
|
96
116
|
)) })
|
|
97
117
|
}
|
|
98
|
-
),
|
|
99
|
-
|
|
118
|
+
) }),
|
|
119
|
+
n && /* @__PURE__ */ r("p", { className: "bear-text-sm bear-text-red-500", children: n })
|
|
100
120
|
]
|
|
101
121
|
}
|
|
102
122
|
);
|
|
103
123
|
};
|
|
104
124
|
export {
|
|
105
|
-
|
|
125
|
+
J as Select
|
|
106
126
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),d=require("react"),J=require("../../context/BearProvider.cjs"),Q=require("../../utils/maxVisible.utils.cjs"),c=require("../../utils/cn.cjs"),F=require("../Typography/Typography.cjs"),ee=require("../Dropdown/Dropdown.cjs"),re=require("../Icon/index.cjs"),r=require("./Stepper.const.cjs"),m=require("./Stepper.utils.cjs"),ne=1200,te=16,se=640,H=3,oe=()=>n.jsx("svg",{width:r.CHECK_ICON_SIZE,height:r.CHECK_ICON_SIZE,viewBox:r.CHECK_ICON_VIEWBOX,fill:"none",stroke:"currentColor",strokeWidth:"3",children:n.jsx("polyline",{points:r.CHECK_ICON_POINTS})}),ie=()=>n.jsxs("svg",{width:r.ERROR_ICON_SIZE,height:r.ERROR_ICON_SIZE,viewBox:r.ERROR_ICON_VIEWBOX,fill:"none",stroke:"currentColor",strokeWidth:"3",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),U=d.forwardRef(({steps:o,activeStep:_,onStepClick:S,orientation:W=r.DEFAULT_ORIENTATION,size:A=r.DEFAULT_SIZE,showNumbers:D=r.DEFAULT_SHOW_NUMBERS,clickable:g=r.DEFAULT_CLICKABLE,showConnectors:M=r.DEFAULT_SHOW_CONNECTORS,connectorStyle:R=r.DEFAULT_CONNECTOR_STYLE,alternativeLabel:L=r.DEFAULT_ALTERNATIVE_LABEL,completedIcon:V,errorIcon:q,labelTypographyProps:Z,descriptionTypographyProps:z,maxVisibleSteps:C,testId:K,className:k,...X},$)=>{const f=J.useBearThemeOptional(),[O,G]=d.useState(()=>typeof window<"u"?window.innerWidth:ne);d.useEffect(()=>{const e=()=>G(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const h=d.useMemo(()=>{if(C!=null)return Q.resolveMaxVisible(C,{width:O,theme:f});if(O<se&&o.length>H)return H},[C,O,f,o.length]),E=W==="horizontal",p=r.STEP_INDICATOR_SIZES[A],v=r.STEP_LABEL_SIZES[A],T=E&&h!=null&&o.length>h,{visibleIndices:j,leftHidden:x,rightHidden:N}=d.useMemo(()=>{if(!T||h==null)return{visibleIndices:o.map((a,I)=>I),leftHidden:[],rightHidden:[]};const e=h,t=Math.floor(e/2),s=Math.max(0,Math.min(_-t,o.length-e)),i=Array.from({length:e},(a,I)=>s+I),l=[],y=[];for(let a=0;a<s;a++)l.push(a);for(let a=s+e;a<o.length;a++)y.push(a);return{visibleIndices:i,leftHidden:l,rightHidden:y}},[T,h,o,_]),b=(e,t,s)=>{const i=r.STEP_STATUS_CLASSES[s],l=m.resolveIndicatorContent(e,t,s,D,V,q,n.jsx(oe,{}),n.jsx(ie,{}));return n.jsx("div",{className:c.cn(r.STEP_INDICATOR_BASE,p,i.indicator,g&&!e.disabled&&"cursor-pointer hover:scale-105"),onClick:()=>{g&&!e.disabled&&S&&S(t)},children:l})},u=(e,t)=>{if(!M||t)return null;const s=e<_;return E?n.jsx("div",{className:c.cn("Bear-Stepper__connector flex-1 self-center mx-1","h-0.5 min-w-[12px] transition-colors",s?r.CONNECTOR_STATUS.completed:r.CONNECTOR_STATUS.pending,R==="dashed"&&"border-t-2 border-dashed bg-transparent")}):n.jsx("div",{className:c.cn(r.CONNECTOR_BASE,r.CONNECTOR_VERTICAL,s?r.CONNECTOR_STATUS.completed:r.CONNECTOR_STATUS.pending,R==="dashed"&&"border-t-2 border-dashed bg-transparent")})},w=(e,t)=>{const s=r.STEP_STATUS_CLASSES[t],i={...Z,...e.labelTypographyProps},l={...z,...e.descriptionTypographyProps};return n.jsxs(n.Fragment,{children:[n.jsx(F.Typography,{variant:"body2",...i,className:c.cn(r.STEP_LABEL_BASE,v.label,s.label,i==null?void 0:i.className),children:e.label}),e.description&&n.jsx(F.Typography,{variant:"caption",...l,className:c.cn(r.STEP_DESCRIPTION_CLASSES,v.description,l==null?void 0:l.className),children:e.description})]})},B=(e,t)=>{const s=m.resolveStepStatus(e,t,_);return n.jsxs("div",{className:c.cn("Bear-Stepper__content flex shrink-0",L?"flex-col items-center":"items-center gap-2"),children:[b(e,t,s),n.jsx("div",{className:c.cn(L&&"text-center mt-2","whitespace-nowrap"),children:w(e,s)})]})},Y=(e,t)=>{const s=m.resolveStepStatus(e,t,_);return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex-shrink-0 mr-4",children:b(e,t,s)}),n.jsxs("div",{className:"flex-1 pt-0.5",children:[w(e,s),e.content&&s==="active"&&n.jsx("div",{className:"mt-4",children:e.content})]})]})},P=(e,t)=>n.jsx("div",{className:"Bear-Stepper__overflow shrink-0",children:n.jsx(ee.Dropdown,{placement:"bottom-start",closeOnSelect:!0,trigger:n.jsx("button",{type:"button",className:c.cn(r.STEP_INDICATOR_BASE,p,r.STEP_STATUS_CLASSES.pending.indicator,"bear-cursor-pointer bear-border-0"),"aria-label":t==="left"?r.OVERFLOW_LEFT_LABEL:r.OVERFLOW_RIGHT_LABEL,children:n.jsx(re.BearIcons.MoreHorizIcon,{size:te})}),items:e.map(s=>({key:`step-${s}`,label:o[s].label,disabled:o[s].disabled,onClick:()=>{o[s].disabled||S==null||S(s)}}))})},`overflow-${t}`);return n.jsxs("div",{ref:$,className:c.cn(r.STEPPER_BASE_CLASSES,E?r.STEPPER_HORIZONTAL_CLASSES:r.STEPPER_VERTICAL_CLASSES,k),"data-testid":K,...X,children:[E&&!T&&o.map((e,t)=>n.jsxs(d.Fragment,{children:[B(e,t),u(t,t===o.length-1)]},t)),E&&T&&n.jsxs(n.Fragment,{children:[x.length>0&&n.jsxs(n.Fragment,{children:[P(x,"left"),u(-1,!1)]}),j.map((e,t)=>{const s=o[e],i=t===j.length-1&&N.length===0;return n.jsxs(d.Fragment,{children:[B(s,e),u(e,i)]},e)}),N.length>0&&P(N,"right")]}),!E&&o.map((e,t)=>n.jsxs("div",{className:c.cn("Bear-Stepper__step",r.STEP_WRAPPER_VERTICAL),children:[Y(e,t),u(t,t===o.length-1)]},t))]})});U.displayName="Stepper";exports.Stepper=U;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t="Bear-Stepper",
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _="horizontal",S="md",T=!0,e=!0,L="solid",A=!1,O=!1,o="Previous",s="Next",C="Complete",n=(E,t)=>`Step ${E} of ${t}`,R=0,r=1,I=1,c="Previous steps",N="More steps",a=16,l="0 0 24 24",i="20 6 9 17 4 12",P=16,F="0 0 24 24",B="Bear-Stepper",d="flex w-full items-center",x="flex flex-col",D="relative flex items-start pb-8 last:pb-0",U="Bear-Stepper__indicator flex items-center justify-center rounded-full font-medium transition-all",g={sm:"w-6 h-6 text-xs",md:"w-8 h-8 text-sm",lg:"w-10 h-10 text-base"},p={pending:{indicator:"bg-gray-200 dark:bg-zinc-700 text-gray-500 dark:text-gray-400",label:"text-gray-500 dark:text-gray-400"},active:{indicator:"bg-pink-500 text-white shadow-lg shadow-pink-500/30",label:"text-gray-900 dark:text-white font-medium"},completed:{indicator:"bg-green-500 text-white",label:"text-gray-700 dark:text-gray-300"},error:{indicator:"bg-red-500 text-white",label:"text-red-500 dark:text-red-400"}},b="Bear-Stepper__connector absolute transition-colors",m="left-4 top-8 w-0.5 h-full -translate-x-1/2",V={pending:"bg-gray-200 dark:bg-zinc-700",completed:"bg-green-500"},f="Bear-Stepper__label transition-colors",u={sm:{label:"text-xs",description:"text-[10px]"},md:{label:"text-sm",description:"text-xs"},lg:{label:"text-base",description:"text-sm"}},y="text-gray-500 dark:text-gray-400 mt-0.5";exports.CHECK_ICON_POINTS=i;exports.CHECK_ICON_SIZE=a;exports.CHECK_ICON_VIEWBOX=l;exports.CONNECTOR_BASE=b;exports.CONNECTOR_STATUS=V;exports.CONNECTOR_VERTICAL=m;exports.DEFAULT_ALTERNATIVE_LABEL=O;exports.DEFAULT_CLICKABLE=A;exports.DEFAULT_COMPLETE_LABEL=C;exports.DEFAULT_CONNECTOR_STYLE=L;exports.DEFAULT_INDICATOR_FORMAT=n;exports.DEFAULT_NEXT_LABEL=s;exports.DEFAULT_ORIENTATION=_;exports.DEFAULT_PREV_LABEL=o;exports.DEFAULT_SHOW_CONNECTORS=e;exports.DEFAULT_SHOW_NUMBERS=T;exports.DEFAULT_SIZE=S;exports.ERROR_ICON_SIZE=P;exports.ERROR_ICON_VIEWBOX=F;exports.FIRST_STEP_INDEX=R;exports.LAST_STEP_OFFSET=I;exports.OVERFLOW_LEFT_LABEL=c;exports.OVERFLOW_RIGHT_LABEL=N;exports.STEPPER_BASE_CLASSES=B;exports.STEPPER_HORIZONTAL_CLASSES=d;exports.STEPPER_VERTICAL_CLASSES=x;exports.STEP_DESCRIPTION_CLASSES=y;exports.STEP_INDICATOR_BASE=U;exports.STEP_INDICATOR_SIZES=g;exports.STEP_LABEL_BASE=f;exports.STEP_LABEL_SIZES=u;exports.STEP_NUMBER_OFFSET=r;exports.STEP_STATUS_CLASSES=p;exports.STEP_WRAPPER_VERTICAL=D;
|
|
@@ -1,8 +1,30 @@
|
|
|
1
|
-
import { StepperSize, StepStatus } from './Stepper.types';
|
|
1
|
+
import { StepperSize, StepStatus, StepperOrientation } from './Stepper.types';
|
|
2
|
+
export declare const DEFAULT_ORIENTATION: StepperOrientation;
|
|
3
|
+
export declare const DEFAULT_SIZE: StepperSize;
|
|
4
|
+
export declare const DEFAULT_SHOW_NUMBERS = true;
|
|
5
|
+
export declare const DEFAULT_SHOW_CONNECTORS = true;
|
|
6
|
+
export declare const DEFAULT_CONNECTOR_STYLE: "solid";
|
|
7
|
+
export declare const DEFAULT_CLICKABLE = false;
|
|
8
|
+
export declare const DEFAULT_ALTERNATIVE_LABEL = false;
|
|
9
|
+
export declare const DEFAULT_PREV_LABEL = "Previous";
|
|
10
|
+
export declare const DEFAULT_NEXT_LABEL = "Next";
|
|
11
|
+
export declare const DEFAULT_COMPLETE_LABEL = "Complete";
|
|
12
|
+
export declare const DEFAULT_INDICATOR_FORMAT: (current: number, total: number) => string;
|
|
13
|
+
export declare const FIRST_STEP_INDEX = 0;
|
|
14
|
+
export declare const STEP_NUMBER_OFFSET = 1;
|
|
15
|
+
export declare const LAST_STEP_OFFSET = 1;
|
|
16
|
+
export declare const OVERFLOW_LEFT_LABEL = "Previous steps";
|
|
17
|
+
export declare const OVERFLOW_RIGHT_LABEL = "More steps";
|
|
18
|
+
export declare const CHECK_ICON_SIZE = 16;
|
|
19
|
+
export declare const CHECK_ICON_VIEWBOX = "0 0 24 24";
|
|
20
|
+
export declare const CHECK_ICON_POINTS = "20 6 9 17 4 12";
|
|
21
|
+
export declare const ERROR_ICON_SIZE = 16;
|
|
22
|
+
export declare const ERROR_ICON_VIEWBOX = "0 0 24 24";
|
|
2
23
|
export declare const STEPPER_BASE_CLASSES = "Bear-Stepper";
|
|
3
|
-
export declare const STEPPER_HORIZONTAL_CLASSES = "flex items-
|
|
24
|
+
export declare const STEPPER_HORIZONTAL_CLASSES = "flex w-full items-center";
|
|
4
25
|
export declare const STEPPER_VERTICAL_CLASSES = "flex flex-col";
|
|
5
|
-
export declare const STEP_WRAPPER_HORIZONTAL = "flex-1
|
|
26
|
+
export declare const STEP_WRAPPER_HORIZONTAL = "relative shrink-0 flex-1 min-w-[80px]";
|
|
27
|
+
export declare const STEP_WRAPPER_HORIZONTAL_WINDOW = "relative min-w-[5rem] max-w-[9rem] shrink-0";
|
|
6
28
|
export declare const STEP_WRAPPER_VERTICAL = "relative flex items-start pb-8 last:pb-0";
|
|
7
29
|
export declare const STEP_INDICATOR_BASE = "Bear-Stepper__indicator flex items-center justify-center rounded-full font-medium transition-all";
|
|
8
30
|
export declare const STEP_INDICATOR_SIZES: Record<StepperSize, string>;
|
|
@@ -11,7 +33,7 @@ export declare const STEP_STATUS_CLASSES: Record<StepStatus, {
|
|
|
11
33
|
label: string;
|
|
12
34
|
}>;
|
|
13
35
|
export declare const CONNECTOR_BASE = "Bear-Stepper__connector absolute transition-colors";
|
|
14
|
-
export declare const CONNECTOR_HORIZONTAL = "top-4
|
|
36
|
+
export declare const CONNECTOR_HORIZONTAL = "top-4 h-0.5 -translate-y-1/2";
|
|
15
37
|
export declare const CONNECTOR_VERTICAL = "left-4 top-8 w-0.5 h-full -translate-x-1/2";
|
|
16
38
|
export declare const CONNECTOR_STYLES: {
|
|
17
39
|
solid: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const
|
|
1
|
+
const E = "horizontal", o = "md", s = !0, n = !0, _ = "solid", r = !1, S = !1, T = "Previous", c = "Next", a = "Complete", l = (t, e) => `Step ${t} of ${e}`, L = 0, i = 1, A = 1, O = "Previous steps", C = "More steps", x = 16, R = "0 0 24 24", d = "20 6 9 17 4 12", I = 16, N = "0 0 24 24", g = "Bear-Stepper", p = "flex w-full items-center", P = "flex flex-col", b = "relative flex items-start pb-8 last:pb-0", B = "Bear-Stepper__indicator flex items-center justify-center rounded-full font-medium transition-all", F = {
|
|
2
2
|
sm: "w-6 h-6 text-xs",
|
|
3
3
|
md: "w-8 h-8 text-sm",
|
|
4
4
|
lg: "w-10 h-10 text-base"
|
|
5
|
-
},
|
|
5
|
+
}, m = {
|
|
6
6
|
pending: {
|
|
7
7
|
indicator: "bg-gray-200 dark:bg-zinc-700 text-gray-500 dark:text-gray-400",
|
|
8
8
|
label: "text-gray-500 dark:text-gray-400"
|
|
@@ -19,28 +19,47 @@ const t = "Bear-Stepper", e = "flex items-start", r = "flex flex-col", a = "flex
|
|
|
19
19
|
indicator: "bg-red-500 text-white",
|
|
20
20
|
label: "text-red-500 dark:text-red-400"
|
|
21
21
|
}
|
|
22
|
-
},
|
|
22
|
+
}, D = "Bear-Stepper__connector absolute transition-colors", f = "left-4 top-8 w-0.5 h-full -translate-x-1/2", U = {
|
|
23
23
|
pending: "bg-gray-200 dark:bg-zinc-700",
|
|
24
24
|
completed: "bg-green-500"
|
|
25
|
-
},
|
|
25
|
+
}, u = "Bear-Stepper__label transition-colors", y = {
|
|
26
26
|
sm: { label: "text-xs", description: "text-[10px]" },
|
|
27
27
|
md: { label: "text-sm", description: "text-xs" },
|
|
28
28
|
lg: { label: "text-base", description: "text-sm" }
|
|
29
|
-
},
|
|
29
|
+
}, h = "text-gray-500 dark:text-gray-400 mt-0.5";
|
|
30
30
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
n as
|
|
31
|
+
d as CHECK_ICON_POINTS,
|
|
32
|
+
x as CHECK_ICON_SIZE,
|
|
33
|
+
R as CHECK_ICON_VIEWBOX,
|
|
34
|
+
D as CONNECTOR_BASE,
|
|
35
|
+
U as CONNECTOR_STATUS,
|
|
36
|
+
f as CONNECTOR_VERTICAL,
|
|
37
|
+
S as DEFAULT_ALTERNATIVE_LABEL,
|
|
38
|
+
r as DEFAULT_CLICKABLE,
|
|
39
|
+
a as DEFAULT_COMPLETE_LABEL,
|
|
40
|
+
_ as DEFAULT_CONNECTOR_STYLE,
|
|
41
|
+
l as DEFAULT_INDICATOR_FORMAT,
|
|
42
|
+
c as DEFAULT_NEXT_LABEL,
|
|
43
|
+
E as DEFAULT_ORIENTATION,
|
|
44
|
+
T as DEFAULT_PREV_LABEL,
|
|
45
|
+
n as DEFAULT_SHOW_CONNECTORS,
|
|
46
|
+
s as DEFAULT_SHOW_NUMBERS,
|
|
47
|
+
o as DEFAULT_SIZE,
|
|
48
|
+
I as ERROR_ICON_SIZE,
|
|
49
|
+
N as ERROR_ICON_VIEWBOX,
|
|
50
|
+
L as FIRST_STEP_INDEX,
|
|
51
|
+
A as LAST_STEP_OFFSET,
|
|
52
|
+
O as OVERFLOW_LEFT_LABEL,
|
|
53
|
+
C as OVERFLOW_RIGHT_LABEL,
|
|
54
|
+
g as STEPPER_BASE_CLASSES,
|
|
55
|
+
p as STEPPER_HORIZONTAL_CLASSES,
|
|
56
|
+
P as STEPPER_VERTICAL_CLASSES,
|
|
57
|
+
h as STEP_DESCRIPTION_CLASSES,
|
|
58
|
+
B as STEP_INDICATOR_BASE,
|
|
59
|
+
F as STEP_INDICATOR_SIZES,
|
|
60
|
+
u as STEP_LABEL_BASE,
|
|
61
|
+
y as STEP_LABEL_SIZES,
|
|
62
|
+
i as STEP_NUMBER_OFFSET,
|
|
63
|
+
m as STEP_STATUS_CLASSES,
|
|
64
|
+
b as STEP_WRAPPER_VERTICAL
|
|
46
65
|
};
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
export declare const Stepper: import('react').ForwardRefExoticComponent<StepperProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
6
|
-
/**
|
|
7
|
-
* StepperControls - Navigation buttons for stepper
|
|
8
|
-
*/
|
|
9
|
-
export declare const StepperControls: import('react').ForwardRefExoticComponent<StepperControlsProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
10
|
-
export default Stepper;
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { StepperProps } from './Stepper.types';
|
|
3
|
+
export declare const Stepper: React.ForwardRefExoticComponent<StepperProps & React.RefAttributes<HTMLDivElement>>;
|