Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 

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