Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,31 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- `<ApplicationViewability />`
- component for hiding elements in specific media
- `<InlineText />`
- force children to get displayed as inline content
- force children to get displayed as inline content
- `<NotAvailable />`
- simple placeholder element that can be used to display info about missing data
- `<StringPreviewContentBlobToggler />`
- `useOnly` property: specify if only parts of the content should be used for the shortened preview, this property replaces `firstNonEmptyLineOnly`
- `useOnly` property: specify if only parts of the content should be used for the shortened preview, this property replaces `firstNonEmptyLineOnly`
- `<ContentBlobToggler />`
- `forceInline` property: force inline rendering
- `<ContextMenu />`
- `togglerSize`: replaces the deprecated `togglerLarge` property
- `<MultiSelect />:
- `searchListPredicate` property: Allows to filter the complete list of search options at once.
- Following optional BlueprintJs properties are forwarded now to override default behaviour: `noResults`, `createNewItemRenderer` and `itemRenderer`
- `isValidNewOption` property: Checks if an input string is or can be turned into a valid new option.

### Fixed

- `<Tag />`
- create more whitespace inside `small` tag
- reduce visual impact of border
- `<StringPreviewContentBlobToggler />`
- take Markdown rendering into account before testing the maximum preview length
- take Markdown rendering into account before testing the maximum preview length
- `<NodeContent />`
- header-menu items are vertically centered now
- `<MultiSelect />`:
- border of the BlueprintJS `Tag` elements were fixed

### Changed

Expand All @@ -37,11 +49,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- `<FlexibleLayoutItem />`
- `<GridColumn />`
- `<PropertyName />` and `<PropertyValue />`
- `<MultiSelect />`
- by default, if no searchPredicate or searchListPredicate is defined, the filtering is done via case-insensitive multi-word filtering.

### Deprecated

- `<StringPreviewContentBlobToggler />`
- `firstNonEmptyLineOnly` will be removed, is replaced by `useOnly="firstNonEmptyLine"`
- `firstNonEmptyLineOnly` will be removed, is replaced by `useOnly="firstNonEmptyLine"`
- `<ContextMenu />`
- `togglerLarge`: replaced by the more versatile `togglerSize` property
- `<MultiSelect />`
- `searchPreficate`: replaced by the, in some cases, more efficient `searchListPredicate`

## [25.0.0] - 2025-12-01

Expand Down
15 changes: 11 additions & 4 deletions src/cmem/ContentBlobToggler/ContentBlobToggler.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState } from "react";
import React, { useState} from "react";

import { Link, Spacing } from "../../index";
import { Link, Spacing, InlineText } from "../../index";

export interface ContentBlobTogglerProps extends React.HTMLAttributes<HTMLDivElement> {
/**
Expand Down Expand Up @@ -31,6 +31,10 @@ export interface ContentBlobTogglerProps extends React.HTMLAttributes<HTMLDivEle
Callback if toggler is necessary. Default: true
*/
enableToggler?: boolean;
/**
* Force always inline rendering.
*/
forceInline?: boolean;
}

/** Shows a preview with the option to expand to a full view (and back). */
Expand All @@ -42,6 +46,7 @@ export function ContentBlobToggler({
fullviewContent,
startExtended = false,
enableToggler = true,
forceInline = false,
...otherProps
}: ContentBlobTogglerProps) {
const [isExtended, setViewState] = useState(startExtended);
Expand All @@ -51,7 +56,7 @@ export function ContentBlobToggler({
setViewState(!isExtended);
};

return (
const tooglerDisplay = (
<div className={className} {...otherProps}>
{!isExtended ? (
<>
Expand All @@ -76,7 +81,7 @@ export function ContentBlobToggler({
{fullviewContent}
{enableToggler && (
<div>
<Spacing size="small" />
{forceInline ? <>{" "}</> : <Spacing size="small" />}
<Link
data-test-id={"content-blob-toggler-less-link"}
href="#less"
Expand All @@ -92,4 +97,6 @@ export function ContentBlobToggler({
)}
</div>
);

return forceInline ? <InlineText>{tooglerDisplay}</InlineText> : tooglerDisplay;
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export function StringPreviewContentBlobToggler({
allowedHtmlElementsInPreview,
noTogglerContentSuffix,
firstNonEmptyLineOnly,
...otherContentBlobTogglerProps
}: StringPreviewContentBlobTogglerProps) {
// need to test `firstNonEmptyLineOnly` until property is removed
const useOnlyTest: StringPreviewContentBlobTogglerProps["useOnly"] = firstNonEmptyLineOnly
Expand Down Expand Up @@ -105,6 +106,7 @@ export function StringPreviewContentBlobToggler({
fullviewContent={fullviewContent}
startExtended={startExtended}
enableToggler={enableToggler}
{...otherContentBlobTogglerProps}
/>
);
}
Expand Down
23 changes: 13 additions & 10 deletions src/components/Application/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,22 @@ $shell-header-icon-03: $eccgui-color-applicationheader-text !default;
/// Item link
$shell-header-link: $blue-60 !default;

/// Height
$shell-header-height: mini-units(8) !default;

// load library sub component
@import "~@carbon/react/scss/components/ui-shell/header/index";

// tweak original layout

.#{$prefix}--header {
height: mini-units(8);
height: $shell-header-height;
}

.#{$prefix}--header__action,
.#{$prefix}--header__action.#{$prefix}--btn--icon-only {
width: mini-units(8);
height: mini-units(8);
width: $shell-header-height;
height: $shell-header-height;
padding-block-start: 0;
background-color: transparent;

Expand Down Expand Up @@ -128,7 +131,7 @@ span.#{$prefix}--header__name {
}

.#{$prefix}--header__menu .#{$prefix}--header__menu-item {
height: mini-units(8);
height: $shell-header-height;
}

// tweak original colors (as long as config does not work properly)
Expand Down Expand Up @@ -255,15 +258,15 @@ a.#{$prefix}--header__menu-item:focus > svg {
// adjust position of all other modal dialogs

.#{$ns}-dialog-container {
top: mini-units(8);
left: mini-units(8);
width: calc(100% - #{mini-units(8)});
min-height: calc(100% - #{mini-units(8)});
top: $shell-header-height;
left: $shell-header-height;
width: calc(100% - #{$shell-header-height});
min-height: calc(100% - #{$shell-header-height});
}

.#{$eccgui}-dialog__wrapper {
max-width: calc(100vw - #{mini-units(8)} - #{2 * $eccgui-size-block-whitespace});
max-height: calc(100vh - #{mini-units(8)} - #{2 * $eccgui-size-block-whitespace});
max-width: calc(100vw - #{$shell-header-height} - #{2 * $eccgui-size-block-whitespace});
max-height: calc(100vh - #{$shell-header-height} - #{2 * $eccgui-size-block-whitespace});
margin: 0;
}
}
Expand Down
9 changes: 7 additions & 2 deletions src/components/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,18 @@ export const Button = ({

const ButtonType = restProps.href ? BlueprintAnchorButton : BlueprintButton;

const iconSize = {
small: restProps["size"] === "small",
large: restProps["size"] === "large",
};

const button = (
<ButtonType
{...restProps}
className={`${eccgui}-button ` + className}
intent={(intent || intentByFunction) as BlueprintIntent}
icon={typeof icon === "string" ? <Icon name={icon} /> : icon}
rightIcon={typeof rightIcon === "string" ? <Icon name={rightIcon} /> : rightIcon}
icon={typeof icon === "string" ? <Icon name={icon} {...iconSize} /> : icon}
rightIcon={typeof rightIcon === "string" ? <Icon name={rightIcon} {...iconSize} /> : rightIcon}
>
{children}
{badge && (
Expand Down
10 changes: 8 additions & 2 deletions src/components/ContextOverlay/ContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { ReactElement } from "react";

import { CLASSPREFIX as eccgui } from "../../configuration/constants";
import { ValidIconName } from "../Icon/canonicalIconNames";
import IconButton from "../Icon/IconButton";
import { IconButton, IconButtonProps } from "../Icon/IconButton";
import { TestableComponent } from "../interfaces";
import Menu from "../Menu/Menu";

Expand All @@ -28,8 +28,13 @@ export interface ContextMenuProps extends TestableComponent {
* Text displayed as title or tooltip on toggler element.
*/
togglerText?: string;
/**
* Allow to de- and increase the size of the default toggler button.
*/
togglerSize?: IconButtonProps["size"];
/**
* Toggler element is displayed larger than normal.
* @deprecated (v26) use `togglerSize="large" instead
*/
togglerLarge?: boolean;
/**
Expand Down Expand Up @@ -62,6 +67,7 @@ export const ContextMenu = ({
contextOverlayProps,
disabled,
togglerLarge = false,
togglerSize,
/* FIXME: The Tooltip component can interfere with the opened menu, since it is implemented via portal and may cover the menu,
so by default we use the title attribute instead of Tooltip. */
tooltipAsTitle = true,
Expand All @@ -76,7 +82,7 @@ export const ContextMenu = ({
tooltipAsTitle={tooltipAsTitle}
name={[togglerElement]}
text={togglerText}
large={togglerLarge}
size={togglerLarge ? "large" : togglerSize}
disabled={!!disabled}
data-test-id={dataTestId ?? undefined}
data-testid={dataTestid ?? undefined}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Icon/IconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export const IconButton = ({
swapPlaceholderDelay: 10,
};
const iconProps = {
small: restProps.small,
large: restProps.large,
small: restProps.small || restProps["size"] === "small",
large: restProps.large || restProps["size"] === "large",
tooltipText: tooltipAsTitle ? undefined : text,
tooltipProps: tooltipProps
? {
Expand Down
Loading
Loading