@ledgerhq/lumen-ui-react 0.1.46 → 0.1.48
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 +130 -122
- package/dist/lib/Components/AmountInput/AmountInput.js +2 -2
- package/dist/lib/Components/BaseInput/BaseInput.d.ts +1 -1
- package/dist/lib/Components/BaseInput/BaseInput.d.ts.map +1 -1
- package/dist/lib/Components/BaseInput/BaseInput.js +119 -93
- package/dist/lib/Components/BaseInput/types.d.ts +24 -0
- package/dist/lib/Components/BaseInput/types.d.ts.map +1 -1
- package/dist/lib/Components/Card/Card.js +1 -1
- package/dist/lib/Components/CardButton/CardButton.js +1 -1
- package/dist/lib/Components/DescriptionItem/DescriptionItem.d.ts +1 -1
- package/dist/lib/Components/DescriptionItem/DescriptionItem.d.ts.map +1 -1
- package/dist/lib/Components/DescriptionItem/DescriptionItem.js +74 -48
- package/dist/lib/Components/DescriptionItem/types.d.ts +6 -0
- package/dist/lib/Components/DescriptionItem/types.d.ts.map +1 -1
- package/dist/lib/Components/Dialog/DialogHeader/DialogHeader.js +1 -1
- package/dist/lib/Components/Icon/Icon.js +8 -8
- package/dist/lib/Components/ListItem/ListItem.d.ts.map +1 -1
- package/dist/lib/Components/ListItem/ListItem.js +118 -68
- package/dist/lib/Components/ListItem/types.d.ts +11 -1
- package/dist/lib/Components/ListItem/types.d.ts.map +1 -1
- package/dist/lib/Components/Menu/Menu.d.ts +1 -1
- package/dist/lib/Components/Menu/Menu.d.ts.map +1 -1
- package/dist/lib/Components/Menu/Menu.js +79 -65
- package/dist/lib/Components/Menu/types.d.ts +6 -0
- package/dist/lib/Components/Menu/types.d.ts.map +1 -1
- package/dist/lib/Components/SearchInput/SearchInput.js +10 -10
- package/dist/lib/Components/SectionHeader/SectionHeader.d.ts +33 -0
- package/dist/lib/Components/SectionHeader/SectionHeader.d.ts.map +1 -0
- package/dist/lib/Components/SectionHeader/SectionHeader.js +56 -0
- package/dist/lib/Components/SectionHeader/index.d.ts +3 -0
- package/dist/lib/Components/SectionHeader/index.d.ts.map +1 -0
- package/dist/lib/Components/SectionHeader/types.d.ts +26 -0
- package/dist/lib/Components/SectionHeader/types.d.ts.map +1 -0
- package/dist/lib/Components/SideBar/SideBar.js +2 -2
- package/dist/lib/Components/Spot/Spot.js +5 -5
- package/dist/lib/Components/Table/Table.d.ts +24 -3
- package/dist/lib/Components/Table/Table.d.ts.map +1 -1
- package/dist/lib/Components/Table/Table.js +274 -186
- package/dist/lib/Components/Table/types.d.ts +63 -28
- package/dist/lib/Components/Table/types.d.ts.map +1 -1
- package/dist/lib/Components/TileButton/TileButton.d.ts +1 -1
- package/dist/lib/Components/TileButton/TileButton.d.ts.map +1 -1
- package/dist/lib/Components/TileButton/TileButton.js +52 -39
- package/dist/lib/Components/TileButton/types.d.ts +5 -0
- package/dist/lib/Components/TileButton/types.d.ts.map +1 -1
- package/dist/lib/Components/Trend/Trend.js +2 -2
- package/dist/lib/Components/index.d.ts +1 -0
- package/dist/lib/Components/index.d.ts.map +1 -1
- package/dist/lib/Symbols/Icons/Atm.d.ts +29 -0
- package/dist/lib/Symbols/Icons/Atm.d.ts.map +1 -0
- package/dist/lib/Symbols/Icons/Atm.js +28 -0
- package/dist/lib/Symbols/Icons/Cutlery.d.ts +29 -0
- package/dist/lib/Symbols/Icons/Cutlery.d.ts.map +1 -0
- package/dist/lib/Symbols/Icons/Cutlery.js +28 -0
- package/dist/lib/Symbols/Icons/GameControler.d.ts +29 -0
- package/dist/lib/Symbols/Icons/GameControler.d.ts.map +1 -0
- package/dist/lib/Symbols/Icons/GameControler.js +28 -0
- package/dist/lib/Symbols/Icons/Upload.d.ts +29 -0
- package/dist/lib/Symbols/Icons/Upload.d.ts.map +1 -0
- package/dist/lib/Symbols/Icons/Upload.js +28 -0
- package/dist/lib/Symbols/index.d.ts +4 -0
- package/dist/lib/Symbols/index.d.ts.map +1 -1
- package/dist/lib/Symbols/index.js +514 -506
- package/dist/package.json +3 -3
- package/package.json +3 -3
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useDisabledContext as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { useCommonTranslation as
|
|
6
|
-
import { InteractiveIcon as
|
|
7
|
-
import { DeleteCircleFill as
|
|
8
|
-
import {
|
|
9
|
-
|
|
1
|
+
import { jsxs as f, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useDisabledContext as Q, resolveBaseInputPlaceholder as X, useMergedRef as Y, cn as s } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import { cva as g } from "class-variance-authority";
|
|
4
|
+
import { useRef as Z, useId as _, useState as ee, useCallback as te } from "react";
|
|
5
|
+
import { useCommonTranslation as re } from "../../../i18n/useCommonTranslation.js";
|
|
6
|
+
import { InteractiveIcon as se } from "../InteractiveIcon/InteractiveIcon.js";
|
|
7
|
+
import { DeleteCircleFill as k } from "../../Symbols/Icons/DeleteCircleFill.js";
|
|
8
|
+
import { InformationFill as ae } from "../../Symbols/Icons/InformationFill.js";
|
|
9
|
+
import { CheckmarkCircleFill as oe } from "../../Symbols/Icons/CheckmarkCircleFill.js";
|
|
10
|
+
const ne = g(
|
|
10
11
|
[
|
|
11
12
|
"group relative flex h-48 w-full cursor-text items-center gap-8 rounded-sm bg-muted px-16 transition-colors",
|
|
12
13
|
"focus-within:ring-2 focus-within:ring-active hover:bg-muted-hover",
|
|
@@ -24,20 +25,20 @@ const te = u(
|
|
|
24
25
|
status: "default"
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
|
-
),
|
|
28
|
+
), le = s(
|
|
28
29
|
"peer w-full flex-1 bg-muted body-1 text-base caret-active outline-hidden transition-colors",
|
|
29
30
|
"group-hover:bg-muted-hover group-disabled:bg-disabled",
|
|
30
31
|
"group-has-disabled:cursor-not-allowed group-has-disabled:bg-disabled group-has-disabled:text-disabled",
|
|
31
32
|
"placeholder:text-muted group-has-disabled:placeholder:text-disabled",
|
|
32
33
|
"[&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",
|
|
33
34
|
"truncate"
|
|
34
|
-
),
|
|
35
|
+
), ie = s(
|
|
35
36
|
"pointer-events-none absolute top-6 left-16 origin-left body-4 text-muted transition-all duration-300",
|
|
36
37
|
"peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:scale-100 peer-placeholder-shown:body-2",
|
|
37
38
|
"group-has-disabled:text-disabled",
|
|
38
39
|
"peer-focus:top-6 peer-focus:translate-y-0 peer-focus:body-4",
|
|
39
40
|
"w-[calc(100%-var(--size-56))] truncate"
|
|
40
|
-
),
|
|
41
|
+
), ce = g(ie, {
|
|
41
42
|
variants: {
|
|
42
43
|
status: {
|
|
43
44
|
default: "",
|
|
@@ -53,7 +54,7 @@ const te = u(
|
|
|
53
54
|
status: "default",
|
|
54
55
|
floated: !1
|
|
55
56
|
}
|
|
56
|
-
}),
|
|
57
|
+
}), de = g("flex items-center gap-2 body-3", {
|
|
57
58
|
variants: {
|
|
58
59
|
status: {
|
|
59
60
|
default: "text-muted",
|
|
@@ -64,129 +65,154 @@ const te = u(
|
|
|
64
65
|
defaultVariants: {
|
|
65
66
|
status: "default"
|
|
66
67
|
}
|
|
67
|
-
}),
|
|
68
|
-
ref:
|
|
69
|
-
className:
|
|
70
|
-
containerClassName:
|
|
71
|
-
inputClassName:
|
|
72
|
-
labelClassName:
|
|
73
|
-
label:
|
|
74
|
-
id:
|
|
75
|
-
disabled:
|
|
76
|
-
helperText:
|
|
77
|
-
|
|
68
|
+
}), Ie = ({
|
|
69
|
+
ref: a,
|
|
70
|
+
className: o,
|
|
71
|
+
containerClassName: t,
|
|
72
|
+
inputClassName: B,
|
|
73
|
+
labelClassName: F,
|
|
74
|
+
label: i,
|
|
75
|
+
id: j,
|
|
76
|
+
disabled: z,
|
|
77
|
+
helperText: b,
|
|
78
|
+
maxCount: c,
|
|
79
|
+
status: d,
|
|
78
80
|
suffix: P,
|
|
79
81
|
prefix: R,
|
|
80
|
-
onClear:
|
|
81
|
-
hideClearButton:
|
|
82
|
-
"aria-invalid":
|
|
83
|
-
onChange:
|
|
84
|
-
placeholder:
|
|
85
|
-
...
|
|
82
|
+
onClear: D,
|
|
83
|
+
hideClearButton: $ = !1,
|
|
84
|
+
"aria-invalid": E,
|
|
85
|
+
onChange: v,
|
|
86
|
+
placeholder: H,
|
|
87
|
+
...u
|
|
86
88
|
}) => {
|
|
87
|
-
const
|
|
89
|
+
const w = Q({
|
|
88
90
|
consumerName: "BaseInput",
|
|
89
|
-
mergeWith: { disabled:
|
|
90
|
-
}), { t:
|
|
91
|
-
|
|
92
|
-
),
|
|
93
|
-
(
|
|
94
|
-
|
|
91
|
+
mergeWith: { disabled: z }
|
|
92
|
+
}), { t: L } = re(), r = Z(null), A = _(), m = j || `input-${A}`, M = E ?? (d === "error" ? !0 : void 0), p = u.value !== void 0, [O, y] = ee(
|
|
93
|
+
u.defaultValue?.toString() ?? ""
|
|
94
|
+
), T = te(
|
|
95
|
+
(n) => {
|
|
96
|
+
p || y(n.target.value), v?.(n);
|
|
95
97
|
},
|
|
96
|
-
[
|
|
97
|
-
),
|
|
98
|
-
label:
|
|
99
|
-
placeholder:
|
|
100
|
-
}),
|
|
101
|
-
if (!
|
|
98
|
+
[p, v]
|
|
99
|
+
), x = p ? u.value?.toString() ?? "" : O, W = x.length > 0, { inputPlaceholder: q, labelStaysFloatedWithPlaceholder: U } = X({
|
|
100
|
+
label: i,
|
|
101
|
+
placeholder: H
|
|
102
|
+
}), I = W && !w && !$, G = x.length, C = !!(c && c > 0), N = `${m}-helper`, h = !!b, J = () => {
|
|
103
|
+
if (!r.current) return;
|
|
102
104
|
Object.getOwnPropertyDescriptor(
|
|
103
105
|
window.HTMLInputElement.prototype,
|
|
104
106
|
"value"
|
|
105
|
-
)?.set?.call(
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
},
|
|
109
|
-
return /* @__PURE__ */
|
|
110
|
-
/* @__PURE__ */
|
|
107
|
+
)?.set?.call(r.current, ""), p || y("");
|
|
108
|
+
const V = new Event("input", { bubbles: !0 });
|
|
109
|
+
r.current.dispatchEvent(V), r.current.focus(), D?.();
|
|
110
|
+
}, K = Y(a, r);
|
|
111
|
+
return /* @__PURE__ */ f("div", { className: o, children: [
|
|
112
|
+
/* @__PURE__ */ f(
|
|
111
113
|
"div",
|
|
112
114
|
{
|
|
113
|
-
className:
|
|
114
|
-
onPointerDown: (
|
|
115
|
-
if (
|
|
116
|
-
const
|
|
117
|
-
if (!
|
|
118
|
-
const
|
|
115
|
+
className: s(ne({ status: d }), t),
|
|
116
|
+
onPointerDown: (n) => {
|
|
117
|
+
if (n.target.closest("input, button, a")) return;
|
|
118
|
+
const l = r.current;
|
|
119
|
+
if (!l) return;
|
|
120
|
+
const S = l.value.length > 0 ? l.value.length : 0;
|
|
119
121
|
window.requestAnimationFrame(() => {
|
|
120
122
|
try {
|
|
121
|
-
|
|
123
|
+
l.setSelectionRange(S, S);
|
|
122
124
|
} catch {
|
|
123
125
|
}
|
|
124
|
-
|
|
126
|
+
l.focus();
|
|
125
127
|
});
|
|
126
128
|
},
|
|
127
129
|
children: [
|
|
128
130
|
R,
|
|
129
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ e(
|
|
130
132
|
"input",
|
|
131
133
|
{
|
|
132
|
-
ref:
|
|
133
|
-
id:
|
|
134
|
-
disabled:
|
|
135
|
-
placeholder:
|
|
136
|
-
"aria-invalid":
|
|
137
|
-
"aria-describedby":
|
|
138
|
-
className:
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
134
|
+
ref: K,
|
|
135
|
+
id: m,
|
|
136
|
+
disabled: w,
|
|
137
|
+
placeholder: q,
|
|
138
|
+
"aria-invalid": M,
|
|
139
|
+
"aria-describedby": h ? N : void 0,
|
|
140
|
+
className: s(
|
|
141
|
+
le,
|
|
142
|
+
i && "pt-12 body-2",
|
|
143
|
+
B
|
|
142
144
|
),
|
|
143
|
-
onChange:
|
|
144
|
-
...
|
|
145
|
+
onChange: T,
|
|
146
|
+
...u
|
|
145
147
|
}
|
|
146
148
|
),
|
|
147
|
-
|
|
149
|
+
i && /* @__PURE__ */ e(
|
|
148
150
|
"label",
|
|
149
151
|
{
|
|
150
|
-
htmlFor:
|
|
151
|
-
className:
|
|
152
|
-
|
|
153
|
-
status:
|
|
154
|
-
floated:
|
|
152
|
+
htmlFor: m,
|
|
153
|
+
className: s(
|
|
154
|
+
ce({
|
|
155
|
+
status: d,
|
|
156
|
+
floated: U
|
|
155
157
|
}),
|
|
156
|
-
|
|
158
|
+
F
|
|
157
159
|
),
|
|
158
|
-
children:
|
|
160
|
+
children: i
|
|
159
161
|
}
|
|
160
162
|
),
|
|
161
|
-
|
|
162
|
-
|
|
163
|
+
I && /* @__PURE__ */ e(
|
|
164
|
+
se,
|
|
163
165
|
{
|
|
164
166
|
iconType: "filled",
|
|
165
|
-
icon:
|
|
167
|
+
icon: k,
|
|
166
168
|
size: 20,
|
|
167
|
-
onClick:
|
|
168
|
-
"aria-label":
|
|
169
|
+
onClick: J,
|
|
170
|
+
"aria-label": L("components.baseInput.clearInputAriaLabel")
|
|
169
171
|
}
|
|
170
172
|
),
|
|
171
|
-
!
|
|
173
|
+
!I && P
|
|
172
174
|
]
|
|
173
175
|
}
|
|
174
176
|
),
|
|
175
|
-
|
|
177
|
+
(h || C) && /* @__PURE__ */ f(
|
|
176
178
|
"div",
|
|
177
179
|
{
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
180
|
+
className: s(
|
|
181
|
+
"mt-8 flex items-start gap-8",
|
|
182
|
+
h ? "justify-between" : "justify-end"
|
|
183
|
+
),
|
|
181
184
|
children: [
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
+
h && b && /* @__PURE__ */ e(
|
|
186
|
+
ue,
|
|
187
|
+
{
|
|
188
|
+
id: N,
|
|
189
|
+
helperText: b,
|
|
190
|
+
status: d
|
|
191
|
+
}
|
|
192
|
+
),
|
|
193
|
+
C && c != null && /* @__PURE__ */ e(pe, { count: G, maxCount: c })
|
|
185
194
|
]
|
|
186
195
|
}
|
|
187
196
|
)
|
|
188
197
|
] });
|
|
189
|
-
}
|
|
198
|
+
}, ue = ({
|
|
199
|
+
id: a,
|
|
200
|
+
helperText: o,
|
|
201
|
+
status: t
|
|
202
|
+
}) => /* @__PURE__ */ f(
|
|
203
|
+
"div",
|
|
204
|
+
{
|
|
205
|
+
id: a,
|
|
206
|
+
className: de({ status: t }),
|
|
207
|
+
role: t === "error" ? "alert" : void 0,
|
|
208
|
+
children: [
|
|
209
|
+
!t && /* @__PURE__ */ e(ae, { size: 16, className: "text-muted" }),
|
|
210
|
+
t === "error" && /* @__PURE__ */ e(k, { size: 16, className: "text-error" }),
|
|
211
|
+
t === "success" && /* @__PURE__ */ e(oe, { size: 16, className: "text-success" }),
|
|
212
|
+
/* @__PURE__ */ e("span", { className: "body-3", children: o })
|
|
213
|
+
]
|
|
214
|
+
}
|
|
215
|
+
), pe = ({ count: a, maxCount: o }) => /* @__PURE__ */ e("span", { "aria-live": "polite", className: "shrink-0 body-3 text-muted", children: `${a}/${o}` });
|
|
190
216
|
export {
|
|
191
|
-
|
|
217
|
+
Ie as BaseInput
|
|
192
218
|
};
|
|
@@ -10,6 +10,10 @@ export type BaseInputProps = {
|
|
|
10
10
|
* Pair with `status` for error/success styling and icons; omit `status` for a neutral hint.
|
|
11
11
|
*/
|
|
12
12
|
helperText?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Soft character limit. When set, renders a `count/maxCount` counter below the input.
|
|
15
|
+
*/
|
|
16
|
+
maxCount?: number;
|
|
13
17
|
/**
|
|
14
18
|
* Visual state for border, label, helper text, and helper icon.
|
|
15
19
|
* Omit when `helperText` is a neutral hint.
|
|
@@ -57,4 +61,24 @@ export type BaseInputProps = {
|
|
|
57
61
|
*/
|
|
58
62
|
labelClassName?: string;
|
|
59
63
|
} & Omit<ComponentPropsWithRef<'input'>, 'size' | 'prefix'>;
|
|
64
|
+
export type BaseInputHelperTextProps = {
|
|
65
|
+
/**
|
|
66
|
+
* The id linking the helper text to the input via `aria-describedby`.
|
|
67
|
+
*/
|
|
68
|
+
id: string;
|
|
69
|
+
/**
|
|
70
|
+
* The helper copy shown below the input.
|
|
71
|
+
*/
|
|
72
|
+
helperText: string;
|
|
73
|
+
} & Pick<BaseInputProps, 'status'>;
|
|
74
|
+
export type BaseInputCounterProps = {
|
|
75
|
+
/**
|
|
76
|
+
* Current character count.
|
|
77
|
+
*/
|
|
78
|
+
count: number;
|
|
79
|
+
/**
|
|
80
|
+
* Soft character limit rendered as the counter denominator.
|
|
81
|
+
*/
|
|
82
|
+
maxCount: number;
|
|
83
|
+
};
|
|
60
84
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/BaseInput/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,SAAS,CAAC;AAElD,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;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AM,wBAAwB,GAAG;IACrC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB,GAAG,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAEnC,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
|
@@ -51,7 +51,7 @@ const k = ({
|
|
|
51
51
|
{
|
|
52
52
|
variants: {
|
|
53
53
|
interactive: {
|
|
54
|
-
true: "cursor-pointer hover:bg-surface-hover
|
|
54
|
+
true: "cursor-pointer hover:bg-surface-hover focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus active:bg-surface-pressed",
|
|
55
55
|
false: ""
|
|
56
56
|
},
|
|
57
57
|
outlined: {
|
|
@@ -8,7 +8,7 @@ const h = f(
|
|
|
8
8
|
variants: {
|
|
9
9
|
appearance: {
|
|
10
10
|
base: "bg-surface text-base hover:bg-surface-hover active:bg-surface-pressed disabled:bg-disabled",
|
|
11
|
-
outline: "bg-base-transparent text-base outline-
|
|
11
|
+
outline: "bg-base-transparent text-base outline-1 outline-muted-subtle outline-dashed hover:bg-base-transparent-hover hover:outline-muted-subtle-hover focus-visible:outline-hidden focus-visible:outline-offset-0 active:bg-base-transparent-pressed active:outline-muted-subtle-pressed disabled:bg-base-transparent disabled:outline-disabled"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
defaultVariants: {
|
|
@@ -17,7 +17,7 @@ import { DescriptionItemLabelProps, DescriptionItemLeadingProps, DescriptionItem
|
|
|
17
17
|
* </DescriptionItemTrailing>
|
|
18
18
|
* </DescriptionItem>
|
|
19
19
|
*/
|
|
20
|
-
export declare const DescriptionItem: ({ ref, children, className, size, ...props }: DescriptionItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const DescriptionItem: ({ ref, children, className, size, priority, ...props }: DescriptionItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
/**
|
|
22
22
|
* Layout container for the leading (left) side of the description item.
|
|
23
23
|
* Contains DescriptionItemLabel and an optional info icon sibling.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DescriptionItem.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/DescriptionItem/DescriptionItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DescriptionItem.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/DescriptionItem/DescriptionItem.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,yBAAyB,EACzB,2BAA2B,EAC3B,oBAAoB,EAEpB,4BAA4B,EAC5B,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AAgBjB;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,eAAe,GAAI,wDAO7B,oBAAoB,4CAiBtB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GAAI,wCAKpC,2BAA2B,4CAmB7B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,wCAKlC,yBAAyB,4CAmB3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAAI,wCAKrC,4BAA4B,4CAmB9B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,wCAKlC,yBAAyB,4CAmB3B,CAAC"}
|
|
@@ -1,98 +1,124 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createSafeContext as
|
|
3
|
-
const [
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { createSafeContext as m, cn as o } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
const [l, c] = m("DescriptionItemSize", {
|
|
4
4
|
size: "md"
|
|
5
|
-
}), p = ({
|
|
5
|
+
}), [p, a] = m("DescriptionItemPriority", {
|
|
6
|
+
priority: void 0
|
|
7
|
+
}), D = ({
|
|
6
8
|
ref: e,
|
|
7
9
|
children: t,
|
|
8
10
|
className: i,
|
|
9
|
-
size:
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
size: r = "md",
|
|
12
|
+
priority: s = "end",
|
|
13
|
+
...d
|
|
14
|
+
}) => /* @__PURE__ */ n(l, { value: { size: r }, children: /* @__PURE__ */ n(p, { value: { priority: s }, children: /* @__PURE__ */ n(
|
|
12
15
|
"div",
|
|
13
16
|
{
|
|
14
17
|
ref: e,
|
|
15
|
-
className:
|
|
16
|
-
|
|
18
|
+
className: o(
|
|
19
|
+
"flex w-full items-start gap-12 overflow-hidden",
|
|
20
|
+
i
|
|
21
|
+
),
|
|
22
|
+
...d,
|
|
17
23
|
children: t
|
|
18
24
|
}
|
|
19
|
-
) }),
|
|
25
|
+
) }) }), I = ({
|
|
20
26
|
ref: e,
|
|
21
27
|
children: t,
|
|
22
28
|
className: i,
|
|
23
|
-
...
|
|
24
|
-
}) =>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
...r
|
|
30
|
+
}) => {
|
|
31
|
+
const { priority: s } = a({
|
|
32
|
+
consumerName: "DescriptionItemLeading",
|
|
33
|
+
contextRequired: !1
|
|
34
|
+
});
|
|
35
|
+
return /* @__PURE__ */ n(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
ref: e,
|
|
39
|
+
className: o(
|
|
40
|
+
"flex min-w-0 grow items-center gap-4",
|
|
41
|
+
s === "end" ? "shrink" : "shrink-0",
|
|
42
|
+
i
|
|
43
|
+
),
|
|
44
|
+
...r,
|
|
45
|
+
children: t
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}, f = ({
|
|
33
49
|
ref: e,
|
|
34
50
|
children: t,
|
|
35
51
|
className: i,
|
|
36
|
-
...
|
|
52
|
+
...r
|
|
37
53
|
}) => {
|
|
38
|
-
const { size:
|
|
54
|
+
const { size: s } = c({
|
|
39
55
|
consumerName: "DescriptionItemLabel",
|
|
40
56
|
contextRequired: !1
|
|
41
57
|
});
|
|
42
|
-
return /* @__PURE__ */
|
|
58
|
+
return /* @__PURE__ */ n(
|
|
43
59
|
"div",
|
|
44
60
|
{
|
|
45
61
|
ref: e,
|
|
46
|
-
className:
|
|
62
|
+
className: o(
|
|
47
63
|
"line-clamp-2 min-w-0 wrap-break-word text-ellipsis text-muted",
|
|
48
|
-
|
|
64
|
+
s === "md" ? "body-2" : "body-3",
|
|
49
65
|
i
|
|
50
66
|
),
|
|
51
|
-
...
|
|
67
|
+
...r,
|
|
52
68
|
children: t
|
|
53
69
|
}
|
|
54
70
|
);
|
|
55
|
-
},
|
|
71
|
+
}, v = ({
|
|
56
72
|
ref: e,
|
|
57
73
|
children: t,
|
|
58
74
|
className: i,
|
|
59
|
-
...
|
|
60
|
-
}) =>
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
75
|
+
...r
|
|
76
|
+
}) => {
|
|
77
|
+
const { priority: s } = a({
|
|
78
|
+
consumerName: "DescriptionItemTrailing",
|
|
79
|
+
contextRequired: !1
|
|
80
|
+
});
|
|
81
|
+
return /* @__PURE__ */ n(
|
|
82
|
+
"div",
|
|
83
|
+
{
|
|
84
|
+
ref: e,
|
|
85
|
+
className: o(
|
|
86
|
+
"flex max-w-4/5 items-center gap-4",
|
|
87
|
+
s === "start" ? "min-w-0 shrink" : "shrink-0",
|
|
88
|
+
i
|
|
89
|
+
),
|
|
90
|
+
...r,
|
|
91
|
+
children: t
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}, b = ({
|
|
69
95
|
ref: e,
|
|
70
96
|
children: t,
|
|
71
97
|
className: i,
|
|
72
|
-
...
|
|
98
|
+
...r
|
|
73
99
|
}) => {
|
|
74
|
-
const { size:
|
|
100
|
+
const { size: s } = c({
|
|
75
101
|
consumerName: "DescriptionItemValue",
|
|
76
102
|
contextRequired: !1
|
|
77
103
|
});
|
|
78
|
-
return /* @__PURE__ */
|
|
104
|
+
return /* @__PURE__ */ n(
|
|
79
105
|
"div",
|
|
80
106
|
{
|
|
81
107
|
ref: e,
|
|
82
|
-
className:
|
|
108
|
+
className: o(
|
|
83
109
|
"min-w-0 truncate text-base",
|
|
84
|
-
|
|
110
|
+
s === "md" ? "body-2-semi-bold" : "body-3-semi-bold",
|
|
85
111
|
i
|
|
86
112
|
),
|
|
87
|
-
...
|
|
113
|
+
...r,
|
|
88
114
|
children: t
|
|
89
115
|
}
|
|
90
116
|
);
|
|
91
117
|
};
|
|
92
118
|
export {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
119
|
+
D as DescriptionItem,
|
|
120
|
+
f as DescriptionItemLabel,
|
|
121
|
+
I as DescriptionItemLeading,
|
|
122
|
+
v as DescriptionItemTrailing,
|
|
123
|
+
b as DescriptionItemValue
|
|
98
124
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Priority } from '@ledgerhq/lumen-utils-shared';
|
|
1
2
|
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
3
|
export type DescriptionItemSize = 'sm' | 'md';
|
|
3
4
|
export type DescriptionItemProps = {
|
|
@@ -10,6 +11,11 @@ export type DescriptionItemProps = {
|
|
|
10
11
|
* @default 'md'
|
|
11
12
|
*/
|
|
12
13
|
size?: DescriptionItemSize;
|
|
14
|
+
/**
|
|
15
|
+
* The parts which are protected from shrinking and truncation when horizontal space is limited.
|
|
16
|
+
* @default 'end'
|
|
17
|
+
*/
|
|
18
|
+
priority?: Priority;
|
|
13
19
|
/**
|
|
14
20
|
* Additional CSS classes for layout adjustments.
|
|
15
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/DescriptionItem/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D,MAAM,MAAM,mBAAmB,GAAG,IAAI,GAAG,IAAI,CAAC;AAE9C,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAEjC,MAAM,MAAM,2BAA2B,GAAG;IACxC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAEjC,MAAM,MAAM,yBAAyB,GAAG;IACtC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAEjC,MAAM,MAAM,4BAA4B,GAAG;IACzC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAEjC,MAAM,MAAM,yBAAyB,GAAG;IACtC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/DescriptionItem/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,EAA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
|
10
|
-
32: "icon-
|
|
11
|
-
24: "icon-
|
|
12
|
-
40: "icon-
|
|
13
|
-
48: "icon-
|
|
14
|
-
56: "icon-
|
|
7
|
+
12: "icon-h-12 icon-w-12 icon-stroke-12",
|
|
8
|
+
16: "icon-h-16 icon-w-16 icon-stroke-16",
|
|
9
|
+
20: "icon-h-20 icon-w-20 icon-stroke-20",
|
|
10
|
+
32: "icon-h-32 icon-w-32 icon-stroke-32",
|
|
11
|
+
24: "icon-h-24 icon-w-24 icon-stroke-24",
|
|
12
|
+
40: "icon-h-40 icon-w-40 icon-stroke-40",
|
|
13
|
+
48: "icon-h-48 icon-w-48 icon-stroke-48",
|
|
14
|
+
56: "icon-h-56 icon-w-56 icon-stroke-56"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
defaultVariants: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/ListItem/ListItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/ListItem/ListItem.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,oBAAoB,EACpB,wBAAwB,EACxB,oBAAoB,EACpB,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AA+DjB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,QAAQ,GAAI,4BAA4B,aAAa,4CAsCjE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,wCAK7B,oBAAoB,4CAmBtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,wCAK7B,oBAAoB,4CAmBtB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,wCAKhC,uBAAuB,4CAmBzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,wCAK3B,kBAAkB,4CAwBpB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,wCAKjC,wBAAwB,4CAwB1B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,wCAK9B,qBAAqB,4CA0BvB,CAAC"}
|