Skip to content

Commit

Permalink
docs(preview-examples): show correct style imports (#1437)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielleroux authored Aug 27, 2024
1 parent 4804d54 commit 289cc33
Show file tree
Hide file tree
Showing 554 changed files with 2,210 additions and 1,704 deletions.
2 changes: 2 additions & 0 deletions packages/angular-test-app/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ testem.log
# System files
.DS_Store
Thumbs.db

src/preview-examples/styles
2 changes: 1 addition & 1 deletion packages/angular-test-app/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"karmaConfig": "karma.conf.js",
"inlineStyleLanguage": "scss",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.scss"],
"styles": [],
"scripts": []
}
}
Expand Down
5 changes: 3 additions & 2 deletions packages/angular-test-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --preserve-symlinks -c production",
"copy-preview-styles": "node ./scripts/copy-preview.mjs",
"start": "pnpm copy-preview-styles && ng serve",
"build": "pnpm copy-preview-styles && ng build --preserve-symlinks -c production",
"watch": "ng build --watch --configuration development",
"test": "ng test --no-watch --no-progress --browsers=ChromeHeadlessCI"
},
Expand Down
15 changes: 15 additions & 0 deletions packages/angular-test-app/scripts/copy-preview.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* SPDX-FileCopyrightText: 2024 Siemens AG
*
* SPDX-License-Identifier: MIT
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { copyPreviewStyles } from 'example-styles';
import path from 'path';

const __dirname = path.resolve();

