@up42/up-components 5.16.1 → 5.18.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,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { AlertProps as MUIALertProps } from '@mui/material';
3
- export type AlertColor = 'info' | 'error' | 'success' | 'warning' | 'neutral';
3
+ export type AlertColor = 'info' | 'error' | 'success' | 'warning' | 'neutral' | 'notice';
4
4
  export type AlertProps = Omit<MUIALertProps, 'color' | 'elevation' | 'iconMapping' | 'severity' | 'square' | 'variant' | 'action'> & {
5
5
  type?: AlertColor;
6
6
  };
@@ -2,8 +2,8 @@ import { DatePickerProps as MuiDatePickerProps } from '@mui/x-date-pickers-pro';
2
2
  import { Dayjs } from 'dayjs';
3
3
  import React from 'react';
4
4
  import { type DatePickerWrapperProps } from '../FormDatePickerWrapper';
5
- export type DatePickerDateType = Dayjs | null | undefined;
6
- type NonGenericMuiDatePickerProps = MuiDatePickerProps<DatePickerDateType>;
5
+ export type FormDatePickerDateType = Date | Dayjs | null | undefined;
6
+ type NonGenericMuiDatePickerProps = MuiDatePickerProps<FormDatePickerDateType>;
7
7
  export type FormDatePickerProps = NonGenericMuiDatePickerProps & DatePickerWrapperProps;
8
8
  export declare const FormDatePicker: React.ForwardRefExoticComponent<NonGenericMuiDatePickerProps & DatePickerWrapperProps & React.RefAttributes<HTMLDivElement>>;
9
9
  export {};
@@ -1,23 +1,35 @@
1
- import { DatePickerProps as MuiDatePickerProps } from '@mui/x-date-pickers-pro';
2
1
  import React from 'react';
