@hero-design/rn 7.0.6 → 7.1.2
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.
- package/.eslintrc.json +4 -3
- package/babel.config.js +1 -1
- package/es/index.js +411 -134
- package/lib/index.js +411 -131
- package/package.json +5 -4
- package/playground/components/BottomNavigation.tsx +69 -0
- package/playground/components/Card.tsx +174 -112
- package/playground/components/FAB.tsx +49 -0
- package/playground/index.tsx +6 -1
- package/rollup.config.js +1 -1
- package/src/components/BottomNavigation/StyledBottomNavigation.tsx +58 -0
- package/src/components/BottomNavigation/__tests__/BottomNavigation.spec.tsx +95 -0
- package/src/components/BottomNavigation/__tests__/__snapshots__/BottomNavigation.spec.tsx.snap +315 -0
- package/src/components/BottomNavigation/index.tsx +169 -0
- package/src/components/Card/StyledCard.tsx +1 -0
- package/src/components/Card/__tests__/__snapshots__/Card.spec.tsx.snap +5 -4
- package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +5 -4
- package/src/components/FAB/AnimatedFABIcon.tsx +47 -0
- package/src/components/FAB/StyledFABContainer.tsx +14 -0
- package/src/components/FAB/StyledFABIcon.tsx +9 -0
- package/src/components/FAB/__tests__/AnimatedFABIcon.spec.tsx +20 -0
- package/src/components/FAB/__tests__/StyledFABContainer.spec.tsx +18 -0
- package/src/components/FAB/__tests__/StyledFABIcon.spec.tsx +16 -0
- package/src/components/FAB/__tests__/__snapshots__/AnimatedFABIcon.spec.tsx.snap +71 -0
- package/src/components/FAB/__tests__/__snapshots__/StyledFABContainer.spec.tsx.snap +46 -0
- package/src/components/FAB/__tests__/__snapshots__/StyledFABIcon.spec.tsx.snap +21 -0
- package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +120 -0
- package/src/components/FAB/__tests__/index.spec.tsx +58 -0
- package/src/components/FAB/index.tsx +56 -0
- package/src/components/Icon/index.tsx +1 -1
- package/src/components/Icon/utils.ts +6 -0
- package/src/components/Typography/Text/StyledText.tsx +5 -1
- package/src/components/Typography/Text/index.tsx +1 -1
- package/src/index.ts +6 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +30 -1
- package/src/theme/components/bottomNavigation.ts +23 -0
- package/src/theme/components/card.ts +1 -1
- package/src/theme/components/fab.ts +21 -0
- package/src/theme/components/typography.ts +1 -0
- package/src/theme/global/space.ts +11 -9
- package/src/theme/global/typography.ts +11 -9
- package/src/theme/index.ts +6 -0
- package/src/utils/__tests__/scale.spec.ts +26 -0
- package/src/utils/helpers.ts +4 -0
- package/src/utils/scale.ts +10 -0
- package/testUtils/setup.ts +4 -0
- package/types/playground/components/BottomNavigation.d.ts +2 -0
- package/types/playground/components/FAB.d.ts +2 -0
- package/types/src/components/BottomNavigation/StyledBottomNavigation.d.ts +17 -0
- package/types/{components/Card/__tests__/Card.spec.d.ts → src/components/BottomNavigation/__tests__/BottomNavigation.spec.d.ts} +0 -0
- package/types/src/components/BottomNavigation/index.d.ts +40 -0
- package/types/src/components/FAB/AnimatedFABIcon.d.ts +6 -0
- package/types/src/components/FAB/StyledFABContainer.d.ts +3 -0
- package/types/src/components/FAB/StyledFABIcon.d.ts +3 -0
- package/types/{components/Card/__tests__/StyledCard.spec.d.ts → src/components/FAB/__tests__/AnimatedFABIcon.spec.d.ts} +0 -0
- package/types/{components/Divider/__tests__/StyledDivider.spec.d.ts → src/components/FAB/__tests__/StyledFABContainer.spec.d.ts} +0 -0
- package/types/{components/ExampleComponent/__tests__/StyledView.spec.d.ts → src/components/FAB/__tests__/StyledFABIcon.spec.d.ts} +0 -0
- package/types/src/components/{Typography/Text/__test__ → FAB/__tests__}/index.spec.d.ts +0 -0
- package/types/src/components/FAB/index.d.ts +30 -0
- package/types/src/components/Icon/index.d.ts +1 -1
- package/types/src/components/Icon/utils.d.ts +2 -0
- package/types/src/components/Typography/Text/StyledText.d.ts +1 -1
- package/types/src/components/Typography/Text/index.d.ts +1 -1
- package/types/src/index.d.ts +4 -1
- package/types/src/theme/components/bottomNavigation.d.ts +17 -0
- package/types/src/theme/components/fab.d.ts +15 -0
- package/types/src/theme/components/typography.d.ts +1 -0
- package/types/src/theme/index.d.ts +4 -0
- package/types/src/{components/Typography/Text/__test__/StyledText.spec.d.ts → utils/__tests__/scale.spec.d.ts} +0 -0
- package/types/src/utils/helpers.d.ts +2 -0
- package/types/src/utils/scale.d.ts +2 -0
- package/.expo/README.md +0 -15
- package/.expo/packager-info.json +0 -10
- package/.expo/settings.json +0 -10
- package/types/components/Card/StyledCard.d.ts +0 -3
- package/types/components/Card/index.d.ts +0 -5
- package/types/components/Divider/StyledDivider.d.ts +0 -7
- package/types/components/Divider/index.d.ts +0 -12
- package/types/components/ExampleComponent/StyledView.d.ts +0 -7
- package/types/components/ExampleComponent/index.d.ts +0 -16
- package/types/index.d.ts +0 -5
- package/types/styled-components.d.ts +0 -6
- package/types/theme/__tests__/index.spec.d.ts +0 -1
- package/types/theme/components/card.d.ts +0 -10
- package/types/theme/components/divider.d.ts +0 -17
- package/types/theme/components/exampleComponent.d.ts +0 -14
- package/types/theme/global/borders.d.ts +0 -4
- package/types/theme/global/colors.d.ts +0 -26
- package/types/theme/global/index.d.ts +0 -63
- package/types/theme/global/space.d.ts +0 -12
- package/types/theme/global/typography.d.ts +0 -21
- package/types/theme/index.d.ts +0 -13
package/src/theme/index.ts
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
import globalTheme, { GlobalTheme } from './global';
|
|
2
2
|
|
|
3
3
|
import getBadgeTheme from './components/badge';
|
|
4
|
+
import getBottomNavigationTheme from './components/bottomNavigation';
|
|
4
5
|
import getCardTheme from './components/card';
|
|
5
6
|
import getDividerTheme from './components/divider';
|
|
6
7
|
import getIconTheme from './components/icon';
|
|
7
8
|
import getTypographyTheme from './components/typography';
|
|
9
|
+
import getFABTheme from './components/fab';
|
|
8
10
|
|
|
9
11
|
type Theme = GlobalTheme & {
|
|
10
12
|
__hd__: {
|
|
11
13
|
badge: ReturnType<typeof getBadgeTheme>;
|
|
14
|
+
bottomNavigation: ReturnType<typeof getBottomNavigationTheme>;
|
|
12
15
|
card: ReturnType<typeof getCardTheme>;
|
|
13
16
|
divider: ReturnType<typeof getDividerTheme>;
|
|
14
17
|
icon: ReturnType<typeof getIconTheme>;
|
|
15
18
|
typography: ReturnType<typeof getTypographyTheme>;
|
|
19
|
+
fab: ReturnType<typeof getFABTheme>;
|
|
16
20
|
};
|
|
17
21
|
};
|
|
18
22
|
|
|
@@ -20,10 +24,12 @@ const getTheme = (theme: GlobalTheme = globalTheme): Theme => ({
|
|
|
20
24
|
...theme,
|
|
21
25
|
__hd__: {
|
|
22
26
|
badge: getBadgeTheme(theme),
|
|
27
|
+
bottomNavigation: getBottomNavigationTheme(theme),
|
|
23
28
|
card: getCardTheme(theme),
|
|
24
29
|
divider: getDividerTheme(theme),
|
|
25
30
|
icon: getIconTheme(theme),
|
|
26
31
|
typography: getTypographyTheme(theme),
|
|
32
|
+
fab: getFABTheme(theme),
|
|
27
33
|
},
|
|
28
34
|
});
|
|
29
35
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Dimensions } from 'react-native';
|
|
2
|
+
import { scale, BASE_WIDTH } from '../scale';
|
|
3
|
+
|
|
4
|
+
jest.unmock('../scale'); // Unmock global mocking of scale for other tests
|
|
5
|
+
|
|
6
|
+
describe('scale', () => {
|
|
7
|
+
it('returns scale based on width when width < height', () => {
|
|
8
|
+
jest
|
|
9
|
+
.spyOn(Dimensions, 'get')
|
|
10
|
+
.mockReturnValue({ width: 400, height: 500, scale: 1, fontScale: 1 });
|
|
11
|
+
|
|
12
|
+
const size = 10;
|
|
13
|
+
|
|
14
|
+
expect(scale(size)).toBe((400 / BASE_WIDTH) * size);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('returns scale based on height when width > height', () => {
|
|
18
|
+
jest
|
|
19
|
+
.spyOn(Dimensions, 'get')
|
|
20
|
+
.mockReturnValue({ width: 700, height: 350, scale: 1, fontScale: 1 });
|
|
21
|
+
|
|
22
|
+
const size = 10;
|
|
23
|
+
|
|
24
|
+
expect(scale(size)).toBe((350 / BASE_WIDTH) * size);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Dimensions } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export const BASE_WIDTH = 390; // Based on iPhone 13's viewport size
|
|
4
|
+
|
|
5
|
+
export const scale = (size: number) => {
|
|
6
|
+
const { width, height } = Dimensions.get('window');
|
|
7
|
+
const shortDimension = width < height ? width : height;
|
|
8
|
+
|
|
9
|
+
return (shortDimension / BASE_WIDTH) * size;
|
|
10
|
+
};
|
package/testUtils/setup.ts
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
declare const BottomNavigationTab: import("styled-components").StyledComponent<typeof View, import("../../theme").Theme, {
|
|
3
|
+
themeVisibility?: boolean | undefined;
|
|
4
|
+
}, never>;
|
|
5
|
+
declare const BottomNavigationContainer: import("styled-components").StyledComponent<typeof View, import("../../theme").Theme, {}, never>;
|
|
6
|
+
declare const ContentWrapper: import("styled-components").StyledComponent<typeof View, import("../../theme").Theme, {}, never>;
|
|
7
|
+
declare const BottomBarWrapper: import("styled-components").StyledComponent<typeof View, import("../../theme").Theme, {
|
|
8
|
+
themeInsets: {
|
|
9
|
+
top: number;
|
|
10
|
+
right: number;
|
|
11
|
+
bottom: number;
|
|
12
|
+
left: number;
|
|
13
|
+
};
|
|
14
|
+
}, never>;
|
|
15
|
+
declare const BottomBar: import("styled-components").StyledComponent<typeof View, import("../../theme").Theme, {}, never>;
|
|
16
|
+
declare const BottomBarItem: import("styled-components").StyledComponent<typeof View, import("../../theme").Theme, {}, never>;
|
|
17
|
+
export { BottomBar, BottomBarItem, BottomNavigationTab, BottomNavigationContainer, BottomBarWrapper, ContentWrapper, };
|
|
File without changes
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
3
|
+
import Icon from '../Icon';
|
|
4
|
+
declare type IconType = ComponentProps<typeof Icon>['icon'];
|
|
5
|
+
export declare type Tab<V> = {
|
|
6
|
+
key: V;
|
|
7
|
+
title?: string;
|
|
8
|
+
icon: IconType;
|
|
9
|
+
component: ReactNode;
|
|
10
|
+
testID?: string;
|
|
11
|
+
};
|
|
12
|
+
interface BottomNavigationType<V extends string | number, T extends Tab<V>> extends ViewProps {
|
|
13
|
+
/**
|
|
14
|
+
* Callback which is called on tab change, receiving id of upcoming active Tab.
|
|
15
|
+
*/
|
|
16
|
+
onChange: (key: V) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Whether inactive tabs should be removed and unmounted in React.
|
|
19
|
+
* Defaults to `false`.
|
|
20
|
+
*/
|
|
21
|
+
renderActiveTabOnly?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Current selected tab key.
|
|
24
|
+
*/
|
|
25
|
+
selectedTabKey: V;
|
|
26
|
+
/**
|
|
27
|
+
* List of Tab to be rendered. Each Tab must have an unique id.
|
|
28
|
+
*/
|
|
29
|
+
tabs: T[];
|
|
30
|
+
/**
|
|
31
|
+
* Addditional style.
|
|
32
|
+
*/
|
|
33
|
+
style?: StyleProp<ViewStyle>;
|
|
34
|
+
/**
|
|
35
|
+
* Testing id of the component.
|
|
36
|
+
*/
|
|
37
|
+
testID?: string;
|
|
38
|
+
}
|
|
39
|
+
declare const BottomNavigation: <V extends string | number, T extends Tab<V>>({ onChange, renderActiveTabOnly, selectedTabKey, tabs, ...nativeProps }: BottomNavigationType<V, T>) => JSX.Element;
|
|
40
|
+
export default BottomNavigation;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { TouchableHighlight, TouchableHighlightProps } from 'react-native';
|
|
2
|
+
declare const StyledFABContainer: import("styled-components").StyledComponent<typeof TouchableHighlight, import("../../theme").Theme, TouchableHighlightProps, never>;
|
|
3
|
+
export { StyledFABContainer };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import { IconProps } from '../Icon';
|
|
3
|
+
interface FABProps {
|
|
4
|
+
/**
|
|
5
|
+
* Name of the Icon.
|
|
6
|
+
*/
|
|
7
|
+
icon: IconProps['icon'];
|
|
8
|
+
/**
|
|
9
|
+
* This function is called on pressing the button.
|
|
10
|
+
* */
|
|
11
|
+
onPress?: () => void;
|
|
12
|
+
/**
|
|
13
|
+
* Specify if the button is animated.
|
|
14
|
+
*/
|
|
15
|
+
animated?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Specify if the button is in active state. It only works if animated is true.
|
|
18
|
+
*/
|
|
19
|
+
active?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Addditional style.
|
|
22
|
+
*/
|
|
23
|
+
style?: StyleProp<ViewStyle>;
|
|
24
|
+
/**
|
|
25
|
+
* Testing id of the component.
|
|
26
|
+
*/
|
|
27
|
+
testID?: string;
|
|
28
|
+
}
|
|
29
|
+
declare const FAB: ({ onPress, icon, animated, testID, active, style }: FABProps) => JSX.Element;
|
|
30
|
+
export default FAB;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const isHeroIcon: (x: any) => x is "number" | "menu" | "image" | "switch" | "bold" | "target" | "restart" | "directory" | "document" | "feed" | "list" | "loading" | "sync" | "user" | "send" | "file" | "activate" | "add-person" | "adjustment" | "alignment" | "bank" | "bell" | "billing" | "bookmark" | "box-check" | "box" | "buildings" | "cake" | "calendar-clock" | "calendar" | "carat-down-small" | "carat-down" | "carat-left" | "carat-right" | "carat-up" | "circle-add" | "circle-cancel" | "circle-check" | "circle-down" | "circle-info" | "circle-left" | "circle-ok" | "circle-pencil" | "circle-question" | "circle-remove" | "circle-right" | "circle-up" | "circle-warning" | "clock" | "cloud-download" | "cloud-upload" | "cog" | "coin" | "contacts" | "credit-card" | "diamond" | "direction-arrows" | "dollar-coin-shine" | "double-buildings" | "edit-template" | "envelope" | "expense" | "eye-circle" | "eye-invisible" | "eye" | "face-meh" | "face-sad" | "face-smiley" | "feedbacks" | "file-certified" | "file-clone" | "file-copy" | "file-csv" | "file-dispose" | "file-doc" | "file-excel" | "file-export" | "file-lock" | "file-pdf" | "file-powerpoint" | "file-search" | "file-secured" | "file-sheets" | "file-slide" | "file-verified" | "file-word" | "folder-user" | "folder" | "funnel-filter" | "global-dollar" | "globe" | "graduation-cap" | "graph" | "happy-sun" | "health-bag" | "heart" | "home" | "import" | "incident-siren" | "instapay" | "loading-2" | "location" | "lock" | "media-content" | "moneybag" | "moon" | "multiple-stars" | "multiple-users" | "node" | "open-folder" | "paperclip" | "payment-summary" | "pencil" | "phone" | "piggy-bank" | "plane" | "play-circle" | "print" | "raising-hands" | "reply" | "reschedule" | "rostering" | "save" | "schedule" | "search-person" | "speaker" | "star-medal" | "star" | "steps-circle" | "stopwatch" | "suitcase" | "survey" | "tag" | "teams" | "timesheet" | "touch-id" | "trash-bin" | "unlock" | "video-1" | "video-2" | "activate-outlined" | "add-person-outlined" | "add-section-outlined" | "add-time-outlined" | "add" | "adjustment-outlined" | "alignment-2-outlined" | "alignment-outlined" | "all-caps" | "arrow-down" | "arrow-left" | "arrow-right" | "arrow-up" | "at-sign" | "bell-outlined" | "billing-outlined" | "body-outlined" | "bookmark-outlined" | "box-check-outlined" | "box-outlined" | "bullet-points" | "cake-outlined" | "calendar-dates-outlined" | "calendar-star-outlined" | "camera-outlined" | "cancel" | "checkmark" | "circle-add-outlined" | "circle-cancel-outlined" | "circle-down-outlined" | "circle-info-outlined" | "circle-left-outlined" | "circle-ok-outlined" | "circle-question-outlined" | "circle-remove-outlined" | "circle-right-outlined" | "circle-up-outlined" | "circle-warning-outlined" | "clock-2-outlined" | "clock-outlined" | "cog-outlined" | "coin-outlined" | "comment-outlined" | "contacts-outlined" | "credit-card-outlined" | "direction-arrows-outlined" | "directory-outlined" | "document-outlined" | "dollar-coin-shine-outlined" | "dollar-sign" | "double-buildings-outlined" | "double-left-arrows" | "double-right-arrows" | "download-outlined" | "edit-template-outlined" | "email-outlined" | "enter-arrow" | "envelope-outlined" | "expense-outlined" | "external-link" | "eye-invisible-outlined" | "eye-outlined" | "face-id" | "face-meh-outlined" | "face-open-smiley-outlined" | "face-sad-outlined" | "face-smiley-outlined" | "feed-outlined" | "file-certified-outlined" | "file-clone-outlined" | "file-copy-outlined" | "file-dispose-outlined" | "file-download-outlined" | "file-export-outlined" | "file-lock-outlined" | "file-outlined" | "file-search-outlined" | "file-secured-outlined" | "file-verified-outlined" | "folder-outlined" | "folder-user-outlined" | "funnel-filter-outline" | "graph-outlined" | "happy-sun-outlined" | "health-bag-outlined" | "heart-outlined" | "home-outlined" | "image-outlined" | "import-outlined" | "instapay-outlined" | "italic" | "link-1" | "link-2" | "list-outlined" | "location-outlined" | "lock-outlined" | "locked-file-outlined" | "log-out" | "media-content-outlined" | "menu-close" | "menu-expand" | "menu-fold-outlined" | "menu-unfold-outlined" | "moneybag-outlined" | "moon-outlined" | "more-horizontal" | "more-vertical" | "multiple-folders-outlined" | "multiple-users-outlined" | "node-outlined" | "number-points" | "payment-summary-outlined" | "payslip-outlined" | "pencil-outlined" | "percentage" | "phone-outlined" | "piggy-bank-outlined" | "plane-outlined" | "play-circle-outlined" | "print-outlined" | "qr-code-outlined" | "re-assign" | "refresh" | "remove" | "reply-outlined" | "return-arrow" | "rostering-outlined" | "save-outlined" | "schedule-outlined" | "search-outlined" | "send-outlined" | "share-1" | "share-2" | "single-down-arrow" | "single-left-arrow" | "single-right-arrow" | "single-up-arrow" | "speaker-outlined" | "star-outlined" | "stopwatch-outlined" | "strikethrough" | "survey-outlined" | "switch-outlined" | "target-outlined" | "timesheet-outlined" | "transfer" | "trash-bin-outlined" | "unavailable" | "underline" | "unlock-outlined" | "upload-outlined" | "user-outlined" | "video-1-outlined" | "video-2-outlined";
|
|
2
|
+
export { isHeroIcon };
|
|
@@ -2,6 +2,6 @@ import { Text } from 'react-native';
|
|
|
2
2
|
declare const StyledText: import("styled-components").StyledComponent<typeof Text, import("../../../theme").Theme, {
|
|
3
3
|
themeFontSize: 'small' | 'medium' | 'large' | 'xlarge';
|
|
4
4
|
themeFontWeight: 'light' | 'regular' | 'semi-bold';
|
|
5
|
-
themeIntent: 'body' | 'subdued';
|
|
5
|
+
themeIntent: 'body' | 'subdued' | 'primary';
|
|
6
6
|
}, never>;
|
|
7
7
|
export { StyledText };
|
package/types/src/index.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { ThemeProvider, useTheme } from 'styled-components-native';
|
|
2
2
|
import theme, { getTheme } from './theme';
|
|
3
|
+
import { scale } from './utils/scale';
|
|
3
4
|
import Badge from './components/Badge';
|
|
5
|
+
import BottomNavigation from './components/BottomNavigation';
|
|
4
6
|
import Card from './components/Card';
|
|
5
7
|
import Divider from './components/Divider';
|
|
6
8
|
import Icon from './components/Icon';
|
|
7
9
|
import Typography from './components/Typography';
|
|
8
|
-
|
|
10
|
+
import FAB from './components/FAB';
|
|
11
|
+
export { theme, getTheme, useTheme, scale, ThemeProvider, Badge, BottomNavigation, Card, Divider, Icon, Typography, FAB, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { GlobalTheme } from '../global';
|
|
2
|
+
declare const getBottomNavigationTheme: (theme: GlobalTheme) => {
|
|
3
|
+
colors: {
|
|
4
|
+
shadow: string;
|
|
5
|
+
background: string;
|
|
6
|
+
};
|
|
7
|
+
shadows: {
|
|
8
|
+
offset: string;
|
|
9
|
+
opacity: number;
|
|
10
|
+
radius: string;
|
|
11
|
+
elevation: number;
|
|
12
|
+
};
|
|
13
|
+
sizes: {
|
|
14
|
+
height: number;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default getBottomNavigationTheme;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { GlobalTheme } from '../global';
|
|
2
|
+
declare const getFABTheme: (theme: GlobalTheme) => {
|
|
3
|
+
fontSizes: {
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
colors: {
|
|
7
|
+
buttonBackground: string;
|
|
8
|
+
icon: string;
|
|
9
|
+
};
|
|
10
|
+
sizes: {
|
|
11
|
+
width: string;
|
|
12
|
+
height: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default getFABTheme;
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { GlobalTheme } from './global';
|
|
2
2
|
import getBadgeTheme from './components/badge';
|
|
3
|
+
import getBottomNavigationTheme from './components/bottomNavigation';
|
|
3
4
|
import getCardTheme from './components/card';
|
|
4
5
|
import getDividerTheme from './components/divider';
|
|
5
6
|
import getIconTheme from './components/icon';
|
|
6
7
|
import getTypographyTheme from './components/typography';
|
|
8
|
+
import getFABTheme from './components/fab';
|
|
7
9
|
declare type Theme = GlobalTheme & {
|
|
8
10
|
__hd__: {
|
|
9
11
|
badge: ReturnType<typeof getBadgeTheme>;
|
|
12
|
+
bottomNavigation: ReturnType<typeof getBottomNavigationTheme>;
|
|
10
13
|
card: ReturnType<typeof getCardTheme>;
|
|
11
14
|
divider: ReturnType<typeof getDividerTheme>;
|
|
12
15
|
icon: ReturnType<typeof getIconTheme>;
|
|
13
16
|
typography: ReturnType<typeof getTypographyTheme>;
|
|
17
|
+
fab: ReturnType<typeof getFABTheme>;
|
|
14
18
|
};
|
|
15
19
|
};
|
|
16
20
|
declare const getTheme: (theme?: GlobalTheme) => Theme;
|
|
File without changes
|
package/.expo/README.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
> Why do I have a folder named ".expo" in my project?
|
|
2
|
-
|
|
3
|
-
The ".expo" folder is created when an Expo project is started using "expo start" command.
|
|
4
|
-
|
|
5
|
-
> What do the files contain?
|
|
6
|
-
|
|
7
|
-
- "devices.json": contains information about devices that have recently opened this project. This is used to populate the "Development sessions" list in your development builds.
|
|
8
|
-
- "packager-info.json": contains port numbers and process PIDs that are used to serve the application to the mobile device/simulator.
|
|
9
|
-
- "settings.json": contains the server configuration that is used to serve the application manifest.
|
|
10
|
-
|
|
11
|
-
> Should I commit the ".expo" folder?
|
|
12
|
-
|
|
13
|
-
No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.
|
|
14
|
-
|
|
15
|
-
Upon project creation, the ".expo" folder is already added to your ".gitignore" file.
|
package/.expo/packager-info.json
DELETED
package/.expo/settings.json
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { View } from 'react-native';
|
|
2
|
-
declare type MarginSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
3
|
-
declare const StyledDivider: import("styled-components").StyledComponent<typeof View, import("../../theme").Theme, {
|
|
4
|
-
themeMarginHorizontal?: MarginSize | undefined;
|
|
5
|
-
themeMarginVertical?: MarginSize | undefined;
|
|
6
|
-
}, never>;
|
|
7
|
-
export { StyledDivider };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
interface DividerProps {
|
|
2
|
-
/**
|
|
3
|
-
* Horizontal margin size. There is no margin by default.
|
|
4
|
-
*/
|
|
5
|
-
marginHorizontal?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
6
|
-
/**
|
|
7
|
-
* Vertical margin size. There is no margin by default.
|
|
8
|
-
*/
|
|
9
|
-
marginVertical?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
10
|
-
}
|
|
11
|
-
declare const Divider: ({ marginHorizontal, marginVertical }: DividerProps) => JSX.Element;
|
|
12
|
-
export default Divider;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { View } from 'react-native';
|
|
2
|
-
declare const Square: import("styled-components").StyledComponent<typeof View, import("../../theme").Theme, {
|
|
3
|
-
themeSize: 'small' | 'medium' | 'large';
|
|
4
|
-
themeMargin: 'small' | 'medium' | 'large';
|
|
5
|
-
themeBgColor: 'primary' | 'danger' | 'warning';
|
|
6
|
-
}, never>;
|
|
7
|
-
export { Square };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
interface Props {
|
|
2
|
-
/**
|
|
3
|
-
* Size.
|
|
4
|
-
*/
|
|
5
|
-
size?: 'small' | 'medium' | 'large';
|
|
6
|
-
/**
|
|
7
|
-
* Margin.
|
|
8
|
-
*/
|
|
9
|
-
margin: 'small' | 'medium' | 'large';
|
|
10
|
-
/**
|
|
11
|
-
* Background color.
|
|
12
|
-
*/
|
|
13
|
-
bgColor: 'primary' | 'danger' | 'warning';
|
|
14
|
-
}
|
|
15
|
-
declare const ExampleComponent: ({ size, margin, bgColor }: Props) => JSX.Element;
|
|
16
|
-
export default ExampleComponent;
|
package/types/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/// <reference types="styled-components-react-native" />
|
|
2
|
-
import * as styledComponents from 'styled-components/native';
|
|
3
|
-
import type { Theme } from './theme';
|
|
4
|
-
declare const styled: styledComponents.ReactNativeStyledInterface<Theme>, useTheme: () => Theme, css: import("styled-components").ThemedCssFunction<Theme>, ThemeProvider: import("styled-components").ThemeProviderComponent<Theme, Theme>;
|
|
5
|
-
export { useTheme, css, ThemeProvider };
|
|
6
|
-
export default styled;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { GlobalTheme } from '../global';
|
|
2
|
-
declare const getDividerTheme: (theme: GlobalTheme) => {
|
|
3
|
-
colors: {
|
|
4
|
-
default: string;
|
|
5
|
-
};
|
|
6
|
-
space: {
|
|
7
|
-
xsmall: string;
|
|
8
|
-
small: string;
|
|
9
|
-
medium: string;
|
|
10
|
-
large: string;
|
|
11
|
-
xlarge: string;
|
|
12
|
-
};
|
|
13
|
-
borderWiths: {
|
|
14
|
-
default: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export default getDividerTheme;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { GlobalTheme } from '../global';
|
|
2
|
-
declare const getExampleComponentTheme: (theme: GlobalTheme) => {
|
|
3
|
-
colors: {
|
|
4
|
-
primaryBg: string;
|
|
5
|
-
dangerBg: string;
|
|
6
|
-
warningBg: string;
|
|
7
|
-
};
|
|
8
|
-
space: {
|
|
9
|
-
smallMargin: number;
|
|
10
|
-
mediumMargin: number;
|
|
11
|
-
largeMargin: number;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export default getExampleComponentTheme;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { palette } from '@hero-design/colors';
|
|
2
|
-
declare const systemPalette: {
|
|
3
|
-
primary: string;
|
|
4
|
-
primaryLight: string;
|
|
5
|
-
info: string;
|
|
6
|
-
infoLight: string;
|
|
7
|
-
infoBackground: string;
|
|
8
|
-
success: string;
|
|
9
|
-
successDark: string;
|
|
10
|
-
successLight: string;
|
|
11
|
-
successBackground: string;
|
|
12
|
-
danger: string;
|
|
13
|
-
dangerLight: string;
|
|
14
|
-
dangerBackground: string;
|
|
15
|
-
warning: string;
|
|
16
|
-
warningDark: string;
|
|
17
|
-
warningBackground: string;
|
|
18
|
-
platformBackground: string;
|
|
19
|
-
backgroundLight: string;
|
|
20
|
-
backgroundDark: string;
|
|
21
|
-
text: string;
|
|
22
|
-
disabledText: string;
|
|
23
|
-
invertedText: string;
|
|
24
|
-
outline: string;
|
|
25
|
-
};
|
|
26
|
-
export { palette, systemPalette };
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
declare const globalTheme: {
|
|
2
|
-
colors: {
|
|
3
|
-
primary: string;
|
|
4
|
-
primaryLight: string;
|
|
5
|
-
info: string;
|
|
6
|
-
infoLight: string;
|
|
7
|
-
infoBackground: string;
|
|
8
|
-
success: string;
|
|
9
|
-
successDark: string;
|
|
10
|
-
successLight: string;
|
|
11
|
-
successBackground: string;
|
|
12
|
-
danger: string;
|
|
13
|
-
dangerLight: string;
|
|
14
|
-
dangerBackground: string;
|
|
15
|
-
warning: string;
|
|
16
|
-
warningDark: string;
|
|
17
|
-
warningBackground: string;
|
|
18
|
-
platformBackground: string;
|
|
19
|
-
backgroundLight: string;
|
|
20
|
-
backgroundDark: string;
|
|
21
|
-
text: string;
|
|
22
|
-
disabledText: string;
|
|
23
|
-
invertedText: string;
|
|
24
|
-
outline: string;
|
|
25
|
-
};
|
|
26
|
-
space: {
|
|
27
|
-
xxsmall: number;
|
|
28
|
-
xsmall: number;
|
|
29
|
-
small: number;
|
|
30
|
-
medium: number;
|
|
31
|
-
large: number;
|
|
32
|
-
xlarge: number;
|
|
33
|
-
xxlarge: number;
|
|
34
|
-
xxxlarge: number;
|
|
35
|
-
xxxxlarge: number;
|
|
36
|
-
};
|
|
37
|
-
fontSizes: {
|
|
38
|
-
xlarge: number;
|
|
39
|
-
large: number;
|
|
40
|
-
medium: number;
|
|
41
|
-
small: number;
|
|
42
|
-
xsmall: number;
|
|
43
|
-
};
|
|
44
|
-
fontWeights: {
|
|
45
|
-
light: number;
|
|
46
|
-
regular: number;
|
|
47
|
-
semiBold: number;
|
|
48
|
-
bold: number;
|
|
49
|
-
};
|
|
50
|
-
lineHeights: {
|
|
51
|
-
xlarge: number;
|
|
52
|
-
large: number;
|
|
53
|
-
medium: number;
|
|
54
|
-
small: number;
|
|
55
|
-
xsmall: number;
|
|
56
|
-
};
|
|
57
|
-
borderWidths: {
|
|
58
|
-
base: number;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
declare type GlobalTheme = typeof globalTheme;
|
|
62
|
-
export { GlobalTheme };
|
|
63
|
-
export default globalTheme;
|