-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
/
parameters.stories.ts
86 lines (77 loc) · 7.75 KB
/
parameters.stories.ts
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
import { global as globalThis } from '@storybook/global';
// these stories only work with `backgroundsStoryGlobals` set to false
// because the `default` prop is dropped and because, `values` changed to `options` and is now an object
const img =
'PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgNTkwIDQ3NSIgZmlsbD0ibm9uZSI+CiAgPGcgaWQ9ImNvbXBvbmVudC1jb21wb3NpdGlvbiI+CiAgICA8bWFzayBpZD0iY29tcG9uZW50cyIgd2lkdGg9IjcxMSIgaGVpZ2h0PSI2NjciIHg9Ii01MiIgeT0iLTg2IiBtYXNrVW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KICAgICAgPHBhdGggZmlsbD0iI2ZmZiIgZD0iTTY1OC4wMiAxODEuNDAzbC00NC4zMTItLjAwMS0uMDAxIDEzMi4xODVoNDQuMzEzdjQ1LjA2NmgtNDQuMzEybC0uMDAxIDEzMi45MzktODguNjI1LS4wMDEtLjAwMSA4OC42MjZoLTQ1LjA2NnYtNDQuMzEybC00NC4zMTItLjAwMXYtNDQuMzEzaC04Ny44NzJsLS4wMDEgNDQuMzEzLTQ0LjMxMi4wMDF2NDQuMzEyaC00NS4wNjZ2LTQ0LjMxM2gtNDQuMzEzdi00NC4zMTJsLTQzLjU1OC0uMDAxLS4wMDIgNDQuMzEzaC00NS4wNjZsLjAwMS00NC4zMTMtNDMuNTYuMDAxdjQ0LjMx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MjY0RCI+CiAgICAgIDwvc3RvcD4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgPC9kZWZzPgo8L3N2Zz4K';
const COLORS = [
{ name: 'red', value: '#FB001D' },
{ name: 'orange', value: '#FB8118' },
{ name: 'yellow', value: '#FCFF0C' },
{ name: 'green', value: '#1AB408' },
{ name: 'blue', value: '#0F0084' },
{ name: 'purple', value: '#620073' },
];
export default {
component: globalThis.Components.Pre,
args: {
text: 'Testing the background',
},
parameters: {
backgrounds: {
values: COLORS,
},
chromatic: { disable: true },
},
};
export const Default = {
parameters: {
backgrounds: {
default: COLORS[0].name,
},
},
};
export const StorySpecific = {
parameters: {
backgrounds: {
default: 'pink',
values: [
{ name: 'white', value: '#F9F5F1' },
{ name: 'pink', value: '#F99CB4' },
{ name: 'teal', value: '#67CDE8' },
{ name: 'brown', value: '#4D2C10' },
{ name: 'black', value: '#000400' },
],
},
},
};
export const Gradient = {
parameters: {
backgrounds: {
default: 'gradient',
values: [
{
name: 'gradient',
value: 'linear-gradient(90deg, #CA005E 0%, #863783 50%, #112396)',
},
],
},
},
};
export const Image = {
parameters: {
backgrounds: {
default: 'component-driven',
values: [
{
name: 'component-driven',
value: `#000 center / cover no-repeat url(data:image/svg+xml;base64,${img})`,
},
],
},
},
};
export const Disabled = {
parameters: {
backgrounds: { disable: true },
},
};