@salutejs/plasma-new-hope 0.71.2-dev.0 → 0.72.0-canary.1160.8612911363.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Cell/Cell.js +0 -2
- package/cjs/components/Cell/Cell.js.map +1 -1
- package/cjs/components/TextField/TextField.js +166 -40
- package/cjs/components/TextField/TextField.js.map +1 -1
- package/cjs/components/TextField/TextField.styles.js +27 -11
- package/cjs/components/TextField/TextField.styles.js.map +1 -1
- package/cjs/components/TextField/TextField.styles_1b1mddp.css +8 -0
- package/cjs/components/TextField/TextField.tokens.js +68 -20
- package/cjs/components/TextField/TextField.tokens.js.map +1 -1
- package/cjs/components/TextField/TextField_wctd2m.css +1 -0
- package/cjs/components/TextField/hooks/useKeyNavigation.js +131 -0
- package/cjs/components/TextField/hooks/useKeyNavigation.js.map +1 -0
- package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.css +19 -0
- package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js +38 -0
- package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js.map +1 -0
- package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +26 -0
- package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js.map +1 -0
- package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles_1y8n7la.css +1 -0
- package/cjs/components/TextField/{_disabled → variations/_disabled}/base.js +2 -2
- package/cjs/components/TextField/variations/_disabled/base.js.map +1 -0
- package/cjs/components/TextField/variations/_disabled/base_1tnjoy9.css +1 -0
- package/cjs/components/TextField/{_label-placement → variations/_label-placement}/base.js +1 -1
- package/cjs/components/TextField/variations/_label-placement/base.js.map +1 -0
- package/cjs/components/TextField/{_label-placement → variations/_label-placement}/inner.js +2 -2
- package/cjs/components/TextField/variations/_label-placement/inner.js.map +1 -0
- package/cjs/components/TextField/variations/_label-placement/inner_gqlcj2.css +1 -0
- package/cjs/components/TextField/{_label-placement → variations/_label-placement}/outer.js +2 -2
- package/cjs/components/TextField/variations/_label-placement/outer.js.map +1 -0
- package/cjs/components/TextField/variations/_label-placement/outer_is41nj.css +1 -0
- package/cjs/components/TextField/{_view → variations/_read-only}/base.js +2 -2
- package/cjs/components/TextField/variations/_read-only/base.js.map +1 -0
- package/cjs/components/TextField/variations/_read-only/base_134hshp.css +1 -0
- package/cjs/components/TextField/variations/_size/base.js +9 -0
- package/cjs/components/TextField/variations/_size/base.js.map +1 -0
- package/cjs/components/TextField/variations/_size/base_1khzr9t.css +1 -0
- package/cjs/components/TextField/{_size → variations/_view}/base.js +2 -2
- package/cjs/components/TextField/variations/_view/base.js.map +1 -0
- package/cjs/components/TextField/variations/_view/base_1qd77x6.css +1 -0
- package/cjs/index.css +16 -9
- package/cjs/index.js +2 -2
- package/es/components/Cell/Cell.js +0 -2
- package/es/components/Cell/Cell.js.map +1 -1
- package/es/components/TextField/TextField.js +169 -44
- package/es/components/TextField/TextField.js.map +1 -1
- package/es/components/TextField/TextField.styles.js +25 -12
- package/es/components/TextField/TextField.styles.js.map +1 -1
- package/es/components/TextField/TextField.styles_1b1mddp.css +8 -0
- package/es/components/TextField/TextField.tokens.js +68 -21
- package/es/components/TextField/TextField.tokens.js.map +1 -1
- package/es/components/TextField/TextField_wctd2m.css +1 -0
- package/es/components/TextField/hooks/useKeyNavigation.js +126 -0
- package/es/components/TextField/hooks/useKeyNavigation.js.map +1 -0
- package/es/components/TextField/ui/TextFieldChip/TextFieldChip.css +19 -0
- package/es/components/TextField/ui/TextFieldChip/TextFieldChip.js +34 -0
- package/es/components/TextField/ui/TextFieldChip/TextFieldChip.js.map +1 -0
- package/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +22 -0
- package/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js.map +1 -0
- package/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles_1y8n7la.css +1 -0
- package/es/components/TextField/variations/_disabled/base.js +5 -0
- package/es/components/TextField/variations/_disabled/base.js.map +1 -0
- package/es/components/TextField/variations/_disabled/base_1tnjoy9.css +1 -0
- package/es/components/TextField/{_label-placement → variations/_label-placement}/base.js +1 -1
- package/es/components/TextField/variations/_label-placement/base.js.map +1 -0
- package/es/components/TextField/variations/_label-placement/inner.js +5 -0
- package/es/components/TextField/variations/_label-placement/inner.js.map +1 -0
- package/es/components/TextField/variations/_label-placement/inner_gqlcj2.css +1 -0
- package/es/components/TextField/variations/_label-placement/outer.js +5 -0
- package/es/components/TextField/variations/_label-placement/outer.js.map +1 -0
- package/es/components/TextField/variations/_label-placement/outer_is41nj.css +1 -0
- package/es/components/TextField/variations/_read-only/base.js +5 -0
- package/es/components/TextField/variations/_read-only/base.js.map +1 -0
- package/es/components/TextField/variations/_read-only/base_134hshp.css +1 -0
- package/es/components/TextField/variations/_size/base.js +5 -0
- package/es/components/TextField/variations/_size/base.js.map +1 -0
- package/es/components/TextField/variations/_size/base_1khzr9t.css +1 -0
- package/es/components/TextField/{_disabled → variations/_view}/base.js +2 -2
- package/es/components/TextField/variations/_view/base.js.map +1 -0
- package/es/components/TextField/variations/_view/base_1qd77x6.css +1 -0
- package/es/index.css +16 -9
- package/es/index.js +2 -2
- package/package.json +2 -2
- package/styled-components/cjs/components/Cell/Cell.js +0 -2
- package/styled-components/cjs/components/TextField/TextField.js +173 -43
- package/styled-components/cjs/components/TextField/TextField.styles.js +18 -10
- package/styled-components/cjs/components/TextField/TextField.template-doc.mdx +24 -0
- package/styled-components/cjs/components/TextField/TextField.tokens.js +68 -21
- package/styled-components/cjs/components/TextField/hooks/index.js +12 -0
- package/styled-components/cjs/components/TextField/hooks/useKeyNavigation.js +137 -0
- package/styled-components/cjs/components/TextField/index.js +2 -2
- package/styled-components/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js +39 -0
- package/styled-components/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +25 -0
- package/styled-components/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.types.js +5 -0
- package/styled-components/cjs/components/TextField/ui/index.js +12 -0
- package/styled-components/cjs/components/TextField/variations/_disabled/base.js +10 -0
- package/styled-components/cjs/components/TextField/variations/_label-placement/inner.js +10 -0
- package/styled-components/cjs/components/TextField/{_label-placement → variations/_label-placement}/outer.js +3 -3
- package/styled-components/cjs/components/TextField/variations/_read-only/base.js +10 -0
- package/styled-components/cjs/components/TextField/variations/_read-only/tokens.json +1 -0
- package/styled-components/cjs/components/TextField/variations/_size/base.js +10 -0
- package/styled-components/cjs/components/TextField/variations/_view/base.js +10 -0
- package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.config.js +43 -0
- package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.js +11 -0
- package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +133 -0
- package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.config.js +40 -0
- package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.js +11 -0
- package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +133 -0
- package/styled-components/cjs/examples/sds_engineer/components/TextField/TextField.config.js +43 -0
- package/styled-components/cjs/examples/sds_engineer/components/TextField/TextField.js +11 -0
- package/styled-components/cjs/examples/sds_engineer/components/TextField/TextField.stories.tsx +133 -0
- package/styled-components/es/components/Cell/Cell.js +0 -2
- package/styled-components/es/components/TextField/TextField.js +177 -47
- package/styled-components/es/components/TextField/TextField.styles.js +17 -9
- package/styled-components/es/components/TextField/TextField.template-doc.mdx +24 -0
- package/styled-components/es/components/TextField/TextField.tokens.js +67 -20
- package/styled-components/es/components/TextField/hooks/index.js +1 -0
- package/styled-components/es/components/TextField/hooks/useKeyNavigation.js +131 -0
- package/styled-components/es/components/TextField/index.js +2 -2
- package/styled-components/es/components/TextField/ui/TextFieldChip/TextFieldChip.js +30 -0
- package/styled-components/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +19 -0
- package/styled-components/es/components/TextField/ui/TextFieldChip/TextFieldChip.types.js +1 -0
- package/styled-components/es/components/TextField/ui/index.js +1 -0
- package/styled-components/es/components/TextField/variations/_disabled/base.js +4 -0
- package/styled-components/es/components/TextField/variations/_label-placement/inner.js +4 -0
- package/styled-components/es/components/TextField/variations/_label-placement/outer.js +4 -0
- package/styled-components/es/components/TextField/variations/_read-only/base.js +4 -0
- package/styled-components/es/components/TextField/variations/_read-only/tokens.json +1 -0
- package/styled-components/es/components/TextField/variations/_size/base.js +4 -0
- package/styled-components/es/components/TextField/variations/_view/base.js +4 -0
- package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.config.js +37 -0
- package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.js +5 -0
- package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +133 -0
- package/styled-components/es/examples/plasma_web/components/TextField/TextField.config.js +34 -0
- package/styled-components/es/examples/plasma_web/components/TextField/TextField.js +5 -0
- package/styled-components/es/examples/plasma_web/components/TextField/TextField.stories.tsx +133 -0
- package/styled-components/es/examples/sds_engineer/components/TextField/TextField.config.js +37 -0
- package/styled-components/es/examples/sds_engineer/components/TextField/TextField.js +5 -0
- package/styled-components/es/examples/sds_engineer/components/TextField/TextField.stories.tsx +133 -0
- package/types/components/Cell/Cell.d.ts.map +1 -1
- package/types/components/TextField/TextField.d.ts +8 -3
- package/types/components/TextField/TextField.d.ts.map +1 -1
- package/types/components/TextField/TextField.styles.d.ts +6 -3
- package/types/components/TextField/TextField.styles.d.ts.map +1 -1
- package/types/components/TextField/TextField.tokens.d.ts +57 -8
- package/types/components/TextField/TextField.tokens.d.ts.map +1 -1
- package/types/components/TextField/TextField.types.d.ts +45 -3
- package/types/components/TextField/TextField.types.d.ts.map +1 -1
- package/types/components/TextField/hooks/index.d.ts +2 -0
- package/types/components/TextField/hooks/index.d.ts.map +1 -0
- package/types/components/TextField/hooks/useKeyNavigation.d.ts +17 -0
- package/types/components/TextField/hooks/useKeyNavigation.d.ts.map +1 -0
- package/types/components/TextField/index.d.ts +3 -2
- package/types/components/TextField/index.d.ts.map +1 -1
- package/types/components/TextField/ui/TextFieldChip/TextFieldChip.d.ts +7 -0
- package/types/components/TextField/ui/TextFieldChip/TextFieldChip.d.ts.map +1 -0
- package/types/components/TextField/ui/TextFieldChip/TextFieldChip.styles.d.ts +3 -0
- package/types/components/TextField/ui/TextFieldChip/TextFieldChip.styles.d.ts.map +1 -0
- package/types/components/TextField/ui/TextFieldChip/TextFieldChip.types.d.ts +37 -0
- package/types/components/TextField/ui/TextFieldChip/TextFieldChip.types.d.ts.map +1 -0
- package/types/components/TextField/ui/index.d.ts +2 -0
- package/types/components/TextField/ui/index.d.ts.map +1 -0
- package/types/components/TextField/variations/_disabled/base.d.ts.map +1 -0
- package/types/components/TextField/variations/_label-placement/base.d.ts.map +1 -0
- package/types/components/TextField/variations/_label-placement/index.d.ts.map +1 -0
- package/types/components/TextField/variations/_label-placement/inner.d.ts.map +1 -0
- package/types/components/TextField/variations/_label-placement/outer.d.ts.map +1 -0
- package/types/components/TextField/variations/_read-only/base.d.ts.map +1 -0
- package/types/components/TextField/variations/_size/base.d.ts.map +1 -0
- package/types/components/TextField/variations/_view/base.d.ts +2 -0
- package/types/components/TextField/variations/_view/base.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/TextField/TextField.config.d.ts +32 -0
- package/types/examples/plasma_b2c/components/TextField/TextField.config.d.ts.map +1 -0
- package/types/examples/plasma_b2c/components/TextField/TextField.d.ts +26 -0
- package/types/examples/plasma_b2c/components/TextField/TextField.d.ts.map +1 -0
- package/types/examples/plasma_web/components/TextField/TextField.config.d.ts +32 -0
- package/types/examples/plasma_web/components/TextField/TextField.config.d.ts.map +1 -0
- package/types/examples/plasma_web/components/TextField/TextField.d.ts +26 -0
- package/types/examples/plasma_web/components/TextField/TextField.d.ts.map +1 -0
- package/types/examples/sds_engineer/components/TextField/TextField.config.d.ts +32 -0
- package/types/examples/sds_engineer/components/TextField/TextField.config.d.ts.map +1 -0
- package/types/examples/sds_engineer/components/TextField/TextField.d.ts +26 -0
- package/types/examples/sds_engineer/components/TextField/TextField.d.ts.map +1 -0
- package/cjs/components/TextField/TextField.styles_2qw1n8.css +0 -5
- package/cjs/components/TextField/TextField_1lzb2r1.css +0 -1
- package/cjs/components/TextField/_disabled/base.js.map +0 -1
- package/cjs/components/TextField/_disabled/base_so3w81.css +0 -1
- package/cjs/components/TextField/_label-placement/base.js.map +0 -1
- package/cjs/components/TextField/_label-placement/inner.js.map +0 -1
- package/cjs/components/TextField/_label-placement/inner_1tyuicp.css +0 -1
- package/cjs/components/TextField/_label-placement/outer.js.map +0 -1
- package/cjs/components/TextField/_label-placement/outer_19ekaek.css +0 -1
- package/cjs/components/TextField/_size/base.js.map +0 -1
- package/cjs/components/TextField/_size/base_b5smyu.css +0 -1
- package/cjs/components/TextField/_view/base.js.map +0 -1
- package/cjs/components/TextField/_view/base_5bqzed.css +0 -1
- package/es/components/TextField/TextField.styles_2qw1n8.css +0 -5
- package/es/components/TextField/TextField_1lzb2r1.css +0 -1
- package/es/components/TextField/_disabled/base.js.map +0 -1
- package/es/components/TextField/_disabled/base_so3w81.css +0 -1
- package/es/components/TextField/_label-placement/base.js.map +0 -1
- package/es/components/TextField/_label-placement/inner.js +0 -5
- package/es/components/TextField/_label-placement/inner.js.map +0 -1
- package/es/components/TextField/_label-placement/inner_1tyuicp.css +0 -1
- package/es/components/TextField/_label-placement/outer.js +0 -5
- package/es/components/TextField/_label-placement/outer.js.map +0 -1
- package/es/components/TextField/_label-placement/outer_19ekaek.css +0 -1
- package/es/components/TextField/_size/base.js +0 -5
- package/es/components/TextField/_size/base.js.map +0 -1
- package/es/components/TextField/_size/base_b5smyu.css +0 -1
- package/es/components/TextField/_view/base.js +0 -5
- package/es/components/TextField/_view/base.js.map +0 -1
- package/es/components/TextField/_view/base_5bqzed.css +0 -1
- package/styled-components/cjs/components/TextField/_disabled/base.js +0 -9
- package/styled-components/cjs/components/TextField/_label-placement/inner.js +0 -10
- package/styled-components/cjs/components/TextField/_size/base.js +0 -10
- package/styled-components/cjs/components/TextField/_view/base.js +0 -10
- package/styled-components/es/components/TextField/_disabled/base.js +0 -3
- package/styled-components/es/components/TextField/_label-placement/inner.js +0 -4
- package/styled-components/es/components/TextField/_label-placement/outer.js +0 -4
- package/styled-components/es/components/TextField/_size/base.js +0 -4
- package/styled-components/es/components/TextField/_view/base.js +0 -4
- package/types/components/TextField/_disabled/base.d.ts.map +0 -1
- package/types/components/TextField/_label-placement/base.d.ts.map +0 -1
- package/types/components/TextField/_label-placement/index.d.ts.map +0 -1
- package/types/components/TextField/_label-placement/inner.d.ts.map +0 -1
- package/types/components/TextField/_label-placement/outer.d.ts.map +0 -1
- package/types/components/TextField/_size/base.d.ts.map +0 -1
- package/types/components/TextField/_view/base.d.ts.map +0 -1
- /package/cjs/components/TextField/{_label-placement → variations/_label-placement}/base_x642ct.css +0 -0
- /package/es/components/TextField/{_label-placement → variations/_label-placement}/base_x642ct.css +0 -0
- /package/styled-components/cjs/components/TextField/{_disabled → variations/_disabled}/tokens.json +0 -0
- /package/styled-components/cjs/components/TextField/{_label-placement → variations/_label-placement}/base.js +0 -0
- /package/styled-components/cjs/components/TextField/{_label-placement → variations/_label-placement}/index.js +0 -0
- /package/styled-components/cjs/components/TextField/{_size → variations/_size}/tokens.json +0 -0
- /package/styled-components/cjs/components/TextField/{_view → variations/_view}/tokens.json +0 -0
- /package/styled-components/es/components/TextField/{_disabled → variations/_disabled}/tokens.json +0 -0
- /package/styled-components/es/components/TextField/{_label-placement → variations/_label-placement}/base.js +0 -0
- /package/styled-components/es/components/TextField/{_label-placement → variations/_label-placement}/index.js +0 -0
- /package/styled-components/es/components/TextField/{_size → variations/_size}/tokens.json +0 -0
- /package/styled-components/es/components/TextField/{_view → variations/_view}/tokens.json +0 -0
- /package/types/components/TextField/{_disabled → variations/_disabled}/base.d.ts +0 -0
- /package/types/components/TextField/{_label-placement → variations/_label-placement}/base.d.ts +0 -0
- /package/types/components/TextField/{_label-placement → variations/_label-placement}/index.d.ts +0 -0
- /package/types/components/TextField/{_label-placement → variations/_label-placement}/inner.d.ts +0 -0
- /package/types/components/TextField/{_label-placement → variations/_label-placement}/outer.d.ts +0 -0
- /package/types/components/TextField/{_size → variations/_read-only}/base.d.ts +0 -0
- /package/types/components/TextField/{_view → variations/_size}/base.d.ts +0 -0
@@ -0,0 +1,133 @@
|
|
1
|
+
import React, { ComponentProps, useState } from 'react';
|
2
|
+
import type { StoryObj, Meta } from '@storybook/react';
|
3
|
+
import { action } from '@storybook/addon-actions';
|
4
|
+
import { IconPlaceholder } from '@salutejs/plasma-sb-utils';
|
5
|
+
|
6
|
+
import { WithTheme } from '../../../_helpers';
|
7
|
+
|
8
|
+
import { TextField } from './TextField';
|
9
|
+
|
10
|
+
const onChange = action('onChange');
|
11
|
+
const onFocus = action('onFocus');
|
12
|
+
const onBlur = action('onBlur');
|
13
|
+
const onSearch = action('onSearch');
|
14
|
+
|
15
|
+
const sizes = ['l', 'm', 's', 'xs'];
|
16
|
+
const views = ['default', 'positive', 'warning', 'negative'];
|
17
|
+
const enumerationTypes = ['plain', 'chip'];
|
18
|
+
const labelPlacements = ['outer', 'inner'];
|
19
|
+
|
20
|
+
const meta: Meta<typeof TextField> = {
|
21
|
+
title: 'plasma_web/TextField',
|
22
|
+
component: TextField,
|
23
|
+
decorators: [WithTheme],
|
24
|
+
argTypes: {
|
25
|
+
view: {
|
26
|
+
options: views,
|
27
|
+
control: {
|
28
|
+
type: 'select',
|
29
|
+
},
|
30
|
+
},
|
31
|
+
maxLength: {
|
32
|
+
control: {
|
33
|
+
type: 'number',
|
34
|
+
},
|
35
|
+
},
|
36
|
+
labelPlacement: {
|
37
|
+
options: labelPlacements,
|
38
|
+
control: {
|
39
|
+
type: 'inline-radio',
|
40
|
+
},
|
41
|
+
},
|
42
|
+
enumerationType: {
|
43
|
+
options: enumerationTypes,
|
44
|
+
control: {
|
45
|
+
type: 'select',
|
46
|
+
},
|
47
|
+
},
|
48
|
+
size: {
|
49
|
+
options: sizes,
|
50
|
+
control: {
|
51
|
+
type: 'inline-radio',
|
52
|
+
},
|
53
|
+
},
|
54
|
+
},
|
55
|
+
};
|
56
|
+
|
57
|
+
export default meta;
|
58
|
+
|
59
|
+
type StoryPropsDefault = Omit<
|
60
|
+
ComponentProps<typeof TextField>,
|
61
|
+
| 'helperBlock'
|
62
|
+
| 'contentLeft'
|
63
|
+
| 'htmlSize'
|
64
|
+
| 'contentRight'
|
65
|
+
| 'type'
|
66
|
+
| 'name'
|
67
|
+
| 'onFocus'
|
68
|
+
| 'onBlur'
|
69
|
+
| 'onChange'
|
70
|
+
| 'value'
|
71
|
+
| 'checked'
|
72
|
+
| 'maxLength'
|
73
|
+
| 'minLength'
|
74
|
+
| 'required'
|
75
|
+
> & {
|
76
|
+
'storybook:contentLeft': boolean;
|
77
|
+
'storybook:contentRight': boolean;
|
78
|
+
};
|
79
|
+
|
80
|
+
const StoryDemo = ({
|
81
|
+
'storybook:contentLeft': enableContentLeft,
|
82
|
+
'storybook:contentRight': enableContentRight,
|
83
|
+
view,
|
84
|
+
...rest
|
85
|
+
}: StoryPropsDefault) => {
|
86
|
+
const [text, setText] = useState('Значение поля');
|
87
|
+
|
88
|
+
const iconSize = rest.size === 'xs' ? 'xs' : 's';
|
89
|
+
|
90
|
+
return (
|
91
|
+
<TextField
|
92
|
+
{...rest}
|
93
|
+
value={text}
|
94
|
+
contentLeft={enableContentLeft ? <IconPlaceholder size={iconSize} /> : undefined}
|
95
|
+
contentRight={enableContentRight ? <IconPlaceholder size={iconSize} /> : undefined}
|
96
|
+
view={view}
|
97
|
+
onChange={(e) => {
|
98
|
+
setText(e.target.value);
|
99
|
+
onChange(e.target.value);
|
100
|
+
}}
|
101
|
+
onFocus={onFocus}
|
102
|
+
onBlur={onBlur}
|
103
|
+
onSearch={onSearch}
|
104
|
+
/>
|
105
|
+
);
|
106
|
+
};
|
107
|
+
|
108
|
+
export const Default: StoryObj<StoryPropsDefault> = {
|
109
|
+
args: {
|
110
|
+
id: 'example-text-field',
|
111
|
+
size: 'l',
|
112
|
+
view: 'default',
|
113
|
+
label: 'Лейбл',
|
114
|
+
labelPlacement: 'outer',
|
115
|
+
placeholder: 'Заполните поле',
|
116
|
+
leftHelper: 'Подсказка к полю',
|
117
|
+
enumerationType: 'plain',
|
118
|
+
disabled: false,
|
119
|
+
readOnly: false,
|
120
|
+
'storybook:contentLeft': true,
|
121
|
+
'storybook:contentRight': true,
|
122
|
+
},
|
123
|
+
render: (args) => <StoryDemo {...args} />,
|
124
|
+
};
|
125
|
+
|
126
|
+
export const Chips: StoryObj<StoryPropsDefault> = {
|
127
|
+
args: {
|
128
|
+
...Default.args,
|
129
|
+
enumerationType: 'chip',
|
130
|
+
values: ['1 value', '2 value', '3 value', '4 value'],
|
131
|
+
},
|
132
|
+
render: (args) => <StoryDemo {...args} />,
|
133
|
+
};
|
@@ -0,0 +1,43 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.config = void 0;
|
7
|
+
var _styledComponents = /*#__PURE__*/require("styled-components");
|
8
|
+
var _TextField = /*#__PURE__*/require("../../../../components/TextField");
|
9
|
+
var config = exports.config = {
|
10
|
+
defaults: {
|
11
|
+
view: 'default',
|
12
|
+
size: 'l',
|
13
|
+
labelPlacement: 'outer'
|
14
|
+
},
|
15
|
+
variations: {
|
16
|
+
view: {
|
17
|
+
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-primary);", ":var(--surface-transparent-primary);", ":var(--surface-transparent-secondary);", ":var(--text-accent);", ":var(--text-secondary);", ":var(--text-primary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--surface-clear);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-primary);", ":var(--surface-transparent-secondary-active);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":0.72;", ":var(--text-accent);"], _TextField.textFieldTokens.color, _TextField.textFieldTokens.backgroundColor, _TextField.textFieldTokens.backgroundColorFocus, _TextField.textFieldTokens.caretColor, _TextField.textFieldTokens.placeholderColor, _TextField.textFieldTokens.labelColor, _TextField.textFieldTokens.leftHelperColor, _TextField.textFieldTokens.colorReadOnly, _TextField.textFieldTokens.backgroundColorReadOnly, _TextField.textFieldTokens.placeholderColorReadOnly, _TextField.textFieldTokens.chipCloseIconColor, _TextField.textFieldTokens.chipColor, _TextField.textFieldTokens.chipBackground, _TextField.textFieldTokens.chipColorHover, _TextField.textFieldTokens.chipBackgroundHover, _TextField.textFieldTokens.chipColorActive, _TextField.textFieldTokens.chipBackgroundActive, _TextField.textFieldTokens.chipBackgroundReadOnly, _TextField.textFieldTokens.chipColorReadOnly, _TextField.textFieldTokens.chipBackgroundReadOnlyHover, _TextField.textFieldTokens.chipColorReadOnlyHover, _TextField.textFieldTokens.chipOpacityReadonly, _TextField.textFieldTokens.focusColor),
|
18
|
+
// TODO заменить --surface-transparent-positive на корректный токен
|
19
|
+
positive: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--plasma-colors-primary);", ":var(--surface-transparent-positive);", ":var(--surface-transparent-positive-active);", ":var(--text-accent);", ":var(--text-secondary);", ":var(--text-primary);", ":var(--text-positive);", ":var(--text-secondary);", ":var(--surface-clear);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-primary);", ":var(--surface-transparent-secondary-active);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":0.72;", ":var(--text-accent);"], _TextField.textFieldTokens.color, _TextField.textFieldTokens.backgroundColor, _TextField.textFieldTokens.backgroundColorFocus, _TextField.textFieldTokens.caretColor, _TextField.textFieldTokens.placeholderColor, _TextField.textFieldTokens.labelColor, _TextField.textFieldTokens.leftHelperColor, _TextField.textFieldTokens.colorReadOnly, _TextField.textFieldTokens.backgroundColorReadOnly, _TextField.textFieldTokens.placeholderColorReadOnly, _TextField.textFieldTokens.chipCloseIconColor, _TextField.textFieldTokens.chipColor, _TextField.textFieldTokens.chipBackground, _TextField.textFieldTokens.chipColorHover, _TextField.textFieldTokens.chipBackgroundHover, _TextField.textFieldTokens.chipColorActive, _TextField.textFieldTokens.chipBackgroundActive, _TextField.textFieldTokens.chipBackgroundReadOnly, _TextField.textFieldTokens.chipColorReadOnly, _TextField.textFieldTokens.chipBackgroundReadOnlyHover, _TextField.textFieldTokens.chipColorReadOnlyHover, _TextField.textFieldTokens.chipOpacityReadonly, _TextField.textFieldTokens.focusColor),
|
20
|
+
// // TODO заменить --surface-transparent-warning на корректный токен
|
21
|
+
warning: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--plasma-colors-primary);", ":var(--surface-transparent-warning);", ":var(--surface-transparent-warning-active);", ":var(--text-accent);", ":var(--text-secondary);", ":var(--text-primary);", ":var(--text-warning);", ":var(--text-secondary);", ":var(--surface-clear);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-primary);", ":var(--surface-transparent-secondary-active);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":0.72;", ":var(--text-accent);"], _TextField.textFieldTokens.color, _TextField.textFieldTokens.backgroundColor, _TextField.textFieldTokens.backgroundColorFocus, _TextField.textFieldTokens.caretColor, _TextField.textFieldTokens.placeholderColor, _TextField.textFieldTokens.labelColor, _TextField.textFieldTokens.leftHelperColor, _TextField.textFieldTokens.colorReadOnly, _TextField.textFieldTokens.backgroundColorReadOnly, _TextField.textFieldTokens.placeholderColorReadOnly, _TextField.textFieldTokens.chipCloseIconColor, _TextField.textFieldTokens.chipColor, _TextField.textFieldTokens.chipBackground, _TextField.textFieldTokens.chipColorHover, _TextField.textFieldTokens.chipBackgroundHover, _TextField.textFieldTokens.chipColorActive, _TextField.textFieldTokens.chipBackgroundActive, _TextField.textFieldTokens.chipBackgroundReadOnly, _TextField.textFieldTokens.chipColorReadOnly, _TextField.textFieldTokens.chipBackgroundReadOnlyHover, _TextField.textFieldTokens.chipColorReadOnlyHover, _TextField.textFieldTokens.chipOpacityReadonly, _TextField.textFieldTokens.focusColor),
|
22
|
+
// // TODO заменить --surface-transparent-negative на корректный токен
|
23
|
+
negative: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--plasma-colors-primary);", ":var(--surface-transparent-negative);", ":var(--surface-transparent-negative-active);", ":var(--text-accent);", ":var(--text-secondary);", ":var(--text-primary);", ":var(--text-negative);", ":var(--text-secondary);", ":var(--surface-clear);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary-hover);", ":var(--text-primary);", ":var(--surface-transparent-secondary-active);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(--text-primary);", ":0.72;", ":var(--text-accent);"], _TextField.textFieldTokens.color, _TextField.textFieldTokens.backgroundColor, _TextField.textFieldTokens.backgroundColorFocus, _TextField.textFieldTokens.caretColor, _TextField.textFieldTokens.placeholderColor, _TextField.textFieldTokens.labelColor, _TextField.textFieldTokens.leftHelperColor, _TextField.textFieldTokens.colorReadOnly, _TextField.textFieldTokens.backgroundColorReadOnly, _TextField.textFieldTokens.placeholderColorReadOnly, _TextField.textFieldTokens.chipCloseIconColor, _TextField.textFieldTokens.chipColor, _TextField.textFieldTokens.chipBackground, _TextField.textFieldTokens.chipColorHover, _TextField.textFieldTokens.chipBackgroundHover, _TextField.textFieldTokens.chipColorActive, _TextField.textFieldTokens.chipBackgroundActive, _TextField.textFieldTokens.chipBackgroundReadOnly, _TextField.textFieldTokens.chipColorReadOnly, _TextField.textFieldTokens.chipBackgroundReadOnlyHover, _TextField.textFieldTokens.chipColorReadOnlyHover, _TextField.textFieldTokens.chipOpacityReadonly, _TextField.textFieldTokens.focusColor)
|
24
|
+
},
|
25
|
+
size: {
|
26
|
+
l: /*#__PURE__*/(0, _styledComponents.css)(["", ":3.5rem;", ":1.0625rem 1.125rem 1.0625rem 1.125rem;", ":0.375rem;", ":0.875rem;", ":-0.0625rem 0.5rem -0.0625rem -0.125rem;", ":-0.0625rem -0.125rem -0.0625rem 0.75rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":0.75rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);", ":0.25rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":0.5625rem 0 0.125rem 0;", ":1.5625rem 0 0.5625rem 0;", ":0.25rem;", ":0.5rem;", ":auto;", ":2.75rem;", ":0.75rem;", ":1rem;", ":0.625rem;", ":0rem;", ":1.5rem;", ":var(--plasma-typo-body-l-font-family);", ":var(--plasma-typo-body-l-font-size);", ":var(--plasma-typo-body-l-font-style);", ":var(--plasma-typo-body-l-font-weight);", ":var(--plasma-typo-body-l-letter-spacing);", ":var(--plasma-typo-body-l-line-height);"], _TextField.textFieldTokens.height, _TextField.textFieldTokens.padding, _TextField.textFieldTokens.paddingWithChips, _TextField.textFieldTokens.borderRadius, _TextField.textFieldTokens.leftContentMargin, _TextField.textFieldTokens.rightContentMargin, _TextField.textFieldTokens.fontFamily, _TextField.textFieldTokens.fontSize, _TextField.textFieldTokens.fontStyle, _TextField.textFieldTokens.fontWeight, _TextField.textFieldTokens.letterSpacing, _TextField.textFieldTokens.lineHeight, _TextField.textFieldTokens.labelOffset, _TextField.textFieldTokens.labelFontFamily, _TextField.textFieldTokens.labelFontSize, _TextField.textFieldTokens.labelFontStyle, _TextField.textFieldTokens.labelFontWeight, _TextField.textFieldTokens.labelLetterSpacing, _TextField.textFieldTokens.labelLineHeight, _TextField.textFieldTokens.leftHelperOffset, _TextField.textFieldTokens.leftHelperFontFamily, _TextField.textFieldTokens.leftHelperFontSize, _TextField.textFieldTokens.leftHelperFontStyle, _TextField.textFieldTokens.leftHelperFontWeight, _TextField.textFieldTokens.leftHelperLetterSpacing, _TextField.textFieldTokens.leftHelperLineHeight, _TextField.textFieldTokens.labelInnerPadding, _TextField.textFieldTokens.contentLabelInnerPadding, _TextField.textFieldTokens.chipGap, _TextField.textFieldTokens.chipBorderRadius, _TextField.textFieldTokens.chipWidth, _TextField.textFieldTokens.chipHeight, _TextField.textFieldTokens.chipPaddingRight, _TextField.textFieldTokens.chipPaddingLeft, _TextField.textFieldTokens.chipClearContentMarginLeft, _TextField.textFieldTokens.chipClearContentMarginRight, _TextField.textFieldTokens.chipCloseIconSize, _TextField.textFieldTokens.chipFontFamily, _TextField.textFieldTokens.chipFontSize, _TextField.textFieldTokens.chipFontStyle, _TextField.textFieldTokens.chipFontWeight, _TextField.textFieldTokens.chipLetterSpacing, _TextField.textFieldTokens.chipLineHeight),
|
27
|
+
m: /*#__PURE__*/(0, _styledComponents.css)(["", ":3rem;", ":0.875rem 1rem 0.875rem 1rem;", ":0.375rem;", ":0.75rem;", ":-0.125rem 0.375rem -0.125rem -0.125rem;", ":-0.125rem -0.125rem -0.125rem 0.75rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":0.625rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);", ":0.25rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":0.375rem 0 0.125rem 0;", ":1.375rem 0 0.375rem 0;", ":0.25rem;", ":0.375rem;", ":auto;", ":2.25rem;", ":0.625rem;", ":0.875rem;", ":0.5rem;", ":0rem;", ":1.25rem;", ":var(--plasma-typo-body-m-font-family);", ":var(--plasma-typo-body-m-font-size);", ":var(--plasma-typo-body-m-font-style);", ":var(--plasma-typo-body-m-font-weight);", ":var(--plasma-typo-body-m-letter-spacing);", ":var(--plasma-typo-body-m-line-height);"], _TextField.textFieldTokens.height, _TextField.textFieldTokens.padding, _TextField.textFieldTokens.paddingWithChips, _TextField.textFieldTokens.borderRadius, _TextField.textFieldTokens.leftContentMargin, _TextField.textFieldTokens.rightContentMargin, _TextField.textFieldTokens.fontFamily, _TextField.textFieldTokens.fontSize, _TextField.textFieldTokens.fontStyle, _TextField.textFieldTokens.fontWeight, _TextField.textFieldTokens.letterSpacing, _TextField.textFieldTokens.lineHeight, _TextField.textFieldTokens.labelOffset, _TextField.textFieldTokens.labelFontFamily, _TextField.textFieldTokens.labelFontSize, _TextField.textFieldTokens.labelFontStyle, _TextField.textFieldTokens.labelFontWeight, _TextField.textFieldTokens.labelLetterSpacing, _TextField.textFieldTokens.labelLineHeight, _TextField.textFieldTokens.leftHelperOffset, _TextField.textFieldTokens.leftHelperFontFamily, _TextField.textFieldTokens.leftHelperFontSize, _TextField.textFieldTokens.leftHelperFontStyle, _TextField.textFieldTokens.leftHelperFontWeight, _TextField.textFieldTokens.leftHelperLetterSpacing, _TextField.textFieldTokens.leftHelperLineHeight, _TextField.textFieldTokens.labelInnerPadding, _TextField.textFieldTokens.contentLabelInnerPadding, _TextField.textFieldTokens.chipGap, _TextField.textFieldTokens.chipBorderRadius, _TextField.textFieldTokens.chipWidth, _TextField.textFieldTokens.chipHeight, _TextField.textFieldTokens.chipPaddingRight, _TextField.textFieldTokens.chipPaddingLeft, _TextField.textFieldTokens.chipClearContentMarginLeft, _TextField.textFieldTokens.chipClearContentMarginRight, _TextField.textFieldTokens.chipCloseIconSize, _TextField.textFieldTokens.chipFontFamily, _TextField.textFieldTokens.chipFontSize, _TextField.textFieldTokens.chipFontStyle, _TextField.textFieldTokens.chipFontWeight, _TextField.textFieldTokens.chipLetterSpacing, _TextField.textFieldTokens.chipLineHeight),
|
28
|
+
s: /*#__PURE__*/(0, _styledComponents.css)(["", ":2.5rem;", ":0.6875rem 0.875rem 0.6875rem 0.875rem;", ":0.375rem;", ":0.625rem;", ":-0.1875rem 0.25rem -0.1875rem -0.125rem;", ":-0.1875rem -0.125rem -0.1875rem 0.75rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":0.5rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);", ":0.25rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":0.3125rem 0 0 0;", ":1.0625rem 0 0.3125rem 0;", ":0.25rem;", ":0.25rem;", ":auto;", ":1.75rem;", ":0.5rem;", ":0.75rem;", ":0.375rem;", ":0rem;", ":1rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);"], _TextField.textFieldTokens.height, _TextField.textFieldTokens.padding, _TextField.textFieldTokens.paddingWithChips, _TextField.textFieldTokens.borderRadius, _TextField.textFieldTokens.leftContentMargin, _TextField.textFieldTokens.rightContentMargin, _TextField.textFieldTokens.fontFamily, _TextField.textFieldTokens.fontSize, _TextField.textFieldTokens.fontStyle, _TextField.textFieldTokens.fontWeight, _TextField.textFieldTokens.letterSpacing, _TextField.textFieldTokens.lineHeight, _TextField.textFieldTokens.labelOffset, _TextField.textFieldTokens.labelFontFamily, _TextField.textFieldTokens.labelFontSize, _TextField.textFieldTokens.labelFontStyle, _TextField.textFieldTokens.labelFontWeight, _TextField.textFieldTokens.labelLetterSpacing, _TextField.textFieldTokens.labelLineHeight, _TextField.textFieldTokens.leftHelperOffset, _TextField.textFieldTokens.leftHelperFontFamily, _TextField.textFieldTokens.leftHelperFontSize, _TextField.textFieldTokens.leftHelperFontStyle, _TextField.textFieldTokens.leftHelperFontWeight, _TextField.textFieldTokens.leftHelperLetterSpacing, _TextField.textFieldTokens.leftHelperLineHeight, _TextField.textFieldTokens.labelInnerPadding, _TextField.textFieldTokens.contentLabelInnerPadding, _TextField.textFieldTokens.chipGap, _TextField.textFieldTokens.chipBorderRadius, _TextField.textFieldTokens.chipWidth, _TextField.textFieldTokens.chipHeight, _TextField.textFieldTokens.chipPaddingRight, _TextField.textFieldTokens.chipPaddingLeft, _TextField.textFieldTokens.chipClearContentMarginLeft, _TextField.textFieldTokens.chipClearContentMarginRight, _TextField.textFieldTokens.chipCloseIconSize, _TextField.textFieldTokens.chipFontFamily, _TextField.textFieldTokens.chipFontSize, _TextField.textFieldTokens.chipFontStyle, _TextField.textFieldTokens.chipFontWeight, _TextField.textFieldTokens.chipLetterSpacing, _TextField.textFieldTokens.chipLineHeight),
|
29
|
+
xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":2rem;", ":0.5625rem 0.625rem 0.5625rem 0.625rem;", ":0.375rem;", ":0.5rem;", ":-0.0625rem 0.25rem -0.0625rem -0.125rem;", ":-0.0625rem -0.125rem -0.0625rem 0.75rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":0.375rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":0.25rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);", ":0.3125rem 0 0 0;", ":1.0625rem 0 0.3125rem 0;", ":0.25rem;", ":0.125rem;", ":auto;", ":1.25rem;", ":0.375rem;", ":0.625rem;", ":0.25rem;", ":0rem;", ":0.75rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);"], _TextField.textFieldTokens.height, _TextField.textFieldTokens.padding, _TextField.textFieldTokens.paddingWithChips, _TextField.textFieldTokens.borderRadius, _TextField.textFieldTokens.leftContentMargin, _TextField.textFieldTokens.rightContentMargin, _TextField.textFieldTokens.fontFamily, _TextField.textFieldTokens.fontSize, _TextField.textFieldTokens.fontStyle, _TextField.textFieldTokens.fontWeight, _TextField.textFieldTokens.letterSpacing, _TextField.textFieldTokens.lineHeight, _TextField.textFieldTokens.labelOffset, _TextField.textFieldTokens.labelFontFamily, _TextField.textFieldTokens.labelFontSize, _TextField.textFieldTokens.labelFontStyle, _TextField.textFieldTokens.labelFontWeight, _TextField.textFieldTokens.labelLetterSpacing, _TextField.textFieldTokens.labelLineHeight, _TextField.textFieldTokens.leftHelperOffset, _TextField.textFieldTokens.leftHelperFontFamily, _TextField.textFieldTokens.leftHelperFontSize, _TextField.textFieldTokens.leftHelperFontStyle, _TextField.textFieldTokens.leftHelperFontWeight, _TextField.textFieldTokens.leftHelperLetterSpacing, _TextField.textFieldTokens.leftHelperLineHeight, _TextField.textFieldTokens.labelInnerPadding, _TextField.textFieldTokens.contentLabelInnerPadding, _TextField.textFieldTokens.chipGap, _TextField.textFieldTokens.chipBorderRadius, _TextField.textFieldTokens.chipWidth, _TextField.textFieldTokens.chipHeight, _TextField.textFieldTokens.chipPaddingRight, _TextField.textFieldTokens.chipPaddingLeft, _TextField.textFieldTokens.chipClearContentMarginLeft, _TextField.textFieldTokens.chipClearContentMarginRight, _TextField.textFieldTokens.chipCloseIconSize, _TextField.textFieldTokens.chipFontFamily, _TextField.textFieldTokens.chipFontSize, _TextField.textFieldTokens.chipFontStyle, _TextField.textFieldTokens.chipFontWeight, _TextField.textFieldTokens.chipLetterSpacing, _TextField.textFieldTokens.chipLineHeight)
|
30
|
+
},
|
31
|
+
labelPlacement: {
|
32
|
+
inner: [_TextField.textField_labelPlacement_inner, /*#__PURE__*/(0, _styledComponents.css)(["&.", "{", ":var(--plasma-input-label-color,var(--plasma-input-placeholder-color,var(--plasma-colors-secondary)));", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);}"], _TextField.textField_labelPlacement_inner, _TextField.textFieldTokens.placeholderColor, _TextField.textFieldTokens.labelInnerFontFamily, _TextField.textFieldTokens.labelInnerFontSize, _TextField.textFieldTokens.labelInnerFontStyle, _TextField.textFieldTokens.labelInnerFontWeight, _TextField.textFieldTokens.labelInnerLetterSpacing, _TextField.textFieldTokens.labelInnerLineHeight)],
|
33
|
+
outer: [_TextField.textField_labelPlacement_outer, /*#__PURE__*/(0, _styledComponents.css)(["&.", "{}"], _TextField.textField_labelPlacement_outer)]
|
34
|
+
},
|
35
|
+
disabled: {
|
36
|
+
"true": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;"], _TextField.textFieldTokens.disabledOpacity)
|
37
|
+
},
|
38
|
+
// TODO заменить --surface-transparent-primary на корректный токен
|
39
|
+
readOnly: {
|
40
|
+
"true": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-secondary);", ":var(--surface-transparent-primary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary);"], _TextField.textFieldTokens.colorReadOnly, _TextField.textFieldTokens.backgroundColorReadOnly, _TextField.textFieldTokens.placeholderColorReadOnly, _TextField.textFieldTokens.leftHelperColorReadOnly, _TextField.textFieldTokens.labelColorReadOnly)
|
41
|
+
}
|
42
|
+
}
|
43
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.TextField = void 0;
|
7
|
+
var _engines = /*#__PURE__*/require("../../../../engines");
|
8
|
+
var _TextField = /*#__PURE__*/require("../../../../components/TextField");
|
9
|
+
var _TextField2 = /*#__PURE__*/require("./TextField.config");
|
10
|
+
var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_TextField.textFieldConfig, _TextField2.config);
|
11
|
+
var TextField = exports.TextField = /*#__PURE__*/(0, _engines.component)(mergedConfig);
|
package/styled-components/cjs/examples/sds_engineer/components/TextField/TextField.stories.tsx
ADDED
@@ -0,0 +1,133 @@
|
|
1
|
+
import React, { ComponentProps, useState } from 'react';
|
2
|
+
import type { StoryObj, Meta } from '@storybook/react';
|
3
|
+
import { action } from '@storybook/addon-actions';
|
4
|
+
import { IconPlaceholder } from '@salutejs/plasma-sb-utils';
|
5
|
+
|
6
|
+
import { WithTheme } from '../../../_helpers';
|
7
|
+
|
8
|
+
import { TextField } from './TextField';
|
9
|
+
|
10
|
+
const onChange = action('onChange');
|
11
|
+
const onFocus = action('onFocus');
|
12
|
+
const onBlur = action('onBlur');
|
13
|
+
const onSearch = action('onSearch');
|
14
|
+
|
15
|
+
const sizes = ['l', 'm', 's', 'xs'];
|
16
|
+
const views = ['default', 'positive', 'warning', 'negative'];
|
17
|
+
const enumerationTypes = ['plain', 'chip'];
|
18
|
+
const labelPlacements = ['outer', 'inner'];
|
19
|
+
|
20
|
+
const meta: Meta<typeof TextField> = {
|
21
|
+
title: 'sds_engineer/TextField',
|
22
|
+
component: TextField,
|
23
|
+
decorators: [WithTheme],
|
24
|
+
argTypes: {
|
25
|
+
view: {
|
26
|
+
options: views,
|
27
|
+
control: {
|
28
|
+
type: 'select',
|
29
|
+
},
|
30
|
+
},
|
31
|
+
maxLength: {
|
32
|
+
control: {
|
33
|
+
type: 'number',
|
34
|
+
},
|
35
|
+
},
|
36
|
+
labelPlacement: {
|
37
|
+
options: labelPlacements,
|
38
|
+
control: {
|
39
|
+
type: 'inline-radio',
|
40
|
+
},
|
41
|
+
},
|
42
|
+
enumerationType: {
|
43
|
+
options: enumerationTypes,
|
44
|
+
control: {
|
45
|
+
type: 'select',
|
46
|
+
},
|
47
|
+
},
|
48
|
+
size: {
|
49
|
+
options: sizes,
|
50
|
+
control: {
|
51
|
+
type: 'inline-radio',
|
52
|
+
},
|
53
|
+
},
|
54
|
+
},
|
55
|
+
};
|
56
|
+
|
57
|
+
export default meta;
|
58
|
+
|
59
|
+
type StoryPropsDefault = Omit<
|
60
|
+
ComponentProps<typeof TextField>,
|
61
|
+
| 'helperBlock'
|
62
|
+
| 'contentLeft'
|
63
|
+
| 'htmlSize'
|
64
|
+
| 'contentRight'
|
65
|
+
| 'type'
|
66
|
+
| 'name'
|
67
|
+
| 'onFocus'
|
68
|
+
| 'onBlur'
|
69
|
+
| 'onChange'
|
70
|
+
| 'value'
|
71
|
+
| 'checked'
|
72
|
+
| 'maxLength'
|
73
|
+
| 'minLength'
|
74
|
+
| 'required'
|
75
|
+
> & {
|
76
|
+
'storybook:contentLeft': boolean;
|
77
|
+
'storybook:contentRight': boolean;
|
78
|
+
};
|
79
|
+
|
80
|
+
const StoryDemo = ({
|
81
|
+
'storybook:contentLeft': enableContentLeft,
|
82
|
+
'storybook:contentRight': enableContentRight,
|
83
|
+
view,
|
84
|
+
...rest
|
85
|
+
}: StoryPropsDefault) => {
|
86
|
+
const [text, setText] = useState('Значение поля');
|
87
|
+
|
88
|
+
const iconSize = rest.size === 'xs' ? 'xs' : 's';
|
89
|
+
|
90
|
+
return (
|
91
|
+
<TextField
|
92
|
+
{...rest}
|
93
|
+
value={text}
|
94
|
+
contentLeft={enableContentLeft ? <IconPlaceholder size={iconSize} /> : undefined}
|
95
|
+
contentRight={enableContentRight ? <IconPlaceholder size={iconSize} /> : undefined}
|
96
|
+
view={view}
|
97
|
+
onChange={(e) => {
|
98
|
+
setText(e.target.value);
|
99
|
+
onChange(e.target.value);
|
100
|
+
}}
|
101
|
+
onFocus={onFocus}
|
102
|
+
onBlur={onBlur}
|
103
|
+
onSearch={onSearch}
|
104
|
+
/>
|
105
|
+
);
|
106
|
+
};
|
107
|
+
|
108
|
+
export const Default: StoryObj<StoryPropsDefault> = {
|
109
|
+
args: {
|
110
|
+
id: 'example-text-field',
|
111
|
+
size: 'l',
|
112
|
+
view: 'default',
|
113
|
+
label: 'Лейбл',
|
114
|
+
labelPlacement: 'outer',
|
115
|
+
placeholder: 'Заполните поле',
|
116
|
+
leftHelper: 'Подсказка к полю',
|
117
|
+
enumerationType: 'plain',
|
118
|
+
disabled: false,
|
119
|
+
readOnly: false,
|
120
|
+
'storybook:contentLeft': true,
|
121
|
+
'storybook:contentRight': true,
|
122
|
+
},
|
123
|
+
render: (args) => <StoryDemo {...args} />,
|
124
|
+
};
|
125
|
+
|
126
|
+
export const Chips: StoryObj<StoryPropsDefault> = {
|
127
|
+
args: {
|
128
|
+
...Default.args,
|
129
|
+
enumerationType: 'chip',
|
130
|
+
values: ['1 value', '2 value', '3 value', '4 value'],
|
131
|
+
},
|
132
|
+
render: (args) => <StoryDemo {...args} />,
|
133
|
+
};
|
@@ -24,8 +24,6 @@ export var cellRoot = function cellRoot(Root) {
|
|
24
24
|
_ref$stretching = _ref.stretching,
|
25
25
|
stretching = _ref$stretching === void 0 ? 'filled' : _ref$stretching;
|
26
26
|
var stretchingClass = classes["".concat(stretching, "Stretching")];
|
27
|
-
|
28
|
-
// Импорт старых свойств
|
29
27
|
var titleText = title || description;
|
30
28
|
var contentLeftDeprecated = contentLeft || content;
|
31
29
|
return /*#__PURE__*/React.createElement(Root, {
|
@@ -1,91 +1,221 @@
|
|
1
|
-
var _excluded = ["
|
1
|
+
var _excluded = ["id", "contentLeft", "contentRight", "label", "labelPlacement", "placeholder", "leftHelper", "enumerationType", "view", "size", "readOnly", "disabled", "values", "onChange", "onChangeChips", "onSearch"];
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
4
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
5
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
6
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
7
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
8
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
3
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
4
10
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
5
|
-
import React, { forwardRef } from 'react';
|
6
|
-
import { css } from 'styled-components';
|
11
|
+
import React, { forwardRef, useEffect, useRef, useState } from 'react';
|
7
12
|
import { safeUseId } from '@salutejs/plasma-core';
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import { base as
|
11
|
-
import { base as
|
12
|
-
import {
|
13
|
-
|
13
|
+
import { css } from 'styled-components';
|
14
|
+
import { cx } from '../../utils';
|
15
|
+
import { base as sizeCSS } from './variations/_size/base';
|
16
|
+
import { base as viewCSS } from './variations/_view/base';
|
17
|
+
import { base as disabledCSS } from './variations/_disabled/base';
|
18
|
+
import { base as readOnlyCSS } from './variations/_read-only/base';
|
19
|
+
import { base as labelPlacementCSS } from './variations/_label-placement/base';
|
20
|
+
import { Input, LeftHelper, Label, InputWrapper, InputLabelWrapper, StyledContentLeft, StyledContentRight, StyledChips } from './TextField.styles';
|
21
|
+
import { classes } from './TextField.tokens';
|
22
|
+
import { TextFieldChip } from './ui';
|
23
|
+
import { useKeyNavigation } from './hooks/useKeyNavigation';
|
24
|
+
export var base = /*#__PURE__*/css(["display:block;overflow:hidden;"]);
|
14
25
|
export var textFieldRoot = function textFieldRoot(Root) {
|
15
|
-
return /*#__PURE__*/forwardRef(function (
|
16
|
-
var
|
17
|
-
|
18
|
-
|
19
|
-
label =
|
20
|
-
labelPlacement =
|
21
|
-
placeholder =
|
22
|
-
leftHelper =
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
return /*#__PURE__*/forwardRef(function (_ref, ref) {
|
27
|
+
var id = _ref.id,
|
28
|
+
contentLeft = _ref.contentLeft,
|
29
|
+
contentRight = _ref.contentRight,
|
30
|
+
label = _ref.label,
|
31
|
+
labelPlacement = _ref.labelPlacement,
|
32
|
+
placeholder = _ref.placeholder,
|
33
|
+
leftHelper = _ref.leftHelper,
|
34
|
+
_ref$enumerationType = _ref.enumerationType,
|
35
|
+
enumerationType = _ref$enumerationType === void 0 ? 'plain' : _ref$enumerationType,
|
36
|
+
view = _ref.view,
|
37
|
+
size = _ref.size,
|
38
|
+
_ref$readOnly = _ref.readOnly,
|
39
|
+
readOnly = _ref$readOnly === void 0 ? false : _ref$readOnly,
|
40
|
+
_ref$disabled = _ref.disabled,
|
41
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
42
|
+
values = _ref.values,
|
43
|
+
onChange = _ref.onChange,
|
44
|
+
onChangeChips = _ref.onChangeChips,
|
45
|
+
onSearch = _ref.onSearch,
|
46
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
47
|
+
var contentRef = useRef(null);
|
48
|
+
var inputRef = useRef(null);
|
49
|
+
var chipsRefs = useRef([]);
|
50
|
+
var controlledRefs = {
|
51
|
+
contentRef: contentRef,
|
52
|
+
inputRef: inputRef,
|
53
|
+
chipsRefs: chipsRefs
|
54
|
+
};
|
55
|
+
var _useState = useState([]),
|
56
|
+
_useState2 = _slicedToArray(_useState, 2),
|
57
|
+
chips = _useState2[0],
|
58
|
+
setChips = _useState2[1];
|
59
|
+
var uniqId = safeUseId();
|
60
|
+
var innerId = id || uniqId;
|
61
|
+
var labelId = safeUseId();
|
62
|
+
var helperTextId = safeUseId();
|
63
|
+
var isChipEnumeration = enumerationType === 'chip';
|
64
|
+
var hideLabel = (size === 'xs' || isChipEnumeration) && labelPlacement === 'inner';
|
65
|
+
var labelInside = size !== 'xs' && labelPlacement === 'inner';
|
66
|
+
var innerLabelPlacementValue = hideLabel ? 'outer' : labelPlacement;
|
67
|
+
var innerPlaceholderValue = hideLabel ? label : placeholder;
|
68
|
+
var innerLabelValue = hideLabel ? undefined : label;
|
69
|
+
var isChipsVisible = isChipEnumeration && (chips === null || chips === void 0 ? void 0 : chips.length);
|
70
|
+
var withHasChips = isChipsVisible ? classes.hasChips : undefined;
|
71
|
+
var wrapperWithoutLeftContent = !contentLeft && isChipsVisible ? classes.hasEmptyContentLeft : undefined;
|
72
|
+
var wrapperWithoutRightContent = !contentRight && isChipsVisible ? classes.hasEmptyContentRight : undefined;
|
29
73
|
var handleChange = function handleChange(event) {
|
74
|
+
if (disabled || readOnly) {
|
75
|
+
return;
|
76
|
+
}
|
30
77
|
var _event$target = event.target,
|
31
78
|
maxLength = _event$target.maxLength,
|
32
79
|
value = _event$target.value;
|
33
|
-
if (
|
80
|
+
if (maxLength !== -1 && value.length > maxLength) {
|
81
|
+
return;
|
82
|
+
}
|
83
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(event);
|
84
|
+
};
|
85
|
+
var updateChips = function updateChips(newChips, newValues) {
|
86
|
+
setChips(newChips);
|
87
|
+
onChangeChips === null || onChangeChips === void 0 ? void 0 : onChangeChips(newValues);
|
88
|
+
};
|
89
|
+
var _useKeyNavigation = useKeyNavigation({
|
90
|
+
controlledRefs: controlledRefs,
|
91
|
+
disabled: disabled,
|
92
|
+
readOnly: readOnly,
|
93
|
+
chips: chips,
|
94
|
+
enumerationType: enumerationType,
|
95
|
+
updateChips: updateChips,
|
96
|
+
onSearch: onSearch,
|
97
|
+
onChange: onChange
|
98
|
+
}),
|
99
|
+
handleInputKeydown = _useKeyNavigation.handleInputKeydown,
|
100
|
+
handleChipKeyDown = _useKeyNavigation.handleChipKeyDown,
|
101
|
+
onChipClear = _useKeyNavigation.onChipClear,
|
102
|
+
handleContentKeyDown = _useKeyNavigation.handleContentKeyDown;
|
103
|
+
var onChipClick = function onChipClick(event) {
|
104
|
+
return event.stopPropagation();
|
105
|
+
};
|
106
|
+
var handleInputFocus = function handleInputFocus() {
|
107
|
+
if (readOnly || disabled || !(inputRef !== null && inputRef !== void 0 && inputRef.current)) {
|
34
108
|
return;
|
35
109
|
}
|
36
|
-
|
110
|
+
inputRef.current.scrollIntoView({
|
111
|
+
behavior: 'smooth',
|
112
|
+
block: 'center',
|
113
|
+
inline: 'center'
|
114
|
+
});
|
115
|
+
inputRef.current.focus({
|
116
|
+
preventScroll: true
|
117
|
+
});
|
37
118
|
};
|
38
|
-
var
|
39
|
-
if (
|
40
|
-
|
119
|
+
var getRef = function getRef(element, index) {
|
120
|
+
if (element && chipsRefs !== null && chipsRefs !== void 0 && chipsRefs.current) {
|
121
|
+
chipsRefs.current[index] = element;
|
41
122
|
}
|
42
123
|
};
|
43
|
-
|
44
|
-
|
45
|
-
|
124
|
+
useEffect(function () {
|
125
|
+
if (!isChipEnumeration && !(values !== null && values !== void 0 && values.length)) {
|
126
|
+
return;
|
127
|
+
}
|
128
|
+
var newChips = (values === null || values === void 0 ? void 0 : values.map(function (value, index) {
|
129
|
+
return {
|
130
|
+
id: "".concat(index, "_").concat(value),
|
131
|
+
text: value
|
132
|
+
};
|
133
|
+
})) || [];
|
134
|
+
setChips(newChips);
|
135
|
+
}, [isChipEnumeration, values]);
|
46
136
|
return /*#__PURE__*/React.createElement(Root, {
|
137
|
+
ref: ref,
|
47
138
|
view: view,
|
48
139
|
size: size,
|
49
140
|
disabled: disabled,
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
},
|
54
|
-
|
55
|
-
|
141
|
+
readOnly: !disabled && readOnly,
|
142
|
+
labelPlacement: innerLabelPlacementValue,
|
143
|
+
onClick: handleInputFocus
|
144
|
+
}, labelInside || innerLabelValue && /*#__PURE__*/React.createElement(Label, {
|
145
|
+
id: labelId,
|
146
|
+
htmlFor: id
|
147
|
+
}, innerLabelValue), /*#__PURE__*/React.createElement(InputWrapper, {
|
148
|
+
className: cx(withHasChips, wrapperWithoutLeftContent, wrapperWithoutRightContent)
|
149
|
+
}, contentLeft && /*#__PURE__*/React.createElement(StyledContentLeft, null, contentLeft), /*#__PURE__*/React.createElement(InputLabelWrapper, {
|
150
|
+
tabIndex: -1,
|
151
|
+
ref: contentRef,
|
152
|
+
onKeyDown: handleContentKeyDown,
|
153
|
+
className: withHasChips
|
154
|
+
}, isChipEnumeration && Boolean(chips === null || chips === void 0 ? void 0 : chips.length) && /*#__PURE__*/React.createElement(StyledChips, null, chips === null || chips === void 0 ? void 0 : chips.map(function (_ref2, index) {
|
155
|
+
var chipId = _ref2.id,
|
156
|
+
text = _ref2.text;
|
157
|
+
return /*#__PURE__*/React.createElement(TextFieldChip, {
|
158
|
+
ref: function ref(element) {
|
159
|
+
return getRef(element, index);
|
160
|
+
},
|
161
|
+
chipId: chipId,
|
162
|
+
key: "".concat(chipId, "_").concat(index),
|
163
|
+
disabled: disabled,
|
164
|
+
readOnly: readOnly,
|
165
|
+
value: text,
|
166
|
+
text: text,
|
167
|
+
onKeyDown: function onKeyDown(event) {
|
168
|
+
return handleChipKeyDown(event, chipId);
|
169
|
+
},
|
170
|
+
onClear: function onClear() {
|
171
|
+
return onChipClear(chipId);
|
172
|
+
},
|
173
|
+
onClick: onChipClick
|
174
|
+
});
|
175
|
+
})), /*#__PURE__*/React.createElement(Input, _extends({}, rest, {
|
176
|
+
ref: inputRef,
|
177
|
+
id: innerId,
|
178
|
+
"aria-labelledby": labelId,
|
56
179
|
"aria-describedby": helperTextId,
|
57
|
-
placeholder:
|
180
|
+
placeholder: innerPlaceholderValue,
|
58
181
|
disabled: disabled,
|
182
|
+
readOnly: !disabled && readOnly,
|
59
183
|
onChange: handleChange,
|
60
|
-
|
184
|
+
onKeyDown: handleInputKeydown
|
61
185
|
})), labelInside && /*#__PURE__*/React.createElement(Label, {
|
62
|
-
id:
|
63
|
-
|
186
|
+
id: labelId,
|
187
|
+
htmlFor: innerId
|
188
|
+
}, innerLabelValue)), contentRight && /*#__PURE__*/React.createElement(StyledContentRight, null, contentRight)), leftHelper && /*#__PURE__*/React.createElement(LeftHelper, {
|
64
189
|
id: helperTextId
|
65
190
|
}, leftHelper));
|
66
191
|
});
|
67
192
|
};
|
68
193
|
export var textFieldConfig = {
|
69
194
|
name: 'TextField',
|
70
|
-
tag: '
|
195
|
+
tag: 'div',
|
71
196
|
layout: textFieldRoot,
|
72
197
|
base: base,
|
73
198
|
variations: {
|
74
199
|
view: {
|
75
|
-
css:
|
200
|
+
css: viewCSS
|
76
201
|
},
|
77
202
|
size: {
|
78
|
-
css:
|
203
|
+
css: sizeCSS
|
79
204
|
},
|
80
205
|
disabled: {
|
81
|
-
css:
|
206
|
+
css: disabledCSS,
|
207
|
+
attrs: true
|
208
|
+
},
|
209
|
+
readOnly: {
|
210
|
+
css: readOnlyCSS,
|
82
211
|
attrs: true
|
83
212
|
},
|
84
213
|
labelPlacement: {
|
85
|
-
css:
|
214
|
+
css: labelPlacementCSS
|
86
215
|
}
|
87
216
|
},
|
88
217
|
defaults: {
|
89
|
-
size: 'm'
|
218
|
+
size: 'm',
|
219
|
+
view: 'default'
|
90
220
|
}
|
91
221
|
};
|