@gearbox-protocol/ui-kit 4.6.1 → 4.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.
- package/dist/cjs/components/base/index.cjs +1 -1
- package/dist/cjs/components/base/review-button/constants.cjs +1 -1
- package/dist/cjs/components/base/review-button/index.cjs +1 -1
- package/dist/cjs/components/base/review-button/review-button.cjs +1 -1
- package/dist/cjs/components/base/review-button/review-solution.cjs +1 -0
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/components/base/index.js +94 -92
- package/dist/esm/components/base/review-button/constants.js +2 -1
- package/dist/esm/components/base/review-button/index.js +6 -4
- package/dist/esm/components/base/review-button/review-button.js +31 -35
- package/dist/esm/components/base/review-button/review-solution.js +56 -0
- package/dist/esm/components/index.js +366 -364
- package/dist/esm/index.js +443 -441
- package/dist/types/components/base/review-button/constants.d.ts +1 -0
- package/dist/types/components/base/review-button/index.d.ts +1 -0
- package/dist/types/components/base/review-button/review-button.d.ts +1 -4
- package/dist/types/components/base/review-button/review-solution.d.ts +35 -0
- package/package.json +1 -1
|
@@ -2,11 +2,8 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { FormattedMessageTypedProps } from '../../typed-intl';
|
|
3
3
|
import { LocaleKeys } from '../../../locale';
|
|
4
4
|
import { ReviewButtonTest } from './constants';
|
|
5
|
+
import { ReviewButtonSolution } from './review-solution';
|
|
5
6
|
export { ReviewButtonTest };
|
|
6
|
-
export interface ReviewButtonSolution {
|
|
7
|
-
readonly label: FormattedMessageTypedProps;
|
|
8
|
-
readonly onClick: () => void;
|
|
9
|
-
}
|
|
10
7
|
export interface ReviewButtonProps {
|
|
11
8
|
readonly disabled: boolean;
|
|
12
9
|
/** What blocks the action; takes the button's own label while it is set. */
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FormattedMessageTypedProps } from '../../typed-intl';
|
|
3
|
+
export interface ReviewSolutionButton {
|
|
4
|
+
/** Changes the current form instead of navigating. */
|
|
5
|
+
readonly kind: "button";
|
|
6
|
+
/** Text of the correction button. */
|
|
7
|
+
readonly label: FormattedMessageTypedProps;
|
|
8
|
+
/** Applies the correction supplied by the caller. */
|
|
9
|
+
readonly onClick: () => void;
|
|
10
|
+
}
|
|
11
|
+
export interface ReviewSolutionLink {
|
|
12
|
+
/** Destination supplied by the application. */
|
|
13
|
+
readonly href: string;
|
|
14
|
+
/** Text of the recovery link. */
|
|
15
|
+
readonly label: FormattedMessageTypedProps;
|
|
16
|
+
/** Optional application-owned navigation handler. */
|
|
17
|
+
readonly onClick?: React.MouseEventHandler<HTMLAnchorElement>;
|
|
18
|
+
}
|
|
19
|
+
export interface ReviewSolutionLinks {
|
|
20
|
+
/** Navigates to one of the recovery operations. */
|
|
21
|
+
readonly kind: "link";
|
|
22
|
+
/** Recovery destinations supplied by the caller. */
|
|
23
|
+
readonly links: readonly ReviewSolutionLink[];
|
|
24
|
+
/** Optional sentence with {link0}, {link1}, … placeholders. */
|
|
25
|
+
readonly label?: FormattedMessageTypedProps;
|
|
26
|
+
}
|
|
27
|
+
export type ReviewButtonSolution = ReviewSolutionButton | ReviewSolutionLinks;
|
|
28
|
+
export interface ReviewSolutionProps {
|
|
29
|
+
/** A correction button or recovery links, also used by ReviewButton. */
|
|
30
|
+
readonly solution?: ReviewButtonSolution;
|
|
31
|
+
/** Optional identifier for the correction button. */
|
|
32
|
+
readonly testId?: string;
|
|
33
|
+
}
|
|
34
|
+
/** Render the same error solution in a review tip or a route selection card. */
|
|
35
|
+
export declare function ReviewSolution({ solution, testId, }: ReviewSolutionProps): React.ReactElement | null;
|