@aragon/gov-ui-kit 1.6.0 → 1.8.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.
Files changed (66) hide show
  1. package/CHANGELOG.md +98 -13
  2. package/build.css +1 -5
  3. package/dist/index.es.js +1 -1
  4. package/dist/index.es.js.map +1 -1
  5. package/dist/types/.storybook/main.d.ts +1 -1
  6. package/dist/types/.storybook/preview.d.ts +1 -1
  7. package/dist/types/.storybook/theme.d.ts +1 -1
  8. package/dist/types/src/core/assets/copy/coreCopy.d.ts +3 -0
  9. package/dist/types/src/core/components/clipboard/clipboard.d.ts +28 -0
  10. package/dist/types/src/core/components/clipboard/index.d.ts +1 -0
  11. package/dist/types/src/core/components/dataList/dataListItem/dataListItem.d.ts +2 -2
  12. package/dist/types/src/core/components/definitionList/definitionListItem/definitionListItem.d.ts +8 -4
  13. package/dist/types/src/core/components/definitionList/definitionListItem/definitionListItemContent.d.ts +13 -0
  14. package/dist/types/src/core/components/index.d.ts +1 -0
  15. package/dist/types/src/core/components/link/link/link.api.d.ts +6 -7
  16. package/dist/types/src/core/components/toggles/toggleGroup/toggleGroup.d.ts +5 -0
  17. package/dist/types/src/core/components/tooltip/tooltip.d.ts +4 -0
  18. package/dist/types/src/core/hooks/index.d.ts +1 -0
  19. package/dist/types/src/core/hooks/useCopy/index.d.ts +1 -0
  20. package/dist/types/src/core/hooks/useCopy/useCopy.d.ts +11 -0
  21. package/dist/types/src/modules/assets/copy/modulesCopy.d.ts +16 -12
  22. package/dist/types/src/modules/components/proposal/proposalUtils.d.ts +2 -11
  23. package/dist/types/src/modules/components/proposal/proposalVoting/index.d.ts +3 -1
  24. package/dist/types/src/modules/components/proposal/proposalVoting/proposalVotingBodyContent/proposalVotingBodyContent.d.ts +7 -7
  25. package/dist/types/src/modules/components/proposal/proposalVoting/proposalVotingBodySummaryList/proposalVotingBodySummaryList.d.ts +2 -2
  26. package/dist/types/src/modules/components/proposal/proposalVoting/proposalVotingBodySummaryListItem/proposalVotingBodySummaryListItem.d.ts +3 -3
  27. package/dist/types/src/modules/components/proposal/proposalVoting/proposalVotingBreakdownMultisig/proposalVotingBreakdownMultisig.d.ts +10 -1
  28. package/dist/types/src/modules/components/proposal/proposalVoting/proposalVotingBreakdownToken/proposalVotingBreakdownToken.d.ts +5 -0
  29. package/dist/types/src/modules/components/proposal/proposalVoting/proposalVotingContainer/proposalVotingContainer.d.ts +7 -5
  30. package/dist/types/src/modules/components/proposal/proposalVoting/proposalVotingContext/index.d.ts +2 -0
  31. package/dist/types/src/modules/components/proposal/proposalVoting/proposalVotingContext/proposalVotingContext.api.d.ts +21 -0
  32. package/dist/types/src/modules/components/proposal/proposalVoting/proposalVotingContext/proposalVotingContext.d.ts +3 -0
  33. package/dist/types/src/modules/components/proposal/proposalVoting/proposalVotingProgress/proposalVotingProgressItem.d.ts +13 -4
  34. package/dist/types/src/modules/components/proposal/proposalVoting/proposalVotingStage/proposalVotingStage.d.ts +12 -11
  35. package/dist/types/src/modules/components/proposal/proposalVoting/proposalVotingStageContainer/index.d.ts +1 -0
  36. package/dist/types/src/modules/components/proposal/proposalVoting/proposalVotingStageContainer/proposalVotingStageContainer.d.ts +12 -0
  37. package/dist/types/src/modules/components/proposal/proposalVoting/proposalVotingStatus/index.d.ts +1 -0
  38. package/dist/types/src/modules/components/proposal/proposalVoting/proposalVotingStatus/proposalVotingStatus.d.ts +26 -0
  39. package/dist/types/src/modules/components/proposal/proposalVoting/proposalVotingStatus/proposalVotingStatusAdvanceable.d.ts +12 -0
  40. package/dist/types/src/modules/components/proposal/proposalVoting/proposalVotingTabs/proposalVotingTabs.d.ts +2 -2
  41. package/dist/types/src/modules/components/vote/voteDataListItem/voteDataListItemStructure/voteDataListItemStructure.d.ts +7 -2
  42. package/dist/types/src/modules/components/vote/voteProposalDataListItem/voteProposalDataListItemStructure/voteProposalDataListItemStructure.d.ts +7 -2
  43. package/dist/types/src/modules/components/vote/voteUtils.d.ts +2 -2
  44. package/dist/types/src/modules/types/definitionSetting.d.ts +1 -1
  45. package/index.css +1 -4
  46. package/package.json +50 -56
  47. package/src/core/components/illustrations/index.css +2 -2
  48. package/src/theme/index.css +2 -1
  49. package/src/theme/tokens/index.css +1 -1
  50. package/src/theme/tokens/primitives/borderRadius.css +9 -8
  51. package/src/theme/tokens/primitives/breakpoints.css +16 -0
  52. package/src/theme/tokens/primitives/colors.css +69 -59
  53. package/src/theme/tokens/primitives/focusRing.css +56 -0
  54. package/src/theme/tokens/primitives/index.css +3 -1
  55. package/src/theme/tokens/primitives/shadows.css +40 -38
  56. package/src/theme/tokens/primitives/spacing.css +2 -36
  57. package/src/theme/tokens/primitives/typography.css +20 -22
  58. package/src/theme/utils/animations.css +23 -0
  59. package/src/theme/utils/index.css +3 -0
  60. package/src/theme/utils/prose.css +72 -0
  61. package/src/theme/utils/pseudoElements.css +27 -0
  62. package/dist/types/src/modules/components/proposal/proposalVoting/proposalVotingStageContext/index.d.ts +0 -1
  63. package/dist/types/src/modules/components/proposal/proposalVoting/proposalVotingStageContext/proposalVotingStageContext.d.ts +0 -17
  64. package/dist/types/src/modules/components/proposal/proposalVoting/proposalVotingStageStatus/index.d.ts +0 -1
  65. package/dist/types/src/modules/components/proposal/proposalVoting/proposalVotingStageStatus/proposalVotingStageStatus.d.ts +0 -18
  66. package/tailwind.config.js +0 -376
