* Gets the active/hover classes for a popover item. * Uses variant for secondary, otherwise colorScheme determines default vs inverted.
( variant: PopoverVariant, colorScheme: PopoverColorScheme, isActive: boolean )
| 138 | * Uses variant for secondary, otherwise colorScheme determines default vs inverted. |
| 139 | */ |
| 140 | function getItemStateClasses( |
| 141 | variant: PopoverVariant, |
| 142 | colorScheme: PopoverColorScheme, |
| 143 | isActive: boolean |
| 144 | ): string { |
| 145 | const state = isActive ? 'active' : 'hover' |
| 146 | |
| 147 | if (variant === 'secondary') { |
| 148 | return STYLES.states.secondary[state] |
| 149 | } |
| 150 | |
| 151 | return colorScheme === 'inverted' ? STYLES.states.inverted[state] : STYLES.states.default[state] |
| 152 | } |
| 153 | |
| 154 | interface PopoverContextValue { |
| 155 | openFolder: ( |