@hero-design/rn 8.30.3 → 8.31.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 +1 -1
- package/es/index.js +116 -176
- package/lib/index.js +116 -176
- package/package.json +5 -5
- package/src/components/Carousel/__tests__/__snapshots__/index.spec.tsx.snap +3 -33
- package/src/components/Carousel/index.tsx +18 -5
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +818 -981
- package/src/components/FAB/ActionGroup/__tests__/index.spec.tsx +11 -4
- package/src/components/FAB/ActionGroup/index.tsx +98 -142
- package/src/components/FAB/AnimatedFABIcon.tsx +5 -3
- package/src/components/FAB/FAB.tsx +28 -112
- package/src/components/FAB/__tests__/__snapshots__/index.spec.tsx.snap +9 -27
- package/src/components/FAB/__tests__/index.spec.tsx +2 -22
- package/src/components/Skeleton/__tests__/__snapshots__/index.spec.tsx.snap +14 -14
- package/src/components/Skeleton/index.tsx +3 -7
- package/src/components/Typography/Caption/StyledCaption.tsx +19 -0
- package/src/components/Typography/Caption/__tests__/StyledCaption.spec.tsx +39 -0
- package/src/components/Typography/Caption/__tests__/__snapshots__/StyledCaption.spec.tsx.snap +211 -0
- package/src/components/Typography/Caption/__tests__/__snapshots__/index.spec.tsx.snap +287 -0
- package/src/components/Typography/Caption/__tests__/index.spec.tsx +46 -0
- package/src/components/Typography/Caption/index.tsx +61 -0
- package/src/components/Typography/index.tsx +3 -0
- package/src/components/Typography/types.ts +18 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +2 -0
- package/src/theme/components/typography.ts +2 -0
- package/src/types.ts +0 -4
- package/src/utils/helpers.ts +4 -1
- package/testUtils/setup.tsx +0 -2
- package/types/components/Accordion/AccordionItem.d.ts +1 -1
- package/types/components/Accordion/StyledAccordion.d.ts +1 -1
- package/types/components/Avatar/StyledAvatar.d.ts +2 -2
- package/types/components/Badge/StyledBadge.d.ts +2 -2
- package/types/components/BottomNavigation/index.d.ts +1 -1
- package/types/components/BottomSheet/BottomSheetContext.d.ts +1 -1
- package/types/components/Box/config.d.ts +2 -2
- package/types/components/Box/types.d.ts +3 -3
- package/types/components/Button/LoadingIndicator/StyledLoadingIndicator.d.ts +1 -1
- package/types/components/Button/LoadingIndicator/index.d.ts +1 -1
- package/types/components/Button/StyledButton.d.ts +2 -2
- package/types/components/Carousel/CardCarousel.d.ts +1 -1
- package/types/components/Carousel/types.d.ts +2 -2
- package/types/components/Divider/StyledDivider.d.ts +1 -1
- package/types/components/Drawer/DragableDrawer/helpers.d.ts +1 -1
- package/types/components/Empty/StyledEmpty.d.ts +1 -1
- package/types/components/Error/StyledError.d.ts +1 -1
- package/types/components/FAB/ActionGroup/StyledActionGroup.d.ts +1 -1
- package/types/components/FAB/ActionGroup/index.d.ts +1 -7
- package/types/components/FAB/AnimatedFABIcon.d.ts +1 -1
- package/types/components/FAB/FAB.d.ts +2 -8
- package/types/components/FAB/index.d.ts +2 -3
- package/types/components/Icon/AnimatedIcon.d.ts +1 -1
- package/types/components/Icon/HeroIcon/index.d.ts +2 -2
- package/types/components/Icon/index.d.ts +1 -1
- package/types/components/List/StyledListItem.d.ts +2 -2
- package/types/components/PinInput/StyledPinInput.d.ts +1 -1
- package/types/components/Progress/types.d.ts +1 -1
- package/types/components/Radio/types.d.ts +1 -1
- package/types/components/RefreshControl/index.d.ts +1 -1
- package/types/components/RichTextEditor/RichTextEditor.d.ts +1 -1
- package/types/components/RichTextEditor/types.d.ts +1 -1
- package/types/components/Select/BaseOptionList.d.ts +1 -1
- package/types/components/Select/MultiSelect/OptionList.d.ts +1 -1
- package/types/components/Select/SingleSelect/OptionList.d.ts +1 -1
- package/types/components/Select/helpers.d.ts +1 -1
- package/types/components/Select/types.d.ts +6 -6
- package/types/components/Skeleton/StyledSkeleton.d.ts +2 -2
- package/types/components/Success/StyledSuccess.d.ts +1 -1
- package/types/components/Swipeable/StyledSwipeable.d.ts +1 -1
- package/types/components/Swipeable/index.d.ts +2 -2
- package/types/components/Switch/SelectorSwitch/index.d.ts +3 -3
- package/types/components/Switch/StyledSwitch.d.ts +1 -1
- package/types/components/Tabs/TabWithBadge.d.ts +3 -3
- package/types/components/Tabs/index.d.ts +2 -2
- package/types/components/Tag/StyledTag.d.ts +2 -2
- package/types/components/TextInput/StyledTextInput.d.ts +2 -2
- package/types/components/TextInput/index.d.ts +1 -1
- package/types/components/Toast/ToastContext.d.ts +2 -2
- package/types/components/Toast/ToastProvider.d.ts +1 -1
- package/types/components/Toast/types.d.ts +2 -2
- package/types/components/Typography/Caption/StyledCaption.d.ts +13 -0
- package/types/components/Typography/Caption/index.d.ts +26 -0
- package/types/components/Typography/index.d.ts +2 -0
- package/types/components/Typography/types.d.ts +6 -0
- package/types/theme/ThemeSwitcher.d.ts +1 -1
- package/types/theme/components/typography.d.ts +2 -0
- package/types/theme/getTheme.d.ts +1 -1
- package/types/theme/global/colors/types.d.ts +3 -3
- package/types/theme/global/index.d.ts +1 -1
- package/types/theme/global/scale.d.ts +1 -1
- package/types/theme/global/typography.d.ts +1 -1
- package/types/types.d.ts +1 -3
- package/types/utils/helpers.d.ts +1 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import renderWithTheme from '../../../../testHelpers/renderWithTheme';
|
|
3
|
+
import Caption from '..';
|
|
4
|
+
|
|
5
|
+
describe('Caption', () => {
|
|
6
|
+
it('renders correctly', () => {
|
|
7
|
+
const { queryAllByText } = renderWithTheme(
|
|
8
|
+
<Caption>This is a test</Caption>
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
expect(queryAllByText('This is a test')).toHaveLength(1);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it.each`
|
|
15
|
+
fontWeight
|
|
16
|
+
${'regular'}
|
|
17
|
+
${'semi-bold'}
|
|
18
|
+
`('has $fontWeight fontWeight style', ({ fontWeight }) => {
|
|
19
|
+
const { toJSON } = renderWithTheme(
|
|
20
|
+
<Caption fontWeight={fontWeight}>This is a test</Caption>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
expect(toJSON()).toMatchSnapshot();
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it.each`
|
|
27
|
+
intent
|
|
28
|
+
${'body'}
|
|
29
|
+
${'subdued'}
|
|
30
|
+
${'primary'}
|
|
31
|
+
${'secondary'}
|
|
32
|
+
${'success'}
|
|
33
|
+
${'info'}
|
|
34
|
+
${'warning'}
|
|
35
|
+
${'danger'}
|
|
36
|
+
${'inverted'}
|
|
37
|
+
${'archived'}
|
|
38
|
+
${'disabled'}
|
|
39
|
+
`('has $intent intent style', ({ intent }) => {
|
|
40
|
+
const { toJSON } = renderWithTheme(
|
|
41
|
+
<Caption intent={intent}>This is a test</Caption>
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
expect(toJSON()).toMatchSnapshot();
|
|
45
|
+
});
|
|
46
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type {
|
|
4
|
+
TextProps as NativeTextProps,
|
|
5
|
+
StyleProp,
|
|
6
|
+
TextStyle,
|
|
7
|
+
} from 'react-native';
|
|
8
|
+
import { StyledCaption } from './StyledCaption';
|
|
9
|
+
|
|
10
|
+
export interface CaptionProps extends NativeTextProps {
|
|
11
|
+
/**
|
|
12
|
+
* Text content.
|
|
13
|
+
*/
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Font weight of the text.
|
|
17
|
+
*/
|
|
18
|
+
fontWeight?: 'regular' | 'semi-bold';
|
|
19
|
+
/**
|
|
20
|
+
* Visual intent color to apply to the text.
|
|
21
|
+
*/
|
|
22
|
+
intent?:
|
|
23
|
+
| 'body'
|
|
24
|
+
| 'subdued'
|
|
25
|
+
| 'primary'
|
|
26
|
+
| 'secondary'
|
|
27
|
+
| 'success'
|
|
28
|
+
| 'info'
|
|
29
|
+
| 'warning'
|
|
30
|
+
| 'danger'
|
|
31
|
+
| 'inverted'
|
|
32
|
+
| 'archived'
|
|
33
|
+
| 'disabled';
|
|
34
|
+
/**
|
|
35
|
+
* Additional style.
|
|
36
|
+
*/
|
|
37
|
+
style?: StyleProp<TextStyle>;
|
|
38
|
+
/**
|
|
39
|
+
* Testing id of the component.
|
|
40
|
+
*/
|
|
41
|
+
testID?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const Caption = ({
|
|
45
|
+
children,
|
|
46
|
+
fontWeight = 'regular',
|
|
47
|
+
intent = 'body',
|
|
48
|
+
allowFontScaling = false,
|
|
49
|
+
...nativeProps
|
|
50
|
+
}: CaptionProps) => (
|
|
51
|
+
<StyledCaption
|
|
52
|
+
{...nativeProps}
|
|
53
|
+
themeFontWeight={fontWeight}
|
|
54
|
+
themeIntent={intent}
|
|
55
|
+
allowFontScaling={allowFontScaling}
|
|
56
|
+
>
|
|
57
|
+
{children}
|
|
58
|
+
</StyledCaption>
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
export default Caption;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const FONTWEIGHT_MAP = {
|
|
2
|
+
light: 'light',
|
|
3
|
+
regular: 'regular',
|
|
4
|
+
'semi-bold': 'semiBold',
|
|
5
|
+
} as const;
|
|
6
|
+
|
|
7
|
+
export type ThemeIntent =
|
|
8
|
+
| 'body'
|
|
9
|
+
| 'subdued'
|
|
10
|
+
| 'primary'
|
|
11
|
+
| 'secondary'
|
|
12
|
+
| 'success'
|
|
13
|
+
| 'info'
|
|
14
|
+
| 'warning'
|
|
15
|
+
| 'danger'
|
|
16
|
+
| 'inverted'
|
|
17
|
+
| 'archived'
|
|
18
|
+
| 'disabled';
|
|
@@ -1114,6 +1114,7 @@ Object {
|
|
|
1114
1114
|
"fontSizes": Object {
|
|
1115
1115
|
"6xlarge": 36,
|
|
1116
1116
|
"7xlarge": 42,
|
|
1117
|
+
"caption": 12,
|
|
1117
1118
|
"large": 16,
|
|
1118
1119
|
"medium": 14,
|
|
1119
1120
|
"small": 12,
|
|
@@ -1138,6 +1139,7 @@ Object {
|
|
|
1138
1139
|
"lineHeights": Object {
|
|
1139
1140
|
"6xlarge": 44,
|
|
1140
1141
|
"7xlarge": 50,
|
|
1142
|
+
"caption": 16,
|
|
1141
1143
|
"large": 24,
|
|
1142
1144
|
"medium": 22,
|
|
1143
1145
|
"small": 16,
|
|
@@ -26,6 +26,7 @@ const getTypographyTheme = (theme: GlobalTheme) => {
|
|
|
26
26
|
xxxxxlarge: theme.fontSizes.xxxxxlarge,
|
|
27
27
|
'6xlarge': theme.fontSizes['6xlarge'],
|
|
28
28
|
'7xlarge': theme.fontSizes['7xlarge'],
|
|
29
|
+
caption: theme.fontSizes.small,
|
|
29
30
|
};
|
|
30
31
|
|
|
31
32
|
const lineHeights = {
|
|
@@ -39,6 +40,7 @@ const getTypographyTheme = (theme: GlobalTheme) => {
|
|
|
39
40
|
xxxxxlarge: theme.lineHeights.xxxxxlarge,
|
|
40
41
|
'6xlarge': theme.lineHeights['6xlarge'],
|
|
41
42
|
'7xlarge': theme.lineHeights['7xlarge'],
|
|
43
|
+
caption: theme.lineHeights.small,
|
|
42
44
|
};
|
|
43
45
|
|
|
44
46
|
return { colors, fonts: theme.fonts, fontSizes, lineHeights };
|
package/src/types.ts
CHANGED
|
@@ -15,8 +15,6 @@ import type {
|
|
|
15
15
|
import { SwipeableProps } from './components/Swipeable';
|
|
16
16
|
import { TextProps } from './components/Typography/Text';
|
|
17
17
|
import { CardCarouselHandles } from './components/Carousel/CardCarousel';
|
|
18
|
-
import { FABHandles } from './components/FAB/FAB';
|
|
19
|
-
import { ActionGroupHandles } from './components/FAB/ActionGroup';
|
|
20
18
|
|
|
21
19
|
export type {
|
|
22
20
|
BottomNavigationTabType,
|
|
@@ -34,6 +32,4 @@ export type {
|
|
|
34
32
|
TextInputHandles,
|
|
35
33
|
Theme,
|
|
36
34
|
CardCarouselHandles,
|
|
37
|
-
FABHandles,
|
|
38
|
-
ActionGroupHandles,
|
|
39
35
|
};
|
package/src/utils/helpers.ts
CHANGED
|
@@ -3,7 +3,10 @@ import { Platform } from 'react-native';
|
|
|
3
3
|
export const isIOS = Platform.OS === 'ios';
|
|
4
4
|
export const isAndroid = Platform.OS === 'android';
|
|
5
5
|
|
|
6
|
-
export function pick<O, T extends keyof O>(
|
|
6
|
+
export function pick<O extends object, T extends keyof O>(
|
|
7
|
+
keys: T[],
|
|
8
|
+
obj: O
|
|
9
|
+
): Pick<O, T> {
|
|
7
10
|
return keys
|
|
8
11
|
.filter((key) => key in obj)
|
|
9
12
|
.reduce<Partial<O>>(
|
package/testUtils/setup.tsx
CHANGED
|
@@ -11,7 +11,6 @@ jest.mock('react-native', () => {
|
|
|
11
11
|
const RN = jest.requireActual('react-native');
|
|
12
12
|
|
|
13
13
|
const mockedAnimatedFunctions = {
|
|
14
|
-
setImmediate: () => jest.fn(),
|
|
15
14
|
start: () => jest.fn(),
|
|
16
15
|
stop: () => jest.fn(),
|
|
17
16
|
_isUsingNativeDriver: () => jest.fn(),
|
|
@@ -20,7 +19,6 @@ jest.mock('react-native', () => {
|
|
|
20
19
|
|
|
21
20
|
RN.Animated.timing = () => mockedAnimatedFunctions;
|
|
22
21
|
RN.Animated.spring = () => mockedAnimatedFunctions;
|
|
23
|
-
RN.Animated.stagger = () => mockedAnimatedFunctions;
|
|
24
22
|
|
|
25
23
|
return RN;
|
|
26
24
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactElement } from 'react';
|
|
2
2
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
import type { Variant } from './StyledAccordion';
|
|
4
|
-
export
|
|
4
|
+
export type AccordionItemProps = {
|
|
5
5
|
header: string | ReactElement;
|
|
6
6
|
content: ReactElement;
|
|
7
7
|
open?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TouchableOpacity, View } from 'react-native';
|
|
3
|
-
export
|
|
3
|
+
export type Variant = 'default' | 'card';
|
|
4
4
|
export declare const StyledWrapper: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
5
5
|
theme?: import("@emotion/react").Theme | undefined;
|
|
6
6
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { View, Image, TouchableOpacity } from 'react-native';
|
|
3
3
|
import { TextProps } from '../Typography/Text';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
type ThemeSize = 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge' | 'xxxlarge' | 'xxxxlarge' | 'xxxxxlarge';
|
|
5
|
+
type ThemeIntent = 'primary' | 'info' | 'danger' | 'success' | 'warning';
|
|
6
6
|
declare const StyledWrapper: import("@emotion/native").StyledComponent<import("react-native").TouchableOpacityProps & {
|
|
7
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
8
8
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Animated } from 'react-native';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
type ThemeIntent = 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'archived';
|
|
4
|
+
type ThemePadding = 'narrowContent' | 'wideContent';
|
|
5
5
|
declare const StyledView: import("@emotion/native").StyledComponent<Animated.AnimatedProps<import("react-native").ViewProps & import("react").RefAttributes<import("react-native").View>> & {
|
|
6
6
|
children?: import("react").ReactNode;
|
|
7
7
|
} & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
3
3
|
import type { IconName } from '../Icon';
|
|
4
|
-
export
|
|
4
|
+
export type BottomNavigationTabType = {
|
|
5
5
|
key: string;
|
|
6
6
|
title?: string;
|
|
7
7
|
icon: IconName;
|
|
@@ -165,6 +165,6 @@ declare const config: {
|
|
|
165
165
|
};
|
|
166
166
|
};
|
|
167
167
|
export declare const flexPropsKey: readonly ["alignContent", "alignItems", "alignSelf", "display", "flex", "flexBasis", "flexDirection", "flexGrow", "flexShrink", "flexWrap", "justifyContent"];
|
|
168
|
-
export
|
|
169
|
-
export
|
|
168
|
+
export type ConfigType = typeof config;
|
|
169
|
+
export type FlexPropsKeyType = typeof flexPropsKey[number];
|
|
170
170
|
export default config;
|
|
@@ -10,11 +10,11 @@ export interface ThemeScale {
|
|
|
10
10
|
radii: keyof Radii;
|
|
11
11
|
borderWidths: keyof BorderWidths;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
export
|
|
13
|
+
type ConfigKeyType = keyof ConfigType;
|
|
14
|
+
export type StyleProps = {
|
|
15
15
|
[key in ConfigKeyType]?: ThemeScale[ConfigType[key]['scale']];
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type FlexStyleProps = Pick<Omit<ViewStyle, keyof StyleProps>, FlexPropsKeyType>;
|
|
18
18
|
export interface BoxViewProps extends ViewProps {
|
|
19
19
|
/**
|
|
20
20
|
* Box's content.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import type { ViewProps } from 'react-native';
|
|
4
4
|
import type { Theme } from '@emotion/react';
|
|
5
|
-
|
|
5
|
+
type ThemeVariant = 'basic-transparent' | 'filled-primary' | 'filled-secondary' | 'filled-danger' | 'outlined-primary' | 'outlined-secondary' | 'outlined-danger' | 'text-primary' | 'text-secondary' | 'text-danger';
|
|
6
6
|
declare const StyledLoadingIndicatorWrapper: import("@emotion/native").StyledComponent<ViewProps & {
|
|
7
7
|
theme?: Theme | undefined;
|
|
8
8
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StyleProp, ViewStyle, ViewProps } from 'react-native';
|
|
2
|
-
|
|
2
|
+
type ThemeVariant = 'basic-transparent' | 'filled-primary' | 'filled-secondary' | 'filled-danger' | 'outlined-primary' | 'outlined-secondary' | 'outlined-danger' | 'text-primary' | 'text-secondary' | 'text-danger';
|
|
3
3
|
interface LoadingIndicatorProps extends ViewProps {
|
|
4
4
|
/**
|
|
5
5
|
* Size of the loading dot.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TouchableHighlight, View } from 'react-native';
|
|
3
3
|
import type { Theme } from '@emotion/react';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
type Intent = 'primary' | 'secondary' | 'danger';
|
|
5
|
+
type ThemeVariant = 'filled-primary' | 'filled-secondary' | 'filled-danger' | 'outlined-primary' | 'outlined-secondary' | 'outlined-danger' | 'text-primary' | 'text-secondary' | 'text-danger';
|
|
6
6
|
declare const StyledButtonContainer: import("@emotion/native").StyledComponent<import("react-native").TouchableHighlightProps & {
|
|
7
7
|
theme?: Theme | undefined;
|
|
8
8
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LayoutChangeEvent, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
export
|
|
3
|
+
export type CardCarouselHandles = {
|
|
4
4
|
snapToIndex: (index: number) => void;
|
|
5
5
|
};
|
|
6
6
|
export interface CardCarouselProps {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ImageSourcePropType, ImageResizeMode } from 'react-native';
|
|
3
|
-
export
|
|
3
|
+
export type CarouselImageProps = ImageSourcePropType & {
|
|
4
4
|
height?: number;
|
|
5
5
|
width?: number;
|
|
6
6
|
resizeMode?: ImageResizeMode;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type CarouselData = {
|
|
9
9
|
image: CarouselImageProps | string;
|
|
10
10
|
content?: ReactNode;
|
|
11
11
|
heading: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
-
|
|
3
|
+
type MarginSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
4
4
|
declare const StyledDivider: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
5
5
|
theme?: import("@emotion/react").Theme | undefined;
|
|
6
6
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { View } from 'react-native';
|
|
3
|
-
|
|
3
|
+
type ThemeVariant = 'light' | 'dark';
|
|
4
4
|
declare const StyledWrapper: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
5
5
|
theme?: import("@emotion/react").Theme | undefined;
|
|
6
6
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Modal, View } from 'react-native';
|
|
3
|
-
|
|
3
|
+
type ErrorVariant = 'full-screen' | 'in-page';
|
|
4
4
|
declare const StyledErrorModal: import("@emotion/native").StyledComponent<import("react-native").ModalBaseProps & import("react-native").ModalPropsIOS & import("react-native").ModalPropsAndroid & import("react-native").ViewProps & {
|
|
5
5
|
theme?: import("@emotion/react").Theme | undefined;
|
|
6
6
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -14,7 +14,7 @@ declare const StyledActionGroupContainer: import("@emotion/native").StyledCompon
|
|
|
14
14
|
theme?: import("@emotion/react").Theme | undefined;
|
|
15
15
|
as?: import("react").ElementType<any> | undefined;
|
|
16
16
|
}, {}, {}>;
|
|
17
|
-
declare const StyledFAB: import("@emotion/native").StyledComponent<import("../FAB").FABProps &
|
|
17
|
+
declare const StyledFAB: import("@emotion/native").StyledComponent<import("../FAB").FABProps & {
|
|
18
18
|
theme?: import("@emotion/react").Theme | undefined;
|
|
19
19
|
as?: import("react").ElementType<any> | undefined;
|
|
20
20
|
}, {}, {}>;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
2
|
import type { IconName } from '../../Icon';
|
|
4
3
|
import type { ActionItemProps } from './ActionItem';
|
|
5
|
-
export declare type ActionGroupHandles = {
|
|
6
|
-
showFAB: () => void;
|
|
7
|
-
collapseFAB: () => void;
|
|
8
|
-
hideFAB: () => void;
|
|
9
|
-
};
|
|
10
4
|
export interface ActionGroupProps {
|
|
11
5
|
/**
|
|
12
6
|
* Title of the action group header.
|
|
@@ -41,5 +35,5 @@ export interface ActionGroupProps {
|
|
|
41
35
|
*/
|
|
42
36
|
testID?: string;
|
|
43
37
|
}
|
|
44
|
-
declare const ActionGroup:
|
|
38
|
+
declare const ActionGroup: ({ headerTitle, onPress, active, style, items, testID, fabTitle, fabIcon, }: ActionGroupProps) => JSX.Element;
|
|
45
39
|
export default ActionGroup;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { StyleProp, ViewStyle } from 'react-native';
|
|
1
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
3
2
|
import type { IconName } from '../Icon';
|
|
4
|
-
export declare type FABHandles = {
|
|
5
|
-
show: () => void;
|
|
6
|
-
collapse: () => void;
|
|
7
|
-
hide: () => void;
|
|
8
|
-
};
|
|
9
3
|
export interface FABProps {
|
|
10
4
|
/**
|
|
11
5
|
* Name of the Icon.
|
|
@@ -36,5 +30,5 @@ export interface FABProps {
|
|
|
36
30
|
*/
|
|
37
31
|
testID?: string;
|
|
38
32
|
}
|
|
39
|
-
declare const FAB:
|
|
33
|
+
declare const FAB: ({ onPress, title, icon, animated, testID, active, style, }: FABProps) => JSX.Element;
|
|
40
34
|
export default FAB;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
ActionGroup: import("react").ForwardRefExoticComponent<import("./ActionGroup").ActionGroupProps & import("react").RefAttributes<import("./ActionGroup").ActionGroupHandles>>;
|
|
1
|
+
declare const _default: (({ onPress, title, icon, animated, testID, active, style, }: import("./FAB").FABProps) => JSX.Element) & {
|
|
2
|
+
ActionGroup: ({ headerTitle, onPress, active, style, items, testID, fabTitle, fabIcon, }: import("./ActionGroup").ActionGroupProps) => JSX.Element;
|
|
4
3
|
};
|
|
5
4
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentProps } from 'react';
|
|
2
2
|
import StyledHeroIcon from './HeroIcon';
|
|
3
|
-
|
|
3
|
+
type AnimatedIconProps = ComponentProps<typeof StyledHeroIcon>;
|
|
4
4
|
declare const AnimatedIcon: ({ style, ...otherProps }: AnimatedIconProps) => JSX.Element;
|
|
5
5
|
export default AnimatedIcon;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type ThemeSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
3
|
+
type ThemeIntent = 'text' | 'primary' | 'secondary' | 'info' | 'danger' | 'success' | 'warning' | 'disabled-text' | 'text-inverted';
|
|
4
4
|
declare const StyledHeroIcon: import("@emotion/native").StyledComponent<import("react-native-vector-icons/Icon").IconProps & {
|
|
5
5
|
theme?: import("@emotion/react").Theme | undefined;
|
|
6
6
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AccessibilityProps, StyleProp, TextStyle } from 'react-native';
|
|
2
2
|
import IconList from './IconList';
|
|
3
|
-
export
|
|
3
|
+
export type IconName = typeof IconList[number];
|
|
4
4
|
export interface IconProps extends AccessibilityProps {
|
|
5
5
|
/**
|
|
6
6
|
* Name of the Icon.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TouchableHighlight, View } from 'react-native';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type Variant = 'full-width' | 'card';
|
|
4
|
+
export type LeadingStatusIntent = 'success' | 'warning' | 'danger' | 'info' | 'archived';
|
|
5
5
|
declare const StyledListItemContainer: import("@emotion/native").StyledComponent<import("react-native").TouchableHighlightProps & {
|
|
6
6
|
theme?: import("@emotion/react").Theme | undefined;
|
|
7
7
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -12,7 +12,7 @@ export declare const StyledPinWrapper: import("@emotion/native").StyledComponent
|
|
|
12
12
|
}, {}, {
|
|
13
13
|
ref?: import("react").Ref<View> | undefined;
|
|
14
14
|
}>;
|
|
15
|
-
export
|
|
15
|
+
export type State = 'default' | 'disabled' | 'error';
|
|
16
16
|
export declare const StyledCell: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
17
17
|
theme?: import("@emotion/react").Theme | undefined;
|
|
18
18
|
as?: import("react").ElementType<any> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ThemeIntent = 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'archived' | 'primary-inverted' | 'success-inverted' | 'warning-inverted' | 'danger-inverted' | 'info-inverted' | 'archived-inverted';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { RefreshControlProps as NativeRefreshControlProps } from 'react-native';
|
|
2
|
-
export
|
|
2
|
+
export type RefreshControlProps = Omit<NativeRefreshControlProps, 'colors' | 'tintColor'>;
|
|
3
3
|
declare const RefreshControl: ({ ...props }: RefreshControlProps) => JSX.Element;
|
|
4
4
|
export default RefreshControl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type ToolbarButtonName = 'bold' | 'italic' | 'underline' | 'bulletedList' | 'numberedList' | 'headingOne' | 'headingTwo' | '|';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SectionList, SectionListProps } from 'react-native';
|
|
3
3
|
import type { OptionType, SelectProps, SectionType } from './types';
|
|
4
|
-
export
|
|
4
|
+
export type BaseOptionListProps<V, T extends OptionType<V>> = Pick<SelectProps<V, T>, 'keyExtractor' | 'loading' | 'onEndReached' | 'onQueryChange'> & {
|
|
5
5
|
sectionListRef?: React.RefObject<SectionList<T, SectionType>>;
|
|
6
6
|
} & SectionListProps<T, SectionType>;
|
|
7
7
|
declare const BaseOptionList: <V, T extends OptionType<V>>({ keyExtractor, loading, onEndReached, onQueryChange, sections, renderItem, sectionListRef, ...rest }: BaseOptionListProps<V, T>) => JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseOptionListProps } from '../BaseOptionList';
|
|
2
2
|
import type { MultiSelectProps } from '.';
|
|
3
3
|
import type { OptionType } from '../types';
|
|
4
|
-
|
|
4
|
+
type OptionListProps<V, T extends OptionType<V>> = Pick<MultiSelectProps<V, T>, 'keyExtractor' | 'loading' | 'onEndReached' | 'onQueryChange' | 'value' | 'renderOption'> & {
|
|
5
5
|
onPress: (value: V[]) => void;
|
|
6
6
|
} & BaseOptionListProps<V, T>;
|
|
7
7
|
declare const OptionList: <V, T extends OptionType<V>>({ keyExtractor, loading, onEndReached, onPress, onQueryChange, sections, renderOption, value, sectionListRef, ...rest }: OptionListProps<V, T>) => JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { SectionList } from 'react-native';
|
|
|
3
3
|
import type { SingleSelectProps } from '.';
|
|
4
4
|
import type { OptionType, SectionType } from '../types';
|
|
5
5
|
import { BaseOptionListProps } from '../BaseOptionList';
|
|
6
|
-
|
|
6
|
+
type OptionListProps<V, T extends OptionType<V>> = Pick<SingleSelectProps<V, T>, 'keyExtractor' | 'loading' | 'onEndReached' | 'onQueryChange' | 'value' | 'renderOption'> & {
|
|
7
7
|
onPress: (value: V | null) => void;
|
|
8
8
|
sectionListRef?: React.RefObject<SectionList<T, SectionType>>;
|
|
9
9
|
} & BaseOptionListProps<V, T>;
|
|
@@ -4,7 +4,7 @@ export declare const getKey: <V, T extends OptionType<V>>(option: T, index: numb
|
|
|
4
4
|
export declare const isSections: <V, T extends OptionType<V>>(options: CombinedOptionsType<V, T>) => options is SectionData<V, T>[];
|
|
5
5
|
export declare const toSections: <V, T extends OptionType<V>>(options: CombinedOptionsType<V, T>) => SectionData<V, T>[];
|
|
6
6
|
export declare const toFlatOptions: <V, T extends OptionType<V>>(options: CombinedOptionsType<V, T>) => OptionType<V>[];
|
|
7
|
-
export
|
|
7
|
+
export type ScrollParams = {
|
|
8
8
|
itemIndex: number;
|
|
9
9
|
sectionIndex: number;
|
|
10
10
|
};
|