@dxos/react-ui-calendar 0.8.4-main.bc674ce → 0.8.4-main.ef1bc66f44
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/dist/lib/browser/index.mjs +8 -5
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +8 -5
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -14
- package/src/components/Calendar/Calendar.stories.tsx +1 -1
- package/src/components/Calendar/Calendar.tsx +11 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-calendar",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.ef1bc66f44",
|
|
4
4
|
"description": "A calendar component.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -33,32 +33,32 @@
|
|
|
33
33
|
"react-resize-detector": "^11.0.1",
|
|
34
34
|
"react-virtualized": "^9.22.6",
|
|
35
35
|
"react-window": "^2.2.3",
|
|
36
|
-
"@dxos/debug": "0.8.4-main.
|
|
37
|
-
"@dxos/async": "0.8.4-main.
|
|
38
|
-
"@dxos/invariant": "0.8.4-main.
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
36
|
+
"@dxos/debug": "0.8.4-main.ef1bc66f44",
|
|
37
|
+
"@dxos/async": "0.8.4-main.ef1bc66f44",
|
|
38
|
+
"@dxos/invariant": "0.8.4-main.ef1bc66f44",
|
|
39
|
+
"@dxos/util": "0.8.4-main.ef1bc66f44",
|
|
40
|
+
"@dxos/log": "0.8.4-main.ef1bc66f44"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/react": "~19.2.7",
|
|
44
44
|
"@types/react-dom": "~19.2.3",
|
|
45
45
|
"@types/react-virtualized": "^9.22.3",
|
|
46
46
|
"@types/react-window": "^2.0.0",
|
|
47
|
-
"effect": "3.19.
|
|
47
|
+
"effect": "3.19.16",
|
|
48
48
|
"react": "~19.2.3",
|
|
49
49
|
"react-dom": "~19.2.3",
|
|
50
50
|
"vite": "7.1.9",
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
51
|
+
"@dxos/react-ui": "0.8.4-main.ef1bc66f44",
|
|
52
|
+
"@dxos/storybook-utils": "0.8.4-main.ef1bc66f44",
|
|
53
|
+
"@dxos/random": "0.8.4-main.ef1bc66f44",
|
|
54
|
+
"@dxos/ui-theme": "0.8.4-main.ef1bc66f44"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"effect": "3.19.
|
|
57
|
+
"effect": "3.19.16",
|
|
58
58
|
"react": "~19.2.3",
|
|
59
59
|
"react-dom": "~19.2.3",
|
|
60
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
61
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
60
|
+
"@dxos/react-ui": "0.8.4-main.ef1bc66f44",
|
|
61
|
+
"@dxos/ui-theme": "0.8.4-main.ef1bc66f44"
|
|
62
62
|
},
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
@@ -101,6 +101,8 @@ const CalendarRoot = forwardRef<CalendarController, CalendarRootProps>(
|
|
|
101
101
|
// Viewport
|
|
102
102
|
//
|
|
103
103
|
|
|
104
|
+
const CALENDAR_VIEWPORT_NAME = 'CalendarContent';
|
|
105
|
+
|
|
104
106
|
type CalendarViewportProps = PropsWithChildren<ThemedClassName>;
|
|
105
107
|
|
|
106
108
|
const CalendarViewport = ({ children, classNames }: CalendarViewportProps) => {
|
|
@@ -111,17 +113,19 @@ const CalendarViewport = ({ children, classNames }: CalendarViewportProps) => {
|
|
|
111
113
|
);
|
|
112
114
|
};
|
|
113
115
|
|
|
114
|
-
CalendarViewport.displayName =
|
|
116
|
+
CalendarViewport.displayName = CALENDAR_VIEWPORT_NAME;
|
|
115
117
|
|
|
116
118
|
//
|
|
117
119
|
// Header
|
|
118
120
|
//
|
|
119
121
|
|
|
122
|
+
const CALENDAR_TOOLBAR_NAME = 'CalendarHeader';
|
|
123
|
+
|
|
120
124
|
type CalendarToolbarProps = ThemedClassName;
|
|
121
125
|
|
|
122
126
|
const CalendarToolbar = ({ classNames }: CalendarToolbarProps) => {
|
|
123
127
|
const { t } = useTranslation(translationKey);
|
|
124
|
-
const { weekStartsOn, event, index, selected } = useCalendarContext(
|
|
128
|
+
const { weekStartsOn, event, index, selected } = useCalendarContext(CALENDAR_TOOLBAR_NAME);
|
|
125
129
|
const top = useMemo(() => getDate(start, index ?? 0, 6, weekStartsOn), [index, weekStartsOn]);
|
|
126
130
|
const today = useMemo(() => new Date(), []);
|
|
127
131
|
|
|
@@ -152,7 +156,7 @@ const CalendarToolbar = ({ classNames }: CalendarToolbarProps) => {
|
|
|
152
156
|
);
|
|
153
157
|
};
|
|
154
158
|
|
|
155
|
-
CalendarToolbar.displayName =
|
|
159
|
+
CalendarToolbar.displayName = CALENDAR_TOOLBAR_NAME;
|
|
156
160
|
|
|
157
161
|
//
|
|
158
162
|
// Grid
|
|
@@ -160,13 +164,15 @@ CalendarToolbar.displayName = 'CalendarHeader';
|
|
|
160
164
|
// TODO(burdon): Drag range.
|
|
161
165
|
//
|
|
162
166
|
|
|
167
|
+
const CALENDAR_GRID_NAME = 'CalendarGrid';
|
|
168
|
+
|
|
163
169
|
type CalendarGridProps = ThemedClassName<{
|
|
164
170
|
rows?: number;
|
|
165
171
|
onSelect?: (event: { date: Date }) => void;
|
|
166
172
|
}>;
|
|
167
173
|
|
|
168
174
|
const CalendarGrid = ({ classNames, rows, onSelect }: CalendarGridProps) => {
|
|
169
|
-
const { weekStartsOn, event, setIndex, selected, setSelected } = useCalendarContext(
|
|
175
|
+
const { weekStartsOn, event, setIndex, selected, setSelected } = useCalendarContext(CALENDAR_GRID_NAME);
|
|
170
176
|
const { ref: containerRef, width = 0, height = 0 } = useResizeDetector();
|
|
171
177
|
const maxHeight = rows ? rows * size : undefined;
|
|
172
178
|
const listRef = useRef<List>(null);
|
|
@@ -302,7 +308,7 @@ const CalendarGrid = ({ classNames, rows, onSelect }: CalendarGridProps) => {
|
|
|
302
308
|
);
|
|
303
309
|
};
|
|
304
310
|
|
|
305
|
-
CalendarGrid.displayName =
|
|
311
|
+
CalendarGrid.displayName = CALENDAR_GRID_NAME;
|
|
306
312
|
|
|
307
313
|
//
|
|
308
314
|
// Calendar
|