Skip to content

Commit d19a957

Browse files
Merge pull request #259 from open-formulieren/issue/242-upgrade-calendar
Upgrade calendar
2 parents 6f4c4a7 + e1841d4 commit d19a957

File tree

6 files changed

+74
-3
lines changed

6 files changed

+74
-3
lines changed

package-lock.json

Lines changed: 62 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
"vitest": "^3.0.7"
141141
},
142142
"dependencies": {
143+
"@utrecht/calendar-react": "^1.0.15",
143144
"@utrecht/component-library-react": "1.0.0-alpha.353",
144145
"clsx": "^2.1.0",
145146
"dompurify": "^3.2.6",

src/components/forms/DatePicker.stories.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import type {Meta, StoryObj} from '@storybook/react-vite';
22
import {Paragraph} from '@utrecht/component-library-react';
33
import {expect, userEvent, waitFor, within} from 'storybook/test';
44

5+
import {withMockDate} from '@/sb-decorators';
6+
57
import {DatePicker, DatePickerRoot, DatePickerTrigger} from './DatePicker';
68

79
export default {
@@ -36,6 +38,7 @@ export default {
3638
</>
3739
);
3840
},
41+
withMockDate,
3942
],
4043
args: {
4144
children: null,
@@ -45,6 +48,7 @@ export default {
4548
},
4649
parameters: {
4750
layout: 'centered',
51+
mockDate: new Date('2025-12-17T12:00:00+01:00'),
4852
},
4953
} satisfies Meta<typeof DatePicker>;
5054

src/components/forms/DatePickerCalendar.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@use '@utrecht/components/button';
2-
@use '@utrecht/components/calendar';
2+
@use '@utrecht/calendar-css';
33

44
@use '@/scss/button-override';
55

src/components/forms/DatePickerCalendar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Calendar component documentation:
22
// https://nl-design-system.github.io/utrecht/storybook-react/index.html?path=/docs/react-component-calendar--docs
3-
import {Calendar} from '@utrecht/component-library-react';
3+
import {Calendar} from '@utrecht/calendar-react';
44
import type {Locale} from 'date-fns';
55
import {useEffect, useState} from 'react';
66
import {useIntl} from 'react-intl';
@@ -24,7 +24,7 @@ const loadCalendarLocale = async (locale: string): Promise<Locale> => {
2424
}
2525
};
2626

27-
const DatePickerCalendar: typeof Calendar = props => {
27+
const DatePickerCalendar: React.FC<React.ComponentProps<typeof Calendar>> = props => {
2828
const intl = useIntl();
2929
const [calendarLocale, setCalendarLocale] = useState<Locale | null>(null);
3030

src/components/forms/DateTimeField/DateTimeField.stories.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,14 @@ export const NoErrorWhileFocus: Story = {
356356
};
357357

358358
export const KeyboardNavigation: Story = {
359+
decorators: [withMockDate],
359360
args: {
360361
name: 'test',
361362
label: 'Logical tab navigation',
362363
},
364+
parameters: {
365+
mockDate: new Date('2025-12-17T12:00:00+01:00'),
366+
},
363367

364368
play: async ({canvasElement}) => {
365369
const canvas = within(canvasElement);

0 commit comments

Comments
 (0)