3
- import type { MUIGlobalOmit } from '@global/utils/types';
4
- import { DatePickerDateType, FormDatePickerProps } from '../FormDatePicker/FormDatePicker';
5
- type NonGenericMuiDatePickerProps = MuiDatePickerProps<DatePickerDateType>;
6
- export type FormDateRangePickerProps = Omit<MUIGlobalOmit<NonGenericMuiDatePickerProps>, 'value' | 'onChange'> & {
7
- start: DatePickerDateType;
8
- onStartChange: (date: DatePickerDateType) => void;
9
- end: DatePickerDateType;
10
- onEndChange: (date: DatePickerDateType) => void;
11
- label?: string;
12
- startPickerProps?: {
13
- slotProps: FormDatePickerProps['slotProps'];
14
- };
15
- endPickerProps?: {
16
- slotProps: FormDatePickerProps['slotProps'];
17
- };
2
+ import { DateRangePickerProps } from '@mui/x-date-pickers-pro/DateRangePicker';
3
+ import { type DatePickerWrapperProps } from '../FormDatePickerWrapper';
4
+ import { FormDatePickerDateType } from '../FormDatePicker/FormDatePicker';
5
+ export type DateRange = {
6
+ start: FormDatePickerDateType;
7
+ end: FormDatePickerDateType;
18
8
  };
9
+ export declare const DEFAULT_FORMAT = "YYYY\u2013MM\u2013DD";
10
+ export type FormDateRangePickerProps = {
11
+ startLabel?: string;
12
+ startPlaceholder?: string;
13
+ endLabel?: string;
14
+ endPlaceholder?: string;
15
+ value: DateRange | null;
16
+ onChange?: (value: DateRange | null) => void;
17
+ disabled?: boolean;
18
+ /**
19
+ * Defines whether or not the user can input values and navigate in the calendars using the keyboard.
20
+ */
21
+ allowKeyboard?: boolean;
22
+ /**
23
+ * Defines the minimum number of days after the "start date" that the "end date" can be selected.
24
+ */
25
+ minEndDateOffset?: number;
26
+ /**
27
+ * Defines the maximum number of days after the "start date" that the "end date" can be selected.
28
+ */
29
+ maxEndDateOffset?: number;
30
+ } & DatePickerWrapperProps & Omit<DateRangePickerProps<FormDatePickerDateType | Date>, 'value' | 'onChange'>;
19
31
  /**
20
- * Documentation: https://up-components.up42.com/?path=/docs/patterns-form-formdaterangepicker--docs
32
+ * FormDateRangePicker allows users to choose two dates (start and end) using calendar view.
33
+ * Documentation: https://up-components.up42.com/?path=/docs-patterns-form-formdaterangepicker--docs
21
34
  */
22
- export declare const FormDateRangePicker: ({ start, onStartChange, end, onEndChange, label, minDate, maxDate, startPickerProps, endPickerProps, ...props }: FormDateRangePickerProps) => React.JSX.Element;
23
- export {};
35
+ export declare const FormDateRangePicker: ({ value, onChange, label, helperText, error, startLabel, endLabel, disabled, minEndDateOffset, maxEndDateOffset, allowKeyboard, startPlaceholder, endPlaceholder, format, ...props }: FormDateRangePickerProps) => React.JSX.Element;
@@ -1,36 +1,17 @@
1
1
  import React from 'react';
2
- import { DateRangePickerProps } from '@mui/x-date-pickers-pro/DateRangePicker';
3
2
  import { type DatePickerWrapperProps } from '../FormDatePickerWrapper';
4
- import { DatePickerDateType } from '../FormDatePicker/FormDatePicker';
5
- export type DateRange = {
6
- start: DatePickerDateType | Date;
7
- end: DatePickerDateType | Date;
8
- };
3
+ import { FormDateRangePickerProps, DateRange } from '../FormDateRangePicker/FormDateRangePicker';
9
4
  export type FormDateRangePickerListProps = {
10
- startLabel?: string;
11
- endLabel?: string;
12
5
  value: DateRange[];
13
6
  onChange?: (value: DateRange[]) => void;
14
7
  disabled?: boolean;
15
- /**
16
- * Defines whether or not the user can input values and navigate in the calendars using the keyboard.
17
- */
18
- allowKeyboard?: boolean;
19
- /**
20
- * Defines the minimum number of days after the "start date" that the "end date" can be selected.
21
- */
22
- minEndDateOffset?: number;
23
- /**
24
- * Defines the maximum number of days after the "start date" that the "end date" can be selected.
25
- */
26
- maxEndDateOffset?: number;
27
8
  /**
28
9
  * Defines the text to display in the action button to add a new Date Range.
29
10
  * It defaults to "Add new date".
30
11
  */
31
12
  addButtonText?: string;
32
- } & DatePickerWrapperProps & Omit<DateRangePickerProps<DatePickerDateType | Date>, 'value' | 'onChange'>;
13
+ } & DatePickerWrapperProps & Omit<FormDateRangePickerProps, 'value' | 'onChange'>;
33
14
  /**
34
15
  * Documentation: https://up-components.up42.com/?path=/docs/patterns-form-formdaterangepickerlist--docs
35
16
  */
36
- export declare const FormDateRangePickerList: ({ value, onChange, label, helperText, error, startLabel, endLabel, disabled, minEndDateOffset, maxEndDateOffset, allowKeyboard, addButtonText, ...props }: FormDateRangePickerListProps) => React.JSX.Element;
17
+ export declare const FormDateRangePickerList: ({ value, onChange, label, helperText, error, disabled, addButtonText, ...props }: FormDateRangePickerListProps) => React.JSX.Element;
@@ -10,10 +10,10 @@ export { GridContainer, type GridContainerProps, GridItem, type GridItemProps }
10
10
  export { PageContainer, type PageContainerProps } from './components/PageContainer/PageContainer';
11
11
  export { Checkbox, type CheckboxProps } from './components/Checkbox/Checkbox';
12
12
  export { FormCheckbox, type FormCheckboxProps } from './components/FormCheckbox/FormCheckbox';
13
- export { FormDatePicker, type FormDatePickerProps, type DatePickerDateType, } from './components/FormDatePickers/FormDatePicker/FormDatePicker';
14
- export { FormDateRangePicker, type FormDateRangePickerProps, } from './components/FormDatePickers/FormDateRangePicker/FormDateRangePicker';
13
+ export { FormDatePicker, type FormDatePickerProps, type FormDatePickerDateType, } from './components/FormDatePickers/FormDatePicker/FormDatePicker';
14
+ export { FormDateRangePicker, type FormDateRangePickerProps, type DateRange, } 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
+ export { FormDateRangePickerList, type FormDateRangePickerListProps, } from './components/FormDatePickers/FormDateRangePickerList/FormDateRangePickerList';
17
17
  export { Radio, type RadioProps } from './components/Radio/Radio';
