@lazerlen/legend-calendar 1.0.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/.eslintrc.js +29 -0
- package/.turbo/turbo-build.log +19 -0
- package/.turbo/turbo-lint.log +14 -0
- package/.turbo/turbo-test.log +261 -0
- package/.turbo/turbo-typecheck.log +1 -0
- package/CHANGELOG.md +127 -0
- package/dist/index.d.mts +679 -0
- package/dist/index.d.ts +679 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +47 -0
- package/src/components/Calendar.stories.tsx +226 -0
- package/src/components/Calendar.tsx +224 -0
- package/src/components/CalendarItemDay.tsx +385 -0
- package/src/components/CalendarItemEmpty.tsx +30 -0
- package/src/components/CalendarItemWeekName.tsx +67 -0
- package/src/components/CalendarList.stories.tsx +326 -0
- package/src/components/CalendarList.tsx +373 -0
- package/src/components/CalendarRowMonth.tsx +62 -0
- package/src/components/CalendarRowWeek.tsx +46 -0
- package/src/components/CalendarThemeProvider.tsx +43 -0
- package/src/components/HStack.tsx +67 -0
- package/src/components/VStack.tsx +67 -0
- package/src/components/index.ts +108 -0
- package/src/developer/decorators.tsx +54 -0
- package/src/developer/loggginHandler.tsx +6 -0
- package/src/developer/useRenderCount.ts +7 -0
- package/src/helpers/dates.test.ts +567 -0
- package/src/helpers/dates.ts +163 -0
- package/src/helpers/functions.ts +327 -0
- package/src/helpers/numbers.ts +11 -0
- package/src/helpers/strings.ts +2 -0
- package/src/helpers/tokens.ts +71 -0
- package/src/helpers/types.ts +3 -0
- package/src/hooks/useCalendar.test.ts +381 -0
- package/src/hooks/useCalendar.ts +351 -0
- package/src/hooks/useCalendarList.test.ts +382 -0
- package/src/hooks/useCalendarList.tsx +291 -0
- package/src/hooks/useDateRange.test.ts +128 -0
- package/src/hooks/useDateRange.ts +94 -0
- package/src/hooks/useOptimizedDayMetadata.test.ts +582 -0
- package/src/hooks/useOptimizedDayMetadata.ts +93 -0
- package/src/hooks/useTheme.ts +14 -0
- package/src/index.ts +24 -0
- package/tsconfig.json +13 -0
- package/tsup.config.ts +15 -0
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** @type {import('eslint').Linter.Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
root: true,
|
|
4
|
+
extends: ["@lazerlen/eslint-config"],
|
|
5
|
+
rules: {
|
|
6
|
+
"no-restricted-imports": [
|
|
7
|
+
"error",
|
|
8
|
+
{
|
|
9
|
+
patterns: [
|
|
10
|
+
{
|
|
11
|
+
group: ["date-fns"],
|
|
12
|
+
message:
|
|
13
|
+
"Please use the custom date functions from @/helpers/dates instead. This decreases the bundle size significantly.",
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
// Allow date-fns imports in test files since we use them to test our custom date functions
|
|
21
|
+
overrides: [
|
|
22
|
+
{
|
|
23
|
+
files: ["**/*.test.ts", "**/*.test.tsx", "**/*.stories.tsx"],
|
|
24
|
+
rules: {
|
|
25
|
+
"no-restricted-imports": ["error", { patterns: [] }],
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[0m[2m[35m$[0m [2m[1mtsup --dts[0m
|
|
2
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
3
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
4
|
+
[34mCLI[39m tsup v8.0.2
|
|
5
|
+
[34mCLI[39m Using tsup config: /Users/leviwilliams/projects/legend-calendar/packages/legend-calendar/tsup.config.ts
|
|
6
|
+
[34mCLI[39m Target: es2015
|
|
7
|
+
[34mCLI[39m Cleaning output folder
|
|
8
|
+
[34mCJS[39m Build start
|
|
9
|
+
[34mESM[39m Build start
|
|
10
|
+
[32mCJS[39m [1mdist/index.js [22m[32m22.00 KB[39m
|
|
11
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m117.93 KB[39m
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 23ms
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m21.27 KB[39m
|
|
14
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m118.18 KB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 24ms
|
|
16
|
+
[34mDTS[39m Build start
|
|
17
|
+
[32mDTS[39m ⚡️ Build success in 1385ms
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m23.93 KB[39m
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m23.93 KB[39m
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[0m[2m[35m$[0m [2m[1meslint src[0m
|
|
2
|
+
=============
|
|
3
|
+
|
|
4
|
+
WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.
|
|
5
|
+
|
|
6
|
+
You may find that it works just fine, or you may not.
|
|
7
|
+
|
|
8
|
+
SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <5.2.0
|
|
9
|
+
|
|
10
|
+
YOUR TYPESCRIPT VERSION: 5.9.3
|
|
11
|
+
|
|
12
|
+
Please only submit bug reports when using the officially supported version.
|
|
13
|
+
|
|
14
|
+
=============
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
[0m[2m[35m$[0m [2m[1mbun test[0m
|
|
2
|
+
[0m[1mbun test [0m[2mv1.2.20 (6ad208bc)[0m
|
|
3
|
+
[0m
|
|
4
|
+
src/hooks/useDateRange.test.ts:
|
|
5
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
6
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
7
|
+
[0m[32m✓[0m [0museDateRange[2m >[0m[1m should initialize with correct default values[0m [0m[2m[8.97ms[0m[2m][0m
|
|
8
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
9
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
10
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
11
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
12
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
13
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
14
|
+
[0m[32m✓[0m [0museDateRange[2m >[0m[1m should update dateRange correctly on onCalendarDayPress[0m [0m[2m[1.87ms[0m[2m][0m
|
|
15
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
16
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
17
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
18
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
19
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
20
|
+
[0m[32m✓[0m [0museDateRange[2m >[0m[1m should clear dateRange on onClearDateRange[0m [0m[2m[1.57ms[0m[2m][0m
|
|
21
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
22
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
23
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
24
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
25
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
26
|
+
[0m[32m✓[0m [0museDateRange[2m >[0m[1m should update isDateRangeValid correctly[0m [0m[2m[0.59ms[0m[2m][0m
|
|
27
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
28
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
29
|
+
[0m[32m✓[0m [0museDateRange[2m >[0m[1m can initialize a date range[0m [0m[2m[0.57ms[0m[2m][0m
|
|
30
|
+
[0m
|
|
31
|
+
src/hooks/useCalendarList.test.ts:
|
|
32
|
+
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m Measures months with 5 weeks (no calendar spacing)[0m
|
|
33
|
+
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m Measures months with 5 weeks (with calendar spacing)[0m
|
|
34
|
+
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m Accounts for additional height[0m
|
|
35
|
+
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m Measures months with 6 weeks[0m [0m[2m[0.03ms[0m[2m][0m
|
|
36
|
+
[0m[32m✓[0m [0mgetHeightForMonth[2m >[0m[1m February 24 has the right height with base options[0m [0m[2m[0.43ms[0m[2m][0m
|
|
37
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
38
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
39
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
40
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
41
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Max: virtualization still works as expected[0m [0m[2m[1.23ms[0m[2m][0m
|
|
42
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
43
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
44
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
45
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
46
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
47
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Min: virtualization still works as expected[0m [0m[2m[0.98ms[0m[2m][0m
|
|
48
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
49
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
50
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Returns a single month when min and max are in the same month[0m [0m[2m[0.35ms[0m[2m][0m
|
|
51
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
52
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
53
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Returns a range of months bounded by the min and max dates[0m [0m[2m[0.33ms[0m[2m][0m
|
|
54
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
55
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
56
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Ignores past/future scroll ranges when min/max dates are used[0m [0m[2m[0.21ms[0m[2m][0m
|
|
57
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
58
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
59
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
60
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mMin/Max dates[2m >[0m[1m Append/Prepend are no-op if min/max are reached[0m [0m[2m[0.57ms[0m[2m][0m
|
|
61
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
62
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
63
|
+
[0m[32m✓[0m [0museCalendarList[2m > [0mgithub issues[2m >[0m[1m #16: Incorrect scroll position when setting calendarMinDateId[0m [0m[2m[0.17ms[0m[2m][0m
|
|
64
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
65
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
66
|
+
[0m[32m✓[0m [0museCalendarList[2m >[0m[1m Data is correctly built when future/past ranges are 0[0m [0m[2m[0.26ms[0m[2m][0m
|
|
67
|
+
[0m
|
|
68
|
+
src/hooks/useCalendar.test.ts:
|
|
69
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0misLastDayOfWeek[2m >[0m[1m isLastDayOfWeek respects "sunday" as last day of week[0m [0m[2m[9.71ms[0m[2m][0m
|
|
70
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0misLastDayOfWeek[2m >[0m[1m isLastDayOfWeek respects "monday" as last day of week[0m [0m[2m[1.23ms[0m[2m][0m
|
|
71
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0misWeekend[2m >[0m[1m starting on sunday[0m [0m[2m[1.58ms[0m[2m][0m
|
|
72
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0misWeekend[2m >[0m[1m starting on monday[0m [0m[2m[1.21ms[0m[2m][0m
|
|
73
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes today[0m [0m[2m[1.16ms[0m[2m][0m
|
|
74
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes disabled (with calendarDisabledDateIds)[0m [0m[2m[1.54ms[0m[2m][0m
|
|
75
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes disabled (with min)[0m [0m[2m[1.22ms[0m[2m][0m
|
|
76
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes disabled (with max)[0m [0m[2m[1.14ms[0m[2m][0m
|
|
77
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m active: supersedes idle[0m [0m[2m[1.13ms[0m[2m][0m
|
|
78
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m disabled: supersedes idle[0m [0m[2m[1.23ms[0m[2m][0m
|
|
79
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m today: supersedes idle[0m [0m[2m[1.38ms[0m[2m][0m
|
|
80
|
+
[0m[32m✓[0m [0mbuildCalendar[2m > [0mstate[2m >[0m[1m idle: serves as the base state[0m [0m[2m[2.10ms[0m[2m][0m
|
|
81
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m builds the month row[0m [0m[2m[1.43ms[0m[2m][0m
|
|
82
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m build the month row with custom formatting[0m [0m[2m[3.49ms[0m[2m][0m
|
|
83
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m builds the week days row starting on sunday[0m [0m[2m[1.65ms[0m[2m][0m
|
|
84
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m builds the week days row starting on monday[0m [0m[2m[1.56ms[0m[2m][0m
|
|
85
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m builds the weeks row[0m [0m[2m[2.08ms[0m[2m][0m
|
|
86
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m build the weeks row with custom formatting[0m [0m[2m[0.66ms[0m[2m][0m
|
|
87
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m handles the expected range[0m [0m[2m[2.31ms[0m[2m][0m
|
|
88
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m calendarMinDate[0m [0m[2m[2.04ms[0m[2m][0m
|
|
89
|
+
[0m[32m✓[0m [0mbuildCalendar[2m >[0m[1m calendarMaxDate[0m [0m[2m[1.88ms[0m[2m][0m
|
|
90
|
+
[0m
|
|
91
|
+
src/hooks/useOptimizedDayMetadata.test.ts:
|
|
92
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
93
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
94
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m return the base metadata as the initial value[0m [0m[2m[1.18ms[0m[2m][0m
|
|
95
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
96
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
97
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
98
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
99
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m if the base changes, the returned value should match it.[0m [0m[2m[0.62ms[0m[2m][0m
|
|
100
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
101
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
102
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
103
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
104
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
105
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m endOfRange: returns the updated metadata once an event is emitted[0m [0m[2m[0.69ms[0m[2m][0m
|
|
106
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
107
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
108
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
109
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
110
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
111
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
112
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m startOfRange: returns the updated metadata once an event is emitted[0m [0m[2m[0.24ms[0m[2m][0m
|
|
113
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
114
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
115
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
116
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
117
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
118
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
119
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
120
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m startOfRange|endOfRange: returns the updated metadata once an event is emitted[0m [0m[2m[0.19ms[0m[2m][0m
|
|
121
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
122
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
123
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
124
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
125
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
126
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
127
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
128
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
129
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
130
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
131
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
132
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
133
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
134
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
135
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
136
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
137
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
138
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
139
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
140
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
141
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
142
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
143
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
144
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m doesn't re-render if the active dates don't overlap[0m [0m[2m[1.18ms[0m[2m][0m
|
|
145
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
146
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
147
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
148
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
149
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
150
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
151
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
152
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
153
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
154
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
155
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
156
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
157
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
158
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
159
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
160
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
161
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata[2m >[0m[1m resets the state once a new range is selected[0m [0m[2m[1.22ms[0m[2m][0m
|
|
162
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
163
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
164
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
165
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
166
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
167
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
168
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
169
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
170
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
171
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m uses the default instance ID when not provided[0m [0m[2m[0.48ms[0m[2m][0m
|
|
172
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
173
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
174
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
175
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m responds to events for the correct instance ID[0m [0m[2m[0.42ms[0m[2m][0m
|
|
176
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
177
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
178
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m ignores events for different instance IDs[0m [0m[2m[0.35ms[0m[2m][0m
|
|
179
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
180
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
181
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
182
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
183
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
184
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
185
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m handles multiple instances correctly[0m [0m[2m[0.41ms[0m[2m][0m
|
|
186
|
+
[0m[31mreact-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer[0m
|
|
187
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
188
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
189
|
+
[0m[31mThe current testing environment is not configured to support act(...)[0m
|
|
190
|
+
[0m[32m✓[0m [0museOptimizedDayMetadata with calendarInstanceId[2m >[0m[1m resets state for the correct instance when a new range is selected[0m [0m[2m[0.17ms[0m[2m][0m
|
|
191
|
+
[0m
|
|
192
|
+
src/helpers/dates.test.ts:
|
|
193
|
+
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m January 1st, 2024[0m [0m[2m[0.09ms[0m[2m][0m
|
|
194
|
+
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m January 31th, 2024[0m [0m[2m[0.01ms[0m[2m][0m
|
|
195
|
+
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m February 1st, 2024[0m [0m[2m[0.01ms[0m[2m][0m
|
|
196
|
+
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m February 10th, 2024[0m [0m[2m[0.01ms[0m[2m][0m
|
|
197
|
+
[0m[32m✓[0m [0mtoDateId: UTC time zone[2m >[0m[1m convert between ID -> Date -> ID returns the original result[0m
|
|
198
|
+
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m January 1st, 2024[0m [0m[2m[0.01ms[0m[2m][0m
|
|
199
|
+
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m January 31th, 2024[0m [0m[2m[0.02ms[0m[2m][0m
|
|
200
|
+
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m February 1st, 2024[0m [0m[2m[0.02ms[0m[2m][0m
|
|
201
|
+
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m February 10th, 2024[0m
|
|
202
|
+
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m February 29th, 2024[0m [0m[2m[0.01ms[0m[2m][0m
|
|
203
|
+
[0m[32m✓[0m [0mtoDateId: Brasilia time zone [2m >[0m[1m convert between ID -> Date -> ID returns the original result[0m [0m[2m[0.01ms[0m[2m][0m
|
|
204
|
+
[0m[32m✓[0m [0mfromDateId: UTC time zone[2m >[0m[1m parse Jan 1st[0m [0m[2m[0.02ms[0m[2m][0m
|
|
205
|
+
[0m[32m✓[0m [0mfromDateId: UTC time zone[2m >[0m[1m parses March 1st[0m
|
|
206
|
+
[0m[32m✓[0m [0mfromDateId: Brasilia time zone[2m >[0m[1m parse Jan 1st[0m [0m[2m[0.01ms[0m[2m][0m
|
|
207
|
+
[0m[32m✓[0m [0mfromDateId: Brasilia time zone[2m >[0m[1m parses March 1st[0m [0m[2m[0.01ms[0m[2m][0m
|
|
208
|
+
[0m[32m✓[0m [0mstartOfMonth[2m >[0m[1m January[0m [0m[2m[0.01ms[0m[2m][0m
|
|
209
|
+
[0m[32m✓[0m [0mstartOfMonth[2m >[0m[1m February[0m [0m[2m[0.01ms[0m[2m][0m
|
|
210
|
+
[0m[32m✓[0m [0mstartOfMonth[2m >[0m[1m matches date-fns[0m [0m[2m[1.52ms[0m[2m][0m
|
|
211
|
+
[0m[32m✓[0m [0mendOfMonth[2m >[0m[1m January[0m [0m[2m[0.05ms[0m[2m][0m
|
|
212
|
+
[0m[32m✓[0m [0mendOfMonth[2m >[0m[1m February[0m
|
|
213
|
+
[0m[32m✓[0m [0mendOfMonth[2m >[0m[1m matches date-fns[0m [0m[2m[1.34ms[0m[2m][0m
|
|
214
|
+
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m sunday: week of February 17th[0m [0m[2m[0.05ms[0m[2m][0m
|
|
215
|
+
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m sunday: week of February 11th[0m
|
|
216
|
+
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m monday: week of February 17th[0m [0m[2m[0.01ms[0m[2m][0m
|
|
217
|
+
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m monday: week of February 11th[0m [0m[2m[0.01ms[0m[2m][0m
|
|
218
|
+
[0m[32m✓[0m [0mstartOfWeek[2m >[0m[1m matches date-fns[0m [0m[2m[1.27ms[0m[2m][0m
|
|
219
|
+
[0m[32m✓[0m [0maddMonths[2m >[0m[1m add 1 month[0m [0m[2m[0.11ms[0m[2m][0m
|
|
220
|
+
[0m[32m✓[0m [0maddMonths[2m >[0m[1m add 10 months[0m
|
|
221
|
+
[0m[32m✓[0m [0maddMonths[2m >[0m[1m matches date-fns[0m [0m[2m[0.18ms[0m[2m][0m
|
|
222
|
+
[0m[32m✓[0m [0msubMonths[2m >[0m[1m sub 1 month[0m [0m[2m[0.02ms[0m[2m][0m
|
|
223
|
+
[0m[32m✓[0m [0msubMonths[2m >[0m[1m sub 10 months[0m [0m[2m[0.01ms[0m[2m][0m
|
|
224
|
+
[0m[32m✓[0m [0msubMonths[2m >[0m[1m matches date-fns[0m [0m[2m[0.23ms[0m[2m][0m
|
|
225
|
+
[0m[32m✓[0m [0maddDays[2m >[0m[1m add 1 day[0m [0m[2m[0.02ms[0m[2m][0m
|
|
226
|
+
[0m[32m✓[0m [0maddDays[2m >[0m[1m add 10 days[0m
|
|
227
|
+
[0m[32m✓[0m [0maddDays[2m >[0m[1m matches date-fns[0m [0m[2m[0.11ms[0m[2m][0m
|
|
228
|
+
[0m[32m✓[0m [0msubDays[2m >[0m[1m sub 1 day[0m [0m[2m[0.10ms[0m[2m][0m
|
|
229
|
+
[0m[32m✓[0m [0msubDays[2m >[0m[1m sub 10 days[0m [0m[2m[0.02ms[0m[2m][0m
|
|
230
|
+
[0m[32m✓[0m [0msubDays[2m >[0m[1m matches date-fns[0m [0m[2m[0.15ms[0m[2m][0m
|
|
231
|
+
[0m[32m✓[0m [0misWeekend[2m >[0m[1m Friday[0m [0m[2m[0.03ms[0m[2m][0m
|
|
232
|
+
[0m[32m✓[0m [0misWeekend[2m >[0m[1m Saturday[0m [0m[2m[0.02ms[0m[2m][0m
|
|
233
|
+
[0m[32m✓[0m [0misWeekend[2m >[0m[1m Sunday[0m [0m[2m[0.02ms[0m[2m][0m
|
|
234
|
+
[0m[32m✓[0m [0misWeekend[2m >[0m[1m Monday[0m [0m[2m[0.03ms[0m[2m][0m
|
|
235
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of 1 month between Feb 28 2021 and Jan 30 2021[0m [0m[2m[0.02ms[0m[2m][0m
|
|
236
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of 1 month between Feb 28 2021 and Jan 31 2021[0m
|
|
237
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of 1 month between Nov, 30 2021 and Oct, 31 2021[0m
|
|
238
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of 1 month between Oct, 31 2021 and Sep, 30 2021[0m
|
|
239
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of 6 month between Oct, 31 2021 and Apr, 30 2021[0m [0m[2m[0.01ms[0m[2m][0m
|
|
240
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m it returns diff of -1 month between Sep, 30 2021 and Oct, 31 2021[0m
|
|
241
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m the days of months of the given dates are the same[0m [0m[2m[0.02ms[0m[2m][0m
|
|
242
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m the given dates are the same[0m [0m[2m[0.05ms[0m[2m][0m
|
|
243
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m does not return -0 when the given dates are the same[0m [0m[2m[0.02ms[0m[2m][0m
|
|
244
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m > [0medge cases[2m >[0m[1m returns the number of full months between the given dates - end of Feb[0m [0m[2m[0.05ms[0m[2m][0m
|
|
245
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m >[0m[1m returns the number of full months between the given dates[0m [0m[2m[0.02ms[0m[2m][0m
|
|
246
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m >[0m[1m returns a negative number if the time value of the first date is smaller[0m
|
|
247
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m >[0m[1m returns NaN if the first date is `Invalid Date`[0m [0m[2m[0.19ms[0m[2m][0m
|
|
248
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m >[0m[1m returns NaN if the second date is `Invalid Date`[0m [0m[2m[0.03ms[0m[2m][0m
|
|
249
|
+
[0m[32m✓[0m [0mdifferenceInMonths [2m >[0m[1m returns NaN if the both dates are `Invalid Date`[0m
|
|
250
|
+
[0m[32m✓[0m [0mgetWeeksInMonth[2m >[0m[1m sunday: Month with 5 weeks[0m [0m[2m[0.03ms[0m[2m][0m
|
|
251
|
+
[0m[32m✓[0m [0mgetWeeksInMonth[2m >[0m[1m sunday: Month with 6 weeks[0m [0m[2m[0.01ms[0m[2m][0m
|
|
252
|
+
[0m[32m✓[0m [0mgetWeeksInMonth[2m >[0m[1m monday: Month with 5 weeks[0m [0m[2m[0.03ms[0m[2m][0m
|
|
253
|
+
[0m[32m✓[0m [0mgetWeeksInMonth[2m >[0m[1m matches date-fns[0m [0m[2m[2.64ms[0m[2m][0m
|
|
254
|
+
[0m[32m✓[0m [0mgetWeekOfMonth[2m >[0m[1m sunday: June[0m [0m[2m[0.11ms[0m[2m][0m
|
|
255
|
+
[0m[32m✓[0m [0mgetWeekOfMonth[2m >[0m[1m monday: June[0m
|
|
256
|
+
[0m[32m✓[0m [0mgetWeekOfMonth[2m >[0m[1m matches date-fns[0m [0m[2m[1.36ms[0m[2m][0m
|
|
257
|
+
|
|
258
|
+
[0m[32m 115 pass[0m
|
|
259
|
+
[0m[2m 0 fail[0m
|
|
260
|
+
8695 expect() calls
|
|
261
|
+
Ran 115 tests across 5 files. [0m[2m[[1m212.00ms[0m[2m][0m
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[0m[2m[35m$[0m [2m[1mtsc --noEmit[0m
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# @marceloterreiro/flash-calendar
|
|
2
|
+
|
|
3
|
+
## 1.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 7eb13ae: Remove CalendarScrollComponent prop from Calendar.List
|
|
8
|
+
|
|
9
|
+
The `CalendarScrollComponent` prop has been removed from `Calendar.List`. LegendList is now the only supported list implementation and cannot be replaced.
|
|
10
|
+
|
|
11
|
+
**Migration:**
|
|
12
|
+
|
|
13
|
+
If you were using `CalendarScrollComponent` to integrate with bottom sheets or other custom scroll containers:
|
|
14
|
+
|
|
15
|
+
1. Wrap `Calendar.List` in your custom scroll container, or
|
|
16
|
+
2. Use the standalone `Calendar` component with your own list implementation
|
|
17
|
+
|
|
18
|
+
This change simplifies the API and reduces maintenance burden by focusing on a single, well-supported list implementation.
|
|
19
|
+
|
|
20
|
+
## 1.6.0
|
|
21
|
+
|
|
22
|
+
### Minor Changes
|
|
23
|
+
|
|
24
|
+
- 256b67d: Add callback support to `activeDayFiller` for dynamic styling based on day metadata
|
|
25
|
+
|
|
26
|
+
## 1.5.0
|
|
27
|
+
|
|
28
|
+
### Minor Changes
|
|
29
|
+
|
|
30
|
+
- 3b65183: Fixes an infinite loop triggered when calendarMaxDateId is today and calendarFutureScrollRangeInMonths is one.
|
|
31
|
+
|
|
32
|
+
## 1.4.0
|
|
33
|
+
|
|
34
|
+
### Minor Changes
|
|
35
|
+
|
|
36
|
+
- f291f09: Add support for passing custom pressable components
|
|
37
|
+
|
|
38
|
+
## 1.3.0
|
|
39
|
+
|
|
40
|
+
### Minor Changes
|
|
41
|
+
|
|
42
|
+
- b66668c: Added support for react-native-web Pressable InteractionState to support hovered and focused alongside pressed
|
|
43
|
+
|
|
44
|
+
## 1.2.0
|
|
45
|
+
|
|
46
|
+
### Minor Changes
|
|
47
|
+
|
|
48
|
+
- f3b9ec8: Add the ability to pass TextProps to the <Text> fields especially when supporting accessibility
|
|
49
|
+
|
|
50
|
+
## 1.1.0
|
|
51
|
+
|
|
52
|
+
### Minor Changes
|
|
53
|
+
|
|
54
|
+
- 863edce: Add the ability to mount more than one calendar at once
|
|
55
|
+
|
|
56
|
+
## 1.0.0
|
|
57
|
+
|
|
58
|
+
### Major Changes
|
|
59
|
+
|
|
60
|
+
- 9bf22ed: Flash Calendar 1.0.0 🚢 🎉
|
|
61
|
+
|
|
62
|
+
This release officially marks the package as production-ready (`1.0.0`).
|
|
63
|
+
While it's been stable since the first release, bumping to `1.0.0` was something
|
|
64
|
+
I had in mind for a while.
|
|
65
|
+
|
|
66
|
+
- New: Add `.scrollToMonth` and `.scrollToDate`, increasing the options available for imperative scrolling.
|
|
67
|
+
|
|
68
|
+
## Breaking changes
|
|
69
|
+
|
|
70
|
+
This release introduces one small change in behavior if your app uses
|
|
71
|
+
imperative scrolling. Previously, `.scrollToDate` would scroll to the month
|
|
72
|
+
containing the date instead of the exact date. Now, `.scrollToDate` scrolls
|
|
73
|
+
to the exact date as implied by the name.
|
|
74
|
+
|
|
75
|
+
If you intentionally want to scroll to the month instead, a new `.scrollToMonth`
|
|
76
|
+
method is available (same signature).
|
|
77
|
+
|
|
78
|
+
I don't expect this to cause any issues, but worth mentioned
|
|
79
|
+
nonetheless.
|
|
80
|
+
|
|
81
|
+
## 0.0.9
|
|
82
|
+
|
|
83
|
+
### Patch Changes
|
|
84
|
+
|
|
85
|
+
- 6d00992: - Add an optional `calendarColorScheme` prop that enables overriding the color scheme used by Flash Calendar.
|
|
86
|
+
|
|
87
|
+
## 0.0.8
|
|
88
|
+
|
|
89
|
+
### Patch Changes
|
|
90
|
+
|
|
91
|
+
- 4fe1276: Remove `borderRadius` type from `itemDay.container`, given it gets overwritten by the base component.
|
|
92
|
+
|
|
93
|
+
## 0.0.7
|
|
94
|
+
|
|
95
|
+
### Patch Changes
|
|
96
|
+
|
|
97
|
+
- ee6b4e5: Fix incorrect scroll position when using the `calendarMinDateId` prop
|
|
98
|
+
|
|
99
|
+
## 0.0.6
|
|
100
|
+
|
|
101
|
+
### Patch Changes
|
|
102
|
+
|
|
103
|
+
- 5363835: Fix `<Calendar.List />` losing track of the active date ranges when the list is scrolled past certain amount
|
|
104
|
+
|
|
105
|
+
## 0.0.5
|
|
106
|
+
|
|
107
|
+
### Patch Changes
|
|
108
|
+
|
|
109
|
+
- cbc7728: Update the registry to Github Packages
|
|
110
|
+
|
|
111
|
+
## 0.0.4
|
|
112
|
+
|
|
113
|
+
### Patch Changes
|
|
114
|
+
|
|
115
|
+
- 801bc18: Fix locale not being forwarded to `Calendar` component
|
|
116
|
+
|
|
117
|
+
## 0.0.3
|
|
118
|
+
|
|
119
|
+
### Patch Changes
|
|
120
|
+
|
|
121
|
+
- e680a96: Add the `calendarFormatLocale` prop
|
|
122
|
+
|
|
123
|
+
## 0.0.2
|
|
124
|
+
|
|
125
|
+
### Patch Changes
|
|
126
|
+
|
|
127
|
+
- First release to test the publish scripts
|