@@ -104,32 +104,44 @@ type HeroDescriptionProps = {
104
104
weight ?: TextWeightVariants | ResponsiveWeightMap
105
105
} & BaseProps < HTMLParagraphElement >
106
106
107
- function HeroDescription ( { size = '200' , weight, children} : PropsWithChildren < HeroDescriptionProps > ) {
108
- return (
109
- < Text className = { styles [ 'Hero-description' ] } as = "p" size = { size } weight = { weight } >
110
- { children }
111
- </ Text >
112
- )
113
- }
107
+ const HeroDescription = forwardRef < HTMLParagraphElement , PropsWithChildren < HeroDescriptionProps > > (
108
+ ( { size = '200' , weight, children} : PropsWithChildren < HeroDescriptionProps > , ref ) => {
109
+ return (
110
+ < Text ref = { ref } className = { styles [ 'Hero-description' ] } as = "p" size = { size } weight = { weight } >
111
+ { children }
112
+ </ Text >
113
+ )
114
+ } ,
115
+ )
114
116
115
117
type HeroImageProps = {
116
118
position ?: 'inline-end' | 'block-end'
117
119
} & ImageProps &
118
120
BaseProps < HTMLImageElement >
119
121
120
- function HeroImage ( { position = 'block-end' , className, ...rest } : PropsWithChildren < HeroImageProps > ) {
121
- return < Image className = { clsx ( styles [ 'Hero-image' ] , styles [ `Hero-image--pos-${ position } ` ] , className ) } { ...rest } />
122
- }
122
+ const HeroImage = forwardRef < HTMLImageElement , HeroImageProps > (
123
+ ( { position = 'block-end' , className, ...rest } : PropsWithChildren < HeroImageProps > , ref ) => {
124
+ return (
125
+ < Image
126
+ ref = { ref }
127
+ className = { clsx ( styles [ 'Hero-image' ] , styles [ `Hero-image--pos-${ position } ` ] , className ) }
128
+ { ...rest }
129
+ />
130
+ )
131
+ } ,
132
+ )
123
133
124
134
type HeroLabelProps = LabelProps & BaseProps < HTMLSpanElement >
125
135
126
- function HeroLabel ( { children, ...rest } : PropsWithChildren < HeroLabelProps > ) {
127
- return (
128
- < Label className = { styles [ 'Hero-label' ] } { ...rest } >
129
- { children }
130
- </ Label >
131
- )
132
- }
136
+ const HeroLabel = forwardRef < HTMLSpanElement , HeroLabelProps > (
137
+ ( { children, ...rest } : PropsWithChildren < HeroLabelProps > , ref ) => {
138
+ return (
139
+ < Label ref = { ref } className = { styles [ 'Hero-label' ] } { ...rest } >
140
+ { children }
141
+ </ Label >
142
+ )
143
+ } ,
144
+ )
133
145
134
146
type RestrictedPolymorphism =
135
147
| ( BaseProps < HTMLAnchorElement > & { as ?: 'a' } )
0 commit comments