@ledgerhq/lumen-ui-react 0.1.39 → 0.1.41
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/i18n/locales/de.json.d.ts +15 -0
- package/dist/i18n/locales/de.json.js +1 -1
- package/dist/i18n/locales/en.json.d.ts +11 -0
- package/dist/i18n/locales/en.json.js +2 -2
- package/dist/i18n/locales/es.json.d.ts +15 -0
- package/dist/i18n/locales/es.json.js +1 -1
- package/dist/i18n/locales/fr.json.d.ts +11 -0
- package/dist/i18n/locales/fr.json.js +1 -1
- package/dist/i18n/locales/ja.json.d.ts +15 -0
- package/dist/i18n/locales/ja.json.js +2 -2
- package/dist/i18n/locales/ko.json.d.ts +15 -0
- package/dist/i18n/locales/ko.json.js +2 -2
- package/dist/i18n/locales/pt.json.d.ts +15 -0
- package/dist/i18n/locales/pt.json.js +1 -1
- package/dist/i18n/locales/ru.json.d.ts +15 -0
- package/dist/i18n/locales/ru.json.js +2 -2
- package/dist/i18n/locales/th.json.d.ts +15 -0
- package/dist/i18n/locales/th.json.js +2 -2
- package/dist/i18n/locales/tr.json.d.ts +15 -0
- package/dist/i18n/locales/tr.json.js +2 -2
- package/dist/i18n/locales/zh.json.d.ts +15 -0
- package/dist/i18n/locales/zh.json.js +2 -2
- package/dist/index.js +90 -88
- package/dist/lib/Components/AmountInput/AmountInput.d.ts.map +1 -1
- package/dist/lib/Components/AmountInput/AmountInput.js +64 -103
- package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.d.ts +21 -0
- package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.d.ts.map +1 -0
- package/dist/lib/Components/AmountInput/useAmountInputValue/useAmountInputValue.js +28 -0
- package/dist/lib/Components/AmountInput/useAutoWidthInput/useAutoWidthInput.d.ts +13 -0
- package/dist/lib/Components/AmountInput/useAutoWidthInput/useAutoWidthInput.d.ts.map +1 -0
- package/dist/lib/Components/AmountInput/useAutoWidthInput/useAutoWidthInput.js +29 -0
- package/dist/lib/Components/Banner/Banner.js +4 -4
- package/dist/lib/Components/Banner/types.d.ts +2 -2
- package/dist/lib/Components/Banner/types.d.ts.map +1 -1
- package/dist/lib/Components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/lib/Components/IconButton/IconButton.js +17 -16
- package/dist/lib/Components/Pagination/Pagination.d.ts +13 -0
- package/dist/lib/Components/Pagination/Pagination.d.ts.map +1 -0
- package/dist/lib/Components/Pagination/Pagination.js +93 -0
- package/dist/lib/Components/Pagination/getPaginationRange.d.ts +6 -0
- package/dist/lib/Components/Pagination/getPaginationRange.d.ts.map +1 -0
- package/dist/lib/Components/Pagination/getPaginationRange.js +25 -0
- package/dist/lib/Components/Pagination/index.d.ts +3 -0
- package/dist/lib/Components/Pagination/index.d.ts.map +1 -0
- package/dist/lib/Components/Pagination/types.d.ts +26 -0
- package/dist/lib/Components/Pagination/types.d.ts.map +1 -0
- package/dist/lib/Components/Table/Table.js +37 -37
- package/dist/lib/Components/Trend/Trend.d.ts.map +1 -1
- package/dist/lib/Components/Trend/Trend.js +51 -34
- package/dist/lib/Components/index.d.ts +1 -0
- package/dist/lib/Components/index.d.ts.map +1 -1
- package/dist/package.json +2 -2
- package/package.json +2 -2
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { jsx as o, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { cn as f } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { Tooltip as h, TooltipTrigger as u, TooltipContent as d } from "../Tooltip/Tooltip.js";
|
|
4
|
+
import { BaseButton as T } from "../Button/BaseButton.js";
|
|
5
|
+
const b = ({
|
|
5
6
|
ref: n,
|
|
6
7
|
className: e,
|
|
7
8
|
icon: i,
|
|
8
|
-
tooltip:
|
|
9
|
-
tooltipPlacement:
|
|
10
|
-
tooltipText:
|
|
11
|
-
onTooltipOpenChange:
|
|
9
|
+
tooltip: s = !1,
|
|
10
|
+
tooltipPlacement: l = "top",
|
|
11
|
+
tooltipText: a,
|
|
12
|
+
onTooltipOpenChange: p,
|
|
12
13
|
"aria-label": t,
|
|
13
|
-
...
|
|
14
|
+
...m
|
|
14
15
|
}) => {
|
|
15
16
|
const r = /* @__PURE__ */ o(
|
|
16
|
-
|
|
17
|
+
T,
|
|
17
18
|
{
|
|
18
19
|
ref: n,
|
|
19
20
|
icon: i,
|
|
20
|
-
className: e,
|
|
21
|
+
className: f("shrink-0", e),
|
|
21
22
|
"aria-label": t,
|
|
22
|
-
...
|
|
23
|
+
...m
|
|
23
24
|
}
|
|
24
25
|
);
|
|
25
|
-
return
|
|
26
|
-
/* @__PURE__ */ o(
|
|
27
|
-
/* @__PURE__ */ o(
|
|
26
|
+
return s ? /* @__PURE__ */ c(h, { onOpenChange: p, children: [
|
|
27
|
+
/* @__PURE__ */ o(u, { asChild: !0, children: r }),
|
|
28
|
+
/* @__PURE__ */ o(d, { side: l, children: a || t })
|
|
28
29
|
] }) : r;
|
|
29
30
|
};
|
|
30
31
|
export {
|
|
31
|
-
|
|
32
|
+
b as IconButton
|
|
32
33
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PaginationProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Pagination navigation for tables and other paginated content.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* <Pagination
|
|
7
|
+
* page={page}
|
|
8
|
+
* totalPages={10}
|
|
9
|
+
* onPageChange={setPage}
|
|
10
|
+
* />
|
|
11
|
+
*/
|
|
12
|
+
export declare const Pagination: ({ page, totalPages, onPageChange, siblingCount, className, ref, ...props }: PaginationProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
//# sourceMappingURL=Pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Pagination/Pagination.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,GAAI,4EAQxB,eAAe,mDA0EjB,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { jsxs as g, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { cn as x } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { getPaginationRange as h } from "./getPaginationRange.js";
|
|
4
|
+
import { useCommonTranslation as v } from "../../../i18n/useCommonTranslation.js";
|
|
5
|
+
import { IconButton as s } from "../IconButton/IconButton.js";
|
|
6
|
+
import { ChevronLeft as y } from "../../Symbols/Icons/ChevronLeft.js";
|
|
7
|
+
import { Button as k } from "../Button/Button.js";
|
|
8
|
+
import { ChevronRight as A } from "../../Symbols/Icons/ChevronRight.js";
|
|
9
|
+
const R = ({
|
|
10
|
+
page: p,
|
|
11
|
+
totalPages: e,
|
|
12
|
+
onPageChange: r,
|
|
13
|
+
siblingCount: c = 1,
|
|
14
|
+
className: l,
|
|
15
|
+
ref: m,
|
|
16
|
+
...u
|
|
17
|
+
}) => {
|
|
18
|
+
const { t: i } = v();
|
|
19
|
+
if (e <= 0)
|
|
20
|
+
return null;
|
|
21
|
+
const a = Math.min(Math.max(p, 1), e), b = Math.max(c, 0), d = h(
|
|
22
|
+
a,
|
|
23
|
+
e,
|
|
24
|
+
b
|
|
25
|
+
);
|
|
26
|
+
return /* @__PURE__ */ g(
|
|
27
|
+
"nav",
|
|
28
|
+
{
|
|
29
|
+
ref: m,
|
|
30
|
+
"aria-label": i("components.pagination.navigationAriaLabel"),
|
|
31
|
+
className: x("flex items-center gap-8 overflow-x-auto p-4", l),
|
|
32
|
+
...u,
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ o(
|
|
35
|
+
s,
|
|
36
|
+
{
|
|
37
|
+
type: "button",
|
|
38
|
+
icon: y,
|
|
39
|
+
size: "sm",
|
|
40
|
+
appearance: "gray",
|
|
41
|
+
disabled: a <= 1,
|
|
42
|
+
"aria-label": i("components.pagination.previousPageAriaLabel"),
|
|
43
|
+
onClick: () => r(a - 1)
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
d.map((n, f) => {
|
|
47
|
+
if (n === "ellipsis")
|
|
48
|
+
return /* @__PURE__ */ o(
|
|
49
|
+
"span",
|
|
50
|
+
{
|
|
51
|
+
"aria-hidden": !0,
|
|
52
|
+
className: "inline-flex w-40 items-center justify-center body-2 text-muted",
|
|
53
|
+
children: "…"
|
|
54
|
+
},
|
|
55
|
+
`ellipsis-${f}`
|
|
56
|
+
);
|
|
57
|
+
const t = n === a;
|
|
58
|
+
return /* @__PURE__ */ o(
|
|
59
|
+
k,
|
|
60
|
+
{
|
|
61
|
+
type: "button",
|
|
62
|
+
size: "sm",
|
|
63
|
+
appearance: t ? "gray" : "no-background",
|
|
64
|
+
className: "shrink-0",
|
|
65
|
+
"aria-label": i("components.pagination.pageAriaLabel", {
|
|
66
|
+
page: n
|
|
67
|
+
}),
|
|
68
|
+
"aria-current": t ? "page" : void 0,
|
|
69
|
+
onClick: () => r(n),
|
|
70
|
+
children: n
|
|
71
|
+
},
|
|
72
|
+
n
|
|
73
|
+
);
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ o(
|
|
76
|
+
s,
|
|
77
|
+
{
|
|
78
|
+
type: "button",
|
|
79
|
+
icon: A,
|
|
80
|
+
size: "sm",
|
|
81
|
+
appearance: "gray",
|
|
82
|
+
disabled: a >= e,
|
|
83
|
+
"aria-label": i("components.pagination.nextPageAriaLabel"),
|
|
84
|
+
onClick: () => r(a + 1)
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
export {
|
|
92
|
+
R as Pagination
|
|
93
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type PaginationRangeItem = number | 'ellipsis';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the list of page numbers and ellipsis markers to display.
|
|
4
|
+
*/
|
|
5
|
+
export declare const getPaginationRange: (page: number, totalPages: number, siblingCount?: number) => PaginationRangeItem[];
|
|
6
|
+
//# sourceMappingURL=getPaginationRange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPaginationRange.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Pagination/getPaginationRange.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,UAAU,CAAC;AAkBtD;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,MAAM,MAAM,EACZ,YAAY,MAAM,EAClB,qBAAgB,KACf,mBAAmB,EA4CrB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const _ = (S, n) => Array.from({ length: n - S + 1 }, (e, E) => S + E), t = (S) => S * 2 + 5, R = (S) => 3 + S * 2, A = (S, n, e = 1) => {
|
|
2
|
+
if (n < 1)
|
|
3
|
+
return [];
|
|
4
|
+
if (n === 1)
|
|
5
|
+
return [1];
|
|
6
|
+
if (t(e) >= n)
|
|
7
|
+
return _(1, n);
|
|
8
|
+
const E = Math.max(S - e, 1), i = Math.min(S + e, n), r = E > 2, s = i < n - 1;
|
|
9
|
+
if (!r && s)
|
|
10
|
+
return [..._(
|
|
11
|
+
1,
|
|
12
|
+
R(e)
|
|
13
|
+
), "ellipsis", n];
|
|
14
|
+
if (r && !s) {
|
|
15
|
+
const I = R(e);
|
|
16
|
+
return [1, "ellipsis", ..._(
|
|
17
|
+
n - I + 1,
|
|
18
|
+
n
|
|
19
|
+
)];
|
|
20
|
+
}
|
|
21
|
+
return r && s ? [1, "ellipsis", ..._(E, i), "ellipsis", n] : _(1, n);
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
A as getPaginationRange
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Pagination/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from 'react';
|
|
2
|
+
export type PaginationProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Current page, 1-indexed.
|
|
5
|
+
*/
|
|
6
|
+
page: number;
|
|
7
|
+
/**
|
|
8
|
+
* Total number of pages.
|
|
9
|
+
* If `<= 0`, the component returns `null`.
|
|
10
|
+
*/
|
|
11
|
+
totalPages: number;
|
|
12
|
+
/**
|
|
13
|
+
* Callback fired when the user selects a different page.
|
|
14
|
+
*/
|
|
15
|
+
onPageChange: (page: number) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Number of page buttons shown on each side of the current page.
|
|
18
|
+
* @default 1
|
|
19
|
+
*/
|
|
20
|
+
siblingCount?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Custom classname for the root nav element.
|
|
23
|
+
*/
|
|
24
|
+
className?: string;
|
|
25
|
+
} & Omit<ComponentPropsWithRef<'nav'>, 'children'>;
|
|
26
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Pagination/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAEnD,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
1
|
+
import { jsx as r, jsxs as m } from "react/jsx-runtime";
|
|
2
2
|
import { createSafeContext as N, cn as c } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
-
import { cva as
|
|
3
|
+
import { cva as s } from "class-variance-authority";
|
|
4
4
|
import { useThrottledScrollBottom as y } from "./utils/useThrottledScrollBottom.js";
|
|
5
5
|
import { Spot as T } from "../Spot/Spot.js";
|
|
6
6
|
import { Information as w } from "../../Symbols/Icons/Information.js";
|
|
@@ -9,7 +9,7 @@ import { ChevronUpDown as R } from "../../Symbols/Icons/ChevronUpDown.js";
|
|
|
9
9
|
import { ChevronDescending as j } from "../../Symbols/Icons/ChevronDescending.js";
|
|
10
10
|
import { ChevronAscending as B } from "../../Symbols/Icons/ChevronAscending.js";
|
|
11
11
|
import { InteractiveIcon as k } from "../InteractiveIcon/InteractiveIcon.js";
|
|
12
|
-
const [H,
|
|
12
|
+
const [H, u] = N("Table"), I = s(
|
|
13
13
|
"relative scrollbar-none w-full max-w-full border-collapse overflow-x-auto rounded-lg",
|
|
14
14
|
{
|
|
15
15
|
variants: {
|
|
@@ -25,7 +25,7 @@ const [H, m] = N("Table"), I = o(
|
|
|
25
25
|
className: t,
|
|
26
26
|
onScrollBottom: n,
|
|
27
27
|
loading: l,
|
|
28
|
-
ref:
|
|
28
|
+
ref: o,
|
|
29
29
|
...i
|
|
30
30
|
}) => {
|
|
31
31
|
const d = y({
|
|
@@ -36,7 +36,7 @@ const [H, m] = N("Table"), I = o(
|
|
|
36
36
|
"div",
|
|
37
37
|
{
|
|
38
38
|
...i,
|
|
39
|
-
ref:
|
|
39
|
+
ref: o,
|
|
40
40
|
className: I({ appearance: e, className: t }),
|
|
41
41
|
onScroll: d,
|
|
42
42
|
children: a
|
|
@@ -66,7 +66,7 @@ const [H, m] = N("Table"), I = o(
|
|
|
66
66
|
clickable: t = !1,
|
|
67
67
|
onClick: n,
|
|
68
68
|
ref: l,
|
|
69
|
-
...
|
|
69
|
+
...o
|
|
70
70
|
}) => /* @__PURE__ */ r(
|
|
71
71
|
"tr",
|
|
72
72
|
{
|
|
@@ -77,10 +77,10 @@ const [H, m] = N("Table"), I = o(
|
|
|
77
77
|
t && "cursor-pointer outline-none select-none hover:bg-base-transparent-hover active:bg-base-transparent-pressed",
|
|
78
78
|
e
|
|
79
79
|
),
|
|
80
|
-
...
|
|
80
|
+
...o,
|
|
81
81
|
children: a
|
|
82
82
|
}
|
|
83
|
-
), S =
|
|
83
|
+
), S = s("", {
|
|
84
84
|
variants: {
|
|
85
85
|
appearance: {
|
|
86
86
|
"no-background": "bg-canvas",
|
|
@@ -98,7 +98,7 @@ const [H, m] = N("Table"), I = o(
|
|
|
98
98
|
ref: n,
|
|
99
99
|
...l
|
|
100
100
|
}) => {
|
|
101
|
-
const { appearance:
|
|
101
|
+
const { appearance: o } = u({
|
|
102
102
|
consumerName: "TableHeaderRow",
|
|
103
103
|
contextRequired: !0
|
|
104
104
|
});
|
|
@@ -106,7 +106,7 @@ const [H, m] = N("Table"), I = o(
|
|
|
106
106
|
"tr",
|
|
107
107
|
{
|
|
108
108
|
ref: n,
|
|
109
|
-
className: S({ appearance:
|
|
109
|
+
className: S({ appearance: o, stickyHeader: t, className: e }),
|
|
110
110
|
...l,
|
|
111
111
|
children: a
|
|
112
112
|
}
|
|
@@ -118,7 +118,7 @@ const [H, m] = N("Table"), I = o(
|
|
|
118
118
|
ref: n,
|
|
119
119
|
...l
|
|
120
120
|
}) => {
|
|
121
|
-
const { appearance:
|
|
121
|
+
const { appearance: o } = u({
|
|
122
122
|
consumerName: "TableGroupHeaderRow",
|
|
123
123
|
contextRequired: !0
|
|
124
124
|
});
|
|
@@ -127,13 +127,13 @@ const [H, m] = N("Table"), I = o(
|
|
|
127
127
|
{
|
|
128
128
|
className: c(
|
|
129
129
|
"flex h-32 w-full items-center bg-muted px-12 body-3 text-base",
|
|
130
|
-
|
|
130
|
+
o === "no-background" && "rounded-sm"
|
|
131
131
|
),
|
|
132
132
|
children: a
|
|
133
133
|
}
|
|
134
134
|
) }) });
|
|
135
135
|
}, p = {
|
|
136
|
-
root:
|
|
136
|
+
root: s(
|
|
137
137
|
"h-64 truncate p-12 body-3 text-base first:rounded-l-md last:rounded-r-md",
|
|
138
138
|
{
|
|
139
139
|
variants: {
|
|
@@ -147,7 +147,7 @@ const [H, m] = N("Table"), I = o(
|
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
),
|
|
150
|
-
inner:
|
|
150
|
+
inner: s("flex flex-1 justify-end", {
|
|
151
151
|
variants: {
|
|
152
152
|
align: {
|
|
153
153
|
start: "text-start justify-start",
|
|
@@ -161,16 +161,16 @@ const [H, m] = N("Table"), I = o(
|
|
|
161
161
|
hideBelow: t,
|
|
162
162
|
align: n = "start",
|
|
163
163
|
ref: l,
|
|
164
|
-
...
|
|
164
|
+
...o
|
|
165
165
|
}) => /* @__PURE__ */ r(
|
|
166
166
|
"td",
|
|
167
167
|
{
|
|
168
168
|
ref: l,
|
|
169
169
|
className: p.root({ hideBelow: t, className: e }),
|
|
170
|
-
...
|
|
170
|
+
...o,
|
|
171
171
|
children: /* @__PURE__ */ r("div", { className: p.inner({ align: n }), children: a })
|
|
172
172
|
}
|
|
173
|
-
), A =
|
|
173
|
+
), A = s("flex min-w-0 items-center gap-12", {
|
|
174
174
|
variants: {
|
|
175
175
|
align: {
|
|
176
176
|
start: "text-start",
|
|
@@ -183,24 +183,24 @@ const [H, m] = N("Table"), I = o(
|
|
|
183
183
|
leadingContent: t,
|
|
184
184
|
title: n,
|
|
185
185
|
description: l,
|
|
186
|
-
ref:
|
|
186
|
+
ref: o,
|
|
187
187
|
...i
|
|
188
|
-
}) => /* @__PURE__ */
|
|
188
|
+
}) => /* @__PURE__ */ m(
|
|
189
189
|
"div",
|
|
190
190
|
{
|
|
191
|
-
ref:
|
|
191
|
+
ref: o,
|
|
192
192
|
className: A({ align: e, className: a }),
|
|
193
193
|
...i,
|
|
194
194
|
children: [
|
|
195
195
|
t && /* @__PURE__ */ r("div", { className: "shrink-0", children: t }),
|
|
196
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ m("div", { className: "flex min-w-0 flex-col gap-4", children: [
|
|
197
197
|
/* @__PURE__ */ r("div", { className: "shrink-0 body-2 text-base", children: n }),
|
|
198
198
|
/* @__PURE__ */ r("div", { className: "truncate body-3 text-muted", children: l })
|
|
199
199
|
] })
|
|
200
200
|
]
|
|
201
201
|
}
|
|
202
202
|
), f = {
|
|
203
|
-
root:
|
|
203
|
+
root: s("group h-40 truncate p-12 body-3 text-base", {
|
|
204
204
|
variants: {
|
|
205
205
|
hideBelow: {
|
|
206
206
|
xs: "hidden xs:table-cell",
|
|
@@ -211,7 +211,7 @@ const [H, m] = N("Table"), I = o(
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
}),
|
|
214
|
-
content:
|
|
214
|
+
content: s("flex min-w-0 items-center gap-4 truncate", {
|
|
215
215
|
variants: {
|
|
216
216
|
align: {
|
|
217
217
|
start: "text-start justify-start",
|
|
@@ -219,7 +219,7 @@ const [H, m] = N("Table"), I = o(
|
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
}),
|
|
222
|
-
trailingContent:
|
|
222
|
+
trailingContent: s(
|
|
223
223
|
"flex items-center justify-center opacity-0 group-hover:opacity-100"
|
|
224
224
|
)
|
|
225
225
|
}, ee = ({
|
|
@@ -228,7 +228,7 @@ const [H, m] = N("Table"), I = o(
|
|
|
228
228
|
scope: t = "col",
|
|
229
229
|
hideBelow: n,
|
|
230
230
|
align: l = "start",
|
|
231
|
-
trailingContent:
|
|
231
|
+
trailingContent: o,
|
|
232
232
|
ref: i,
|
|
233
233
|
...d
|
|
234
234
|
}) => /* @__PURE__ */ r(
|
|
@@ -238,9 +238,9 @@ const [H, m] = N("Table"), I = o(
|
|
|
238
238
|
scope: t,
|
|
239
239
|
className: f.root({ hideBelow: n, className: e }),
|
|
240
240
|
...d,
|
|
241
|
-
children: /* @__PURE__ */ r("div", { className: "min-w-0", children: /* @__PURE__ */
|
|
241
|
+
children: /* @__PURE__ */ r("div", { className: "min-w-0", children: /* @__PURE__ */ m("div", { className: f.content({ align: l }), children: [
|
|
242
242
|
/* @__PURE__ */ r("span", { className: c("truncate", l === "end" && "order-1"), children: a }),
|
|
243
|
-
/* @__PURE__ */ r("div", { className: "flex items-center justify-center opacity-0 group-hover:opacity-100", children:
|
|
243
|
+
/* @__PURE__ */ r("div", { className: "flex items-center justify-center opacity-0 group-hover:opacity-100", children: o })
|
|
244
244
|
] }) })
|
|
245
245
|
}
|
|
246
246
|
), te = ({
|
|
@@ -287,7 +287,7 @@ const [H, m] = N("Table"), I = o(
|
|
|
287
287
|
ref: e,
|
|
288
288
|
...t
|
|
289
289
|
}) => {
|
|
290
|
-
const { loading: n } =
|
|
290
|
+
const { loading: n } = u({
|
|
291
291
|
consumerName: "TableLoadingRow",
|
|
292
292
|
contextRequired: !0
|
|
293
293
|
});
|
|
@@ -322,7 +322,7 @@ const [H, m] = N("Table"), I = o(
|
|
|
322
322
|
desc: j,
|
|
323
323
|
idle: R
|
|
324
324
|
}, h = {
|
|
325
|
-
root:
|
|
325
|
+
root: s(
|
|
326
326
|
[
|
|
327
327
|
"flex min-w-0 cursor-pointer items-center gap-4",
|
|
328
328
|
"rounded-xs focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus"
|
|
@@ -336,7 +336,7 @@ const [H, m] = N("Table"), I = o(
|
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
338
|
),
|
|
339
|
-
icon:
|
|
339
|
+
icon: s("", {
|
|
340
340
|
variants: {
|
|
341
341
|
active: {
|
|
342
342
|
true: "opacity-100",
|
|
@@ -344,21 +344,21 @@ const [H, m] = N("Table"), I = o(
|
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
346
|
})
|
|
347
|
-
},
|
|
347
|
+
}, oe = ({
|
|
348
348
|
children: a,
|
|
349
349
|
sortDirection: e,
|
|
350
350
|
align: t = "start",
|
|
351
351
|
onToggleSort: n,
|
|
352
352
|
className: l,
|
|
353
|
-
onClick:
|
|
353
|
+
onClick: o,
|
|
354
354
|
ref: i,
|
|
355
355
|
...d
|
|
356
356
|
}) => {
|
|
357
357
|
const { t: b } = C(), v = L[e || "idle"], x = {
|
|
358
|
-
asc: b("table.ascAriaLabel"),
|
|
359
|
-
desc: b("table.descAriaLabel")
|
|
358
|
+
asc: b("components.table.ascAriaLabel"),
|
|
359
|
+
desc: b("components.table.descAriaLabel")
|
|
360
360
|
};
|
|
361
|
-
return /* @__PURE__ */
|
|
361
|
+
return /* @__PURE__ */ m(
|
|
362
362
|
"button",
|
|
363
363
|
{
|
|
364
364
|
...d,
|
|
@@ -367,7 +367,7 @@ const [H, m] = N("Table"), I = o(
|
|
|
367
367
|
className: h.root({ align: t, className: l }),
|
|
368
368
|
"aria-label": e ? x[e] : void 0,
|
|
369
369
|
onClick: (g) => {
|
|
370
|
-
|
|
370
|
+
o?.(g), n?.(e === "asc" ? "desc" : "asc");
|
|
371
371
|
},
|
|
372
372
|
children: [
|
|
373
373
|
/* @__PURE__ */ r("span", { className: "min-w-0 truncate", children: a }),
|
|
@@ -400,5 +400,5 @@ export {
|
|
|
400
400
|
re as TableLoadingRow,
|
|
401
401
|
O as TableRoot,
|
|
402
402
|
Y as TableRow,
|
|
403
|
-
|
|
403
|
+
oe as TableSortButton
|
|
404
404
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Trend.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Trend/Trend.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Trend.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Trend/Trend.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AA+C1C,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,IAAW,EACX,QAAQ,EAAE,YAAoB,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,UAAU,2CAyBZ"}
|
|
@@ -1,50 +1,67 @@
|
|
|
1
|
-
import { jsxs as c, jsx as
|
|
2
|
-
import { useDisabledContext as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { jsxs as c, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useDisabledContext as f, cn as p } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { cva as b } from "class-variance-authority";
|
|
4
|
+
import { useCommonTranslation as v } from "../../../i18n/useCommonTranslation.js";
|
|
5
5
|
import { TriangleDown as g } from "../../Symbols/Icons/TriangleDown.js";
|
|
6
|
-
import { TriangleUp as
|
|
7
|
-
function
|
|
8
|
-
return
|
|
6
|
+
import { TriangleUp as x } from "../../Symbols/Icons/TriangleUp.js";
|
|
7
|
+
function V(e) {
|
|
8
|
+
return e === 0 ? "neutral" : e > 0 ? "positive" : "negative";
|
|
9
9
|
}
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
const T = b("inline-flex items-center", {
|
|
11
|
+
variants: {
|
|
12
|
+
size: {
|
|
13
|
+
md: "body-2 gap-2",
|
|
14
|
+
sm: "body-3 gap-2"
|
|
15
|
+
},
|
|
16
|
+
variant: {
|
|
17
|
+
positive: "",
|
|
18
|
+
negative: "",
|
|
19
|
+
neutral: ""
|
|
20
|
+
},
|
|
21
|
+
disabled: {
|
|
22
|
+
true: "text-disabled",
|
|
23
|
+
false: ""
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
compoundVariants: [
|
|
27
|
+
{ variant: "positive", disabled: !1, class: "text-success" },
|
|
28
|
+
{ variant: "negative", disabled: !1, class: "text-error" },
|
|
29
|
+
{ variant: "neutral", disabled: !1, class: "text-muted" }
|
|
30
|
+
],
|
|
31
|
+
defaultVariants: {
|
|
32
|
+
size: "md",
|
|
33
|
+
disabled: !1
|
|
34
|
+
}
|
|
35
|
+
}), h = {
|
|
18
36
|
md: 16,
|
|
19
37
|
sm: 12
|
|
38
|
+
}, z = {
|
|
39
|
+
positive: x,
|
|
40
|
+
negative: g,
|
|
41
|
+
neutral: null
|
|
20
42
|
};
|
|
21
43
|
function M({
|
|
22
|
-
value:
|
|
23
|
-
size:
|
|
24
|
-
disabled:
|
|
25
|
-
className:
|
|
26
|
-
...
|
|
44
|
+
value: e,
|
|
45
|
+
size: s = "md",
|
|
46
|
+
disabled: r = !1,
|
|
47
|
+
className: o,
|
|
48
|
+
...l
|
|
27
49
|
}) {
|
|
28
|
-
const
|
|
50
|
+
const t = V(e), n = f({
|
|
29
51
|
consumerName: "Trend",
|
|
30
|
-
mergeWith: { disabled:
|
|
31
|
-
}), { t:
|
|
52
|
+
mergeWith: { disabled: r }
|
|
53
|
+
}), { t: d } = v(), i = z[t], a = `${Math.abs(e).toFixed(2)}%`, m = e < 0 ? `-${a}` : a;
|
|
32
54
|
return /* @__PURE__ */ c(
|
|
33
55
|
"span",
|
|
34
56
|
{
|
|
35
|
-
"aria-label":
|
|
36
|
-
value:
|
|
57
|
+
"aria-label": d(`components.trend.${t}AriaLabel`, {
|
|
58
|
+
value: a
|
|
37
59
|
}),
|
|
38
|
-
className:
|
|
39
|
-
|
|
40
|
-
h[o],
|
|
41
|
-
r ? "text-disabled" : C[e],
|
|
42
|
-
a
|
|
43
|
-
),
|
|
44
|
-
...i,
|
|
60
|
+
className: p(T({ size: s, variant: t, disabled: n }), o),
|
|
61
|
+
...l,
|
|
45
62
|
children: [
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
|
|
63
|
+
i && /* @__PURE__ */ u(i, { size: h[s], disabled: n }),
|
|
64
|
+
m
|
|
48
65
|
]
|
|
49
66
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1B,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,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC"}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/lumen-ui-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.40",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"keywords": [
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
55
55
|
"class-variance-authority": "^0.7.1",
|
|
56
56
|
"@tanstack/react-table": "^8.21.3",
|
|
57
|
-
"@ledgerhq/lumen-design-core": "0.1.
|
|
57
|
+
"@ledgerhq/lumen-design-core": "0.1.17",
|
|
58
58
|
"clsx": "^2.1.1",
|
|
59
59
|
"react": "^18.0.0 || ^19.0.0",
|
|
60
60
|
"react-dom": "^18.0.0 || ^19.0.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/lumen-ui-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.41",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"keywords": [
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
55
55
|
"class-variance-authority": "^0.7.1",
|
|
56
56
|
"@tanstack/react-table": "^8.21.3",
|
|
57
|
-
"@ledgerhq/lumen-design-core": "0.1.
|
|
57
|
+
"@ledgerhq/lumen-design-core": "0.1.17",
|
|
58
58
|
"clsx": "^2.1.1",
|
|
59
59
|
"react": "^18.0.0 || ^19.0.0",
|
|
60
60
|
"react-dom": "^18.0.0 || ^19.0.0",
|