Skip to content

Commit b06bec7

Browse files
committed
add togglerSize property
1 parent dcdbc36 commit b06bec7

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
2020
- `forceInline` property: force inline rendering
2121
- `<MultiSuggestField />`:
2222
- `isValidNewOption` property: Checks if an input string is or can be turned into a valid new option.
23+
- `<ContextMenu />`
24+
- `togglerSize`: replaces the deprecated `togglerLarge` property
2325

2426
### Fixed
2527

@@ -50,6 +52,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
5052

5153
- `<StringPreviewContentBlobToggler />`
5254
- `firstNonEmptyLineOnly` will be removed, is replaced by `useOnly="firstNonEmptyLine"`
55+
- `<ContextMenu />`
56+
- `togglerLarge`: replaced by the more versatile `togglerSize` property
5357

5458
## [25.0.0] - 2025-12-01
5559

src/components/ContextOverlay/ContextMenu.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { ReactElement } from "react";
22

33
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
44
import { ValidIconName } from "../Icon/canonicalIconNames";
5-
import IconButton from "../Icon/IconButton";
5+
import { IconButton, IconButtonProps } from "../Icon/IconButton";
66
import { TestableComponent } from "../interfaces";
77
import Menu from "../Menu/Menu";
88

@@ -28,8 +28,13 @@ export interface ContextMenuProps extends TestableComponent {
2828
* Text displayed as title or tooltip on toggler element.
2929
*/
3030
togglerText?: string;
31+
/**
32+
* Allow to de- and increase the size of the default toggler button.
33+
*/
34+
togglerSize?: IconButtonProps["size"];
3135
/**
3236
* Toggler element is displayed larger than normal.
37+
* @deprecated (v26) use `togglerSize="large" instead
3338
*/
3439
togglerLarge?: boolean;
3540
/**
@@ -62,6 +67,7 @@ export const ContextMenu = ({
6267
contextOverlayProps,
6368
disabled,
6469
togglerLarge = false,
70+
togglerSize,
6571
/* FIXME: The Tooltip component can interfere with the opened menu, since it is implemented via portal and may cover the menu,
6672
so by default we use the title attribute instead of Tooltip. */
6773
tooltipAsTitle = true,
@@ -76,7 +82,7 @@ export const ContextMenu = ({
7682
tooltipAsTitle={tooltipAsTitle}
7783
name={[togglerElement]}
7884
text={togglerText}
79-
large={togglerLarge}
85+
size={togglerLarge ? "large" : togglerSize}
8086
disabled={!!disabled}
8187
data-test-id={dataTestId ?? undefined}
8288
data-testid={dataTestid ?? undefined}

0 commit comments

Comments
 (0)