@ledgerhq/lumen-ui-react 0.1.60 → 0.1.62

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 (89) hide show
  1. package/dist/index.js +150 -132
  2. package/dist/lib/Components/core/AmountInput/AmountInput.d.ts +1 -1
  3. package/dist/lib/Components/core/AmountInput/AmountInput.d.ts.map +1 -1
  4. package/dist/lib/Components/core/AmountInput/AmountInput.js +53 -51
  5. package/dist/lib/Components/core/AmountInput/useAmountInputValue/useAmountInputValue.js +3 -3
  6. package/dist/lib/Components/core/Avatar/resolveAvatarColor.js +2 -2
  7. package/dist/lib/Components/core/AvatarButton/AvatarButton.js +6 -6
  8. package/dist/lib/Components/core/Banner/Banner.js +8 -8
  9. package/dist/lib/Components/core/Button/Button.js +10 -10
  10. package/dist/lib/Components/core/Card/Card.js +6 -6
  11. package/dist/lib/Components/core/CardButton/CardButton.d.ts +2 -0
  12. package/dist/lib/Components/core/CardButton/CardButton.d.ts.map +1 -1
  13. package/dist/lib/Components/core/CardButton/CardButton.js +4 -4
  14. package/dist/lib/Components/core/DataTable/DataTable.js +7 -7
  15. package/dist/lib/Components/core/Divider/Divider.js +8 -8
  16. package/dist/lib/Components/core/DotCount/DotCount.js +3 -3
  17. package/dist/lib/Components/core/DotIcon/DotIcon.js +9 -9
  18. package/dist/lib/Components/core/DotSymbol/DotSymbol.js +16 -16
  19. package/dist/lib/Components/core/Link/Link.d.ts +1 -1
  20. package/dist/lib/Components/core/Link/Link.d.ts.map +1 -1
  21. package/dist/lib/Components/core/Link/Link.js +21 -20
  22. package/dist/lib/Components/core/Link/types.d.ts +1 -1
  23. package/dist/lib/Components/core/Link/types.d.ts.map +1 -1
  24. package/dist/lib/Components/core/ListItem/ListItem.js +4 -4
  25. package/dist/lib/Components/core/MediaBanner/MediaBanner.js +19 -19
  26. package/dist/lib/Components/core/MediaButton/MediaButton.js +2 -2
  27. package/dist/lib/Components/core/Menu/Menu.d.ts +3 -2
  28. package/dist/lib/Components/core/Menu/Menu.d.ts.map +1 -1
  29. package/dist/lib/Components/core/Menu/Menu.js +157 -108
  30. package/dist/lib/Components/core/Menu/types.d.ts +31 -0
  31. package/dist/lib/Components/core/Menu/types.d.ts.map +1 -1
  32. package/dist/lib/Components/core/NavBar/CoinCapsule.js +8 -8
  33. package/dist/lib/Components/core/Pagination/Pagination.js +14 -14
  34. package/dist/lib/Components/core/Popover/Popover.js +6 -6
  35. package/dist/lib/Components/core/SearchInput/SearchInput.js +5 -5
  36. package/dist/lib/Components/core/SegmentedControl/SegmentedControl.js +19 -19
  37. package/dist/lib/Components/core/Select/Select.js +8 -8
  38. package/dist/lib/Components/core/SideBar/SideBar.js +14 -14
  39. package/dist/lib/Components/core/Spinner/Spinner.js +4 -4
  40. package/dist/lib/Components/core/Spot/Spot.js +9 -9
  41. package/dist/lib/Components/core/Stepper/Stepper.d.ts +4 -3
  42. package/dist/lib/Components/core/Stepper/Stepper.d.ts.map +1 -1
  43. package/dist/lib/Components/core/Stepper/Stepper.js +137 -65
  44. package/dist/lib/Components/core/Stepper/types.d.ts +12 -2
  45. package/dist/lib/Components/core/Stepper/types.d.ts.map +1 -1
  46. package/dist/lib/Components/core/Switch/Switch.js +5 -5
  47. package/dist/lib/Components/core/Table/Table.js +9 -9
  48. package/dist/lib/Components/core/TileButton/TileButton.js +8 -8
  49. package/dist/lib/Components/core/Timeline/Timeline.d.ts +54 -0
  50. package/dist/lib/Components/core/Timeline/Timeline.d.ts.map +1 -0
  51. package/dist/lib/Components/core/Timeline/Timeline.js +228 -0
  52. package/dist/lib/Components/core/Timeline/index.d.ts +3 -0
  53. package/dist/lib/Components/core/Timeline/index.d.ts.map +1 -0
  54. package/dist/lib/Components/core/Timeline/types.d.ts +148 -0
  55. package/dist/lib/Components/core/Timeline/types.d.ts.map +1 -0
  56. package/dist/lib/Components/core/Toast/Toast.d.ts +25 -0
  57. package/dist/lib/Components/core/Toast/Toast.d.ts.map +1 -0
  58. package/dist/lib/Components/core/Toast/Toast.js +68 -0
  59. package/dist/lib/Components/core/Toast/Toaster.d.ts +27 -0
  60. package/dist/lib/Components/core/Toast/Toaster.d.ts.map +1 -0
  61. package/dist/lib/Components/core/Toast/Toaster.js +92 -0
  62. package/dist/lib/Components/core/Toast/hooks/useToastCollapse.d.ts +15 -0
  63. package/dist/lib/Components/core/Toast/hooks/useToastCollapse.d.ts.map +1 -0
  64. package/dist/lib/Components/core/Toast/hooks/useToastCollapse.js +15 -0
  65. package/dist/lib/Components/core/Toast/hooks/useToastViewportPause.d.ts +24 -0
  66. package/dist/lib/Components/core/Toast/hooks/useToastViewportPause.d.ts.map +1 -0
  67. package/dist/lib/Components/core/Toast/hooks/useToastViewportPause.js +27 -0
  68. package/dist/lib/Components/core/Toast/index.d.ts +5 -0
  69. package/dist/lib/Components/core/Toast/index.d.ts.map +1 -0
  70. package/dist/lib/Components/core/Toast/styles.d.ts +20 -0
  71. package/dist/lib/Components/core/Toast/styles.d.ts.map +1 -0
  72. package/dist/lib/Components/core/Toast/styles.js +77 -0
  73. package/dist/lib/Components/core/Toast/types.d.ts +81 -0
  74. package/dist/lib/Components/core/Toast/types.d.ts.map +1 -0
  75. package/dist/lib/Components/core/Trend/Trend.js +2 -2
  76. package/dist/lib/Components/core/index.d.ts +2 -0
  77. package/dist/lib/Components/core/index.d.ts.map +1 -1
  78. package/dist/lib/Components/internal/BaseButton/BaseButton.js +2 -2
  79. package/dist/lib/Components/internal/BaseInput/BaseInput.js +9 -9
  80. package/dist/lib/Components/internal/BaseInput/BaseInputMultiline.js +12 -12
  81. package/dist/lib/Components/internal/BaseTag/BaseTag.js +8 -8
  82. package/dist/lib/Components/symbols/Icon/Icon.js +4 -4
  83. package/dist/lib/Components/symbols/Icon/createIcon.js +8 -8
  84. package/dist/lib/Components/visualization/DonutChart/DonutChartCenter.js +6 -6
  85. package/dist/lib/Components/visualization/DonutChart/donutSizeContext.js +2 -2
  86. package/dist/lib/Components/visualization/Legend/Legend.js +8 -8
  87. package/dist/libs/utils-shared/dist/index.js +306 -141
  88. package/dist/package.json +3 -3
  89. package/package.json +3 -3
