@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.
- package/dist/index.js +150 -132
- package/dist/lib/Components/core/AmountInput/AmountInput.d.ts +1 -1
- package/dist/lib/Components/core/AmountInput/AmountInput.d.ts.map +1 -1
- package/dist/lib/Components/core/AmountInput/AmountInput.js +53 -51
- package/dist/lib/Components/core/AmountInput/useAmountInputValue/useAmountInputValue.js +3 -3
- package/dist/lib/Components/core/Avatar/resolveAvatarColor.js +2 -2
- package/dist/lib/Components/core/AvatarButton/AvatarButton.js +6 -6
- package/dist/lib/Components/core/Banner/Banner.js +8 -8
- package/dist/lib/Components/core/Button/Button.js +10 -10
- package/dist/lib/Components/core/Card/Card.js +6 -6
- package/dist/lib/Components/core/CardButton/CardButton.d.ts +2 -0
- package/dist/lib/Components/core/CardButton/CardButton.d.ts.map +1 -1
- package/dist/lib/Components/core/CardButton/CardButton.js +4 -4
- package/dist/lib/Components/core/DataTable/DataTable.js +7 -7
- package/dist/lib/Components/core/Divider/Divider.js +8 -8
- package/dist/lib/Components/core/DotCount/DotCount.js +3 -3
- package/dist/lib/Components/core/DotIcon/DotIcon.js +9 -9
- package/dist/lib/Components/core/DotSymbol/DotSymbol.js +16 -16
- package/dist/lib/Components/core/Link/Link.d.ts +1 -1
- package/dist/lib/Components/core/Link/Link.d.ts.map +1 -1
- package/dist/lib/Components/core/Link/Link.js +21 -20
- package/dist/lib/Components/core/Link/types.d.ts +1 -1
- package/dist/lib/Components/core/Link/types.d.ts.map +1 -1
- package/dist/lib/Components/core/ListItem/ListItem.js +4 -4
- package/dist/lib/Components/core/MediaBanner/MediaBanner.js +19 -19
- package/dist/lib/Components/core/MediaButton/MediaButton.js +2 -2
- package/dist/lib/Components/core/Menu/Menu.d.ts +3 -2
- package/dist/lib/Components/core/Menu/Menu.d.ts.map +1 -1
- package/dist/lib/Components/core/Menu/Menu.js +157 -108
- package/dist/lib/Components/core/Menu/types.d.ts +31 -0
- package/dist/lib/Components/core/Menu/types.d.ts.map +1 -1
- package/dist/lib/Components/core/NavBar/CoinCapsule.js +8 -8
- package/dist/lib/Components/core/Pagination/Pagination.js +14 -14
- package/dist/lib/Components/core/Popover/Popover.js +6 -6
- package/dist/lib/Components/core/SearchInput/SearchInput.js +5 -5
- package/dist/lib/Components/core/SegmentedControl/SegmentedControl.js +19 -19
- package/dist/lib/Components/core/Select/Select.js +8 -8
- package/dist/lib/Components/core/SideBar/SideBar.js +14 -14
- package/dist/lib/Components/core/Spinner/Spinner.js +4 -4
- package/dist/lib/Components/core/Spot/Spot.js +9 -9
- package/dist/lib/Components/core/Stepper/Stepper.d.ts +4 -3
- package/dist/lib/Components/core/Stepper/Stepper.d.ts.map +1 -1
- package/dist/lib/Components/core/Stepper/Stepper.js +137 -65
- package/dist/lib/Components/core/Stepper/types.d.ts +12 -2
- package/dist/lib/Components/core/Stepper/types.d.ts.map +1 -1
- package/dist/lib/Components/core/Switch/Switch.js +5 -5
- package/dist/lib/Components/core/Table/Table.js +9 -9
- package/dist/lib/Components/core/TileButton/TileButton.js +8 -8
- package/dist/lib/Components/core/Timeline/Timeline.d.ts +54 -0
- package/dist/lib/Components/core/Timeline/Timeline.d.ts.map +1 -0
- package/dist/lib/Components/core/Timeline/Timeline.js +228 -0
- package/dist/lib/Components/core/Timeline/index.d.ts +3 -0
- package/dist/lib/Components/core/Timeline/index.d.ts.map +1 -0
- package/dist/lib/Components/core/Timeline/types.d.ts +148 -0
- package/dist/lib/Components/core/Timeline/types.d.ts.map +1 -0
- package/dist/lib/Components/core/Toast/Toast.d.ts +25 -0
- package/dist/lib/Components/core/Toast/Toast.d.ts.map +1 -0
- package/dist/lib/Components/core/Toast/Toast.js +68 -0
- package/dist/lib/Components/core/Toast/Toaster.d.ts +27 -0
- package/dist/lib/Components/core/Toast/Toaster.d.ts.map +1 -0
- package/dist/lib/Components/core/Toast/Toaster.js +92 -0
- package/dist/lib/Components/core/Toast/hooks/useToastCollapse.d.ts +15 -0
- package/dist/lib/Components/core/Toast/hooks/useToastCollapse.d.ts.map +1 -0
- package/dist/lib/Components/core/Toast/hooks/useToastCollapse.js +15 -0
- package/dist/lib/Components/core/Toast/hooks/useToastViewportPause.d.ts +24 -0
- package/dist/lib/Components/core/Toast/hooks/useToastViewportPause.d.ts.map +1 -0
- package/dist/lib/Components/core/Toast/hooks/useToastViewportPause.js +27 -0
- package/dist/lib/Components/core/Toast/index.d.ts +5 -0
- package/dist/lib/Components/core/Toast/index.d.ts.map +1 -0
- package/dist/lib/Components/core/Toast/styles.d.ts +20 -0
- package/dist/lib/Components/core/Toast/styles.d.ts.map +1 -0
- package/dist/lib/Components/core/Toast/styles.js +77 -0
- package/dist/lib/Components/core/Toast/types.d.ts +81 -0
- package/dist/lib/Components/core/Toast/types.d.ts.map +1 -0
- package/dist/lib/Components/core/Trend/Trend.js +2 -2
- package/dist/lib/Components/core/index.d.ts +2 -0
- package/dist/lib/Components/core/index.d.ts.map +1 -1
- package/dist/lib/Components/internal/BaseButton/BaseButton.js +2 -2
- package/dist/lib/Components/internal/BaseInput/BaseInput.js +9 -9
- package/dist/lib/Components/internal/BaseInput/BaseInputMultiline.js +12 -12
- package/dist/lib/Components/internal/BaseTag/BaseTag.js +8 -8
- package/dist/lib/Components/symbols/Icon/Icon.js +4 -4
- package/dist/lib/Components/symbols/Icon/createIcon.js +8 -8
- package/dist/lib/Components/visualization/DonutChart/DonutChartCenter.js +6 -6
- package/dist/lib/Components/visualization/DonutChart/donutSizeContext.js +2 -2
- package/dist/lib/Components/visualization/Legend/Legend.js +8 -8
- package/dist/libs/utils-shared/dist/index.js +306 -141
- package/dist/package.json +3 -3
- 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
|
|
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 =
|
|
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 =
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
113
|
+
children: s,
|
|
114
114
|
...d
|
|
115
115
|
}) {
|
|
116
|
-
const l = v(null), { canScrollLeft: c, canScrollRight:
|
|
116
|
+
const l = v(null), { canScrollLeft: c, canScrollRight: a, scrollBy: u } = j(l);
|
|
117
117
|
z(l, n);
|
|
118
|
-
const i = c ||
|
|
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:
|
|
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:
|
|
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
|
|
186
|
-
ref:
|
|
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:
|
|
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:
|
|
216
|
+
onClick: s,
|
|
217
217
|
className: d,
|
|
218
218
|
disabled: l,
|
|
219
219
|
...c
|
|
220
220
|
}) {
|
|
221
221
|
const {
|
|
222
|
-
selectedValue:
|
|
222
|
+
selectedValue: a,
|
|
223
223
|
onSelectedChange: u,
|
|
224
224
|
disabled: i,
|
|
225
225
|
tabLayout: S
|
|
226
|
-
} = k(), g =
|
|
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),
|
|
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:
|
|
257
|
+
disabled: s,
|
|
258
258
|
appearance: d = "background",
|
|
259
259
|
tabLayout: l = "fixed",
|
|
260
260
|
...c
|
|
261
261
|
}) {
|
|
262
|
-
const
|
|
262
|
+
const a = y({
|
|
263
263
|
consumerName: "SegmentedControl",
|
|
264
|
-
mergeWith: { disabled:
|
|
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:
|
|
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:
|
|
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:
|
|
40
|
-
onOpenChange:
|
|
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,
|
|
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:
|
|
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) =>
|
|
82
|
+
onValueChange: (d) => L(f(d)),
|
|
83
83
|
isItemEqualToValue: (d, E) => f(d) === f(E),
|
|
84
84
|
open: y,
|
|
85
|
-
defaultOpen:
|
|
86
|
-
onOpenChange:
|
|
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:
|
|
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
|
|
2
|
-
import { createSafeContext as
|
|
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,
|
|
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 } =
|
|
131
|
+
}), { collapsed: b, active: g, onActiveChange: v } = L({
|
|
132
132
|
consumerName: "SideBarItem",
|
|
133
133
|
contextRequired: !0
|
|
134
|
-
}), u = g === t, h = u ? a : r,
|
|
135
|
-
(
|
|
136
|
-
c || (l?.(
|
|
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
|
-
),
|
|
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
|
-
] }),
|
|
142
|
+
] }), k = /* @__PURE__ */ e(
|
|
143
143
|
"button",
|
|
144
144
|
{
|
|
145
145
|
ref: n,
|
|
146
146
|
type: "button",
|
|
147
147
|
disabled: c,
|
|
148
|
-
onClick:
|
|
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:
|
|
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:
|
|
160
|
-
/* @__PURE__ */ e(w, { side: "right", sideOffset: 8, children:
|
|
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 } =
|
|
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:
|
|
6
|
+
className: e,
|
|
7
7
|
size: n = 16,
|
|
8
|
-
...
|
|
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",
|
|
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
|
-
...
|
|
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
|
|
5
|
-
import { Spinner as
|
|
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
|
-
),
|
|
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:
|
|
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(
|
|
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:
|
|
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:
|
|
100
|
+
appearance: l,
|
|
101
101
|
size: h
|
|
102
102
|
}),
|
|
103
103
|
d
|
|
104
104
|
),
|
|
105
105
|
...f,
|
|
106
|
-
children:
|
|
106
|
+
children: p
|
|
107
107
|
}
|
|
108
108
|
);
|
|
109
109
|
};
|
|
110
110
|
export {
|
|
111
|
-
|
|
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
|
|
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={
|
|
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":"
|
|
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
|
|
2
|
-
import { useDisabledContext as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
|
37
|
+
const r = w({
|
|
13
38
|
consumerName: "Stepper",
|
|
14
|
-
mergeWith: { disabled:
|
|
15
|
-
}), {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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__ */
|
|
61
|
+
return /* @__PURE__ */ i(
|
|
31
62
|
"div",
|
|
32
63
|
{
|
|
33
|
-
ref:
|
|
64
|
+
ref: g,
|
|
34
65
|
role: "progressbar",
|
|
35
|
-
"aria-valuenow":
|
|
66
|
+
"aria-valuenow": l,
|
|
36
67
|
"aria-valuemin": 1,
|
|
37
|
-
"aria-valuemax":
|
|
38
|
-
"aria-label":
|
|
39
|
-
className:
|
|
40
|
-
"relative flex
|
|
41
|
-
|
|
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
|
-
...
|
|
75
|
+
...v,
|
|
44
76
|
children: [
|
|
45
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ i(
|
|
46
78
|
"svg",
|
|
47
79
|
{
|
|
48
|
-
width:
|
|
49
|
-
height:
|
|
50
|
-
viewBox: `0 0 ${
|
|
51
|
-
className: "rotate-
|
|
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__ */
|
|
86
|
+
/* @__PURE__ */ s(
|
|
55
87
|
"circle",
|
|
56
88
|
{
|
|
57
|
-
cx:
|
|
58
|
-
cy:
|
|
59
|
-
r:
|
|
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: `${
|
|
66
|
-
strokeDasharray:
|
|
67
|
-
strokeDashoffset:
|
|
97
|
+
strokeWidth: `${t}px`,
|
|
98
|
+
strokeDasharray: p,
|
|
99
|
+
strokeDashoffset: k
|
|
68
100
|
}
|
|
69
101
|
}
|
|
70
102
|
),
|
|
71
|
-
/* @__PURE__ */
|
|
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:
|
|
75
|
-
cy:
|
|
76
|
-
r:
|
|
133
|
+
cx: m,
|
|
134
|
+
cy: h,
|
|
135
|
+
r: d,
|
|
77
136
|
fill: "none",
|
|
78
137
|
stroke: "currentColor",
|
|
79
138
|
strokeLinecap: "round",
|
|
80
|
-
|
|
81
|
-
|
|
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: `${
|
|
86
|
-
strokeDasharray:
|
|
87
|
-
strokeDashoffset:
|
|
142
|
+
strokeWidth: `${t}px`,
|
|
143
|
+
strokeDasharray: p,
|
|
144
|
+
strokeDashoffset: k
|
|
88
145
|
}
|
|
89
146
|
}
|
|
90
147
|
)
|
|
91
148
|
]
|
|
92
149
|
}
|
|
93
150
|
),
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"
|
|
98
|
-
|
|
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
|
-
|
|
178
|
+
S as Stepper
|
|
107
179
|
};
|