@@ -1,3 +1,3 @@
1
- import type { StorybookConfig } from '@storybook/react-webpack5';
1
+ import type { StorybookConfig } from '@storybook/react-vite';
2
2
  declare const config: StorybookConfig;
3
3
  export default config;
@@ -1,4 +1,4 @@
1
- import type { Preview } from '@storybook/react';
1
+ import type { Preview } from '@storybook/react-vite';
2
2
  import '../index.css';
3
3
  import './style.css';
4
4
  declare const preview: Preview;
@@ -1,2 +1,2 @@
1
- declare const _default: import("@storybook/theming").ThemeVars;
1
+ declare const _default: import("storybook/theming").ThemeVars;
2
2
  export default _default;
@@ -27,5 +27,8 @@ export declare const coreCopy: {
27
27
  inputNumberMax: {
28
28
  max: string;
29
29
  };
30
+ clipboard: {
31
+ copy: string;
32
+ };
30
33
  };
31
34
  export type CoreCopy = typeof coreCopy;
@@ -0,0 +1,28 @@
1
+ import { type AvatarIconSize } from '../avatars';
2
+ import { type ButtonSize } from '../button';
3
+ export type ClipboardVariant = 'button' | 'avatar' | 'avatar-white-bg';
4
+ export interface IClipboardProps {
5
+ /**
6
+ * Text value to be copied to the clipboard.
7
+ */
8
+ copyValue: string;
9
+ /**
10
+ * Size of the button or avatar.
11
+ * @default sm
12
+ */
13
+ size?: ButtonSize | AvatarIconSize;
14
+ /**
15
+ * Variant of the button.
16
+ * @default avatar
17
+ */
18
+ variant?: ClipboardVariant;
19
+ /**
20
+ * Class name to be applied to the wrapper.
21
+ */
22
+ className?: string;
23
+ /**
24
+ * Optional children to be rendered next to the clipboard.
25
+ */
26
+ children?: React.ReactNode;
27
+ }
28
+ export declare const Clipboard: React.FC<IClipboardProps>;
@@ -0,0 +1 @@
1
+ export { Clipboard, type ClipboardVariant, type IClipboardProps } from './clipboard';
@@ -1,3 +1,3 @@
1
- import { type AnchorHTMLAttributes, type ButtonHTMLAttributes } from 'react';
2
- export type IDataListItemProps = ButtonHTMLAttributes<HTMLButtonElement> | AnchorHTMLAttributes<HTMLAnchorElement>;
1
+ import { type AnchorHTMLAttributes, type ButtonHTMLAttributes, type HTMLAttributes } from 'react';
2
+ export type IDataListItemProps = ButtonHTMLAttributes<HTMLButtonElement> | AnchorHTMLAttributes<HTMLAnchorElement> | HTMLAttributes<HTMLDivElement>;
3
3
  export declare const DataListItem: React.FC<IDataListItemProps>;
