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.
92 lines
2.0 KiB
92 lines
2.0 KiB
import type { Morfo } from '../types';
|
|
import { v } from '../types';
|
|
|
|
export const timePickerMorfo = {
|
|
name: 'TimePicker',
|
|
kebab: 'time-picker',
|
|
scope: ['soma'],
|
|
translations: {
|
|
trigger: { es: 'Abrir selector de hora', en: 'Open time picker' }
|
|
},
|
|
|
|
focus: {
|
|
initial: 'first-focusable',
|
|
trap: true,
|
|
return: 'trigger',
|
|
restore: true
|
|
},
|
|
|
|
parts: [
|
|
{
|
|
name: 'Provider',
|
|
kebab: 'provider',
|
|
archetype: 'provider',
|
|
kind: 'virtual',
|
|
defaultElement: 'none',
|
|
optional: false,
|
|
data: [],
|
|
aria: []
|
|
},
|
|
{
|
|
name: 'Trigger',
|
|
kebab: 'trigger',
|
|
archetype: 'trigger',
|
|
kind: 'public',
|
|
defaultElement: 'button',
|
|
role: 'button',
|
|
optional: false,
|
|
states: ['open', 'closed'],
|
|
data: [{ attr: 'data-state', values: ['open', 'closed'] }],
|
|
aria: [
|
|
{ attr: 'type', value: v.literal('button') },
|
|
{ attr: 'aria-haspopup', value: v.literal('dialog') },
|
|
{ attr: 'aria-expanded', value: v.stateRef('open') },
|
|
{
|
|
attr: 'aria-controls',
|
|
value: v.partRef('content'),
|
|
condition: { when: 'part-present', part: 'content' },
|
|
severity: 'recommended'
|
|
},
|
|
{
|
|
attr: 'aria-label',
|
|
value: v.translationRef('#?components.time-picker.trigger|Open time picker'),
|
|
severity: 'recommended'
|
|
}
|
|
]
|
|
},
|
|
{
|
|
name: 'Content',
|
|
kebab: 'content',
|
|
archetype: 'content',
|
|
kind: 'public',
|
|
defaultElement: 'div',
|
|
role: 'dialog',
|
|
optional: false,
|
|
states: ['open', 'closed'],
|
|
data: [{ attr: 'data-state', values: ['open', 'closed'] }],
|
|
aria: []
|
|
},
|
|
{
|
|
name: 'DayPeriodToggle',
|
|
kebab: 'day-period-toggle',
|
|
archetype: 'input',
|
|
kind: 'public',
|
|
defaultElement: 'div',
|
|
role: 'radiogroup',
|
|
optional: true,
|
|
data: [],
|
|
aria: []
|
|
},
|
|
{
|
|
name: 'DayPeriodItem',
|
|
kebab: 'day-period-item',
|
|
archetype: 'item',
|
|
kind: 'public',
|
|
defaultElement: 'label',
|
|
optional: true,
|
|
data: [{ attr: 'data-checked', severity: 'optional' }],
|
|
aria: []
|
|
}
|
|
]
|
|
} as const satisfies Morfo;
|