You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte-kit-vice/src/uix/morfo/components/feed.ts

113 lines
2.5 KiB

import type { Morfo } from '../types';
import { v } from '../types';
export const feedMorfo: Morfo = {
name: 'Feed',
kebab: 'feed',
scope: ['soma'],
apg: 'https://www.w3.org/WAI/ARIA/apg/patterns/feed/',
parts: [
{
name: 'Provider',
kebab: 'root',
kind: 'public',
defaultElement: 'section',
role: 'feed',
optional: false,
data: [{ attr: 'data-busy', severity: 'optional' }],
aria: [
{
attr: 'aria-label',
value: v.translationRef('#?components.feed.label|Feed'),
severity: 'recommended'
},
{
attr: 'aria-busy',
value: v.literal('true'),
severity: 'optional',
condition: { when: 'prop-truthy', prop: 'busy' }
}
],
keyboard: [
{ key: 'PageDown', action: 'next-item' },
{ key: 'PageUp', action: 'prev-item' },
{ key: 'Ctrl+Home', action: 'first-item' },
{ key: 'Ctrl+End', action: 'last-item' }
]
},
{
name: 'Article',
kebab: 'article',
kind: 'public',
defaultElement: 'article',
role: 'article',
optional: false,
data: [
{ attr: 'data-posinset' },
{ attr: 'data-level' }
],
aria: [
{ attr: 'aria-posinset', value: v.propRef('posinset') },
{ attr: 'aria-setsize', value: v.propRef('setsize') },
{
attr: 'aria-labelledby',
value: v.partRef('article-title'),
condition: { when: 'part-present', part: 'article-title' },
severity: 'recommended'
},
{
attr: 'aria-describedby',
value: v.partRef('article-description'),
condition: { when: 'part-present', part: 'article-description' },
severity: 'optional'
}
]
},
{
name: 'ArticleTitle',
kebab: 'article-title',
kind: 'public',
defaultElement: 'div',
role: 'heading',
optional: true,
data: [],
aria: [{ attr: 'aria-level', value: v.propRef('level') }]
},
{
name: 'ArticleDescription',
kebab: 'article-description',
kind: 'public',
defaultElement: 'div',
optional: true,
data: [],
aria: []
},
{
name: 'Thread',
kebab: 'thread',
kind: 'public',
defaultElement: 'div',
role: 'feed',
optional: true,
data: [{ attr: 'data-level' }],
aria: [
{
attr: 'aria-labelledby',
value: v.partRef('article-title'),
condition: { when: 'part-present', part: 'article-title' },
severity: 'optional'
}
]
},
{
name: 'Sentinel',
kebab: 'sentinel',
kind: 'public',
defaultElement: 'div',
optional: true,
data: [{ attr: 'data-intersecting', severity: 'optional' }],
aria: [{ attr: 'aria-hidden', value: v.literal('true') }]
}
]
};

Powered by TurnKey Linux.