@hero-design/rn 8.16.0 → 8.17.0
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/.turbo/turbo-build.log +9 -9
- package/es/index.js +229 -77
- package/lib/index.js +229 -75
- package/package.json +7 -5
- package/rollup.config.js +1 -0
- package/src/components/Error/StyledError.tsx +6 -0
- package/src/components/Error/__tests__/__snapshots__/index.spec.tsx.snap +183 -33
- package/src/components/Error/__tests__/index.spec.tsx +18 -0
- package/src/components/Error/index.tsx +44 -11
- package/src/components/Skeleton/StyledSkeleton.tsx +25 -0
- package/src/components/Skeleton/__tests__/__snapshots__/index.spec.tsx.snap +498 -0
- package/src/components/Skeleton/__tests__/index.spec.tsx +30 -0
- package/src/components/Skeleton/index.tsx +134 -0
- package/src/index.ts +2 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +15 -0
- package/src/theme/components/skeleton.ts +22 -0
- package/src/theme/getTheme.ts +3 -0
- package/types/components/Error/StyledError.d.ts +7 -1
- package/types/components/Error/index.d.ts +4 -3
- package/types/components/Skeleton/StyledSkeleton.d.ts +17 -0
- package/types/components/Skeleton/index.d.ts +13 -0
- package/types/index.d.ts +2 -1
- package/types/theme/components/skeleton.d.ts +17 -0
- package/types/theme/getTheme.d.ts +2 -0
package/src/theme/getTheme.ts
CHANGED
|
@@ -31,6 +31,7 @@ import getRefreshControlTheme from './components/refreshControl';
|
|
|
31
31
|
import getRichTextEditorTheme from './components/richTextEditor';
|
|
32
32
|
import getSectionHeadingTheme from './components/sectionHeading';
|
|
33
33
|
import getSelectTheme from './components/select';
|
|
34
|
+
import getSkeletonTheme from './components/skeleton';
|
|
34
35
|
import getSliderTheme from './components/slider';
|
|
35
36
|
import getSpinnerTheme from './components/spinner';
|
|
36
37
|
import getSwipeableTheme from './components/swipeable';
|
|
@@ -78,6 +79,7 @@ type Theme = GlobalTheme & {
|
|
|
78
79
|
richTextEditor: ReturnType<typeof getRichTextEditorTheme>;
|
|
79
80
|
sectionHeading: ReturnType<typeof getSectionHeadingTheme>;
|
|
80
81
|
select: ReturnType<typeof getSelectTheme>;
|
|
82
|
+
skeleton: ReturnType<typeof getSkeletonTheme>;
|
|
81
83
|
slider: ReturnType<typeof getSliderTheme>;
|
|
82
84
|
spinner: ReturnType<typeof getSpinnerTheme>;
|
|
83
85
|
swipeable: ReturnType<typeof getSwipeableTheme>;
|
|
@@ -131,6 +133,7 @@ const getTheme = (
|
|
|
131
133
|
richTextEditor: getRichTextEditorTheme(globalTheme),
|
|
132
134
|
sectionHeading: getSectionHeadingTheme(globalTheme),
|
|
133
135
|
select: getSelectTheme(globalTheme),
|
|
136
|
+
skeleton: getSkeletonTheme(globalTheme),
|
|
134
137
|
slider: getSliderTheme(globalTheme),
|
|
135
138
|
spinner: getSpinnerTheme(globalTheme),
|
|
136
139
|
swipeable: getSwipeableTheme(globalTheme),
|
|
@@ -39,6 +39,12 @@ declare const StyledErrorButtonSecondary: import("@emotion/native").StyledCompon
|
|
|
39
39
|
theme?: import("@emotion/react").Theme | undefined;
|
|
40
40
|
as?: import("react").ElementType<any> | undefined;
|
|
41
41
|
}, {}, {}>;
|
|
42
|
+
declare const StyledErrorImageContainer: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
43
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
44
|
+
as?: import("react").ElementType<any> | undefined;
|
|
45
|
+
}, {}, {
|
|
46
|
+
ref?: import("react").Ref<View> | undefined;
|
|
47
|
+
}>;
|
|
42
48
|
declare const StyledErrorImage: import("@emotion/native").StyledComponent<import("../Image").ImageProps & {
|
|
43
49
|
theme?: import("@emotion/react").Theme | undefined;
|
|
44
50
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -51,4 +57,4 @@ declare const StyledErrorDescription: import("@emotion/native").StyledComponent<
|
|
|
51
57
|
theme?: import("@emotion/react").Theme | undefined;
|
|
52
58
|
as?: import("react").ElementType<any> | undefined;
|
|
53
59
|
}, {}, {}>;
|
|
54
|
-
export { ErrorVariant, StyledErrorModal, StyledErrorImage, StyledErrorContainer, StyledErrorButtonContainer, StyledErrorButtonPrimary, StyledErrorButtonSecondary, StyledErrorContent, StyledErrorTitle, StyledErrorDescription, };
|
|
60
|
+
export { ErrorVariant, StyledErrorModal, StyledErrorImage, StyledErrorContainer, StyledErrorButtonContainer, StyledErrorButtonPrimary, StyledErrorButtonSecondary, StyledErrorContent, StyledErrorTitle, StyledErrorDescription, StyledErrorImageContainer, };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { ImageSourcePropType, ViewProps } from 'react-native';
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import type { ImageSourcePropType, ViewProps, ImageProps as RNImageProps } from 'react-native';
|
|
3
3
|
import { ErrorVariant } from './StyledError';
|
|
4
|
+
import { ImageProps } from '../Image/index';
|
|
4
5
|
interface ErrorProps extends ViewProps {
|
|
5
6
|
/**
|
|
6
7
|
* @deprecated use conditional rendering instead
|
|
@@ -23,7 +24,7 @@ interface ErrorProps extends ViewProps {
|
|
|
23
24
|
/**
|
|
24
25
|
* Image of the error
|
|
25
26
|
*/
|
|
26
|
-
image?: ImageSourcePropType | string;
|
|
27
|
+
image?: ReactElement<ImageProps | RNImageProps> | ImageSourcePropType | string;
|
|
27
28
|
/**
|
|
28
29
|
* Testing id of the component.
|
|
29
30
|
*/
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type ThemeIntent = 'light' | 'dark';
|
|
3
|
+
declare type ThemeVariant = 'circular' | 'rectangular' | 'rounded';
|
|
4
|
+
declare const StyledContainer: import("@emotion/native").StyledComponent<import("../Box").BoxProps & {
|
|
5
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
6
|
+
as?: import("react").ElementType<any> | undefined;
|
|
7
|
+
} & {
|
|
8
|
+
themeIntent: ThemeIntent;
|
|
9
|
+
themeVariant: ThemeVariant;
|
|
10
|
+
}, {}, {}>;
|
|
11
|
+
declare const StyledGradientContainer: import("@emotion/native").StyledComponent<import("../Box").BoxProps & {
|
|
12
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
13
|
+
as?: import("react").ElementType<any> | undefined;
|
|
14
|
+
} & {
|
|
15
|
+
themeVariant: ThemeVariant;
|
|
16
|
+
}, {}, {}>;
|
|
17
|
+
export { StyledContainer, StyledGradientContainer };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ViewProps } from 'react-native';
|
|
2
|
+
export interface SkeletonProps extends ViewProps {
|
|
3
|
+
/**
|
|
4
|
+
* Intent of the component.
|
|
5
|
+
*/
|
|
6
|
+
intent?: 'light' | 'dark';
|
|
7
|
+
/**
|
|
8
|
+
* Variant of the component.
|
|
9
|
+
*/
|
|
10
|
+
variant?: 'circular' | 'rectangular' | 'rounded';
|
|
11
|
+
}
|
|
12
|
+
declare const Skeleton: ({ intent, variant, style, onLayout, ...props }: SkeletonProps) => JSX.Element;
|
|
13
|
+
export default Skeleton;
|
package/types/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ import Swipeable from './components/Swipeable';
|
|
|
32
32
|
import Radio from './components/Radio';
|
|
33
33
|
import SectionHeading from './components/SectionHeading';
|
|
34
34
|
import Select from './components/Select';
|
|
35
|
+
import Skeleton from './components/Skeleton';
|
|
35
36
|
import Switch from './components/Switch';
|
|
36
37
|
import Tabs from './components/Tabs';
|
|
37
38
|
import Tag from './components/Tag';
|
|
@@ -43,5 +44,5 @@ import Typography from './components/Typography';
|
|
|
43
44
|
import RefreshControl from './components/RefreshControl';
|
|
44
45
|
import RichTextEditor from './components/RichTextEditor';
|
|
45
46
|
import PageControl from './components/PageControl';
|
|
46
|
-
export { theme, getTheme, useTheme, scale, ThemeProvider, ThemeSwitcher, withTheme, swagSystemPalette, swagDarkSystemPalette, workSystemPalette, jobsSystemPalette, walletSystemPalette, eBensSystemPalette, Accordion, Alert, Attachment, Avatar, useAvatarColors, Badge, BottomNavigation, BottomSheet, Box, Button, Calendar, Card, Carousel, Collapse, Checkbox, ContentNavigator, DatePicker, Divider, Drawer, Empty, Error, FAB, Icon, Image, List, PinInput, Progress, PageControl, Slider, Spinner, Swipeable, Radio, SectionHeading, Select, Switch, Tabs, Tag, TextInput, TimePicker, Toast, Toolbar, Typography, RefreshControl, RichTextEditor, };
|
|
47
|
+
export { theme, getTheme, useTheme, scale, ThemeProvider, ThemeSwitcher, withTheme, swagSystemPalette, swagDarkSystemPalette, workSystemPalette, jobsSystemPalette, walletSystemPalette, eBensSystemPalette, Accordion, Alert, Attachment, Avatar, useAvatarColors, Badge, BottomNavigation, BottomSheet, Box, Button, Calendar, Card, Carousel, Collapse, Checkbox, ContentNavigator, DatePicker, Divider, Drawer, Empty, Error, FAB, Icon, Image, List, PinInput, Progress, PageControl, Skeleton, Slider, Spinner, Swipeable, Radio, SectionHeading, Select, Switch, Tabs, Tag, TextInput, TimePicker, Toast, Toolbar, Typography, RefreshControl, RichTextEditor, };
|
|
47
48
|
export * from './types';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { GlobalTheme } from '../global';
|
|
2
|
+
declare const getSkeletonTheme: (theme: GlobalTheme) => {
|
|
3
|
+
colors: {
|
|
4
|
+
lightBackground: string;
|
|
5
|
+
darkBackground: string;
|
|
6
|
+
lightGradientStart: string;
|
|
7
|
+
lightGradientEnd: string;
|
|
8
|
+
darkGradientStart: string;
|
|
9
|
+
darkGradientEnd: string;
|
|
10
|
+
};
|
|
11
|
+
radii: {
|
|
12
|
+
rectangular: number;
|
|
13
|
+
circular: number;
|
|
14
|
+
rounded: number;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default getSkeletonTheme;
|
|
@@ -29,6 +29,7 @@ import getRefreshControlTheme from './components/refreshControl';
|
|
|
29
29
|
import getRichTextEditorTheme from './components/richTextEditor';
|
|
30
30
|
import getSectionHeadingTheme from './components/sectionHeading';
|
|
31
31
|
import getSelectTheme from './components/select';
|
|
32
|
+
import getSkeletonTheme from './components/skeleton';
|
|
32
33
|
import getSliderTheme from './components/slider';
|
|
33
34
|
import getSpinnerTheme from './components/spinner';
|
|
34
35
|
import getSwipeableTheme from './components/swipeable';
|
|
@@ -74,6 +75,7 @@ declare type Theme = GlobalTheme & {
|
|
|
74
75
|
richTextEditor: ReturnType<typeof getRichTextEditorTheme>;
|
|
75
76
|
sectionHeading: ReturnType<typeof getSectionHeadingTheme>;
|
|
76
77
|
select: ReturnType<typeof getSelectTheme>;
|
|
78
|
+
skeleton: ReturnType<typeof getSkeletonTheme>;
|
|
77
79
|
slider: ReturnType<typeof getSliderTheme>;
|
|
78
80
|
spinner: ReturnType<typeof getSpinnerTheme>;
|
|
79
81
|
swipeable: ReturnType<typeof getSwipeableTheme>;
|