@up42/up-components 3.4.0 → 4.1.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.
@@ -1,7 +1,7 @@
1
- import React, { PropsWithChildren } from 'react';
1
+ import React, { PropsWithChildren, ReactNode } from 'react';
2
2
  export type DatePickerWrapperProps = {
3
3
  error?: boolean;
4
- label?: string;
4
+ label?: string | ReactNode;
5
5
  helperText?: string;
6
6
  };
7
7
  export declare const FormDatePickerWrapper: ({ label, error, helperText, children, }: PropsWithChildren<DatePickerWrapperProps>) => React.JSX.Element;
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import { DateRangePickerProps } from '@mui/x-date-pickers-pro/DateRangePicker';
3
+ import { type DatePickerWrapperProps } from '../FormDatePickerWrapper';
4
+ import { DatePickerDateType } from '../FormDatePicker/FormDatePicker';
5
+ export type DateRange = {
6
+ start: DatePickerDateType | Date;
7
+ end: DatePickerDateType | Date;
8
+ };
9
+ export type FormDateRangePickerListProps = {
10
+ startLabel?: string;
11
+ endLabel?: string;
12
+ value: DateRange[];
13
+ onChange?: (value: DateRange[]) => void;
14
+ disabled?: boolean;
15
+ /**
16
+ * Defines the minimum number of days after the "start date" that the "end date" can be selected.
17
+ */
18
+ minEndDateOffset?: number;
19
+ /**
20
+ * Defines the maximum number of days after the "start date" that the "end date" can be selected.
21
+ */
22
+ maxEndDateOffset?: number;
23
+ } & DatePickerWrapperProps & Omit<DateRangePickerProps<DatePickerDateType | Date>, 'value'>;
24
+ /**
25
+ * Documentation: https://up-components.up42.com/?path=/docs/patterns-form-formdaterangepickerlist--docs
26
+ */
27
+ export declare const FormDateRangePickerList: ({ value, onChange, label, helperText, error, startLabel, endLabel, disabled, minEndDateOffset, maxEndDateOffset, ...props }: FormDateRangePickerListProps) => React.JSX.Element;
@@ -13,6 +13,7 @@ export { FormCheckbox, type FormCheckboxProps } from './components/FormCheckbox/
13
13
  export { FormDatePicker, type FormDatePickerProps, type DatePickerDateType, } from './components/FormDatePickers/FormDatePicker/FormDatePicker';
14
14
  export { FormDateRangePicker, type FormDateRangePickerProps, } from './components/FormDatePickers/FormDateRangePicker/FormDateRangePicker';
15
15
  export { FormDateTimePicker, type FormDateTimePickerProps, } from './components/FormDatePickers/FormDateTimePicker/FormDateTimePicker';
16
+ export { FormDateRangePickerList, type FormDateRangePickerListProps, type DateRange, } from './components/FormDatePickers/FormDateRangePickerList/FormDateRangePickerList';
16
17
  export { Radio, type RadioProps } from './components/Radio/Radio';
17
18
  export { FormRadio, type FormRadioProps } from './components/FormRadio/FormRadio';
18
19
  export { Switch, type SwitchProps } from './components/Switch/Switch';