@entur/datepicker 11.8.0 → 12.0.0-next.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/dist/DatePicker/Calendar.d.ts +1 -1
- package/dist/DatePicker/CalendarBase.d.ts +1 -1
- package/dist/DatePicker/CalendarCell.d.ts +1 -2
- package/dist/DatePicker/CalendarGrid.d.ts +1 -2
- package/dist/DatePicker/DateField.d.ts +1 -1
- package/dist/DatePicker/DatePicker.d.ts +1 -1
- package/dist/DatePicker/RangeCalendar.d.ts +1 -1
- package/dist/DatePicker/RangeCalendarCell.d.ts +1 -2
- package/dist/TimePicker/SimpleTimePicker.d.ts +1 -1
- package/dist/TimePicker/TimePicker.d.ts +1 -1
- package/dist/TimePicker/TimePickerArrowButton.d.ts +1 -2
- package/dist/datepicker.cjs.js +6 -6
- package/dist/datepicker.cjs.js.map +1 -1
- package/dist/datepicker.esm.js +8 -8
- package/dist/datepicker.esm.js.map +1 -1
- package/dist/shared/CalendarButton.d.ts +1 -1
- package/dist/shared/FieldSegment.d.ts +1 -2
- package/dist/styles.css +4 -7
- package/package.json +14 -14
|
@@ -66,5 +66,5 @@ type BaseCalendarProps<DateType extends DateValue> = {
|
|
|
66
66
|
visibleDuration?: Pick<DateDuration, 'months'>;
|
|
67
67
|
};
|
|
68
68
|
export type CalendarProps<DateType extends DateValue> = BaseCalendarProps<DateType> & ExtendedCalendarProps<DateType>;
|
|
69
|
-
export declare const Calendar: <DateType extends DateValue>({ locale: localOverride, ...rest }: CalendarProps<DateType>) =>
|
|
69
|
+
export declare const Calendar: <DateType extends DateValue>({ locale: localOverride, ...rest }: CalendarProps<DateType>) => import("react/jsx-runtime").JSX.Element;
|
|
70
70
|
export {};
|
|
@@ -16,5 +16,5 @@ type CalendarBaseProps = {
|
|
|
16
16
|
weekNumberHeader: string;
|
|
17
17
|
renderCell: (date: CalendarDate, currentMonth: CalendarDate, weekNumberString: string, ariaDescribedBy: string) => React.ReactNode;
|
|
18
18
|
};
|
|
19
|
-
export declare const CalendarBase: ({ state, calendarProps, prevButtonProps, nextButtonProps, title, calendarRef, style, className, navigationDescription, showWeekNumbers, weekNumberHeader, renderCell, }: CalendarBaseProps) =>
|
|
19
|
+
export declare const CalendarBase: ({ state, calendarProps, prevButtonProps, nextButtonProps, title, calendarRef, style, className, navigationDescription, showWeekNumbers, weekNumberHeader, renderCell, }: CalendarBaseProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
import { CalendarState } from '@react-stately/calendar';
|
|
3
2
|
import { CalendarDate } from '@internationalized/date';
|
|
4
3
|
type CalendarCellProps = {
|
|
@@ -12,5 +11,5 @@ type CalendarCellProps = {
|
|
|
12
11
|
classNameForDate?: (date: CalendarDate) => string;
|
|
13
12
|
ariaLabelForDate?: (date: CalendarDate) => string;
|
|
14
13
|
};
|
|
15
|
-
export declare const CalendarCell: ({ state, date, currentMonth, showOutsideMonth, onSelectedCellClick, onCellClick, weekNumberString, classNameForDate, ariaLabelForDate, ...rest }: CalendarCellProps) =>
|
|
14
|
+
export declare const CalendarCell: ({ state, date, currentMonth, showOutsideMonth, onSelectedCellClick, onCellClick, weekNumberString, classNameForDate, ariaLabelForDate, ...rest }: CalendarCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
15
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
import { CalendarState, RangeCalendarState } from '@react-stately/calendar';
|
|
3
2
|
import { CalendarDate } from '@internationalized/date';
|
|
4
3
|
type CalendarGridProps = {
|
|
@@ -9,5 +8,5 @@ type CalendarGridProps = {
|
|
|
9
8
|
weekNumberHeader: string;
|
|
10
9
|
renderCell: (date: CalendarDate, currentMonth: CalendarDate, weekNumberString: string, ariaDescribedBy: string) => React.ReactNode;
|
|
11
10
|
};
|
|
12
|
-
export declare const CalendarGrid: ({ state, startDate, navigationDescription, showWeekNumbers, weekNumberHeader, renderCell, }: CalendarGridProps) =>
|
|
11
|
+
export declare const CalendarGrid: ({ state, startDate, navigationDescription, showWeekNumbers, weekNumberHeader, renderCell, }: CalendarGridProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
12
|
export {};
|
|
@@ -85,5 +85,5 @@ export type BaseDateFieldProps<DateType extends DateValue> = {
|
|
|
85
85
|
style?: React.CSSProperties;
|
|
86
86
|
};
|
|
87
87
|
export type DateFieldProps<DateType extends DateValue> = BaseDateFieldProps<DateType> & ExtendedDateFieldProps<DateType>;
|
|
88
|
-
export declare const DateField: <DateType extends DateValue>({ selectedDate, onChange, label, locale: customLocale, showTimeZone, showTime, granularity, disabled, readOnly, isDisabled, variant, feedback, validationVariant, validationFeedback, labelTooltip, minDate, maxDate, forcedReturnType, style, className, labelProps: parentLabelProps, append, prepend, onValidate, dateFieldRef: ref, ...rest }: DateFieldProps<DateType>) =>
|
|
88
|
+
export declare const DateField: <DateType extends DateValue>({ selectedDate, onChange, label, locale: customLocale, showTimeZone, showTime, granularity, disabled, readOnly, isDisabled, variant, feedback, validationVariant, validationFeedback, labelTooltip, minDate, maxDate, forcedReturnType, style, className, labelProps: parentLabelProps, append, prepend, onValidate, dateFieldRef: ref, ...rest }: DateFieldProps<DateType>) => import("react/jsx-runtime").JSX.Element;
|
|
89
89
|
export {};
|
|
@@ -43,5 +43,5 @@ type BaseDatePickerProps = {
|
|
|
43
43
|
ariaLabelForDate?: (date: CalendarDate) => string;
|
|
44
44
|
};
|
|
45
45
|
export type DatePickerProps<DateType extends DateValue> = Omit<BaseDateFieldProps<DateType>, keyof BaseDatePickerProps | 'labelProps' | 'fieldProps' | 'groupProps' | 'dateFieldRef'> & BaseDatePickerProps & ExtendedDateFieldProps<DateType>;
|
|
46
|
-
export declare const DatePicker: <DateType extends DateValue>({ selectedDate, locale, disabled, readOnly, showTime, showTimeZone, classNameForDate, className, variant, feedback, validationVariant, validationFeedback, showWeekNumbers, weekNumberHeader, showOutsideMonth, disableModal, labelTooltip, navigationDescription, minDate, maxDate, modalTreshold, ariaLabelForDate, append, prepend, granularity, ...rest }: DatePickerProps<DateType>) =>
|
|
46
|
+
export declare const DatePicker: <DateType extends DateValue>({ selectedDate, locale, disabled, readOnly, showTime, showTimeZone, classNameForDate, className, variant, feedback, validationVariant, validationFeedback, showWeekNumbers, weekNumberHeader, showOutsideMonth, disableModal, labelTooltip, navigationDescription, minDate, maxDate, modalTreshold, ariaLabelForDate, append, prepend, granularity, ...rest }: DatePickerProps<DateType>) => import("react/jsx-runtime").JSX.Element;
|
|
47
47
|
export {};
|
|
@@ -65,5 +65,5 @@ type BaseRangeCalendarProps<DateType extends DateValue> = {
|
|
|
65
65
|
};
|
|
66
66
|
type ExtendedRangeCalendarProps<DateType extends DateValue> = Omit<AriaRangeCalendarProps<DateType>, keyof BaseRangeCalendarProps<DateType> | 'value' | 'label' | 'hideTimeZone' | 'placeholder' | 'placeholderValue' | 'defaultValue' | 'minValue' | 'maxValue'>;
|
|
67
67
|
export type RangeCalendarProps<DateType extends DateValue> = BaseRangeCalendarProps<DateType> & ExtendedRangeCalendarProps<DateType>;
|
|
68
|
-
export declare const RangeCalendar: <DateType extends DateValue>({ locale: localOverride, ...rest }: RangeCalendarProps<DateType>) =>
|
|
68
|
+
export declare const RangeCalendar: <DateType extends DateValue>({ locale: localOverride, ...rest }: RangeCalendarProps<DateType>) => import("react/jsx-runtime").JSX.Element;
|
|
69
69
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
import { RangeCalendarState } from '@react-stately/calendar';
|
|
3
2
|
import { CalendarDate } from '@internationalized/date';
|
|
4
3
|
type RangeCalendarCellProps = {
|
|
@@ -10,5 +9,5 @@ type RangeCalendarCellProps = {
|
|
|
10
9
|
classNameForDate?: (date: CalendarDate) => string;
|
|
11
10
|
ariaLabelForDate?: (date: CalendarDate) => string;
|
|
12
11
|
};
|
|
13
|
-
export declare const RangeCalendarCell: ({ state, date, currentMonth, showOutsideMonth, weekNumberString, classNameForDate, ariaLabelForDate, ...rest }: RangeCalendarCellProps) =>
|
|
12
|
+
export declare const RangeCalendarCell: ({ state, date, currentMonth, showOutsideMonth, weekNumberString, classNameForDate, ariaLabelForDate, ...rest }: RangeCalendarCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
13
|
export {};
|
|
@@ -44,5 +44,5 @@ type BaseSimpleTimePickerProps<TimeType extends TimeValue> = {
|
|
|
44
44
|
style?: React.CSSProperties;
|
|
45
45
|
};
|
|
46
46
|
export type SimpleTimePickerProps<TimeType extends TimeValue> = BaseSimpleTimePickerProps<TimeType> & ExtendedSimpleTimePickerProps<TimeType>;
|
|
47
|
-
export declare const SimpleTimePicker: <TimeType extends TimeValue>({ append, className, disabled, feedback, showClockIcon, inputRef, label, labelTooltip, onChange, padding, prepend, readOnly, selectedTime, showSeconds, style, variant, ...rest }: SimpleTimePickerProps<TimeType>) =>
|
|
47
|
+
export declare const SimpleTimePicker: <TimeType extends TimeValue>({ append, className, disabled, feedback, showClockIcon, inputRef, label, labelTooltip, onChange, padding, prepend, readOnly, selectedTime, showSeconds, style, variant, ...rest }: SimpleTimePickerProps<TimeType>) => import("react/jsx-runtime").JSX.Element;
|
|
48
48
|
export {};
|
|
@@ -65,5 +65,5 @@ type BaseTimePickerProps<TimeType extends TimeValue> = {
|
|
|
65
65
|
style?: React.CSSProperties;
|
|
66
66
|
};
|
|
67
67
|
export type TimePickerProps<TimeType extends TimeValue> = BaseTimePickerProps<TimeType> & ExtendedTimePickerProps<TimeType>;
|
|
68
|
-
export declare const TimePicker: <TimeType extends TimeValue>({ selectedTime, onChange, disabled, readOnly, className, style, label, labelTooltip, feedback, granularity, variant, locale: customLocale, showTimeZone, showSeconds, minuteIncrementForArrowButtons, leftArrowButtonAriaLabel, rightArrowButtonAriaLabel, inputRef, forcedReturnType, forcedTimeZone, append, prepend, ...rest }: TimePickerProps<TimeType>) =>
|
|
68
|
+
export declare const TimePicker: <TimeType extends TimeValue>({ selectedTime, onChange, disabled, readOnly, className, style, label, labelTooltip, feedback, granularity, variant, locale: customLocale, showTimeZone, showSeconds, minuteIncrementForArrowButtons, leftArrowButtonAriaLabel, rightArrowButtonAriaLabel, inputRef, forcedReturnType, forcedTimeZone, append, prepend, ...rest }: TimePickerProps<TimeType>) => import("react/jsx-runtime").JSX.Element;
|
|
69
69
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
1
|
type TimePickerArrowButtonProps = {
|
|
3
2
|
direction: 'left' | 'right';
|
|
4
3
|
disabled?: boolean;
|
|
@@ -7,5 +6,5 @@ type TimePickerArrowButtonProps = {
|
|
|
7
6
|
onClick?: () => void;
|
|
8
7
|
onFocus?: () => void;
|
|
9
8
|
};
|
|
10
|
-
export declare const TimePickerArrowButton: ({ direction, onClick, disabled, readonly, "aria-label": ariaLabel, ...rest }: TimePickerArrowButtonProps) =>
|
|
9
|
+
export declare const TimePickerArrowButton: ({ direction, onClick, disabled, readonly, "aria-label": ariaLabel, ...rest }: TimePickerArrowButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
10
|
export {};
|
package/dist/datepicker.cjs.js
CHANGED
|
@@ -259,7 +259,7 @@ const DateField = ({
|
|
|
259
259
|
const dateFieldRef = React.useRef(null);
|
|
260
260
|
const { labelProps, fieldProps } = datepicker.useDateField(_props, state, dateFieldRef);
|
|
261
261
|
React.useEffect(() => onValidate?.(!state.isInvalid), [state.isInvalid]);
|
|
262
|
-
const id =
|
|
262
|
+
const id = `datefield${React.useId()}`;
|
|
263
263
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
264
264
|
utils.ConditionalWrapper,
|
|
265
265
|
{
|
|
@@ -312,7 +312,7 @@ const CalendarGrid = ({
|
|
|
312
312
|
weekNumberHeader,
|
|
313
313
|
renderCell
|
|
314
314
|
}) => {
|
|
315
|
-
const calendarGridId =
|
|
315
|
+
const calendarGridId = `eds-calendar${React.useId()}`;
|
|
316
316
|
const { locale } = i18n.useLocale();
|
|
317
317
|
const gridStartDate = startDate ?? state.visibleRange.start;
|
|
318
318
|
const { gridProps, headerProps, weekDays } = calendar.useCalendarGrid(
|
|
@@ -958,7 +958,7 @@ const NativeDatePicker = React.forwardRef(
|
|
|
958
958
|
prepend = /* @__PURE__ */ jsxRuntime.jsx(icons.DateIcon, { inline: true }),
|
|
959
959
|
...rest
|
|
960
960
|
}, ref) => {
|
|
961
|
-
const nativedatepickerId =
|
|
961
|
+
const nativedatepickerId = `eds-nativetimepicker${React.useId()}`;
|
|
962
962
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
963
963
|
form.BaseFormControl,
|
|
964
964
|
{
|
|
@@ -1075,7 +1075,7 @@ const TimePicker = ({
|
|
|
1075
1075
|
}) => {
|
|
1076
1076
|
let { locale } = i18n.useLocale();
|
|
1077
1077
|
if (customLocale) locale = customLocale;
|
|
1078
|
-
const timePickerId =
|
|
1078
|
+
const timePickerId = `eds-timepicker${React.useId()}`;
|
|
1079
1079
|
const timeZone = forcedTimeZone ?? (selectedTime !== null && "timeZone" in selectedTime ? selectedTime.timeZone : "Europe/Oslo");
|
|
1080
1080
|
const handleOnChange2 = (value) => {
|
|
1081
1081
|
if (forcedReturnType !== void 0 || !selectedTime) {
|
|
@@ -1106,7 +1106,7 @@ const TimePicker = ({
|
|
|
1106
1106
|
state,
|
|
1107
1107
|
timeFieldRef
|
|
1108
1108
|
);
|
|
1109
|
-
const id =
|
|
1109
|
+
const id = `timepicker${React.useId()}`;
|
|
1110
1110
|
const getCurrentTime = () => {
|
|
1111
1111
|
const getCurrentTimeWithCorrectType = convertValueToType({
|
|
1112
1112
|
value: date.now(timeZone),
|
|
@@ -1206,7 +1206,7 @@ const TimePicker = ({
|
|
|
1206
1206
|
};
|
|
1207
1207
|
const NativeTimePicker = React.forwardRef(
|
|
1208
1208
|
({ className, style, onChange, label, feedback, variant, prepend, ...rest }, ref) => {
|
|
1209
|
-
const nativetimepickerId =
|
|
1209
|
+
const nativetimepickerId = `eds-native-timepicker${React.useId()}`;
|
|
1210
1210
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1211
1211
|
form.BaseFormControl,
|
|
1212
1212
|
{
|