2022-09-09 01:23:19 +08:00

40 lines
758 B
TypeScript

import globalThis from 'global';
import { PartialStoryFn, StoryContext } from '@storybook/csf';
export default {
component: null,
decorators: [
(storyFn: PartialStoryFn, context: StoryContext) =>
storyFn({ component: globalThis.Components.Pre, args: { object: context.args } }),
],
};
export const CustomMatchers = {
parameters: {
controls: {
matchers: {
date: /whateverIwant/,
},
},
docs: { source: { state: 'open' } },
},
args: {
whateverIwant: '10/10/2020',
},
};
export const DisabledMatchers = {
parameters: {
controls: {
matchers: {
date: null,
color: null,
},
},
},
args: {
purchaseDate: '10/10/2020',
backgroundColor: '#BADA55',
},
};