@aragon/gov-ui-kit 2.5.2 → 2.7.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.
@@ -203,5 +203,25 @@ export declare const modulesCopy: {
203
203
  contract: string;
204
204
  };
205
205
  };
206
+ transactionDataListItemStructure: {
207
+ received: string;
208
+ sent: string;
209
+ action: string;
210
+ executed: string;
211
+ actionCount: (count: number) => string;
212
+ };
213
+ transactionDetailSummary: {
214
+ executedBy: string;
215
+ proposal: string;
216
+ totalActions: string;
217
+ transaction: string;
218
+ executedOn: string;
219
+ };
220
+ transactionDetail: {
221
+ title: string;
222
+ more: string;
223
+ expand: string;
224
+ collapse: string;
225
+ };
206
226
  };
207
227
  export type ModulesCopy = typeof modulesCopy;
@@ -1 +1,3 @@
1
1
  export * from './transactionDataListItem';
2
+ export * from './transactionDetail';
3
+ export * from './transactionDetailSummary';
@@ -1,2 +1,2 @@
1
1
  export { TransactionDataListItemStructure } from './transactionDataListItemStructure';
2
- export { type ITransactionDataListItemProps, TransactionStatus, TransactionType, } from './transactionDataListItemStructure.api';
2
+ export { type ITransactionDataListItemProps, TransactionStatus, type TransactionTransferType, TransactionType, } from './transactionDataListItemStructure.api';
@@ -8,21 +8,15 @@ export declare enum TransactionStatus {
8
8
  export declare enum TransactionType {
9
9
  DEPOSIT = "DEPOSIT",
10
10
  WITHDRAW = "WITHDRAW",
11
- ACTION = "ACTION"
11
+ ACTION = "ACTION",
12
+ EXECUTION = "EXECUTION"
12
13
  }
13
- export type ITransactionDataListItemProps = IDataListItemProps & {
14
+ export type TransactionTransferType = Exclude<TransactionType, TransactionType.EXECUTION>;
15
+ type TransactionDataListItemBaseProps = IDataListItemProps & {
14
16
  /**
15
17
  * The chain ID of the transaction.
16
18
  */
17
19
  chainId: number;
18
- /**
19
- * The symbol of the token (e.g. 'ETH').
20
- */
21
- tokenSymbol: string;
22
- /**
23
- * The token value in the transaction.
24
- */
25
- tokenAmount?: number | string;
26
20
  /**
27
21
  * The price of the transaction in USD.
28
22
  */
@@ -50,3 +44,52 @@ export type ITransactionDataListItemProps = IDataListItemProps & {
50
44
  */
51
45
  hash?: Hash;
52
46
  };
47
+ export type ITransactionDataListItemTransferProps = TransactionDataListItemBaseProps & {
48
+ /**
49
+ * The symbol of the token (e.g. 'ETH').
50
+ */
51
+ tokenSymbol: string;
52
+ /**
53
+ * The token value in the transaction.
54
+ */
55
+ tokenAmount?: number | string;
56
+ /**
57
+ * The type of transaction.
58
+ * @default TransactionType.ACTION
59
+ */
60
+ type?: TransactionTransferType;
61
+ /**
62
+ * Executor labels are only rendered for `TransactionType.EXECUTION` transactions.
63
+ */
64
+ label?: never;
65
+ /**
66
+ * Action counts are only rendered for `TransactionType.EXECUTION` transactions.
67
+ */
68
+ actionCount?: never;
69
+ };
70
+ export type ITransactionDataListItemExecutionProps = TransactionDataListItemBaseProps & {
71
+ /**
72
+ * Execution transaction type.
73
+ */
74
+ type: TransactionType.EXECUTION;
75
+ /**
76
+ * Label of the executor for `TransactionType.EXECUTION` transactions, rendered as `Executed {label}`. Accepts a
77
+ * human-readable plugin name (e.g. 'Token Voting') or an address, which gets truncated automatically.
78
+ */
79
+ label?: string;
80
+ /**
81
+ * Number of actions bundled in a `TransactionType.EXECUTION` transaction. Rendered as the right-side value
82
+ * (e.g. '5 actions') in place of the token amount.
83
+ */
84
+ actionCount: number;
85
+ /**
86
+ * Token amounts are not rendered for execution transactions.
87
+ */
88
+ tokenAmount?: never;
89
+ /**
90
+ * Token symbols are not rendered for execution transactions.
91
+ */
92
+ tokenSymbol?: never;
93
+ };
94
+ export type ITransactionDataListItemProps = ITransactionDataListItemTransferProps | ITransactionDataListItemExecutionProps;
95
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const TransactionDetail: {
2
+ Root: import("react").FC<import("./transactionDetailRoot").ITransactionDetailRootProps>;
3
+ };
4
+ export * from './transactionDetailRoot';
@@ -0,0 +1,17 @@
1
+ import type { ComponentPropsWithoutRef } from 'react';
2
+ export interface ITransactionDetailRootProps extends ComponentPropsWithoutRef<'div'> {
3
+ /**
4
+ * Title displayed in the dialog header. Defaults to the localized "Executed" copy.
5
+ */
6
+ title?: string;
7
+ /**
8
+ * Callback triggered on close-button click. The close button is hidden when the property is not set.
9
+ */
10
+ onClose?: () => void;
11
+ }
12
+ /**
13
+ * The `<TransactionDetail.Root />` component renders the dialog header and the scrollable content shell of an
14
+ * execution detail dialog. Compose it with `<TransactionDetailSummary />` and an action-list component such as
15
+ * `<ProposalActions />` for decoded execution actions. It must be rendered inside a `<Dialog.Root />`.
16
+ */
17
+ export declare const TransactionDetailRoot: React.FC<ITransactionDetailRootProps>;
@@ -0,0 +1,2 @@
1
+ export { TransactionDetailSummary } from './transactionDetailSummary';
2
+ export type * from './transactionDetailSummary.api';
@@ -0,0 +1,60 @@
1
+ import type { ComponentPropsWithoutRef } from 'react';
2
+ import type { Hash } from 'viem';
3
+ /**
4
+ * Entity that executed the transaction, rendered on the `Executed by` row.
5
+ *
6
+ * The three states from the design map onto these fields:
7
+ * - Not an active-process execution: set `label` (plugin name or address) and `address`; omit `href` so the label
8
+ * links to the block explorer, and omit `helptext`.
9
+ * - Active-process execution: set `label` to the process name, `helptext` to the plugin name and version (e.g.
10
+ * 'SPP v1.3') and `href` to the process detail page.
11
+ */
12
+ export interface ITransactionDetailSummaryExecutedBy {
13
+ /**
14
+ * Address of the executor. Builds the block-explorer link (unless `href` is set) and the copy button, and is used
15
+ * as the label (truncated) when `label` is not provided.
16
+ */
17
+ address?: string;
18
+ /**
19
+ * Label displayed for the executor (e.g. a process or plugin name). Defaults to the truncated `address`.
20
+ */
21
+ label?: string;
22
+ /**
23
+ * Helptext displayed below the label (e.g. the plugin name and version, 'SPP v1.3'). Hidden when not provided.
24
+ */
25
+ helptext?: string;
26
+ /**
27
+ * Internal link applied to the label (e.g. the process detail page). Takes precedence over the block-explorer link.
28
+ */
29
+ href?: string;
30
+ }
31
+ export interface ITransactionDetailSummaryProps extends ComponentPropsWithoutRef<'dl'> {
32
+ /**
33
+ * Chain ID of the transaction, used to build the block-explorer links.
34
+ */
35
+ chainId: number;
36
+ /**
37
+ * Entity that executed the transaction, rendered on the `Executed by` row.
38
+ */
39
+ executedBy: ITransactionDetailSummaryExecutedBy;
40
+ /**
41
+ * Identifier of the proposal that triggered the execution (e.g. 'CRE-54'). The row is omitted when not set.
42
+ */
43
+ proposalId?: string;
44
+ /**
45
+ * Internal link applied to the proposal identifier (e.g. the proposal detail page).
46
+ */
47
+ proposalHref?: string;
48
+ /**
49
+ * Total number of actions bundled in the execution.
50
+ */
51
+ totalActions: number;
52
+ /**
53
+ * Hash of the execution transaction. Rendered truncated with an explorer link and a copy button.
54
+ */
55
+ transactionHash: Hash;
56
+ /**
57
+ * Date of the execution in ISO format or as a timestamp.
58
+ */
59
+ date: number | string;
60
+ }
@@ -0,0 +1,2 @@
1
+ import type { ITransactionDetailSummaryProps } from './transactionDetailSummary.api';
2
+ export declare const TransactionDetailSummary: React.FC<ITransactionDetailSummaryProps>;
@@ -20,6 +20,13 @@ declare class AddressUtils {
20
20
  * @returns The truncated address when the address input is valid, the address input as is otherwise.
21
21
  */
22
22
  truncateAddress: (address?: string) => string;
23
+ /**
24
+ * Truncates the input hash (e.g. a merkle root, transaction or block hash) by displaying the first 10 and last 8 characters.
25
+ * @param hash The 32-byte hash to truncate
26
+ * @returns The truncated hash when the input is a valid 32-byte hash, the input as is otherwise.
27
+ */
28
+ truncateHash: (hash?: string) => string;
29
+ private truncate;
23
30
  /**
24
31
  * Returns the address on its checksum format
25
32
  * @param address The address to be formatted
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aragon/gov-ui-kit",
3
- "version": "2.5.2",
3
+ "version": "2.7.0",
4
4
  "description": "Implementation of the Aragon's Governance UI Kit",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/types/src/index.d.ts",
@@ -130,7 +130,7 @@
130
130
  "vite-plugin-static-copy": "^4.1.0",
131
131
  "vite-plugin-svgr": "^5.2.0",
132
132
  "wagmi": "^3.6.14",
133
- "zod": "^3.25.76"
133
+ "zod": "^4.4.3"
134
134
  },
135
135
  "bugs": {
136
136
  "url": "https://github.com/aragon/gov-ui-kit/issues"