@storybook/react-native 6.5.0-rc.1 → 6.5.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/hooks.d.ts +5 -0
  2. package/dist/hooks.js +10 -3
  3. package/dist/index.d.ts +1 -1
  4. package/dist/preview/View.d.ts +9 -7
  5. package/dist/preview/View.js +3 -1
  6. package/dist/preview/components/OnDeviceUI/OnDeviceUI.js +61 -40
  7. package/dist/preview/components/OnDeviceUI/Panel.d.ts +7 -5
  8. package/dist/preview/components/OnDeviceUI/Panel.js +9 -4
  9. package/dist/preview/components/OnDeviceUI/absolute-positioned-keyboard-aware-view.d.ts +1 -1
  10. package/dist/preview/components/OnDeviceUI/addons/Addons.d.ts +3 -2
  11. package/dist/preview/components/OnDeviceUI/addons/Addons.js +7 -22
  12. package/dist/preview/components/OnDeviceUI/addons/List.js +6 -15
  13. package/dist/preview/components/OnDeviceUI/addons/Wrapper.js +10 -14
  14. package/dist/preview/components/OnDeviceUI/animation.d.ts +34 -11
  15. package/dist/preview/components/OnDeviceUI/animation.js +49 -18
  16. package/dist/preview/components/OnDeviceUI/navigation/Navigation.d.ts +3 -1
  17. package/dist/preview/components/OnDeviceUI/navigation/Navigation.js +5 -5
  18. package/dist/preview/components/OnDeviceUI/navigation/NavigationBar.d.ts +8 -0
  19. package/dist/preview/components/OnDeviceUI/navigation/NavigationBar.js +14 -0
  20. package/dist/preview/components/OnDeviceUI/navigation/VisibilityButton.js +10 -10
  21. package/dist/preview/components/Shared/layout.d.ts +12 -0
  22. package/dist/preview/components/Shared/layout.js +27 -0
  23. package/dist/preview/components/Shared/tabs.d.ts +20 -0
  24. package/dist/preview/components/Shared/tabs.js +35 -0
  25. package/dist/preview/components/Shared/theme.d.ts +183 -13
  26. package/dist/preview/components/Shared/theme.js +177 -13
  27. package/dist/preview/components/StoryListView/StoryListView.js +57 -65
  28. package/dist/types/types-6.0.d.ts +10 -10
  29. package/dist/types/types.d.ts +3 -3
  30. package/package.json +6 -6
  31. package/scripts/__snapshots__/loader.test.js.snap +35 -35
  32. package/dist/preview/components/OnDeviceUI/navigation/Bar.d.ts +0 -9
  33. package/dist/preview/components/OnDeviceUI/navigation/Bar.js +0 -17
  34. package/dist/preview/components/OnDeviceUI/navigation/Button.d.ts +0 -10
  35. package/dist/preview/components/OnDeviceUI/navigation/Button.js +0 -17
  36. package/dist/preview/components/Shared/text.d.ts +0 -3
  37. package/dist/preview/components/Shared/text.js +0 -18
@@ -2,85 +2,80 @@ import styled from '@emotion/native';
2
2
  import { addons } from '@storybook/addons';
3
3
  import Events from '@storybook/core-events';
4
4
  import React, { useMemo, useState } from 'react';
5
- import { SectionList, StyleSheet, View, } from 'react-native';
6
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
5
+ import { SectionList, StyleSheet } from 'react-native';
7
6
  import { GridIcon, SearchIcon, StoryIcon } from '../Shared/icons';
