mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-27 23:27:31 +00:00
refactor(roadtrip): the limits as badges, and a quieter empty state
The three figures under the button were one run-on string joined by dots, which says nothing about which number is which. Each takes the badge shell the rail already uses, with its own icon: a clock, a calendar, a pump. The icon tile in front of the title goes, because it was eating exactly the width the three badges need to sit on one line. Distances there go through formatDistance, so an imperial traveller reads miles on the button and types miles in the dialog while storage stays kilometres. EmptyState gains a compact variant. A sidebar state sits under its own controls, where a line at page size competes with them; at the caption tier it reads as what it is, a note about why the list below is blank.
This commit is contained in:
@@ -22,6 +22,7 @@ export default function EmptyState({
|
||||
size = 104,
|
||||
surface = 'var(--bg-card)',
|
||||
layout = 'stack',
|
||||
compact = false,
|
||||
className = '',
|
||||
action,
|
||||
}: {
|
||||
@@ -31,6 +32,14 @@ export default function EmptyState({
|
||||
size?: number
|
||||
surface?: string
|
||||
layout?: 'stack' | 'row'
|
||||
/**
|
||||
* Quieter type for a state inside a narrow column rather than on a page.
|
||||
*
|
||||
* The sidebar's empty state sits under its own controls, so a line at the page size
|
||||
* competes with them for the eye; at the caption tier it reads as what it is, a note
|
||||
* about why the list below is blank.
|
||||
*/
|
||||
compact?: boolean
|
||||
className?: string
|
||||
/** Optional call to action under the title, for states that have an obvious next step. */
|
||||
action?: ReactNode
|
||||
@@ -44,7 +53,7 @@ export default function EmptyState({
|
||||
style={{ '--m-ink': 'var(--text-primary)', '--m-bg': surface } as CSSProperties}
|
||||
>
|
||||
<MDancingTrek scene={scene} mood={mood} size={size} />
|
||||
<p className="text-[15px] font-semibold text-content-secondary">{title}</p>
|
||||
<p className={compact ? 'text-caption text-content-muted' : 'text-[15px] font-semibold text-content-secondary'}>{title}</p>
|
||||
{action}
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user