@ledgerhq/lumen-ui-react 0.0.69 → 0.0.70
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/Subheader/Subheader.d.ts +8 -6
- package/dist/lib/Components/Subheader/Subheader.d.ts.map +1 -1
- package/dist/lib/Components/Subheader/Subheader.js +73 -44
- package/dist/lib/Components/Subheader/types.d.ts +6 -10
- package/dist/lib/Components/Subheader/types.d.ts.map +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { SubheaderActionProps, SubheaderCountProps, SubheaderDescriptionProps,
|
|
2
|
+
import { SubheaderActionProps, SubheaderCountProps, SubheaderDescriptionProps, SubheaderProps, SubheaderRowProps, SubheaderShowMoreProps, SubheaderTitleProps } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Title component for the Subheader. Displays the main heading.
|
|
5
5
|
* Use the `as` prop to control heading semantics and avoid multiple h2s on a page.
|
|
@@ -11,7 +11,7 @@ import { SubheaderActionProps, SubheaderCountProps, SubheaderDescriptionProps, S
|
|
|
11
11
|
* // With custom heading level
|
|
12
12
|
* <SubheaderTitle as="h3">Section Title</SubheaderTitle>
|
|
13
13
|
*/
|
|
14
|
-
export declare const SubheaderTitle: ({ children, as: Component, }: SubheaderTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const SubheaderTitle: ({ children, as: Component, className, ...props }: SubheaderTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
/**
|
|
16
16
|
* Row component for the Subheader. Layout container to horizontally align title, count, hint, and action.
|
|
17
17
|
* Can optionally be interactive with an onClick handler.
|
|
@@ -20,20 +20,22 @@ export declare const SubheaderRow: ({ children, onClick, className, ...props }:
|
|
|
20
20
|
/**
|
|
21
21
|
* Count component for the Subheader. Displays a formatted number.
|
|
22
22
|
*/
|
|
23
|
-
export declare const SubheaderCount: ({ value, format }: SubheaderCountProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const SubheaderCount: ({ value, format, className, ...props }: SubheaderCountProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
24
|
/**
|
|
25
25
|
* Info component for the Subheader. Displays an information icon that can be wrapped in a Tooltip.
|
|
26
26
|
*/
|
|
27
|
-
export declare const SubheaderInfo: React.ForwardRefExoticComponent<Omit<
|
|
27
|
+
export declare const SubheaderInfo: React.ForwardRefExoticComponent<Omit<import('..').InteractiveIconProps, "children" | "iconType"> & {
|
|
28
|
+
iconType?: "filled" | "stroked";
|
|
29
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
28
30
|
/**
|
|
29
31
|
* ShowMore component for the Subheader. Displays a static chevron right icon to indicate expandable content.
|
|
30
32
|
* Position this after SubheaderCount and before other elements.
|
|
31
33
|
*/
|
|
32
|
-
export declare const SubheaderShowMore: ({ className }: SubheaderShowMoreProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export declare const SubheaderShowMore: ({ className, ...props }: SubheaderShowMoreProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
35
|
/**
|
|
34
36
|
* Description component for the Subheader. Displays descriptive text below the title row.
|
|
35
37
|
*/
|
|
36
|
-
export declare const SubheaderDescription: ({ children, }: SubheaderDescriptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare const SubheaderDescription: ({ children, className, ...props }: SubheaderDescriptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
39
|
/**
|
|
38
40
|
* Action component for the Subheader. Displays an interactive text button.
|
|
39
41
|
* Automatically positions itself at the end of the row using ml-auto.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Subheader.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Subheader/Subheader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"Subheader.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Subheader/Subheader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EAEzB,cAAc,EACd,iBAAiB,EACjB,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,GAAI,kDAK5B,mBAAmB,4CASrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,4CAK1B,iBAAiB,4CAgBnB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GAAI,wCAK5B,mBAAmB,4CAOrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa;;2CAiBxB,CAAC;AAGH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,yBAG/B,sBAAsB,4CASxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,mCAIlC,yBAAyB,4CAM3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,4CAK7B,oBAAoB,4CActB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,eAAO,MAAM,SAAS,GAAI,mCAIvB,cAAc,4CAMhB,CAAC"}
|
|
@@ -1,71 +1,100 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cn as
|
|
3
|
-
import
|
|
4
|
-
import { Information as
|
|
5
|
-
import { ChevronRight as
|
|
6
|
-
import { InteractiveIcon as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { cn as s } from "../../../libs/utils-shared/dist/index.js";
|
|
3
|
+
import i from "react";
|
|
4
|
+
import { Information as c } from "../../Symbols/Icons/Information.js";
|
|
5
|
+
import { ChevronRight as m } from "../../Symbols/Icons/ChevronRight.js";
|
|
6
|
+
import { InteractiveIcon as d } from "../InteractiveIcon/InteractiveIcon.js";
|
|
7
7
|
const S = ({
|
|
8
|
-
children:
|
|
9
|
-
as:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
children: t,
|
|
9
|
+
as: e = "h2",
|
|
10
|
+
className: r,
|
|
11
|
+
...o
|
|
12
|
+
}) => /* @__PURE__ */ n(
|
|
13
|
+
e,
|
|
14
|
+
{
|
|
15
|
+
className: s("min-w-0 truncate heading-4-semi-bold", r),
|
|
16
|
+
...o,
|
|
17
|
+
children: t
|
|
18
|
+
}
|
|
19
|
+
), N = ({
|
|
20
|
+
children: t,
|
|
21
|
+
onClick: e,
|
|
22
|
+
className: r,
|
|
14
23
|
...o
|
|
15
|
-
}) => /* @__PURE__ */
|
|
16
|
-
|
|
24
|
+
}) => /* @__PURE__ */ n(
|
|
25
|
+
e ? "button" : "div",
|
|
17
26
|
{
|
|
18
|
-
className:
|
|
27
|
+
className: s(
|
|
19
28
|
"flex items-center gap-4",
|
|
20
|
-
|
|
21
|
-
|
|
29
|
+
e && "cursor-pointer",
|
|
30
|
+
r
|
|
22
31
|
),
|
|
23
|
-
onClick:
|
|
32
|
+
onClick: e,
|
|
24
33
|
...o,
|
|
25
|
-
children:
|
|
34
|
+
children: t
|
|
26
35
|
}
|
|
27
|
-
), y = ({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
), y = ({
|
|
37
|
+
value: t,
|
|
38
|
+
format: e,
|
|
39
|
+
className: r,
|
|
40
|
+
...o
|
|
41
|
+
}) => {
|
|
42
|
+
const a = e ? e(t) : `(${t})`;
|
|
43
|
+
return /* @__PURE__ */ n("span", { className: s("shrink-0 body-2 text-muted", r), ...o, children: a });
|
|
44
|
+
}, u = i.forwardRef(({ iconType: t = "stroked", className: e, ...r }, o) => /* @__PURE__ */ n("span", { className: "flex shrink-0 items-center", children: /* @__PURE__ */ n(
|
|
45
|
+
d,
|
|
32
46
|
{
|
|
33
47
|
ref: o,
|
|
34
|
-
iconType:
|
|
35
|
-
className:
|
|
48
|
+
iconType: t,
|
|
49
|
+
className: e,
|
|
36
50
|
"aria-label": "More information",
|
|
37
|
-
...
|
|
38
|
-
children: /* @__PURE__ */
|
|
51
|
+
...r,
|
|
52
|
+
children: /* @__PURE__ */ n(c, { size: 16 })
|
|
39
53
|
}
|
|
40
54
|
) }));
|
|
41
|
-
|
|
42
|
-
const I = ({
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
55
|
+
u.displayName = "SubheaderInfo";
|
|
56
|
+
const I = ({
|
|
57
|
+
className: t,
|
|
58
|
+
...e
|
|
59
|
+
}) => /* @__PURE__ */ n(
|
|
60
|
+
"span",
|
|
61
|
+
{
|
|
62
|
+
className: s("shrink-0 self-center text-muted", t),
|
|
63
|
+
...e,
|
|
64
|
+
children: /* @__PURE__ */ n(m, { size: 16 })
|
|
65
|
+
}
|
|
66
|
+
), g = ({
|
|
67
|
+
children: t,
|
|
68
|
+
className: e,
|
|
69
|
+
...r
|
|
70
|
+
}) => /* @__PURE__ */ n("p", { className: s("body-3 text-muted", e), ...r, children: t }), v = ({
|
|
71
|
+
children: t,
|
|
72
|
+
onClick: e,
|
|
73
|
+
className: r,
|
|
48
74
|
...o
|
|
49
|
-
}) => /* @__PURE__ */
|
|
75
|
+
}) => /* @__PURE__ */ n(
|
|
50
76
|
"button",
|
|
51
77
|
{
|
|
52
78
|
type: "button",
|
|
53
|
-
onClick:
|
|
54
|
-
className:
|
|
79
|
+
onClick: e,
|
|
80
|
+
className: s(
|
|
81
|
+
"ml-auto shrink-0 cursor-pointer pl-8 body-2 text-interactive",
|
|
82
|
+
r
|
|
83
|
+
),
|
|
55
84
|
...o,
|
|
56
|
-
children:
|
|
85
|
+
children: t
|
|
57
86
|
}
|
|
58
87
|
), w = ({
|
|
59
|
-
className:
|
|
60
|
-
children:
|
|
61
|
-
...
|
|
62
|
-
}) => /* @__PURE__ */
|
|
88
|
+
className: t,
|
|
89
|
+
children: e,
|
|
90
|
+
...r
|
|
91
|
+
}) => /* @__PURE__ */ n("div", { className: s("flex flex-col gap-4", t), ...r, children: e });
|
|
63
92
|
export {
|
|
64
93
|
w as Subheader,
|
|
65
94
|
v as SubheaderAction,
|
|
66
95
|
y as SubheaderCount,
|
|
67
96
|
g as SubheaderDescription,
|
|
68
|
-
|
|
97
|
+
u as SubheaderInfo,
|
|
69
98
|
N as SubheaderRow,
|
|
70
99
|
I as SubheaderShowMore,
|
|
71
100
|
S as SubheaderTitle
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { InteractiveIconProps } from '../InteractiveIcon';
|
|
1
2
|
export type SubheaderProps = {
|
|
2
3
|
/**
|
|
3
4
|
* The children of the subheader, which should include SubheaderRow, SubheaderTitle, SubheaderDescription, etc.
|
|
@@ -25,7 +26,7 @@ export type SubheaderTitleProps = {
|
|
|
25
26
|
* @default 'h2'
|
|
26
27
|
*/
|
|
27
28
|
as?: keyof Pick<HTMLElementTagNameMap, 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div' | 'span'>;
|
|
28
|
-
}
|
|
29
|
+
} & Omit<React.HTMLAttributes<HTMLHeadingElement>, 'children'>;
|
|
29
30
|
export type SubheaderCountProps = {
|
|
30
31
|
/**
|
|
31
32
|
* The count value to display.
|
|
@@ -36,8 +37,8 @@ export type SubheaderCountProps = {
|
|
|
36
37
|
* Defaults to (n) => `(${n})`
|
|
37
38
|
*/
|
|
38
39
|
format?: (value: number) => string;
|
|
39
|
-
}
|
|
40
|
-
export type SubheaderInfoProps = Omit<
|
|
40
|
+
} & Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'>;
|
|
41
|
+
export type SubheaderInfoProps = Omit<InteractiveIconProps, 'children' | 'iconType'> & {
|
|
41
42
|
/**
|
|
42
43
|
* The visual style of the icon button.
|
|
43
44
|
* Defaults to 'stroked'.
|
|
@@ -49,7 +50,7 @@ export type SubheaderDescriptionProps = {
|
|
|
49
50
|
* The description text to display below the title row.
|
|
50
51
|
*/
|
|
51
52
|
children: React.ReactNode;
|
|
52
|
-
}
|
|
53
|
+
} & Omit<React.HTMLAttributes<HTMLParagraphElement>, 'children'>;
|
|
53
54
|
export type SubheaderActionProps = {
|
|
54
55
|
/**
|
|
55
56
|
* The action element to display (e.g., button text).
|
|
@@ -60,10 +61,5 @@ export type SubheaderActionProps = {
|
|
|
60
61
|
*/
|
|
61
62
|
onClick: () => void;
|
|
62
63
|
} & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'onClick'>;
|
|
63
|
-
export type SubheaderShowMoreProps =
|
|
64
|
-
/**
|
|
65
|
-
* Optional className for custom styling.
|
|
66
|
-
*/
|
|
67
|
-
className?: string;
|
|
68
|
-
};
|
|
64
|
+
export type SubheaderShowMoreProps = Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'>;
|
|
69
65
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Subheader/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC;AAE3D,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,CAAC;AAEpE,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH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