@forgedevstack/bear 1.0.8 → 1.1.0
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 +11 -1
- package/dist/components/ActivityItem/ActivityItem.cjs +1 -1
- package/dist/components/ActivityItem/ActivityItem.js +1 -0
- package/dist/components/Alert/Alert.const.cjs +1 -1
- package/dist/components/Alert/Alert.const.js +3 -2
- package/dist/components/AppBar/AppBar.cjs +1 -1
- package/dist/components/AppBar/AppBar.js +3 -2
- package/dist/components/Badge/Badge.cjs +1 -1
- package/dist/components/Badge/Badge.js +15 -14
- package/dist/components/BearLogo/EmberLogo.cjs +1 -1
- package/dist/components/BearLogo/EmberLogo.js +3 -2
- package/dist/components/BottomNavigation/BottomNavigation.cjs +1 -1
- package/dist/components/BottomNavigation/BottomNavigation.js +3 -2
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.js +56 -55
- package/dist/components/Button/Button.types.d.ts +7 -0
- package/dist/components/Carousel/Carousel.cjs +1 -1
- package/dist/components/Carousel/Carousel.const.cjs +1 -0
- package/dist/components/Carousel/Carousel.const.d.ts +12 -0
- package/dist/components/Carousel/Carousel.const.js +9 -0
- package/dist/components/Carousel/Carousel.d.ts +14 -3
- package/dist/components/Carousel/Carousel.js +222 -75
- package/dist/components/Carousel/Carousel.types.d.ts +32 -2
- package/dist/components/Carousel/index.d.ts +1 -1
- package/dist/components/Chip/Chip.cjs +1 -1
- package/dist/components/Chip/Chip.js +3 -2
- package/dist/components/CodeEditor/CodeEditor.cjs +5 -0
- package/dist/components/CodeEditor/CodeEditor.const.cjs +1 -0
- package/dist/components/CodeEditor/CodeEditor.const.d.ts +21 -0
- package/dist/components/CodeEditor/CodeEditor.const.js +119 -0
- package/dist/components/CodeEditor/CodeEditor.d.ts +22 -0
- package/dist/components/CodeEditor/CodeEditor.js +250 -0
- package/dist/components/CodeEditor/CodeEditor.types.d.ts +80 -0
- package/dist/components/CodeEditor/CodeEditor.utils.cjs +1 -0
- package/dist/components/CodeEditor/CodeEditor.utils.d.ts +6 -0
- package/dist/components/CodeEditor/CodeEditor.utils.js +75 -0
- package/dist/components/CodeEditor/index.d.ts +2 -0
- package/dist/components/Columns/Columns.cjs +1 -1
- package/dist/components/Columns/Columns.js +9 -8
- package/dist/components/CountdownTimer/CountdownTimer.cjs +1 -0
- package/dist/components/CountdownTimer/CountdownTimer.const.cjs +1 -0
- package/dist/components/CountdownTimer/CountdownTimer.const.d.ts +27 -0
- package/dist/components/CountdownTimer/CountdownTimer.const.js +35 -0
- package/dist/components/CountdownTimer/CountdownTimer.d.ts +7 -0
- package/dist/components/CountdownTimer/CountdownTimer.js +115 -0
- package/dist/components/CountdownTimer/CountdownTimer.types.d.ts +56 -0
- package/dist/components/CountdownTimer/index.d.ts +2 -0
- package/dist/components/Cropper/Cropper.cjs +1 -0
- package/dist/components/Cropper/Cropper.const.cjs +1 -0
- package/dist/components/Cropper/Cropper.const.d.ts +31 -0
- package/dist/components/Cropper/Cropper.const.js +33 -0
- package/dist/components/Cropper/Cropper.d.ts +21 -0
- package/dist/components/Cropper/Cropper.js +362 -0
- package/dist/components/Cropper/Cropper.types.d.ts +72 -0
- package/dist/components/Cropper/index.d.ts +2 -0
- package/dist/components/DataTable/DataTable.cjs +1 -1
- package/dist/components/DataTable/DataTable.js +5 -4
- package/dist/components/Divider/Divider.cjs +1 -1
- package/dist/components/Divider/Divider.js +15 -14
- package/dist/components/Dock/Dock.cjs +1 -0
- package/dist/components/Dock/Dock.const.cjs +1 -0
- package/dist/components/Dock/Dock.const.d.ts +25 -0
- package/dist/components/Dock/Dock.const.js +22 -0
- package/dist/components/Dock/Dock.d.ts +7 -0
- package/dist/components/Dock/Dock.js +144 -0
- package/dist/components/Dock/Dock.types.d.ts +42 -0
- package/dist/components/Dock/index.d.ts +2 -0
- package/dist/components/EmptyState/EmptyState.cjs +1 -1
- package/dist/components/EmptyState/EmptyState.js +7 -6
- package/dist/components/FileTree/FileTree.cjs +1 -0
- package/dist/components/FileTree/FileTree.d.ts +3 -0
- package/dist/components/FileTree/FileTree.js +46 -0
- package/dist/components/FileTree/FileTree.types.d.ts +30 -0
- package/dist/components/FileTree/index.d.ts +2 -0
- package/dist/components/GradientText/GradientText.cjs +1 -0
- package/dist/components/GradientText/GradientText.const.cjs +1 -0
- package/dist/components/GradientText/GradientText.const.d.ts +15 -0
- package/dist/components/GradientText/GradientText.const.js +36 -0
- package/dist/components/GradientText/GradientText.d.ts +7 -0
- package/dist/components/GradientText/GradientText.js +52 -0
- package/dist/components/GradientText/GradientText.types.d.ts +27 -0
- package/dist/components/GradientText/index.d.ts +2 -0
- package/dist/components/Highlight/Highlight.cjs +1 -1
- package/dist/components/Highlight/Highlight.const.cjs +1 -0
- package/dist/components/Highlight/Highlight.const.d.ts +8 -0
- package/dist/components/Highlight/Highlight.const.js +15 -0
- package/dist/components/Highlight/Highlight.d.ts +4 -0
- package/dist/components/Highlight/Highlight.js +32 -24
- package/dist/components/Highlight/Highlight.types.d.ts +9 -1
- package/dist/components/Highlight/index.d.ts +1 -1
- package/dist/components/Icon/Icon.cjs +1 -1
- package/dist/components/Icon/Icon.js +17 -16
- package/dist/components/Icon/index.cjs +1 -1
- package/dist/components/Icon/index.js +12 -11
- package/dist/components/Kbd/Kbd.cjs +1 -1
- package/dist/components/Kbd/Kbd.js +17 -16
- package/dist/components/Map/Map.cjs +1 -0
- package/dist/components/Map/Map.const.cjs +1 -0
- package/dist/components/Map/Map.const.d.ts +20 -0
- package/dist/components/Map/Map.const.js +26 -0
- package/dist/components/Map/Map.d.ts +20 -0
- package/dist/components/Map/Map.js +259 -0
- package/dist/components/Map/Map.types.d.ts +81 -0
- package/dist/components/Map/index.d.ts +2 -0
- package/dist/components/Marquee/Marquee.cjs +1 -0
- package/dist/components/Marquee/Marquee.const.cjs +1 -0
- package/dist/components/Marquee/Marquee.const.d.ts +11 -0
- package/dist/components/Marquee/Marquee.const.js +12 -0
- package/dist/components/Marquee/Marquee.d.ts +7 -0
- package/dist/components/Marquee/Marquee.js +106 -0
- package/dist/components/Marquee/Marquee.types.d.ts +32 -0
- package/dist/components/Marquee/index.d.ts +2 -0
- package/dist/components/Masonry/Masonry.cjs +1 -0
- package/dist/components/Masonry/Masonry.const.cjs +1 -0
- package/dist/components/Masonry/Masonry.const.d.ts +9 -0
- package/dist/components/Masonry/Masonry.const.js +9 -0
- package/dist/components/Masonry/Masonry.d.ts +7 -0
- package/dist/components/Masonry/Masonry.js +51 -0
- package/dist/components/Masonry/Masonry.types.d.ts +21 -0
- package/dist/components/Masonry/index.d.ts +2 -0
- package/dist/components/NavigableSelect/NavigableSelect.cjs +1 -0
- package/dist/components/NavigableSelect/NavigableSelect.const.cjs +1 -0
- package/dist/components/NavigableSelect/NavigableSelect.const.d.ts +23 -0
- package/dist/components/NavigableSelect/NavigableSelect.const.js +33 -0
- package/dist/components/NavigableSelect/NavigableSelect.d.ts +7 -0
- package/dist/components/NavigableSelect/NavigableSelect.js +361 -0
- package/dist/components/NavigableSelect/NavigableSelect.types.d.ts +56 -0
- package/dist/components/NavigableSelect/index.d.ts +2 -0
- package/dist/components/Progress/Progress.cjs +1 -1
- package/dist/components/Progress/Progress.js +3 -2
- package/dist/components/ResizablePanel/ResizablePanel.cjs +1 -0
- package/dist/components/ResizablePanel/ResizablePanel.const.cjs +1 -0
- package/dist/components/ResizablePanel/ResizablePanel.const.d.ts +11 -0
- package/dist/components/ResizablePanel/ResizablePanel.const.js +11 -0
- package/dist/components/ResizablePanel/ResizablePanel.d.ts +17 -0
- package/dist/components/ResizablePanel/ResizablePanel.js +70 -0
- package/dist/components/ResizablePanel/ResizablePanel.types.d.ts +21 -0
- package/dist/components/ResizablePanel/ResizablePanel.utils.cjs +1 -0
- package/dist/components/ResizablePanel/ResizablePanel.utils.d.ts +10 -0
- package/dist/components/ResizablePanel/ResizablePanel.utils.js +11 -0
- package/dist/components/ResizablePanel/index.d.ts +2 -0
- package/dist/components/ResizableTextarea/ResizableTextarea.cjs +1 -0
- package/dist/components/ResizableTextarea/ResizableTextarea.const.cjs +1 -0
- package/dist/components/ResizableTextarea/ResizableTextarea.const.d.ts +2 -0
- package/dist/components/ResizableTextarea/ResizableTextarea.const.js +5 -0
- package/dist/components/ResizableTextarea/ResizableTextarea.d.ts +3 -0
- package/dist/components/ResizableTextarea/ResizableTextarea.js +60 -0
- package/dist/components/ResizableTextarea/ResizableTextarea.types.d.ts +15 -0
- package/dist/components/ResizableTextarea/index.d.ts +2 -0
- package/dist/components/RichEditor/components/ToolbarButton/ToolbarButton.cjs +1 -1
- package/dist/components/RichEditor/components/ToolbarButton/ToolbarButton.js +3 -2
- package/dist/components/ScrollArea/ScrollArea.cjs +1 -1
- package/dist/components/ScrollArea/ScrollArea.js +3 -2
- package/dist/components/Sidebar/Sidebar.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.js +13 -12
- package/dist/components/Spinner/Spinner.cjs +1 -1
- package/dist/components/Spinner/Spinner.js +3 -2
- package/dist/components/Spotlight/Spotlight.cjs +1 -0
- package/dist/components/Spotlight/Spotlight.const.cjs +1 -0
- package/dist/components/Spotlight/Spotlight.const.d.ts +18 -0
- package/dist/components/Spotlight/Spotlight.const.js +9 -0
- package/dist/components/Spotlight/Spotlight.d.ts +7 -0
- package/dist/components/Spotlight/Spotlight.js +220 -0
- package/dist/components/Spotlight/Spotlight.types.d.ts +51 -0
- package/dist/components/Spotlight/index.d.ts +2 -0
- package/dist/components/StatCard/StatCard.cjs +1 -1
- package/dist/components/StatCard/StatCard.js +9 -8
- package/dist/components/Statistic/Statistic.cjs +1 -1
- package/dist/components/Statistic/Statistic.js +7 -6
- package/dist/components/Switch/Switch.cjs +1 -1
- package/dist/components/Switch/Switch.js +11 -10
- package/dist/components/TimePicker/components/TimePickerColumnsDropdown/TimePickerColumnsDropdown.cjs +1 -1
- package/dist/components/TimePicker/components/TimePickerColumnsDropdown/TimePickerColumnsDropdown.js +16 -15
- package/dist/components/TimePicker/helpers/ClockFaceSvg.cjs +1 -1
- package/dist/components/TimePicker/helpers/ClockFaceSvg.js +13 -12
- package/dist/components/Transition/Transition.cjs +1 -0
- package/dist/components/Transition/Transition.const.cjs +1 -0
- package/dist/components/Transition/Transition.const.d.ts +15 -0
- package/dist/components/Transition/Transition.const.js +73 -0
- package/dist/components/Transition/Transition.d.ts +37 -0
- package/dist/components/Transition/Transition.js +107 -0
- package/dist/components/Transition/Transition.types.d.ts +69 -0
- package/dist/components/Transition/index.d.ts +2 -0
- package/dist/components/Typewriter/Typewriter.cjs +1 -0
- package/dist/components/Typewriter/Typewriter.const.cjs +1 -0
- package/dist/components/Typewriter/Typewriter.const.d.ts +22 -0
- package/dist/components/Typewriter/Typewriter.const.js +11 -0
- package/dist/components/Typewriter/Typewriter.d.ts +7 -0
- package/dist/components/Typewriter/Typewriter.js +88 -0
- package/dist/components/Typewriter/Typewriter.types.d.ts +32 -0
- package/dist/components/Typewriter/index.d.ts +2 -0
- package/dist/components/Typography/Typography.cjs +1 -1
- package/dist/components/Typography/Typography.const.cjs +1 -0
- package/dist/components/Typography/Typography.const.d.ts +22 -0
- package/dist/components/Typography/Typography.const.js +91 -0
- package/dist/components/Typography/Typography.js +75 -138
- package/dist/components/Typography/Typography.types.d.ts +17 -0
- package/dist/components/Watermark/Watermark.cjs +1 -0
- package/dist/components/Watermark/Watermark.const.cjs +1 -0
- package/dist/components/Watermark/Watermark.const.d.ts +30 -0
- package/dist/components/Watermark/Watermark.const.js +18 -0
- package/dist/components/Watermark/Watermark.d.ts +7 -0
- package/dist/components/Watermark/Watermark.js +96 -0
- package/dist/components/Watermark/Watermark.types.d.ts +35 -0
- package/dist/components/Watermark/index.d.ts +2 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +33 -1
- package/dist/components/index.js +270 -237
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/index.js +24 -19
- package/dist/hooks/useAnimate.cjs +1 -0
- package/dist/hooks/useAnimate.d.ts +61 -0
- package/dist/hooks/useAnimate.js +125 -0
- package/dist/hooks/useResponsive.cjs +1 -0
- package/dist/hooks/useResponsive.d.ts +35 -0
- package/dist/hooks/useResponsive.js +74 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +335 -295
- package/dist/styles.css +1 -1
- package/dist/utils/createSlots.cjs +1 -0
- package/dist/utils/createSlots.d.ts +70 -0
- package/dist/utils/createSlots.js +65 -0
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +4 -2
- package/package.json +1 -1
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { jsxs as b, jsx as t, Fragment as G } from "react/jsx-runtime";
|
|
2
|
+
import { useState as w, useRef as E, useCallback as D, useEffect as v, useMemo as T } from "react";
|
|
3
|
+
import { cn as m } from "../../utils/cn.js";
|
|
4
|
+
import { DEFAULT_PLACEHOLDER as P, DEFAULT_SHORTCUT_KEY as Y, DEFAULT_NOTHING_FOUND as z, DEFAULT_LIMIT as Q, FOCUS_DELAY as V, SPOTLIGHT_Z_INDEX as W } from "./Spotlight.const.js";
|
|
5
|
+
const X = (l, s) => {
|
|
6
|
+
var o, u;
|
|
7
|
+
const i = s.toLowerCase();
|
|
8
|
+
return !!(l.label.toLowerCase().includes(i) || (o = l.description) != null && o.toLowerCase().includes(i) || (u = l.keywords) != null && u.some((y) => y.toLowerCase().includes(i)));
|
|
9
|
+
}, I = (l, s) => {
|
|
10
|
+
if (!s) return l;
|
|
11
|
+
const i = l.toLowerCase().indexOf(s.toLowerCase());
|
|
12
|
+
return i === -1 ? l : /* @__PURE__ */ b(G, { children: [
|
|
13
|
+
l.slice(0, i),
|
|
14
|
+
/* @__PURE__ */ t("mark", { className: "Bear-Spotlight__highlight bear-bg-yellow-200 dark:bear-bg-yellow-800 bear-text-inherit bear-rounded-sm bear-px-0.5", children: l.slice(i, i + s.length) }),
|
|
15
|
+
l.slice(i + s.length)
|
|
16
|
+
] });
|
|
17
|
+
}, ee = (l) => {
|
|
18
|
+
const {
|
|
19
|
+
actions: s,
|
|
20
|
+
open: i,
|
|
21
|
+
onOpenChange: o,
|
|
22
|
+
placeholder: u = P,
|
|
23
|
+
shortcutKey: y = Y,
|
|
24
|
+
shortcutMod: N = !0,
|
|
25
|
+
nothingFoundMessage: A = z,
|
|
26
|
+
highlightMatches: S = !0,
|
|
27
|
+
limit: x = Q,
|
|
28
|
+
filter: f,
|
|
29
|
+
className: O,
|
|
30
|
+
style: M,
|
|
31
|
+
testId: F
|
|
32
|
+
} = l, [U, K] = w(!1), [n, L] = w(""), [p, h] = w(0), B = E(null), C = E(null), g = i ?? U, d = D(
|
|
33
|
+
(e) => {
|
|
34
|
+
K(e), o == null || o(e), e || (L(""), h(0));
|
|
35
|
+
},
|
|
36
|
+
[o]
|
|
37
|
+
);
|
|
38
|
+
v(() => {
|
|
39
|
+
const e = (r) => {
|
|
40
|
+
(N ? r.metaKey || r.ctrlKey : !0) && r.key.toLowerCase() === y.toLowerCase() && (r.preventDefault(), d(!g)), r.key === "Escape" && g && d(!1);
|
|
41
|
+
};
|
|
42
|
+
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
43
|
+
}, [y, N, g, d]), v(() => {
|
|
44
|
+
g && setTimeout(() => {
|
|
45
|
+
var e;
|
|
46
|
+
return (e = B.current) == null ? void 0 : e.focus();
|
|
47
|
+
}, V);
|
|
48
|
+
}, [g]);
|
|
49
|
+
const c = T(() => f ? f(n, s).slice(0, x) : n ? s.filter((e) => X(e, n)).slice(0, x) : s.slice(0, x), [s, n, f, x]), R = T(() => {
|
|
50
|
+
const e = /* @__PURE__ */ new Map();
|
|
51
|
+
return c.forEach((r) => {
|
|
52
|
+
const a = r.group || "";
|
|
53
|
+
e.has(a) || e.set(a, []), e.get(a).push(r);
|
|
54
|
+
}), e;
|
|
55
|
+
}, [c]), H = D(
|
|
56
|
+
(e) => {
|
|
57
|
+
if (e.key === "ArrowDown")
|
|
58
|
+
e.preventDefault(), h((r) => Math.min(r + 1, c.length - 1));
|
|
59
|
+
else if (e.key === "ArrowUp")
|
|
60
|
+
e.preventDefault(), h((r) => Math.max(r - 1, 0));
|
|
61
|
+
else if (e.key === "Enter" && c[p]) {
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
const r = c[p];
|
|
64
|
+
r.disabled || (r.onTrigger(), d(!1));
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
[c, p, d]
|
|
68
|
+
);
|
|
69
|
+
if (v(() => {
|
|
70
|
+
const e = C.current;
|
|
71
|
+
if (!e) return;
|
|
72
|
+
const r = e.querySelector('[data-active="true"]');
|
|
73
|
+
r == null || r.scrollIntoView({ block: "nearest" });
|
|
74
|
+
}, [p]), !g) return null;
|
|
75
|
+
let k = -1;
|
|
76
|
+
return /* @__PURE__ */ b(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
className: m(
|
|
80
|
+
"Bear-Spotlight",
|
|
81
|
+
"bear-fixed bear-inset-0 bear-flex bear-items-start bear-justify-center bear-pt-[15vh]"
|
|
82
|
+
),
|
|
83
|
+
style: { zIndex: W },
|
|
84
|
+
"data-testid": F,
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ t(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
className: "Bear-Spotlight__backdrop bear-absolute bear-inset-0 bear-bg-black/50 dark:bear-bg-black/70 bear-backdrop-blur-sm",
|
|
90
|
+
onClick: () => d(!1),
|
|
91
|
+
"aria-hidden": "true"
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ b(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
className: m(
|
|
98
|
+
"Bear-Spotlight__dialog",
|
|
99
|
+
"bear-relative bear-w-full bear-max-w-[560px] bear-mx-4",
|
|
100
|
+
"bear-bg-white dark:bear-bg-gray-900",
|
|
101
|
+
"bear-rounded-xl bear-shadow-2xl",
|
|
102
|
+
"bear-border bear-border-gray-200 dark:bear-border-gray-700",
|
|
103
|
+
"bear-overflow-hidden",
|
|
104
|
+
O
|
|
105
|
+
),
|
|
106
|
+
style: M,
|
|
107
|
+
role: "dialog",
|
|
108
|
+
"aria-label": "Search",
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ b("div", { className: "Bear-Spotlight__search bear-flex bear-items-center bear-gap-3 bear-px-4 bear-py-3 bear-border-b bear-border-gray-200 dark:bear-border-gray-700", children: [
|
|
111
|
+
/* @__PURE__ */ b(
|
|
112
|
+
"svg",
|
|
113
|
+
{
|
|
114
|
+
width: 20,
|
|
115
|
+
height: 20,
|
|
116
|
+
viewBox: "0 0 24 24",
|
|
117
|
+
fill: "none",
|
|
118
|
+
stroke: "currentColor",
|
|
119
|
+
strokeWidth: 2,
|
|
120
|
+
className: "bear-text-gray-400 dark:bear-text-gray-500 bear-shrink-0",
|
|
121
|
+
children: [
|
|
122
|
+
/* @__PURE__ */ t("circle", { cx: "11", cy: "11", r: "8" }),
|
|
123
|
+
/* @__PURE__ */ t("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
/* @__PURE__ */ t(
|
|
128
|
+
"input",
|
|
129
|
+
{
|
|
130
|
+
ref: B,
|
|
131
|
+
type: "text",
|
|
132
|
+
value: n,
|
|
133
|
+
onChange: (e) => {
|
|
134
|
+
L(e.target.value), h(0);
|
|
135
|
+
},
|
|
136
|
+
onKeyDown: H,
|
|
137
|
+
placeholder: u,
|
|
138
|
+
className: m(
|
|
139
|
+
"Bear-Spotlight__input",
|
|
140
|
+
"bear-flex-1 bear-bg-transparent bear-outline-none bear-text-base",
|
|
141
|
+
"bear-text-gray-900 dark:bear-text-white",
|
|
142
|
+
"placeholder:bear-text-gray-400 dark:placeholder:bear-text-gray-500"
|
|
143
|
+
),
|
|
144
|
+
autoComplete: "off",
|
|
145
|
+
spellCheck: !1
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
/* @__PURE__ */ t("kbd", { className: "bear-hidden sm:bear-inline-flex bear-items-center bear-px-1.5 bear-py-0.5 bear-rounded bear-text-[10px] bear-font-mono bear-text-gray-400 dark:bear-text-gray-500 bear-bg-gray-100 dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700", children: "ESC" })
|
|
149
|
+
] }),
|
|
150
|
+
/* @__PURE__ */ b(
|
|
151
|
+
"div",
|
|
152
|
+
{
|
|
153
|
+
ref: C,
|
|
154
|
+
className: "Bear-Spotlight__results bear-max-h-[400px] bear-overflow-y-auto bear-py-2",
|
|
155
|
+
role: "listbox",
|
|
156
|
+
children: [
|
|
157
|
+
c.length === 0 && /* @__PURE__ */ t("div", { className: "Bear-Spotlight__empty bear-px-4 bear-py-8 bear-text-center bear-text-gray-500 dark:bear-text-gray-400 bear-text-sm", children: A }),
|
|
158
|
+
Array.from(R.entries()).map(([e, r]) => /* @__PURE__ */ b("div", { className: "Bear-Spotlight__group", children: [
|
|
159
|
+
e && /* @__PURE__ */ t("div", { className: "Bear-Spotlight__group-title bear-px-4 bear-py-1.5 bear-text-xs bear-font-semibold bear-uppercase bear-tracking-wider bear-text-gray-400 dark:bear-text-gray-500", children: e }),
|
|
160
|
+
r.map((a) => {
|
|
161
|
+
k++;
|
|
162
|
+
const _ = k === p, j = k;
|
|
163
|
+
return /* @__PURE__ */ b(
|
|
164
|
+
"button",
|
|
165
|
+
{
|
|
166
|
+
className: m(
|
|
167
|
+
"Bear-Spotlight__action",
|
|
168
|
+
"bear-w-full bear-flex bear-items-center bear-gap-3 bear-px-4 bear-py-2.5 bear-text-left bear-cursor-pointer",
|
|
169
|
+
"bear-transition-colors bear-duration-100",
|
|
170
|
+
_ ? "bear-bg-gray-100 dark:bear-bg-gray-800" : "hover:bear-bg-gray-50 dark:hover:bear-bg-gray-800/50",
|
|
171
|
+
a.disabled && "bear-opacity-50 bear-cursor-not-allowed"
|
|
172
|
+
),
|
|
173
|
+
"data-active": _,
|
|
174
|
+
onMouseEnter: () => h(j),
|
|
175
|
+
onClick: () => {
|
|
176
|
+
a.disabled || (a.onTrigger(), d(!1));
|
|
177
|
+
},
|
|
178
|
+
role: "option",
|
|
179
|
+
"aria-selected": _,
|
|
180
|
+
"aria-disabled": a.disabled,
|
|
181
|
+
children: [
|
|
182
|
+
a.icon && /* @__PURE__ */ t("span", { className: "Bear-Spotlight__action-icon bear-text-gray-500 dark:bear-text-gray-400 bear-shrink-0", children: a.icon }),
|
|
183
|
+
/* @__PURE__ */ b("div", { className: "Bear-Spotlight__action-body bear-flex-1 bear-min-w-0", children: [
|
|
184
|
+
/* @__PURE__ */ t("div", { className: "Bear-Spotlight__action-label bear-text-sm bear-font-medium bear-text-gray-900 dark:bear-text-white bear-truncate", children: S ? I(a.label, n) : a.label }),
|
|
185
|
+
a.description && /* @__PURE__ */ t("div", { className: "Bear-Spotlight__action-desc bear-text-xs bear-text-gray-500 dark:bear-text-gray-400 bear-truncate", children: S ? I(a.description, n) : a.description })
|
|
186
|
+
] }),
|
|
187
|
+
a.rightSection && /* @__PURE__ */ t("span", { className: "Bear-Spotlight__action-right bear-shrink-0", children: a.rightSection })
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
a.id
|
|
191
|
+
);
|
|
192
|
+
})
|
|
193
|
+
] }, e))
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
),
|
|
197
|
+
/* @__PURE__ */ b("div", { className: "Bear-Spotlight__footer bear-border-t bear-border-gray-200 dark:bear-border-gray-700 bear-px-4 bear-py-2 bear-flex bear-items-center bear-gap-4 bear-text-[11px] bear-text-gray-400 dark:bear-text-gray-500", children: [
|
|
198
|
+
/* @__PURE__ */ b("span", { className: "bear-flex bear-items-center bear-gap-1", children: [
|
|
199
|
+
/* @__PURE__ */ t("kbd", { className: "bear-px-1 bear-rounded bear-bg-gray-100 dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700", children: "↑↓" }),
|
|
200
|
+
"navigate"
|
|
201
|
+
] }),
|
|
202
|
+
/* @__PURE__ */ b("span", { className: "bear-flex bear-items-center bear-gap-1", children: [
|
|
203
|
+
/* @__PURE__ */ t("kbd", { className: "bear-px-1 bear-rounded bear-bg-gray-100 dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700", children: "↵" }),
|
|
204
|
+
"select"
|
|
205
|
+
] }),
|
|
206
|
+
/* @__PURE__ */ b("span", { className: "bear-flex bear-items-center bear-gap-1", children: [
|
|
207
|
+
/* @__PURE__ */ t("kbd", { className: "bear-px-1 bear-rounded bear-bg-gray-100 dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700", children: "esc" }),
|
|
208
|
+
"close"
|
|
209
|
+
] })
|
|
210
|
+
] })
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
};
|
|
218
|
+
export {
|
|
219
|
+
ee as Spotlight
|
|
220
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface SpotlightAction {
|
|
3
|
+
/** Unique ID */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Display label */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Description text */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** Left icon */
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
/** Right-side content (e.g. shortcut badge) */
|
|
12
|
+
rightSection?: ReactNode;
|
|
13
|
+
/** Group/category name */
|
|
14
|
+
group?: string;
|
|
15
|
+
/** Keywords for search matching */
|
|
16
|
+
keywords?: string[];
|
|
17
|
+
/** Callback when selected */
|
|
18
|
+
onTrigger: () => void;
|
|
19
|
+
/** Whether action is disabled */
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/** Nested actions (submenu) */
|
|
22
|
+
children?: SpotlightAction[];
|
|
23
|
+
}
|
|
24
|
+
export interface SpotlightProps {
|
|
25
|
+
/** Available actions */
|
|
26
|
+
actions: SpotlightAction[];
|
|
27
|
+
/** Whether spotlight is open */
|
|
28
|
+
open?: boolean;
|
|
29
|
+
/** Callback when open changes */
|
|
30
|
+
onOpenChange?: (open: boolean) => void;
|
|
31
|
+
/** Search placeholder */
|
|
32
|
+
placeholder?: string;
|
|
33
|
+
/** Keyboard shortcut to trigger (default: 'k') */
|
|
34
|
+
shortcutKey?: string;
|
|
35
|
+
/** Whether shortcut needs Cmd/Ctrl */
|
|
36
|
+
shortcutMod?: boolean;
|
|
37
|
+
/** Nothing found message */
|
|
38
|
+
nothingFoundMessage?: string;
|
|
39
|
+
/** Whether to highlight matches */
|
|
40
|
+
highlightMatches?: boolean;
|
|
41
|
+
/** Limit number of results */
|
|
42
|
+
limit?: number;
|
|
43
|
+
/** Custom filter function */
|
|
44
|
+
filter?: (query: string, actions: SpotlightAction[]) => SpotlightAction[];
|
|
45
|
+
/** Custom class name */
|
|
46
|
+
className?: string;
|
|
47
|
+
/** Custom style */
|
|
48
|
+
style?: React.CSSProperties;
|
|
49
|
+
/** Test ID */
|
|
50
|
+
testId?: string;
|
|
51
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("../../utils/cn.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("../../utils/cn.cjs");require("react");const o=({title:s,value:i,color:t="#6366f1",icon:n,onClick:r,className:a,...l})=>e.jsxs("div",{className:d.cn("relative overflow-hidden rounded-2xl p-6 transition-transform hover:scale-105 cursor-pointer",a),style:{background:`linear-gradient(135deg, ${t}dd, ${t}99)`},onClick:r,...l,children:[e.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 -mr-8 -mt-8 rounded-full opacity-20 bg-white"}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("p",{className:"text-white/80 text-sm font-medium mb-1",children:s}),e.jsx("p",{className:"text-white text-3xl font-bold mb-4",children:i}),r&&e.jsxs("button",{className:"flex items-center gap-2 px-4 py-1.5 bg-white/20 hover:bg-white/30 rounded-full text-white text-sm font-medium transition-colors",children:[n,"View All"]})]})]});exports.StatCard=o;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { cn as n } from "../../utils/cn.js";
|
|
3
|
-
|
|
3
|
+
import "react";
|
|
4
|
+
const p = ({
|
|
4
5
|
title: l,
|
|
5
|
-
value:
|
|
6
|
+
value: o,
|
|
6
7
|
color: r = "#6366f1",
|
|
7
|
-
icon:
|
|
8
|
+
icon: s,
|
|
8
9
|
onClick: i,
|
|
9
|
-
className:
|
|
10
|
+
className: a,
|
|
10
11
|
...d
|
|
11
12
|
}) => /* @__PURE__ */ e(
|
|
12
13
|
"div",
|
|
13
14
|
{
|
|
14
15
|
className: n(
|
|
15
16
|
"relative overflow-hidden rounded-2xl p-6 transition-transform hover:scale-105 cursor-pointer",
|
|
16
|
-
|
|
17
|
+
a
|
|
17
18
|
),
|
|
18
19
|
style: { background: `linear-gradient(135deg, ${r}dd, ${r}99)` },
|
|
19
20
|
onClick: i,
|
|
@@ -22,9 +23,9 @@ const h = ({
|
|
|
22
23
|
/* @__PURE__ */ t("div", { className: "absolute top-0 right-0 w-32 h-32 -mr-8 -mt-8 rounded-full opacity-20 bg-white" }),
|
|
23
24
|
/* @__PURE__ */ e("div", { className: "relative z-10", children: [
|
|
24
25
|
/* @__PURE__ */ t("p", { className: "text-white/80 text-sm font-medium mb-1", children: l }),
|
|
25
|
-
/* @__PURE__ */ t("p", { className: "text-white text-3xl font-bold mb-4", children:
|
|
26
|
+
/* @__PURE__ */ t("p", { className: "text-white text-3xl font-bold mb-4", children: o }),
|
|
26
27
|
i && /* @__PURE__ */ e("button", { className: "flex items-center gap-2 px-4 py-1.5 bg-white/20 hover:bg-white/30 rounded-full text-white text-sm font-medium transition-colors", children: [
|
|
27
|
-
|
|
28
|
+
s,
|
|
28
29
|
"View All"
|
|
29
30
|
] })
|
|
30
31
|
] })
|
|
@@ -32,5 +33,5 @@ const h = ({
|
|
|
32
33
|
}
|
|
33
34
|
);
|
|
34
35
|
export {
|
|
35
|
-
|
|
36
|
+
p as StatCard
|
|
36
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("../../utils/cn.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("../../utils/cn.cjs");require("react");const v=({title:u,value:t,prefix:b,suffix:l,icon:n,trend:r,description:c,loading:h=!1,precision:d=0,className:x,size:s="md",variant:m="default"})=>{const j=typeof t=="number"?t.toLocaleString(void 0,{minimumFractionDigits:d,maximumFractionDigits:d}):t,i={sm:{value:"bear-text-xl",title:"bear-text-xs",icon:"bear-w-8 bear-h-8"},md:{value:"bear-text-3xl",title:"bear-text-sm",icon:"bear-w-10 bear-h-10"},lg:{value:"bear-text-4xl",title:"bear-text-base",icon:"bear-w-12 bear-h-12"}},o={default:"",card:"bear-bg-zinc-800 bear-rounded-xl bear-p-4 bear-border bear-border-zinc-700",minimal:""};return h?e.jsx("div",{className:a.cn(o[m],x),children:e.jsxs("div",{className:"bear-animate-pulse",children:[e.jsx("div",{className:"bear-h-4 bear-w-20 bear-bg-zinc-700 bear-rounded bear-mb-2"}),e.jsx("div",{className:"bear-h-8 bear-w-32 bear-bg-zinc-700 bear-rounded"})]})}):e.jsxs("div",{className:a.cn("bear-flex bear-items-start bear-gap-3",o[m],x),children:[n&&e.jsx("div",{className:a.cn("bear-flex bear-items-center bear-justify-center bear-rounded-lg bear-bg-pink-500/20 bear-text-pink-400",i[s].icon),children:n}),e.jsxs("div",{children:[e.jsx("div",{className:a.cn("bear-text-zinc-400 bear-mb-1",i[s].title),children:u}),e.jsxs("div",{className:a.cn("bear-font-bold bear-text-white bear-flex bear-items-baseline bear-gap-1",i[s].value),children:[b&&e.jsx("span",{className:"bear-text-zinc-400",children:b}),j,l&&e.jsx("span",{className:"bear-text-zinc-400 bear-text-lg",children:l})]}),r&&e.jsxs("div",{className:a.cn("bear-flex bear-items-center bear-gap-1 bear-mt-1 bear-text-sm",r.isUpward!==!1?"bear-text-green-400":"bear-text-red-400"),children:[e.jsx("svg",{className:"bear-w-4 bear-h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:r.isUpward!==!1?"M5 10l7-7m0 0l7 7m-7-7v18":"M19 14l-7 7m0 0l-7-7m7 7V3"})}),Math.abs(r.value),"%"]}),c&&e.jsx("div",{className:"bear-text-xs bear-text-zinc-500 bear-mt-1",children:c})]})]})};exports.Statistic=v;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
2
|
import { cn as a } from "../../utils/cn.js";
|
|
3
|
-
|
|
3
|
+
import "react";
|
|
4
|
+
const w = ({
|
|
4
5
|
title: u,
|
|
5
6
|
value: b,
|
|
6
7
|
prefix: l,
|
|
7
8
|
suffix: n,
|
|
8
9
|
icon: c,
|
|
9
10
|
trend: t,
|
|
10
|
-
description:
|
|
11
|
+
description: m,
|
|
11
12
|
loading: v = !1,
|
|
12
|
-
precision:
|
|
13
|
+
precision: d = 0,
|
|
13
14
|
className: o,
|
|
14
15
|
size: i = "md",
|
|
15
16
|
variant: x = "default"
|
|
16
17
|
}) => {
|
|
17
|
-
const g = typeof b == "number" ? b.toLocaleString(void 0, { minimumFractionDigits:
|
|
18
|
+
const g = typeof b == "number" ? b.toLocaleString(void 0, { minimumFractionDigits: d, maximumFractionDigits: d }) : b, s = {
|
|
18
19
|
sm: { value: "bear-text-xl", title: "bear-text-xs", icon: "bear-w-8 bear-h-8" },
|
|
19
20
|
md: { value: "bear-text-3xl", title: "bear-text-sm", icon: "bear-w-10 bear-h-10" },
|
|
20
21
|
lg: { value: "bear-text-4xl", title: "bear-text-base", icon: "bear-w-12 bear-h-12" }
|
|
@@ -46,10 +47,10 @@ const N = ({
|
|
|
46
47
|
Math.abs(t.value),
|
|
47
48
|
"%"
|
|
48
49
|
] }),
|
|
49
|
-
|
|
50
|
+
m && /* @__PURE__ */ e("div", { className: "bear-text-xs bear-text-zinc-500 bear-mt-1", children: m })
|
|
50
51
|
] })
|
|
51
52
|
] });
|
|
52
53
|
};
|
|
53
54
|
export {
|
|
54
|
-
|
|
55
|
+
w as Statistic
|
|
55
56
|
};
|
|
@@ -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"),e=require("../../utils/cn.cjs");require("react");const g="Bear-Switch bear-inline-flex bear-items-center bear-gap-3 bear-cursor-pointer",h="bear-opacity-50 bear-cursor-not-allowed",C="Bear-Switch__track bear-relative bear-inline-flex bear-items-center bear-shrink-0 bear-rounded-full bear-transition-colors bear-duration-200 focus-within:bear-ring-2 focus-within:bear-ring-pink-500 focus-within:bear-ring-offset-2 focus-within:bear-ring-offset-white dark:focus-within:bear-ring-offset-zinc-900",p="bear-bg-pink-500",E="bear-bg-gray-300 dark:bear-bg-gray-600",A="Bear-Switch__thumb bear-absolute bear-top-0.5 bear-left-0.5 bear-rounded-full bear-bg-white bear-shadow bear-transition-transform bear-duration-200 bear-flex bear-items-center bear-justify-center",y="Bear-Switch__label bear-text-sm bear-text-gray-700 dark:bear-text-gray-300",l="Bear-Switch__icon bear-flex bear-items-center bear-justify-center",j={sm:{track:"bear-w-8 bear-h-4",thumb:"bear-w-3 bear-h-3",translate:"bear-translate-x-4",iconSize:8},md:{track:"bear-w-11 bear-h-6",thumb:"bear-w-5 bear-h-5",translate:"bear-translate-x-5",iconSize:12},lg:{track:"bear-w-14 bear-h-7",thumb:"bear-w-6 bear-h-6",translate:"bear-translate-x-7",iconSize:16}},T=({label:o,checked:a=!1,onCheckedChange:t,size:u="md",disabled:s=!1,uncheckedIcon:n,checkedIcon:b,showIconsInThumb:S=!1,className:f,testId:x,id:_,...m})=>{const w=()=>{s||t==null||t(!a)},i=j[u],c=n||b;return r.jsxs("label",{id:_,"data-testid":x,className:e.cn(g,s&&h,f),children:[r.jsx("input",{type:"checkbox",checked:a,onChange:w,disabled:s,className:"bear-sr-only",...m}),r.jsxs("span",{className:e.cn(C,a?p:E,i.track),children:[c&&!S&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:e.cn(l,"bear-absolute bear-left-1",a?"bear-text-white":"bear-text-transparent","bear-transition-colors bear-duration-200"),children:b}),r.jsx("span",{className:e.cn(l,"bear-absolute bear-right-1",a?"bear-text-transparent":"bear-text-gray-600 dark:bear-text-gray-400","bear-transition-colors bear-duration-200"),children:n})]}),r.jsx("span",{className:e.cn(A,a&&i.translate,i.thumb),children:c&&S&&r.jsx("span",{className:e.cn(l,a?"bear-text-pink-500":"bear-text-gray-400"),children:a?b:n})})]}),o&&r.jsx("span",{className:y,children:o})]})};exports.Switch=T;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { jsxs as o, jsx as r, Fragment as
|
|
1
|
+
import { jsxs as o, jsx as r, Fragment as h } from "react/jsx-runtime";
|
|
2
2
|
import { cn as e } from "../../utils/cn.js";
|
|
3
|
+
import "react";
|
|
3
4
|
const C = "Bear-Switch bear-inline-flex bear-items-center bear-gap-3 bear-cursor-pointer", g = "bear-opacity-50 bear-cursor-not-allowed", E = "Bear-Switch__track bear-relative bear-inline-flex bear-items-center bear-shrink-0 bear-rounded-full bear-transition-colors bear-duration-200 focus-within:bear-ring-2 focus-within:bear-ring-pink-500 focus-within:bear-ring-offset-2 focus-within:bear-ring-offset-white dark:focus-within:bear-ring-offset-zinc-900", A = "bear-bg-pink-500", y = "bear-bg-gray-300 dark:bear-bg-gray-600", T = "Bear-Switch__thumb bear-absolute bear-top-0.5 bear-left-0.5 bear-rounded-full bear-bg-white bear-shadow bear-transition-transform bear-duration-200 bear-flex bear-items-center bear-justify-center", H = "Bear-Switch__label bear-text-sm bear-text-gray-700 dark:bear-text-gray-300", l = "Bear-Switch__icon bear-flex bear-items-center bear-justify-center", L = {
|
|
4
5
|
sm: {
|
|
5
6
|
track: "bear-w-8 bear-h-4",
|
|
@@ -19,7 +20,7 @@ const C = "Bear-Switch bear-inline-flex bear-items-center bear-gap-3 bear-cursor
|
|
|
19
20
|
translate: "bear-translate-x-7",
|
|
20
21
|
iconSize: 16
|
|
21
22
|
}
|
|
22
|
-
},
|
|
23
|
+
}, W = ({
|
|
23
24
|
label: S,
|
|
24
25
|
checked: a = !1,
|
|
25
26
|
onCheckedChange: t,
|
|
@@ -30,16 +31,16 @@ const C = "Bear-Switch bear-inline-flex bear-items-center bear-gap-3 bear-cursor
|
|
|
30
31
|
showIconsInThumb: c = !1,
|
|
31
32
|
className: m,
|
|
32
33
|
testId: u,
|
|
33
|
-
id:
|
|
34
|
-
...
|
|
34
|
+
id: p,
|
|
35
|
+
...w
|
|
35
36
|
}) => {
|
|
36
|
-
const
|
|
37
|
+
const x = () => {
|
|
37
38
|
s || t == null || t(!a);
|
|
38
39
|
}, i = L[_], f = b || n;
|
|
39
40
|
return /* @__PURE__ */ o(
|
|
40
41
|
"label",
|
|
41
42
|
{
|
|
42
|
-
id:
|
|
43
|
+
id: p,
|
|
43
44
|
"data-testid": u,
|
|
44
45
|
className: e(
|
|
45
46
|
C,
|
|
@@ -52,10 +53,10 @@ const C = "Bear-Switch bear-inline-flex bear-items-center bear-gap-3 bear-cursor
|
|
|
52
53
|
{
|
|
53
54
|
type: "checkbox",
|
|
54
55
|
checked: a,
|
|
55
|
-
onChange:
|
|
56
|
+
onChange: x,
|
|
56
57
|
disabled: s,
|
|
57
58
|
className: "bear-sr-only",
|
|
58
|
-
...
|
|
59
|
+
...w
|
|
59
60
|
}
|
|
60
61
|
),
|
|
61
62
|
/* @__PURE__ */ o(
|
|
@@ -67,7 +68,7 @@ const C = "Bear-Switch bear-inline-flex bear-items-center bear-gap-3 bear-cursor
|
|
|
67
68
|
i.track
|
|
68
69
|
),
|
|
69
70
|
children: [
|
|
70
|
-
f && !c && /* @__PURE__ */ o(
|
|
71
|
+
f && !c && /* @__PURE__ */ o(h, { children: [
|
|
71
72
|
/* @__PURE__ */ r("span", { className: e(
|
|
72
73
|
l,
|
|
73
74
|
"bear-absolute bear-left-1",
|
|
@@ -104,5 +105,5 @@ const C = "Bear-Switch bear-inline-flex bear-items-center bear-gap-3 bear-cursor
|
|
|
104
105
|
);
|
|
105
106
|
};
|
|
106
107
|
export {
|
|
107
|
-
|
|
108
|
+
W as Switch
|
|
108
109
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("../../../../utils/cn.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("../../../../utils/cn.cjs");require("react");const e=require("../../TimePicker.constants.cjs"),O=({selectedHour:r,setSelectedHour:I,selectedMinute:_,setSelectedMinute:a,period:l,setPeriod:C,format:T,hours:n,minutes:N,timeValue:P,clearable:d,onChange:S,onConfirm:t,onClose:m,translations:A})=>{const c={...e.TIMEPICKER_DEFAULT_TRANSLATIONS,...A};return s.jsxs("div",{className:e.TIMEPICKER_DROPDOWN_CLASSES,children:[s.jsxs("div",{className:"Bear-TimePicker__columns bear-flex bear-gap-2 bear-mb-3",children:[s.jsxs("div",{className:"Bear-TimePicker__column bear-flex-1",children:[s.jsx("div",{className:e.TIMEPICKER_COLUMN_HEADER_CLASSES,children:c.hour}),s.jsx("div",{className:e.TIMEPICKER_COLUMN_CLASSES,children:n.map(E=>s.jsx("button",{onClick:()=>I(E),className:i.cn(e.TIMEPICKER_OPTION_CLASSES,r===E?e.TIMEPICKER_OPTION_ACTIVE_CLASSES:e.TIMEPICKER_OPTION_INACTIVE_CLASSES),children:E.toString().padStart(2,"0")},E))})]}),s.jsxs("div",{className:"Bear-TimePicker__column bear-flex-1",children:[s.jsx("div",{className:e.TIMEPICKER_COLUMN_HEADER_CLASSES,children:c.minute}),s.jsx("div",{className:e.TIMEPICKER_COLUMN_CLASSES,children:N.map(E=>s.jsx("button",{onClick:()=>a(E),className:i.cn(e.TIMEPICKER_OPTION_CLASSES,_===E?e.TIMEPICKER_OPTION_ACTIVE_CLASSES:e.TIMEPICKER_OPTION_INACTIVE_CLASSES),children:E.toString().padStart(2,"0")},E))})]}),T==="12h"&&s.jsxs("div",{className:"Bear-TimePicker__column bear-flex-1",children:[s.jsx("div",{className:e.TIMEPICKER_COLUMN_HEADER_CLASSES,children:c.period}),s.jsx("div",{className:"bear-space-y-1",children:["AM","PM"].map(E=>s.jsx("button",{onClick:()=>C(E),className:i.cn(e.TIMEPICKER_OPTION_CLASSES,"bear-py-2",l===E?e.TIMEPICKER_OPTION_ACTIVE_CLASSES:e.TIMEPICKER_OPTION_INACTIVE_CLASSES),children:E},E))})]})]}),s.jsxs("div",{className:e.TIMEPICKER_FOOTER_CLASSES,children:[d&&P&&s.jsx("button",{onClick:()=>{S==null||S(null),m()},className:e.TIMEPICKER_CLEAR_BUTTON_CLASSES,children:c.cancel}),s.jsx("button",{onClick:t,className:e.TIMEPICKER_CONFIRM_BUTTON_CLASSES,children:c.ok})]})]})};exports.TimePickerColumnsDropdown=O;
|
package/dist/components/TimePicker/components/TimePickerColumnsDropdown/TimePickerColumnsDropdown.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { jsxs as a, jsx as c } from "react/jsx-runtime";
|
|
2
2
|
import { cn as r } from "../../../../utils/cn.js";
|
|
3
|
-
import
|
|
4
|
-
|
|
3
|
+
import "react";
|
|
4
|
+
import { TIMEPICKER_DROPDOWN_CLASSES as u, TIMEPICKER_DEFAULT_TRANSLATIONS as L, TIMEPICKER_COLUMN_HEADER_CLASSES as s, TIMEPICKER_COLUMN_CLASSES as d, TIMEPICKER_OPTION_ACTIVE_CLASSES as m, TIMEPICKER_OPTION_INACTIVE_CLASSES as E, TIMEPICKER_OPTION_CLASSES as n, TIMEPICKER_FOOTER_CLASSES as h, TIMEPICKER_CLEAR_BUTTON_CLASSES as p, TIMEPICKER_CONFIRM_BUTTON_CLASSES as v } from "../../TimePicker.constants.js";
|
|
5
|
+
const B = ({
|
|
5
6
|
selectedHour: S,
|
|
6
7
|
setSelectedHour: _,
|
|
7
8
|
selectedMinute: N,
|
|
8
|
-
setSelectedMinute:
|
|
9
|
-
period:
|
|
10
|
-
setPeriod:
|
|
11
|
-
format:
|
|
9
|
+
setSelectedMinute: o,
|
|
10
|
+
period: t,
|
|
11
|
+
setPeriod: I,
|
|
12
|
+
format: T,
|
|
12
13
|
hours: C,
|
|
13
14
|
minutes: P,
|
|
14
15
|
timeValue: A,
|
|
@@ -29,7 +30,7 @@ const x = ({
|
|
|
29
30
|
onClick: () => _(e),
|
|
30
31
|
className: r(
|
|
31
32
|
n,
|
|
32
|
-
S === e ?
|
|
33
|
+
S === e ? m : E
|
|
33
34
|
),
|
|
34
35
|
children: e.toString().padStart(2, "0")
|
|
35
36
|
},
|
|
@@ -41,26 +42,26 @@ const x = ({
|
|
|
41
42
|
/* @__PURE__ */ c("div", { className: d, children: P.map((e) => /* @__PURE__ */ c(
|
|
42
43
|
"button",
|
|
43
44
|
{
|
|
44
|
-
onClick: () =>
|
|
45
|
+
onClick: () => o(e),
|
|
45
46
|
className: r(
|
|
46
47
|
n,
|
|
47
|
-
N === e ?
|
|
48
|
+
N === e ? m : E
|
|
48
49
|
),
|
|
49
50
|
children: e.toString().padStart(2, "0")
|
|
50
51
|
},
|
|
51
52
|
e
|
|
52
53
|
)) })
|
|
53
54
|
] }),
|
|
54
|
-
|
|
55
|
+
T === "12h" && /* @__PURE__ */ a("div", { className: "Bear-TimePicker__column bear-flex-1", children: [
|
|
55
56
|
/* @__PURE__ */ c("div", { className: s, children: i.period }),
|
|
56
57
|
/* @__PURE__ */ c("div", { className: "bear-space-y-1", children: ["AM", "PM"].map((e) => /* @__PURE__ */ c(
|
|
57
58
|
"button",
|
|
58
59
|
{
|
|
59
|
-
onClick: () =>
|
|
60
|
+
onClick: () => I(e),
|
|
60
61
|
className: r(
|
|
61
62
|
n,
|
|
62
63
|
"bear-py-2",
|
|
63
|
-
|
|
64
|
+
t === e ? m : E
|
|
64
65
|
),
|
|
65
66
|
children: e
|
|
66
67
|
},
|
|
@@ -71,11 +72,11 @@ const x = ({
|
|
|
71
72
|
/* @__PURE__ */ a("div", { className: h, children: [
|
|
72
73
|
O && A && /* @__PURE__ */ c("button", { onClick: () => {
|
|
73
74
|
l == null || l(null), M();
|
|
74
|
-
}, className:
|
|
75
|
-
/* @__PURE__ */ c("button", { onClick: R, className:
|
|
75
|
+
}, className: p, children: i.cancel }),
|
|
76
|
+
/* @__PURE__ */ c("button", { onClick: R, className: v, children: i.ok })
|
|
76
77
|
] })
|
|
77
78
|
] });
|
|
78
79
|
};
|
|
79
80
|
export {
|
|
80
|
-
|
|
81
|
+
B as TimePickerColumnsDropdown
|
|
81
82
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),m=require("../../../utils/cn.cjs");require("react");const e=require("../TimePicker.constants.cjs"),E=({values:t,isHourMode:n,format:i,selectedHour:r,selectedMinute:l,onSelect:b,className:h})=>{const f=c=>n?(c*30-90)*(Math.PI/180):(c*(360/t.length)-90)*(Math.PI/180),s=(n?(i==="12h"?r===12?0:r%12:r)*30-90:l*6-90)*Math.PI/180;return a.jsxs("svg",{viewBox:"0 0 200 200",className:m.cn("Bear-TimePicker__clock-face bear-w-full bear-h-full",h),children:[a.jsx("circle",{cx:e.CLOCK_CENTER,cy:e.CLOCK_CENTER,r:e.CLOCK_RADIUS,className:"Bear-TimePicker__clock-face-circle bear-fill-none bear-stroke-gray-200 dark:bear-stroke-zinc-700 bear-stroke-2"}),t.map((c,x)=>{const C=f(x),o=e.CLOCK_CENTER+e.CLOCK_RADIUS*.85*Math.cos(C),_=e.CLOCK_CENTER+e.CLOCK_RADIUS*.85*Math.sin(C),k=n?i==="12h"?c===12?r===12:r%12===c:r===c:l===c;return a.jsxs("g",{onClick:()=>b(c),className:"Bear-TimePicker__clock-face-item bear-cursor-pointer",children:[k&&a.jsx("circle",{cx:o,cy:_,r:14,className:"Bear-TimePicker__clock-face-dot bear-fill-blue-500"}),a.jsx("text",{x:o,y:_,textAnchor:"middle",dominantBaseline:"middle",className:m.cn("Bear-TimePicker__clock-face-text bear-text-sm bear-font-medium bear-pointer-events-none",k?"bear-fill-white":"bear-fill-gray-700 dark:bear-fill-zinc-300"),children:typeof c=="number"?c.toString().padStart(2,"0"):c})]},c)}),a.jsx("line",{x1:e.CLOCK_CENTER,y1:e.CLOCK_CENTER,x2:e.CLOCK_CENTER+e.CLOCK_RADIUS*.6*Math.cos(s),y2:e.CLOCK_CENTER+e.CLOCK_RADIUS*.6*Math.sin(s),className:"Bear-TimePicker__clock-face-hand bear-stroke-blue-500 bear-stroke-2",strokeLinecap:"round"})]})};exports.ClockFaceSvg=E;
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { jsxs as f, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { cn as _ } from "../../../utils/cn.js";
|
|
3
|
-
import
|
|
4
|
-
|
|
3
|
+
import "react";
|
|
4
|
+
import { CLOCK_RADIUS as c, CLOCK_CENTER as r } from "../TimePicker.constants.js";
|
|
5
|
+
const T = ({
|
|
5
6
|
values: i,
|
|
6
7
|
isHourMode: t,
|
|
7
8
|
format: l,
|
|
8
|
-
selectedHour:
|
|
9
|
+
selectedHour: a,
|
|
9
10
|
selectedMinute: o,
|
|
10
11
|
onSelect: g,
|
|
11
12
|
className: x
|
|
12
13
|
}) => {
|
|
13
|
-
const d = (e) => t ? (e * 30 - 90) * (Math.PI / 180) : (e * (360 / i.length) - 90) * (Math.PI / 180), s = (t ? (l === "12h" ?
|
|
14
|
+
const d = (e) => t ? (e * 30 - 90) * (Math.PI / 180) : (e * (360 / i.length) - 90) * (Math.PI / 180), s = (t ? (l === "12h" ? a === 12 ? 0 : a % 12 : a) * 30 - 90 : o * 6 - 90) * Math.PI / 180;
|
|
14
15
|
return /* @__PURE__ */ f("svg", { viewBox: "0 0 200 200", className: _("Bear-TimePicker__clock-face bear-w-full bear-h-full", x), children: [
|
|
15
16
|
/* @__PURE__ */ n(
|
|
16
17
|
"circle",
|
|
17
18
|
{
|
|
18
|
-
cx:
|
|
19
|
-
cy:
|
|
19
|
+
cx: r,
|
|
20
|
+
cy: r,
|
|
20
21
|
r: c,
|
|
21
22
|
className: "Bear-TimePicker__clock-face-circle bear-fill-none bear-stroke-gray-200 dark:bear-stroke-zinc-700 bear-stroke-2"
|
|
22
23
|
}
|
|
23
24
|
),
|
|
24
25
|
i.map((e, p) => {
|
|
25
|
-
const m = d(p), k =
|
|
26
|
+
const m = d(p), k = r + c * 0.85 * Math.cos(m), h = r + c * 0.85 * Math.sin(m), b = t ? l === "12h" ? e === 12 ? a === 12 : a % 12 === e : a === e : o === e;
|
|
26
27
|
return /* @__PURE__ */ f(
|
|
27
28
|
"g",
|
|
28
29
|
{
|
|
@@ -52,10 +53,10 @@ const N = ({
|
|
|
52
53
|
/* @__PURE__ */ n(
|
|
53
54
|
"line",
|
|
54
55
|
{
|
|
55
|
-
x1:
|
|
56
|
-
y1:
|
|
57
|
-
x2:
|
|
58
|
-
y2:
|
|
56
|
+
x1: r,
|
|
57
|
+
y1: r,
|
|
58
|
+
x2: r + c * 0.6 * Math.cos(s),
|
|
59
|
+
y2: r + c * 0.6 * Math.sin(s),
|
|
59
60
|
className: "Bear-TimePicker__clock-face-hand bear-stroke-blue-500 bear-stroke-2",
|
|
60
61
|
strokeLinecap: "round"
|
|
61
62
|
}
|
|
@@ -63,5 +64,5 @@ const N = ({
|
|
|
63
64
|
] });
|
|
64
65
|
};
|
|
65
66
|
export {
|
|
66
|
-
|
|
67
|
+
T as ClockFaceSvg
|
|
67
68
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),x=require("../../utils/cn.cjs"),M=require("./Transition.const.cjs"),P=({show:a,name:y="fade",duration:i=M.DEFAULT_DURATION,delay:n=0,easing:I=M.DEFAULT_EASING,enterFrom:l,enterTo:o,leaveFrom:f,leaveTo:N,unmountOnHide:T=!0,onEnter:m,onEntered:d,onLeave:c,onLeft:S,children:v,className:R,as:A="div"})=>{const[q,F]=s.useState(a),[b,u]=s.useState(a?"idle":"exit-active"),e=s.useRef(null);if(s.useEffect(()=>(e.current&&clearTimeout(e.current),a?(F(!0),u("enter"),m==null||m(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{u("enter-active"),e.current=setTimeout(()=>{u("idle"),d==null||d()},i+n)})})):(u("exit"),c==null||c(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{u("exit-active"),e.current=setTimeout(()=>{T&&F(!1),S==null||S()},i+n)})})),()=>{e.current&&clearTimeout(e.current)}),[a]),!q&&T)return null;const t=M.TRANSITION_PRESETS[y];let r={transition:`all ${i}ms ${I} ${n}ms`};switch(b){case"enter":r={...r,...l??(t==null?void 0:t.enter)};break;case"enter-active":case"idle":r={...r,...o??(t==null?void 0:t.enterActive)};break;case"exit":r={...r,...f??(t==null?void 0:t.exit)};break;case"exit-active":r={...r,...N??(t==null?void 0:t.exitActive)};break}return s.createElement(A,{className:x.cn(R),style:r},v)},$=({children:a,initial:y,animate:i,exit:n,transition:I={},whileHover:l,whileTap:o,inView:f=!0,as:N="div",className:T,testId:m})=>{const[d,c]=s.useState(y??{}),[S,v]=s.useState(!1),[R,A]=s.useState(!1),q=s.useRef(!1),{duration:F=300,delay:b=0,easing:u=M.DEFAULT_EASING}=I;s.useEffect(()=>{q.current?f&&i?c(i):!f&&n&&c(n):(q.current=!0,requestAnimationFrame(()=>{f&&i&&c(i)}))},[f]);let e={...d,transition:`all ${F}ms ${u} ${b}ms`};return R&&o?e={...e,...o}:S&&l&&(e={...e,...l}),s.createElement(N,{className:x.cn(T),style:e,"data-testid":m,onMouseEnter:l?()=>v(!0):void 0,onMouseLeave:l?()=>{v(!1),A(!1)}:void 0,onMouseDown:o?()=>A(!0):void 0,onMouseUp:o?()=>A(!1):void 0},a)};exports.Motion=$;exports.Transition=P;
|