@muraldevkit/ui-toolkit 2.61.0 → 2.62.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/form/{text-input/hooks → hooks}/useActiveColor.d.ts +1 -1
- package/dist/components/form/{text-input/MrlEditableTextInput → hooks}/useIsEditable.d.ts +1 -1
- package/dist/components/form/index.d.ts +1 -0
- package/dist/components/form/textarea/MrlEditableTextarea/MrlEditableTextarea.d.ts +43 -0
- package/dist/components/form/textarea/MrlEditableTextarea/MrlEditableTextareaRightButton.d.ts +25 -0
- package/dist/components/form/textarea/MrlEditableTextarea/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/styles/MrlEditableTextarea/global.scss +15 -0
- package/dist/styles/MrlEditableTextarea/module.scss +53 -0
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ export * from './text-input/MrlTextInput';
|
|
|
5
5
|
export * from './text-input/MrlEditableTextInput';
|
|
6
6
|
export * from './label/MrlLabel';
|
|
7
7
|
export * from './textarea/MrlTextarea';
|
|
8
|
+
export * from './textarea/MrlEditableTextarea';
|
|
8
9
|
export * from './fieldset/MrlFieldset';
|
|
9
10
|
export * from './checkbox/MrlCheckbox';
|
|
10
11
|
export * from './checkbox/MrlCheckboxStandalone';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { TextareaHTMLAttributes } from 'react';
|
|
2
|
+
import './MrlEditableTextarea.global.scss';
|
|
3
|
+
import { InputStates, MrlFormInputError } from '../../..';
|
|
4
|
+
interface MrlEditableTextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
5
|
+
/** The value of the textarea used to make it a controlled input */
|
|
6
|
+
value: string;
|
|
7
|
+
/**
|
|
8
|
+
* Value of the label text assigned to the input.
|
|
9
|
+
* This is used to describe to the user what field they will be editing when interacting with the edit buton.
|
|
10
|
+
*/
|
|
11
|
+
inputLabelText: string;
|
|
12
|
+
/**
|
|
13
|
+
* The maximum number of characters that the user can enter.
|
|
14
|
+
* If undefined or set to "0", removes the character counter from the textarea
|
|
15
|
+
*/
|
|
16
|
+
maxLength?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Id of the text input.
|
|
19
|
+
*/
|
|
20
|
+
inputId: string;
|
|
21
|
+
/**
|
|
22
|
+
* Text placeholder for the text input.
|
|
23
|
+
*/
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Changes the state of the input based on user permissions or actions.
|
|
27
|
+
*/
|
|
28
|
+
state?: InputStates;
|
|
29
|
+
/** Additional class to add to the textarea */
|
|
30
|
+
className?: string;
|
|
31
|
+
'data-qa': string;
|
|
32
|
+
error?: MrlFormInputError;
|
|
33
|
+
isEditable?: boolean;
|
|
34
|
+
setIsEditable?: (isEditableUpdate: boolean) => void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Allows the user to input plain text in a multi-line format
|
|
38
|
+
*
|
|
39
|
+
* @param {MrlEditableTextareaProps} props - the component props
|
|
40
|
+
* @returns a textarea element
|
|
41
|
+
*/
|
|
42
|
+
export declare const MrlEditableTextarea: React.ForwardRefExoticComponent<MrlEditableTextareaProps & React.RefAttributes<HTMLButtonElement>>;
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DSIconType } from '../../..';
|
|
3
|
+
export interface MrlEditableTextareaRightButtonProps {
|
|
4
|
+
/** the action that should be executed when interacting with the icon */
|
|
5
|
+
action: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
|
6
|
+
/** the icon that will be rendered */
|
|
7
|
+
icon: DSIconType;
|
|
8
|
+
/** data-qa attribute for the icon */
|
|
9
|
+
dataQa?: string;
|
|
10
|
+
/** describes the purpouse of the icon button */
|
|
11
|
+
label: string;
|
|
12
|
+
/** determines if the icon has active color or not */
|
|
13
|
+
hasActiveColor: boolean;
|
|
14
|
+
setHasActiveColor: (hasActiveColor: boolean) => void;
|
|
15
|
+
/** the text input value used to calculate the active style */
|
|
16
|
+
value?: string;
|
|
17
|
+
ref?: HTMLButtonElement;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Renders the right icon in the text input
|
|
21
|
+
*
|
|
22
|
+
* @param {MrlEditableTextareaRightButtonProps} props - the component props
|
|
23
|
+
* @returns a button element with an icon
|
|
24
|
+
*/
|
|
25
|
+
export declare const MrlEditableTextareaRightButton: React.ForwardRefExoticComponent<Pick<MrlEditableTextareaRightButtonProps, "label" | "value" | "dataQa" | "icon" | "hasActiveColor" | "setHasActiveColor" | "action"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MrlEditableTextarea';
|