AAE-40269 Add storybook v10 (#11401)

This commit is contained in:
Wojciech Duda
2026-01-09 18:17:43 +00:00
committed by GitHub
parent f0c6cc0ff7
commit 5f9de1fde8
119 changed files with 11010 additions and 753 deletions
+36
View File
@@ -0,0 +1,36 @@
import type { StorybookConfig } from '@storybook/angular';
import rootMain from '../../../.storybook/main';
import { dirname } from 'path';
import { fileURLToPath } from 'url';
const config: StorybookConfig = {
...rootMain,
framework: {
name: getAbsolutePath('@storybook/angular'),
options: {}
},
stories: ['../../core/**/*.stories.ts', '../../content-services/**/*.stories.ts', '../../process-services-cloud/**/*.stories.ts'],
staticDirs: [
{ from: '../../core/src/lib/i18n', to: 'assets/adf-core/i18n' },
{ from: '../../core/src/lib/assets/images', to: 'assets/images' },
{ from: '../../content-services/src/lib/i18n', to: 'assets/adf-content-services/i18n' },
{ from: '../../process-services/src/lib/i18n', to: 'assets/adf-process-services/i18n' },
{ from: '../../process-services-cloud/src/lib/i18n', to: 'assets/adf-process-services-cloud/i18n' },
{ from: '../../config/app.config.json', to: 'app.config.json' }
],
addons: ['@storybook/addon-themes'],
webpackFinal: async (config) => {
if (config.performance) {
config.performance.hints = false;
} else {
config.performance = { hints: false };
}
return config;
}
};
export default config;
function getAbsolutePath(value: string): any {
return dirname(fileURLToPath(import.meta.resolve(`${value}/package.json`)));
}
+34
View File
@@ -0,0 +1,34 @@
import { type Preview, type AngularRenderer, moduleMetadata } from '@storybook/angular';
import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
import { withThemeByClassName } from '@storybook/addon-themes';
const preview: Preview = {
parameters: {
docs: { inlineStories: true },
controls: { expanded: true },
layout: 'centered'
},
decorators: [
moduleMetadata({
providers: [
{
provide: MAT_FORM_FIELD_DEFAULT_OPTIONS,
useValue: {
appearance: 'outline'
}
}
]
}),
withThemeByClassName<AngularRenderer>({
themes: {
light: 'adf-storybook-light-theme',
dark: 'adf-storybook-dark-theme'
},
defaultTheme: 'light',
parentSelector: 'html'
})
],
tags: ['autodocs']
};
export default preview;
+41
View File
@@ -0,0 +1,41 @@
{
"extends": "../../../tsconfig.json",
"compilerOptions": {
"emitDecoratorMetadata": true,
"moduleResolution": "bundler"
},
"exclude": [
"../**/*.spec.ts",
"../../core/**/*.spec.ts",
"../../core/**/mocks/**/*.ts",
"../../core/**/mock/**/*",
"../../core/feature-flags/**/*.ts",
"../../core/breadcrumbs/public-api.ts",
"../../core/breadcrumbs/src/index.ts",
"../../core/index.ts",
"../../core/schematics/**/*",
"../../core/shell/**/*",
"../../core/test.ts",
"../../core/src/lib/testing/**/*",
"../../core/src/lib/models/basic-auth.ts",
"../../core/src/lib/models/oauth2.ts",
"../../core/src/lib/services/startup-service-factory.ts",
"../../core/src/lib/card-view/directives/card-view-property-validator.spec.directive.ts",
"../../content-services/**/*.spec.ts",
"../../content-services/**/mock/**/*",
"../../content-services/**/mocks/**/*",
"../../content-services/src/lib/testing/**/*",
"../../content-services/src/lib/content-type/public-api.ts",
"../../content-services/src/lib/folder-directive/folder-edit.directive.ts",
"../../content-services/src/lib/content-metadata/components/content-metadata/mock-data.ts",
"../../content-services/src/test.ts",
"../../process-services-cloud/**/*.spec.ts",
"../../process-services-cloud/**/mocks/**/*",
"../../process-services-cloud/**/mock/**/*",
"../../process-services-cloud/src/lib/testing/**/*",
"../../process-services-cloud/src/test.ts",
"../../../.storybook/main.ts"
],
"include": ["../src/**/*", "preview.ts", "../../core/**/*", "../../content-services/**/*", "../../process-services-cloud/**/*"]
}