@forgedevstack/bear 1.2.8 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/components/Backdrop/Backdrop.cjs +1 -1
  2. package/dist/components/Backdrop/Backdrop.const.cjs +1 -1
  3. package/dist/components/Backdrop/Backdrop.const.d.ts +4 -1
  4. package/dist/components/Backdrop/Backdrop.const.js +11 -8
  5. package/dist/components/Backdrop/Backdrop.js +39 -36
  6. package/dist/components/Backdrop/Backdrop.types.d.ts +1 -0
  7. package/dist/components/Backdrop/index.d.ts +1 -0
  8. package/dist/components/Drawer/Drawer.cjs +1 -1
  9. package/dist/components/Drawer/Drawer.const.cjs +1 -1
  10. package/dist/components/Drawer/Drawer.const.d.ts +3 -0
  11. package/dist/components/Drawer/Drawer.const.js +14 -11
  12. package/dist/components/Drawer/Drawer.js +95 -82
  13. package/dist/components/Modal/Modal.cjs +1 -1
  14. package/dist/components/Modal/Modal.const.cjs +1 -1
  15. package/dist/components/Modal/Modal.const.d.ts +3 -1
  16. package/dist/components/Modal/Modal.const.js +12 -9
  17. package/dist/components/Modal/Modal.js +45 -41
  18. package/dist/components/Modal/Modal.types.d.ts +1 -0
  19. package/dist/components/ModalsProvider/ModalsContext.cjs +1 -0
  20. package/dist/components/ModalsProvider/ModalsContext.d.ts +2 -0
  21. package/dist/components/ModalsProvider/ModalsContext.js +5 -0
  22. package/dist/components/ModalsProvider/ModalsProvider.cjs +1 -0
  23. package/dist/components/ModalsProvider/ModalsProvider.const.cjs +1 -0
  24. package/dist/components/ModalsProvider/ModalsProvider.const.d.ts +39 -0
  25. package/dist/components/ModalsProvider/ModalsProvider.const.js +40 -0
  26. package/dist/components/ModalsProvider/ModalsProvider.d.ts +3 -0
  27. package/dist/components/ModalsProvider/ModalsProvider.js +97 -0
  28. package/dist/components/ModalsProvider/ModalsProvider.types.d.ts +75 -0
  29. package/dist/components/ModalsProvider/ModalsProvider.utils.cjs +1 -0
  30. package/dist/components/ModalsProvider/ModalsProvider.utils.d.ts +8 -0
  31. package/dist/components/ModalsProvider/ModalsProvider.utils.js +24 -0
  32. package/dist/components/ModalsProvider/components/ModalsHost/ModalsHost.cjs +1 -0
  33. package/dist/components/ModalsProvider/components/ModalsHost/ModalsHost.d.ts +2 -0
  34. package/dist/components/ModalsProvider/components/ModalsHost/ModalsHost.js +24 -0
  35. package/dist/components/ModalsProvider/components/ModalsHost/index.d.ts +1 -0
  36. package/dist/components/ModalsProvider/components/StackedModal/StackedModal.cjs +1 -0
  37. package/dist/components/ModalsProvider/components/StackedModal/StackedModal.d.ts +2 -0
  38. package/dist/components/ModalsProvider/components/StackedModal/StackedModal.js +66 -0
  39. package/dist/components/ModalsProvider/components/StackedModal/index.d.ts +1 -0
  40. package/dist/components/ModalsProvider/components/index.d.ts +2 -0
  41. package/dist/components/ModalsProvider/hooks/index.d.ts +1 -0
  42. package/dist/components/ModalsProvider/hooks/useModals.cjs +1 -0
  43. package/dist/components/ModalsProvider/hooks/useModals.d.ts +2 -0
  44. package/dist/components/ModalsProvider/hooks/useModals.js +12 -0
  45. package/dist/components/ModalsProvider/index.d.ts +3 -0
  46. package/dist/components/SignPad/SignPad.cjs +1 -1
  47. package/dist/components/SignPad/SignPad.const.cjs +1 -1
  48. package/dist/components/SignPad/SignPad.const.d.ts +13 -2
  49. package/dist/components/SignPad/SignPad.const.js +22 -13
  50. package/dist/components/SignPad/SignPad.js +127 -121
  51. package/dist/components/SignPad/SignPad.types.d.ts +2 -1
  52. package/dist/components/SignPad/SignPad.utils.cjs +1 -0
  53. package/dist/components/SignPad/SignPad.utils.d.ts +34 -0
  54. package/dist/components/SignPad/SignPad.utils.js +42 -0
  55. package/dist/components/Snackbar/Snackbar.cjs +1 -1
  56. package/dist/components/Snackbar/Snackbar.const.cjs +1 -1
  57. package/dist/components/Snackbar/Snackbar.const.d.ts +7 -1
  58. package/dist/components/Snackbar/Snackbar.const.js +21 -11
  59. package/dist/components/Snackbar/Snackbar.js +60 -59
  60. package/dist/components/StatCard/StatCard.cjs +1 -1
  61. package/dist/components/StatCard/StatCard.const.cjs +1 -0
  62. package/dist/components/StatCard/StatCard.const.d.ts +11 -1
  63. package/dist/components/StatCard/StatCard.const.js +14 -0
  64. package/dist/components/StatCard/StatCard.d.ts +0 -4
  65. package/dist/components/StatCard/StatCard.js +44 -32
  66. package/dist/components/Stepper/Stepper.cjs +1 -1
  67. package/dist/components/Stepper/Stepper.const.cjs +1 -1
  68. package/dist/components/Stepper/Stepper.const.d.ts +23 -11
  69. package/dist/components/Stepper/Stepper.const.js +60 -48
  70. package/dist/components/Stepper/Stepper.js +126 -118
  71. package/dist/components/Toast/Toast.cjs +1 -1
  72. package/dist/components/Toast/Toast.const.cjs +1 -1
  73. package/dist/components/Toast/Toast.const.d.ts +4 -1
  74. package/dist/components/Toast/Toast.const.js +20 -5
  75. package/dist/components/Toast/Toast.js +97 -110
  76. package/dist/components/index.cjs +1 -1
  77. package/dist/components/index.d.ts +2 -0
  78. package/dist/components/index.js +389 -385
  79. package/dist/index.cjs +1 -1
  80. package/dist/index.js +504 -500
  81. package/dist/styles/_feedback.css +130 -0
  82. package/dist/styles/_overlays.css +24 -0
  83. package/dist/styles/main.css +2 -0
  84. package/dist/styles.css +193 -25
  85. package/package.json +1 -1
