Skip to content

Commit d198818

Browse files
committed
Pull request #67: EOA-5526: Add BICS theme to Colibri
Merge in DEV/colibri-docs from feature/EOA-5526_Add_BICS_Theme_CR to release/current * commit '3e577bfee8dbd0137d01bafba7caa66880b7bb45': EOA-5526: updating 'default' to 'telesign' theme EOA-5526: Updating Pattern stories so they react correctly to theme changes EOA-5526: Adding BICS theme to our docs
2 parents d85fe0b + 3e577bf commit d198818

File tree

13 files changed

+1332
-992
lines changed

13 files changed

+1332
-992
lines changed

.storybook/preview.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export const withThemeProvider: DecoratorFunction<WebComponentsRenderer> = (
171171
const body = document.querySelector('body.sb-show-main');
172172
if (!(body instanceof HTMLElement)) return story();
173173

174-
body.setAttribute('data-theme', theme || 'default');
174+
body.setAttribute('data-theme', theme || 'telesign');
175175
return story();
176176
};
177177

@@ -200,27 +200,27 @@ const preview: Preview = {
200200
storySort: {
201201
order: [
202202
'Welcome',
203-
'Frameworks',
203+
'Framework Integration',
204204
'Foundation',
205205
'Actions',
206+
'Data Visualization',
206207
'Feedback',
207-
'Images & Icons',
208208
'Forms',
209+
'Helpers',
210+
'Images & Icons',
209211
'Layouts',
210212
'Navigation',
211213
'Overlays',
212-
'Titles & Texts',
213-
'Data Visualization',
214-
'Helpers',
215214
'Patterns',
215+
'Titles & Texts',
216216
],
217217
},
218218
},
219219
docs: {
220220
container: (props: any) => {
221221
const { theme } = props.context.store.userGlobals.globals;
222222
const body = document.querySelector('body');
223-
body!.setAttribute('data-theme', theme.toLowerCase() ?? 'default');
223+
body!.setAttribute('data-theme', theme.toLowerCase() ?? 'telesign');
224224

225225
return createElement(DocsContainer, props);
226226
},
@@ -239,12 +239,13 @@ const preview: Preview = {
239239
theme: {
240240
name: 'Theme',
241241
description: 'Theme for Colibri components',
242-
defaultValue: 'default',
242+
defaultValue: 'telesign',
243243
toolbar: {
244244
icon: 'globe',
245245
items: [
246-
{ value: 'default', title: 'Theme: default' },
246+
{ value: 'telesign', title: 'Theme: Telesign' },
247247
{ value: 'massive', title: 'Theme: Massive' },
248+
{ value: 'bics', title: 'Theme: BICS' },
248249
],
249250
dynamicTitle: true,
250251
},

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Our documentation system is built using Storybook, providing an interactive envi
99
- [Overview](#overview)
1010
- [Getting Started](#getting-started)
1111
- [Documentation Structure](#documentation-structure)
12-
- [Writing Documentation](#writing-documentation)
12+
- [Writing Documentation](#writing-documentation)
1313
- [Development](#development)
1414
- [Customization](#customization)
1515
- [Best Practices](#best-practices)
@@ -276,7 +276,7 @@ The system supports theme switching through the `data-theme` attribute:
276276

277277
```typescript
278278
decorators: [
279-
(story, context) => html` <div data-theme=${context.args.mode || 'default'}>${story()}</div> `,
279+
(story, context) => html` <div data-theme=${context.args.mode || 'telesign'}>${story()}</div> `,
280280
];
281281
```
282282

src/_storybook/components/MainLogo/MainLogo.styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const MainLogoStyles = css`
4747
}
4848
4949
/* Theme-specific colors - set via JavaScript */
50-
:host([data-current-theme='default']) {
50+
:host([data-current-theme='telesign']) {
5151
--logo-telesign-color: #011ac2;
5252
--logo-primary-color: #ffffff; /* To be updated to the #011ac2 once UX/UI team fixes the tokens issue */
5353
--logo-dark-color: #ffffff;

src/_storybook/components/MainLogo/MainLogo.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class MainLogo extends LitElement {
5454
return 'massive';
5555
case 'bics':
5656
return 'bics';
57-
case 'default':
57+
case 'telesign':
5858
default:
5959
return 'telesign';
6060
}
@@ -63,14 +63,14 @@ export class MainLogo extends LitElement {
6363
private _getThemeFromContext(): string {
6464
const storybook = document.querySelector('[data-theme]');
6565
if (storybook) {
66-
return storybook.getAttribute('data-theme') || 'default';
66+
return storybook.getAttribute('data-theme') || 'telesign';
6767
}
6868

6969
const body = document.body;
7070
if (body.classList.contains('theme-massive')) return 'massive';
7171
if (body.classList.contains('theme-bics')) return 'bics';
7272

73-
return 'default';
73+
return 'telesign';
7474
}
7575

7676
private async _loadLogo(): Promise<void> {
@@ -158,7 +158,7 @@ export class MainLogo extends LitElement {
158158

159159
private _getCurrentTheme(): string {
160160
const body = document.querySelector('body.sb-show-main');
161-
return body?.getAttribute('data-theme') || 'default';
161+
return body?.getAttribute('data-theme') || 'telesign';
162162
}
163163

164164
private _observeThemeChanges(): void {

0 commit comments

Comments
 (0)