@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,70 @@
|
|
|
1
|
+
import { jsxs as k, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useState as C, useRef as H, useCallback as w } from "react";
|
|
3
|
+
import { DEFAULT_DIRECTION as A, DEFAULT_FIRST_SIZE as M, MIN_SIZE as O, MAX_SIZE as U, EVENT_POINTER_MOVE as p, EVENT_POINTER_UP as v, HANDLE_WIDTH as E } from "./ResizablePanel.const.js";
|
|
4
|
+
import { clampSize as $, getResizePercentage as B } from "./ResizablePanel.utils.js";
|
|
5
|
+
import { cn as I } from "../../utils/cn.js";
|
|
6
|
+
const X = (z) => {
|
|
7
|
+
const {
|
|
8
|
+
first: g,
|
|
9
|
+
second: N,
|
|
10
|
+
direction: o = A,
|
|
11
|
+
defaultSize: S = M,
|
|
12
|
+
minSize: s = O,
|
|
13
|
+
maxSize: l = U,
|
|
14
|
+
onResize: i,
|
|
15
|
+
className: _,
|
|
16
|
+
testId: P
|
|
17
|
+
} = z, [t, x] = C(S), c = H(null), b = w((e) => $(e, s, l), [s, l]), R = w(
|
|
18
|
+
(e) => {
|
|
19
|
+
var f;
|
|
20
|
+
e.preventDefault();
|
|
21
|
+
const r = e.target;
|
|
22
|
+
(f = r.setPointerCapture) == null || f.call(r, e.pointerId);
|
|
23
|
+
const m = (a) => {
|
|
24
|
+
if (!c.current) return;
|
|
25
|
+
const y = c.current.getBoundingClientRect(), L = B(y, o, a.clientX, a.clientY), u = b(L);
|
|
26
|
+
x(u), i == null || i(u);
|
|
27
|
+
}, h = () => {
|
|
28
|
+
var a;
|
|
29
|
+
(a = r.releasePointerCapture) == null || a.call(r, e.pointerId), window.removeEventListener(p, m), window.removeEventListener(v, h);
|
|
30
|
+
};
|
|
31
|
+
window.addEventListener(p, m), window.addEventListener(v, h);
|
|
32
|
+
},
|
|
33
|
+
[o, b, i]
|
|
34
|
+
), n = o === "horizontal", T = n ? { width: `${t}%`, minWidth: 0 } : { height: `${t}%`, minHeight: 0 }, D = n ? { width: `${100 - t}%`, minWidth: 0 } : { height: `${100 - t}%`, minHeight: 0 };
|
|
35
|
+
return /* @__PURE__ */ k(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
ref: c,
|
|
39
|
+
"data-testid": P,
|
|
40
|
+
className: I(
|
|
41
|
+
"Bear-ResizablePanel bear-flex bear-w-full bear-h-full bear-overflow-hidden",
|
|
42
|
+
n ? "bear-flex-row" : "bear-flex-col",
|
|
43
|
+
_
|
|
44
|
+
),
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ d("div", { className: "bear-overflow-auto bear-shrink-0", style: T, children: g }),
|
|
47
|
+
/* @__PURE__ */ d(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
role: "separator",
|
|
51
|
+
"aria-valuenow": t,
|
|
52
|
+
"aria-valuemin": s,
|
|
53
|
+
"aria-valuemax": l,
|
|
54
|
+
tabIndex: 0,
|
|
55
|
+
onPointerDown: R,
|
|
56
|
+
className: I(
|
|
57
|
+
"Bear-ResizablePanel__handle bear-shrink-0 bear-bg-gray-200 dark:bear-bg-gray-700 hover:bear-bg-pink-500/30 bear-transition-colors bear-cursor-col-resize",
|
|
58
|
+
n ? "bear-w-1.5" : "bear-h-1.5 bear-w-full bear-cursor-row-resize"
|
|
59
|
+
),
|
|
60
|
+
style: n ? { width: E } : { height: E }
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
/* @__PURE__ */ d("div", { className: "bear-overflow-auto bear-shrink-0 bear-flex-1", style: D, children: N })
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
export {
|
|
69
|
+
X as ResizablePanel
|
|
70
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ResizablePanelProps {
|
|
3
|
+
/** First pane content */
|
|
4
|
+
first: ReactNode;
|
|
5
|
+
/** Second pane content */
|
|
6
|
+
second: ReactNode;
|
|
7
|
+
/** Layout direction */
|
|
8
|
+
direction?: 'horizontal' | 'vertical';
|
|
9
|
+
/** Default size of first pane (0–100, percentage) */
|
|
10
|
+
defaultSize?: number;
|
|
11
|
+
/** Minimum size of first pane (percentage) */
|
|
12
|
+
minSize?: number;
|
|
13
|
+
/** Maximum size of first pane (percentage) */
|
|
14
|
+
maxSize?: number;
|
|
15
|
+
/** Called when resize ends with new size (0–100) */
|
|
16
|
+
onResize?: (size: number) => void;
|
|
17
|
+
/** Class name for the root container */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** Test ID */
|
|
20
|
+
testId?: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./ResizablePanel.const.cjs");function r(e,t,i,a){return t==="horizontal"?(i-e.left)/e.width*n.PERCENTAGE_SCALE:(a-e.top)/e.height*n.PERCENTAGE_SCALE}function o(e,t,i){return Math.min(i,Math.max(t,e))}exports.clampSize=o;exports.getResizePercentage=r;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ResizablePanelProps } from './ResizablePanel.types';
|
|
2
|
+
/**
|
|
3
|
+
* Compute first pane size as a percentage (0–100) from pointer position and container rect.
|
|
4
|
+
* Used for both horizontal and vertical layouts.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getResizePercentage(rect: DOMRect, direction: NonNullable<ResizablePanelProps['direction']>, clientX: number, clientY: number): number;
|
|
7
|
+
/**
|
|
8
|
+
* Clamp a value between min and max (inclusive).
|
|
9
|
+
*/
|
|
10
|
+
export declare function clampSize(value: number, min: number, max: number): number;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PERCENTAGE_SCALE as n } from "./ResizablePanel.const.js";
|
|
2
|
+
function a(t, e, i, o) {
|
|
3
|
+
return e === "horizontal" ? (i - t.left) / t.width * n : (o - t.top) / t.height * n;
|
|
4
|
+
}
|
|
5
|
+
function h(t, e, i) {
|
|
6
|
+
return Math.min(i, Math.max(e, t));
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
h as clampSize,
|
|
10
|
+
a as getResizePercentage
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),o=require("react"),f=require("../../utils/cn.cjs"),w=require("./ResizableTextarea.const.cjs"),k=({minHeight:e=w.DEFAULT_MIN_HEIGHT,maxHeight:t=w.DEFAULT_MAX_HEIGHT,resizable:a=!0,className:x,style:y,testId:R,...T})=>{const h=o.useRef(null),[c,E]=o.useState(e),b=o.useRef(0),d=o.useRef(e),_=o.useCallback(r=>{var v,g;if(!a)return;r.preventDefault(),b.current=r.clientY,d.current=c,(g=(v=r.target).setPointerCapture)==null||g.call(v,r.pointerId);const l=s=>{const i=s.clientY-b.current;let n=d.current+i;e>0&&(n=Math.max(e,n)),t>0&&(n=Math.min(t,n)),E(n)},p=()=>{var s,i;(i=(s=r.target).releasePointerCapture)==null||i.call(s,r.pointerId),window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",p)};window.addEventListener("pointermove",l),window.addEventListener("pointerup",p)},[a,c,e,t]);return u.jsxs("div",{className:f.cn("Bear-ResizableTextarea bear-relative",x),"data-testid":R,children:[u.jsx("textarea",{ref:h,className:f.cn("bear-w-full bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-gray-600","bear-bg-white dark:bear-bg-gray-900 bear-text-gray-900 dark:bear-text-gray-100","bear-p-3 bear-resize-none focus:bear-outline-none focus:bear-ring-2 focus:bear-ring-pink-500/50"),style:{...y,minHeight:a?e:void 0,height:a?c:void 0,maxHeight:t>0?t:void 0},...T}),a&&u.jsx("div",{role:"separator",onPointerDown:_,className:"Bear-ResizableTextarea__handle bear-absolute bear-right-0 bear-bottom-0 bear-w-4 bear-h-4 bear-cursor-s-resize bear-opacity-50 hover:bear-opacity-100",style:{background:"linear-gradient(135deg, transparent 50%, currentColor 50%)"}})]})};exports.ResizableTextarea=k;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=80,t=400;exports.DEFAULT_MAX_HEIGHT=t;exports.DEFAULT_MIN_HEIGHT=T;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsxs as k, jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as d, useState as L, useCallback as _ } from "react";
|
|
3
|
+
import { cn as g } from "../../utils/cn.js";
|
|
4
|
+
import { DEFAULT_MIN_HEIGHT as D, DEFAULT_MAX_HEIGHT as I } from "./ResizableTextarea.const.js";
|
|
5
|
+
const P = ({
|
|
6
|
+
minHeight: e = D,
|
|
7
|
+
maxHeight: t = I,
|
|
8
|
+
resizable: a = !0,
|
|
9
|
+
className: w,
|
|
10
|
+
style: m,
|
|
11
|
+
testId: y,
|
|
12
|
+
...x
|
|
13
|
+
}) => {
|
|
14
|
+
const h = d(null), [i, E] = L(e), b = d(0), c = d(e), T = _((r) => {
|
|
15
|
+
var p, v;
|
|
16
|
+
if (!a) return;
|
|
17
|
+
r.preventDefault(), b.current = r.clientY, c.current = i, (v = (p = r.target).setPointerCapture) == null || v.call(p, r.pointerId);
|
|
18
|
+
const u = (n) => {
|
|
19
|
+
const s = n.clientY - b.current;
|
|
20
|
+
let o = c.current + s;
|
|
21
|
+
e > 0 && (o = Math.max(e, o)), t > 0 && (o = Math.min(t, o)), E(o);
|
|
22
|
+
}, l = () => {
|
|
23
|
+
var n, s;
|
|
24
|
+
(s = (n = r.target).releasePointerCapture) == null || s.call(n, r.pointerId), window.removeEventListener("pointermove", u), window.removeEventListener("pointerup", l);
|
|
25
|
+
};
|
|
26
|
+
window.addEventListener("pointermove", u), window.addEventListener("pointerup", l);
|
|
27
|
+
}, [a, i, e, t]);
|
|
28
|
+
return /* @__PURE__ */ k("div", { className: g("Bear-ResizableTextarea bear-relative", w), "data-testid": y, children: [
|
|
29
|
+
/* @__PURE__ */ f(
|
|
30
|
+
"textarea",
|
|
31
|
+
{
|
|
32
|
+
ref: h,
|
|
33
|
+
className: g(
|
|
34
|
+
"bear-w-full bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-gray-600",
|
|
35
|
+
"bear-bg-white dark:bear-bg-gray-900 bear-text-gray-900 dark:bear-text-gray-100",
|
|
36
|
+
"bear-p-3 bear-resize-none focus:bear-outline-none focus:bear-ring-2 focus:bear-ring-pink-500/50"
|
|
37
|
+
),
|
|
38
|
+
style: {
|
|
39
|
+
...m,
|
|
40
|
+
minHeight: a ? e : void 0,
|
|
41
|
+
height: a ? i : void 0,
|
|
42
|
+
maxHeight: t > 0 ? t : void 0
|
|
43
|
+
},
|
|
44
|
+
...x
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
a && /* @__PURE__ */ f(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
role: "separator",
|
|
51
|
+
onPointerDown: T,
|
|
52
|
+
className: "Bear-ResizableTextarea__handle bear-absolute bear-right-0 bear-bottom-0 bear-w-4 bear-h-4 bear-cursor-s-resize bear-opacity-50 hover:bear-opacity-100",
|
|
53
|
+
style: { background: "linear-gradient(135deg, transparent 50%, currentColor 50%)" }
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
] });
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
P as ResizableTextarea
|
|
60
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TextareaHTMLAttributes } from 'react';
|
|
2
|
+
export interface ResizableTextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'style'> {
|
|
3
|
+
/** Minimum height in pixels */
|
|
4
|
+
minHeight?: number;
|
|
5
|
+
/** Maximum height in pixels (0 = unbounded) */
|
|
6
|
+
maxHeight?: number;
|
|
7
|
+
/** Allow user to resize by dragging the handle */
|
|
8
|
+
resizable?: boolean;
|
|
9
|
+
/** Class name for the wrapper */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Inline styles */
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
/** Test ID */
|
|
14
|
+
testId?: string;
|
|
15
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),T=require("../../../../utils/cn.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),T=require("../../../../utils/cn.cjs");require("react");const t=require("../../RichEditor.const.cjs"),u=o=>{const{icon:i,title:r,active:_,onClick:n,disabled:e}=o;return c.jsx("button",{type:"button",title:r,onClick:n,disabled:e,className:T.cn("Bear-RichEditor__button",t.RICH_EDITOR_BUTTON_BASE_CLASSES,_?`Bear-RichEditor__button--active ${t.RICH_EDITOR_BUTTON_ACTIVE_CLASSES}`:t.RICH_EDITOR_BUTTON_INACTIVE_CLASSES,e&&`Bear-RichEditor__button--disabled ${t.RICH_EDITOR_BUTTON_DISABLED_CLASSES}`),children:i})};exports.ToolbarButton=u;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as T } from "react/jsx-runtime";
|
|
2
2
|
import { cn as S } from "../../../../utils/cn.js";
|
|
3
|
+
import "react";
|
|
3
4
|
import { RICH_EDITOR_BUTTON_DISABLED_CLASSES as e, RICH_EDITOR_BUTTON_ACTIVE_CLASSES as n, RICH_EDITOR_BUTTON_INACTIVE_CLASSES as c, RICH_EDITOR_BUTTON_BASE_CLASSES as I } from "../../RichEditor.const.js";
|
|
4
|
-
const
|
|
5
|
+
const b = (o) => {
|
|
5
6
|
const { icon: _, title: i, active: r, onClick: E, disabled: t } = o;
|
|
6
7
|
return /* @__PURE__ */ T(
|
|
7
8
|
"button",
|
|
@@ -21,5 +22,5 @@ const B = (o) => {
|
|
|
21
22
|
);
|
|
22
23
|
};
|
|
23
24
|
export {
|
|
24
|
-
|
|
25
|
+
b as ToolbarButton
|
|
25
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),u=require("../../utils/cn.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),u=require("../../utils/cn.cjs");require("react");const w=({children:b,className:l,orientation:a="vertical",scrollbarSize:o="md",scrollbarVariant:t="default",maxHeight:r,maxWidth:e})=>{const s={sm:"[&::-webkit-scrollbar]:bear-w-1 [&::-webkit-scrollbar]:bear-h-1",md:"[&::-webkit-scrollbar]:bear-w-2 [&::-webkit-scrollbar]:bear-h-2",lg:"[&::-webkit-scrollbar]:bear-w-3 [&::-webkit-scrollbar]:bear-h-3"},c={default:"[&::-webkit-scrollbar-track]:bear-bg-zinc-800 [&::-webkit-scrollbar-thumb]:bear-bg-zinc-600 [&::-webkit-scrollbar-thumb]:bear-rounded-full [&::-webkit-scrollbar-thumb]:hover:bear-bg-zinc-500",minimal:"[&::-webkit-scrollbar-track]:bear-bg-transparent [&::-webkit-scrollbar-thumb]:bear-bg-zinc-700 [&::-webkit-scrollbar-thumb]:bear-rounded-full",hidden:"[&::-webkit-scrollbar]:bear-hidden bear-scrollbar-none"},i={vertical:"bear-overflow-y-auto bear-overflow-x-hidden",horizontal:"bear-overflow-x-auto bear-overflow-y-hidden",both:"bear-overflow-auto"};return n.jsx("div",{className:u.cn(i[a],s[o],c[t],l),style:{maxHeight:typeof r=="number"?`${r}px`:r,maxWidth:typeof e=="number"?`${e}px`:e},children:b})};exports.ScrollArea=w;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { cn as n } from "../../utils/cn.js";
|
|
3
|
-
|
|
3
|
+
import "react";
|
|
4
|
+
const m = ({
|
|
4
5
|
children: b,
|
|
5
6
|
className: l,
|
|
6
7
|
orientation: a = "vertical",
|
|
@@ -40,5 +41,5 @@ const k = ({
|
|
|
40
41
|
);
|
|
41
42
|
};
|
|
42
43
|
export {
|
|
43
|
-
|
|
44
|
+
m as ScrollArea
|
|
44
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("../../utils/cn.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("../../utils/cn.cjs");require("react");const t=require("../Icon/index.cjs"),p=require("./components/SidebarItem/SidebarItem.cjs"),a=require("./Sidebar.const.cjs"),L=S=>{const{items:b,collapsed:r=!1,onCollapsedChange:d,width:_=a.SIDEBAR_WIDTH,collapsedWidth:I=a.SIDEBAR_COLLAPSED_WIDTH,header:o,footer:c,showHeader:E=!0,activeItemId:h,onItemClick:u,activeVariant:f="fill",fullHeight:A=!1,variant:s="default",position:l="left",className:C,style:x,testId:B,id:R}=S,m=r?I:_,v=l==="left"?"bear-border-r":"bear-border-l",D=E&&o;return e.jsxs("aside",{id:R,"data-testid":B,className:i.cn("Bear-Sidebar",`Bear-Sidebar--${s}`,r&&"Bear-Sidebar--collapsed","bear-flex bear-flex-col bear-h-full bear-transition-all bear-duration-300",A&&"bear-min-h-full",s==="default"&&v,a.SIDEBAR_VARIANT_STYLES[s],C),style:{width:m,...x},children:[D&&e.jsxs("div",{className:i.cn("Bear-Sidebar__header",a.SIDEBAR_HEADER_CLASSES),children:[!r&&o,d&&e.jsx("button",{type:"button",onClick:()=>d(!r),className:i.cn("Bear-Sidebar__toggle",a.SIDEBAR_TOGGLE_CLASSES),"aria-label":r?"Expand sidebar":"Collapse sidebar",children:r?l==="left"?e.jsx(t.ChevronRightIcon,{size:a.SIDEBAR_TOGGLE_ICON_SIZE}):e.jsx(t.ChevronLeftIcon,{size:a.SIDEBAR_TOGGLE_ICON_SIZE}):l==="left"?e.jsx(t.ChevronLeftIcon,{size:a.SIDEBAR_TOGGLE_ICON_SIZE}):e.jsx(t.ChevronRightIcon,{size:a.SIDEBAR_TOGGLE_ICON_SIZE})})]}),e.jsx("nav",{className:"Bear-Sidebar__nav bear-flex-1 bear-overflow-y-auto bear-px-2 bear-py-3 bear-space-y-1 bear-min-h-0",children:b.map(n=>e.jsx(p.SidebarItem,{item:n,isActive:n.id===h,collapsed:r,onClick:u,activeVariant:f},n.id))}),c&&e.jsx("div",{className:i.cn("Bear-Sidebar__footer",a.SIDEBAR_FOOTER_CLASSES),children:r?null:c})]})};exports.Sidebar=L;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { jsxs as b, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { cn as r } from "../../utils/cn.js";
|
|
3
|
+
import "react";
|
|
3
4
|
import { ChevronRightIcon as c, ChevronLeftIcon as S } from "../Icon/index.js";
|
|
4
5
|
import { SidebarItem as N } from "./components/SidebarItem/SidebarItem.js";
|
|
5
6
|
import { SIDEBAR_WIDTH as T, SIDEBAR_COLLAPSED_WIDTH as y, SIDEBAR_TOGGLE_ICON_SIZE as i, SIDEBAR_TOGGLE_CLASSES as H, SIDEBAR_HEADER_CLASSES as O, SIDEBAR_FOOTER_CLASSES as g, SIDEBAR_VARIANT_STYLES as w } from "./Sidebar.const.js";
|
|
6
|
-
const
|
|
7
|
+
const F = (f) => {
|
|
7
8
|
const {
|
|
8
|
-
items:
|
|
9
|
+
items: m,
|
|
9
10
|
collapsed: e = !1,
|
|
10
11
|
onCollapsedChange: d,
|
|
11
|
-
width:
|
|
12
|
-
collapsedWidth:
|
|
12
|
+
width: _ = T,
|
|
13
|
+
collapsedWidth: h = y,
|
|
13
14
|
header: s,
|
|
14
15
|
footer: n,
|
|
15
|
-
showHeader:
|
|
16
|
-
activeItemId:
|
|
17
|
-
onItemClick:
|
|
16
|
+
showHeader: p = !0,
|
|
17
|
+
activeItemId: E,
|
|
18
|
+
onItemClick: I,
|
|
18
19
|
activeVariant: A = "fill",
|
|
19
20
|
fullHeight: B = !1,
|
|
20
21
|
variant: l = "default",
|
|
@@ -23,7 +24,7 @@ const V = (f) => {
|
|
|
23
24
|
style: C,
|
|
24
25
|
testId: v,
|
|
25
26
|
id: D
|
|
26
|
-
} = f, R = e ?
|
|
27
|
+
} = f, R = e ? h : _, L = t === "left" ? "bear-border-r" : "bear-border-l", x = p && s;
|
|
27
28
|
return /* @__PURE__ */ b(
|
|
28
29
|
"aside",
|
|
29
30
|
{
|
|
@@ -54,13 +55,13 @@ const V = (f) => {
|
|
|
54
55
|
}
|
|
55
56
|
)
|
|
56
57
|
] }),
|
|
57
|
-
/* @__PURE__ */ a("nav", { className: "Bear-Sidebar__nav bear-flex-1 bear-overflow-y-auto bear-px-2 bear-py-3 bear-space-y-1 bear-min-h-0", children:
|
|
58
|
+
/* @__PURE__ */ a("nav", { className: "Bear-Sidebar__nav bear-flex-1 bear-overflow-y-auto bear-px-2 bear-py-3 bear-space-y-1 bear-min-h-0", children: m.map((o) => /* @__PURE__ */ a(
|
|
58
59
|
N,
|
|
59
60
|
{
|
|
60
61
|
item: o,
|
|
61
|
-
isActive: o.id ===
|
|
62
|
+
isActive: o.id === E,
|
|
62
63
|
collapsed: e,
|
|
63
|
-
onClick:
|
|
64
|
+
onClick: I,
|
|
64
65
|
activeVariant: A
|
|
65
66
|
},
|
|
66
67
|
o.id
|
|
@@ -71,5 +72,5 @@ const V = (f) => {
|
|
|
71
72
|
);
|
|
72
73
|
};
|
|
73
74
|
export {
|
|
74
|
-
|
|
75
|
+
F as Sidebar
|
|
75
76
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("../../utils/cn.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("../../utils/cn.cjs");require("react");const t={xs:"bear-w-3 bear-h-3",sm:"bear-w-4 bear-h-4",md:"bear-w-6 bear-h-6",lg:"bear-w-8 bear-h-8",xl:"bear-w-10 bear-h-10"},c=({size:r="md",className:n,color:a="currentColor",label:s="Loading"})=>e.jsxs("svg",{className:i.cn("Bear-Spinner",`Bear-Spinner--${r}`,"bear-animate-spin",t[r],n),viewBox:"0 0 24 24",fill:"none","aria-label":s,role:"status",children:[e.jsx("circle",{className:"Bear-Spinner__track bear-opacity-25",cx:"12",cy:"12",r:"10",stroke:a,strokeWidth:"4"}),e.jsx("path",{className:"Bear-Spinner__arc bear-opacity-75",fill:a,d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]});exports.Spinner=c;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsxs as i, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { cn as t } from "../../utils/cn.js";
|
|
3
|
+
import "react";
|
|
3
4
|
const c = {
|
|
4
5
|
xs: "bear-w-3 bear-h-3",
|
|
5
6
|
sm: "bear-w-4 bear-h-4",
|
|
6
7
|
md: "bear-w-6 bear-h-6",
|
|
7
8
|
lg: "bear-w-8 bear-h-8",
|
|
8
9
|
xl: "bear-w-10 bear-h-10"
|
|
9
|
-
},
|
|
10
|
+
}, m = ({
|
|
10
11
|
size: r = "md",
|
|
11
12
|
className: s,
|
|
12
13
|
color: e = "currentColor",
|
|
@@ -49,5 +50,5 @@ const c = {
|
|
|
49
50
|
}
|
|
50
51
|
);
|
|
51
52
|
export {
|
|
52
|
-
|
|
53
|
+
m as Spinner
|
|
53
54
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),b=require("react"),m=require("../../utils/cn.cjs"),x=require("./Spotlight.const.cjs"),R=(s,l)=>{var i,p;const n=l.toLowerCase();return!!(s.label.toLowerCase().includes(n)||(i=s.description)!=null&&i.toLowerCase().includes(n)||(p=s.keywords)!=null&&p.some(y=>y.toLowerCase().includes(n)))},E=(s,l)=>{if(!l)return s;const n=s.toLowerCase().indexOf(l.toLowerCase());return n===-1?s:r.jsxs(r.Fragment,{children:[s.slice(0,n),r.jsx("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:s.slice(n,n+l.length)}),s.slice(n+l.length)]})},U=s=>{const{actions:l,open:n,onOpenChange:i,placeholder:p=x.DEFAULT_PLACEHOLDER,shortcutKey:y=x.DEFAULT_SHORTCUT_KEY,shortcutMod:v=!0,nothingFoundMessage:L=x.DEFAULT_NOTHING_FOUND,highlightMatches:S=!0,limit:f=x.DEFAULT_LIMIT,filter:k,className:B,style:D,testId:T}=s,[I,A]=b.useState(!1),[o,j]=b.useState(""),[h,u]=b.useState(0),N=b.useRef(null),C=b.useRef(null),g=n??I,d=b.useCallback(e=>{A(e),i==null||i(e),e||(j(""),u(0))},[i]);b.useEffect(()=>{const e=a=>{(v?a.metaKey||a.ctrlKey:!0)&&a.key.toLowerCase()===y.toLowerCase()&&(a.preventDefault(),d(!g)),a.key==="Escape"&&g&&d(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[y,v,g,d]),b.useEffect(()=>{g&&setTimeout(()=>{var e;return(e=N.current)==null?void 0:e.focus()},x.FOCUS_DELAY)},[g]);const c=b.useMemo(()=>k?k(o,l).slice(0,f):o?l.filter(e=>R(e,o)).slice(0,f):l.slice(0,f),[l,o,k,f]),O=b.useMemo(()=>{const e=new Map;return c.forEach(a=>{const t=a.group||"";e.has(t)||e.set(t,[]),e.get(t).push(a)}),e},[c]),M=b.useCallback(e=>{if(e.key==="ArrowDown")e.preventDefault(),u(a=>Math.min(a+1,c.length-1));else if(e.key==="ArrowUp")e.preventDefault(),u(a=>Math.max(a-1,0));else if(e.key==="Enter"&&c[h]){e.preventDefault();const a=c[h];a.disabled||(a.onTrigger(),d(!1))}},[c,h,d]);if(b.useEffect(()=>{const e=C.current;if(!e)return;const a=e.querySelector('[data-active="true"]');a==null||a.scrollIntoView({block:"nearest"})},[h]),!g)return null;let _=-1;return r.jsxs("div",{className:m.cn("Bear-Spotlight","bear-fixed bear-inset-0 bear-flex bear-items-start bear-justify-center bear-pt-[15vh]"),style:{zIndex:x.SPOTLIGHT_Z_INDEX},"data-testid":T,children:[r.jsx("div",{className:"Bear-Spotlight__backdrop bear-absolute bear-inset-0 bear-bg-black/50 dark:bear-bg-black/70 bear-backdrop-blur-sm",onClick:()=>d(!1),"aria-hidden":"true"}),r.jsxs("div",{className:m.cn("Bear-Spotlight__dialog","bear-relative bear-w-full bear-max-w-[560px] bear-mx-4","bear-bg-white dark:bear-bg-gray-900","bear-rounded-xl bear-shadow-2xl","bear-border bear-border-gray-200 dark:bear-border-gray-700","bear-overflow-hidden",B),style:D,role:"dialog","aria-label":"Search",children:[r.jsxs("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:[r.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,className:"bear-text-gray-400 dark:bear-text-gray-500 bear-shrink-0",children:[r.jsx("circle",{cx:"11",cy:"11",r:"8"}),r.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),r.jsx("input",{ref:N,type:"text",value:o,onChange:e=>{j(e.target.value),u(0)},onKeyDown:M,placeholder:p,className:m.cn("Bear-Spotlight__input","bear-flex-1 bear-bg-transparent bear-outline-none bear-text-base","bear-text-gray-900 dark:bear-text-white","placeholder:bear-text-gray-400 dark:placeholder:bear-text-gray-500"),autoComplete:"off",spellCheck:!1}),r.jsx("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"})]}),r.jsxs("div",{ref:C,className:"Bear-Spotlight__results bear-max-h-[400px] bear-overflow-y-auto bear-py-2",role:"listbox",children:[c.length===0&&r.jsx("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:L}),Array.from(O.entries()).map(([e,a])=>r.jsxs("div",{className:"Bear-Spotlight__group",children:[e&&r.jsx("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}),a.map(t=>{_++;const w=_===h,F=_;return r.jsxs("button",{className:m.cn("Bear-Spotlight__action","bear-w-full bear-flex bear-items-center bear-gap-3 bear-px-4 bear-py-2.5 bear-text-left bear-cursor-pointer","bear-transition-colors bear-duration-100",w?"bear-bg-gray-100 dark:bear-bg-gray-800":"hover:bear-bg-gray-50 dark:hover:bear-bg-gray-800/50",t.disabled&&"bear-opacity-50 bear-cursor-not-allowed"),"data-active":w,onMouseEnter:()=>u(F),onClick:()=>{t.disabled||(t.onTrigger(),d(!1))},role:"option","aria-selected":w,"aria-disabled":t.disabled,children:[t.icon&&r.jsx("span",{className:"Bear-Spotlight__action-icon bear-text-gray-500 dark:bear-text-gray-400 bear-shrink-0",children:t.icon}),r.jsxs("div",{className:"Bear-Spotlight__action-body bear-flex-1 bear-min-w-0",children:[r.jsx("div",{className:"Bear-Spotlight__action-label bear-text-sm bear-font-medium bear-text-gray-900 dark:bear-text-white bear-truncate",children:S?E(t.label,o):t.label}),t.description&&r.jsx("div",{className:"Bear-Spotlight__action-desc bear-text-xs bear-text-gray-500 dark:bear-text-gray-400 bear-truncate",children:S?E(t.description,o):t.description})]}),t.rightSection&&r.jsx("span",{className:"Bear-Spotlight__action-right bear-shrink-0",children:t.rightSection})]},t.id)})]},e))]}),r.jsxs("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:[r.jsxs("span",{className:"bear-flex bear-items-center bear-gap-1",children:[r.jsx("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:"↑↓"}),"navigate"]}),r.jsxs("span",{className:"bear-flex bear-items-center bear-gap-1",children:[r.jsx("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:"↵"}),"select"]}),r.jsxs("span",{className:"bear-flex bear-items-center bear-gap-1",children:[r.jsx("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"}),"close"]})]})]})]})};exports.Spotlight=U;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T="k",E="Search...",L="No results found",_=10,D=9999,U=50;exports.DEFAULT_LIMIT=_;exports.DEFAULT_NOTHING_FOUND=L;exports.DEFAULT_PLACEHOLDER=E;exports.DEFAULT_SHORTCUT_KEY=T;exports.FOCUS_DELAY=U;exports.SPOTLIGHT_Z_INDEX=D;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Default shortcut key */
|
|
2
|
+
export declare const DEFAULT_SHORTCUT_KEY = "k";
|
|
3
|
+
/** Default placeholder */
|
|
4
|
+
export declare const DEFAULT_PLACEHOLDER = "Search...";
|
|
5
|
+
/** Default nothing found message */
|
|
6
|
+
export declare const DEFAULT_NOTHING_FOUND = "No results found";
|
|
7
|
+
/** Default result limit */
|
|
8
|
+
export declare const DEFAULT_LIMIT = 10;
|
|
9
|
+
/** Backdrop z-index */
|
|
10
|
+
export declare const SPOTLIGHT_Z_INDEX = 9999;
|
|
11
|
+
/** Top offset for dialog (percentage of viewport height) */
|
|
12
|
+
export declare const DIALOG_TOP_OFFSET = "15vh";
|
|
13
|
+
/** Max dialog width in pixels */
|
|
14
|
+
export declare const DIALOG_MAX_WIDTH = 560;
|
|
15
|
+
/** Max results height in pixels */
|
|
16
|
+
export declare const RESULTS_MAX_HEIGHT = 400;
|
|
17
|
+
/** Focus delay after open in ms */
|
|
18
|
+
export declare const FOCUS_DELAY = 50;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { SpotlightProps } from './Spotlight.types';
|
|
3
|
+
/**
|
|
4
|
+
* Spotlight - macOS-style search overlay (Cmd+K).
|
|
5
|
+
* Supports grouped actions, highlighting, keyboard navigation, and theming via BearProvider.
|
|
6
|
+
*/
|
|
7
|
+
export declare const Spotlight: FC<SpotlightProps>;
|