@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,198 +1,210 @@
1
- import { jsxs as l, Fragment as V, jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as J, useState as re, useEffect as te, useMemo as j } from "react";
3
- import { useBearThemeOptional as ne } from "../../context/BearProvider.js";
4
- import { resolveMaxVisible as oe } from "../../utils/maxVisible.utils.js";
5
- import { cn as i } from "../../utils/cn.js";
6
- import { STEP_WRAPPER_HORIZONTAL as F, STEP_WRAPPER_HORIZONTAL_WINDOW as ie, STEP_WRAPPER_VERTICAL as le, STEPPER_HORIZONTAL_CLASSES as se, STEPPER_VERTICAL_CLASSES as ae, STEPPER_BASE_CLASSES as ce, STEP_STATUS_CLASSES as v, STEP_LABEL_SIZES as de, STEP_LABEL_BASE as U, STEP_DESCRIPTION_CLASSES as $, CONNECTOR_STATUS as q, CONNECTOR_HORIZONTAL as me, CONNECTOR_VERTICAL as he, CONNECTOR_BASE as fe, STEP_INDICATOR_SIZES as ue, STEP_INDICATOR_BASE as G } from "./Stepper.const.js";
7
- import { Button as O } from "../Button/Button.js";
8
- import { Dropdown as pe } from "../Dropdown/Dropdown.js";
9
- import { BearIcons as Ee } from "../Icon/index.js";
10
- const Se = () => /* @__PURE__ */ t("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", children: /* @__PURE__ */ t("polyline", { points: "20 6 9 17 4 12" }) }), _e = () => /* @__PURE__ */ l("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", children: [
1
+ import { jsxs as i, Fragment as f, jsx as t } from "react/jsx-runtime";
2
+ import D, { forwardRef as oe, useState as ie, useEffect as le, useMemo as U } from "react";
3
+ import { useBearThemeOptional as se } from "../../context/BearProvider.js";
4
+ import { resolveMaxVisible as ae } from "../../utils/maxVisible.utils.js";
5
+ import { cn as s } from "../../utils/cn.js";
6
+ import { Typography as V } from "../Typography/Typography.js";
7
+ import { Dropdown as ce } from "../Dropdown/Dropdown.js";
8
+ import { BearIcons as de } from "../Icon/index.js";
9
+ import { STEP_WRAPPER_VERTICAL as Ee, STEPPER_HORIZONTAL_CLASSES as he, STEPPER_VERTICAL_CLASSES as _e, STEPPER_BASE_CLASSES as me, DEFAULT_ORIENTATION as Te, DEFAULT_SIZE as fe, DEFAULT_SHOW_NUMBERS as Se, DEFAULT_CLICKABLE as Ie, DEFAULT_SHOW_CONNECTORS as Oe, DEFAULT_CONNECTOR_STYLE as Ce, DEFAULT_ALTERNATIVE_LABEL as Ne, CONNECTOR_STATUS as S, CONNECTOR_VERTICAL as ue, CONNECTOR_BASE as Ae, OVERFLOW_LEFT_LABEL as Le, OVERFLOW_RIGHT_LABEL as ge, STEP_STATUS_CLASSES as u, STEP_INDICATOR_SIZES as Re, STEP_INDICATOR_BASE as M, STEP_LABEL_SIZES as pe, STEP_LABEL_BASE as ve, STEP_DESCRIPTION_CLASSES as we, ERROR_ICON_VIEWBOX as be, ERROR_ICON_SIZE as z, CHECK_ICON_VIEWBOX as Be, CHECK_ICON_SIZE as Z, CHECK_ICON_POINTS as Pe } from "./Stepper.const.js";
10
+ import { resolveStepStatus as K, resolveIndicatorContent as ye } from "./Stepper.utils.js";
11
+ const He = 1200, We = 16, Fe = 640, k = 3, De = () => /* @__PURE__ */ t("svg", { width: Z, height: Z, viewBox: Be, fill: "none", stroke: "currentColor", strokeWidth: "3", children: /* @__PURE__ */ t("polyline", { points: Pe }) }), Ue = () => /* @__PURE__ */ i("svg", { width: z, height: z, viewBox: be, fill: "none", stroke: "currentColor", strokeWidth: "3", children: [
11
12
  /* @__PURE__ */ t("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
12
13
  /* @__PURE__ */ t("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
13
- ] }), Ne = J(
14
+ ] }), Ve = oe(
14
15
  ({
15
16
  steps: o,
16
- activeStep: d,
17
- onStepClick: m,
18
- orientation: C = "horizontal",
19
- size: S = "md",
20
- showNumbers: g = !0,
21
- clickable: _ = !1,
22
- showConnectors: T = !0,
23
- connectorStyle: b = "solid",
24
- alternativeLabel: h = !1,
25
- completedIcon: w,
26
- errorIcon: A,
27
- maxVisibleSteps: u,
28
- testId: I,
29
- className: K,
30
- ...Q
31
- }, X) => {
32
- const B = ne(), [y, Y] = re(() => typeof window < "u" ? window.innerWidth : 1200);
33
- te(() => {
34
- const e = () => Y(window.innerWidth);
17
+ activeStep: E,
18
+ onStepClick: h,
19
+ orientation: X = Te,
20
+ size: A = fe,
21
+ showNumbers: j = Se,
22
+ clickable: L = Ie,
23
+ showConnectors: x = Oe,
24
+ connectorStyle: g = Ce,
25
+ alternativeLabel: R = Ne,
26
+ completedIcon: $,
27
+ errorIcon: G,
28
+ labelTypographyProps: Y,
29
+ descriptionTypographyProps: q,
30
+ maxVisibleSteps: I,
31
+ testId: J,
32
+ className: Q,
33
+ ...ee
34
+ }, re) => {
35
+ const p = se(), [O, ne] = ie(() => typeof window < "u" ? window.innerWidth : He);
36
+ le(() => {
37
+ const e = () => ne(window.innerWidth);
35
38
  return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
36
39
  }, []);
37
- const p = j(
38
- () => u == null ? void 0 : oe(u, { width: y, theme: B }),
39
- [u, y, B]
40
- ), L = (e, r) => r.status ? r.status : e < d ? "completed" : e === d ? "active" : "pending", f = C === "horizontal", H = ue[S], N = de[S], E = f && p != null && o.length > p, { visibleIndices: W, leftHidden: x, rightHidden: z } = j(() => {
41
- if (!E || p == null)
40
+ const _ = U(() => {
41
+ if (I != null)
42
+ return ae(I, { width: O, theme: p });
43
+ if (O < Fe && o.length > k)
44
+ return k;
45
+ }, [I, O, p, o.length]), d = X === "horizontal", v = Re[A], w = pe[A], m = d && _ != null && o.length > _, { visibleIndices: b, leftHidden: B, rightHidden: C } = U(() => {
46
+ if (!m || _ == null)
42
47
  return {
43
- visibleIndices: o.map((c, R) => R),
48
+ visibleIndices: o.map((c, N) => N),
44
49
  leftHidden: [],
45
50
  rightHidden: []
46
51
  };
47
- const e = p, r = Math.max(0, Math.min(d - Math.floor(e / 2), o.length - e)), n = Array.from({ length: e }, (c, R) => r + R), s = [], a = [];
48
- for (let c = 0; c < r; c++) s.push(c);
49
- for (let c = r + e; c < o.length; c++) a.push(c);
50
- return { visibleIndices: n, leftHidden: s, rightHidden: a };
51
- }, [E, p, o.length, d]), M = E ? ie : F, k = (e, r, n) => {
52
- const s = v[n];
53
- let a = null;
54
- return e.icon ? a = e.icon : n === "completed" ? a = w || /* @__PURE__ */ t(Se, {}) : n === "error" ? a = A || /* @__PURE__ */ t(_e, {}) : g && (a = r + 1), /* @__PURE__ */ t(
52
+ const e = _, r = Math.floor(e / 2), n = Math.max(0, Math.min(E - r, o.length - e)), l = Array.from({ length: e }, (c, N) => n + N), a = [], F = [];
53
+ for (let c = 0; c < n; c++) a.push(c);
54
+ for (let c = n + e; c < o.length; c++) F.push(c);
55
+ return { visibleIndices: l, leftHidden: a, rightHidden: F };
56
+ }, [m, _, o, E]), P = (e, r, n) => {
57
+ const l = u[n], a = ye(
58
+ e,
59
+ r,
60
+ n,
61
+ j,
62
+ $,
63
+ G,
64
+ /* @__PURE__ */ t(De, {}),
65
+ /* @__PURE__ */ t(Ue, {})
66
+ );
67
+ return /* @__PURE__ */ t(
55
68
  "div",
56
69
  {
57
- className: i(
58
- G,
59
- H,
60
- s.indicator,
61
- _ && !e.disabled && "cursor-pointer hover:scale-105"
70
+ className: s(
71
+ M,
72
+ v,
73
+ l.indicator,
74
+ L && !e.disabled && "cursor-pointer hover:scale-105"
62
75
  ),
63
76
  onClick: () => {
64
- _ && !e.disabled && m && m(r);
77
+ L && !e.disabled && h && h(r);
65
78
  },
66
79
  children: a
67
80
  }
68
81
  );
69
- }, P = (e) => {
70
- if (!T || e === o.length - 1) return null;
71
- const r = e < d;
72
- return /* @__PURE__ */ t(
82
+ }, T = (e, r) => {
83
+ if (!x || r) return null;
84
+ const n = e < E;
85
+ return d ? /* @__PURE__ */ t(
73
86
  "div",
74
87
  {
75
- className: i(
76
- fe,
77
- f ? me : he,
78
- r ? q.completed : q.pending,
79
- b === "dashed" && "border-t-2 border-dashed bg-transparent"
88
+ className: s(
89
+ "Bear-Stepper__connector flex-1 self-center mx-1",
90
+ "h-0.5 min-w-[12px] transition-colors",
91
+ n ? S.completed : S.pending,
92
+ g === "dashed" && "border-t-2 border-dashed bg-transparent"
93
+ )
94
+ }
95
+ ) : /* @__PURE__ */ t(
96
+ "div",
97
+ {
98
+ className: s(
99
+ Ae,
100
+ ue,
101
+ n ? S.completed : S.pending,
102
+ g === "dashed" && "border-t-2 border-dashed bg-transparent"
80
103
  )
81
104
  }
82
105
  );
83
- }, Z = (e, r) => {
84
- const n = L(r, e), s = v[n];
85
- return /* @__PURE__ */ l("div", { className: i("flex", h ? "flex-col items-center" : "items-center gap-3"), children: [
86
- k(e, r, n),
87
- /* @__PURE__ */ l("div", { className: i(h && "text-center mt-2"), children: [
88
- /* @__PURE__ */ t("div", { className: i(U, N.label, s.label), children: e.label }),
89
- e.description && /* @__PURE__ */ t("div", { className: i($, N.description), children: e.description })
90
- ] })
106
+ }, y = (e, r) => {
107
+ const n = u[r], l = { ...Y, ...e.labelTypographyProps }, a = { ...q, ...e.descriptionTypographyProps };
108
+ return /* @__PURE__ */ i(f, { children: [
109
+ /* @__PURE__ */ t(
110
+ V,
111
+ {
112
+ variant: "body2",
113
+ ...l,
114
+ className: s(ve, w.label, n.label, l == null ? void 0 : l.className),
115
+ children: e.label
116
+ }
117
+ ),
118
+ e.description && /* @__PURE__ */ t(
119
+ V,
120
+ {
121
+ variant: "caption",
122
+ ...a,
123
+ className: s(we, w.description, a == null ? void 0 : a.className),
124
+ children: e.description
125
+ }
126
+ )
127
+ ] });
128
+ }, H = (e, r) => {
129
+ const n = K(e, r, E);
130
+ return /* @__PURE__ */ i("div", { className: s("Bear-Stepper__content flex shrink-0", R ? "flex-col items-center" : "items-center gap-2"), children: [
131
+ P(e, r, n),
132
+ /* @__PURE__ */ t("div", { className: s(R && "text-center mt-2", "whitespace-nowrap"), children: y(e, n) })
91
133
  ] });
92
- }, ee = (e, r) => {
93
- const n = L(r, e), s = v[n];
94
- return /* @__PURE__ */ l(V, { children: [
95
- /* @__PURE__ */ t("div", { className: "flex-shrink-0 mr-4", children: k(e, r, n) }),
96
- /* @__PURE__ */ l("div", { className: "flex-1 pt-0.5", children: [
97
- /* @__PURE__ */ t("div", { className: i(U, N.label, s.label), children: e.label }),
98
- e.description && /* @__PURE__ */ t("div", { className: i($, N.description), children: e.description }),
134
+ }, te = (e, r) => {
135
+ const n = K(e, r, E);
136
+ return /* @__PURE__ */ i(f, { children: [
137
+ /* @__PURE__ */ t("div", { className: "flex-shrink-0 mr-4", children: P(e, r, n) }),
138
+ /* @__PURE__ */ i("div", { className: "flex-1 pt-0.5", children: [
139
+ y(e, n),
99
140
  e.content && n === "active" && /* @__PURE__ */ t("div", { className: "mt-4", children: e.content })
100
141
  ] })
101
142
  ] });
102
- }, D = (e, r) => /* @__PURE__ */ t("div", { className: i("Bear-Stepper__step", "Bear-Stepper__overflow", M), children: /* @__PURE__ */ l("div", { className: i("flex", h ? "flex-col items-center" : "items-center gap-3"), children: [
103
- /* @__PURE__ */ t(
104
- pe,
105
- {
106
- placement: "bottom-start",
107
- closeOnSelect: !0,
108
- trigger: /* @__PURE__ */ t(
109
- "button",
110
- {
111
- type: "button",
112
- className: i(
113
- G,
114
- H,
115
- v.pending.indicator,
116
- "bear-cursor-pointer bear-border-0"
117
- ),
118
- "aria-label": r === "left" ? "Previous steps" : "More steps",
119
- children: /* @__PURE__ */ t(Ee.MoreHorizIcon, { size: 16 })
120
- }
121
- ),
122
- items: e.map((n) => ({
123
- key: `step-${n}`,
124
- label: o[n].label,
125
- disabled: o[n].disabled,
126
- onClick: () => {
127
- o[n].disabled || m == null || m(n);
128
- }
129
- }))
130
- }
131
- ),
132
- h && /* @__PURE__ */ t("div", { className: "text-center mt-2 bear-text-xs bear-text-gray-400", children: " " })
133
- ] }) }, `overflow-${r}`);
134
- return /* @__PURE__ */ l(
143
+ }, W = (e, r) => /* @__PURE__ */ t("div", { className: "Bear-Stepper__overflow shrink-0", children: /* @__PURE__ */ t(
144
+ ce,
145
+ {
146
+ placement: "bottom-start",
147
+ closeOnSelect: !0,
148
+ trigger: /* @__PURE__ */ t(
149
+ "button",
150
+ {
151
+ type: "button",
152
+ className: s(
153
+ M,
154
+ v,
155
+ u.pending.indicator,
156
+ "bear-cursor-pointer bear-border-0"
157
+ ),
158
+ "aria-label": r === "left" ? Le : ge,
159
+ children: /* @__PURE__ */ t(de.MoreHorizIcon, { size: We })
160
+ }
161
+ ),
162
+ items: e.map((n) => ({
163
+ key: `step-${n}`,
164
+ label: o[n].label,
165
+ disabled: o[n].disabled,
166
+ onClick: () => {
167
+ o[n].disabled || h == null || h(n);
168
+ }
169
+ }))
170
+ }
171
+ ) }, `overflow-${r}`);
172
+ return /* @__PURE__ */ i(
135
173
  "div",
136
174
  {
137
- ref: X,
138
- className: i(ce, f ? se : ae, K),
139
- "data-testid": I,
140
- ...Q,
175
+ ref: re,
176
+ className: s(me, d ? he : _e, Q),
177
+ "data-testid": J,
178
+ ...ee,
141
179
  children: [
142
- f && !E && o.map((e, r) => /* @__PURE__ */ l("div", { className: i("Bear-Stepper__step", F), children: [
143
- Z(e, r),
144
- P(r)
180
+ d && !m && o.map((e, r) => /* @__PURE__ */ i(D.Fragment, { children: [
181
+ H(e, r),
182
+ T(r, r === o.length - 1)
145
183
  ] }, r)),
146
- f && E && /* @__PURE__ */ l(V, { children: [
147
- x.length > 0 && D(x, "left"),
148
- W.map((e, r) => {
149
- const n = o[e], s = W[r + 1], a = s != null && s === e + 1;
150
- return /* @__PURE__ */ l("div", { className: i("Bear-Stepper__step", M), children: [
151
- Z(n, e),
152
- a && P(e)
184
+ d && m && /* @__PURE__ */ i(f, { children: [
185
+ B.length > 0 && /* @__PURE__ */ i(f, { children: [
186
+ W(B, "left"),
187
+ T(-1, !1)
188
+ ] }),
189
+ b.map((e, r) => {
190
+ const n = o[e], l = r === b.length - 1 && C.length === 0;
191
+ return /* @__PURE__ */ i(D.Fragment, { children: [
192
+ H(n, e),
193
+ T(e, l)
153
194
  ] }, e);
154
195
  }),
155
- z.length > 0 && D(z, "right")
196
+ C.length > 0 && W(C, "right")
156
197
  ] }),
157
- !f && o.map((e, r) => /* @__PURE__ */ l("div", { className: i("Bear-Stepper__step", le), children: [
158
- ee(e, r),
159
- P(r)
198
+ !d && o.map((e, r) => /* @__PURE__ */ i("div", { className: s("Bear-Stepper__step", Ee), children: [
199
+ te(e, r),
200
+ T(r, r === o.length - 1)
160
201
  ] }, r))
161
202
  ]
162
203
  }
163
204
  );
164
205
  }
165
206
  );
166
- Ne.displayName = "Stepper";
167
- const ve = J(
168
- ({
169
- activeStep: o,
170
- totalSteps: d,
171
- onPrev: m,
172
- onNext: C,
173
- onComplete: S,
174
- disablePrev: g = !1,
175
- disableNext: _ = !1,
176
- prevLabel: T = "Previous",
177
- nextLabel: b = "Next",
178
- completeLabel: h = "Complete",
179
- showIndicator: w = !0
180
- }, A) => {
181
- const u = o === 0, I = o === d - 1;
182
- return /* @__PURE__ */ l("div", { ref: A, className: "Bear-StepperControls flex items-center justify-between mt-6", children: [
183
- /* @__PURE__ */ t(O, { variant: "outline", onClick: m, disabled: u || g, children: T }),
184
- w && /* @__PURE__ */ l("span", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
185
- "Step ",
186
- o + 1,
187
- " of ",
188
- d
189
- ] }),
190
- I ? /* @__PURE__ */ t(O, { variant: "primary", onClick: S, children: h }) : /* @__PURE__ */ t(O, { variant: "primary", onClick: C, disabled: _, children: b })
191
- ] });
192
- }
193
- );
194
- ve.displayName = "StepperControls";
207
+ Ve.displayName = "Stepper";
195
208
  export {
196
- Ne as Stepper,
197
- ve as StepperControls
209
+ Ve as Stepper
198
210
  };
@@ -1,4 +1,5 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
+ import { TypographyProps } from '../Typography/Typography.types';
2
3
  import { MaxVisibleInput } from '../../utils/maxVisible.utils';
3
4
  export type StepperOrientation = 'horizontal' | 'vertical';
4
5
  export type StepStatus = 'pending' | 'active' | 'completed' | 'error';
@@ -16,6 +17,10 @@ export interface Step {
16
17
  disabled?: boolean;
17
18
  /** Optional content for this step */
18
19
  content?: ReactNode;
20
+ /** Per-step Typography props for the label */
21
+ labelTypographyProps?: Partial<TypographyProps>;
22
+ /** Per-step Typography props for the description */
23
+ descriptionTypographyProps?: Partial<TypographyProps>;
19
24
  }
20
25
  export interface StepperProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
21
26
  /** Array of steps */
@@ -42,9 +47,13 @@ export interface StepperProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onCh
42
47
  completedIcon?: ReactNode;
43
48
  /** Custom error icon */
44
49
  errorIcon?: ReactNode;
50
+ /** Typography props applied to all step labels (overridden by per-step labelTypographyProps) */
51
+ labelTypographyProps?: Partial<TypographyProps>;
52
+ /** Typography props applied to all step descriptions (overridden by per-step descriptionTypographyProps) */
53
+ descriptionTypographyProps?: Partial<TypographyProps>;
45
54
  /** Test ID */
46
55
  testId?: string;
47
- /** When set on horizontal layout, show at most this many steps with menus for the rest (breakpoint map supported). */
56
+ /** When set on horizontal layout, show at most this many steps with dropdown menus for the rest (breakpoint map supported). */
48
57
  maxVisibleSteps?: MaxVisibleInput;
49
58
  }
50
59
  export interface StepperControlsProps {
@@ -70,4 +79,6 @@ export interface StepperControlsProps {
70
79
  completeLabel?: string;
71
80
  /** Show step indicator */
72
81
  showIndicator?: boolean;
82
+ /** Step indicator format function (receives activeStep + 1 and totalSteps) */
83
+ indicatorFormat?: (current: number, total: number) => string;
73
84
  }
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./Stepper.const.cjs");function l(e,t,r){return e.status?e.status:t<r?"completed":t===r?"active":"pending"}function a(e,t,r,n,o,u,c,i){if(e.icon)return e.icon;switch(r){case"completed":return o??c;case"error":return u??i;default:return n?t+s.STEP_NUMBER_OFFSET:null}}exports.resolveIndicatorContent=a;exports.resolveStepStatus=l;
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ import { Step, StepStatus } from './Stepper.types';
3
+ /**
4
+ * Derives the visual status for a step based on its explicit status or its
5
+ * position relative to the active step.
6
+ */
7
+ export declare function resolveStepStatus(step: Step, index: number, activeStep: number): StepStatus;
8
+ /**
9
+ * Determines the indicator content for a step circle based on status, custom
10
+ * icons, and the showNumbers flag.
11
+ */
12
+ export declare function resolveIndicatorContent(step: Step, index: number, status: StepStatus, showNumbers: boolean, completedIcon: ReactNode | undefined, errorIcon: ReactNode | undefined, defaultCompletedIcon: ReactNode, defaultErrorIcon: ReactNode): ReactNode;
@@ -0,0 +1,19 @@
1
+ import { STEP_NUMBER_OFFSET as f } from "./Stepper.const.js";
2
+ function a(r, t, e) {
3
+ return r.status ? r.status : t < e ? "completed" : t === e ? "active" : "pending";
4
+ }
5
+ function l(r, t, e, n, u, o, i, c) {
6
+ if (r.icon) return r.icon;
7
+ switch (e) {
8
+ case "completed":
9
+ return u ?? i;
10
+ case "error":
11
+ return o ?? c;
12
+ default:
13
+ return n ? t + f : null;
14
+ }
15
+ }
16
+ export {
17
+ l as resolveIndicatorContent,
18
+ a as resolveStepStatus
19
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),A=require("react"),n=require("../../Button/Button.cjs"),F=require("../../Typography/Typography.cjs"),e=require("../Stepper.const.cjs"),o=A.forwardRef(({activeStep:t,totalSteps:s,onPrev:i,onNext:a,onComplete:l,disablePrev:c=!1,disableNext:T=!1,prevLabel:p=e.DEFAULT_PREV_LABEL,nextLabel:u=e.DEFAULT_NEXT_LABEL,completeLabel:E=e.DEFAULT_COMPLETE_LABEL,showIndicator:d=!0,indicatorFormat:_=e.DEFAULT_INDICATOR_FORMAT},L)=>{const S=t===e.FIRST_STEP_INDEX,y=t===s-e.LAST_STEP_OFFSET;return r.jsxs("div",{ref:L,className:"Bear-StepperControls flex items-center justify-between mt-6",children:[r.jsx(n.Button,{variant:"outline",onClick:i,disabled:S||c,children:p}),d&&r.jsx(F.Typography,{variant:"body2",className:"text-gray-500 dark:text-gray-400",children:_(t+e.LAST_STEP_OFFSET,s)}),y?r.jsx(n.Button,{variant:"primary",onClick:l,children:E}):r.jsx(n.Button,{variant:"primary",onClick:a,disabled:T,children:u})]})});o.displayName="StepperControls";exports.StepperControls=o;
@@ -0,0 +1,2 @@
1
+ import { StepperControlsProps } from '../Stepper.types';
2
+ export declare const StepperControls: import('react').ForwardRefExoticComponent<StepperControlsProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,32 @@
1
+ import { jsxs as A, jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as y } from "react";
3
+ import { Button as t } from "../../Button/Button.js";
4
+ import { Typography as F } from "../../Typography/Typography.js";
5
+ import { DEFAULT_PREV_LABEL as C, DEFAULT_INDICATOR_FORMAT as S, LAST_STEP_OFFSET as o, DEFAULT_COMPLETE_LABEL as h, DEFAULT_NEXT_LABEL as x, FIRST_STEP_INDEX as D } from "../Stepper.const.js";
6
+ const N = y(
7
+ ({
8
+ activeStep: e,
9
+ totalSteps: i,
10
+ onPrev: a,
11
+ onNext: n,
12
+ onComplete: s,
13
+ disablePrev: l = !1,
14
+ disableNext: m = !1,
15
+ prevLabel: p = C,
16
+ nextLabel: E = x,
17
+ completeLabel: d = h,
18
+ showIndicator: T = !0,
19
+ indicatorFormat: L = S
20
+ }, c) => {
21
+ const _ = e === D, f = e === i - o;
22
+ return /* @__PURE__ */ A("div", { ref: c, className: "Bear-StepperControls flex items-center justify-between mt-6", children: [
23
+ /* @__PURE__ */ r(t, { variant: "outline", onClick: a, disabled: _ || l, children: p }),
24
+ T && /* @__PURE__ */ r(F, { variant: "body2", className: "text-gray-500 dark:text-gray-400", children: L(e + o, i) }),
25
+ f ? /* @__PURE__ */ r(t, { variant: "primary", onClick: s, children: d }) : /* @__PURE__ */ r(t, { variant: "primary", onClick: n, disabled: m, children: E })
26
+ ] });
27
+ }
28
+ );
29
+ N.displayName = "StepperControls";
30
+ export {
31
+ N as StepperControls
32
+ };
@@ -1,2 +1,3 @@
1
- export { Stepper, StepperControls } from './Stepper';
1
+ export { Stepper } from './Stepper';
2
+ export { StepperControls } from './components/StepperControls';
2
3
  export type { StepperProps, StepperControlsProps, Step, StepStatus, StepperOrientation, StepperSize } from './Stepper.types';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),M=require("react"),x=require("../../utils/cn.cjs"),o=require("./TagCloud.const.cjs"),O=({tags:n,minFontSize:u=o.DEFAULT_MIN_FONT,maxFontSize:p=o.DEFAULT_MAX_FONT,colors:h=o.DEFAULT_COLORS,layout:j="flow",mobileCompact:C=!1,onTagClick:s,testId:v,className:y,..._})=>{const{minVal:a,maxVal:f}=M.useMemo(()=>{let e=1/0,t=-1/0;for(const r of n)r.value<e&&(e=r.value),r.value>t&&(t=r.value);return{minVal:e,maxVal:t}},[n]),L=e=>f===a?(u+p)/2:u+(e-a)/(f-a)*(p-u),b=e=>.5+(e-a)/(f-a||1)*.5,I=j==="circle",T=(e,t,r)=>{const l=L(e.value),c=e.color??h[t%h.length],d=b(e.value),m=e.href?"a":"span";return i.jsx(m,{className:x.cn("Bear-TagCloud__tag inline-block transition-all duration-200 hover:scale-110 hover:opacity-100",(s||e.href)&&"cursor-pointer"),style:{fontSize:l,color:c,opacity:d,lineHeight:1.2,...r},onClick:()=>s==null?void 0:s(e),...e.href?{href:e.href,target:"_blank",rel:"noopener noreferrer"}:{},children:e.text},`${e.text}-${t}`)};if(I){const e=o.FULL_CIRCLE_DEG/n.length;return i.jsx("div",{className:x.cn("Bear-TagCloud Bear-TagCloud--circle relative",y),style:{width:"100%",paddingBottom:"100%"},"data-testid":v,..._,children:i.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:n.map((t,r)=>{const l=(e*r-90)*(Math.PI/180),c=o.CIRCLE_RADIUS_RATIO,d=50+c*Math.cos(l),m=50+c*Math.sin(l);return T(t,r,{position:"absolute",left:`${d}%`,top:`${m}%`,transform:"translate(-50%, -50%)"})})})})}return i.jsx("div",{className:x.cn("Bear-TagCloud flex flex-wrap items-center justify-center gap-2 p-4",C&&"max-sm:flex-nowrap max-sm:overflow-x-auto max-sm:justify-start max-sm:gap-3 max-sm:pb-2",y),"data-testid":v,..._,children:n.map((e,t)=>T(e,t))})};exports.TagCloud=O;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=12,L=40,T=["#ec4899","#8b5cf6","#3b82f6","#10b981","#f59e0b","#ef4444"],A=38,E=360;exports.CIRCLE_RADIUS_RATIO=A;exports.DEFAULT_COLORS=T;exports.DEFAULT_MAX_FONT=L;exports.DEFAULT_MIN_FONT=_;exports.FULL_CIRCLE_DEG=E;
@@ -0,0 +1,5 @@
1
+ export declare const DEFAULT_MIN_FONT = 12;
2
+ export declare const DEFAULT_MAX_FONT = 40;
3
+ export declare const DEFAULT_COLORS: string[];
4
+ export declare const CIRCLE_RADIUS_RATIO = 38;
5
+ export declare const FULL_CIRCLE_DEG = 360;
@@ -0,0 +1,8 @@
1
+ const _ = 12, L = 40, c = ["#ec4899", "#8b5cf6", "#3b82f6", "#10b981", "#f59e0b", "#ef4444"], o = 38, t = 360;
2
+ export {
3
+ o as CIRCLE_RADIUS_RATIO,
4
+ c as DEFAULT_COLORS,
5
+ L as DEFAULT_MAX_FONT,
6
+ _ as DEFAULT_MIN_FONT,
7
+ t as FULL_CIRCLE_DEG
8
+ };
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { TagCloudProps } from './TagCloud.types';
3
+ export declare const TagCloud: FC<TagCloudProps>;
@@ -0,0 +1,76 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { useMemo as E } from "react";
3
+ import { cn as p } from "../../utils/cn.js";
4
+ import { FULL_CIRCLE_DEG as M, DEFAULT_MIN_FONT as N, DEFAULT_MAX_FONT as O, DEFAULT_COLORS as b, CIRCLE_RADIUS_RATIO as w } from "./TagCloud.const.js";
5
+ const j = ({
6
+ tags: n,
7
+ minFontSize: c = N,
8
+ maxFontSize: d = O,
9
+ colors: h = b,
10
+ layout: L = "flow",
11
+ mobileCompact: T = !1,
12
+ onTagClick: a,
13
+ testId: x,
14
+ className: v,
15
+ ..._
16
+ }) => {
17
+ const { minVal: o, maxVal: f } = E(() => {
18
+ let e = 1 / 0, t = -1 / 0;
19
+ for (const r of n)
20
+ r.value < e && (e = r.value), r.value > t && (t = r.value);
21
+ return { minVal: e, maxVal: t };
22
+ }, [n]), C = (e) => f === o ? (c + d) / 2 : c + (e - o) / (f - o) * (d - c), I = (e) => 0.5 + (e - o) / (f - o || 1) * 0.5, A = L === "circle", y = (e, t, r) => {
23
+ const l = C(e.value), s = e.color ?? h[t % h.length], m = I(e.value), u = e.href ? "a" : "span";
24
+ return /* @__PURE__ */ i(
25
+ u,
26
+ {
27
+ className: p(
28
+ "Bear-TagCloud__tag inline-block transition-all duration-200 hover:scale-110 hover:opacity-100",
29
+ (a || e.href) && "cursor-pointer"
30
+ ),
31
+ style: { fontSize: l, color: s, opacity: m, lineHeight: 1.2, ...r },
32
+ onClick: () => a == null ? void 0 : a(e),
33
+ ...e.href ? { href: e.href, target: "_blank", rel: "noopener noreferrer" } : {},
34
+ children: e.text
35
+ },
36
+ `${e.text}-${t}`
37
+ );
38
+ };
39
+ if (A) {
40
+ const e = M / n.length;
41
+ return /* @__PURE__ */ i(
42
+ "div",
43
+ {
44
+ className: p("Bear-TagCloud Bear-TagCloud--circle relative", v),
45
+ style: { width: "100%", paddingBottom: "100%" },
46
+ "data-testid": x,
47
+ ..._,
48
+ children: /* @__PURE__ */ i("div", { className: "absolute inset-0 flex items-center justify-center", children: n.map((t, r) => {
49
+ const l = (e * r - 90) * (Math.PI / 180), s = w, m = 50 + s * Math.cos(l), u = 50 + s * Math.sin(l);
50
+ return y(t, r, {
51
+ position: "absolute",
52
+ left: `${m}%`,
53
+ top: `${u}%`,
54
+ transform: "translate(-50%, -50%)"
55
+ });
56
+ }) })
57
+ }
58
+ );
59
+ }
60
+ return /* @__PURE__ */ i(
61
+ "div",
62
+ {
63
+ className: p(
64
+ "Bear-TagCloud flex flex-wrap items-center justify-center gap-2 p-4",
65
+ T && "max-sm:flex-nowrap max-sm:overflow-x-auto max-sm:justify-start max-sm:gap-3 max-sm:pb-2",
66
+ v
67
+ ),
68
+ "data-testid": x,
69
+ ..._,
70
+ children: n.map((e, t) => y(e, t))
71
+ }
72
+ );
73
+ };
74
+ export {
75
+ j as TagCloud
76
+ };
@@ -0,0 +1,26 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export type TagCloudLayout = 'flow' | 'circle';
3
+ export interface TagCloudItem {
4
+ text: string;
5
+ value: number;
6
+ color?: string;
7
+ href?: string;
8
+ }
9
+ export interface TagCloudProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
10
+ /** Tags with text and weight value */
11
+ tags: TagCloudItem[];
12
+ /** Minimum font size in px */
13
+ minFontSize?: number;
14
+ /** Maximum font size in px */
15
+ maxFontSize?: number;
16
+ /** Color palette (cycled through) */
17
+ colors?: string[];
18
+ /** Layout mode */
19
+ layout?: TagCloudLayout;
20
+ /** Responsive: collapse to scrollable list on mobile */
21
+ mobileCompact?: boolean;
22
+ /** Callback when a tag is clicked */
23
+ onTagClick?: (tag: TagCloudItem) => void;
24
+ /** Test ID */
25
+ testId?: string;
26
+ }
@@ -0,0 +1,2 @@
1
+ export { TagCloud } from './TagCloud';
2
+ export type { TagCloudProps, TagCloudItem, TagCloudLayout } from './TagCloud.types';