@@ -59,7 +59,7 @@ import { chipActiveSurfaceClass, chipHoverSurfaceClass } from '../chip/chip-chro
5959import { InsideModalContext } from '../modal/modal'
6060import { TOOLTIP_MAX_WIDTH_PX , TOOLTIP_SURFACE_CLASS } from '../tooltip/tooltip-styles'
6161
62- type PopoverSize = 'sm' | 'md'
62+ type PopoverSize = 'sm' | 'md' | 'compact'
6363type PopoverColorScheme = 'default' | 'inverted'
6464
6565/**
@@ -82,6 +82,11 @@ const STYLES = {
8282 icon : 'size-[14px]' ,
8383 section : 'px-1.5 py-1 text-xs' ,
8484 } ,
85+ compact : {
86+ item : 'h-7 gap-1.5 px-1.5 py-0 text-xs' ,
87+ icon : 'size-3' ,
88+ section : 'px-1.5 py-0.5 text-xs' ,
89+ } ,
8590 } satisfies Record < PopoverSize , { item : string ; icon : string ; section : string } > ,
8691
8792 /** Color scheme variants */
@@ -189,6 +194,7 @@ export interface PopoverProps extends PopoverPrimitive.PopoverProps {
189194 * Size variant of the popover
190195 * - sm: 11px text, compact spacing (for logs, notifications, context menus)
191196 * - md: 13px text, default spacing
197+ * - compact: 11px text, 28px rows for location and views menus
192198 * @default 'md'
193199 */
194200 size ?: PopoverSize
@@ -401,7 +407,12 @@ interface PopoverContentProps
401407 * Applies a semantic platform surface treatment.
402408 * @default 'default'
403409 */
404- appearance ?: 'default' | 'tooltip'
410+ appearance ?: 'default' | 'tooltip' | 'menu'
411+ /**
412+ * Removes the content's inset padding for embedded calendars and panels.
413+ * @default 'default'
414+ */
415+ padding ?: 'default' | 'none'
405416 /**
406417 * Flip to avoid viewport collisions
407418 * @default true
@@ -443,6 +454,7 @@ const PopoverContent = React.forwardRef<
443454 collisionPadding = 8 ,
444455 border = false ,
445456 appearance = 'default' ,
457+ padding = 'default' ,
446458 avoidCollisions = true ,
447459 showArrow = false ,
448460 arrowClassName,
@@ -614,6 +626,8 @@ const PopoverContent = React.forwardRef<
614626 STYLES . colorScheme [ colorScheme ] . content ,
615627 STYLES . content ,
616628 appearance === 'tooltip' && TOOLTIP_SURFACE_CLASS ,
629+ appearance === 'menu' && 'bg-[var(--bg)] text-[var(--text-body)] shadow-xs' ,
630+ padding === 'none' && 'p-0' ,
617631 hasUserWidthConstraint &&
618632 '[&_.flex-1:not([data-popover-scroll])]:truncate [&_[data-popover-section]]:truncate' ,
619633 border && 'border border-[var(--border-1)]' ,
@@ -842,6 +856,7 @@ const PopoverSection = React.forwardRef<HTMLDivElement, PopoverSectionProps>(
842856 'mt-1.5 min-w-0 first:mt-0 first:pt-0' ,
843857 STYLES . colorScheme [ colorScheme ] . section ,
844858 STYLES . size [ size ] . section ,
859+ size === 'compact' && colorScheme === 'default' && 'text-[var(--text-muted)]' ,
845860 className
846861 ) }
847862 data-popover-section = ''
0 commit comments