Skip to content

Commit b6c7e0b

Browse files
committed
feat(ui-heading,shared-types): add new aiHeading prop and design. Also add h6 level to heading
INSTUI-4616
1 parent fa78679 commit b6c7e0b

File tree

4 files changed

+55
-22
lines changed

4 files changed

+55
-22
lines changed

packages/ui-heading/src/Heading/index.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,34 @@ class Heading extends Component<HeadingProps> {
145145
</span>
146146
)
147147
}
148+
if (aiVariant === 'stacked') {
149+
return (
150+
<>
151+
<span css={this.props.styles?.igniteAIStacked}>
152+
<IconAiColoredSolid />
153+
<span css={this.props.styles?.igniteAI}>IgniteAI</span>
154+
</span>
155+
{children}
156+
</>
157+
)
158+
}
159+
if (aiVariant === 'horizontal') {
160+
return (
161+
<>
162+
<IconAiColoredSolid />
163+
<span css={this.props.styles?.igniteAI}>IgniteAI</span>
164+
{children}
165+
</>
166+
)
167+
}
168+
if (aiVariant === 'iconOnly') {
169+
return (
170+
<>
171+
<IconAiColoredSolid />
172+
&nbsp;{children}
173+
</>
174+
)
175+
}
148176
return children
149177
}
150178

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ type HeadingOwnProps = {
5858
* The font color to render, NOTE: `ai` color is deprecated. Use the `aiVariant` prop instead
5959
*/
6060
color?:
61-
| 'primary'
62-
| 'secondary'
63-
| 'primary-inverse'
64-
| 'secondary-inverse'
65-
| 'inherit'
66-
| 'ai'
61+
| 'primary'
62+
| 'secondary'
63+
| 'primary-inverse'
64+
| 'secondary-inverse'
65+
| 'inherit'
66+
| 'ai'
6767
/**
6868
* The *visual* appearance of the Heading: h1 is largest; h5 is smallest.
6969
*/
@@ -91,16 +91,16 @@ type HeadingOwnProps = {
9191
* Sets appearance of the heading.
9292
*/
9393
variant?:
94-
| 'titlePageDesktop'
95-
| 'titlePageMobile'
96-
| 'titleSection'
97-
| 'titleCardSection'
98-
| 'titleModule'
99-
| 'titleCardLarge'
100-
| 'titleCardRegular'
101-
| 'titleCardMini'
102-
| 'label'
103-
| 'labelInline'
94+
| 'titlePageDesktop'
95+
| 'titlePageMobile'
96+
| 'titleSection'
97+
| 'titleCardSection'
98+
| 'titleModule'
99+
| 'titleCardLarge'
100+
| 'titleCardRegular'
101+
| 'titleCardMini'
102+
| 'label'
103+
| 'labelInline'
104104
}
105105

106106
type PropKeys = keyof HeadingOwnProps

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const generateStyle = (
3939
componentTheme: HeadingTheme,
4040
props: HeadingProps
4141
): HeadingStyle => {
42-
const { level, color, border, variant, aiVariant } = props
42+
const { level, color, border, variant, renderIcon, aiVariant } = props
4343

4444
const variants: Record<NonNullable<HeadingProps['variant']>, object> = {
4545
titlePageDesktop: {
@@ -223,10 +223,10 @@ const generateStyle = (
223223
alignItems: 'center',
224224
...(aiVariant === 'stacked'
225225
? {
226-
display: 'flex',
227-
flexDirection: 'column',
228-
alignItems: 'flex-start'
229-
}
226+
display: 'flex',
227+
flexDirection: 'column',
228+
alignItems: 'flex-start'
229+
}
230230
: {})
231231
}
232232
}

packages/ui-heading/tsconfig.build.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"composite": true,
66
"rootDir": "./src"
77
},
8-
"include": ["src"],
8+
"include": [
9+
"src"
10+
],
911
"references": [
1012
{
1113
"path": "../console/tsconfig.build.json"
@@ -37,6 +39,9 @@
3739
{
3840
"path": "../ui-babel-preset/tsconfig.build.json"
3941
},
42+
{
43+
"path": "../ui-test-utils/tsconfig.build.json"
44+
},
4045
{
4146
"path": "../ui-themes/tsconfig.build.json"
4247
}

0 commit comments

Comments
 (0)