@@ -1,13 +1,17 @@
1
1
  import { type ComponentPropsWithRef } from 'react';
2
- import { type ILinkProps } from '../../link';
3
- export interface IDefinitionListItemProps extends ComponentPropsWithRef<'div'> {
2
+ import { type IDefinitionListItemContentProps } from './definitionListItemContent';
3
+ export interface IDefinitionListItemProps extends ComponentPropsWithRef<'div'>, Pick<IDefinitionListItemContentProps, 'link'> {
4
4
  /**
5
5
  * The term to be displayed in the definition list item.
6
6
  */
7
7
  term: string;
8
8
  /**
9
- * The materials for a Link component if necessary.
9
+ * Renders an icon to copy the defined value on the clipboard when set.
10
10
  */
11
- link?: ILinkProps;
11
+ copyValue?: string;
12
+ /**
13
+ * Optional description text for the definition list item.
14
+ */
15
+ description?: string;
12
16
  }
13
17
  export declare const DefinitionListItem: React.FC<IDefinitionListItemProps>;
@@ -0,0 +1,13 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type ILinkProps } from '../../link';
3
+ export interface IDefinitionListItemContentProps {
4
+ /**
5
+ * Renders the item as a link with the provided properties when set.
6
+ */
7
+ link?: ILinkProps;
8
+ /**
9
+ * Children of the component.
10
+ */
11
+ children?: ReactNode;
12
+ }
13
+ export declare const DefinitionListItemContent: React.FC<IDefinitionListItemContentProps>;
@@ -4,6 +4,7 @@ export * from './avatars';
4
4
  export * from './breadcrumbs';
5
5
  export * from './button';
6
6
  export * from './cards';
7
+ export * from './clipboard';
7
8
  export * from './collapsible';
8
9
  export * from './dataList';
9
10
  export * from './definitionList';
@@ -1,5 +1,4 @@
1
1
  import type { AnchorHTMLAttributes } from 'react';
2
- import { type IconType } from '../../icon';
3
2
  export type LinkVariant = 'primary' | 'neutral';
4
3
  export interface ILinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
5
4
  /**
@@ -7,20 +6,20 @@ export interface ILinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
7
6
  * @default 'primary'
8
7
  */
9
8
  variant?: LinkVariant;
10
- /**
11
- * Icon displayed on the right side of the link. Accepts any icon from src/components/icon/iconList.ts.
12
- */
13
- iconRight?: IconType;
14
9
  /**
15
10
  * Whether the link is disabled.
16
11
  */
17
12
  disabled?: boolean;
18
13
  /**
19
- * Optional description text.
14
+ * Optionally show URL as a description below the link text.
20
15
  */
21
- description?: string;
16
+ showUrl?: boolean;
22
17
  /**
23
18
  * Classnames to be applied directly to the link text.
24
19
  */
25
20
  textClassName?: string;
21
+ /**
22
+ * Whether the link is external. If true, the link will open in a new tab and will have external link icon.
23
+ */
24
+ isExternal?: boolean;
26
25
  }
@@ -6,6 +6,11 @@ export interface IToggleGroupBaseProps<TMulti extends boolean> extends Omit<Comp
6
6
  * @default fixed
7
7
  */
8
8
  variant?: 'fixed' | 'space-between';