18
18
  export { FormRadio, type FormRadioProps } from './components/FormRadio/FormRadio';
19
19
  export { Switch, type SwitchProps } from './components/Switch/Switch';
package/dist/index.d.ts CHANGED
@@ -177,43 +177,22 @@ type DatePickerWrapperProps = {
177
177
  helperText?: string;
178
178
  };
179
179
 
180
- type DatePickerDateType = Dayjs | null | undefined;
181
- type NonGenericMuiDatePickerProps$1 = DatePickerProps<DatePickerDateType>;
182
- type FormDatePickerProps = NonGenericMuiDatePickerProps$1 & DatePickerWrapperProps;
183
- declare const FormDatePicker: React__default.ForwardRefExoticComponent<NonGenericMuiDatePickerProps$1 & DatePickerWrapperProps & React__default.RefAttributes<HTMLDivElement>>;
184
-
185
- type NonGenericMuiDatePickerProps = DatePickerProps<DatePickerDateType>;
186
- type FormDateRangePickerProps = Omit<MUIGlobalOmit<NonGenericMuiDatePickerProps>, 'value' | 'onChange'> & {
187
- start: DatePickerDateType;
188
- onStartChange: (date: DatePickerDateType) => void;
189
- end: DatePickerDateType;
190
- onEndChange: (date: DatePickerDateType) => void;
191
- label?: string;
192
- startPickerProps?: {
193
- slotProps: FormDatePickerProps['slotProps'];
194
- };
195
- endPickerProps?: {
196
- slotProps: FormDatePickerProps['slotProps'];
197
- };
198
- };
199
- /**
200
- * Documentation: https://up-components.up42.com/?path=/docs/patterns-form-formdaterangepicker--docs
201
- */
202
- declare const FormDateRangePicker: ({ start, onStartChange, end, onEndChange, label, minDate, maxDate, startPickerProps, endPickerProps, ...props }: FormDateRangePickerProps) => React__default.JSX.Element;
203
-
204
- type NonGenericMuiDateTimePickerProps = DateTimePickerProps<Dayjs | null | undefined>;
205
- type FormDateTimePickerProps = NonGenericMuiDateTimePickerProps & DatePickerWrapperProps;
206
- declare const FormDateTimePicker: React__default.ForwardRefExoticComponent<NonGenericMuiDateTimePickerProps & DatePickerWrapperProps & React__default.RefAttributes<HTMLDivElement>>;
180
+ type FormDatePickerDateType = Date | Dayjs | null | undefined;
181
+ type NonGenericMuiDatePickerProps = DatePickerProps<FormDatePickerDateType>;
182
+ type FormDatePickerProps = NonGenericMuiDatePickerProps & DatePickerWrapperProps;
183
+ declare const FormDatePicker: React__default.ForwardRefExoticComponent<NonGenericMuiDatePickerProps & DatePickerWrapperProps & React__default.RefAttributes<HTMLDivElement>>;
207
184
 
208
185
  type DateRange = {
209
- start: DatePickerDateType | Date;
210
- end: DatePickerDateType | Date;
186
+ start: FormDatePickerDateType;
187
+ end: FormDatePickerDateType;
211
188
  };