8
- import { Header, Name } from '../Shared/text';
9
- import { useIsStorySelected, useIsStorySectionSelected } from '../../../hooks';
10
- const SearchInput = styled.TextInput(Object.assign({ fontSize: 16, padding: 0, paddingHorizontal: 36 }, StyleSheet.absoluteFillObject), ({ theme }) => ({
11
- color: theme.buttonActiveTextColor,
7
+ import { Box } from '../Shared/layout';
8
+ import { useIsStorySelected, useIsStorySectionSelected, useTheme } from '../../../hooks';
9
+ const SectionHeaderText = styled.Text(({ theme }) => ({
10
+ fontSize: theme.storyList.fontSize,
11
+ color: theme.storyList.headerTextColor,
12
+ fontWeight: theme.storyList.headerFontWeight,
12
13
  }));
13
- const SearchContainer = styled.View({
14
- borderRadius: 100,
15
- borderWidth: 1.5,
16
- marginVertical: 4,
17
- marginHorizontal: 8,
18
- paddingVertical: 10,
19
- paddingLeft: 12,
14
+ const StoryNameText = styled.Text(({ selected, theme }) => ({
15
+ fontSize: theme.storyList.fontSize,
16
+ fontWeight: selected ? theme.storyList.storySelectedFontWeight : theme.storyList.storyFontWeight,
17
+ color: selected ? theme.storyList.storySelectedTextColor : theme.storyList.storyTextColor,
18
+ }));
19
+ const SEARCH_ICON_SIZE = 24;
20
+ const SearchInput = styled.TextInput(Object.assign({ padding: 0 }, StyleSheet.absoluteFillObject), ({ theme }) => ({
21
+ fontSize: theme.storyList.search.fontSize,
22
+ paddingStart: theme.storyList.search.paddingHorizontal + SEARCH_ICON_SIZE,
23
+ color: theme.storyList.search.textColor,
24
+ }));
25
+ const SearchContainer = styled.View(({ theme }) => ({
20
26
  flexDirection: 'row',
21
27
  alignItems: 'center',
22
- }, ({ theme }) => ({
23
- borderColor: theme.borderColor,
24
- backgroundColor: theme.storyListBackgroundColor,
28
+ margin: theme.panel.paddingHorizontal,
29
+ paddingVertical: theme.storyList.search.paddingVertical,
30
+ paddingStart: theme.storyList.search.paddingHorizontal,
31
+ borderColor: theme.storyList.search.borderColor,
32
+ borderWidth: theme.storyList.search.borderWidth,
33
+ borderRadius: theme.storyList.search.borderRadius,
34
+ backgroundColor: theme.storyList.search.backgroundColor,
25
35
  }));
26
36
  const SearchBar = (props) => {
37
+ const theme = useTheme();
27
38
  return (React.createElement(SearchContainer, null,
28
39
  React.createElement(SearchIcon, null),
29
- React.createElement(SearchInput, Object.assign({}, props, { autoCapitalize: 'none', autoComplete: 'off', autoCorrect: false, spellCheck: false, clearButtonMode: "while-editing", disableFullscreenUI: true, placeholderTextColor: "#666", returnKeyType: "search" }))));
40
+ React.createElement(SearchInput, Object.assign({}, props, { autoCapitalize: "none", autoComplete: "off", autoCorrect: false, spellCheck: false, clearButtonMode: "while-editing", disableFullscreenUI: true, placeholderTextColor: theme.storyList.search.placeholderTextColor, returnKeyType: "search" }))));
30
41
  };
31
42
  const HeaderContainer = styled.TouchableOpacity({
32
- marginTop: 8,
33
- marginHorizontal: 6,
34
- padding: 6,
35
- paddingHorizontal: 8,
36
- borderTopLeftRadius: 6,
37
- borderTopRightRadius: 6,
38
43
  flexDirection: 'row',
39
44
  alignItems: 'center',
40
45
  }, ({ selected, theme }) => ({
41
- backgroundColor: selected ? theme.sectionActiveColor : undefined,
46
+ marginTop: theme.storyList.sectionSpacing,
47
+ paddingHorizontal: theme.storyList.headerPaddingHorizontal,
48
+ paddingVertical: theme.storyList.headerPaddingVertical,
49
+ backgroundColor: selected ? theme.storyList.sectionActiveBackgroundColor : undefined,
50
+ borderTopLeftRadius: theme.storyList.sectionBorderRadius,
51
+ borderTopRightRadius: theme.storyList.sectionBorderRadius,
42
52
  }));
43
- const StoryListContainer = styled.View(({ theme }) => (Object.assign(Object.assign({ top: 0 }, StyleSheet.absoluteFillObject), {
44
- // for this to work I need to get the top margin from safeareview context
45
- // shadowColor: '#000',
46
- // shadowOffset: {
47
- // width: 0,
48
- // height: 1,
49
- // },
50
- // shadowOpacity: 0.2,
51
- // shadowRadius: 1.41,
52
- // elevation: 2,
53
- borderRightWidth: StyleSheet.hairlineWidth, borderRightColor: theme.borderColor, backgroundColor: theme.storyListBackgroundColor })));
54
53
  const SectionHeader = React.memo(({ title, onPress }) => {
55
54
  const selected = useIsStorySectionSelected(title);
56
55
  return (React.createElement(HeaderContainer, { key: title, selected: selected, onPress: onPress, activeOpacity: 0.8 },
57
56
  React.createElement(GridIcon, null),
58
- React.createElement(Header, { selected: selected }, title)));
57
+ React.createElement(SectionHeaderText, { selected: selected }, title)));
59
58
  });
60
59
  const ItemTouchable = styled.TouchableOpacity({
61
- marginHorizontal: 6,
62
- padding: 6,
63
- paddingLeft: 24,
64
60
  flexDirection: 'row',
65
61
  alignItems: 'center',
66
- }, ({ selected, sectionSelected, isLastItem, theme }) => {
67
- var _a;
68
- return {
69
- backgroundColor: selected
70
- ? ((_a = theme === null || theme === void 0 ? void 0 : theme.listItemActiveColor) !== null && _a !== void 0 ? _a : '#1ea7fd')
71
- : sectionSelected
72
- ? theme === null || theme === void 0 ? void 0 : theme.sectionActiveColor
73
- : undefined,
74
- borderBottomLeftRadius: isLastItem ? 6 : undefined,
75
- borderBottomRightRadius: isLastItem ? 6 : undefined,
76
- };
77
- });
62
+ }, ({ selected, sectionSelected, isLastItem, theme }) => ({
63
+ padding: theme.storyList.storyPaddingHorizontal,
64
+ paddingStart: theme.storyList.storyIndent,
65
+ backgroundColor: selected
66
+ ? theme.storyList.storySelectedBackgroundColor
67
+ : sectionSelected
68
+ ? theme.storyList.sectionActiveBackgroundColor
69
+ : undefined,
70
+ borderBottomLeftRadius: isLastItem ? theme.storyList.sectionBorderRadius : undefined,
71
+ borderBottomRightRadius: isLastItem ? theme.storyList.sectionBorderRadius : undefined,
72
+ }));
78
73
  const ListItem = React.memo(({ storyId, kind, title, isLastItem, onPress }) => {
79
74
  const selected = useIsStorySelected(storyId);
80
75
  const sectionSelected = useIsStorySectionSelected(kind);
81
76
  return (React.createElement(ItemTouchable, { key: title, onPress: onPress, activeOpacity: 0.8, testID: `Storybook.ListItem.${kind}.${title}`, accessibilityLabel: `Storybook.ListItem.${title}`, selected: selected, sectionSelected: sectionSelected, isLastItem: isLastItem },
82
77
  React.createElement(StoryIcon, { selected: selected }),
83
- React.createElement(Name, { selected: selected }, title)));
78
+ React.createElement(StoryNameText, { selected: selected }, title)));
84
79
  }, (prevProps, nextProps) => prevProps.storyId === nextProps.storyId);
