DropdownMenu cascading submenu style polish (WEB-1129)
Version: 0.6.3 ยท Type: ๐ Bug Fix
Problemโ
The cascading submenu visuals did not match the design:
- The cascading arrow was too large (used the
chevronRightthick arrow). - The submenu was offset from the parent menu instead of overlapping it.
- The submenu's first option was not aligned with the parent option.
- When the submenu opened, the parent
SubTriggerbackground turned dark instead of the hover Gray-1. - Leading icon and arrow icon colors were inconsistent.
Changed Filesโ
packages/design/src/Icons/contract.tspackages/design/src/Icons/index.tsxpackages/design/src/components/DropdownMenu/DropdownMenu.tsxpackages/design/src/components/DropdownMenu/styles.tspackages/design/src/components/DropdownMenu/DropdownMenuDesignSpec.md- consumer icon registries:
packages/design-site/src/icons/plaud-icon-registry.tsx,apps/web4/src/shared/icons/designIconRegistry.tsx
Changesโ
- Added a new required
listChevronRighticon key (Figmaicon_list_chevron_right) toIconRegistry; the cascading arrow now uses it at a 20px container withLabels/Primarycolor. - Leading icon container defaults to
Labels/Primary(a business-injected node can still override it). DropdownMenuSubContentdefaults tosideOffset={-8}(overlaps the parent menu by 8px) andalignOffset={-8}(shifts up 8px so the first option aligns with the parent option); both remain overridable.SubTriggeropen-state background overridden toGrays/Gray-1, consistent with hover (fixes the dark background on open).
Breakingโ
IconRegistry gains a required key listChevronRight. Every consumer that injects an icon registry must provide an icon_list_chevron_right implementation, otherwise satisfies IconRegistry fails to compile. In-monorepo consumers (design-site, web4) are already updated.