const stylesPath = path.resolve(__dirname, 'src', 'preview-examples', 'styles');
copyPreviewStyles(stylesPath);
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ import { AfterViewInit, Component, ElementRef, ViewChild } from '@angular/core';
@Component({
selector: 'app-example',
templateUrl: './about-and-legal.html',
styles: [
`
@import 'example-styles/dist/application.css';
`,
],
styleUrls: ['./styles/application.css'],
})
export default class AboutAndLegal implements AfterViewInit {
@ViewChild('menu', { read: ElementRef })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { AppSwitchConfiguration } from '@siemens/ix';
@Component({
selector: 'app-example',
templateUrl: './application-app-switch.html',
styles: [`@import 'example-styles/dist/application.css'`],
styleUrls: ['./styles/application.css'],
})
export default class ApplicationAppSwitchExample {
appSwitchConfig: AppSwitchConfiguration = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ import { Breakpoint } from '@siemens/ix';

@Component({
selector: 'app-example',
styles: [
`
@import 'example-styles/dist/application.css';
`,
],
styleUrls: ['./styles/application.css'],
templateUrl: './application-breakpoints.html',
})
export default class ApplicationBreakpointExample {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import { Component } from '@angular/core';
@Component({
selector: 'app-example',
templateUrl: './application.html',
styles: [
`
@import 'example-styles/dist/application.css';
`,
],
styleUrls: ['./styles/application.css'],
})
export default class ApplicationExample {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ import { Component } from '@angular/core';
</ix-menu>
</ix-basic-navigation>
`,
styles: [
`
@import 'example-styles/dist/basic-navigation.css';
`,
],
styleUrls: ['./styles/basic-navigation.css'],
})
export default class BasicNavigation {}
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ import { Component } from '@angular/core';
sit amet.
</ix-blind>
`,
styles: [
`
@import 'example-styles/dist/blind.css';
`,
],
styleUrls: ['./styles/blind.css'],
})
export default class Blind {}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import { Component } from '@angular/core';
@Component({
selector: 'app-example',
templateUrl: './blind-variants.html',
styles: [
`
@import 'example-styles/dist/blind.css';
`,
],
styleUrls: ['./styles/blind.css'],
})
export default class Blind {}
6 changes: 1 addition & 5 deletions packages/angular-test-app/src/preview-examples/blind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import { Component } from '@angular/core';
@Component({
selector: 'app-example',
templateUrl: './blind.html',
styles: [
`
@import 'example-styles/dist/blind.css';
`,
],
styleUrls: ['./styles/blind.css'],
})
export default class Blind {}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import { Component } from '@angular/core';
@Component({
selector: 'app-example',
templateUrl: './button-danger-outline.html',
styles: [
`
@import './buttons.css';
`,
],
styleUrls: ['./styles/buttons.css'],
})
export default class Buttons {}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import { Component } from '@angular/core';
@Component({
selector: 'app-example',
templateUrl: './button-danger.html',
styles: [
`
@import './buttons.css';
`,
],
styleUrls: ['./styles/buttons.css'],
})
export default class Buttons {}
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ import { Component } from '@angular/core';
<ix-button ghost> Button </ix-button>
<ix-button disabled ghost> Button </ix-button>
`,
styles: [
`
@import 'example-styles/dist/buttons.css';
`,
],
styleUrls: ['./styles/buttons.css'],
})
export default class Buttons {}
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ import { Component } from '@angular/core';
@Component({
selector: 'app-example',
template: buttonGreyGhost(),
styles: [
`
@import 'example-styles/dist/buttons.css';
`,
],
styleUrls: ['./styles/buttons.css'],
})
export default class Buttons {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ import { Component } from '@angular/core';
<ix-button outline variant="secondary"> Button </ix-button>
<ix-button disabled outline variant="secondary"> Button </ix-button>
`,
styles: [
`
@import 'example-styles/dist/buttons.css';
`,
],
styleUrls: ['./styles/buttons.css'],
})
export default class Buttons {}
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ import { Component } from '@angular/core';
<ix-button variant="secondary"> Button </ix-button>
<ix-button disabled variant="secondary"> Button </ix-button>
`,
styles: [
`
@import 'example-styles/dist/buttons.css';
`,
],
styleUrls: ['./styles/buttons.css'],
})
export default class Buttons {}
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ import { Component } from '@angular/core';
@Component({
selector: 'app-example',
template: './button-loading.html',
styles: [
`
@import 'example-styles/dist/buttons.css';
`,
],
styleUrls: ['./styles/buttons.css'],
})
export default class ButtonLoading {
loading = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@ import { Component } from '@angular/core';

@Component({
selector: 'app-example',
template: `
<ix-button outline>
Button
</ix-button>
<ix-button disabled outline>
Button
</ix-button>`,
styles: [`@import 'example-styles/dist/buttons.css';`],
template: ` <ix-button outline> Button </ix-button>
<ix-button disabled outline> Button </ix-button>`,
styleUrls: ['./styles/buttons.css'],
})
export default class Buttons {}
25 changes: 7 additions & 18 deletions packages/angular-test-app/src/preview-examples/button-text-icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,12 @@ import { Component } from '@angular/core';

@Component({
selector: 'app-example',
template: buttonTextIcon(),
styles: [`@import 'example-styles/dist/buttons.css';`],
template: `
<ix-button icon="star"> Button </ix-button>
<ix-button variant="secondary" icon="star"> Button </ix-button>
<ix-button outline icon="star"> Button </ix-button>
<ix-button ghost icon="star"> Button </ix-button>
`,
styleUrls: ['./styles/buttons.css'],
})
export default class Buttons {}
function buttonTextIcon(): string | undefined {
return `
<ix-button icon="star">
Button
</ix-button>
<ix-button variant="secondary" icon="star">
Button
</ix-button>
<ix-button outline icon="star">
Button
</ix-button>
<ix-button ghost icon="star">
Button
</ix-button>
`;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ import { Component } from '@angular/core';
@Component({
selector: 'app-example',
templateUrl: './button-with-icon.html',
styles: [`@import 'example-styles/dist/icon-button.css';`],
styleUrls: ['./styles/icon-button.css'],
})
export default class ButtonWithIcon {}
2 changes: 1 addition & 1 deletion packages/angular-test-app/src/preview-examples/buttons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ import { Component } from '@angular/core';
<ix-button>Button</ix-button>
<ix-button disabled>Button</ix-button>
`,
styles: [`@import 'example-styles/dist/buttons.css';`],
styleUrls: ['./styles/buttons.css'],
})
export default class Buttons {}
6 changes: 1 addition & 5 deletions packages/angular-test-app/src/preview-examples/card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ import { Component } from '@angular/core';
@Component({
selector: 'app-example',
templateUrl: './card.html',
styles: [
`
@import 'example-styles/dist/card.css';
`,
],
styleUrls: ['./styles/card.css'],
})
export default class Card {
onClick(event: Event) {
Expand Down
6 changes: 1 addition & 5 deletions packages/angular-test-app/src/preview-examples/chip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ import { Component } from '@angular/core';
</ix-chip>
</div>
`,
styles: [
`
@import 'example-styles/dist/chip.css';
`,
],
styleUrls: ['./styles/chip.css'],
})
export default class Chip {}
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ import { Component } from '@angular/core';

@Component({
selector: 'app-example',
styles: [
`
@import 'example-styles/dist/dropdown-button.css';
`,
],
styleUrls: ['./styles/dropdown-button.css'],
template: `
<div class="dropdown-button">
<ix-dropdown-button label="" icon="checkboxes">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ import { Component } from '@angular/core';
</ix-dropdown-button>
</div>
`,
styles: [
`
@import 'example-styles/dist/dropdown-button.css';
`,
]
styleUrls: ['./styles/dropdown-button.css'],
})
export default class Dropdown {}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { BarSeriesOption, EChartsOption } from 'echarts';
@Component({
selector: 'app-example',
templateUrl: './echarts-bar-horizontal-stacked.html',
styleUrls: ["../../../example-styles/dist/charts.css"],
styleUrls: ['./styles/charts.css'],
})
export default class EchartsBarHorizontalStacked implements OnInit {
theme = convertThemeName(themeSwitcher.getCurrentTheme());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { EChartsOption } from 'echarts';
@Component({
selector: 'app-example',
templateUrl: './echarts-bar-simple.html',
styleUrls: ["../../../example-styles/dist/charts.css"],
styleUrls: ["./styles/charts.css"],
})
export default class EchartsBarSimple implements OnInit {
theme = convertThemeName(themeSwitcher.getCurrentTheme());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { EChartsOption } from 'echarts';
@Component({
selector: 'app-example',
templateUrl: './echarts-circle.html',
styleUrls: ["../../../example-styles/dist/charts.css"],
styleUrls: ["./styles/charts.css"],
})
export default class EchartsCircle implements OnInit {
theme = convertThemeName(themeSwitcher.getCurrentTheme());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { EChartsOption } from 'echarts';
@Component({
selector: 'app-example',
templateUrl: './echarts-empty-state.html',
styleUrls: ["../../../example-styles/dist/charts.css"],
styleUrls: ["./styles/charts.css"],
})
export default class EchartsLineSimple implements OnInit {
theme = convertThemeName(themeSwitcher.getCurrentTheme());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { EChartsOption } from 'echarts';
@Component({
selector: 'app-example',
templateUrl: './echarts-gauge.html',
styleUrls: ["../../../example-styles/dist/charts.css"],
styleUrls: ["./styles/charts.css"],
})
export default class EchartsGauge implements OnInit {
theme = convertThemeName(themeSwitcher.getCurrentTheme());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { EChartsOption } from 'echarts';
@Component({
selector: 'app-example',
templateUrl: './echarts-line-advanced.html',
styleUrls: ["../../../example-styles/dist/charts.css"],
styleUrls: ["./styles/charts.css"],
})
export default class EchartsLineAdvanced implements OnInit {
theme = convertThemeName(themeSwitcher.getCurrentTheme());
Expand Down
Loading

0 comments on commit 289cc33

Please sign in to comment.