Compare commits

...
Author SHA1 Message Date
Robin 4362f7ea89 Update design of layout switch options 2026-12-03 10:29:53 -05:00
Robin 38e9696d22 Stop using deprecated hideChevron prop 2026-12-03 10:27:29 -05:00
Robin 2cf05335af Update Compound Web to 10.8.0 2026-12-03 10:26:57 -05:00
6 changed files with 28 additions and 17 deletions
+1 -1
View File
@@ -91,7 +91,7 @@
"@typescript-eslint/utils": "^8.61.0",
"@use-gesture/react": "^10.2.11",
"@vector-im/compound-design-tokens": "^11.0.0",
"@vector-im/compound-web": "^10.5.0",
"@vector-im/compound-web": "^10.8.0",
"@vitejs/plugin-react": "^6.0.2",
"@vitest/browser-playwright": "^4.1.5",
"@vitest/coverage-v8": "^4.0.18",
+5 -5
View File
@@ -133,8 +133,8 @@ importers:
specifier: ^11.0.0
version: 11.3.1(@types/react@19.3.3)(react@19.3.1)
'@vector-im/compound-web':
specifier: ^10.5.0
version: 10.7.0(@fontsource/inconsolata@5.3.0)(@fontsource/inter@5.3.0)(@types/react-dom@19.3.0(@types/react@19.3.3))(@types/react@19.3.3)(@vector-im/compound-design-tokens@11.3.1(@types/react@19.3.3)(react@19.3.1))(react-dom@19.3.1(react@19.3.1))(react@19.3.1)
specifier: ^10.8.0
version: 10.8.0(@fontsource/inconsolata@5.3.0)(@fontsource/inter@5.3.0)(@types/react-dom@19.3.0(@types/react@19.3.3))(@types/react@19.3.3)(@vector-im/compound-design-tokens@11.3.1(@types/react@19.3.3)(react@19.3.1))(react-dom@19.3.1(react@19.3.1))(react@19.3.1)
'@vitejs/plugin-react':
specifier: ^6.0.2
version: 6.3.0(@rolldown/plugin-babel@0.3.1(@babel/core@7.29.16(supports-color@7.2.0))(@babel/runtime@8.0.8)(rolldown@1.2.19)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.8(@types/node@26.6.11)(esbuild@0.28.2)(jiti@2.7.0)(sass@1.108.2)(terser@5.46.1)(yaml@2.9.1))
@@ -3273,8 +3273,8 @@ packages:
react:
optional: true
'@vector-im/compound-web@10.7.0':
resolution: {integrity: sha512-WP6/TcfxD2tuD8bw9FVAWIIGUti1WHKdojnble3MJmkC6fGRuEtl0p4Cz8ctmHY4XNkNKGGp5Nlax/Csry86IQ==}
'@vector-im/compound-web@10.8.0':
resolution: {integrity: sha512-DSrAiTVAtrg0+3IwY5oguhWDdZ1m+96O/bySxF0St7+TNP7L6fvzc80QFNUmJtNUTMSgNFcbvEEPtvksi0w3fQ==}
peerDependencies:
'@fontsource/inconsolata': ^5
'@fontsource/inter': ^5
@@ -8623,7 +8623,7 @@ snapshots:
'@types/react': 19.3.3
react: 19.3.1
'@vector-im/compound-web@10.7.0(@fontsource/inconsolata@5.3.0)(@fontsource/inter@5.3.0)(@types/react-dom@19.3.0(@types/react@19.3.3))(@types/react@19.3.3)(@vector-im/compound-design-tokens@11.3.1(@types/react@19.3.3)(react@19.3.1))(react-dom@19.3.1(react@19.3.1))(react@19.3.1)':
'@vector-im/compound-web@10.8.0(@fontsource/inconsolata@5.3.0)(@fontsource/inter@5.3.0)(@types/react-dom@19.3.0(@types/react@19.3.3))(@types/react@19.3.3)(@vector-im/compound-design-tokens@11.3.1(@types/react@19.3.3)(react@19.3.1))(react-dom@19.3.1(react@19.3.1))(react@19.3.1)':
dependencies:
'@floating-ui/react': 0.27.20(react-dom@19.3.1(react@19.3.1))(react@19.3.1)
'@floating-ui/react-dom': 2.1.9(react-dom@19.3.1(react@19.3.1))(react@19.3.1)
-2
View File
@@ -112,7 +112,6 @@ export const BackgroundEffectGrid: FC<Props> = ({
disabled={disabled}
data-disabled={disabled ? "" : undefined}
label={null}
hideChevron
className={styles.tile}
// Without a handler it isn't one of the menu's items, so the keyboard
// passes over it.
@@ -160,7 +159,6 @@ export const BackgroundEffectGrid: FC<Props> = ({
onAdd === undefined ? null : (
<MenuItem
label={null}
hideChevron
className={styles.tile}
onSelect={(e) => {
e.preventDefault();
@@ -368,7 +368,6 @@ export const MediaMuteAndSwitchButton: FC<MediaMuteAndSwitchButtonProps> = ({
<MenuItem
// A radio input may not sit inside a button.
as="div"
hideChevron
disabled={disabled}
label={labelText(label, numbered)}
Icon={
+22 -7
View File
@@ -5,15 +5,25 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE in the repository root for full details.
*/
import { type ReactNode, useState, type FC } from "react";
import {
type ReactNode,
useState,
type FC,
type ComponentType,
type SVGAttributes,
} from "react";
import { useTranslation } from "react-i18next";
import { Menu, OptionMenuItem } from "@vector-im/compound-web";
import {
GridIcon,
SpotlightViewIcon,
} from "@vector-im/compound-design-tokens/assets/web/icons";
import {
type LayoutMode,
type LayoutSwitchViewModel,
} from "../state/LayoutSwitchViewModel";
import { useBehavior } from "../useBehavior";
import { useTranslation } from "react-i18next";
import { Menu, RadioMenuItem } from "@vector-im/compound-web";
import { LayoutSwitchButton } from "../button";
interface LayoutSwitchProps {
@@ -27,9 +37,14 @@ export const LayoutSwitch: FC<LayoutSwitchProps> = ({ vm, ...props }) => {
const layout = useBehavior(vm.layout$);
const [open, setOpen] = useState(false);
const menuItem = (label: string, value: LayoutMode): ReactNode => (
<RadioMenuItem
const menuItem = (
value: LayoutMode,
label: string,
Icon: ComponentType<SVGAttributes<SVGElement>>,
): ReactNode => (
<OptionMenuItem
label={label}
Icon={Icon}
checked={layout === value}
onSelect={() => vm.setLayout(value)}
/>
@@ -42,8 +57,8 @@ export const LayoutSwitch: FC<LayoutSwitchProps> = ({ vm, ...props }) => {
onOpenChange={setOpen}
trigger={<LayoutSwitchButton layout={layout} {...props} />}
>
{menuItem(t("layout_grid_label"), "grid")}
{menuItem(t("layout_spotlight_label"), "spotlight")}
{menuItem("grid", t("layout_grid_label"), GridIcon)}
{menuItem("spotlight", t("layout_spotlight_label"), SpotlightViewIcon)}
</Menu>
);
};
-1
View File
@@ -359,7 +359,6 @@ const ScreenShareVolumeButton: FC<ScreenShareVolumeButtonProps> = ({ vm }) => {
className={styles.volumeMenuItem}
onSelect={null}
label={null}
hideChevron={true}
>
<button className={styles.menuMuteButton} onClick={onMuteButtonClick}>
<VolumeIcon aria-hidden width={24} height={24} />