mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-17 04:23:07 +00:00
- useAgendaKeyboardNavigation: ArrowLeft/Right → prev/next no mobile (FullCalendar v7 não tem setas no grid — verificado no bundle); skips para modificadores/dialog/menu/inputs; restore de foco na região - Região de teclado mobile-only: tabIndex/role/aria-label gateados por isMobile (desktop mantém a toolbar e sua árvore a11y intacta) - onTitleClick ganha icon?: LucideIcon (glyph da página, aria-hidden); agenda passa RotateCcw como affordance do 'voltar para hoje' - E2E: teste de teclado (dia e mês), glyph no título, hardening do swipe CDP (pacing 25ms — burst era classificado como flick pelo Chromium e disparava back-nav ~35% das runs) - Unit: 14 testes do hook/pura + 4 do renderer do glyph; impl plan docs/plans/c101-ux-pos-critique-impl.md (aprovado pelo humano) Closes #512
58 lines
1.8 KiB
TypeScript
58 lines
1.8 KiB
TypeScript
import type { CampaignPageChrome } from '@/lib/campaignPageChrome'
|
|
import { cn } from '@/lib/utils'
|
|
|
|
export const CampaignPageChromeText = ({
|
|
chrome,
|
|
layout,
|
|
className,
|
|
}: {
|
|
chrome: CampaignPageChrome
|
|
layout: 'mobile' | 'desktop'
|
|
className?: string
|
|
}) => {
|
|
if (layout === 'desktop') {
|
|
return (
|
|
<p
|
|
data-slot="campaign-page-chrome"
|
|
className={cn('min-w-0 truncate text-sm font-medium text-foreground', className)}
|
|
>
|
|
<span data-slot="campaign-page-chrome-title">{chrome.title}</span>
|
|
{chrome.subtitle ? (
|
|
<span className="font-normal text-muted-foreground"> {chrome.subtitle}</span>
|
|
) : null}
|
|
</p>
|
|
)
|
|
}
|
|
|
|
return (
|
|
<div data-slot="campaign-page-chrome" className={cn('min-w-0 flex-1 leading-tight', className)}>
|
|
{chrome.onTitleClick ? (
|
|
<button
|
|
type="button"
|
|
data-slot="campaign-page-chrome-title"
|
|
title={chrome.onTitleClick.hint}
|
|
onClick={chrome.onTitleClick.action}
|
|
className="flex min-w-0 max-w-full items-center gap-1.5 text-left text-sm font-semibold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
>
|
|
<span className="block min-w-0 truncate">{chrome.title}</span>
|
|
{chrome.onTitleClick.icon ? (
|
|
<chrome.onTitleClick.icon
|
|
className="size-3.5 shrink-0 text-current"
|
|
aria-hidden="true"
|
|
/>
|
|
) : null}
|
|
</button>
|
|
) : (
|
|
<span
|
|
data-slot="campaign-page-chrome-title"
|
|
className="block truncate text-sm font-semibold"
|
|
>
|
|
{chrome.title}
|
|
</span>
|
|
)}
|
|
{chrome.subtitle ? (
|
|
<span className="block truncate text-xs text-primary-foreground/80">{chrome.subtitle}</span>
|
|
) : null}
|
|
</div>
|
|
)
|
|
}
|