@muraldevkit/ui-toolkit 2.19.4 → 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.
@@ -15,3 +15,4 @@ export * from './text';
15
15
  export * from './tooltip';
16
16
  export * from './portal';
17
17
  export * from './navigation-sidebar';
18
+ export * from './skeleton';
@@ -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';
@@ -0,0 +1,2 @@
1
+ export * from './MrlSkeleton';
2
+ export * from './MrlSkeletonText';
@@ -115,7 +115,7 @@ export declare const colorPictoStoryData: {
115
115
  export declare const animateStoryData: {
116
116
  args: {
117
117
  delay: number;
118
- state: "play" | "stop";
118
+ state: "stop" | "play";
119
119
  };
120
120
  argTypes: {
121
121
  delay: {
@@ -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 {};