@muraldevkit/ui-toolkit 2.19.3 → 2.20.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/components/index.d.ts +1 -0
- package/dist/components/skeleton/MrlSkeleton/MrlSkeleton.d.ts +20 -0
- package/dist/components/skeleton/MrlSkeleton/index.d.ts +1 -0
- package/dist/components/skeleton/MrlSkeletonText/MrlSkeletonText.d.ts +22 -0
- package/dist/components/skeleton/MrlSkeletonText/index.d.ts +1 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/svg/config.d.ts +1 -1
- package/dist/components/table/MrlSmartTable/MrlSmartTable.d.ts +11 -0
- package/dist/components/table/MrlTableCell/MrlTableCell.d.ts +6 -1
- package/dist/components/table/MrlTableColumn/MrlTableColumn.d.ts +6 -1
- package/dist/components/table/fixtures.d.ts +29 -0
- package/dist/index.js +1 -1
- package/dist/styles/MrlSkeleton/module.scss +9 -0
- package/dist/styles/MrlSkeletonText/module.scss +24 -0
- package/dist/styles/MrlTableCell/module.scss +1 -0
- package/dist/styles/MrlTableColumn/module.scss +1 -0
- package/dist/styles/MrlTableRow/module.scss +3 -1
- package/dist/styles/MrlTooltipContent/global.scss +1 -1
- package/dist/styles/skeleton/mixins.scss +44 -0
- package/dist/styles/skeleton/variables.scss +2 -0
- package/dist/styles/table/global.scss +45 -0
- package/dist/styles/table/variables.scss +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface MrlSkeletonProps extends React.ComponentProps<'div'> {
|
|
3
|
+
/** An object with CSS properties */
|
|
4
|
+
style?: React.CSSProperties;
|
|
5
|
+
/** MrlSkeleton wrapper class */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** The height of the MrlSkeleton component */
|
|
8
|
+
height?: React.CSSProperties['height'];
|
|
9
|
+
/** The width of the MrlSkeleton component */
|
|
10
|
+
width?: React.CSSProperties['width'];
|
|
11
|
+
/** The shape of the Skeleton component */
|
|
12
|
+
shape?: 'circle' | 'default';
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* MrlSkeleton React component.
|
|
16
|
+
*
|
|
17
|
+
* @param props {MrlSkeletonProps} - component props
|
|
18
|
+
* @returns a MrlSkeleton React component.
|
|
19
|
+
*/
|
|
20
|
+
export declare function MrlSkeleton({ height, shape, style, width, className, ...rest }: MrlSkeletonProps): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MrlSkeleton';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextSizes } from '../../text/constants';
|
|
3
|
+
export interface MrlSkeletonTextProps extends React.ComponentProps<'div'> {
|
|
4
|
+
/** An object of CSS properties */
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
/** MrlSkeletonText wrapper class */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** The width of the MrlSkeletonText component */
|
|
9
|
+
width?: React.CSSProperties['width'];
|
|
10
|
+
/** Number of lines to render */
|
|
11
|
+
lines?: number;
|
|
12
|
+
/** Size of the text which is the same as MrlText component */
|
|
13
|
+
size?: TextSizes;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* MrlSkeletonText React component. Used to create skeleton elements as placeholders
|
|
17
|
+
* for the MrlText component. It supports the same text sizes as the MrlText component.
|
|
18
|
+
*
|
|
19
|
+
* @param props {MrlSkeletonTextProps} - component props
|
|
20
|
+
* @returns a MrlSkeleton React component.
|
|
21
|
+
*/
|
|
22
|
+
export declare function MrlSkeletonText({ className, style, width, lines, size, ...rest }: MrlSkeletonTextProps): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MrlSkeletonText';
|
|
@@ -50,6 +50,7 @@ export interface MrlTableItem extends Record<string, unknown> {
|
|
|
50
50
|
*/
|
|
51
51
|
id: MrlTableItemId;
|
|
52
52
|
}
|
|
53
|
+
export type MrlTableColumnSticky = 'left' | 'right';
|
|
53
54
|
export interface MrlSmartTableColumn {
|
|
54
55
|
/**
|
|
55
56
|
* The key used to retrieve the cell value from the item object,
|
|
@@ -80,6 +81,16 @@ export interface MrlSmartTableColumn {
|
|
|
80
81
|
* @default sortAlphabeticallyAsCoercedStrings
|
|
81
82
|
*/
|
|
82
83
|
sortBy?: (aValue: unknown, bValue: unknown) => number;
|
|
84
|
+
/**
|
|
85
|
+
* Whether the column is sticky
|
|
86
|
+
* the sticky effect will only work on the first or last column.
|
|
87
|
+
* Set to 'left' for the first column and 'right' for the last column
|
|
88
|
+
*
|
|
89
|
+
* @example The container of the table will need overflow:scroll/auto
|
|
90
|
+
* and the width will need to be constrained in order for
|
|
91
|
+
* the columns to be 'sticky'
|
|
92
|
+
*/
|
|
93
|
+
sticky?: MrlTableColumnSticky;
|
|
83
94
|
}
|
|
84
95
|
/**
|
|
85
96
|
* A set of item ids.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { MrlTableColumnSticky } from '../MrlSmartTable';
|
|
2
3
|
export interface MrlTableCellProps extends React.ComponentPropsWithoutRef<'td'> {
|
|
3
4
|
/**
|
|
4
5
|
* An element id (and if not provided, a unique value decorated
|
|
@@ -7,6 +8,10 @@ export interface MrlTableCellProps extends React.ComponentPropsWithoutRef<'td'>
|
|
|
7
8
|
* @default `${id}-mrl-table-cell`
|
|
8
9
|
*/
|
|
9
10
|
id?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Whether this cell is sticky 'left' or sticky 'right' or not sticky at all
|
|
13
|
+
*/
|
|
14
|
+
sticky?: MrlTableColumnSticky;
|
|
10
15
|
}
|
|
11
16
|
/**
|
|
12
17
|
* MrlTableCell Component
|
|
@@ -14,4 +19,4 @@ export interface MrlTableCellProps extends React.ComponentPropsWithoutRef<'td'>
|
|
|
14
19
|
* @param {MrlTableCellProps} props - MrlTableCell component props
|
|
15
20
|
* @returns a table cell element
|
|
16
21
|
*/
|
|
17
|
-
export declare function MrlTableCell({ className, ...rest }: MrlTableCellProps): JSX.Element;
|
|
22
|
+
export declare function MrlTableCell({ className, sticky, ...rest }: MrlTableCellProps): JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { MrlTableColumnSticky } from '../MrlSmartTable';
|
|
2
3
|
export interface MrlTableColumnProps extends React.ComponentPropsWithoutRef<'th'> {
|
|
3
4
|
/**
|
|
4
5
|
* An element id (and if not provided, a unique value decorated
|
|
@@ -7,6 +8,10 @@ export interface MrlTableColumnProps extends React.ComponentPropsWithoutRef<'th'
|
|
|
7
8
|
* @default `${id}-mrl-table-column`
|
|
8
9
|
*/
|
|
9
10
|
id?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Whether this column is sticky 'left' or sticky 'right' or not sticky at all
|
|
13
|
+
*/
|
|
14
|
+
sticky?: MrlTableColumnSticky;
|
|
10
15
|
}
|
|
11
16
|
/**
|
|
12
17
|
* MrlTableColumn Component
|
|
@@ -14,4 +19,4 @@ export interface MrlTableColumnProps extends React.ComponentPropsWithoutRef<'th'
|
|
|
14
19
|
* @param {MrlTableColumnProps} props - MrlTableColumn component props
|
|
15
20
|
* @returns a table column element
|
|
16
21
|
*/
|
|
17
|
-
export declare function MrlTableColumn({ className, ...rest }: MrlTableColumnProps): JSX.Element;
|
|
22
|
+
export declare function MrlTableColumn({ className, sticky, ...rest }: MrlTableColumnProps): JSX.Element;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
declare enum STICKY_VALUES {
|
|
2
|
+
LEFT = "left",
|
|
3
|
+
RIGHT = "right"
|
|
4
|
+
}
|
|
1
5
|
export declare const SAMPLE_COLUMNS: ({
|
|
2
6
|
allowsSorting: boolean;
|
|
3
7
|
id: string;
|
|
@@ -13,6 +17,30 @@ export declare const SAMPLE_ITEMS: {
|
|
|
13
17
|
name: string;
|
|
14
18
|
type: string;
|
|
15
19
|
}[];
|
|
20
|
+
export declare const SAMPLE_STICKY_COLUMNS: ({
|
|
21
|
+
allowsSorting: boolean;
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
sticky: STICKY_VALUES;
|
|
25
|
+
} | {
|
|
26
|
+
allowsSorting: boolean;
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
sticky?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
sticky: STICKY_VALUES;
|
|
34
|
+
allowsSorting?: undefined;
|
|
35
|
+
})[];
|
|
36
|
+
export declare const SAMPLE_STICKY_ITEMS: {
|
|
37
|
+
dateModified: string;
|
|
38
|
+
foobars: string;
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
type: string;
|
|
42
|
+
widgets: string;
|
|
43
|
+
}[];
|
|
16
44
|
export declare const SAMPLE_ITEMS_WITH_LONG_CONTENT: {
|
|
17
45
|
dateModified: string;
|
|
18
46
|
id: string;
|
|
@@ -25,3 +53,4 @@ export declare const SAMPLE_ITEMS_500: {
|
|
|
25
53
|
name: string;
|
|
26
54
|
type: string;
|
|
27
55
|
}[];
|
|
56
|
+
export {};
|