@storybook/react-native 6.5.3 → 6.5.4

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 (35) hide show
  1. package/dist/constants.js +4 -1
  2. package/dist/hooks.js +75 -36
  3. package/dist/index.js +40 -18
  4. package/dist/preview/View.js +165 -88
  5. package/dist/preview/components/OnDeviceUI/OnDeviceUI.js +127 -81
  6. package/dist/preview/components/OnDeviceUI/Panel.js +24 -15
  7. package/dist/preview/components/OnDeviceUI/absolute-positioned-keyboard-aware-view.js +17 -10
  8. package/dist/preview/components/OnDeviceUI/addons/Addons.js +32 -23
  9. package/dist/preview/components/OnDeviceUI/addons/AddonsSkeleton.js +69 -41
  10. package/dist/preview/components/OnDeviceUI/addons/List.js +15 -9
  11. package/dist/preview/components/OnDeviceUI/addons/Wrapper.js +27 -18
  12. package/dist/preview/components/OnDeviceUI/addons/index.js +8 -1
  13. package/dist/preview/components/OnDeviceUI/animation.js +37 -29
  14. package/dist/preview/components/OnDeviceUI/index.js +8 -1
  15. package/dist/preview/components/OnDeviceUI/navigation/Navigation.js +31 -24
  16. package/dist/preview/components/OnDeviceUI/navigation/NavigationBar.js +26 -14
  17. package/dist/preview/components/OnDeviceUI/navigation/NavigationButton.js +26 -17
  18. package/dist/preview/components/OnDeviceUI/navigation/constants.js +6 -3
  19. package/dist/preview/components/OnDeviceUI/navigation/index.js +8 -1
  20. package/dist/preview/components/Shared/icons.js +28 -10
  21. package/dist/preview/components/Shared/layout.js +21 -4
  22. package/dist/preview/components/Shared/tabs.js +41 -27
  23. package/dist/preview/components/Shared/theme.js +11 -8
  24. package/dist/preview/components/StoryListView/StoryListView.js +161 -97
  25. package/dist/preview/components/StoryListView/index.js +8 -1
  26. package/dist/preview/components/StoryView/StoryView.js +30 -14
  27. package/dist/preview/components/StoryView/index.js +8 -1
  28. package/dist/preview/executeLoadable.d.ts +4 -1
  29. package/dist/preview/executeLoadable.js +43 -23
  30. package/dist/preview/rn-host-detect.js +3 -1
  31. package/dist/preview/start.js +81 -56
  32. package/dist/types/types-6.0.js +2 -1
  33. package/dist/types/types.js +2 -1
  34. package/package.json +3 -3
  35. package/readme.md +97 -55
@@ -1 +1,8 @@
1
- export { default } from './Addons';
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = void 0;
7
+ var Addons_1 = require("./Addons");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(Addons_1).default; } });
@@ -1,26 +1,29 @@
1
- import { I18nManager } from 'react-native';
2
- import { SIDEBAR, CANVAS, ADDONS } from './navigation/constants';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPreviewShadowStyle = exports.getPreviewStyle = exports.getAddonPanelPosition = exports.getSidebarPanelPosition = void 0;
4
+ var react_native_1 = require("react-native");
5
+ var constants_1 = require("./navigation/constants");
3
6
  // Factor that will flip the animation orientation in RTL locales.
4
- const RTL_SCALE = I18nManager.isRTL ? -1 : 1;
7
+ var RTL_SCALE = react_native_1.I18nManager.isRTL ? -1 : 1;
5
8
  // Percentage to scale the preview area by when opening a panel.
6
- const PREVIEW_SCALE = 0.3;
9
+ var PREVIEW_SCALE = 0.3;
7
10
  // Percentage to scale the preview area by when opening a panel, on wide screens.
8
- const PREVIEW_SCALE_WIDE = 0.7;
11
+ var PREVIEW_SCALE_WIDE = 0.7;
9
12
  // Percentage to shrink the visible preview by, without affecting the panel size.
