2
root: ({ props, context, parent, instance }) => ({
7
'items-center inline-flex text-center align-bottom justify-center',
10
(props.iconPos === 'top' || props.iconPos === 'bottom') &&
17
'px-3 py-2': props.size === null,
18
'text-sm py-1.5 px-3': props.size === 'small',
19
'text-xl py-3 px-4': props.size === 'large',
21
{ 'gap-2': props.label !== null },
23
'w-10 px-0 py-2': props.label == null && props.icon !== null,
26
'w-10 px-0 gap-0': instance.hasIcon && !props.label && !props.badge,
27
'rounded-[50%] h-10 [&>[data-pc-section=label]]:w-0 [&>[data-pc-section=label]]:invisible':
28
instance.hasIcon && !props.label && !props.badge && props.rounded,
32
{ 'shadow-lg': props.raised },
33
{ 'rounded-md': !props.rounded, 'rounded-full': props.rounded },
35
'rounded-none first:rounded-l-md last:rounded-r-md':
36
parent.instance.$name == 'InputGroup',
40
{ 'text-primary-600 bg-transparent border-transparent': props.link },
44
'text-white bg-gray-500 border border-gray-500':
45
props.plain && !props.outlined && !props.text,
48
{ 'text-surface-500': props.plain && props.text },
51
'text-surface-500 border border-gray-500':
52
props.plain && props.outlined,
56
{ 'bg-transparent border-transparent': props.text && !props.plain },
59
{ 'bg-transparent border': props.outlined && !props.plain },
65
'text-primary-contrast':
67
props.severity === null &&
73
props.severity === null &&
77
'border border-primary':
79
props.severity === null &&
85
{ 'text-primary': props.text && props.severity === null && !props.plain },
88
'text-primary border border-primary':
89
props.outlined && props.severity === null && !props.plain,
94
'text-surface-900 dark:text-white':
95
props.severity === 'secondary' &&
99
'bg-surface-100 dark:bg-surface-700':
100
props.severity === 'secondary' &&
104
'border border-surface-100 dark:border-surface-700':
105
props.severity === 'secondary' &&
112
'text-surface-500 dark:text-surface-300':
113
props.text && props.severity === 'secondary' && !props.plain,
117
'text-surface-500 dark:text-surface-300 border border-surface-500 hover:bg-surface-300/10':
118
props.outlined && props.severity === 'secondary' && !props.plain,
123
'text-white dark:text-green-900':
124
props.severity === 'success' &&
128
'bg-green-500 dark:bg-green-400':
129
props.severity === 'success' &&
133
'border border-green-500 dark:border-green-400':
134
props.severity === 'success' &&
141
'text-green-500 dark:text-green-400':
142
props.text && props.severity === 'success' && !props.plain,
146
'text-green-500 border border-green-500 hover:bg-green-300/10':
147
props.outlined && props.severity === 'success' && !props.plain,
152
'text-white dark:text-surface-900':
153
props.severity === 'info' &&
157
'bg-blue-500 dark:bg-blue-400':
158
props.severity === 'info' &&
162
'border border-blue-500 dark:border-blue-400':
163
props.severity === 'info' &&
170
'text-blue-500 dark:text-blue-400':
171
props.text && props.severity === 'info' && !props.plain,
175
'text-blue-500 border border-blue-500 hover:bg-blue-300/10 ':
176
props.outlined && props.severity === 'info' && !props.plain,
181
'text-white dark:text-surface-900':
182
props.severity === 'warn' &&
186
'bg-orange-500 dark:bg-orange-400':
187
props.severity === 'warn' &&
191
'border border-orange-500 dark:border-orange-400':
192
props.severity === 'warn' &&
199
'text-orange-500 dark:text-orange-400':
200
props.text && props.severity === 'warn' && !props.plain,
204
'text-orange-500 border border-orange-500 hover:bg-orange-300/10':
205
props.outlined && props.severity === 'warn' && !props.plain,
210
'text-white dark:text-surface-900':
211
props.severity === 'help' &&
215
'bg-purple-500 dark:bg-purple-400':
216
props.severity === 'help' &&
220
'border border-purple-500 dark:border-purple-400':
221
props.severity === 'help' &&
228
'text-purple-500 dark:text-purple-400':
229
props.text && props.severity === 'help' && !props.plain,
233
'text-purple-500 border border-purple-500 hover:bg-purple-300/10':
234
props.outlined && props.severity === 'help' && !props.plain,
239
'text-white dark:text-surface-900':
240
props.severity === 'danger' &&
244
'bg-red-500 dark:bg-red-400':
245
props.severity === 'danger' &&
249
'border border-red-500 dark:border-red-400':
250
props.severity === 'danger' &&
257
'text-red-500 dark:text-red-400':
258
props.text && props.severity === 'danger' && !props.plain,
262
'text-red-500 border border-red-500 hover:bg-red-300/10':
263
props.outlined && props.severity === 'danger' && !props.plain,
268
'text-white dark:text-surface-900':
269
props.severity === 'contrast' &&
273
'bg-surface-900 dark:bg-surface-0':
274
props.severity === 'contrast' &&
278
'border border-surface-900 dark:border-surface-0':
279
props.severity === 'contrast' &&
286
'text-surface-900 dark:text-surface-0':
287
props.text && props.severity === 'contrast' && !props.plain,
291
'text-surface-900 dark:text-surface-0 border border-surface-900 dark:border-surface-0':
292
props.outlined && props.severity === 'contrast' && !props.plain,
296
'focus:outline-none focus:outline-offset-0 focus:ring-1',
299
{ 'focus:ring-primary': props.link },
303
'hover:bg-gray-600 hover:border-gray-600':
304
props.plain && !props.outlined && !props.text,
308
'hover:bg-surface-300/10':
309
props.plain && (props.text || props.outlined),
314
'hover:bg-primary-emphasis hover:border-primary-emphasis':
316
props.severity === null &&
321
{ 'focus:ring-primary': props.severity === null },
324
'hover:bg-primary-300/10':
325
(props.text || props.outlined) &&
326
props.severity === null &&
332
'hover:bg-surface-200 dark:hover:bg-surface-600 hover:border-surface-200 dark:hover:border-surface-600':
333
props.severity === 'secondary' &&
339
'focus:ring-surface-500 dark:focus:ring-surface-400':
340
props.severity === 'secondary',
344
'hover:bg-surface-300/10':
345
(props.text || props.outlined) &&
346
props.severity === 'secondary' &&
352
'hover:bg-green-600 dark:hover:bg-green-300 hover:border-green-600 dark:hover:border-green-300':
353
props.severity === 'success' &&
359
'focus:ring-green-500 dark:focus:ring-green-400':
360
props.severity === 'success',
364
'hover:bg-green-300/10':
365
(props.text || props.outlined) &&
366
props.severity === 'success' &&
372
'hover:bg-blue-600 dark:hover:bg-blue-300 hover:border-blue-600 dark:hover:border-blue-300':
373
props.severity === 'info' &&
379
'focus:ring-blue-500 dark:focus:ring-blue-400':
380
props.severity === 'info',
384
'hover:bg-blue-300/10':
385
(props.text || props.outlined) &&
386
props.severity === 'info' &&
392
'hover:bg-orange-600 dark:hover:bg-orange-300 hover:border-orange-600 dark:hover:border-orange-300':
393
props.severity === 'warn' &&
399
'focus:ring-orange-500 dark:focus:ring-orange-400':
400
props.severity === 'warn',
404
'hover:bg-orange-300/10':
405
(props.text || props.outlined) &&
406
props.severity === 'warn' &&
412
'hover:bg-purple-600 dark:hover:bg-purple-300 hover:border-purple-600 dark:hover:border-purple-300':
413
props.severity === 'help' &&
419
'focus:ring-purple-500 dark:focus:ring-purple-400':
420
props.severity === 'help',
424
'hover:bg-purple-300/10':
425
(props.text || props.outlined) &&
426
props.severity === 'help' &&
432
'hover:bg-red-600 dark:hover:bg-red-300 hover:border-red-600 dark:hover:border-red-300':
433
props.severity === 'danger' &&
439
'focus:ring-red-500 dark:focus:ring-red-400':
440
props.severity === 'danger',
444
'hover:bg-red-300/10':
445
(props.text || props.outlined) &&
446
props.severity === 'danger' &&
452
'hover:bg-surface-800 dark:hover:bg-surface-100 hover:border-surface-800 dark:hover:border-surface-100':
453
props.severity === 'contrast' &&
459
'focus:ring-surface-500 dark:focus:ring-surface-400':
460
props.severity === 'contrast',
464
'hover:bg-surface-900/10 dark:hover:bg-[rgba(255,255,255,0.03)]':
465
(props.text || props.outlined) &&
466
props.severity === 'contrast' &&
471
{ 'opacity-60 pointer-events-none cursor-default': context.disabled },
474
'transition duration-200 ease-in-out',
477
'cursor-pointer overflow-hidden select-none',
480
'[&>[data-pc-name=badge]]:min-w-4 [&>[data-pc-name=badge]]:h-4 [&>[data-pc-name=badge]]:leading-4',
483
label: ({ props }) => ({
488
'hover:underline': props.link,
490
{ 'flex-1': props.label !== null, 'invisible w-0': props.label == null },
493
icon: ({ props }) => ({
495
'text-base leading-4',
498
'mr-2': props.iconPos == 'left' && props.label != null,
499
'ml-2 order-1': props.iconPos == 'right' && props.label != null,
500
'order-2': props.iconPos == 'bottom' && props.label != null,
504
loadingIcon: ({ props }) => ({
509
'mr-2': props.iconPos == 'left' && props.label != null,
510
'ml-2 order-1': props.iconPos == 'right' && props.label != null,
511
'mb-2': props.iconPos == 'top' && props.label != null,
512
'mt-2': props.iconPos == 'bottom' && props.label != null,
517
badge: ({ props }) => ({
520
'ml-2 w-4 h-4 leading-none flex items-center justify-center':