|
8 | 8 | */ |
9 | 9 |
|
10 | 10 | import { css } from '@emotion/react'; |
| 11 | +import type { SerializedStyles } from '@emotion/react'; |
11 | 12 | import { type UseEuiTheme, useEuiTheme, useGeneratedHtmlId } from '@elastic/eui'; |
12 | 13 | import { useMemo } from 'react'; |
13 | 14 | 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 | +} |
21 | 40 |
|
22 | 41 | const DIAGONAL_GRADIENT_START_PERCENT = 2.98; |
23 | 42 | const DIAGONAL_GRADIENT_END_PERCENT = 66.24; |
@@ -152,7 +171,7 @@ const resolveVariantStyles = ( |
152 | 171 | variant: AiButtonVariant, |
153 | 172 | euiTheme: UseEuiTheme['euiTheme'], |
154 | 173 | buttonGradientAngle: number |
155 | | -): ResolvedVariantStyles => { |
| 174 | +) => { |
156 | 175 | const { |
157 | 176 | colors, |
158 | 177 | components: { |
|
0 commit comments