aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/templates/layout/layout.stories.tsx
blob: 4666b074afcb03670c96458086bc886bc28fe0b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import { ComponentMeta, ComponentStory } from '@storybook/react';
import LayoutComponent from './layout';

/**
 * Layout - Storybook Meta
 */
export default {
  title: 'Templates/LayoutBase',
  component: LayoutComponent,
  args: {
    breadcrumbSchema: [],
    isHome: false,
  },
  argTypes: {
    children: {
      control: {
        type: 'text',
      },
      description: 'The article content.',
      type: {
        name: 'string',
        required: true,
      },
    },
    breadcrumbSchema: {
      control: {
        type: 'null',
      },
      description: 'The JSON schema for breadcrumb items.',
      type: {
        name: 'object',
        required: true,
        value: {},
      },
    },
    isHome: {
      control: {
        type: 'boolean',
      },
      description: 'Determine if it is the homepage.',
      table: {
        category: 'Options',
        defaultValue: { summary: false },
      },
      type: {
        name: 'boolean',
        required: false,
      },
    },
    className: {
      control: {
        type: 'text',
      },
      description: 'Set additional classnames to the article element.',
      table: {
        category: 'Styles',
      },
      type: {
        name: 'string',
        required: false,
      },
    },
    useGrid: {
      control: {
        type: 'boolean',
      },
      description: 'Use the grid layout.',
      table: {
        category: 'Options',
      },
      type: {
        name: 'boolean',
        required: false,
      },
    },
    withExtraPadding: {
      control: {
        type: 'boolean',
      },
      description: 'Set additional padding at the bottom of the page.',
      table: {
        category: 'Options',
      },
      type: {
        name: 'boolean',
        required: false,
      },
    },
  },
  decorators: [
    (Story) => (
      <div
        id="__next"
        style={{
          flex: 1,
          display: 'flex',
          flexFlow: 'column nowrap',
          minHeight: '100vh',
        }}
      >
        <Story />
      </div>
    ),
  ],
  parameters: {
    layout: 'fullscreen',
  },
} as ComponentMeta<typeof LayoutComponent>;

const Template: ComponentStory<typeof LayoutComponent> = (args) => (
  <LayoutComponent {...args} />
);

/**
 * Layout Stories - Default
 */
export const LayoutBase = Template.bind({});
span>, 'important'] }, { pattern: /\b(?:DISPLAY|INF|INFO|NOTICE|STATUS)\b/, alias: ['info', 'keyword'], }, { pattern: /\b(?:DBG|DEBUG|FINE)\b/, alias: ['debug', 'keyword'] }, { pattern: /\b(?:FINER|FINEST|TRACE|TRC|VERBOSE|VRB)\b/, alias: ['trace', 'comment'], }, ], property: { pattern: /((?:^|[\]|])[ \t]*)[a-z_](?:[\w-]|\b\/\b)*(?:[. ]\(?\w(?:[\w-]|\b\/\b)*\)?)*:(?=\s)/im, lookbehind: !0, }, separator: { pattern: /(^|[^-+])-{3,}|={3,}|\*{3,}|- - /m, lookbehind: !0, alias: 'comment', }, url: /\b(?:file|ftp|https?):\/\/[^\s|,;'"]*[^\s|,;'">.]/, email: { pattern: /(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/, lookbehind: !0, alias: 'url', }, 'ip-address': { pattern: /\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/, alias: 'constant', }, 'mac-address': { pattern: /\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i, alias: 'constant', }, domain: { pattern: /(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/, lookbehind: !0, alias: 'constant', }, uuid: { pattern: /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i, alias: 'constant', }, hash: { pattern: /\b(?:[a-f0-9]{32}){1,2}\b/i, alias: 'constant' }, 'file-path': { pattern: /\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i, lookbehind: !0, greedy: !0, alias: 'string', }, date: { pattern: RegExp( '\\b\\d{4}[-/]\\d{2}[-/]\\d{2}(?:T(?=\\d{1,2}:)|(?=\\s\\d{1,2}:))|\\b\\d{1,4}[-/ ](?:\\d{1,2}|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)[-/ ]\\d{2,4}T?\\b|\\b(?:(?:Fri|Mon|Sat|Sun|Thu|Tue|Wed)(?:\\s{1,2}(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep))?|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)\\s{1,2}\\d{1,2}\\b', 'i' ), alias: 'number', }, time: { pattern: /\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/, alias: 'number', }, boolean: /\b(?:false|null|true)\b/i, number: { pattern: /(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i, lookbehind: !0, }, operator: /[;:?<=>~/@!$%&+\-|^(){}*#]/, punctuation: /[\[\].,]/, };