@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
@@ -0,0 +1,279 @@
1
+ import { jsx as e, jsxs as s, Fragment as De } from "react/jsx-runtime";
2
+ import { useRef as $, useState as p, useMemo as G, useEffect as U, useCallback as x } from "react";
3
+ import { cn as h } from "../../utils/cn.js";
4
+ import { BearIcons as i } from "../Icon/index.js";
5
+ import { SIZE_MAP as Oe, CENTER_ICON_SIZE as me, PROGRESS_HEIGHT as he, DEFAULT_ACCENT as Ye } from "./MediaPlayer.const.js";
6
+ import { formatTime as C } from "./MediaPlayer.utils.js";
7
+ import { useBearStyles as $e } from "../../hooks/useBearStyles.js";
8
+ const Ge = 320, fe = 16, Xe = ({
9
+ src: W,
10
+ type: R = "video",
11
+ poster: L,
12
+ autoPlay: j = !1,
13
+ loop: A = !1,
14
+ muted: Z = !1,
15
+ nativeControls: w = !1,
16
+ width: F,
17
+ height: q,
18
+ size: ge = "md",
19
+ accentColor: u = Ye,
20
+ playIcon: H,
21
+ pauseIcon: K,
22
+ muteIcon: pe,
23
+ unmuteIcon: xe,
24
+ fullscreenIcon: ye,
25
+ centerOverlay: ve = !1,
26
+ sticky: D = !1,
27
+ stickyPosition: V = "right",
28
+ stickySize: X = Ge,
29
+ airPlay: be = !1,
30
+ playlist: _,
31
+ onTrackChange: M,
32
+ bis: ke,
33
+ testId: Ne,
34
+ className: we,
35
+ style: Ie,
36
+ ..._e
37
+ }) => {
38
+ const f = $(null), J = $(null), Q = $(null), [N, O] = p(j), [I, ee] = p(0), [v, te] = p(0), [P, Me] = p(Z), [g, ne] = p(A), [S, Pe] = p(!1), [re, Se] = p(0), [Ee, E] = p(!j), [l, ze] = p(0), Y = $e(ke, Ie), m = G(() => _ && _.length > 0 ? _ : [{ src: W, poster: L, type: R, title: void 0, artist: void 0 }], [_, W, L, R]), a = m[l], Te = a.src, z = a.poster ?? L, c = a.type ?? R, d = m.length > 1, o = Oe[ge];
39
+ U(() => {
40
+ ne(A);
41
+ }, [A]), U(() => {
42
+ const t = f.current;
43
+ if (!t) return;
44
+ const n = () => ee(t.currentTime), r = () => te(t.duration), k = () => {
45
+ d && l < m.length - 1 ? b(l + 1) : g ? d && b(0) : (O(!1), E(!0));
46
+ };
47
+ return t.addEventListener("timeupdate", n), t.addEventListener("loadedmetadata", r), t.addEventListener("ended", k), () => {
48
+ t.removeEventListener("timeupdate", n), t.removeEventListener("loadedmetadata", r), t.removeEventListener("ended", k);
49
+ };
50
+ }, [g, d, l, m.length]), U(() => {
51
+ if (!D || c !== "video") return;
52
+ const t = Q.current;
53
+ if (!t) return;
54
+ const n = () => {
55
+ const k = t.getBoundingClientRect().bottom < 0;
56
+ Pe(k), k && Se(fe);
57
+ };
58
+ return window.addEventListener("scroll", n, { passive: !0 }), n(), () => window.removeEventListener("scroll", n);
59
+ }, [D, c]);
60
+ const b = x((t) => {
61
+ const n = Math.max(0, Math.min(m.length - 1, t));
62
+ ze(n), ee(0), te(0), E(!1), M == null || M(n, m[n]), setTimeout(() => {
63
+ const r = f.current;
64
+ r && (r.load(), r.play().catch(() => {
65
+ }), O(!0));
66
+ }, 50);
67
+ }, [m, M]), T = x(() => {
68
+ const t = f.current;
69
+ t && (N ? (t.pause(), E(!0)) : (t.play().catch(() => {
70
+ }), E(!1)), O(!N));
71
+ }, [N]), se = x((t) => {
72
+ const n = f.current;
73
+ if (!n || !v) return;
74
+ const r = t.currentTarget.getBoundingClientRect(), k = Math.max(0, Math.min(1, (t.clientX - r.left) / r.width));
75
+ n.currentTime = k * v;
76
+ }, [v]), ie = x(() => {
77
+ const t = f.current;
78
+ t && (t.muted = !P, Me(!P));
79
+ }, [P]), oe = x(() => {
80
+ const t = !g;
81
+ ne(t);
82
+ const n = f.current;
83
+ n && (n.loop = t);
84
+ }, [g]), Be = x(() => {
85
+ var n;
86
+ const t = J.current;
87
+ t && (document.fullscreenElement ? document.exitFullscreen() : (n = t.requestFullscreen) == null || n.call(t));
88
+ }, []), Ce = x(() => {
89
+ const t = f.current;
90
+ t != null && t.webkitShowPlaybackTargetPicker && t.webkitShowPlaybackTargetPicker();
91
+ }, []), ae = x(() => {
92
+ if (I > 3) {
93
+ const t = f.current;
94
+ t && (t.currentTime = 0);
95
+ } else l > 0 && b(l - 1);
96
+ }, [I, l, b]), le = x(() => {
97
+ l < m.length - 1 && b(l + 1);
98
+ }, [l, m.length, b]), ce = v ? I / v * 100 : 0, y = o.iconSm, B = o.iconMd, de = N ? K ?? /* @__PURE__ */ e(i.PauseIcon, { size: B }) : H ?? /* @__PURE__ */ e(i.PlayIcon, { size: B }), ue = P ? pe ?? /* @__PURE__ */ e(i.VolumeOffIcon, { size: y }) : xe ?? /* @__PURE__ */ e(i.VolumeUpIcon, { size: y }), Re = ye ?? /* @__PURE__ */ e(i.MaximizeIcon, { size: y }), Le = c === "video" ? "video" : "audio", je = G(() => S && c === "video" ? {
99
+ ...Y,
100
+ position: "fixed",
101
+ top: re,
102
+ [V === "left" ? "left" : "right"]: fe,
103
+ width: X,
104
+ zIndex: 50,
105
+ boxShadow: "0 8px 32px rgba(0,0,0,0.45)",
106
+ borderRadius: 12,
107
+ transition: "top 0.15s ease-out"
108
+ } : {
109
+ ...Y,
110
+ width: F ?? "100%",
111
+ height: q,
112
+ maxWidth: F ? void 0 : o.maxWidth
113
+ }, [S, c, Y, F, q, o.maxWidth, re, V, X]), Ae = G(() => {
114
+ if (!S)
115
+ return { aspectRatio: o.aspectRatio };
116
+ }, [S, o.aspectRatio]), Fe = `${u}20`;
117
+ return /* @__PURE__ */ s(De, { children: [
118
+ D && /* @__PURE__ */ e("div", { ref: Q, style: { height: 1 } }),
119
+ /* @__PURE__ */ s(
120
+ "div",
121
+ {
122
+ ref: J,
123
+ className: h("Bear-MediaPlayer relative rounded-xl overflow-hidden bg-black", we),
124
+ style: je,
125
+ "data-testid": Ne,
126
+ ..._e,
127
+ children: [
128
+ /* @__PURE__ */ e(
129
+ Le,
130
+ {
131
+ ref: f,
132
+ src: Te,
133
+ poster: z,
134
+ autoPlay: j,
135
+ loop: g && !d,
136
+ muted: Z,
137
+ controls: w,
138
+ playsInline: !0,
139
+ className: h(c === "video" ? "Bear-MediaPlayer__video w-full object-cover" : "hidden"),
140
+ style: c === "video" ? Ae : void 0,
141
+ onClick: c === "video" ? T : void 0
142
+ }
143
+ ),
144
+ ve && c === "video" && Ee && !w && /* @__PURE__ */ e(
145
+ "button",
146
+ {
147
+ type: "button",
148
+ onClick: T,
149
+ className: "Bear-MediaPlayer__overlay absolute inset-0 flex items-center justify-center bg-black/30 transition-opacity",
150
+ children: /* @__PURE__ */ e("div", { className: "w-16 h-16 rounded-full bg-white/90 flex items-center justify-center shadow-lg", children: N ? K ?? /* @__PURE__ */ e(i.PauseIcon, { size: me, className: "text-gray-900" }) : H ?? /* @__PURE__ */ e(i.PlayIcon, { size: me, className: "text-gray-900" }) })
151
+ }
152
+ ),
153
+ !w && c === "video" && /* @__PURE__ */ s("div", { className: h("Bear-MediaPlayer__controls absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent pt-8", o.padding), children: [
154
+ /* @__PURE__ */ e(
155
+ "div",
156
+ {
157
+ className: "Bear-MediaPlayer__progress w-full cursor-pointer mb-2 group",
158
+ style: { height: he },
159
+ onClick: se,
160
+ children: /* @__PURE__ */ e("div", { className: "w-full h-full bg-white/30 rounded-full relative overflow-hidden", children: /* @__PURE__ */ e("div", { className: "h-full rounded-full transition-all", style: { width: `${ce}%`, backgroundColor: u } }) })
161
+ }
162
+ ),
163
+ /* @__PURE__ */ s("div", { className: h("Bear-MediaPlayer__bar flex items-center", o.gap), children: [
164
+ d && /* @__PURE__ */ e("button", { type: "button", onClick: ae, className: "text-white hover:text-pink-400 transition-colors", children: /* @__PURE__ */ e(i.SkipBackIcon, { size: y }) }),
165
+ /* @__PURE__ */ e("button", { type: "button", onClick: T, className: "text-white hover:text-pink-400 transition-colors", children: de }),
166
+ d && /* @__PURE__ */ e("button", { type: "button", onClick: le, className: "text-white hover:text-pink-400 transition-colors", children: /* @__PURE__ */ e(i.SkipForwardIcon, { size: y }) }),
167
+ /* @__PURE__ */ e("button", { type: "button", onClick: ie, className: "text-white hover:text-pink-400 transition-colors", children: ue }),
168
+ /* @__PURE__ */ s("span", { className: h("Bear-MediaPlayer__time text-white font-mono", o.text), children: [
169
+ C(I),
170
+ " / ",
171
+ C(v)
172
+ ] }),
173
+ /* @__PURE__ */ e("div", { className: "flex-1" }),
174
+ /* @__PURE__ */ e(
175
+ "button",
176
+ {
177
+ type: "button",
178
+ onClick: oe,
179
+ className: "transition-colors",
180
+ style: { color: g ? u : void 0 },
181
+ title: "Loop",
182
+ children: /* @__PURE__ */ e(i.RepeatIcon, { size: y, className: g ? void 0 : "text-white/60 hover:text-white" })
183
+ }
184
+ ),
185
+ be && /* @__PURE__ */ e("button", { type: "button", onClick: Ce, className: "text-white hover:text-pink-400 transition-colors", title: "AirPlay", children: /* @__PURE__ */ e(i.CastIcon, { size: y }) }),
186
+ /* @__PURE__ */ e("button", { type: "button", onClick: Be, className: "text-white hover:text-pink-400 transition-colors", children: Re })
187
+ ] }),
188
+ d && a.title && /* @__PURE__ */ s("div", { className: "mt-1 flex items-center gap-2 truncate", children: [
189
+ /* @__PURE__ */ e("span", { className: "text-white text-xs font-medium truncate", children: a.title }),
190
+ a.artist && /* @__PURE__ */ s("span", { className: "text-white/50 text-xs truncate", children: [
191
+ "— ",
192
+ a.artist
193
+ ] })
194
+ ] })
195
+ ] }),
196
+ c === "audio" && !w && /* @__PURE__ */ s("div", { className: h("Bear-MediaPlayer__audio bg-gray-100 dark:bg-zinc-800 rounded-xl", o.padding), children: [
197
+ d && (z || a.title) && /* @__PURE__ */ s("div", { className: "flex items-center gap-3 mb-3", children: [
198
+ z && /* @__PURE__ */ e("img", { src: z, alt: "", className: "w-12 h-12 rounded-lg object-cover shrink-0" }),
199
+ /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
200
+ a.title && /* @__PURE__ */ e("p", { className: "text-sm font-semibold text-gray-900 dark:text-white truncate", children: a.title }),
201
+ a.artist && /* @__PURE__ */ e("p", { className: "text-xs text-gray-500 dark:text-gray-400 truncate", children: a.artist })
202
+ ] })
203
+ ] }),
204
+ /* @__PURE__ */ e("div", { className: "Bear-MediaPlayer__progress w-full cursor-pointer mb-1", style: { height: he }, onClick: se, children: /* @__PURE__ */ e("div", { className: "w-full h-full bg-gray-300 dark:bg-zinc-600 rounded-full overflow-hidden", children: /* @__PURE__ */ e("div", { className: "h-full rounded-full", style: { width: `${ce}%`, backgroundColor: u } }) }) }),
205
+ /* @__PURE__ */ s("div", { className: "flex justify-between mb-2", children: [
206
+ /* @__PURE__ */ e("span", { className: h("text-gray-500 font-mono", o.text), children: C(I) }),
207
+ /* @__PURE__ */ e("span", { className: h("text-gray-500 font-mono", o.text), children: C(v) })
208
+ ] }),
209
+ /* @__PURE__ */ s("div", { className: h("flex items-center justify-center", o.gap), children: [
210
+ /* @__PURE__ */ e(
211
+ "button",
212
+ {
213
+ type: "button",
214
+ onClick: oe,
215
+ className: "transition-colors",
216
+ style: { color: g ? u : void 0 },
217
+ title: "Loop",
218
+ children: /* @__PURE__ */ e(i.RepeatIcon, { size: y, className: g ? void 0 : "text-gray-400 hover:text-gray-600 dark:hover:text-gray-300" })
219
+ }
220
+ ),
221
+ d && /* @__PURE__ */ e("button", { type: "button", onClick: ae, className: "text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white transition-colors", children: /* @__PURE__ */ e(i.SkipBackIcon, { size: B }) }),
222
+ /* @__PURE__ */ e(
223
+ "button",
224
+ {
225
+ type: "button",
226
+ onClick: T,
227
+ className: "Bear-MediaPlayer__play w-10 h-10 rounded-full flex items-center justify-center text-white transition-colors",
228
+ style: { backgroundColor: u },
229
+ children: de
230
+ }
231
+ ),
232
+ d && /* @__PURE__ */ e("button", { type: "button", onClick: le, className: "text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white transition-colors", children: /* @__PURE__ */ e(i.SkipForwardIcon, { size: B }) }),
233
+ /* @__PURE__ */ e("button", { type: "button", onClick: ie, className: "text-gray-500 hover:text-gray-700 dark:hover:text-gray-300", children: ue })
234
+ ] })
235
+ ] }),
236
+ d && !w && /* @__PURE__ */ e("div", { className: "Bear-MediaPlayer__playlist bg-gray-50 dark:bg-zinc-900 border-t border-gray-200 dark:border-zinc-700 max-h-48 overflow-y-auto", children: m.map((t, n) => {
237
+ const r = n === l;
238
+ return /* @__PURE__ */ s(
239
+ "button",
240
+ {
241
+ type: "button",
242
+ onClick: () => b(n),
243
+ className: h(
244
+ "w-full flex items-center gap-3 px-3 py-2 text-left transition-colors",
245
+ !r && "hover:bg-gray-100 dark:hover:bg-zinc-800"
246
+ ),
247
+ style: r ? { backgroundColor: Fe } : void 0,
248
+ children: [
249
+ t.poster && /* @__PURE__ */ e("img", { src: t.poster, alt: "", className: "w-8 h-8 rounded object-cover shrink-0" }),
250
+ /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
251
+ /* @__PURE__ */ e(
252
+ "p",
253
+ {
254
+ className: "text-xs font-medium truncate",
255
+ style: r ? { color: u } : void 0,
256
+ children: t.title ?? `Track ${n + 1}`
257
+ }
258
+ ),
259
+ t.artist && /* @__PURE__ */ e("p", { className: "text-[10px] text-gray-400 truncate", children: t.artist })
260
+ ] }),
261
+ r && N && /* @__PURE__ */ s("div", { className: "flex items-end gap-0.5 h-3", children: [
262
+ /* @__PURE__ */ e("span", { className: "w-0.5 rounded-full animate-pulse", style: { height: "60%", backgroundColor: u } }),
263
+ /* @__PURE__ */ e("span", { className: "w-0.5 rounded-full animate-pulse", style: { height: "100%", backgroundColor: u, animationDelay: "0.2s" } }),
264
+ /* @__PURE__ */ e("span", { className: "w-0.5 rounded-full animate-pulse", style: { height: "40%", backgroundColor: u, animationDelay: "0.4s" } })
265
+ ] }),
266
+ /* @__PURE__ */ e("span", { className: "text-[10px] text-gray-400 tabular-nums shrink-0", children: n + 1 })
267
+ ]
268
+ },
269
+ n
270
+ );
271
+ }) })
272
+ ]
273
+ }
274
+ )
275
+ ] });
276
+ };
277
+ export {
278
+ Xe as MediaPlayer
279
+ };
@@ -0,0 +1,69 @@
1
+ import { HTMLAttributes, ReactNode } from 'react';
2
+ import { BisProp } from '../../types/bis.types';
3
+ export type MediaType = 'video' | 'audio';
4
+ export type MediaPlayerSize = 'sm' | 'md' | 'lg';
5
+ export type StickyPosition = 'left' | 'right';
6
+ export interface PlaylistItem {
7
+ /** Media source URL */
8
+ src: string;
9
+ /** Track title */
10
+ title?: string;
11
+ /** Artist or subtitle */
12
+ artist?: string;
13
+ /** Poster / cover art */
14
+ poster?: string;
15
+ /** Media type override */
16
+ type?: MediaType;
17
+ }
18
+ export interface MediaPlayerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
19
+ /** Media source URL */
20
+ src: string;
21
+ /** Media type */
22
+ type?: MediaType;
23
+ /** Poster image (video only) */
24
+ poster?: string;
25
+ /** Auto-play on mount */
26
+ autoPlay?: boolean;
27
+ /** Loop playback */
28
+ loop?: boolean;
29
+ /** Mute audio */
30
+ muted?: boolean;
31
+ /** Show native controls fallback */
32
+ nativeControls?: boolean;
33
+ /** Video width */
34
+ width?: number | string;
35
+ /** Video height */
36
+ height?: number | string;
37
+ /** Player size preset — controls aspect ratio and UI density */
38
+ size?: MediaPlayerSize;
39
+ /** Accent color for controls */
40
+ accentColor?: string;
41
+ /** Custom play icon */
42
+ playIcon?: ReactNode;
43
+ /** Custom pause icon */
44
+ pauseIcon?: ReactNode;
45
+ /** Custom mute icon */
46
+ muteIcon?: ReactNode;
47
+ /** Custom unmute icon */
48
+ unmuteIcon?: ReactNode;
49
+ /** Custom fullscreen icon */
50
+ fullscreenIcon?: ReactNode;
51
+ /** Show a large centered play/pause overlay on the video */
52
+ centerOverlay?: boolean;
53
+ /** Follow the scroll — player scrolls alongside the page at the given side */
54
+ sticky?: boolean;
55
+ /** Which side the sticky player appears on */
56
+ stickyPosition?: StickyPosition;
57
+ /** Sticky player width in px */
58
+ stickySize?: number;
59
+ /** Show AirPlay button (when browser supports it) */
60
+ airPlay?: boolean;
61
+ /** Playlist items — enables gallery mode */
62
+ playlist?: PlaylistItem[];
63
+ /** Called when active track changes */
64
+ onTrackChange?: (index: number, item: PlaylistItem) => void;
65
+ /** Bear Inner Style overrides */
66
+ bis?: BisProp;
67
+ /** Test ID */
68
+ testId?: string;
69
+ }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=60,n=2;function a(t){const r=Math.floor(t/o),e=Math.floor(t%o);return`${r}:${e.toString().padStart(n,"0")}`}exports.formatTime=a;
@@ -0,0 +1 @@
1
+ export declare function formatTime(s: number): string;
@@ -0,0 +1,7 @@
1
+ function n(t) {
2
+ const o = Math.floor(t / 60), E = Math.floor(t % 60);
3
+ return `${o}:${E.toString().padStart(2, "0")}`;
4
+ }
5
+ export {
6
+ n as formatTime
7
+ };
@@ -0,0 +1,2 @@
1
+ export { MediaPlayer } from './MediaPlayer';
2
+ export type { MediaPlayerProps, MediaType, MediaPlayerSize, PlaylistItem, StickyPosition } from './MediaPlayer.types';
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),m=require("react"),J=require("../../context/BearProvider.cjs"),K=require("../../utils/maxVisible.utils.cjs"),o=require("../../utils/cn.cjs"),s=require("./Stepper.const.cjs"),I=require("../Button/Button.cjs"),Q=require("../Dropdown/Dropdown.cjs"),X=require("../Icon/index.cjs"),Y=()=>r.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:r.jsx("polyline",{points:"20 6 9 17 4 12"})}),ee=()=>r.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",children:[r.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),Z=m.forwardRef(({steps:i,activeStep:d,onStepClick:S,orientation:C="horizontal",size:f="md",showNumbers:p=!0,clickable:x=!1,showConnectors:A=!0,connectorStyle:j="solid",alternativeLabel:u=!1,completedIcon:v,errorIcon:P,maxVisibleSteps:E,testId:g,className:U,...V},F)=>{const O=J.useBearThemeOptional(),[w,$]=m.useState(()=>typeof window<"u"?window.innerWidth:1200);m.useEffect(()=>{const e=()=>$(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const _=m.useMemo(()=>E==null?void 0:K.resolveMaxVisible(E,{width:w,theme:O}),[E,w,O]),B=(e,n)=>n.status?n.status:e<d?"completed":e===d?"active":"pending",h=C==="horizontal",L=s.STEP_INDICATOR_SIZES[f],N=s.STEP_LABEL_SIZES[f],T=h&&_!=null&&i.length>_,{visibleIndices:y,leftHidden:H,rightHidden:W}=m.useMemo(()=>{if(!T||_==null)return{visibleIndices:i.map((a,b)=>b),leftHidden:[],rightHidden:[]};const e=_,n=Math.max(0,Math.min(d-Math.floor(e/2),i.length-e)),t=Array.from({length:e},(a,b)=>n+b),l=[],c=[];for(let a=0;a<n;a++)l.push(a);for(let a=n+e;a<i.length;a++)c.push(a);return{visibleIndices:t,leftHidden:l,rightHidden:c}},[T,_,i.length,d]),z=T?s.STEP_WRAPPER_HORIZONTAL_WINDOW:s.STEP_WRAPPER_HORIZONTAL,q=(e,n,t)=>{const l=s.STEP_STATUS_CLASSES[t];let c=null;return e.icon?c=e.icon:t==="completed"?c=v||r.jsx(Y,{}):t==="error"?c=P||r.jsx(ee,{}):p&&(c=n+1),r.jsx("div",{className:o.cn(s.STEP_INDICATOR_BASE,L,l.indicator,x&&!e.disabled&&"cursor-pointer hover:scale-105"),onClick:()=>{x&&!e.disabled&&S&&S(n)},children:c})},R=e=>{if(!A||e===i.length-1)return null;const n=e<d;return r.jsx("div",{className:o.cn(s.CONNECTOR_BASE,h?s.CONNECTOR_HORIZONTAL:s.CONNECTOR_VERTICAL,n?s.CONNECTOR_STATUS.completed:s.CONNECTOR_STATUS.pending,j==="dashed"&&"border-t-2 border-dashed bg-transparent")})},M=(e,n)=>{const t=B(n,e),l=s.STEP_STATUS_CLASSES[t];return r.jsxs("div",{className:o.cn("flex",u?"flex-col items-center":"items-center gap-3"),children:[q(e,n,t),r.jsxs("div",{className:o.cn(u&&"text-center mt-2"),children:[r.jsx("div",{className:o.cn(s.STEP_LABEL_BASE,N.label,l.label),children:e.label}),e.description&&r.jsx("div",{className:o.cn(s.STEP_DESCRIPTION_CLASSES,N.description),children:e.description})]})]})},G=(e,n)=>{const t=B(n,e),l=s.STEP_STATUS_CLASSES[t];return r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"flex-shrink-0 mr-4",children:q(e,n,t)}),r.jsxs("div",{className:"flex-1 pt-0.5",children:[r.jsx("div",{className:o.cn(s.STEP_LABEL_BASE,N.label,l.label),children:e.label}),e.description&&r.jsx("div",{className:o.cn(s.STEP_DESCRIPTION_CLASSES,N.description),children:e.description}),e.content&&t==="active"&&r.jsx("div",{className:"mt-4",children:e.content})]})]})},D=(e,n)=>r.jsx("div",{className:o.cn("Bear-Stepper__step","Bear-Stepper__overflow",z),children:r.jsxs("div",{className:o.cn("flex",u?"flex-col items-center":"items-center gap-3"),children:[r.jsx(Q.Dropdown,{placement:"bottom-start",closeOnSelect:!0,trigger:r.jsx("button",{type:"button",className:o.cn(s.STEP_INDICATOR_BASE,L,s.STEP_STATUS_CLASSES.pending.indicator,"bear-cursor-pointer bear-border-0"),"aria-label":n==="left"?"Previous steps":"More steps",children:r.jsx(X.BearIcons.MoreHorizIcon,{size:16})}),items:e.map(t=>({key:`step-${t}`,label:i[t].label,disabled:i[t].disabled,onClick:()=>{i[t].disabled||S==null||S(t)}}))}),u&&r.jsx("div",{className:"text-center mt-2 bear-text-xs bear-text-gray-400",children:" "})]})},`overflow-${n}`);return r.jsxs("div",{ref:F,className:o.cn(s.STEPPER_BASE_CLASSES,h?s.STEPPER_HORIZONTAL_CLASSES:s.STEPPER_VERTICAL_CLASSES,U),"data-testid":g,...V,children:[h&&!T&&i.map((e,n)=>r.jsxs("div",{className:o.cn("Bear-Stepper__step",s.STEP_WRAPPER_HORIZONTAL),children:[M(e,n),R(n)]},n)),h&&T&&r.jsxs(r.Fragment,{children:[H.length>0&&D(H,"left"),y.map((e,n)=>{const t=i[e],l=y[n+1],c=l!=null&&l===e+1;return r.jsxs("div",{className:o.cn("Bear-Stepper__step",z),children:[M(t,e),c&&R(e)]},e)}),W.length>0&&D(W,"right")]}),!h&&i.map((e,n)=>r.jsxs("div",{className:o.cn("Bear-Stepper__step",s.STEP_WRAPPER_VERTICAL),children:[G(e,n),R(n)]},n))]})});Z.displayName="Stepper";const k=m.forwardRef(({activeStep:i,totalSteps:d,onPrev:S,onNext:C,onComplete:f,disablePrev:p=!1,disableNext:x=!1,prevLabel:A="Previous",nextLabel:j="Next",completeLabel:u="Complete",showIndicator:v=!0},P)=>{const E=i===0,g=i===d-1;return r.jsxs("div",{ref:P,className:"Bear-StepperControls flex items-center justify-between mt-6",children:[r.jsx(I.Button,{variant:"outline",onClick:S,disabled:E||p,children:A}),v&&r.jsxs("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Step ",i+1," of ",d]}),g?r.jsx(I.Button,{variant:"primary",onClick:f,children:u}):r.jsx(I.Button,{variant:"primary",onClick:C,disabled:x,children:j})]})});k.displayName="StepperControls";exports.Stepper=Z;exports.StepperControls=k;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),d=require("react"),J=require("../../context/BearProvider.cjs"),Q=require("../../utils/maxVisible.utils.cjs"),c=require("../../utils/cn.cjs"),F=require("../Typography/Typography.cjs"),ee=require("../Dropdown/Dropdown.cjs"),re=require("../Icon/index.cjs"),r=require("./Stepper.const.cjs"),m=require("./Stepper.utils.cjs"),ne=1200,te=16,se=640,H=3,oe=()=>n.jsx("svg",{width:r.CHECK_ICON_SIZE,height:r.CHECK_ICON_SIZE,viewBox:r.CHECK_ICON_VIEWBOX,fill:"none",stroke:"currentColor",strokeWidth:"3",children:n.jsx("polyline",{points:r.CHECK_ICON_POINTS})}),ie=()=>n.jsxs("svg",{width:r.ERROR_ICON_SIZE,height:r.ERROR_ICON_SIZE,viewBox:r.ERROR_ICON_VIEWBOX,fill:"none",stroke:"currentColor",strokeWidth:"3",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),U=d.forwardRef(({steps:o,activeStep:_,onStepClick:S,orientation:W=r.DEFAULT_ORIENTATION,size:A=r.DEFAULT_SIZE,showNumbers:D=r.DEFAULT_SHOW_NUMBERS,clickable:g=r.DEFAULT_CLICKABLE,showConnectors:M=r.DEFAULT_SHOW_CONNECTORS,connectorStyle:R=r.DEFAULT_CONNECTOR_STYLE,alternativeLabel:L=r.DEFAULT_ALTERNATIVE_LABEL,completedIcon:V,errorIcon:q,labelTypographyProps:Z,descriptionTypographyProps:z,maxVisibleSteps:C,testId:K,className:k,...X},$)=>{const f=J.useBearThemeOptional(),[O,G]=d.useState(()=>typeof window<"u"?window.innerWidth:ne);d.useEffect(()=>{const e=()=>G(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const h=d.useMemo(()=>{if(C!=null)return Q.resolveMaxVisible(C,{width:O,theme:f});if(O<se&&o.length>H)return H},[C,O,f,o.length]),E=W==="horizontal",p=r.STEP_INDICATOR_SIZES[A],v=r.STEP_LABEL_SIZES[A],T=E&&h!=null&&o.length>h,{visibleIndices:j,leftHidden:x,rightHidden:N}=d.useMemo(()=>{if(!T||h==null)return{visibleIndices:o.map((a,I)=>I),leftHidden:[],rightHidden:[]};const e=h,t=Math.floor(e/2),s=Math.max(0,Math.min(_-t,o.length-e)),i=Array.from({length:e},(a,I)=>s+I),l=[],y=[];for(let a=0;a<s;a++)l.push(a);for(let a=s+e;a<o.length;a++)y.push(a);return{visibleIndices:i,leftHidden:l,rightHidden:y}},[T,h,o,_]),b=(e,t,s)=>{const i=r.STEP_STATUS_CLASSES[s],l=m.resolveIndicatorContent(e,t,s,D,V,q,n.jsx(oe,{}),n.jsx(ie,{}));return n.jsx("div",{className:c.cn(r.STEP_INDICATOR_BASE,p,i.indicator,g&&!e.disabled&&"cursor-pointer hover:scale-105"),onClick:()=>{g&&!e.disabled&&S&&S(t)},children:l})},u=(e,t)=>{if(!M||t)return null;const s=e<_;return E?n.jsx("div",{className:c.cn("Bear-Stepper__connector flex-1 self-center mx-1","h-0.5 min-w-[12px] transition-colors",s?r.CONNECTOR_STATUS.completed:r.CONNECTOR_STATUS.pending,R==="dashed"&&"border-t-2 border-dashed bg-transparent")}):n.jsx("div",{className:c.cn(r.CONNECTOR_BASE,r.CONNECTOR_VERTICAL,s?r.CONNECTOR_STATUS.completed:r.CONNECTOR_STATUS.pending,R==="dashed"&&"border-t-2 border-dashed bg-transparent")})},w=(e,t)=>{const s=r.STEP_STATUS_CLASSES[t],i={...Z,...e.labelTypographyProps},l={...z,...e.descriptionTypographyProps};return n.jsxs(n.Fragment,{children:[n.jsx(F.Typography,{variant:"body2",...i,className:c.cn(r.STEP_LABEL_BASE,v.label,s.label,i==null?void 0:i.className),children:e.label}),e.description&&n.jsx(F.Typography,{variant:"caption",...l,className:c.cn(r.STEP_DESCRIPTION_CLASSES,v.description,l==null?void 0:l.className),children:e.description})]})},B=(e,t)=>{const s=m.resolveStepStatus(e,t,_);return n.jsxs("div",{className:c.cn("Bear-Stepper__content flex shrink-0",L?"flex-col items-center":"items-center gap-2"),children:[b(e,t,s),n.jsx("div",{className:c.cn(L&&"text-center mt-2","whitespace-nowrap"),children:w(e,s)})]})},Y=(e,t)=>{const s=m.resolveStepStatus(e,t,_);return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex-shrink-0 mr-4",children:b(e,t,s)}),n.jsxs("div",{className:"flex-1 pt-0.5",children:[w(e,s),e.content&&s==="active"&&n.jsx("div",{className:"mt-4",children:e.content})]})]})},P=(e,t)=>n.jsx("div",{className:"Bear-Stepper__overflow shrink-0",children:n.jsx(ee.Dropdown,{placement:"bottom-start",closeOnSelect:!0,trigger:n.jsx("button",{type:"button",className:c.cn(r.STEP_INDICATOR_BASE,p,r.STEP_STATUS_CLASSES.pending.indicator,"bear-cursor-pointer bear-border-0"),"aria-label":t==="left"?r.OVERFLOW_LEFT_LABEL:r.OVERFLOW_RIGHT_LABEL,children:n.jsx(re.BearIcons.MoreHorizIcon,{size:te})}),items:e.map(s=>({key:`step-${s}`,label:o[s].label,disabled:o[s].disabled,onClick:()=>{o[s].disabled||S==null||S(s)}}))})},`overflow-${t}`);return n.jsxs("div",{ref:$,className:c.cn(r.STEPPER_BASE_CLASSES,E?r.STEPPER_HORIZONTAL_CLASSES:r.STEPPER_VERTICAL_CLASSES,k),"data-testid":K,...X,children:[E&&!T&&o.map((e,t)=>n.jsxs(d.Fragment,{children:[B(e,t),u(t,t===o.length-1)]},t)),E&&T&&n.jsxs(n.Fragment,{children:[x.length>0&&n.jsxs(n.Fragment,{children:[P(x,"left"),u(-1,!1)]}),j.map((e,t)=>{const s=o[e],i=t===j.length-1&&N.length===0;return n.jsxs(d.Fragment,{children:[B(s,e),u(e,i)]},e)}),N.length>0&&P(N,"right")]}),!E&&o.map((e,t)=>n.jsxs("div",{className:c.cn("Bear-Stepper__step",r.STEP_WRAPPER_VERTICAL),children:[Y(e,t),u(t,t===o.length-1)]},t))]})});U.displayName="Stepper";exports.Stepper=U;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t="Bear-Stepper",e="flex w-full min-w-0 items-start overflow-x-auto pb-1 flex-nowrap",S="flex flex-col",E="relative min-w-[7rem] shrink-0 flex-1",r="relative min-w-[5rem] max-w-[9rem] shrink-0",_="relative flex items-start pb-8 last:pb-0",a="Bear-Stepper__indicator flex items-center justify-center rounded-full font-medium transition-all",T={sm:"w-6 h-6 text-xs",md:"w-8 h-8 text-sm",lg:"w-10 h-10 text-base"},n={pending:{indicator:"bg-gray-200 dark:bg-zinc-700 text-gray-500 dark:text-gray-400",label:"text-gray-500 dark:text-gray-400"},active:{indicator:"bg-pink-500 text-white shadow-lg shadow-pink-500/30",label:"text-gray-900 dark:text-white font-medium"},completed:{indicator:"bg-green-500 text-white",label:"text-gray-700 dark:text-gray-300"},error:{indicator:"bg-red-500 text-white",label:"text-red-500 dark:text-red-400"}},o="Bear-Stepper__connector absolute transition-colors",l="top-4 left-1/2 right-0 h-0.5 -translate-y-1/2",i="left-4 top-8 w-0.5 h-full -translate-x-1/2",s={pending:"bg-gray-200 dark:bg-zinc-700",completed:"bg-green-500"},A="Bear-Stepper__label transition-colors",R={sm:{label:"text-xs",description:"text-[10px]"},md:{label:"text-sm",description:"text-xs"},lg:{label:"text-base",description:"text-sm"}},P="text-gray-500 dark:text-gray-400 mt-0.5";exports.CONNECTOR_BASE=o;exports.CONNECTOR_HORIZONTAL=l;exports.CONNECTOR_STATUS=s;exports.CONNECTOR_VERTICAL=i;exports.STEPPER_BASE_CLASSES=t;exports.STEPPER_HORIZONTAL_CLASSES=e;exports.STEPPER_VERTICAL_CLASSES=S;exports.STEP_DESCRIPTION_CLASSES=P;exports.STEP_INDICATOR_BASE=a;exports.STEP_INDICATOR_SIZES=T;exports.STEP_LABEL_BASE=A;exports.STEP_LABEL_SIZES=R;exports.STEP_STATUS_CLASSES=n;exports.STEP_WRAPPER_HORIZONTAL=E;exports.STEP_WRAPPER_HORIZONTAL_WINDOW=r;exports.STEP_WRAPPER_VERTICAL=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _="horizontal",S="md",T=!0,e=!0,L="solid",A=!1,O=!1,o="Previous",s="Next",C="Complete",n=(E,t)=>`Step ${E} of ${t}`,R=0,r=1,I=1,c="Previous steps",N="More steps",a=16,l="0 0 24 24",i="20 6 9 17 4 12",P=16,F="0 0 24 24",B="Bear-Stepper",d="flex w-full items-center",x="flex flex-col",D="relative flex items-start pb-8 last:pb-0",U="Bear-Stepper__indicator flex items-center justify-center rounded-full font-medium transition-all",g={sm:"w-6 h-6 text-xs",md:"w-8 h-8 text-sm",lg:"w-10 h-10 text-base"},p={pending:{indicator:"bg-gray-200 dark:bg-zinc-700 text-gray-500 dark:text-gray-400",label:"text-gray-500 dark:text-gray-400"},active:{indicator:"bg-pink-500 text-white shadow-lg shadow-pink-500/30",label:"text-gray-900 dark:text-white font-medium"},completed:{indicator:"bg-green-500 text-white",label:"text-gray-700 dark:text-gray-300"},error:{indicator:"bg-red-500 text-white",label:"text-red-500 dark:text-red-400"}},b="Bear-Stepper__connector absolute transition-colors",m="left-4 top-8 w-0.5 h-full -translate-x-1/2",V={pending:"bg-gray-200 dark:bg-zinc-700",completed:"bg-green-500"},f="Bear-Stepper__label transition-colors",u={sm:{label:"text-xs",description:"text-[10px]"},md:{label:"text-sm",description:"text-xs"},lg:{label:"text-base",description:"text-sm"}},y="text-gray-500 dark:text-gray-400 mt-0.5";exports.CHECK_ICON_POINTS=i;exports.CHECK_ICON_SIZE=a;exports.CHECK_ICON_VIEWBOX=l;exports.CONNECTOR_BASE=b;exports.CONNECTOR_STATUS=V;exports.CONNECTOR_VERTICAL=m;exports.DEFAULT_ALTERNATIVE_LABEL=O;exports.DEFAULT_CLICKABLE=A;exports.DEFAULT_COMPLETE_LABEL=C;exports.DEFAULT_CONNECTOR_STYLE=L;exports.DEFAULT_INDICATOR_FORMAT=n;exports.DEFAULT_NEXT_LABEL=s;exports.DEFAULT_ORIENTATION=_;exports.DEFAULT_PREV_LABEL=o;exports.DEFAULT_SHOW_CONNECTORS=e;exports.DEFAULT_SHOW_NUMBERS=T;exports.DEFAULT_SIZE=S;exports.ERROR_ICON_SIZE=P;exports.ERROR_ICON_VIEWBOX=F;exports.FIRST_STEP_INDEX=R;exports.LAST_STEP_OFFSET=I;exports.OVERFLOW_LEFT_LABEL=c;exports.OVERFLOW_RIGHT_LABEL=N;exports.STEPPER_BASE_CLASSES=B;exports.STEPPER_HORIZONTAL_CLASSES=d;exports.STEPPER_VERTICAL_CLASSES=x;exports.STEP_DESCRIPTION_CLASSES=y;exports.STEP_INDICATOR_BASE=U;exports.STEP_INDICATOR_SIZES=g;exports.STEP_LABEL_BASE=f;exports.STEP_LABEL_SIZES=u;exports.STEP_NUMBER_OFFSET=r;exports.STEP_STATUS_CLASSES=p;exports.STEP_WRAPPER_VERTICAL=D;
@@ -1,8 +1,29 @@
1
- import { StepperSize, StepStatus } from './Stepper.types';
1
+ import { StepperSize, StepStatus, StepperOrientation } from './Stepper.types';
2
+ export declare const DEFAULT_ORIENTATION: StepperOrientation;
3
+ export declare const DEFAULT_SIZE: StepperSize;
4
+ export declare const DEFAULT_SHOW_NUMBERS = true;
5
+ export declare const DEFAULT_SHOW_CONNECTORS = true;
6
+ export declare const DEFAULT_CONNECTOR_STYLE: "solid";
7
+ export declare const DEFAULT_CLICKABLE = false;
8
+ export declare const DEFAULT_ALTERNATIVE_LABEL = false;
9
+ export declare const DEFAULT_PREV_LABEL = "Previous";
10
+ export declare const DEFAULT_NEXT_LABEL = "Next";
11
+ export declare const DEFAULT_COMPLETE_LABEL = "Complete";
12
+ export declare const DEFAULT_INDICATOR_FORMAT: (current: number, total: number) => string;
13
+ export declare const FIRST_STEP_INDEX = 0;
14
+ export declare const STEP_NUMBER_OFFSET = 1;
15
+ export declare const LAST_STEP_OFFSET = 1;
16
+ export declare const OVERFLOW_LEFT_LABEL = "Previous steps";
17
+ export declare const OVERFLOW_RIGHT_LABEL = "More steps";
18
+ export declare const CHECK_ICON_SIZE = 16;
19
+ export declare const CHECK_ICON_VIEWBOX = "0 0 24 24";
20
+ export declare const CHECK_ICON_POINTS = "20 6 9 17 4 12";
21
+ export declare const ERROR_ICON_SIZE = 16;
22
+ export declare const ERROR_ICON_VIEWBOX = "0 0 24 24";
2
23
  export declare const STEPPER_BASE_CLASSES = "Bear-Stepper";
