Skip to content

Commit dc9c1b5

Browse files
committed
chore: theme selector updates
1 parent 13f399c commit dc9c1b5

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

packages/documentation-framework/components/themeSelector/themeSelector.js

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,24 @@ const DesktopIcon = (
5050
</svg>
5151
);
5252

53-
const HCGroupLabel = () => {
53+
const ColorSchemeGroupLabel = () => {
54+
return (
55+
<div className="pf-v6-c-menu__group-title" id="theme-selector-color-scheme-title">
56+
Color scheme
57+
</div>
58+
);
59+
};
60+
61+
const HighContrastGroupLabel = () => {
5462
const [isPopoverOpen, setIsPopoverOpen] = useState(false);
5563

5664
return (
57-
<h2 className="pf-v6-c-menu__group-title">
65+
<div className="pf-v6-c-menu__group-title">
5866
High contrast{' '}
5967
<Popover
68+
onClick={(e) => e.stopPropagation()}
6069
headerContent={"Under development"}
61-
headerComponent="h3"
70+
headerComponent="h1"
6271
bodyContent={
6372
"We are still working to add high contrast support across all PatternFly components and extensions. This beta allows you to preview our progress."
6473
}
@@ -81,7 +90,7 @@ const HCGroupLabel = () => {
8190
/>
8291
</Popover>{' '}&nbsp;
8392
<Label color="blue" isCompact>Beta</Label>
84-
</h2>
93+
</div>
8594
)
8695
};
8796

@@ -144,8 +153,8 @@ export const ThemeSelector = ({ id }) => {
144153
shouldFocusToggleOnSelect
145154
onOpenChangeKeys={['Escape']}
146155
>
147-
<SelectGroup label={'Color scheme'} labelHeadingLevel="h2">
148-
<SelectList aria-label="Light/Dark theme switcher">
156+
<SelectGroup label={ColorSchemeGroupLabel}>
157+
<SelectList aria-labelledby="theme-selector-color-scheme-title">
149158
<SelectOption value={colorModes.SYSTEM} icon={DesktopIcon} description="Follow system preference">
150159
System
151160
</SelectOption>
@@ -159,7 +168,7 @@ export const ThemeSelector = ({ id }) => {
159168
</SelectGroup>
160169
{process.env.hasHighContrastSwitcher && (<>
161170
<Divider />
162-
<SelectGroup label={HCGroupLabel}>
171+
<SelectGroup label={HighContrastGroupLabel}>
163172
<MenuSearch>
164173
<MenuSearchInput>
165174
<ToggleGroup aria-label="High contrast theme switcher">

0 commit comments

Comments
 (0)