@ledgerhq/lumen-ui-react 0.0.66 → 0.0.67
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/AmountInput/AmountInput.js +10 -10
- package/dist/lib/Components/BaseInput/BaseInput.js +4 -4
- package/dist/lib/Components/Button/BaseButton.d.ts.map +1 -1
- package/dist/lib/Components/Button/BaseButton.js +37 -42
- package/dist/lib/Components/Dialog/Dialog.js +2 -2
- package/dist/lib/Components/InteractiveIcon/InteractiveIcon.d.ts.map +1 -1
- package/dist/lib/Components/InteractiveIcon/InteractiveIcon.js +15 -10
- package/dist/lib/Components/Link/Link.js +5 -5
- package/dist/lib/Components/Menu/Menu.d.ts.map +1 -1
- package/dist/lib/Components/Menu/Menu.js +81 -77
- package/dist/lib/Components/Select/Select.js +7 -7
- package/dist/lib/Components/Spot/Spot.js +4 -4
- package/dist/lib/Components/ThemeProvider/ThemeProvider.js +2 -2
- package/dist/lib/Components/Tile/Tile.d.ts +4 -4
- package/dist/lib/Components/Tile/Tile.d.ts.map +1 -1
- package/dist/lib/Components/Tile/Tile.js +104 -171
- package/dist/lib/Components/Tile/types.d.ts +6 -1
- package/dist/lib/Components/Tile/types.d.ts.map +1 -1
- package/dist/libs/utils-shared/dist/index.js +44 -52
- package/dist/package.json +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { getFontSize as V, cn as a, textFormatter as
|
|
1
|
+
import { jsxs as I, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { getFontSize as V, cn as a, textFormatter as F } from "../../../libs/utils-shared/dist/index.js";
|
|
3
3
|
import { cva as z } from "class-variance-authority";
|
|
4
4
|
import M, { useRef as p, useState as h, useMemo as _, useLayoutEffect as q, useEffect as D } from "react";
|
|
5
5
|
const L = z(
|
|
@@ -42,8 +42,8 @@ const L = z(
|
|
|
42
42
|
onChange: C,
|
|
43
43
|
...N
|
|
44
44
|
}, A) => {
|
|
45
|
-
const c = p(null), s = p(null), [n, f] = h(u.toString()), [
|
|
46
|
-
function
|
|
45
|
+
const c = p(null), s = p(null), [n, f] = h(u.toString()), [E, m] = h(!1), g = p(n);
|
|
46
|
+
function j(...t) {
|
|
47
47
|
return (e) => {
|
|
48
48
|
t.forEach((o) => {
|
|
49
49
|
o && (typeof o == "function" ? o(e) : o.current = e);
|
|
@@ -62,8 +62,8 @@ const L = z(
|
|
|
62
62
|
}, [n]), D(() => {
|
|
63
63
|
f(u.toString());
|
|
64
64
|
}, [u]);
|
|
65
|
-
const
|
|
66
|
-
const e =
|
|
65
|
+
const k = (t) => {
|
|
66
|
+
const e = F(t.target.value, {
|
|
67
67
|
allowDecimals: y,
|
|
68
68
|
thousandsSeparator: R,
|
|
69
69
|
maxIntegerLength: S,
|
|
@@ -71,7 +71,7 @@ const L = z(
|
|
|
71
71
|
});
|
|
72
72
|
f(e), C({ ...t, target: { ...t.target, value: e } }), e !== g.current && m(!0), g.current = e;
|
|
73
73
|
};
|
|
74
|
-
return /* @__PURE__ */
|
|
74
|
+
return /* @__PURE__ */ I(
|
|
75
75
|
"div",
|
|
76
76
|
{
|
|
77
77
|
className: "group relative flex items-center justify-center transition-transform",
|
|
@@ -103,14 +103,14 @@ const L = z(
|
|
|
103
103
|
/* @__PURE__ */ l(
|
|
104
104
|
"input",
|
|
105
105
|
{
|
|
106
|
-
ref:
|
|
106
|
+
ref: j(A, s),
|
|
107
107
|
type: "text",
|
|
108
108
|
inputMode: "decimal",
|
|
109
109
|
disabled: w,
|
|
110
110
|
value: n,
|
|
111
|
-
onChange:
|
|
111
|
+
onChange: k,
|
|
112
112
|
onAnimationEnd: () => m(!1),
|
|
113
|
-
className: a(L({ isChanging:
|
|
113
|
+
className: a(L({ isChanging: E }), x),
|
|
114
114
|
...N,
|
|
115
115
|
style: { fontSize: i, letterSpacing: "normal" }
|
|
116
116
|
}
|
|
@@ -30,11 +30,11 @@ const q = a(
|
|
|
30
30
|
inputClassName: S,
|
|
31
31
|
labelClassName: k,
|
|
32
32
|
label: u,
|
|
33
|
-
id:
|
|
33
|
+
id: j,
|
|
34
34
|
disabled: f,
|
|
35
35
|
errorMessage: i,
|
|
36
36
|
suffix: E,
|
|
37
|
-
prefix:
|
|
37
|
+
prefix: z,
|
|
38
38
|
onClear: p,
|
|
39
39
|
hideClearButton: B = !1,
|
|
40
40
|
"aria-invalid": m,
|
|
@@ -42,7 +42,7 @@ const q = a(
|
|
|
42
42
|
...o
|
|
43
43
|
}, C) => {
|
|
44
44
|
var x;
|
|
45
|
-
const { t: D } = _(), r = l.useRef(null), F = l.useId(), b =
|
|
45
|
+
const { t: D } = _(), r = l.useRef(null), F = l.useId(), b = j || `input-${F}`, L = m || (i ? !0 : void 0), c = o.value !== void 0, [T, v] = l.useState(
|
|
46
46
|
((x = o.defaultValue) == null ? void 0 : x.toString()) || ""
|
|
47
47
|
), V = l.useCallback(
|
|
48
48
|
(t) => {
|
|
@@ -86,7 +86,7 @@ const q = a(
|
|
|
86
86
|
});
|
|
87
87
|
},
|
|
88
88
|
children: [
|
|
89
|
-
|
|
89
|
+
z,
|
|
90
90
|
/* @__PURE__ */ n(
|
|
91
91
|
"input",
|
|
92
92
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Button/BaseButton.tsx"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"BaseButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Button/BaseButton.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAyDzC,eAAO,MAAM,UAAU;;;;;;;;;YA3CP,CAAC;iBAAqB,CAAC;;;2FAyGtC,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsxs as x, jsx as
|
|
1
|
+
import { jsxs as x, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { cn as h } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
-
import { Slot as
|
|
3
|
+
import { Slot as y, Slottable as z } from "@radix-ui/react-slot";
|
|
4
4
|
import { cva as l } from "class-variance-authority";
|
|
5
|
-
import
|
|
5
|
+
import B from "react";
|
|
6
6
|
import { Spinner as N } from "../Spinner/Spinner.js";
|
|
7
|
-
const
|
|
8
|
-
'inline-flex size-fit
|
|
7
|
+
const S = l(
|
|
8
|
+
'inline-flex size-fit items-center justify-center rounded-full body-1-semi-bold transition-colors duration-200 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus data-[disabled="true"]:bg-disabled data-[disabled="true"]:text-disabled',
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
appearance: {
|
|
@@ -16,6 +16,10 @@ const j = l(
|
|
|
16
16
|
"no-background": "bg-transparent text-base hover:bg-base-transparent-hover active:bg-base-transparent-pressed disabled:bg-base-transparent",
|
|
17
17
|
red: "bg-error text-error hover:bg-error-hover active:bg-error-pressed"
|
|
18
18
|
},
|
|
19
|
+
disabled: {
|
|
20
|
+
true: "cursor-default",
|
|
21
|
+
false: "cursor-pointer"
|
|
22
|
+
},
|
|
19
23
|
size: {
|
|
20
24
|
xs: "p-8",
|
|
21
25
|
sm: "p-10",
|
|
@@ -32,7 +36,7 @@ const j = l(
|
|
|
32
36
|
isFull: !1
|
|
33
37
|
}
|
|
34
38
|
}
|
|
35
|
-
),
|
|
39
|
+
), d = l("shrink-0", {
|
|
36
40
|
variants: {
|
|
37
41
|
appearance: {
|
|
38
42
|
base: "text-on-interactive",
|
|
@@ -46,69 +50,60 @@ const j = l(
|
|
|
46
50
|
true: "text-disabled"
|
|
47
51
|
}
|
|
48
52
|
}
|
|
49
|
-
}),
|
|
53
|
+
}), j = B.forwardRef(
|
|
50
54
|
({
|
|
51
|
-
className:
|
|
52
|
-
appearance:
|
|
53
|
-
size:
|
|
54
|
-
isFull:
|
|
55
|
-
disabled: e,
|
|
56
|
-
asChild:
|
|
57
|
-
icon:
|
|
58
|
-
loading:
|
|
59
|
-
children:
|
|
60
|
-
onClick:
|
|
55
|
+
className: u,
|
|
56
|
+
appearance: a = "base",
|
|
57
|
+
size: r,
|
|
58
|
+
isFull: p,
|
|
59
|
+
disabled: e = !1,
|
|
60
|
+
asChild: o = !1,
|
|
61
|
+
icon: i,
|
|
62
|
+
loading: s,
|
|
63
|
+
children: n,
|
|
64
|
+
onClick: m,
|
|
61
65
|
...v
|
|
62
66
|
}, f) => {
|
|
63
|
-
const g =
|
|
64
|
-
(p) => {
|
|
65
|
-
if (e || t) {
|
|
66
|
-
p.preventDefault();
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
a == null || a(p);
|
|
70
|
-
},
|
|
71
|
-
[e, t, a]
|
|
72
|
-
), b = n ? {
|
|
67
|
+
const g = {
|
|
73
68
|
xs: 16,
|
|
74
69
|
sm: 20,
|
|
75
70
|
md: 24,
|
|
76
71
|
lg: 24
|
|
77
|
-
}[
|
|
72
|
+
}, c = s || e, b = r ? g[r] : 24;
|
|
78
73
|
return /* @__PURE__ */ x(
|
|
79
|
-
|
|
74
|
+
o ? y : "button",
|
|
80
75
|
{
|
|
81
76
|
className: h(
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
S({ disabled: e, appearance: a, size: r, isFull: p }),
|
|
78
|
+
u
|
|
84
79
|
),
|
|
85
80
|
ref: f,
|
|
86
|
-
"data-disabled":
|
|
87
|
-
disabled:
|
|
88
|
-
onClick:
|
|
81
|
+
"data-disabled": c || void 0,
|
|
82
|
+
disabled: c,
|
|
83
|
+
onClick: m,
|
|
89
84
|
...v,
|
|
90
85
|
children: [
|
|
91
|
-
|
|
86
|
+
s && /* @__PURE__ */ t(
|
|
92
87
|
N,
|
|
93
88
|
{
|
|
94
89
|
size: b,
|
|
95
|
-
className:
|
|
90
|
+
className: d({ appearance: a, disabled: e })
|
|
96
91
|
}
|
|
97
92
|
),
|
|
98
|
-
!
|
|
99
|
-
|
|
93
|
+
!s && i && /* @__PURE__ */ t(
|
|
94
|
+
i,
|
|
100
95
|
{
|
|
101
96
|
size: b,
|
|
102
|
-
className:
|
|
97
|
+
className: d({ appearance: a, disabled: e })
|
|
103
98
|
}
|
|
104
99
|
),
|
|
105
|
-
|
|
100
|
+
n && (o ? /* @__PURE__ */ t(z, { children: n }) : /* @__PURE__ */ t("span", { className: "line-clamp-2 text-left", children: n }))
|
|
106
101
|
]
|
|
107
102
|
}
|
|
108
103
|
);
|
|
109
104
|
}
|
|
110
105
|
);
|
|
111
|
-
|
|
106
|
+
j.displayName = "BaseButton";
|
|
112
107
|
export {
|
|
113
|
-
|
|
108
|
+
j as BaseButton
|
|
114
109
|
};
|
|
@@ -47,7 +47,7 @@ const d = n.forwardRef(
|
|
|
47
47
|
)
|
|
48
48
|
);
|
|
49
49
|
d.displayName = "DialogOverlay";
|
|
50
|
-
function
|
|
50
|
+
function j({
|
|
51
51
|
className: a,
|
|
52
52
|
children: t,
|
|
53
53
|
...e
|
|
@@ -109,7 +109,7 @@ D.displayName = "DialogFooter";
|
|
|
109
109
|
export {
|
|
110
110
|
C as Dialog,
|
|
111
111
|
y as DialogBody,
|
|
112
|
-
|
|
112
|
+
j as DialogContent,
|
|
113
113
|
D as DialogFooter,
|
|
114
114
|
R as DialogTrigger
|
|
115
115
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InteractiveIcon.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/InteractiveIcon/InteractiveIcon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"InteractiveIcon.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/InteractiveIcon/InteractiveIcon.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAoB1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,eAAe;;;2FAY1B,CAAC"}
|
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cn as
|
|
3
|
-
import { cva as
|
|
4
|
-
import
|
|
5
|
-
const c =
|
|
6
|
-
"inline-flex size-fit
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { cn as a } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { cva as n } from "class-variance-authority";
|
|
4
|
+
import l from "react";
|
|
5
|
+
const c = n(
|
|
6
|
+
"inline-flex size-fit items-center justify-center rounded-full text-muted transition-colors hover:text-muted-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus active:text-muted-pressed disabled:text-disabled",
|
|
7
7
|
{
|
|
8
8
|
variants: {
|
|
9
9
|
iconType: {
|
|
10
10
|
filled: "",
|
|
11
11
|
stroked: "bg-base-transparent hover:bg-base-transparent-hover active:bg-base-transparent-pressed disabled:bg-disabled"
|
|
12
|
+
},
|
|
13
|
+
disabled: {
|
|
14
|
+
true: "cursor-default",
|
|
15
|
+
false: "cursor-pointer"
|
|
12
16
|
}
|
|
13
17
|
}
|
|
14
18
|
}
|
|
15
|
-
), d =
|
|
19
|
+
), d = l.forwardRef(({ className: t, iconType: r, disabled: e = !1, ...s }, o) => /* @__PURE__ */ i(
|
|
16
20
|
"button",
|
|
17
21
|
{
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
...s,
|
|
23
|
+
ref: o,
|
|
24
|
+
disabled: e,
|
|
25
|
+
className: a(t, c({ disabled: e, iconType: r }))
|
|
21
26
|
}
|
|
22
27
|
));
|
|
23
28
|
d.displayName = "InteractiveIcon";
|
|
@@ -4,7 +4,7 @@ import { Slot as b } from "@radix-ui/react-slot";
|
|
|
4
4
|
import { cva as h } from "class-variance-authority";
|
|
5
5
|
import x from "react";
|
|
6
6
|
import { ExternalLink as k } from "../../Symbols/Icons/ExternalLink.js";
|
|
7
|
-
const
|
|
7
|
+
const N = h(
|
|
8
8
|
"inline-flex w-fit max-w-full items-center justify-center transition-colors focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-focus",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
@@ -29,7 +29,7 @@ const z = h(
|
|
|
29
29
|
underline: !0
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
),
|
|
32
|
+
), w = x.forwardRef(
|
|
33
33
|
({
|
|
34
34
|
className: l,
|
|
35
35
|
children: r,
|
|
@@ -51,7 +51,7 @@ const z = h(
|
|
|
51
51
|
ref: d,
|
|
52
52
|
className: v(
|
|
53
53
|
l,
|
|
54
|
-
|
|
54
|
+
N({
|
|
55
55
|
appearance: m,
|
|
56
56
|
size: i,
|
|
57
57
|
underline: f
|
|
@@ -79,7 +79,7 @@ const z = h(
|
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
);
|
|
82
|
-
|
|
82
|
+
w.displayName = "Link";
|
|
83
83
|
export {
|
|
84
|
-
|
|
84
|
+
w as Link
|
|
85
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Menu/Menu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EACV,SAAS,EAET,gBAAgB,EAChB,aAAa,EAOb,cAAc,EACd,mBAAmB,EACpB,MAAM,SAAS,CAAC;AA0BjB,iBAAS,IAAI,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAEpC;AAED,QAAA,MAAM,WAAW;;oJASf,CAAC;AAGH,iBAAS,SAAS,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,2CAE9C;AAED,iBAAS,UAAU,CAAC,EAClB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,MAAM,CAAC,2CAE3D;AAED,iBAAS,OAAO,CAAC,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,GAAG,CAAC,2CAExD;AAED,iBAAS,cAAc,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,2CAIxD;AAED,QAAA,MAAM,cAAc;;;;;;qIAalB,CAAC;AAGH,QAAA,MAAM,cAAc;;6MAUlB,CAAC;AAGH,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Menu/Menu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EACV,SAAS,EAET,gBAAgB,EAChB,aAAa,EAOb,cAAc,EACd,mBAAmB,EACpB,MAAM,SAAS,CAAC;AA0BjB,iBAAS,IAAI,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,2CAEpC;AAED,QAAA,MAAM,WAAW;;oJASf,CAAC;AAGH,iBAAS,SAAS,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,2CAE9C;AAED,iBAAS,UAAU,CAAC,EAClB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,MAAM,CAAC,2CAE3D;AAED,iBAAS,OAAO,CAAC,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,GAAG,CAAC,2CAExD;AAED,iBAAS,cAAc,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,2CAIxD;AAED,QAAA,MAAM,cAAc;;;;;;qIAalB,CAAC;AAGH,QAAA,MAAM,cAAc;;6MAUlB,CAAC;AAGH,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;qIAqBf,CAAC;AAGH,QAAA,MAAM,QAAQ;;;;;;;qIAUZ,CAAC;AAGH,QAAA,MAAM,gBAAgB;;;0EAkBpB,CAAC;AAGH,QAAA,MAAM,aAAa;;0EAiBjB,CAAC;AAGH,QAAA,MAAM,SAAS;;;;qIAUb,CAAC;AAGH,QAAA,MAAM,aAAa;;;qIAQlB,CAAC;AAGF,OAAO,EACL,IAAI,EACJ,WAAW,EACX,WAAW,EACX,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,aAAa,EACb,SAAS,EACT,UAAU,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACd,cAAc,GACf,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as a, jsxs as l } from "react/jsx-runtime";
|
|
2
|
-
import { cn as
|
|
2
|
+
import { cn as r } from "../../../libs/utils-shared/dist/index.js";
|
|
3
3
|
import * as t from "@radix-ui/react-dropdown-menu";
|
|
4
4
|
import * as i from "react";
|
|
5
|
-
import { Check as
|
|
6
|
-
import { Divider as
|
|
7
|
-
import { ChevronRight as
|
|
8
|
-
const
|
|
5
|
+
import { Check as p } from "../../Symbols/Icons/Check.js";
|
|
6
|
+
import { Divider as b } from "../Divider/Divider.js";
|
|
7
|
+
import { ChevronRight as N } from "../../Symbols/Icons/ChevronRight.js";
|
|
8
|
+
const f = r(
|
|
9
9
|
"z-menu min-w-160 overflow-hidden rounded-sm bg-muted p-8",
|
|
10
10
|
"shadow-sm",
|
|
11
11
|
"data-[state=open]:animate-fade-in",
|
|
12
12
|
"data-[state=closed]:animate-fade-out"
|
|
13
|
-
), d =
|
|
13
|
+
), d = r(
|
|
14
14
|
"relative flex cursor-default items-center gap-12 select-none",
|
|
15
15
|
"h-44 rounded-sm px-8 outline-hidden",
|
|
16
16
|
"body-2-semi-bold text-base",
|
|
@@ -18,147 +18,151 @@ const c = o(
|
|
|
18
18
|
"focus:bg-base-transparent-hover",
|
|
19
19
|
"active:bg-base-transparent-pressed",
|
|
20
20
|
"data-disabled:pointer-events-none data-disabled:text-disabled"
|
|
21
|
-
),
|
|
21
|
+
), g = r("px-8 py-4 body-3-semi-bold text-muted"), y = r(
|
|
22
22
|
d,
|
|
23
23
|
"data-[state=open]:bg-base-transparent-hover"
|
|
24
24
|
);
|
|
25
|
-
function
|
|
25
|
+
function G({ ...e }) {
|
|
26
26
|
return /* @__PURE__ */ a(t.Root, { "data-slot": "menu", ...e });
|
|
27
27
|
}
|
|
28
|
-
const
|
|
28
|
+
const h = i.forwardRef(({ ...e }, n) => /* @__PURE__ */ a(
|
|
29
29
|
t.Trigger,
|
|
30
30
|
{
|
|
31
|
-
ref:
|
|
31
|
+
ref: n,
|
|
32
32
|
"data-slot": "menu-trigger",
|
|
33
33
|
...e
|
|
34
34
|
}
|
|
35
35
|
));
|
|
36
|
-
|
|
37
|
-
function
|
|
36
|
+
h.displayName = t.Trigger.displayName;
|
|
37
|
+
function L({ ...e }) {
|
|
38
38
|
return /* @__PURE__ */ a(t.Group, { "data-slot": "menu-group", ...e });
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function D({
|
|
41
41
|
...e
|
|
42
42
|
}) {
|
|
43
43
|
return /* @__PURE__ */ a(t.Portal, { ...e });
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function q({
|
|
46
46
|
...e
|
|
47
47
|
}) {
|
|
48
48
|
return /* @__PURE__ */ a(t.Sub, { ...e });
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function A({ ...e }) {
|
|
51
51
|
return /* @__PURE__ */ a(t.RadioGroup, { "data-slot": "menu-radio-group", ...e });
|
|
52
52
|
}
|
|
53
|
-
const
|
|
53
|
+
const x = i.forwardRef(({ className: e, inset: n, children: o, ...s }, m) => /* @__PURE__ */ l(
|
|
54
54
|
t.SubTrigger,
|
|
55
55
|
{
|
|
56
56
|
ref: m,
|
|
57
57
|
"data-slot": "menu-sub-trigger",
|
|
58
|
-
className:
|
|
59
|
-
...
|
|
58
|
+
className: r(y, n && "pl-32", e),
|
|
59
|
+
...s,
|
|
60
60
|
children: [
|
|
61
|
-
|
|
62
|
-
/* @__PURE__ */ a(
|
|
61
|
+
o,
|
|
62
|
+
/* @__PURE__ */ a(N, { size: 20, className: "ml-auto text-muted" })
|
|
63
63
|
]
|
|
64
64
|
}
|
|
65
65
|
));
|
|
66
|
-
|
|
67
|
-
const
|
|
66
|
+
x.displayName = t.SubTrigger.displayName;
|
|
67
|
+
const R = i.forwardRef(({ className: e, ...n }, o) => /* @__PURE__ */ a(
|
|
68
68
|
t.SubContent,
|
|
69
69
|
{
|
|
70
|
-
ref:
|
|
70
|
+
ref: o,
|
|
71
71
|
"data-slot": "menu-sub-content",
|
|
72
|
-
className:
|
|
73
|
-
...
|
|
72
|
+
className: r(f, e),
|
|
73
|
+
...n
|
|
74
74
|
}
|
|
75
75
|
));
|
|
76
|
-
|
|
77
|
-
const
|
|
76
|
+
R.displayName = t.SubContent.displayName;
|
|
77
|
+
const M = i.forwardRef(({ className: e, sideOffset: n = 4, align: o = "start", ...s }, m) => /* @__PURE__ */ a(t.Portal, { children: /* @__PURE__ */ a(
|
|
78
78
|
t.Content,
|
|
79
79
|
{
|
|
80
80
|
ref: m,
|
|
81
81
|
"data-slot": "menu-content",
|
|
82
|
-
sideOffset:
|
|
83
|
-
className:
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
sideOffset: n,
|
|
83
|
+
className: r(f, e),
|
|
84
|
+
onClick: (u) => {
|
|
85
|
+
var c;
|
|
86
|
+
u.stopPropagation(), (c = s.onClick) == null || c.call(s, u);
|
|
87
|
+
},
|
|
88
|
+
align: o,
|
|
89
|
+
...s
|
|
86
90
|
}
|
|
87
91
|
) }));
|
|
88
|
-
|
|
89
|
-
const
|
|
92
|
+
M.displayName = t.Content.displayName;
|
|
93
|
+
const w = i.forwardRef(({ className: e, inset: n, ...o }, s) => /* @__PURE__ */ a(
|
|
90
94
|
t.Item,
|
|
91
95
|
{
|
|
92
|
-
ref:
|
|
96
|
+
ref: s,
|
|
93
97
|
"data-slot": "menu-item",
|
|
94
|
-
className:
|
|
95
|
-
...
|
|
98
|
+
className: r(d, n && "pl-32", e),
|
|
99
|
+
...o
|
|
96
100
|
}
|
|
97
101
|
));
|
|
98
|
-
|
|
99
|
-
const
|
|
102
|
+
w.displayName = t.Item.displayName;
|
|
103
|
+
const S = i.forwardRef(({ className: e, children: n, checked: o, ...s }, m) => /* @__PURE__ */ l(
|
|
100
104
|
t.CheckboxItem,
|
|
101
105
|
{
|
|
102
106
|
ref: m,
|
|
103
107
|
"data-slot": "menu-checkbox-item",
|
|
104
|
-
className:
|
|
105
|
-
checked:
|
|
106
|
-
...
|
|
108
|
+
className: r(d, e),
|
|
109
|
+
checked: o,
|
|
110
|
+
...s,
|
|
107
111
|
children: [
|
|
108
|
-
|
|
109
|
-
/* @__PURE__ */ a("span", { className: "ml-auto flex size-24 items-center justify-center", children: /* @__PURE__ */ a(t.ItemIndicator, { children: /* @__PURE__ */ a(
|
|
112
|
+
n,
|
|
113
|
+
/* @__PURE__ */ a("span", { className: "ml-auto flex size-24 items-center justify-center", children: /* @__PURE__ */ a(t.ItemIndicator, { children: /* @__PURE__ */ a(p, { size: 24, className: "text-active" }) }) })
|
|
110
114
|
]
|
|
111
115
|
}
|
|
112
116
|
));
|
|
113
|
-
|
|
114
|
-
const
|
|
117
|
+
S.displayName = t.CheckboxItem.displayName;
|
|
118
|
+
const C = i.forwardRef(({ className: e, children: n, ...o }, s) => /* @__PURE__ */ l(
|
|
115
119
|
t.RadioItem,
|
|
116
120
|
{
|
|
117
|
-
ref:
|
|
121
|
+
ref: s,
|
|
118
122
|
"data-slot": "menu-radio-item",
|
|
119
|
-
className:
|
|
120
|
-
...
|
|
123
|
+
className: r(d, e),
|
|
124
|
+
...o,
|
|
121
125
|
children: [
|
|
122
|
-
|
|
123
|
-
/* @__PURE__ */ a("span", { className: "ml-auto flex size-24 items-center justify-center", children: /* @__PURE__ */ a(t.ItemIndicator, { children: /* @__PURE__ */ a(
|
|
126
|
+
n,
|
|
127
|
+
/* @__PURE__ */ a("span", { className: "ml-auto flex size-24 items-center justify-center", children: /* @__PURE__ */ a(t.ItemIndicator, { children: /* @__PURE__ */ a(p, { size: 24, className: "text-active" }) }) })
|
|
124
128
|
]
|
|
125
129
|
}
|
|
126
130
|
));
|
|
127
|
-
|
|
128
|
-
const
|
|
131
|
+
C.displayName = t.RadioItem.displayName;
|
|
132
|
+
const I = i.forwardRef(({ className: e, inset: n, ...o }, s) => /* @__PURE__ */ a(
|
|
129
133
|
t.Label,
|
|
130
134
|
{
|
|
131
|
-
ref:
|
|
135
|
+
ref: s,
|
|
132
136
|
"data-slot": "menu-label",
|
|
133
|
-
className:
|
|
134
|
-
...
|
|
137
|
+
className: r(g, n && "pl-32", e),
|
|
138
|
+
...o
|
|
135
139
|
}
|
|
136
140
|
));
|
|
137
|
-
|
|
138
|
-
const
|
|
139
|
-
({ className: e, ...
|
|
140
|
-
|
|
141
|
+
I.displayName = t.Label.displayName;
|
|
142
|
+
const v = i.forwardRef(
|
|
143
|
+
({ className: e, ...n }, o) => /* @__PURE__ */ a(
|
|
144
|
+
b,
|
|
141
145
|
{
|
|
142
|
-
ref:
|
|
143
|
-
className:
|
|
144
|
-
...
|
|
146
|
+
ref: o,
|
|
147
|
+
className: r("mx-8 my-4 w-auto", e),
|
|
148
|
+
...n
|
|
145
149
|
}
|
|
146
150
|
)
|
|
147
151
|
);
|
|
148
|
-
|
|
152
|
+
v.displayName = "MenuSeparator";
|
|
149
153
|
export {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
154
|
+
G as Menu,
|
|
155
|
+
S as MenuCheckboxItem,
|
|
156
|
+
M as MenuContent,
|
|
157
|
+
L as MenuGroup,
|
|
158
|
+
w as MenuItem,
|
|
159
|
+
I as MenuLabel,
|
|
160
|
+
D as MenuPortal,
|
|
161
|
+
A as MenuRadioGroup,
|
|
162
|
+
C as MenuRadioItem,
|
|
163
|
+
v as MenuSeparator,
|
|
164
|
+
q as MenuSub,
|
|
165
|
+
R as MenuSubContent,
|
|
166
|
+
x as MenuSubTrigger,
|
|
167
|
+
h as MenuTrigger
|
|
164
168
|
};
|
|
@@ -97,9 +97,9 @@ const x = c(
|
|
|
97
97
|
position: r,
|
|
98
98
|
...i,
|
|
99
99
|
children: [
|
|
100
|
-
/* @__PURE__ */ e(
|
|
100
|
+
/* @__PURE__ */ e(j, {}),
|
|
101
101
|
/* @__PURE__ */ e(a.Viewport, { className: y({ position: r }), children: o }),
|
|
102
|
-
/* @__PURE__ */ e(
|
|
102
|
+
/* @__PURE__ */ e(z, {})
|
|
103
103
|
]
|
|
104
104
|
}
|
|
105
105
|
) }));
|
|
@@ -147,7 +147,7 @@ const I = s.forwardRef(
|
|
|
147
147
|
)
|
|
148
148
|
);
|
|
149
149
|
I.displayName = "SelectSeparator";
|
|
150
|
-
const
|
|
150
|
+
const R = s.forwardRef(({ className: t, ...o }, r) => /* @__PURE__ */ e(
|
|
151
151
|
a.ItemText,
|
|
152
152
|
{
|
|
153
153
|
ref: r,
|
|
@@ -156,8 +156,8 @@ const z = s.forwardRef(({ className: t, ...o }, r) => /* @__PURE__ */ e(
|
|
|
156
156
|
...o
|
|
157
157
|
}
|
|
158
158
|
));
|
|
159
|
-
|
|
160
|
-
function
|
|
159
|
+
R.displayName = a.ItemText.displayName;
|
|
160
|
+
function j({
|
|
161
161
|
className: t,
|
|
162
162
|
...o
|
|
163
163
|
}) {
|
|
@@ -174,7 +174,7 @@ function R({
|
|
|
174
174
|
}
|
|
175
175
|
);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function z({
|
|
178
178
|
className: t,
|
|
179
179
|
...o
|
|
180
180
|
}) {
|
|
@@ -196,7 +196,7 @@ export {
|
|
|
196
196
|
N as SelectContent,
|
|
197
197
|
G as SelectGroup,
|
|
198
198
|
v as SelectItem,
|
|
199
|
-
|
|
199
|
+
R as SelectItemText,
|
|
200
200
|
w as SelectLabel,
|
|
201
201
|
I as SelectSeparator,
|
|
202
202
|
h as SelectTrigger
|
|
@@ -4,8 +4,8 @@ import { cva as h } from "class-variance-authority";
|
|
|
4
4
|
import { useMemo as f } from "react";
|
|
5
5
|
import { Spinner as b } from "../Spinner/Spinner.js";
|
|
6
6
|
import { InformationFill as g } from "../../Symbols/Icons/InformationFill.js";
|
|
7
|
-
import { WarningFill as
|
|
8
|
-
import { DeleteCircleFill as
|
|
7
|
+
import { WarningFill as x } from "../../Symbols/Icons/WarningFill.js";
|
|
8
|
+
import { DeleteCircleFill as z } from "../../Symbols/Icons/DeleteCircleFill.js";
|
|
9
9
|
import { CheckmarkCircleFill as w } from "../../Symbols/Icons/CheckmarkCircleFill.js";
|
|
10
10
|
import { BluetoothCircleFill as y } from "../../Symbols/Icons/BluetoothCircleFill.js";
|
|
11
11
|
const F = h(
|
|
@@ -57,9 +57,9 @@ const F = h(
|
|
|
57
57
|
case "check":
|
|
58
58
|
return /* @__PURE__ */ e(w, { size: t });
|
|
59
59
|
case "error":
|
|
60
|
-
return /* @__PURE__ */ e(x, { size: t });
|
|
61
|
-
case "warning":
|
|
62
60
|
return /* @__PURE__ */ e(z, { size: t });
|
|
61
|
+
case "warning":
|
|
62
|
+
return /* @__PURE__ */ e(x, { size: t });
|
|
63
63
|
case "info":
|
|
64
64
|
return /* @__PURE__ */ e(g, { size: t });
|
|
65
65
|
case "loader":
|
|
@@ -19,7 +19,7 @@ const [x, p] = i("ThemeProvider"), D = ({
|
|
|
19
19
|
[t, o]
|
|
20
20
|
);
|
|
21
21
|
return /* @__PURE__ */ r(x, { value: d, children: /* @__PURE__ */ r(h, { locale: o, children: e }) });
|
|
22
|
-
},
|
|
22
|
+
}, P = () => {
|
|
23
23
|
const e = p({
|
|
24
24
|
consumerName: "useTheme",
|
|
25
25
|
contextRequired: !0
|
|
@@ -31,5 +31,5 @@ const [x, p] = i("ThemeProvider"), D = ({
|
|
|
31
31
|
};
|
|
32
32
|
export {
|
|
33
33
|
D as ThemeProvider,
|
|
34
|
-
|
|
34
|
+
P as useTheme
|
|
35
35
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { MouseEventHandler } from 'react';
|
|
2
1
|
import { TileContentProps, TileDescriptionProps, TileSpotProps, TileTitleProps } from './types';
|
|
3
2
|
/**
|
|
4
3
|
* A flexible tile component that uses a composite pattern for maximum customization.
|
|
@@ -30,11 +29,12 @@ import { TileContentProps, TileDescriptionProps, TileSpotProps, TileTitleProps }
|
|
|
30
29
|
export declare const Tile: import('react').ForwardRefExoticComponent<{
|
|
31
30
|
appearance?: "no-background" | "card";
|
|
32
31
|
disabled?: boolean;
|
|
33
|
-
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
32
|
+
onClick?: import('react').MouseEventHandler<HTMLButtonElement>;
|
|
34
33
|
children: import('react').ReactNode;
|
|
35
34
|
className?: string;
|
|
36
35
|
'aria-label'?: string;
|
|
37
|
-
|
|
36
|
+
secondaryAction?: import('react').ReactNode;
|
|
37
|
+
} & Omit<import('react').HTMLAttributes<HTMLButtonElement>, "onClick"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
38
38
|
/**
|
|
39
39
|
* A spot adapter for use within Tile. Automatically inherits the disabled state from the parent Tile.
|
|
40
40
|
* Always renders at a fixed size of 48.
|
|
@@ -85,7 +85,7 @@ export declare const TileDescription: {
|
|
|
85
85
|
* </Tile>
|
|
86
86
|
*/
|
|
87
87
|
export declare const TileSecondaryAction: import('react').ForwardRefExoticComponent<{
|
|
88
|
-
onClick?: MouseEventHandler;
|
|
88
|
+
onClick?: import('react').MouseEventHandler;
|
|
89
89
|
icon: React.ComponentType<Omit<import('../Icon').IconProps, "children">>;
|
|
90
90
|
className?: string;
|
|
91
91
|
} & Omit<import('react').HTMLAttributes<HTMLButtonElement>, "onClick"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tile.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Tile/Tile.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tile.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Tile/Tile.tsx"],"names":[],"mappings":"AAKA,OAAO,EACL,gBAAgB,EAEhB,oBAAoB,EAGpB,aAAa,EACb,cAAc,EACf,MAAM,SAAS,CAAC;AAkCjB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,IAAI;;;;;;;;uHAuChB,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,QAAQ;YAAW,aAAa;;CAM5C,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,WAAW;wCAIrB,gBAAgB;;CASlB,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,SAAS;wCAInB,cAAc;;CAiBhB,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,eAAe;wCAIzB,oBAAoB;;CAiBtB,CAAC;AAGF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB;;;;0HAsC9B,CAAC"}
|
|
@@ -1,242 +1,175 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import { cva as
|
|
4
|
-
import { forwardRef as
|
|
5
|
-
import { Spot as
|
|
6
|
-
import { InteractiveIcon as
|
|
7
|
-
const [
|
|
8
|
-
root:
|
|
1
|
+
import { jsx as a, jsxs as T } from "react/jsx-runtime";
|
|
2
|
+
import { createSafeContext as v, cn as s } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { cva as m } from "class-variance-authority";
|
|
4
|
+
import { forwardRef as f, useCallback as x } from "react";
|
|
5
|
+
import { Spot as y } from "../Spot/Spot.js";
|
|
6
|
+
import { InteractiveIcon as N } from "../InteractiveIcon/InteractiveIcon.js";
|
|
7
|
+
const [g, n] = v("Tile"), b = {
|
|
8
|
+
root: m([
|
|
9
|
+
"group relative flex flex-col items-center rounded-md text-base transition-colors focus-visible:outline-2 focus-visible:outline-focus"
|
|
10
|
+
]),
|
|
11
|
+
inner: m(
|
|
9
12
|
[
|
|
10
|
-
"
|
|
13
|
+
"flex w-full flex-col items-center gap-8 px-8 py-12",
|
|
11
14
|
"rounded-md focus-visible:outline-2 focus-visible:outline-focus"
|
|
12
15
|
],
|
|
13
16
|
{
|
|
14
17
|
variants: {
|
|
15
18
|
appearance: {
|
|
16
|
-
"no-background": "bg-base-transparent",
|
|
17
|
-
card: "bg-surface"
|
|
18
|
-
},
|
|
19
|
-
isActive: {
|
|
20
|
-
true: "",
|
|
21
|
-
false: ""
|
|
19
|
+
"no-background": "bg-base-transparent hover:not-disabled:bg-base-transparent-hover active:not-disabled:bg-base-transparent-pressed",
|
|
20
|
+
card: "bg-surface hover:not-disabled:bg-surface-hover active:not-disabled:bg-surface-pressed"
|
|
22
21
|
},
|
|
23
22
|
disabled: {
|
|
24
|
-
true: "",
|
|
25
|
-
false: ""
|
|
23
|
+
true: "cursor-default",
|
|
24
|
+
false: "cursor-pointer"
|
|
26
25
|
}
|
|
27
26
|
},
|
|
28
|
-
compoundVariants: [
|
|
29
|
-
{
|
|
30
|
-
appearance: "no-background",
|
|
31
|
-
isActive: !1,
|
|
32
|
-
disabled: !1,
|
|
33
|
-
className: "hover:bg-base-transparent-hover"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
appearance: "no-background",
|
|
37
|
-
isActive: !0,
|
|
38
|
-
disabled: !1,
|
|
39
|
-
className: "bg-base-transparent-pressed"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
appearance: "card",
|
|
43
|
-
isActive: !1,
|
|
44
|
-
disabled: !1,
|
|
45
|
-
className: "hover:bg-surface-hover"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
appearance: "card",
|
|
49
|
-
isActive: !0,
|
|
50
|
-
disabled: !1,
|
|
51
|
-
className: "bg-surface-pressed"
|
|
52
|
-
}
|
|
53
|
-
],
|
|
54
27
|
defaultVariants: {
|
|
55
28
|
appearance: "no-background",
|
|
56
|
-
isActive: !1,
|
|
57
29
|
disabled: !1
|
|
58
30
|
}
|
|
59
31
|
}
|
|
60
|
-
),
|
|
61
|
-
button: v(
|
|
62
|
-
"flex w-full cursor-pointer flex-col items-center gap-8 rounded-md px-8 py-12 focus-visible:outline-2 focus-visible:outline-focus"
|
|
63
32
|
)
|
|
64
|
-
},
|
|
33
|
+
}, h = f(
|
|
65
34
|
({
|
|
66
35
|
className: e,
|
|
67
|
-
onClick:
|
|
36
|
+
onClick: t,
|
|
37
|
+
secondaryAction: o,
|
|
68
38
|
appearance: r = "no-background",
|
|
69
|
-
disabled:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
a
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"div",
|
|
100
|
-
{
|
|
101
|
-
...n,
|
|
102
|
-
ref: N,
|
|
103
|
-
className: T.root({
|
|
104
|
-
appearance: r,
|
|
105
|
-
isActive: g,
|
|
106
|
-
disabled: t,
|
|
107
|
-
className: e
|
|
108
|
-
}),
|
|
109
|
-
onMouseDown: t ? void 0 : (a) => {
|
|
110
|
-
S(a);
|
|
111
|
-
},
|
|
112
|
-
onMouseUp: t ? void 0 : (a) => {
|
|
113
|
-
k(a);
|
|
114
|
-
},
|
|
115
|
-
onMouseLeave: t ? void 0 : (a) => {
|
|
116
|
-
R(a);
|
|
117
|
-
},
|
|
118
|
-
children: [
|
|
119
|
-
/* @__PURE__ */ s(
|
|
120
|
-
"button",
|
|
121
|
-
{
|
|
122
|
-
"aria-label": f,
|
|
123
|
-
onClick: t ? void 0 : i,
|
|
124
|
-
disabled: t,
|
|
125
|
-
"data-disabled": t || void 0,
|
|
126
|
-
className: T.button(),
|
|
127
|
-
children: A
|
|
128
|
-
}
|
|
129
|
-
),
|
|
130
|
-
h
|
|
131
|
-
]
|
|
132
|
-
}
|
|
133
|
-
) });
|
|
134
|
-
}
|
|
39
|
+
disabled: i = !1,
|
|
40
|
+
children: l,
|
|
41
|
+
style: c,
|
|
42
|
+
...d
|
|
43
|
+
}, u) => /* @__PURE__ */ a(g, { value: { disabled: i }, children: /* @__PURE__ */ T(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
ref: u,
|
|
47
|
+
style: c,
|
|
48
|
+
className: b.root({
|
|
49
|
+
className: e
|
|
50
|
+
}),
|
|
51
|
+
children: [
|
|
52
|
+
/* @__PURE__ */ a(
|
|
53
|
+
"button",
|
|
54
|
+
{
|
|
55
|
+
...d,
|
|
56
|
+
onClick: t,
|
|
57
|
+
disabled: i,
|
|
58
|
+
className: b.inner({
|
|
59
|
+
appearance: r,
|
|
60
|
+
disabled: i
|
|
61
|
+
}),
|
|
62
|
+
children: l
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
o
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
) })
|
|
135
69
|
);
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
const { disabled:
|
|
70
|
+
h.displayName = "Tile";
|
|
71
|
+
const S = (e) => {
|
|
72
|
+
const { disabled: t } = n({
|
|
139
73
|
consumerName: "TileSpot",
|
|
140
74
|
contextRequired: !0
|
|
141
75
|
});
|
|
142
|
-
return /* @__PURE__ */
|
|
76
|
+
return /* @__PURE__ */ a(y, { ...e, size: 48, disabled: t });
|
|
143
77
|
};
|
|
144
|
-
|
|
145
|
-
const
|
|
78
|
+
S.displayName = "TileSpot";
|
|
79
|
+
const w = ({
|
|
146
80
|
children: e,
|
|
147
|
-
className:
|
|
148
|
-
...
|
|
149
|
-
}) => /* @__PURE__ */
|
|
81
|
+
className: t,
|
|
82
|
+
...o
|
|
83
|
+
}) => /* @__PURE__ */ a(
|
|
150
84
|
"div",
|
|
151
85
|
{
|
|
152
|
-
className:
|
|
153
|
-
...
|
|
86
|
+
className: s("flex w-full flex-col items-center text-center", t),
|
|
87
|
+
...o,
|
|
154
88
|
children: e
|
|
155
89
|
}
|
|
156
90
|
);
|
|
157
|
-
|
|
158
|
-
const
|
|
91
|
+
w.displayName = "TileContent";
|
|
92
|
+
const R = ({
|
|
159
93
|
children: e,
|
|
160
|
-
className:
|
|
161
|
-
...
|
|
94
|
+
className: t,
|
|
95
|
+
...o
|
|
162
96
|
}) => {
|
|
163
|
-
const { disabled:
|
|
97
|
+
const { disabled: r } = n({
|
|
164
98
|
consumerName: "TileTitle",
|
|
165
99
|
contextRequired: !0
|
|
166
100
|
});
|
|
167
|
-
return /* @__PURE__ */
|
|
101
|
+
return /* @__PURE__ */ a(
|
|
168
102
|
"div",
|
|
169
103
|
{
|
|
170
|
-
className:
|
|
104
|
+
className: s(
|
|
171
105
|
"w-full truncate body-2-semi-bold",
|
|
172
|
-
|
|
173
|
-
|
|
106
|
+
r && "text-disabled",
|
|
107
|
+
t
|
|
174
108
|
),
|
|
175
|
-
...
|
|
109
|
+
...o,
|
|
176
110
|
children: e
|
|
177
111
|
}
|
|
178
112
|
);
|
|
179
113
|
};
|
|
180
|
-
|
|
181
|
-
const
|
|
114
|
+
R.displayName = "TileTitle";
|
|
115
|
+
const q = ({
|
|
182
116
|
children: e,
|
|
183
|
-
className:
|
|
184
|
-
...
|
|
117
|
+
className: t,
|
|
118
|
+
...o
|
|
185
119
|
}) => {
|
|
186
|
-
const { disabled:
|
|
120
|
+
const { disabled: r } = n({
|
|
187
121
|
consumerName: "TileDescription",
|
|
188
122
|
contextRequired: !0
|
|
189
123
|
});
|
|
190
|
-
return /* @__PURE__ */
|
|
124
|
+
return /* @__PURE__ */ a(
|
|
191
125
|
"div",
|
|
192
126
|
{
|
|
193
|
-
className:
|
|
127
|
+
className: s(
|
|
194
128
|
"w-full truncate body-3",
|
|
195
|
-
|
|
196
|
-
|
|
129
|
+
r ? "text-disabled" : "text-muted",
|
|
130
|
+
t
|
|
197
131
|
),
|
|
198
|
-
...
|
|
132
|
+
...o,
|
|
199
133
|
children: e
|
|
200
134
|
}
|
|
201
135
|
);
|
|
202
136
|
};
|
|
203
|
-
|
|
204
|
-
const
|
|
205
|
-
const { disabled:
|
|
137
|
+
q.displayName = "TileDescription";
|
|
138
|
+
const D = f(({ onClick: e, icon: t, className: o, "aria-label": r, ...i }, l) => {
|
|
139
|
+
const { disabled: c } = n({
|
|
206
140
|
consumerName: "TileSecondaryAction",
|
|
207
141
|
contextRequired: !0
|
|
208
|
-
}),
|
|
209
|
-
(
|
|
210
|
-
|
|
142
|
+
}), d = x(
|
|
143
|
+
(p) => {
|
|
144
|
+
p.stopPropagation(), p.preventDefault(), e == null || e(p);
|
|
211
145
|
},
|
|
212
146
|
[e]
|
|
213
147
|
);
|
|
214
|
-
if (
|
|
215
|
-
const
|
|
216
|
-
return /* @__PURE__ */
|
|
217
|
-
|
|
148
|
+
if (c) return null;
|
|
149
|
+
const u = t;
|
|
150
|
+
return /* @__PURE__ */ a(
|
|
151
|
+
N,
|
|
218
152
|
{
|
|
219
|
-
|
|
220
|
-
className: u(
|
|
153
|
+
className: s(
|
|
221
154
|
"absolute top-8 right-4 opacity-0 transition-opacity duration-200 group-hover:opacity-100 focus-within:opacity-100",
|
|
222
|
-
|
|
155
|
+
o
|
|
223
156
|
),
|
|
224
157
|
"data-secondary-button-container": !0,
|
|
225
158
|
iconType: "stroked",
|
|
226
|
-
onClick:
|
|
227
|
-
"aria-label":
|
|
228
|
-
ref:
|
|
229
|
-
...
|
|
230
|
-
children: /* @__PURE__ */
|
|
159
|
+
onClick: d,
|
|
160
|
+
"aria-label": r,
|
|
161
|
+
ref: l,
|
|
162
|
+
...i,
|
|
163
|
+
children: /* @__PURE__ */ a(u, { size: 24 })
|
|
231
164
|
}
|
|
232
165
|
);
|
|
233
166
|
});
|
|
234
|
-
|
|
167
|
+
D.displayName = "TileSecondaryAction";
|
|
235
168
|
export {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
169
|
+
h as Tile,
|
|
170
|
+
w as TileContent,
|
|
171
|
+
q as TileDescription,
|
|
172
|
+
D as TileSecondaryAction,
|
|
173
|
+
S as TileSpot,
|
|
174
|
+
R as TileTitle
|
|
242
175
|
};
|
|
@@ -36,7 +36,12 @@ export type TileProps = {
|
|
|
36
36
|
* Aria label for accessibility.
|
|
37
37
|
*/
|
|
38
38
|
'aria-label'?: string;
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* The secondary action to display inside the tile.
|
|
41
|
+
* Typically contains a TileSecondaryAction component.
|
|
42
|
+
*/
|
|
43
|
+
secondaryAction?: ReactNode;
|
|
44
|
+
} & Omit<HTMLAttributes<HTMLButtonElement>, 'onClick'>;
|
|
40
45
|
export type TileSpotProps = DiscriminatedSpotProps;
|
|
41
46
|
export type TileContentProps = {
|
|
42
47
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Tile/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,eAAe,GAAG,MAAM,CAAC;IACtC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAC/C;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Tile/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,eAAe,GAAG,MAAM,CAAC;IACtC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAC/C;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC;CAC7B,GAAG,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,SAAS,CAAC,CAAC;AAEvD,MAAM,MAAM,aAAa,GAAG,sBAAsB,CAAC;AAEnD,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnC,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnC,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnC,MAAM,MAAM,wBAAwB,GAAG;IACrC;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IACvD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,SAAS,CAAC,CAAC"}
|
|
@@ -1,84 +1,76 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { clsx as
|
|
4
|
-
import { twMerge as
|
|
5
|
-
function
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as d, useMemo as h, useContext as g } from "react";
|
|
3
|
+
import { clsx as x } from "clsx";
|
|
4
|
+
import { twMerge as $ } from "tailwind-merge";
|
|
5
|
+
function P(t) {
|
|
6
6
|
return t ? t.split(/[-_ ]+/).map((n) => n.charAt(0).toUpperCase() + n.slice(1).toLowerCase()).join("") : "";
|
|
7
7
|
}
|
|
8
|
-
const
|
|
9
|
-
function
|
|
8
|
+
const w = 48, C = 17, v = 2;
|
|
9
|
+
function S(t) {
|
|
10
10
|
const n = t.replace(/\D/g, "").length;
|
|
11
11
|
return Math.max(
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
C,
|
|
13
|
+
w - n * v
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function m(t, n = !0) {
|
|
17
17
|
if (!t) return "";
|
|
18
|
-
const a = t.includes("."), [
|
|
19
|
-
return a && n ? r ? `${
|
|
18
|
+
const a = t.includes("."), [c, r] = t.split("."), o = c.replace(/\B(?=(\d{3})+(?!\d))/g, " ");
|
|
19
|
+
return a && n ? r ? `${o}.${r}` : `${o}.` : o;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function b(t, n = {}) {
|
|
22
22
|
const {
|
|
23
23
|
allowDecimals: a = !0,
|
|
24
|
-
thousandsSeparator:
|
|
24
|
+
thousandsSeparator: c = !0,
|
|
25
25
|
maxIntegerLength: r = 9,
|
|
26
|
-
maxDecimalLength:
|
|
27
|
-
} = n,
|
|
28
|
-
let e =
|
|
26
|
+
maxDecimalLength: o = 9
|
|
27
|
+
} = n, i = t.replace(",", ".").replace(/[^\d.]/g, "");
|
|
28
|
+
let e = i;
|
|
29
29
|
if (e = e.replace(/^0+(?=\d)/, ""), !a)
|
|
30
|
-
return e = e.replace(/\D/g, ""), r > 0 && e.length > r && (e = e.slice(0, r)),
|
|
30
|
+
return e = e.replace(/\D/g, ""), r > 0 && e.length > r && (e = e.slice(0, r)), c ? m(e) : e;
|
|
31
31
|
e === "." && (e = "0.");
|
|
32
32
|
const u = e.indexOf(".");
|
|
33
33
|
if (u !== -1) {
|
|
34
|
-
let
|
|
35
|
-
r > 0 &&
|
|
36
|
-
const f =
|
|
37
|
-
e =
|
|
34
|
+
let s = e.slice(0, u), l = e.slice(u + 1).replace(/\./g, "");
|
|
35
|
+
r > 0 && s.length > r && (s = s.slice(0, r)), l = l.slice(0, o), s === "" && (s = "0");
|
|
36
|
+
const f = i.endsWith(".") || e.endsWith(".");
|
|
37
|
+
e = l.length > 0 ? `${s}.${l}` : f ? `${s}.` : s;
|
|
38
38
|
} else
|
|
39
39
|
r > 0 && e.length > r && (e = e.slice(0, r));
|
|
40
|
-
return
|
|
40
|
+
return c ? m(e) : e;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
const a =
|
|
44
|
-
const e =
|
|
45
|
-
() =>
|
|
46
|
-
Object.values(
|
|
42
|
+
function A(t, n) {
|
|
43
|
+
const a = d(n), c = ({ children: o, value: i }) => {
|
|
44
|
+
const e = h(
|
|
45
|
+
() => i,
|
|
46
|
+
Object.values(i ?? {})
|
|
47
47
|
);
|
|
48
|
-
return /* @__PURE__ */
|
|
48
|
+
return /* @__PURE__ */ p(a.Provider, { value: e, children: o });
|
|
49
49
|
};
|
|
50
|
-
|
|
50
|
+
c.displayName = t + "Provider";
|
|
51
51
|
function r({
|
|
52
|
-
consumerName:
|
|
53
|
-
contextRequired:
|
|
52
|
+
consumerName: o,
|
|
53
|
+
contextRequired: i
|
|
54
54
|
}) {
|
|
55
|
-
const e =
|
|
55
|
+
const e = g(a);
|
|
56
56
|
if (e)
|
|
57
57
|
return e;
|
|
58
|
-
if (
|
|
58
|
+
if (i)
|
|
59
59
|
throw new Error(
|
|
60
|
-
`${
|
|
60
|
+
`${o} must be used within ${t}`
|
|
61
61
|
);
|
|
62
62
|
return n || {};
|
|
63
63
|
}
|
|
64
|
-
return [
|
|
64
|
+
return [c, r];
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
return
|
|
68
|
-
}
|
|
69
|
-
function z(t, n) {
|
|
70
|
-
const a = g.toArray(t), i = typeof n == "string" ? (o) => m(o) && o.props["data-slot"] === n : (o) => m(o) && o.type === n, r = a.find(i), s = a.filter((o) => !i(o));
|
|
71
|
-
return {
|
|
72
|
-
slotElement: r ?? null,
|
|
73
|
-
remainingChildren: s
|
|
74
|
-
};
|
|
66
|
+
function E(...t) {
|
|
67
|
+
return $(x(t));
|
|
75
68
|
}
|
|
76
69
|
export {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
b as
|
|
82
|
-
|
|
83
|
-
S as toPascalCase
|
|
70
|
+
E as cn,
|
|
71
|
+
A as createSafeContext,
|
|
72
|
+
m as formatThousands,
|
|
73
|
+
S as getFontSize,
|
|
74
|
+
b as textFormatter,
|
|
75
|
+
P as toPascalCase
|
|
84
76
|
};
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/lumen-ui-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.67",
|
|
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.16",
|
|
45
45
|
"i18next": "^23.7.0",
|
|
46
46
|
"react-i18next": "^14.0.0"
|
|
47
47
|
},
|