3
- export declare const STEPPER_HORIZONTAL_CLASSES = "flex w-full min-w-0 items-start overflow-x-auto pb-1 flex-nowrap";
24
+ export declare const STEPPER_HORIZONTAL_CLASSES = "flex w-full items-center";
4
25
  export declare const STEPPER_VERTICAL_CLASSES = "flex flex-col";
5
- export declare const STEP_WRAPPER_HORIZONTAL = "relative min-w-[7rem] shrink-0 flex-1";
26
+ export declare const STEP_WRAPPER_HORIZONTAL = "relative shrink-0 flex-1 min-w-[80px]";
6
27
  export declare const STEP_WRAPPER_HORIZONTAL_WINDOW = "relative min-w-[5rem] max-w-[9rem] shrink-0";
7
28
  export declare const STEP_WRAPPER_VERTICAL = "relative flex items-start pb-8 last:pb-0";
8
29
  export declare const STEP_INDICATOR_BASE = "Bear-Stepper__indicator flex items-center justify-center rounded-full font-medium transition-all";
@@ -12,7 +33,7 @@ export declare const STEP_STATUS_CLASSES: Record<StepStatus, {
12
33
  label: string;
13
34
  }>;
14
35
  export declare const CONNECTOR_BASE = "Bear-Stepper__connector absolute transition-colors";