85
80
  const getStories = (storyIndex) => {
86
81
  if (!storyIndex) {
@@ -100,14 +95,13 @@ const styles = StyleSheet.create({
100
95
  sectionList: { flex: 1 },
101
96
  sectionListContentContainer: { paddingBottom: 6 },
102
97
  });
103
- const tabBarHeight = 40;
104
98
  function keyExtractor(item, index) {
105
99
  return item.id + index;
106
100
  }
107
101
  const StoryListView = ({ storyIndex }) => {
108
- const insets = useSafeAreaInsets();
109
102
  const originalData = useMemo(() => getStories(storyIndex), [storyIndex]);
110
103
  const [data, setData] = useState(originalData);
104
+ const theme = useTheme();
111
105
  const handleChangeSearchText = (text) => {
112
106
  const query = text.trim();
113
107
  if (!query) {
@@ -131,20 +125,18 @@ const StoryListView = ({ storyIndex }) => {
131
125
  const channel = addons.getChannel();
132
126
  channel.emit(Events.SET_CURRENT_STORY, { storyId });
133
127
  };
134
- const safeStyle = React.useMemo(() => {
135
- return { flex: 1, marginTop: insets.top, paddingBottom: insets.bottom + tabBarHeight };
136
- }, [insets]);
137
128
  const renderItem = React.useCallback(({ item, index, section }) => {
138
129
  return (React.createElement(ListItem, { storyId: item.id, title: item.name, kind: item.title, isLastItem: index === section.data.length - 1, onPress: () => changeStory(item.id) }));
139
130
  }, []);
140
131
  const renderSectionHeader = React.useCallback(({ section: { title, data } }) => (React.createElement(SectionHeader, { title: title, onPress: () => changeStory(data[0].id) })), []);
141
- return (React.createElement(StoryListContainer, null,
142
- React.createElement(View, { style: safeStyle },
143
- React.createElement(SearchBar, { testID: "Storybook.ListView.SearchBar", onChangeText: handleChangeSearchText, placeholder: "Find by name" }),
144
- React.createElement(SectionList
145
- // contentInset={{ bottom: insets.bottom, top: 0 }}
146
- , {
147
- // contentInset={{ bottom: insets.bottom, top: 0 }}
148
- style: styles.sectionList, contentContainerStyle: styles.sectionListContentContainer, testID: "Storybook.ListView", renderItem: renderItem, renderSectionHeader: renderSectionHeader, keyExtractor: keyExtractor, sections: data, stickySectionHeadersEnabled: false }))));
132
+ return (React.createElement(Box, { flex: true },
133
+ React.createElement(SearchBar, { testID: "Storybook.ListView.SearchBar", onChangeText: handleChangeSearchText, placeholder: "Find by name" }),
134
+ React.createElement(SectionList, { style: styles.sectionList, contentContainerStyle: [
135
+ styles.sectionListContentContainer,
136
+ {
137
+ paddingVertical: theme.panel.paddingVertical,
138
+ paddingHorizontal: theme.panel.paddingHorizontal,
139
+ },
140
+ ], testID: "Storybook.ListView", renderItem: renderItem, renderSectionHeader: renderSectionHeader, keyExtractor: keyExtractor, sections: data, stickySectionHeadersEnabled: false })));
149
141
  };
150
142
  export default React.memo(StoryListView);
@@ -1,8 +1,8 @@
1
1
  import { ComponentProps, ComponentType, JSXElementConstructor, ReactElement } from 'react';
2
2
  import type { Args, ComponentAnnotations, StoryAnnotations, AnnotatedStoryFn } from '@storybook/csf';
3
- export declare type StoryFnReactReturnType = ReactElement<unknown>;
3
+ export type StoryFnReactReturnType = ReactElement<unknown>;
4
4
  export type { Args, ArgTypes, Parameters, StoryContext } from '@storybook/addons';
5
- export declare type ReactNativeFramework = {
5
+ export type ReactNativeFramework = {
6
6
  component: ComponentType<any>;
7
7
  storyResult: StoryFnReactReturnType;
8
8
  };
@@ -13,7 +13,7 @@ export declare type ReactNativeFramework = {
13
13
  * export default { ... } as ComponentMeta<typeof Button>;
14
14
  * ```
15
15
  */
16
- export declare type ComponentMeta<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = Meta<ComponentProps<T>>;
16
+ export type ComponentMeta<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = Meta<ComponentProps<T>>;
17
17
  /**
18
18
  * For the common case where a (CSFv2) story is a simple component that receives args as props:
19
19
  *
@@ -21,7 +21,7 @@ export declare type ComponentMeta<T extends keyof JSX.IntrinsicElements | JSXEle
21
21
  * const Template: ComponentStory<typeof Button> = (args) => <Button {...args} />
22
22
  * ```
23
23
  */
24
- export declare type ComponentStoryFn<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = StoryFn<ComponentProps<T>>;
24
+ export type ComponentStoryFn<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = StoryFn<ComponentProps<T>>;
25
25
  /**
26
26
  * For the common case where a (CSFv3) story is a simple component that receives args as props:
27
27
  *
@@ -31,7 +31,7 @@ export declare type ComponentStoryFn<T extends keyof JSX.IntrinsicElements | JSX
31
31
  * }
32
32
  * ```
33
33
  */
34
- export declare type ComponentStoryObj<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = StoryObj<ComponentProps<T>>;
34
+ export type ComponentStoryObj<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = StoryObj<ComponentProps<T>>;
35
35
  /**
36
36
  * For the common case where a (CSFv2) story is a simple component that receives args as props:
37
37
  *
@@ -42,25 +42,25 @@ export declare type ComponentStoryObj<T extends keyof JSX.IntrinsicElements | JS
42
42
  * NOTE: this is an alias for `ComponentStoryFn`.
43
43
  * In Storybook v7, `ComponentStory` will alias `ComponentStoryObj`
44
44
  */
45
- export declare type ComponentStory<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = Story<ComponentProps<T>>;
45
+ export type ComponentStory<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = Story<ComponentProps<T>>;
46
46
  /**
47
47
  * Metadata to configure the stories for a component.
48
48
  *
49
49
  * @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
50
50
  */
51
- export declare type Meta<TArgs = Args> = ComponentAnnotations<ReactNativeFramework, TArgs>;
51
+ export type Meta<TArgs = Args> = ComponentAnnotations<ReactNativeFramework, TArgs>;
52
52
  /**
53
53
  * Story function that represents a CSFv2 component example.
54
54
  *
55
55
  * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
56
56
  */
57
- export declare type StoryFn<TArgs = Args> = AnnotatedStoryFn<ReactNativeFramework, TArgs>;
57
+ export type StoryFn<TArgs = Args> = AnnotatedStoryFn<ReactNativeFramework, TArgs>;
58
58
  /**
59
59
  * Story function that represents a CSFv3 component example.
60
60
  *
61
61
  * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
62
62
  */
63
- export declare type StoryObj<TArgs = Args> = StoryAnnotations<ReactNativeFramework, TArgs>;
63
+ export type StoryObj<TArgs = Args> = StoryAnnotations<ReactNativeFramework, TArgs>;
64
64
  /**
65
65
  * Story function that represents a CSFv2 component example.
66
66
  *
@@ -69,4 +69,4 @@ export declare type StoryObj<TArgs = Args> = StoryAnnotations<ReactNativeFramewo
69
69
  * NOTE that in Storybook 7.0, this type will be renamed to `StoryFn` and replaced by the current `StoryObj` type.
70
70
  *
71
71
  */
72
- export declare type Story<TArgs = Args> = StoryFn<TArgs>;
72
+ export type Story<TArgs = Args> = StoryFn<TArgs>;
@@ -8,7 +8,7 @@ export interface RequireContext {
8
8
  (id: string): any;
9
9
  resolve(id: string): string;
10
10
  }
11
- export declare type LoaderFunction = () => void | any[];
12
- export declare type Loadable = RequireContext | RequireContext[] | LoaderFunction;
11
+ export type LoaderFunction = () => void | any[];
12
+ export type Loadable = RequireContext | RequireContext[] | LoaderFunction;
13
13
  export type { RenderContext, RenderContextWithoutStoryContext };
14
- export declare type RenderStoryFunction = (context: RenderContext) => void;
14
+ export type RenderStoryFunction = (context: RenderContext) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/react-native",
3
- "version": "6.5.0-rc.1",
3
+ "version": "6.5.0-rc.3",
4
4
  "description": "A better way to develop React Native Components for your app",
5
5
  "keywords": [
6
6
  "react",
@@ -61,6 +61,7 @@
61
61
  "@storybook/preview-web": "^6.5.14",
62
62
  "chokidar": "^3.5.1",
63
63
  "commander": "^8.2.0",
64
+ "deepmerge": "^4.3.0",
64
65
  "emotion-theming": "^10.0.19",
65
66
  "glob": "^7.1.7",
66
67
  "jotai": "^2.0.2",
@@ -69,10 +70,9 @@
69
70
  "util": "^0.12.4"
70
71
  },
71
72
  "devDependencies": {
72
- "@types/react": "^18.0.21",
73
- "@types/react-native": "^0.70.4",
74
- "babel-jest": "^26.6.3",
75
- "jest": "^26.6.3",
73
+ "@types/react": "~18.0.27",
74
+ "babel-jest": "^29.4.3",
75
+ "jest": "^29.4.3",
76
76
  "react-test-renderer": "18.2.0"
77
77
  },
78
78
  "peerDependencies": {
@@ -87,5 +87,5 @@
87
87
  "publishConfig": {
88
88
  "access": "public"
89
89
  },
90
- "gitHead": "deada392ffc817d872b9e3fd7b00cbede4334e02"
90
+ "gitHead": "f2a1a9100ba5ddf37fa59b58518751a525eb4788"
91
91
  }
@@ -6,14 +6,14 @@ exports[`loader writeRequires when there are different file extensions writes th
6
6
 
7
7
  import { configure, addDecorator, addParameters, addArgsEnhancer, clearDecorators } from '@storybook/react-native';
8
8
 
9
- global.STORIES = [{\\"titlePrefix\\":\\"\\",\\"directory\\":\\"./scripts/mocks/file-extensions\\",\\"files\\":\\"FakeStory.stories.tsx\\",\\"importPathMatcher\\":\\"^\\\\\\\\.[\\\\\\\\\\\\\\\\/](?:scripts\\\\\\\\/mocks\\\\\\\\/file-extensions\\\\\\\\/FakeStory\\\\\\\\.stories\\\\\\\\.tsx)$\\"}]
9
+ global.STORIES = [{"titlePrefix":"","directory":"./scripts/mocks/file-extensions","files":"FakeStory.stories.tsx","importPathMatcher":"^\\\\.[\\\\\\\\/](?:scripts\\\\/mocks\\\\/file-extensions\\\\/FakeStory\\\\.stories\\\\.tsx)$"}]
10
10
 
11
- import \\"@storybook/addon-ondevice-notes/register\\";
12
- import \\"@storybook/addon-ondevice-controls/register\\";
13
- import \\"@storybook/addon-ondevice-backgrounds/register\\";
14
- import \\"@storybook/addon-ondevice-actions/register\\";
11
+ import "@storybook/addon-ondevice-notes/register";
12
+ import "@storybook/addon-ondevice-controls/register";
13
+ import "@storybook/addon-ondevice-backgrounds/register";
14
+ import "@storybook/addon-ondevice-actions/register";
15
15
 
16
- import { argsEnhancers } from \\"@storybook/addon-actions/dist/modern/preset/addArgs\\"
16
+ import { argsEnhancers } from "@storybook/addon-actions/dist/modern/preset/addArgs"
17
17
 
18
18
 
19
19
  import { decorators, parameters } from './preview';
@@ -42,7 +42,7 @@ import \\"@storybook/addon-ondevice-actions/register\\";
42
42
 
43
43
 
44
44
  const getStories=() => {
45
- return {\\"./scripts/mocks/file-extensions/FakeStory.stories.tsx\\": require(\\"./FakeStory.stories.tsx\\")};
45
+ return {"./scripts/mocks/file-extensions/FakeStory.stories.tsx": require("./FakeStory.stories.tsx")};
46
46
  }
47
47
 
48
48
  configure(getStories, module, false)
@@ -55,14 +55,14 @@ exports[`loader writeRequires when there is a configuration object writes the st
55
55
 
56
56
  import { configure, addDecorator, addParameters, addArgsEnhancer, clearDecorators } from '@storybook/react-native';
57
57
 
58
- global.STORIES = [{\\"titlePrefix\\":\\"ComponentsPrefix\\",\\"files\\":\\"**/*.stories.tsx\\",\\"directory\\":\\"./scripts/mocks/configuration-objects/components\\",\\"importPathMatcher\\":\\"^\\\\\\\\.[\\\\\\\\\\\\\\\\/](?:scripts\\\\\\\\/mocks\\\\\\\\/configuration-objects\\\\\\\\/components(?:\\\\\\\\/(?!\\\\\\\\.)(?:(?:(?!(?:^|\\\\\\\\/)\\\\\\\\.).)*?)\\\\\\\\/|\\\\\\\\/|$)(?!\\\\\\\\.)(?=.)[^/]*?\\\\\\\\.stories\\\\\\\\.tsx)$\\"}]
58
+ global.STORIES = [{"titlePrefix":"ComponentsPrefix","files":"**/*.stories.tsx","directory":"./scripts/mocks/configuration-objects/components","importPathMatcher":"^\\\\.[\\\\\\\\/](?:scripts\\\\/mocks\\\\/configuration-objects\\\\/components(?:\\\\/(?!\\\\.)(?:(?:(?!(?:^|\\\\/)\\\\.).)*?)\\\\/|\\\\/|$)(?!\\\\.)(?=.)[^/]*?\\\\.stories\\\\.tsx)$"}]
59
59
 
60
- import \\"@storybook/addon-ondevice-notes/register\\";
61
- import \\"@storybook/addon-ondevice-controls/register\\";
62
- import \\"@storybook/addon-ondevice-backgrounds/register\\";
63
- import \\"@storybook/addon-ondevice-actions/register\\";
60
+ import "@storybook/addon-ondevice-notes/register";
61
+ import "@storybook/addon-ondevice-controls/register";
62
+ import "@storybook/addon-ondevice-backgrounds/register";
63
+ import "@storybook/addon-ondevice-actions/register";
64
64
 
65
- import { argsEnhancers } from \\"@storybook/addon-actions/dist/modern/preset/addArgs\\"
65
+ import { argsEnhancers } from "@storybook/addon-actions/dist/modern/preset/addArgs"
66
66
 
67
67
 
68
68
  import { decorators, parameters } from './preview';
@@ -91,7 +91,7 @@ import \\"@storybook/addon-ondevice-actions/register\\";
91
91
 
92
92
 
93
93
  const getStories=() => {
94
- return {\\"./scripts/mocks/configuration-objects/components/FakeStory.stories.tsx\\": require(\\"./components/FakeStory.stories.tsx\\")};
94
+ return {"./scripts/mocks/configuration-objects/components/FakeStory.stories.tsx": require("./components/FakeStory.stories.tsx")};
95
95
  }
96
96
 
97
97
  configure(getStories, module, false)
@@ -104,14 +104,14 @@ exports[`loader writeRequires when there is a story glob and exclude paths globs
104
104
 
105
105
  import { configure, addDecorator, addParameters, addArgsEnhancer, clearDecorators } from '@storybook/react-native';
106
106
 
107
- global.STORIES = [{\\"titlePrefix\\":\\"\\",\\"directory\\":\\"./scripts/mocks/exclude-config-files\\",\\"files\\":\\"**/*.stories.tsx\\",\\"importPathMatcher\\":\\"^\\\\\\\\.[\\\\\\\\\\\\\\\\/](?:scripts\\\\\\\\/mocks\\\\\\\\/exclude-config-files(?:\\\\\\\\/(?!\\\\\\\\.)(?:(?:(?!(?:^|\\\\\\\\/)\\\\\\\\.).)*?)\\\\\\\\/|\\\\\\\\/|$)(?!\\\\\\\\.)(?=.)[^/]*?\\\\\\\\.stories\\\\\\\\.tsx)$\\"}]
107
+ global.STORIES = [{"titlePrefix":"","directory":"./scripts/mocks/exclude-config-files","files":"**/*.stories.tsx","importPathMatcher":"^\\\\.[\\\\\\\\/](?:scripts\\\\/mocks\\\\/exclude-config-files(?:\\\\/(?!\\\\.)(?:(?:(?!(?:^|\\\\/)\\\\.).)*?)\\\\/|\\\\/|$)(?!\\\\.)(?=.)[^/]*?\\\\.stories\\\\.tsx)$"}]
108
108
 
109
- import \\"@storybook/addon-ondevice-notes/register\\";
110
- import \\"@storybook/addon-ondevice-controls/register\\";
111
- import \\"@storybook/addon-ondevice-backgrounds/register\\";
112
- import \\"@storybook/addon-ondevice-actions/register\\";
109
+ import "@storybook/addon-ondevice-notes/register";
110
+ import "@storybook/addon-ondevice-controls/register";
111
+ import "@storybook/addon-ondevice-backgrounds/register";
112
+ import "@storybook/addon-ondevice-actions/register";
113
113
 
114
- import { argsEnhancers } from \\"@storybook/addon-actions/dist/modern/preset/addArgs\\"
114
+ import { argsEnhancers } from "@storybook/addon-actions/dist/modern/preset/addArgs"
115
115
 
116
116
 
117
117
  import { decorators, parameters } from './preview';
@@ -140,7 +140,7 @@ import \\"@storybook/addon-ondevice-actions/register\\";
140
140
 
141
141
 
142
142
  const getStories=() => {
143
- return {\\"./scripts/mocks/exclude-config-files/include-components/FakeStory.stories.tsx\\": require(\\"./include-components/FakeStory.stories.tsx\\")};
143
+ return {"./scripts/mocks/exclude-config-files/include-components/FakeStory.stories.tsx": require("./include-components/FakeStory.stories.tsx")};
144
144
  }
145
145
 
146
146
  configure(getStories, module, false)
@@ -153,14 +153,14 @@ exports[`loader writeRequires when there is a story glob writes the story import
153
153
 
154
154
  import { configure, addDecorator, addParameters, addArgsEnhancer, clearDecorators } from '@storybook/react-native';
155
155
 
156
- global.STORIES = [{\\"titlePrefix\\":\\"\\",\\"directory\\":\\"./scripts/mocks/all-config-files\\",\\"files\\":\\"FakeStory.stories.tsx\\",\\"importPathMatcher\\":\\"^\\\\\\\\.[\\\\\\\\\\\\\\\\/](?:scripts\\\\\\\\/mocks\\\\\\\\/all-config-files\\\\\\\\/FakeStory\\\\\\\\.stories\\\\\\\\.tsx)$\\"}]
156
+ global.STORIES = [{"titlePrefix":"","directory":"./scripts/mocks/all-config-files","files":"FakeStory.stories.tsx","importPathMatcher":"^\\\\.[\\\\\\\\/](?:scripts\\\\/mocks\\\\/all-config-files\\\\/FakeStory\\\\.stories\\\\.tsx)$"}]
157
157
 
158
- import \\"@storybook/addon-ondevice-notes/register\\";
159
- import \\"@storybook/addon-ondevice-controls/register\\";
160
- import \\"@storybook/addon-ondevice-backgrounds/register\\";
161
- import \\"@storybook/addon-ondevice-actions/register\\";
158
+ import "@storybook/addon-ondevice-notes/register";
159
+ import "@storybook/addon-ondevice-controls/register";
160
+ import "@storybook/addon-ondevice-backgrounds/register";
161
+ import "@storybook/addon-ondevice-actions/register";
162
162
 
163
- import { argsEnhancers } from \\"@storybook/addon-actions/dist/modern/preset/addArgs\\"
163
+ import { argsEnhancers } from "@storybook/addon-actions/dist/modern/preset/addArgs"
164
164
 
165
165
 
166
166
  import { decorators, parameters } from './preview';
@@ -189,7 +189,7 @@ import \\"@storybook/addon-ondevice-actions/register\\";
189
189
 
190
190
 
191
191
  const getStories=() => {
192
- return {\\"./scripts/mocks/all-config-files/FakeStory.stories.tsx\\": require(\\"./FakeStory.stories.tsx\\")};
192
+ return {"./scripts/mocks/all-config-files/FakeStory.stories.tsx": require("./FakeStory.stories.tsx")};
193
193
  }
194
194
 
195
195
  configure(getStories, module, false)
@@ -202,14 +202,14 @@ exports[`loader writeRequires when there is no preview does not add preview rela
202
202
 
203
203
  import { configure, addDecorator, addParameters, addArgsEnhancer, clearDecorators } from '@storybook/react-native';
204
204
 
205
- global.STORIES = [{\\"titlePrefix\\":\\"\\",\\"directory\\":\\"./scripts/mocks/no-preview\\",\\"files\\":\\"FakeStory.stories.tsx\\",\\"importPathMatcher\\":\\"^\\\\\\\\.[\\\\\\\\\\\\\\\\/](?:scripts\\\\\\\\/mocks\\\\\\\\/no-preview\\\\\\\\/FakeStory\\\\\\\\.stories\\\\\\\\.tsx)$\\"}]
205
+ global.STORIES = [{"titlePrefix":"","directory":"./scripts/mocks/no-preview","files":"FakeStory.stories.tsx","importPathMatcher":"^\\\\.[\\\\\\\\/](?:scripts\\\\/mocks\\\\/no-preview\\\\/FakeStory\\\\.stories\\\\.tsx)$"}]
206
206
 
207
- import \\"@storybook/addon-ondevice-notes/register\\";
208
- import \\"@storybook/addon-ondevice-controls/register\\";
209
- import \\"@storybook/addon-ondevice-backgrounds/register\\";
210
- import \\"@storybook/addon-ondevice-actions/register\\";
207
+ import "@storybook/addon-ondevice-notes/register";
208
+ import "@storybook/addon-ondevice-controls/register";
209
+ import "@storybook/addon-ondevice-backgrounds/register";
210
+ import "@storybook/addon-ondevice-actions/register";
211
211
 
212
- import { argsEnhancers } from \\"@storybook/addon-actions/dist/modern/preset/addArgs\\"
212
+ import { argsEnhancers } from "@storybook/addon-actions/dist/modern/preset/addArgs"
213
213
 
214
214
 
215
215
 
@@ -220,7 +220,7 @@ import \\"@storybook/addon-ondevice-actions/register\\";
220
220
 
221
221
 
222
222
  const getStories=() => {
223
- return {\\"./scripts/mocks/no-preview/FakeStory.stories.tsx\\": require(\\"./FakeStory.stories.tsx\\")};
223
+ return {"./scripts/mocks/no-preview/FakeStory.stories.tsx": require("./FakeStory.stories.tsx")};
224
224
  }
225
225
 
226
226
  configure(getStories, module, false)
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { ViewStyle } from 'react-native';
3
- export interface Props {
4
- index: number;
5
- onPress: (id: number) => void;
6
- style: ViewStyle;
7
- }
8
- declare const _default: React.MemoExoticComponent<({ index, onPress, style }: Props) => JSX.Element>;
9
- export default _default;
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import styled from '@emotion/native';
3
- import Button from './Button';
4
- import { NAVIGATOR, PREVIEW, ADDONS } from './constants';
5
- const Container = styled.View(({ theme }) => ({
6
- flexDirection: 'row',
7
- paddingHorizontal: 8,
8
- backgroundColor: theme.backgroundColor || 'white',
9
- borderTopWidth: 1,
10
- borderBottomWidth: 1,
11
- borderColor: theme.borderColor || '#e6e6e6',
12
- }));
13
- const Bar = ({ index, onPress, style }) => (React.createElement(Container, { style: style },
14
- React.createElement(Button, { onPress: onPress, testID: "BottomMenu.Navigator", id: NAVIGATOR, active: index === NAVIGATOR }, "NAVIGATOR"),
15
- React.createElement(Button, { onPress: onPress, testID: "BottomMenu.Preview", id: PREVIEW, active: index === PREVIEW }, "PREVIEW"),
16
- React.createElement(Button, { onPress: onPress, testID: "BottomMenu.Addons", id: ADDONS, active: index === ADDONS }, "ADDONS")));
17
- export default React.memo(Bar);
@@ -1,10 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- interface Props {
3
- id: number | string;
4
- active: boolean;
5
- onPress: (id: number | string) => void;
6
- testID?: string;
7
- children: ReactNode;
8
- }
9
- declare const _default: React.MemoExoticComponent<({ onPress, id, active, children, testID }: Props) => JSX.Element>;
10
- export default _default;
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import { TouchableOpacity } from 'react-native';
3
- import styled from '@emotion/native';
4
- const ActiveBorder = styled.View(({ active, theme }) => ({
5
- backgroundColor: active ? theme.borderColor || '#e6e6e6' : 'transparent',
6
- height: 3,
7
- }));
8
- const ButtonText = styled.Text(({ theme, active }) => ({
9
- color: active ? theme.buttonActiveTextColor || '#444444' : theme.buttonTextColor || '#999999',
10
- paddingHorizontal: 8,
11
- paddingVertical: 10,
12
- fontSize: 11,
13
- }));
14
- const Button = ({ onPress, id, active, children, testID }) => (React.createElement(TouchableOpacity, { testID: testID, onPress: () => onPress(id), activeOpacity: 0.8 },
15
- React.createElement(ButtonText, { active: active }, children),
16
- React.createElement(ActiveBorder, { active: active })));
17
- export default React.memo(Button);
@@ -1,3 +0,0 @@
1
- export declare const Header: any;
2
- export declare const Name: any;
3
- export declare const Label: any;
@@ -1,18 +0,0 @@
1
- import styled from '@emotion/native';
2
- export const Header = styled.Text(({ theme }) => ({
3
- fontSize: 16,
4
- color: theme.headerTextColor || 'black',
5
- fontWeight: '500',
6
- }));
7
- export const Name = styled.Text({
8
- fontSize: 16,
9
- }, ({ selected, theme }) => {
10
- var _a, _b;
11
- return selected
12
- ? { fontWeight: '700', color: (_a = theme.listItemActiveTextColor) !== null && _a !== void 0 ? _a : 'white' }
13
- : { color: (_b = theme.listItemTextColor) !== null && _b !== void 0 ? _b : 'black' };
14
- });
15
- export const Label = styled.Text(({ theme }) => ({
16
- fontSize: 18,
17
- color: theme.labelColor || 'black',
18
- }));