10
- const PREVIEW_SCALE_SHRINK = 0.9;
11
- const SCALE_OFFSET = 0.025;
12
- const TRANSLATE_Y_OFFSET = 12;
13
- const panelWidth = (width, wide) => {
14
- const scale = wide ? PREVIEW_SCALE_WIDE : PREVIEW_SCALE;
13
+ var PREVIEW_SCALE_SHRINK = 0.9;
14
+ var SCALE_OFFSET = 0.025;
15
+ var TRANSLATE_Y_OFFSET = 12;
16
+ var panelWidth = function (width, wide) {
17
+ var scale = wide ? PREVIEW_SCALE_WIDE : PREVIEW_SCALE;
15
18
  return width * (1 - scale - SCALE_OFFSET);
16
19
  };
17
- export const getSidebarPanelPosition = (animatedValue, previewWidth, wide) => {
20
+ var getSidebarPanelPosition = function (animatedValue, previewWidth, wide) {
18
21
  return [
19
22
  {
20
23
  transform: [
21
24
  {
22
25
  translateX: animatedValue.interpolate({
23
- inputRange: [SIDEBAR, CANVAS],
26
+ inputRange: [constants_1.SIDEBAR, constants_1.CANVAS],
24
27
  outputRange: [0, (-panelWidth(previewWidth, wide) - 1) * RTL_SCALE],
25
28
  }),
26
29
  },
@@ -29,13 +32,14 @@ export const getSidebarPanelPosition = (animatedValue, previewWidth, wide) => {
29
32
  },
30
33
  ];
31
34
  };
32
- export const getAddonPanelPosition = (animatedValue, previewWidth, wide) => {
35
+ exports.getSidebarPanelPosition = getSidebarPanelPosition;
36
+ var getAddonPanelPosition = function (animatedValue, previewWidth, wide) {
33
37
  return [
34
38
  {
35
39
  transform: [
36
40
  {
37
41
  translateX: animatedValue.interpolate({
38
- inputRange: [CANVAS, ADDONS],
42
+ inputRange: [constants_1.CANVAS, constants_1.ADDONS],
39
43
  outputRange: [
40
44
  previewWidth * RTL_SCALE,
41
45
  (previewWidth - panelWidth(previewWidth, wide)) * RTL_SCALE,
@@ -47,62 +51,66 @@ export const getAddonPanelPosition = (animatedValue, previewWidth, wide) => {
47
51
  },
48
52
  ];
49
53
  };
54
+ exports.getAddonPanelPosition = getAddonPanelPosition;
50
55
  /**
51
56
  * Build the animated style for the preview container view.
52
57
  *
53
58
  * When the sidebar or addons panel is focused, the preview container is
54
59
  * scaled down and translated to the left (or right) of the panel.
55
60
  */
56
- export const getPreviewStyle = ({ animatedValue, previewDimensions: { width: previewWidth, height: previewHeight }, wide, insets, tabOpen, lastTabOpen, }) => {
57
- const scale = (wide ? PREVIEW_SCALE_WIDE : PREVIEW_SCALE) * PREVIEW_SCALE_SHRINK;
58
- const scaledPreviewWidth = previewWidth * scale;
59
- const scaledPreviewHeight = previewHeight * scale;
61
+ var getPreviewStyle = function (_a) {
62
+ var animatedValue = _a.animatedValue, _b = _a.previewDimensions, previewWidth = _b.width, previewHeight = _b.height, wide = _a.wide, insets = _a.insets, tabOpen = _a.tabOpen, lastTabOpen = _a.lastTabOpen;
63
+ var scale = (wide ? PREVIEW_SCALE_WIDE : PREVIEW_SCALE) * PREVIEW_SCALE_SHRINK;
64
+ var scaledPreviewWidth = previewWidth * scale;
65
+ var scaledPreviewHeight = previewHeight * scale;
60
66
  // Horizontally center the scaled preview in the available space beside the panel.
61
- const nonPanelWidth = previewWidth - panelWidth(previewWidth, wide);
62
- const translateXOffset = (nonPanelWidth - scaledPreviewWidth) / 2;
63
- const translateX = (previewWidth / 2 - (previewWidth * scale) / 2 - translateXOffset) * RTL_SCALE;
67
+ var nonPanelWidth = previewWidth - panelWidth(previewWidth, wide);
68
+ var translateXOffset = (nonPanelWidth - scaledPreviewWidth) / 2;
69
+ var translateX = (previewWidth / 2 - (previewWidth * scale) / 2 - translateXOffset) * RTL_SCALE;
64
70
  // Translate the preview to the top edge of the screen, move it down by the
65
71
  // safe area inset, then by the preview Y offset.
66
- const translateY = -(previewHeight / 2 - scaledPreviewHeight / 2) + insets.top + TRANSLATE_Y_OFFSET;
72
+ var translateY = -(previewHeight / 2 - scaledPreviewHeight / 2) + insets.top + TRANSLATE_Y_OFFSET;
67
73
  // Is navigation moving from one panel to another, skipping preview?
68
- const skipPreview = lastTabOpen !== CANVAS && tabOpen !== CANVAS;
74
+ var skipPreview = lastTabOpen !== constants_1.CANVAS && tabOpen !== constants_1.CANVAS;
69
75
  return {
70
76
  transform: [
71
77
  {
72
78
  translateX: animatedValue.interpolate({
73
- inputRange: [SIDEBAR, CANVAS, ADDONS],
79
+ inputRange: [constants_1.SIDEBAR, constants_1.CANVAS, constants_1.ADDONS],
74
80
  outputRange: [translateX, 0, -translateX],
75
81
  }),
76
82
  },
77
83
  {
78
84
  translateY: animatedValue.interpolate({
79
- inputRange: [SIDEBAR, CANVAS, ADDONS],
85
+ inputRange: [constants_1.SIDEBAR, constants_1.CANVAS, constants_1.ADDONS],
80
86
  outputRange: [translateY, skipPreview ? translateY : 0, translateY],
81
87
  }),
82
88
  },
83
89
  {
84
90
  scale: animatedValue.interpolate({
85
- inputRange: [SIDEBAR, CANVAS, ADDONS],
91
+ inputRange: [constants_1.SIDEBAR, constants_1.CANVAS, constants_1.ADDONS],
86
92
  outputRange: [scale, skipPreview ? scale : 1, scale],
87
93
  }),
88
94
  },
89
95
  ],
90
96
  };
91
97
  };
98
+ exports.getPreviewStyle = getPreviewStyle;
92
99
  /**
93
100
  * Build the animated shadow style for the preview.
94
101
  *
95
102
  * When the sidebar or addons panel are visible the scaled preview will have
96
103
  * a shadow, and when going to the preview tab the shadow will be invisible.
97
104
  */
98
- export const getPreviewShadowStyle = (animatedValue) => ({
105
+ var getPreviewShadowStyle = function (animatedValue) { return ({
99
106
  elevation: 8,
100
107
  shadowColor: '#000',
101
108
  shadowOpacity: animatedValue.interpolate({
102
- inputRange: [SIDEBAR, CANVAS, ADDONS],
109
+ inputRange: [constants_1.SIDEBAR, constants_1.CANVAS, constants_1.ADDONS],
103
110
  outputRange: [0.25, 0, 0.25],
104
111
  }),
105
112
  shadowRadius: 8,
106
113
  shadowOffset: { width: 0, height: 0 },
107
114
  overflow: 'visible',
108
- });
115
+ }); };
116
+ exports.getPreviewShadowStyle = getPreviewShadowStyle;
@@ -1 +1,8 @@
1
- export { default } from './OnDeviceUI';
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = void 0;
7
+ var OnDeviceUI_1 = require("./OnDeviceUI");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(OnDeviceUI_1).default; } });
@@ -1,44 +1,51 @@
1
- import React from 'react';
2
- import { View } from 'react-native';
3
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
4
- import GestureRecognizer from 'react-native-swipe-gestures';
5
- import { useIsUIVisible } from '../../../../hooks';
6
- import { NavigationBar } from './NavigationBar';
7
- import { VisibilityButton, AddonsSplitButton } from './NavigationButton';
8
- const SWIPE_CONFIG = {
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ var react_1 = __importDefault(require("react"));
7
+ var react_native_1 = require("react-native");
8
+ var react_native_safe_area_context_1 = require("react-native-safe-area-context");
9
+ var react_native_swipe_gestures_1 = __importDefault(require("react-native-swipe-gestures"));
10
+ var hooks_1 = require("../../../../hooks");
11
+ var NavigationBar_1 = require("./NavigationBar");
12
+ var NavigationButton_1 = require("./NavigationButton");
13
+ var SWIPE_CONFIG = {
9
14
  velocityThreshold: 0.2,
10
15
  directionalOffsetThreshold: 80,
11
16
  };
12
- const navStyle = {
17
+ var navStyle = {
13
18
  position: 'absolute',
14
19
  left: 0,
15
20
  right: 0,
16
21
  bottom: 0,
17
22
  };
18
- const Navigation = ({ tabOpen, onChangeTab, onLayout }) => {
19
- const insets = useSafeAreaInsets();
20
- const handleSwipeLeft = () => {
23
+ var Navigation = function (_a) {
24
+ var tabOpen = _a.tabOpen, onChangeTab = _a.onChangeTab, onLayout = _a.onLayout;
25
+ var insets = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
26
+ var handleSwipeLeft = function () {
21
27
  if (tabOpen < 1) {
22
28
  onChangeTab(tabOpen + 1);
23
29
  }
24
30
  };
25
- const handleSwipeRight = () => {
31
+ var handleSwipeRight = function () {
26
32
  if (tabOpen > -1) {
27
33
  onChangeTab(tabOpen - 1);
28
34
  }
29
35
  };
30
- const [isUIVisible] = useIsUIVisible();
31
- return (React.createElement(View, { style: navStyle, onLayout: onLayout },
32
- React.createElement(View, null, isUIVisible && (React.createElement(GestureRecognizer, { onSwipeLeft: handleSwipeLeft, onSwipeRight: handleSwipeRight, config: SWIPE_CONFIG },
33
- React.createElement(NavigationBar, { index: tabOpen, onPress: onChangeTab, style: { paddingBottom: insets.bottom } })))),
34
- React.createElement(NavigationShortcuts, null,
35
- React.createElement(VisibilityButton, null),
36
- React.createElement(AddonsSplitButton, null))));
36
+ var isUIVisible = (0, hooks_1.useIsUIVisible)()[0];
37
+ return (react_1.default.createElement(react_native_1.View, { style: navStyle, onLayout: onLayout },
38
+ react_1.default.createElement(react_native_1.View, null, isUIVisible && (react_1.default.createElement(react_native_swipe_gestures_1.default, { onSwipeLeft: handleSwipeLeft, onSwipeRight: handleSwipeRight, config: SWIPE_CONFIG },
39
+ react_1.default.createElement(NavigationBar_1.NavigationBar, { index: tabOpen, onPress: onChangeTab, style: { paddingBottom: insets.bottom } })))),
40
+ react_1.default.createElement(NavigationShortcuts, null,
41
+ react_1.default.createElement(NavigationButton_1.VisibilityButton, null),
42
+ react_1.default.createElement(NavigationButton_1.AddonsSplitButton, null))));
37
43
  };
38
- export default React.memo(Navigation);
39
- function NavigationShortcuts({ children }) {
40
- const insets = useSafeAreaInsets();
41
- return (React.createElement(View, { style: {
44
+ exports.default = react_1.default.memo(Navigation);
45
+ function NavigationShortcuts(_a) {
46
+ var children = _a.children;
47
+ var insets = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
48
+ return (react_1.default.createElement(react_native_1.View, { style: {
42
49
  zIndex: 100,
43
50
  alignSelf: 'center',
44
51
  justifyContent: 'center',
@@ -1,14 +1,26 @@
1
- import React from 'react';
2
- import styled from '@emotion/native';
3
- import { SIDEBAR, CANVAS, ADDONS } from './constants';
4
- import { TabBar, TabButton } from '../../Shared/tabs';
5
- const NavigationTabBar = styled(TabBar)(({ theme }) => ({
6
- paddingHorizontal: theme.tokens.spacing2,
7
- backgroundColor: theme.navigation.backgroundColor,
8
- borderColor: theme.navigation.borderColor,
9
- borderTopWidth: theme.navigation.borderWidth,
10
- }));
11
- export const NavigationBar = React.memo(({ index, onPress, style }) => (React.createElement(NavigationTabBar, { style: style },
12
- React.createElement(TabButton, { onPress: onPress, testID: "BottomMenu.Sidebar", id: SIDEBAR, active: index === SIDEBAR }, "SIDEBAR"),
13
- React.createElement(TabButton, { onPress: onPress, testID: "BottomMenu.Canvas", id: CANVAS, active: index === CANVAS }, "CANVAS"),
14
- React.createElement(TabButton, { onPress: onPress, testID: "BottomMenu.Addons", id: ADDONS, active: index === ADDONS }, "ADDONS"))));
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.NavigationBar = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var native_1 = __importDefault(require("@emotion/native"));
9
+ var constants_1 = require("./constants");
10
+ var tabs_1 = require("../../Shared/tabs");
11
+ var NavigationTabBar = (0, native_1.default)(tabs_1.TabBar)(function (_a) {
12
+ var theme = _a.theme;
13
+ return ({
14
+ paddingHorizontal: theme.tokens.spacing2,
15
+ backgroundColor: theme.navigation.backgroundColor,
16
+ borderColor: theme.navigation.borderColor,
17
+ borderTopWidth: theme.navigation.borderWidth,
18
+ });
19
+ });
20
+ exports.NavigationBar = react_1.default.memo(function (_a) {
21
+ var index = _a.index, onPress = _a.onPress, style = _a.style;
22
+ return (react_1.default.createElement(NavigationTabBar, { style: style },
23
+ react_1.default.createElement(tabs_1.TabButton, { onPress: onPress, testID: "BottomMenu.Sidebar", id: constants_1.SIDEBAR, active: index === constants_1.SIDEBAR }, "SIDEBAR"),
24
+ react_1.default.createElement(tabs_1.TabButton, { onPress: onPress, testID: "BottomMenu.Canvas", id: constants_1.CANVAS, active: index === constants_1.CANVAS }, "CANVAS"),
25
+ react_1.default.createElement(tabs_1.TabButton, { onPress: onPress, testID: "BottomMenu.Addons", id: constants_1.ADDONS, active: index === constants_1.ADDONS }, "ADDONS")));
26
+ });
@@ -1,20 +1,29 @@
1
- import React from 'react';
2
- import { TouchableWithoutFeedback } from 'react-native';
3
- import { useIsSplitPanelVisible, useIsUIVisible } from '../../../../hooks';
4
- import { Icon } from '../../Shared/icons';
5
- import { Box } from '../../Shared/layout';
6
- const hitSlop = { top: 5, left: 5, right: 5, bottom: 5 };
7
- function NavigationButton({ iconName, inverseIconName, active, toggle }) {
8
- return (React.createElement(TouchableWithoutFeedback, { onPress: toggle, hitSlop: hitSlop },
9
- React.createElement(Box, { marginHorizontal: 8 },
10
- React.createElement(Icon, { flex: 1, background: true, name: inverseIconName, opacity: 0.8, pointerEvents: "none" },
11
- React.createElement(Icon, { name: iconName, opacity: active ? 0.6 : 0.25 })))));
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AddonsSplitButton = exports.VisibilityButton = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var react_native_1 = require("react-native");
9
+ var hooks_1 = require("../../../../hooks");
10
+ var icons_1 = require("../../Shared/icons");
11
+ var layout_1 = require("../../Shared/layout");
12
+ var hitSlop = { top: 5, left: 5, right: 5, bottom: 5 };
13
+ function NavigationButton(_a) {
14
+ var iconName = _a.iconName, inverseIconName = _a.inverseIconName, active = _a.active, toggle = _a.toggle;
15
+ return (react_1.default.createElement(react_native_1.TouchableWithoutFeedback, { onPress: toggle, hitSlop: hitSlop },
16
+ react_1.default.createElement(layout_1.Box, { marginHorizontal: 8 },
17
+ react_1.default.createElement(icons_1.Icon, { flex: 1, background: true, name: inverseIconName, opacity: 0.8, pointerEvents: "none" },
18
+ react_1.default.createElement(icons_1.Icon, { name: iconName, opacity: active ? 0.6 : 0.25 })))));
12
19
  }
13
- export function VisibilityButton() {
14
- const [active, toggle] = useIsUIVisible();
15
- return (React.createElement(NavigationButton, { iconName: "layout-bottom", inverseIconName: "layout-bottom-inverse", active: active, toggle: () => toggle() }));
20
+ function VisibilityButton() {
21
+ var _a = (0, hooks_1.useIsUIVisible)(), active = _a[0], toggle = _a[1];
22
+ return (react_1.default.createElement(NavigationButton, { iconName: "layout-bottom", inverseIconName: "layout-bottom-inverse", active: active, toggle: function () { return toggle(); } }));
16
23
  }
17
- export function AddonsSplitButton() {
18
- const [active, toggle] = useIsSplitPanelVisible();
19
- return (React.createElement(NavigationButton, { iconName: "layout-split", inverseIconName: "layout-split-inverse", active: active, toggle: () => toggle() }));
24
+ exports.VisibilityButton = VisibilityButton;
25
+ function AddonsSplitButton() {
26
+ var _a = (0, hooks_1.useIsSplitPanelVisible)(), active = _a[0], toggle = _a[1];
27
+ return (react_1.default.createElement(NavigationButton, { iconName: "layout-split", inverseIconName: "layout-split-inverse", active: active, toggle: function () { return toggle(); } }));
20
28
  }
29
+ exports.AddonsSplitButton = AddonsSplitButton;
@@ -1,3 +1,6 @@
1
- export const SIDEBAR = -1;
2
- export const CANVAS = 0;
3
- export const ADDONS = 1;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ADDONS = exports.CANVAS = exports.SIDEBAR = void 0;
4
+ exports.SIDEBAR = -1;
5
+ exports.CANVAS = 0;
6
+ exports.ADDONS = 1;
@@ -1 +1,8 @@
1
- export { default } from './Navigation';
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = void 0;
7
+ var Navigation_1 = require("./Navigation");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(Navigation_1).default; } });
@@ -1,3 +1,15 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
1
13
  var __rest = (this && this.__rest) || function (s, e) {
2
14
  var t = {};
3
15
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -9,10 +21,15 @@ var __rest = (this && this.__rest) || function (s, e) {
9
21
  }
10
22
  return t;
11
23
  };
12
- import React from 'react';
13
- import { Image, ImageBackground } from 'react-native';
14
- import styled from '@emotion/native';
15
- const iconSources = {
24
+ var __importDefault = (this && this.__importDefault) || function (mod) {
25
+ return (mod && mod.__esModule) ? mod : { "default": mod };
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.Icon = void 0;
29
+ var react_1 = __importDefault(require("react"));
30
+ var react_native_1 = require("react-native");
31
+ var native_1 = __importDefault(require("@emotion/native"));
32
+ var iconSources = {
16
33
  grid: {
17
34
  uri: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAMAAABHPGVmAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAALdQTFRFAAAAIJ//Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqj9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Haf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqb9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqf9Hqj9Hqf9Hmz01QAAAD10Uk5TAAAEGjNefYqLXDUFAjSY0e79/9KZAghmyMkBQbz6vUIBBnD1cQcOo6Sp76qBePTHVOoC+RQTX4mCDZsBMmX5zDcAAAHcSURBVHic7ZrrcoIwEIVX8W5VpAiUaq33GyJqrfby/s9VacsCDojUJNNx9vzCTLLfZJdkHM4ChJTJSrl8oVj6s4qFckWqZiBed7V6Q24qV6op36uVVgxC042rAQh60LUIhPnY7rBCuOo8dZ9PGb3+gCXC1WA4CjPGE9YIV9NxiNHmwVCUWYAy4rIPV1PMmNnnxVCUoVf9LvOa+xp0f89HqCDzhbWMle3NsuPnWIt5MF7757zogfOxcqLOEGrtzVufm6U5Kz9iR3eHNgYObNWXc4svhQDs1C0GNTbHgZp/l6hnt5ECApqKQZu1471b93O1S1h6OQR2fsbqGcg28JeTtDIFBBwM28iCJON7lZSsVBAN3zFZCpRkkbgwDQQWWJQcvOK2LLYQCwPnoYDPS7aQJQYuwJ4/ZA8l/pASQQhCEIIQhCAEIQhBghB7nSj839xMnmtHQriJIAS5IYiQw3g7dxdBCEIQghCEIAQhyH+ECPmMLsQQKOMzY2vjgIHLYkwaIXaTEOMM+FuAIMbMhJYIW1aIwczaKj9EWuVCTH++7Quml8Qev0aMnl+qtxkfxnu4cYXLXiYhhpg2H4AP1g1L7a55ygDGrVdGZOuVKwFNZN/KSp/XtsPVpOpJ0C+2naE/XA0rpwAAAABJRU5ErkJggg==',
18
35
  },
@@ -38,10 +55,11 @@ const iconSources = {
38
55
  uri: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAEaSURBVHgB7ZntDYJADIaLcQBGYARHgAl0I0YQJ8BNdAPZ4BzBDWov8ENrkYuJtJA+SUO4D/K+1yaQAuA4jmMaRCwpjhQB5+NG0VIU8Cu0OR+EaxM15GM6szHxdLlQ7MAGHUWVZdmDT2xGNtRgR3wkaqmliY8MYF93AWwSs3B9HZAyUINdDnxAMmCpdDh7PiCVEIJhqITeNG9g4bgBbdyANm5AGzegzeINbKcW8Ff33Ex92ngJaeMGtHED2rgBbdZv4FtbzwKSgTu7V2uz0OHxPlCXsqlhzdWgkQXsm8uBaWlTNpZChzgIp/EXBuElyu38IvUhDdqjkbSus70+LKwoTqBP1CCKT4KyUVCcsf/tMxcB+zIuwXEcxzRPpfGo9y3IYogAAAAASUVORK5CYII=',
39
56
  },
40
57
  };
41
- const StyledImage = styled(Image)();
42
- const StyledImageBackground = styled(ImageBackground)();
43
- export function Icon(_a) {
44
- var { name, background = false } = _a, props = __rest(_a, ["name", "background"]);
45
- const IconComponent = background ? StyledImageBackground : StyledImage;
46
- return (React.createElement(IconComponent, Object.assign({ source: Object.assign(Object.assign({}, iconSources[name]), { width: 16, height: 16 }) }, props)));
58
+ var StyledImage = (0, native_1.default)(react_native_1.Image)();
59
+ var StyledImageBackground = (0, native_1.default)(react_native_1.ImageBackground)();
60
+ function Icon(_a) {
61
+ var name = _a.name, _b = _a.background, background = _b === void 0 ? false : _b, props = __rest(_a, ["name", "background"]);
62
+ var IconComponent = background ? StyledImageBackground : StyledImage;
63
+ return (react_1.default.createElement(IconComponent, __assign({ source: __assign(__assign({}, iconSources[name]), { width: 16, height: 16 }) }, props)));
47
64
  }
65
+ exports.Icon = Icon;
@@ -1,3 +1,15 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
1
13
  var __rest = (this && this.__rest) || function (s, e) {
2
14
  var t = {};
3
15
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -9,7 +21,12 @@ var __rest = (this && this.__rest) || function (s, e) {
9
21
  }
10
22
  return t;
11
23
  };
12
- import styled from '@emotion/native';
24
+ var __importDefault = (this && this.__importDefault) || function (mod) {
25
+ return (mod && mod.__esModule) ? mod : { "default": mod };
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.Box = void 0;
29
+ var native_1 = __importDefault(require("@emotion/native"));
13
30
  /**
14
31
  * A general (flex)box layout component that accepts props for flexbox layout
15
32
  * styles, such as `flex`, `alignItems`, `marginVertical`, etc.
@@ -21,7 +38,7 @@ import styled from '@emotion/native';
21
38
  * </Box>
22
39
  * ```
23
40
  */
24
- export const Box = styled.View((_a) => {
25
- var { flex } = _a, layoutProps = __rest(_a, ["flex"]);
26
- return (Object.assign({ flex: flex === true ? 1 : flex === false ? 0 : flex }, layoutProps));
41
+ exports.Box = native_1.default.View(function (_a) {
42
+ var flex = _a.flex, layoutProps = __rest(_a, ["flex"]);
43
+ return (__assign({ flex: flex === true ? 1 : flex === false ? 0 : flex }, layoutProps));
27
44
  });
@@ -1,34 +1,48 @@
1
- import React from 'react';
2
- import { ScrollView, View } from 'react-native';
3
- import styled from '@emotion/native';
4
- import { useTheme } from '../../../hooks';
5
- const TabButtonText = styled.Text(({ theme, active }) => ({
6
- color: active ? theme.tabs.activeTextColor : theme.tabs.inactiveTextColor,
7
- paddingVertical: theme.tabs.paddingVertical,
8
- paddingHorizontal: theme.tabs.paddingHorizontal,
9
- fontSize: theme.tabs.fontSize,
10
- fontWeight: theme.tabs.fontWeight,
11
- }));
12
- const hitSlop = { top: 8, left: 0, right: 0, bottom: 20 };
13
- const TabButtonTouchable = styled.TouchableOpacity(({ theme, active }) => ({
14
- borderWidth: theme.tabs.borderWidth,
15
- borderColor: active ? theme.tabs.activeBorderColor : theme.tabs.inactiveBorderColor,
16
- borderRadius: theme.tabs.borderRadius,
17
- backgroundColor: active ? theme.tabs.activeBackgroundColor : theme.tabs.inactiveBackgroundColor,
18
- }));
19
- export const TabButton = React.memo(({ onPress, id, active, children, testID }) => {
20
- return (React.createElement(TabButtonTouchable, { active: active, testID: testID, onPress: () => onPress(id), activeOpacity: 0.8, hitSlop: hitSlop },
21
- React.createElement(TabButtonText, { active: active }, children)));
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TabBar = exports.TabButton = void 0;
7
+ var react_1 = __importDefault(require("react"));
8
+ var react_native_1 = require("react-native");
9
+ var native_1 = __importDefault(require("@emotion/native"));
10
+ var hooks_1 = require("../../../hooks");
11
+ var TabButtonText = native_1.default.Text(function (_a) {
12
+ var theme = _a.theme, active = _a.active;
13
+ return ({
14
+ color: active ? theme.tabs.activeTextColor : theme.tabs.inactiveTextColor,
15
+ paddingVertical: theme.tabs.paddingVertical,
16
+ paddingHorizontal: theme.tabs.paddingHorizontal,
17
+ fontSize: theme.tabs.fontSize,
18
+ fontWeight: theme.tabs.fontWeight,
19
+ });
22
20
  });
23
- export const TabBar = React.memo(({ scrollable = false, style, children }) => {
24
- const theme = useTheme();
21
+ var hitSlop = { top: 8, left: 0, right: 0, bottom: 20 };
22
+ var TabButtonTouchable = native_1.default.TouchableOpacity(function (_a) {
23
+ var theme = _a.theme, active = _a.active;
24
+ return ({
25
+ borderWidth: theme.tabs.borderWidth,
26
+ borderColor: active ? theme.tabs.activeBorderColor : theme.tabs.inactiveBorderColor,
27
+ borderRadius: theme.tabs.borderRadius,
28
+ backgroundColor: active ? theme.tabs.activeBackgroundColor : theme.tabs.inactiveBackgroundColor,
29
+ });
30
+ });
31
+ exports.TabButton = react_1.default.memo(function (_a) {
32
+ var onPress = _a.onPress, id = _a.id, active = _a.active, children = _a.children, testID = _a.testID;
33
+ return (react_1.default.createElement(TabButtonTouchable, { active: active, testID: testID, onPress: function () { return onPress(id); }, activeOpacity: 0.8, hitSlop: hitSlop },
34
+ react_1.default.createElement(TabButtonText, { active: active }, children)));
35
+ });
36
+ exports.TabBar = react_1.default.memo(function (_a) {
37
+ var _b = _a.scrollable, scrollable = _b === void 0 ? false : _b, style = _a.style, children = _a.children;
38
+ var theme = (0, hooks_1.useTheme)();
25
39
  if (scrollable) {
26
- children = (React.createElement(ScrollView, { showsHorizontalScrollIndicator: false, horizontal: true, contentContainerStyle: { paddingHorizontal: theme.tokens.spacing2 } }, children));
40
+ children = (react_1.default.createElement(react_native_1.ScrollView, { showsHorizontalScrollIndicator: false, horizontal: true, contentContainerStyle: { paddingHorizontal: theme.tokens.spacing2 } }, children));
27
41
  }
28
- return (React.createElement(View, { style: style },
29
- React.createElement(TabBarContainer, null, children)));
42
+ return (react_1.default.createElement(react_native_1.View, { style: style },
43
+ react_1.default.createElement(TabBarContainer, null, children)));
30
44
  });
31
- const TabBarContainer = styled.View({
45
+ var TabBarContainer = native_1.default.View({
32
46
  flexDirection: 'row',
33
47
  paddingVertical: 6,
34
48
  justifyItems: 'center',
@@ -1,4 +1,7 @@
1
- const tokens = {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.darkTheme = exports.theme = void 0;
4
+ var tokens = {
2
5
  spacing1: 4,
3
6
  spacing2: 8,
4
7
  spacing3: 12,
@@ -44,19 +47,19 @@ const tokens = {
44
47
  },
45
48
  },
46
49
  };
47
- const text = {
50
+ var text = {
48
51
  primaryColor: tokens.color.navy,
49
52
  secondaryColor: tokens.color.grey700,
50
53
  linkColor: '#0000ff',
51
54
  };
52
- const textOnDark = {
55
+ var textOnDark = {
53
56
  primaryColor: tokens.color.white,
54
57
  secondaryColor: tokens.color.grey200,
55
58
  linkColor: tokens.color.blue600,
56
59
  };
57
- export const theme = {
58
- tokens,
59
- text,
60
+ exports.theme = {
61
+ tokens: tokens,
62
+ text: text,
60
63
  backgroundColor: tokens.color.white,
61
64
  preview: {
62
65
  containerBackgroundColor: tokens.color.white,
@@ -185,8 +188,8 @@ export const theme = {
185
188
  },
186
189
  },
187
190
  };
188
- export const darkTheme = {
189
- tokens,
191
+ exports.darkTheme = {
192
+ tokens: tokens,
190
193
  text: textOnDark,
191
194
  backgroundColor: tokens.color.offBlack,
192
195
  preview: {