1
1
import {
2
2
ComponentSlotStyle ,
3
- ComponentSlotStylesPrepared ,
3
+ ComponentSlotStylesResolved ,
4
4
ComponentVariablesInput ,
5
5
DebugData ,
6
6
emptyTheme ,
@@ -10,6 +10,7 @@ import * as React from 'react'
10
10
import { ThemeContext } from 'react-fela'
11
11
12
12
import {
13
+ ComponentAnimationProp ,
13
14
ComponentDesignProp ,
14
15
ComponentSlotClasses ,
15
16
RendererRenderRule ,
@@ -23,14 +24,19 @@ type UseStylesOptions<StyleProps extends PrimitiveProps> = {
23
24
mapPropsToStyles ?: ( ) => StyleProps
24
25
mapPropsToInlineStyles ?: ( ) => InlineStyleProps < StyleProps >
25
26
rtl ?: boolean
27
+
28
+ __experimental_composeName ?: string
29
+ __experimental_overrideStyles ?: boolean
26
30
}
27
31
28
32
type UseStylesResult = {
29
33
classes : ComponentSlotClasses
30
- styles : ComponentSlotStylesPrepared
34
+ styles : ComponentSlotStylesResolved
31
35
}
32
36
33
37
type InlineStyleProps < StyleProps > = {
38
+ unstable_animation ?: ComponentAnimationProp
39
+
34
40
/** Additional CSS class name(s) to apply. */
35
41
className ?: string
36
42
@@ -62,17 +68,22 @@ const useStyles = <StyleProps extends PrimitiveProps>(
62
68
mapPropsToStyles = ( ) => ( { } as StyleProps ) ,
63
69
mapPropsToInlineStyles = ( ) => ( { } as InlineStyleProps < StyleProps > ) ,
64
70
rtl = false ,
71
+ __experimental_composeName,
72
+ __experimental_overrideStyles,
65
73
} = options
66
74
67
75
// Stores debug information for component.
68
76
const debug = React . useRef < { fluentUIDebug : DebugData | null } > ( { fluentUIDebug : null } )
77
+ const inlineProps = mapPropsToInlineStyles ( )
78
+
69
79
const { classes, styles : resolvedStyles } = getStyles ( {
70
80
// Input values
71
81
className,
72
82
displayName,
73
83
props : {
74
84
...mapPropsToStyles ( ) ,
75
- ...mapPropsToInlineStyles ( ) ,
85
+ ...inlineProps ,
86
+ animation : inlineProps . unstable_animation ,
76
87
} ,
77
88
78
89
// Context values
@@ -82,6 +93,10 @@ const useStyles = <StyleProps extends PrimitiveProps>(
82
93
saveDebug : fluentUIDebug => ( debug . current = { fluentUIDebug } ) ,
83
94
theme : context . theme ,
84
95
_internal_resolvedComponentVariables : context . _internal_resolvedComponentVariables ,
96
+
97
+ __experimental_cache : true ,
98
+ __experimental_composeName,
99
+ __experimental_overrideStyles,
85
100
} )
86
101
87
102
return { classes, styles : resolvedStyles }
0 commit comments