uikit-react-public 0.11.20 → 0.11.24

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.
Files changed (120) hide show
  1. package/dist/components/Calendar/Calendar.d.ts +3 -0
  2. package/dist/components/Calendar/Calendar.stories.d.ts +42 -0
  3. package/dist/components/Calendar/Calendar.types.d.ts +18 -0
  4. package/dist/components/Calendar/index.d.ts +2 -0
  5. package/dist/components/Calendar/subcomponents/AcademicWeeks.d.ts +7 -0
  6. package/dist/components/Calendar/subcomponents/ColumnHeading.d.ts +7 -0
  7. package/dist/components/Calendar/subcomponents/Controls.d.ts +6 -0
  8. package/dist/components/{Datepicker/subcomponents/Day → Calendar/subcomponents}/Day.d.ts +3 -3
  9. package/dist/components/{Datepicker → Calendar}/subcomponents/EventDot.d.ts +2 -2
  10. package/dist/components/Calendar/subcomponents/Grid.d.ts +11 -0
  11. package/dist/components/Calendar/subcomponents/index.d.ts +7 -0
  12. package/dist/components/{Datepicker → Calendar}/utils/getAcademicWeekNumbers/getAcademicWeekNumbers.d.ts +1 -1
  13. package/dist/components/Calendar/utils/index.d.ts +4 -0
  14. package/dist/components/Calendar/utils/normaliseMonth/normaliseMonth.d.ts +9 -0
  15. package/dist/components/Calendar/utils/parseDateFromString/parseDateFromString.d.ts +9 -0
  16. package/dist/components/Calendar/utils/parseDateFromString/parseDateFromString.test.d.ts +1 -0
  17. package/dist/components/Datepicker/Datepicker.d.ts +3 -16
  18. package/dist/components/Datepicker/Datepicker.stories.d.ts +9 -3
  19. package/dist/components/Datepicker/Datepicker.types.d.ts +23 -7
  20. package/dist/components/Datepicker/index.d.ts +1 -2
  21. package/dist/components/Datepicker/subcomponents/CustomDatepicker.d.ts +17 -0
  22. package/dist/components/Datepicker/subcomponents/DatepickerInput.d.ts +10 -0
  23. package/dist/components/Datepicker/subcomponents/NativeDatepicker.d.ts +6 -0
  24. package/dist/components/Datepicker/subcomponents/Panel.d.ts +6 -0
  25. package/dist/components/Datepicker/subcomponents/VisibleField.d.ts +12 -0
  26. package/dist/components/Datepicker/subcomponents/index.d.ts +5 -7
  27. package/dist/components/Datepicker/utils/dateToLocaleISOString/dateToLocaleISOString.d.ts +17 -0
  28. package/dist/components/Datepicker/utils/dateToLocaleISOString/dateToLocaleISOString.test.d.ts +1 -0
  29. package/dist/components/Datepicker/utils/index.d.ts +2 -3
  30. package/dist/components/Datepicker/utils/parseInputValue/parseInputValue.d.ts +11 -0
  31. package/dist/components/Datepicker/utils/parseInputValue/parseInputValue.test.d.ts +1 -0
  32. package/dist/components/Footer/Footer.d.ts +1 -1
  33. package/dist/components/Menu/Menu.d.ts +2 -1
  34. package/dist/components/Menu/MenuContent.d.ts +1 -0
  35. package/dist/components/index.d.ts +2 -0
  36. package/dist/index.js +3269 -3117
  37. package/lib/components/Calendar/Calendar.stories.tsx +209 -0
  38. package/lib/components/Calendar/Calendar.tsx +121 -0
  39. package/lib/components/Calendar/Calendar.types.ts +21 -0
  40. package/lib/components/Calendar/__tests__/Calendar.test.tsx +71 -0
  41. package/lib/components/Calendar/__tests__/__snapshots__/Calendar.test.tsx.snap +1218 -0
  42. package/lib/components/Calendar/index.ts +6 -0
  43. package/lib/components/{Datepicker → Calendar}/subcomponents/AcademicWeek.tsx +1 -1
  44. package/lib/components/{Datepicker → Calendar}/subcomponents/AcademicWeeks.tsx +9 -7
  45. package/lib/components/Calendar/subcomponents/ColumnHeading.tsx +40 -0
  46. package/lib/components/{Datepicker/subcomponents/MonthSelector/MonthSelector.tsx → Calendar/subcomponents/Controls.tsx} +17 -17
  47. package/lib/components/{Datepicker/subcomponents/Day → Calendar/subcomponents}/Day.stories.tsx +8 -8
  48. package/lib/components/{Datepicker/subcomponents/Day → Calendar/subcomponents}/Day.tsx +28 -16
  49. package/lib/components/{Datepicker → Calendar}/subcomponents/EventDot.tsx +3 -3
  50. package/lib/components/Calendar/subcomponents/Grid.tsx +117 -0
  51. package/lib/components/Calendar/subcomponents/index.ts +7 -0
  52. package/lib/components/{Datepicker → Calendar}/utils/getAcademicWeekNumbers/getAcademicWeekNumbers.test.ts +1 -1
  53. package/lib/components/{Datepicker → Calendar}/utils/getAcademicWeekNumbers/getAcademicWeekNumbers.ts +1 -1
  54. package/lib/components/{Datepicker → Calendar}/utils/getDatesForCalendarGrid/getDatesForCalendarGrid.test.ts +29 -65
  55. package/lib/components/{Datepicker → Calendar}/utils/getDatesForCalendarGrid/getDatesForCalendarGrid.ts +11 -43
  56. package/lib/components/Calendar/utils/index.ts +4 -0
  57. package/lib/components/Calendar/utils/normaliseMonth/normaliseMonth.test.ts +40 -0
  58. package/lib/components/Calendar/utils/normaliseMonth/normaliseMonth.ts +16 -0
  59. package/lib/components/Calendar/utils/parseDateFromString/parseDateFromString.test.ts +15 -0
  60. package/lib/components/Calendar/utils/parseDateFromString/parseDateFromString.ts +19 -0
  61. package/lib/components/Datepicker/Datepicker.stories.tsx +128 -64
  62. package/lib/components/Datepicker/Datepicker.tsx +34 -114
  63. package/lib/components/Datepicker/Datepicker.types.ts +38 -9
  64. package/lib/components/Datepicker/__tests__/Datepicker.test.tsx +53 -112
  65. package/lib/components/Datepicker/__tests__/__snapshots__/Datepicker.test.tsx.snap +92 -747
  66. package/lib/components/Datepicker/index.ts +1 -2
  67. package/lib/components/Datepicker/subcomponents/CustomDatepicker.tsx +209 -0
  68. package/lib/components/Datepicker/subcomponents/DatepickerInput.tsx +74 -0
  69. package/lib/components/Datepicker/subcomponents/NativeDatepicker.tsx +70 -0
  70. package/lib/components/Datepicker/subcomponents/Panel.tsx +32 -0
  71. package/lib/components/Datepicker/subcomponents/VisibleField.tsx +104 -0
  72. package/lib/components/Datepicker/subcomponents/index.ts +5 -7
  73. package/lib/components/Datepicker/utils/dateToLocaleISOString/dateToLocaleISOString.test.ts +32 -0
  74. package/lib/components/Datepicker/utils/dateToLocaleISOString/dateToLocaleISOString.ts +23 -0
  75. package/lib/components/Datepicker/utils/index.ts +2 -3
  76. package/lib/components/Datepicker/utils/parseInputValue/parseInputValue.test.ts +110 -0
  77. package/lib/components/Datepicker/utils/parseInputValue/parseInputValue.ts +57 -0
  78. package/lib/components/Footer/Footer.tsx +3 -3
  79. package/lib/components/Footer/__tests__/__snapshots__/Footer.test.tsx.snap +6 -6
  80. package/lib/components/Menu/Menu.tsx +3 -0
  81. package/lib/components/Menu/MenuContent.tsx +4 -1
  82. package/lib/components/index.ts +3 -0
  83. package/package.json +2 -2
  84. package/dist/components/Datepicker/subcomponents/AcademicWeeks.d.ts +0 -7
  85. package/dist/components/Datepicker/subcomponents/CalendarGrid/CalendarGrid.d.ts +0 -8
  86. package/dist/components/Datepicker/subcomponents/CalendarGrid/index.d.ts +0 -1
  87. package/dist/components/Datepicker/subcomponents/CalendarMenu/CalendarMenu.d.ts +0 -12
  88. package/dist/components/Datepicker/subcomponents/CalendarMenu/index.d.ts +0 -1
  89. package/dist/components/Datepicker/subcomponents/ColumnHeadings/ColumnHeadings.d.ts +0 -2
  90. package/dist/components/Datepicker/subcomponents/ColumnHeadings/index.d.ts +0 -1
  91. package/dist/components/Datepicker/subcomponents/DateField/DateField.d.ts +0 -7
  92. package/dist/components/Datepicker/subcomponents/DateField/index.d.ts +0 -1
  93. package/dist/components/Datepicker/subcomponents/Day/index.d.ts +0 -1
  94. package/dist/components/Datepicker/subcomponents/MonthSelector/MonthSelector.d.ts +0 -6
  95. package/dist/components/Datepicker/subcomponents/MonthSelector/index.d.ts +0 -1
  96. package/dist/components/Datepicker/subcomponents/Native/Native.d.ts +0 -9
  97. package/dist/components/Datepicker/subcomponents/Native/index.d.ts +0 -1
  98. package/dist/components/Datepicker/utils/parseDateForDateField/parseDateForDateField.d.ts +0 -20
  99. package/lib/components/Datepicker/subcomponents/CalendarGrid/CalendarGrid.tsx +0 -54
  100. package/lib/components/Datepicker/subcomponents/CalendarGrid/index.ts +0 -1
  101. package/lib/components/Datepicker/subcomponents/CalendarMenu/CalendarMenu.tsx +0 -90
  102. package/lib/components/Datepicker/subcomponents/CalendarMenu/index.ts +0 -1
  103. package/lib/components/Datepicker/subcomponents/ColumnHeadings/ColumnHeadings.tsx +0 -35
  104. package/lib/components/Datepicker/subcomponents/ColumnHeadings/index.ts +0 -1
  105. package/lib/components/Datepicker/subcomponents/DateField/DateField.tsx +0 -155
  106. package/lib/components/Datepicker/subcomponents/DateField/__tests__/DateField.test.tsx +0 -191
  107. package/lib/components/Datepicker/subcomponents/DateField/index.ts +0 -1
  108. package/lib/components/Datepicker/subcomponents/Day/index.ts +0 -1
  109. package/lib/components/Datepicker/subcomponents/MonthSelector/index.ts +0 -1
  110. package/lib/components/Datepicker/subcomponents/Native/Native.tsx +0 -59
  111. package/lib/components/Datepicker/subcomponents/Native/index.ts +0 -1
  112. package/lib/components/Datepicker/utils/parseDateForDateField/parseDateForDateField.test.ts +0 -41
  113. package/lib/components/Datepicker/utils/parseDateForDateField/parseDateForDateField.ts +0 -48
  114. /package/dist/components/{Datepicker/subcomponents/DateField/__tests__/DateField.test.d.ts → Calendar/__tests__/Calendar.test.d.ts} +0 -0
  115. /package/dist/components/{Datepicker → Calendar}/subcomponents/AcademicWeek.d.ts +0 -0
  116. /package/dist/components/{Datepicker/subcomponents/Day → Calendar/subcomponents}/Day.stories.d.ts +0 -0
  117. /package/dist/components/{Datepicker → Calendar}/utils/getAcademicWeekNumbers/getAcademicWeekNumbers.test.d.ts +0 -0
  118. /package/dist/components/{Datepicker → Calendar}/utils/getDatesForCalendarGrid/getDatesForCalendarGrid.d.ts +0 -0
  119. /package/dist/components/{Datepicker → Calendar}/utils/getDatesForCalendarGrid/getDatesForCalendarGrid.test.d.ts +0 -0
  120. /package/dist/components/{Datepicker/utils/parseDateForDateField/parseDateForDateField.test.d.ts → Calendar/utils/normaliseMonth/normaliseMonth.test.d.ts} +0 -0
