@salutejs/plasma-web 1.390.0-canary.1352.10686935940.0 → 1.390.0-canary.1352.10698100498.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -275,7 +275,7 @@ import { TextareaResize } from '@salutejs/plasma-core';
275
275
  import { TextFieldGroupProps } from '@salutejs/plasma-new-hope/styled-components';
276
276
  import { TextFieldPrimitiveValue } from '@salutejs/plasma-new-hope/types/components/TextField/TextField.types';
277
277
  import { TextfieldPrimitiveValue } from '@salutejs/plasma-new-hope/types/components/Range/Range.types';
278
- import type { TextFieldProps as TextFieldProps_2 } from '@salutejs/plasma-hope';
278
+ import type { TextFieldProps as TextFieldProps_3 } from '@salutejs/plasma-hope';
279
279
  import { TextFieldPropsBase } from '@salutejs/plasma-new-hope/types/components/TextField/TextField.types';
280
280
  import { TextFieldView } from '@salutejs/plasma-hope';
281
281
  import { TextSkeletonBaseProps } from '@salutejs/plasma-new-hope/types/components/Skeleton/TextSkeleton/TextSkeleton.types';
@@ -417,7 +417,7 @@ true: PolymorphicClassName;
417
417
  readOnly: {
418
418
  true: PolymorphicClassName;
419
419
  };
420
- }> & BaseProps & Omit<TextFieldPropsBase, "enumerationType" | "chips" | "onChangeChips"> & Omit<InputHTMLAttributes_3<HTMLInputElement>, "size"> & RefAttributes<HTMLInputElement>>;
420
+ }> & BaseProps & Omit<TextFieldPropsBase, "required" | "requiredPlacement" | "optional" | "enumerationType" | "chips" | "onChangeChips"> & Omit<InputHTMLAttributes_3<HTMLInputElement>, "size" | "required"> & RefAttributes<HTMLInputElement>>;
421
421
 
422
422
  // @public (undocumented)
