@@ -38,17 +38,17 @@ const arrowOptions = {
38
38
*/
39
39
const CStat = {
40
40
name : 'CStat' ,
41
- extends : CBox ,
42
- render ( h ) {
43
- const children = cleanChildren ( this . $ slots. default )
41
+ functional : true ,
42
+ render ( h , { props , slots , data , ... rest } ) {
43
+ const children = cleanChildren ( slots ( ) . default )
44
44
return h ( CBox , {
45
- props : {
45
+ ...rest ,
46
+ props : { as : props . as } ,
47
+ attrs : {
46
48
flex : 1 ,
47
49
pr : 4 ,
48
50
position : 'relative' ,
49
- ...forwardProps ( this . $props )
50
- } ,
51
- attrs : {
51
+ ...( data . attrs || { } ) ,
52
52
'data-chakra-component' : 'CStat'
53
53
}
54
54
} , children )
@@ -65,17 +65,20 @@ const CStat = {
65
65
*/
66
66
const CStatGroup = {
67
67
name : 'CStatGroup' ,
68
- extends : CFlex ,
69
- render ( h ) {
70
- const children = cleanChildren ( this . $slots . default )
68
+ functional : true ,
69
+ props : CFlex . props ,
70
+ render ( h , { props, slots, data, ...rest } ) {
71
+ const children = cleanChildren ( slots ( ) . default )
71
72
return h ( CFlex , {
73
+ ...rest ,
72
74
props : {
73
75
flexWrap : 'wrap' ,
74
76
justifyContent : 'space-around' ,
75
77
alignItems : 'flex-start' ,
76
- ...forwardProps ( this . $ props)
78
+ ...forwardProps ( props )
77
79
} ,
78
80
attrs : {
81
+ ...( data . attrs || { } ) ,
79
82
'data-chakra-component' : 'CStatGroup'
80
83
}
81
84
} , children )
@@ -92,23 +95,27 @@ const CStatGroup = {
92
95
*/
93
96
const CStatArrow = {
94
97
name : 'CStatArrow' ,
95
- extends : CIcon ,
98
+ functional : true ,
96
99
props : {
100
+ ...CIcon . props ,
97
101
type : {
98
102
type : String ,
99
103
default : 'increase'
100
104
}
101
105
} ,
102
- render ( h ) {
106
+ render ( h , { props , slots , data , ... rest } ) {
103
107
return h ( CIcon , {
108
+ ...rest ,
104
109
props : {
105
- mr : 1 ,
106
110
size : '14px' ,
107
- verticalAlign : 'middle' ,
108
- ...arrowOptions [ this . type ] ,
109
- ...forwardProps ( this . $props )
111
+ ...arrowOptions [ props . type ] ,
112
+ ...forwardProps ( props )
110
113
} ,
111
114
attrs : {
115
+ mr : 1 ,
116
+ verticalAlign : 'middle' ,
117
+ ...( data . attrs || { } ) ,
118
+ color : arrowOptions [ props . type ] . color ,
112
119
'data-chakra-component' : 'CStatArrow'
113
120
}
114
121
} )
@@ -125,19 +132,20 @@ const CStatArrow = {
125
132
*/
126
133
const CStatNumber = {
127
134
name : 'CStatNumber' ,
128
- extends : CText ,
129
- render ( h ) {
135
+ functional : true ,
136
+ props : CText . props ,
137
+ render ( h , { props, slots, data, ...rest } ) {
130
138
return h ( CText , {
131
- props : {
139
+ ...rest ,
140
+ props : forwardProps ( props ) ,
141
+ attrs : {
132
142
fontSize : '2xl' ,
133
143
verticalAlign : 'baseline' ,
134
144
fontWeight : 'semibold' ,
135
- ...forwardProps ( this . $props )
136
- } ,
137
- attrs : {
145
+ ...( data . attrs || { } ) ,
138
146
'data-chakra-component' : 'CStatNumber'
139
147
}
140
- } , this . $ slots. default )
148
+ } , slots ( ) . default )
141
149
}
142
150
}
143
151
@@ -151,16 +159,20 @@ const CStatNumber = {
151
159
*/
152
160
const CStatHelperText = {
153
161
name : 'CStatHelperText' ,
154
- extends : CText ,
155
- render ( h ) {
162
+ functional : true ,
163
+ props : CText . props ,
164
+ render ( h , { props, slots, data, ...rest } ) {
156
165
return h ( CText , {
157
- props : {
166
+ ...rest ,
167
+ props : forwardProps ( props ) ,
168
+ attrs : {
158
169
fontSize : 'sm' ,
159
170
opacity : 0.8 ,
160
171
mb : 2 ,
161
- ...forwardProps ( this . $props )
172
+ ...( data . attrs || { } ) ,
173
+ 'data-chakra-component' : 'CStatHelperText'
162
174
}
163
- } , this . $ slots. default )
175
+ } , slots ( ) . default )
164
176
}
165
177
}
166
178
@@ -174,18 +186,19 @@ const CStatHelperText = {
174
186
*/
175
187
const CStatLabel = {
176
188
name : 'CStatLabel' ,
177
- extends : CText ,
178
- render ( h ) {
189
+ functional : true ,
190
+ props : CText . props ,
191
+ render ( h , { props, slots, data, ...rest } ) {
179
192
return h ( CText , {
180
- props : {
193
+ ...rest ,
194
+ props : forwardProps ( props ) ,
195
+ attrs : {
181
196
fontWeight : 'medium' ,
182
197
fontSize : 'sm' ,
183
- ...forwardProps ( this . $props )
184
- } ,
185
- attrs : {
198
+ ...( data . attrs || { } ) ,
186
199
'data-chakra-component' : 'CStatLabel'
187
200
}
188
- } , this . $ slots. default )
201
+ } , slots ( ) . default )
189
202
}
190
203
}
191
204
0 commit comments