@lazerlen/legend-calendar 1.4.1 → 1.5.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 +9 -9
- package/.turbo/turbo-test.log +106 -106
- package/dist/index.d.mts +58 -13
- package/dist/index.d.ts +58 -13
- package/dist/index.js +592 -317
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +588 -314
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/components/Calendar.tsx +14 -16
- package/src/components/CalendarItemDay.tsx +6 -8
- package/src/components/CalendarItemEmpty.tsx +2 -3
- package/src/components/CalendarItemWeekName.tsx +2 -3
- package/src/components/CalendarList.tsx +279 -92
- package/src/components/CalendarListConfigContext.tsx +29 -0
- package/src/components/CalendarRowMonth.tsx +2 -3
- package/src/components/CalendarRowWeek.tsx +2 -3
- package/src/components/index.ts +4 -0
- package/src/developer/decorators.tsx +4 -4
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import { memo } from "react";
|
|
3
2
|
import type { TextStyle, ViewStyle } from "react-native";
|
|
4
3
|
import { StyleSheet, View } from "react-native";
|
|
5
4
|
|
|
@@ -34,7 +33,7 @@ export interface CalendarRowMonthProps {
|
|
|
34
33
|
theme?: CalendarRowMonthTheme;
|
|
35
34
|
}
|
|
36
35
|
|
|
37
|
-
export const CalendarRowMonth =
|
|
36
|
+
export const CalendarRowMonth = function CalendarRowMonth({
|
|
38
37
|
children,
|
|
39
38
|
height,
|
|
40
39
|
theme,
|
|
@@ -52,4 +51,4 @@ export const CalendarRowMonth = memo(function CalendarRowMonth({
|
|
|
52
51
|
<Text style={contentStyles}>{children}</Text>
|
|
53
52
|
</View>
|
|
54
53
|
);
|
|
55
|
-
}
|
|
54
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import { memo } from "react";
|
|
3
2
|
import type { ViewStyle } from "react-native";
|
|
4
3
|
import { StyleSheet } from "react-native";
|
|
5
4
|
|
|
@@ -22,7 +21,7 @@ const styles = StyleSheet.create({
|
|
|
22
21
|
},
|
|
23
22
|
});
|
|
24
23
|
|
|
25
|
-
export const CalendarRowWeek =
|
|
24
|
+
export const CalendarRowWeek = function CalendarRowWeek({
|
|
26
25
|
children,
|
|
27
26
|
spacing = 0,
|
|
28
27
|
theme,
|
|
@@ -39,4 +38,4 @@ export const CalendarRowWeek = memo(function CalendarRowWeek({
|
|
|
39
38
|
{children}
|
|
40
39
|
</HStack>
|
|
41
40
|
);
|
|
42
|
-
}
|
|
41
|
+
};
|
package/src/components/index.ts
CHANGED
|
@@ -43,6 +43,10 @@ export type {
|
|
|
43
43
|
CalendarListRef,
|
|
44
44
|
CalendarMonthEnhanced,
|
|
45
45
|
} from "@/components/CalendarList";
|
|
46
|
+
export {
|
|
47
|
+
useCalendarListConfig,
|
|
48
|
+
type CalendarListConfig,
|
|
49
|
+
} from "@/components/CalendarListConfigContext";
|
|
46
50
|
export type { CalendarRowMonthProps } from "@/components/CalendarRowMonth";
|
|
47
51
|
export type { CalendarRowWeekProps } from "@/components/CalendarRowWeek";
|
|
48
52
|
export type { HStackProps } from "@/components/HStack";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { PropsWithChildren, ReactNode } from "react";
|
|
2
1
|
import { StatusBar } from "expo-status-bar";
|
|
3
|
-
import {
|
|
2
|
+
import type { PropsWithChildren, ReactNode } from "react";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
4
|
import { StyleSheet, View, type ViewStyle } from "react-native";
|
|
5
5
|
|
|
6
6
|
import { useTheme } from "@/hooks/useTheme";
|
|
@@ -28,7 +28,7 @@ export const paddingDecorator = (storyFn: () => ReactNode) => (
|
|
|
28
28
|
<View style={styles.paddedContainer}>{storyFn()}</View>
|
|
29
29
|
);
|
|
30
30
|
|
|
31
|
-
const BackgroundStory =
|
|
31
|
+
const BackgroundStory = ({ children }: PropsWithChildren) => {
|
|
32
32
|
const { colors } = useTheme();
|
|
33
33
|
const containerStyles = useMemo<ViewStyle[]>(
|
|
34
34
|
() => [
|
|
@@ -46,7 +46,7 @@ const BackgroundStory = memo(({ children }: PropsWithChildren) => {
|
|
|
46
46
|
{children}
|
|
47
47
|
</View>
|
|
48
48
|
);
|
|
49
|
-
}
|
|
49
|
+
};
|
|
50
50
|
BackgroundStory.displayName = "BackgroundStory";
|
|
51
51
|
|
|
52
52
|
export const backgroundDecorator = (storyFn: () => ReactNode) => (
|