mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-05 02:14:05 +00:00
46 lines
2.2 KiB
TypeScript
46 lines
2.2 KiB
TypeScript
import type { ReactNode } from 'react'
|
|
import { fs } from '../shared/DialogShell'
|
|
import { CardHead } from '../shared/dialogParts'
|
|
|
|
/**
|
|
* The pieces the two columns beside the place form share: the Place details
|
|
* column on the left and the saved places on the right. Both are grey panels
|
|
* with white cards on them, the look of the booking editors' route panels, so
|
|
* the three columns of the add place dialog read as one piece.
|
|
*/
|
|
|
|
/**
|
|
* The frame of a column. Its width is the caller's: the same sm:w-80 (320 px) on
|
|
* both sides of the form, so neither column reads as the more important one.
|
|
*/
|
|
export const SIDE_COLUMN = 'flex max-h-[60vh] w-full shrink-0 flex-col self-start overflow-hidden rounded-[14px] border border-edge-faint bg-surface-secondary'
|
|
|
|
/** Side columns use the same heading as the editor's other groups. */
|
|
export function ColumnHead({ icon, children }: { icon: ReactNode; children: string }) {
|
|
return (
|
|
<div className="flex-none px-3 pb-3 pt-3">
|
|
<CardHead icon={icon} title={children} />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
/** A white card on the grey column, the frame every block of it sits in. */
|
|
export const COLUMN_CARD = 'rounded-[12px] border border-edge-faint bg-surface-input'
|
|
|
|
/**
|
|
* A quiet line in place of content: nothing picked yet, still loading, nothing
|
|
* found. Small on purpose, so an empty column waits instead of shouting, and it
|
|
* leaves the column its width so the dialog does not move when content arrives.
|
|
*/
|
|
export function HintCard({ icon, children }: { icon: ReactNode; children: ReactNode }) {
|
|
return (
|
|
<div className="flex items-center gap-2.5 rounded-[12px] border border-dashed border-edge px-3 py-2.5 text-content-muted" style={fs(12, 'body')}>
|
|
<span className="grid h-8 w-8 flex-none place-items-center rounded-full bg-surface-card text-content-faint shadow-sm">{icon}</span>
|
|
<span className="min-w-0 leading-snug">{children}</span>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
/** A white action across the width of a column or a field, like the dialog's secondary buttons. */
|
|
export const WHITE_BUTTON = 'trek-form-control flex w-full items-center justify-center gap-2 rounded-[10px] border border-edge bg-surface-input px-3 py-2 font-medium text-content transition-colors hover:bg-surface-hover disabled:cursor-default disabled:opacity-50'
|