@hero-design/rn 6.8.0 → 7.0.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 +1 -0
- package/.expo/README.md +15 -0
- package/.expo/packager-info.json +10 -0
- package/.expo/settings.json +10 -0
- package/app.json +4 -0
- package/assets/fonts/hero-icons.ttf +0 -0
- package/es/index.js +10053 -131
- package/jest.config.js +5 -0
- package/lib/index.js +10057 -130
- package/package.json +24 -4
- package/playground/components/Badge.tsx +50 -0
- package/playground/components/Card.tsx +52 -0
- package/playground/components/Icon.tsx +140 -0
- package/playground/components/Typography.tsx +21 -0
- package/playground/index.tsx +42 -9
- package/react-native.config.js +5 -0
- package/src/components/Badge/StyledBadge.tsx +34 -0
- package/src/components/Badge/__tests__/Badge.spec.tsx +50 -0
- package/src/components/Badge/__tests__/__snapshots__/Badge.spec.tsx.snap +161 -0
- package/src/components/Badge/index.tsx +35 -0
- package/src/components/Card/StyledCard.tsx +9 -0
- package/src/components/Card/__tests__/Card.spec.tsx +36 -0
- package/src/components/Card/__tests__/StyledCard.spec.tsx +15 -0
- package/src/components/Card/__tests__/__snapshots__/Card.spec.tsx.snap +39 -0
- package/src/components/Card/__tests__/__snapshots__/StyledCard.spec.tsx.snap +18 -0
- package/src/components/Card/index.tsx +9 -0
- package/src/components/Icon/HeroIcon/index.tsx +30 -0
- package/src/components/Icon/HeroIcon/selection.json +1 -0
- package/src/components/Icon/IconList.ts +298 -0
- package/src/components/Icon/__tests__/Icon.spec.tsx +36 -0
- package/src/components/Icon/__tests__/__snapshots__/Icon.spec.tsx.snap +43 -0
- package/src/components/Icon/index.tsx +47 -0
- package/src/components/Typography/Text/StyledText.tsx +69 -0
- package/src/components/Typography/Text/__test__/StyledText.spec.tsx +62 -0
- package/src/components/Typography/Text/__test__/__snapshots__/StyledText.spec.tsx.snap +172 -0
- package/src/components/Typography/Text/__test__/index.spec.tsx +11 -0
- package/src/components/Typography/Text/index.tsx +41 -0
- package/src/components/Typography/index.tsx +11 -0
- package/src/index.ts +15 -1
- package/src/testHelpers/renderWithTheme.tsx +8 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +79 -0
- package/src/theme/components/badge.ts +38 -0
- package/src/theme/components/card.ts +15 -0
- package/src/theme/components/icon.ts +24 -0
- package/src/theme/components/typography.ts +32 -0
- package/src/theme/global/typography.ts +4 -0
- package/src/theme/index.ts +12 -0
- package/testUtils/setup.ts +3 -0
- package/tsconfig.json +2 -6
- package/types/components/ExampleComponent/StyledView.d.ts +7 -0
- package/types/components/{Divider/__tests__/StyledDivider.spec.d.ts → ExampleComponent/__tests__/StyledView.spec.d.ts} +0 -0
- package/types/components/ExampleComponent/index.d.ts +16 -0
- package/types/index.d.ts +3 -3
- package/types/playground/components/Badge.d.ts +2 -0
- package/types/playground/components/Card.d.ts +2 -0
- package/types/playground/components/Divider.d.ts +2 -0
- package/types/playground/components/Icon.d.ts +2 -0
- package/types/playground/components/Typography.d.ts +2 -0
- package/types/playground/index.d.ts +2 -0
- package/types/src/components/Badge/StyledBadge.d.ts +9 -0
- package/types/{theme/__tests__/index.spec.d.ts → src/components/Badge/__tests__/Badge.spec.d.ts} +0 -0
- package/types/src/components/Badge/index.d.ts +22 -0
- package/types/src/components/Card/StyledCard.d.ts +3 -0
- package/types/src/components/Card/__tests__/Card.spec.d.ts +1 -0
- package/types/src/components/Card/__tests__/StyledCard.spec.d.ts +1 -0
- package/types/src/components/Card/index.d.ts +5 -0
- package/types/{components → src/components}/Divider/StyledDivider.d.ts +0 -0
- package/types/src/components/Divider/__tests__/StyledDivider.spec.d.ts +1 -0
- package/types/{components → src/components}/Divider/index.d.ts +0 -0
- package/types/src/components/Icon/HeroIcon/index.d.ts +7 -0
- package/types/src/components/Icon/IconList.d.ts +2 -0
- package/types/src/components/Icon/__tests__/Icon.spec.d.ts +1 -0
- package/types/src/components/Icon/index.d.ts +27 -0
- package/types/src/components/Typography/Text/StyledText.d.ts +7 -0
- package/types/src/components/Typography/Text/__test__/StyledText.spec.d.ts +1 -0
- package/types/src/components/Typography/Text/__test__/index.spec.d.ts +1 -0
- package/types/src/components/Typography/Text/index.d.ts +22 -0
- package/types/src/components/Typography/index.d.ts +6 -0
- package/types/src/index.d.ts +8 -0
- package/types/src/styled-components.d.ts +6 -0
- package/types/src/testHelpers/renderWithTheme.d.ts +3 -0
- package/types/src/theme/__tests__/index.spec.d.ts +1 -0
- package/types/src/theme/components/badge.d.ts +29 -0
- package/types/src/theme/components/card.d.ts +10 -0
- package/types/{theme → src/theme}/components/divider.d.ts +0 -0
- package/types/src/theme/components/icon.d.ts +19 -0
- package/types/src/theme/components/typography.d.ts +25 -0
- package/types/{theme → src/theme}/global/borders.d.ts +0 -0
- package/types/src/theme/global/colors.d.ts +26 -0
- package/types/src/theme/global/index.d.ts +67 -0
- package/types/src/theme/global/space.d.ts +12 -0
- package/types/src/theme/global/typography.d.ts +25 -0
- package/types/src/theme/index.d.ts +19 -0
- package/types/theme/colors.d.ts +24 -0
- package/types/theme/components/demoStyle.d.ts +11 -0
- package/types/theme/components/exampleComponent.d.ts +14 -0
- package/types/theme/global/colors.d.ts +0 -2
- package/types/theme/global/index.d.ts +0 -5
- package/types/theme/index.d.ts +2 -2
- package/types/theme/space.d.ts +12 -0
- package/types/theme/typography.d.ts +21 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare type ThemeSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
2
|
+
declare type ThemeIntent = 'text' | 'primary' | 'info' | 'danger' | 'success' | 'warning';
|
|
3
|
+
declare const StyledHeroIcon: import("styled-components").StyledComponent<typeof import("react-native-vector-icons/Icon").Icon, import("../../../theme").Theme, {
|
|
4
|
+
themeSize: ThemeSize;
|
|
5
|
+
themeIntent: ThemeIntent;
|
|
6
|
+
}, never>;
|
|
7
|
+
export default StyledHeroIcon;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const IconList: readonly ["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", "directory", "document", "dollar-coin-shine", "double-buildings", "edit-template", "envelope", "expense", "eye-circle", "eye-invisible", "eye", "face-meh", "face-sad", "face-smiley", "feed", "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", "file", "folder-user", "folder", "funnel-filter", "global-dollar", "globe", "graduation-cap", "graph", "happy-sun", "health-bag", "heart", "home", "image", "import", "incident-siren", "instapay", "list", "loading", "loading-2", "location", "lock", "media-content", "menu", "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", "send", "speaker", "star-medal", "star", "steps-circle", "stopwatch", "suitcase", "survey", "switch", "tag", "target", "teams", "timesheet", "touch-id", "trash-bin", "unlock", "user", "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", "bold", "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", "number", "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", "restart", "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", "sync", "target-outlined", "timesheet-outlined", "transfer", "trash-bin-outlined", "unavailable", "underline", "unlock-outlined", "upload-outlined", "user-outlined", "video-1-outlined", "video-2-outlined"];
|
|
2
|
+
export default IconList;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import IconList from './IconList';
|
|
3
|
+
declare type IconName = typeof IconList[number];
|
|
4
|
+
interface IconProps {
|
|
5
|
+
/**
|
|
6
|
+
* Name of the `Icon`.
|
|
7
|
+
*/
|
|
8
|
+
icon: IconName;
|
|
9
|
+
/**
|
|
10
|
+
* Addditional style to be applied for `Icon`.
|
|
11
|
+
*/
|
|
12
|
+
style?: StyleProp<ViewStyle>;
|
|
13
|
+
/**
|
|
14
|
+
* Size of the `Icon`.
|
|
15
|
+
*/
|
|
16
|
+
size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
17
|
+
/**
|
|
18
|
+
* Intent of the `Icon`.
|
|
19
|
+
*/
|
|
20
|
+
intent?: 'text' | 'primary' | 'info' | 'danger' | 'success' | 'warning';
|
|
21
|
+
/**
|
|
22
|
+
* Testing id of the component.
|
|
23
|
+
*/
|
|
24
|
+
testID?: string;
|
|
25
|
+
}
|
|
26
|
+
declare const Icon: ({ icon, style, size, intent, testID, }: IconProps) => JSX.Element;
|
|
27
|
+
export default Icon;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Text } from 'react-native';
|
|
2
|
+
declare const StyledText: import("styled-components").StyledComponent<typeof Text, import("../../../theme").Theme, {
|
|
3
|
+
themeFontSize: 'small' | 'medium' | 'large' | 'xlarge';
|
|
4
|
+
themeFontWeight: 'light' | 'regular' | 'semi-bold';
|
|
5
|
+
themeIntent: 'body' | 'subdued';
|
|
6
|
+
}, never>;
|
|
7
|
+
export { StyledText };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TextProps as NativeTextProps } from 'react-native';
|
|
3
|
+
interface TextProps extends NativeTextProps {
|
|
4
|
+
/**
|
|
5
|
+
* Text content.
|
|
6
|
+
*/
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Size of the text.
|
|
10
|
+
*/
|
|
11
|
+
fontSize?: 'small' | 'medium' | 'large' | 'xlarge';
|
|
12
|
+
/**
|
|
13
|
+
* Font weight of the text.
|
|
14
|
+
*/
|
|
15
|
+
fontWeight?: 'light' | 'regular' | 'semi-bold';
|
|
16
|
+
/**
|
|
17
|
+
* Visual intent color to apply to the text.
|
|
18
|
+
*/
|
|
19
|
+
intent?: 'body' | 'subdued';
|
|
20
|
+
}
|
|
21
|
+
declare const Text: ({ children, fontSize, fontWeight, intent, ...nativeProps }: TextProps) => JSX.Element;
|
|
22
|
+
export default Text;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ThemeProvider, useTheme } from 'styled-components-native';
|
|
2
|
+
import theme, { getTheme } from './theme';
|
|
3
|
+
import Badge from './components/Badge';
|
|
4
|
+
import Card from './components/Card';
|
|
5
|
+
import Divider from './components/Divider';
|
|
6
|
+
import Icon from './components/Icon';
|
|
7
|
+
import Typography from './components/Typography';
|
|
8
|
+
export { theme, getTheme, useTheme, ThemeProvider, Badge, Card, Divider, Icon, Typography, };
|
|
@@ -0,0 +1,6 @@
|
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { GlobalTheme } from '../global';
|
|
2
|
+
declare const getBadgeTheme: (theme: GlobalTheme) => {
|
|
3
|
+
borderWidths: {
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
colors: {
|
|
7
|
+
danger: string;
|
|
8
|
+
dangerBackground: string;
|
|
9
|
+
info: string;
|
|
10
|
+
infoBackground: string;
|
|
11
|
+
success: string;
|
|
12
|
+
successBackground: string;
|
|
13
|
+
warning: string;
|
|
14
|
+
warningBackground: string;
|
|
15
|
+
};
|
|
16
|
+
padding: {
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
fontSizes: {
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
fontWeights: {
|
|
23
|
+
default: number;
|
|
24
|
+
};
|
|
25
|
+
radii: {
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export default getBadgeTheme;
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { GlobalTheme } from '../global';
|
|
2
|
+
declare const getIconTheme: (theme: GlobalTheme) => {
|
|
3
|
+
colors: {
|
|
4
|
+
text: string;
|
|
5
|
+
primary: string;
|
|
6
|
+
info: string;
|
|
7
|
+
danger: string;
|
|
8
|
+
success: string;
|
|
9
|
+
warning: string;
|
|
10
|
+
};
|
|
11
|
+
sizes: {
|
|
12
|
+
xsmall: number;
|
|
13
|
+
small: number;
|
|
14
|
+
medium: number;
|
|
15
|
+
large: number;
|
|
16
|
+
xlarge: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export default getIconTheme;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { GlobalTheme } from '../global';
|
|
2
|
+
declare const getTypographyTheme: (theme: GlobalTheme) => {
|
|
3
|
+
colors: {
|
|
4
|
+
body: string;
|
|
5
|
+
subdued: string;
|
|
6
|
+
};
|
|
7
|
+
fontSizes: {
|
|
8
|
+
small: number;
|
|
9
|
+
medium: number;
|
|
10
|
+
large: number;
|
|
11
|
+
xlarge: number;
|
|
12
|
+
};
|
|
13
|
+
fontWeights: {
|
|
14
|
+
light: number;
|
|
15
|
+
regular: number;
|
|
16
|
+
semiBold: number;
|
|
17
|
+
};
|
|
18
|
+
lineHeights: {
|
|
19
|
+
small: string;
|
|
20
|
+
medium: string;
|
|
21
|
+
large: string;
|
|
22
|
+
xlarge: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default getTypographyTheme;
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
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 };
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
xxxxxlarge: number;
|
|
39
|
+
xxxxlarge: number;
|
|
40
|
+
xxxlarge: number;
|
|
41
|
+
xxlarge: number;
|
|
42
|
+
xlarge: number;
|
|
43
|
+
large: number;
|
|
44
|
+
medium: number;
|
|
45
|
+
small: number;
|
|
46
|
+
xsmall: number;
|
|
47
|
+
};
|
|
48
|
+
fontWeights: {
|
|
49
|
+
light: number;
|
|
50
|
+
regular: number;
|
|
51
|
+
semiBold: number;
|
|
52
|
+
bold: number;
|
|
53
|
+
};
|
|
54
|
+
lineHeights: {
|
|
55
|
+
xlarge: number;
|
|
56
|
+
large: number;
|
|
57
|
+
medium: number;
|
|
58
|
+
small: number;
|
|
59
|
+
xsmall: number;
|
|
60
|
+
};
|
|
61
|
+
borderWidths: {
|
|
62
|
+
base: number;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
declare type GlobalTheme = typeof globalTheme;
|
|
66
|
+
export { GlobalTheme };
|
|
67
|
+
export default globalTheme;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const fontSizes: {
|
|
2
|
+
xxxxxlarge: number;
|
|
3
|
+
xxxxlarge: number;
|
|
4
|
+
xxxlarge: number;
|
|
5
|
+
xxlarge: number;
|
|
6
|
+
xlarge: number;
|
|
7
|
+
large: number;
|
|
8
|
+
medium: number;
|
|
9
|
+
small: number;
|
|
10
|
+
xsmall: number;
|
|
11
|
+
};
|
|
12
|
+
declare const fontWeights: {
|
|
13
|
+
light: number;
|
|
14
|
+
regular: number;
|
|
15
|
+
semiBold: number;
|
|
16
|
+
bold: number;
|
|
17
|
+
};
|
|
18
|
+
declare const lineHeights: {
|
|
19
|
+
xlarge: number;
|
|
20
|
+
large: number;
|
|
21
|
+
medium: number;
|
|
22
|
+
small: number;
|
|
23
|
+
xsmall: number;
|
|
24
|
+
};
|
|
25
|
+
export { fontSizes, fontWeights, lineHeights };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { GlobalTheme } from './global';
|
|
2
|
+
import getBadgeTheme from './components/badge';
|
|
3
|
+
import getCardTheme from './components/card';
|
|
4
|
+
import getDividerTheme from './components/divider';
|
|
5
|
+
import getIconTheme from './components/icon';
|
|
6
|
+
import getTypographyTheme from './components/typography';
|
|
7
|
+
declare type Theme = GlobalTheme & {
|
|
8
|
+
__hd__: {
|
|
9
|
+
badge: ReturnType<typeof getBadgeTheme>;
|
|
10
|
+
card: ReturnType<typeof getCardTheme>;
|
|
11
|
+
divider: ReturnType<typeof getDividerTheme>;
|
|
12
|
+
icon: ReturnType<typeof getIconTheme>;
|
|
13
|
+
typography: ReturnType<typeof getTypographyTheme>;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
declare const getTheme: (theme?: GlobalTheme) => Theme;
|
|
17
|
+
declare const theme: Theme;
|
|
18
|
+
export { Theme, getTheme };
|
|
19
|
+
export default theme;
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
backgroundDark: string;
|
|
20
|
+
text: string;
|
|
21
|
+
disabledText: string;
|
|
22
|
+
invertedText: string;
|
|
23
|
+
};
|
|
24
|
+
export { palette, systemPalette };
|
|
@@ -0,0 +1,14 @@
|
|
|
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;
|
|
@@ -16,11 +16,9 @@ declare const systemPalette: {
|
|
|
16
16
|
warningDark: string;
|
|
17
17
|
warningBackground: string;
|
|
18
18
|
platformBackground: string;
|
|
19
|
-
backgroundLight: string;
|
|
20
19
|
backgroundDark: string;
|
|
21
20
|
text: string;
|
|
22
21
|
disabledText: string;
|
|
23
22
|
invertedText: string;
|
|
24
|
-
outline: string;
|
|
25
23
|
};
|
|
26
24
|
export { palette, systemPalette };
|
|
@@ -16,12 +16,10 @@ declare const globalTheme: {
|
|
|
16
16
|
warningDark: string;
|
|
17
17
|
warningBackground: string;
|
|
18
18
|
platformBackground: string;
|
|
19
|
-
backgroundLight: string;
|
|
20
19
|
backgroundDark: string;
|
|
21
20
|
text: string;
|
|
22
21
|
disabledText: string;
|
|
23
22
|
invertedText: string;
|
|
24
|
-
outline: string;
|
|
25
23
|
};
|
|
26
24
|
space: {
|
|
27
25
|
xxsmall: number;
|
|
@@ -54,9 +52,6 @@ declare const globalTheme: {
|
|
|
54
52
|
small: number;
|
|
55
53
|
xsmall: number;
|
|
56
54
|
};
|
|
57
|
-
borderWidths: {
|
|
58
|
-
base: number;
|
|
59
|
-
};
|
|
60
55
|
};
|
|
61
56
|
declare type GlobalTheme = typeof globalTheme;
|
|
62
57
|
export { GlobalTheme };
|
package/types/theme/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { GlobalTheme } from './global';
|
|
2
|
-
import
|
|
2
|
+
import getExampleComponentTheme from './components/exampleComponent';
|
|
3
3
|
declare type Theme = GlobalTheme & {
|
|
4
4
|
__hd__: {
|
|
5
|
-
|
|
5
|
+
exampleComponent: ReturnType<typeof getExampleComponentTheme>;
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
8
|
declare const getTheme: (theme?: GlobalTheme) => Theme;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare const fontSizes: {
|
|
2
|
+
xlarge: number;
|
|
3
|
+
large: number;
|
|
4
|
+
medium: number;
|
|
5
|
+
small: number;
|
|
6
|
+
xsmall: number;
|
|
7
|
+
};
|
|
8
|
+
declare const fontWeights: {
|
|
9
|
+
light: number;
|
|
10
|
+
regular: number;
|
|
11
|
+
semiBold: number;
|
|
12
|
+
bold: number;
|
|
13
|
+
};
|
|
14
|
+
declare const lineHeights: {
|
|
15
|
+
xlarge: number;
|
|
16
|
+
large: number;
|
|
17
|
+
medium: number;
|
|
18
|
+
small: number;
|
|
19
|
+
xsmall: number;
|
|
20
|
+
};
|
|
21
|
+
export { fontSizes, fontWeights, lineHeights };
|