@hero-design/rn 8.3.4 → 8.5.0-alpha.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 +66 -9
- package/assets/fonts/hero-icons-mobile.ttf +0 -0
- package/es/index.js +473 -133
- package/lib/index.js +473 -133
- package/package.json +5 -7
- package/rollup.config.js +0 -1
- package/src/components/Carousel/CarouselItem.tsx +3 -1
- package/src/components/Carousel/StyledCarousel.tsx +2 -0
- package/src/components/Carousel/__tests__/__snapshots__/index.spec.tsx.snap +18 -15
- package/src/components/Icon/HeroIcon/glyphMap.json +1 -1
- package/src/components/Icon/IconList.ts +9 -0
- package/src/components/List/ListItem.tsx +1 -5
- package/src/components/List/__tests__/__snapshots__/ListItem.spec.tsx.snap +8 -8
- package/src/components/Select/BaseOptionList.tsx +5 -12
- package/src/components/Select/MultiSelect/OptionList.tsx +6 -6
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +3 -0
- package/src/components/Select/MultiSelect/index.tsx +9 -0
- package/src/components/Select/SingleSelect/OptionList.tsx +5 -3
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/OptionList.spec.tsx.snap +24 -4
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +21 -3
- package/src/components/Select/SingleSelect/index.tsx +8 -0
- package/src/components/Swipeable/Buttons.tsx +65 -0
- package/src/components/Swipeable/StyledSwipeable.tsx +14 -2
- package/src/components/Swipeable/SwipeableAction.tsx +15 -7
- package/src/components/Swipeable/index.tsx +531 -136
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +1 -1
- package/src/theme/components/carousel.ts +1 -1
- package/types/components/Calendar/helpers.d.ts +2 -2
- package/types/components/Select/helpers.d.ts +1 -1
- package/types/components/Swipeable/Buttons.d.ts +15 -0
- package/types/components/Swipeable/StyledSwipeable.d.ts +15 -2
- package/types/components/Swipeable/SwipeableAction.d.ts +10 -6
- package/types/components/Swipeable/index.d.ts +24 -41
- package/types/components/Toolbar/index.d.ts +2 -3
- package/types/testHelpers/renderWithTheme.d.ts +1 -1
- package/.turbo/turbo-publish:npm.log +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const initArray: <T>(length: number, func: (value: number) => T) => T[];
|
|
2
|
-
export declare const isEqDate: (dateA?: Date
|
|
3
|
-
export declare const getValidDate: (date: Date, minDate?: Date
|
|
2
|
+
export declare const isEqDate: (dateA?: Date, dateB?: Date) => boolean;
|
|
3
|
+
export declare const getValidDate: (date: Date, minDate?: Date, maxDate?: Date) => Date | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SectionData, CombinedOptionsType, OptionType } from './types';
|
|
2
|
-
export declare const getKey: <V, T extends OptionType<V>>(option: T, index: number, keyExtractor?: ((opt: T, i?: number
|
|
2
|
+
export declare const getKey: <V, T extends OptionType<V>>(option: T, index: number, keyExtractor?: ((opt: T, i?: number) => string) | undefined) => import("react").Key;
|
|
3
3
|
export declare const isSections: <V, T extends OptionType<V>>(options: CombinedOptionsType<V, T>) => options is SectionData<V, T>[];
|
|
4
4
|
export declare const toSections: <V, T extends OptionType<V>>(options: CombinedOptionsType<V, T>) => SectionData<V, T>[];
|
|
5
5
|
export declare const toFlatOptions: <V, T extends OptionType<V>>(options: CombinedOptionsType<V, T>) => OptionType<V>[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Animated, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
buttons?: React.ReactNode[];
|
|
5
|
+
isLeftButtons: boolean;
|
|
6
|
+
leftButtonContainerStyle?: StyleProp<ViewStyle>;
|
|
7
|
+
rightButtonContainerStyle?: StyleProp<ViewStyle>;
|
|
8
|
+
panAnimatedValue: Animated.ValueXY;
|
|
9
|
+
width: number;
|
|
10
|
+
canSwipeLeft?: boolean;
|
|
11
|
+
canSwipeRight?: boolean;
|
|
12
|
+
buttonWidth: number;
|
|
13
|
+
};
|
|
14
|
+
declare const Buttons: ({ buttons, isLeftButtons, leftButtonContainerStyle, rightButtonContainerStyle, panAnimatedValue, width, canSwipeLeft, canSwipeRight, buttonWidth, }: Props) => JSX.Element;
|
|
15
|
+
export default Buttons;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TouchableOpacity } from 'react-native';
|
|
1
|
+
import { Animated, TouchableOpacity, View } from 'react-native';
|
|
2
2
|
export declare type ActionIntent = 'primary' | 'success' | 'danger';
|
|
3
|
-
|
|
3
|
+
declare const StyledRectButton: import("@emotion/native").StyledComponent<import("react-native").TouchableOpacityProps & {
|
|
4
4
|
theme?: import("@emotion/react").Theme | undefined;
|
|
5
5
|
as?: import("react").ElementType<any> | undefined;
|
|
6
6
|
} & {
|
|
@@ -8,3 +8,16 @@ export declare const StyledRectButton: import("@emotion/native").StyledComponent
|
|
|
8
8
|
}, {}, {
|
|
9
9
|
ref?: import("react").Ref<TouchableOpacity> | undefined;
|
|
10
10
|
}>;
|
|
11
|
+
declare const StyledWrapper: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
|
|
12
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
13
|
+
as?: import("react").ElementType<any> | undefined;
|
|
14
|
+
}, {}, {
|
|
15
|
+
ref?: import("react").Ref<View> | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
declare const StyledContent: import("@emotion/native").StyledComponent<Animated.AnimatedProps<import("react-native").ViewProps & import("react").RefAttributes<View>> & {
|
|
18
|
+
children?: import("react").ReactNode;
|
|
19
|
+
} & {
|
|
20
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
21
|
+
as?: import("react").ElementType<any> | undefined;
|
|
22
|
+
}, {}, {}>;
|
|
23
|
+
export { StyledRectButton, StyledWrapper, StyledContent };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
1
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import { IconName } from '../Icon';
|
|
3
3
|
import { ActionIntent } from './StyledSwipeable';
|
|
4
4
|
export interface SwipeableActionProps {
|
|
5
5
|
/**
|
|
@@ -10,10 +10,6 @@ export interface SwipeableActionProps {
|
|
|
10
10
|
* Callback when the action button is pressed.
|
|
11
11
|
*/
|
|
12
12
|
onPress?: () => void;
|
|
13
|
-
/**
|
|
14
|
-
* Action button's content
|
|
15
|
-
*/
|
|
16
|
-
children?: ReactNode;
|
|
17
13
|
/**
|
|
18
14
|
* Additional style.
|
|
19
15
|
*/
|
|
@@ -22,6 +18,14 @@ export interface SwipeableActionProps {
|
|
|
22
18
|
* Testing id of the component.
|
|
23
19
|
*/
|
|
24
20
|
testID?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Name of the Icon.
|
|
23
|
+
*/
|
|
24
|
+
icon: IconName;
|
|
25
|
+
/**
|
|
26
|
+
* Action label of the component.
|
|
27
|
+
*/
|
|
28
|
+
label: string;
|
|
25
29
|
}
|
|
26
|
-
declare const SwipeableAction: ({ intent, onPress, style,
|
|
30
|
+
declare const SwipeableAction: ({ intent, onPress, style, testID, label, icon, }: SwipeableActionProps) => JSX.Element;
|
|
27
31
|
export default SwipeableAction;
|
|
@@ -1,45 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
declare type
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*/
|
|
13
|
-
state?: 'closed' | 'leftOpen' | 'rightOpen';
|
|
14
|
-
/**
|
|
15
|
-
* Callback when the state of the component changes.
|
|
16
|
-
*/
|
|
17
|
-
onStateChange?: (state: State) => void;
|
|
18
|
-
/**
|
|
19
|
-
* Action panel that is going to be revealed from the left side when user swipes right.
|
|
20
|
-
*/
|
|
21
|
-
leftActions?: ReactNode;
|
|
22
|
-
/**
|
|
23
|
-
* Width of the left action panel.
|
|
24
|
-
* By default, it will take up the whole width of the device.
|
|
25
|
-
*/
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { GestureResponderEvent, PanResponderGestureState, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import SwipeableAction from './SwipeableAction';
|
|
4
|
+
export declare type SwipeState = 'closed' | 'leftOpen' | 'rightOpen';
|
|
5
|
+
export declare type SwipeableProps = {
|
|
6
|
+
leftContent?: React.ReactNode;
|
|
7
|
+
rightContent?: React.ReactNode;
|
|
8
|
+
leftActions?: [typeof SwipeableAction][];
|
|
9
|
+
rightActions?: [typeof SwipeableAction][];
|
|
10
|
+
onSwipeLeftStart?: (event: GestureResponderEvent, gestureState: PanResponderGestureState) => void;
|
|
11
|
+
onSwipeLeftEnd?: (event: GestureResponderEvent, gestureState: PanResponderGestureState) => void;
|
|
26
12
|
leftActionsWidth?: number;
|
|
27
|
-
/**
|
|
28
|
-
* Action panel that is going to be revealed from the right side when user swipes left.
|
|
29
|
-
*/
|
|
30
|
-
rightActions?: ReactNode;
|
|
31
|
-
/**
|
|
32
|
-
* Width of the right action panel.
|
|
33
|
-
* By default, it will take up the whole width of the device.
|
|
34
|
-
*/
|
|
35
13
|
rightActionsWidth?: number;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
14
|
+
onStateChange?: (state: SwipeState) => void;
|
|
15
|
+
onSwipeRightStart?: (event: GestureResponderEvent, gestureState: PanResponderGestureState) => void;
|
|
16
|
+
onSwipeRightEnd?: (event: GestureResponderEvent, gestureState: PanResponderGestureState) => void;
|
|
17
|
+
leftButtonWidth?: number;
|
|
18
|
+
rightButtonWidth?: number;
|
|
19
|
+
swipeState?: SwipeState;
|
|
20
|
+
style?: StyleProp<ViewStyle>;
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
};
|
|
23
|
+
declare const _default: React.NamedExoticComponent<SwipeableProps> & {
|
|
24
|
+
readonly type: ({ children, leftActions, leftContent, rightActions, rightContent, style, leftActionsWidth, leftButtonWidth, onSwipeLeftStart, onSwipeLeftEnd, rightActionsWidth, rightButtonWidth, onSwipeRightStart, onSwipeRightEnd, swipeState, onStateChange, ...rest }: SwipeableProps) => JSX.Element;
|
|
25
|
+
} & {
|
|
26
|
+
Action: ({ intent, onPress, style, testID, label, icon, }: import("./SwipeableAction").SwipeableActionProps) => JSX.Element;
|
|
44
27
|
};
|
|
45
28
|
export default _default;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
export interface ToolbarProps extends Omit<ViewProps, 'style'> {
|
|
2
|
+
export interface ToolbarProps {
|
|
4
3
|
/**
|
|
5
4
|
* Toolbar's content.
|
|
6
5
|
*/
|
|
7
6
|
children?: ReactNode;
|
|
8
7
|
}
|
|
9
|
-
declare const _default: (({ children
|
|
8
|
+
declare const _default: (({ children }: ToolbarProps) => JSX.Element) & {
|
|
10
9
|
Group: ({ align, items }: import("./ToolbarGroup").ToolbarGroupProps) => JSX.Element;
|
|
11
10
|
};
|
|
12
11
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { RenderOptions } from '@testing-library/react-native';
|
|
2
|
-
declare const renderWithTheme: (ui: JSX.Element, options?: RenderOptions
|
|
2
|
+
declare const renderWithTheme: (ui: JSX.Element, options?: RenderOptions) => import("@testing-library/react-native").RenderAPI;
|
|
3
3
|
export default renderWithTheme;
|
|
File without changes
|