9
+ /**
10
+ * Orientation of the toggle group.
11
+ * @default horizontal
12
+ */
13
+ orientation?: 'horizontal' | 'vertical';
9
14
  /**
10
15
  * Allows multiple toggles to be selected at the same time when set to true.
11
16
  */
@@ -40,5 +40,9 @@ export interface ITooltipProps {
40
40
  * Children elements to trigger the tooltip.
41
41
  */
42
42
  children?: ReactNode;
43
+ /**
44
+ * When `true`, the tooltip will use children button as a trigger, to avoid a button inside a button.
45
+ */
46
+ triggerAsChild?: boolean;
43
47
  }
44
48
  export declare const Tooltip: React.FC<ITooltipProps>;
@@ -1,2 +1,3 @@
1
+ export * from './useCopy';
1
2
  export * from './useDebouncedValue';
2
3
  export * from './useRandomId';
@@ -0,0 +1 @@
1
+ export { useCopy, type IUseCopyReturn } from './useCopy';
@@ -0,0 +1,11 @@
1
+ export interface IUseCopyReturn {
2
+ /**
3
+ * Indicates whether the text has been copied. Resets after timeout of 2 seconds.
4
+ */
5
+ isCopied: boolean;
6
+ /**
7
+ * Function to copy the text to the clipboard.
8
+ */
9
+ handleCopy: (text: string) => Promise<void>;
10
+ }
11
+ export declare const useCopy: () => IUseCopyReturn;
@@ -100,6 +100,7 @@ export declare const modulesCopy: {
100
100
  EXECUTABLE: string;
101
101
  REJECTED: string;
102
102
  VETOED: string;
103
+ UNREACHED: string;
103
104
  };
104
105
  };
