@ledgerhq/lumen-ui-react 0.0.59 → 0.0.60
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 +83 -76
- package/dist/lib/Components/AmountInput/AmountInput.js +10 -10
- package/dist/lib/Components/BaseInput/BaseInput.js +4 -4
- package/dist/lib/Components/Dialog/Dialog.d.ts +1 -0
- package/dist/lib/Components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/lib/Components/Dialog/Dialog.js +32 -31
- package/dist/lib/Components/Dialog/types.d.ts +6 -0
- package/dist/lib/Components/Dialog/types.d.ts.map +1 -1
- package/dist/lib/Components/Divider/Divider.d.ts +24 -0
- package/dist/lib/Components/Divider/Divider.d.ts.map +1 -0
- package/dist/lib/Components/Divider/Divider.js +23 -0
- package/dist/lib/Components/Divider/index.d.ts +3 -0
- package/dist/lib/Components/Divider/index.d.ts.map +1 -0
- package/dist/lib/Components/Divider/types.d.ts +9 -0
- package/dist/lib/Components/Divider/types.d.ts.map +1 -0
- package/dist/lib/Components/Link/Link.js +5 -5
- package/dist/lib/Components/ListItem/ListItem.js +5 -5
- package/dist/lib/Components/Menu/Menu.d.ts.map +1 -1
- package/dist/lib/Components/Menu/Menu.js +80 -78
- package/dist/lib/Components/Select/Select.d.ts.map +1 -1
- package/dist/lib/Components/Select/Select.js +76 -74
- 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 +75 -45
- package/dist/lib/Components/Tile/Tile.d.ts.map +1 -1
- package/dist/lib/Components/Tile/Tile.js +168 -99
- package/dist/lib/Components/Tile/index.d.ts +1 -1
- package/dist/lib/Components/Tile/index.d.ts.map +1 -1
- package/dist/lib/Components/Tile/types.d.ts +68 -26
- package/dist/lib/Components/Tile/types.d.ts.map +1 -1
- 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 +52 -44
- package/dist/package.json +2 -2
- package/package.json +2 -2
|
@@ -1,56 +1,86 @@
|
|
|
1
|
-
import { TileProps } from './types';
|
|
1
|
+
import { TileContentProps, TileDescriptionProps, TileProps, TileSecondaryActionProps, TileSpotProps, TileTitleProps } from './types';
|
|
2
2
|
/**
|
|
3
|
-
* A tile
|
|
4
|
-
*
|
|
5
|
-
* and can optionally display a secondary action that appears on hover or focus.
|
|
3
|
+
* A flexible tile component that uses a composite pattern for maximum customization.
|
|
4
|
+
* Displays content in a vertical layout with support for spots, text, and custom content.
|
|
6
5
|
*
|
|
7
6
|
* @see {@link https://ldls.vercel.app/?path=/docs/components-Tile-overview--docs Storybook}
|
|
8
7
|
* @see {@link https://ldls.vercel.app/?path=/docs/components-Tile-implementation--docs#dos-and-donts Guidelines}
|
|
9
8
|
*
|
|
10
|
-
* @warning The `className` prop should only be used for layout adjustments like margins or positioning.
|
|
11
|
-
* Do not use it to modify the list item's core appearance (colors, padding, etc).
|
|
12
|
-
*
|
|
13
9
|
* @example
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
10
|
+
* import {
|
|
11
|
+
* Tile,
|
|
12
|
+
* TileSpot,
|
|
13
|
+
* TileContent,
|
|
14
|
+
* TileTitle,
|
|
15
|
+
* TileSecondaryAction,
|
|
16
|
+
* Tag
|
|
17
|
+
* } from '@ledgerhq/lumen-ui-react';
|
|
18
|
+
* import { Bitcoin, MoreVertical } from '@ledgerhq/lumen-ui-react/symbols';
|
|
23
19
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
20
|
+
* <Tile appearance="card">
|
|
21
|
+
* <TileSecondaryAction icon={MoreVertical} onClick={() => console.log('More')} />
|
|
22
|
+
* <TileSpot appearance="icon" icon={Bitcoin} />
|
|
23
|
+
* <TileContent>
|
|
24
|
+
* <TileTitle>Bitcoin</TileTitle>
|
|
25
|
+
* </TileContent>
|
|
26
|
+
* <div>Custom content</div>
|
|
27
|
+
* </Tile>
|
|
28
|
+
*/
|
|
29
|
+
export declare const Tile: {
|
|
30
|
+
({ className, onClick, appearance, disabled, "aria-label": ariaLabel, children, onMouseDown, onMouseUp, onMouseLeave, ...props }: TileProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* A spot adapter for use within Tile. Automatically inherits the disabled state from the parent Tile.
|
|
35
|
+
* Always renders at a fixed size of 48.
|
|
36
|
+
*/
|
|
37
|
+
export declare const TileSpot: {
|
|
38
|
+
(props: TileSpotProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
displayName: string;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* A container for grouping TileTitle and TileDescription with consistent spacing.
|
|
43
|
+
* Use this to wrap text content within a Tile.
|
|
44
|
+
*/
|
|
45
|
+
export declare const TileContent: {
|
|
46
|
+
({ children, className, ...props }: TileContentProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
displayName: string;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* The primary text label for a Tile. Automatically inherits the disabled state from the parent Tile.
|
|
51
|
+
* Text will truncate with ellipsis if it exceeds the available width.
|
|
52
|
+
*/
|
|
53
|
+
export declare const TileTitle: {
|
|
54
|
+
({ children, className, ...props }: TileTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
displayName: string;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* The secondary text label for a Tile. Automatically inherits the disabled state from the parent Tile.
|
|
59
|
+
* Text will truncate with ellipsis if it exceeds the available width.
|
|
60
|
+
*/
|
|
61
|
+
export declare const TileDescription: {
|
|
62
|
+
({ children, className, ...props }: TileDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
63
|
+
displayName: string;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* A self-contained secondary action button for a Tile. Renders an InteractiveIcon that appears
|
|
67
|
+
* in the top-right corner and is visible on hover/focus. Automatically hidden when the parent Tile is disabled.
|
|
35
68
|
*
|
|
36
|
-
*
|
|
37
|
-
* import {
|
|
38
|
-
* import { InteractiveIcon } from '@ledgerhq/lumen-ui-react';
|
|
39
|
-
* import { Settings, Ethereum, MoreVertical } from '@ledgerhq/lumen-ui-react/symbols';
|
|
69
|
+
* @example
|
|
70
|
+
* import { MoreVertical } from '@ledgerhq/lumen-ui-react/symbols';
|
|
40
71
|
*
|
|
41
|
-
* <Tile
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* <MoreVertical />
|
|
51
|
-
* </InteractiveIcon>
|
|
52
|
-
* }
|
|
53
|
-
* />
|
|
72
|
+
* <Tile>
|
|
73
|
+
* <TileSecondaryAction
|
|
74
|
+
* icon={MoreVertical}
|
|
75
|
+
* onClick={(e) => console.log('Secondary action clicked')}
|
|
76
|
+
* />
|
|
77
|
+
* <TileContent>
|
|
78
|
+
* <TileTitle>My Title</TileTitle>
|
|
79
|
+
* </TileContent>
|
|
80
|
+
* </Tile>
|
|
54
81
|
*/
|
|
55
|
-
export declare const
|
|
82
|
+
export declare const TileSecondaryAction: {
|
|
83
|
+
({ onClick, icon, className, "aria-label": ariaLabel, ...props }: TileSecondaryActionProps): import("react/jsx-runtime").JSX.Element | null;
|
|
84
|
+
displayName: string;
|
|
85
|
+
};
|
|
56
86
|
//# sourceMappingURL=Tile.d.ts.map
|
|
@@ -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":"AASA,OAAO,EACL,gBAAgB,EAEhB,oBAAoB,EACpB,SAAS,EACT,wBAAwB,EACxB,aAAa,EACb,cAAc,EACf,MAAM,SAAS,CAAC;AAgEjB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,IAAI;sIAWd,SAAS;;CAqFX,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,QAAQ;YAAW,aAAa;;CAM5C,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,WAAW;wCAIrB,gBAAgB;;CAYlB,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;sEAM7B,wBAAwB;;CAmC1B,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { cva as
|
|
4
|
-
import { useState as
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsx as l, jsxs as k } from "react/jsx-runtime";
|
|
2
|
+
import { extractSlottable as q, createSafeContext as C, cn as d } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { cva as b } from "class-variance-authority";
|
|
4
|
+
import { useState as I, useCallback as n } from "react";
|
|
5
|
+
import { Spot as R } from "../Spot/Spot.js";
|
|
6
|
+
import { InteractiveIcon as z } from "../InteractiveIcon/InteractiveIcon.js";
|
|
7
|
+
const [V, u] = C("Tile"), v = {
|
|
8
|
+
root: b(
|
|
7
9
|
[
|
|
8
|
-
"group relative flex flex-col items-center text-base transition-colors",
|
|
9
|
-
"
|
|
10
|
-
"gap-8 px-8 py-12"
|
|
10
|
+
"group relative flex flex-col items-center gap-8 text-base transition-colors",
|
|
11
|
+
"focus-visible:outline-focus rounded-md focus-visible:outline-2"
|
|
11
12
|
],
|
|
12
13
|
{
|
|
13
14
|
variants: {
|
|
@@ -57,122 +58,190 @@ const u = {
|
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
60
|
),
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
defaultVariants: {
|
|
68
|
-
disabled: !1
|
|
69
|
-
}
|
|
70
|
-
}),
|
|
71
|
-
description: o("truncate body-3", {
|
|
72
|
-
variants: {
|
|
73
|
-
disabled: {
|
|
74
|
-
true: "text-disabled",
|
|
75
|
-
false: "text-muted"
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
defaultVariants: {
|
|
79
|
-
disabled: !1
|
|
80
|
-
}
|
|
81
|
-
})
|
|
82
|
-
}, H = ({
|
|
83
|
-
className: b,
|
|
84
|
-
title: f,
|
|
85
|
-
description: d,
|
|
86
|
-
leadingContent: m,
|
|
87
|
-
secondaryAction: v,
|
|
88
|
-
trailingContent: h,
|
|
61
|
+
button: b(
|
|
62
|
+
"focus-visible:outline-focus flex w-full flex-col items-center gap-8 rounded-md px-8 py-12 focus-visible:outline-2"
|
|
63
|
+
)
|
|
64
|
+
}, j = ({
|
|
65
|
+
className: e,
|
|
89
66
|
onClick: i,
|
|
90
|
-
appearance:
|
|
67
|
+
appearance: s = "no-background",
|
|
91
68
|
disabled: t = !1,
|
|
92
|
-
"aria-label":
|
|
93
|
-
|
|
69
|
+
"aria-label": p,
|
|
70
|
+
children: m,
|
|
71
|
+
onMouseDown: c,
|
|
72
|
+
onMouseUp: o,
|
|
73
|
+
onMouseLeave: r,
|
|
74
|
+
...x
|
|
94
75
|
}) => {
|
|
95
|
-
const [
|
|
76
|
+
const [g, f] = I(!1), { slotElement: y, remainingChildren: N } = q(
|
|
77
|
+
m,
|
|
78
|
+
T
|
|
79
|
+
), h = n(
|
|
96
80
|
(a) => {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
i == null || i(a);
|
|
81
|
+
a.target.closest(
|
|
82
|
+
"[data-secondary-button-container]"
|
|
83
|
+
) || (c == null || c(a), f(!0));
|
|
102
84
|
},
|
|
103
|
-
[
|
|
104
|
-
),
|
|
85
|
+
[c]
|
|
86
|
+
), A = n(
|
|
105
87
|
(a) => {
|
|
106
|
-
|
|
88
|
+
f(!1), o == null || o(a);
|
|
107
89
|
},
|
|
108
|
-
[]
|
|
109
|
-
),
|
|
90
|
+
[o]
|
|
91
|
+
), S = n(
|
|
110
92
|
(a) => {
|
|
111
|
-
|
|
112
|
-
"[data-secondary-button-container]"
|
|
113
|
-
) || r(!0);
|
|
93
|
+
f(!1), r == null || r(a);
|
|
114
94
|
},
|
|
115
|
-
[
|
|
116
|
-
)
|
|
117
|
-
|
|
118
|
-
}, [t]), k = l(() => {
|
|
119
|
-
t || r(!1);
|
|
120
|
-
}, [t]);
|
|
121
|
-
return /* @__PURE__ */ c(
|
|
95
|
+
[r]
|
|
96
|
+
);
|
|
97
|
+
return /* @__PURE__ */ l(V, { value: { disabled: t }, children: /* @__PURE__ */ k(
|
|
122
98
|
"div",
|
|
123
99
|
{
|
|
124
|
-
...
|
|
125
|
-
className:
|
|
126
|
-
appearance:
|
|
127
|
-
isActive:
|
|
100
|
+
...x,
|
|
101
|
+
className: v.root({
|
|
102
|
+
appearance: s,
|
|
103
|
+
isActive: g,
|
|
128
104
|
disabled: t,
|
|
129
|
-
className:
|
|
105
|
+
className: e
|
|
130
106
|
}),
|
|
131
|
-
onMouseDown: (a) => {
|
|
132
|
-
|
|
133
|
-
(n = e == null ? void 0 : e.onMouseDown) == null || n.call(e, a), A(a);
|
|
107
|
+
onMouseDown: t ? void 0 : (a) => {
|
|
108
|
+
h(a);
|
|
134
109
|
},
|
|
135
|
-
onMouseUp: (a) => {
|
|
136
|
-
|
|
137
|
-
(n = e == null ? void 0 : e.onMouseUp) == null || n.call(e, a), w(a);
|
|
110
|
+
onMouseUp: t ? void 0 : (a) => {
|
|
111
|
+
A(a);
|
|
138
112
|
},
|
|
139
|
-
onMouseLeave: (a) => {
|
|
140
|
-
|
|
141
|
-
(n = e == null ? void 0 : e.onMouseLeave) == null || n.call(e, a), k(a);
|
|
113
|
+
onMouseLeave: t ? void 0 : (a) => {
|
|
114
|
+
S(a);
|
|
142
115
|
},
|
|
143
116
|
children: [
|
|
144
|
-
/* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ l(
|
|
145
118
|
"button",
|
|
146
119
|
{
|
|
147
|
-
"aria-label":
|
|
148
|
-
onClick:
|
|
120
|
+
"aria-label": p,
|
|
121
|
+
onClick: t ? void 0 : i,
|
|
149
122
|
disabled: t,
|
|
150
123
|
"data-disabled": t || void 0,
|
|
151
|
-
className:
|
|
152
|
-
children:
|
|
153
|
-
/* @__PURE__ */ s("div", { className: "flex items-center justify-center", children: m }),
|
|
154
|
-
/* @__PURE__ */ c("div", { className: "flex w-full flex-col items-center gap-4", children: [
|
|
155
|
-
/* @__PURE__ */ c("div", { className: "flex w-full flex-col text-center", children: [
|
|
156
|
-
/* @__PURE__ */ s("div", { className: u.title({ disabled: t }), children: f }),
|
|
157
|
-
d && /* @__PURE__ */ s("div", { className: u.description({ disabled: t }), children: d })
|
|
158
|
-
] }),
|
|
159
|
-
h
|
|
160
|
-
] })
|
|
161
|
-
]
|
|
124
|
+
className: v.button(),
|
|
125
|
+
children: N
|
|
162
126
|
}
|
|
163
127
|
),
|
|
164
|
-
|
|
165
|
-
"div",
|
|
166
|
-
{
|
|
167
|
-
className: "absolute right-4 top-4 opacity-0 transition-opacity duration-200 focus-within:opacity-100 group-hover:opacity-100",
|
|
168
|
-
"data-secondary-button-container": !0,
|
|
169
|
-
children: /* @__PURE__ */ s(D, { onClick: M, children: v })
|
|
170
|
-
}
|
|
171
|
-
)
|
|
128
|
+
y
|
|
172
129
|
]
|
|
173
130
|
}
|
|
131
|
+
) });
|
|
132
|
+
};
|
|
133
|
+
j.displayName = "Tile";
|
|
134
|
+
const w = (e) => {
|
|
135
|
+
const { disabled: i } = u({
|
|
136
|
+
consumerName: "TileSpot",
|
|
137
|
+
contextRequired: !0
|
|
138
|
+
});
|
|
139
|
+
return /* @__PURE__ */ l(R, { ...e, size: 48, disabled: i });
|
|
140
|
+
};
|
|
141
|
+
w.displayName = "TileSpot";
|
|
142
|
+
const P = ({
|
|
143
|
+
children: e,
|
|
144
|
+
className: i,
|
|
145
|
+
...s
|
|
146
|
+
}) => /* @__PURE__ */ l(
|
|
147
|
+
"div",
|
|
148
|
+
{
|
|
149
|
+
className: d(
|
|
150
|
+
"flex w-full flex-col items-center gap-4 text-center",
|
|
151
|
+
i
|
|
152
|
+
),
|
|
153
|
+
...s,
|
|
154
|
+
children: e
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
P.displayName = "TileContent";
|
|
158
|
+
const D = ({
|
|
159
|
+
children: e,
|
|
160
|
+
className: i,
|
|
161
|
+
...s
|
|
162
|
+
}) => {
|
|
163
|
+
const { disabled: t } = u({
|
|
164
|
+
consumerName: "TileTitle",
|
|
165
|
+
contextRequired: !0
|
|
166
|
+
});
|
|
167
|
+
return /* @__PURE__ */ l(
|
|
168
|
+
"div",
|
|
169
|
+
{
|
|
170
|
+
className: d(
|
|
171
|
+
"body-2-semi-bold w-full truncate",
|
|
172
|
+
t && "text-disabled",
|
|
173
|
+
i
|
|
174
|
+
),
|
|
175
|
+
...s,
|
|
176
|
+
children: e
|
|
177
|
+
}
|
|
178
|
+
);
|
|
179
|
+
};
|
|
180
|
+
D.displayName = "TileTitle";
|
|
181
|
+
const E = ({
|
|
182
|
+
children: e,
|
|
183
|
+
className: i,
|
|
184
|
+
...s
|
|
185
|
+
}) => {
|
|
186
|
+
const { disabled: t } = u({
|
|
187
|
+
consumerName: "TileDescription",
|
|
188
|
+
contextRequired: !0
|
|
189
|
+
});
|
|
190
|
+
return /* @__PURE__ */ l(
|
|
191
|
+
"div",
|
|
192
|
+
{
|
|
193
|
+
className: d(
|
|
194
|
+
"body-3 w-full truncate",
|
|
195
|
+
t ? "text-disabled" : "text-muted",
|
|
196
|
+
i
|
|
197
|
+
),
|
|
198
|
+
...s,
|
|
199
|
+
children: e
|
|
200
|
+
}
|
|
201
|
+
);
|
|
202
|
+
};
|
|
203
|
+
E.displayName = "TileDescription";
|
|
204
|
+
const T = ({
|
|
205
|
+
onClick: e,
|
|
206
|
+
icon: i,
|
|
207
|
+
className: s,
|
|
208
|
+
"aria-label": t,
|
|
209
|
+
...p
|
|
210
|
+
}) => {
|
|
211
|
+
const { disabled: m } = u({
|
|
212
|
+
consumerName: "TileSecondaryAction",
|
|
213
|
+
contextRequired: !0
|
|
214
|
+
}), c = n(
|
|
215
|
+
(r) => {
|
|
216
|
+
r.stopPropagation(), r.preventDefault(), e == null || e(r);
|
|
217
|
+
},
|
|
218
|
+
[e]
|
|
219
|
+
);
|
|
220
|
+
if (m) return null;
|
|
221
|
+
const o = i;
|
|
222
|
+
return /* @__PURE__ */ l(
|
|
223
|
+
z,
|
|
224
|
+
{
|
|
225
|
+
"data-slot": "tile-secondary-action",
|
|
226
|
+
className: d(
|
|
227
|
+
"absolute right-12 top-16 opacity-0 transition-opacity duration-200 focus-within:opacity-100 group-hover:opacity-100",
|
|
228
|
+
s
|
|
229
|
+
),
|
|
230
|
+
"data-secondary-button-container": !0,
|
|
231
|
+
iconType: "stroked",
|
|
232
|
+
onClick: c,
|
|
233
|
+
"aria-label": t,
|
|
234
|
+
...p,
|
|
235
|
+
children: /* @__PURE__ */ l(o, { size: 24 })
|
|
236
|
+
}
|
|
174
237
|
);
|
|
175
238
|
};
|
|
239
|
+
T.displayName = "TileSecondaryAction";
|
|
176
240
|
export {
|
|
177
|
-
|
|
241
|
+
j as Tile,
|
|
242
|
+
P as TileContent,
|
|
243
|
+
E as TileDescription,
|
|
244
|
+
T as TileSecondaryAction,
|
|
245
|
+
w as TileSpot,
|
|
246
|
+
D as TileTitle
|
|
178
247
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Tile/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Tile/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,SAAS,EACT,eAAe,EACf,mBAAmB,GACpB,MAAM,QAAQ,CAAC;AAChB,cAAc,SAAS,CAAC"}
|
|
@@ -1,44 +1,86 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { HTMLAttributes, MouseEventHandler, ReactNode } from 'react';
|
|
2
|
+
import { IconProps } from '../Icon';
|
|
3
|
+
import { DiscriminatedSpotProps } from '../Spot/types';
|
|
4
|
+
export type TileContextValue = {
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
};
|
|
2
7
|
export type TileProps = {
|
|
3
8
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
9
|
+
* The visual appearance of the tile background.
|
|
10
|
+
* - `no-background`: Transparent background (shows hover state)
|
|
11
|
+
* - `card`: Surface background color
|
|
12
|
+
* @default "no-background"
|
|
6
13
|
*/
|
|
7
|
-
|
|
14
|
+
appearance?: 'no-background' | 'card';
|
|
8
15
|
/**
|
|
9
|
-
*
|
|
16
|
+
* Whether the tile is disabled.
|
|
17
|
+
* When disabled, the tile is non-interactive and has disabled styles.
|
|
18
|
+
* @default false
|
|
10
19
|
*/
|
|
11
|
-
|
|
20
|
+
disabled?: boolean;
|
|
12
21
|
/**
|
|
13
|
-
* The
|
|
22
|
+
* The function to call when the tile is clicked.
|
|
14
23
|
*/
|
|
15
|
-
|
|
24
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
16
25
|
/**
|
|
17
|
-
* The
|
|
18
|
-
*
|
|
26
|
+
* The children to display inside the tile.
|
|
27
|
+
* Can include TileSpot, TileContent, TileTitle, TileDescription, TileSecondaryAction, and any custom content.
|
|
19
28
|
*/
|
|
20
|
-
|
|
29
|
+
children: ReactNode;
|
|
21
30
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
31
|
+
* Additional CSS classes for the tile container.
|
|
32
|
+
* Should only be used for layout adjustments like margins or positioning.
|
|
24
33
|
*/
|
|
25
|
-
|
|
34
|
+
className?: string;
|
|
26
35
|
/**
|
|
27
|
-
*
|
|
36
|
+
* Aria label for accessibility.
|
|
28
37
|
*/
|
|
29
|
-
|
|
38
|
+
'aria-label'?: string;
|
|
39
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'onClick'>;
|
|
40
|
+
export type TileSpotProps = DiscriminatedSpotProps;
|
|
41
|
+
export type TileContentProps = {
|
|
30
42
|
/**
|
|
31
|
-
* The
|
|
32
|
-
*
|
|
33
|
-
* - `card`: Surface background color
|
|
34
|
-
* @default "no-background"
|
|
43
|
+
* The children to display inside the tile content area.
|
|
44
|
+
* Typically contains TileTitle and TileDescription.
|
|
35
45
|
*/
|
|
36
|
-
|
|
46
|
+
children: ReactNode;
|
|
37
47
|
/**
|
|
38
|
-
*
|
|
39
|
-
* When disabled, the tile is non-interactive and has disabled styles.
|
|
40
|
-
* @default false
|
|
48
|
+
* Additional CSS classes for the content container.
|
|
41
49
|
*/
|
|
42
|
-
|
|
43
|
-
} &
|
|
50
|
+
className?: string;
|
|
51
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
52
|
+
export type TileTitleProps = {
|
|
53
|
+
/**
|
|
54
|
+
* The title text to display.
|
|
55
|
+
*/
|
|
56
|
+
children: ReactNode;
|
|
57
|
+
/**
|
|
58
|
+
* Additional CSS classes for the title.
|
|
59
|
+
*/
|
|
60
|
+
className?: string;
|
|
61
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
62
|
+
export type TileDescriptionProps = {
|
|
63
|
+
/**
|
|
64
|
+
* The description text to display.
|
|
65
|
+
*/
|
|
66
|
+
children: ReactNode;
|
|
67
|
+
/**
|
|
68
|
+
* Additional CSS classes for the description.
|
|
69
|
+
*/
|
|
70
|
+
className?: string;
|
|
71
|
+
} & HTMLAttributes<HTMLDivElement>;
|
|
72
|
+
export type TileSecondaryActionProps = {
|
|
73
|
+
/**
|
|
74
|
+
* The function to call when the secondary action is clicked.
|
|
75
|
+
*/
|
|
76
|
+
onClick?: MouseEventHandler;
|
|
77
|
+
/**
|
|
78
|
+
* Icon component to render inside the InteractiveIcon.
|
|
79
|
+
*/
|
|
80
|
+
icon: React.ComponentType<Omit<IconProps, 'children'>>;
|
|
81
|
+
/**
|
|
82
|
+
* Additional CSS classes for the secondary action container.
|
|
83
|
+
*/
|
|
84
|
+
className?: string;
|
|
85
|
+
} & Omit<HTMLAttributes<HTMLButtonElement>, 'onClick'>;
|
|
44
86
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Tile/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,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;CACvB,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC,CAAC;AAEpD,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/Components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/Components/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC"}
|