@@ -1,117 +1,116 @@
1
- import { jsxs as i, Fragment as f, jsx as t } from "react/jsx-runtime";
2
- import U, { forwardRef as ie, useState as le, useEffect as se, useMemo as V } from "react";
1
+ import { jsxs as i, Fragment as O, jsx as t } from "react/jsx-runtime";
2
+ import F, { forwardRef as le, useState as Ee, useEffect as se, useMemo as U } from "react";
3
3
  import { useBearThemeOptional as ae, useBearDirectionOptional as ce } from "../../context/BearProvider.js";
4
4
  import { resolveMaxVisible as de } from "../../utils/maxVisible.utils.js";
5
- import { cn as s } from "../../utils/cn.js";
5
+ import { cn as E } from "../../utils/cn.js";
6
6
  import { Typography as M } from "../Typography/Typography.js";
7
- import { Dropdown as Ee } from "../Dropdown/Dropdown.js";
8
- import { BearIcons as he } from "../Icon/index.js";
9
- import { STEP_WRAPPER_VERTICAL as _e, STEPPER_HORIZONTAL_CLASSES as me, STEPPER_VERTICAL_CLASSES as Te, STEPPER_BASE_CLASSES as fe, DEFAULT_ORIENTATION as Se, DEFAULT_SIZE as Ie, DEFAULT_SHOW_NUMBERS as Oe, DEFAULT_CLICKABLE as Ce, DEFAULT_SHOW_CONNECTORS as Ne, DEFAULT_CONNECTOR_STYLE as ue, DEFAULT_ALTERNATIVE_LABEL as Ae, CONNECTOR_STATUS as S, CONNECTOR_VERTICAL as Le, CONNECTOR_BASE as ge, OVERFLOW_LEFT_LABEL as Re, OVERFLOW_RIGHT_LABEL as pe, STEP_STATUS_CLASSES as u, STEP_INDICATOR_SIZES as ve, STEP_INDICATOR_BASE as z, STEP_LABEL_SIZES as we, STEP_LABEL_BASE as be, STEP_DESCRIPTION_CLASSES as Be, ERROR_ICON_VIEWBOX as Pe, ERROR_ICON_SIZE as Z, CHECK_ICON_VIEWBOX as ye, CHECK_ICON_SIZE as K, CHECK_ICON_POINTS as He } from "./Stepper.const.js";
10
- import { resolveStepStatus as k, resolveIndicatorContent as We } from "./Stepper.utils.js";
11
- const Fe = 1200, De = 16, Ue = 640, x = 3, Ve = () => /* @__PURE__ */ t("svg", { width: K, height: K, viewBox: ye, fill: "none", stroke: "currentColor", strokeWidth: "3", children: /* @__PURE__ */ t("polyline", { points: He }) }), Me = () => /* @__PURE__ */ i("svg", { width: Z, height: Z, viewBox: Pe, fill: "none", stroke: "currentColor", strokeWidth: "3", children: [
7
+ import { Dropdown as _e } from "../Dropdown/Dropdown.js";
8
+ import { BearIcons as Te } from "../Icon/index.js";
9
+ import { STEP_WRAPPER_VERTICAL as he, STEPPER_HORIZONTAL_CLASSES as Ne, STEPPER_VERTICAL_CLASSES as Oe, STEPPER_BASE_CLASSES as Se, DEFAULT_ORIENTATION as Ce, DEFAULT_SIZE as Ie, DEFAULT_SHOW_NUMBERS as Ae, DEFAULT_CLICKABLE as Le, DEFAULT_SHOW_CONNECTORS as me, DEFAULT_CONNECTOR_STYLE as Re, DEFAULT_ALTERNATIVE_LABEL as fe, STEP_LABEL_ALTERNATIVE as ue, STEP_LABEL_INLINE as ge, STEP_CONTENT_ALTERNATIVE as Pe, STEP_CONTENT_INLINE as ve, STEP_CONTENT_BASE as Be, CONNECTOR_DASHED_CLASSES as Z, CONNECTOR_STATUS as S, CONNECTOR_HORIZONTAL_LAYOUT as we, CONNECTOR_VERTICAL as be, CONNECTOR_BASE as pe, STEP_OVERFLOW_ROOT as He, OVERFLOW_LEFT_LABEL as We, OVERFLOW_RIGHT_LABEL as De, STEP_STATUS_CLASSES as m, STEP_INDICATOR_SIZES as Ve, STEP_INDICATOR_BASE as z, STEP_VERTICAL_INDICATOR_WRAP as ye, STEP_VERTICAL_BODY as Fe, STEP_VERTICAL_CONTENT as Ue, STEP_CLICKABLE_CLASSES as Me, STEP_LABEL_SIZES as Ze, STEP_LABEL_BASE as ze, STEP_DESCRIPTION_CLASSES as Ke, ERROR_ICON_VIEWBOX as Xe, ERROR_ICON_SIZE as K, CHECK_ICON_VIEWBOX as Ye, CHECK_ICON_SIZE as X, CHECK_ICON_POINTS as je } from "./Stepper.const.js";
10
+ import { resolveStepStatus as Y, resolveIndicatorContent as $e } from "./Stepper.utils.js";
11
+ const ke = 1200, Ge = 16, qe = 640, j = 3, Je = () => /* @__PURE__ */ t("svg", { width: X, height: X, viewBox: Ye, fill: "none", stroke: "currentColor", strokeWidth: "3", children: /* @__PURE__ */ t("polyline", { points: je }) }), Qe = () => /* @__PURE__ */ i("svg", { width: K, height: K, viewBox: Xe, fill: "none", stroke: "currentColor", strokeWidth: "3", children: [
12
12
  /* @__PURE__ */ t("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
13
13
  /* @__PURE__ */ t("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
14
- ] }), ze = ie(
14
+ ] }), xe = le(
15
15
  ({
16
16
  steps: o,
17
- activeStep: E,
18
- onStepClick: h,
19
- orientation: X = Se,
20
- size: A = Ie,
21
- showNumbers: j = Oe,
22
- clickable: L = Ce,
23
- showConnectors: $ = Ne,
24
- connectorStyle: g = ue,
25
- alternativeLabel: R = Ae,
26
- completedIcon: G,
27
- errorIcon: Y,
28
- labelTypographyProps: q,
29
- descriptionTypographyProps: J,
30
- maxVisibleSteps: I,
31
- testId: Q,
32
- className: ee,
33
- ...re
34
- }, ne) => {
35
- const p = ae(), { direction: v } = ce(), [O, te] = le(() => typeof window < "u" ? window.innerWidth : Fe);
17
+ activeStep: d,
18
+ onStepClick: _,
19
+ orientation: $ = Ce,
20
+ size: R = Ie,
21
+ showNumbers: k = Ae,
22
+ clickable: f = Le,
23
+ showConnectors: G = me,
24
+ connectorStyle: u = Re,
25
+ alternativeLabel: g = fe,
26
+ completedIcon: q,
27
+ errorIcon: J,
28
+ labelTypographyProps: Q,
29
+ descriptionTypographyProps: x,
30
+ maxVisibleSteps: C,
31
+ testId: ee,
32
+ className: re,
33
+ ...ne
34
+ }, te) => {
35
+ const P = ae(), { direction: v } = ce(), [I, oe] = Ee(() => typeof window < "u" ? window.innerWidth : ke);
36
36
  se(() => {
37
- const e = () => te(window.innerWidth);
37
+ const e = () => oe(window.innerWidth);
38
38
  return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
39
39
  }, []);
40
- const _ = V(() => {
41
- if (I != null)
42
- return de(I, { width: O, theme: p });
43
- if (O < Ue && o.length > x)
44
- return x;
45
- }, [I, O, p, o.length]), d = X === "horizontal", w = ve[A], b = we[A], m = d && _ != null && o.length > _, { visibleIndices: B, leftHidden: P, rightHidden: C } = V(() => {
46
- if (!m || _ == null)
40
+ const T = U(() => {
41
+ if (C != null)
42
+ return de(C, { width: I, theme: P });
43
+ if (I < qe && o.length > j)
44
+ return j;
45
+ }, [C, I, P, o.length]), c = $ === "horizontal", B = Ve[R], w = Ze[R], h = c && T != null && o.length > T, { visibleIndices: b, leftHidden: p, rightHidden: A } = U(() => {
46
+ if (!h || T == null)
47
47
  return {
48
- visibleIndices: o.map((c, N) => N),
48
+ visibleIndices: o.map((a, L) => L),
49
49
  leftHidden: [],
50
50
  rightHidden: []
51
51
  };
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 = [], D = [];
53
- for (let c = 0; c < n; c++) a.push(c);
54
- for (let c = n + e; c < o.length; c++) D.push(c);
55
- return { visibleIndices: l, leftHidden: a, rightHidden: D };
56
- }, [m, _, o, E]), y = (e, r, n) => {
57
- const l = u[n], a = We(
52
+ const e = T, r = Math.floor(e / 2), n = Math.max(0, Math.min(d - r, o.length - e)), l = Array.from({ length: e }, (a, L) => n + L), s = [], y = [];
53
+ for (let a = 0; a < n; a++) s.push(a);
54
+ for (let a = n + e; a < o.length; a++) y.push(a);
55
+ return { visibleIndices: l, leftHidden: s, rightHidden: y };
56
+ }, [h, T, o, d]), H = (e, r, n) => {
57
+ const l = m[n], s = $e(
58
58
  e,
59
59
  r,
60
60
  n,
61
- j,
62
- G,
63
- Y,
64
- /* @__PURE__ */ t(Ve, {}),
65
- /* @__PURE__ */ t(Me, {})
61
+ k,
62
+ q,
63
+ J,
64
+ /* @__PURE__ */ t(Je, {}),
65
+ /* @__PURE__ */ t(Qe, {})
66
66
  );
67
67
  return /* @__PURE__ */ t(
68
68
  "div",
69
69
  {
70
- className: s(
70
+ className: E(
71
71
  z,
72
- w,
72
+ B,
73
73
  l.indicator,
74
- L && !e.disabled && "cursor-pointer hover:scale-105"
74
+ f && !e.disabled && Me
75
75
  ),
76
76
  onClick: () => {
77
- L && !e.disabled && h && h(r);
77
+ f && !e.disabled && _ && _(r);
78
78
  },
79
- children: a
79
+ children: s
80
80
  }
81
81
  );
82
- }, T = (e, r) => {
83
- if (!$ || r) return null;
84
- const n = e < E;
85
- return d ? /* @__PURE__ */ t(
82
+ }, N = (e, r) => {
83
+ if (!G || r) return null;
84
+ const n = e < d;
85
+ return c ? /* @__PURE__ */ t(
86
86
  "div",
87
87
  {
88
- className: s(
89
- "Bear-Stepper__connector flex-1 self-center mx-1",
90
- "h-0.5 min-w-[12px] transition-colors",
88
+ className: E(
89
+ we,
91
90
  n ? S.completed : S.pending,
92
- g === "dashed" && "border-t-2 border-dashed bg-transparent"
91
+ u === "dashed" && Z
93
92
  )
94
93
  }
95
94
  ) : /* @__PURE__ */ t(
96
95
  "div",
97
96
  {
98
- className: s(
99
- ge,
100
- Le,
97
+ className: E(
98
+ pe,
99
+ be,
101
100
  n ? S.completed : S.pending,
102
- g === "dashed" && "border-t-2 border-dashed bg-transparent"
101
+ u === "dashed" && Z
103
102
  )
104
103
  }
105
104
  );
106
- }, H = (e, r) => {
107
- const n = u[r], l = { ...q, ...e.labelTypographyProps }, a = { ...J, ...e.descriptionTypographyProps };
108
- return /* @__PURE__ */ i(f, { children: [
105
+ }, W = (e, r) => {
106
+ const n = m[r], l = { ...Q, ...e.labelTypographyProps }, s = { ...x, ...e.descriptionTypographyProps };
107
+ return /* @__PURE__ */ i(O, { children: [
109
108
  /* @__PURE__ */ t(
110
109
  M,
111
110
  {
112
111
  variant: "body2",
113
112
  ...l,
114
- className: s(be, b.label, n.label, l == null ? void 0 : l.className),
113
+ className: E(ze, w.label, n.label, l == null ? void 0 : l.className),
115
114
  children: e.label
116
115
  }
117
116
  ),
@@ -119,29 +118,38 @@ const Fe = 1200, De = 16, Ue = 640, x = 3, Ve = () => /* @__PURE__ */ t("svg", {
119
118
  M,
120
119
  {
121
120
  variant: "caption",
122
- ...a,
123
- className: s(Be, b.description, a == null ? void 0 : a.className),
121
+ ...s,
122
+ className: E(Ke, w.description, s == null ? void 0 : s.className),
124
123
  children: e.description
125
124
  }
126
125
  )
127
126
  ] });
128
- }, W = (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
- y(e, r, n),
132
- /* @__PURE__ */ t("div", { className: s(R && "text-center mt-2", "whitespace-nowrap"), children: H(e, n) })
133
- ] });
134
- }, oe = (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: y(e, r, n) }),
138
- /* @__PURE__ */ i("div", { className: "flex-1 pt-0.5", children: [
139
- H(e, n),
140
- e.content && n === "active" && /* @__PURE__ */ t("div", { className: "mt-4", children: e.content })
127
+ }, D = (e, r) => {
128
+ const n = Y(e, r, d);
129
+ return /* @__PURE__ */ i(
130
+ "div",
131
+ {
132
+ className: E(
133
+ Be,
134
+ g ? Pe : ve
135
+ ),
136
+ children: [
137
+ H(e, r, n),
138
+ /* @__PURE__ */ t("div", { className: E(g ? ue : ge), children: W(e, n) })
139
+ ]
140
+ }
141
+ );
142
+ }, ie = (e, r) => {
143
+ const n = Y(e, r, d);
144
+ return /* @__PURE__ */ i(O, { children: [
145
+ /* @__PURE__ */ t("div", { className: ye, children: H(e, r, n) }),
146
+ /* @__PURE__ */ i("div", { className: Fe, children: [
147
+ W(e, n),
148
+ e.content && n === "active" && /* @__PURE__ */ t("div", { className: Ue, children: e.content })
141
149
  ] })
142
150
  ] });
143
- }, F = (e, r) => /* @__PURE__ */ t("div", { className: "Bear-Stepper__overflow shrink-0", children: /* @__PURE__ */ t(
144
- Ee,
151
+ }, V = (e, r) => /* @__PURE__ */ t("div", { className: He, children: /* @__PURE__ */ t(
152
+ _e,
145
153
  {
146
154
  placement: "bottom-start",
147
155
  closeOnSelect: !0,
@@ -149,14 +157,14 @@ const Fe = 1200, De = 16, Ue = 640, x = 3, Ve = () => /* @__PURE__ */ t("svg", {
149
157
  "button",
150
158
  {
151
159
  type: "button",
152
- className: s(
160
+ className: E(
153
161
  z,
154
- w,
155
- u.pending.indicator,
162
+ B,
163
+ m.pending.indicator,
156
164
  "bear-cursor-pointer bear-border-0"
157
165
  ),
158
- "aria-label": r === "left" ? Re : pe,
159
- children: /* @__PURE__ */ t(he.MoreHorizIcon, { size: De })
166
+ "aria-label": r === "left" ? We : De,
167
+ children: /* @__PURE__ */ t(Te.MoreHorizIcon, { size: Ge })
160
168
  }
161
169
  ),
162
170
  items: e.map((n) => ({
@@ -164,7 +172,7 @@ const Fe = 1200, De = 16, Ue = 640, x = 3, Ve = () => /* @__PURE__ */ t("svg", {
164
172
  label: o[n].label,
165
173
  disabled: o[n].disabled,
166
174
  onClick: () => {
167
- o[n].disabled || h == null || h(n);
175
+ o[n].disabled || _ == null || _(n);
168
176
  }
169
177
  }))
170
178
  }
@@ -172,45 +180,45 @@ const Fe = 1200, De = 16, Ue = 640, x = 3, Ve = () => /* @__PURE__ */ t("svg", {
172
180
  return /* @__PURE__ */ i(
173
181
  "div",
174
182
  {
175
- ref: ne,
183
+ ref: te,
176
184
  dir: v,
177
- className: s(
178
- fe,
179
- d ? me : Te,
180
- v === "rtl" && d && "bear-flex-row-reverse",
181
- ee
185
+ className: E(
186
+ Se,
187
+ c ? Ne : Oe,
188
+ v === "rtl" && c && "bear-flex-row-reverse",
189
+ re
182
190
  ),
183
- "data-testid": Q,
184
- ...re,
191
+ "data-testid": ee,
192
+ ...ne,
185
193
  children: [
186
- d && !m && o.map((e, r) => /* @__PURE__ */ i(U.Fragment, { children: [
187
- W(e, r),
188
- T(r, r === o.length - 1)
194
+ c && !h && o.map((e, r) => /* @__PURE__ */ i(F.Fragment, { children: [
195
+ D(e, r),
196
+ N(r, r === o.length - 1)
189
197
  ] }, r)),
190
- d && m && /* @__PURE__ */ i(f, { children: [
191
- P.length > 0 && /* @__PURE__ */ i(f, { children: [
192
- F(P, "left"),
193
- T(-1, !1)
198
+ c && h && /* @__PURE__ */ i(O, { children: [
199
+ p.length > 0 && /* @__PURE__ */ i(O, { children: [
200
+ V(p, "left"),
201
+ N(-1, !1)
194
202
  ] }),
195
- B.map((e, r) => {
196
- const n = o[e], l = r === B.length - 1 && C.length === 0;
197
- return /* @__PURE__ */ i(U.Fragment, { children: [
198
- W(n, e),
199
- T(e, l)
203
+ b.map((e, r) => {
204
+ const n = o[e], l = r === b.length - 1 && A.length === 0;
205
+ return /* @__PURE__ */ i(F.Fragment, { children: [
206
+ D(n, e),
207
+ N(e, l)
200
208
  ] }, e);
201
209
  }),
202
- C.length > 0 && F(C, "right")
210
+ A.length > 0 && V(A, "right")
203
211
  ] }),
204
- !d && o.map((e, r) => /* @__PURE__ */ i("div", { className: s("Bear-Stepper__step", _e), children: [
205
- oe(e, r),
206
- T(r, r === o.length - 1)
212
+ !c && o.map((e, r) => /* @__PURE__ */ i("div", { className: E("Bear-Stepper__step", he), children: [
213
+ ie(e, r),
214
+ N(r, r === o.length - 1)
207
215
  ] }, r))
208
216
  ]
209
217
  }
210
218
  );
211
219
  }
212
220
  );
213
- ze.displayName = "Stepper";
221
+ xe.displayName = "Stepper";
214
222
  export {
215
- ze as Stepper
223
+ xe as Stepper
216
224
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),T=require("./Toast.const.cjs"),S=require("../../utils/cn.cjs"),O=require("../../utils/generateBearId.utils.cjs"),P=require("../../utils/liveRegion.utils.cjs"),N={success:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),info:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),warning:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),error:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),e.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})},A=()=>e.jsxs("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),B={success:"bear-bg-green-500 bear-text-white",info:"bear-bg-blue-500 bear-text-white",warning:"bear-bg-amber-500 bear-text-white",error:"bear-bg-red-500 bear-text-white"},L={"top-left":"bear-top-4 bear-left-4","top-center":"bear-top-4 bear-left-1/2 bear-transform bear--translate-x-1/2","top-right":"bear-top-4 bear-right-4","bottom-left":"bear-bottom-4 bear-left-4","bottom-center":"bear-bottom-4 bear-left-1/2 bear-transform bear--translate-x-1/2","bottom-right":"bear-bottom-4 bear-right-4"},_=t.createContext(null),M=()=>{const l=t.useContext(_);if(!l)throw new Error("useToast must be used within a ToastProvider");return l},q=({id:l,testId:x,message:d,title:b,severity:n="info",duration:o=5e3,closable:a=!0,icon:i,action:f,onClose:c,onRemove:h,className:v,autoScroll:m=!1,pauseOnHover:g=!1})=>{const[j,r]=t.useState(!1),[s,u]=t.useState(!1),w=t.useRef(null),y=t.useRef(o),p=t.useRef(0);t.useEffect(()=>{m&&w.current&&w.current.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[m]),t.useEffect(()=>{if(o<=0||s)return;p.current=Date.now();const E=setTimeout(()=>{r(!0),setTimeout(()=>{h(),c==null||c()},T.TOAST_EXIT_MS)},y.current);return()=>{clearTimeout(E),y.current=Math.max(0,y.current-(Date.now()-p.current))}},[o,s,h,c]);const I=()=>{r(!0),setTimeout(()=>{h(),c==null||c()},T.TOAST_EXIT_MS)},k=()=>i===!1?null:i||N[n],R=P.getBearLiveRegionProps(n);return e.jsxs("div",{ref:w,id:l,"data-testid":x,...R,"aria-atomic":"true",onMouseEnter:g?()=>u(!0):void 0,onMouseLeave:g?()=>u(!1):void 0,className:S.cn(T.T_O_A_S_T_ROOT_CLASS,"bear-flex bear-items-start bear-gap-3 bear-p-4 bear-rounded-lg bear-shadow-lg bear-min-w-[300px] bear-max-w-[400px]","bear-transition-all bear-duration-200",j?"bear-opacity-0 bear-translate-x-2":"bear-opacity-100 bear-translate-x-0",B[n],v),children:[k()&&e.jsx("span",{className:"bear-flex-shrink-0 bear-mt-0.5",children:k()}),e.jsxs("div",{className:"bear-flex-1 bear-min-w-0",children:[b&&e.jsx("div",{className:"bear-font-semibold bear-mb-0.5",children:b}),e.jsx("div",{className:"bear-text-sm bear-opacity-90",children:d})]}),f&&e.jsx("div",{className:"bear-flex-shrink-0",children:f}),a&&e.jsx("button",{type:"button",onClick:I,className:"bear-flex-shrink-0 bear-p-1 bear-rounded hover:bear-bg-white/20 bear-transition-colors bear-bg-transparent bear-border-none bear-cursor-pointer","aria-label":"Close",children:e.jsx(A,{})})]})},C=({position:l="top-right",maxToasts:x=5,className:d})=>{const b=t.useContext(_);if(!b)return null;const{_toasts:n,_removeToast:o}=b,a=n.slice(0,x);return e.jsx("div",{className:S.cn(`${T.T_O_A_S_T_ROOT_CLASS}__container`,"bear-fixed bear-z-[11000] bear-flex bear-flex-col bear-gap-2",L[l],d),"aria-relevant":"additions",children:a.map(i=>e.jsx(q,{...i,onRemove:()=>o(i.id)},i.id))})},W=({children:l,position:x="top-right",maxToasts:d})=>{const[b,n]=t.useState([]),o=t.useCallback(r=>{n(s=>s.filter(u=>u.id!==r))},[]),a=t.useCallback(r=>{const s=r.id||O.generateBearId("Toast");return n(u=>[...u,{...r,id:s}]),s},[]),i=t.useCallback(r=>a(r),[a]),f=t.useCallback((r,s)=>a({message:r,severity:"success",...s}),[a]),c=t.useCallback((r,s)=>a({message:r,severity:"info",...s}),[a]),h=t.useCallback((r,s)=>a({message:r,severity:"warning",...s}),[a]),v=t.useCallback((r,s)=>a({message:r,severity:"error",...s}),[a]),m=t.useCallback(r=>o(r),[o]),g=t.useCallback(()=>n([]),[]),j={toast:i,success:f,info:c,warning:h,error:v,dismiss:m,dismissAll:g,_toasts:b,_removeToast:o};return e.jsxs(_.Provider,{value:j,children:[l,e.jsx(C,{position:x,maxToasts:d})]})};exports.ToastContainer=C;exports.ToastProvider=W;exports.useToast=M;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("react"),x=require("./Toast.const.cjs"),I=require("../../utils/cn.cjs"),R=require("../../utils/generateBearId.utils.cjs"),A=require("../../utils/liveRegion.utils.cjs"),P={success:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),info:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),warning:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),error:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),e.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})},L=()=>e.jsxs("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),M=x.TOAST_SEVERITY_MODIFIER,N=x.TOAST_POSITION_CLASSES,y=s.createContext(null),B=()=>{const l=s.useContext(y);if(!l)throw new Error("useToast must be used within a ToastProvider");return l},q=({id:l,testId:b,message:h,title:u,severity:a="info",duration:i=5e3,closable:n=!0,icon:o,action:f,onClose:c,onRemove:T,className:j,autoScroll:v=!1,pauseOnHover:_=!1})=>{const[m,t]=s.useState(!1),[r,d]=s.useState(!1),S=s.useRef(null),g=s.useRef(i),k=s.useRef(0);s.useEffect(()=>{v&&S.current&&S.current.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[v]),s.useEffect(()=>{if(i<=0||r)return;k.current=Date.now();const O=setTimeout(()=>{t(!0),setTimeout(()=>{T(),c==null||c()},x.TOAST_EXIT_MS)},g.current);return()=>{clearTimeout(O),g.current=Math.max(0,g.current-(Date.now()-k.current))}},[i,r,T,c]);const E=()=>{t(!0),setTimeout(()=>{T(),c==null||c()},x.TOAST_EXIT_MS)},w=()=>o===!1?null:o||P[a],p=A.getBearLiveRegionProps(a);return e.jsxs("div",{ref:S,id:l,"data-testid":b,...p,"aria-atomic":"true",onMouseEnter:_?()=>d(!0):void 0,onMouseLeave:_?()=>d(!1):void 0,className:I.cn(x.T_O_A_S_T_ROOT_CLASS,x.TOAST_ITEM_CLASSES,m?"bear-opacity-0 bear-translate-x-2":"bear-opacity-100 bear-translate-x-0",M[a],j),children:[w()&&e.jsx("span",{className:"bear-flex-shrink-0 bear-mt-0.5",children:w()}),e.jsxs("div",{className:"bear-flex-1 bear-min-w-0",children:[u&&e.jsx("div",{className:"bear-font-semibold bear-mb-0.5",children:u}),e.jsx("div",{className:"bear-text-sm bear-opacity-90",children:h})]}),f&&e.jsx("div",{className:"bear-flex-shrink-0",children:f}),n&&e.jsx("button",{type:"button",onClick:E,className:"bear-flex-shrink-0 bear-p-1 bear-rounded hover:bear-bg-black/10 dark:hover:bear-bg-white/20 bear-transition-colors bear-bg-transparent bear-border-none bear-cursor-pointer","aria-label":"Close",children:e.jsx(L,{})})]})},C=({position:l="top-right",maxToasts:b=5,className:h})=>{const u=s.useContext(y);if(!u)return null;const{_toasts:a,_removeToast:i}=u,n=a.slice(0,b);return e.jsx("div",{className:I.cn(`${x.T_O_A_S_T_ROOT_CLASS}__container`,"bear-fixed bear-z-[11000] bear-flex bear-flex-col bear-gap-2",N[l],h),"aria-relevant":"additions",children:n.map(o=>e.jsx(q,{...o,onRemove:()=>i(o.id)},o.id))})},V=({children:l,position:b="top-right",maxToasts:h})=>{const[u,a]=s.useState([]),i=s.useCallback(t=>{a(r=>r.filter(d=>d.id!==t))},[]),n=s.useCallback(t=>{const r=t.id||R.generateBearId("Toast");return a(d=>[...d,{...t,id:r}]),r},[]),o=s.useCallback(t=>n(t),[n]),f=s.useCallback((t,r)=>n({message:t,severity:"success",...r}),[n]),c=s.useCallback((t,r)=>n({message:t,severity:"info",...r}),[n]),T=s.useCallback((t,r)=>n({message:t,severity:"warning",...r}),[n]),j=s.useCallback((t,r)=>n({message:t,severity:"error",...r}),[n]),v=s.useCallback(t=>i(t),[i]),_=s.useCallback(()=>a([]),[]),m={toast:o,success:f,info:c,warning:T,error:j,dismiss:v,dismissAll:_,_toasts:u,_removeToast:i};return e.jsxs(y.Provider,{value:m,children:[l,e.jsx(C,{position:b,maxToasts:h})]})};exports.ToastContainer=C;exports.ToastProvider=V;exports.useToast=B;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("../../utils/liveRegion.const.cjs"),E="Bear-Toast";_.BEAR_ARIA_LIVE_BY_SEVERITY.success,_.BEAR_ARIA_LIVE_BY_SEVERITY.info,_.BEAR_ARIA_LIVE_BY_SEVERITY.warning,_.BEAR_ARIA_LIVE_BY_SEVERITY.error;_.BEAR_ARIA_ROLE_BY_SEVERITY.success,_.BEAR_ARIA_ROLE_BY_SEVERITY.info,_.BEAR_ARIA_ROLE_BY_SEVERITY.warning,_.BEAR_ARIA_ROLE_BY_SEVERITY.error;const R=200;exports.TOAST_EXIT_MS=R;exports.T_O_A_S_T_ROOT_CLASS=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../utils/liveRegion.const.cjs"),e="Bear-Toast";r.BEAR_ARIA_LIVE_BY_SEVERITY.success,r.BEAR_ARIA_LIVE_BY_SEVERITY.info,r.BEAR_ARIA_LIVE_BY_SEVERITY.warning,r.BEAR_ARIA_LIVE_BY_SEVERITY.error;r.BEAR_ARIA_ROLE_BY_SEVERITY.success,r.BEAR_ARIA_ROLE_BY_SEVERITY.info,r.BEAR_ARIA_ROLE_BY_SEVERITY.warning,r.BEAR_ARIA_ROLE_BY_SEVERITY.error;const _=200,t={success:`${e}--success`,info:`${e}--info`,warning:`${e}--warning`,error:`${e}--error`},a={"top-left":"bear-top-4 bear-left-4","top-center":"bear-top-4 bear-left-1/2 bear-transform bear--translate-x-1/2","top-right":"bear-top-4 bear-right-4","bottom-left":"bear-bottom-4 bear-left-4","bottom-center":"bear-bottom-4 bear-left-1/2 bear-transform bear--translate-x-1/2","bottom-right":"bear-bottom-4 bear-right-4"},o="bear-flex bear-items-start bear-gap-3 bear-p-4 bear-rounded-lg bear-shadow-lg bear-min-w-[300px] bear-max-w-[400px] bear-transition-all bear-duration-200";exports.TOAST_EXIT_MS=_;exports.TOAST_ITEM_CLASSES=o;exports.TOAST_POSITION_CLASSES=a;exports.TOAST_SEVERITY_MODIFIER=t;exports.T_O_A_S_T_ROOT_CLASS=e;
@@ -1,5 +1,8 @@
1
- import { ToastSeverity } from './Toast.types';
1
+ import { ToastSeverity, ToastPosition } from './Toast.types';
2
2
  export declare const T_O_A_S_T_ROOT_CLASS = "Bear-Toast";
3
3
  export declare const TOAST_ARIA_LIVE: Record<ToastSeverity, 'polite' | 'assertive'>;
4
4
  export declare const TOAST_ARIA_ROLE: Record<ToastSeverity, 'status' | 'alert'>;
5
5
  export declare const TOAST_EXIT_MS = 200;
6
+ export declare const TOAST_SEVERITY_MODIFIER: Record<ToastSeverity, string>;
7
+ export declare const TOAST_POSITION_CLASSES: Record<ToastPosition, string>;
8
+ export declare const TOAST_ITEM_CLASSES = "bear-flex bear-items-start bear-gap-3 bear-p-4 bear-rounded-lg bear-shadow-lg bear-min-w-[300px] bear-max-w-[400px] bear-transition-all bear-duration-200";
@@ -1,9 +1,24 @@
1
- import { BEAR_ARIA_LIVE_BY_SEVERITY as r, BEAR_ARIA_ROLE_BY_SEVERITY as _ } from "../../utils/liveRegion.const.js";
2
- const n = "Bear-Toast";
1
+ import { BEAR_ARIA_LIVE_BY_SEVERITY as r, BEAR_ARIA_ROLE_BY_SEVERITY as e } from "../../utils/liveRegion.const.js";
2
+ const t = "Bear-Toast";
3
3
  r.success, r.info, r.warning, r.error;
4
- _.success, _.info, _.warning, _.error;
5
- const o = 200;
4
+ e.success, e.info, e.warning, e.error;
5
+ const o = 200, n = {
6
+ success: `${t}--success`,
7
+ info: `${t}--info`,
8
+ warning: `${t}--warning`,
9
+ error: `${t}--error`
10
+ }, b = {
11
+ "top-left": "bear-top-4 bear-left-4",
12
+ "top-center": "bear-top-4 bear-left-1/2 bear-transform bear--translate-x-1/2",
13
+ "top-right": "bear-top-4 bear-right-4",
14
+ "bottom-left": "bear-bottom-4 bear-left-4",
15
+ "bottom-center": "bear-bottom-4 bear-left-1/2 bear-transform bear--translate-x-1/2",
16
+ "bottom-right": "bear-bottom-4 bear-right-4"
17
+ }, s = "bear-flex bear-items-start bear-gap-3 bear-p-4 bear-rounded-lg bear-shadow-lg bear-min-w-[300px] bear-max-w-[400px] bear-transition-all bear-duration-200";
6
18
  export {
7
19
  o as TOAST_EXIT_MS,
8
- n as T_O_A_S_T_ROOT_CLASS
20
+ s as TOAST_ITEM_CLASSES,
21
+ b as TOAST_POSITION_CLASSES,
22
+ n as TOAST_SEVERITY_MODIFIER,
23
+ t as T_O_A_S_T_ROOT_CLASS
9
24
  };