105
106
  proposalDataListItemStructure: {
@@ -113,6 +114,7 @@ export declare const modulesCopy: {
113
114
  };
114
115
  proposalVotingBreakdownMultisig: {
115
116
  name: string;
117
+ nameVeto: string;
116
118
  description: (count: string) => string;
117
119
  };
118
120
  proposalVotingBreakdownToken: {
@@ -120,9 +122,12 @@ export declare const modulesCopy: {
120
122
  yes: string;
121
123
  no: string;
122
124
  abstain: string;
125
+ approveDescription: string;
126
+ vetoDescription: string;
123
127
  };
124
128
  support: {
125
129
  name: string;
130
+ nameVeto: string;
126
131
  description: (value: string) => string;
127
132
  };
128
133
  minParticipation: {
@@ -130,7 +135,11 @@ export declare const modulesCopy: {
130
135
  description: (value: string) => string;
131
136
  };
132
137
  };
133
- proposalVotingStageStatus: {
138
+ proposalVotingProgressItem: {
139
+ reached: string;
140
+ unreached: string;
141
+ };
142
+ proposalVotingStatus: {
134
143
  main: {
135
144
  proposal: string;
136
145
  stage: string;
@@ -139,24 +148,23 @@ export declare const modulesCopy: {
139
148
  pending: string;
140
149
  active: string;
141
150
  accepted: string;
151
+ executable: string;
152
+ executed: string;
142
153
  rejected: string;
143
154
  expired: string;
144
155
  unreached: string;
145
156
  vetoed: string;
157
+ advanceable: (canAdvance?: boolean, isShortWindow?: boolean) => "until advanceable" | "left to advance" | "is";
146
158
  };
147
159
  status: {
148
160
  accepted: string;
149
161
  rejected: string;
150
- expired: string;
151
162
  vetoed: string;
163
+ advanceable: string;
164
+ executed: string;
165
+ executable: string;
152
166
  };
153
167
  };
154
- proposalVotingDetails: {
155
- voting: string;
156
- governance: string;
157
- starts: string;
158
- expires: string;
159
- };
160
168
  proposalVotingStage: {
161
169
  stage: (index: number) => string;
162
170
  };
@@ -166,10 +174,6 @@ export declare const modulesCopy: {
166
174
  voteDataListItemStructure: {
167
175
  yourDelegate: string;
168
176
  you: string;
169
- voted: string;
170
- };
171
- voteProposalDataListItemStructure: {
172
- voted: string;
173
177
  };
174
178
  wallet: {
175
179
  connect: string;
@@ -10,16 +10,7 @@ export declare enum ProposalStatus {
10
10
  PENDING = "PENDING",
11
11
  EXECUTABLE = "EXECUTABLE",
12
12
  REJECTED = "REJECTED",
13
- VETOED = "VETOED"
13
+ VETOED = "VETOED",
14
+ UNREACHED = "UNREACHED"
14
15
  }
15
- export declare enum ProposalVotingStatus {
16
- ACTIVE = "ACTIVE",
17
- ACCEPTED = "ACCEPTED",
18
- PENDING = "PENDING",
19
- EXPIRED = "EXPIRED",
20
- REJECTED = "REJECTED",
21
- UNREACHED = "UNREACHED",
22
- VETOED = "VETOED"
23
- }
24
- export declare const proposalStatusToVotingStatus: Record<ProposalStatus, ProposalVotingStatus>;
25
16
  export declare const proposalStatusToTagVariant: Record<ProposalStatus, TagVariant>;
@@ -3,10 +3,11 @@ export declare const ProposalVoting: {
3
3
  BreakdownToken: import("react").FC<import("./proposalVotingBreakdownToken").IProposalVotingBreakdownTokenProps>;
4
4
  Container: import("react").FC<import("./proposalVotingContainer").IProposalVotingContainerProps>;
5
5
  Details: import("react").FC<import("./proposalVotingDetails").IProposalVotingDetailsProps>;
6
+ StageContainer: import("react").FC<import("./proposalVotingStageContainer").IProposalVotingStageContainerProps>;
6
7
  Stage: import("react").FC<import("./proposalVotingStage").IProposalVotingStageProps>;
7
8
  Votes: import("react").FC<import("./proposalVotingVotes").IProposalVotingVotesProps>;
8
9
  BodySummary: import("react").FC<import("react").PropsWithChildren<import("./proposalVotingBodySummary").IProposalVotingBodySummaryProps>>;
9
- BodySummaryList: import("react").FC<import("react").PropsWithChildren<import("./proposalVotingBodySummaryList").IProposalVotingBodySummaryListProps>>;
10
+ BodySummaryList: import("react").FC<import("./proposalVotingBodySummaryList").IProposalVotingBodySummaryListProps>;
10
11
  BodySummaryListItem: import("react").FC<import("./proposalVotingBodySummaryListItem").IProposalVotingBodySummaryListItemProps>;
11
12
  BodyContent: import("react").FC<import("./proposalVotingBodyContent").IProposalVotingBodyContentProps>;
12
13
  Progress: {
@@ -25,4 +26,5 @@ export * from './proposalVotingDefinitions';
25
26
  export * from './proposalVotingDetails';
26
27
  export * from './proposalVotingProgress';
27
28
  export * from './proposalVotingStage';
29
+ export * from './proposalVotingStageContainer';
28
30
  export * from './proposalVotingVotes';
@@ -1,22 +1,22 @@
1
1
  import { type ComponentProps } from 'react';
2
- import { ProposalVotingStatus } from '../../proposalUtils';
2
+ import { ProposalStatus } from '../../proposalUtils';
3
3
  import { type IProposalVotingBodyBrand } from '../proposalVotingDefinitions';
4
4
  import { type IProposalVotingTabsProps } from '../proposalVotingTabs';
5
5
  export interface IProposalVotingBodyContentProps extends Pick<IProposalVotingTabsProps, 'hideTabs'>, ComponentProps<'div'> {
6
6
  /**
7
- * Status of the stage.
7
+ * Status of the proposal.
8
8
  */
9
- status: ProposalVotingStatus;
9
+ status: ProposalStatus;
10
10
  /**
11
- * Name of the body, only relevant for multi-body stages.
11
+ * Name of the body.
12
12
  */
13
- name?: string;
13
+ name: string;
14
14
  /**
15
- * ID of the body used to determine if the content should be rendered or not, only relevant for multi-body stages.
15
+ * ID of the body used to determine if the content should be rendered or not, only relevant for multi-body proposals.
16
16
  */
17
17
  bodyId?: string;
18
18
  /**
19
- * Branded identity assets for an external body.
19
+ * Brand definitions of the body.
20
20
  */
21
21
  bodyBrand?: IProposalVotingBodyBrand;
22
22
  }
@@ -1,4 +1,4 @@
1
- import type { ComponentProps, PropsWithChildren } from 'react';
1
+ import type { ComponentProps } from 'react';
2
2
  export interface IProposalVotingBodySummaryListProps extends ComponentProps<'div'> {
3
3
  }
4
- export declare const ProposalVotingBodySummaryList: React.FC<PropsWithChildren<IProposalVotingBodySummaryListProps>>;
4
+ export declare const ProposalVotingBodySummaryList: React.FC<IProposalVotingBodySummaryListProps>;
@@ -7,12 +7,12 @@ export type IProposalVotingBodySummaryListItemProps = IDataListItemProps & {
7
7
  */
8
8
  id: string;
9
9
  /**
10
- * Branded identity assets for an external body.
10
+ * Brand definitions of the body.
11
11
  */
12
12
  bodyBrand?: IProposalVotingBodyBrand;
13
13
  /**
14
- * Children to render.
14
+ * Children of the component.
15
15
  */
16
- children: ReactNode;
16
+ children?: ReactNode;
17
17
  };
18
18
  export declare const ProposalVotingBodySummaryListItem: React.FC<IProposalVotingBodySummaryListItemProps>;
@@ -5,8 +5,17 @@ export interface IProposalVotingBreakdownMultisigProps extends Omit<ITabsContent
5
5
  */
6
6
  approvalsAmount: number;
7
7
  /**
8
- * Minimum numbers of approvals required for a proposal to pass.
8
+ * Minimum numbers of approvals required for the proposal to pass.
9
9
  */
10
10
  minApprovals: number;
11
+ /**
12
+ * Number of members when the proposal was created.
13
+ */
14
+ membersCount: number;
15
+ /**
16
+ * Defines if the voting is for vetoing the proposal or not.
17
+ * @default false
18
+ */
19
+ isVeto?: boolean;
11
20
  }
12
21
  export declare const ProposalVotingBreakdownMultisig: React.FC<IProposalVotingBreakdownMultisigProps>;
@@ -28,5 +28,10 @@ export interface IProposalVotingBreakdownTokenProps extends Omit<ITabsContentPro
28
28
  * Total supply of the governance token.
29
29
  */
30
30
  tokenTotalSupply: number | string;
31
+ /**
32
+ * Defines if the voting is for vetoing the proposal or not.
33
+ * @default false
34
+ */
35
+ isVeto?: boolean;
31
36
  }
32
37
  export declare const ProposalVotingBreakdownToken: React.FC<IProposalVotingBreakdownTokenProps>;
@@ -1,12 +1,14 @@
1
1
  import { type ComponentProps } from 'react';
2
- export interface IProposalVotingContainerProps extends Omit<ComponentProps<'div'>, 'defaultValue'> {
2
+ import type { ProposalStatus } from '../../proposalUtils';
3
+ import { type IProposalVotingContextProviderProps } from '../proposalVotingContext';
4
+ export interface IProposalVotingContainerProps extends Pick<IProposalVotingContextProviderProps, 'bodyList'>, ComponentProps<'div'> {
3
5
  /**
4
- * Active stage that will be expanded for multi-stage proposals.
6
+ * Status of the proposal.
5
7
  */
6
- activeStage?: string;
8
+ status: ProposalStatus;
7
9
  /**
8
- * Callback called when the user selects a stage, to be used for expanding the current active stage for multi-stage proposals.
10
+ * End date of the proposal in timestamp or ISO format.
9
11
  */
10
- onStageClick?: (stage?: string) => void;
12
+ endDate?: number | string;
11
13
  }
12
14
  export declare const ProposalVotingContainer: React.FC<IProposalVotingContainerProps>;
@@ -0,0 +1,2 @@
1
+ export { ProposalVotingContextProvider, useProposalVotingContext } from './proposalVotingContext';
2
+ export type { IProposalVotingContext, IProposalVotingContextProviderProps } from './proposalVotingContext.api';
@@ -0,0 +1,21 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface IProposalVotingContext {
3
+ /**
4
+ * List of plugin addresses to be displayed in the body summary list.
5
+ */
6
+ bodyList?: string[];
7
+ /**
8
+ * The active body to be displayed.
9
+ */
10
+ activeBody?: string;
11
+ /**
12
+ * Callback triggered to update the current active body.
13
+ */
14
+ setActiveBody?: (id?: string) => void;
15
+ }
16
+ export interface IProposalVotingContextProviderProps extends Pick<IProposalVotingContext, 'bodyList'> {
17
+ /**
18
+ * Children of the component.
19
+ */
20
+ children?: ReactNode;
21
+ }
@@ -0,0 +1,3 @@
1
+ import type { IProposalVotingContext, IProposalVotingContextProviderProps } from './proposalVotingContext.api';
2
+ export declare const ProposalVotingContextProvider: React.FC<IProposalVotingContextProviderProps>;
3
+ export declare const useProposalVotingContext: () => IProposalVotingContext;
@@ -9,11 +9,20 @@ export interface IProposalVotingProgressItemDescription {
9
9
  */
10
10
  text: string;
11
11
  }
12
- export interface IProposalVotingProgressItemProps extends IProgressProps {
12
+ export interface IProposalVotingProgressItemProps extends Omit<IProgressProps, 'variant' | 'size'> {
13
13
  /**
14
14
  * Name of the voting progress.
15
15
  */
16
16
  name: string;
17
+ /**
18
+ * Additional description of the name of the voting progress, displayed after the name.
19
+ */
20
+ nameDescription?: string;
21
+ /**
22
+ * Variant of the voting progress item component.
23
+ * @default 'default'
24
+ */
25
+ variant?: 'default' | 'critical' | 'success';
17
26
  /**
18
27
  * Description of the voting progress displayed below the progress bar.
19
28
  */
@@ -23,9 +32,9 @@ export interface IProposalVotingProgressItemProps extends IProgressProps {
23
32
  */
24
33
  showPercentage?: boolean;
25
34
  /**
26
- * Displays a status icon based on the progress bar and indicator values when set to true. The component renders a
27
- * "success" status icon when value is equal or greater than indicator, and a "failed" status icon otherwise.
35
+ * Displays a status icon and text based on the progress bar and indicator values when set to true. The component
36
+ * renders a "success" status when value is equal or greater than indicator, and a "failed" status otherwise.
28
37
  */
29
- showStatusIcon?: boolean;
38
+ showStatus?: boolean;
30
39
  }
31
40
  export declare const ProposalVotingProgressItem: React.FC<IProposalVotingProgressItemProps>;
@@ -1,33 +1,34 @@
1
1
  import { type ComponentProps } from 'react';
2
- import type { ProposalVotingStatus } from '../../proposalUtils';
3
- export interface IProposalVotingStageProps extends ComponentProps<'div'> {
2
+ import type { ProposalStatus } from '../../proposalUtils';
3
+ import { type IProposalVotingContextProviderProps } from '../proposalVotingContext';
4
+ export interface IProposalVotingStageProps extends Pick<IProposalVotingContextProviderProps, 'bodyList'>, ComponentProps<'div'> {
4
5
  /**
5
6
  * Status of the stage.
6
7
  */
7
- status: ProposalVotingStatus;
8
+ status: ProposalStatus;
8
9
  /**
9
10
  * Start date of the stage in timestamp or ISO format.
10
11
  */
11
12
  startDate?: number | string;
12
13
  /**
13
- * Start date of the stage in timestamp or ISO format.
14
+ * End date of the stage in timestamp or ISO format.
14
15
  */
15
16
  endDate?: number | string;
16
17
  /**
17
- * Name of the proposal stage displayed for multi-stage proposals.
18
+ * Name of the proposal stage.
18
19
  */
19
- name?: string;
20
+ name: string;
20
21
  /**
21
- * Index of the stage set automatically by the ProposalVotingContainer for multi-stage proposals.
22
+ * Index of the stage set automatically by the ProposalVotingStageContainer component.
22
23
  */
23
24
  index?: number;
24
25
  /**
25
- * Defines if the proposal has multiple stages or not.
26
+ * Min advance date of the proposal in timestamp or ISO format.
26
27
  */
27
- isMultiStage?: boolean;
28
+ minAdvance?: string | number;
28
29
  /**
29
- * List of plugin addresses of bodies.
30
+ * Max advance date of the proposal in timestamp or ISO format.
30
31
  */
31
- bodyList?: string[];
32
+ maxAdvance?: string | number;
32
33
  }
33
34
  export declare const ProposalVotingStage: React.FC<IProposalVotingStageProps>;
@@ -0,0 +1 @@
1
+ export { ProposalVotingStageContainer, type IProposalVotingStageContainerProps } from './proposalVotingStageContainer';
@@ -0,0 +1,12 @@
1
+ import { type ComponentProps } from 'react';
2
+ export interface IProposalVotingStageContainerProps extends Omit<ComponentProps<'div'>, 'defaultValue'> {
3
+ /**
4
+ * Active stage that will be expanded for multi-stage proposals.
5
+ */
6
+ activeStage?: string;
7
+ /**
8
+ * Callback called when the user selects a stage, to be used for expanding the current active stage for multi-stage proposals.
9
+ */
10
+ onStageClick?: (stage?: string) => void;
11
+ }
12
+ export declare const ProposalVotingStageContainer: React.FC<IProposalVotingStageContainerProps>;
@@ -0,0 +1 @@
1
+ export { ProposalVotingStatus, type IProposalVotingStatusProps } from './proposalVotingStatus';
@@ -0,0 +1,26 @@
1
+ import type { ComponentProps } from 'react';
2
+ import { ProposalStatus } from '../../proposalUtils';
3
+ export interface IProposalVotingStatusProps extends ComponentProps<'div'> {
4
+ /**
5
+ * Status of the proposal.
6
+ * @default ProposalStatus.PENDING
7
+ */
8
+ status?: ProposalStatus;
9
+ /**
10
+ * End date of the proposal in timestamp or ISO format.
11
+ */
12
+ endDate?: string | number;
13
+ /**
14
+ * Defines if the proposal is a multi-stage proposal.
15
+ */
16
+ isMultiStage?: boolean;
17
+ /**
18
+ * Min advance date of the proposal in timestamp or ISO format.
19
+ */
20
+ minAdvance?: string | number;
21
+ /**
22
+ * Max advance date of the proposal in timestamp or ISO format.
23
+ */
24
+ maxAdvance?: string | number;
25
+ }
26
+ export declare const ProposalVotingStatus: React.FC<IProposalVotingStatusProps>;
@@ -0,0 +1,12 @@
1
+ import { type ComponentProps } from 'react';
2
+ export interface IProposalVotingStatusAdvanceableProps extends ComponentProps<'div'> {
3
+ /**
4
+ * Min advance date of the proposal in timestamp or ISO format.
5
+ */
6
+ minAdvance?: string | number;
7
+ /**
8
+ * Max advance date of the proposal in timestamp or ISO format.
9
+ */
10
+ maxAdvance?: string | number;
11
+ }
12
+ export declare const ProposalVotingStatusAdvanceable: React.FC<IProposalVotingStatusAdvanceableProps>;
@@ -1,11 +1,11 @@
1
1
  import { type ITabsRootProps } from '../../../../../core';
2
- import { ProposalVotingStatus } from '../../proposalUtils';
2
+ import { ProposalStatus } from '../../proposalUtils';
3
3
  import { ProposalVotingTab } from '../proposalVotingDefinitions';
4
4
  export interface IProposalVotingTabsProps extends ITabsRootProps {
5
5
  /**
6
6
  * Voting status of the proposal.
7
7
  */
8
- status: ProposalVotingStatus;
8
+ status: ProposalStatus;
9
9
  /**
10
10
  * Hides the triggers for the specified tab IDs when set.
11
11
  */
@@ -14,6 +14,10 @@ export type IVoteDataListItemStructureProps = IDataListItemProps & {
14
14
  * The vote of the user.
15
15
  */
16
16
  voteIndicator: VoteIndicator;
17
+ /**
18
+ * Additional description for the vote indicator, displayed after the tag.
19
+ */
20
+ voteIndicatorDescription?: string;
17
21
  /**
18
22
  * If token-based voting, the amount of token voting power used.
19
23
  */
@@ -23,8 +27,9 @@ export type IVoteDataListItemStructureProps = IDataListItemProps & {
23
27
  */
24
28
  tokenSymbol?: string;
25
29
  /**
26
- * Custom label for the tag.
30
+ * Defines if the voting is for vetoing the proposal or not.
31
+ * @default false
27
32
  */
28
- confirmationLabel?: string;
33
+ isVeto?: boolean;
29
34
  };
30
35
  export declare const VoteDataListItemStructure: React.FC<IVoteDataListItemStructureProps>;