@hero-design/rn 8.88.0 → 8.89.0-alpha.1
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/es/index.js +413 -44
- package/lib/index.js +414 -44
- package/package.json +3 -2
- package/src/components/Calendar/CalendarRange.tsx +337 -0
- package/src/components/Calendar/CalendarRangeConnector.tsx +68 -0
- package/src/components/Calendar/CalendarRowItem.tsx +14 -3
- package/src/components/Calendar/StyledCalendar.tsx +23 -9
- package/src/components/Calendar/__tests__/CalendarRange.spec.tsx +284 -0
- package/src/components/Calendar/__tests__/CalendarRangeConnector.spec.tsx +73 -0
- package/src/components/Calendar/__tests__/__snapshots__/CalendarRangeConnector.spec.tsx.snap +632 -0
- package/src/components/Calendar/__tests__/__snapshots__/CalendarRowItem.spec.tsx.snap +45 -20
- package/src/components/Calendar/__tests__/helper.spec.ts +110 -1
- package/src/components/Calendar/helpers.ts +75 -0
- package/src/components/Calendar/index.tsx +19 -15
- package/src/components/RichTextEditor/RichTextEditor.tsx +14 -20
- package/src/components/RichTextEditor/__tests__/__snapshots__/RichTextEditor.spec.tsx.snap +2 -4
- package/src/index.ts +2 -0
- package/src/theme/__tests__/__snapshots__/index.spec.ts.snap +9 -4
- package/src/theme/components/calendar.ts +6 -1
- package/src/theme/global/colors/ehWorkDark.ts +59 -0
- package/src/theme/global/index.ts +2 -0
- package/src/theme/index.ts +2 -0
- package/src/types.ts +2 -0
- package/stats/8.88.0/rn-stats.html +0 -2
- package/types/components/Calendar/CalendarRange.d.ts +23 -0
- package/types/components/Calendar/CalendarRangeConnector.d.ts +11 -0
- package/types/components/Calendar/CalendarRowItem.d.ts +3 -1
- package/types/components/Calendar/StyledCalendar.d.ts +2 -1
- package/types/components/Calendar/helpers.d.ts +15 -0
- package/types/components/Calendar/index.d.ts +4 -2
- package/types/index.d.ts +2 -2
- package/types/theme/components/calendar.d.ts +5 -0
- package/types/theme/global/colors/ehWorkDark.d.ts +49 -0
- package/types/theme/global/index.d.ts +2 -1
- package/types/theme/index.d.ts +2 -2
- package/types/types.d.ts +2 -1
- package/.turbo/turbo-build.log +0 -13
package/src/theme/index.ts
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
jobsSystemPalette,
|
|
11
11
|
walletSystemPalette,
|
|
12
12
|
eBensSystemPalette,
|
|
13
|
+
ehWorkDarkPalette,
|
|
13
14
|
} from './global';
|
|
14
15
|
|
|
15
16
|
import type { Theme } from './getTheme';
|
|
@@ -32,6 +33,7 @@ export {
|
|
|
32
33
|
jobsSystemPalette,
|
|
33
34
|
walletSystemPalette,
|
|
34
35
|
eBensSystemPalette,
|
|
36
|
+
ehWorkDarkPalette,
|
|
35
37
|
};
|
|
36
38
|
|
|
37
39
|
export default defaultTheme;
|
package/src/types.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { CardCarouselHandles } from './components/Carousel/CardCarousel';
|
|
|
18
18
|
import { FABHandles } from './components/FAB/FAB';
|
|
19
19
|
import { ActionGroupHandles } from './components/FAB/ActionGroup';
|
|
20
20
|
import type { SliderRangeValue } from './components/Slider/RangeSlider';
|
|
21
|
+
import type { CalendarDateRange } from './components/Calendar/CalendarRange';
|
|
21
22
|
|
|
22
23
|
export type {
|
|
23
24
|
BottomNavigationTabType,
|
|
@@ -38,4 +39,5 @@ export type {
|
|
|
38
39
|
FABHandles,
|
|
39
40
|
ActionGroupHandles,
|
|
40
41
|
SliderRangeValue,
|
|
42
|
+
CalendarDateRange,
|
|
41
43
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type CalendarDateRange = {
|
|
3
|
+
startDate?: Date;
|
|
4
|
+
endDate?: Date;
|
|
5
|
+
};
|
|
6
|
+
export interface CalendarProps {
|
|
7
|
+
value?: CalendarDateRange;
|
|
8
|
+
visibleDate: Date;
|
|
9
|
+
minDate?: Date;
|
|
10
|
+
maxDate?: Date;
|
|
11
|
+
onChange?: (dateRange: CalendarDateRange) => void;
|
|
12
|
+
onPreviousPress?: () => void;
|
|
13
|
+
onNextPress?: () => void;
|
|
14
|
+
onTitlePress?: () => void;
|
|
15
|
+
markedDates?: Date[];
|
|
16
|
+
testID?: string;
|
|
17
|
+
onMonthChange?: (date: Date) => void;
|
|
18
|
+
onToggleMonthPicker?: (visible: boolean) => void;
|
|
19
|
+
monthPickerConfirmLabel?: string;
|
|
20
|
+
monthPickerCancelLabel?: string;
|
|
21
|
+
}
|
|
22
|
+
declare const CalendarRange: ({ value, visibleDate, onChange, onPreviousPress, onNextPress, onTitlePress, minDate, maxDate, markedDates, testID, onMonthChange, onToggleMonthPicker, monthPickerConfirmLabel, monthPickerCancelLabel, }: CalendarProps) => React.JSX.Element;
|
|
23
|
+
export default CalendarRange;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface SelectedDateProps {
|
|
3
|
+
date: Date;
|
|
4
|
+
onPress?: () => void;
|
|
5
|
+
marked?: boolean;
|
|
6
|
+
isStart?: boolean;
|
|
7
|
+
showConnector?: boolean;
|
|
8
|
+
itemWidth?: number;
|
|
9
|
+
}
|
|
10
|
+
declare const SelectedDate: ({ date, onPress, marked, isStart, showConnector, itemWidth, }: SelectedDateProps) => React.JSX.Element;
|
|
11
|
+
export default SelectedDate;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
export declare const getCellVariant: (isSelected?: boolean, isCurrent?: boolean, isHighlighted?: boolean) => "default" | "current" | "selected" | "highlighted";
|
|
2
3
|
export interface CalendarRowItemProps {
|
|
3
4
|
date?: Date;
|
|
4
5
|
onPress?: () => void;
|
|
@@ -7,6 +8,7 @@ export interface CalendarRowItemProps {
|
|
|
7
8
|
textIntent?: 'body' | 'subdued';
|
|
8
9
|
marked?: boolean;
|
|
9
10
|
itemWidth?: number;
|
|
11
|
+
isHighlighted?: boolean;
|
|
10
12
|
}
|
|
11
|
-
declare const CalendarRowItem: ({ date, onPress, isCurrent, isSelected, textIntent, marked, itemWidth, }: CalendarRowItemProps) => React.JSX.Element;
|
|
13
|
+
declare const CalendarRowItem: ({ date, onPress, isCurrent, isSelected, textIntent, marked, itemWidth, isHighlighted, }: CalendarRowItemProps) => React.JSX.Element;
|
|
12
14
|
export default CalendarRowItem;
|
|
@@ -24,7 +24,7 @@ declare const StyledCalendarCell: import("@emotion/native").StyledComponent<impo
|
|
|
24
24
|
theme?: import("@emotion/react").Theme;
|
|
25
25
|
as?: React.ElementType;
|
|
26
26
|
} & {
|
|
27
|
-
variant?: "default" | "current" | "selected";
|
|
27
|
+
variant?: "default" | "current" | "selected" | "highlighted";
|
|
28
28
|
themeItemWidth?: number;
|
|
29
29
|
}, {}, {
|
|
30
30
|
ref?: import("react").Ref<TouchableOpacity> | undefined;
|
|
@@ -40,6 +40,7 @@ declare const StyledCalendarRowItem: import("@emotion/native").StyledComponent<V
|
|
|
40
40
|
as?: React.ElementType;
|
|
41
41
|
} & {
|
|
42
42
|
themeItemWidth?: number;
|
|
43
|
+
isHighlighted?: boolean;
|
|
43
44
|
}, {}, {
|
|
44
45
|
ref?: import("react").Ref<View> | undefined;
|
|
45
46
|
}>;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
1
|
export declare const initArray: <T>(length: number, func: (value: number) => T) => T[];
|
|
2
2
|
export declare const isEqDate: (dateA?: Date, dateB?: Date) => boolean;
|
|
3
|
+
export declare const isDateInRange: ({ date, range, }: {
|
|
4
|
+
date: Date;
|
|
5
|
+
range?: {
|
|
6
|
+
startDate?: Date;
|
|
7
|
+
endDate?: Date;
|
|
8
|
+
};
|
|
9
|
+
}) => boolean;
|
|
3
10
|
export declare const getValidDate: (date: Date, minDate?: Date, maxDate?: Date) => Date | undefined;
|
|
11
|
+
export declare const setStartOrEndDate: ({ date, startDate, endDate, }: {
|
|
12
|
+
date: Date;
|
|
13
|
+
startDate?: Date;
|
|
14
|
+
endDate?: Date;
|
|
15
|
+
}) => {
|
|
16
|
+
startDate: Date | undefined;
|
|
17
|
+
endDate: Date | undefined;
|
|
18
|
+
};
|
|
@@ -54,5 +54,7 @@ export interface CalendarProps {
|
|
|
54
54
|
*/
|
|
55
55
|
monthPickerCancelLabel?: string;
|
|
56
56
|
}
|
|
57
|
-
declare const
|
|
58
|
-
|
|
57
|
+
declare const _default: (({ value, visibleDate, onChange, onPreviousPress, onNextPress, onTitlePress, minDate, maxDate, markedDates, testID, onMonthChange, onToggleMonthPicker, monthPickerConfirmLabel, monthPickerCancelLabel, }: CalendarProps) => React.JSX.Element) & {
|
|
58
|
+
Range: ({ value, visibleDate, onChange, onPreviousPress, onNextPress, onTitlePress, minDate, maxDate, markedDates, testID, onMonthChange, onToggleMonthPicker, monthPickerConfirmLabel, monthPickerCancelLabel, }: import("./CalendarRange").CalendarProps) => React.JSX.Element;
|
|
59
|
+
};
|
|
60
|
+
export default _default;
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import theme, { getTheme, ThemeProvider, useTheme, swagSystemPalette, swagLightSystemPalette, swagLightJobsSystemPalette, swagDarkSystemPalette, workSystemPalette, jobsSystemPalette, walletSystemPalette, eBensSystemPalette, ThemeSwitcher, withTheme } from './theme';
|
|
1
|
+
import theme, { getTheme, ThemeProvider, useTheme, swagSystemPalette, swagLightSystemPalette, swagLightJobsSystemPalette, swagDarkSystemPalette, workSystemPalette, jobsSystemPalette, walletSystemPalette, eBensSystemPalette, ehWorkDarkPalette, ThemeSwitcher, withTheme } from './theme';
|
|
2
2
|
import { scale } from './utils/scale';
|
|
3
3
|
import Accordion from './components/Accordion';
|
|
4
4
|
import Alert from './components/Alert';
|
|
@@ -54,5 +54,5 @@ import Portal from './components/Portal';
|
|
|
54
54
|
import { ScrollViewWithFAB, SectionListWithFAB, FlatListWithFAB } from './components/AnimatedScroller';
|
|
55
55
|
import Search from './components/Search';
|
|
56
56
|
import FloatingIsland from './components/FloatingIsland';
|
|
57
|
-
export { theme, getTheme, useTheme, scale, ThemeProvider, ThemeSwitcher, withTheme, swagSystemPalette, swagLightSystemPalette, swagLightJobsSystemPalette, swagDarkSystemPalette, workSystemPalette, jobsSystemPalette, walletSystemPalette, eBensSystemPalette, Accordion, Alert, AppCue, Attachment, Avatar, useAvatarColors, Badge, BottomNavigation, BottomSheet, Box, Button, Calendar, Card, Carousel, Chip, Collapse, Checkbox, ContentNavigator, DatePicker, Divider, Drawer, Empty, Error, FAB, FlatListWithFAB, Icon, Image, HeroDesignProvider, MapPin, List, PinInput, Progress, Portal, PageControl, Skeleton, Slider, Spinner, Swipeable, Radio, Search, ScrollViewWithFAB, SectionHeading, SectionListWithFAB, Select, Success, Switch, Tabs, Tag, TextInput, TimePicker, Toast, Toolbar, Typography, Rate, RefreshControl, RichTextEditor, FloatingIsland, };
|
|
57
|
+
export { theme, getTheme, useTheme, scale, ThemeProvider, ThemeSwitcher, withTheme, swagSystemPalette, swagLightSystemPalette, swagLightJobsSystemPalette, swagDarkSystemPalette, workSystemPalette, jobsSystemPalette, walletSystemPalette, eBensSystemPalette, ehWorkDarkPalette, Accordion, Alert, AppCue, Attachment, Avatar, useAvatarColors, Badge, BottomNavigation, BottomSheet, Box, Button, Calendar, Card, Carousel, Chip, Collapse, Checkbox, ContentNavigator, DatePicker, Divider, Drawer, Empty, Error, FAB, FlatListWithFAB, Icon, Image, HeroDesignProvider, MapPin, List, PinInput, Progress, Portal, PageControl, Skeleton, Slider, Spinner, Swipeable, Radio, Search, ScrollViewWithFAB, SectionHeading, SectionListWithFAB, Select, Success, Switch, Tabs, Tag, TextInput, TimePicker, Toast, Toolbar, Typography, Rate, RefreshControl, RichTextEditor, FloatingIsland, };
|
|
58
58
|
export * from './types';
|
|
@@ -8,6 +8,10 @@ declare const getCalendarTheme: (theme: GlobalTheme) => {
|
|
|
8
8
|
border: string;
|
|
9
9
|
primary: string;
|
|
10
10
|
inverted: string;
|
|
11
|
+
rowItem: {
|
|
12
|
+
selected: string;
|
|
13
|
+
highlighted: string;
|
|
14
|
+
};
|
|
11
15
|
};
|
|
12
16
|
sizes: {
|
|
13
17
|
cellWidth: number;
|
|
@@ -23,6 +27,7 @@ declare const getCalendarTheme: (theme: GlobalTheme) => {
|
|
|
23
27
|
headerHorizontalPadding: number;
|
|
24
28
|
headerMarginRight: number;
|
|
25
29
|
iosPickerMarginVertical: number;
|
|
30
|
+
cellPadding: number;
|
|
26
31
|
};
|
|
27
32
|
};
|
|
28
33
|
export default getCalendarTheme;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
declare const ehWorkDarkPalette: {
|
|
2
|
+
black: string;
|
|
3
|
+
white: string;
|
|
4
|
+
defaultGlobalSurface: string;
|
|
5
|
+
neutralGlobalSurface: string;
|
|
6
|
+
darkGlobalSurface: string;
|
|
7
|
+
overlayGlobalSurface: string;
|
|
8
|
+
onDefaultGlobalSurface: string;
|
|
9
|
+
mutedOnDefaultGlobalSurface: string;
|
|
10
|
+
inactiveOnDefaultGlobalSurface: string;
|
|
11
|
+
disabledOnDefaultGlobalSurface: string;
|
|
12
|
+
onDarkGlobalSurface: string;
|
|
13
|
+
primaryOutline: string;
|
|
14
|
+
secondaryOutline: string;
|
|
15
|
+
inactiveOutline: string;
|
|
16
|
+
disabledOutline: string;
|
|
17
|
+
archivedSurface: string;
|
|
18
|
+
mutedArchived: string;
|
|
19
|
+
archived: string;
|
|
20
|
+
onArchivedSurface: string;
|
|
21
|
+
errorSurface: string;
|
|
22
|
+
mutedError: string;
|
|
23
|
+
error: string;
|
|
24
|
+
onErrorSurface: string;
|
|
25
|
+
warningSurface: string;
|
|
26
|
+
mutedWarning: string;
|
|
27
|
+
warning: string;
|
|
28
|
+
onWarningSurface: string;
|
|
29
|
+
successSurface: string;
|
|
30
|
+
mutedSuccess: string;
|
|
31
|
+
success: string;
|
|
32
|
+
onSuccessSurface: string;
|
|
33
|
+
infoSurface: string;
|
|
34
|
+
mutedInfo: string;
|
|
35
|
+
info: string;
|
|
36
|
+
onInfoSurface: string;
|
|
37
|
+
primary: string;
|
|
38
|
+
onPrimary: string;
|
|
39
|
+
secondary: string;
|
|
40
|
+
onSecondary: string;
|
|
41
|
+
defaultSurface: string;
|
|
42
|
+
highlightedSurface: string;
|
|
43
|
+
pressedSurface: string;
|
|
44
|
+
decorativePrimary: string;
|
|
45
|
+
decorativePrimarySurface: string;
|
|
46
|
+
decorativeSecondary: string;
|
|
47
|
+
decorativeSecondarySurface: string;
|
|
48
|
+
};
|
|
49
|
+
export default ehWorkDarkPalette;
|
|
@@ -7,6 +7,7 @@ import workSystemPalette from './colors/work';
|
|
|
7
7
|
import jobsSystemPalette from './colors/jobs';
|
|
8
8
|
import walletSystemPalette from './colors/wallet';
|
|
9
9
|
import eBensSystemPalette from './colors/eBens';
|
|
10
|
+
import ehWorkDarkPalette from './colors/ehWorkDark';
|
|
10
11
|
import type { Scale } from './scale';
|
|
11
12
|
import type { SystemPalette } from './colors/types';
|
|
12
13
|
declare const getGlobalTheme: (scale: Scale, systemPalette: SystemPalette) => {
|
|
@@ -79,4 +80,4 @@ declare const getGlobalTheme: (scale: Scale, systemPalette: SystemPalette) => {
|
|
|
79
80
|
};
|
|
80
81
|
type GlobalTheme = ReturnType<typeof getGlobalTheme>;
|
|
81
82
|
export type { GlobalTheme, Scale, SystemPalette };
|
|
82
|
-
export { getGlobalTheme, defaultScale, swagSystemPalette, swagLightSystemPalette, swagLightJobsSystemPalette, swagDarkSystemPalette, workSystemPalette, jobsSystemPalette, walletSystemPalette, eBensSystemPalette, };
|
|
83
|
+
export { getGlobalTheme, defaultScale, swagSystemPalette, swagLightSystemPalette, swagLightJobsSystemPalette, swagDarkSystemPalette, workSystemPalette, jobsSystemPalette, walletSystemPalette, eBensSystemPalette, ehWorkDarkPalette, };
|
package/types/theme/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import getTheme from './getTheme';
|
|
2
2
|
import ThemeProvider, { useTheme } from './ThemeProvider';
|
|
3
3
|
import ThemeSwitcher, { withTheme } from './ThemeSwitcher';
|
|
4
|
-
import { swagSystemPalette, swagLightSystemPalette, swagLightJobsSystemPalette, swagDarkSystemPalette, workSystemPalette, jobsSystemPalette, walletSystemPalette, eBensSystemPalette } from './global';
|
|
4
|
+
import { swagSystemPalette, swagLightSystemPalette, swagLightJobsSystemPalette, swagDarkSystemPalette, workSystemPalette, jobsSystemPalette, walletSystemPalette, eBensSystemPalette, ehWorkDarkPalette } from './global';
|
|
5
5
|
import type { Theme } from './getTheme';
|
|
6
6
|
declare const defaultTheme: Theme;
|
|
7
7
|
export type { Theme };
|
|
8
|
-
export { withTheme, getTheme, ThemeProvider, ThemeSwitcher, useTheme, swagSystemPalette, swagLightSystemPalette, swagLightJobsSystemPalette, swagDarkSystemPalette, workSystemPalette, jobsSystemPalette, walletSystemPalette, eBensSystemPalette, };
|
|
8
|
+
export { withTheme, getTheme, ThemeProvider, ThemeSwitcher, useTheme, swagSystemPalette, swagLightSystemPalette, swagLightJobsSystemPalette, swagDarkSystemPalette, workSystemPalette, jobsSystemPalette, walletSystemPalette, eBensSystemPalette, ehWorkDarkPalette, };
|
|
9
9
|
export default defaultTheme;
|
package/types/types.d.ts
CHANGED
|
@@ -12,4 +12,5 @@ import { CardCarouselHandles } from './components/Carousel/CardCarousel';
|
|
|
12
12
|
import { FABHandles } from './components/FAB/FAB';
|
|
13
13
|
import { ActionGroupHandles } from './components/FAB/ActionGroup';
|
|
14
14
|
import type { SliderRangeValue } from './components/Slider/RangeSlider';
|
|
15
|
-
|
|
15
|
+
import type { CalendarDateRange } from './components/Calendar/CalendarRange';
|
|
16
|
+
export type { BottomNavigationTabType, IconName, SingleSelectProps, MultiSelectProps, ListRenderOptionInfo, SectionListRenderOptionInfo, SwipeableProps, RichTextEditorProps, RichTextEditorRef, TabType, TextInputProps, TextProps, TextInputHandles, Theme, CardCarouselHandles, FABHandles, ActionGroupHandles, SliderRangeValue, CalendarDateRange, };
|
package/.turbo/turbo-build.log
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
(node:3003) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
|
|
2
|
-
(Use `node --trace-warnings ...` to show where the warning was created)
|
|
3
|
-
[36m
|
|
4
|
-
[1msrc/index.ts[22m → [1mlib/index.js, es/index.js[22m...[39m
|
|
5
|
-
[1m[33m(!) [plugin replace] @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.[39m[22m
|
|
6
|
-
[1m[33m(!) [plugin typescript] src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx (61:35): @rollup/plugin-typescript TS2307: Cannot find module '../../../../types' or its corresponding type declarations.[39m[22m
|
|
7
|
-
[1m/home/runner/work/hero-design/hero-design/packages/rn/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx:61:35[22m
|
|
8
|
-
[90m
|
|
9
|
-
[7m61[0m import { RichTextEditorRef } from "../../../../types";
|
|
10
|
-
[7m [0m [91m ~~~~~~~~~~~~~~~~~~~[0m
|
|
11
|
-
[39m
|
|
12
|
-
[1m[33m(!) [plugin node-resolve] preferring built-in module 'events' over local alternative at '/home/runner/work/hero-design/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning.or passing a function to 'preferBuiltins' to provide more fine-grained control over which built-in modules to prefer.[39m[22m
|
|
13
|
-
[32mcreated [1mlib/index.js, es/index.js[22m in [1m52.4s[22m[39m
|