@forgedevstack/bear 1.1.4 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/dist/components/Anchor/Anchor.cjs +1 -1
- package/dist/components/Anchor/Anchor.js +37 -45
- package/dist/components/Anchor/Anchor.utils.cjs +1 -0
- package/dist/components/Anchor/Anchor.utils.d.ts +2 -0
- package/dist/components/Anchor/Anchor.utils.js +12 -0
- package/dist/components/Autocomplete/Autocomplete.cjs +1 -1
- package/dist/components/Autocomplete/Autocomplete.js +60 -67
- package/dist/components/Autocomplete/Autocomplete.utils.cjs +1 -0
- package/dist/components/Autocomplete/Autocomplete.utils.d.ts +2 -0
- package/dist/components/Autocomplete/Autocomplete.utils.js +12 -0
- package/dist/components/BackTop/BackTop.cjs +1 -1
- package/dist/components/BackTop/BackTop.js +10 -11
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.constants.cjs +2 -2
- package/dist/components/Button/Button.constants.d.ts +1 -0
- package/dist/components/Button/Button.constants.js +12 -5
- package/dist/components/Button/Button.d.ts +0 -27
- package/dist/components/Button/Button.js +93 -105
- package/dist/components/Button/Button.types.d.ts +1 -0
- package/dist/components/Button/Button.utils.cjs +1 -0
- package/dist/components/Button/Button.utils.d.ts +2 -0
- package/dist/components/Button/Button.utils.js +5 -0
- package/dist/components/Button/useSpotlight.cjs +1 -0
- package/dist/components/Button/useSpotlight.d.ts +21 -0
- package/dist/components/Button/useSpotlight.js +28 -0
- package/dist/components/Chart/Chart.cjs +1 -1
- package/dist/components/Chart/Chart.const.cjs +1 -0
- package/dist/components/Chart/Chart.const.js +21 -0
- package/dist/components/Chart/Chart.js +55 -71
- package/dist/components/Chart/Chart.utils.cjs +1 -0
- package/dist/components/Chart/Chart.utils.js +5 -0
- package/dist/components/Confetti/Confetti.cjs +1 -1
- package/dist/components/Confetti/Confetti.js +37 -34
- package/dist/components/ContextMenu/ContextMenu.cjs +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +31 -30
- package/dist/components/ContextMenu/ContextMenu.utils.cjs +1 -0
- package/dist/components/ContextMenu/ContextMenu.utils.d.ts +5 -0
- package/dist/components/ContextMenu/ContextMenu.utils.js +4 -0
- package/dist/components/CountdownTimer/CountdownTimer.cjs +1 -1
- package/dist/components/CountdownTimer/CountdownTimer.js +62 -71
- package/dist/components/CountdownTimer/CountdownTimer.utils.cjs +1 -0
- package/dist/components/CountdownTimer/CountdownTimer.utils.d.ts +3 -0
- package/dist/components/CountdownTimer/CountdownTimer.utils.js +16 -0
- package/dist/components/Dock/Dock.cjs +1 -1
- package/dist/components/Dock/Dock.js +38 -43
- package/dist/components/Dock/Dock.utils.cjs +1 -0
- package/dist/components/Dock/Dock.utils.d.ts +1 -0
- package/dist/components/Dock/Dock.utils.js +10 -0
- package/dist/components/Dropdown/Dropdown.cjs +1 -1
- package/dist/components/Dropdown/Dropdown.js +59 -60
- package/dist/components/FileTree/FileTree.cjs +1 -1
- package/dist/components/FileTree/FileTree.js +20 -32
- package/dist/components/FileTree/FileTree.utils.cjs +1 -0
- package/dist/components/FileTree/FileTree.utils.d.ts +4 -0
- package/dist/components/FileTree/FileTree.utils.js +15 -0
- package/dist/components/GradientText/GradientText.cjs +1 -1
- package/dist/components/GradientText/GradientText.js +27 -29
- package/dist/components/Icon/icons/bear.cjs +1 -0
- package/dist/components/Icon/icons/bear.d.ts +12 -0
- package/dist/components/Icon/icons/bear.js +47 -0
- package/dist/components/Icon/index.cjs +1 -1
- package/dist/components/Icon/index.d.ts +18 -0
- package/dist/components/Icon/index.js +17 -15
- package/dist/components/InfiniteScroll/InfiniteScroll.cjs +1 -1
- package/dist/components/InfiniteScroll/InfiniteScroll.const.cjs +1 -1
- package/dist/components/InfiniteScroll/InfiniteScroll.const.js +6 -7
- package/dist/components/InfiniteScroll/InfiniteScroll.js +41 -41
- package/dist/components/MentionsInput/MentionsInput.cjs +1 -1
- package/dist/components/MentionsInput/MentionsInput.js +64 -68
- package/dist/components/MentionsInput/MentionsInput.utils.cjs +1 -0
- package/dist/components/MentionsInput/MentionsInput.utils.d.ts +2 -0
- package/dist/components/MentionsInput/MentionsInput.utils.js +9 -0
- package/dist/components/PageNav/PageNav.cjs +1 -0
- package/dist/components/PageNav/PageNav.const.cjs +1 -0
- package/dist/components/PageNav/PageNav.const.d.ts +22 -0
- package/dist/components/PageNav/PageNav.const.js +42 -0
- package/dist/components/PageNav/PageNav.d.ts +3 -0
- package/dist/components/PageNav/PageNav.js +81 -0
- package/dist/components/PageNav/PageNav.types.d.ts +17 -0
- package/dist/components/PageNav/index.d.ts +2 -0
- package/dist/components/Progress/Progress.cjs +1 -1
- package/dist/components/Progress/Progress.js +6 -6
- package/dist/components/PropsPlayground/PropsPlayground.cjs +1 -0
- package/dist/components/PropsPlayground/PropsPlayground.const.cjs +1 -0
- package/dist/components/PropsPlayground/PropsPlayground.const.d.ts +11 -0
- package/dist/components/PropsPlayground/PropsPlayground.const.js +23 -0
- package/dist/components/PropsPlayground/PropsPlayground.d.ts +3 -0
- package/dist/components/PropsPlayground/PropsPlayground.js +221 -0
- package/dist/components/PropsPlayground/PropsPlayground.types.d.ts +29 -0
- package/dist/components/PropsPlayground/PropsPlayground.utils.cjs +1 -0
- package/dist/components/PropsPlayground/PropsPlayground.utils.d.ts +2 -0
- package/dist/components/PropsPlayground/PropsPlayground.utils.js +9 -0
- package/dist/components/PropsPlayground/index.d.ts +2 -0
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.js +28 -30
- package/dist/components/SignPad/SignPad.cjs +1 -1
- package/dist/components/SignPad/SignPad.js +24 -24
- package/dist/components/Skeleton/Skeleton.cjs +1 -1
- package/dist/components/Skeleton/Skeleton.js +89 -94
- package/dist/components/Skeleton/Skeleton.utils.cjs +1 -0
- package/dist/components/Skeleton/Skeleton.utils.d.ts +1 -0
- package/dist/components/Skeleton/Skeleton.utils.js +10 -0
- package/dist/components/SliderRange/SliderRange.cjs +1 -1
- package/dist/components/SliderRange/SliderRange.js +61 -63
- package/dist/components/SliderRange/SliderRange.utils.cjs +1 -0
- package/dist/components/SliderRange/SliderRange.utils.d.ts +1 -0
- package/dist/components/SliderRange/SliderRange.utils.js +7 -0
- package/dist/components/Spotlight/Spotlight.cjs +1 -1
- package/dist/components/Spotlight/Spotlight.js +62 -73
- package/dist/components/Spotlight/Spotlight.utils.cjs +1 -0
- package/dist/components/Spotlight/Spotlight.utils.d.ts +3 -0
- package/dist/components/Spotlight/Spotlight.utils.js +18 -0
- package/dist/components/Tabs/Tabs.cjs +1 -1
- package/dist/components/Tabs/Tabs.js +39 -38
- package/dist/components/Tabs/Tabs.types.d.ts +3 -1
- package/dist/components/Toast/Toast.cjs +1 -1
- package/dist/components/Toast/Toast.js +18 -17
- package/dist/components/Toast/Toast.utils.cjs +1 -0
- package/dist/components/Toast/Toast.utils.d.ts +1 -0
- package/dist/components/Toast/Toast.utils.js +4 -0
- package/dist/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.js +10 -11
- package/dist/components/Tour/Tour.cjs +1 -1
- package/dist/components/Tour/Tour.js +1 -2
- package/dist/components/VirtualList/VirtualList.cjs +1 -1
- package/dist/components/VirtualList/VirtualList.js +38 -43
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +66 -62
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +60 -58
- package/dist/hooks/useResizeObserver/index.d.ts +2 -0
- package/dist/hooks/useResizeObserver/useResizeObserver.cjs +1 -0
- package/dist/hooks/useResizeObserver/useResizeObserver.d.ts +3 -0
- package/dist/hooks/useResizeObserver/useResizeObserver.js +20 -0
- package/dist/hooks/useResizeObserver/useResizeObserver.types.d.ts +8 -0
- package/dist/icons.cjs +1 -0
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +6 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +175 -169
- package/dist/styles/_base.css +7 -3
- package/dist/styles.css +1 -1
- package/package.json +6 -1
|
@@ -1,30 +1,14 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useMemo as
|
|
1
|
+
import { jsx as t, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as b } from "react";
|
|
3
3
|
import { cn as d } from "../../utils/cn.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// pink
|
|
7
|
-
"#8b5cf6",
|
|
8
|
-
// purple
|
|
9
|
-
"#3b82f6",
|
|
10
|
-
// blue
|
|
11
|
-
"#10b981",
|
|
12
|
-
// emerald
|
|
13
|
-
"#f59e0b",
|
|
14
|
-
// amber
|
|
15
|
-
"#ef4444",
|
|
16
|
-
// red
|
|
17
|
-
"#06b6d4",
|
|
18
|
-
// cyan
|
|
19
|
-
"#84cc16"
|
|
20
|
-
// lime
|
|
21
|
-
], k = (l, o) => o || L[l % L.length], R = ({
|
|
4
|
+
import { getChartColor as k } from "./Chart.utils.js";
|
|
5
|
+
const R = ({
|
|
22
6
|
data: l,
|
|
23
|
-
height:
|
|
7
|
+
height: i = 200,
|
|
24
8
|
showLabels: p = !0,
|
|
25
9
|
showValues: $ = !1,
|
|
26
|
-
animated:
|
|
27
|
-
color:
|
|
10
|
+
animated: m = !0,
|
|
11
|
+
color: h,
|
|
28
12
|
orientation: g = "vertical",
|
|
29
13
|
barRadius: u = 4,
|
|
30
14
|
barGap: v = 0.2,
|
|
@@ -32,15 +16,15 @@ const L = [
|
|
|
32
16
|
...N
|
|
33
17
|
}) => {
|
|
34
18
|
const n = Math.max(...l.map((s) => s.value));
|
|
35
|
-
return /* @__PURE__ */ t("div", { className: d("w-full", y), style: { height:
|
|
36
|
-
const e = s.value / n * 100, a = k(r, s.color ||
|
|
37
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ t("div", { className: d("w-full", y), style: { height: i }, ...N, children: g === "vertical" ? /* @__PURE__ */ t("div", { className: "flex items-end justify-between h-full gap-2", children: l.map((s, r) => {
|
|
20
|
+
const e = s.value / n * 100, a = k(r, s.color || h);
|
|
21
|
+
return /* @__PURE__ */ f("div", { className: "flex-1 flex flex-col items-center gap-1", children: [
|
|
38
22
|
/* @__PURE__ */ t("div", { className: "w-full flex-1 flex items-end", children: /* @__PURE__ */ t(
|
|
39
23
|
"div",
|
|
40
24
|
{
|
|
41
25
|
className: d(
|
|
42
26
|
"w-full transition-all duration-500 ease-out",
|
|
43
|
-
|
|
27
|
+
m && "animate-grow-up"
|
|
44
28
|
),
|
|
45
29
|
style: {
|
|
46
30
|
height: `${e}%`,
|
|
@@ -54,15 +38,15 @@ const L = [
|
|
|
54
38
|
p && /* @__PURE__ */ t("span", { className: "text-xs text-gray-600 dark:text-slate-300 truncate max-w-full", children: s.label })
|
|
55
39
|
] }, r);
|
|
56
40
|
}) }) : /* @__PURE__ */ t("div", { className: "flex flex-col justify-between h-full gap-2", children: l.map((s, r) => {
|
|
57
|
-
const e = s.value / n * 100, a = k(r, s.color ||
|
|
58
|
-
return /* @__PURE__ */
|
|
41
|
+
const e = s.value / n * 100, a = k(r, s.color || h);
|
|
42
|
+
return /* @__PURE__ */ f("div", { className: "flex-1 flex items-center gap-2", children: [
|
|
59
43
|
p && /* @__PURE__ */ t("span", { className: "text-xs text-gray-600 dark:text-slate-300 w-16 truncate", children: s.label }),
|
|
60
44
|
/* @__PURE__ */ t("div", { className: "flex-1 h-full flex items-center", children: /* @__PURE__ */ t(
|
|
61
45
|
"div",
|
|
62
46
|
{
|
|
63
47
|
className: d(
|
|
64
48
|
"h-3/4 transition-all duration-500 ease-out",
|
|
65
|
-
|
|
49
|
+
m && "animate-grow-right"
|
|
66
50
|
),
|
|
67
51
|
style: {
|
|
68
52
|
width: `${e}%`,
|
|
@@ -75,38 +59,38 @@ const L = [
|
|
|
75
59
|
$ && /* @__PURE__ */ t("span", { className: "text-xs text-gray-500 dark:text-slate-400 w-10 text-right", children: s.value })
|
|
76
60
|
] }, r);
|
|
77
61
|
}) }) });
|
|
78
|
-
},
|
|
62
|
+
}, j = ({
|
|
79
63
|
data: l,
|
|
80
|
-
height:
|
|
64
|
+
height: i = 200,
|
|
81
65
|
showLabels: p = !0,
|
|
82
66
|
showDots: $ = !0,
|
|
83
|
-
smooth:
|
|
84
|
-
fill:
|
|
67
|
+
smooth: m = !0,
|
|
68
|
+
fill: h = !1,
|
|
85
69
|
strokeWidth: g = 2,
|
|
86
70
|
color: u = "#ec4899",
|
|
87
71
|
animated: v = !0,
|
|
88
72
|
className: y,
|
|
89
73
|
...N
|
|
90
74
|
}) => {
|
|
91
|
-
const n =
|
|
92
|
-
const e = Math.max(...l.map((c) => c.value)), a = Math.min(...l.map((c) => c.value)),
|
|
75
|
+
const n = b(() => {
|
|
76
|
+
const e = Math.max(...l.map((c) => c.value)), a = Math.min(...l.map((c) => c.value)), o = e - a || 1;
|
|
93
77
|
return l.map((c, x) => ({
|
|
94
78
|
x: x / (l.length - 1 || 1) * 100,
|
|
95
|
-
y: 100 - (c.value - a) /
|
|
79
|
+
y: 100 - (c.value - a) / o * 80 - 10,
|
|
96
80
|
...c
|
|
97
81
|
}));
|
|
98
|
-
}, [l]), s =
|
|
99
|
-
if (
|
|
100
|
-
const x = c[
|
|
101
|
-
return `${e} C ${
|
|
102
|
-
}, "") : n.reduce((e, a,
|
|
103
|
-
return /* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
/* @__PURE__ */ t("defs", { children: /* @__PURE__ */
|
|
82
|
+
}, [l]), s = b(() => n.length === 0 ? "" : m ? n.reduce((e, a, o, c) => {
|
|
83
|
+
if (o === 0) return `M ${a.x},${a.y}`;
|
|
84
|
+
const x = c[o - 1], w = x.x + (a.x - x.x) / 3, C = a.x - (a.x - x.x) / 3;
|
|
85
|
+
return `${e} C ${w},${x.y} ${C},${a.y} ${a.x},${a.y}`;
|
|
86
|
+
}, "") : n.reduce((e, a, o) => `${e} ${o === 0 ? "M" : "L"} ${a.x},${a.y}`, ""), [n, m]), r = b(() => n.length === 0 ? "" : `${s} L 100,100 L 0,100 Z`, [s, n]);
|
|
87
|
+
return /* @__PURE__ */ f("div", { className: d("w-full", y), style: { height: i }, ...N, children: [
|
|
88
|
+
/* @__PURE__ */ f("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "w-full h-full", children: [
|
|
89
|
+
/* @__PURE__ */ t("defs", { children: /* @__PURE__ */ f("linearGradient", { id: "line-gradient", x1: "0%", y1: "0%", x2: "0%", y2: "100%", children: [
|
|
106
90
|
/* @__PURE__ */ t("stop", { offset: "0%", stopColor: u, stopOpacity: "0.3" }),
|
|
107
91
|
/* @__PURE__ */ t("stop", { offset: "100%", stopColor: u, stopOpacity: "0" })
|
|
108
92
|
] }) }),
|
|
109
|
-
|
|
93
|
+
h && /* @__PURE__ */ t(
|
|
110
94
|
"path",
|
|
111
95
|
{
|
|
112
96
|
d: r,
|
|
@@ -141,40 +125,40 @@ const L = [
|
|
|
141
125
|
] }),
|
|
142
126
|
p && /* @__PURE__ */ t("div", { className: "flex justify-between mt-2", children: l.map((e, a) => /* @__PURE__ */ t("span", { className: "text-xs text-gray-600 dark:text-slate-300", children: e.label }, a)) })
|
|
143
127
|
] });
|
|
144
|
-
},
|
|
128
|
+
}, L = ({
|
|
145
129
|
data: l,
|
|
146
|
-
height:
|
|
130
|
+
height: i = 200,
|
|
147
131
|
showLabels: p = !0,
|
|
148
132
|
innerRadius: $ = 0,
|
|
149
|
-
startAngle:
|
|
150
|
-
padAngle:
|
|
133
|
+
startAngle: m = -90,
|
|
134
|
+
padAngle: h = 2,
|
|
151
135
|
animated: g = !0,
|
|
152
136
|
className: u,
|
|
153
137
|
...v
|
|
154
138
|
}) => {
|
|
155
|
-
const y = l.reduce((r, e) => r + e.value, 0), N =
|
|
156
|
-
let r =
|
|
139
|
+
const y = l.reduce((r, e) => r + e.value, 0), N = b(() => {
|
|
140
|
+
let r = m;
|
|
157
141
|
return l.map((e, a) => {
|
|
158
|
-
const
|
|
142
|
+
const o = e.value / y * 360 - h, c = {
|
|
159
143
|
startAngle: r,
|
|
160
|
-
endAngle: r +
|
|
144
|
+
endAngle: r + o,
|
|
161
145
|
color: k(a, e.color),
|
|
162
146
|
...e
|
|
163
147
|
};
|
|
164
|
-
return r +=
|
|
148
|
+
return r += o + h, c;
|
|
165
149
|
});
|
|
166
|
-
}, [l, y,
|
|
150
|
+
}, [l, y, m, h]), n = (r, e) => {
|
|
167
151
|
const a = r * Math.PI / 180;
|
|
168
152
|
return {
|
|
169
153
|
x: 50 + e * Math.cos(a),
|
|
170
154
|
y: 50 + e * Math.sin(a)
|
|
171
155
|
};
|
|
172
156
|
}, s = (r, e) => {
|
|
173
|
-
const
|
|
174
|
-
return $ > 0 ? `M ${c.x},${c.y} A 45,45 0 ${M},1 ${x.x},${x.y} L ${
|
|
157
|
+
const o = $ * 45, c = n(r, 45), x = n(e, 45), w = n(r, o), C = n(e, o), M = e - r > 180 ? 1 : 0;
|
|
158
|
+
return $ > 0 ? `M ${c.x},${c.y} A 45,45 0 ${M},1 ${x.x},${x.y} L ${C.x},${C.y} A ${o},${o} 0 ${M},0 ${w.x},${w.y} Z` : `M 50,50 L ${c.x},${c.y} A 45,45 0 ${M},1 ${x.x},${x.y} Z`;
|
|
175
159
|
};
|
|
176
|
-
return /* @__PURE__ */
|
|
177
|
-
/* @__PURE__ */ t("div", { style: { width:
|
|
160
|
+
return /* @__PURE__ */ f("div", { className: d("flex items-center gap-4", u), ...v, children: [
|
|
161
|
+
/* @__PURE__ */ t("div", { style: { width: i, height: i }, children: /* @__PURE__ */ t("svg", { viewBox: "0 0 100 100", className: "w-full h-full", children: N.map((r, e) => /* @__PURE__ */ t(
|
|
178
162
|
"path",
|
|
179
163
|
{
|
|
180
164
|
d: s(r.startAngle, r.endAngle),
|
|
@@ -187,7 +171,7 @@ const L = [
|
|
|
187
171
|
},
|
|
188
172
|
e
|
|
189
173
|
)) }) }),
|
|
190
|
-
p && /* @__PURE__ */ t("div", { className: "flex flex-col gap-2", children: l.map((r, e) => /* @__PURE__ */
|
|
174
|
+
p && /* @__PURE__ */ t("div", { className: "flex flex-col gap-2", children: l.map((r, e) => /* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
|
|
191
175
|
/* @__PURE__ */ t(
|
|
192
176
|
"div",
|
|
193
177
|
{
|
|
@@ -196,30 +180,30 @@ const L = [
|
|
|
196
180
|
}
|
|
197
181
|
),
|
|
198
182
|
/* @__PURE__ */ t("span", { className: "text-sm text-gray-600 dark:text-slate-300", children: r.label }),
|
|
199
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ f("span", { className: "text-sm text-gray-400 dark:text-slate-500", children: [
|
|
200
184
|
Math.round(r.value / y * 100),
|
|
201
185
|
"%"
|
|
202
186
|
] })
|
|
203
187
|
] }, e)) })
|
|
204
188
|
] });
|
|
205
|
-
},
|
|
189
|
+
}, P = ({ type: l, ...i }) => {
|
|
206
190
|
switch (l) {
|
|
207
191
|
case "bar":
|
|
208
|
-
return /* @__PURE__ */ t(R, { ...
|
|
192
|
+
return /* @__PURE__ */ t(R, { ...i });
|
|
209
193
|
case "line":
|
|
210
194
|
case "area":
|
|
211
|
-
return /* @__PURE__ */ t(
|
|
195
|
+
return /* @__PURE__ */ t(j, { ...i, fill: l === "area" });
|
|
212
196
|
case "pie":
|
|
213
|
-
return /* @__PURE__ */ t(
|
|
197
|
+
return /* @__PURE__ */ t(L, { ...i });
|
|
214
198
|
case "donut":
|
|
215
|
-
return /* @__PURE__ */ t(
|
|
199
|
+
return /* @__PURE__ */ t(L, { ...i, innerRadius: 0.6 });
|
|
216
200
|
default:
|
|
217
|
-
return /* @__PURE__ */ t(R, { ...
|
|
201
|
+
return /* @__PURE__ */ t(R, { ...i });
|
|
218
202
|
}
|
|
219
203
|
};
|
|
220
204
|
export {
|
|
221
205
|
R as BarChart,
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
206
|
+
P as Chart,
|
|
207
|
+
j as LineChart,
|
|
208
|
+
L as PieChart
|
|
225
209
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./Chart.const.cjs"),o=(e,r)=>r||t.DEFAULT_COLORS[e%t.DEFAULT_COLORS.length];exports.getChartColor=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("react/jsx-runtime"),a=require("react"),R=require("../../utils/cn.cjs"),r=require("./Confetti.const.cjs"),v=({active:c=!1,count:E=r.CONFETTI_DEFAULTS.COUNT,duration:h=r.CONFETTI_DEFAULTS.DURATION,colors:T=r.CONFETTI_COLORS,originX:f=r.CONFETTI_DEFAULTS.ORIGIN_X,originY:I=r.CONFETTI_DEFAULTS.ORIGIN_Y,spread:F=r.CONFETTI_DEFAULTS.SPREAD,velocity:S=r.CONFETTI_DEFAULTS.VELOCITY,gravity:N=r.CONFETTI_DEFAULTS.GRAVITY,autoHide:O=r.CONFETTI_DEFAULTS.AUTO_HIDE,onComplete:o,className:x,testId:y})=>{const[m,d]=a.useState([]),[M,A]=a.useState(!1),n=a.useRef(),i=a.useRef(0),_=a.useCallback(()=>{const t=[],l=F*Math.PI/180;for(let s=0;s<E;s++){const e=-Math.PI/2+(Math.random()-.5)*l,b=S*(.5+Math.random()*.5);t.push({id:s,x:f*100,y:I*100,rotation:Math.random()*360,color:T[Math.floor(Math.random()*T.length)],size:r.CONFETTI_SIZE_RANGE.min+Math.random()*(r.CONFETTI_SIZE_RANGE.max-r.CONFETTI_SIZE_RANGE.min),velocity:{x:Math.cos(e)*b,y:Math.sin(e)*b},rotationSpeed:(Math.random()-.5)*20,shape:r.CONFETTI_SHAPES[Math.floor(Math.random()*r.CONFETTI_SHAPES.length)]})}return t},[E,T,f,I,F,S]),u=a.useCallback(t=>{if(i.current||(i.current=t),t-i.current>=h&&O){A(!1),d([]),o==null||o();return}d(s=>s.map(e=>({...e,x:e.x+e.velocity.x*.1,y:e.y+e.velocity.y*.1,rotation:e.rotation+e.rotationSpeed,velocity:{x:e.velocity.x*.99,y:e.velocity.y+N}}))),n.current=requestAnimationFrame(u)},[h,N,O,o]);a.useEffect(()=>(c?(A(!0),d(_()),i.current=0,n.current=requestAnimationFrame(u)):n.current&&cancelAnimationFrame(n.current),()=>{n.current&&cancelAnimationFrame(n.current)}),[c,_,u]);const g=t=>{const l={left:`${t.x}%`,top:`${t.y}%`,width:t.size,height:t.size,transform:`rotate(${t.rotation}deg)`,backgroundColor:t.shape!=="triangle"?t.color:"transparent",borderLeft:t.shape==="triangle"?`${t.size/2}px solid transparent`:void 0,borderRight:t.shape==="triangle"?`${t.size/2}px solid transparent`:void 0,borderBottom:t.shape==="triangle"?`${t.size}px solid ${t.color}`:void 0};return C.jsx("div",{className:R.cn("bear-absolute bear-opacity-90",t.shape==="circle"&&"bear-rounded-full"),style:l},t.id)};return!M||m.length===0?null:C.jsx("div",{className:R.cn("Bear-Confetti","bear-fixed bear-inset-0 bear-pointer-events-none bear-overflow-hidden bear-z-[99999]",x),"data-testid":y,children:m.map(g)})};exports.Confetti=v;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { CONFETTI_DEFAULTS as a, CONFETTI_SHAPES as
|
|
1
|
+
import { jsx as N } from "react/jsx-runtime";
|
|
2
|
+
import { useState as g, useRef as v, useCallback as S, useEffect as D } from "react";
|
|
3
|
+
import { cn as F } from "../../utils/cn.js";
|
|
4
|
+
import { CONFETTI_DEFAULTS as a, CONFETTI_SHAPES as _, CONFETTI_COLORS as G, CONFETTI_SIZE_RANGE as f } from "./Confetti.const.js";
|
|
5
5
|
const k = ({
|
|
6
6
|
active: m = !1,
|
|
7
7
|
count: u = a.COUNT,
|
|
8
8
|
duration: c = a.DURATION,
|
|
9
9
|
colors: l = G,
|
|
10
|
-
originX:
|
|
11
|
-
originY:
|
|
12
|
-
spread:
|
|
10
|
+
originX: b = a.ORIGIN_X,
|
|
11
|
+
originY: I = a.ORIGIN_Y,
|
|
12
|
+
spread: x = a.SPREAD,
|
|
13
13
|
velocity: T = a.VELOCITY,
|
|
14
|
-
gravity:
|
|
14
|
+
gravity: y = a.GRAVITY,
|
|
15
15
|
autoHide: M = a.AUTO_HIDE,
|
|
16
16
|
onComplete: o,
|
|
17
|
-
className:
|
|
18
|
-
testId:
|
|
17
|
+
className: z,
|
|
18
|
+
testId: P
|
|
19
19
|
}) => {
|
|
20
|
-
const [
|
|
21
|
-
const t = [], i =
|
|
20
|
+
const [E, d] = g([]), [$, O] = g(!1), n = v(), s = v(0), R = S(() => {
|
|
21
|
+
const t = [], i = x * Math.PI / 180;
|
|
22
22
|
for (let e = 0; e < u; e++) {
|
|
23
23
|
const r = -Math.PI / 2 + (Math.random() - 0.5) * i, A = T * (0.5 + Math.random() * 0.5);
|
|
24
24
|
t.push({
|
|
25
25
|
id: e,
|
|
26
|
-
x:
|
|
27
|
-
y:
|
|
26
|
+
x: b * 100,
|
|
27
|
+
y: I * 100,
|
|
28
28
|
rotation: Math.random() * 360,
|
|
29
29
|
color: l[Math.floor(Math.random() * l.length)],
|
|
30
30
|
size: f.min + Math.random() * (f.max - f.min),
|
|
@@ -33,13 +33,13 @@ const k = ({
|
|
|
33
33
|
y: Math.sin(r) * A
|
|
34
34
|
},
|
|
35
35
|
rotationSpeed: (Math.random() - 0.5) * 20,
|
|
36
|
-
shape:
|
|
36
|
+
shape: _[Math.floor(Math.random() * _.length)]
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
return t;
|
|
40
|
-
}, [u, l, I, x,
|
|
40
|
+
}, [u, l, b, I, x, T]), h = S((t) => {
|
|
41
41
|
if (s.current || (s.current = t), t - s.current >= c && M) {
|
|
42
|
-
|
|
42
|
+
O(!1), d([]), o == null || o();
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
d(
|
|
@@ -50,42 +50,45 @@ const k = ({
|
|
|
50
50
|
rotation: r.rotation + r.rotationSpeed,
|
|
51
51
|
velocity: {
|
|
52
52
|
x: r.velocity.x * 0.99,
|
|
53
|
-
y: r.velocity.y +
|
|
53
|
+
y: r.velocity.y + y
|
|
54
54
|
}
|
|
55
55
|
}))
|
|
56
56
|
), n.current = requestAnimationFrame(h);
|
|
57
|
-
}, [c,
|
|
58
|
-
|
|
57
|
+
}, [c, y, M, o]);
|
|
58
|
+
D(() => (m ? (O(!0), d(R()), s.current = 0, n.current = requestAnimationFrame(h)) : n.current && cancelAnimationFrame(n.current), () => {
|
|
59
59
|
n.current && cancelAnimationFrame(n.current);
|
|
60
|
-
}), [m,
|
|
61
|
-
const
|
|
60
|
+
}), [m, R, h]);
|
|
61
|
+
const C = (t) => {
|
|
62
62
|
const i = {
|
|
63
|
-
position: "absolute",
|
|
64
63
|
left: `${t.x}%`,
|
|
65
64
|
top: `${t.y}%`,
|
|
66
65
|
width: t.size,
|
|
67
66
|
height: t.size,
|
|
68
67
|
transform: `rotate(${t.rotation}deg)`,
|
|
69
68
|
backgroundColor: t.shape !== "triangle" ? t.color : "transparent",
|
|
70
|
-
borderRadius: t.shape === "circle" ? "50%" : 0,
|
|
71
69
|
borderLeft: t.shape === "triangle" ? `${t.size / 2}px solid transparent` : void 0,
|
|
72
70
|
borderRight: t.shape === "triangle" ? `${t.size / 2}px solid transparent` : void 0,
|
|
73
|
-
borderBottom: t.shape === "triangle" ? `${t.size}px solid ${t.color}` : void 0
|
|
74
|
-
opacity: 0.9
|
|
71
|
+
borderBottom: t.shape === "triangle" ? `${t.size}px solid ${t.color}` : void 0
|
|
75
72
|
};
|
|
76
|
-
return /* @__PURE__ */
|
|
73
|
+
return /* @__PURE__ */ N(
|
|
74
|
+
"div",
|
|
75
|
+
{
|
|
76
|
+
className: F("bear-absolute bear-opacity-90", t.shape === "circle" && "bear-rounded-full"),
|
|
77
|
+
style: i
|
|
78
|
+
},
|
|
79
|
+
t.id
|
|
80
|
+
);
|
|
77
81
|
};
|
|
78
|
-
return
|
|
82
|
+
return !$ || E.length === 0 ? null : /* @__PURE__ */ N(
|
|
79
83
|
"div",
|
|
80
84
|
{
|
|
81
|
-
className:
|
|
85
|
+
className: F(
|
|
82
86
|
"Bear-Confetti",
|
|
83
|
-
"bear-fixed bear-inset-0 bear-pointer-events-none bear-overflow-hidden",
|
|
84
|
-
|
|
87
|
+
"bear-fixed bear-inset-0 bear-pointer-events-none bear-overflow-hidden bear-z-[99999]",
|
|
88
|
+
z
|
|
85
89
|
),
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
children: R.map($)
|
|
90
|
+
"data-testid": P,
|
|
91
|
+
children: E.map(C)
|
|
89
92
|
}
|
|
90
93
|
);
|
|
91
94
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),r=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),r=require("react"),_=require("../../utils/cn.cjs"),l=require("./ContextMenu.const.cjs"),j=require("./ContextMenu.utils.cjs"),b=({items:S,position:a,onClose:i})=>{const[c,o]=r.useState(null),[u,d]=r.useState({x:0,y:0}),x=r.useRef(null),E=r.useCallback(s=>{var e;s.disabled||s.children||((e=s.onClick)==null||e.call(s),i())},[i]),f=r.useCallback((s,e)=>{if(s.children){const n=e.currentTarget.getBoundingClientRect();d({x:n.right+l.SUB_MENU_OFFSET,y:n.top}),o(s.id)}else o(null)},[]);return t.jsx("div",{ref:x,className:l.MENU_CLASSES,style:{left:a.x,top:a.y},role:"menu",children:S.map(s=>{if(j.isDivider(s))return t.jsx("div",{className:l.DIVIDER_CLASSES,role:"separator"},s.id);const e=s;return t.jsxs("div",{children:[t.jsxs("div",{className:_.cn(l.ITEM_CLASSES,e.disabled&&l.ITEM_DISABLED_CLASSES,e.danger&&l.ITEM_DANGER_CLASSES),onClick:()=>E(e),onMouseEnter:n=>f(e,n),role:"menuitem","aria-disabled":e.disabled,children:[t.jsxs("span",{className:"bear-flex bear-items-center",children:[e.icon&&t.jsx("span",{className:l.ICON_CLASSES,children:e.icon}),e.label]}),t.jsxs("span",{className:"bear-flex bear-items-center",children:[e.shortcut&&t.jsx("span",{className:l.SHORTCUT_CLASSES,children:e.shortcut}),e.children&&t.jsx("span",{className:l.SUB_INDICATOR_CLASSES,children:"▸"})]})]}),e.children&&c===e.id&&t.jsx(b,{items:e.children,position:u,onClose:i})]},e.id)})})},v=({items:S,children:a,disabled:i=!1,onOpenChange:c,testId:o})=>{const[u,d]=r.useState(!1),[x,E]=r.useState({x:0,y:0}),f=r.useRef(null),s=r.useCallback(()=>{d(!1),c==null||c(!1)},[c]),e=r.useCallback(n=>{i||(n.preventDefault(),E({x:n.clientX,y:n.clientY}),d(!0),c==null||c(!0))},[i,c]);return r.useEffect(()=>{if(!u)return;const n=()=>s(),m=M=>{M.key==="Escape"&&s()};return document.addEventListener("mousedown",n),document.addEventListener("keydown",m),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("keydown",m)}},[u,s]),t.jsxs("div",{ref:f,onContextMenu:e,"data-testid":o,children:[a,u&&t.jsx(b,{items:S,position:x,onClose:s})]})};exports.ContextMenu=v;
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as i, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as u, useRef as b, useCallback as S, useEffect as N } from "react";
|
|
3
3
|
import { cn as _ } from "../../utils/cn.js";
|
|
4
|
-
import { SUB_MENU_OFFSET as h, MENU_CLASSES as A, DIVIDER_CLASSES as I, ICON_CLASSES as M, SHORTCUT_CLASSES as
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { SUB_MENU_OFFSET as h, MENU_CLASSES as A, DIVIDER_CLASSES as I, ICON_CLASSES as M, SHORTCUT_CLASSES as k, SUB_INDICATOR_CLASSES as y, ITEM_DANGER_CLASSES as C, ITEM_DISABLED_CLASSES as D, ITEM_CLASSES as R } from "./ContextMenu.const.js";
|
|
5
|
+
import { isDivider as T } from "./ContextMenu.utils.js";
|
|
6
|
+
const v = ({ items: m, position: o, onClose: c }) => {
|
|
7
|
+
const [r, d] = u(null), [l, a] = u({ x: 0, y: 0 }), f = b(null), E = S((s) => {
|
|
7
8
|
var e;
|
|
8
|
-
s.disabled || s.children || ((e = s.onClick) == null || e.call(s),
|
|
9
|
-
}, [
|
|
9
|
+
s.disabled || s.children || ((e = s.onClick) == null || e.call(s), c());
|
|
10
|
+
}, [c]), p = S((s, e) => {
|
|
10
11
|
if (s.children) {
|
|
11
12
|
const t = e.currentTarget.getBoundingClientRect();
|
|
12
|
-
|
|
13
|
+
a({ x: t.right + h, y: t.top }), d(s.id);
|
|
13
14
|
} else
|
|
14
|
-
|
|
15
|
+
d(null);
|
|
15
16
|
}, []);
|
|
16
|
-
return /* @__PURE__ */ n("div", { ref: f, className: A, style: { left: o.x, top: o.y }, role: "menu", children:
|
|
17
|
+
return /* @__PURE__ */ n("div", { ref: f, className: A, style: { left: o.x, top: o.y }, role: "menu", children: m.map((s) => {
|
|
17
18
|
if (T(s)) return /* @__PURE__ */ n("div", { className: I, role: "separator" }, s.id);
|
|
18
19
|
const e = s;
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
/* @__PURE__ */
|
|
20
|
+
return /* @__PURE__ */ i("div", { children: [
|
|
21
|
+
/* @__PURE__ */ i(
|
|
21
22
|
"div",
|
|
22
23
|
{
|
|
23
24
|
className: _(R, e.disabled && D, e.danger && C),
|
|
@@ -26,39 +27,39 @@ const T = (c) => "type" in c && c.type === "divider", b = ({ items: c, position:
|
|
|
26
27
|
role: "menuitem",
|
|
27
28
|
"aria-disabled": e.disabled,
|
|
28
29
|
children: [
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ i("span", { className: "bear-flex bear-items-center", children: [
|
|
30
31
|
e.icon && /* @__PURE__ */ n("span", { className: M, children: e.icon }),
|
|
31
32
|
e.label
|
|
32
33
|
] }),
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
e.shortcut && /* @__PURE__ */ n("span", { className:
|
|
35
|
-
e.children && /* @__PURE__ */ n("span", { className:
|
|
34
|
+
/* @__PURE__ */ i("span", { className: "bear-flex bear-items-center", children: [
|
|
35
|
+
e.shortcut && /* @__PURE__ */ n("span", { className: k, children: e.shortcut }),
|
|
36
|
+
e.children && /* @__PURE__ */ n("span", { className: y, children: "▸" })
|
|
36
37
|
] })
|
|
37
38
|
]
|
|
38
39
|
}
|
|
39
40
|
),
|
|
40
|
-
e.children && r === e.id && /* @__PURE__ */ n(
|
|
41
|
+
e.children && r === e.id && /* @__PURE__ */ n(v, { items: e.children, position: l, onClose: c })
|
|
41
42
|
] }, e.id);
|
|
42
43
|
}) });
|
|
43
|
-
},
|
|
44
|
-
const [
|
|
45
|
-
|
|
46
|
-
}, [r]), e =
|
|
47
|
-
|
|
48
|
-
}, [
|
|
44
|
+
}, F = ({ items: m, children: o, disabled: c = !1, onOpenChange: r, testId: d }) => {
|
|
45
|
+
const [l, a] = u(!1), [f, E] = u({ x: 0, y: 0 }), p = b(null), s = S(() => {
|
|
46
|
+
a(!1), r == null || r(!1);
|
|
47
|
+
}, [r]), e = S((t) => {
|
|
48
|
+
c || (t.preventDefault(), E({ x: t.clientX, y: t.clientY }), a(!0), r == null || r(!0));
|
|
49
|
+
}, [c, r]);
|
|
49
50
|
return N(() => {
|
|
50
|
-
if (!
|
|
51
|
-
const t = () => s(),
|
|
51
|
+
if (!l) return;
|
|
52
|
+
const t = () => s(), L = (x) => {
|
|
52
53
|
x.key === "Escape" && s();
|
|
53
54
|
};
|
|
54
|
-
return document.addEventListener("mousedown", t), document.addEventListener("keydown",
|
|
55
|
-
document.removeEventListener("mousedown", t), document.removeEventListener("keydown",
|
|
55
|
+
return document.addEventListener("mousedown", t), document.addEventListener("keydown", L), () => {
|
|
56
|
+
document.removeEventListener("mousedown", t), document.removeEventListener("keydown", L);
|
|
56
57
|
};
|
|
57
|
-
}, [
|
|
58
|
+
}, [l, s]), /* @__PURE__ */ i("div", { ref: p, onContextMenu: e, "data-testid": d, children: [
|
|
58
59
|
o,
|
|
59
|
-
|
|
60
|
+
l && /* @__PURE__ */ n(v, { items: m, position: f, onClose: s })
|
|
60
61
|
] });
|
|
61
62
|
};
|
|
62
63
|
export {
|
|
63
|
-
|
|
64
|
+
F as ContextMenu
|
|
64
65
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=i=>"type"in i&&i.type==="divider";exports.isDivider=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),d=require("../../utils/cn.cjs"),e=require("./CountdownTimer.const.cjs"),s=require("./CountdownTimer.utils.cjs"),G=y=>{const{targetDate:c,duration:b,variant:w="default",size:m="md",showDays:A=!0,showHours:L=!0,showMinutes:v=!0,showSeconds:I=!0,showLabels:D=!0,showSeparator:R=!0,separator:N=e.DEFAULT_SEPARATOR,labels:E,onComplete:o,onTick:l,paused:C=!1,render:h,className:j,style:k,testId:B}=y,u=t.useMemo(()=>({...e.DEFAULT_LABELS,...E}),[E]),x=t.useRef(!1),P=t.useCallback(()=>c?new Date(c).getTime():b?Date.now()+b*e.MS_PER_SECOND:Date.now(),[c,b]),[S]=t.useState(P),[n,Z]=t.useState(()=>s.calcRemaining(S,Date.now()));if(t.useEffect(()=>{if(C)return;const a=()=>{const p=s.calcRemaining(S,Date.now());Z(p),l==null||l(p),p.isComplete&&!x.current&&(x.current=!0,o==null||o())};a();const _=setInterval(a,e.UPDATE_INTERVAL);return()=>clearInterval(_)},[S,C,o,l]),h)return r.jsx(r.Fragment,{children:h(n)});const f=e.SIZE_DIGIT_CLASSES[m]??e.SIZE_DIGIT_CLASSES.md,q=e.SIZE_LABEL_CLASSES[m]??e.SIZE_LABEL_CLASSES.md,F=e.SIZE_GAP_CLASSES[m]??e.SIZE_GAP_CLASSES.md,i=[];A&&i.push({value:s.pad(n.days),label:u.days}),L&&i.push({value:s.pad(n.hours),label:u.hours}),v&&i.push({value:s.pad(n.minutes),label:u.minutes}),I&&i.push({value:s.pad(n.seconds),label:u.seconds});const g=w==="card",T=w==="flip";return r.jsx("div",{className:d.cn("Bear-CountdownTimer","bear-flex bear-items-center",F,j),style:k,"data-testid":B,role:"timer","aria-label":"Countdown timer",children:i.map((a,_)=>r.jsxs("div",{className:"Bear-CountdownTimer__segment bear-flex bear-items-center",children:[_>0&&R&&!g&&r.jsx("span",{className:d.cn("Bear-CountdownTimer__separator",f,e.SEPARATOR_MARGIN,"bear-text-gray-400 dark:bear-text-gray-500"),"aria-hidden":"true",children:N}),r.jsxs("div",{className:"Bear-CountdownTimer__unit bear-flex bear-flex-col bear-items-center",children:[r.jsx("div",{className:d.cn("Bear-CountdownTimer__digit",f,"bear-tabular-nums bear-tracking-wider",g&&["bear-px-3 bear-py-2 bear-rounded-lg","bear-bg-gray-100 dark:bear-bg-gray-800","bear-border bear-border-gray-200 dark:bear-border-gray-700"],T&&["bear-px-3 bear-py-2 bear-rounded-lg","bear-bg-gray-900 dark:bear-bg-gray-100","bear-text-white dark:bear-text-gray-900","bear-shadow-lg"],!g&&!T&&"bear-text-[var(--bear-text-primary)]"),children:a.value}),D&&r.jsx("span",{className:d.cn("Bear-CountdownTimer__label",q,"bear-mt-1 bear-uppercase bear-tracking-widest","bear-text-gray-500 dark:bear-text-gray-400"),children:a.label})]})]},a.label))})};exports.CountdownTimer=G;
|