@@ -0,0 +1,3 @@
1
+ import { CalendarProps } from './Calendar.types';
2
+ declare const Calendar: ({ pickedDate, onDatePick, minDate, maxDate, events, showAcademicWeeks, academicWeeks, testId, className, }: CalendarProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default Calendar;
@@ -0,0 +1,42 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ declare const meta: {
3
+ title: string;
4
+ component: ({ pickedDate, onDatePick, minDate, maxDate, events, showAcademicWeeks, academicWeeks, testId, className, }: import('./Calendar.types').CalendarProps) => import("react/jsx-runtime").JSX.Element;
5
+ parameters: {
6
+ layout: string;
7
+ };
8
+ argTypes: {
9
+ pickedDate: {
10
+ control: {
11
+ type: "date";
12
+ };
13
+ };
14
+ minDate: {
15
+ control: {
16
+ type: "date";
17
+ };
18
+ };
19
+ maxDate: {
20
+ control: {
21
+ type: "date";
22
+ };
23
+ };
24
+ showAcademicWeeks: {
25
+ control: {
26
+ type: "boolean";
27
+ };
28
+ };
29
+ testId: {
30
+ control: {
31
+ type: "text";
32
+ };
33
+ };
34
+ };
35
+ tags: string[];
36
+ };
37
+ export default meta;
38
+ type Story = StoryObj<typeof meta>;
39
+ export declare const Default: Story;
40
+ export declare const WithEvents: Story;
41
+ export declare const WithAcademicWeeks: Story;
42
+ export declare const MinMaxDates: Story;
@@ -0,0 +1,18 @@
1
+ export type CalendarEvent = {
2
+ date: string;
3
+ };
4
+ export type AcademicWeek = {
5
+ start: string;
6
+ number: number;
7
+ };
8
+ export interface CalendarProps {
9
+ pickedDate?: Date | null;
10
+ onDatePick?: (date: Date | null, event?: React.SyntheticEvent) => void;
11
+ minDate?: string | null;
12
+ maxDate?: string | null;
13
+ events?: CalendarEvent[];
14
+ showAcademicWeeks?: boolean;
15
+ academicWeeks?: AcademicWeek[];
16
+ testId?: string;
17
+ className?: string;
18
+ }
@@ -0,0 +1,2 @@
1
+ export { default } from './Calendar';
2
+ export type { CalendarProps, CalendarEvent, AcademicWeek, } from './Calendar.types';
@@ -0,0 +1,7 @@
1
+ import { AcademicWeek as AcademicWeekType } from '../Calendar.types';
2
+ interface AcademicWeeksProps {
3
+ date: Date;
4
+ weeks: AcademicWeekType[];
5
+ }
6
+ declare const AcademicWeeks: ({ date, weeks }: AcademicWeeksProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default AcademicWeeks;
@@ -0,0 +1,7 @@
1
+ interface ColumnHeadingProps {
2
+ index: number;
3
+ day: string;
4
+ isWeekend: boolean;
5
+ }
6
+ declare const ColumnHeading: ({ index, day, isWeekend }: ColumnHeadingProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default ColumnHeading;
@@ -0,0 +1,6 @@
1
+ interface ControlsProps {
2
+ month: Date;
3
+ changeMonth: (change: number) => void;
4
+ }
5
+ declare const Controls: ({ month, changeMonth }: ControlsProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default Controls;
@@ -1,7 +1,7 @@
1
- import { CalendarEvent } from '../../Datepicker.types';
1
+ import { CalendarEvent } from '../Calendar.types';
2
2
  export interface DayProps {
3
- date: Date | null | undefined;
4
- onPick?: (date: Date) => void;
3
+ date: Date;
4
+ onPick?: (date: Date, event: React.SyntheticEvent) => void;
5
5
  isSelected?: boolean;
6
6
  isToday?: boolean;
7
7
  isInCurrentMonth?: boolean;
@@ -1,6 +1,6 @@
1
- type EventDotProps = {
1
+ interface EventDotProps {
2
2
  inverted: boolean;
3
3
  inCurrentMonth: boolean;
4
- };
4
+ }
5
5
  declare const EventDot: ({ inverted, inCurrentMonth }: EventDotProps) => import("react/jsx-runtime").JSX.Element;
6
6
  export default EventDot;
@@ -0,0 +1,11 @@
1
+ import { CalendarEvent } from '../Calendar.types';
2
+ interface GridProps {
3
+ month: Date;
4
+ pickedDate: Date | null;
5
+ onDatePick?: (date: Date, event: React.SyntheticEvent) => void;
6
+ minDate: Date | null;
7
+ maxDate: Date | null;
8
+ events: CalendarEvent[];
9
+ }
10
+ declare const Grid: ({ month, pickedDate, onDatePick, minDate, maxDate, events, }: GridProps) => import("react/jsx-runtime").JSX.Element;
11
+ export default Grid;
@@ -0,0 +1,7 @@
1
+ export { default as Controls } from './Controls';
2
+ export { default as AcademicWeeks } from './AcademicWeeks';
3
+ export { default as AcademicWeek } from './AcademicWeek';
4
+ export { default as Grid } from './Grid';
5
+ export { default as ColumnHeading } from './ColumnHeading';
6
+ export { default as Day } from './Day';
7
+ export { default as EventDot } from './EventDot';
@@ -1,4 +1,4 @@
1
- import { AcademicWeek } from '../../Datepicker.types';
1
+ import { AcademicWeek } from '../../';
2
2
  /**
3
3
  * Returns the Monday for the week of the given date.
4
4
  * For example:
@@ -0,0 +1,4 @@
1
+ export { default as normaliseMonth } from './normaliseMonth/normaliseMonth';
2
+ export { default as parseDateFromString } from './parseDateFromString/parseDateFromString';
3
+ export { default as getAcademicWeekNumbers } from './getAcademicWeekNumbers/getAcademicWeekNumbers';
4
+ export { default as getDatesForCalendarGrid } from './getDatesForCalendarGrid/getDatesForCalendarGrid';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Normalises a given date to the first day of its month (with the time set to midnight).
3
+ * If the input date is undefined, it returns null.
4
+ * Used in <Calendar> to track the displayed month.
5
+ * @param date The date to normalise.
6
+ * @returns A new Date object set to the first day of the month with the time at midnight, or null if the input was null or undefined.
7
+ */
8
+ declare const normaliseMonth: (date: Date | null | undefined) => Date | null;
9
+ export default normaliseMonth;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Parses a date string into a Date object.
3
+ * Returns null if the input is invalid.
4
+ *
5
+ * @param dateString - The date string to parse (can be in ISO format or UNIX timestamp).
6
+ * @returns A Date object, or null if invalid.
7
+ */
8
+ declare const parseDateFromString: (dateString: string) => Date | null;
9
+ export default parseDateFromString;
@@ -1,16 +1,3 @@
1
- import { InputHTMLAttributes } from 'react';
2
- import { CalendarEvent, AcademicWeek } from './Datepicker.types';
3
- export declare const NAME = "ucl-datepicker";
4
- export interface DatepickerProps extends InputHTMLAttributes<HTMLInputElement> {
5
- date: Date | null | undefined;
6
- minDate?: Date | null | undefined;
7
- maxDate?: Date | null | undefined;
8
- onDateChange: (date: Date | null | undefined) => void;
9
- native?: boolean;
10
- events?: CalendarEvent[];
11
- showAcademicWeeks?: boolean;
12
- academicWeeks?: AcademicWeek[];
13
- testId?: string;
14
- }
15
- declare const _default: import('react').MemoExoticComponent<({ date, minDate, maxDate, onDateChange, native, events, showAcademicWeeks, academicWeeks, testId, className, ...props }: DatepickerProps) => import("react/jsx-runtime").JSX.Element>;
16
- export default _default;
1
+ import { DatepickerProps } from './Datepicker.types';
2
+ declare const Datepicker: ({ value, onValueChange, minDate, maxDate, disabled, className, native, nativeRef, nativeHTMLAttributes, ...props }: DatepickerProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default Datepicker;
@@ -1,12 +1,12 @@
1
1
  import { StoryObj } from '@storybook/react';
2
2
  declare const meta: {
3
3
  title: string;
4
- component: import('react').MemoExoticComponent<({ date, minDate, maxDate, onDateChange, native, events, showAcademicWeeks, academicWeeks, testId, className, ...props }: import('./Datepicker').DatepickerProps) => import("react/jsx-runtime").JSX.Element>;
4
+ component: ({ value, onValueChange, minDate, maxDate, disabled, className, native, nativeRef, nativeHTMLAttributes, ...props }: import('./Datepicker.types').DatepickerProps) => import("react/jsx-runtime").JSX.Element;
5
5
  parameters: {
6
6
  layout: string;
7
7
  };
8
8
  argTypes: {
9
- date: {
9
+ value: {
10
10
  control: {
11
11
  type: "date";
12
12
  };
@@ -21,6 +21,11 @@ declare const meta: {
21
21
  type: "date";
22
22
  };
23
23
  };
24
+ disabled: {
25
+ control: {
26
+ type: "boolean";
27
+ };
28
+ };
24
29
  native: {
25
30
  control: {
26
31
  type: "boolean";
@@ -37,6 +42,7 @@ declare const meta: {
37
42
  export default meta;
38
43
  type Story = StoryObj<typeof meta>;
39
44
  export declare const Default: Story;
40
- export declare const AsNative: Story;
41
45
  export declare const WithEvents: Story;
42
46
  export declare const WithAcademicWeeks: Story;
47
+ export declare const MinMaxDates: Story;
48
+ export declare const Native: Story;
@@ -1,7 +1,23 @@
1
- export type CalendarEvent = {
2
- date: string;
3
- };
4
- export type AcademicWeek = {
5
- start: string;
6
- number: number;
7
- };
1
+ import { InputHTMLAttributes, HTMLAttributes, RefObject } from 'react';
2
+ import { CalendarEvent, AcademicWeek } from '../Calendar';
3
+ export type DatepickerValue = Date | null;
4
+ interface BaseDatepickerProps {
5
+ value?: DatepickerValue;
6
+ onValueChange?: (value: DatepickerValue, event?: React.SyntheticEvent) => void;
7
+ minDate?: string | null;
8
+ maxDate?: string | null;
9
+ events?: CalendarEvent[];
10
+ showAcademicWeeks?: boolean;
11
+ academicWeeks?: AcademicWeek[];
12
+ testId?: string;
13
+ disabled?: boolean;
14
+ ref?: RefObject<HTMLDivElement>;
15
+ inputRef?: RefObject<HTMLInputElement>;
16
+ }
17
+ type NativeDatepickerAttributeProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'min' | 'max' | 'className' | 'disabled'>;
18
+ export interface DatepickerProps extends BaseDatepickerProps, HTMLAttributes<HTMLDivElement> {
19
+ native?: boolean;
20
+ nativeHTMLAttributes?: NativeDatepickerAttributeProps;
21
+ nativeRef?: RefObject<HTMLInputElement>;
22
+ }
23
+ export {};
@@ -1,3 +1,2 @@
1
1
  export { default } from './Datepicker';
2
- export type { DatepickerProps } from './Datepicker';
3
- export type { CalendarEvent, AcademicWeek } from './Datepicker.types';
2
+ export type { DatepickerProps } from './Datepicker.types';
@@ -0,0 +1,17 @@
1
+ import { DatepickerValue } from '../Datepicker.types';
2
+ import { CalendarEvent, AcademicWeek } from '../../Calendar';
3
+ interface CustomDatepickerProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ value?: DatepickerValue;
5
+ onValueChange?: (value: DatepickerValue, event?: React.SyntheticEvent) => void;
6
+ minDate?: string | null;
7
+ maxDate?: string | null;
8
+ disabled?: boolean;
9
+ events?: CalendarEvent[];
10
+ showAcademicWeeks?: boolean;
11
+ academicWeeks?: AcademicWeek[];
12
+ testId?: string;
13
+ ref?: React.RefObject<HTMLDivElement>;
14
+ inputRef?: React.RefObject<HTMLInputElement>;
15
+ }
16
+ declare const CustomDatepicker: ({ value, onValueChange, minDate, maxDate, disabled, events, showAcademicWeeks, academicWeeks, testId, className, ref, inputRef, ...props }: CustomDatepickerProps) => import("react/jsx-runtime").JSX.Element;
17
+ export default CustomDatepicker;
@@ -0,0 +1,10 @@
1
+ interface DatepickerInputProps {
2
+ value: string;
3
+ onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
4
+ onKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
5
+ onFocus: () => void;
6
+ disabled: boolean;
7
+ ref: React.RefObject<HTMLInputElement | null>;
8
+ }
9
+ declare const DatepickerInput: ({ value, onChange, onKeyDown, onFocus, disabled, ref, }: DatepickerInputProps) => import("react/jsx-runtime").JSX.Element;
10
+ export default DatepickerInput;
@@ -0,0 +1,6 @@
1
+ interface NativeDatepickerProps extends React.InputHTMLAttributes<HTMLInputElement> {
2
+ testId?: string;
3
+ ref?: React.RefObject<HTMLInputElement>;
4
+ }
5
+ declare const NativeDatepicker: ({ value, onChange, min, max, className, disabled, testId, ref, ...props }: NativeDatepickerProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default NativeDatepicker;
@@ -0,0 +1,6 @@
1
+ interface PanelProps {
2
+ zIndex?: number;
3
+ children: React.ReactNode;
4
+ }
5
+ declare const Panel: ({ zIndex, children }: PanelProps) => import("react/jsx-runtime").JSX.Element;
6
+ export default Panel;
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ interface VisibleFieldProps {
3
+ inputValue: string;
4
+ onInputChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
5
+ onInputKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
6
+ onInputFocus: () => void;
7
+ onButtonClick: () => void;
8
+ disabled: boolean;
9
+ inputRef: React.RefObject<HTMLInputElement | null>;
10
+ }
11
+ declare const VisibleField: ({ inputValue, onInputChange, onInputKeyDown, onInputFocus, onButtonClick, disabled, inputRef, }: VisibleFieldProps) => import("react/jsx-runtime").JSX.Element;
12
+ export default VisibleField;
@@ -1,7 +1,5 @@
1
- export { default as CalendarGrid } from './CalendarGrid';
2
- export { default as CalendarMenu } from './CalendarMenu';
3
- export { default as ColumnHeadings } from './ColumnHeadings';
4
- export { default as DateField } from './DateField';
5
- export { default as Day } from './Day';
6
- export { default as Native } from './Native';
7
- export { default as MonthSelector } from './MonthSelector';
1
+ export { default as CustomDatepicker } from './CustomDatepicker';
2
+ export { default as NativeDatepicker } from './NativeDatepicker';
3
+ export { default as VisibleField } from './VisibleField';
4
+ export { default as DatepickerInput } from './DatepickerInput';
5
+ export { default as Panel } from './Panel';
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Converts a Date object to a `YYYY-MM-DD` string based on the user's local timezone.
3
+ *
4
+ * Used for passing dates to <NativeDatepicker> in `Datepicker.tsx`
5
+ *
6
+ * This function uses the Swedish (`sv-SE`) locale with `toLocaleDateString`
7
+ * as it conveniently defaults to the ISO 8601 `YYYY-MM-DD` format, while respecting
8
+ * the local date. This avoids timezone conversion issues that can arise from
9
+ * using `toISOString()`.
10
+ *
11
+ * This implementation should handle daylight saving time, etc, correctly.
12
+ *
13
+ * @param date The date to convert.
14
+ * @returns A string in `YYYY-MM-DD` format, or `null` if the input is `null`.
15
+ */
16
+ declare const dateToLocaleISOString: (date: Date | null | undefined) => string | null;
17
+ export default dateToLocaleISOString;
@@ -1,3 +1,2 @@
1
- export { default as getDatesForCalendarGrid } from './getDatesForCalendarGrid/getDatesForCalendarGrid';
2
- export { default as parseDate } from './parseDateForDateField/parseDateForDateField';
3
- export { default as getAcademicWeekNumbers } from './getAcademicWeekNumbers/getAcademicWeekNumbers';
1
+ export { default as dateToLocaleISOString } from './dateToLocaleISOString/dateToLocaleISOString';
2
+ export { default as parseInputValue } from './parseInputValue/parseInputValue';
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Parses a date string into a Date object.
3
+ * Used in <VisibleField> to parse user input into the controlled <input> field.
4
+ *
5
+ * @param {string} value The date string to parse. Expected format is DD/MM/YYYY, DD-MM-YYYY, or DD MM YYYY.
6
+ * @param {string} [minDate] Optional minimum date string in YYYY-MM-DD format. If the parsed date is before this date, the function returns null.
7
+ * @param {string} [maxDate] Optional maximum date string in YYYY-MM-DD format. If the parsed date is after this date, the function returns null.
8
+ * @returns {Date | null} A Date object representing the parsed date, or null if the input is invalid or out of range.
9
+ */
10
+ declare const parseInputValue: (value: string, minDate?: string | null, maxDate?: string | null) => Date | null;
11
+ export default parseInputValue;
@@ -2,7 +2,7 @@ import { HTMLAttributes } from 'react';
2
2
  import { default as FooterColumn } from './FooterColumn';
3
3
  import { default as FooterNavLink } from './FooterNavLink';
4
4
  export declare const NAME = "ucl-uikit-footer";
5
- export interface FooterProps extends HTMLAttributes<HTMLDivElement> {
5
+ export interface FooterProps extends HTMLAttributes<HTMLElement> {
6
6
  testId?: string;
7
7
  disclaimer?: string;
8
8
  freedomOfInformation?: string;
@@ -7,11 +7,12 @@ export interface MenuProps extends HTMLAttributes<HTMLDivElement> {
7
7
  title?: string;
8
8
  menuId?: string;
9
9
  testId?: string;
10
+ position?: 'left' | 'right';
10
11
  }
11
12
  export interface IMenuSubComponents {
12
13
  Section: typeof MenuSection;
13
14
  Item: typeof MenuItem;
14
15
  }
15
- declare const MemoMenu: import('react').MemoExoticComponent<({ defaultOpen, title, menuId, testId, children, className, ...props }: MenuProps) => import("react/jsx-runtime").JSX.Element>;
16
+ declare const MemoMenu: import('react').MemoExoticComponent<({ defaultOpen, title, position, menuId, testId, children, className, ...props }: MenuProps) => import("react/jsx-runtime").JSX.Element>;
16
17
  declare const MenuWithSubComponents: typeof MemoMenu & IMenuSubComponents;
17
18
  export default MenuWithSubComponents;
@@ -3,6 +3,7 @@ export declare const NAME = "ucl-uikit-menu__content";
3
3
  export interface MenuContentProps extends HTMLAttributes<HTMLDivElement> {
4
4
  title?: string;
5
5
  testId?: string;
6
+ position?: 'left' | 'right';
6
7
  }
7
8
  declare const _default: React.NamedExoticComponent<MenuContentProps>;
8
9
  export default _default;
@@ -77,3 +77,5 @@ export { default as Radio, LabelledRadio } from './Radio';
77
77
  export type { RadioProps, LabelledRadioProps } from './Radio';
78
78
  export { default as Datepicker } from './Datepicker';
79
79
  export type { DatepickerProps } from './Datepicker';
80
+ export { default as Calendar } from './Calendar';
81
+ export type { CalendarProps } from './Calendar';