@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,36 @@
|
|
|
1
|
+
const t = {
|
|
2
|
+
primary: ["var(--bear-primary-400, #f472b6)", "var(--bear-primary-600, #db2777)"],
|
|
3
|
+
sunset: ["#f97316", "#ef4444", "#ec4899"],
|
|
4
|
+
ocean: ["#06b6d4", "#3b82f6", "#8b5cf6"],
|
|
5
|
+
forest: ["#22c55e", "#10b981", "#14b8a6"],
|
|
6
|
+
fire: ["#fbbf24", "#f97316", "#ef4444"],
|
|
7
|
+
purple: ["#a855f7", "#7c3aed", "#6366f1"],
|
|
8
|
+
neon: ["#22d3ee", "#a78bfa", "#f472b6"],
|
|
9
|
+
candy: ["#f472b6", "#fb923c", "#fbbf24"],
|
|
10
|
+
aurora: ["#34d399", "#22d3ee", "#818cf8", "#c084fc"],
|
|
11
|
+
midnight: ["#6366f1", "#8b5cf6", "#a78bfa"]
|
|
12
|
+
}, o = {
|
|
13
|
+
"to-r": "to right",
|
|
14
|
+
"to-l": "to left",
|
|
15
|
+
"to-t": "to top",
|
|
16
|
+
"to-b": "to bottom",
|
|
17
|
+
"to-tr": "to top right",
|
|
18
|
+
"to-tl": "to top left",
|
|
19
|
+
"to-br": "to bottom right",
|
|
20
|
+
"to-bl": "to bottom left"
|
|
21
|
+
}, b = 3, f = "200% 200%", e = {
|
|
22
|
+
normal: 400,
|
|
23
|
+
medium: 500,
|
|
24
|
+
semibold: 600,
|
|
25
|
+
bold: 700,
|
|
26
|
+
extrabold: 800
|
|
27
|
+
}, r = 700, a = 3;
|
|
28
|
+
export {
|
|
29
|
+
f as ANIMATED_BG_SIZE,
|
|
30
|
+
a as COLOR_REPEAT_COUNT,
|
|
31
|
+
b as DEFAULT_ANIMATION_SPEED,
|
|
32
|
+
r as DEFAULT_WEIGHT,
|
|
33
|
+
o as DIRECTION_MAP,
|
|
34
|
+
t as GRADIENT_PRESETS,
|
|
35
|
+
e as WEIGHT_MAP
|
|
36
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { GradientTextProps } from './GradientText.types';
|
|
3
|
+
/**
|
|
4
|
+
* GradientText - Text with gradient colors.
|
|
5
|
+
* 10 built-in presets, custom colors, animation, and theme integration via BearProvider.
|
|
6
|
+
*/
|
|
7
|
+
export declare const GradientText: FC<GradientTextProps>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as A } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as o } from "react";
|
|
3
|
+
import { cn as I } from "../../utils/cn.js";
|
|
4
|
+
import { DEFAULT_ANIMATION_SPEED as _, GRADIENT_PRESETS as s, DIRECTION_MAP as b, COLOR_REPEAT_COUNT as x, ANIMATED_BG_SIZE as C, WEIGHT_MAP as N, DEFAULT_WEIGHT as S } from "./GradientText.const.js";
|
|
5
|
+
const y = (l) => {
|
|
6
|
+
const {
|
|
7
|
+
children: d,
|
|
8
|
+
preset: i = "primary",
|
|
9
|
+
colors: t,
|
|
10
|
+
direction: n = "to-r",
|
|
11
|
+
animate: e = !1,
|
|
12
|
+
animationSpeed: c = _,
|
|
13
|
+
as: m = "span",
|
|
14
|
+
weight: T = "bold",
|
|
15
|
+
className: g,
|
|
16
|
+
style: p,
|
|
17
|
+
testId: E
|
|
18
|
+
} = l, r = o(() => t && t.length > 0 ? t : s[i] ?? s.primary, [t, i]), f = o(() => {
|
|
19
|
+
const a = b[n] ?? "to right";
|
|
20
|
+
if (!e) return `linear-gradient(${a}, ${r.join(", ")})`;
|
|
21
|
+
const u = Array.from({ length: x }, () => r).flat();
|
|
22
|
+
return `linear-gradient(${a}, ${u.join(", ")})`;
|
|
23
|
+
}, [r, n, e]);
|
|
24
|
+
return /* @__PURE__ */ A(
|
|
25
|
+
m,
|
|
26
|
+
{
|
|
27
|
+
className: I(
|
|
28
|
+
"Bear-GradientText",
|
|
29
|
+
"bear-inline-block",
|
|
30
|
+
e && "Bear-GradientText--animated",
|
|
31
|
+
g
|
|
32
|
+
),
|
|
33
|
+
style: {
|
|
34
|
+
background: f,
|
|
35
|
+
backgroundClip: "text",
|
|
36
|
+
WebkitBackgroundClip: "text",
|
|
37
|
+
WebkitTextFillColor: "transparent",
|
|
38
|
+
fontWeight: N[T] ?? S,
|
|
39
|
+
...e && {
|
|
40
|
+
backgroundSize: C,
|
|
41
|
+
animation: `bear-gradient-shift ${c}s ease infinite`
|
|
42
|
+
},
|
|
43
|
+
...p
|
|
44
|
+
},
|
|
45
|
+
"data-testid": E,
|
|
46
|
+
children: d
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
y as GradientText
|
|
52
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type GradientDirection = 'to-r' | 'to-l' | 'to-t' | 'to-b' | 'to-tr' | 'to-tl' | 'to-br' | 'to-bl';
|
|
3
|
+
export type GradientPreset = 'primary' | 'sunset' | 'ocean' | 'forest' | 'fire' | 'purple' | 'neon' | 'candy' | 'aurora' | 'midnight';
|
|
4
|
+
export interface GradientTextProps {
|
|
5
|
+
/** Content to render with gradient */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** Gradient preset name */
|
|
8
|
+
preset?: GradientPreset | (string & {});
|
|
9
|
+
/** Custom colors array (overrides preset) */
|
|
10
|
+
colors?: string[];
|
|
11
|
+
/** Gradient direction */
|
|
12
|
+
direction?: GradientDirection;
|
|
13
|
+
/** Whether to animate the gradient */
|
|
14
|
+
animate?: boolean;
|
|
15
|
+
/** Animation speed in seconds */
|
|
16
|
+
animationSpeed?: number;
|
|
17
|
+
/** HTML tag to render */
|
|
18
|
+
as?: 'span' | 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div';
|
|
19
|
+
/** Font weight */
|
|
20
|
+
weight?: 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold';
|
|
21
|
+
/** Custom class name */
|
|
22
|
+
className?: string;
|
|
23
|
+
/** Custom style */
|
|
24
|
+
style?: React.CSSProperties;
|
|
25
|
+
/** Test ID */
|
|
26
|
+
testId?: string;
|
|
27
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),h=require("react"),u=require("../../utils/cn.cjs"),e=require("./Highlight.const.cjs"),t=h.forwardRef((r,s)=>{const{children:i,color:a=e.DEFAULT_COLOR,animated:n=!1,className:c,testId:o,...l}=r,g=e.HIGHLIGHT_COLOR_CLASSES[a]??e.HIGHLIGHT_COLOR_CLASSES[e.DEFAULT_COLOR];return d.jsx("span",{ref:s,className:u.cn("Bear-Highlight","bear-px-1 bear-rounded",g,n&&"bear-animate-pulse",c),"data-testid":o,...l,children:i})});t.displayName="Highlight";exports.Highlight=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r={primary:"bear-bg-[var(--bear-primary-100,#fce7f3)] dark:bear-bg-[var(--bear-primary-900,#831843)]/30",yellow:"bear-bg-yellow-200 dark:bear-bg-yellow-500/30",pink:"bear-bg-pink-200 dark:bear-bg-pink-500/30",blue:"bear-bg-blue-200 dark:bear-bg-blue-500/30",green:"bear-bg-green-200 dark:bear-bg-green-500/30",purple:"bear-bg-purple-200 dark:bear-bg-purple-500/30",orange:"bear-bg-orange-200 dark:bear-bg-orange-500/30",red:"bear-bg-red-200 dark:bear-bg-red-500/30",cyan:"bear-bg-cyan-200 dark:bear-bg-cyan-500/30"},e="yellow";exports.DEFAULT_COLOR=e;exports.HIGHLIGHT_COLOR_CLASSES=r;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HighlightColor } from './Highlight.types';
|
|
2
|
+
/**
|
|
3
|
+
* Highlight color classes — uses CSS variables for theme integration.
|
|
4
|
+
* 'primary' maps to BearProvider's primary color.
|
|
5
|
+
*/
|
|
6
|
+
export declare const HIGHLIGHT_COLOR_CLASSES: Record<HighlightColor, string>;
|
|
7
|
+
/** Default highlight color */
|
|
8
|
+
export declare const DEFAULT_COLOR: HighlightColor;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const r = {
|
|
2
|
+
primary: "bear-bg-[var(--bear-primary-100,#fce7f3)] dark:bear-bg-[var(--bear-primary-900,#831843)]/30",
|
|
3
|
+
yellow: "bear-bg-yellow-200 dark:bear-bg-yellow-500/30",
|
|
4
|
+
pink: "bear-bg-pink-200 dark:bear-bg-pink-500/30",
|
|
5
|
+
blue: "bear-bg-blue-200 dark:bear-bg-blue-500/30",
|
|
6
|
+
green: "bear-bg-green-200 dark:bear-bg-green-500/30",
|
|
7
|
+
purple: "bear-bg-purple-200 dark:bear-bg-purple-500/30",
|
|
8
|
+
orange: "bear-bg-orange-200 dark:bear-bg-orange-500/30",
|
|
9
|
+
red: "bear-bg-red-200 dark:bear-bg-red-500/30",
|
|
10
|
+
cyan: "bear-bg-cyan-200 dark:bear-bg-cyan-500/30"
|
|
11
|
+
}, e = "yellow";
|
|
12
|
+
export {
|
|
13
|
+
e as DEFAULT_COLOR,
|
|
14
|
+
r as HIGHLIGHT_COLOR_CLASSES
|
|
15
|
+
};
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import { HighlightProps } from './Highlight.types';
|
|
2
|
+
/**
|
|
3
|
+
* Highlight - Inline text highlight with theme-aware colors.
|
|
4
|
+
* 'primary' color uses BearProvider's primary palette.
|
|
5
|
+
*/
|
|
2
6
|
export declare const Highlight: import('react').ForwardRefExoticComponent<HighlightProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
@@ -1,28 +1,36 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as p } from "react";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
3
|
+
import { cn as f } from "../../utils/cn.js";
|
|
4
|
+
import { DEFAULT_COLOR as r, HIGHLIGHT_COLOR_CLASSES as t } from "./Highlight.const.js";
|
|
5
|
+
const h = p(
|
|
6
|
+
(a, e) => {
|
|
7
|
+
const {
|
|
8
|
+
children: o,
|
|
9
|
+
color: s = r,
|
|
10
|
+
animated: i = !1,
|
|
11
|
+
className: m,
|
|
12
|
+
testId: l,
|
|
13
|
+
...n
|
|
14
|
+
} = a, c = t[s] ?? t[r];
|
|
15
|
+
return /* @__PURE__ */ d(
|
|
16
|
+
"span",
|
|
17
|
+
{
|
|
18
|
+
ref: e,
|
|
19
|
+
className: f(
|
|
20
|
+
"Bear-Highlight",
|
|
21
|
+
"bear-px-1 bear-rounded",
|
|
22
|
+
c,
|
|
23
|
+
i && "bear-animate-pulse",
|
|
24
|
+
m
|
|
25
|
+
),
|
|
26
|
+
"data-testid": l,
|
|
27
|
+
...n,
|
|
28
|
+
children: o
|
|
29
|
+
}
|
|
30
|
+
);
|
|
23
31
|
}
|
|
24
|
-
)
|
|
25
|
-
|
|
32
|
+
);
|
|
33
|
+
h.displayName = "Highlight";
|
|
26
34
|
export {
|
|
27
|
-
|
|
35
|
+
h as Highlight
|
|
28
36
|
};
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type HighlightColor = 'primary' | 'yellow' | 'pink' | 'blue' | 'green' | 'purple' | 'orange' | 'red' | 'cyan';
|
|
2
3
|
export interface HighlightProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
/** Content to highlight */
|
|
3
5
|
children?: ReactNode;
|
|
4
|
-
|
|
6
|
+
/** Highlight color — 'primary' uses theme color from BearProvider */
|
|
7
|
+
color?: HighlightColor;
|
|
8
|
+
/** Whether to animate with pulse */
|
|
5
9
|
animated?: boolean;
|
|
10
|
+
/** Additional class name */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** Test ID */
|
|
13
|
+
testId?: string;
|
|
6
14
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Highlight } from './Highlight';
|
|
2
|
-
export type { HighlightProps } from './Highlight.types';
|
|
2
|
+
export type { HighlightProps, HighlightColor } from './Highlight.types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),u=require("../../utils/cn.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),u=require("../../utils/cn.cjs");require("react");const d={xs:12,sm:16,md:20,lg:24,xl:32},m=({size:e="md",color:r="currentColor",strokeWidth:t=2,spin:o=!1,className:s,children:i,testId:a,...c})=>{const n=typeof e=="number"?e:d[e];return l.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round",className:u.cn("bear-inline-block bear-shrink-0",o&&"bear-animate-spin",s),"data-testid":a,...c,children:i})};exports.Icon=m;
|
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { cn as c } from "../../utils/cn.js";
|
|
3
|
-
|
|
3
|
+
import "react";
|
|
4
|
+
const p = {
|
|
4
5
|
xs: 12,
|
|
5
6
|
sm: 16,
|
|
6
7
|
md: 20,
|
|
7
8
|
lg: 24,
|
|
8
9
|
xl: 32
|
|
9
|
-
},
|
|
10
|
+
}, f = ({
|
|
10
11
|
size: e = "md",
|
|
11
|
-
color:
|
|
12
|
-
strokeWidth:
|
|
12
|
+
color: r = "currentColor",
|
|
13
|
+
strokeWidth: n = 2,
|
|
13
14
|
spin: t = !1,
|
|
14
|
-
className:
|
|
15
|
-
children:
|
|
15
|
+
className: i,
|
|
16
|
+
children: s,
|
|
16
17
|
testId: a,
|
|
17
|
-
...
|
|
18
|
+
...m
|
|
18
19
|
}) => {
|
|
19
|
-
const o = typeof e == "number" ? e :
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
const o = typeof e == "number" ? e : p[e];
|
|
21
|
+
return /* @__PURE__ */ l(
|
|
21
22
|
"svg",
|
|
22
23
|
{
|
|
23
24
|
width: o,
|
|
24
25
|
height: o,
|
|
25
26
|
viewBox: "0 0 24 24",
|
|
26
27
|
fill: "none",
|
|
27
|
-
stroke:
|
|
28
|
-
strokeWidth:
|
|
28
|
+
stroke: r,
|
|
29
|
+
strokeWidth: n,
|
|
29
30
|
strokeLinecap: "round",
|
|
30
31
|
strokeLinejoin: "round",
|
|
31
32
|
className: c(
|
|
32
33
|
"bear-inline-block bear-shrink-0",
|
|
33
34
|
t && "bear-animate-spin",
|
|
34
|
-
|
|
35
|
+
i
|
|
35
36
|
),
|
|
36
37
|
"data-testid": a,
|
|
37
|
-
...
|
|
38
|
-
children:
|
|
38
|
+
...m,
|
|
39
|
+
children: s
|
|
39
40
|
}
|
|
40
41
|
);
|
|
41
42
|
};
|
|
42
43
|
export {
|
|
43
|
-
|
|
44
|
+
f as Icon
|
|
44
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");const n=require("./icons/action.cjs"),o=require("./icons/navigation.cjs"),t=require("./icons/content.cjs"),r=require("./icons/communication.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");const n=require("./icons/action.cjs"),o=require("./icons/navigation.cjs"),t=require("./icons/content.cjs"),r=require("./icons/communication.cjs"),e=require("./icons/status.cjs"),i=require("./icons/media.cjs"),s=require("./icons/editor.cjs"),c=require("./icons/misc.cjs"),I=e.CheckIcon,h=o.CloseIcon,C=n.EditIcon,v=o.ChevronDownIcon,u=o.ChevronRightIcon,a=o.ChevronLeftIcon,g=o.ChevronsLeftIcon,q=o.ChevronsRightIcon,d=c.XIcon,f={...n,...o,...t,...r,...e,...i,...s,...c,Action:n,Navigation:o,Content:t,Communication:r,Status:e,Media:i,Editor:s,Misc:c};exports.BearIcons=f;exports.CheckIcon=I;exports.ChevronDownIcon=v;exports.ChevronLeftIcon=a;exports.ChevronRightIcon=u;exports.ChevronsLeftIcon=g;exports.ChevronsRightIcon=q;exports.CloseIcon=h;exports.EditIcon=C;exports.XIcon=d;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
2
3
|
import * as o from "./icons/action.js";
|
|
3
4
|
import { EditIcon as m } from "./icons/action.js";
|
|
4
5
|
import * as n from "./icons/navigation.js";
|
|
@@ -11,7 +12,7 @@ import * as s from "./icons/media.js";
|
|
|
11
12
|
import * as i from "./icons/editor.js";
|
|
12
13
|
import * as e from "./icons/misc.js";
|
|
13
14
|
import { XIcon as $ } from "./icons/misc.js";
|
|
14
|
-
const
|
|
15
|
+
const k = p, l = a, w = m, D = I, X = h, M = C, x = f, A = v, B = $, N = {
|
|
15
16
|
// Flat access to common icons (shortcuts)
|
|
16
17
|
...o,
|
|
17
18
|
...n,
|
|
@@ -32,14 +33,14 @@ const E = p, k = a, l = m, w = I, D = h, X = C, M = f, x = v, A = $, B = {
|
|
|
32
33
|
Misc: e
|
|
33
34
|
};
|
|
34
35
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
N as BearIcons,
|
|
37
|
+
k as CheckIcon,
|
|
38
|
+
D as ChevronDownIcon,
|
|
39
|
+
M as ChevronLeftIcon,
|
|
40
|
+
X as ChevronRightIcon,
|
|
41
|
+
x as ChevronsLeftIcon,
|
|
42
|
+
A as ChevronsRightIcon,
|
|
43
|
+
l as CloseIcon,
|
|
44
|
+
w as EditIcon,
|
|
45
|
+
B as XIcon
|
|
45
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("../../utils/cn.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("../../utils/cn.cjs");require("react");const x={cmd:"⌘",command:"⌘",ctrl:"⌃",control:"⌃",alt:"⌥",option:"⌥",shift:"⇧",enter:"↵",return:"↵",tab:"⇥",backspace:"⌫",delete:"⌦",escape:"⎋",esc:"⎋",up:"↑",down:"↓",left:"←",right:"→",space:"␣"},u=({children:l,keys:r,size:b="md",variant:s="default",className:c})=>{const i={sm:"bear-text-xs bear-px-1.5 bear-py-0.5 bear-min-w-[18px]",md:"bear-text-sm bear-px-2 bear-py-1 bear-min-w-[24px]",lg:"bear-text-base bear-px-2.5 bear-py-1.5 bear-min-w-[30px]"},o={default:"bear-bg-zinc-700 bear-border-zinc-600 bear-shadow-[0_1px_0_1px_rgba(0,0,0,0.3)]",outline:"bear-bg-transparent bear-border-zinc-500",ghost:"bear-bg-zinc-800/50 bear-border-transparent"},d=(a,n,m)=>{const p=x[a.toLowerCase()]||a.toUpperCase();return e.jsxs("span",{className:"bear-inline-flex bear-items-center",children:[e.jsx("kbd",{className:t.cn("bear-inline-flex bear-items-center bear-justify-center bear-rounded bear-border bear-font-mono bear-font-medium bear-text-zinc-300",i[b],o[s]),children:p}),!m&&e.jsx("span",{className:"bear-mx-1 bear-text-zinc-500",children:"+"})]},n)};return r&&r.length>0?e.jsx("span",{className:t.cn("bear-inline-flex bear-items-center",c),children:r.map((a,n)=>d(a,n,n===r.length-1))}):e.jsx("kbd",{className:t.cn("bear-inline-flex bear-items-center bear-justify-center bear-rounded bear-border bear-font-mono bear-font-medium bear-text-zinc-300",i[b],o[s],c),children:l})};exports.Kbd=u;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cn as
|
|
1
|
+
import { jsx as t, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import { cn as n } from "../../utils/cn.js";
|
|
3
|
+
import "react";
|
|
3
4
|
const f = {
|
|
4
5
|
cmd: "⌘",
|
|
5
6
|
command: "⌘",
|
|
@@ -20,39 +21,39 @@ const f = {
|
|
|
20
21
|
left: "←",
|
|
21
22
|
right: "→",
|
|
22
23
|
space: "␣"
|
|
23
|
-
},
|
|
24
|
-
children:
|
|
24
|
+
}, z = ({
|
|
25
|
+
children: m,
|
|
25
26
|
keys: e,
|
|
26
27
|
size: b = "md",
|
|
27
28
|
variant: s = "default",
|
|
28
29
|
className: o
|
|
29
30
|
}) => {
|
|
30
|
-
const
|
|
31
|
+
const i = {
|
|
31
32
|
sm: "bear-text-xs bear-px-1.5 bear-py-0.5 bear-min-w-[18px]",
|
|
32
33
|
md: "bear-text-sm bear-px-2 bear-py-1 bear-min-w-[24px]",
|
|
33
34
|
lg: "bear-text-base bear-px-2.5 bear-py-1.5 bear-min-w-[30px]"
|
|
34
|
-
},
|
|
35
|
+
}, c = {
|
|
35
36
|
default: "bear-bg-zinc-700 bear-border-zinc-600 bear-shadow-[0_1px_0_1px_rgba(0,0,0,0.3)]",
|
|
36
37
|
outline: "bear-bg-transparent bear-border-zinc-500",
|
|
37
38
|
ghost: "bear-bg-zinc-800/50 bear-border-transparent"
|
|
38
|
-
},
|
|
39
|
+
}, l = (r, a, d) => {
|
|
39
40
|
const p = f[r.toLowerCase()] || r.toUpperCase();
|
|
40
41
|
return /* @__PURE__ */ x("span", { className: "bear-inline-flex bear-items-center", children: [
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ t("kbd", { className: n(
|
|
42
43
|
"bear-inline-flex bear-items-center bear-justify-center bear-rounded bear-border bear-font-mono bear-font-medium bear-text-zinc-300",
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
i[b],
|
|
45
|
+
c[s]
|
|
45
46
|
), children: p }),
|
|
46
|
-
!d && /* @__PURE__ */
|
|
47
|
+
!d && /* @__PURE__ */ t("span", { className: "bear-mx-1 bear-text-zinc-500", children: "+" })
|
|
47
48
|
] }, a);
|
|
48
49
|
};
|
|
49
|
-
return e && e.length > 0 ? /* @__PURE__ */
|
|
50
|
+
return e && e.length > 0 ? /* @__PURE__ */ t("span", { className: n("bear-inline-flex bear-items-center", o), children: e.map((r, a) => l(r, a, a === e.length - 1)) }) : /* @__PURE__ */ t("kbd", { className: n(
|
|
50
51
|
"bear-inline-flex bear-items-center bear-justify-center bear-rounded bear-border bear-font-mono bear-font-medium bear-text-zinc-300",
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
i[b],
|
|
53
|
+
c[s],
|
|
53
54
|
o
|
|
54
|
-
), children:
|
|
55
|
+
), children: m });
|
|
55
56
|
};
|
|
56
57
|
export {
|
|
57
|
-
|
|
58
|
+
z as Kbd
|
|
58
59
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),l=require("react"),x=require("../../utils/cn.cjs"),a=require("./Map.const.cjs"),xe=({markers:O=[],viewport:$,controlledViewport:v,onViewportChange:f,onMarkerClick:w,onMapClick:z,onMarkerDrag:Me,tileProvider:I="openstreetmap",customTileUrl:F,width:g="100%",height:p=400,showZoomControls:G=!0,showAttribution:J=!0,scrollWheelZoom:N=!0,doubleClickZoom:D=!0,draggable:X=!0,minZoom:L=a.MIN_ZOOM,maxZoom:j=a.MAX_ZOOM,className:Q,style:V,testId:ee})=>{const E=l.useRef(null),[ae,te]=l.useState($??a.DEFAULT_VIEWPORT),[R,U]=l.useState(!1),[S,Y]=l.useState(null),[M,A]=l.useState(null),[re,C]=l.useState(null),[B,oe]=l.useState(null),t=v??ae,c=l.useCallback(e=>{const r={...e,zoom:Math.max(L,Math.min(j,e.zoom)),lat:Math.max(-85,Math.min(85,e.lat)),lng:((e.lng+180)%360+360)%360-180};v||te(r),f==null||f(r)},[v,f,L,j]),y=(e,r)=>(e+180)/360*Math.pow(2,r),m=(e,r)=>{const n=e*Math.PI/180;return(1-Math.log(Math.tan(n)+1/Math.cos(n))/Math.PI)/2*Math.pow(2,r)},P=(e,r)=>e/Math.pow(2,r)*360-180,W=(e,r)=>{const n=Math.PI-2*Math.PI*e/Math.pow(2,r);return 180/Math.PI*Math.atan(.5*(Math.exp(n)-Math.exp(-n)))},ne=(e,r,n)=>(I==="custom"?F??a.TILE_URLS.openstreetmap:a.TILE_URLS[I]).replace("{x}",String(e)).replace("{y}",String(r)).replace("{z}",String(n)),se=l.useMemo(()=>{const e=E.current,r=(e==null?void 0:e.clientWidth)??(typeof g=="number"?g:800),n=typeof p=="number"?p:400,o=Math.round(t.zoom),i=y(t.lng,o),b=m(t.lat,o),d=Math.ceil(r/a.TILE_SIZE)+2,h=Math.ceil(n/a.TILE_SIZE)+2,u=Math.pow(2,o),T=[];for(let Z=-Math.floor(d/2);Z<=Math.ceil(d/2);Z++)for(let k=-Math.floor(h/2);k<=Math.ceil(h/2);k++){const q=Math.floor(i)+Z,_=Math.floor(b)+k;if(_<0||_>=u)continue;const ge=(q%u+u)%u,pe=r/2+(q-i)*a.TILE_SIZE,he=n/2+(_-b)*a.TILE_SIZE;T.push({x:ge,y:_,z:o,px:pe,py:he})}return T},[t.lat,t.lng,t.zoom,g,p]),le=l.useMemo(()=>{const e=E.current,r=(e==null?void 0:e.clientWidth)??(typeof g=="number"?g:800),n=typeof p=="number"?p:400,o=t.zoom,i=y(t.lng,o),b=m(t.lat,o);return O.map(d=>{const h=y(d.lng,o),u=m(d.lat,o);return{marker:d,px:r/2+(h-i)*a.TILE_SIZE,py:n/2+(u-b)*a.TILE_SIZE}})},[O,t,g,p]),be=l.useCallback(e=>{X&&(U(!0),Y({x:e.clientX,y:e.clientY}),A({...t}))},[X,t]),ce=l.useCallback(e=>{if(!R||!S||!M)return;const r=e.clientX-S.x,n=e.clientY-S.y,o=M.zoom,i=y(M.lng,o)-r/a.TILE_SIZE,b=m(M.lat,o)-n/a.TILE_SIZE;c({lat:W(b,o),lng:P(i,o),zoom:o})},[R,S,M,c]),K=l.useCallback(()=>{U(!1),Y(null),A(null)},[]),ie=l.useCallback(e=>{if(!N)return;e.preventDefault();const r=e.deltaY>0?-.5:.5;c({...t,zoom:t.zoom+r})},[N,t,c]),de=l.useCallback(e=>{D&&(e.preventDefault(),c({...t,zoom:t.zoom+1}))},[D,t,c]),ue=l.useCallback(e=>{if(!z)return;const r=E.current;if(!r)return;const n=r.getBoundingClientRect(),o=e.clientX-n.left,i=e.clientY-n.top,b=t.zoom,d=y(t.lng,b),h=m(t.lat,b),u=d+(o-r.clientWidth/2)/a.TILE_SIZE,T=h+(i-r.clientHeight/2)/a.TILE_SIZE;z(W(T,b),P(u,b))},[z,t]),H=I!=="custom"?a.TILE_ATTRIBUTIONS[I]:"";return s.jsxs("div",{ref:E,className:x.cn("bear-relative bear-overflow-hidden bear-rounded-lg bear-select-none","bear-border bear-border-gray-200 dark:bear-border-gray-700",R?"bear-cursor-grabbing":"bear-cursor-grab",Q),style:{width:g,height:p,...V},onMouseDown:be,onMouseMove:ce,onMouseUp:K,onMouseLeave:K,onWheel:ie,onDoubleClick:de,onClick:ue,"data-testid":ee,role:"application","aria-label":"Interactive map",children:[s.jsx("div",{className:"bear-absolute bear-inset-0 bear-overflow-hidden",children:se.map(e=>s.jsx("img",{src:ne(e.x,e.y,e.z),alt:"",className:"bear-absolute bear-pointer-events-none",style:{left:e.px,top:e.py,width:a.TILE_SIZE,height:a.TILE_SIZE},loading:"lazy",draggable:!1},`${e.z}-${e.x}-${e.y}`))}),le.map(({marker:e,px:r,py:n})=>s.jsxs("div",{className:"bear-absolute bear-z-10 bear-pointer-events-auto",style:{left:r-a.MARKER_SIZE/2,top:n-a.MARKER_SIZE,width:a.MARKER_SIZE,height:a.MARKER_SIZE},onClick:o=>{o.stopPropagation(),oe(B===e.id?null:e.id),w==null||w(e)},onMouseEnter:()=>C(e.id),onMouseLeave:()=>C(null),children:[e.icon?s.jsx("div",{className:"bear-text-2xl bear-flex bear-items-center bear-justify-center bear-w-full bear-h-full",children:e.icon}):s.jsxs("svg",{width:a.MARKER_SIZE,height:a.MARKER_SIZE,viewBox:"0 0 32 42",fill:"none",children:[s.jsx("path",{d:"M16 0C7.16 0 0 7.16 0 16c0 12 16 26 16 26s16-14 16-26C32 7.16 24.84 0 16 0z",fill:e.color??a.DEFAULT_MARKER_COLOR,className:x.cn("bear-transition-all bear-duration-200",re===e.id&&"bear-drop-shadow-lg")}),s.jsx("circle",{cx:"16",cy:"15",r:"6",fill:"white"})]}),e.label&&s.jsx("div",{className:x.cn("bear-absolute bear-left-1/2 bear--translate-x-1/2 bear-top-full bear-mt-1","bear-bg-white dark:bear-bg-gray-800 bear-text-xs bear-font-medium","bear-px-2 bear-py-0.5 bear-rounded bear-shadow-md bear-whitespace-nowrap","bear-text-gray-800 dark:bear-text-gray-200","bear-border bear-border-gray-200 dark:bear-border-gray-600"),children:e.label}),B===e.id&&e.popup&&s.jsx("div",{className:x.cn("bear-absolute bear-left-1/2 bear--translate-x-1/2 bear-bottom-full bear-mb-2","bear-bg-white dark:bear-bg-gray-800 bear-rounded-lg bear-shadow-xl","bear-p-3 bear-min-w-[150px] bear-max-w-[250px]","bear-border bear-border-gray-200 dark:bear-border-gray-600","bear-z-20"),onClick:o=>o.stopPropagation(),children:e.popup})]},e.id)),G&&s.jsxs("div",{className:"bear-absolute bear-top-3 bear-right-3 bear-z-20 bear-flex bear-flex-col bear-gap-1",children:[s.jsx("button",{onClick:e=>{e.stopPropagation(),c({...t,zoom:t.zoom+1})},disabled:t.zoom>=j,className:x.cn("bear-flex bear-items-center bear-justify-center bear-rounded-md","bear-bg-white dark:bear-bg-gray-800 bear-shadow-md","bear-text-gray-700 dark:bear-text-gray-200","hover:bear-bg-gray-50 dark:hover:bear-bg-gray-700","bear-border bear-border-gray-200 dark:bear-border-gray-600","bear-transition-colors bear-duration-150","disabled:bear-opacity-50 disabled:bear-cursor-not-allowed"),style:{width:a.ZOOM_BUTTON_SIZE,height:a.ZOOM_BUTTON_SIZE},"aria-label":"Zoom in",children:s.jsx("svg",{className:"bear-w-4 bear-h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})}),s.jsx("button",{onClick:e=>{e.stopPropagation(),c({...t,zoom:t.zoom-1})},disabled:t.zoom<=L,className:x.cn("bear-flex bear-items-center bear-justify-center bear-rounded-md","bear-bg-white dark:bear-bg-gray-800 bear-shadow-md","bear-text-gray-700 dark:bear-text-gray-200","hover:bear-bg-gray-50 dark:hover:bear-bg-gray-700","bear-border bear-border-gray-200 dark:bear-border-gray-600","bear-transition-colors bear-duration-150","disabled:bear-opacity-50 disabled:bear-cursor-not-allowed"),style:{width:a.ZOOM_BUTTON_SIZE,height:a.ZOOM_BUTTON_SIZE},"aria-label":"Zoom out",children:s.jsx("svg",{className:"bear-w-4 bear-h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 12H4"})})})]}),J&&H&&s.jsx("div",{className:"bear-absolute bear-bottom-1 bear-right-1 bear-z-20 bear-text-[10px] bear-text-gray-500 bear-bg-white/80 dark:bear-bg-gray-900/80 bear-px-1.5 bear-py-0.5 bear-rounded",children:H})]})};exports.Map=xe;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t={lat:40.7128,lng:-74.006,zoom:10},e="var(--bear-primary-500)",a=32,r=1,n=19,o=256,s={openstreetmap:"https://tile.openstreetmap.org/{z}/{x}/{y}.png","cartodb-light":"https://basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png","cartodb-dark":"https://basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png","stamen-terrain":"https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png"},p={openstreetmap:"© OpenStreetMap contributors","cartodb-light":"© CartoDB © OpenStreetMap","cartodb-dark":"© CartoDB © OpenStreetMap","stamen-terrain":"© Stamen Design © OpenStreetMap"},O=36;exports.DEFAULT_MARKER_COLOR=e;exports.DEFAULT_VIEWPORT=t;exports.MARKER_SIZE=a;exports.MAX_ZOOM=n;exports.MIN_ZOOM=r;exports.TILE_ATTRIBUTIONS=p;exports.TILE_SIZE=o;exports.TILE_URLS=s;exports.ZOOM_BUTTON_SIZE=O;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MapViewport, MapTileProvider } from './Map.types';
|
|
2
|
+
/** Default viewport - centered on the world */
|
|
3
|
+
export declare const DEFAULT_VIEWPORT: MapViewport;
|
|
4
|
+
/** Default marker color */
|
|
5
|
+
export declare const DEFAULT_MARKER_COLOR = "var(--bear-primary-500)";
|
|
6
|
+
/** Default marker size in px */
|
|
7
|
+
export declare const MARKER_SIZE = 32;
|
|
8
|
+
/** Marker pulse animation size in px */
|
|
9
|
+
export declare const MARKER_PULSE_SIZE = 48;
|
|
10
|
+
/** Min/Max zoom levels */
|
|
11
|
+
export declare const MIN_ZOOM = 1;
|
|
12
|
+
export declare const MAX_ZOOM = 19;
|
|
13
|
+
/** Tile size in px */
|
|
14
|
+
export declare const TILE_SIZE = 256;
|
|
15
|
+
/** Tile URL templates for providers */
|
|
16
|
+
export declare const TILE_URLS: Record<Exclude<MapTileProvider, 'custom'>, string>;
|
|
17
|
+
/** Attribution text for providers */
|
|
18
|
+
export declare const TILE_ATTRIBUTIONS: Record<Exclude<MapTileProvider, 'custom'>, string>;
|
|
19
|
+
/** Zoom button size */
|
|
20
|
+
export declare const ZOOM_BUTTON_SIZE = 36;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const t = {
|
|
2
|
+
lat: 40.7128,
|
|
3
|
+
lng: -74.006,
|
|
4
|
+
zoom: 10
|
|
5
|
+
}, a = "var(--bear-primary-500)", e = 32, n = 1, r = 19, o = 256, s = {
|
|
6
|
+
openstreetmap: "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
|
|
7
|
+
"cartodb-light": "https://basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",
|
|
8
|
+
"cartodb-dark": "https://basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png",
|
|
9
|
+
"stamen-terrain": "https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png"
|
|
10
|
+
}, p = {
|
|
11
|
+
openstreetmap: "© OpenStreetMap contributors",
|
|
12
|
+
"cartodb-light": "© CartoDB © OpenStreetMap",
|
|
13
|
+
"cartodb-dark": "© CartoDB © OpenStreetMap",
|
|
14
|
+
"stamen-terrain": "© Stamen Design © OpenStreetMap"
|
|
15
|
+
}, c = 36;
|
|
16
|
+
export {
|
|
17
|
+
a as DEFAULT_MARKER_COLOR,
|
|
18
|
+
t as DEFAULT_VIEWPORT,
|
|
19
|
+
e as MARKER_SIZE,
|
|
20
|
+
r as MAX_ZOOM,
|
|
21
|
+
n as MIN_ZOOM,
|
|
22
|
+
p as TILE_ATTRIBUTIONS,
|
|
23
|
+
o as TILE_SIZE,
|
|
24
|
+
s as TILE_URLS,
|
|
25
|
+
c as ZOOM_BUTTON_SIZE
|
|
26
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { MapProps } from './Map.types';
|
|
3
|
+
/**
|
|
4
|
+
* Map - Interactive map component with markers, zoom, and tile providers
|
|
5
|
+
*
|
|
6
|
+
* @description
|
|
7
|
+
* Zero-dependency interactive map built on OpenStreetMap tiles.
|
|
8
|
+
* Supports markers, drag, zoom, and multiple tile providers.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <Map
|
|
13
|
+
* markers={[{ id: '1', lat: 40.71, lng: -74.00, label: 'NYC' }]}
|
|
14
|
+
* viewport={{ lat: 40.71, lng: -74.00, zoom: 12 }}
|
|
15
|
+
* onMarkerClick={(m) => console.log(m.label)}
|
|
16
|
+
* height={400}
|
|
17
|
+
* />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare const Map: FC<MapProps>;
|