@muraldevkit/ui-toolkit 4.50.0 → 4.51.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.
@@ -0,0 +1,45 @@
1
+ import * as React from 'react';
2
+ import { MrlButtonProps } from '../MrlButton';
3
+ import { DSIconType } from '../../svg';
4
+ import { DataQa } from '../../../utils/dataQa';
5
+ export declare const DEFAULT_RESET_TIME = 4000;
6
+ export type PossibleState = 'normal' | 'processing' | 'success' | 'error';
7
+ export type MrlProcessingButtonConfig = {
8
+ normal: {
9
+ text: string;
10
+ icon?: DSIconType;
11
+ };
12
+ processing: {
13
+ action: () => Promise<void>;
14
+ text: string;
15
+ };
16
+ success?: {
17
+ text: string;
18
+ icon?: DSIconType;
19
+ };
20
+ error?: {
21
+ text: string;
22
+ icon?: DSIconType;
23
+ };
24
+ };
25
+ export interface MrlProcessingButtonProps extends Omit<MrlButtonProps, 'ref'>, DataQa {
26
+ /**
27
+ * The configuration for the processing button.
28
+ */
29
+ processingButtonConfig: MrlProcessingButtonConfig;
30
+ /**
31
+ * The time to wait before resetting the button to the normal state.
32
+ */
33
+ resetTime?: number;
34
+ }
35
+ /**
36
+ * A specialized button component that provides visual feedback during processing operations.
37
+ *
38
+ * The MrlProcessingButton extends the standard MrlButton with additional processing state
39
+ * management and user feedback capabilities. It automatically handles the transition between
40
+ * normal, loading, and completion states to provide clear visual feedback to users.
41
+ *
42
+ * @param props - The component props extending MrlButtonProps with additional processing capabilities
43
+ * @returns a MrlProcessingButton React component
44
+ */
45
+ export declare function MrlProcessingButton(props: MrlProcessingButtonProps): React.JSX.Element;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copies text to the clipboard using the browser's clipboard API
3
+ * @param text - The text to copy to clipboard
4
+ * @param processing_time - The time to wait before copying the text to the clipboard
5
+ * @returns Promise that resolves when text is copied
6
+ */
7
+ export declare function copyToClipboard(text: string, processing_time?: number): Promise<void>;
8
+ /**
9
+ * Actions for the MrlProcessingButton
10
+ */
11
+ export declare const MRL_PROCESSING_BUTTON_ACTIONS: {
12
+ copyToClipboard: typeof copyToClipboard;
13
+ };
@@ -0,0 +1,2 @@
1
+ export * from './MrlProcessingButton';
2
+ export * from './actions';