@aragon/gov-ui-kit 1.23.1 → 1.25.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/build.css +1 -1
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/types/src/core/components/accordion/accordionItemHeader/accordionItemHeader.api.d.ts +25 -0
- package/dist/types/src/core/components/accordion/accordionItemHeader/accordionItemHeader.d.ts +1 -3
- package/dist/types/src/core/components/accordion/accordionItemHeader/index.d.ts +2 -1
- package/dist/types/src/modules/assets/copy/modulesCopy.d.ts +2 -0
- package/dist/types/src/modules/components/proposal/proposalActions/proposalActionsContext/proposalActionsContext.d.ts +4 -0
- package/dist/types/src/modules/components/proposal/proposalActions/proposalActionsItem/index.d.ts +1 -1
- package/dist/types/src/modules/components/proposal/proposalActions/proposalActionsItem/proposalActionsItem.api.d.ts +30 -8
- package/dist/types/src/modules/components/proposal/proposalActions/proposalActionsRoot/proposalActionsRoot.d.ts +8 -0
- package/package.json +1 -1
package/dist/types/src/core/components/accordion/accordionItemHeader/accordionItemHeader.api.d.ts
ADDED
|
@@ -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
|
+
}
|
package/dist/types/src/core/components/accordion/accordionItemHeader/accordionItemHeader.d.ts
CHANGED
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import {
|
|
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
|
|
1
|
+
export { AccordionItemHeader } from './accordionItemHeader';
|
|
2
|
+
export type { IAccordionItemHeaderProps, IAccordionItemHeaderRemoveControl } from './accordionItemHeader.api';
|
|
@@ -44,6 +44,7 @@ export declare const modulesCopy: {
|
|
|
44
44
|
dropdownLabel: string;
|
|
45
45
|
nativeSendAlert: string;
|
|
46
46
|
nativeSendDescription: (amount: string, symbol: string) => string;
|
|
47
|
+
of: string;
|
|
47
48
|
menu: {
|
|
48
49
|
BASIC: string;
|
|
49
50
|
dropdownLabel: string;
|
|
@@ -54,6 +55,7 @@ export declare const modulesCopy: {
|
|
|
54
55
|
proposalActionsDecoder: {
|
|
55
56
|
copyData: string;
|
|
56
57
|
add: string;
|
|
58
|
+
noParametersMessage: string;
|
|
57
59
|
validation: {
|
|
58
60
|
required: (label: string) => string;
|
|
59
61
|
boolean: (label: string) => 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>;
|
package/dist/types/src/modules/components/proposal/proposalActions/proposalActionsItem/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { ProposalActionsItem } from './proposalActionsItem';
|
|
2
|
-
export type {
|
|
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
|
|
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
|
-
*
|
|
11
|
+
* Callback called with the current action and its index on item click.
|
|
13
12
|
*/
|
|
14
|
-
|
|
13
|
+
onClick: (index: number, action?: TAction) => void;
|
|
15
14
|
/**
|
|
16
|
-
*
|
|
15
|
+
* Whether the item is disabled.
|
|
17
16
|
*/
|
|
18
|
-
|
|
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.
|
|
30
|
+
*/
|
|
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
|
-
*
|
|
59
|
+
* Controls for the action to be moved up or down.
|
|
43
60
|
*/
|
|
44
|
-
|
|
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,9 @@ 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
|
+
* Chain ID for the blockchain network.
|
|
75
|
+
* @default mainnet.id
|
|
76
|
+
*/
|
|
77
|
+
chainId?: number;
|
|
56
78
|
}
|
|
@@ -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>;
|