@muraldevkit/ui-toolkit 2.19.4 → 2.21.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';
@@ -13,6 +13,15 @@ interface ModalProps extends MrlComponentProps {
13
13
  */
14
14
  className?: string;
15
15
  client?: MrlDeviceClient;
16
+ /**
17
+ * !!!!! WARNING: do not use this prop without an explicit requirement from the design team !!!!!
18
+ *
19
+ * Enables/disables the ability to close the modal. This prop does the following:
20
+ * - removes close button
21
+ * - disables clicking on the overlay to close the modal
22
+ * - disables the escape key to close the modal
23
+ */
24
+ closable?: boolean;
16
25
  /**
17
26
  * Tells the modal whether we are in a loading state.
18
27
  * This is used to disabled FocusTrap until the contents of the modal are loaded
@@ -38,5 +47,5 @@ interface ModalProps extends MrlComponentProps {
38
47
  * @param {React.ReactElement} props.children - Children to be rendered within the modal. The first child is used as the trigger.
39
48
  * @returns {React.ReactElement} an instance of the MrlModal
40
49
  */
41
- export declare const MrlModal: ({ children, className, client, loading, size, state, hookClose, attrs }: ModalProps) => ReactElement;
50
+ export declare const MrlModal: ({ children, className, client, closable, loading, size, state, hookClose, attrs }: ModalProps) => ReactElement;
42
51
  export {};
@@ -2,6 +2,7 @@
2
2
  interface ModalDemoProps {
3
3
  /** Additional function to be run when the modal closes */
4
4
  hookClose?: (() => void) | undefined;
5
+ closable?: boolean;
5
6
  }
6
7
  /**
7
8
  * Demo for a modal with a trigger button
@@ -10,5 +11,5 @@ interface ModalDemoProps {
10
11
  * @param {Function} props.hookClose - hookClose for modal
11
12
  * @returns {Element} Rendered demo
12
13
  */
13
- export declare const ModalWithTriggerDemo: ({ hookClose }: ModalDemoProps) => JSX.Element;
14
+ export declare const ModalWithTriggerDemo: ({ closable, hookClose }: ModalDemoProps) => JSX.Element;
14
15
  export {};
@@ -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';
@@ -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 {};