@up42/up-components 0.10.8 → 0.10.10
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 +1 -1
- package/dist/cjs/types/components/DateTime/DateTime.d.ts +11 -0
- package/dist/cjs/types/components/DateTime/DateTime.test.d.ts +1 -0
- package/dist/cjs/types/components/EmptyState/EmptyState.d.ts +1 -1
- package/dist/cjs/types/index.d.ts +2 -0
- package/dist/cjs/types/utils/helpers/formatDate.d.ts +16 -0
- package/dist/cjs/types/utils/helpers/formatDate.test.d.ts +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/types/components/DateTime/DateTime.d.ts +11 -0
- package/dist/esm/types/components/DateTime/DateTime.test.d.ts +1 -0
- package/dist/esm/types/components/EmptyState/EmptyState.d.ts +1 -1
- package/dist/esm/types/index.d.ts +2 -0
- package/dist/esm/types/utils/helpers/formatDate.d.ts +16 -0
- package/dist/esm/types/utils/helpers/formatDate.test.d.ts +1 -0
- package/dist/index.d.ts +29 -2
- package/package.json +6 -3
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DateType, FormatDateOptions } from '../../utils/helpers/formatDate';
|
|
3
|
+
export declare type DateTimeProps = {
|
|
4
|
+
date: DateType;
|
|
5
|
+
} & FormatDateOptions;
|
|
6
|
+
/**
|
|
7
|
+
* Documentation: https://up-components.up42.dev/?path=/docs/data-display-datetime
|
|
8
|
+
*/
|
|
9
|
+
export declare const DateTime: React.ForwardRefExoticComponent<{
|
|
10
|
+
date: DateType;
|
|
11
|
+
} & FormatDateOptions & React.RefAttributes<HTMLTimeElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -21,4 +21,4 @@ export declare type EmptyStateProps<C extends React.ElementType = 'div'> = BaseP
|
|
|
21
21
|
/**
|
|
22
22
|
* Documentation: https://up-components.up42.dev/?path=/docs/patterns-emptystate
|
|
23
23
|
*/
|
|
24
|
-
export declare const EmptyState: <C extends React.ElementType<any>>({ icon: Icon, title, subTitle, action, ...props }: EmptyStateProps<C>) => JSX.Element;
|
|
24
|
+
export declare const EmptyState: <C extends React.ElementType<any>>({ icon: Icon, title, subTitle, action, sx, ...props }: EmptyStateProps<C>) => JSX.Element;
|
|
@@ -40,6 +40,7 @@ export { Loading, type LoadingProps } from './components/Loading/Loading';
|
|
|
40
40
|
export { Icon, type IconProps } from './components/Icon/Icon';
|
|
41
41
|
export { Badge, type BadgeProps } from './components/Badge/Badge';
|
|
42
42
|
export { Tag, type TagProps } from './components/Tag/Tag';
|
|
43
|
+
export { DateTime, type DateTimeProps } from './components/DateTime/DateTime';
|
|
43
44
|
export { DocumentationPopover, type DocumentationPopoverProps, } from './components/DocumentationPopover/DocumentationPopover';
|
|
44
45
|
export { CodeBox, type CodeBoxProps } from './components/CodeBox/CodeBox';
|
|
45
46
|
export { Table, TableBody, TableCell, TableHead, TableContainer, TableRow, TableFooter, TablePagination, TableSortLabel, type TableProps, type TableBodyProps, type TableCellProps, type TableHeadProps, type TableContainerProps, type TableRowProps, type TableFooterProps, type TablePaginationProps, type TableSortLabelProps, } from './components/Table/Table';
|
|
@@ -47,6 +48,7 @@ export { DataGrid, type DataGridProps, type GridColDef, type GridRenderCellParam
|
|
|
47
48
|
export { capitalize } from './utils/helpers/capitalize';
|
|
48
49
|
export { copyToClipboard } from './utils/helpers/copyToClipboard';
|
|
49
50
|
export { formatNumber } from './utils/helpers/formatNumber';
|
|
51
|
+
export { formatDate } from './utils/helpers/formatDate';
|
|
50
52
|
export { useQueryParams } from './utils/hooks/useQueryParams';
|
|
51
53
|
export { useRemotePagination, type PaginatedResponse } from './utils/hooks/useRemotePagination';
|
|
52
54
|
export { useAlert, type CreateAlertProps } from './global/providers/AlertProvider/AlertProvider';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
export declare type FormatDateOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* For more formats see here: https://day.js.org/docs/en/display/format#docsNav
|
|
5
|
+
*/
|
|
6
|
+
format?: string;
|
|
7
|
+
fromNow?: boolean;
|
|
8
|
+
utc?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare type DateType = dayjs.ConfigType;
|
|
11
|
+
/**
|
|
12
|
+
* Returns formatted date string. The format will depend on the option passed in the second argument.
|
|
13
|
+
*
|
|
14
|
+
* Documentation: https://up-components.up42.dev/?path=/story/utils--page#formatnumber
|
|
15
|
+
*/
|
|
16
|
+
export declare const formatDate: (date: DateType, options?: FormatDateOptions | undefined) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|