@babylonlabs-io/core-ui 1.13.0 → 1.15.0
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/elements/FinalityProviderItem/FinalityProviderItem.d.ts +6 -1
- package/dist/elements/FinalityProviderItem/FinalityProviderItem.js +3 -1
- package/dist/elements/ProvidersList/ProvidersList.d.ts +3 -1
- package/dist/elements/ProvidersList/ProvidersList.js +2 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +1504 -1383
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/style.css +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/widgets/sections/ActivityCard/ActivityCard.d.ts +37 -0
- package/dist/widgets/sections/ActivityCard/ActivityCard.js +7 -0
- package/dist/widgets/sections/ActivityCard/ActivityCard.stories.d.ts +14 -0
- package/dist/widgets/sections/ActivityCard/ActivityCard.stories.js +228 -0
- package/dist/widgets/sections/ActivityCard/components/ActivityCardActionSection.d.ts +6 -0
- package/dist/widgets/sections/ActivityCard/components/ActivityCardActionSection.js +5 -0
- package/dist/widgets/sections/ActivityCard/components/ActivityCardAmountSection.d.ts +9 -0
- package/dist/widgets/sections/ActivityCard/components/ActivityCardAmountSection.js +6 -0
- package/dist/widgets/sections/ActivityCard/components/ActivityCardDetailsSection.d.ts +11 -0
- package/dist/widgets/sections/ActivityCard/components/ActivityCardDetailsSection.js +10 -0
- package/dist/widgets/sections/ActivityCard/components/ActivityListItem.d.ts +12 -0
- package/dist/widgets/sections/ActivityCard/components/ActivityListItem.js +5 -0
- package/dist/widgets/sections/ActivityCard/index.d.ts +5 -0
- package/dist/widgets/sections/ActivityCard/index.js +5 -0
- package/dist/widgets/sections/FeesSection/FeesSection.d.ts +4 -4
- package/dist/widgets/sections/FeesSection/FeesSection.js +1 -1
- package/dist/widgets/sections/FeesSection/FeesSection.stories.d.ts +1 -0
- package/dist/widgets/sections/FeesSection/FeesSection.stories.js +4 -0
- package/dist/widgets/sections/FinalityProviderSubsection/FinalityProviderSubsection.d.ts +3 -1
- package/dist/widgets/sections/FinalityProviderSubsection/FinalityProviderSubsection.js +2 -2
- package/dist/widgets/sections/FinalityProviderSubsection/FinalityProviderSubsection.stories.d.ts +1 -0
- package/dist/widgets/sections/FinalityProviderSubsection/FinalityProviderSubsection.stories.js +21 -0
- package/package.json +1 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface ActivityCardDetailItem {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string | React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export interface ActivityListItemData {
|
|
6
|
+
icon?: string | React.ReactNode;
|
|
7
|
+
iconAlt?: string;
|
|
8
|
+
name: string;
|
|
9
|
+
id?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface ActivityCardActionButton {
|
|
12
|
+
label: string;
|
|
13
|
+
onClick: () => void;
|
|
14
|
+
variant?: "contained" | "outlined";
|
|
15
|
+
size?: "small" | "medium" | "large";
|
|
16
|
+
className?: string;
|
|
17
|
+
fullWidth?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface ActivityCardData {
|
|
20
|
+
formattedAmount: string;
|
|
21
|
+
icon?: string | React.ReactNode;
|
|
22
|
+
iconAlt?: string;
|
|
23
|
+
details: ActivityCardDetailItem[];
|
|
24
|
+
optionalDetails?: ActivityCardDetailItem[];
|
|
25
|
+
listItems?: {
|
|
26
|
+
label: string;
|
|
27
|
+
items: ActivityListItemData[];
|
|
28
|
+
}[];
|
|
29
|
+
primaryAction?: ActivityCardActionButton;
|
|
30
|
+
secondaryActions?: ActivityCardActionButton[];
|
|
31
|
+
}
|
|
32
|
+
interface ActivityCardProps {
|
|
33
|
+
data: ActivityCardData;
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
export declare function ActivityCard({ data, className }: ActivityCardProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ActivityCardActionSection } from "./components/ActivityCardActionSection";
|
|
3
|
+
import { ActivityCardAmountSection } from "./components/ActivityCardAmountSection";
|
|
4
|
+
import { ActivityCardDetailsSection } from "./components/ActivityCardDetailsSection";
|
|
5
|
+
export function ActivityCard({ data, className }) {
|
|
6
|
+
return (_jsxs("div", { className: `w-full bg-secondary-highlight p-3 sm:p-4 space-y-3 sm:space-y-4 rounded ${className || ""}`, children: [_jsx(ActivityCardAmountSection, { formattedAmount: data.formattedAmount, icon: data.icon, iconAlt: data.iconAlt, primaryAction: data.primaryAction }), _jsx(ActivityCardDetailsSection, { details: data.details, optionalDetails: data.optionalDetails, listItems: data.listItems }), data.secondaryActions && data.secondaryActions.length > 0 && (_jsx(ActivityCardActionSection, { actions: data.secondaryActions }))] }));
|
|
7
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { ActivityCard } from "./ActivityCard";
|
|
3
|
+
declare const meta: Meta<typeof ActivityCard>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Basic: Story;
|
|
7
|
+
export declare const WithIcon: Story;
|
|
8
|
+
export declare const WithPrimaryAction: Story;
|
|
9
|
+
export declare const WithSecondaryActions: Story;
|
|
10
|
+
export declare const WithOptionalDetails: Story;
|
|
11
|
+
export declare const WithListItems: Story;
|
|
12
|
+
export declare const Complete: Story;
|
|
13
|
+
export declare const LargeAmount: Story;
|
|
14
|
+
export declare const ErrorState: Story;
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { ActivityCard } from "./ActivityCard";
|
|
2
|
+
const meta = {
|
|
3
|
+
component: ActivityCard,
|
|
4
|
+
tags: ["autodocs"],
|
|
5
|
+
};
|
|
6
|
+
export default meta;
|
|
7
|
+
export const Basic = {
|
|
8
|
+
args: {
|
|
9
|
+
data: {
|
|
10
|
+
formattedAmount: "1.5 BTC",
|
|
11
|
+
details: [
|
|
12
|
+
{ label: "Status", value: "Confirmed" },
|
|
13
|
+
{ label: "Date", value: "Mar 15, 2024" },
|
|
14
|
+
{ label: "Transaction ID", value: "bc1q...xyz789" },
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export const WithIcon = {
|
|
20
|
+
args: {
|
|
21
|
+
data: {
|
|
22
|
+
formattedAmount: "2.3 BTC",
|
|
23
|
+
icon: "/images/fps/lombard.jpeg",
|
|
24
|
+
iconAlt: "Lombard Protocol",
|
|
25
|
+
details: [
|
|
26
|
+
{ label: "Status", value: "Pending" },
|
|
27
|
+
{ label: "Date", value: "Mar 16, 2024" },
|
|
28
|
+
{ label: "Fee", value: "0.0001 BTC" },
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
export const WithPrimaryAction = {
|
|
34
|
+
args: {
|
|
35
|
+
data: {
|
|
36
|
+
formattedAmount: "0.75 BTC",
|
|
37
|
+
icon: "/images/fps/pumpbtc.jpeg",
|
|
38
|
+
iconAlt: "PumpBTC",
|
|
39
|
+
details: [
|
|
40
|
+
{ label: "Status", value: "Pending" },
|
|
41
|
+
{ label: "Date", value: "Mar 16, 2024" },
|
|
42
|
+
{ label: "Confirmations", value: "2/6" },
|
|
43
|
+
],
|
|
44
|
+
primaryAction: {
|
|
45
|
+
label: "View Details",
|
|
46
|
+
onClick: () => alert("Primary action clicked"),
|
|
47
|
+
variant: "contained",
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
export const WithSecondaryActions = {
|
|
53
|
+
args: {
|
|
54
|
+
data: {
|
|
55
|
+
formattedAmount: "5.0 BTC",
|
|
56
|
+
icon: "/images/fps/solv.jpeg",
|
|
57
|
+
iconAlt: "Solv Protocol",
|
|
58
|
+
details: [
|
|
59
|
+
{ label: "Status", value: "Completed" },
|
|
60
|
+
{ label: "Date", value: "Mar 14, 2024" },
|
|
61
|
+
{ label: "Recipient", value: "bc1q...abc123" },
|
|
62
|
+
],
|
|
63
|
+
secondaryActions: [
|
|
64
|
+
{
|
|
65
|
+
label: "Copy Hash",
|
|
66
|
+
onClick: () => alert("Hash copied"),
|
|
67
|
+
variant: "outlined",
|
|
68
|
+
size: "small",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
label: "Export",
|
|
72
|
+
onClick: () => alert("Export clicked"),
|
|
73
|
+
variant: "outlined",
|
|
74
|
+
size: "small",
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
export const WithOptionalDetails = {
|
|
81
|
+
args: {
|
|
82
|
+
data: {
|
|
83
|
+
formattedAmount: "3.2 BTC",
|
|
84
|
+
icon: "/images/wallets/keystone.svg",
|
|
85
|
+
iconAlt: "Keystone Wallet",
|
|
86
|
+
details: [
|
|
87
|
+
{ label: "Status", value: "Confirmed" },
|
|
88
|
+
{ label: "Date", value: "Mar 15, 2024" },
|
|
89
|
+
],
|
|
90
|
+
optionalDetails: [
|
|
91
|
+
{ label: "Network Fee", value: "0.0001 BTC" },
|
|
92
|
+
{ label: "Block Height", value: "834,567" },
|
|
93
|
+
{ label: "Confirmations", value: "6/6" },
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
export const WithListItems = {
|
|
99
|
+
args: {
|
|
100
|
+
data: {
|
|
101
|
+
formattedAmount: "10.5 BTC",
|
|
102
|
+
icon: "/images/wallets/binance.webp",
|
|
103
|
+
iconAlt: "Binance Wallet",
|
|
104
|
+
details: [
|
|
105
|
+
{ label: "Status", value: "Completed" },
|
|
106
|
+
{ label: "Date", value: "Mar 13, 2024" },
|
|
107
|
+
],
|
|
108
|
+
listItems: [
|
|
109
|
+
{
|
|
110
|
+
label: "Finality Providers",
|
|
111
|
+
items: [
|
|
112
|
+
{ name: "Lombard Protocol", id: "fp1", icon: "/images/fps/lombard.jpeg" },
|
|
113
|
+
{ name: "PumpBTC", id: "fp2", icon: "/images/fps/pumpbtc.jpeg" },
|
|
114
|
+
{ name: "Solv Protocol", id: "fp3", icon: "/images/fps/solv.jpeg" },
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
label: "Validators",
|
|
119
|
+
items: [
|
|
120
|
+
{ name: "Validator One", id: "val1" },
|
|
121
|
+
{ name: "Validator Two", id: "val2" },
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
export const Complete = {
|
|
129
|
+
args: {
|
|
130
|
+
data: {
|
|
131
|
+
formattedAmount: "7.8 BTC",
|
|
132
|
+
icon: "/images/fps/lombard.jpeg",
|
|
133
|
+
iconAlt: "Lombard Protocol",
|
|
134
|
+
details: [
|
|
135
|
+
{ label: "Status", value: "Confirmed" },
|
|
136
|
+
{ label: "Date", value: "Mar 12, 2024" },
|
|
137
|
+
{ label: "Type", value: "Delegation" },
|
|
138
|
+
],
|
|
139
|
+
optionalDetails: [
|
|
140
|
+
{ label: "Network Fee", value: "0.00015 BTC" },
|
|
141
|
+
{ label: "Block Height", value: "834,234" },
|
|
142
|
+
{ label: "Lock Time", value: "1000 blocks" },
|
|
143
|
+
],
|
|
144
|
+
listItems: [
|
|
145
|
+
{
|
|
146
|
+
label: "Finality Providers",
|
|
147
|
+
items: [
|
|
148
|
+
{ name: "Lombard Protocol", id: "bp1", icon: "/images/fps/lombard.jpeg" },
|
|
149
|
+
{ name: "Solv Protocol", id: "bp2", icon: "/images/fps/solv.jpeg" },
|
|
150
|
+
],
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
primaryAction: {
|
|
154
|
+
label: "Manage Delegation",
|
|
155
|
+
onClick: () => alert("Manage delegation clicked"),
|
|
156
|
+
variant: "contained",
|
|
157
|
+
fullWidth: true,
|
|
158
|
+
},
|
|
159
|
+
secondaryActions: [
|
|
160
|
+
{
|
|
161
|
+
label: "View on Explorer",
|
|
162
|
+
onClick: () => alert("Explorer opened"),
|
|
163
|
+
variant: "outlined",
|
|
164
|
+
size: "small",
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
label: "Share",
|
|
168
|
+
onClick: () => alert("Share clicked"),
|
|
169
|
+
variant: "outlined",
|
|
170
|
+
size: "small",
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
label: "Export Details",
|
|
174
|
+
onClick: () => alert("Export clicked"),
|
|
175
|
+
variant: "outlined",
|
|
176
|
+
size: "small",
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
export const LargeAmount = {
|
|
183
|
+
args: {
|
|
184
|
+
data: {
|
|
185
|
+
formattedAmount: "1,234.56789 BTC",
|
|
186
|
+
icon: "/images/fps/pumpbtc.jpeg",
|
|
187
|
+
iconAlt: "PumpBTC",
|
|
188
|
+
details: [
|
|
189
|
+
{ label: "Status", value: "High Value Transaction" },
|
|
190
|
+
{ label: "Date", value: "Mar 16, 2024" },
|
|
191
|
+
{ label: "USD Value", value: "$87,421,234.56" },
|
|
192
|
+
],
|
|
193
|
+
primaryAction: {
|
|
194
|
+
label: "Confirm Transaction",
|
|
195
|
+
onClick: () => alert("High value transaction confirmed"),
|
|
196
|
+
variant: "contained",
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
export const ErrorState = {
|
|
202
|
+
args: {
|
|
203
|
+
data: {
|
|
204
|
+
formattedAmount: "0.5 BTC",
|
|
205
|
+
icon: "/images/status/warning.svg",
|
|
206
|
+
iconAlt: "Warning",
|
|
207
|
+
details: [
|
|
208
|
+
{ label: "Status", value: "Failed" },
|
|
209
|
+
{ label: "Date", value: "Mar 16, 2024" },
|
|
210
|
+
{ label: "Error", value: "Insufficient funds" },
|
|
211
|
+
],
|
|
212
|
+
secondaryActions: [
|
|
213
|
+
{
|
|
214
|
+
label: "Retry",
|
|
215
|
+
onClick: () => alert("Retry clicked"),
|
|
216
|
+
variant: "contained",
|
|
217
|
+
size: "small",
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
label: "Cancel",
|
|
221
|
+
onClick: () => alert("Cancel clicked"),
|
|
222
|
+
variant: "outlined",
|
|
223
|
+
size: "small",
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ActivityCardActionButton } from "../ActivityCard";
|
|
2
|
+
interface ActivityCardActionSectionProps {
|
|
3
|
+
actions: ActivityCardActionButton[];
|
|
4
|
+
}
|
|
5
|
+
export declare function ActivityCardActionSection({ actions, }: ActivityCardActionSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "../../../../components/Button";
|
|
3
|
+
export function ActivityCardActionSection({ actions, }) {
|
|
4
|
+
return (_jsx("div", { className: "mt-4 sm:mt-6 space-y-2", children: actions.map((action, index) => (_jsx(Button, { variant: action.variant || "outlined", size: action.size || "small", className: `sm:bbn-btn-medium ${action.fullWidth ? "w-full" : ""} ${action.className || ""}`, onClick: action.onClick, children: action.label }, index))) }));
|
|
5
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ActivityCardActionButton } from "../ActivityCard";
|
|
2
|
+
interface ActivityCardAmountSectionProps {
|
|
3
|
+
formattedAmount: string;
|
|
4
|
+
icon?: string | React.ReactNode;
|
|
5
|
+
iconAlt?: string;
|
|
6
|
+
primaryAction?: ActivityCardActionButton;
|
|
7
|
+
}
|
|
8
|
+
export declare function ActivityCardAmountSection({ formattedAmount, icon, iconAlt, primaryAction, }: ActivityCardAmountSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "../../../../components/Button";
|
|
3
|
+
export function ActivityCardAmountSection({ formattedAmount, icon, iconAlt, primaryAction, }) {
|
|
4
|
+
return (_jsxs("div", { className: "flex items-center justify-between mb-4 sm:mb-6", children: [_jsxs("div", { className: "flex items-center gap-2", children: [icon &&
|
|
5
|
+
(typeof icon === "string" ? (_jsx("img", { src: icon, alt: iconAlt || "icon", className: "w-6 h-6 sm:w-8 sm:h-8" })) : (icon)), _jsx("span", { className: "text-base sm:text-lg font-medium text-accent-primary", children: formattedAmount })] }), primaryAction && (_jsx(Button, { variant: primaryAction.variant || "contained", size: primaryAction.size || "small", className: `sm:bbn-btn-medium ${primaryAction.className || ""}`, onClick: primaryAction.onClick, children: primaryAction.label }))] }));
|
|
6
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ActivityCardDetailItem, ActivityListItemData } from "../ActivityCard";
|
|
2
|
+
interface ActivityCardDetailsSectionProps {
|
|
3
|
+
details: ActivityCardDetailItem[];
|
|
4
|
+
optionalDetails?: ActivityCardDetailItem[];
|
|
5
|
+
listItems?: {
|
|
6
|
+
label: string;
|
|
7
|
+
items: ActivityListItemData[];
|
|
8
|
+
}[];
|
|
9
|
+
}
|
|
10
|
+
export declare function ActivityCardDetailsSection({ details, optionalDetails, listItems, }: ActivityCardDetailsSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ActivityListItem } from "./ActivityListItem";
|
|
3
|
+
function DetailRow({ label, value }) {
|
|
4
|
+
return (_jsxs("div", { className: "flex items-center justify-between gap-2 min-w-0 overflow-x-auto", children: [_jsx("span", { className: "text-xs sm:text-sm text-accent-secondary flex-shrink-0", children: label }), _jsx("span", { className: "text-xs sm:text-sm text-accent-primary font-medium text-right min-w-0 overflow-x-auto whitespace-nowrap", children: value })] }));
|
|
5
|
+
}
|
|
6
|
+
export function ActivityCardDetailsSection({ details, optionalDetails, listItems, }) {
|
|
7
|
+
const hasOptionalDetails = optionalDetails && optionalDetails.length > 0;
|
|
8
|
+
const hasListItems = listItems && listItems.length > 0;
|
|
9
|
+
return (_jsxs("div", { className: "space-y-3 sm:space-y-4 overflow-x-auto", children: [_jsx("div", { className: "space-y-4 sm:space-y-6", children: details.map((detail, detailIndex) => (_jsx(DetailRow, { label: detail.label, value: detail.value }, detailIndex))) }), hasListItems && (_jsx("div", { className: "space-y-3 sm:space-y-4", children: listItems.map((listSection, sectionIndex) => (_jsx("div", { className: "bg-surface p-3 sm:p-4 rounded space-y-3 sm:space-y-4 overflow-x-auto", children: _jsxs("div", { className: "flex justify-between items-start gap-2", children: [_jsx("span", { className: "text-xs sm:text-sm text-accent-secondary", children: listSection.label }), _jsx("div", { className: "flex flex-wrap gap-2", children: listSection.items.map((item, itemIndex) => (_jsx(ActivityListItem, { item: item }, item.id || itemIndex))) })] }) }, sectionIndex))) })), hasOptionalDetails && (_jsx("div", { className: "bg-surface p-3 sm:p-4 rounded space-y-3 sm:space-y-4 overflow-x-auto", children: optionalDetails.map((detail, index) => (_jsx(DetailRow, { label: detail.label, value: detail.value }, index))) }))] }));
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ActivityListItemData {
|
|
2
|
+
icon?: string | React.ReactNode;
|
|
3
|
+
iconAlt?: string;
|
|
4
|
+
name: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
}
|
|
7
|
+
interface ActivityListItemProps {
|
|
8
|
+
item: ActivityListItemData;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function ActivityListItem({ item, className }: ActivityListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
export function ActivityListItem({ item, className }) {
|
|
4
|
+
return (_jsxs("div", { className: twMerge("flex items-center gap-2 min-w-0", className), children: [_jsx("span", { className: "text-xs sm:text-sm text-accent-primary font-medium truncate flex items-center", children: item.name }), item.icon && (_jsx("div", { className: "flex items-center w-4 h-4 flex-shrink-0 justify-center text-xs sm:text-sm", children: typeof item.icon === "string" ? (_jsx("img", { src: item.icon, alt: item.iconAlt || item.name, className: "w-full h-full rounded-full object-cover" })) : (item.icon) }))] }));
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ActivityCard, type ActivityCardActionButton, type ActivityCardData, type ActivityCardDetailItem, type ActivityListItemData, } from "./ActivityCard";
|
|
2
|
+
export { ActivityCardActionSection } from "./components/ActivityCardActionSection";
|
|
3
|
+
export { ActivityCardAmountSection } from "./components/ActivityCardAmountSection";
|
|
4
|
+
export { ActivityCardDetailsSection } from "./components/ActivityCardDetailsSection";
|
|
5
|
+
export { ActivityListItem } from "./components/ActivityListItem";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ActivityCard, } from "./ActivityCard";
|
|
2
|
+
export { ActivityCardActionSection } from "./components/ActivityCardActionSection";
|
|
3
|
+
export { ActivityCardAmountSection } from "./components/ActivityCardAmountSection";
|
|
4
|
+
export { ActivityCardDetailsSection } from "./components/ActivityCardDetailsSection";
|
|
5
|
+
export { ActivityListItem } from "./components/ActivityListItem";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
interface FeesSectionProps {
|
|
2
2
|
className?: string;
|
|
3
|
-
feeRate
|
|
3
|
+
feeRate?: number | string;
|
|
4
4
|
onFeeRateEdit?: () => void;
|
|
5
|
-
feeAmount
|
|
6
|
-
coinSymbol
|
|
5
|
+
feeAmount?: number | string;
|
|
6
|
+
coinSymbol?: string;
|
|
7
7
|
feeAmountHint?: string;
|
|
8
|
-
total
|
|
8
|
+
total?: number | string;
|
|
9
9
|
totalHint?: string;
|
|
10
10
|
bbnFeeAmount?: number | string;
|
|
11
11
|
bbnCoinSymbol?: string;
|
|
@@ -6,5 +6,5 @@ import { BTCFeeAmount } from "./BTCFeeAmount";
|
|
|
6
6
|
import { BBNFeeAmount } from "./BBNFeeAmount";
|
|
7
7
|
import { Total } from "./Total";
|
|
8
8
|
export function FeesSection({ className, feeRate, onFeeRateEdit, feeAmount, coinSymbol, feeAmountHint, total, totalHint, bbnFeeAmount, bbnCoinSymbol, bbnFeeAmountHint, bbnFeeDecimals, }) {
|
|
9
|
-
return (_jsx(SubSection, { className: twMerge("flex w-full flex-col content-center justify-between gap-4", className), children: _jsxs("div", { className: "flex flex-col gap-6 p-4", children: [_jsx(BTCFeeRate, { value: feeRate, onEdit: onFeeRateEdit }), _jsx(BTCFeeAmount, { amount: feeAmount, coinSymbol: coinSymbol, hint: feeAmountHint }), bbnFeeAmount !== undefined && bbnCoinSymbol ? (_jsx(BBNFeeAmount, { amount: bbnFeeAmount, coinSymbol: bbnCoinSymbol, hint: bbnFeeAmountHint, decimals: bbnFeeDecimals })) : null, _jsx("div", { className: "divider my-4" }), _jsx(Total, { total: total, coinSymbol: coinSymbol, hint: totalHint })] }) }));
|
|
9
|
+
return (_jsx(SubSection, { className: twMerge("flex w-full flex-col content-center justify-between gap-4", className), children: _jsxs("div", { className: "flex flex-col gap-6 p-4", children: [feeRate !== undefined && _jsx(BTCFeeRate, { value: feeRate, onEdit: onFeeRateEdit }), feeAmount !== undefined && coinSymbol !== undefined && (_jsx(BTCFeeAmount, { amount: feeAmount, coinSymbol: coinSymbol, hint: feeAmountHint })), bbnFeeAmount !== undefined && bbnCoinSymbol ? (_jsx(BBNFeeAmount, { amount: bbnFeeAmount, coinSymbol: bbnCoinSymbol, hint: bbnFeeAmountHint, decimals: bbnFeeDecimals })) : null, total !== undefined && coinSymbol !== undefined && _jsx("div", { className: "divider my-4" }), total !== undefined && coinSymbol !== undefined && _jsx(Total, { total: total, coinSymbol: coinSymbol, hint: totalHint })] }) }));
|
|
10
10
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { FeesSection } from "./FeesSection";
|
|
2
3
|
const meta = {
|
|
3
4
|
component: FeesSection,
|
|
@@ -12,3 +13,6 @@ export const Default = {
|
|
|
12
13
|
total: "0.0001",
|
|
13
14
|
},
|
|
14
15
|
};
|
|
16
|
+
export const BabylonNetworkFee = {
|
|
17
|
+
render: () => (_jsx(FeesSection, { bbnFeeAmount: 0, bbnCoinSymbol: "BABY", bbnFeeAmountHint: "$0,00" })),
|
|
18
|
+
};
|
|
@@ -5,6 +5,8 @@ interface Props {
|
|
|
5
5
|
actionText: string;
|
|
6
6
|
onAdd: () => void;
|
|
7
7
|
onRemove: (id?: string) => void;
|
|
8
|
+
/** Whether to display chain information (logo and name) for each provider item. Defaults to true. */
|
|
9
|
+
showChain?: boolean;
|
|
8
10
|
}
|
|
9
|
-
export declare function FinalityProviderSubsection({ max, items, actionText, onAdd, onRemove }: Props): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function FinalityProviderSubsection({ max, items, actionText, onAdd, onRemove, showChain }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
export {};
|
|
@@ -3,7 +3,7 @@ import { SubSection } from "../../../components/SubSection";
|
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { CounterButton } from "../../../components/CounterButton/CounterButton";
|
|
5
5
|
import { ProvidersList } from "../../../elements/ProvidersList/ProvidersList";
|
|
6
|
-
export function FinalityProviderSubsection({ max, items = [], actionText, onAdd, onRemove }) {
|
|
6
|
+
export function FinalityProviderSubsection({ max, items = [], actionText, onAdd, onRemove, showChain = true }) {
|
|
7
7
|
const count = useMemo(() => items.length, [items]);
|
|
8
|
-
return (_jsx(SubSection, { children: _jsxs("div", { className: "flex w-full flex-col gap-4", children: [_jsx("div", { className: "flex flex-row", children: _jsxs("div", { className: "flex w-full flex-row content-center items-center justify-between font-normal", children: [_jsx("span", { className: "text-sm sm:text-base", children: actionText }), _jsx(CounterButton, { counter: count, max: max, onAdd: onAdd })] }) }), count > 0 && _jsx(ProvidersList, { items: items, onRemove: onRemove })] }) }));
|
|
8
|
+
return (_jsx(SubSection, { children: _jsxs("div", { className: "flex w-full flex-col gap-4", children: [_jsx("div", { className: "flex flex-row", children: _jsxs("div", { className: "flex w-full flex-row content-center items-center justify-between font-normal", children: [_jsx("span", { className: "text-sm sm:text-base", children: actionText }), _jsx(CounterButton, { counter: count, max: max, onAdd: onAdd })] }) }), count > 0 && _jsx(ProvidersList, { items: items, onRemove: onRemove, showChain: showChain })] }) }));
|
|
9
9
|
}
|
package/dist/widgets/sections/FinalityProviderSubsection/FinalityProviderSubsection.stories.d.ts
CHANGED
|
@@ -11,3 +11,4 @@ export declare const SingleProviderMode: Story;
|
|
|
11
11
|
export declare const SingleProviderModeWithItem: Story;
|
|
12
12
|
export declare const ProvidersWithoutLogos: Story;
|
|
13
13
|
export declare const ProvidersWithoutDescriptions: Story;
|
|
14
|
+
export declare const SingleProviderWithoutBsnLogo: Story;
|
package/dist/widgets/sections/FinalityProviderSubsection/FinalityProviderSubsection.stories.js
CHANGED
|
@@ -189,3 +189,24 @@ export const ProvidersWithoutDescriptions = {
|
|
|
189
189
|
},
|
|
190
190
|
render: ({ max, items, actionText, onAdd, onRemove }) => (_jsx(FinalityProviderSubsection, { max: max, items: items, actionText: actionText, onAdd: onAdd, onRemove: onRemove })),
|
|
191
191
|
};
|
|
192
|
+
export const SingleProviderWithoutBsnLogo = {
|
|
193
|
+
args: {
|
|
194
|
+
max: 1,
|
|
195
|
+
items: [
|
|
196
|
+
{
|
|
197
|
+
bsnId: "babylon",
|
|
198
|
+
bsnName: "Babylon Genesis",
|
|
199
|
+
provider: {
|
|
200
|
+
rank: 1,
|
|
201
|
+
logo_url: "https://placehold.co/40x40",
|
|
202
|
+
description: { moniker: "Babylon Provider" },
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
actionText: "Select Validator",
|
|
207
|
+
onAdd: () => alert("Add clicked"),
|
|
208
|
+
onRemove: (bsnId) => alert(`Remove clicked for ${bsnId}`),
|
|
209
|
+
showChain: false,
|
|
210
|
+
},
|
|
211
|
+
render: ({ max, items, actionText, onAdd, onRemove, showChain }) => (_jsx(FinalityProviderSubsection, { max: max, items: items, actionText: actionText, onAdd: onAdd, onRemove: onRemove, showChain: showChain })),
|
|
212
|
+
};
|