423
423
  export const Avatar: FunctionComponent<PropsType< {
@@ -2356,90 +2356,17 @@ export const TextArea: ForwardRefExoticComponent<TextAreaProps & RefAttributes<H
2356
2356
 
2357
2357
  export { TextareaHTMLAttributes }
2358
2358
 
2359
+ // Warning: (ae-forgotten-export) The symbol "RequiredProps" needs to be exported by the entry point index.d.ts
2360
+ //
2359
2361
  // @public (undocumented)
2360
- export interface TextAreaProps extends TextAreaProps_2 {
2361
- optional?: boolean;
2362
- required?: boolean;
2363
- requiredPlacement?: 'left' | 'right';
2364
- // @deprecated (undocumented)
2362
+ export type TextAreaProps = TextAreaProps_2 & {
2365
2363
  resize?: 'none' | 'both' | 'horizontal' | 'vertical';
2366
- }
2364
+ } & RequiredProps;
2367
2365
 
2368
2366
  export { TextareaResize }
2369
2367
 
2370
2368
  // @public
2371
- export const TextField: React_2.ForwardRefExoticComponent<TextFieldProps_2 & {
2372
- optional?: boolean | undefined;
2373
- required?: boolean | undefined;
2374
- requiredPlacement?: "right" | "left" | undefined;
2375
- } & Pick<PropsType< {
2376
- view: {
2377
- default: PolymorphicClassName;
2378
- positive: PolymorphicClassName;
2379
- warning: PolymorphicClassName;
2380
- negative: PolymorphicClassName;
2381
- };
2382
- size: {
2383
- l: PolymorphicClassName;
2384
- m: PolymorphicClassName;
2385
- s: PolymorphicClassName;
2386
- xs: PolymorphicClassName;
2387
- };
2388
- labelPlacement: {
2389
- inner: PolymorphicClassName;
2390
- outer: PolymorphicClassName;
2391
- };
2392
- disabled: {
2393
- true: PolymorphicClassName;
2394
- };
2395
- readOnly: {
2396
- true: PolymorphicClassName;
2397
- };
2398
- }> & (({
2399
- size?: string | undefined;
2400
- view?: string | undefined;
2401
- readOnly?: boolean | undefined;
2402
- disabled?: boolean | undefined;
2403
- } & {
2404
- label?: string | undefined;
2405
- labelPlacement?: "outer" | "inner" | undefined;
2406
- leftHelper?: string | undefined;
2407
- contentLeft?: React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | undefined;
2408
- contentRight?: React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | undefined;
2409
- textBefore?: string | undefined;
2410
- textAfter?: string | undefined;
2411
- optional?: boolean | undefined;
2412
- required?: boolean | undefined;
2413
- requiredPlacement?: "right" | "left" | undefined;
2414
- onSearch?: ((value: string, event?: React_2.KeyboardEvent<HTMLInputElement> | undefined) => void) | undefined;
2415
- } & {
2416
- chips?: undefined;
2417
- onChangeChips?: undefined;
2418
- enumerationType?: "plain" | undefined;
2419
- onSearch?: ((value: string, event?: React_2.KeyboardEvent<HTMLInputElement> | undefined) => void) | undefined;
2420
- } & Omit<React_2.InputHTMLAttributes<HTMLInputElement>, "size"> & React_2.RefAttributes<HTMLInputElement>) | ({
2421
- size?: string | undefined;
2422
- view?: string | undefined;
2423
- readOnly?: boolean | undefined;
2424
- disabled?: boolean | undefined;
2425
- } & {
2426
- label?: string | undefined;
2427
- labelPlacement?: "outer" | "inner" | undefined;
2428
- leftHelper?: string | undefined;
2429
- contentLeft?: React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | undefined;
2430
- contentRight?: React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | undefined;
2431
- textBefore?: string | undefined;
2432
- textAfter?: string | undefined;
2433
- optional?: boolean | undefined;
2434
- required?: boolean | undefined;
2435
- requiredPlacement?: "right" | "left" | undefined;
2436
- onSearch?: ((value: string, event?: React_2.KeyboardEvent<HTMLInputElement> | undefined) => void) | undefined;
2437
- } & {
2438
- enumerationType: "chip";
2439
- onSearch?: undefined;
2440
- chips?: TextFieldPrimitiveValue[] | undefined;
2441
- onChangeChips?: ((value: TextFieldPrimitiveValue[]) => void) | undefined;
2442
- } & Omit<React_2.InputHTMLAttributes<HTMLInputElement>, "size"> & React_2.RefAttributes<HTMLInputElement>)), "enumerationType" | "chips" | "onChangeChips"> & React_2.RefAttributes<HTMLInputElement>>;
2369
+ export const TextField: React_2.ForwardRefExoticComponent<TextFieldProps & React_2.RefAttributes<HTMLInputElement>>;
2443
2370
 
2444
2371
  // @public
2445
2372
  export const TextFieldGroup: FunctionComponent<PropsType< {
@@ -2486,11 +2413,11 @@ shape?: "default" | undefined;
2486
2413
 
2487
2414
  export { TextFieldGroupProps }
2488
2415
 
2489
- // Warning: (ae-forgotten-export) The symbol "TextFieldProps_3" needs to be exported by the entry point index.d.ts
2416
+ // Warning: (ae-forgotten-export) The symbol "TextFieldProps_2" needs to be exported by the entry point index.d.ts
2490
2417
  // Warning: (ae-forgotten-export) The symbol "newHopeTextFieldProps" needs to be exported by the entry point index.d.ts
2491
2418
  //
2492
2419
  // @public (undocumented)
2493
- export type TextFieldProps = TextFieldProps_3 & Pick<newHopeTextFieldProps, 'enumerationType' | 'chips' | 'onChangeChips'>;
2420
+ export type TextFieldProps = TextFieldProps_2 & Pick<newHopeTextFieldProps, 'enumerationType' | 'chips' | 'onChangeChips'>;
2494
2421
 
2495
2422
  export { TextFieldView }
2496
2423
 
@@ -22,4 +22,4 @@ export declare const Autocomplete: import("react").FunctionComponent<import("@sa
22
22
  readOnly: {
23
23
  true: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
24
24
  };
25
- }> & import("@salutejs/plasma-new-hope/types/components/Autocomplete/Autocomplete.types").BaseProps & Omit<import("@salutejs/plasma-new-hope/types/components/TextField/TextField.types").TextFieldPropsBase, "enumerationType" | "chips" | "onChangeChips"> & Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "size"> & import("react").RefAttributes<HTMLInputElement>>;
25
+ }> & import("@salutejs/plasma-new-hope/types/components/Autocomplete/Autocomplete.types").BaseProps & Omit<import("@salutejs/plasma-new-hope/types/components/TextField/TextField.types").TextFieldPropsBase, "required" | "requiredPlacement" | "optional" | "enumerationType" | "chips" | "onChangeChips"> & Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "size" | "required"> & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,21 +1,33 @@
1
1
  import type { TextAreaProps as TextAreaPropsBase } from '@salutejs/plasma-hope';
2
2
  export { TextArea } from './TextArea';
3
- export interface TextAreaProps extends TextAreaPropsBase {
3
+ declare type RequiredProps = {
4
4
  /**
5
- * @deprecated не используется в компоненте
5
+ * Задает выравнивание индикатора обязательности поля
6
+ * @default right
6
7
  */
7
- resize?: 'none' | 'both' | 'horizontal' | 'vertical';
8
+ requiredPlacement?: 'left' | 'right';
9
+ } & ({
10
+ /**
11
+ * Флаг обязательности поля
12
+ */
13
+ required: true;
8
14
  /**
9
15
  * Флаг необязательности поля
10
16
  */
11
- optional?: boolean;
17
+ optional?: never | false;
18
+ } | {
19
+ /**
20
+ * Флаг необязательности поля
21
+ */
22
+ optional?: true;
12
23
  /**
13
24
  * Флаг обязательности поля
14
25
  */
15
- required?: boolean;
26
+ required?: never | false;
27
+ });
28
+ export declare type TextAreaProps = TextAreaPropsBase & {
16
29
  /**
17
- * Задает выравнивание индикатора обязательности поля
18
- * @default right
30
+ * @deprecated не используется в компоненте
19
31
  */
20
- requiredPlacement?: 'left' | 'right';
21
- }
32
+ resize?: 'none' | 'both' | 'horizontal' | 'vertical';
33
+ } & RequiredProps;
@@ -36,16 +36,20 @@ declare const TextFieldComponent: React.FunctionComponent<import("@salutejs/plas
36
36
  contentRight?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
37
37
  textBefore?: string | undefined;
38
38
  textAfter?: string | undefined;
39
- optional?: boolean | undefined;
40
- required?: boolean | undefined;
41
- requiredPlacement?: "right" | "left" | undefined;
42
39
  onSearch?: ((value: string, event?: React.KeyboardEvent<HTMLInputElement> | undefined) => void) | undefined;
40
+ } & {
41
+ requiredPlacement?: "right" | "left" | undefined;
42
+ } & {
43
+ required: true;
44
+ optional?: false | undefined;
43
45
  } & {
44
46
  chips?: undefined;
45
47
  onChangeChips?: undefined;
46
48
  enumerationType?: "plain" | undefined;
47
- onSearch?: ((value: string, event?: React.KeyboardEvent<HTMLInputElement> | undefined) => void) | undefined;
48
- } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & React.RefAttributes<HTMLInputElement>) | ({
49
+ onSearch?: ((value: string, event?: React.KeyboardEvent<HTMLInputElement> | undefined) => void) | undefined; /**
50
+ * Флаг необязательности поля
51
+ */
52
+ } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "required"> & React.RefAttributes<HTMLInputElement>) | ({
49
53
  size?: string | undefined;
50
54
  view?: string | undefined;
51
55
  readOnly?: boolean | undefined;
@@ -58,74 +62,20 @@ declare const TextFieldComponent: React.FunctionComponent<import("@salutejs/plas
58
62
  contentRight?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
59
63
  textBefore?: string | undefined;
60
64
  textAfter?: string | undefined;
61
- optional?: boolean | undefined;
62
- required?: boolean | undefined;
63
- requiredPlacement?: "right" | "left" | undefined;
64
65
  onSearch?: ((value: string, event?: React.KeyboardEvent<HTMLInputElement> | undefined) => void) | undefined;
65
66
  } & {
66
- enumerationType: "chip";
67
+ requiredPlacement?: "right" | "left" | undefined;
68
+ } & {
69
+ required: true;
70
+ optional?: false | undefined;
71
+ } & {
72
+ enumerationType: "chip"; /**
73
+ * Флаг необязательности поля
74
+ */
67
75
  onSearch?: undefined;
68
76
  chips?: import("@salutejs/plasma-new-hope/types/components/TextField/TextField.types").TextFieldPrimitiveValue[] | undefined;
69
77
  onChangeChips?: ((value: import("@salutejs/plasma-new-hope/types/components/TextField/TextField.types").TextFieldPrimitiveValue[]) => void) | undefined;
70
- } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & React.RefAttributes<HTMLInputElement>))>;
71
- declare type newHopeTextFieldProps = React.ComponentProps<typeof TextFieldComponent>;
72
- declare type TextFieldProps = TextFieldPropsOld & {
73
- /**
74
- * Флаг необязательности поля
75
- */
76
- optional?: boolean;
77
- /**
78
- * Флаг обязательности поля
79
- */
80
- required?: boolean;
81
- /**
82
- * Задает выравнивание индикатора обязательности поля
83
- * @default right
84
- */
85
- requiredPlacement?: 'left' | 'right';
86
- };
87
- export declare type CustomTextFieldProps = TextFieldProps & Pick<newHopeTextFieldProps, 'enumerationType' | 'chips' | 'onChangeChips'>;
88
- /**
89
- * Поле ввода текста.
90
- */
91
- export declare const TextField: React.ForwardRefExoticComponent<TextFieldPropsOld & {
92
- /**
93
- * Флаг необязательности поля
94
- */
95
- optional?: boolean | undefined;
96
- /**
97
- * Флаг обязательности поля
98
- */
99
- required?: boolean | undefined;
100
- /**
101
- * Задает выравнивание индикатора обязательности поля
102
- * @default right
103
- */
104
- requiredPlacement?: "right" | "left" | undefined;
105
- } & Pick<import("@salutejs/plasma-new-hope/types/engines/types").PropsType<{
106
- view: {
107
- default: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
108
- positive: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
109
- warning: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
110
- negative: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
111
- };
112
- size: {
113
- l: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
114
- m: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
115
- s: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
116
- xs: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
117
- };
118
- labelPlacement: {
119
- inner: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
120
- outer: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
121
- };
122
- disabled: {
123
- true: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
124
- };
125
- readOnly: {
126
- true: import("@salutejs/plasma-new-hope/types/engines/types").PolymorphicClassName;
127
- };
128
- }> & (({
78
+ } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "required"> & React.RefAttributes<HTMLInputElement>) | ({
129
79
  size?: string | undefined;
130
80
  view?: string | undefined;
131
81
  readOnly?: boolean | undefined;
@@ -138,16 +88,20 @@ export declare const TextField: React.ForwardRefExoticComponent<TextFieldPropsOl
138
88
  contentRight?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
139
89
  textBefore?: string | undefined;
140
90
  textAfter?: string | undefined;
141
- optional?: boolean | undefined;
142
- required?: boolean | undefined;
143
- requiredPlacement?: "right" | "left" | undefined;
144
91
  onSearch?: ((value: string, event?: React.KeyboardEvent<HTMLInputElement> | undefined) => void) | undefined;
92
+ } & {
93
+ requiredPlacement?: "right" | "left" | undefined;
94
+ } & {
95
+ optional?: true | undefined;
96
+ required?: false | undefined;
145
97
  } & {
146
98
  chips?: undefined;
147
99
  onChangeChips?: undefined;
148
100
  enumerationType?: "plain" | undefined;
149
- onSearch?: ((value: string, event?: React.KeyboardEvent<HTMLInputElement> | undefined) => void) | undefined;
150
- } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & React.RefAttributes<HTMLInputElement>) | ({
101
+ onSearch?: ((value: string, event?: React.KeyboardEvent<HTMLInputElement> | undefined) => void) | undefined; /**
102
+ * Флаг необязательности поля
103
+ */
104
+ } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "required"> & React.RefAttributes<HTMLInputElement>) | ({
151
105
  size?: string | undefined;
152
106
  view?: string | undefined;
153
107
  readOnly?: boolean | undefined;
@@ -160,14 +114,50 @@ export declare const TextField: React.ForwardRefExoticComponent<TextFieldPropsOl
160
114
  contentRight?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
161
115
  textBefore?: string | undefined;
162
116
  textAfter?: string | undefined;
163
- optional?: boolean | undefined;
164
- required?: boolean | undefined;
165
- requiredPlacement?: "right" | "left" | undefined;
166
117
  onSearch?: ((value: string, event?: React.KeyboardEvent<HTMLInputElement> | undefined) => void) | undefined;
167
118
  } & {
168
- enumerationType: "chip";
119
+ requiredPlacement?: "right" | "left" | undefined;
120
+ } & {
121
+ optional?: true | undefined;
122
+ required?: false | undefined;
123
+ } & {
124
+ enumerationType: "chip"; /**
125
+ * Флаг необязательности поля
126
+ */
169
127
  onSearch?: undefined;
170
128
  chips?: import("@salutejs/plasma-new-hope/types/components/TextField/TextField.types").TextFieldPrimitiveValue[] | undefined;
171
129
  onChangeChips?: ((value: import("@salutejs/plasma-new-hope/types/components/TextField/TextField.types").TextFieldPrimitiveValue[]) => void) | undefined;
172
- } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> & React.RefAttributes<HTMLInputElement>)), "enumerationType" | "chips" | "onChangeChips"> & React.RefAttributes<HTMLInputElement>>;
130
+ } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "required"> & React.RefAttributes<HTMLInputElement>))>;
131
+ declare type newHopeTextFieldProps = React.ComponentProps<typeof TextFieldComponent>;
132
+ declare type RequiredProps = {
133
+ /**
134
+ * Задает выравнивание индикатора обязательности поля
135
+ * @default right
136
+ */
137
+ requiredPlacement?: 'left' | 'right';
138
+ } & ({
139
+ /**
140
+ * Флаг обязательности поля
141
+ */
142
+ required: true;
143
+ /**
144
+ * Флаг необязательности поля
145
+ */
146
+ optional?: never | false;
147
+ } | {
148
+ /**
149
+ * Флаг необязательности поля
150
+ */
151
+ optional?: true;
152
+ /**
153
+ * Флаг обязательности поля
154
+ */
155
+ required?: never | false;
156
+ });
157
+ declare type TextFieldProps = TextFieldPropsOld & RequiredProps;
158
+ export declare type CustomTextFieldProps = TextFieldProps & Pick<newHopeTextFieldProps, 'enumerationType' | 'chips' | 'onChangeChips'>;
159
+ /**
160
+ * Поле ввода текста.
161
+ */
162
+ export declare const TextField: React.ForwardRefExoticComponent<CustomTextFieldProps & React.RefAttributes<HTMLInputElement>>;
173
163
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.js","sources":["../../../../src-css/components/TextField/TextField.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport type { TextFieldProps as TextFieldPropsOld } from '@salutejs/plasma-hope';\nimport { textFieldConfig, component, mergeConfig } from '@salutejs/plasma-new-hope';\n\nimport { config } from './TextField.config';\n\nconst mergedConfig = mergeConfig(textFieldConfig, config);\nconst TextFieldComponent = component(mergedConfig);\n\ntype newHopeTextFieldProps = React.ComponentProps<typeof TextFieldComponent>;\n\ntype TextFieldProps = TextFieldPropsOld & {\n /**\n * Флаг необязательности поля\n */\n optional?: boolean;\n /**\n * Флаг обязательности поля\n */\n required?: boolean;\n /**\n * Задает выравнивание индикатора обязательности поля\n * @default right\n */\n requiredPlacement?: 'left' | 'right';\n};\n\nexport type CustomTextFieldProps = TextFieldProps &\n Pick<newHopeTextFieldProps, 'enumerationType' | 'chips' | 'onChangeChips'>;\n\nconst statusToView: Record<NonNullable<TextFieldProps['status']>, NonNullable<newHopeTextFieldProps['view']>> = {\n success: 'positive',\n warning: 'warning',\n error: 'negative',\n};\nconst animatedHintToLabelPlacement: Record<\n NonNullable<TextFieldProps['animatedHint']>,\n NonNullable<newHopeTextFieldProps['labelPlacement']>\n> = {\n placeholder: 'outer',\n label: 'inner',\n};\n\n/**\n * Поле ввода текста.\n */\nexport const TextField = forwardRef<HTMLInputElement, CustomTextFieldProps>((props, ref) => {\n const {\n status,\n\n label,\n placeholder,\n animatedHint,\n helperText,\n\n enumerationType,\n chips,\n onSearch,\n onChangeChips,\n\n size = 'l',\n\n ...rest\n } = props;\n\n /** TODO: #1064 Remove In plasma-2.0 */\n /* eslint-disable no-underscore-dangle */\n const _view = status ? statusToView[status] : 'default';\n let _labelPlacement = animatedHint ? animatedHintToLabelPlacement[animatedHint] : 'outer';\n let _label = label ? String(label) : undefined;\n if (size !== 'l' && _labelPlacement === 'inner') {\n _label = undefined;\n _labelPlacement = 'outer';\n }\n if (size === 'l' && animatedHint === 'placeholder' && !label) {\n _label = placeholder;\n _labelPlacement = 'inner';\n }\n\n if (enumerationType === 'chip') {\n return (\n <TextFieldComponent\n {...rest}\n view={_view}\n labelPlacement={_labelPlacement}\n label={_label}\n size={size}\n placeholder={placeholder}\n leftHelper={helperText}\n ref={ref}\n enumerationType=\"chip\"\n chips={chips}\n onChangeChips={onChangeChips}\n />\n );\n }\n\n return (\n <TextFieldComponent\n {...rest}\n view={_view}\n labelPlacement={_labelPlacement}\n label={_label}\n size={size}\n placeholder={placeholder}\n leftHelper={helperText}\n ref={ref}\n enumerationType=\"plain\"\n onSearch={onSearch}\n />\n );\n});\n"],"names":["mergedConfig","mergeConfig","textFieldConfig","config","TextFieldComponent","component","statusToView","success","warning","error","animatedHintToLabelPlacement","placeholder","label","TextField","forwardRef","props","ref","status","animatedHint","helperText","enumerationType","chips","onSearch","onChangeChips","_props$size","size","rest","_objectWithoutProperties","_excluded","_view","_labelPlacement","_label","String","undefined","React","createElement","_extends","view","labelPlacement","leftHelper"],"mappings":";;;;;;;;;;AAMA,IAAMA,YAAY,gBAAGC,yBAAW,CAACC,6BAAe,EAAEC,uBAAM,CAAC,CAAA;AACzD,IAAMC,kBAAkB,gBAAGC,uBAAS,CAACL,YAAY,CAAC,CAAA;AAuBlD,IAAMM,YAAuG,GAAG;AAC5GC,EAAAA,OAAO,EAAE,UAAU;AACnBC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,KAAK,EAAE,UAAA;AACX,CAAC,CAAA;AACD,IAAMC,4BAGL,GAAG;AACAC,EAAAA,WAAW,EAAE,OAAO;AACpBC,EAAAA,KAAK,EAAE,OAAA;AACX,CAAC,CAAA;;AAED;AACA;AACA;AACO,IAAMC,SAAS,gBAAGC,gBAAU,CAAyC,UAACC,KAAK,EAAEC,GAAG,EAAK;AACxF,EAAA,IACIC,MAAM,GAeNF,KAAK,CAfLE,MAAM;IAENL,KAAK,GAaLG,KAAK,CAbLH,KAAK;IACLD,WAAW,GAYXI,KAAK,CAZLJ,WAAW;IACXO,YAAY,GAWZH,KAAK,CAXLG,YAAY;IACZC,UAAU,GAUVJ,KAAK,CAVLI,UAAU;IAEVC,eAAe,GAQfL,KAAK,CARLK,eAAe;IACfC,KAAK,GAOLN,KAAK,CAPLM,KAAK;IACLC,QAAQ,GAMRP,KAAK,CANLO,QAAQ;IACRC,aAAa,GAKbR,KAAK,CALLQ,aAAa;IAAAC,WAAA,GAKbT,KAAK,CAHLU,IAAI;AAAJA,IAAAA,IAAI,GAAAD,WAAA,KAAG,KAAA,CAAA,GAAA,GAAG,GAAAA,WAAA;AAEPE,IAAAA,IAAI,GAAAC,iDAAA,CACPZ,KAAK,EAAAa,SAAA,CAAA,CAAA;;AAET;AACA;EACA,IAAMC,KAAK,GAAGZ,MAAM,GAAGX,YAAY,CAACW,MAAM,CAAC,GAAG,SAAS,CAAA;EACvD,IA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,EAAEA,WAAY;AACzB4B,IAAAA,UAAU,EAAEpB,UAAW;AACvBH,IAAAA,GAAG,EAAEA,GAAI;AACTI,IAAAA,eAAe,EAAC,OAAO;AACvBE,IAAAA,QAAQ,EAAEA,QAAAA;AAAS,GAAA,CACtB,CAAC,CAAA;AAEV,CAAC;;;;"}
1
+ {"version":3,"file":"TextField.js","sources":["../../../../src-css/components/TextField/TextField.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport type { TextFieldProps as TextFieldPropsOld } from '@salutejs/plasma-hope';\nimport { textFieldConfig, component, mergeConfig } from '@salutejs/plasma-new-hope';\n\nimport { config } from './TextField.config';\n\nconst mergedConfig = mergeConfig(textFieldConfig, config);\nconst TextFieldComponent = component(mergedConfig);\n\ntype newHopeTextFieldProps = React.ComponentProps<typeof TextFieldComponent>;\n\ntype RequiredProps = {\n /**\n * Задает выравнивание индикатора обязательности поля\n * @default right\n */\n requiredPlacement?: 'left' | 'right';\n} & (\n | {\n /**\n * Флаг обязательности поля\n */\n required: true;\n /**\n * Флаг необязательности поля\n */\n optional?: never | false;\n }\n | {\n /**\n * Флаг необязательности поля\n */\n optional?: true;\n /**\n * Флаг обязательности поля\n */\n required?: never | false;\n }\n);\n\ntype TextFieldProps = TextFieldPropsOld & RequiredProps;\n\nexport type CustomTextFieldProps = TextFieldProps &\n Pick<newHopeTextFieldProps, 'enumerationType' | 'chips' | 'onChangeChips'>;\n\nconst statusToView: Record<NonNullable<TextFieldProps['status']>, NonNullable<newHopeTextFieldProps['view']>> = {\n success: 'positive',\n warning: 'warning',\n error: 'negative',\n};\nconst animatedHintToLabelPlacement: Record<\n NonNullable<TextFieldProps['animatedHint']>,\n NonNullable<newHopeTextFieldProps['labelPlacement']>\n> = {\n placeholder: 'outer',\n label: 'inner',\n};\n\n/**\n * Поле ввода текста.\n */\nexport const TextField = forwardRef<HTMLInputElement, CustomTextFieldProps>((props, ref) => {\n const {\n status,\n\n label,\n placeholder,\n animatedHint,\n helperText,\n\n enumerationType,\n chips,\n onSearch,\n onChangeChips,\n\n size = 'l',\n\n ...rest\n } = props;\n\n /** TODO: #1064 Remove In plasma-2.0 */\n /* eslint-disable no-underscore-dangle */\n const _view = status ? statusToView[status] : 'default';\n let _labelPlacement = animatedHint ? animatedHintToLabelPlacement[animatedHint] : 'outer';\n let _label = label ? String(label) : undefined;\n if (size !== 'l' && _labelPlacement === 'inner') {\n _label = undefined;\n _labelPlacement = 'outer';\n }\n if (size === 'l' && animatedHint === 'placeholder' && !label) {\n _label = placeholder;\n _labelPlacement = 'inner';\n }\n\n if (enumerationType === 'chip') {\n return (\n <TextFieldComponent\n {...rest}\n view={_view}\n labelPlacement={_labelPlacement}\n label={_label}\n size={size}\n placeholder={placeholder}\n leftHelper={helperText}\n ref={ref}\n enumerationType=\"chip\"\n chips={chips}\n onChangeChips={onChangeChips}\n />\n );\n }\n\n return (\n <TextFieldComponent\n {...rest}\n view={_view}\n labelPlacement={_labelPlacement}\n label={_label}\n size={size}\n placeholder={placeholder}\n leftHelper={helperText}\n ref={ref}\n enumerationType=\"plain\"\n onSearch={onSearch}\n />\n );\n});\n"],"names":["mergedConfig","mergeConfig","textFieldConfig","config","TextFieldComponent","component","statusToView","success","warning","error","animatedHintToLabelPlacement","placeholder","label","TextField","forwardRef","props","ref","status","animatedHint","helperText","enumerationType","chips","onSearch","onChangeChips","_props$size","size","rest","_objectWithoutProperties","_excluded","_view","_labelPlacement","_label","String","undefined","React","createElement","_extends","view","labelPlacement","leftHelper"],"mappings":";;;;;;;;;;AAMA,IAAMA,YAAY,gBAAGC,yBAAW,CAACC,6BAAe,EAAEC,uBAAM,CAAC,CAAA;AACzD,IAAMC,kBAAkB,gBAAGC,uBAAS,CAACL,YAAY,CAAC,CAAA;AAsClD,IAAMM,YAAuG,GAAG;AAC5GC,EAAAA,OAAO,EAAE,UAAU;AACnBC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,KAAK,EAAE,UAAA;AACX,CAAC,CAAA;AACD,IAA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N,KAAK,EAAE;AAC1DmB,IAAAA,MAAM,GAAGpB,WAAW,CAAA;AACpBmB,IAAAA,eAAe,GAAG,OAAO,CAAA;AAC7B,GAAA;EAEA,IAAIV,eAAe,KAAK,MAAM,EAAE;IAC5B,oBACIc,KAAA,CAAAC,aAAA,CAAC/B,kBAAkB,EAAAgC,iCAAA,KACXV,IAAI,EAAA;AACRW,MAAAA,IAAI,EAAER,KAAM;AACZS,MAAAA,cAAc,EAAER,eAAgB;AAChClB,MAAAA,KAAK,EAAEmB,MAAO;AACdN,MAAAA,IAAI,EAAEA,IAAK;AACXd,MAAAA,WAAW,EAAEA,WAAY;AACzB4B,MAAAA,UAAU,EAAEpB,UAAW;AACvBH,MAAAA,GAAG,EAAEA,GAAI;AACTI,MAAAA,eAAe,EAAC,MAAM;AACtBC,MAAAA,KAAK,EAAEA,KAAM;AACbE,MAAAA,aAAa,EAAEA,aAAAA;AAAc,KAAA,CAChC,CAAC,CAAA;AAEV,GAAA;EAEA,oBACIW,KAAA,CAAAC,aAAA,CAAC/B,kBAAkB,EAAAgC,iCAAA,KACXV,IAAI,EAAA;AACRW,IAAAA,IAAI,EAAER,KAAM;AACZS,IAAAA,cAAc,EAAER,eAAgB;AAChClB,IAAAA,KAAK,EAAEmB,MAAO;AACdN,IAAAA,IAAI,EAAEA,IAAK;AACXd,IAAAA,WAAW,EAAEA,WAAY;AACzB4B,IAAAA,UAAU,EAAEpB,UAAW;AACvBH,IAAAA,GAAG,EAAEA,GAAI;AACTI,IAAAA,eAAe,EAAC,OAAO;AACvBE,IAAAA,QAAQ,EAAEA,QAAAA;AAAS,GAAA,CACtB,CAAC,CAAA;AAEV,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.js","sources":["../../../../src-css/components/TextField/TextField.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport type { TextFieldProps as TextFieldPropsOld } from '@salutejs/plasma-hope';\nimport { textFieldConfig, component, mergeConfig } from '@salutejs/plasma-new-hope';\n\nimport { config } from './TextField.config';\n\nconst mergedConfig = mergeConfig(textFieldConfig, config);\nconst TextFieldComponent = component(mergedConfig);\n\ntype newHopeTextFieldProps = React.ComponentProps<typeof TextFieldComponent>;\n\ntype TextFieldProps = TextFieldPropsOld & {\n /**\n * Флаг необязательности поля\n */\n optional?: boolean;\n /**\n * Флаг обязательности поля\n */\n required?: boolean;\n /**\n * Задает выравнивание индикатора обязательности поля\n * @default right\n */\n requiredPlacement?: 'left' | 'right';\n};\n\nexport type CustomTextFieldProps = TextFieldProps &\n Pick<newHopeTextFieldProps, 'enumerationType' | 'chips' | 'onChangeChips'>;\n\nconst statusToView: Record<NonNullable<TextFieldProps['status']>, NonNullable<newHopeTextFieldProps['view']>> = {\n success: 'positive',\n warning: 'warning',\n error: 'negative',\n};\nconst animatedHintToLabelPlacement: Record<\n NonNullable<TextFieldProps['animatedHint']>,\n NonNullable<newHopeTextFieldProps['labelPlacement']>\n> = {\n placeholder: 'outer',\n label: 'inner',\n};\n\n/**\n * Поле ввода текста.\n */\nexport const TextField = forwardRef<HTMLInputElement, CustomTextFieldProps>((props, ref) => {\n const {\n status,\n\n label,\n placeholder,\n animatedHint,\n helperText,\n\n enumerationType,\n chips,\n onSearch,\n onChangeChips,\n\n size = 'l',\n\n ...rest\n } = props;\n\n /** TODO: #1064 Remove In plasma-2.0 */\n /* eslint-disable no-underscore-dangle */\n const _view = status ? statusToView[status] : 'default';\n let _labelPlacement = animatedHint ? animatedHintToLabelPlacement[animatedHint] : 'outer';\n let _label = label ? String(label) : undefined;\n if (size !== 'l' && _labelPlacement === 'inner') {\n _label = undefined;\n _labelPlacement = 'outer';\n }\n if (size === 'l' && animatedHint === 'placeholder' && !label) {\n _label = placeholder;\n _labelPlacement = 'inner';\n }\n\n if (enumerationType === 'chip') {\n return (\n <TextFieldComponent\n {...rest}\n view={_view}\n labelPlacement={_labelPlacement}\n label={_label}\n size={size}\n placeholder={placeholder}\n leftHelper={helperText}\n ref={ref}\n enumerationType=\"chip\"\n chips={chips}\n onChangeChips={onChangeChips}\n />\n );\n }\n\n return (\n <TextFieldComponent\n {...rest}\n view={_view}\n labelPlacement={_labelPlacement}\n label={_label}\n size={size}\n placeholder={placeholder}\n leftHelper={helperText}\n ref={ref}\n enumerationType=\"plain\"\n onSearch={onSearch}\n />\n );\n});\n"],"names":["mergedConfig","mergeConfig","textFieldConfig","config","TextFieldComponent","component","statusToView","success","warning","error","animatedHintToLabelPlacement","placeholder","label","TextField","forwardRef","props","ref","status","animatedHint","helperText","enumerationType","chips","onSearch","onChangeChips","_props$size","size","rest","_objectWithoutProperties","_excluded","_view","_labelPlacement","_label","String","undefined","React","createElement","_extends","view","labelPlacement","leftHelper"],"mappings":";;;;;;AAMA,IAAMA,YAAY,gBAAGC,WAAW,CAACC,eAAe,EAAEC,MAAM,CAAC,CAAA;AACzD,IAAMC,kBAAkB,gBAAGC,SAAS,CAACL,YAAY,CAAC,CAAA;AAuBlD,IAAMM,YAAuG,GAAG;AAC5GC,EAAAA,OAAO,EAAE,UAAU;AACnBC,EAAAA,OAAO,EAAE,SAAS;AAClBC,EAAAA,KAAK,EAAE,UAAA;AACX,CAAC,CAAA;AACD,IAAMC,4BAGL,GAAG;AACAC,EAAAA,WAAW,EAAE,OAAO;AACpBC,EAAAA,KAAK,EAAE,OAAA;AACX,CAAC,CAAA;;AAED;AACA;AACA;AACO,IAAMC,SAAS,gBAAGC,UAAU,CAAyC,UAACC,KAAK,EAAEC,GAAG,EAAK;AACxF,EAAA,IACIC,MAAM,GAeNF,KAAK,CAfLE,MAAM;IAENL,KAAK,GAaLG,KAAK,CAbLH,KAAK;IACLD,WAAW,GAYXI,KAAK,CAZLJ,WAAW;IACXO,YAAY,GAWZH,KAAK,CAXLG,YAAY;IACZC,UAAU,GAUVJ,KAAK,CAVLI,UAAU;IAEVC,eAAe,GAQfL,KAAK,CARLK,eAAe;IACfC,KAAK,GAOLN,KAAK,CAPLM,KAAK;IACLC,QAAQ,GAMRP,KAAK,CANLO,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,MAAAA,KAAK,EAAEA,KAAM;AACbE,MAAAA,aAAa,EAAEA,aAAAA;AAAc,KAAA,CAChC,CAAC,CAAA;AAEV,GAAA;EAEA,oBACIW,KAAA,CAAAC,aAAA,CAAC/B,kBAAkB,EAAAgC,QAAA,KACXV,IAAI,EAAA;AACRW,IAAAA,IAAI,EAAER,KAAM;AACZS,IAAAA,cAAc,EAAER,eAAgB;AAChClB,IAAAA,KAAK,EAAEmB,MAAO;AACdN,IAAAA,IAAI,EAAEA,IAAK;AACXd,IAAAA,WAAW,EAAEA,WAAY;AACzB4B,IAAAA,UAAU,EAAEpB,UAAW;AACvBH,IAAAA,GAAG,EAAEA,GAAI;AACTI,IAAAA,eAAe,EAAC,OAAO;AACvBE,IAAAA,QAAQ,EAAEA,QAAAA;AAAS,GAAA,CACtB,CAAC,CAAA;AAEV,CAAC;;;;"}
1
+ {"version":3,"file":"TextField.js","sources":["../../../../src-css/components/TextField/TextField.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport type { TextFieldProps as TextFieldPropsOld } from '@salutejs/plasma-hope';\nimport { textFieldConfig, component, mergeConfig } from '@salutejs/plasma-new-hope';\n\nimport { config } from './TextField.config';\n\nconst mergedConfig = mergeConfig(textFieldConfig, config);\nconst TextFieldComponent = component(mergedConfig);\n\ntype newHopeTextFieldProps = React.ComponentProps<typeof TextFieldComponent>;\n\ntype RequiredProps = {\n /**\n * Задает выравнивание индикатора обязательности поля\n * @default right\n */\n requiredPlacement?: 'left' | 'right';\n} & (\n | {\n /**\n * Флаг обязательности поля\n */\n required: true;\n /**\n * Флаг необязательности поля\n */\n optional?: never | false;\n }\n | {\n /**\n * Флаг необязательности поля\n */\n optional?: true;\n /**\n * Флаг обязательности поля\n */\n required?: never | false;\n }\n);\n\ntype TextFieldProps = TextFieldPropsOld & RequiredProps;\n\nexport type CustomTextFieldProps = TextFieldProps &\n Pick<newHopeTextFieldProps, 'enumerationType' | 'chips' | 'onChangeChips'>;\n\nconst statusToView: Record<NonNullable<TextFieldProps['status']>, NonNullable<newHopeTextFieldProps['view']>> = {\n success: 'positive',\n warning: 'warning',\n error: 'negative',\n};\nconst animatedHintToLabelPlacement: Record<\n NonNullable<TextFieldProps['animatedHint']>,\n NonNullable<newHopeTextFieldProps['labelPlacement']>\n> = {\n placeholder: 'outer',\n label: 'inner',\n};\n\n/**\n * Поле ввода текста.\n */\nexport const TextField = forwardRef<HTMLInputElement, CustomTextFieldProps>((props, ref) => {\n const {\n status,\n\n label,\n placeholder,\n animatedHint,\n helperText,\n\n enumerationType,\n chips,\n onSearch,\n onChangeChips,\n\n size = 'l',\n\n ...rest\n } = props;\n\n /** TODO: #1064 Remove In plasma-2.0 */\n /* eslint-disable no-underscore-dangle */\n const _view = status ? statusToView[status] : 'default';\n let _labelPlacement = animatedHint ? animatedHintToLabelPlacement[animatedHint] : 'outer';\n let _label = label ? String(label) : undefined;\n if (size !== 'l' && _labelPlacement === 'inner') {\n _label = undefined;\n _labelPlacement = 'outer';\n }\n if (size === 'l' && animatedHint === 'placeholder' && !label) {\n _label = placeholder;\n _labelPlacement = 'inner';\n }\n\n if (enumerationType === 'chip') {\n return (\n <TextFieldComponent\n {...rest}\n view={_view}\n labelPlacement={_labelPlacement}\n label={_label}\n size={size}\n placeholder={placeholder}\n leftHelper={helperText}\n ref={ref}\n enumerationType=\"chip\"\n chips={chips}\n onChangeChips={onChangeChips}\n />\n );\n }\n\n return (\n <TextFieldComponent\n {...rest}\n view={_view}\n labelPlacement={_labelPlacement}\n label={_label}\n size={size}\n placeholder={placeholder}\n leftHelper={helperText}\n ref={ref}\n enumerationType=\"plain\"\n onSearch={onSearch}\n />\n );\n});\n"],"names":["mergedConfig","mergeConfig","textFieldConfig","config","TextFieldComponent","component","statusToView","success","warning","error","animatedHintToLabelPlacement","placeholder","label","TextField","forwardRef","props","ref","status","animatedHint","helperText","enumerationType","chips","onSearch","onChangeChips","_props$size","size","rest","_objectWithoutProperties","_excluded","_view","_labelPlacement","_label","String","undefined","React","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AAEA,GAAI;AACTI,IAAAA,eAAe,EAAC,OAAO;AACvBE,IAAAA,QAAQ,EAAEA,QAAAA;AAAS,GAAA,CACtB,CAAC,CAAA;AAEV,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salutejs/plasma-web",
3
- "version": "1.390.0-canary.1352.10686935940.0",
3
+ "version": "1.390.0-canary.1352.10698100498.0",
4
4
  "description": "Salute Design System / React UI kit for web applications",
5
5
  "author": "Salute Frontend Team <salute.developers@gmail.com>",
6
6
  "license": "MIT",
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@salutejs/plasma-core": "1.178.0-dev.0",
23
23
  "@salutejs/plasma-hope": "1.309.0-dev.0",
24
- "@salutejs/plasma-new-hope": "0.139.0-canary.1352.10686935940.0",
24
+ "@salutejs/plasma-new-hope": "0.139.0-canary.1352.10698100498.0",
25
25
  "@salutejs/plasma-themes": "0.17.0-dev.0",
26
26
  "@salutejs/plasma-tokens-b2b": "1.42.0-dev.0",
27
27
  "@salutejs/plasma-tokens-b2c": "0.52.0-dev.0",
@@ -112,5 +112,5 @@
112
112
  "Fanil Zubairov"
113
113
  ],
114
114
  "sideEffects": false,
115
- "gitHead": "a3d263e482ffe8f965c31330c1f46ac204ab386a"
115
+ "gitHead": "3f117bc8e7a5ef2d901e83d5e5e8f33950328392"
116
116
  }
@@ -275,7 +275,7 @@ import { TextareaResize } from '@salutejs/plasma-core';
275
275
  import { TextFieldGroupProps } from '@salutejs/plasma-new-hope/styled-components';
276
276
  import { TextFieldPrimitiveValue } from '@salutejs/plasma-new-hope/types/components/TextField/TextField.types';
277
277
  import { TextfieldPrimitiveValue } from '@salutejs/plasma-new-hope/types/components/Range/Range.types';
278
- import type { TextFieldProps as TextFieldProps_2 } from '@salutejs/plasma-hope';
278
+ import type { TextFieldProps as TextFieldProps_3 } from '@salutejs/plasma-hope';
279
279
  import { TextFieldPropsBase } from '@salutejs/plasma-new-hope/types/components/TextField/TextField.types';
280
280
  import { TextFieldView } from '@salutejs/plasma-hope';
281
281
  import { TextSkeletonBaseProps } from '@salutejs/plasma-new-hope/types/components/Skeleton/TextSkeleton/TextSkeleton.types';
@@ -417,7 +417,7 @@ true: PolymorphicClassName;
417
417
  readOnly: {
418
418
  true: PolymorphicClassName;
419
419
  };
420
- }> & BaseProps & Omit<TextFieldPropsBase, "enumerationType" | "chips" | "onChangeChips"> & Omit<InputHTMLAttributes_3<HTMLInputElement>, "size"> & RefAttributes<HTMLInputElement>>;
420
+ }> & BaseProps & Omit<TextFieldPropsBase, "required" | "requiredPlacement" | "optional" | "enumerationType" | "chips" | "onChangeChips"> & Omit<InputHTMLAttributes_3<HTMLInputElement>, "size" | "required"> & RefAttributes<HTMLInputElement>>;
421
421
 
