Skip to content

Commit 933e172

Browse files
authored
docs: introduce (UXC) "patterns" section & add design examples for ShellBar (#7411)
1 parent fff9fb9 commit 933e172

39 files changed

+5383
-29
lines changed

.github/renovate.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,21 @@
7272
]
7373
},
7474
{
75-
"description": "Example & Template dependencies",
75+
"description": "Example,Template & Pattern dependencies",
7676
"extends": ["schedule:weekly"],
77-
"matchFileNames": ["examples/**", "templates/**"],
77+
"matchFileNames": ["examples/**", "templates/**", "patterns/**"],
7878
"semanticCommitType": "chore",
79-
"groupName": "all non-major dependencies (examples & templates)",
79+
"groupName": "all non-major dependencies (examples, templates & patterns)",
8080
"groupSlug": "examples-all-minor-patch",
8181
"matchUpdateTypes": ["minor", "patch"],
8282
"matchBaseBranches": ["main"],
8383
"matchPackageNames": ["*", "!/^@ui5//"]
8484
},
8585
{
86-
"description": "UI5 Web Components (for React) in all examples & templates",
87-
"groupName": "UI5 Web Components React (examples & templates)",
86+
"description": "UI5 Web Components (for React) in all examples, templates & patterns",
87+
"groupName": "UI5 Web Components React (examples, templates & patterns)",
8888
"groupSlug": "examples-ui5-webcomponents-react",
89-
"matchFileNames": ["examples/**", "templates/**"],
89+
"matchFileNames": ["examples/**", "templates/**", "patterns/**"],
9090
"semanticCommitType": "chore",
9191
"matchBaseBranches": ["main"],
9292
"matchSourceUrls": [

.github/workflows/examples.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ on:
77
paths:
88
- 'examples/**/*'
99
- 'templates/**/*'
10+
- 'patterns/navigation-layout/**/*'
1011
pull_request:
1112
paths:
1213
- 'examples/**/*'
1314
- 'templates/**/*'
15+
- 'patterns/navigation-layout/**/*'
1416

1517
jobs:
1618
examples:
@@ -77,3 +79,33 @@ jobs:
7779
- name: ESLint
7880
run: npm run lint --if-present
7981
working-directory: templates/${{ matrix.path }}
82+
83+
patterns:
84+
runs-on: ubuntu-latest
85+
strategy:
86+
matrix:
87+
path:
88+
- navigation-layout
89+
fail-fast: false
90+
steps:
91+
- uses: actions/checkout@v4
92+
93+
- uses: actions/setup-node@v4.4.0
94+
with:
95+
node-version-file: '.nvmrc'
96+
97+
- name: Install
98+
run: npm ci
99+
working-directory: patterns/${{ matrix.path }}
100+
101+
- name: Build
102+
run: npm run build
103+
working-directory: patterns/${{ matrix.path }}
104+
105+
- name: Test
106+
run: npm run test --if-present
107+
working-directory: patterns/${{ matrix.path }}
108+
109+
- name: ESLint
110+
run: npm run lint --if-present
111+
working-directory: patterns/${{ matrix.path }}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Design-Compliant Examples
2+
3+
These examples demonstrate the implementation of design specifications. They primarily illustrate design concepts and mostly do not provide additional functionality. You can reference them to select the appropriate design patterns.

.storybook/preview.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ const preview: Preview = {
144144
'Knowledge Base',
145145
'Testing with Cypress',
146146
['Setup', 'Commands', 'Queries'],
147+
'Patterns',
147148
'Charts',
148149
['Docs'],
149150
'Data Display',

docs/EmbeddedStackBlitz.tsx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import sdk from '@stackblitz/sdk';
2+
import { useEffect, useRef } from 'react';
3+
4+
interface EmbeddedStackBlitzProps {
5+
repoPath: string;
6+
}
7+
8+
export function EmbeddedStackBlitz({ repoPath }: EmbeddedStackBlitzProps) {
9+
const containerRef = useRef<HTMLDivElement | null>(null);
10+
11+
useEffect(() => {
12+
const container = containerRef.current;
13+
if (!container) {
14+
return;
15+
}
16+
sdk.embedGithubProject(container, repoPath, {
17+
openFile: 'src/App.tsx',
18+
view: 'editor',
19+
height: '90%',
20+
hideDevTools: true,
21+
terminalHeight: 0,
22+
});
23+
24+
return () => {
25+
if (container) {
26+
container.innerHTML = '';
27+
}
28+
};
29+
}, [repoPath]);
30+
31+
return <div ref={containerRef} />;
32+
}
33+
34+
EmbeddedStackBlitz.displayName = 'EmbeddedStackBlitz';

docs/Patterns.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import {Footer} from '@sb/components';
2+
import {Meta} from '@storybook/blocks';
3+
import UXCIntegration from "./UXCIntegration.js"
4+
5+
<Meta title="Patterns / UXC Integration"/>
6+
7+
# UXC Integration
8+
9+
<UXCIntegration/>
10+
11+
<Footer/>

docs/UXCIntegration.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { MessageStrip, ThemeProvider } from '@ui5/webcomponents-react';
2+
import UXCIntegrationApp from '../patterns/navigation-layout/src/App.js';
3+
import '../patterns/navigation-layout/src/index.css';
4+
import { EmbeddedStackBlitz } from '@/docs/EmbeddedStackBlitz.js';
5+
6+
function UXCIntegration() {
7+
return (
8+
<div style={{ height: '80vh', position: 'relative' }}>
9+
<ThemeProvider>
10+
<UXCIntegrationApp
11+
content={
12+
<>
13+
<MessageStrip hideCloseButton style={{ marginBlockEnd: '0.25rem' }}>
14+
For a full-page view of this pattern, click <b>&#34;Fork on StackBlitz&#34;</b> below to open it in the
15+
standalone StackBlitz editor.
16+
</MessageStrip>
17+
<EmbeddedStackBlitz repoPath="SAP/ui5-webcomponents-react/tree/main/patterns/navigation-layout" />
18+
</>
19+
}
20+
/>
21+
</ThemeProvider>
22+
</div>
23+
);
24+
}
25+
26+
export default UXCIntegration;

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ const ignorePatterns = {
3030
'**/out/**',
3131
'**/examples',
3232
'**/templates',
33+
'**/patterns/navigation-layout',
3334
],
3435
};
3536

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"create-theming-parameters": "node scripts/generate-theming-parameters.js"
3636
},
3737
"dependencies": {
38+
"@stackblitz/sdk": "^1.11.0",
3839
"@storybook/addon-a11y": "8.6.14",
3940
"@storybook/addon-essentials": "8.6.14",
4041
"@storybook/blocks": "8.6.14",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export interface MessageBoxPropTypes
4949
* Flag whether the Message Box should be opened or closed
5050
*/
5151
open?: DialogPropTypes['open'];
52+
// todo: add headerText prop and deprecate `titleText`
5253
/**
5354
* A custom title for the MessageBox. If not present, it will be derived from the `MessageBox` type.
5455
*/

0 commit comments

Comments
 (0)