@aragon/gov-ui-kit 1.24.0 → 1.26.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.
@@ -0,0 +1,25 @@
1
+ import type { ComponentPropsWithRef } from 'react';
2
+ export interface IAccordionItemHeaderRemoveControl {
3
+ /**
4
+ * Label of the remove control.
5
+ */
6
+ label: string;
7
+ /**
8
+ * Callback called with the current item and its index on remove button click.
9
+ */
10
+ onClick: (index: number) => void;
11
+ /**
12
+ * Whether the remove control is disabled.
13
+ */
14
+ disabled: boolean;
15
+ }
16
+ export interface IAccordionItemHeaderProps extends ComponentPropsWithRef<'button'> {
17
+ /**
18
+ * Remove control to be displayed in edit mode.
19
+ */
20
+ removeControl?: IAccordionItemHeaderRemoveControl;
21
+ /**
22
+ * The index of the accordion item.
23
+ */
24
+ index?: number;
25
+ }
@@ -1,4 +1,2 @@
1
- import { type ComponentPropsWithRef } from 'react';
2
- export interface IAccordionItemHeaderProps extends ComponentPropsWithRef<'button'> {
3
- }
1
+ import type { IAccordionItemHeaderProps } from './accordionItemHeader.api';
4
2
  export declare const AccordionItemHeader: import("react").ForwardRefExoticComponent<Omit<IAccordionItemHeaderProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -1 +1,2 @@
