|
| 1 | +/* do not change this file, it is auto generated by storybook. */ |
| 2 | + |
| 3 | +import { |
| 4 | + configure, |
| 5 | + addDecorator, |
| 6 | + addParameters, |
| 7 | + addArgsEnhancer, |
| 8 | + clearDecorators, |
| 9 | +} from "@storybook/react-native"; |
| 10 | + |
| 11 | +global.STORIES = [ |
| 12 | + { |
| 13 | + titlePrefix: "", |
| 14 | + directory: "./components", |
| 15 | + files: "**/*.stories.?(ts|tsx|js|jsx)", |
| 16 | + importPathMatcher: |
| 17 | + "^\\.[\\\\/](?:components(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(?:ts|tsx|js|jsx)?)$", |
| 18 | + }, |
| 19 | + { |
| 20 | + titlePrefix: "", |
| 21 | + directory: "./other_components/AnotherButton", |
| 22 | + files: "AnotherButton.stories.tsx", |
| 23 | + importPathMatcher: |
| 24 | + "^\\.[\\\\/](?:other_components\\/AnotherButton\\/AnotherButton\\.stories\\.tsx)$", |
| 25 | + }, |
| 26 | +]; |
| 27 | + |
| 28 | +import "@storybook/addon-ondevice-notes/register"; |
| 29 | +import "@storybook/addon-ondevice-controls/register"; |
| 30 | +import "@storybook/addon-ondevice-knobs/register"; |
| 31 | +import "@storybook/addon-ondevice-backgrounds/register"; |
| 32 | +import "@storybook/addon-ondevice-actions/register"; |
| 33 | + |
| 34 | +import { argsEnhancers } from "@storybook/addon-actions/dist/modern/preset/addArgs"; |
| 35 | + |
| 36 | +import { decorators, parameters } from "./preview"; |
| 37 | + |
| 38 | +if (decorators) { |
| 39 | + if (__DEV__) { |
| 40 | + // stops the warning from showing on every HMR |
| 41 | + require("react-native").LogBox.ignoreLogs([ |
| 42 | + "`clearDecorators` is deprecated and will be removed in Storybook 7.0", |
| 43 | + ]); |
| 44 | + } |
| 45 | + // workaround for global decorators getting infinitely applied on HMR, see https://github.com/storybookjs/react-native/issues/185 |
| 46 | + clearDecorators(); |
| 47 | + decorators.forEach((decorator) => addDecorator(decorator)); |
| 48 | +} |
| 49 | + |
| 50 | +if (parameters) { |
| 51 | + addParameters(parameters); |
| 52 | +} |
| 53 | + |
| 54 | +try { |
| 55 | + argsEnhancers.forEach((enhancer) => addArgsEnhancer(enhancer)); |
| 56 | +} catch {} |
| 57 | + |
| 58 | +const stories = [ |
| 59 | + require.context( |
| 60 | + "../components", |
| 61 | + true, |
| 62 | + /^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/ |
| 63 | + ), |
| 64 | + require.context( |
| 65 | + "../other_components/AnotherButton", |
| 66 | + false, |
| 67 | + /^\.[\\/](?:AnotherButton\.stories\.tsx)$/ |
| 68 | + ), |
| 69 | +]; |
| 70 | + |
| 71 | +configure(stories, module, false); |
0 commit comments