@up42/up-components 4.0.0 → 4.2.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,31 @@
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 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
+ } & DatePickerWrapperProps & Omit<DateRangePickerProps<DatePickerDateType | Date>, 'value' | 'onChange'>;
28
+ /**
29
+ * Documentation: https://up-components.up42.com/?path=/docs/patterns-form-formdaterangepickerlist--docs
30
+ */
31
+ export declare const FormDateRangePickerList: ({ value, onChange, label, helperText, error, startLabel, endLabel, disabled, minEndDateOffset, maxEndDateOffset, allowKeyboard, ...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';
package/dist/index.d.ts CHANGED
@@ -11,6 +11,7 @@ import * as _mui_material_OverridableComponent from '@mui/material/OverridableCo
11
11
  import * as _mui_system from '@mui/system';
12
12
  import { DatePickerProps, DateTimePickerProps } from '@mui/x-date-pickers-pro';
13
13
  import dayjs, { Dayjs } from 'dayjs';
14
+ import { DateRangePickerProps } from '@mui/x-date-pickers-pro/DateRangePicker';
14
15
  import { TableProps as TableProps$1 } from '@mui/material/Table';
15
16
  import { TableBodyProps as TableBodyProps$1 } from '@mui/material/TableBody';
16
17
  import { TableCellProps as TableCellProps$1 } from '@mui/material/TableCell';
@@ -21,8 +22,7 @@ import { TablePaginationProps as TablePaginationProps$1 } from '@mui/material/Ta
21
22
  import { TableSortLabelProps as TableSortLabelProps$1 } from '@mui/material/TableSortLabel';
22
23
  import { TableFooterProps as TableFooterProps$1 } from '@mui/material/TableFooter';
23
24
  import { DataGridPremiumProps } from '@mui/x-data-grid-premium';
24
- export { GRID_DETAIL_PANEL_TOGGLE_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, GridCell, GridFooter, GridLoadingOverlay, GridNoRowsOverlay, GridPagination, GridRow, GridRowCount, GridSelectedRowCount, gridColumnDefinitionsSelector, gridColumnVisibilityModelSelector, gridDetailPanelExpandedRowIdsSelector, gridDetailPanelExpandedRowsContentCacheSelector, gridRowsLookupSelector, useGridApiContext, useGridApiRef, useGridSelector } from '@mui/x-data-grid-premium';
25
- export type { GridColDef, GridRenderCellParams, GridRowId, GridRowParams, GridRowSelectionModel, GridRowsProp, GridSortModel } from '@mui/x-data-grid-premium';
25
+ export { GRID_DETAIL_PANEL_TOGGLE_COL_DEF, GRID_DETAIL_PANEL_TOGGLE_FIELD, GridCell, GridColDef, GridFooter, GridLoadingOverlay, GridNoRowsOverlay, GridPagination, GridRenderCellParams, GridRow, GridRowCount, GridRowId, GridRowParams, GridRowSelectionModel, GridRowsProp, GridSelectedRowCount, GridSortModel, gridColumnDefinitionsSelector, gridColumnVisibilityModelSelector, gridDetailPanelExpandedRowIdsSelector, gridDetailPanelExpandedRowsContentCacheSelector, gridRowsLookupSelector, useGridApiContext, useGridApiRef, useGridSelector } from '@mui/x-data-grid-premium';
26
26
 
27
27
  interface UpComponentsProviderProps extends Omit<ThemeProviderProps, 'theme'> {
28
28
  licenseKey: string;
@@ -177,19 +177,15 @@ declare const FormCheckbox: React__default.ForwardRefExoticComponent<Omit<_mui_s
177
177
 
178
178
  type DatePickerWrapperProps = {
179
179
  error?: boolean;
180
- label?: string;
180
+ label?: string | ReactNode;
181
181
  helperText?: string;
182
182
  };
183
183
 
184
-
185
-
186
184
  type DatePickerDateType = Dayjs | null | undefined;
187
185
  type NonGenericMuiDatePickerProps$1 = DatePickerProps<DatePickerDateType>;
188
186
  type FormDatePickerProps = NonGenericMuiDatePickerProps$1 & DatePickerWrapperProps;
189
187
  declare const FormDatePicker: React__default.ForwardRefExoticComponent<NonGenericMuiDatePickerProps$1 & DatePickerWrapperProps & React__default.RefAttributes<HTMLDivElement>>;
190
188
 
191
-
192
-
193
189
  type NonGenericMuiDatePickerProps = DatePickerProps<DatePickerDateType>;
194
190
  type FormDateRangePickerProps = Omit<MUIGlobalOmit<NonGenericMuiDatePickerProps>, 'value' | 'onChange'> & {
195
191
  start: DatePickerDateType;
@@ -209,12 +205,38 @@ type FormDateRangePickerProps = Omit<MUIGlobalOmit<NonGenericMuiDatePickerProps>
209
205
  */
210
206
  declare const FormDateRangePicker: ({ start, onStartChange, end, onEndChange, label, minDate, maxDate, startPickerProps, endPickerProps, ...props }: FormDateRangePickerProps) => React__default.JSX.Element;
211
207
 
212
-
213
-
214
208
  type NonGenericMuiDateTimePickerProps = DateTimePickerProps<Dayjs | null | undefined>;
215
209
  type FormDateTimePickerProps = NonGenericMuiDateTimePickerProps & DatePickerWrapperProps;
216
210
  declare const FormDateTimePicker: React__default.ForwardRefExoticComponent<NonGenericMuiDateTimePickerProps & DatePickerWrapperProps & React__default.RefAttributes<HTMLDivElement>>;
217
211
 
212
+ type DateRange = {
213
+ start: DatePickerDateType | Date;
214
+ end: DatePickerDateType | Date;
215
+ };
216
+ type FormDateRangePickerListProps = {
217
+ startLabel?: string;
218
+ endLabel?: string;
219
+ value: DateRange[];
220
+ onChange?: (value: DateRange[]) => void;
221
+ disabled?: boolean;
222
+ /**
223
+ * Defines whether or not the user can input values and navigate in the calendars using the keyboard.
224
+ */
225
+ allowKeyboard?: boolean;
226
+ /**
227
+ * Defines the minimum number of days after the "start date" that the "end date" can be selected.
228
+ */
229
+ minEndDateOffset?: number;
230
+ /**
231
+ * Defines the maximum number of days after the "start date" that the "end date" can be selected.
232
+ */
233
+ maxEndDateOffset?: number;
234
+ } & DatePickerWrapperProps & Omit<DateRangePickerProps<DatePickerDateType | Date>, 'value' | 'onChange'>;
235
+ /**
236
+ * Documentation: https://up-components.up42.com/?path=/docs/patterns-form-formdaterangepickerlist--docs
237
+ */
238
+ declare const FormDateRangePickerList: ({ value, onChange, label, helperText, error, startLabel, endLabel, disabled, minEndDateOffset, maxEndDateOffset, allowKeyboard, ...props }: FormDateRangePickerListProps) => React__default.JSX.Element;
239
+
218
240
  type RadioProps = MUIGlobalOmit<RadioProps$1>;
219
241
  /**
220
242
  * Documentation: https://up-components.up42.com/?path=/docs/data-entry-radio--docs
@@ -5156,14 +5178,6 @@ declare const TableSortLabel: ({ children, ...props }: TableSortLabelProps) => R
5156
5178
  type TableFooterProps = MUIGlobalOmit<TableFooterProps$1>;
5157
5179
  declare const TableFooter: ({ children, ...props }: TableFooterProps) => React__default.JSX.Element;
5158
5180
 
5159
-
5160
-
5161
-
5162
-
5163
-
5164
-
5165
-
5166
-
5167
5181
  /**
5168
5182
  * Documentation: https://up-components.up42.com/?path=/docs/data-display-datagrid--docs
5169
5183
  */
@@ -5336,73 +5350,5 @@ type ContextState = {
5336
5350
  */
5337
5351
  declare const useAlert: () => ContextState;
5338
5352
 
5339
-
5340
-
5341
-
5342
-
5343
-
5344
-
5345
-
5346
-
5347
-
5348
-
5349
-
5350
-
5351
-
5352
-
5353
-
5354
-
5355
-
5356
-
5357
-
5358
-
5359
-
5360
-
5361
-
5362
-
5363
-
5364
-
5365
-
5366
-
5367
-
5368
-
5369
-
5370
-
5371
-
5372
-
5373
-
5374
-
5375
-
5376
-
5377
-
5378
-
5379
-
5380
-
5381
-
5382
-
5383
-
5384
-
5385
-
5386
-
5387
-
5388
-
5389
-
5390
-
5391
-
5392
-
5393
-
5394
-
5395
-
5396
-
5397
-
5398
-
5399
-
5400
-
5401
-
5402
-
5403
-
5404
-
5405
-
5406
-
5407
- export { Alert, Avatar, Badge, Banner, Button, Checkbox, CodeInline, CodeSnippet, ContactBox, ControlButton, CopyButton, DataGrid, DateTime, Divider, DocumentationPopover, EmptyState, FormCheckbox, FormDatePicker, FormDateRangePicker, FormDateTimePicker, FormInput, FormRadio, FormSelect, FormSwitch, GridContainer, GridItem, Icon, Illustration, InfoCard, InfoModal, InfoPopover, Input, Link, Loading, NotFound, PageContainer, PageHeader, Radio, Select, Slider, Switch, Tab, TabGroup, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TablePagination, TableRow, TableSortLabel, Tabs, Tag, Typography, UpComponentsProvider, capitalize, copyToClipboard, formatDate, formatFileSize, formatNumber, theme, useAlert, useCursorPagination, useDebounce, useQueryParams, useRemotePagination };
5408
- export type { AlertProps, AvatarProps, BadgeProps, BannerProps, ButtonProps, CheckboxProps, CodeInlineProps, CodeSnippetItemProps, CodeSnippetProps, ContactBoxProps, ControlButtonProps, CopyButtonProps, CreateAlertProps, CreateSnackbarProps, CursorPaginatedResponse, DatePickerDateType, DateTimeProps, DividerProps, DocumentationPopoverProps, EmptyStateProps, FormCheckboxProps, FormDatePickerProps, FormDateRangePickerProps, FormDateTimePickerProps, FormInputProps, FormRadioProps, FormSelectProps, FormSwitchProps, GridContainerProps, GridItemProps, IconProps, IllustrationProps, InfoCardProps, InfoModalProps, InfoPopoverProps, InputProps, LinkProps, LoadingProps, NotFoundProps, PageContainerProps, PageHeaderProps, PaginatedResponse, RadioProps, SelectProps, SliderProps, SwitchProps, TabGroupProps, TabProps, TableBodyProps, TableCellProps, TableContainerProps, TableFooterProps, TableHeadProps, TablePaginationProps, TableProps, TableRowProps, TableSortLabelProps, TabsProps, TagProps, TypographyProps };
5353
+ export { Alert, Avatar, Badge, Banner, Button, Checkbox, CodeInline, CodeSnippet, ContactBox, ControlButton, CopyButton, DataGrid, DateTime, Divider, DocumentationPopover, EmptyState, FormCheckbox, FormDatePicker, FormDateRangePicker, FormDateRangePickerList, FormDateTimePicker, FormInput, FormRadio, FormSelect, FormSwitch, GridContainer, GridItem, Icon, Illustration, InfoCard, InfoModal, InfoPopover, Input, Link, Loading, NotFound, PageContainer, PageHeader, Radio, Select, Slider, Switch, Tab, TabGroup, Table, TableBody, TableCell, TableContainer, TableFooter, TableHead, TablePagination, TableRow, TableSortLabel, Tabs, Tag, Typography, UpComponentsProvider, capitalize, copyToClipboard, formatDate, formatFileSize, formatNumber, theme, useAlert, useCursorPagination, useDebounce, useQueryParams, useRemotePagination };
5354
+ export type { AlertProps, AvatarProps, BadgeProps, BannerProps, ButtonProps, CheckboxProps, CodeInlineProps, CodeSnippetItemProps, CodeSnippetProps, ContactBoxProps, ControlButtonProps, CopyButtonProps, CreateAlertProps, CreateSnackbarProps, CursorPaginatedResponse, DatePickerDateType, DateRange, DateTimeProps, DividerProps, DocumentationPopoverProps, EmptyStateProps, FormCheckboxProps, FormDatePickerProps, FormDateRangePickerListProps, FormDateRangePickerProps, FormDateTimePickerProps, FormInputProps, FormRadioProps, FormSelectProps, FormSwitchProps, GridContainerProps, GridItemProps, IconProps, IllustrationProps, InfoCardProps, InfoModalProps, InfoPopoverProps, InputProps, LinkProps, LoadingProps, NotFoundProps, PageContainerProps, PageHeaderProps, PaginatedResponse, RadioProps, SelectProps, SliderProps, SwitchProps, TabGroupProps, TabProps, TableBodyProps, TableCellProps, TableContainerProps, TableFooterProps, TableHeadProps, TablePaginationProps, TableProps, TableRowProps, TableSortLabelProps, TabsProps, TagProps, TypographyProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@up42/up-components",
3
- "version": "4.0.0",
3
+ "version": "4.2.0",
4
4
  "description": "UP42 Component Library",
5
5
  "author": "Axel Fuhrmann axel.fuhrmann@up42.com",
6
6
  "license": "ISC",
@@ -55,13 +55,15 @@
55
55
  "@rollup/plugin-node-resolve": "^15.2.3",
56
56
  "@rollup/plugin-terser": "^0.4.4",
57
57
  "@rollup/plugin-typescript": "^11.1.6",
58
- "@storybook/addon-a11y": "^8.1.10",
59
- "@storybook/addon-actions": "^8.1.10",
60
- "@storybook/addon-essentials": "^8.1.10",
61
- "@storybook/addon-links": "^8.1.10",
62
- "@storybook/addon-mdx-gfm": "^8.1.10",
63
- "@storybook/react": "^8.1.10",
64
- "@storybook/react-vite": "^8.1.10",
58
+ "@storybook/addon-a11y": "^8.6.10",
59
+ "@storybook/addon-actions": "^8.6.10",
60
+ "@storybook/addon-essentials": "^8.6.10",
61
+ "@storybook/addon-links": "^8.6.10",
62
+ "@storybook/addon-mdx-gfm": "^8.6.10",
63
+ "@storybook/manager-api": "^8.6.10",
64
+ "@storybook/react": "^8.6.10",
65
+ "@storybook/react-vite": "^8.6.10",
66
+ "@storybook/theming": "^8.6.10",
65
67
  "@svgr/rollup": "^6.2.1",
66
68
  "@testing-library/react": "^12.1.2",
67
69
  "@testing-library/react-hooks": "^8.0.1",
@@ -79,7 +81,7 @@
79
81
  "eslint-plugin-prettier": "^4.0.0",
80
82
  "eslint-plugin-react": "^7.28.0",
81
83
  "eslint-plugin-react-hooks": "^4.3.0",
82
- "eslint-plugin-storybook": "^0.8.0",
84
+ "eslint-plugin-storybook": "^0.12.0",
83
85
  "husky": "^7.0.4",
84
86
  "jest": "^27.4.7",
85
87
  "lint-staged": "^12.3.1",
@@ -90,11 +92,11 @@
90
92
  "rollup-plugin-delete": "^2.0.0",
91
93
  "rollup-plugin-dts": "^6.1.0",
92
94
  "rollup-plugin-peer-deps-external": "^2.2.4",
93
- "storybook": "^8.1.10",
95
+ "storybook": "^8.6.10",
94
96
  "svgo": "^3.3.2",
95
97
  "typescript": "^4.5.4",
96
- "vite": "^4.5.9",
97
- "vite-plugin-svgr": "^3.2.0"
98
+ "vite": "^6.2.3",
99
+ "vite-plugin-svgr": "^4.2.0"
98
100
  },
99
101
  "peerDependencies": {
100
102
  "@emotion/react": "^11.7.1",
@@ -106,12 +108,6 @@
106
108
  "react": "^17.0.2",
107
109
  "react-dom": "^17.0.2"
108
110
  },
109
- "overrides": {
110
- "vite": {
111
- "rollup": ">4.22.3",
112
- "esbuild": "0.25.0"
113
- }
114
- },
115
111
  "lint-staged": {
116
112
  "*.{js,tsx,ts}": "eslint --cache --fix",
117
113
  "*.mdx": "prettier --write"