212
- type FormDateRangePickerListProps = {
189
+ type FormDateRangePickerProps = {
213
190
  startLabel?: string;
191
+ startPlaceholder?: string;
214
192
  endLabel?: string;
215
- value: DateRange[];
216
- onChange?: (value: DateRange[]) => void;
193
+ endPlaceholder?: string;
194
+ value: DateRange | null;
195
+ onChange?: (value: DateRange | null) => void;
217
196
  disabled?: boolean;
218
197
  /**
219
198
  * Defines whether or not the user can input values and navigate in the calendars using the keyboard.
@@ -227,16 +206,31 @@ type FormDateRangePickerListProps = {
227
206
  * Defines the maximum number of days after the "start date" that the "end date" can be selected.
228
207
  */
229
208
  maxEndDateOffset?: number;
209
+ } & DatePickerWrapperProps & Omit<DateRangePickerProps<FormDatePickerDateType | Date>, 'value' | 'onChange'>;
210
+ /**
211
+ * FormDateRangePicker allows users to choose two dates (start and end) using calendar view.
212
+ * Documentation: https://up-components.up42.com/?path=/docs-patterns-form-formdaterangepicker--docs
213
+ */
214
+ declare const FormDateRangePicker: ({ value, onChange, label, helperText, error, startLabel, endLabel, disabled, minEndDateOffset, maxEndDateOffset, allowKeyboard, startPlaceholder, endPlaceholder, format, ...props }: FormDateRangePickerProps) => React__default.JSX.Element;
215
+
216
+ type NonGenericMuiDateTimePickerProps = DateTimePickerProps<Dayjs | null | undefined>;
217
+ type FormDateTimePickerProps = NonGenericMuiDateTimePickerProps & DatePickerWrapperProps;
218
+ declare const FormDateTimePicker: React__default.ForwardRefExoticComponent<NonGenericMuiDateTimePickerProps & DatePickerWrapperProps & React__default.RefAttributes<HTMLDivElement>>;
219
+
220
+ type FormDateRangePickerListProps = {
221
+ value: DateRange[];
222
+ onChange?: (value: DateRange[]) => void;
223
+ disabled?: boolean;
230
224
  /**
231
225
  * Defines the text to display in the action button to add a new Date Range.
232
226
  * It defaults to "Add new date".
233
227
  */
234
228
  addButtonText?: string;
235
- } & DatePickerWrapperProps & Omit<DateRangePickerProps<DatePickerDateType | Date>, 'value' | 'onChange'>;
229
+ } & DatePickerWrapperProps & Omit<FormDateRangePickerProps, 'value' | 'onChange'>;
236
230
  /**
237
231
  * Documentation: https://up-components.up42.com/?path=/docs/patterns-form-formdaterangepickerlist--docs
238
232
  */
239
- declare const FormDateRangePickerList: ({ value, onChange, label, helperText, error, startLabel, endLabel, disabled, minEndDateOffset, maxEndDateOffset, allowKeyboard, addButtonText, ...props }: FormDateRangePickerListProps) => React__default.JSX.Element;
233
+ declare const FormDateRangePickerList: ({ value, onChange, label, helperText, error, disabled, addButtonText, ...props }: FormDateRangePickerListProps) => React__default.JSX.Element;
240
234
 
241
235
  type RadioProps = MUIGlobalOmit<RadioProps$1>;
242
236
  /**
@@ -456,7 +450,7 @@ type InfoModalProps = MUIGlobalOmit<Omit<ModalProps, 'BackdropProps' | 'Backdrop
456
450
  */
457
451
  declare const InfoModal: ({ title, subtitle, children, actions, open, maxWidth, onClose, ...props }: InfoModalProps) => React__default.JSX.Element;
458
452
 
459
- type AlertColor = 'info' | 'error' | 'success' | 'warning' | 'neutral';
453
+ type AlertColor = 'info' | 'error' | 'success' | 'warning' | 'neutral' | 'notice';
460
454
  type AlertProps = Omit<AlertProps$1, 'color' | 'elevation' | 'iconMapping' | 'severity' | 'square' | 'variant' | 'action'> & {
461
455
  type?: AlertColor;
462
456
  };
