Skip to content

Commit 380c37f

Browse files
committed
Merge branch 'main' into feat/exports-path
2 parents 0592a68 + 1a5343e commit 380c37f

File tree

11 files changed

+137
-87
lines changed

11 files changed

+137
-87
lines changed
104 KB
Loading

docs/knowledge-base/FAQ.mdx

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Meta } from '@storybook/addon-docs/blocks';
22
import { Footer, TableOfContent } from '@sb/components';
33
import { MessageStrip } from '@ui5/webcomponents-react';
44
import SbTagFilter from '@sb/images/sb-pkg-filter.png';
5+
import { Badge } from "@sb/components/Badge.js";
56

67
<Meta title="FAQ" />
78

@@ -25,12 +26,12 @@ import SbTagFilter from '@sb/images/sb-pkg-filter.png';
2526
<br />
2627
<br />
2728

28-
## Where can I find all compatible versions of `@ui5/webcomponents` and `@ui5/webcomponents-react`?
29+
## Where Can I Find All Compatible Versions of `@ui5/webcomponents` and `@ui5/webcomponents-react`?
2930

3031
All necessary `@ui5/webcomponents` packages are `peerDependencies` of `@ui5/webcomponents-react`, so if you're using npm v7 or later, then these dependencies should be auto installed when running `npm install`.
3132
If you want to check which versions are compatible you can find a compatibility table [here](?path=/docs/getting-started--docs#add-ui5webcomponents-react-to-an-existing-app).
3233

33-
## What are "abstract" UI5 Web Components?
34+
## What Are "abstract" UI5 Web Components?
3435

3536
Abstract UI5 Web Components are mainly there to pass props to the actual component inside the shadow root. Therefore, all attributes passed to the element, will have no effect on the actual component.
3637

@@ -59,17 +60,17 @@ Rendering a `ComboBoxItem` with some custom HTML attributes...
5960

6061
As you can see, both `title` and `style` are correctly applied, but since the item doesn't have children, nor a shadow root the attributes don't have an effect on the component.
6162

62-
## How can I style elements inside the shadow root of a web component?
63+
## How Can I Style Elements Inside the Shadow Root of a Web Component?
6364

6465
Styling elements inside the shadow root is only supported by leveraging the [`::part` pseudo-element](https://developer.mozilla.org/en-US/docs/Web/CSS/::part). You can find out more about this [here](?path=/docs/knowledge-base-styling--docs#css-shadow-parts).
6566

66-
## How can I reuse or change colors, fonts, etc. of UI5 Web Components for React?
67+
## How Can I Reuse or Change Colors, Fonts, etc. of UI5 Web Components for React?
6768

6869
UI5 Web Components for React comes with a [publicly available](https://github.com/SAP/theming-base-content) set of CSS variables that ensure the same look and feel across applications. Changing these values is not recommended, if you still need to customize them, you can find out more about this [here](?path=/docs/knowledge-base-styling--docs#styling-ui5-web-components-for-react-components).
6970

7071
To reuse these styles, you can either use the CSS variable, or use our [Theming Parameters](?path=/docs/knowledge-base-public-utils--docs#theming-parameters).
7172

72-
## Why is changing the theme not working?
73+
## Why Is Changing the Theme Not Working?
7374

7475
You have to ensure to import the `Assets` with the different themes, otherwise only the default theme will be used.
7576

@@ -79,19 +80,25 @@ import '@ui5/webcomponents-react/dist/Assets';
7980

8081
Further information about theming can be found in our and the UI5 Web Components [Theming documentation](?path=/docs/getting-started--docs#theming).
8182

82-
## How can I distinguish if a component is developed in the `ui5-webcomponents` or `ui5-webcomponents-react` repo?
83+
## How Can I Distinguish If a Component Is Developed in the `ui5-webcomponents` or `ui5-webcomponents-react` Repo?
8384

8485
Each component developed by the UI5 Web Components team ([`ui5-webcomponents`](https://github.com/SAP/ui5-webcomponents)) that is wrapped by the UI5 Web Components for React ([`ui5-webcomponents-react`](https://github.com/SAP/ui5-webcomponents-react)) wrapper includes the following note in its component description:
8586

86-
**Note**: This is a UI5 Web Component! [Repository](https://github.com/SAP/ui5-webcomponents) | [Documentation](https://sap.github.io/ui5-webcomponents/)
87+
> **Note**: This is a UI5 Web Component! [Repository](https://github.com/SAP/ui5-webcomponents) | [Documentation](https://sap.github.io/ui5-webcomponents/)
8788
8889
If a component does not have this note, it is a React-only component provided exclusively by `ui5-webcomponents-react`.
8990

90-
Additionally, Storybook supports filtering by tags, allowing you to filter by different `ui5-webcomponents` packages as well:
91+
Additionally, Storybook supports filtering by tags, allowing you to filter by different `ui5-webcomponents(-react)` packages as well:
9192

92-
<img src={SbTagFilter} alt="Storybook Tag Filter" height={320} />
93+
<img src={SbTagFilter} alt="Storybook Tag Filter" height={420} />
9394

94-
## Why isn't scoping working?
95+
## What Do the Badges in the Side Navigation Mean?
96+
97+
- <Badge type="custom" />: There are no global design or UX specifications for this component, or it deviates from them partially or fully. More details can be found in the component’s description.
98+
- <Badge type="experimental" />: The component or pattern is in an experimental state, meaning changes to its public API may occur without a major version update (`v3.0.0`).
99+
- <Badge type="deprecated" />: The component is deprecated and will be removed in the next major version update (`v3.0.0`). More details can be found in the component's description.
100+
101+
## Why Isn't Scoping Working?
95102

96103
Starting from UI5 Web Components (for React) 2.0.0, the order of imports with regard to scoping and components matters.
97104
Setting the scoping suffix must be done before importing any components, as they use the suffix at the top-level of the module - meaning when a component is imported, the suffix has to be known.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"@vitejs/plugin-react": "4.7.0",
7171
"chromatic": "13.1.3",
7272
"cssnano": "7.1.1",
73-
"cypress": "14.5.4",
73+
"cypress": "15.0.0",
7474
"cypress-real-events": "1.14.0",
7575
"dedent": "1.6.0",
7676
"documentation": "14.0.3",

packages/charts/src/components/ScatterChart/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export interface ScatterChartProps extends Omit<IChartBaseProps<IScatterChartCon
103103
* </code>
104104
*/
105105
dataset?: ScatterDataObject[];
106+
//todo: use object instead of array (next major release)
106107
/**
107108
* An array of config objects. Each object is defining one axis in the chart.
108109
*
@@ -115,7 +116,7 @@ export interface ScatterChartProps extends Omit<IChartBaseProps<IScatterChartCon
115116
* - `label`: Label to display in tooltips. Falls back to the <code>accessor</code> if not present.
116117
* - `formatter`: function will be called for each data label and allows you to format it according to your needs. Also addresses labels of axis.
117118
*/
118-
measures?: MeasureConfig[];
119+
measures: [MeasureConfig, MeasureConfig, MeasureConfig, ...MeasureConfig[]];
119120
}
120121

121122
const measureDefaults = {
@@ -316,7 +317,6 @@ const ScatterChart = forwardRef<HTMLDivElement, ScatterChartProps>((props, ref)
316317
label={referenceLineX?.label}
317318
/>
318319
)}
319-
{/*ToDo: remove conditional rendering once `active` is working again (https://github.com/recharts/recharts/issues/2703)*/}
320320
{tooltipConfig?.active !== false && (
321321
<Tooltip
322322
cursor={tooltipFillOpacity}

packages/cypress-commands/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"peerDependencies": {
2626
"@ui5/webcomponents": "~2.13.1",
2727
"@ui5/webcomponents-base": "~2.13.1",
28-
"cypress": "^12 || ^13 || ^14"
28+
"cypress": "^12 || ^13 || ^14 || ^15"
2929
},
3030
"peerDependenciesMeta": {
3131
"@ui5/webcomponents": {

packages/main/src/components/MessageView/MessageView.cy.tsx

Lines changed: 60 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Link } from '@ui5/webcomponents-react';
44
import { useRef } from 'react';
55
import { MessageItem } from './MessageItem';
66
import { MessageView } from './index.js';
7+
import { Dialog } from '../../webComponents/Dialog/index.js';
78

89
describe('MessageView', () => {
910
it('default & grouped', () => {
@@ -80,54 +81,64 @@ describe('MessageView', () => {
8081
getAllTextsVisible();
8182
});
8283

83-
it('select & nav back', () => {
84-
const select = cy.spy().as('select');
85-
const TestComp = () => {
86-
const ref = useRef(null);
87-
return (
88-
<>
89-
<button
90-
onClick={() => {
91-
ref.current.navigateBack();
92-
}}
93-
>
94-
nav back
95-
</button>
96-
<MessageView onItemSelect={select} ref={ref} showDetailsPageHeader>
97-
<MessageItem titleText="Error" type={ValueState.Negative} groupName="Group1">
98-
Error Message
99-
</MessageItem>
100-
<MessageItem titleText="Warning" type={ValueState.Critical} groupName="Group1">
101-
Warning
102-
</MessageItem>
103-
<MessageItem titleText="Success" type={ValueState.Positive}>
104-
Success
105-
</MessageItem>
106-
<MessageItem titleText="Information" type={ValueState.Information}>
107-
Information Message
108-
</MessageItem>
109-
<MessageItem titleText="None" type={ValueState.None} groupName="Group2">
110-
None
111-
</MessageItem>
112-
</MessageView>
113-
</>
114-
);
115-
};
116-
cy.mount(<TestComp />);
117-
cy.findByText('Error').click();
118-
cy.findAllByText('Error').should('have.length', 1);
119-
cy.findByText('Error Message').should('be.visible');
120-
cy.get('[ui5-button]').click();
121-
cy.findAllByText('Error').should('have.length', 1);
122-
cy.findByText('Error Message').should('not.exist');
123-
cy.get('@select').should('have.been.calledOnce');
124-
cy.findByText('Information').click();
125-
cy.findAllByText('Information').should('have.length', 1);
126-
cy.findByText('Information Message').should('be.visible');
127-
cy.findByText('nav back').click();
128-
cy.findAllByText('Information').should('have.length', 1);
129-
cy.findByText('Information Message').should('not.exist');
130-
cy.get('@select').should('have.been.calledTwice');
84+
[false, true].forEach((inDialog) => {
85+
['ltr', 'rtl'].forEach((dir) => {
86+
it(`select & nav back ${inDialog ? 'in Dialog' : ''} (${dir})`, () => {
87+
const select = cy.spy().as('select');
88+
const TestComp = () => {
89+
const ref = useRef(null);
90+
const Parent = inDialog ? Dialog : 'div';
91+
return (
92+
<Parent dir={dir} open style={{ width: '400px' }}>
93+
<button
94+
slot="header"
95+
onClick={() => {
96+
ref.current.navigateBack();
97+
}}
98+
>
99+
nav back
100+
</button>
101+
<MessageView onItemSelect={select} ref={ref} showDetailsPageHeader={!inDialog}>
102+
<MessageItem titleText="Error" type={ValueState.Negative} groupName="Group1">
103+
Error Message
104+
</MessageItem>
105+
<MessageItem titleText="Warning" type={ValueState.Critical} groupName="Group1">
106+
Warning
107+
</MessageItem>
108+
<MessageItem titleText="Success" type={ValueState.Positive}>
109+
Success
110+
</MessageItem>
111+
<MessageItem titleText="Information" type={ValueState.Information}>
112+
Information Message
113+
</MessageItem>
114+
<MessageItem titleText="None" type={ValueState.None} groupName="Group2">
115+
None
116+
</MessageItem>
117+
</MessageView>
118+
</Parent>
119+
);
120+
};
121+
cy.mount(<TestComp />);
122+
cy.findByText('Error').click();
123+
cy.findAllByText('Error').should('have.length', 1);
124+
cy.findByText('Error Message').should('be.visible');
125+
if (inDialog) {
126+
cy.findByText('nav back').click();
127+
} else {
128+
cy.get('[ui5-button]').click();
129+
}
130+
cy.findAllByText('Error').should('have.length', 1);
131+
cy.findByText('Error Message').should('not.exist');
132+
cy.get('@select').should('have.been.calledOnce');
133+
cy.findByText('Information').click();
134+
cy.findAllByText('Information').should('have.length', 1);
135+
cy.findByText('Information Message').should('be.visible');
136+
cy.findByText('nav back').click();
137+
cy.findAllByText('Information').should('have.length', 1);
138+
cy.findByText('Information Message').should('not.exist');
139+
cy.get('@select').should('have.been.calledTwice');
140+
});
141+
});
131142
});
132143

133144
it('one/no message-type/item', () => {
@@ -168,7 +179,7 @@ describe('MessageView', () => {
168179
// remaining props were already tested
169180
cy.findByText('SubtitleText').should('be.visible');
170181
cy.findByText('1337').should('be.visible');
171-
cy.get('[name="slim-arrow-right"]').should('be.visible').click();
182+
cy.get('[name="slim-arrow-right"]').should('be.visible').realClick();
172183
cy.findByText('SubtitleText').should('not.exist');
173184
cy.findByText('1337').should('not.exist');
174185
});

packages/main/src/components/MessageView/MessageView.module.css

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,22 @@
88
> * {
99
width: 100%;
1010
flex-shrink: 0;
11-
transition: transform 200ms ease-in-out;
11+
transition:
12+
transform 200ms ease-in-out,
13+
opacity 300ms ease-in-out;
1214
}
1315
}
1416

15-
.showDetails {
16-
> * {
17-
transform: translateX(-100%);
18-
}
17+
.container[data-with-animation='false'] > * {
18+
transition: none;
19+
}
20+
21+
.showDetails > * {
22+
transform: translateX(-100%);
23+
}
24+
25+
:dir(rtl) .showDetails > * {
26+
transform: translateX(100%);
1927
}
2028

2129
.button {

packages/main/src/components/MessageView/index.tsx

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import ButtonDesign from '@ui5/webcomponents/dist/types/ButtonDesign.js';
44
import ListSeparator from '@ui5/webcomponents/dist/types/ListSeparator.js';
55
import TitleLevel from '@ui5/webcomponents/dist/types/TitleLevel.js';
66
import WrappingType from '@ui5/webcomponents/dist/types/WrappingType.js';
7+
import { getAnimationMode } from '@ui5/webcomponents-base/dist/config/AnimationMode.js';
78
import ValueState from '@ui5/webcomponents-base/dist/types/ValueState.js';
89
import announce from '@ui5/webcomponents-base/dist/util/InvisibleMessage.js';
910
import iconSlimArrowLeft from '@ui5/webcomponents-icons/dist/slim-arrow-left.js';
@@ -64,6 +65,8 @@ export interface MessageViewPropTypes extends CommonProps {
6465
onItemSelect?: ListPropTypes['onItemClick'];
6566
}
6667

68+
const withAnimation = getAnimationMode() !== 'none';
69+
6770
export const resolveMessageTypes = (children: ReactElement<MessageItemPropTypes>[]) => {
6871
return (children ?? [])
6972
.map((message) => message?.props?.type)
@@ -178,7 +181,7 @@ const MessageView = forwardRef<MessageViewDomRef, MessageViewPropTypes>((props,
178181
const selectedItem = listRef.current.querySelector<Ui5DomRef>(
179182
`[data-title="${CSS.escape(prevSelectedMessage.current.titleTextStr)}"]`,
180183
);
181-
void selectedItem.focus();
184+
void selectedItem?.focus();
182185
});
183186
}
184187
transitionTrigger.current = null;
@@ -193,13 +196,22 @@ const MessageView = forwardRef<MessageViewDomRef, MessageViewPropTypes>((props,
193196

194197
const outerClasses = clsx(classNames.container, className, selectedMessage && classNames.showDetails);
195198
return (
196-
<div ref={componentRef} {...rest} className={outerClasses} onTransitionEnd={handleTransitionEnd}>
199+
<div
200+
ref={componentRef}
201+
{...rest}
202+
className={outerClasses}
203+
onTransitionEnd={handleTransitionEnd}
204+
data-with-animation={`${withAnimation}`}
205+
>
197206
<MessageViewContext.Provider
198207
value={{
199208
selectMessage: setSelectedMessage,
200209
}}
201210
>
202-
<div style={{ visibility: selectedMessage ? 'hidden' : 'visible' }} className={classNames.messagesContainer}>
211+
<div
212+
style={{ visibility: selectedMessage ? 'hidden' : 'visible', opacity: selectedMessage ? 0.3 : 1 }}
213+
className={classNames.messagesContainer}
214+
>
203215
{!selectedMessage && (
204216
<>
205217
{filledTypes > 1 && (
@@ -257,7 +269,11 @@ const MessageView = forwardRef<MessageViewDomRef, MessageViewPropTypes>((props,
257269
</>
258270
)}
259271
</div>
260-
<div className={classNames.detailsContainer} data-component-name="MessageViewDetailsContainer">
272+
<div
273+
className={classNames.detailsContainer}
274+
style={{ opacity: selectedMessage ? 1 : 0.3 }}
275+
data-component-name="MessageViewDetailsContainer"
276+
>
261277
{childrenArray.length > 0 ? (
262278
<>
263279
{showDetailsPageHeader && selectedMessage && (

packages/main/src/components/ObjectPage/ObjectPage.cy.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ describe('ObjectPage', () => {
431431
cy.findByTestId('footer').should('be.visible');
432432

433433
// Select Employment tab
434-
cy.get('[ui5-tabcontainer]').findUi5TabByText('Goals').click();
434+
cy.get('[ui5-tabcontainer]').findUi5TabByText('Goals').focus();
435435
cy.get('[ui5-tabcontainer]').realPress('ArrowRight');
436436
cy.get('[ui5-tabcontainer]').realPress('ArrowRight');
437437
cy.get('[ui5-tabcontainer]').realPress('ArrowRight');

templates/nextjs-pages/package-lock.json

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)