2024-02-11 23:11:28 +02:00
|
|
|
export default {
|
|
|
|
|
name: 'MenuItem',
|
|
|
|
|
selector: '.menu-item',
|
2026-01-06 16:22:52 +02:00
|
|
|
validInnerComponents: ['Text', 'Icon', 'Border'],
|
2024-02-11 23:11:28 +02:00
|
|
|
states: {
|
2025-03-22 16:04:16 -04:00
|
|
|
hover: ':is(:hover, :focus-visible, :has(:focus-visible)):not(.disabled)',
|
2024-12-31 13:05:15 +02:00
|
|
|
active: '.-active',
|
2026-01-06 16:22:52 +02:00
|
|
|
disabled: '.disabled',
|
2024-02-11 23:11:28 +02:00
|
|
|
},
|
|
|
|
|
defaultRules: [
|
|
|
|
|
{
|
|
|
|
|
directives: {
|
2024-02-12 17:26:08 +02:00
|
|
|
background: '--bg',
|
2026-01-06 16:22:52 +02:00
|
|
|
opacity: 0,
|
|
|
|
|
},
|
2024-02-12 17:26:08 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
state: ['hover'],
|
|
|
|
|
directives: {
|
2024-10-03 00:44:16 +03:00
|
|
|
background: '$mod(--bg 5)',
|
2026-01-06 16:22:52 +02:00
|
|
|
opacity: 1,
|
|
|
|
|
},
|
2024-02-11 23:11:28 +02:00
|
|
|
},
|
2024-02-13 02:09:43 +02:00
|
|
|
{
|
|
|
|
|
state: ['active'],
|
|
|
|
|
directives: {
|
2024-10-03 00:44:16 +03:00
|
|
|
background: '$mod(--bg 10)',
|
2026-01-06 16:22:52 +02:00
|
|
|
opacity: 1,
|
|
|
|
|
},
|
2024-02-27 17:03:39 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
state: ['active', 'hover'],
|
|
|
|
|
directives: {
|
2024-10-03 00:44:16 +03:00
|
|
|
background: '$mod(--bg 15)',
|
2026-01-06 16:22:52 +02:00
|
|
|
opacity: 1,
|
|
|
|
|
},
|
2024-02-13 02:09:43 +02:00
|
|
|
},
|
2024-02-11 23:11:28 +02:00
|
|
|
{
|
|
|
|
|
component: 'Text',
|
|
|
|
|
parent: {
|
|
|
|
|
component: 'MenuItem',
|
2026-01-06 16:22:52 +02:00
|
|
|
state: ['hover'],
|
2024-02-27 17:03:39 +02:00
|
|
|
},
|
|
|
|
|
directives: {
|
|
|
|
|
textColor: '--link',
|
2026-01-06 16:22:52 +02:00
|
|
|
textAuto: 'no-preserve',
|
|
|
|
|
},
|
2024-02-27 17:03:39 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Text',
|
|
|
|
|
parent: {
|
|
|
|
|
component: 'MenuItem',
|
2026-01-06 16:22:52 +02:00
|
|
|
state: ['active'],
|
2024-02-27 17:03:39 +02:00
|
|
|
},
|
|
|
|
|
directives: {
|
|
|
|
|
textColor: '--link',
|
2026-01-06 16:22:52 +02:00
|
|
|
textAuto: 'no-preserve',
|
|
|
|
|
},
|
2024-02-27 17:03:39 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Icon',
|
|
|
|
|
parent: {
|
|
|
|
|
component: 'MenuItem',
|
2026-01-06 16:22:52 +02:00
|
|
|
state: ['active'],
|
2024-02-11 23:11:28 +02:00
|
|
|
},
|
|
|
|
|
directives: {
|
|
|
|
|
textColor: '--link',
|
2026-01-06 16:22:52 +02:00
|
|
|
textAuto: 'no-preserve',
|
|
|
|
|
},
|
2024-02-11 23:11:28 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Icon',
|
|
|
|
|
parent: {
|
|
|
|
|
component: 'MenuItem',
|
2026-01-06 16:22:52 +02:00
|
|
|
state: ['hover'],
|
2024-02-11 23:11:28 +02:00
|
|
|
},
|
|
|
|
|
directives: {
|
|
|
|
|
textColor: '--link',
|
2026-01-06 16:22:52 +02:00
|
|
|
textAuto: 'no-preserve',
|
|
|
|
|
},
|
2024-12-31 13:05:15 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Text',
|
|
|
|
|
parent: {
|
|
|
|
|
component: 'MenuItem',
|
2026-01-06 16:22:52 +02:00
|
|
|
state: ['disabled'],
|
2024-12-31 13:05:15 +02:00
|
|
|
},
|
|
|
|
|
directives: {
|
|
|
|
|
textOpacity: 0.25,
|
2026-01-06 16:22:52 +02:00
|
|
|
textOpacityMode: 'blend',
|
|
|
|
|
},
|
2024-12-31 13:05:15 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
component: 'Icon',
|
|
|
|
|
parent: {
|
|
|
|
|
component: 'MenuItem',
|
2026-01-06 16:22:52 +02:00
|
|
|
state: ['disabled'],
|
2024-12-31 13:05:15 +02:00
|
|
|
},
|
|
|
|
|
directives: {
|
|
|
|
|
textOpacity: 0.25,
|
2026-01-06 16:22:52 +02:00
|
|
|
textOpacityMode: 'blend',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
2024-02-11 23:11:28 +02:00
|
|
|
}
|