@ledgerhq/lumen-ui-react 0.0.82 → 0.0.83
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 +52 -50
- package/dist/lib/Components/Stepper/Stepper.d.ts +17 -0
- package/dist/lib/Components/Stepper/Stepper.d.ts.map +1 -0
- package/dist/lib/Components/Stepper/Stepper.js +100 -0
- package/dist/lib/Components/Stepper/index.d.ts +3 -0
- package/dist/lib/Components/Stepper/index.d.ts.map +1 -0
- package/dist/lib/Components/Stepper/types.d.ts +21 -0
- package/dist/lib/Components/Stepper/types.d.ts.map +1 -0
- package/dist/lib/Components/index.d.ts +1 -0
- package/dist/lib/Components/index.d.ts.map +1 -1
- package/dist/libs/utils-shared/dist/index.js +114 -90
- package/dist/package.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -25,15 +25,16 @@ import { SideBar as we, SideBarCollapseToggle as ke, SideBarItem as He, SideBarL
|
|
|
25
25
|
import { Skeleton as Pe } from "./lib/Components/Skeleton/Skeleton.js";
|
|
26
26
|
import { Spinner as je } from "./lib/Components/Spinner/Spinner.js";
|
|
27
27
|
import { Spot as ze } from "./lib/Components/Spot/Spot.js";
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
28
|
+
import { Stepper as Je } from "./lib/Components/Stepper/Stepper.js";
|
|
29
|
+
import { Subheader as Oe, SubheaderAction as Qe, SubheaderCount as Ue, SubheaderDescription as Ve, SubheaderInfo as We, SubheaderRow as Xe, SubheaderShowMore as Ye, SubheaderTitle as Ze } from "./lib/Components/Subheader/Subheader.js";
|
|
30
|
+
import { Switch as $e } from "./lib/Components/Switch/Switch.js";
|
|
31
|
+
import { Table as oo, TableActionBar as ro, TableActionBarLeading as to, TableActionBarTrailing as ao, TableBody as no, TableCell as io, TableCellContent as lo, TableGroupHeaderRow as po, TableHeader as mo, TableHeaderCell as To, TableHeaderRow as uo, TableInfoIcon as xo, TableLoadingRow as fo, TableRoot as So, TableRow as bo, TableSortButton as go } from "./lib/Components/Table/Table.js";
|
|
32
|
+
import { Tag as Io } from "./lib/Components/Tag/Tag.js";
|
|
33
|
+
import { TextInput as so } from "./lib/Components/TextInput/TextInput.js";
|
|
34
|
+
import { Tile as Lo, TileContent as ho, TileDescription as Mo, TileSecondaryAction as Do, TileSpot as vo, TileTitle as Ao, TileTrailingContent as Ro } from "./lib/Components/Tile/Tile.js";
|
|
35
|
+
import { TileButton as ko } from "./lib/Components/TileButton/TileButton.js";
|
|
36
|
+
import { Tooltip as No, TooltipContent as yo, TooltipProvider as Go, TooltipTrigger as Po } from "./lib/Components/Tooltip/Tooltip.js";
|
|
37
|
+
import { ThemeProvider as jo, useTheme as qo } from "./lib/Components/ThemeProvider/ThemeProvider.js";
|
|
37
38
|
export {
|
|
38
39
|
a as AddressInput,
|
|
39
40
|
p as AmountDisplay,
|
|
@@ -102,45 +103,46 @@ export {
|
|
|
102
103
|
Pe as Skeleton,
|
|
103
104
|
je as Spinner,
|
|
104
105
|
ze as Spot,
|
|
105
|
-
Je as
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
Ze as
|
|
114
|
-
$e as
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
go as
|
|
131
|
-
Io as
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
106
|
+
Je as Stepper,
|
|
107
|
+
Oe as Subheader,
|
|
108
|
+
Qe as SubheaderAction,
|
|
109
|
+
Ue as SubheaderCount,
|
|
110
|
+
Ve as SubheaderDescription,
|
|
111
|
+
We as SubheaderInfo,
|
|
112
|
+
Xe as SubheaderRow,
|
|
113
|
+
Ye as SubheaderShowMore,
|
|
114
|
+
Ze as SubheaderTitle,
|
|
115
|
+
$e as Switch,
|
|
116
|
+
oo as Table,
|
|
117
|
+
ro as TableActionBar,
|
|
118
|
+
to as TableActionBarLeading,
|
|
119
|
+
ao as TableActionBarTrailing,
|
|
120
|
+
no as TableBody,
|
|
121
|
+
io as TableCell,
|
|
122
|
+
lo as TableCellContent,
|
|
123
|
+
po as TableGroupHeaderRow,
|
|
124
|
+
mo as TableHeader,
|
|
125
|
+
To as TableHeaderCell,
|
|
126
|
+
uo as TableHeaderRow,
|
|
127
|
+
xo as TableInfoIcon,
|
|
128
|
+
fo as TableLoadingRow,
|
|
129
|
+
So as TableRoot,
|
|
130
|
+
bo as TableRow,
|
|
131
|
+
go as TableSortButton,
|
|
132
|
+
Io as Tag,
|
|
133
|
+
so as TextInput,
|
|
134
|
+
jo as ThemeProvider,
|
|
135
|
+
Lo as Tile,
|
|
136
|
+
ko as TileButton,
|
|
137
|
+
ho as TileContent,
|
|
138
|
+
Mo as TileDescription,
|
|
139
|
+
Do as TileSecondaryAction,
|
|
140
|
+
vo as TileSpot,
|
|
141
|
+
Ao as TileTitle,
|
|
142
|
+
Ro as TileTrailingContent,
|
|
143
|
+
No as Tooltip,
|
|
144
|
+
yo as TooltipContent,
|
|
145
|
+
Go as TooltipProvider,
|
|
146
|
+
Po as TooltipTrigger,
|
|
147
|
+
qo as useTheme
|
|
146
148
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A circular stepper component showing progress as current step out of total steps.
|
|
3
|
+
* Renders a track arc with a progress arc and a center label.
|
|
4
|
+
*
|
|
5
|
+
* @see Figma – Stepper](https://www.figma.com/design/JxaLVMTWirCpU0rsbZ30k7/2.-Components-Library?node-id=11977-94&m=dev)
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <Stepper currentStep={1} totalSteps={4} />
|
|
9
|
+
* <Stepper currentStep={0} totalSteps={9} disabled /> // Shows minimal dot, disabled style
|
|
10
|
+
*/
|
|
11
|
+
export declare const Stepper: import('react').ForwardRefExoticComponent<{
|
|
12
|
+
currentStep: number;
|
|
13
|
+
totalSteps: number;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
label?: string;
|
|
16
|
+
} & Omit<import('react').HTMLAttributes<HTMLDivElement>, "children"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
17
|
+
//# sourceMappingURL=Stepper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stepper.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Stepper/Stepper.tsx"],"names":[],"mappings":"AAOA;;;;;;;;;GASG;AACH,eAAO,MAAM,OAAO;;;;;qHAyFnB,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { cn as d, getStepperCalculations as b } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { forwardRef as v } from "react";
|
|
4
|
+
const s = 48, i = 4, N = v(
|
|
5
|
+
({ className: m, currentStep: t, totalSteps: r, disabled: h = !1, label: o, ...f }, u) => {
|
|
6
|
+
const {
|
|
7
|
+
displayLabel: p,
|
|
8
|
+
r: n,
|
|
9
|
+
cx: l,
|
|
10
|
+
cy: c,
|
|
11
|
+
trackDashArray: k,
|
|
12
|
+
progressDashArray: y,
|
|
13
|
+
progressDashOffset: x
|
|
14
|
+
} = b({
|
|
15
|
+
currentStep: t,
|
|
16
|
+
totalSteps: r,
|
|
17
|
+
size: s,
|
|
18
|
+
label: o,
|
|
19
|
+
strokeWidth: i
|
|
20
|
+
});
|
|
21
|
+
return /* @__PURE__ */ a(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
ref: u,
|
|
25
|
+
role: "progressbar",
|
|
26
|
+
"aria-valuenow": t,
|
|
27
|
+
"aria-valuemin": 1,
|
|
28
|
+
"aria-valuemax": r,
|
|
29
|
+
"aria-label": p,
|
|
30
|
+
className: d(
|
|
31
|
+
"relative flex size-48 shrink-0 items-center justify-center rounded-full",
|
|
32
|
+
m
|
|
33
|
+
),
|
|
34
|
+
...f,
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ a(
|
|
37
|
+
"svg",
|
|
38
|
+
{
|
|
39
|
+
width: s,
|
|
40
|
+
height: s,
|
|
41
|
+
viewBox: `0 0 ${s} ${s}`,
|
|
42
|
+
className: "rotate-135",
|
|
43
|
+
"aria-hidden": !0,
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ e(
|
|
46
|
+
"circle",
|
|
47
|
+
{
|
|
48
|
+
cx: l,
|
|
49
|
+
cy: c,
|
|
50
|
+
r: n,
|
|
51
|
+
fill: "none",
|
|
52
|
+
stroke: "currentColor",
|
|
53
|
+
strokeLinecap: "round",
|
|
54
|
+
className: "stroke-muted-subtle",
|
|
55
|
+
style: {
|
|
56
|
+
strokeWidth: `${i}px`,
|
|
57
|
+
strokeDasharray: k,
|
|
58
|
+
strokeDashoffset: 0
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
/* @__PURE__ */ e(
|
|
63
|
+
"circle",
|
|
64
|
+
{
|
|
65
|
+
cx: l,
|
|
66
|
+
cy: c,
|
|
67
|
+
r: n,
|
|
68
|
+
fill: "none",
|
|
69
|
+
stroke: "currentColor",
|
|
70
|
+
strokeLinecap: "round",
|
|
71
|
+
className: d(
|
|
72
|
+
h ? "stroke-muted-subtle-hover" : "stroke-active",
|
|
73
|
+
"transition-[stroke-dashoffset,stroke] duration-300 ease-in-out"
|
|
74
|
+
),
|
|
75
|
+
style: {
|
|
76
|
+
strokeWidth: `${i}px`,
|
|
77
|
+
strokeDasharray: y,
|
|
78
|
+
strokeDashoffset: x
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
/* @__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: [
|
|
86
|
+
/* @__PURE__ */ e("span", { className: "body-1-semi-bold", children: Math.min(Math.max(t, 0), r) }),
|
|
87
|
+
/* @__PURE__ */ a("span", { className: "body-2-semi-bold text-muted", children: [
|
|
88
|
+
"/",
|
|
89
|
+
r
|
|
90
|
+
] })
|
|
91
|
+
] }) })
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
N.displayName = "Stepper";
|
|
98
|
+
export {
|
|
99
|
+
N as Stepper
|
|
100
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Stepper/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export type StepperProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Current step number (1-based). Use 0 or negative to show minimal dot (before starting).
|
|
5
|
+
*/
|
|
6
|
+
currentStep: number;
|
|
7
|
+
/**
|
|
8
|
+
* Total number of steps.
|
|
9
|
+
*/
|
|
10
|
+
totalSteps: number;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the stepper is disabled. Changes the progress arc to a muted style.
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Optional custom label. Defaults to "{currentStep}/{totalSteps}".
|
|
18
|
+
*/
|
|
19
|
+
label?: string;
|
|
20
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Stepper/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/Components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/Components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,123 +1,147 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { clsx as
|
|
4
|
-
import { twMerge as
|
|
5
|
-
function
|
|
6
|
-
return l ? l.split(/[-_ ]+/).map((
|
|
1
|
+
import { jsx as P } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as W, useMemo as O, use as j } from "react";
|
|
3
|
+
import { clsx as k } from "clsx";
|
|
4
|
+
import { twMerge as N } from "tailwind-merge";
|
|
5
|
+
function H(l) {
|
|
6
|
+
return l ? l.split(/[-_ ]+/).map((t) => t.charAt(0).toUpperCase() + t.slice(1).toLowerCase()).join("") : "";
|
|
7
7
|
}
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
const
|
|
8
|
+
const q = 48, z = 17, E = 2;
|
|
9
|
+
function J(l) {
|
|
10
|
+
const t = l.replace(/\D/g, "").length;
|
|
11
11
|
return Math.max(
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
z,
|
|
13
|
+
q - t * E
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
|
-
function C(l,
|
|
16
|
+
function C(l, t = !0) {
|
|
17
17
|
if (!l) return "";
|
|
18
|
-
const
|
|
19
|
-
return
|
|
18
|
+
const o = l.includes("."), [m, r] = l.split("."), s = m.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
|
|
19
|
+
return o && t ? r ? `${s}.${r}` : `${s}.` : s;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function K(l, t = {}) {
|
|
22
22
|
const {
|
|
23
|
-
allowDecimals:
|
|
24
|
-
thousandsSeparator:
|
|
25
|
-
maxIntegerLength:
|
|
26
|
-
maxDecimalLength:
|
|
27
|
-
} =
|
|
28
|
-
let e =
|
|
29
|
-
if (e = e.replace(/^0+(?=\d)/, ""), !
|
|
30
|
-
return e = e.replace(/\D/g, ""),
|
|
23
|
+
allowDecimals: o = !0,
|
|
24
|
+
thousandsSeparator: m = !0,
|
|
25
|
+
maxIntegerLength: r = 9,
|
|
26
|
+
maxDecimalLength: s = 9
|
|
27
|
+
} = t, n = l.replace(",", ".").replace(/[^\d.]/g, "");
|
|
28
|
+
let e = n;
|
|
29
|
+
if (e = e.replace(/^0+(?=\d)/, ""), !o)
|
|
30
|
+
return e = e.replace(/\D/g, ""), r > 0 && e.length > r && (e = e.slice(0, r)), m ? C(e) : e;
|
|
31
31
|
e === "." && (e = "0.");
|
|
32
32
|
const c = e.indexOf(".");
|
|
33
33
|
if (c !== -1) {
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
e =
|
|
34
|
+
let a = e.slice(0, c), i = e.slice(c + 1).replace(/\./g, "");
|
|
35
|
+
r > 0 && a.length > r && (a = a.slice(0, r)), i = i.slice(0, s), a === "" && (a = "0");
|
|
36
|
+
const h = n.endsWith(".") || e.endsWith(".");
|
|
37
|
+
e = i.length > 0 ? `${a}.${i}` : h ? `${a}.` : a;
|
|
38
38
|
} else
|
|
39
|
-
|
|
40
|
-
return
|
|
39
|
+
r > 0 && e.length > r && (e = e.slice(0, r));
|
|
40
|
+
return m ? C(e) : e;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
const
|
|
42
|
+
function U(l, t) {
|
|
43
|
+
const o = W(t), m = ({ children: s, value: n }) => {
|
|
44
44
|
const e = O(
|
|
45
|
-
() =>
|
|
46
|
-
Object.values(
|
|
45
|
+
() => n,
|
|
46
|
+
Object.values(n ?? {})
|
|
47
47
|
);
|
|
48
|
-
return /* @__PURE__ */
|
|
48
|
+
return /* @__PURE__ */ P(o, { value: e, children: s });
|
|
49
49
|
};
|
|
50
|
-
|
|
51
|
-
function
|
|
52
|
-
consumerName:
|
|
53
|
-
contextRequired:
|
|
50
|
+
m.displayName = l + "Provider";
|
|
51
|
+
function r({
|
|
52
|
+
consumerName: s,
|
|
53
|
+
contextRequired: n
|
|
54
54
|
}) {
|
|
55
|
-
const e =
|
|
55
|
+
const e = j(o);
|
|
56
56
|
if (e)
|
|
57
57
|
return e;
|
|
58
|
-
if (
|
|
58
|
+
if (n)
|
|
59
59
|
throw new Error(
|
|
60
|
-
`${
|
|
60
|
+
`${s} must be used within ${l}`
|
|
61
61
|
);
|
|
62
|
-
return
|
|
62
|
+
return t || {};
|
|
63
63
|
}
|
|
64
|
-
return [
|
|
64
|
+
return [m, r];
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
return
|
|
66
|
+
function V(...l) {
|
|
67
|
+
return N(k(l));
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
69
|
+
const _ = ({
|
|
70
|
+
currentStep: l,
|
|
71
|
+
totalSteps: t,
|
|
72
|
+
size: o,
|
|
73
|
+
label: m,
|
|
74
|
+
strokeWidth: r = 4,
|
|
75
|
+
arcPercentage: s = 0.75
|
|
76
|
+
}) => {
|
|
77
|
+
const n = Math.min(Math.max(l, 0), t), e = m ?? `${n}/${t}`, c = t <= 0 ? 0 : n / t, a = (o - r) / 2, i = o / 2, h = o / 2, f = 2 * Math.PI * a, g = f * s, D = g * (1 - c), d = n <= 0, M = `${g} ${f}`, T = d ? g - 2 : D;
|
|
78
|
+
return {
|
|
79
|
+
displayLabel: e,
|
|
80
|
+
progress: c,
|
|
81
|
+
r: a,
|
|
82
|
+
cx: i,
|
|
83
|
+
cy: h,
|
|
84
|
+
circumference: f,
|
|
85
|
+
trackArcLength: g,
|
|
86
|
+
trackDashArray: `${g} ${f}`,
|
|
87
|
+
progressDashArray: M,
|
|
88
|
+
progressDashOffset: T,
|
|
89
|
+
showMinimalDot: d
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
function F(l, t, o = {}) {
|
|
93
|
+
const { leading: m = !1, trailing: r = !0, maxWait: s } = o;
|
|
94
|
+
let n = null, e = null, c = null, a = 0, i = null, h = null, f;
|
|
95
|
+
const g = s !== void 0, D = g ? Math.max(s, t) : 0, d = (u) => {
|
|
96
|
+
a = u;
|
|
97
|
+
const p = i, $ = h;
|
|
98
|
+
return i = null, h = null, f = l.apply($, p), f;
|
|
99
|
+
}, M = (u) => {
|
|
100
|
+
const p = c ? u - c : 0;
|
|
101
|
+
return t - p;
|
|
102
|
+
}, T = (u) => {
|
|
103
|
+
const p = c ? u - c : t, $ = u - a;
|
|
104
|
+
return c === null || p >= t || p < 0 || g && $ >= D;
|
|
105
|
+
}, y = (u) => (n = null, r && i ? d(u) : (i = null, h = null, f)), x = () => {
|
|
106
|
+
const u = Date.now();
|
|
107
|
+
if (T(u)) {
|
|
108
|
+
y(u);
|
|
86
109
|
return;
|
|
87
110
|
}
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
const
|
|
91
|
-
e = null,
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
const
|
|
96
|
-
if (
|
|
97
|
-
if (
|
|
98
|
-
return
|
|
99
|
-
if (
|
|
100
|
-
return clearTimeout(
|
|
111
|
+
n = setTimeout(x, M(u));
|
|
112
|
+
}, b = () => {
|
|
113
|
+
const u = Date.now();
|
|
114
|
+
e = null, i && (d(u), n !== null && (clearTimeout(n), n = setTimeout(x, t)));
|
|
115
|
+
}, L = (u) => (a = u, n = setTimeout(x, t), g && (e = setTimeout(b, D)), m ? d(u) : f), S = () => {
|
|
116
|
+
n !== null && clearTimeout(n), e !== null && clearTimeout(e), a = 0, i = null, h = null, c = null, n = null, e = null;
|
|
117
|
+
}, v = () => n === null && e === null ? f : y(Date.now()), A = () => n !== null || e !== null, w = function(...u) {
|
|
118
|
+
const p = Date.now(), $ = T(p);
|
|
119
|
+
if (i = u, h = this, c = p, $) {
|
|
120
|
+
if (n === null)
|
|
121
|
+
return L(p);
|
|
122
|
+
if (g)
|
|
123
|
+
return clearTimeout(n), n = setTimeout(x, t), d(p);
|
|
101
124
|
}
|
|
102
|
-
return
|
|
125
|
+
return n === null && (n = setTimeout(x, t)), f;
|
|
103
126
|
};
|
|
104
|
-
return w.cancel = S, w.flush =
|
|
127
|
+
return w.cancel = S, w.flush = v, w.pending = A, w;
|
|
105
128
|
}
|
|
106
|
-
function
|
|
107
|
-
const { leading:
|
|
108
|
-
return
|
|
109
|
-
leading:
|
|
110
|
-
trailing:
|
|
111
|
-
maxWait:
|
|
129
|
+
function Q(l, t, o = {}) {
|
|
130
|
+
const { leading: m = !0, trailing: r = !0 } = o;
|
|
131
|
+
return F(l, t, {
|
|
132
|
+
leading: m,
|
|
133
|
+
trailing: r,
|
|
134
|
+
maxWait: t
|
|
112
135
|
});
|
|
113
136
|
}
|
|
114
137
|
export {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
138
|
+
V as cn,
|
|
139
|
+
U as createSafeContext,
|
|
140
|
+
F as debounce,
|
|
118
141
|
C as formatThousands,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
142
|
+
J as getFontSize,
|
|
143
|
+
_ as getStepperCalculations,
|
|
144
|
+
K as textFormatter,
|
|
145
|
+
Q as throttle,
|
|
146
|
+
H as toPascalCase
|
|
123
147
|
};
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/lumen-ui-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.82",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"keywords": [
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
]
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@ledgerhq/lumen-utils-shared": "0.0.
|
|
44
|
+
"@ledgerhq/lumen-utils-shared": "0.0.19",
|
|
45
45
|
"i18next": "^23.7.0",
|
|
46
46
|
"react-i18next": "^14.0.0"
|
|
47
47
|
},
|