1
- export { AccordionItemHeader, type IAccordionItemHeaderProps } from './accordionItemHeader';
1
+ export { AccordionItemHeader } from './accordionItemHeader';
2
+ export type { IAccordionItemHeaderProps, IAccordionItemHeaderRemoveControl } from './accordionItemHeader.api';
@@ -39,11 +39,13 @@ export declare const modulesCopy: {
39
39
  proposalActionsFooter: {
40
40
  collapse: string;
41
41
  expand: string;
42
+ more: string;
42
43
  };
43
44
  proposalActionsItem: {
44
45
  dropdownLabel: string;
45
46
  nativeSendAlert: string;
46
47
  nativeSendDescription: (amount: string, symbol: string) => string;
48
+ of: string;
47
49
  menu: {
48
50
  BASIC: string;
49
51
  dropdownLabel: string;
@@ -19,6 +19,10 @@ export interface IProposalActionsContext {
19
19
  * Whether or not the list of actions is loading.
20
20
  */
21
21
  isLoading: boolean;
22
+ /**
23
+ * Whether or not the component is in edit mode.
24
+ */
25
+ editMode: boolean;
22
26
  }
23
27
  export declare const proposalActionsContext: import("react").Context<IProposalActionsContext | null>;
24
28
  export declare const ProposalActionsContextProvider: import("react").Provider<IProposalActionsContext | null>;
@@ -1 +1 @@
1
- export { ProposalActionsFooter, type IProposalActionsFooterProps } from './proposalActionsFooter';
1
+ export { ProposalActionsFooter, type IProposalActionsFooterDropdownItem, type IProposalActionsFooterProps, } from './proposalActionsFooter';
@@ -1,8 +1,33 @@
1
1
  import type { ComponentProps } from 'react';
2
+ import { IconType } from '../../../../../core';
3
+ export interface IProposalActionsFooterDropdownItem {
4
+ /**
5
+ * Label for the dropdown item.
6
+ */
7
+ label: string;
8
+ /**
9
+ * Icon to display next to the label.
10
+ */
11
+ icon?: IconType;
12
+ /**
13
+ * Position of the icon relative to the label.
14
+ */
15
+ iconPosition?: 'left' | 'right';
16
+ /**
17
+ * Callback function to be executed when the dropdown item is clicked.
18
+ */
19
+ onClick: () => void;
20
+ }
2
21
  export interface IProposalActionsFooterProps extends ComponentProps<'div'> {
3
22
  /**
4
23
  * List of action IDs to be used to toggle the expanded state for all the actions, defaults to the index of the actions.
5
24
  */
6
25
  actionIds?: string[];
26
+ /**
27
+ * Optional dropdown items to display in a dropdown menu alongside the expand/collapse action.
28
+ * When provided, the expand/collapse button is replaced with a dropdown containing both
29
+ * the expand/collapse action and the provided items.
30
+ */
31
+ dropdownItems?: IProposalActionsFooterDropdownItem[];
7
32
  }
8
33
  export declare const ProposalActionsFooter: React.FC<IProposalActionsFooterProps>;
@@ -1,2 +1,2 @@
1
1
  export { ProposalActionsItem } from './proposalActionsItem';
2
- export type { IProposalActionsItemDropdownItem, IProposalActionsItemProps, ProposalActionsItemViewMode, } from './proposalActionsItem.api';
2
+ export type { IProposalActionsArrayControl, IProposalActionsArrayControls, IProposalActionsItemProps, ProposalActionsItemViewMode, } from './proposalActionsItem.api';
@@ -1,21 +1,34 @@
1
- import type { IconType } from '../../../../../core';
2
1
  import type { IWeb3ComponentProps } from '../../../../types';
3
2
  import type { ProposalActionsDecoderView } from '../proposalActionsDecoder';
4
3
  import type { IProposalAction, ProposalActionComponent } from '../proposalActionsDefinitions';
5
4
  export type ProposalActionsItemViewMode = 'BASIC' | ProposalActionsDecoderView;
6
- export interface IProposalActionsItemDropdownItem<TAction extends IProposalAction = IProposalAction> {
5
+ export interface IProposalActionsArrayControl<TAction extends IProposalAction = IProposalAction> {
7
6
  /**
8
7
  * Label of the item.
9
8
  */
10
9
  label: string;
11
10
  /**
12
- * Icon of the item.
11
+ * Callback called with the current action and its index on item click.
13
12
  */
14
- icon: IconType;
13
+ onClick: (index: number, action?: TAction) => void;
15
14
  /**
16
- * Callback called with the current action and its index on item click.
15
+ * Whether the item is disabled.
16
+ */
17
+ disabled: boolean;
18
+ }
19
+ export interface IProposalActionsArrayControls<TAction extends IProposalAction = IProposalAction> {
20
+ /**
21
+ * Move down control.
22
+ */
23
+ moveDown: IProposalActionsArrayControl<TAction>;
24
+ /**
25
+ * Move up control.
26
+ */
27
+ moveUp: IProposalActionsArrayControl<TAction>;
28
+ /**
29
+ * Remove control.
17
30
  */
18
- onClick: (action: TAction, index: number) => void;
31
+ remove: IProposalActionsArrayControl<TAction>;
19
32
  }
20
33
  export interface IProposalActionsItemProps<TAction extends IProposalAction = IProposalAction> extends IWeb3ComponentProps {
21
34
  /**
@@ -26,6 +39,10 @@ export interface IProposalActionsItemProps<TAction extends IProposalAction = IPr
26
39
  * Function selector of the action to be displayed optionally.
27
40
  */
28
41
  actionFunctionSelector?: string;
42
+ /**
43
+ * Count of the action to be displayed optionally.
44
+ */
45
+ actionCount?: number;
29
46
  /**
30
47
  * Index of the action injected by the <ProposalActions.Container /> component.
31
48
  */
@@ -39,9 +56,9 @@ export interface IProposalActionsItemProps<TAction extends IProposalAction = IPr
39
56
  */
40
57
  CustomComponent?: ProposalActionComponent<TAction>;
41
58
  /**
42
- * Items displayed beside the "View as" menu.
59
+ * Controls for the action to be moved up or down.
43
60
  */
44
- dropdownItems?: Array<IProposalActionsItemDropdownItem<TAction>>;
61
+ arrayControls?: IProposalActionsArrayControls<TAction>;
45
62
  /**
46
63
  * Enables the edit-mode when set to true. The RAW view will be editable only if the action has no DECODED view,
47
64
  * similarly the DECODED view will be editable only if the action has no BASIC view.
@@ -53,4 +70,14 @@ export interface IProposalActionsItemProps<TAction extends IProposalAction = IPr
53
70
  * Form prefix to be prepended to all proposal action text fields.
54
71
  */
55
72
  formPrefix?: string;
73
+ /**
74
+ * If true, skips react-hook-form watching and treats the item as read-only (useful when rendered outside a FormProvider).
75
+ * @default false
76
+ */
77
+ readOnly?: boolean;
78
+ /**
79
+ * Chain ID for the blockchain network.
80
+ * @default mainnet.id
81
+ */
82
+ chainId?: number;
56
83
  }
@@ -9,6 +9,7 @@ export interface IProposalActionsRootProps extends ComponentProps<'div'> {
9
9
  actionsCount?: number;
10
10
  /**
11
11
  * List of actions ids that are expanded. To be used for controlling the expanded / collapsed states.
12
+ * When using editMode, you should set this prop to expand all actions (e.g., array of all action indices as strings).
12
13
  */
13
14
  expandedActions?: string[];
14
15
  /**
@@ -20,5 +21,12 @@ export interface IProposalActionsRootProps extends ComponentProps<'div'> {
20
21
  * @default false
21
22
  */
22
23
  isLoading?: boolean;
24
+ /**
25
+ * Whether or not the component is in edit mode. When true, actions show index badges, movement controls,
26
+ * and remove buttons. Note: This prop controls UI features only - you must also set expandedActions to
27
+ * expand the accordions.
28
+ * @default false
29
+ */
30
+ editMode?: boolean;
23
31
  }
24
32
  export declare const ProposalActionsRoot: React.FC<IProposalActionsRootProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aragon/gov-ui-kit",
3
- "version": "1.24.0",
3
+ "version": "1.26.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",
@@ -70,16 +70,16 @@
70
70
  "@babel/preset-env": "^7.28.3",
71
71
  "@babel/preset-react": "^7.27.1",
72
72
  "@babel/preset-typescript": "^7.27.1",
73
- "@changesets/changelog-github": "^0.5.1",
74
- "@changesets/cli": "^2.29.7",
73
+ "@changesets/changelog-github": "^0.5.2",
74
+ "@changesets/cli": "^2.29.8",
75
75
  "@hookform/devtools": "^4.4.0",
76
76
  "@rollup/plugin-commonjs": "^28.0.6",
77
77
  "@rollup/plugin-image": "^3.0.3",
78
78
  "@rollup/plugin-node-resolve": "^16.0.1",
79
79
  "@rollup/plugin-terser": "^0.4.4",
80
80
  "@rollup/plugin-typescript": "^12.1.4",
81
- "@storybook/addon-docs": "^9.1.7",
82
- "@storybook/react-vite": "^9.1.7",
81
+ "@storybook/addon-docs": "^9.1.16",
82
+ "@storybook/react-vite": "^9.1.16",
83
83
  "@svgr/rollup": "^8.1.0",
84
84
  "@tailwindcss/postcss": "^4.1.13",
85
85
  "@tailwindcss/typography": "^0.5.16",
@@ -95,13 +95,13 @@
95
95
  "@types/react-dom": "^18",
96
96
  "@types/sanitize-html": "^2.16.0",
97
97
  "cross-env": "^10.0.0",
98
- "eslint": "^9.36.0",
98
+ "eslint": "^9.39.1",
99
99
  "eslint-import-resolver-typescript": "^4.4.4",
100
100
  "eslint-plugin-import": "^2.32.0",
101
101
  "eslint-plugin-jsx-a11y": "^6.10.2",
102
102
  "eslint-plugin-react": "^7.37.5",
103
103
  "eslint-plugin-react-hooks": "^5.2.0",
104
- "eslint-plugin-storybook": "^9.1.7",
104
+ "eslint-plugin-storybook": "^9.1.16",
105
105
  "eslint-plugin-testing-library": "^7.9.1",
106
106
  "husky": "^9.1.7",
107
107
  "jest": "^30.1.3",
@@ -119,19 +119,19 @@
119
119
  "rollup-plugin-peer-deps-external": "^2.2.4",
120
120
  "rollup-plugin-postcss": "^4.0.2",
121
121
  "rollup-plugin-visualizer": "^6.0.3",
122
- "storybook": "^9.1.7",
122
+ "storybook": "^9.1.16",
123
123
  "tailwindcss": "^4.1.13",
124
124
  "ts-jest": "^29.4.4",
125
125
  "tslib": "2.8.1",
126
126
  "typescript": "^5.9.2",
127
127
  "typescript-eslint": "^8.44.1",
128
- "vercel": "^48.1.1",
128
+ "vercel": "^48.12.0",
129
129
  "viem": "^2.37.8",
130
130
  "vite": "^7.1.7",
131
131
  "vite-plugin-node-polyfills": "^0.24.0",
132
132
  "vite-plugin-static-copy": "^3.1.2",
133
133
  "vite-plugin-svgr": "^4.5.0",
134
- "wagmi": "^2.17.2",
134
+ "wagmi": "^2.19.5",
135
135
  "zod": "^3.23.8"
136
136
  },
137
137
  "bugs": {