mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-13 14:32:03 +00:00
feat(mood): sectioned add sheet with quick-tag row and disclosure
This commit is contained in:
1 parent
079be9d5af
commit
9e1e285fe4
12 files changed
+611
-150
No files matched your search
@@ -30,8 +30,12 @@ interface SheetSectionProps {
|
||||
summary?: React.ReactNode;
|
||||
/** Optional leading icon (a Lucide component or any node). */
|
||||
icon?: React.ReactNode;
|
||||
/** Whether the section starts expanded. Defaults to collapsed. */
|
||||
/** Whether the section starts expanded (uncontrolled). Defaults to closed. */
|
||||
defaultOpen?: boolean;
|
||||
/** Controlled open state. When set, pair with `onOpenChange`. */
|
||||
open?: boolean;
|
||||
/** Controlled open-state change handler. */
|
||||
onOpenChange?: (open: boolean) => void;
|
||||
/** Optional className merged onto the section wrapper. */
|
||||
className?: string;
|
||||
children: React.ReactNode;
|
||||
@@ -42,12 +46,15 @@ export function SheetSection({
|
||||
summary,
|
||||
icon,
|
||||
defaultOpen = false,
|
||||
open,
|
||||
onOpenChange,
|
||||
className,
|
||||
children,
|
||||
}: SheetSectionProps) {
|
||||
return (
|
||||
<CollapsiblePrimitive.Root
|
||||
defaultOpen={defaultOpen}
|
||||
// Controlled when `open` is provided, otherwise uncontrolled.
|
||||
{...(open === undefined ? { defaultOpen } : { open, onOpenChange })}
|
||||
data-slot="sheet-section"
|
||||
className={cn("border-border/60 border-t pt-3", className)}
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user