422
422
  // @public (undocumented)
423
423
  export const Avatar: FunctionComponent<PropsType< {
@@ -2356,90 +2356,17 @@ export const TextArea: ForwardRefExoticComponent<TextAreaProps & RefAttributes<H
2356
2356
 
2357
2357
  export { TextareaHTMLAttributes }
2358
2358
 
2359
+ // Warning: (ae-forgotten-export) The symbol "RequiredProps" needs to be exported by the entry point index.d.ts
2360
+ //
2359
2361
  // @public (undocumented)
2360
- export interface TextAreaProps extends TextAreaProps_2 {
2361
- optional?: boolean;
2362
- required?: boolean;
2363
- requiredPlacement?: 'left' | 'right';
2364
- // @deprecated (undocumented)
2362
+ export type TextAreaProps = TextAreaProps_2 & {
2365
2363
  resize?: 'none' | 'both' | 'horizontal' | 'vertical';
2366
- }
2364
+ } & RequiredProps;
2367
2365
 
2368
2366
  export { TextareaResize }
2369
2367
 
2370
2368
  // @public
2371
- export const TextField: React_2.ForwardRefExoticComponent<TextFieldProps_2 & {
2372
- optional?: boolean | undefined;
2373
- required?: boolean | undefined;
2374
- requiredPlacement?: "right" | "left" | undefined;
2375
- } & Pick<PropsType< {
2376
- view: {
2377
- default: PolymorphicClassName;
2378
- positive: PolymorphicClassName;
2379
- warning: PolymorphicClassName;
2380
- negative: PolymorphicClassName;
2381
- };
2382
- size: {
2383
- l: PolymorphicClassName;
2384
- m: PolymorphicClassName;
2385
- s: PolymorphicClassName;
2386
- xs: PolymorphicClassName;
2387
- };
2388
- labelPlacement: {
2389
- inner: PolymorphicClassName;
2390
- outer: PolymorphicClassName;
2391
- };
2392
- disabled: {
2393
- true: PolymorphicClassName;
2394
- };
2395
- readOnly: {
2396
- true: PolymorphicClassName;
2397
- };
2398
- }> & (({
2399
- size?: string | undefined;
2400
- view?: string | undefined;
2401
- readOnly?: boolean | undefined;
2402
- disabled?: boolean | undefined;
2403
- } & {
2404
- label?: string | undefined;
2405
- labelPlacement?: "outer" | "inner" | undefined;
2406
- leftHelper?: string | undefined;
2407
- contentLeft?: React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | undefined;
2408
- contentRight?: React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | undefined;
2409
- textBefore?: string | undefined;
2410
- textAfter?: string | undefined;
2411
- optional?: boolean | undefined;
2412
- required?: boolean | undefined;
2413
- requiredPlacement?: "right" | "left" | undefined;
2414
- onSearch?: ((value: string, event?: React_2.KeyboardEvent<HTMLInputElement> | undefined) => void) | undefined;
2415
- } & {
2416
- chips?: undefined;
2417
- onChangeChips?: undefined;
2418
- enumerationType?: "plain" | undefined;
2419
- onSearch?: ((value: string, event?: React_2.KeyboardEvent<HTMLInputElement> | undefined) => void) | undefined;
2420
- } & Omit<React_2.InputHTMLAttributes<HTMLInputElement>, "size"> & React_2.RefAttributes<HTMLInputElement>) | ({
2421
- size?: string | undefined;
2422
- view?: string | undefined;
2423
- readOnly?: boolean | undefined;
2424
- disabled?: boolean | undefined;
2425
- } & {
2426
- label?: string | undefined;
2427
- labelPlacement?: "outer" | "inner" | undefined;
2428
- leftHelper?: string | undefined;
2429
- contentLeft?: React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | undefined;
2430
- contentRight?: React_2.ReactElement<any, string | React_2.JSXElementConstructor<any>> | undefined;
2431
- textBefore?: string | undefined;
2432
- textAfter?: string | undefined;
2433
- optional?: boolean | undefined;
2434
- required?: boolean | undefined;
2435
- requiredPlacement?: "right" | "left" | undefined;
2436
- onSearch?: ((value: string, event?: React_2.KeyboardEvent<HTMLInputElement> | undefined) => void) | undefined;
2437
- } & {
2438
- enumerationType: "chip";
2439
- onSearch?: undefined;
2440
- chips?: TextFieldPrimitiveValue[] | undefined;
2441
- onChangeChips?: ((value: TextFieldPrimitiveValue[]) => void) | undefined;
2442
- } & Omit<React_2.InputHTMLAttributes<HTMLInputElement>, "size"> & React_2.RefAttributes<HTMLInputElement>)), "enumerationType" | "chips" | "onChangeChips"> & React_2.RefAttributes<HTMLInputElement>>;
2369
+ export const TextField: React_2.ForwardRefExoticComponent<TextFieldProps & React_2.RefAttributes<HTMLInputElement>>;
2443
2370
 
2444
2371
  // @public
2445
2372
  export const TextFieldGroup: FunctionComponent<PropsType< {
@@ -2486,11 +2413,11 @@ shape?: "default" | undefined;
2486
2413
 
2487
2414
  export { TextFieldGroupProps }
2488
2415
 
2489
- // Warning: (ae-forgotten-export) The symbol "TextFieldProps_3" needs to be exported by the entry point index.d.ts
2416
+ // Warning: (ae-forgotten-export) The symbol "TextFieldProps_2" needs to be exported by the entry point index.d.ts
2490
2417
  // Warning: (ae-forgotten-export) The symbol "newHopeTextFieldProps" needs to be exported by the entry point index.d.ts
2491
2418
  //
2492
2419
  // @public (undocumented)
2493
- export type TextFieldProps = TextFieldProps_3 & Pick<newHopeTextFieldProps, 'enumerationType' | 'chips' | 'onChangeChips'>;
2420
+ export type TextFieldProps = TextFieldProps_2 & Pick<newHopeTextFieldProps, 'enumerationType' | 'chips' | 'onChangeChips'>;
2494
2421
 
2495
2422
  export { TextFieldView }
2496
2423