@forgedevstack/bear 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/README.md +0 -4
  2. package/dist/components/AnimatedCounter/AnimatedCounter.cjs +1 -0
  3. package/dist/components/AnimatedCounter/AnimatedCounter.const.cjs +1 -0
  4. package/dist/components/AnimatedCounter/AnimatedCounter.const.d.ts +5 -0
  5. package/dist/components/AnimatedCounter/AnimatedCounter.const.js +7 -0
  6. package/dist/components/AnimatedCounter/AnimatedCounter.d.ts +3 -0
  7. package/dist/components/AnimatedCounter/AnimatedCounter.js +59 -0
  8. package/dist/components/AnimatedCounter/AnimatedCounter.types.d.ts +26 -0
  9. package/dist/components/AnimatedCounter/AnimatedCounter.utils.cjs +1 -0
  10. package/dist/components/AnimatedCounter/AnimatedCounter.utils.d.ts +6 -0
  11. package/dist/components/AnimatedCounter/AnimatedCounter.utils.js +13 -0
  12. package/dist/components/AnimatedCounter/index.d.ts +2 -0
  13. package/dist/components/CurrencyInput/CurrencyInput.cjs +1 -0
  14. package/dist/components/CurrencyInput/CurrencyInput.const.cjs +1 -0
  15. package/dist/components/CurrencyInput/CurrencyInput.const.d.ts +4 -0
  16. package/dist/components/CurrencyInput/CurrencyInput.const.js +19 -0
  17. package/dist/components/CurrencyInput/CurrencyInput.d.ts +3 -0
  18. package/dist/components/CurrencyInput/CurrencyInput.js +60 -0
  19. package/dist/components/CurrencyInput/CurrencyInput.types.d.ts +22 -0
  20. package/dist/components/CurrencyInput/CurrencyInput.utils.cjs +1 -0
  21. package/dist/components/CurrencyInput/CurrencyInput.utils.d.ts +2 -0
  22. package/dist/components/CurrencyInput/CurrencyInput.utils.js +14 -0
  23. package/dist/components/CurrencyInput/index.d.ts +2 -0
  24. package/dist/components/DiffViewer/DiffViewer.cjs +1 -1
  25. package/dist/components/DiffViewer/DiffViewer.const.cjs +1 -1
  26. package/dist/components/DiffViewer/DiffViewer.const.d.ts +6 -0
  27. package/dist/components/DiffViewer/DiffViewer.const.js +17 -4
  28. package/dist/components/DiffViewer/DiffViewer.d.ts +0 -14
  29. package/dist/components/DiffViewer/DiffViewer.js +97 -105
  30. package/dist/components/DiffViewer/DiffViewer.types.d.ts +5 -0
  31. package/dist/components/DiffViewer/index.d.ts +1 -1
  32. package/dist/components/GlowCard/GlowCard.cjs +1 -0
  33. package/dist/components/GlowCard/GlowCard.const.cjs +1 -0
  34. package/dist/components/GlowCard/GlowCard.const.d.ts +11 -0
  35. package/dist/components/GlowCard/GlowCard.const.js +13 -0
  36. package/dist/components/GlowCard/GlowCard.d.ts +3 -0
  37. package/dist/components/GlowCard/GlowCard.js +185 -0
  38. package/dist/components/GlowCard/GlowCard.types.d.ts +21 -0
  39. package/dist/components/GlowCard/index.d.ts +2 -0
  40. package/dist/components/Heatmap/Heatmap.cjs +1 -0
  41. package/dist/components/Heatmap/Heatmap.const.cjs +1 -0
  42. package/dist/components/Heatmap/Heatmap.const.d.ts +8 -0
  43. package/dist/components/Heatmap/Heatmap.const.js +11 -0
  44. package/dist/components/Heatmap/Heatmap.d.ts +3 -0
  45. package/dist/components/Heatmap/Heatmap.js +103 -0
  46. package/dist/components/Heatmap/Heatmap.types.d.ts +34 -0
  47. package/dist/components/Heatmap/Heatmap.utils.cjs +1 -0
  48. package/dist/components/Heatmap/Heatmap.utils.d.ts +2 -0
  49. package/dist/components/Heatmap/Heatmap.utils.js +18 -0
  50. package/dist/components/Heatmap/index.d.ts +2 -0
  51. package/dist/components/ImageAnnotation/ImageAnnotation.cjs +1 -0
  52. package/dist/components/ImageAnnotation/ImageAnnotation.const.cjs +1 -0
  53. package/dist/components/ImageAnnotation/ImageAnnotation.const.d.ts +3 -0
  54. package/dist/components/ImageAnnotation/ImageAnnotation.const.js +6 -0
  55. package/dist/components/ImageAnnotation/ImageAnnotation.d.ts +3 -0
  56. package/dist/components/ImageAnnotation/ImageAnnotation.js +113 -0
  57. package/dist/components/ImageAnnotation/ImageAnnotation.types.d.ts +28 -0
  58. package/dist/components/ImageAnnotation/index.d.ts +2 -0
  59. package/dist/components/MediaPlayer/MediaPlayer.cjs +1 -0
  60. package/dist/components/MediaPlayer/MediaPlayer.const.cjs +1 -0
  61. package/dist/components/MediaPlayer/MediaPlayer.const.d.ts +36 -0
  62. package/dist/components/MediaPlayer/MediaPlayer.const.js +11 -0
  63. package/dist/components/MediaPlayer/MediaPlayer.d.ts +3 -0
  64. package/dist/components/MediaPlayer/MediaPlayer.js +279 -0
  65. package/dist/components/MediaPlayer/MediaPlayer.types.d.ts +69 -0
  66. package/dist/components/MediaPlayer/MediaPlayer.utils.cjs +1 -0
  67. package/dist/components/MediaPlayer/MediaPlayer.utils.d.ts +1 -0
  68. package/dist/components/MediaPlayer/MediaPlayer.utils.js +7 -0
  69. package/dist/components/MediaPlayer/index.d.ts +2 -0
  70. package/dist/components/Stepper/Stepper.cjs +1 -1
  71. package/dist/components/Stepper/Stepper.const.cjs +1 -1
  72. package/dist/components/Stepper/Stepper.const.d.ts +25 -4
  73. package/dist/components/Stepper/Stepper.const.js +39 -21
  74. package/dist/components/Stepper/Stepper.d.ts +3 -3
  75. package/dist/components/Stepper/Stepper.js +168 -156
  76. package/dist/components/Stepper/Stepper.types.d.ts +12 -1
  77. package/dist/components/Stepper/Stepper.utils.cjs +1 -0
  78. package/dist/components/Stepper/Stepper.utils.d.ts +12 -0
  79. package/dist/components/Stepper/Stepper.utils.js +19 -0
  80. package/dist/components/Stepper/components/StepperControls.cjs +1 -0
  81. package/dist/components/Stepper/components/StepperControls.d.ts +2 -0
  82. package/dist/components/Stepper/components/StepperControls.js +32 -0
  83. package/dist/components/Stepper/index.d.ts +2 -1
  84. package/dist/components/TagCloud/TagCloud.cjs +1 -0
  85. package/dist/components/TagCloud/TagCloud.const.cjs +1 -0
  86. package/dist/components/TagCloud/TagCloud.const.d.ts +5 -0
  87. package/dist/components/TagCloud/TagCloud.const.js +8 -0
  88. package/dist/components/TagCloud/TagCloud.d.ts +3 -0
  89. package/dist/components/TagCloud/TagCloud.js +76 -0
  90. package/dist/components/TagCloud/TagCloud.types.d.ts +26 -0
  91. package/dist/components/TagCloud/index.d.ts +2 -0
  92. package/dist/components/TimelineChart/TimelineChart.cjs +1 -0
  93. package/dist/components/TimelineChart/TimelineChart.const.cjs +1 -0
  94. package/dist/components/TimelineChart/TimelineChart.const.d.ts +6 -0
  95. package/dist/components/TimelineChart/TimelineChart.const.js +9 -0
  96. package/dist/components/TimelineChart/TimelineChart.d.ts +3 -0
  97. package/dist/components/TimelineChart/TimelineChart.js +65 -0
  98. package/dist/components/TimelineChart/TimelineChart.types.d.ts +31 -0
  99. package/dist/components/TimelineChart/index.d.ts +2 -0
  100. package/dist/components/index.cjs +1 -1
  101. package/dist/components/index.d.ts +17 -1
  102. package/dist/components/index.js +286 -269
  103. package/dist/index.cjs +1 -1
  104. package/dist/index.js +361 -344
  105. package/dist/styles/_effects.css +15 -0
  106. package/dist/styles.css +1 -1
  107. package/package.json +1 -1
