@hero-design/rn 8.63.2 → 8.64.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/CHANGELOG.md +15 -0
- package/es/index.js +86 -38
- package/eslint.config.js +42 -0
- package/lib/index.js +86 -38
- package/package.json +9 -5
- package/rollup.config.js +13 -0
- package/sonar-project.properties +1 -1
- package/src/components/BottomSheet/__tests__/__snapshots__/index.spec.tsx.snap +5 -0
- package/src/components/BottomSheet/__tests__/index.spec.tsx +17 -0
- package/src/components/BottomSheet/index.tsx +6 -0
- package/src/components/Calendar/CalendarRowItem.tsx +3 -1
- package/src/components/Calendar/StyledCalendar.tsx +21 -8
- package/src/components/Calendar/__tests__/CalendarRowItem.spec.tsx +1 -0
- package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +4 -2
- package/src/components/Calendar/__tests__/index.spec.tsx +7 -1
- package/src/components/Calendar/index.tsx +30 -8
- package/src/components/DatePicker/DatePickerCalendar.tsx +14 -10
- package/src/components/DatePicker/DatePickerIOS.tsx +2 -0
- package/src/components/DatePicker/__tests__/DatePickerCalendar.spec.tsx +37 -0
- package/src/components/DatePicker/__tests__/DatePickerIOS.spec.tsx +34 -0
- package/src/components/DatePicker/__tests__/__snapshots__/DatePickerIOS.spec.tsx.snap +5 -0
- package/src/components/DatePicker/types.ts +4 -0
- package/src/components/FAB/ActionGroup/__tests__/__snapshots__/index.spec.tsx.snap +5 -0
- package/src/components/FAB/ActionGroup/__tests__/index.spec.tsx +45 -24
- package/src/components/FAB/ActionGroup/index.tsx +6 -0
- package/src/components/Select/MultiSelect/__tests__/__snapshots__/index.spec.tsx.snap +20 -0
- package/src/components/Select/MultiSelect/__tests__/index.spec.tsx +28 -0
- package/src/components/Select/MultiSelect/index.tsx +6 -0
- package/src/components/Select/SingleSelect/__tests__/__snapshots__/index.spec.tsx.snap +15 -0
- package/src/components/Select/SingleSelect/__tests__/index.spec.tsx +25 -0
- package/src/components/Select/SingleSelect/index.tsx +6 -0
- package/src/components/TimePicker/TimePickerIOS.tsx +2 -0
- package/src/components/TimePicker/__tests__/TimePickerIOS.spec.tsx +31 -0
- package/src/components/TimePicker/__tests__/__snapshots__/TimePickerIOS.spec.tsx.snap +5 -0
- package/src/components/TimePicker/types.ts +4 -0
- package/src/components/Toast/Toast.tsx +1 -0
- package/src/components/Toast/__tests__/__snapshots__/Toast.spec.tsx.snap +7 -0
- package/src/testHelpers/utils.ts +21 -0
- package/stats/8.63.3/rn-stats.html +4844 -0
- package/stats/8.64.0/rn-stats.html +4842 -0
- package/types/components/BottomSheet/index.d.ts +5 -1
- package/types/components/Calendar/CalendarRowItem.d.ts +2 -1
- package/types/components/Calendar/StyledCalendar.d.ts +7 -0
- package/types/components/DatePicker/DatePickerCalendar.d.ts +1 -1
- package/types/components/DatePicker/DatePickerIOS.d.ts +1 -1
- package/types/components/DatePicker/types.d.ts +4 -0
- package/types/components/FAB/ActionGroup/index.d.ts +4 -0
- package/types/components/Select/MultiSelect/index.d.ts +5 -1
- package/types/components/Select/SingleSelect/index.d.ts +5 -1
- package/types/components/Select/index.d.ts +1 -1
- package/types/components/TimePicker/TimePickerIOS.d.ts +1 -1
- package/types/components/TimePicker/types.d.ts +4 -0
- package/types/testHelpers/utils.d.ts +1 -0
- package/.eslintrc.js +0 -13
- package/src/theme/components/.eslintrc.json +0 -10
|
@@ -59,8 +59,12 @@ interface BottomSheetProps {
|
|
|
59
59
|
* keyboardAvoidingView's props
|
|
60
60
|
* */
|
|
61
61
|
keyboardAvoidingViewProps?: KeyboardAvoidingViewProps;
|
|
62
|
+
/**
|
|
63
|
+
* Supported orientations for the BottomSheet modal, iOS only.
|
|
64
|
+
*/
|
|
65
|
+
supportedOrientations?: ('portrait' | 'landscape')[];
|
|
62
66
|
}
|
|
63
|
-
declare const _default: (({ open, header, footer, children, onAnimationEnd, onOpen, onRequestClose, onDismiss, showCloseButton, hasBackdrop, showDivider, style, testID, keyboardAvoidingViewProps, }: BottomSheetProps) => JSX.Element) & {
|
|
67
|
+
declare const _default: (({ open, header, footer, children, onAnimationEnd, onOpen, onRequestClose, onDismiss, showCloseButton, hasBackdrop, showDivider, style, testID, keyboardAvoidingViewProps, supportedOrientations, }: BottomSheetProps) => JSX.Element) & {
|
|
64
68
|
ScrollView: ({ scrollEventThrottle, ...props }: import("react-native").ScrollViewProps) => JSX.Element;
|
|
65
69
|
};
|
|
66
70
|
export default _default;
|
|
@@ -6,6 +6,7 @@ export interface CalendarRowItemProps {
|
|
|
6
6
|
isSelected?: boolean;
|
|
7
7
|
textIntent?: 'body' | 'subdued';
|
|
8
8
|
marked?: boolean;
|
|
9
|
+
itemWidth?: number;
|
|
9
10
|
}
|
|
10
|
-
declare const CalendarRowItem: ({ date, onPress, isCurrent, isSelected, textIntent, marked, }: CalendarRowItemProps) => React.JSX.Element;
|
|
11
|
+
declare const CalendarRowItem: ({ date, onPress, isCurrent, isSelected, textIntent, marked, itemWidth, }: CalendarRowItemProps) => React.JSX.Element;
|
|
11
12
|
export default CalendarRowItem;
|
|
@@ -15,6 +15,8 @@ declare const StyledCalendarHeader: import("@emotion/native").StyledComponent<Vi
|
|
|
15
15
|
declare const StyledCalendarDayNameCell: import("@emotion/native").StyledComponent<ViewProps & {
|
|
16
16
|
theme?: import("@emotion/react").Theme | undefined;
|
|
17
17
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
18
|
+
} & {
|
|
19
|
+
themeItemWidth?: number | undefined;
|
|
18
20
|
}, {}, {
|
|
19
21
|
ref?: import("react").Ref<View> | undefined;
|
|
20
22
|
}>;
|
|
@@ -23,6 +25,7 @@ declare const StyledCalendarCell: import("@emotion/native").StyledComponent<impo
|
|
|
23
25
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
24
26
|
} & {
|
|
25
27
|
variant?: "selected" | "default" | "current" | undefined;
|
|
28
|
+
themeItemWidth?: number | undefined;
|
|
26
29
|
}, {}, {
|
|
27
30
|
ref?: import("react").Ref<TouchableOpacity> | undefined;
|
|
28
31
|
}>;
|
|
@@ -35,12 +38,16 @@ declare const StyledCalendarRow: import("@emotion/native").StyledComponent<ViewP
|
|
|
35
38
|
declare const StyledCalendarRowItem: import("@emotion/native").StyledComponent<ViewProps & {
|
|
36
39
|
theme?: import("@emotion/react").Theme | undefined;
|
|
37
40
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
41
|
+
} & {
|
|
42
|
+
themeItemWidth?: number | undefined;
|
|
38
43
|
}, {}, {
|
|
39
44
|
ref?: import("react").Ref<View> | undefined;
|
|
40
45
|
}>;
|
|
41
46
|
declare const StyledDisabledCalendarRowItem: import("@emotion/native").StyledComponent<ViewProps & {
|
|
42
47
|
theme?: import("@emotion/react").Theme | undefined;
|
|
43
48
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
49
|
+
} & {
|
|
50
|
+
themeItemWidth?: number | undefined;
|
|
44
51
|
}, {}, {
|
|
45
52
|
ref?: import("react").Ref<View> | undefined;
|
|
46
53
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DatePickerProps } from './types';
|
|
3
|
-
declare const DatePickerCalendar: ({ value, minDate, maxDate, label, placeholder, onChange, confirmLabel, displayFormat, disabled, required, error, helpText, style, testID, monthPickerConfirmLabel, monthPickerCancelLabel, }: Omit<DatePickerProps, 'variant'>) => React.JSX.Element;
|
|
3
|
+
declare const DatePickerCalendar: ({ value, minDate, maxDate, label, placeholder, onChange, confirmLabel, displayFormat, disabled, required, error, helpText, style, testID, monthPickerConfirmLabel, monthPickerCancelLabel, supportedOrientations, }: Omit<DatePickerProps, 'variant'>) => React.JSX.Element;
|
|
4
4
|
export default DatePickerCalendar;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DatePickerProps } from './types';
|
|
3
|
-
declare const DatePickerIOS: ({ value, minDate, maxDate, label, placeholder, onChange, confirmLabel, displayFormat, disabled, required, error, helpText, style, testID, }: Omit<DatePickerProps, 'variant' | 'monthPickerConfirmLabel' | 'monthPickerCancelLabel'>) => React.JSX.Element;
|
|
3
|
+
declare const DatePickerIOS: ({ value, minDate, maxDate, label, placeholder, onChange, confirmLabel, displayFormat, disabled, required, error, helpText, style, testID, supportedOrientations, }: Omit<DatePickerProps, 'variant' | 'monthPickerConfirmLabel' | 'monthPickerCancelLabel'>) => React.JSX.Element;
|
|
4
4
|
export default DatePickerIOS;
|
|
@@ -71,4 +71,8 @@ export interface DatePickerProps {
|
|
|
71
71
|
* Calendar variant prop. Label for the cancel button of the month picker, Android only.
|
|
72
72
|
*/
|
|
73
73
|
monthPickerCancelLabel?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Supported orientations for the DatePicker modal, iOS only.
|
|
76
|
+
*/
|
|
77
|
+
supportedOrientations?: ('portrait' | 'landscape')[];
|
|
74
78
|
}
|
|
@@ -45,6 +45,10 @@ export interface ActionGroupProps {
|
|
|
45
45
|
* Testing id of the component.
|
|
46
46
|
*/
|
|
47
47
|
testID?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Supported orientations for the ActionGroup modal, iOS only.
|
|
50
|
+
*/
|
|
51
|
+
supportedOrientations?: ('portrait' | 'landscape')[];
|
|
48
52
|
}
|
|
49
53
|
declare const ActionGroup: React.ForwardRefExoticComponent<ActionGroupProps & React.RefAttributes<ActionGroupHandles>>;
|
|
50
54
|
export default ActionGroup;
|
|
@@ -21,6 +21,10 @@ export interface MultiSelectProps<V, T extends OptionType<V> = OptionType<V>> ex
|
|
|
21
21
|
* Customise the selected value rendering.
|
|
22
22
|
*/
|
|
23
23
|
renderSelectedValue?: (selectedValue: V[], inputProps: NativeTextInputProps) => React.ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Supported orientations for the MultiSelect modal, iOS only.
|
|
26
|
+
*/
|
|
27
|
+
supportedOrientations?: ('portrait' | 'landscape')[];
|
|
24
28
|
}
|
|
25
|
-
declare function MultiSelect<V, T extends OptionType<V>>({ footerLabel, label, loading, inputProps, onConfirm, onDismiss, onEndReached, onQueryChange, options, renderOption, renderSelectedValue, query, error, editable, disabled, required, style, testID, value, }: MultiSelectProps<V, T>): React.JSX.Element;
|
|
29
|
+
declare function MultiSelect<V, T extends OptionType<V>>({ footerLabel, label, loading, inputProps, onConfirm, onDismiss, onEndReached, onQueryChange, options, renderOption, renderSelectedValue, query, error, editable, disabled, required, style, testID, value, supportedOrientations, }: MultiSelectProps<V, T>): React.JSX.Element;
|
|
26
30
|
export default MultiSelect;
|
|
@@ -14,6 +14,10 @@ export interface SingleSelectProps<V, T extends OptionType<V> = OptionType<V>> e
|
|
|
14
14
|
* Customise the selected value rendering.
|
|
15
15
|
*/
|
|
16
16
|
renderSelectedValue?: (selectedValue: V | null, inputProps: NativeTextInputProps) => React.ReactNode;
|
|
17
|
+
/**
|
|
18
|
+
* Supported orientations for the Select modal, iOS only.
|
|
19
|
+
*/
|
|
20
|
+
supportedOrientations?: ('portrait' | 'landscape')[];
|
|
17
21
|
}
|
|
18
|
-
declare const SingleSelect: <V, T extends OptionType<V>>({ label, loading, inputProps, onConfirm, onDismiss, onEndReached, onQueryChange, options, renderOption, renderSelectedValue, query, error, editable, disabled, required, style, testID, value, }: SingleSelectProps<V, T>) => React.JSX.Element;
|
|
22
|
+
declare const SingleSelect: <V, T extends OptionType<V>>({ label, loading, inputProps, onConfirm, onDismiss, onEndReached, onQueryChange, options, renderOption, renderSelectedValue, query, error, editable, disabled, required, style, testID, value, supportedOrientations, }: SingleSelectProps<V, T>) => React.JSX.Element;
|
|
19
23
|
export default SingleSelect;
|
|
@@ -2,7 +2,7 @@ import MultiSelect from './MultiSelect';
|
|
|
2
2
|
import type { MultiSelectProps } from './MultiSelect';
|
|
3
3
|
import type { SingleSelectProps } from './SingleSelect';
|
|
4
4
|
export type { MultiSelectProps, SingleSelectProps };
|
|
5
|
-
declare const _default: (<V, T extends import("./types").OptionType<V>>({ label, loading, inputProps, onConfirm, onDismiss, onEndReached, onQueryChange, options, renderOption, renderSelectedValue, query, error, editable, disabled, required, style, testID, value, }: SingleSelectProps<V, T>) => import("react").JSX.Element) & {
|
|
5
|
+
declare const _default: (<V, T extends import("./types").OptionType<V>>({ label, loading, inputProps, onConfirm, onDismiss, onEndReached, onQueryChange, options, renderOption, renderSelectedValue, query, error, editable, disabled, required, style, testID, value, supportedOrientations, }: SingleSelectProps<V, T>) => import("react").JSX.Element) & {
|
|
6
6
|
Multi: typeof MultiSelect;
|
|
7
7
|
};
|
|
8
8
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { TimePickerProps } from './types';
|
|
3
|
-
declare const TimePickerIOS: ({ value, label, placeholder, onChange, confirmLabel, displayFormat, disabled, required, error, helpText, style, testID, showSuffix, }: TimePickerProps) => React.JSX.Element;
|
|
3
|
+
declare const TimePickerIOS: ({ value, label, placeholder, onChange, confirmLabel, displayFormat, disabled, required, error, helpText, style, testID, showSuffix, supportedOrientations, }: TimePickerProps) => React.JSX.Element;
|
|
4
4
|
export default TimePickerIOS;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const setOrientation: (orientation: 'portrait' | 'landscape') => void;
|
package/.eslintrc.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
root: true,
|
|
3
|
-
parserOptions: {
|
|
4
|
-
tsconfigRootDir: __dirname,
|
|
5
|
-
project: ['./tsconfig.json'],
|
|
6
|
-
},
|
|
7
|
-
extends: ['hd', 'plugin:@hero-design/recommendedRn'],
|
|
8
|
-
plugins: ['@hero-design', 'import'],
|
|
9
|
-
rules: {
|
|
10
|
-
'no-underscore-dangle': [2, { allow: ['__hd__'] }],
|
|
11
|
-
'import/no-cycle': 2,
|
|
12
|
-
},
|
|
13
|
-
};
|