Skip to content

Commit 85295a5

Browse files
committed
feat(ui-heading,shared-types): add ai color
INSTUI-4550
1 parent 52545d1 commit 85295a5

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

packages/shared-types/src/ComponentThemeVariables.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -656,14 +656,16 @@ export type HeadingTheme = Typography & {
656656
h5FontSize: Typography['fontSizeSmall']
657657
h5FontWeight: Typography['fontWeightNormal']
658658
h5FontFamily: Typography['fontFamily']
659-
primaryInverseColor: Colors['contrasts']['white1010']
660-
primaryColor: Colors['contrasts']['grey125125']
661-
secondaryColor: Colors['contrasts']['grey4570']
662-
secondaryInverseColor: Colors['contrasts']['grey1111']
659+
primaryInverseColor: string
660+
primaryColor: string
661+
secondaryColor: string
662+
secondaryInverseColor: string
663663
borderPadding: Spacing['xxxSmall']
664-
borderColor: Colors['contrasts']['grey1424']
664+
borderColor: string
665665
borderWidth: Border['widthSmall']
666666
borderStyle: Border['style']
667+
aiTextTopGradientColor: string
668+
aiTextBottomGradientColor: string
667669
}
668670

669671
export type ImgTheme = {

packages/ui-heading/src/Heading/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ type: example
6565
<Heading>I inherit my color via the CSS cascade (default)</Heading>
6666
<Heading color="primary">I am primary color</Heading>
6767
<Heading color="secondary">I am secondary color</Heading>
68+
<Heading color="ai">I am AI color</Heading>
6869
</div>
6970
```
7071

packages/ui-heading/src/Heading/props.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ type HeadingOwnProps = {
5858
| 'primary-inverse'
5959
| 'secondary-inverse'
6060
| 'inherit'
61+
| 'ai'
6162
/**
6263
* The *visual* appearance of the Heading: h1 is largest; h5 is smallest.
6364
*/
@@ -112,7 +113,8 @@ const propTypes: PropValidators<PropKeys> = {
112113
'secondary',
113114
'primary-inverse',
114115
'secondary-inverse',
115-
'inherit'
116+
'inherit',
117+
'ai'
116118
]),
117119
level: PropTypes.oneOf(['h1', 'h2', 'h3', 'h4', 'h5', 'reset']),
118120
as: PropTypes.elementType,

packages/ui-heading/src/Heading/styles.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,13 @@ const generateStyle = (
143143
primary: { color: componentTheme.primaryColor },
144144
secondary: { color: componentTheme.secondaryColor },
145145
'primary-inverse': { color: componentTheme.primaryInverseColor },
146-
'secondary-inverse': { color: componentTheme.secondaryInverseColor }
146+
'secondary-inverse': { color: componentTheme.secondaryInverseColor },
147+
ai: {
148+
background: `
149+
linear-gradient(to bottom, ${componentTheme.aiTextTopGradientColor} 0%, ${componentTheme.aiTextBottomGradientColor} 100%) text`,
150+
border: 'solid transparent',
151+
'-webkit-text-fill-color': 'transparent'
152+
}
147153
}
148154

149155
const borderStyles = {

packages/ui-heading/src/Heading/theme.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ const generateComponentTheme = (theme: Theme): HeadingTheme => {
8383
borderPadding: spacing?.xxxSmall,
8484
borderColor: colors?.contrasts?.grey1424,
8585
borderWidth: borders?.widthSmall,
86-
borderStyle: borders?.style
86+
borderStyle: borders?.style,
87+
88+
aiTextTopGradientColor: colors.contrasts.violet4570,
89+
aiTextBottomGradientColor: colors.contrasts.sea4570
8790
}
8891

8992
return {

0 commit comments

Comments
 (0)