@hero-design/rn 8.112.4 → 8.112.5
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 +3 -3
- package/CHANGELOG.md +6 -0
- package/es/index.js +1760 -1359
- package/jest.config.js +1 -1
- package/lib/index.js +1760 -1359
- package/package.json +2 -2
- package/src/components/Accordion/AccordionItem.tsx +1 -1
- package/src/components/AnimatedScroller/AnimatedScrollable.tsx +1 -1
- package/src/components/AnimatedScroller/SectionListWithFAB.tsx +1 -1
- package/src/components/Button/UtilityButton/index.tsx +1 -1
- package/src/components/Calendar/CalendarRange.tsx +1 -1
- package/src/components/Calendar/CalendarRowItem.tsx +1 -1
- package/src/components/Calendar/index.tsx +1 -1
- package/src/components/Chart/Line/Line.tsx +3 -4
- package/src/components/Chart/index.tsx +0 -2
- package/src/components/Chart/shared/ChartHeader.tsx +1 -1
- package/src/components/Chart/shared/hooks/useColorScale.ts +2 -2
- package/src/components/Chart/shared/hooks/useGenerateTicks.ts +2 -2
- package/src/components/Chart/shared/hooks/useScaleBandX.ts +3 -3
- package/src/components/Chart/shared/hooks/useScaleLinearY.ts +3 -4
- package/src/components/Chart/types.ts +0 -8
- package/src/components/Checkbox/utils.ts +1 -1
- package/src/components/Chip/index.tsx +1 -1
- package/src/components/DatePicker/hooks/__tests__/useFormatDate.spec.ts +7 -5
- package/src/components/DatePicker/hooks/useFormatDate.ts +1 -1
- package/src/components/DatePicker/types.ts +1 -1
- package/src/components/FloatingIsland/index.tsx +1 -1
- package/src/components/Illustration/index.tsx +1 -1
- package/src/components/List/BasicListItem.tsx +1 -1
- package/src/components/List/StyledListItem.tsx +2 -2
- package/src/components/LocaleProvider/__tests__/utils.specs.ts +1 -2
- package/src/components/LocaleProvider/index.tsx +1 -1
- package/src/components/LocaleProvider/utils.ts +2 -3
- package/src/components/Portal/index.tsx +1 -1
- package/src/components/Portal/types.tsx +2 -2
- package/src/components/Radio/Radio.tsx +1 -1
- package/src/components/Rate/index.tsx +2 -2
- package/src/components/RefreshControl/index.tsx +1 -1
- package/src/components/RichTextEditor/RichTextEditor.tsx +1 -1
- package/src/components/RichTextEditor/utils/events.ts +1 -1
- package/src/components/Search/SearchOneLine.tsx +1 -1
- package/src/components/Search/StyledSearch.tsx +1 -1
- package/src/components/SectionHeading/index.tsx +1 -1
- package/src/components/Select/helpers.tsx +1 -1
- package/src/components/Skeleton/index.tsx +1 -1
- package/src/components/Slider/RangeSlider.tsx +1 -1
- package/src/components/StatusScreens/Success/index.tsx +1 -1
- package/src/components/Tabs/ScrollableTabsHeader/ScrollableTabsHeader.tsx +1 -1
- package/src/components/Tabs/TabWithBadge.tsx +2 -2
- package/src/components/TextInput/index.tsx +2 -2
- package/src/components/TimePicker/TimePickerAndroid.tsx +1 -1
- package/src/components/TimePicker/TimePickerIOS.tsx +1 -1
- package/src/components/TimePicker/types.ts +1 -1
- package/src/components/Toast/ToastContext.ts +1 -1
- package/src/components/Toolbar/index.tsx +1 -1
- package/src/components/Typography/Label/index.tsx +1 -1
- package/src/theme/global/colors/types.ts +1 -1
- package/src/theme/global/shadows/index.ts +0 -3
- package/src/theme/global/shadows/types.ts +1 -1
- package/src/theme/global/sizes.ts +1 -0
- package/src/theme/global/typography.ts +2 -1
- package/types/components/Accordion/AccordionItem.d.ts +1 -1
- package/types/components/AnimatedScroller/AnimatedScrollable.d.ts +1 -1
- package/types/components/AnimatedScroller/SectionListWithFAB.d.ts +1 -1
- package/types/components/Button/UtilityButton/index.d.ts +1 -1
- package/types/components/Calendar/CalendarRowItem.d.ts +1 -1
- package/types/components/Chart/index.d.ts +0 -3
- package/types/components/Chart/shared/ChartHeader.d.ts +1 -1
- package/types/components/Chart/shared/hooks/useScaleBandX.d.ts +2 -3
- package/types/components/Chart/shared/hooks/useScaleLinearY.d.ts +2 -3
- package/types/components/Chart/types.d.ts +1 -7
- package/types/components/Checkbox/utils.d.ts +2 -1
- package/types/components/Chip/index.d.ts +1 -1
- package/types/components/DatePicker/types.d.ts +1 -1
- package/types/components/FloatingIsland/index.d.ts +1 -1
- package/types/components/Illustration/index.d.ts +1 -1
- package/types/components/List/BasicListItem.d.ts +1 -1
- package/types/components/List/StyledListItem.d.ts +2 -2
- package/types/components/LocaleProvider/utils.d.ts +1 -1
- package/types/components/Portal/index.d.ts +1 -1
- package/types/components/Portal/types.d.ts +3 -2
- package/types/components/Radio/Radio.d.ts +1 -1
- package/types/components/Rate/index.d.ts +2 -2
- package/types/components/RefreshControl/index.d.ts +1 -1
- package/types/components/RichTextEditor/RichTextEditor.d.ts +0 -4
- package/types/components/RichTextEditor/utils/events.d.ts +2 -1
- package/types/components/Search/SearchOneLine.d.ts +1 -1
- package/types/components/Search/StyledSearch.d.ts +2 -1
- package/types/components/SectionHeading/index.d.ts +1 -1
- package/types/components/Select/helpers.d.ts +2 -1
- package/types/components/Skeleton/index.d.ts +1 -1
- package/types/components/Slider/RangeSlider.d.ts +1 -1
- package/types/components/StatusScreens/Success/index.d.ts +1 -1
- package/types/components/Tabs/ScrollableTabsHeader/ScrollableTabsHeader.d.ts +1 -1
- package/types/components/Tabs/TabWithBadge.d.ts +2 -2
- package/types/components/TextInput/index.d.ts +2 -2
- package/types/components/TimePicker/types.d.ts +1 -1
- package/types/components/Toast/ToastContext.d.ts +2 -1
- package/types/components/Toolbar/index.d.ts +1 -1
- package/types/components/Typography/Label/index.d.ts +1 -1
- package/types/theme/components/alert.d.ts +10 -1
- package/types/theme/components/bottomNavigation.d.ts +10 -1
- package/types/theme/components/chip.d.ts +10 -1
- package/types/theme/components/fab.d.ts +10 -1
- package/types/theme/components/floatingIsland.d.ts +10 -1
- package/types/theme/components/list.d.ts +10 -1
- package/types/theme/components/search.d.ts +10 -1
- package/types/theme/components/segmentedControl.d.ts +10 -1
- package/types/theme/components/slider.d.ts +10 -1
- package/types/theme/components/toast.d.ts +10 -1
- package/types/theme/global/colors/types.d.ts +2 -1
- package/types/theme/global/index.d.ts +1 -1
- package/types/theme/global/shadows/index.d.ts +0 -2
- package/types/theme/global/shadows/types.d.ts +2 -1
- package/types/theme/global/typography.d.ts +1 -1
- package/.cursor/rules/performance-optimization.mdc +0 -64
- package/.cursor/rules/rn-rules.mdc +0 -165
- package/.cursor/rules/testing-rules.mdc +0 -114
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hero-design/rn",
|
|
3
|
-
"version": "8.112.
|
|
3
|
+
"version": "8.112.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@emotion/react": "^11.9.3",
|
|
24
24
|
"@hero-design/colors": "8.47.0",
|
|
25
25
|
"d3": "^7.8.5",
|
|
26
|
-
"date-fns": "^
|
|
26
|
+
"date-fns": "^4.1.0",
|
|
27
27
|
"hero-editor": "^1.17.0",
|
|
28
28
|
"nanoid": "^5.0.9"
|
|
29
29
|
},
|
|
@@ -10,7 +10,7 @@ import Typography from '../Typography';
|
|
|
10
10
|
import Icon from '../Icon';
|
|
11
11
|
import type { Variant } from './StyledAccordion';
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
type AccordionItemProps = {
|
|
14
14
|
header: string | ReactElement;
|
|
15
15
|
content: ReactElement;
|
|
16
16
|
open?: boolean;
|
|
@@ -9,7 +9,7 @@ import type { ActionGroupProps } from '../FAB/ActionGroup';
|
|
|
9
9
|
import type { FABProps } from '../FAB/FAB';
|
|
10
10
|
import AnimatedFAB from './AnimatedFAB';
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
interface AnimatedScrollerProps<T> {
|
|
13
13
|
/**
|
|
14
14
|
* Scroll component, it can be ScrollView, FlatList or SectionList.
|
|
15
15
|
*/
|
|
@@ -5,7 +5,7 @@ import AnimatedScroller from './AnimatedScrollable';
|
|
|
5
5
|
import type { ActionGroupProps } from '../FAB/ActionGroup';
|
|
6
6
|
import type { FABProps } from '../FAB/FAB';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
interface SectionListWithFABProps<T> extends SectionListProps<T> {
|
|
9
9
|
/**
|
|
10
10
|
* FAB or FAB.ActionGroup props props.
|
|
11
11
|
*/
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from './StyledUtilityButton';
|
|
10
10
|
import type { IconName } from '../../Icon';
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
interface UtilityButtonProps extends ViewProps {
|
|
13
13
|
/**
|
|
14
14
|
* Places an icon within the button, before the button's text
|
|
15
15
|
*/
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
MonthYearPickerDialogueAndroid,
|
|
3
3
|
MonthYearPickerViewIOS,
|
|
4
4
|
} from '@hero-design/react-native-month-year-picker';
|
|
5
|
-
import format from 'date-fns/fp
|
|
5
|
+
import { format } from 'date-fns/fp';
|
|
6
6
|
import React, { useState } from 'react';
|
|
7
7
|
import { Platform, TouchableOpacity } from 'react-native';
|
|
8
8
|
import { useTheme } from '../../theme';
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
MonthYearPickerDialogueAndroid,
|
|
3
3
|
MonthYearPickerViewIOS,
|
|
4
4
|
} from '@hero-design/react-native-month-year-picker';
|
|
5
|
-
import format from 'date-fns/fp
|
|
5
|
+
import { format } from 'date-fns/fp';
|
|
6
6
|
import React, { useState } from 'react';
|
|
7
7
|
import { Platform, TouchableOpacity } from 'react-native';
|
|
8
8
|
import { useTheme } from '../../theme';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as d3 from 'd3';
|
|
2
1
|
import React, { useMemo } from 'react';
|
|
2
|
+
import { line, curveBasis } from 'd3';
|
|
3
3
|
import { Path } from 'react-native-svg';
|
|
4
4
|
import { DEFAULT_LINE_STROKE_WIDTH } from '../shared/constants';
|
|
5
5
|
import useScaleBandX from '../shared/hooks/useScaleBandX';
|
|
@@ -56,11 +56,10 @@ const Line = ({
|
|
|
56
56
|
// Create line generator with proper curve
|
|
57
57
|
const lineGenerator = useMemo(
|
|
58
58
|
() =>
|
|
59
|
-
|
|
60
|
-
.line<DataValue>()
|
|
59
|
+
line<DataValue>()
|
|
61
60
|
.x((_, i) => (xScale(labels[i]) ?? 0) + xScale.bandwidth() / 2)
|
|
62
61
|
.y((d) => yScale(d ?? 0))
|
|
63
|
-
.curve(
|
|
62
|
+
.curve(curveBasis),
|
|
64
63
|
[xScale, yScale, labels]
|
|
65
64
|
);
|
|
66
65
|
|
|
@@ -5,7 +5,7 @@ import { StyledChartHeader } from '../StyledChart';
|
|
|
5
5
|
import type { HeaderConfig } from '../types';
|
|
6
6
|
import Box from '../../Box';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
type ChartHeaderProps = HeaderConfig & {
|
|
9
9
|
onLayout?: (event: LayoutChangeEvent) => void;
|
|
10
10
|
};
|
|
11
11
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { scaleOrdinal } from 'd3';
|
|
3
3
|
import { mobileVisualisationPalette } from '@hero-design/colors';
|
|
4
4
|
|
|
5
5
|
// Only use colors that are not maasstrichtBlue
|
|
@@ -20,6 +20,6 @@ export default function useColorScale(
|
|
|
20
20
|
return useMemo(() => {
|
|
21
21
|
const palette =
|
|
22
22
|
customColors && customColors.length > 0 ? customColors : DEFAULT_COLORS;
|
|
23
|
-
return
|
|
23
|
+
return scaleOrdinal<string, string>().domain(labels).range(palette);
|
|
24
24
|
}, [labels, customColors]);
|
|
25
25
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { range } from 'd3';
|
|
3
3
|
|
|
4
4
|
const useGenerateTicks = ({
|
|
5
5
|
maxValue,
|
|
@@ -14,7 +14,7 @@ const useGenerateTicks = ({
|
|
|
14
14
|
const minValueOrZero = minValue || 0;
|
|
15
15
|
|
|
16
16
|
const ticks = useMemo(() => {
|
|
17
|
-
const generatedTicks =
|
|
17
|
+
const generatedTicks = range(minValueOrZero, maxValueOrZero, step);
|
|
18
18
|
if (generatedTicks[generatedTicks.length - 1] !== maxValueOrZero) {
|
|
19
19
|
generatedTicks.push(maxValueOrZero);
|
|
20
20
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { scaleBand } from 'd3';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
type UseScaleBandXProps = {
|
|
5
5
|
labels: string[];
|
|
6
6
|
xStart: number;
|
|
7
7
|
xEnd: number;
|
|
@@ -9,7 +9,7 @@ export type UseScaleBandXProps = {
|
|
|
9
9
|
|
|
10
10
|
const useScaleBandX = ({ labels, xStart, xEnd }: UseScaleBandXProps) => {
|
|
11
11
|
return useMemo(
|
|
12
|
-
() =>
|
|
12
|
+
() => scaleBand().domain(labels).range([xStart, xEnd]).padding(0.2),
|
|
13
13
|
[labels, xStart, xEnd]
|
|
14
14
|
);
|
|
15
15
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { scaleLinear } from 'd3';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
type UseScaleLinearYProps = {
|
|
5
5
|
maxValue: number;
|
|
6
6
|
minValue: number;
|
|
7
7
|
yStart: number;
|
|
@@ -19,8 +19,7 @@ const useScaleLinearY = ({
|
|
|
19
19
|
|
|
20
20
|
return useMemo(
|
|
21
21
|
() =>
|
|
22
|
-
|
|
23
|
-
.scaleLinear()
|
|
22
|
+
scaleLinear()
|
|
24
23
|
.domain([minValueOrZero, maxValueOrZero])
|
|
25
24
|
.range([yEnd, yStart]),
|
|
26
25
|
[maxValueOrZero, minValueOrZero, yStart, yEnd]
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
export type AxisSizeConfig = {
|
|
2
|
-
xAxisTextHeight: number;
|
|
3
|
-
setXAxisTextHeight: (height: number) => void;
|
|
4
|
-
yAxisTextWidth: number;
|
|
5
|
-
setYAxisTextWidth: (width: number) => void;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
1
|
/**
|
|
9
2
|
* Represents a data series for the chart.
|
|
10
3
|
* @template Data - The type of the data array for the series.
|
|
@@ -122,7 +115,6 @@ type StyleConfig = {
|
|
|
122
115
|
|
|
123
116
|
export type {
|
|
124
117
|
Series,
|
|
125
|
-
TickConfig,
|
|
126
118
|
XAxisConfig,
|
|
127
119
|
YAxisConfig,
|
|
128
120
|
DataValue,
|
|
@@ -14,7 +14,7 @@ type DeprecatedVariant = 'outlined' | 'filled';
|
|
|
14
14
|
|
|
15
15
|
type ValidVariant = 'selection' | 'filter' | 'compact' | 'compact-outlined';
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
interface ChipProps extends ViewProps {
|
|
18
18
|
/**
|
|
19
19
|
* The label of the chip.
|
|
20
20
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { renderHook } from '@testing-library/react-hooks';
|
|
2
|
-
import formatDate from 'date-fns/fp
|
|
2
|
+
import { format as formatDate } from 'date-fns/fp';
|
|
3
3
|
import useFormatDate from '../useFormatDate';
|
|
4
4
|
import { useDateTimeFormat } from '../../../LocaleProvider/hooks';
|
|
5
5
|
|
|
@@ -8,10 +8,12 @@ jest.mock('../../../LocaleProvider/hooks', () => ({
|
|
|
8
8
|
useDateTimeFormat: jest.fn(),
|
|
9
9
|
}));
|
|
10
10
|
|
|
11
|
-
jest.mock('date-fns/fp
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
jest.mock('date-fns/fp', () => {
|
|
12
|
+
return {
|
|
13
|
+
format: jest.fn((format, date) => {
|
|
14
|
+
return `Formatted: ${format}, Date: ${date.toISOString()}`;
|
|
15
|
+
}),
|
|
16
|
+
};
|
|
15
17
|
});
|
|
16
18
|
|
|
17
19
|
describe('useFormatDate', () => {
|
|
@@ -43,7 +43,7 @@ export interface DatePickerProps {
|
|
|
43
43
|
confirmLabel: string;
|
|
44
44
|
/**
|
|
45
45
|
* Date format. Default format is dd/MM/yyyy.
|
|
46
|
-
* Following date-fns's format (https://date-fns.org/
|
|
46
|
+
* Following date-fns's format (https://date-fns.org/v4.1.0/docs/format).
|
|
47
47
|
*/
|
|
48
48
|
displayFormat?: string;
|
|
49
49
|
/**
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from './StyledFloatingIsland';
|
|
10
10
|
import type { IconName } from '../Icon';
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
interface FloatingIslandProps extends ViewProps {
|
|
13
13
|
/**
|
|
14
14
|
* Callback that is called when the floating island is pressed.
|
|
15
15
|
*/
|
|
@@ -8,7 +8,7 @@ import { Illustrations, type IllustrationName } from './illustrations';
|
|
|
8
8
|
export { IllustrationList } from './illustrations';
|
|
9
9
|
export type { IllustrationName } from './illustrations';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
interface IllustrationProps {
|
|
12
12
|
/**
|
|
13
13
|
* The name of the illustration to display
|
|
14
14
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TouchableHighlight, View } from 'react-native';
|
|
2
2
|
import styled from '@emotion/native';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
type Variant = 'full-width' | 'card';
|
|
5
|
+
type LeadingStatusIntent =
|
|
6
6
|
| 'success'
|
|
7
7
|
| 'warning'
|
|
8
8
|
| 'danger'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
|
-
import setDefaultOptions from 'date-fns
|
|
2
|
+
import { setDefaultOptions } from 'date-fns';
|
|
3
3
|
import { LocaleContext } from './context';
|
|
4
4
|
import { getDateFnsLocale } from './utils';
|
|
5
5
|
import type { LocaleValues } from '../../locales/types';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import enAU from 'date-fns/locale
|
|
2
|
-
import
|
|
3
|
-
import type { Locale } from 'date-fns';
|
|
1
|
+
import { enAU, enCA } from 'date-fns/locale';
|
|
2
|
+
import type { Locale } from 'date-fns/locale';
|
|
4
3
|
import type { LocaleCode } from '../../locales/types';
|
|
5
4
|
|
|
6
5
|
const Locales = {
|
|
@@ -11,7 +11,7 @@ import { ThemeProvider, useTheme } from '../../theme';
|
|
|
11
11
|
|
|
12
12
|
const nanoid = customAlphabet('abcdefghijklmnopqrstuvwxyz0123456789', 10);
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
interface PortalProps {
|
|
15
15
|
/*
|
|
16
16
|
* Name of the portal. If name is not provided, a random name will be generated.
|
|
17
17
|
*/
|
|
@@ -14,12 +14,12 @@ export interface RemovePortalAction {
|
|
|
14
14
|
portalName: string;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
interface RegisterHostAction {
|
|
18
18
|
type: ACTIONS;
|
|
19
19
|
hostName: string;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
interface UnregisterHostAction {
|
|
23
23
|
type: ACTIONS;
|
|
24
24
|
hostName: string;
|
|
25
25
|
}
|
|
@@ -4,7 +4,7 @@ import type { StyleProp, ViewStyle } from 'react-native';
|
|
|
4
4
|
import type { IconName } from '../Icon';
|
|
5
5
|
import { Circle, InnerCircle, StyledRadio } from './StyledRadio';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
interface RadioProps {
|
|
8
8
|
/**
|
|
9
9
|
* Whether the radio is checked.
|
|
10
10
|
*/
|
|
@@ -4,11 +4,11 @@ import { Animated, Platform, Pressable } from 'react-native';
|
|
|
4
4
|
import Icon from '../Icon';
|
|
5
5
|
import { StyledIconWrapper, StyledWrapper } from './StyledRate';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
interface RateOption<T extends string | number> {
|
|
8
8
|
value: T;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
interface RateProps<T extends string | number> extends ViewProps {
|
|
12
12
|
/**
|
|
13
13
|
* Options for rate component.
|
|
14
14
|
*/
|
|
@@ -3,7 +3,7 @@ import type { RefreshControlProps as NativeRefreshControlProps } from 'react-nat
|
|
|
3
3
|
import { RefreshControl as NativeRefreshControl } from 'react-native';
|
|
4
4
|
import { useTheme } from '../../theme';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
type RefreshControlProps = Omit<
|
|
7
7
|
NativeRefreshControlProps,
|
|
8
8
|
'colors' | 'tintColor'
|
|
9
9
|
>;
|
|
@@ -18,7 +18,7 @@ import { renderPrefix, renderSuffix } from './utils';
|
|
|
18
18
|
import Button from '../Button';
|
|
19
19
|
import { useTheme } from '../../theme';
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
type SearchOneLineHandles = Pick<
|
|
22
22
|
RNTextInput,
|
|
23
23
|
'focus' | 'clear' | 'blur' | 'isFocused' | 'setNativeProps'
|
|
24
24
|
>;
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import type { IconName, IconProps } from '../Icon';
|
|
12
12
|
import { useDeprecation } from '../../utils/hooks';
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
interface SectionHeadingProps extends ViewProps {
|
|
15
15
|
/**
|
|
16
16
|
* Heading text.
|
|
17
17
|
*/
|
|
@@ -12,7 +12,7 @@ import type { Theme } from '../../theme';
|
|
|
12
12
|
import { useTheme } from '../../theme';
|
|
13
13
|
import { StyledContainer, StyledGradientContainer } from './StyledSkeleton';
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
interface SkeletonProps extends ViewProps {
|
|
16
16
|
/**
|
|
17
17
|
* Intent of the component.
|
|
18
18
|
*/
|
|
@@ -24,7 +24,7 @@ import { noop } from '../../../utils/functions';
|
|
|
24
24
|
import type { IllustrationName } from '../../Illustration';
|
|
25
25
|
import Illustration from '../../Illustration';
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
interface SuccessProps extends ViewProps {
|
|
28
28
|
/**
|
|
29
29
|
* Image to be displayed.
|
|
30
30
|
* @deprecated The `image` prop is deprecated and will be removed in the next major version. Use the `icon` prop instead.
|
|
@@ -53,7 +53,7 @@ const getTabItem = ({
|
|
|
53
53
|
return item({ color });
|
|
54
54
|
};
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
interface ScrollableTabHeaderProps extends ViewProps {
|
|
57
57
|
/**
|
|
58
58
|
* Callback which is called on tab press, receiving key of upcoming active Tab.
|
|
59
59
|
*/
|
|
@@ -5,11 +5,11 @@ import { View } from 'react-native';
|
|
|
5
5
|
import Badge from '../Badge';
|
|
6
6
|
import { StyledBadgeWrapper } from './StyledTabs';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
type StatusBadgeType = {
|
|
9
9
|
type: 'status';
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
type CounterBadgeType = {
|
|
13
13
|
type: 'counter';
|
|
14
14
|
value: number;
|
|
15
15
|
max?: number;
|
|
@@ -45,7 +45,7 @@ export type TextInputHandles = Pick<
|
|
|
45
45
|
'focus' | 'clear' | 'blur' | 'isFocused' | 'setNativeProps'
|
|
46
46
|
>;
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
type TextInputVariant = 'text' | 'textarea';
|
|
49
49
|
|
|
50
50
|
type NativeTextInputProps = Omit<RNTextInputProps, 'onFocus' | 'onBlur'> & {
|
|
51
51
|
onFocus?: (
|
|
@@ -56,7 +56,7 @@ type NativeTextInputProps = Omit<RNTextInputProps, 'onFocus' | 'onBlur'> & {
|
|
|
56
56
|
) => void | undefined;
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
interface TextInputRef {
|
|
60
60
|
focus: () => void;
|
|
61
61
|
blur: () => void;
|
|
62
62
|
clear: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import DateTimePicker from '@react-native-community/datetimepicker';
|
|
2
2
|
import React, { useState, useCallback } from 'react';
|
|
3
3
|
import { View } from 'react-native';
|
|
4
|
-
import formatTime from 'date-fns/fp
|
|
4
|
+
import { format as formatTime } from 'date-fns/fp';
|
|
5
5
|
|
|
6
6
|
import TextInput from '../TextInput';
|
|
7
7
|
import { StyledTouchableOpacity } from './StyledTimePicker';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import DateTimePicker from '@react-native-community/datetimepicker';
|
|
2
2
|
import React, { useEffect, useState, useCallback } from 'react';
|
|
3
3
|
import { View } from 'react-native';
|
|
4
|
-
import formatTime from 'date-fns/fp
|
|
4
|
+
import { format as formatTime } from 'date-fns/fp';
|
|
5
5
|
|
|
6
6
|
import BottomSheet from '../BottomSheet';
|
|
7
7
|
import TextInput from '../TextInput';
|
|
@@ -24,7 +24,7 @@ export interface TimePickerProps {
|
|
|
24
24
|
confirmLabel: string;
|
|
25
25
|
/**
|
|
26
26
|
* Time display format of current value presented on the input. Default format is: HH:mm aa.
|
|
27
|
-
* Following date-fns's format (https://date-fns.org/
|
|
27
|
+
* Following date-fns's format (https://date-fns.org/v4.1.0/docs/format).
|
|
28
28
|
* This also change how the time picker display between 24 hour and 12 hour mode.
|
|
29
29
|
*/
|
|
30
30
|
displayFormat?: string;
|
|
@@ -5,7 +5,7 @@ import { ToolbarWrapper } from './StyledToolbar';
|
|
|
5
5
|
import ToolbarGroup from './ToolbarGroup';
|
|
6
6
|
import ToolbarMessage from './ToolbarMessage';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
interface ToolbarProps extends Omit<ViewProps, 'style'> {
|
|
9
9
|
/**
|
|
10
10
|
* Toolbar's content.
|
|
11
11
|
*/
|