design-react-kit 5.4.0 → 5.4.1

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.
@@ -1,4 +1,4 @@
1
- import React, { Ref, ReactNode, TextareaHTMLAttributes } from 'react';
1
+ import React, { ReactNode, Ref, TextareaHTMLAttributes } from 'react';
2
2
  import type { CSSModule } from 'reactstrap/types/lib/utils';
3
3
  export interface TextAreaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
4
4
  /** Etichetta del campo TextArea. */
package/package.json CHANGED
@@ -24,7 +24,7 @@
24
24
  "bugs": {
25
25
  "url": "https://github.com/italia/design-react-kit/issues"
26
26
  },
27
- "version": "5.4.0",
27
+ "version": "5.4.1",
28
28
  "license": "BSD-3",
29
29
  "type": "module",
30
30
  "module": "./dist/index.js",
@@ -1,8 +1,8 @@
1
- import React, { Ref, ReactNode, TextareaHTMLAttributes } from 'react';
1
+ import React, { ReactNode, Ref, TextareaHTMLAttributes } from 'react';
2
2
 
3
- import { InputContainer } from './InputContainer';
4
- import { getClasses, getValidationTextControlClass, useFocus } from './utils';
5
3
  import type { CSSModule } from 'reactstrap/types/lib/utils';
4
+ import { InputContainer } from './InputContainer';
5
+ import { getClasses, getFormControlClass, getValidationTextControlClass, useFocus } from './utils';
6
6
 
7
7
  export interface TextAreaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
8
8
  /** Etichetta del campo TextArea. */
@@ -56,6 +56,11 @@ export const TextArea = ({
56
56
 
57
57
  const extraAttributes: { ['aria-describedby']?: string } = {};
58
58
 
59
+ //Chiamo questa funzione per impostare classNames a 'form-control'
60
+ const formControlClass = getFormControlClass(
61
+ {},
62
+ cssModule
63
+ );
59
64
  // associate the input field with the help text
60
65
  const infoId = id ? `${id}Description` : undefined;
61
66
  if (id) {
@@ -73,6 +78,7 @@ export const TextArea = ({
73
78
  label,
74
79
  validationText,
75
80
  normalized: Boolean(normalized),
81
+ formControlClass,
76
82
  validationTextControlClass,
77
83
  isFocused,
78
84
  originalWrapperClass
@@ -1,5 +1,5 @@
1
1
  import classNames from 'classnames';
2
- import { useState, useCallback } from 'react';
2
+ import { useCallback, useState } from 'react';
3
3
  import type { CSSModule } from 'reactstrap/types/lib/utils';
4
4
  import { mapToCssModules } from '../utils';
5
5
  import type { InputProps } from './Input';
@@ -98,7 +98,7 @@ export function getClasses(
98
98
  ),
99
99
  cssModule
100
100
  );
101
- const wrapperClass = mapToCssModules(classNames(className, originalWrapperClass, 'form-group'), cssModule);
101
+ const wrapperClass = mapToCssModules(classNames(originalWrapperClass, 'form-group'), cssModule);
102
102
  const validationTextClass = mapToCssModules(
103
103
  classNames(
104
104
  {