mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-02 17:26:24 +00:00
ba70ad28b8
Arabic runs the app right to left, but margins, paddings, insets, text alignment, borders and corner radii were written for the left side, so icons sat against the wrong edge of their labels, indents and badges pointed the wrong way and amount columns aligned left. They now use the logical forms (ms-, ps-, start-, text-start, marginInlineStart, insetInlineEnd and their CSS equivalents), which are the very same sides in a left to right language. Geometry stays physical on purpose: maps, positions measured from the pointer or a bounding box, time axes, sliders, transforms and print output. Amounts drawn as several spans keep their order in a right to left row, the time picker keeps hours before minutes, and two switches whose thumb slid out of its track in Arabic now move the right way. lint:rtl counts what is still physical per file against a baseline that may only shrink (1512 uses in 370 files before, 319 in 113 now), and CI runs it, so new code reaches for the logical forms.
30 lines
1.4 KiB
TypeScript
30 lines
1.4 KiB
TypeScript
import type { ReactNode } from 'react'
|
|
import type { LucideIcon } from 'lucide-react'
|
|
import { NEUTRAL_TINT, fs } from '../shared/DialogShell'
|
|
|
|
/** A panel's add action: a soft card pill on the head band. */
|
|
export const HEAD_ACTION = 'inline-flex items-center gap-1 whitespace-nowrap rounded-full bg-surface-card px-2.5 py-1 font-semibold text-content-muted shadow-sm hover:text-content'
|
|
|
|
/**
|
|
* The head band every Collab panel opens with, the same one the cards of the
|
|
* other trip tabs carry: its icon and name in small capitals, how many there
|
|
* are, and its actions on the right.
|
|
*/
|
|
export default function CollabPanelHead({ icon: Icon, title, count, actions }: {
|
|
icon: LucideIcon
|
|
title: string
|
|
count?: number
|
|
actions?: ReactNode
|
|
}) {
|
|
return (
|
|
<div className="flex min-h-[50px] flex-none items-center gap-2 border-b border-edge-faint px-4 py-2" style={{ background: NEUTRAL_TINT }}>
|
|
<Icon size={14} strokeWidth={2} className="flex-none text-content-faint" />
|
|
<h3 className="m-0 font-geist font-bold uppercase tracking-[.08em] text-content-faint" style={fs(11)}>{title}</h3>
|
|
{count != null && count > 0 && (
|
|
<span className="rounded-full bg-surface-card px-2 py-[2px] font-geist font-bold text-content-muted" style={fs(10)}>{count}</span>
|
|
)}
|
|
{actions && <div className="ms-auto flex items-center gap-1.5" style={fs(11.5)}>{actions}</div>}
|
|
</div>
|
|
)
|
|
}
|