10
10
* governing permissions and limitations under the License.
11
11
*/
12
12
13
- import { baseColor , focusRing , fontRelative , style } from '../style' with { type : 'macro' } ;
13
+ import { baseColor , focusRing , fontRelative , linearGradient , style } from '../style' with { type : 'macro' } ;
14
14
import { ButtonRenderProps , ContextValue , Link , LinkProps , OverlayTriggerStateContext , Provider , Button as RACButton , ButtonProps as RACButtonProps } from 'react-aria-components' ;
15
15
import { centerBaseline } from './CenterBaseline' ;
16
16
import { centerPadding , getAllowedOverrides , staticColor , StyleProps } from './style-utils' with { type : 'macro' } ;
@@ -34,7 +34,7 @@ interface ButtonStyleProps {
34
34
*
35
35
* @default 'primary'
36
36
*/
37
- variant ?: 'primary' | 'secondary' | 'accent' | 'negative' ,
37
+ variant ?: 'primary' | 'secondary' | 'accent' | 'negative' | 'premium' | 'genai' ,
38
38
/**
39
39
* The background style of the Button.
40
40
*
@@ -102,6 +102,10 @@ const button = style<ButtonRenderProps & ButtonStyleProps & {isStaticColor: bool
102
102
fillStyle : {
103
103
fill : 0 ,
104
104
outline : 2
105
+ } ,
106
+ variant : {
107
+ premium : 0 ,
108
+ genai : 0
105
109
}
106
110
} ,
107
111
'--labelPadding' : {
@@ -134,18 +138,43 @@ const button = style<ButtonRenderProps & ButtonStyleProps & {isStaticColor: bool
134
138
isDisabled : 'GrayText'
135
139
}
136
140
} ,
141
+ backgroundImage : {
142
+ variant : {
143
+ premium : {
144
+ default : linearGradient ( '96deg' , [ 'fuchsia-900' , 0 ] , [ 'indigo-900' , 66 ] , [ 'blue-900' , 100 ] ) ,
145
+ isHovered : linearGradient ( '96deg' , [ 'fuchsia-1000' , 0 ] , [ 'indigo-1000' , 66 ] , [ 'blue-1000' , 100 ] ) ,
146
+ isPressed : linearGradient ( '96deg' , [ 'fuchsia-1000' , 0 ] , [ 'indigo-1000' , 66 ] , [ 'blue-1000' , 100 ] ) ,
147
+ isFocusVisible : linearGradient ( '96deg' , [ 'fuchsia-1000' , 0 ] , [ 'indigo-1000' , 66 ] , [ 'blue-1000' , 100 ] )
148
+ } ,
149
+ genai : {
150
+ default : linearGradient ( '96deg' , [ 'red-900' , 0 ] , [ 'magenta-900' , 33 ] , [ 'indigo-900' , 100 ] ) ,
151
+ isHovered : linearGradient ( '96deg' , [ 'red-1000' , 0 ] , [ 'magenta-1000' , 33 ] , [ 'indigo-1000' , 100 ] ) ,
152
+ isPressed : linearGradient ( '96deg' , [ 'red-1000' , 0 ] , [ 'magenta-1000' , 33 ] , [ 'indigo-1000' , 100 ] ) ,
153
+ isFocusVisible : linearGradient ( '96deg' , [ 'red-1000' , 0 ] , [ 'magenta-1000' , 33 ] , [ 'indigo-1000' , 100 ] )
154
+ }
155
+ } ,
156
+ isDisabled : 'none' ,
157
+ isPending : 'none' ,
158
+ forcedColors : 'none'
159
+ } ,
137
160
backgroundColor : {
138
161
fillStyle : {
139
162
fill : {
140
163
variant : {
141
164
primary : 'neutral' ,
142
165
secondary : baseColor ( 'gray-100' ) ,
143
166
accent : 'accent' ,
144
- negative : 'negative'
167
+ negative : 'negative' ,
168
+ premium : 'gray-100' ,
169
+ genai : 'gray-100'
145
170
} ,
146
171
isDisabled : 'disabled'
147
172
} ,
148
173
outline : {
174
+ variant : {
175
+ premium : 'gray-100' ,
176
+ genai : 'gray-100'
177
+ } ,
149
178
default : 'transparent' ,
150
179
isHovered : 'gray-100' ,
151
180
isPressed : 'gray-100' ,
@@ -158,11 +187,17 @@ const button = style<ButtonRenderProps & ButtonStyleProps & {isStaticColor: bool
158
187
fill : {
159
188
variant : {
160
189
primary : baseColor ( 'transparent-overlay-800' ) ,
161
- secondary : baseColor ( 'transparent-overlay-100' )
190
+ secondary : baseColor ( 'transparent-overlay-100' ) ,
191
+ premium : 'gray-800' ,
192
+ genai : 'gray-800'
162
193
} ,
163
194
isDisabled : 'transparent-overlay-100'
164
195
} ,
165
196
outline : {
197
+ variant : {
198
+ premium : 'gray-800' ,
199
+ genai : 'gray-800'
200
+ } ,
166
201
default : 'transparent' ,
167
202
isHovered : 'transparent-overlay-100' ,
168
203
isPressed : 'transparent-overlay-100' ,
@@ -189,12 +224,18 @@ const button = style<ButtonRenderProps & ButtonStyleProps & {isStaticColor: bool
189
224
primary : 'gray-25' ,
190
225
secondary : 'neutral' ,
191
226
accent : 'white' ,
192
- negative : 'white'
227
+ negative : 'white' ,
228
+ premium : 'white' ,
229
+ genai : 'white'
193
230
} ,
194
231
isDisabled : 'disabled'
195
232
} ,
196
233
outline : {
197
234
default : 'neutral' ,
235
+ variant : {
236
+ premium : 'white' ,
237
+ genai : 'white'
238
+ } ,
198
239
isDisabled : 'disabled'
199
240
}
200
241
} ,
@@ -203,10 +244,18 @@ const button = style<ButtonRenderProps & ButtonStyleProps & {isStaticColor: bool
203
244
fill : {
204
245
variant : {
205
246
primary : 'auto' ,
206
- secondary : baseColor ( 'transparent-overlay-800' )
247
+ secondary : baseColor ( 'transparent-overlay-800' ) ,
248
+ premium : 'white' ,
249
+ genai : 'white'
207
250
}
208
251
} ,
209
- outline : baseColor ( 'transparent-overlay-800' )
252
+ outline : {
253
+ variant : {
254
+ premium : 'white' ,
255
+ genai : 'white'
256
+ } ,
257
+ default : baseColor ( 'transparent-overlay-800' )
258
+ }
210
259
} ,
211
260
isDisabled : 'transparent-overlay-400'
212
261
} ,
0 commit comments