@@ -1,9 +1,9 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
2
  import { cn as t } from "../../../../libs/utils-shared/dist/index.js";
3
- import { cva as n } from "class-variance-authority";
3
+ import { cva as e } from "class-variance-authority";
4
4
  import { BaseInput as c } from "../../internal/BaseInput/BaseInput.js";
5
5
  import { Search as d } from "../../symbols/icons/Search.js";
6
- const m = n("", {
6
+ const m = e("", {
7
7
  variants: {
8
8
  appearance: {
9
9
  plain: "",
@@ -13,7 +13,7 @@ const m = n("", {
13
13
  defaultVariants: {
14
14
  appearance: "plain"
15
15
  }
16
- }), l = n("", {
16
+ }), l = e("", {
17
17
  variants: {
18
18
  appearance: {
19
19
  plain: "",
@@ -24,7 +24,7 @@ const m = n("", {
24
24
  appearance: "plain"
25
25
  }
26
26
  }), x = ({
27
- ref: e,
27
+ ref: n,
28
28
  appearance: a = "plain",
29
29
  className: s,
30
30
  inputClassName: p,
@@ -33,7 +33,7 @@ const m = n("", {
33
33
  }) => /* @__PURE__ */ r(
34
34
  c,
35
35
  {
36
- ref: e,
36
+ ref: n,
37
37
  prefix: /* @__PURE__ */ r(
38
38
  d,
39
39
  {
@@ -89,7 +89,7 @@ function x({
89
89
  icon: t,
90
90
  label: r,
91
91
  visible: n,
92
- onClick: a
92
+ onClick: s
93
93
  }) {
94
94
  return /* @__PURE__ */ o(
95
95
  "button",
@@ -99,7 +99,7 @@ function x({
99
99
  "aria-hidden": !n,
100
100
  tabIndex: -1,
101
101
  disabled: !n,
102
- onClick: a,
102
+ onClick: s,
103
103
  className: f.arrow({ visible: n, side: e }),
104
104
  children: /* @__PURE__ */ o(t, { size: 20 })
105
105
  }
@@ -110,12 +110,12 @@ function D({
110
110
  tabLayout: t,
111
111
  className: r,
112
112
  selectedIndex: n,
113
- children: a,
113
+ children: s,
114
114
  ...d
115
115
  }) {
116
- const l = v(null), { canScrollLeft: c, canScrollRight: s, scrollBy: u } = j(l);
116
+ const l = v(null), { canScrollLeft: c, canScrollRight: a, scrollBy: u } = j(l);
117
117
  z(l, n);
118
- const i = c || s ? B(c, s) : void 0;
118
+ const i = c || a ? B(c, a) : void 0;
119
119
  return /* @__PURE__ */ b(
120
120
  "div",
121
121
  {
@@ -131,7 +131,7 @@ function D({
131
131
  ref: l,
132
132
  className: "scrollbar-none overflow-x-auto",
133
133
  style: i ? { maskImage: i, WebkitMaskImage: i } : void 0,
134
- children: a
134
+ children: s
135
135
  }
136
136
  ),
137
137
  /* @__PURE__ */ o(
@@ -150,7 +150,7 @@ function D({
150
150
  side: "right",
151
151
  icon: L,
152
152
  label: "Scroll right",
153
- visible: s,
153
+ visible: a,
154
154
  onClick: () => u("right")
155
155
  }
156
156
  )
@@ -182,15 +182,15 @@ function P({
182
182
  selectedIndex: r,
183
183
  children: n
184
184
  }) {
185
- const a = v(null), { pill: d, isReady: l } = I({
186
- ref: a,
185
+ const s = v(null), { pill: d, isReady: l } = I({
186
+ ref: s,
187
187
  selectedIndex: r,
188
188
  children: n
189
189
  });
190
190
  return /* @__PURE__ */ b(
191
191
  "div",
192
192
  {
193
- ref: a,
193
+ ref: s,
194
194
  role: "radiogroup",
195
195
  "aria-disabled": t,
196
196
  className: f.root({ tabLayout: e }),
@@ -213,17 +213,17 @@ function $({
213
213
  children: t,
214
214
  icon: r,
215
215
  trailingContent: n,
216
- onClick: a,
216
+ onClick: s,
217
217
  className: d,
218
218
  disabled: l,
219
219
  ...c
220
220
  }) {
221
221
  const {
222
- selectedValue: s,
222
+ selectedValue: a,
223
223
  onSelectedChange: u,
224
224
  disabled: i,
225
225
  tabLayout: S
226
- } = k(), g = s === e, p = w(() => !!(l || i), [l, i]);
226
+ } = k(), g = a === e, p = w(() => !!(l || i), [l, i]);
227
227
  return /* @__PURE__ */ o(
228
228
  "button",
229
229
  {
@@ -233,7 +233,7 @@ function $({
233
233
  "aria-disabled": p,
234
234
  disabled: p,
235
235
  onClick: (C) => {
236
- p || (u(e), a?.(C));
236
+ p || (u(e), s?.(C));
237
237
  },
238
238
  className: h(
239
239
  f.item({ selected: g, disabled: p }),
@@ -254,14 +254,14 @@ function E({
254
254
  onSelectedChange: t,
255
255
  children: r,
256
256
  className: n,
257
- disabled: a,
257
+ disabled: s,
258
258
  appearance: d = "background",
259
259
  tabLayout: l = "fixed",
260
260
  ...c
261
261
  }) {
262
- const s = y({
262
+ const a = y({
263
263
  consumerName: "SegmentedControl",
264
- mergeWith: { disabled: a }
264
+ mergeWith: { disabled: s }
265
265
  }), u = R(
266
266
  e,
267
267
  r
@@ -272,7 +272,7 @@ function E({
272
272
  value: {
273
273
  selectedValue: e,
274
274
  onSelectedChange: (i) => t(i),
275
- disabled: s,
275
+ disabled: a,
276
276
  tabLayout: l
277
277
  },
278
278
  children: /* @__PURE__ */ o(
@@ -287,7 +287,7 @@ function E({
287
287
  P,
288
288
  {
289
289
  tabLayout: l,
290
- disabled: s,
290
+ disabled: a,
291
291
  selectedIndex: u,
292
292
  children: r
293
293
  }
@@ -36,8 +36,8 @@ function re({
36
36
  defaultSearchValue: m,
37
37
  onSearchValueChange: b,
38
38
  open: y,
39
- defaultOpen: v,
40
- onOpenChange: C,
39
+ defaultOpen: C,
40
+ onOpenChange: v,
41
41
  name: N,
42
42
  required: w,
43
43
  children: I
@@ -45,7 +45,7 @@ function re({
45
45
  const V = G({
46
46
  consumerName: "Select",
47
47
  mergeWith: { disabled: r }
48
- }), [h, T] = W(
48
+ }), [h, L] = W(
49
49
  {
50
50
  prop: o,
51
51
  defaultProp: a ?? null,
@@ -54,7 +54,7 @@ function re({
54
54
  }
55
55
  }
56
56
  ), {
57
- isGrouped: L,
57
+ isGrouped: T,
58
58
  groupedItems: R,
59
59
  filteredItemsForRoot: q,
60
60
  resolvedSearchValue: P,
@@ -79,18 +79,18 @@ function re({
79
79
  inputValue: P,
80
80
  onInputValueChange: D,
81
81
  value: h,
82
- onValueChange: (d) => T(f(d)),
82
+ onValueChange: (d) => L(f(d)),
83
83
  isItemEqualToValue: (d, E) => f(d) === f(E),
84
84
  open: y,
85
- defaultOpen: v,
86
- onOpenChange: C,
85
+ defaultOpen: C,
86
+ onOpenChange: v,
87
87
  name: N,
88
88
  required: w,
89
89
  disabled: V,
90
90
  children: /* @__PURE__ */ t(
91
91
  M,
92
92
  {
93
- value: { selectedValue: h, registerSearch: z, isGrouped: L, searchMounted: j },
93
+ value: { selectedValue: h, registerSearch: z, isGrouped: T, searchMounted: j },
94
94
  children: I
95
95
  }
96
96
  )
@@ -1,5 +1,5 @@
1
- import { jsx as e, jsxs as x, Fragment as P } from "react/jsx-runtime";
2
- import { createSafeContext as R, cn as m, useDisabledContext as q } from "../../../../libs/utils-shared/dist/index.js";
1
+ import { jsx as e, jsxs as x, Fragment as R } from "react/jsx-runtime";
2
+ import { createSafeContext as V, cn as m, useDisabledContext as q } from "../../../../libs/utils-shared/dist/index.js";
3
3
  import { cva as C } from "class-variance-authority";
4
4
  import { useCallback as S } from "react";
5
5
  import { Tooltip as N, TooltipTrigger as T, TooltipContent as w } from "../Tooltip/Tooltip.js";
@@ -7,7 +7,7 @@ import { useCommonTranslation as A } from "../../../../i18n/useCommonTranslation
7
7
  import { useControllableState as B } from "../../../../utils/useControllableState/useControllableState.js";
8
8
  import { ExpandRight as z } from "../../symbols/icons/ExpandRight.js";
9
9
  import { ExpandLeft as E } from "../../symbols/icons/ExpandLeft.js";
10
- const [O, y] = R("SideBar"), f = {
10
+ const [O, L] = V("SideBar"), f = {
11
11
  root: C(
12
12
  [
13
13
  "flex h-full flex-col justify-between gap-16 overflow-y-auto rounded-xl bg-surface-transparent p-16",
@@ -128,43 +128,43 @@ const [O, y] = R("SideBar"), f = {
128
128
  const c = q({
129
129
  consumerName: "SideBarItem",
130
130
  mergeWith: { disabled: i }
131
- }), { collapsed: b, active: g, onActiveChange: v } = y({
131
+ }), { collapsed: b, active: g, onActiveChange: v } = L({
132
132
  consumerName: "SideBarItem",
133
133
  contextRequired: !0
134
- }), u = g === t, h = u ? a : r, I = s ?? o, L = S(
135
- (k) => {
136
- c || (l?.(k), v?.(t));
134
+ }), u = g === t, h = u ? a : r, y = s ?? o, I = S(
135
+ (P) => {
136
+ c || (l?.(P), v?.(t));
137
137
  },
138
138
  [c, l, v, t]
139
- ), V = /* @__PURE__ */ x(P, { children: [
139
+ ), j = /* @__PURE__ */ x(R, { children: [
140
140
  /* @__PURE__ */ e(h, { size: 20 }),
141
141
  o != null && /* @__PURE__ */ e("span", { className: "translate-x-8 truncate", children: o })
142
- ] }), j = /* @__PURE__ */ e(
142
+ ] }), k = /* @__PURE__ */ e(
143
143
  "button",
144
144
  {
145
145
  ref: n,
146
146
  type: "button",
147
147
  disabled: c,
148
- onClick: L,
148
+ onClick: I,
149
149
  className: m(
150
150
  f.item({ active: u, disabled: c }),
151
151
  d
152
152
  ),
153
153
  "aria-current": u ? "page" : void 0,
154
154
  ...p,
155
- children: V
155
+ children: j
156
156
  }
157
157
  );
158
158
  return /* @__PURE__ */ x(N, { open: b ? void 0 : !1, children: [
159
- /* @__PURE__ */ e(T, { asChild: !0, children: j }),
160
- /* @__PURE__ */ e(w, { side: "right", sideOffset: 8, children: I })
159
+ /* @__PURE__ */ e(T, { asChild: !0, children: k }),
160
+ /* @__PURE__ */ e(w, { side: "right", sideOffset: 8, children: y })
161
161
  ] });
162
162
  }, H = ({
163
163
  className: n,
164
164
  tooltipContent: t,
165
165
  ...r
166
166
  }) => {
167
- const { t: a } = A(), { collapsed: o, setCollapsed: s } = y({
167
+ const { t: a } = A(), { collapsed: o, setCollapsed: s } = L({
168
168
  consumerName: "SideBarCollapseToggle",
169
169
  contextRequired: !0
170
170
  }), i = S(() => {
@@ -3,15 +3,15 @@ import { cn as s } from "../../../../libs/utils-shared/dist/index.js";
3
3
  import { useCommonTranslation as a } from "../../../../i18n/useCommonTranslation.js";
4
4
  const c = ({
5
5
  ref: r,
6
- className: t,
6
+ className: e,
7
7
  size: n = 16,
8
- ...e
8
+ ...t
9
9
  }) => {
10
10
  const { t: i } = a();
11
11
  return /* @__PURE__ */ o(
12
12
  "svg",
13
13
  {
14
- className: s("shrink-0 animate-spin text-base", t),
14
+ className: s("shrink-0 animate-spin text-base", e),
15
15
  xmlns: "http://www.w3.org/2000/svg",
16
16
  width: n,
17
17
  height: n,
@@ -20,7 +20,7 @@ const c = ({
20
20
  "aria-label": i("components.spinner.loadingAriaLabel"),
21
21
  role: "img",
22
22
  ref: r,
23
- ...e,
23
+ ...t,
24
24
  children: /* @__PURE__ */ o(
25
25
  "path",
26
26
  {
@@ -1,8 +1,8 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { useDisabledContext as x, cn as w } from "../../../../libs/utils-shared/dist/index.js";
3
3
  import { cva as y } from "class-variance-authority";
4
- import { useMemo as P } from "react";
5
- import { Spinner as C } from "../Spinner/Spinner.js";
4
+ import { useMemo as C } from "react";
5
+ import { Spinner as P } from "../Spinner/Spinner.js";
6
6
  import { InformationFill as F } from "../../symbols/icons/InformationFill.js";
7
7
  import { WarningFill as k } from "../../symbols/icons/WarningFill.js";
8
8
  import { DeleteCircleFill as N } from "../../symbols/icons/DeleteCircleFill.js";
@@ -34,7 +34,7 @@ const I = y(
34
34
  }
35
35
  }
36
36
  }
37
- ), G = (t) => {
37
+ ), E = (t) => {
38
38
  const s = t.size ?? 48, i = {
39
39
  32: 12,
40
40
  40: 16,
@@ -47,7 +47,7 @@ const I = y(
47
47
  48: "heading-5",
48
48
  56: "heading-4",
49
49
  72: "heading-2"
50
- }, o = i[s] ?? 20, a = c[s] ?? "heading-5", { componentProps: m, content: l } = P(() => {
50
+ }, o = i[s] ?? 20, a = c[s] ?? "heading-5", { componentProps: m, content: p } = C(() => {
51
51
  if (t.appearance === "icon") {
52
52
  const { icon: n, ...r } = t;
53
53
  return {
@@ -75,12 +75,12 @@ const I = y(
75
75
  case "info":
76
76
  return /* @__PURE__ */ e(F, { size: o });
77
77
  case "loader":
78
- return /* @__PURE__ */ e(C, { size: o });
78
+ return /* @__PURE__ */ e(P, { size: o });
79
79
  }
80
80
  })();
81
81
  return { componentProps: t, content: z };
82
82
  }, [t, o, a]), {
83
- appearance: p,
83
+ appearance: l,
84
84
  className: d,
85
85
  disabled: u = !1,
86
86
  size: h = 48,
@@ -97,16 +97,16 @@ const I = y(
97
97
  className: w(
98
98
  I({
99
99
  disabled: g,
100
- appearance: p,
100
+ appearance: l,
101
101
  size: h
102
102
  }),
103
103
  d
104
104
  ),
105
105
  ...f,
106
- children: l
106
+ children: p
107
107
  }
108
108
  );
109
109
  };
110
110
  export {
111
- G as Spot
111
+ E as Spot
112
112
  };
@@ -1,13 +1,14 @@
1
1
  import { StepperProps } from './types';
2
2
  /**
3
3
  * A circular stepper component showing progress as current step out of total steps.
4
- * Renders a track arc with a progress arc and a center label.
4
+ * Renders a segmented track with progress and a center label.
5
5
  *
6
6
  * @see Figma – Stepper](https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7/2.-Components-Library?node-id=11977-94&m=dev)
7
7
  *
8
8
  * @example
9
9
  * <Stepper currentStep={1} totalSteps={4} />
10
- * <Stepper currentStep={0} totalSteps={9} disabled /> // Shows minimal dot, disabled style
10
+ * <Stepper currentStep={0} totalSteps={8} disabled /> // Empty progress, disabled style
11
+ * <Stepper currentStep={2} totalSteps={4} size="lg" />
11
12
  */
12
- export declare const Stepper: ({ className, currentStep, totalSteps, disabled: disabledProp, label, ref, ...props }: StepperProps) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const Stepper: ({ className, appearance, size, currentStep, totalSteps, disabled: disabledProp, label, ref, ...props }: StepperProps) => import("react/jsx-runtime").JSX.Element;
13
14
  //# sourceMappingURL=Stepper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/core/Stepper/Stepper.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAK5C;;;;;;;;;GASG;AACH,eAAO,MAAM,OAAO,GAAI,sFAQrB,YAAY,4CAyFd,CAAC"}
1
+ {"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/core/Stepper/Stepper.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AA2B5C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,OAAO,GAAI,wGAUrB,YAAY,4CAkId,CAAC"}
@@ -1,107 +1,179 @@
1
- import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
- import { useDisabledContext as v, cn as d, getStepperCalculations as D } from "../../../../libs/utils-shared/dist/index.js";
3
- const s = 48, i = 4, W = ({
4
- className: m,
5
- currentStep: t,
6
- totalSteps: r,
7
- disabled: h = !1,
8
- label: o,
9
- ref: u,
10
- ...f
1
+ import { jsxs as i, jsx as s } from "react/jsx-runtime";
2
+ import { useDisabledContext as w, cn as o, getStepperCalculations as $ } from "../../../../libs/utils-shared/dist/index.js";
3
+ import { cva as j } from "class-variance-authority";
4
+ import { useId as z } from "react";
5
+ const L = {
6
+ md: { px: 48, strokeWidth: 4, root: "size-48", label: "body-2" },
7
+ lg: { px: 72, strokeWidth: 6, root: "size-72", label: "heading-4" }
8
+ }, I = j("transition-[stroke] duration-300 ease-in-out", {
9
+ variants: {
10
+ appearance: { accent: "", success: "" },
11
+ disabled: { true: "", false: "" }
12
+ },
13
+ compoundVariants: [
14
+ {
15
+ appearance: "accent",
16
+ disabled: !1,
17
+ class: "stroke-active"
18
+ },
19
+ {
20
+ appearance: "success",
21
+ disabled: !1,
22
+ class: "stroke-success"
23
+ },
24
+ { disabled: !0, class: "stroke-muted-subtle-hover" }
25
+ ]
26
+ }), S = ({
27
+ className: f,
28
+ appearance: x = "accent",
29
+ size: b = "md",
30
+ currentStep: l,
31
+ totalSteps: a,
32
+ disabled: y = !1,
33
+ label: n,
34
+ ref: g,
35
+ ...v
11
36
  }) => {
12
- const k = v({
37
+ const r = w({
13
38
  consumerName: "Stepper",
14
- mergeWith: { disabled: h }
15
- }), {
16
- displayLabel: p,
17
- r: l,
18
- cx: n,
19
- cy: c,
20
- trackDashArray: b,
21
- progressDashArray: x,
22
- progressDashOffset: y
23
- } = D({
24
- currentStep: t,
25
- totalSteps: r,
26
- size: s,
27
- label: o,
28
- strokeWidth: i
39
+ mergeWith: { disabled: y }
40
+ }), u = z(), {
41
+ px: e,
42
+ strokeWidth: t,
43
+ root: N,
44
+ label: c
45
+ } = L[b], {
46
+ displayLabel: D,
47
+ r: d,
48
+ cx: m,
49
+ cy: h,
50
+ progressDashArray: p,
51
+ progressMaskDashArray: C,
52
+ progressDashOffset: W,
53
+ dashPatternOffset: k
54
+ } = $({
55
+ currentStep: l,
56
+ totalSteps: a,
57
+ size: e,
58
+ label: n,
59
+ strokeWidth: t
29
60
  });
30
- return /* @__PURE__ */ a(
61
+ return /* @__PURE__ */ i(
31
62
  "div",
32
63
  {
33
- ref: u,
64
+ ref: g,
34
65
  role: "progressbar",
35
- "aria-valuenow": t,
66
+ "aria-valuenow": l,
36
67
  "aria-valuemin": 1,
37
- "aria-valuemax": r,
38
- "aria-label": p,
39
- className: d(
40
- "relative flex size-48 shrink-0 items-center justify-center rounded-full",
41
- m
68
+ "aria-valuemax": a,
69
+ "aria-label": D,
70
+ className: o(
71
+ "relative flex shrink-0 items-center justify-center rounded-full",
72
+ N,
73
+ f
42
74
  ),
43
- ...f,
75
+ ...v,
44
76
  children: [
45
- /* @__PURE__ */ a(
77
+ /* @__PURE__ */ i(
46
78
  "svg",
47
79
  {
48
- width: s,
49
- height: s,
50
- viewBox: `0 0 ${s} ${s}`,
51
- className: "rotate-135",
80
+ width: e,
81
+ height: e,
82
+ viewBox: `0 0 ${e} ${e}`,
83
+ className: "-rotate-90",
52
84
  "aria-hidden": !0,
53
85
  children: [
54
- /* @__PURE__ */ e(
86
+ /* @__PURE__ */ s(
55
87
  "circle",
56
88
  {
57
- cx: n,
58
- cy: c,
59
- r: l,
89
+ cx: m,
90
+ cy: h,
91
+ r: d,
60
92
  fill: "none",
61
93
  stroke: "currentColor",
62
94
  strokeLinecap: "round",
63
95
  className: "stroke-muted-subtle",
64
96
  style: {
65
- strokeWidth: `${i}px`,
66
- strokeDasharray: b,
67
- strokeDashoffset: 0
97
+ strokeWidth: `${t}px`,
98
+ strokeDasharray: p,
99
+ strokeDashoffset: k
68
100
  }
69
101
  }
70
102
  ),
71
- /* @__PURE__ */ e(
103
+ /* @__PURE__ */ s(
104
+ "mask",
105
+ {
106
+ id: u,
107
+ maskUnits: "userSpaceOnUse",
108
+ x: 0,
109
+ y: 0,
110
+ width: e,
111
+ height: e,
112
+ children: /* @__PURE__ */ s(
113
+ "circle",
114
+ {
115
+ cx: m,
116
+ cy: h,
117
+ r: d,
118
+ fill: "none",
119
+ stroke: "white",
120
+ className: "transition-[stroke-dashoffset] duration-300 ease-in-out",
121
+ style: {
122
+ strokeWidth: `${t}px`,
123
+ strokeDasharray: C,
124
+ strokeDashoffset: W
125
+ }
126
+ }
127
+ )
128
+ }
129
+ ),
130
+ /* @__PURE__ */ s(
72
131
  "circle",
73
132
  {
74
- cx: n,
75
- cy: c,
76
- r: l,
133
+ cx: m,
134
+ cy: h,
135
+ r: d,
77
136
  fill: "none",
78
137
  stroke: "currentColor",
79
138
  strokeLinecap: "round",
80
- className: d(
81
- k ? "stroke-muted-subtle-hover" : "stroke-active",
82
- "transition-[stroke-dashoffset,stroke] duration-300 ease-in-out"
83
- ),
139
+ mask: `url(#${u})`,
140
+ className: I({ appearance: x, disabled: r }),
84
141
  style: {
85
- strokeWidth: `${i}px`,
86
- strokeDasharray: x,
87
- strokeDashoffset: y
142
+ strokeWidth: `${t}px`,
143
+ strokeDasharray: p,
144
+ strokeDashoffset: k
88
145
  }
89
146
  }
90
147
  )
91
148
  ]
92
149
  }
93
150
  ),
94
- /* @__PURE__ */ e("span", { className: "absolute inset-0 m-4 flex items-center justify-center text-base", children: o ? /* @__PURE__ */ e("span", { className: "body-2-semi-bold", children: o }) : /* @__PURE__ */ a("span", { children: [
95
- /* @__PURE__ */ e("span", { className: "body-1-semi-bold", children: Math.min(Math.max(t, 0), r) }),
96
- /* @__PURE__ */ a("span", { className: "body-2-semi-bold text-muted", children: [
97
- "/",
98
- r
99
- ] })
151
+ /* @__PURE__ */ s("span", { className: "absolute inset-0 m-4 flex min-w-0 items-center justify-center text-base", children: n ? /* @__PURE__ */ s(
152
+ "span",
153
+ {
154
+ className: o(c, "truncate", r && "text-disabled"),
155
+ children: n
156
+ }
157
+ ) : /* @__PURE__ */ i("span", { className: "truncate", children: [
158
+ /* @__PURE__ */ s("span", { className: o(c, r && "text-disabled"), children: Math.min(Math.max(l, 0), a) }),
159
+ /* @__PURE__ */ i(
160
+ "span",
161
+ {
162
+ className: o(
163
+ c,
164
+ r ? "text-disabled" : "text-muted"
165
+ ),
166
+ children: [
167
+ "/",
168
+ a
169
+ ]
170
+ }
171
+ )
100
172
  ] }) })
101
173
  ]
102
174
  }
103
175
  );
104
176
  };
105
177
  export {
106
- W as Stepper
178
+ S as Stepper
107
179
  };