2024-02-22 00:02:24 +02:00
|
|
|
export default {
|
|
|
|
|
name: 'Tab', // Name of the component
|
|
|
|
|
selector: '.tab', // CSS selector/prefix
|
|
|
|
|
states: {
|
|
|
|
|
active: '.active',
|
2025-03-22 16:04:16 -04:00
|
|
|
hover: ':is(:hover, :focus-visible, :has(:focus-visible)):not(.disabled)',
|
2026-01-06 16:22:52 +02:00
|
|
|
disabled: '.disabled',
|
2024-02-22 00:02:24 +02:00
|
|
|
},
|
2026-01-06 16:22:52 +02:00
|
|
|
validInnerComponents: ['Text', 'Icon'],
|
2024-02-22 00:02:24 +02:00
|
|
|
defaultRules: [
|
|
|
|
|
{
|
|
|
|
|
directives: {
|
|
|
|
|
background: '--fg',
|
2024-10-06 14:10:19 +03:00
|
|
|
shadow: ['--buttonDefaultShadow', '--buttonDefaultBevel'],
|
2026-01-06 16:22:52 +02:00
|
|
|
roundness: 3,
|
|
|
|
|
},
|
2024-02-22 00:02:24 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
state: ['hover'],
|
|
|
|
|
directives: {
|
2026-01-06 16:22:52 +02:00
|
|
|
shadow: ['--buttonDefaultHoverGlow', '--buttonDefaultBevel'],
|
|
|
|
|
},
|
2024-02-22 00:02:24 +02:00
|
|
|
},
|
2024-02-22 00:06:51 +02:00
|
|
|
{
|
2024-02-28 22:56:15 +02:00
|
|
|
state: ['active'],
|
2024-02-22 00:06:51 +02:00
|
|
|
directives: {
|
2026-01-06 16:22:52 +02:00
|
|
|
opacity: 0,
|
|
|
|
|
},
|
2024-02-22 00:06:51 +02:00
|
|
|
},
|
2024-02-22 00:02:24 +02:00
|
|
|
{
|
2024-02-28 22:56:15 +02:00
|
|
|
state: ['hover', 'active'],
|
2024-02-22 00:02:24 +02:00
|
|
|
directives: {
|
2026-01-06 16:22:52 +02:00
|
|
|
shadow: ['--buttonDefaultShadow', '--buttonDefaultBevel'],
|
|
|
|
|
},
|
2024-02-22 00:02:24 +02:00
|
|
|
},
|
|
|
|
|
{
|
2024-02-28 22:56:15 +02:00
|
|
|
state: ['disabled'],
|
2024-02-22 00:02:24 +02:00
|
|
|
directives: {
|
2024-10-03 00:44:16 +03:00
|
|
|
background: '$blend(--inheritedBackground 0.25 --parent)',
|
2026-01-06 16:22:52 +02:00
|
|
|
shadow: ['--buttonDefaultBevel'],
|
|
|
|
|
},
|
2024-02-22 00:02:24 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Text',
|
|
|
|
|
parent: {
|
|
|
|
|
component: 'Tab',
|
2026-01-06 16:22:52 +02:00
|
|
|
state: ['disabled'],
|
2024-02-22 00:02:24 +02:00
|
|
|
},
|
|
|
|
|
directives: {
|
|
|
|
|
textOpacity: 0.25,
|
2026-01-06 16:22:52 +02:00
|
|
|
textOpacityMode: 'blend',
|
|
|
|
|
},
|
2024-02-22 00:06:51 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Icon',
|
|
|
|
|
parent: {
|
|
|
|
|
component: 'Tab',
|
2026-01-06 16:22:52 +02:00
|
|
|
state: ['active'],
|
2024-02-22 00:06:51 +02:00
|
|
|
},
|
|
|
|
|
directives: {
|
2026-01-06 16:22:52 +02:00
|
|
|
textColor: '--text',
|
|
|
|
|
},
|
2024-02-22 00:06:51 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Icon',
|
|
|
|
|
parent: {
|
|
|
|
|
component: 'Tab',
|
2026-01-06 16:22:52 +02:00
|
|
|
state: ['active', 'hover'],
|
2024-02-22 00:06:51 +02:00
|
|
|
},
|
|
|
|
|
directives: {
|
2026-01-06 16:22:52 +02:00
|
|
|
textColor: '--text',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
2024-02-22 00:02:24 +02:00
|
|
|
}
|