@up42/up-components 2.8.0 → 2.9.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/cjs/index.js +2 -2
- package/dist/cjs/types/components/Container/Container.overrides.d.ts +1 -0
- package/dist/cjs/types/global/providers/AlertProvider/AlertProvider.d.ts +35 -0
- package/dist/cjs/types/global/providers/AlertProvider/AlertStack.d.ts +2 -0
- package/dist/cjs/types/global/providers/AlertProvider/SnackbarWrapper.d.ts +2 -0
- package/dist/cjs/types/index.d.ts +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/types/components/Container/Container.overrides.d.ts +1 -0
- package/dist/esm/types/global/providers/AlertProvider/AlertProvider.d.ts +35 -0
- package/dist/esm/types/global/providers/AlertProvider/AlertStack.d.ts +2 -0
- package/dist/esm/types/global/providers/AlertProvider/SnackbarWrapper.d.ts +2 -0
- package/dist/esm/types/index.d.ts +1 -1
- package/dist/index.d.ts +30 -2
- package/package.json +1 -3
- package/dist/cjs/types/global/providers/AlertProvider/SnackBarStack.d.ts +0 -2
- package/dist/esm/types/global/providers/AlertProvider/SnackBarStack.d.ts +0 -2
- /package/dist/cjs/types/global/providers/AlertProvider/{SnackBarStack.test.d.ts → AlertStack.test.d.ts} +0 -0
- /package/dist/esm/types/global/providers/AlertProvider/{SnackBarStack.test.d.ts → AlertStack.test.d.ts} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ElementType, ReactNode } from 'react';
|
|
2
|
+
import { Fade, GrowProps, SnackbarProps as MUISnackbarProps, SlideProps } from '@mui/material';
|
|
2
3
|
import { AlertColor } from '../../../components/Alert/Alert';
|
|
3
4
|
export declare type CreateAlertProps = {
|
|
4
5
|
title?: string;
|
|
@@ -9,6 +10,36 @@ export declare type CreateAlertProps = {
|
|
|
9
10
|
*/
|
|
10
11
|
duration?: number;
|
|
11
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* Props for creating a snackbar.
|
|
15
|
+
*/
|
|
16
|
+
export declare type CreateSnackbarProps = {
|
|
17
|
+
/**
|
|
18
|
+
* The message to be displayed in the snackbar.
|
|
19
|
+
*/
|
|
20
|
+
message: string | ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* The type of the snackbar. Optional.
|
|
23
|
+
*/
|
|
24
|
+
type?: AlertColor;
|
|
25
|
+
/**
|
|
26
|
+
* The duration for which the snackbar should be displayed. Optional.
|
|
27
|
+
*/
|
|
28
|
+
duration?: number;
|
|
29
|
+
/**
|
|
30
|
+
* The number of columns the snackbar should occupy. Optional.
|
|
31
|
+
*/
|
|
32
|
+
columns?: 2 | 4 | 6 | 8;
|
|
33
|
+
/**
|
|
34
|
+
* The transition effect for the snackbar. Optional.
|
|
35
|
+
*/
|
|
36
|
+
transition?: 'slide' | 'grow' | 'fade';
|
|
37
|
+
} & MUISnackbarProps;
|
|
38
|
+
export declare const transitionComponents: {
|
|
39
|
+
slide: (props: SlideProps) => JSX.Element;
|
|
40
|
+
grow: (props: GrowProps) => JSX.Element;
|
|
41
|
+
fade: typeof Fade;
|
|
42
|
+
};
|
|
12
43
|
export declare type DisplayAlertProps = CreateAlertProps & {
|
|
13
44
|
id: string;
|
|
14
45
|
onClose?: (id: string) => void;
|
|
@@ -18,7 +49,11 @@ declare type ContextState = {
|
|
|
18
49
|
alertStack: DisplayAlertProps[];
|
|
19
50
|
removeFromStack: (id: string) => void;
|
|
20
51
|
animationTime: number;
|
|
52
|
+
createSnackbar: (props: CreateSnackbarProps) => void;
|
|
53
|
+
currentSnackbar: CreateSnackbarProps;
|
|
54
|
+
closeSnackbar: (props: CreateSnackbarProps) => void;
|
|
21
55
|
};
|
|
56
|
+
export declare const defaultSnackbarState: CreateSnackbarProps;
|
|
22
57
|
export declare const AlertProvider: ({ children }: {
|
|
23
58
|
children: ReactNode;
|
|
24
59
|
}) => JSX.Element;
|
|
@@ -55,4 +55,4 @@ export { formatFileSize } from './utils/helpers/formatFileSize';
|
|
|
55
55
|
export { useQueryParams } from './utils/hooks/useQueryParams';
|
|
56
56
|
export { useRemotePagination, type PaginatedResponse } from './utils/hooks/useRemotePagination';
|
|
57
57
|
export { useDebounce } from './utils/hooks/useDebounce';
|
|
58
|
-
export { useAlert, type CreateAlertProps } from './global/providers/AlertProvider/AlertProvider';
|
|
58
|
+
export { useAlert, type CreateAlertProps, type CreateSnackbarProps, } from './global/providers/AlertProvider/AlertProvider';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export { default as tokens } from '@up42/design-system-tokens/dist/json/tokens.json';
|
|
3
3
|
import * as _mui_material from '@mui/material';
|
|
4
|
-
import { BoxProps, TextFieldProps, AvatarProps as AvatarProps$1, GridProps, ContainerProps, CheckboxProps as CheckboxProps$1, RadioProps as RadioProps$1, RadioGroupProps, SwitchProps as SwitchProps$1, SelectProps as SelectProps$1, SliderProps as SliderProps$1, LinkProps as LinkProps$1, TabsProps as TabsProps$1, TabProps as TabProps$1, CardProps, ModalProps, AlertProps as AlertProps$1, SxProps, Theme, IconButtonProps, SvgIconProps, BadgeProps as BadgeProps$1, ChipProps, DividerProps as DividerProps$1 } from '@mui/material';
|
|
4
|
+
import { BoxProps, TextFieldProps, AvatarProps as AvatarProps$1, GridProps, ContainerProps, CheckboxProps as CheckboxProps$1, RadioProps as RadioProps$1, RadioGroupProps, SwitchProps as SwitchProps$1, SelectProps as SelectProps$1, SliderProps as SliderProps$1, LinkProps as LinkProps$1, TabsProps as TabsProps$1, TabProps as TabProps$1, CardProps, ModalProps, AlertProps as AlertProps$1, SxProps, Theme, IconButtonProps, SvgIconProps, BadgeProps as BadgeProps$1, ChipProps, DividerProps as DividerProps$1, SnackbarProps } from '@mui/material';
|
|
5
5
|
export * from '@mui/material';
|
|
6
6
|
import { ThemeProviderProps } from '@mui/material/styles/ThemeProvider';
|
|
7
7
|
import * as React from 'react';
|
|
@@ -4923,6 +4923,31 @@ declare type CreateAlertProps = {
|
|
|
4923
4923
|
*/
|
|
4924
4924
|
duration?: number;
|
|
4925
4925
|
};
|
|
4926
|
+
/**
|
|
4927
|
+
* Props for creating a snackbar.
|
|
4928
|
+
*/
|
|
4929
|
+
declare type CreateSnackbarProps = {
|
|
4930
|
+
/**
|
|
4931
|
+
* The message to be displayed in the snackbar.
|
|
4932
|
+
*/
|
|
4933
|
+
message: string | ReactNode;
|
|
4934
|
+
/**
|
|
4935
|
+
* The type of the snackbar. Optional.
|
|
4936
|
+
*/
|
|
4937
|
+
type?: AlertColor;
|
|
4938
|
+
/**
|
|
4939
|
+
* The duration for which the snackbar should be displayed. Optional.
|
|
4940
|
+
*/
|
|
4941
|
+
duration?: number;
|
|
4942
|
+
/**
|
|
4943
|
+
* The number of columns the snackbar should occupy. Optional.
|
|
4944
|
+
*/
|
|
4945
|
+
columns?: 2 | 4 | 6 | 8;
|
|
4946
|
+
/**
|
|
4947
|
+
* The transition effect for the snackbar. Optional.
|
|
4948
|
+
*/
|
|
4949
|
+
transition?: 'slide' | 'grow' | 'fade';
|
|
4950
|
+
} & SnackbarProps;
|
|
4926
4951
|
declare type DisplayAlertProps = CreateAlertProps & {
|
|
4927
4952
|
id: string;
|
|
4928
4953
|
onClose?: (id: string) => void;
|
|
@@ -4932,10 +4957,13 @@ declare type ContextState = {
|
|
|
4932
4957
|
alertStack: DisplayAlertProps[];
|
|
4933
4958
|
removeFromStack: (id: string) => void;
|
|
4934
4959
|
animationTime: number;
|
|
4960
|
+
createSnackbar: (props: CreateSnackbarProps) => void;
|
|
4961
|
+
currentSnackbar: CreateSnackbarProps;
|
|
4962
|
+
closeSnackbar: (props: CreateSnackbarProps) => void;
|
|
4935
4963
|
};
|
|
4936
4964
|
/**
|
|
4937
4965
|
* Documentation: https://up-components.up42.com/?path=/docs/feedback-alert-usealert--docs
|
|
4938
4966
|
*/
|
|
4939
4967
|
declare const useAlert: () => ContextState;
|
|
4940
4968
|
|
|
4941
|
-
export { Alert, type AlertProps, Avatar, type AvatarProps, Badge, type BadgeProps, Banner, type BannerProps, Button, type ButtonProps, Checkbox, type CheckboxProps, CodeInline, type CodeInlineProps, CodeSnippet, type CodeSnippetItemProps, type CodeSnippetProps, ContactBox, type ContactBoxProps, ControlButton, type ControlButtonProps, CopyButton, type CopyButtonProps, type CreateAlertProps, DataGrid, type DataGridProps, type DatePickerDateType, DateTime, type DateTimeProps, Divider, type DividerProps, DocumentationPopover, type DocumentationPopoverProps, EmptyState, type EmptyStateProps, FormCheckbox, type FormCheckboxProps, FormDatePicker, type FormDatePickerProps, FormDateRangePicker, type FormDateRangePickerProps, FormInput, type FormInputProps, FormRadio, type FormRadioProps, FormSelect, type FormSelectProps, FormSwitch, type FormSwitchProps, GridContainer, type GridContainerProps, GridItem, type GridItemProps, Icon, type IconProps, Illustration, type IllustrationProps, InfoCard, type InfoCardProps, InfoModal, type InfoModalProps, InfoPopover, type InfoPopoverProps, Input, type InputProps, Link, type LinkProps, Loading, type LoadingProps, NotFound, type NotFoundProps, PageContainer, type PageContainerProps, PageHeader, type PageHeaderProps, type PaginatedResponse, Radio, type RadioProps, Select, type SelectProps, Slider, type SliderProps, Switch, type SwitchProps, Tab, TabGroup, type TabGroupProps, type TabProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableContainer, type TableContainerProps, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, TablePagination, type TablePaginationProps, type TableProps, TableRow, type TableRowProps, TableSortLabel, type TableSortLabelProps, Tabs, type TabsProps, Tag, type TagProps, Typography, type TypographyProps, UpComponentsProvider, capitalize, copyToClipboard, formatDate, formatFileSize, formatNumber, theme, useAlert, useDebounce, useQueryParams, useRemotePagination };
|
|
4969
|
+
export { Alert, type AlertProps, Avatar, type AvatarProps, Badge, type BadgeProps, Banner, type BannerProps, Button, type ButtonProps, Checkbox, type CheckboxProps, CodeInline, type CodeInlineProps, CodeSnippet, type CodeSnippetItemProps, type CodeSnippetProps, ContactBox, type ContactBoxProps, ControlButton, type ControlButtonProps, CopyButton, type CopyButtonProps, type CreateAlertProps, type CreateSnackbarProps, DataGrid, type DataGridProps, type DatePickerDateType, DateTime, type DateTimeProps, Divider, type DividerProps, DocumentationPopover, type DocumentationPopoverProps, EmptyState, type EmptyStateProps, FormCheckbox, type FormCheckboxProps, FormDatePicker, type FormDatePickerProps, FormDateRangePicker, type FormDateRangePickerProps, FormInput, type FormInputProps, FormRadio, type FormRadioProps, FormSelect, type FormSelectProps, FormSwitch, type FormSwitchProps, GridContainer, type GridContainerProps, GridItem, type GridItemProps, Icon, type IconProps, Illustration, type IllustrationProps, InfoCard, type InfoCardProps, InfoModal, type InfoModalProps, InfoPopover, type InfoPopoverProps, Input, type InputProps, Link, type LinkProps, Loading, type LoadingProps, NotFound, type NotFoundProps, PageContainer, type PageContainerProps, PageHeader, type PageHeaderProps, type PaginatedResponse, Radio, type RadioProps, Select, type SelectProps, Slider, type SliderProps, Switch, type SwitchProps, Tab, TabGroup, type TabGroupProps, type TabProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableContainer, type TableContainerProps, TableFooter, type TableFooterProps, TableHead, type TableHeadProps, TablePagination, type TablePaginationProps, type TableProps, TableRow, type TableRowProps, TableSortLabel, type TableSortLabelProps, Tabs, type TabsProps, Tag, type TagProps, Typography, type TypographyProps, UpComponentsProvider, capitalize, copyToClipboard, formatDate, formatFileSize, formatNumber, theme, useAlert, useDebounce, useQueryParams, useRemotePagination };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@up42/up-components",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0",
|
|
4
4
|
"description": "UP42 Component Library",
|
|
5
5
|
"author": "Axel Fuhrmann axel.fuhrmann@up42.com",
|
|
6
6
|
"license": "ISC",
|
|
@@ -67,8 +67,6 @@
|
|
|
67
67
|
"@types/react": "^17.0.38",
|
|
68
68
|
"@typescript-eslint/eslint-plugin": "^5.10.0",
|
|
69
69
|
"@typescript-eslint/parser": "^5.10.0",
|
|
70
|
-
"babel-jest": "^27.4.6",
|
|
71
|
-
"babel-loader": "^8.2.3",
|
|
72
70
|
"commit-and-tag-version": "^12.4.1",
|
|
73
71
|
"eslint": "^8.7.0",
|
|
74
72
|
"eslint-config-prettier": "^8.3.0",
|
|
File without changes
|
|
File without changes
|