Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new text color variant "ai-highlight" to the UI Text component and updates related types and styles.
- Added new theme colors: aiColor and aiBackgroundColor.
- Updated style definitions and prop types to support the new "ai-highlight" variant.
- Adjusted documentation examples and shared type definitions for color properties.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ui-text/src/Text/theme.ts | Added aiColor and aiBackgroundColor to the theme |
| packages/ui-text/src/Text/styles.ts | Updated style definitions to include the ai-highlight variant |
| packages/ui-text/src/Text/props.ts | Extended supported color types with ai-highlight |
| packages/ui-text/src/Text/README.md | Updated documentation to showcase the new ai-highlight example |
| packages/shared-types/src/ComponentThemeVariables.ts | Changed color properties types from Colors references to string |
packages/ui-text/src/Text/theme.ts
Outdated
| successColor: colors?.contrasts?.green5782, | ||
| alertColor: colors?.contrasts?.blue5782, | ||
| warningColor: colors?.contrasts?.orange5782, | ||
| aiColor: colors.contrasts?.violet5790, |
There was a problem hiding this comment.
For consistency with the other color properties, consider using the safe navigation operator on 'colors' (i.e. colors?.contrasts?.violet5790) to prevent potential runtime errors if colors is null or undefined.
| aiColor: colors.contrasts?.violet5790, | |
| aiColor: colors?.contrasts?.violet5790, |
| successColor: Colors['contrasts']['green4570'] | ||
| alertColor: Colors['contrasts']['blue4570'] | ||
| warningColor: Colors['contrasts']['orange5782'] | ||
| primaryInverseColor: string |
There was a problem hiding this comment.
Changing the color properties from specific Colors references to a generic string type could reduce type safety. Consider maintaining the original color type definitions or adding validation to ensure consistency in the color values.
|
TEST_PLAN: compare with design documentation
INSTUI-4547