@@ -1,127 +1,119 @@
1
- import { jsxs as r, jsx as d } from "react/jsx-runtime";
2
- import { useMemo as v } from "react";
3
- import { cn as h } from "../../utils/cn.js";
4
- import { useBear as B } from "../../context/BearProvider.js";
5
- import { Typography as i } from "../Typography/Typography.js";
6
- import { LINE_NUMBER_WIDTH as M, DIFF_COLORS as O } from "./DiffViewer.const.js";
7
- import { computeDiff as _, computeStats as j } from "./DiffViewer.utils.js";
8
- const H = ({
9
- oldValue: l,
10
- newValue: m,
11
- viewMode: x = "split",
12
- showLineNumbers: y = !0,
13
- oldTitle: N = "Original",
14
- newTitle: u = "Modified",
15
- showStats: f = !0,
16
- className: p,
17
- testId: g
1
+ import { jsxs as t, jsx as a } from "react/jsx-runtime";
2
+ import { useState as R, useMemo as x, useCallback as y } from "react";
3
+ import { cn as o } from "../../utils/cn.js";
4
+ import { useBear as W } from "../../context/BearProvider.js";
5
+ import { Typography as n } from "../Typography/Typography.js";
6
+ import { DEFAULT_OLD_TITLE as j, DEFAULT_NEW_TITLE as G, DEFAULT_SPACING as H, LINE_NUMBER_WIDTH as P, LINE_SPACING as V, DIFF_COLORS as $, LINE_HOVER_LABELS as q } from "./DiffViewer.const.js";
7
+ import { computeDiff as z, computeStats as J } from "./DiffViewer.utils.js";
8
+ const ae = ({
9
+ oldValue: p,
10
+ newValue: f,
11
+ viewMode: L = "split",
12
+ showLineNumbers: E = !0,
13
+ oldTitle: k = j,
14
+ newTitle: _ = G,
15
+ showStats: D = !0,
16
+ spacing: T = H,
17
+ showLineHoverInfo: i = !1,
18
+ className: w,
19
+ testId: v
18
20
  }) => {
19
- const { mode: w } = B(), b = w === "dark", o = v(() => _(l, m), [l, m]), t = v(() => j(o), [o]), n = (e) => y ? /* @__PURE__ */ d(
21
+ const { mode: C } = W(), S = C === "dark", [A, b] = R(null), d = x(() => z(p, f), [p, f]), c = x(() => J(d), [d]), h = V[T], B = y((e) => {
22
+ i && b(e);
23
+ }, [i]), F = y(() => {
24
+ b(null);
25
+ }, []), l = (e) => E ? /* @__PURE__ */ a(
20
26
  "span",
21
27
  {
22
- className: "select-none text-gray-400 dark:text-gray-600 text-right pr-3",
23
- style: { minWidth: M },
28
+ className: o("select-none text-gray-400 dark:text-gray-600 text-right pr-3", h),
29
+ style: { minWidth: P },
24
30
  children: e ?? ""
25
31
  }
26
- ) : null, s = (e, a) => {
27
- const c = O[a], D = a === "add" ? "+" : a === "remove" ? "-" : " ";
28
- return /* @__PURE__ */ r(
32
+ ) : null, m = (e, r, s) => {
33
+ const g = $[r], U = r === "add" ? "+" : r === "remove" ? "-" : " ", I = s != null && A === s;
34
+ return /* @__PURE__ */ t(
29
35
  "div",
30
36
  {
31
- className: "flex font-mono text-sm",
37
+ className: o("flex font-mono text-sm relative group", h),
32
38
  style: {
33
- backgroundColor: c.bg,
34
- borderLeft: `3px solid ${c.border}`
39
+ backgroundColor: g.bg,
40
+ borderLeft: `3px solid ${g.border}`
35
41
  },
42
+ onMouseEnter: () => s != null && B(s),
43
+ onMouseLeave: F,
36
44
  children: [
37
- /* @__PURE__ */ d(
45
+ /* @__PURE__ */ a(
38
46
  "span",
39
47
  {
40
48
  className: "px-2 select-none font-bold",
41
- style: { color: c.text },
42
- children: D
49
+ style: { color: g.text },
50
+ children: U
43
51
  }
44
52
  ),
45
- /* @__PURE__ */ d("span", { className: "flex-1 whitespace-pre", children: e })
46
- ]
47
- }
48
- );
49
- };
50
- if (x === "unified")
51
- return /* @__PURE__ */ r(
52
- "div",
53
- {
54
- className: h(
55
- "Bear-DiffViewer",
56
- "rounded-lg overflow-hidden border",
57
- b ? "bg-gray-900 border-gray-700" : "bg-white border-gray-200",
58
- p
59
- ),
60
- "data-testid": g,
61
- children: [
62
- f && /* @__PURE__ */ r("div", { className: "flex items-center gap-4 px-4 py-2 border-b border-gray-200 dark:border-gray-700", children: [
63
- /* @__PURE__ */ r(i, { variant: "caption", className: "text-green-600", children: [
64
- "+",
65
- t.additions,
66
- " additions"
67
- ] }),
68
- /* @__PURE__ */ r(i, { variant: "caption", className: "text-red-600", children: [
69
- "-",
70
- t.deletions,
71
- " deletions"
72
- ] })
73
- ] }),
74
- /* @__PURE__ */ d("div", { className: "overflow-x-auto", children: o.map((e, a) => /* @__PURE__ */ r("div", { className: "flex", children: [
75
- n(e.oldLineNumber || e.newLineNumber),
76
- /* @__PURE__ */ d("div", { className: "flex-1", children: s(e.content, e.type) })
77
- ] }, a)) })
53
+ /* @__PURE__ */ a("span", { className: "flex-1 whitespace-pre", children: e }),
54
+ i && I && r !== "context" && /* @__PURE__ */ a(
55
+ "span",
56
+ {
57
+ className: o(
58
+ "absolute right-2 top-1/2 -translate-y-1/2 text-xs px-2 py-0.5 rounded",
59
+ r === "add" ? "bg-green-500/20 text-green-600 dark:text-green-400" : "bg-red-500/20 text-red-600 dark:text-red-400"
60
+ ),
61
+ children: q[r]
62
+ }
63
+ )
78
64
  ]
79
65
  }
80
66
  );
81
- const k = o.filter((e) => e.type !== "add"), L = o.filter((e) => e.type !== "remove");
82
- return /* @__PURE__ */ r(
83
- "div",
84
- {
85
- className: h(
86
- "Bear-DiffViewer",
87
- "rounded-lg overflow-hidden border",
88
- b ? "bg-gray-900 border-gray-700" : "bg-white border-gray-200",
89
- p
90
- ),
91
- "data-testid": g,
92
- children: [
93
- f && /* @__PURE__ */ r("div", { className: "flex items-center gap-4 px-4 py-2 border-b border-gray-200 dark:border-gray-700", children: [
94
- /* @__PURE__ */ r(i, { variant: "caption", className: "text-green-600", children: [
95
- "+",
96
- t.additions,
97
- " additions"
98
- ] }),
99
- /* @__PURE__ */ r(i, { variant: "caption", className: "text-red-600", children: [
100
- "-",
101
- t.deletions,
102
- " deletions"
103
- ] })
104
- ] }),
105
- /* @__PURE__ */ r("div", { className: "grid grid-cols-2 divide-x divide-gray-200 dark:divide-gray-700", children: [
106
- /* @__PURE__ */ r("div", { children: [
107
- /* @__PURE__ */ d("div", { className: "px-3 py-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ d(i, { variant: "caption", className: "font-semibold", children: N }) }),
108
- /* @__PURE__ */ d("div", { className: "overflow-x-auto", children: k.map((e, a) => /* @__PURE__ */ r("div", { className: "flex", children: [
109
- n(e.oldLineNumber),
110
- /* @__PURE__ */ d("div", { className: "flex-1", children: s(e.content, e.type === "remove" ? "remove" : "context") })
111
- ] }, a)) })
112
- ] }),
113
- /* @__PURE__ */ r("div", { children: [
114
- /* @__PURE__ */ d("div", { className: "px-3 py-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ d(i, { variant: "caption", className: "font-semibold", children: u }) }),
115
- /* @__PURE__ */ d("div", { className: "overflow-x-auto", children: L.map((e, a) => /* @__PURE__ */ r("div", { className: "flex", children: [
116
- n(e.newLineNumber),
117
- /* @__PURE__ */ d("div", { className: "flex-1", children: s(e.content, e.type === "add" ? "add" : "context") })
118
- ] }, a)) })
119
- ] })
120
- ] })
121
- ]
122
- }
67
+ }, u = () => D ? /* @__PURE__ */ t("div", { className: "flex items-center gap-4 px-4 py-2 border-b border-gray-200 dark:border-gray-700", children: [
68
+ /* @__PURE__ */ t(n, { variant: "caption", className: "text-green-600", children: [
69
+ "+",
70
+ c.additions,
71
+ " additions"
72
+ ] }),
73
+ /* @__PURE__ */ t(n, { variant: "caption", className: "text-red-600", children: [
74
+ "-",
75
+ c.deletions,
76
+ " deletions"
77
+ ] }),
78
+ /* @__PURE__ */ t(n, { variant: "caption", className: "text-gray-500", children: [
79
+ c.unchanged,
80
+ " unchanged"
81
+ ] })
82
+ ] }) : null, N = o(
83
+ "Bear-DiffViewer",
84
+ "rounded-lg overflow-hidden border",
85
+ S ? "bg-gray-900 border-gray-700" : "bg-white border-gray-200",
86
+ w
123
87
  );
88
+ if (L === "unified")
89
+ return /* @__PURE__ */ t("div", { className: N, "data-testid": v, children: [
90
+ u(),
91
+ /* @__PURE__ */ a("div", { className: "overflow-x-auto", children: d.map((e, r) => /* @__PURE__ */ t("div", { className: "flex", children: [
92
+ l(e.oldLineNumber || e.newLineNumber),
93
+ /* @__PURE__ */ a("div", { className: "flex-1", children: m(e.content, e.type, r) })
94
+ ] }, r)) })
95
+ ] });
96
+ const M = d.filter((e) => e.type !== "add"), O = d.filter((e) => e.type !== "remove");
97
+ return /* @__PURE__ */ t("div", { className: N, "data-testid": v, children: [
98
+ u(),
99
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-2 divide-x divide-gray-200 dark:divide-gray-700", children: [
100
+ /* @__PURE__ */ t("div", { children: [
101
+ /* @__PURE__ */ a("div", { className: "px-3 py-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ a(n, { variant: "caption", className: "font-semibold", children: k }) }),
102
+ /* @__PURE__ */ a("div", { className: "overflow-x-auto", children: M.map((e, r) => /* @__PURE__ */ t("div", { className: "flex", children: [
103
+ l(e.oldLineNumber),
104
+ /* @__PURE__ */ a("div", { className: "flex-1", children: m(e.content, e.type === "remove" ? "remove" : "context", r) })
105
+ ] }, r)) })
106
+ ] }),
107
+ /* @__PURE__ */ t("div", { children: [
108
+ /* @__PURE__ */ a("div", { className: "px-3 py-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ a(n, { variant: "caption", className: "font-semibold", children: _ }) }),
109
+ /* @__PURE__ */ a("div", { className: "overflow-x-auto", children: O.map((e, r) => /* @__PURE__ */ t("div", { className: "flex", children: [
110
+ l(e.newLineNumber),
111
+ /* @__PURE__ */ a("div", { className: "flex-1", children: m(e.content, e.type === "add" ? "add" : "context", r) })
112
+ ] }, r)) })
113
+ ] })
114
+ ] })
115
+ ] });
124
116
  };
125
117
  export {
126
- H as DiffViewer
118
+ ae as DiffViewer
127
119
  };
@@ -3,6 +3,7 @@
3
3
  */
4
4
  export type DiffViewMode = 'split' | 'unified';
5
5
  export type DiffLineType = 'add' | 'remove' | 'context';
6
+ export type DiffSpacing = 'compact' | 'comfortable' | 'spacious';
6
7
  export interface DiffViewerProps {
7
8
  /** Original text (left side) */
8
9
  oldValue: string;
@@ -22,6 +23,10 @@ export interface DiffViewerProps {
22
23
  newTitle?: string;
23
24
  /** Show diff statistics */
24
25
  showStats?: boolean;
26
+ /** Line spacing density */
27
+ spacing?: DiffSpacing;
28
+ /** Show a tooltip on line hover with change type */
29
+ showLineHoverInfo?: boolean;
25
30
  /** Custom class name */
26
31
  className?: string;
27
32
  /** Test ID */
@@ -1,2 +1,2 @@
1
1
  export { DiffViewer } from './DiffViewer';
2
- export type { DiffViewerProps, DiffViewMode, DiffLine, DiffStats } from './DiffViewer.types';
2
+ export type { DiffViewerProps, DiffViewMode, DiffLine, DiffStats, DiffSpacing } from './DiffViewer.types';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("react"),C=require("../../utils/cn.cjs"),n=require("./GlowCard.const.cjs"),w=({children:$,glowColor:a=n.DEFAULT_GLOW_COLOR,glowIntensity:i=n.DEFAULT_GLOW_INTENSITY,followMouse:p=!0,borderRadius:c=n.DEFAULT_BORDER_RADIUS,disabled:u=!1,effect:v=n.DEFAULT_EFFECT,borderWidth:r=n.DEFAULT_BORDER_WIDTH,testId:y,className:E,style:b,...O})=>{const l=d.useRef(null),[s,T]=d.useState({x:n.CENTER_POSITION,y:n.CENTER_POSITION}),[m,_]=d.useState(!1),h=d.useCallback(x=>{if(!p||u||!l.current)return;const o=l.current.getBoundingClientRect();T({x:(x.clientX-o.left)/o.width*100,y:(x.clientY-o.top)/o.height*100})},[p,u]),t=m&&!u,A=typeof c=="number"?`${c}px`:c,B=()=>{switch(v){case"border":return e.jsx("div",{className:"Bear-GlowCard__border absolute inset-0 pointer-events-none rounded-[inherit] transition-opacity duration-300",style:{opacity:t?1:0,background:`radial-gradient(circle at ${s.x}% ${s.y}%, ${a}${n.HEX_OPACITY_BORDER}, transparent ${i}%)`,mask:"linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)",maskComposite:"exclude",WebkitMaskComposite:"xor",padding:r}});case"spotlight":return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"Bear-GlowCard__spot absolute inset-0 pointer-events-none transition-opacity duration-300",style:{opacity:t?.8:0,background:`radial-gradient(300px circle at ${s.x}% ${s.y}%, ${a}${n.HEX_OPACITY_AMBIENT}, transparent 60%)`}}),e.jsx("div",{className:"Bear-GlowCard__spot-border absolute inset-0 pointer-events-none rounded-[inherit] transition-opacity duration-300",style:{opacity:t?1:0,boxShadow:`inset 0 0 0 ${r}px ${a}${n.HEX_OPACITY_BORDER}`}})]});case"pulse":return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"Bear-GlowCard__pulse-inner absolute inset-0 pointer-events-none rounded-[inherit] transition-opacity duration-300",style:{opacity:t?1:0,background:`radial-gradient(ellipse at 50% 50%, ${a}${n.HEX_OPACITY_AMBIENT}, transparent 70%)`,animation:t?"bear-glow-pulse 2s ease-in-out infinite":"none"}}),e.jsx("div",{className:"Bear-GlowCard__pulse-outer absolute -inset-1 pointer-events-none rounded-[inherit]",style:{boxShadow:`0 0 ${i}px ${i/2}px ${a}${n.HEX_OPACITY_SHADOW}`,animation:t?"bear-glow-pulse 2s ease-in-out infinite":"none",opacity:t?1:0,transition:"opacity 0.3s"}}),e.jsx("div",{className:"Bear-GlowCard__pulse-ring absolute inset-0 pointer-events-none rounded-[inherit]",style:{boxShadow:`inset 0 0 0 ${r}px ${a}${n.HEX_OPACITY_BORDER}`,animation:t?"bear-glow-pulse 2s ease-in-out infinite 0.5s":"none",opacity:t?1:0,transition:"opacity 0.3s"}})]});case"wave":return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"Bear-GlowCard__wave absolute inset-0 pointer-events-none rounded-[inherit]",style:{opacity:t?1:0,transition:"opacity 0.3s",background:`linear-gradient(90deg, transparent 0%, ${a}${n.HEX_OPACITY_AMBIENT} 50%, transparent 100%)`,backgroundSize:"200% 100%",animation:t?"bear-glow-wave 2.5s ease-in-out infinite":"none"}}),e.jsx("div",{className:"Bear-GlowCard__wave-edge absolute inset-0 pointer-events-none rounded-[inherit]",style:{opacity:t?1:0,transition:"opacity 0.3s",boxShadow:`inset 0 ${r}px 0 ${a}${n.HEX_OPACITY_BORDER}, 0 0 ${i/2}px ${a}${n.HEX_OPACITY_SHADOW}`,animation:t?"bear-glow-wave-shadow 2.5s ease-in-out infinite":"none"}})]});default:return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"Bear-GlowCard__ambient absolute inset-0 pointer-events-none transition-opacity duration-300",style:{opacity:t?.6:0,background:`radial-gradient(circle at ${s.x}% ${s.y}%, ${a}${n.HEX_OPACITY_AMBIENT}, transparent ${i}%)`}}),e.jsx("div",{className:"Bear-GlowCard__shadow absolute inset-0 pointer-events-none rounded-[inherit] transition-opacity duration-300",style:{opacity:t?.6:0,boxShadow:`inset 0 0 0 1px ${a}${n.HEX_OPACITY_BORDER_SHADOW}, 0 0 ${i}px ${a}${n.HEX_OPACITY_SHADOW}`}})]})}};return e.jsxs("div",{ref:l,className:C.cn("Bear-GlowCard relative overflow-hidden transition-shadow duration-300","bg-white dark:bg-zinc-900 border border-gray-200 dark:border-zinc-700",t&&"shadow-xl",E),style:{borderRadius:A,...b},onMouseMove:h,onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),"data-testid":y,...O,children:[B(),e.jsx("div",{className:"Bear-GlowCard__content relative z-10",children:$})]})};exports.GlowCard=w;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E="#ec4899",_=40,O=12,T="ambient",A=2,D=50,I="66",R="33",t="22",L="44";exports.CENTER_POSITION=D;exports.DEFAULT_BORDER_RADIUS=O;exports.DEFAULT_BORDER_WIDTH=A;exports.DEFAULT_EFFECT=T;exports.DEFAULT_GLOW_COLOR=E;exports.DEFAULT_GLOW_INTENSITY=_;exports.HEX_OPACITY_AMBIENT=R;exports.HEX_OPACITY_BORDER=I;exports.HEX_OPACITY_BORDER_SHADOW=L;exports.HEX_OPACITY_SHADOW=t;
@@ -0,0 +1,11 @@
1
+ export declare const DEFAULT_GLOW_COLOR = "#ec4899";
2
+ export declare const DEFAULT_GLOW_INTENSITY = 40;
3
+ export declare const DEFAULT_BORDER_RADIUS = 12;
4
+ export declare const DEFAULT_EFFECT: "ambient";
5
+ export declare const DEFAULT_BORDER_WIDTH = 2;
6
+ export declare const CENTER_POSITION = 50;
7
+ export declare const HEX_OPACITY_BORDER = "66";
8
+ export declare const HEX_OPACITY_AMBIENT = "33";
9
+ export declare const HEX_OPACITY_SHADOW = "22";
10
+ export declare const HEX_OPACITY_BORDER_SHADOW = "44";
11
+ export declare const PULSE_INTERVAL_MS = 2000;
@@ -0,0 +1,13 @@
1
+ const E = "#ec4899", _ = 40, O = 12, T = "ambient", A = 2, D = 50, t = "66", c = "33", n = "22", o = "44";
2
+ export {
3
+ D as CENTER_POSITION,
4
+ O as DEFAULT_BORDER_RADIUS,
5
+ A as DEFAULT_BORDER_WIDTH,
6
+ T as DEFAULT_EFFECT,
7
+ E as DEFAULT_GLOW_COLOR,
8
+ _ as DEFAULT_GLOW_INTENSITY,
9
+ c as HEX_OPACITY_AMBIENT,
10
+ t as HEX_OPACITY_BORDER,
11
+ o as HEX_OPACITY_BORDER_SHADOW,
12
+ n as HEX_OPACITY_SHADOW
13
+ };
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { GlowCardProps } from './GlowCard.types';
3
+ export declare const GlowCard: FC<GlowCardProps>;
@@ -0,0 +1,185 @@
1
+ import { jsxs as r, jsx as t, Fragment as d } from "react/jsx-runtime";
2
+ import { useRef as A, useState as m, useCallback as C } from "react";
3
+ import { cn as D } from "../../utils/cn.js";
4
+ import { CENTER_POSITION as h, DEFAULT_BORDER_RADIUS as R, DEFAULT_GLOW_COLOR as S, DEFAULT_GLOW_INTENSITY as L, DEFAULT_EFFECT as F, DEFAULT_BORDER_WIDTH as H, HEX_OPACITY_AMBIENT as c, HEX_OPACITY_BORDER_SHADOW as M, HEX_OPACITY_SHADOW as $, HEX_OPACITY_BORDER as p } from "./GlowCard.const.js";
5
+ const X = ({
6
+ children: x,
7
+ glowColor: n = S,
8
+ glowIntensity: a = L,
9
+ followMouse: v = !0,
10
+ borderRadius: u = R,
11
+ disabled: l = !1,
12
+ effect: f = F,
13
+ borderWidth: s = H,
14
+ testId: w,
15
+ className: E,
16
+ style: B,
17
+ ...N
18
+ }) => {
19
+ const _ = A(null), [i, g] = m({ x: h, y: h }), [G, y] = m(!1), O = C(
20
+ (b) => {
21
+ if (!v || l || !_.current) return;
22
+ const o = _.current.getBoundingClientRect();
23
+ g({
24
+ x: (b.clientX - o.left) / o.width * 100,
25
+ y: (b.clientY - o.top) / o.height * 100
26
+ });
27
+ },
28
+ [v, l]
29
+ ), e = G && !l, T = typeof u == "number" ? `${u}px` : u, k = () => {
30
+ switch (f) {
31
+ case "border":
32
+ return /* @__PURE__ */ t(
33
+ "div",
34
+ {
35
+ className: "Bear-GlowCard__border absolute inset-0 pointer-events-none rounded-[inherit] transition-opacity duration-300",
36
+ style: {
37
+ opacity: e ? 1 : 0,
38
+ background: `radial-gradient(circle at ${i.x}% ${i.y}%, ${n}${p}, transparent ${a}%)`,
39
+ mask: "linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)",
40
+ maskComposite: "exclude",
41
+ WebkitMaskComposite: "xor",
42
+ padding: s
43
+ }
44
+ }
45
+ );
46
+ case "spotlight":
47
+ return /* @__PURE__ */ r(d, { children: [
48
+ /* @__PURE__ */ t(
49
+ "div",
50
+ {
51
+ className: "Bear-GlowCard__spot absolute inset-0 pointer-events-none transition-opacity duration-300",
52
+ style: {
53
+ opacity: e ? 0.8 : 0,
54
+ background: `radial-gradient(300px circle at ${i.x}% ${i.y}%, ${n}${c}, transparent 60%)`
55
+ }
56
+ }
57
+ ),
58
+ /* @__PURE__ */ t(
59
+ "div",
60
+ {
61
+ className: "Bear-GlowCard__spot-border absolute inset-0 pointer-events-none rounded-[inherit] transition-opacity duration-300",
62
+ style: {
63
+ opacity: e ? 1 : 0,
64
+ boxShadow: `inset 0 0 0 ${s}px ${n}${p}`
65
+ }
66
+ }
67
+ )
68
+ ] });
69
+ case "pulse":
70
+ return /* @__PURE__ */ r(d, { children: [
71
+ /* @__PURE__ */ t(
72
+ "div",
73
+ {
74
+ className: "Bear-GlowCard__pulse-inner absolute inset-0 pointer-events-none rounded-[inherit] transition-opacity duration-300",
75
+ style: {
76
+ opacity: e ? 1 : 0,
77
+ background: `radial-gradient(ellipse at 50% 50%, ${n}${c}, transparent 70%)`,
78
+ animation: e ? "bear-glow-pulse 2s ease-in-out infinite" : "none"
79
+ }
80
+ }
81
+ ),
82
+ /* @__PURE__ */ t(
83
+ "div",
84
+ {
85
+ className: "Bear-GlowCard__pulse-outer absolute -inset-1 pointer-events-none rounded-[inherit]",
86
+ style: {
87
+ boxShadow: `0 0 ${a}px ${a / 2}px ${n}${$}`,
88
+ animation: e ? "bear-glow-pulse 2s ease-in-out infinite" : "none",
89
+ opacity: e ? 1 : 0,
90
+ transition: "opacity 0.3s"
91
+ }
92
+ }
93
+ ),
94
+ /* @__PURE__ */ t(
95
+ "div",
96
+ {
97
+ className: "Bear-GlowCard__pulse-ring absolute inset-0 pointer-events-none rounded-[inherit]",
98
+ style: {
99
+ boxShadow: `inset 0 0 0 ${s}px ${n}${p}`,
100
+ animation: e ? "bear-glow-pulse 2s ease-in-out infinite 0.5s" : "none",
101
+ opacity: e ? 1 : 0,
102
+ transition: "opacity 0.3s"
103
+ }
104
+ }
105
+ )
106
+ ] });
107
+ case "wave":
108
+ return /* @__PURE__ */ r(d, { children: [
109
+ /* @__PURE__ */ t(
110
+ "div",
111
+ {
112
+ className: "Bear-GlowCard__wave absolute inset-0 pointer-events-none rounded-[inherit]",
113
+ style: {
114
+ opacity: e ? 1 : 0,
115
+ transition: "opacity 0.3s",
116
+ background: `linear-gradient(90deg, transparent 0%, ${n}${c} 50%, transparent 100%)`,
117
+ backgroundSize: "200% 100%",
118
+ animation: e ? "bear-glow-wave 2.5s ease-in-out infinite" : "none"
119
+ }
120
+ }
121
+ ),
122
+ /* @__PURE__ */ t(
123
+ "div",
124
+ {
125
+ className: "Bear-GlowCard__wave-edge absolute inset-0 pointer-events-none rounded-[inherit]",
126
+ style: {
127
+ opacity: e ? 1 : 0,
128
+ transition: "opacity 0.3s",
129
+ boxShadow: `inset 0 ${s}px 0 ${n}${p}, 0 0 ${a / 2}px ${n}${$}`,
130
+ animation: e ? "bear-glow-wave-shadow 2.5s ease-in-out infinite" : "none"
131
+ }
132
+ }
133
+ )
134
+ ] });
135
+ default:
136
+ return /* @__PURE__ */ r(d, { children: [
137
+ /* @__PURE__ */ t(
138
+ "div",
139
+ {
140
+ className: "Bear-GlowCard__ambient absolute inset-0 pointer-events-none transition-opacity duration-300",
141
+ style: {
142
+ opacity: e ? 0.6 : 0,
143
+ background: `radial-gradient(circle at ${i.x}% ${i.y}%, ${n}${c}, transparent ${a}%)`
144
+ }
145
+ }
146
+ ),
147
+ /* @__PURE__ */ t(
148
+ "div",
149
+ {
150
+ className: "Bear-GlowCard__shadow absolute inset-0 pointer-events-none rounded-[inherit] transition-opacity duration-300",
151
+ style: {
152
+ opacity: e ? 0.6 : 0,
153
+ boxShadow: `inset 0 0 0 1px ${n}${M}, 0 0 ${a}px ${n}${$}`
154
+ }
155
+ }
156
+ )
157
+ ] });
158
+ }
159
+ };
160
+ return /* @__PURE__ */ r(
161
+ "div",
162
+ {
163
+ ref: _,
164
+ className: D(
165
+ "Bear-GlowCard relative overflow-hidden transition-shadow duration-300",
166
+ "bg-white dark:bg-zinc-900 border border-gray-200 dark:border-zinc-700",
167
+ e && "shadow-xl",
168
+ E
169
+ ),
170
+ style: { borderRadius: T, ...B },
171
+ onMouseMove: O,
172
+ onMouseEnter: () => y(!0),
173
+ onMouseLeave: () => y(!1),
174
+ "data-testid": w,
175
+ ...N,
176
+ children: [
177
+ k(),
178
+ /* @__PURE__ */ t("div", { className: "Bear-GlowCard__content relative z-10", children: x })
179
+ ]
180
+ }
181
+ );
182
+ };
183
+ export {
184
+ X as GlowCard
185
+ };
@@ -0,0 +1,21 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ export type GlowEffect = 'ambient' | 'border' | 'spotlight' | 'pulse' | 'wave';
3
+ export interface GlowCardProps extends HTMLAttributes<HTMLDivElement> {
4
+ children?: ReactNode;
5
+ /** Glow color (CSS color value) */
6
+ glowColor?: string;
7
+ /** Glow intensity (0–100, controls blur/spread) */
8
+ glowIntensity?: number;
9
+ /** Whether glow follows the mouse position */
10
+ followMouse?: boolean;
11
+ /** Border radius */
12
+ borderRadius?: number | string;
13
+ /** Disable glow animation */
14
+ disabled?: boolean;
15
+ /** Glow effect style */
16
+ effect?: GlowEffect;
17
+ /** Border width for 'border' effect (px) */
18
+ borderWidth?: number;
19
+ /** Test ID */
20
+ testId?: string;
21
+ }
@@ -0,0 +1,2 @@
1
+ export { GlowCard } from './GlowCard';
2
+ export type { GlowCardProps, GlowEffect } from './GlowCard.types';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),l=require("react"),S=require("../../utils/cn.cjs"),W=require("../Popover/Popover.cjs"),N=require("../Typography/Typography.cjs"),o=require("./Heatmap.const.cjs"),k=require("./Heatmap.utils.cjs"),I=({data:v,startDate:d,endDate:h,colorScale:u=o.DEFAULT_COLOR_SCALE,cellSize:m=o.DEFAULT_CELL_SIZE,cellGap:p=o.DEFAULT_CELL_GAP,showDayLabels:y=!0,showMonthLabels:b=!0,emptyColor:L,tooltipFormat:E,onCellClick:x,renderTooltip:i,testId:D,className:O,...q})=>{const[g,H]=l.useState(null),[P,_]=l.useState(!1),R=l.useRef(new Map),{weeks:M,dataMap:T,maxValue:f}=l.useMemo(()=>{const e=h?new Date(h):new Date,a=d?new Date(d):new Date(e.getFullYear()-1,e.getMonth(),e.getDate()),c=new Map;let r=0;for(const n of v)c.set(n.date,n),n.value>r&&(r=n.value);return{weeks:k.getWeeks(a,e),dataMap:c,maxValue:r}},[v,d,h]),C=l.useCallback(e=>{if(e===0||f===0)return L??o.DEFAULT_EMPTY_COLOR;const a=Math.min(Math.floor(e/f*(u.length-1)),u.length-1);return u[a]},[f,L,u]),j=y?28:0,F=l.useCallback(e=>{!e||!i||(H(e),_(!0))},[i]),U=l.useCallback(()=>{_(!1),H(null)},[]);return s.jsxs("div",{className:S.cn("Bear-Heatmap relative inline-block",O),"data-testid":D,...q,children:[b&&s.jsx("div",{className:"Bear-Heatmap__months flex mb-1",style:{paddingLeft:j},children:M.map((e,a)=>{const c=e[0],r=a===0||c.getDate()<=o.DAYS_IN_WEEK;return s.jsx(N.Typography,{variant:"caption",className:"Bear-Heatmap__month text-gray-400 dark:text-gray-500 text-[10px]",style:{width:m+p,textAlign:"left"},children:r?o.MONTH_LABELS[c.getMonth()]:""},a)})}),s.jsxs("div",{className:"Bear-Heatmap__grid flex",children:[y&&s.jsx("div",{className:"Bear-Heatmap__days flex flex-col mr-1",style:{gap:p},children:o.DAY_LABELS.map((e,a)=>s.jsx(N.Typography,{variant:"caption",className:"Bear-Heatmap__day text-gray-400 dark:text-gray-500 text-[10px] flex items-center justify-end",style:{height:m,width:j-o.LABEL_PAD},children:e},a))}),s.jsx("div",{className:"Bear-Heatmap__weeks flex",style:{gap:p},children:M.map((e,a)=>s.jsx("div",{className:"Bear-Heatmap__week flex flex-col",style:{gap:p},children:e.map((c,r)=>{const n=k.toKey(c),t=T.get(n),w=(t==null?void 0:t.value)??0,Y=C(w),A=s.jsx("div",{ref:B=>{B&&R.current.set(n,B)},className:"Bear-Heatmap__cell rounded-sm cursor-pointer transition-transform hover:scale-125",style:{width:m,height:m,backgroundColor:Y},title:i?void 0:t?E?E(t):`${n}: ${w}`:n,onClick:()=>t&&(x==null?void 0:x(t)),onMouseEnter:()=>F(t),onMouseLeave:U},r);return i&&t&&(g==null?void 0:g.date)===t.date?s.jsx(W.Popover,{content:i(t),trigger:"hover",placement:"top",open:P,onOpenChange:_,arrow:!1,children:A},r):A})},a))})]})]})};exports.Heatmap=I;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=12,E=3,A=["#161b22","#0e4429","#006d32","#26a641","#39d353"],_="#ebedf0",t=["","Mon","","Wed","","Fri",""],D=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],e=7,o=4;exports.DAYS_IN_WEEK=e;exports.DAY_LABELS=t;exports.DEFAULT_CELL_GAP=E;exports.DEFAULT_CELL_SIZE=L;exports.DEFAULT_COLOR_SCALE=A;exports.DEFAULT_EMPTY_COLOR=_;exports.LABEL_PAD=o;exports.MONTH_LABELS=D;
@@ -0,0 +1,8 @@
1
+ export declare const DEFAULT_CELL_SIZE = 12;
2
+ export declare const DEFAULT_CELL_GAP = 3;
3
+ export declare const DEFAULT_COLOR_SCALE: string[];
4
+ export declare const DEFAULT_EMPTY_COLOR = "#ebedf0";
5
+ export declare const DAY_LABELS: string[];
6
+ export declare const MONTH_LABELS: string[];
7
+ export declare const DAYS_IN_WEEK = 7;
8
+ export declare const LABEL_PAD = 4;
@@ -0,0 +1,11 @@
1
+ const L = 12, A = 3, E = ["#161b22", "#0e4429", "#006d32", "#26a641", "#39d353"], _ = "#ebedf0", n = ["", "Mon", "", "Wed", "", "Fri", ""], o = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], c = 7, t = 4;
2
+ export {
3
+ c as DAYS_IN_WEEK,
4
+ n as DAY_LABELS,
5
+ A as DEFAULT_CELL_GAP,
6
+ L as DEFAULT_CELL_SIZE,
7
+ E as DEFAULT_COLOR_SCALE,
8
+ _ as DEFAULT_EMPTY_COLOR,
9
+ t as LABEL_PAD,
10
+ o as MONTH_LABELS
11
+ };
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { HeatmapProps } from './Heatmap.types';
3
+ export declare const Heatmap: FC<HeatmapProps>;