fix(editor): Plus rows hover tint, axe on an active row, line limits
This commit is contained in:
1 parent
2c4c771269
commit
da755f9768
3 files changed
+30
-7
No files matched your search
@@ -20,17 +20,27 @@ import { useT } from '@/i18n/useT'
|
||||
import HistoryButtons from './HistoryButtons'
|
||||
import { MORE_LIST_ID, useMoreDismiss, useMoreMenu } from './useMoreMenu'
|
||||
|
||||
const BASE =
|
||||
'min-h-11 whitespace-nowrap border-b-2 px-3 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)]'
|
||||
const FOCUS_RING =
|
||||
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)]'
|
||||
const BASE = `min-h-11 whitespace-nowrap border-b-2 px-3 text-sm ${FOCUS_RING}`
|
||||
const ACTIVE =
|
||||
'border-[var(--color-accent)] font-medium text-[var(--color-accent-strong)]'
|
||||
const IDLE =
|
||||
'border-transparent text-[var(--color-ink-muted)] hover:text-[var(--color-ink)]'
|
||||
|
||||
const ROW =
|
||||
'flex min-h-12 w-full items-center justify-between gap-3 rounded-md px-4 text-left text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)]'
|
||||
`flex min-h-12 w-full items-center justify-between gap-3 rounded-md px-4 text-left
|
||||
text-sm ${FOCUS_RING}`.replace(/\s+/g, ' ')
|
||||
const ROW_ACTIVE =
|
||||
'bg-[var(--color-accent)]/10 font-medium text-[var(--color-accent-strong)]'
|
||||
const ROW_IDLE =
|
||||
'text-[var(--color-ink-muted)] hover:bg-[var(--color-accent)]/5 hover:text-[var(--color-ink)]'
|
||||
const MORE_PANEL =
|
||||
`absolute inset-x-0 top-full z-20 mt-1 flex flex-col gap-1 rounded-lg border
|
||||
border-[var(--color-border)] bg-[var(--color-surface)] p-2 shadow-lg`.replace(
|
||||
/\s+/g,
|
||||
' ',
|
||||
)
|
||||
|
||||
/** The blocking-error count on the Vérification tab, as text; absent at zero. */
|
||||
function ErrorCount({ tab }: { tab: EditorTabId }) {
|
||||
@@ -138,7 +148,7 @@ function MoreList({ more, active, onPick }: MoreListProps) {
|
||||
transition: { duration: reduced ? 0 : 0.15 },
|
||||
}}
|
||||
exit={{ ...hidden, transition: { duration: reduced ? 0 : 0.12 } }}
|
||||
className="absolute inset-x-0 top-full z-20 mt-1 flex flex-col gap-1 rounded-lg border border-[var(--color-border)] bg-[var(--color-surface)] p-2 shadow-lg"
|
||||
className={MORE_PANEL}
|
||||
>
|
||||
{more.map((tab) => (
|
||||
<li key={tab}>
|
||||
@@ -147,7 +157,7 @@ function MoreList({ more, active, onPick }: MoreListProps) {
|
||||
type="button"
|
||||
aria-current={tab === active ? 'true' : undefined}
|
||||
onClick={() => onPick(tab)}
|
||||
className={`${ROW} ${tab === active ? ROW_ACTIVE : IDLE}`}
|
||||
className={`${ROW} ${tab === active ? ROW_ACTIVE : ROW_IDLE}`}
|
||||
>
|
||||
<span>
|
||||
{t(`editor.tab.${tab}`)}
|
||||
|
||||
Reference in new issue
Block a user