@@ -5949,4 +5943,4 @@ type ContextState = {
5949
5943
  declare const useAlert: () => ContextState;
5950
5944
 
5951
5945
  export { Alert, Avatar, Badge, Banner, Button, Checkbox, CodeBlock, CodeInline, CodeSnippet, ContactBox, ControlButton, CopyButton, DataGrid, DateTime, Divider, DocumentationPopover, EditTagsButton, EmptyState, FeatureCard, FeatureCardHeader, FeatureCardHeaderActions, FeatureFlagCheckbox, FormCheckbox, FormDatePicker, FormDateRangePicker, FormDateRangePickerList, FormDateTimePicker, FormInput, FormRadio, FormSelect, FormSwitch, GridContainer, GridItem, Icon, Illustration, InfoCard, InfoModal, InfoPopover, Input, Link, Loading, Logo, NotFound, PageContainer, PageHeader, PageHeaderV2, Popover, Radio, Select, Slider, StatusLight, Switch, Tab, TabGroup, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TablePagination, TableRow, TableSortLabel, Tabs, Tag, TagsList, ToggleButton, Typography, UpComponentsProvider, analytics, capitalize, copyToClipboard, formatDate, formatFileSize, formatNumber, generateQueryKey, theme, useAlert, useCursorPagination, useDebounce, useQueryParams, useRemotePagination, useToggle };
5952
- export type { AlertProps, AnalyticsConfig, AvatarProps, BadgeProps, BannerProps, ButtonProps, CheckboxProps, CodeBlockProps, CodeInlineProps, CodeSnippetItemProps, CodeSnippetProps, ContactBoxProps, ControlButtonProps, CopyButtonProps, CreateAlertProps, CreateSnackbarProps, CursorPaginatedResponse, DatePickerDateType, DateRange, DateTimeProps, DividerProps, DocumentationPopoverProps, EditTagsButtonProps, EmptyStateProps, FeatureCardHeaderActionsProps, FeatureCardHeaderProps, FeatureCardProps, FeatureFlagCheckboxProps, FormCheckboxProps, FormDatePickerProps, FormDateRangePickerListProps, FormDateRangePickerProps, FormDateTimePickerProps, FormInputProps, FormRadioProps, FormSelectProps, FormSwitchProps, GridContainerProps, GridItemProps, IconAction, IconProps$1 as IconProps, IllustrationProps, InfoCardProps, InfoModalProps, InfoPopoverProps, InputProps, LinkProps, LoadingProps, LogoProps, MenuAction, NotFoundProps, PageContainerProps, PageHeaderProps, PageHeaderV2Props, PaginatedResponse, PopoverProps, RadioProps, SelectProps, SliderProps, StatusLightProps, SwitchProps, TabGroupProps, TabProps, TableBodyProps, TableCellProps, TableContainerProps, TableFooterProps, TableHeadProps, TablePaginationProps, TableProps, TableRowProps, TableSortLabelProps, TabsProps, TagItem, TagProps, TagsListProps, ToggleButtonProps, TypographyProps, UseToggleResult };
5946
+ export type { AlertProps, AnalyticsConfig, AvatarProps, BadgeProps, BannerProps, ButtonProps, CheckboxProps, CodeBlockProps, CodeInlineProps, CodeSnippetItemProps, CodeSnippetProps, ContactBoxProps, ControlButtonProps, CopyButtonProps, CreateAlertProps, CreateSnackbarProps, CursorPaginatedResponse, DateRange, DateTimeProps, DividerProps, DocumentationPopoverProps, EditTagsButtonProps, EmptyStateProps, FeatureCardHeaderActionsProps, FeatureCardHeaderProps, FeatureCardProps, FeatureFlagCheckboxProps, FormCheckboxProps, FormDatePickerDateType, FormDatePickerProps, FormDateRangePickerListProps, FormDateRangePickerProps, FormDateTimePickerProps, FormInputProps, FormRadioProps, FormSelectProps, FormSwitchProps, GridContainerProps, GridItemProps, IconAction, IconProps$1 as IconProps, IllustrationProps, InfoCardProps, InfoModalProps, InfoPopoverProps, InputProps, LinkProps, LoadingProps, LogoProps, MenuAction, NotFoundProps, PageContainerProps, PageHeaderProps, PageHeaderV2Props, PaginatedResponse, PopoverProps, RadioProps, SelectProps, SliderProps, StatusLightProps, SwitchProps, TabGroupProps, TabProps, TableBodyProps, TableCellProps, TableContainerProps, TableFooterProps, TableHeadProps, TablePaginationProps, TableProps, TableRowProps, TableSortLabelProps, TabsProps, TagItem, TagProps, TagsListProps, ToggleButtonProps, TypographyProps, UseToggleResult };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@up42/up-components",
3
- "version": "5.16.1",
3
+ "version": "5.18.0",
4
4
  "description": "UP42 Component Library",
5
5
  "author": "Axel Fuhrmann axel.fuhrmann@up42.com",
6
6
  "license": "ISC",