15
- export declare const CONNECTOR_HORIZONTAL = "top-4 left-1/2 right-0 h-0.5 -translate-y-1/2";
36
+ export declare const CONNECTOR_HORIZONTAL = "top-4 h-0.5 -translate-y-1/2";
16
37
  export declare const CONNECTOR_VERTICAL = "left-4 top-8 w-0.5 h-full -translate-x-1/2";
17
38
  export declare const CONNECTOR_STYLES: {
18
39
  solid: string;
@@ -1,8 +1,8 @@
1
- const t = "Bear-Stepper", e = "flex w-full min-w-0 items-start overflow-x-auto pb-1 flex-nowrap", r = "flex flex-col", a = "relative min-w-[7rem] shrink-0 flex-1", n = "relative min-w-[5rem] max-w-[9rem] shrink-0", o = "relative flex items-start pb-8 last:pb-0", l = "Bear-Stepper__indicator flex items-center justify-center rounded-full font-medium transition-all", i = {
1
+ const E = "horizontal", o = "md", s = !0, n = !0, _ = "solid", r = !1, S = !1, T = "Previous", c = "Next", a = "Complete", l = (t, e) => `Step ${t} of ${e}`, L = 0, i = 1, A = 1, O = "Previous steps", C = "More steps", x = 16, R = "0 0 24 24", d = "20 6 9 17 4 12", I = 16, N = "0 0 24 24", g = "Bear-Stepper", p = "flex w-full items-center", P = "flex flex-col", b = "relative flex items-start pb-8 last:pb-0", B = "Bear-Stepper__indicator flex items-center justify-center rounded-full font-medium transition-all", F = {
2
2
  sm: "w-6 h-6 text-xs",
3
3
  md: "w-8 h-8 text-sm",
4
4
  lg: "w-10 h-10 text-base"
5
- }, s = {
5
+ }, m = {
6
6
  pending: {
7
7
  indicator: "bg-gray-200 dark:bg-zinc-700 text-gray-500 dark:text-gray-400",
8
8
  label: "text-gray-500 dark:text-gray-400"
@@ -19,29 +19,47 @@ const t = "Bear-Stepper", e = "flex w-full min-w-0 items-start overflow-x-auto p
19
19
  indicator: "bg-red-500 text-white",
20
20
  label: "text-red-500 dark:text-red-400"
21
21
  }
22
- }, S = "Bear-Stepper__connector absolute transition-colors", x = "top-4 left-1/2 right-0 h-0.5 -translate-y-1/2", E = "left-4 top-8 w-0.5 h-full -translate-x-1/2", c = {
22
+ }, D = "Bear-Stepper__connector absolute transition-colors", f = "left-4 top-8 w-0.5 h-full -translate-x-1/2", U = {
23
23
  pending: "bg-gray-200 dark:bg-zinc-700",
24
24
  completed: "bg-green-500"
25
- }, _ = "Bear-Stepper__label transition-colors", d = {
25
+ }, u = "Bear-Stepper__label transition-colors", y = {
26
26
  sm: { label: "text-xs", description: "text-[10px]" },
27
27
  md: { label: "text-sm", description: "text-xs" },
28
28
  lg: { label: "text-base", description: "text-sm" }
29
- }, T = "text-gray-500 dark:text-gray-400 mt-0.5";
29
+ }, h = "text-gray-500 dark:text-gray-400 mt-0.5";
30
30
  export {
31
- S as CONNECTOR_BASE,
32
- x as CONNECTOR_HORIZONTAL,
33
- c as CONNECTOR_STATUS,
34
- E as CONNECTOR_VERTICAL,
35
- t as STEPPER_BASE_CLASSES,
36
- e as STEPPER_HORIZONTAL_CLASSES,
37
- r as STEPPER_VERTICAL_CLASSES,
38
- T as STEP_DESCRIPTION_CLASSES,
39
- l as STEP_INDICATOR_BASE,
40
- i as STEP_INDICATOR_SIZES,
41
- _ as STEP_LABEL_BASE,
42
- d as STEP_LABEL_SIZES,
43
- s as STEP_STATUS_CLASSES,
44
- a as STEP_WRAPPER_HORIZONTAL,
45
- n as STEP_WRAPPER_HORIZONTAL_WINDOW,
46
- o as STEP_WRAPPER_VERTICAL
31
+ d as CHECK_ICON_POINTS,
32
+ x as CHECK_ICON_SIZE,
33
+ R as CHECK_ICON_VIEWBOX,
34
+ D as CONNECTOR_BASE,
35
+ U as CONNECTOR_STATUS,
36
+ f as CONNECTOR_VERTICAL,
37
+ S as DEFAULT_ALTERNATIVE_LABEL,
38
+ r as DEFAULT_CLICKABLE,
39
+ a as DEFAULT_COMPLETE_LABEL,
40
+ _ as DEFAULT_CONNECTOR_STYLE,
41
+ l as DEFAULT_INDICATOR_FORMAT,
42
+ c as DEFAULT_NEXT_LABEL,
43
+ E as DEFAULT_ORIENTATION,
44
+ T as DEFAULT_PREV_LABEL,
45
+ n as DEFAULT_SHOW_CONNECTORS,
46
+ s as DEFAULT_SHOW_NUMBERS,
47
+ o as DEFAULT_SIZE,
48
+ I as ERROR_ICON_SIZE,
49
+ N as ERROR_ICON_VIEWBOX,
50
+ L as FIRST_STEP_INDEX,
51
+ A as LAST_STEP_OFFSET,
52
+ O as OVERFLOW_LEFT_LABEL,
53
+ C as OVERFLOW_RIGHT_LABEL,
54
+ g as STEPPER_BASE_CLASSES,
55
+ p as STEPPER_HORIZONTAL_CLASSES,
56
+ P as STEPPER_VERTICAL_CLASSES,
57
+ h as STEP_DESCRIPTION_CLASSES,
58
+ B as STEP_INDICATOR_BASE,
59
+ F as STEP_INDICATOR_SIZES,
60
+ u as STEP_LABEL_BASE,
61
+ y as STEP_LABEL_SIZES,
62
+ i as STEP_NUMBER_OFFSET,
63
+ m as STEP_STATUS_CLASSES,
64
+ b as STEP_WRAPPER_VERTICAL
47
65
  };
@@ -1,3 +1,3 @@
1
- import { StepperProps, StepperControlsProps } from './Stepper.types';
2
- export declare const Stepper: import('react').ForwardRefExoticComponent<StepperProps & import('react').RefAttributes<HTMLDivElement>>;
3
- export declare const StepperControls: import('react').ForwardRefExoticComponent<StepperControlsProps & import('react').RefAttributes<HTMLDivElement>>;
1
+ import { default as React } from 'react';
2
+ import { StepperProps } from './Stepper.types';
3
+ export declare const Stepper: React.ForwardRefExoticComponent<StepperProps & React.RefAttributes<HTMLDivElement>>;