design-react-kit 5.6.0 → 5.6.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.
@@ -30,8 +30,6 @@ export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
30
30
  innerRef?: Ref<HTMLInputElement>;
31
31
  /** Utilizzare per mostrare testo statico non modificabile. */
32
32
  plaintext?: boolean;
33
- /** Utilizzare per mostrare un elemento addon a fianco (prima o dopo) il campo input all'interno del componente */
34
- addon?: boolean;
35
33
  /** Utilizzare per mostrare un elemento un simbolo attivando la proprietà addon nel campo input all'interno del componente */
36
34
  addonText?: string;
37
35
  /** Oggetto contenente la nuova mappatura per le classi CSS. */
@@ -64,5 +62,5 @@ export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
64
62
  iconLeft?: ReactNode;
65
63
  testId?: string;
66
64
  }
67
- export declare const Input: ({ id, className, cssModule, type, tag, addon, addonText, static: staticInput, plaintext, innerRef, label, incrementLabel, decrementLabel, validationText, infoText, placeholder, normalized, value, wrapperClass: originalWrapperClassOld, wrapperClassName: originalWrapperClass, size, testId, noWrapper, hasButtonRight, buttonRight, hasIconLeft, iconLeft, ...attributes }: InputProps) => React.JSX.Element;
65
+ export declare const Input: ({ id, className, cssModule, type, tag, addonText, static: staticInput, plaintext, innerRef, label, incrementLabel, decrementLabel, validationText, infoText, placeholder, normalized, value, wrapperClass: originalWrapperClassOld, wrapperClassName: originalWrapperClass, size, testId, noWrapper, hasButtonRight, buttonRight, hasIconLeft, iconLeft, ...attributes }: InputProps) => React.JSX.Element;
68
66
  export {};
@@ -4,7 +4,7 @@ type ValidationProps = Pick<InputProps, 'valid'>;
4
4
  type TypeProps = Pick<InputProps, 'plaintext' | 'type'> & {
5
5
  staticInput?: boolean;
6
6
  };
7
- type FormControlProps = Pick<InputProps, 'addon' | 'normalized'> & TypeProps;
7
+ type FormControlProps = Pick<InputProps, 'normalized'> & TypeProps;
8
8
  export declare function getFormControlClass(props: FormControlProps, cssModule?: CSSModule): string;
9
9
  export declare function getValidationTextControlClass({ valid }: ValidationProps, cssModule?: CSSModule): string;
10
10
  export declare function getTag({ tag, plaintext, staticInput, type }: Pick<InputProps, 'tag'> & TypeProps): import("react").ElementType;
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.6.0",
27
+ "version": "5.6.1",
28
28
  "license": "BSD-3",
29
29
  "type": "module",
30
30
  "module": "./dist/index.js",
@@ -77,8 +77,6 @@ export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
77
77
  innerRef?: Ref<HTMLInputElement>;
78
78
  /** Utilizzare per mostrare testo statico non modificabile. */
79
79
  plaintext?: boolean;
80
- /** Utilizzare per mostrare un elemento addon a fianco (prima o dopo) il campo input all'interno del componente */
81
- addon?: boolean;
82
80
  /** Utilizzare per mostrare un elemento un simbolo attivando la proprietà addon nel campo input all'interno del componente */
83
81
  addonText?: string;
84
82
  /** Oggetto contenente la nuova mappatura per le classi CSS. */
@@ -118,7 +116,6 @@ export const Input = ({
118
116
  cssModule,
119
117
  type = 'text',
120
118
  tag,
121
- addon,
122
119
  addonText,
123
120
  static: staticInput,
124
121
  plaintext,
@@ -173,13 +170,11 @@ export const Input = ({
173
170
  let { bsSize, valid, ...rest } = attributes;
174
171
 
175
172
  const Tag = getTag({ tag, plaintext, staticInput, type });
176
- addon = addonText != null ? true : addon;
177
173
  const formControlClass = getFormControlClass(
178
174
  {
179
175
  plaintext,
180
176
  staticInput,
181
177
  type,
182
- addon,
183
178
  normalized
184
179
  },
185
180
  cssModule
@@ -304,10 +299,8 @@ export const Input = ({
304
299
  };
305
300
 
306
301
  if (['currency', 'percentage', 'adaptive', 'number'].includes(type)) {
307
- if (containerProps.extraLabelClass) {
302
+ if (containerProps.extraLabelClass && ['currency', 'percentage'].includes(type)) {
308
303
  containerProps.extraLabelClass = containerProps.extraLabelClass + ' input-symbol-label';
309
- } else {
310
- containerProps.extraLabelClass = 'input-symbol-label';
311
304
  }
312
305
  return (
313
306
  <InputContainer {...containerProps}>
@@ -8,9 +8,9 @@ type ValidationProps = Pick<InputProps, 'valid'>;
8
8
  type TypeProps = Pick<InputProps, 'plaintext' | 'type'> & {
9
9
  staticInput?: boolean;
10
10
  };
11
- type FormControlProps = Pick<InputProps, 'addon' | 'normalized'> & TypeProps;
11
+ type FormControlProps = Pick<InputProps, 'normalized'> & TypeProps;
12
12
 
13
- function getFormControlClassInternal({ plaintext, staticInput, type = 'text', addon, normalized }: FormControlProps) {
13
+ function getFormControlClassInternal({ plaintext, staticInput, type = 'text', normalized }: FormControlProps) {
14
14
  const formControlClass = 'form-control';
15
15
  if (plaintext || staticInput || normalized) {
16
16
  return `${formControlClass}-plaintext`;
@@ -19,9 +19,7 @@ function getFormControlClassInternal({ plaintext, staticInput, type = 'text', ad
19
19
  return `${formControlClass}-file`;
20
20
  }
21
21
  if (['radio', 'checkbox'].indexOf(type) > -1) {
22
- if (addon) {
23
- return null;
24
- }
22
+ return null;
25
23
  }
26
24
  return formControlClass;
27
25
  }