mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-02 17:26:24 +00:00
feat(settings,admin): every tab and popup in the planner's design
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import React from 'react'
|
||||
import { ChevronRight } from 'lucide-react'
|
||||
import { fs } from '../../components/shared/DialogShell'
|
||||
import { StatusPill } from '../../components/Settings/settingsKit'
|
||||
|
||||
interface GoogleOptionsProps {
|
||||
/** "Google options" — the heading of the fold. */
|
||||
@@ -19,24 +21,27 @@ interface GoogleOptionsProps {
|
||||
*
|
||||
* A native <details> rather than a state hook: keyboard operable and announced
|
||||
* to screen readers without writing any of that, and it survives a re-render
|
||||
* without state.
|
||||
* without state. Drawn as a box of rows (settingsKit's SettingRows), the
|
||||
* summary being its first row.
|
||||
*/
|
||||
export default function GoogleOptions({ title, summary, children }: GoogleOptionsProps): React.ReactElement {
|
||||
return (
|
||||
<details className="group rounded-lg border border-edge-secondary bg-surface-secondary/40">
|
||||
<details className="group overflow-hidden rounded-[12px] border border-edge-faint bg-surface-secondary">
|
||||
<summary
|
||||
className="flex cursor-pointer list-none items-center gap-2 px-4 py-2.5
|
||||
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent
|
||||
className="flex cursor-pointer list-none items-center gap-2.5 px-3.5 py-2.5 hover:bg-surface-hover
|
||||
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[color:var(--text-primary)]
|
||||
[&::-webkit-details-marker]:hidden"
|
||||
>
|
||||
<ChevronRight
|
||||
className="h-4 w-4 flex-shrink-0 text-content-faint transition-transform group-open:rotate-90"
|
||||
size={15}
|
||||
strokeWidth={2}
|
||||
className="flex-none text-content-faint transition-transform group-open:rotate-90"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<span className="flex-1 text-sm font-medium text-content-secondary">{title}</span>
|
||||
<span className="text-xs text-content-faint">{summary}</span>
|
||||
<span className="min-w-0 flex-1 truncate font-medium text-content" style={fs(13, 'body')}>{title}</span>
|
||||
<StatusPill>{summary}</StatusPill>
|
||||
</summary>
|
||||
<div className="border-t border-edge-faint px-4">{children}</div>
|
||||
<div className="divide-y divide-edge-faint border-t border-edge-faint bg-surface-card">{children}</div>
|
||||
</details>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user