Skip to content

Commit fb9b1ae

Browse files
committed
gradient_types.ts → deleted
1 parent 1a991b6 commit fb9b1ae

3 files changed

Lines changed: 28 additions & 54 deletions

File tree

src/platform/packages/shared/shared-ux/ai-components/ai_button/src/gradient_types.ts

Lines changed: 0 additions & 45 deletions
This file was deleted.

src/platform/packages/shared/shared-ux/ai-components/ai_button/src/svg_ai_gradient_defs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
import React from 'react';
11-
import type { AiGradientColors } from './gradient_types';
11+
import type { AiGradientColors } from './use_ai_gradient_styles';
1212

1313
/** Percentage offsets that inset the gradient stops to keep the color transition within the icon's visible area. */
1414
const ICON_GRADIENT_START_OFFSET = 16;

src/platform/packages/shared/shared-ux/ai-components/ai_button/src/use_ai_gradient_styles.ts

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,35 @@
88
*/
99

1010
import { css } from '@emotion/react';
11+
import type { SerializedStyles } from '@emotion/react';
1112
import { type UseEuiTheme, useEuiTheme, useGeneratedHtmlId } from '@elastic/eui';
1213
import { useMemo } from 'react';
1314
import type { AiButtonVariant } from './types';
14-
import type {
15-
AiButtonGradientOptions,
16-
AiButtonGradientStyles,
17-
AiGradientColors,
18-
ResolvedVariantStyles,
19-
SvgAiGradient,
20-
} from './gradient_types';
15+
16+
/** Options for the AI button gradient hooks. */
17+
export interface AiButtonGradientOptions {
18+
readonly variant?: AiButtonVariant;
19+
readonly iconOnly?: boolean;
20+
}
21+
22+
/** Computed gradient styles for an AI button. */
23+
export interface AiButtonGradientStyles {
24+
readonly buttonCss: SerializedStyles;
25+
readonly labelCss: SerializedStyles;
26+
}
27+
28+
/** Start and end colors for a linear gradient. */
29+
export interface AiGradientColors {
30+
readonly startColor: string;
31+
readonly endColor: string;
32+
}
33+
34+
/** SVG gradient for the AI button icon. */
35+
export interface SvgAiGradient {
36+
readonly iconGradientCss?: SerializedStyles;
37+
readonly gradientId: string;
38+
readonly colors: AiGradientColors;
39+
}
2140

2241
const DIAGONAL_GRADIENT_START_PERCENT = 2.98;
2342
const DIAGONAL_GRADIENT_END_PERCENT = 66.24;
@@ -152,7 +171,7 @@ const resolveVariantStyles = (
152171
variant: AiButtonVariant,
153172
euiTheme: UseEuiTheme['euiTheme'],
154173
buttonGradientAngle: number
155-
): ResolvedVariantStyles => {
174+
) => {
156175
const {
157176
colors,
158177
components: {

0 commit comments

Comments
 (0)