summaryrefslogtreecommitdiffhomepage
path: root/packages/ui/src/storybook/fixtures.ts
blob: 59d4129709a78c1ae140a2a47c09b7cc718face8 (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
export const diff = {
  before: {
    name: "src/greet.ts",
    contents: `export function greet(name: string) {
  return \`Hello, \${name}!\`
}
`,
  },
  after: {
    name: "src/greet.ts",
    contents: `export function greet(name: string, excited = false) {
  const message = \`Hello, \${name}!\`
  return excited ? \`\${message}!!\` : message
}
`,
  },
}

export const code = {
  name: "src/calc.ts",
  contents: `export function sum(values: number[]) {
  return values.reduce((total, value) => total + value, 0)
}

export function average(values: number[]) {
  if (values.length === 0) return 0
  return sum(values) / values.length
}
`,
}

export const markdown = [
  "# Markdown",
  "",
  "Use **Markdown** for rich text.",
  "",
  "## Highlights",
  "- Headings, lists, and code blocks",
  "- Inline `code` and links",
  "",
  "```ts",
  "export const value = 42",
  "```",
  "",
  "More at https://example.com/docs",
].join("\n")

export const changes = {
  additions: 18,
  deletions: 6,
}