@ledgerhq/lumen-ui-react 0.0.66 → 0.0.68
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 +10 -8
- 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 +5 -4
- package/dist/lib/Components/Tile/Tile.d.ts.map +1 -1
- package/dist/lib/Components/Tile/Tile.js +105 -165
- package/dist/lib/Components/Tile/types.d.ts +12 -1
- package/dist/lib/Components/Tile/types.d.ts.map +1 -1
- package/dist/lib/Components/TileButton/TileButton.d.ts +37 -0
- package/dist/lib/Components/TileButton/TileButton.d.ts.map +1 -0
- package/dist/lib/Components/TileButton/TileButton.js +81 -0
- package/dist/lib/Components/TileButton/index.d.ts +3 -0
- package/dist/lib/Components/TileButton/index.d.ts.map +1 -0
- package/dist/lib/Components/TileButton/types.d.ts +45 -0
- package/dist/lib/Components/TileButton/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 +44 -52
- package/dist/package.json +2 -2
- package/package.json +2 -2
|
@@ -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,13 @@ 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
|
-
|
|
32
|
+
centered?: boolean;
|
|
33
|
+
onClick?: import('react').MouseEventHandler<HTMLButtonElement>;
|
|
34
34
|
children: import('react').ReactNode;
|
|
35
35
|
className?: string;
|
|
36
36
|
'aria-label'?: string;
|
|
37
|
-
|
|
37
|
+
secondaryAction?: import('react').ReactNode;
|
|
38
|
+
} & Omit<import('react').HTMLAttributes<HTMLButtonElement>, "onClick"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
38
39
|
/**
|
|
39
40
|
* A spot adapter for use within Tile. Automatically inherits the disabled state from the parent Tile.
|
|
40
41
|
* Always renders at a fixed size of 48.
|
|
@@ -85,7 +86,7 @@ export declare const TileDescription: {
|
|
|
85
86
|
* </Tile>
|
|
86
87
|
*/
|
|
87
88
|
export declare const TileSecondaryAction: import('react').ForwardRefExoticComponent<{
|
|
88
|
-
onClick?: MouseEventHandler;
|
|
89
|
+
onClick?: import('react').MouseEventHandler;
|
|
89
90
|
icon: React.ComponentType<Omit<import('../Icon').IconProps, "children">>;
|
|
90
91
|
className?: string;
|
|
91
92
|
} & 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;AAuCjB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,IAAI;;;;;;;;;uHAyChB,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,182 @@
|
|
|
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 n } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { cva as f } from "class-variance-authority";
|
|
4
|
+
import { forwardRef as b, 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, l] = v("Tile"), m = {
|
|
8
|
+
root: f([
|
|
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: f(
|
|
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: "",
|
|
23
|
+
true: "cursor-default",
|
|
24
|
+
false: "cursor-pointer"
|
|
25
|
+
},
|
|
26
|
+
centered: {
|
|
27
|
+
true: "h-full justify-center",
|
|
25
28
|
false: ""
|
|
26
29
|
}
|
|
27
30
|
},
|
|
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
31
|
defaultVariants: {
|
|
55
32
|
appearance: "no-background",
|
|
56
|
-
|
|
57
|
-
|
|
33
|
+
disabled: !1,
|
|
34
|
+
centered: !1
|
|
58
35
|
}
|
|
59
36
|
}
|
|
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
37
|
)
|
|
64
|
-
},
|
|
38
|
+
}, h = b(
|
|
65
39
|
({
|
|
66
40
|
className: e,
|
|
67
|
-
onClick:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
-
}
|
|
41
|
+
onClick: t,
|
|
42
|
+
secondaryAction: r,
|
|
43
|
+
appearance: o = "no-background",
|
|
44
|
+
disabled: i = !1,
|
|
45
|
+
centered: c = !1,
|
|
46
|
+
children: d,
|
|
47
|
+
style: u,
|
|
48
|
+
...p
|
|
49
|
+
}, s) => /* @__PURE__ */ a(g, { value: { disabled: i }, children: /* @__PURE__ */ T(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
ref: s,
|
|
53
|
+
style: u,
|
|
54
|
+
className: m.root({
|
|
55
|
+
className: e
|
|
56
|
+
}),
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ a(
|
|
59
|
+
"button",
|
|
60
|
+
{
|
|
61
|
+
...p,
|
|
62
|
+
onClick: t,
|
|
63
|
+
disabled: i,
|
|
64
|
+
className: m.inner({
|
|
65
|
+
appearance: o,
|
|
66
|
+
disabled: i,
|
|
67
|
+
centered: c
|
|
68
|
+
}),
|
|
69
|
+
children: d
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
r
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
) })
|
|
135
76
|
);
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
const { disabled:
|
|
77
|
+
h.displayName = "Tile";
|
|
78
|
+
const S = (e) => {
|
|
79
|
+
const { disabled: t } = l({
|
|
139
80
|
consumerName: "TileSpot",
|
|
140
81
|
contextRequired: !0
|
|
141
82
|
});
|
|
142
|
-
return /* @__PURE__ */
|
|
83
|
+
return /* @__PURE__ */ a(y, { ...e, size: 48, disabled: t });
|
|
143
84
|
};
|
|
144
|
-
|
|
145
|
-
const
|
|
85
|
+
S.displayName = "TileSpot";
|
|
86
|
+
const w = ({
|
|
146
87
|
children: e,
|
|
147
|
-
className:
|
|
88
|
+
className: t,
|
|
148
89
|
...r
|
|
149
|
-
}) => /* @__PURE__ */
|
|
90
|
+
}) => /* @__PURE__ */ a(
|
|
150
91
|
"div",
|
|
151
92
|
{
|
|
152
|
-
className:
|
|
93
|
+
className: n("flex w-full flex-col items-center text-center", t),
|
|
153
94
|
...r,
|
|
154
95
|
children: e
|
|
155
96
|
}
|
|
156
97
|
);
|
|
157
|
-
|
|
158
|
-
const
|
|
98
|
+
w.displayName = "TileContent";
|
|
99
|
+
const R = ({
|
|
159
100
|
children: e,
|
|
160
|
-
className:
|
|
101
|
+
className: t,
|
|
161
102
|
...r
|
|
162
103
|
}) => {
|
|
163
|
-
const { disabled:
|
|
104
|
+
const { disabled: o } = l({
|
|
164
105
|
consumerName: "TileTitle",
|
|
165
106
|
contextRequired: !0
|
|
166
107
|
});
|
|
167
|
-
return /* @__PURE__ */
|
|
108
|
+
return /* @__PURE__ */ a(
|
|
168
109
|
"div",
|
|
169
110
|
{
|
|
170
|
-
className:
|
|
111
|
+
className: n(
|
|
171
112
|
"w-full truncate body-2-semi-bold",
|
|
172
|
-
|
|
173
|
-
|
|
113
|
+
o && "text-disabled",
|
|
114
|
+
t
|
|
174
115
|
),
|
|
175
116
|
...r,
|
|
176
117
|
children: e
|
|
177
118
|
}
|
|
178
119
|
);
|
|
179
120
|
};
|
|
180
|
-
|
|
181
|
-
const
|
|
121
|
+
R.displayName = "TileTitle";
|
|
122
|
+
const j = ({
|
|
182
123
|
children: e,
|
|
183
|
-
className:
|
|
124
|
+
className: t,
|
|
184
125
|
...r
|
|
185
126
|
}) => {
|
|
186
|
-
const { disabled:
|
|
127
|
+
const { disabled: o } = l({
|
|
187
128
|
consumerName: "TileDescription",
|
|
188
129
|
contextRequired: !0
|
|
189
130
|
});
|
|
190
|
-
return /* @__PURE__ */
|
|
131
|
+
return /* @__PURE__ */ a(
|
|
191
132
|
"div",
|
|
192
133
|
{
|
|
193
|
-
className:
|
|
134
|
+
className: n(
|
|
194
135
|
"w-full truncate body-3",
|
|
195
|
-
|
|
196
|
-
|
|
136
|
+
o ? "text-disabled" : "text-muted",
|
|
137
|
+
t
|
|
197
138
|
),
|
|
198
139
|
...r,
|
|
199
140
|
children: e
|
|
200
141
|
}
|
|
201
142
|
);
|
|
202
143
|
};
|
|
203
|
-
|
|
204
|
-
const
|
|
205
|
-
const { disabled:
|
|
144
|
+
j.displayName = "TileDescription";
|
|
145
|
+
const q = b(({ onClick: e, icon: t, className: r, "aria-label": o, ...i }, c) => {
|
|
146
|
+
const { disabled: d } = l({
|
|
206
147
|
consumerName: "TileSecondaryAction",
|
|
207
148
|
contextRequired: !0
|
|
208
|
-
}),
|
|
209
|
-
(
|
|
210
|
-
|
|
149
|
+
}), u = x(
|
|
150
|
+
(s) => {
|
|
151
|
+
s.stopPropagation(), s.preventDefault(), e == null || e(s);
|
|
211
152
|
},
|
|
212
153
|
[e]
|
|
213
154
|
);
|
|
214
|
-
if (
|
|
215
|
-
const
|
|
216
|
-
return /* @__PURE__ */
|
|
217
|
-
|
|
155
|
+
if (d) return null;
|
|
156
|
+
const p = t;
|
|
157
|
+
return /* @__PURE__ */ a(
|
|
158
|
+
N,
|
|
218
159
|
{
|
|
219
|
-
|
|
220
|
-
className: u(
|
|
160
|
+
className: n(
|
|
221
161
|
"absolute top-8 right-4 opacity-0 transition-opacity duration-200 group-hover:opacity-100 focus-within:opacity-100",
|
|
222
162
|
r
|
|
223
163
|
),
|
|
224
164
|
"data-secondary-button-container": !0,
|
|
225
165
|
iconType: "stroked",
|
|
226
|
-
onClick:
|
|
227
|
-
"aria-label":
|
|
228
|
-
ref:
|
|
229
|
-
...
|
|
230
|
-
children: /* @__PURE__ */
|
|
166
|
+
onClick: u,
|
|
167
|
+
"aria-label": o,
|
|
168
|
+
ref: c,
|
|
169
|
+
...i,
|
|
170
|
+
children: /* @__PURE__ */ a(p, { size: 24 })
|
|
231
171
|
}
|
|
232
172
|
);
|
|
233
173
|
});
|
|
234
|
-
|
|
174
|
+
q.displayName = "TileSecondaryAction";
|
|
235
175
|
export {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
176
|
+
h as Tile,
|
|
177
|
+
w as TileContent,
|
|
178
|
+
j as TileDescription,
|
|
179
|
+
q as TileSecondaryAction,
|
|
180
|
+
S as TileSpot,
|
|
181
|
+
R as TileTitle
|
|
242
182
|
};
|
|
@@ -18,6 +18,12 @@ export type TileProps = {
|
|
|
18
18
|
* @default false
|
|
19
19
|
*/
|
|
20
20
|
disabled?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the tile content should be centered vertically.
|
|
23
|
+
* Useful when the tile has a fixed height and you want the content centered.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
centered?: boolean;
|
|
21
27
|
/**
|
|
22
28
|
* The function to call when the tile is clicked.
|
|
23
29
|
*/
|
|
@@ -36,7 +42,12 @@ export type TileProps = {
|
|
|
36
42
|
* Aria label for accessibility.
|
|
37
43
|
*/
|
|
38
44
|
'aria-label'?: string;
|
|
39
|
-
|
|
45
|
+
/**
|
|
46
|
+
* The secondary action to display inside the tile.
|
|
47
|
+
* Typically contains a TileSecondaryAction component.
|
|
48
|
+
*/
|
|
49
|
+
secondaryAction?: ReactNode;
|
|
50
|
+
} & Omit<HTMLAttributes<HTMLButtonElement>, 'onClick'>;
|
|
40
51
|
export type TileSpotProps = DiscriminatedSpotProps;
|
|
41
52
|
export type TileContentProps = {
|
|
42
53
|
/**
|
|
@@ -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;;;;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"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A compact button component displaying an icon above a label in a vertical layout.
|
|
4
|
+
* Ideal for grids, toolbars, or quick action menus.
|
|
5
|
+
*
|
|
6
|
+
* @see {@link https://ldls.vercel.app/?path=/docs/action-tilebutton--docs Storybook}
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { TileButton } from '@ledgerhq/lumen-ui-react';
|
|
10
|
+
* import { Settings } from '@ledgerhq/lumen-ui-react/symbols';
|
|
11
|
+
*
|
|
12
|
+
* <TileButton icon={Settings} onClick={() => console.log('clicked')}>
|
|
13
|
+
* Settings
|
|
14
|
+
* </TileButton>
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // Using with router (asChild pattern)
|
|
18
|
+
* import { Link } from 'react-router-dom';
|
|
19
|
+
*
|
|
20
|
+
* <TileButton asChild icon={Settings}>
|
|
21
|
+
* <Link to="/settings">Settings</Link>
|
|
22
|
+
* </TileButton>
|
|
23
|
+
*/
|
|
24
|
+
export declare const TileButton: React.ForwardRefExoticComponent<{
|
|
25
|
+
icon: React.ComponentType<{
|
|
26
|
+
size?: import('../Icon').IconSize;
|
|
27
|
+
className?: string;
|
|
28
|
+
}>;
|
|
29
|
+
children: React.ReactNode;
|
|
30
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
isFull?: boolean;
|
|
33
|
+
className?: string;
|
|
34
|
+
'aria-label'?: string;
|
|
35
|
+
asChild?: boolean;
|
|
36
|
+
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "children" | "onClick"> & React.RefAttributes<HTMLButtonElement>>;
|
|
37
|
+
//# sourceMappingURL=TileButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TileButton.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/TileButton/TileButton.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAsC3C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,UAAU;;YAvDlB,CAAC;iBAAqB,CAAC;;;;;;;;;yHAuG3B,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsxs as b, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { cn as p } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { Slot as v, Slottable as x } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as r } from "class-variance-authority";
|
|
5
|
+
import g, { useCallback as N } from "react";
|
|
6
|
+
const V = r(
|
|
7
|
+
[
|
|
8
|
+
"flex flex-col items-center gap-8 rounded-md p-12",
|
|
9
|
+
"bg-muted body-2-semi-bold text-base transition-colors",
|
|
10
|
+
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus"
|
|
11
|
+
],
|
|
12
|
+
{
|
|
13
|
+
variants: {
|
|
14
|
+
disabled: {
|
|
15
|
+
true: "bg-disabled text-disabled cursor-not-allowed",
|
|
16
|
+
false: "hover:bg-muted-hover active:bg-muted-pressed cursor-pointer"
|
|
17
|
+
},
|
|
18
|
+
isFull: {
|
|
19
|
+
true: "w-full"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
disabled: !1,
|
|
24
|
+
isFull: !1
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
), j = r("shrink-0", {
|
|
28
|
+
variants: {
|
|
29
|
+
disabled: {
|
|
30
|
+
true: "text-disabled",
|
|
31
|
+
false: "text-base"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
defaultVariants: {
|
|
35
|
+
disabled: !1
|
|
36
|
+
}
|
|
37
|
+
}), w = g.forwardRef(
|
|
38
|
+
({
|
|
39
|
+
icon: i,
|
|
40
|
+
children: l,
|
|
41
|
+
onClick: t,
|
|
42
|
+
disabled: e = !1,
|
|
43
|
+
isFull: n = !1,
|
|
44
|
+
className: u,
|
|
45
|
+
asChild: a = !1,
|
|
46
|
+
"aria-label": f,
|
|
47
|
+
...c
|
|
48
|
+
}, d) => {
|
|
49
|
+
const m = N(
|
|
50
|
+
(o) => {
|
|
51
|
+
if (e) {
|
|
52
|
+
o.preventDefault();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
t == null || t(o);
|
|
56
|
+
},
|
|
57
|
+
[e, t]
|
|
58
|
+
);
|
|
59
|
+
return /* @__PURE__ */ b(
|
|
60
|
+
a ? v : "button",
|
|
61
|
+
{
|
|
62
|
+
ref: d,
|
|
63
|
+
type: a ? void 0 : "button",
|
|
64
|
+
className: p(V({ disabled: e, isFull: n }), u),
|
|
65
|
+
onClick: m,
|
|
66
|
+
disabled: e,
|
|
67
|
+
"data-disabled": e || void 0,
|
|
68
|
+
"aria-label": f,
|
|
69
|
+
...c,
|
|
70
|
+
children: [
|
|
71
|
+
/* @__PURE__ */ s(i, { size: 20, className: j({ disabled: e }) }),
|
|
72
|
+
a ? /* @__PURE__ */ s(x, { children: l }) : /* @__PURE__ */ s("span", { className: "line-clamp-2 text-center", children: l })
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
w.displayName = "TileButton";
|
|
79
|
+
export {
|
|
80
|
+
w as TileButton
|
|
81
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/TileButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,cAAc,SAAS,CAAC"}
|