You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

92 regels
1.9 KiB

  1. import { themes, defaultTheme } from '../stories/_global/styles/themes.config';
  2. import '../stories/_global/styles/themes.scss';
  3. import '../stories/_global/styles/main.scss';
  4. import '../stories/_global/styles/fonts.scss';
  5. import '../stories/_global/styles/icons.scss';
  6. import '../stories/_global/styles/pictograms.scss';
  7. import '../stories/_global/styles/typography.scss';
  8. import '../stories/_global/styles/grid.scss';
  9. import '../stories/_global/styles/storybook-preview.scss';
  10. import '../stories/_global/scripts/ihk';
  11. const customViewports = {
  12. Phone: {
  13. name: 'Phone',
  14. styles: {
  15. width: '380px',
  16. height: '720px',
  17. },
  18. },
  19. Tablet: {
  20. name: 'Tablet',
  21. styles: {
  22. width: '768px',
  23. height: '1024px',
  24. }
  25. }
  26. };
  27. export const parameters = {
  28. layout: 'padded',
  29. actions: {},
  30. viewport: { options: customViewports },
  31. controls: {
  32. matchers: {
  33. color: /(background|color)$/i,
  34. date: /Date$/,
  35. },
  36. },
  37. backgrounds: {
  38. options: {
  39. white: {
  40. name: 'white',
  41. value: '#FFFFFF',
  42. },
  43. primary: {
  44. name: 'primary',
  45. value: '#003366',
  46. },
  47. secondary: {
  48. name: 'secondary',
  49. value: '#56BD66',
  50. },
  51. lightblue: {
  52. name: 'lightblue',
  53. value: '#E3EBF5',
  54. }
  55. }
  56. },
  57. }
  58. export const globalTypes = {
  59. theme: {
  60. name: 'Theme',
  61. description: 'Theme für alle Komponenten (data-theme am <html>-Element)',
  62. toolbar: {
  63. title: 'Theme',
  64. icon: 'paintbrush',
  65. items: themes.map(({ name, value }) => ({ value, title: name })),
  66. dynamicTitle: true,
  67. },
  68. },
  69. };
  70. export const initialGlobals = {
  71. backgrounds: {
  72. value: 'white'
  73. },
  74. theme: defaultTheme,
  75. };
  76. export const tags = ['autodocs'];
  77. export const decorators = [
  78. (Story, context) => {
  79. document.documentElement.setAttribute('data-theme', context.globals.theme ?? defaultTheme);
  80. document.body.classList.add('variant-base');
  81. return Story();
  82. },
  83. ];