@ledgerhq/lumen-ui-react 0.1.40 → 0.1.42
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/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/MediaButton/MediaButton.d.ts.map +1 -1
- package/dist/lib/Components/MediaButton/MediaButton.js +92 -38
- package/dist/lib/Components/Trend/Trend.d.ts.map +1 -1
- package/dist/lib/Components/Trend/Trend.js +51 -34
- package/dist/package.json +2 -2
- package/package.json +1 -1
|
@@ -36,7 +36,7 @@ const k = {
|
|
|
36
36
|
closeAriaLabel: f,
|
|
37
37
|
...p
|
|
38
38
|
}) => {
|
|
39
|
-
const { t:
|
|
39
|
+
const { t: x } = g(), d = k[s];
|
|
40
40
|
return /* @__PURE__ */ e(
|
|
41
41
|
"div",
|
|
42
42
|
{
|
|
@@ -44,13 +44,13 @@ const k = {
|
|
|
44
44
|
className: c(F.root({ appearance: s }), t),
|
|
45
45
|
...p,
|
|
46
46
|
children: [
|
|
47
|
-
/* @__PURE__ */ r("div", { className: "flex shrink-0 items-start py-4", children:
|
|
47
|
+
/* @__PURE__ */ r("div", { className: "flex shrink-0 items-start py-4", children: d }),
|
|
48
48
|
/* @__PURE__ */ e("div", { className: "mr-8 flex flex-1 flex-col gap-8 py-4", children: [
|
|
49
49
|
/* @__PURE__ */ e("div", { className: "flex flex-col gap-4", children: [
|
|
50
50
|
a && /* @__PURE__ */ r("h3", { className: "line-clamp-2 body-1-semi-bold", children: a }),
|
|
51
51
|
o && /* @__PURE__ */ r("div", { className: c("line-clamp-5 body-2", !a && "mt-2"), children: o })
|
|
52
52
|
] }),
|
|
53
|
-
(l || n) && /* @__PURE__ */ e("div", { className: "flex gap-4", children: [
|
|
53
|
+
(l || n) && /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-4", children: [
|
|
54
54
|
l,
|
|
55
55
|
n
|
|
56
56
|
] })
|
|
@@ -62,7 +62,7 @@ const k = {
|
|
|
62
62
|
size: "xs",
|
|
63
63
|
icon: h,
|
|
64
64
|
onClick: () => i(),
|
|
65
|
-
"aria-label": f ||
|
|
65
|
+
"aria-label": f || x("components.banner.closeAriaLabel")
|
|
66
66
|
}
|
|
67
67
|
)
|
|
68
68
|
]
|
|
@@ -8,11 +8,11 @@ export type BannerProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
8
8
|
/**
|
|
9
9
|
* The main title of the banner.
|
|
10
10
|
*/
|
|
11
|
-
title?:
|
|
11
|
+
title?: ReactNode;
|
|
12
12
|
/**
|
|
13
13
|
* Optional descriptive text.
|
|
14
14
|
*/
|
|
15
|
-
description?:
|
|
15
|
+
description?: ReactNode;
|
|
16
16
|
/**
|
|
17
17
|
* Optional primary action.
|
|
18
18
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Banner/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9E,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACzD;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IACtD;;OAEG;IACH,KAAK,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Banner/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9E,MAAM,MAAM,WAAW,GAAG,cAAc,CAAC,cAAc,CAAC,GAAG;IACzD;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IACtD;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B;;OAEG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MediaButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/MediaButton/MediaButton.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"MediaButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/MediaButton/MediaButton.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAiFhD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,WAAW,GAAI,6IAYzB,gBAAgB,4CA6ClB,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useDisabledContext as
|
|
3
|
-
import { Slot as
|
|
4
|
-
import { cva as
|
|
5
|
-
import { baseButtonVariants as
|
|
6
|
-
import { ChevronDown as
|
|
7
|
-
const y =
|
|
1
|
+
import { jsxs as l, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useDisabledContext as C, cn as u } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { Slot as g, Slottable as v } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as S } from "class-variance-authority";
|
|
5
|
+
import { baseButtonVariants as z } from "../Button/BaseButton.js";
|
|
6
|
+
import { ChevronDown as x } from "../../Symbols/Icons/ChevronDown.js";
|
|
7
|
+
const y = S("gap-8 body-2-semi-bold", {
|
|
8
8
|
variants: {
|
|
9
9
|
size: {
|
|
10
10
|
sm: "",
|
|
@@ -14,60 +14,114 @@ const y = C("gap-8 body-2-semi-bold", {
|
|
|
14
14
|
flat: "",
|
|
15
15
|
rounded: "",
|
|
16
16
|
none: ""
|
|
17
|
+
},
|
|
18
|
+
hasChevron: {
|
|
19
|
+
true: "",
|
|
20
|
+
false: ""
|
|
17
21
|
}
|
|
18
22
|
},
|
|
19
23
|
compoundVariants: [
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
{
|
|
25
|
+
size: "md",
|
|
26
|
+
leadingContentShape: ["flat", "none"],
|
|
27
|
+
hasChevron: !0,
|
|
28
|
+
class: "py-14 pr-12 pl-16"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
size: "sm",
|
|
32
|
+
leadingContentShape: ["flat", "none"],
|
|
33
|
+
hasChevron: !0,
|
|
34
|
+
class: "py-10 pr-8 pl-12"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
size: "md",
|
|
38
|
+
leadingContentShape: "rounded",
|
|
39
|
+
hasChevron: !0,
|
|
40
|
+
class: "py-8 pr-12 pl-8"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
size: "sm",
|
|
44
|
+
leadingContentShape: "rounded",
|
|
45
|
+
hasChevron: !0,
|
|
46
|
+
class: "p-8"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
size: "md",
|
|
50
|
+
leadingContentShape: "flat",
|
|
51
|
+
hasChevron: !1,
|
|
52
|
+
class: "px-16 py-12"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
size: "md",
|
|
56
|
+
leadingContentShape: "none",
|
|
57
|
+
hasChevron: !1,
|
|
58
|
+
class: "px-16 py-14"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
size: "sm",
|
|
62
|
+
leadingContentShape: ["flat", "none"],
|
|
63
|
+
hasChevron: !1,
|
|
64
|
+
class: "px-12 py-10"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
size: "md",
|
|
68
|
+
leadingContentShape: "rounded",
|
|
69
|
+
hasChevron: !1,
|
|
70
|
+
class: "py-8 pr-16 pl-8"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
size: "sm",
|
|
74
|
+
leadingContentShape: "rounded",
|
|
75
|
+
hasChevron: !1,
|
|
76
|
+
class: "py-8 pr-10 pl-8"
|
|
77
|
+
}
|
|
26
78
|
],
|
|
27
79
|
defaultVariants: {
|
|
28
80
|
size: "md",
|
|
29
|
-
leadingContentShape: "none"
|
|
81
|
+
leadingContentShape: "none",
|
|
82
|
+
hasChevron: !0
|
|
30
83
|
}
|
|
31
84
|
}), k = ({
|
|
32
|
-
ref:
|
|
33
|
-
className:
|
|
85
|
+
ref: r,
|
|
86
|
+
className: i,
|
|
34
87
|
appearance: p = "gray",
|
|
35
|
-
size:
|
|
36
|
-
disabled:
|
|
88
|
+
size: d = "md",
|
|
89
|
+
disabled: h = !1,
|
|
37
90
|
asChild: n = !1,
|
|
38
91
|
leadingContent: a,
|
|
39
|
-
leadingContentShape:
|
|
40
|
-
hideChevron:
|
|
41
|
-
children:
|
|
42
|
-
...
|
|
92
|
+
leadingContentShape: m = "flat",
|
|
93
|
+
hideChevron: s = !1,
|
|
94
|
+
children: t,
|
|
95
|
+
...c
|
|
43
96
|
}) => {
|
|
44
|
-
const
|
|
97
|
+
const o = C({
|
|
45
98
|
consumerName: "MediaButton",
|
|
46
|
-
mergeWith: { disabled:
|
|
47
|
-
}),
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
-
n ?
|
|
99
|
+
mergeWith: { disabled: h }
|
|
100
|
+
}), f = a ? m : "none";
|
|
101
|
+
return /* @__PURE__ */ l(
|
|
102
|
+
n ? g : "button",
|
|
50
103
|
{
|
|
51
|
-
ref:
|
|
104
|
+
ref: r,
|
|
52
105
|
className: u(
|
|
53
|
-
|
|
106
|
+
z({
|
|
54
107
|
appearance: p,
|
|
55
|
-
disabled:
|
|
108
|
+
disabled: o,
|
|
56
109
|
loading: !1
|
|
57
110
|
}),
|
|
58
111
|
y({
|
|
59
|
-
size:
|
|
60
|
-
leadingContentShape:
|
|
112
|
+
size: d,
|
|
113
|
+
leadingContentShape: f,
|
|
114
|
+
hasChevron: !s
|
|
61
115
|
}),
|
|
62
|
-
|
|
116
|
+
i
|
|
63
117
|
),
|
|
64
|
-
disabled:
|
|
65
|
-
...
|
|
118
|
+
disabled: o,
|
|
119
|
+
...c,
|
|
66
120
|
children: [
|
|
67
121
|
a && /* @__PURE__ */ e("span", { className: "inline-flex shrink-0 items-center", children: a }),
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
n ? /* @__PURE__ */ e(
|
|
70
|
-
!
|
|
122
|
+
/* @__PURE__ */ l("span", { className: "flex items-center gap-2", children: [
|
|
123
|
+
n ? /* @__PURE__ */ e(v, { children: t }) : /* @__PURE__ */ e("span", { className: "line-clamp-1 text-left", children: t }),
|
|
124
|
+
!s && /* @__PURE__ */ e(x, { size: 20 })
|
|
71
125
|
] })
|
|
72
126
|
]
|
|
73
127
|
}
|
|
@@ -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
|
}
|
|
50
67
|
);
|
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.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",
|