import * as React from 'react';
import { createComponent } from '@lit/react';
import Component from '../../components/textarea';
import { TAG_NAME } from '../../components/textarea/textarea.constants';
/**
 * mdc-textarea component, which is used to get the multi-line text input from the user.
 * It contains:
 * - label: It is the title of the textarea field.
 * - required: A boolean attribute depicting that the textarea field is required.
 * - Textarea: It is the multi-line text input field.
 * - helper-text: It is the text that provides additional information about the textarea field.
 * - max-character-limit: It is the text that shows the character count of the textarea field.
 * - Error, Warning, Success, Priority Help Text type: It is the text that provides additional information
 *   about the textarea field based on the validation state.
 * - limitexceeded: It is the event that is dispatched when the character limit exceeds or restored.
 *   This event exposes 3 properties:
 *   - currentCharacterCount - the current number of characters in the textarea field,
 *   - maxCharacterLimit - the maximum number of characters allowed in the textarea field,
 *   - value - the current value of the textarea field,
 *
 * **Note**: Consumers must set the help-text-type with 'error' and
 * help-text attribute with the error message using limitexceeded event.
 * The same help-text value will be used for the validation message to be displayed.
 *
 * ### Accessibility
 *
 * #### Resize
 *
 * Accessible text area resizing can be turned on with the `resizable`.
 * It is strongly recommended to set the `resize-button-aria-label` attribute as well to describe what it is and what are the shortcuts (up/down arrows) of the button.
 *
 * #### Best practices
 *
 * - Always provide a `label` for screen readers to identify the textarea's purpose
 * - Use `help-text` to provide additional context or instructions
 * - When using `max-character-limit`, consider providing `character-limit-announcement` for screen reader updates
 * - Use appropriate `help-text-type` (error, warning, success) to convey validation state
 * - Ensure `validation-message` is set for form validation errors
 *
 * @tagname mdc-textarea
 *
 * @event input - (React: onInput) This event is dispatched when the value of the textarea field changes (every press).
 * @event change - (React: onChange) This event is dispatched when the value of the textarea field changes (on blur).
 * @event focus - (React: onFocus) This event is dispatched when the textarea receives focus.
 * @event blur - (React: onBlur) This event is dispatched when the textarea loses focus.
 * @event limitexceeded - (React: onLimitExceeded) This event is dispatched once when the character limit
 * exceeds or restored.
 *
 * @dependency mdc-button
 * @dependency mdc-icon
 * @dependency mdc-text
 * @dependency mdc-toggletip
 *
 * @slot label - Slot for the label element. If not provided, the `label` property will be used to render the label.
 * @slot toggletip - Slot for the toggletip info icon button. If not provided, the `toggletip-text` property will be used to render the info icon button and toggletip.
 * @slot help-icon - Slot for the helper/validation icon. If not provided, the icon will be rendered based on the `helpTextType` property.
 * @slot help-text - Slot for the helper/validation text. If not provided, the `helpText` property will be used to render the helper/validation text.
 *
 * @csspart label - The label element.
 * @csspart label-text - The container for the label and required indicator elements.
 * @csspart required-indicator - The required indicator element that is displayed next to the label when the `required` property is set to true.
 * @csspart info-icon-btn - The info icon button element that is displayed next to the label when the `toggletip-text` property is set.
 * @csspart label-toggletip - The toggletip element that is displayed when the info icon button is clicked.
 * @csspart textarea - The textarea element.
 * @csspart textarea-container - The container element that wraps the textarea and resize button.
 * @csspart textarea-footer - The footer element that contains the character counter.
 * @csspart character-counter - The character counter element.
 * @csspart resize-button - The resize button element (shown when `resizable` is true).
 * @csspart help-text - The helper/validation text element.
 * @csspart helper-icon - The helper/validation icon element that is displayed next to the helper/validation text.
 * @csspart help-text-container - The container for the helper/validation icon and text elements.
 *
 * @cssproperty --mdc-label-font-size - Font size for the label text.
 * @cssproperty --mdc-label-font-weight - Font weight for the label text.
 * @cssproperty --mdc-label-line-height - Line height for the label text.
 * @cssproperty --mdc-label-color - Color for the label text.
 * @cssproperty --mdc-help-text-font-size - Font size for the help text.
 * @cssproperty --mdc-help-text-font-weight - Font weight for the help text.
 * @cssproperty --mdc-help-text-line-height - Line height for the help text.
 * @cssproperty --mdc-help-text-color - Color for the help text.
 * @cssproperty --mdc-required-indicator-color - Color for the required indicator text.
 * @cssproperty --mdc-textarea-text-color - Text color for the textarea field
 * @cssproperty --mdc-textarea-background-color - Background color for the textarea field
 * @cssproperty --mdc-textarea-border-color - Border color for the textarea field
 * @cssproperty --mdc-textarea-text-secondary-normal - Text color for the character counter
 * @cssproperty --mdc-textarea-text-font-size - Font size for the textarea field
 * @cssproperty --mdc-textarea-text-line-height - Line height for the textarea field
 * @cssproperty --mdc-textarea-container-background-color - Background color for the textarea container
 */
const reactWrapper = createComponent({
    tagName: TAG_NAME,
    elementClass: Component,
    react: React,
    events: {
        onInput: 'input',
        onChange: 'change',
        onFocus: 'focus',
        onBlur: 'blur',
        onLimitExceeded: 'limitexceeded',
    },
    displayName: 'Textarea',
});
export default reactWrapper;
