@salutejs/plasma-new-hope 0.196.1-dev.0 → 0.197.0-canary.1556.11973013493.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Autocomplete/Autocomplete.css +18 -19
- package/cjs/components/Autocomplete/Autocomplete.js +7 -1
- package/cjs/components/Autocomplete/Autocomplete.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.css +18 -19
- package/cjs/components/Combobox/ComboboxNew/Combobox.js +7 -2
- package/cjs/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/Inner.css +18 -19
- package/cjs/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +18 -19
- package/cjs/components/DatePicker/RangeDate/RangeDate.css +18 -19
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +18 -19
- package/cjs/components/DatePicker/SingleDate/SingleDate.css +18 -19
- package/cjs/components/DatePicker/SingleDate/SingleDate.js +7 -3
- package/cjs/components/DatePicker/SingleDate/SingleDate.js.map +1 -1
- package/cjs/components/Pagination/Pagination.css +18 -19
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +18 -19
- package/cjs/components/Range/Range.css +18 -19
- package/cjs/components/Select/Select.css +18 -19
- package/cjs/components/Select/ui/Inner/Inner.css +18 -19
- package/cjs/components/Select/ui/Inner/ui/Item/Item.css +18 -19
- package/cjs/components/Select/ui/Target/Target.css +18 -19
- package/cjs/components/Select/ui/Target/Target.js +1 -2
- package/cjs/components/Select/ui/Target/Target.js.map +1 -1
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.css +18 -19
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +12 -7
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
- package/cjs/components/Slider/Slider.css +18 -19
- package/cjs/components/Slider/components/Double/Double.css +18 -19
- package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +18 -19
- package/cjs/components/TextField/TextField.js +12 -11
- package/cjs/components/TextField/TextField.js.map +1 -1
- package/cjs/components/TextField/TextField.styles.js +20 -11
- package/cjs/components/TextField/TextField.styles.js.map +1 -1
- package/cjs/components/TextField/{TextField.styles_j7dqpn.css → TextField.styles_ppcxpx.css} +1 -1
- package/cjs/components/TextField/TextField.tokens.js +1 -0
- package/cjs/components/TextField/TextField.tokens.js.map +1 -1
- package/cjs/components/TextField/ui/Hint/Hint.css +20 -20
- package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.css +1 -2
- package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js +3 -17
- package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js.map +1 -1
- package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +1 -7
- package/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js.map +1 -1
- package/{es/components/TextField/ui/TextFieldChip/TextFieldChip.styles_1yosnxc.css → cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles_1y8n7la.css} +0 -1
- package/cjs/components/TextField/variations/_label-placement/base.js +1 -1
- package/cjs/components/TextField/variations/_label-placement/base.js.map +1 -1
- package/cjs/components/TextField/variations/_label-placement/base_y1lvvc.css +1 -0
- package/cjs/index.css +18 -19
- package/emotion/cjs/components/Autocomplete/Autocomplete.js +7 -1
- package/emotion/cjs/components/Combobox/ComboboxNew/Combobox.js +7 -2
- package/emotion/cjs/components/DatePicker/SingleDate/SingleDate.js +7 -3
- package/emotion/cjs/components/Select/ui/Target/Target.js +1 -2
- package/emotion/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +12 -7
- package/emotion/cjs/components/TextField/TextField.js +13 -12
- package/emotion/cjs/components/TextField/TextField.styles.js +29 -26
- package/emotion/cjs/components/TextField/TextField.template-doc.mdx +3 -13
- package/emotion/cjs/components/TextField/TextField.tokens.js +1 -0
- package/emotion/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js +3 -17
- package/emotion/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +3 -12
- package/emotion/cjs/components/TextField/variations/_label-placement/base.js +1 -1
- package/emotion/cjs/examples/plasma_b2c/components/Select/Select.stories.tsx +1 -8
- package/emotion/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +7 -10
- package/emotion/cjs/examples/plasma_web/components/Select/Select.stories.tsx +1 -8
- package/emotion/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +9 -12
- package/emotion/es/components/Autocomplete/Autocomplete.js +7 -1
- package/emotion/es/components/Combobox/ComboboxNew/Combobox.js +7 -2
- package/emotion/es/components/DatePicker/SingleDate/SingleDate.js +7 -3
- package/emotion/es/components/Select/ui/Target/Target.js +1 -2
- package/emotion/es/components/Select/ui/Target/ui/Textfield/Textfield.js +12 -7
- package/emotion/es/components/TextField/TextField.js +13 -12
- package/emotion/es/components/TextField/TextField.styles.js +29 -26
- package/emotion/es/components/TextField/TextField.template-doc.mdx +3 -13
- package/emotion/es/components/TextField/TextField.tokens.js +1 -0
- package/emotion/es/components/TextField/ui/TextFieldChip/TextFieldChip.js +4 -18
- package/emotion/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +2 -11
- package/emotion/es/components/TextField/variations/_label-placement/base.js +1 -1
- package/emotion/es/examples/plasma_b2c/components/Select/Select.stories.tsx +1 -8
- package/emotion/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +7 -10
- package/emotion/es/examples/plasma_web/components/Select/Select.stories.tsx +1 -8
- package/emotion/es/examples/plasma_web/components/TextField/TextField.stories.tsx +9 -12
- package/es/components/Autocomplete/Autocomplete.css +18 -19
- package/es/components/Autocomplete/Autocomplete.js +7 -1
- package/es/components/Autocomplete/Autocomplete.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/Combobox.css +18 -19
- package/es/components/Combobox/ComboboxNew/Combobox.js +7 -2
- package/es/components/Combobox/ComboboxNew/Combobox.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/ui/Inner/Inner.css +18 -19
- package/es/components/Combobox/ComboboxNew/ui/Inner/ui/Item/Item.css +18 -19
- package/es/components/DatePicker/RangeDate/RangeDate.css +18 -19
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +18 -19
- package/es/components/DatePicker/SingleDate/SingleDate.css +18 -19
- package/es/components/DatePicker/SingleDate/SingleDate.js +7 -3
- package/es/components/DatePicker/SingleDate/SingleDate.js.map +1 -1
- package/es/components/Pagination/Pagination.css +18 -19
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +18 -19
- package/es/components/Range/Range.css +18 -19
- package/es/components/Select/Select.css +18 -19
- package/es/components/Select/ui/Inner/Inner.css +18 -19
- package/es/components/Select/ui/Inner/ui/Item/Item.css +18 -19
- package/es/components/Select/ui/Target/Target.css +18 -19
- package/es/components/Select/ui/Target/Target.js +1 -2
- package/es/components/Select/ui/Target/Target.js.map +1 -1
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.css +18 -19
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.js +12 -7
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.js.map +1 -1
- package/es/components/Slider/Slider.css +18 -19
- package/es/components/Slider/components/Double/Double.css +18 -19
- package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +18 -19
- package/es/components/TextField/TextField.js +12 -11
- package/es/components/TextField/TextField.js.map +1 -1
- package/es/components/TextField/TextField.styles.js +20 -11
- package/es/components/TextField/TextField.styles.js.map +1 -1
- package/es/components/TextField/{TextField.styles_j7dqpn.css → TextField.styles_ppcxpx.css} +1 -1
- package/es/components/TextField/TextField.tokens.js +1 -0
- package/es/components/TextField/TextField.tokens.js.map +1 -1
- package/es/components/TextField/ui/Hint/Hint.css +20 -20
- package/es/components/TextField/ui/TextFieldChip/TextFieldChip.css +1 -2
- package/es/components/TextField/ui/TextFieldChip/TextFieldChip.js +4 -18
- package/es/components/TextField/ui/TextFieldChip/TextFieldChip.js.map +1 -1
- package/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +2 -7
- package/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js.map +1 -1
- package/{cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles_1yosnxc.css → es/components/TextField/ui/TextFieldChip/TextFieldChip.styles_1y8n7la.css} +0 -1
- package/es/components/TextField/variations/_label-placement/base.js +1 -1
- package/es/components/TextField/variations/_label-placement/base.js.map +1 -1
- package/es/components/TextField/variations/_label-placement/base_y1lvvc.css +1 -0
- package/es/index.css +18 -19
- package/package.json +2 -2
- package/styled-components/cjs/components/Autocomplete/Autocomplete.js +7 -1
- package/styled-components/cjs/components/Combobox/ComboboxNew/Combobox.js +7 -2
- package/styled-components/cjs/components/DatePicker/SingleDate/SingleDate.js +7 -3
- package/styled-components/cjs/components/Select/ui/Target/Target.js +1 -2
- package/styled-components/cjs/components/Select/ui/Target/ui/Textfield/Textfield.js +12 -7
- package/styled-components/cjs/components/TextField/TextField.js +12 -11
- package/styled-components/cjs/components/TextField/TextField.styles.js +9 -6
- package/styled-components/cjs/components/TextField/TextField.template-doc.mdx +3 -13
- package/styled-components/cjs/components/TextField/TextField.tokens.js +1 -0
- package/styled-components/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.js +3 -17
- package/styled-components/cjs/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +2 -10
- package/styled-components/cjs/components/TextField/variations/_label-placement/base.js +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Select/Select.stories.tsx +1 -8
- package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +7 -10
- package/styled-components/cjs/examples/plasma_web/components/Select/Select.stories.tsx +1 -8
- package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +9 -12
- package/styled-components/es/components/Autocomplete/Autocomplete.js +7 -1
- package/styled-components/es/components/Combobox/ComboboxNew/Combobox.js +7 -2
- package/styled-components/es/components/DatePicker/SingleDate/SingleDate.js +7 -3
- package/styled-components/es/components/Select/ui/Target/Target.js +1 -2
- package/styled-components/es/components/Select/ui/Target/ui/Textfield/Textfield.js +12 -7
- package/styled-components/es/components/TextField/TextField.js +12 -11
- package/styled-components/es/components/TextField/TextField.styles.js +9 -6
- package/styled-components/es/components/TextField/TextField.template-doc.mdx +3 -13
- package/styled-components/es/components/TextField/TextField.tokens.js +1 -0
- package/styled-components/es/components/TextField/ui/TextFieldChip/TextFieldChip.js +4 -18
- package/styled-components/es/components/TextField/ui/TextFieldChip/TextFieldChip.styles.js +1 -9
- package/styled-components/es/components/TextField/variations/_label-placement/base.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Select/Select.stories.tsx +1 -8
- package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +7 -10
- package/styled-components/es/examples/plasma_web/components/Select/Select.stories.tsx +1 -8
- package/styled-components/es/examples/plasma_web/components/TextField/TextField.stories.tsx +9 -12
- package/types/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/types/components/Autocomplete/Autocomplete.types.d.ts +2 -3
- package/types/components/Autocomplete/Autocomplete.types.d.ts.map +1 -1
- package/types/components/Autocomplete/ui/TextField/TextField.styles.d.ts +709 -69
- package/types/components/Autocomplete/ui/TextField/TextField.styles.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts +30 -10
- package/types/components/Combobox/ComboboxNew/Combobox.types.d.ts.map +1 -1
- package/types/components/Combobox/ComboboxNew/ui/Target/Target.styles.d.ts +709 -69
- package/types/components/Combobox/ComboboxNew/ui/Target/Target.styles.d.ts.map +1 -1
- package/types/components/DatePicker/SingleDate/SingleDate.d.ts +2 -2
- package/types/components/DatePicker/SingleDate/SingleDate.d.ts.map +1 -1
- package/types/components/DatePicker/SingleDate/SingleDate.styles.d.ts +709 -69
- package/types/components/DatePicker/SingleDate/SingleDate.styles.d.ts.map +1 -1
- package/types/components/DatePicker/SingleDate/SingleDate.types.d.ts +28 -9
- package/types/components/DatePicker/SingleDate/SingleDate.types.d.ts.map +1 -1
- package/types/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.d.ts +282 -20
- package/types/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.styles.d.ts.map +1 -1
- package/types/components/Range/Range.styles.d.ts +709 -69
- package/types/components/Range/Range.styles.d.ts.map +1 -1
- package/types/components/Select/Select.types.d.ts +30 -15
- package/types/components/Select/Select.types.d.ts.map +1 -1
- package/types/components/Select/ui/Target/Target.d.ts +1 -1
- package/types/components/Select/ui/Target/Target.d.ts.map +1 -1
- package/types/components/Select/ui/Target/Target.types.d.ts +1 -1
- package/types/components/Select/ui/Target/Target.types.d.ts.map +1 -1
- package/types/components/Select/ui/Target/ui/Textfield/Textfield.d.ts.map +1 -1
- package/types/components/Select/ui/Target/ui/Textfield/Textfield.styles.d.ts +709 -69
- package/types/components/Select/ui/Target/ui/Textfield/Textfield.styles.d.ts.map +1 -1
- package/types/components/Select/ui/Target/ui/Textfield/Textfield.types.d.ts +1 -1
- package/types/components/Select/ui/Target/ui/Textfield/Textfield.types.d.ts.map +1 -1
- package/types/components/Slider/components/Double/Double.styles.d.ts +709 -69
- package/types/components/Slider/components/Double/Double.styles.d.ts.map +1 -1
- package/types/components/TextField/TextField.d.ts.map +1 -1
- package/types/components/TextField/TextField.styles.d.ts +3 -1
- package/types/components/TextField/TextField.styles.d.ts.map +1 -1
- package/types/components/TextField/TextField.tokens.d.ts +1 -0
- package/types/components/TextField/TextField.tokens.d.ts.map +1 -1
- package/types/components/TextField/TextField.types.d.ts +42 -27
- package/types/components/TextField/TextField.types.d.ts.map +1 -1
- package/types/components/TextField/ui/TextFieldChip/TextFieldChip.d.ts.map +1 -1
- package/types/components/TextField/ui/TextFieldChip/TextFieldChip.styles.d.ts +0 -1
- package/types/components/TextField/ui/TextFieldChip/TextFieldChip.styles.d.ts.map +1 -1
- package/types/components/TextField/ui/TextFieldChip/TextFieldChip.types.d.ts +1 -5
- package/types/components/TextField/ui/TextFieldChip/TextFieldChip.types.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Autocomplete/Autocomplete.d.ts +5 -557
- package/types/examples/plasma_b2c/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Combobox/Combobox.d.ts +1045 -133
- package/types/examples/plasma_b2c/components/Combobox/Combobox.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/DatePicker/DatePicker.d.ts +47 -1
- package/types/examples/plasma_b2c/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Mask/Mask.d.ts +1238 -70
- package/types/examples/plasma_b2c/components/Mask/Mask.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Select/Select.d.ts +282 -20
- package/types/examples/plasma_b2c/components/Select/Select.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/TextField/TextField.d.ts +709 -69
- package/types/examples/plasma_b2c/components/TextField/TextField.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Autocomplete/Autocomplete.d.ts +5 -557
- package/types/examples/plasma_web/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Combobox/Combobox.d.ts +1045 -133
- package/types/examples/plasma_web/components/Combobox/Combobox.d.ts.map +1 -1
- package/types/examples/plasma_web/components/DatePicker/DatePicker.d.ts +47 -1
- package/types/examples/plasma_web/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Mask/Mask.d.ts +1238 -70
- package/types/examples/plasma_web/components/Mask/Mask.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Select/Select.d.ts +282 -20
- package/types/examples/plasma_web/components/Select/Select.d.ts.map +1 -1
- package/types/examples/plasma_web/components/TextField/TextField.d.ts +709 -69
- package/types/examples/plasma_web/components/TextField/TextField.d.ts.map +1 -1
- package/cjs/components/TextField/variations/_label-placement/base_gttvto.css +0 -1
- package/es/components/TextField/variations/_label-placement/base_gttvto.css +0 -1
@@ -62,7 +62,7 @@ export function App() {
|
|
62
62
|
```
|
63
63
|
|
64
64
|
### Статус поля
|
65
|
-
Статус поля задается с помощью свойства `status`.
|
65
|
+
Статус поля задается с помощью свойства `status`.
|
66
66
|
Возможные значения свойства: `success`, `warning` и `error`.
|
67
67
|
На отображение TextField так же влияют свойства `clear` и `hasDivider`:
|
68
68
|
|
@@ -150,7 +150,7 @@ export function App() {
|
|
150
150
|
```
|
151
151
|
|
152
152
|
### Режим ввода
|
153
|
-
С помощью свойства `enumerationType` можно вводить элементы как теги.
|
153
|
+
С помощью свойства `enumerationType` можно вводить элементы как теги.
|
154
154
|
По нажатию Enter, после ввода нужного текста, он преобразуется в Chip:
|
155
155
|
|
156
156
|
```tsx live
|
@@ -166,17 +166,7 @@ export function App() {
|
|
166
166
|
size="l"
|
167
167
|
enumerationType="chip"
|
168
168
|
helperText="Подсказка снизу"
|
169
|
-
|
170
|
-
/>
|
171
|
-
|
172
|
-
<TextField
|
173
|
-
placeholder="Введите значение"
|
174
|
-
defaultValue="Значение"
|
175
|
-
size="l"
|
176
|
-
enumerationType="chip"
|
177
|
-
helperText="Подсказка снизу"
|
178
|
-
chips={["Значение 1"]}
|
179
|
-
chipType="text"
|
169
|
+
values={["Значение 1"]}
|
180
170
|
/>
|
181
171
|
</div>
|
182
172
|
);
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { forwardRef } from 'react';
|
2
|
-
import { StyledChip
|
2
|
+
import { StyledChip } from './TextFieldChip.styles';
|
3
3
|
/**
|
4
4
|
* Чип, отображающий выбранный элемент
|
5
5
|
*/
|
@@ -11,23 +11,14 @@ export var TextFieldChip = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
11
11
|
onClick = _ref.onClick,
|
12
12
|
onClear = _ref.onClear,
|
13
13
|
onKeyDown = _ref.onKeyDown,
|
14
|
-
_forceChipManipulationWithReadonly = _ref._forceChipManipulationWithReadonly
|
15
|
-
chipType = _ref.chipType;
|
14
|
+
_forceChipManipulationWithReadonly = _ref._forceChipManipulationWithReadonly;
|
16
15
|
var onClearHandle = function onClearHandle() {
|
17
16
|
return onClear(id);
|
18
17
|
};
|
19
18
|
var onKeyDownHandle = function onKeyDownHandle(event) {
|
20
19
|
onKeyDown === null || onKeyDown === void 0 || onKeyDown(event, id);
|
21
20
|
};
|
22
|
-
|
23
|
-
if (onClick) {
|
24
|
-
onClick(e);
|
25
|
-
}
|
26
|
-
if (onClear) {
|
27
|
-
onClear(id);
|
28
|
-
}
|
29
|
-
};
|
30
|
-
return chipType === 'default' ? /*#__PURE__*/React.createElement(StyledChip, {
|
21
|
+
return /*#__PURE__*/React.createElement(StyledChip, {
|
31
22
|
ref: ref,
|
32
23
|
tabIndex: -1,
|
33
24
|
disabled: disabled,
|
@@ -41,10 +32,5 @@ export var TextFieldChip = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
41
32
|
// @ts-ignore
|
42
33
|
,
|
43
34
|
_forceChipManipulationWithReadonly: _forceChipManipulationWithReadonly
|
44
|
-
})
|
45
|
-
ref: ref,
|
46
|
-
tabIndex: -1,
|
47
|
-
onClick: handleClick,
|
48
|
-
onKeyDown: onKeyDownHandle
|
49
|
-
}, text);
|
35
|
+
});
|
50
36
|
});
|
@@ -10,20 +10,11 @@ var Chip = /*#__PURE__*/component(mergedConfig);
|
|
10
10
|
|
11
11
|
// NOTE: Необходимое переопределение токенов из компонента Chip т.к. используются его части
|
12
12
|
export var StyledChip = /*#__PURE__*/_styled(Chip, {
|
13
|
-
target: "
|
13
|
+
target: "e7ctrkt0",
|
14
14
|
label: "plasma-new-hope__StyledChip"
|
15
15
|
})(chipTokens.color, ":var(", tokens.chipColor, ");", chipTokens.background, ":var(", tokens.chipBackground, ");", chipTokens.colorHover, ":var(", tokens.chipColorHover, ");", chipTokens.backgroundHover, ":var(", tokens.chipBackgroundHover, ");", chipTokens.colorActive, ":var(", tokens.chipColorActive, ");", chipTokens.backgroundActive, ":var(", tokens.chipBackgroundActive, ");", chipTokens.backgroundReadOnly, ":var(", tokens.chipBackgroundReadOnly, ");", chipTokens.colorReadOnly, ":var(", tokens.chipColorReadOnly, ");", chipTokens.backgroundReadOnlyHover, ":var(", tokens.chipBackgroundReadOnlyHover, ");", chipTokens.colorReadOnlyHover, ":var(", tokens.chipColorReadOnlyHover, ");", chipTokens.borderRadius, ":var(", tokens.chipBorderRadius, ");", chipTokens.width, ":var(", tokens.chipWidth, ");", chipTokens.height, ":var(", tokens.chipHeight, ");", chipTokens.paddingRight, ":var(", tokens.chipPaddingRight, ");", chipTokens.paddingLeft, ":var(", tokens.chipPaddingLeft, ");", chipTokens.fontFamily, ":var(", tokens.chipFontFamily, ");", chipTokens.fontSize, ":var(", tokens.chipFontSize, ");", chipTokens.fontStyle, ":var(", tokens.chipFontStyle, ");", chipTokens.fontWeight, ":var(", tokens.chipFontWeight, ");", chipTokens.letterSpacing, ":var(", tokens.chipLetterSpacing, ");", chipTokens.lineHeight, ":var(", tokens.chipLineHeight, ");", chipTokens.clearContentMarginLeft, ":var(", tokens.chipClearContentMarginLeft, ");", chipTokens.clearContentMarginRight, ":var(", tokens.chipClearContentMarginRight, ");", chipTokens.scaleHover, ":var(", tokens.chipScaleHover, ");", chipTokens.scaleActive, ":var(", tokens.chipScaleActive, ");", chipTokens.closeIconSize, ":var(", tokens.chipCloseIconSize, ");", chipTokens.closeIconColor, ":var(", tokens.chipCloseIconColor, ");", chipTokens.focusColor, ":var(", tokens.focusColor, ");scroll-snap-align:center;scroll-snap-stop:normal;", /*#__PURE__*/addFocus({
|
16
16
|
outlineOffset: '0.0625rem',
|
17
17
|
outlineSize: '0.0625rem',
|
18
18
|
outlineRadius: /*#__PURE__*/"calc(var(".concat(tokens.chipBorderRadius, ") - 0.1rem)"),
|
19
19
|
outlineColor: /*#__PURE__*/"var(".concat(tokens.focusColor, ")")
|
20
|
-
}), " &[readonly]{opacity:var(", tokens.chipOpacityReadonly, ");}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;char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PURE__*/_styled("button", {
|
22
|
-
target: "e7ctrkt0",
|
23
|
-
label: "plasma-new-hope__TextChip"
|
24
|
-
})("display:block;flex:none;background:none;border:none;outline:none;padding:0;white-space:nowrap;cursor:pointer;font-family:var(", tokens.fontFamily, ");font-size:var(", tokens.fontSize, ");font-style:var(", tokens.fontStyle, ");font-weight:var(", tokens.fontWeight, ");letter-spacing:var(", tokens.letterSpacing, ");line-height:var(", tokens.lineHeight, ");color:var(", tokens.color, ");", /*#__PURE__*/addFocus({
|
25
|
-
outlineOffset: '0.0625rem',
|
26
|
-
outlineSize: '0.0625rem',
|
27
|
-
outlineRadius: /*#__PURE__*/"calc(var(".concat(tokens.chipBorderRadius, ") - 0.1rem)"),
|
28
|
-
outlineColor: /*#__PURE__*/"var(".concat(tokens.focusColor, ")")
|
29
|
-
}), " &:after{content:',';}&:last-child{&:after{content:'';}}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvVGV4dEZpZWxkL3VpL1RleHRGaWVsZENoaXAvVGV4dEZpZWxkQ2hpcC5zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBeURxQyIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL1RleHRGaWVsZC91aS9UZXh0RmllbGRDaGlwL1RleHRGaWVsZENoaXAuc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuXG5pbXBvcnQgeyBjaGlwQ29uZmlnLCBjaGlwVG9rZW5zIH0gZnJvbSAnLi4vLi4vLi4vQ2hpcCc7XG5pbXBvcnQgeyBjb21wb25lbnQsIG1lcmdlQ29uZmlnIH0gZnJ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LjA2MjVyZW0nLFxuICAgICAgICBvdXRsaW5lU2l6ZTogJzAuMDYyNXJlbScsXG4gICAgICAgIG91dGxpbmVSYWRpdXM6IGBjYWxjKHZhcigke3Rva2Vucy5jaGlwQm9yZGVyUmFkaXVzfSkgLSAwLjFyZW0pYCxcbiAgICAgICAgb3V0bGluZUNvbG9yOiBgdmFyKCR7dG9rZW5zLmZvY3VzQ29sb3J9KWAsXG4gICAgfSl9XG5cbiAgICAmOmFmdGVyIHtcbiAgICAgICAgY29udGVudDogJywnO1xuICAgIH1cblxuICAgICY6bGFzdC1jaGlsZCB7XG4gICAgICAgICY6YWZ0ZXIge1xuICAgICAgICAgICAgY29udGVudDogJyc7XG4gICAgICAgIH1cbiAgICB9XG5gO1xuIl19 */"));
|
20
|
+
}), " &[readonly]{opacity:var(", tokens.chipOpacityReadonly, ");}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvVGV4dEZpZWxkL3VpL1RleHRGaWVsZENoaXAvVGV4dEZpZWxkQ2hpcC5zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBWXNDIiwiZmlsZSI6Ii4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvVGV4dEZpZWxkL3VpL1RleHRGaWVsZENoaXAvVGV4dEZpZWxkQ2hpcC5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5cbmltcG9ydCB7IGNoaXBDb25maWcsIGNoaXBUb2tlbnMgfSBmcm9tICcuLi8uLi8uLi9DaGlwJztcbmltcG9ydCB7IGNvbXBvbmVudCwgbWVyZ2VDb25maWcgfSBmcm9tICcuLi8uLi8uLi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gICAgICBvdXRsaW5lUmFkaXVzOiBgY2FsYyh2YXIoJHt0b2tlbnMuY2hpcEJvcmRlclJhZGl1c30pIC0gMC4xcmVtKWAsXG4gICAgICAgIG91dGxpbmVDb2xvcjogYHZhcigke3Rva2Vucy5mb2N1c0NvbG9yfSlgLFxuICAgIH0pfVxuXG4gICAgJltyZWFkb25seV0ge1xuICAgICAgICBvcGFjaXR5OiB2YXIoJHt0b2tlbnMuY2hpcE9wYWNpdHlSZWFkb25seX0pO1xuICAgIH1cbmA7XG4iXX0= */"));
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import { css } from '@emotion/react';
|
2
2
|
import { classes, tokens } from '../../TextField.tokens';
|
3
3
|
import { Input, InputContainer, Label, StyledTextAfter, StyledTextBefore } from '../../TextField.styles';
|
4
|
-
export var base = /*#__PURE__*/css("&.", classes.outerLabelPlacement, "{", Label, "{position:relative;display:inline-block;color:var(", tokens.labelColor, ");}}&.", classes.innerLabelPlacement, "{", InputContainer, "{padding:var(", tokens.contentLabelInnerPadding, ");}", StyledTextAfter, ",", StyledTextBefore, "{padding:var(", tokens.contentLabelInnerPadding, ");}", Input, ":focus~", Label, ",", Input, ".", classes.hasValue, "~", Label, "{color:var(", tokens.placeholderColor, ");align-items:flex-start;padding:var(", tokens.labelInnerPadding, ");font-family:var(", tokens.labelInnerFontFamily, ");font-size:var(", tokens.labelInnerFontSize, ");font-style:var(", tokens.labelInnerFontStyle, ");font-weight:var(", tokens.labelInnerFontWeight, ");letter-spacing:var(", tokens.labelInnerLetterSpacing, ");line-height:var(", tokens.labelInnerLineHeight, ");}", Label, "{color:var(", tokens.placeholderColor, ");pointer-events:none;position:absolute;top:0;display:flex;align-items:center;box-sizing:border-box;height:var(", tokens.height, ");padding-top:calc(calc(var(", tokens.height, ") - var(", tokens.labelLineHeight, ")) / 2);padding-bottom:calc(calc(var(", tokens.height, ") - var(", tokens.labelLineHeight, ")) / 2);}&.", classes.clear, " ", Label, "{color:var(", tokens.clearPlaceholderColor, ");}};label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvVGV4dEZpZWxkL3ZhcmlhdGlvbnMvX2xhYmVsLXBsYWNlbWVudC9iYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUt1QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL1RleHRGaWVsZC92YXJpYXRpb25zL19sYWJlbC1wbGFjZW1lbnQvYmFzZS50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHsgY2xhc3NlcywgdG9rZW5zIH0gZnJvbSAnLi4vLi4vVGV4dEZpZWxkLnRva2Vucyc7XG5pbXBvcnQgeyBJbnB1dCwgSW5wdXRDb250YWluZXIsIExhYmVsLCBTdHlsZWRUZXh0QWZ0ZXIsIFN0eWxlZFRleHRCZWZvcmUgfSBmcm9tICcuLi8uLi9UZXh0RmllbGQuc3R5bGVzJztcblxuZXhwb3J0IGNvbnN0IGJhc2UgPSBjc3NgXG4gICAgJi4ke2NsYXNzZXMub3V0ZXJMYWJlbFBsYWNlbWVudH0ge1xuICAgICAgICAke0xhYmVsfSB7XG4gICAgICAgICAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgICAgICAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG4gICAgICAgICAgICBjb2xvcjogdmFyKCR7dG9rZW5zLmxhYmVsQ29sb3J9KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgICYuJHtjbGFzc2VzLmlubmVyTGFiZWxQbGFjZW1lbnR9IHtcbiAgICAgICAgJHtJbnB1dENvbnRhaW5lcn0ge1xuICAgICAgICAgICAgcGFkZGluZzogdmFyKCR7dG9rZW5zLmNvbnRlbnRMYWJlbElubmVyUGFkZGluZ30pO1xuICAgICAgICB9XG5cbiAgICAgICAgJHtTdHlsZWRUZXh0QWZ0ZXJ9LCAke1N0eWxlZFRleHRCZWZvcmV9IHtcbiAgICAgICAgICAgIHBhZGRpbmc6IHZhcigke3Rva2Vucy5jb250ZW50TGFiZWxJbm5lclBhZGRpbmd9KTtcbiAgICAgICAgfVxuXG4gICAgICAgIC8qINC/0L7QtNC90LjQvNCw0LXRgiBsYWJlbCDQstCy0LXRgNGFINC/0YDQuCDRhNC+0LrRg9GB0LUsINC90LDQu9C40YfQuNC4INC30L3QsNGH0LXQvdC40Y8gKi9cbiAgICAgICAgJHtJbnB1dH06Zm9jdXMgfiAke0xhYmVsfSwgJHtJbnB1dH0uJHtjbGFzc2VzLmhhc1ZhbHVlfSB+
|
4
|
+
export var base = /*#__PURE__*/css("&.", classes.outerLabelPlacement, "{", Label, "{position:relative;display:inline-block;color:var(", tokens.labelColor, ");}}&.", classes.innerLabelPlacement, "{", InputContainer, "{padding:var(", tokens.contentLabelInnerPadding, ");}", StyledTextAfter, ",", StyledTextBefore, "{padding:var(", tokens.contentLabelInnerPadding, ");}", Input, ":focus~", Label, ",", Input, ".", classes.hasValue, "~", Label, ",", Input, ".", classes.forcePlaceholder, "~", Label, "{color:var(", tokens.placeholderColor, ");align-items:flex-start;padding:var(", tokens.labelInnerPadding, ");font-family:var(", tokens.labelInnerFontFamily, ");font-size:var(", tokens.labelInnerFontSize, ");font-style:var(", tokens.labelInnerFontStyle, ");font-weight:var(", tokens.labelInnerFontWeight, ");letter-spacing:var(", tokens.labelInnerLetterSpacing, ");line-height:var(", tokens.labelInnerLineHeight, ");}", Label, "{color:var(", tokens.placeholderColor, ");pointer-events:none;position:absolute;top:0;display:flex;align-items:center;box-sizing:border-box;height:var(", tokens.height, ");padding-top:calc(calc(var(", tokens.height, ") - var(", tokens.labelLineHeight, ")) / 2);padding-bottom:calc(calc(var(", tokens.height, ") - var(", tokens.labelLineHeight, ")) / 2);}&.", classes.clear, " ", Label, "{color:var(", tokens.clearPlaceholderColor, ");}};label:plasma-new-hope__base;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvVGV4dEZpZWxkL3ZhcmlhdGlvbnMvX2xhYmVsLXBsYWNlbWVudC9iYXNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUt1QiIsImZpbGUiOiIuLi8uLi8uLi8uLi8uLi8uLi9zcmMtZW1vdGlvbi9jb21wb25lbnRzL1RleHRGaWVsZC92YXJpYXRpb25zL19sYWJlbC1wbGFjZW1lbnQvYmFzZS50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0JztcblxuaW1wb3J0IHsgY2xhc3NlcywgdG9rZW5zIH0gZnJvbSAnLi4vLi4vVGV4dEZpZWxkLnRva2Vucyc7XG5pbXBvcnQgeyBJbnB1dCwgSW5wdXRDb250YWluZXIsIExhYmVsLCBTdHlsZWRUZXh0QWZ0ZXIsIFN0eWxlZFRleHRCZWZvcmUgfSBmcm9tICcuLi8uLi9UZXh0RmllbGQuc3R5bGVzJztcblxuZXhwb3J0IGNvbnN0IGJhc2UgPSBjc3NgXG4gICAgJi4ke2NsYXNzZXMub3V0ZXJMYWJlbFBsYWNlbWVudH0ge1xuICAgICAgICAke0xhYmVsfSB7XG4gICAgICAgICAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgICAgICAgICBkaXNwbGF5OiBpbmxpbmUtYmxvY2s7XG4gICAgICAgICAgICBjb2xvcjogdmFyKCR7dG9rZW5zLmxhYmVsQ29sb3J9KTtcbiAgICAgICAgfVxuICAgIH1cbl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vbG9yfSk7XG4gICAgICAgIH1cbiAgICB9XG5gO1xuIl19 */"));
|
@@ -104,11 +104,6 @@ const meta: Meta<StorySelectProps> = {
|
|
104
104
|
},
|
105
105
|
if: { arg: 'required', truthy: false },
|
106
106
|
},
|
107
|
-
chipType: {
|
108
|
-
control: 'select',
|
109
|
-
options: ['default', 'text'],
|
110
|
-
if: { arg: 'target', eq: 'textfield-like' },
|
111
|
-
},
|
112
107
|
},
|
113
108
|
args: {
|
114
109
|
target: 'textfield-like',
|
@@ -126,7 +121,6 @@ const meta: Meta<StorySelectProps> = {
|
|
126
121
|
optional: false,
|
127
122
|
required: false,
|
128
123
|
requiredPlacement: 'right',
|
129
|
-
chipType: 'default',
|
130
124
|
},
|
131
125
|
parameters: {
|
132
126
|
controls: {
|
@@ -150,7 +144,6 @@ const meta: Meta<StorySelectProps> = {
|
|
150
144
|
'optional',
|
151
145
|
'required',
|
152
146
|
'requiredPlacement',
|
153
|
-
'chipType',
|
154
147
|
],
|
155
148
|
},
|
156
149
|
},
|
@@ -389,7 +382,7 @@ const SingleStory = (args: StorySelectProps) => {
|
|
389
382
|
export const Single: StoryObj<StorySelectProps> = {
|
390
383
|
parameters: {
|
391
384
|
controls: {
|
392
|
-
exclude: ['chipView', 'isTargetAmount'
|
385
|
+
exclude: ['chipView', 'isTargetAmount'],
|
393
386
|
},
|
394
387
|
},
|
395
388
|
render: (args) => <SingleStory {...args} />,
|
@@ -87,6 +87,12 @@ const meta: Meta<typeof TextField> = {
|
|
87
87
|
type: 'inline-radio',
|
88
88
|
},
|
89
89
|
},
|
90
|
+
hasPlaceholder: {
|
91
|
+
control: {
|
92
|
+
type: 'boolean',
|
93
|
+
},
|
94
|
+
if: { arg: 'labelPlacement', eq: 'inner' },
|
95
|
+
},
|
90
96
|
size: {
|
91
97
|
options: sizes,
|
92
98
|
control: {
|
@@ -134,10 +140,6 @@ const meta: Meta<typeof TextField> = {
|
|
134
140
|
control: { type: 'text' },
|
135
141
|
if: { arg: 'hasHint', truthy: true },
|
136
142
|
},
|
137
|
-
chipType: {
|
138
|
-
control: 'select',
|
139
|
-
options: ['default', 'text'],
|
140
|
-
},
|
141
143
|
},
|
142
144
|
};
|
143
145
|
|
@@ -214,6 +216,7 @@ export const Default: StoryObj<StoryPropsDefault> = {
|
|
214
216
|
view: 'default',
|
215
217
|
label: 'Лейбл',
|
216
218
|
labelPlacement: 'outer',
|
219
|
+
hasPlaceholder: false,
|
217
220
|
titleCaption: 'Подпись к полю',
|
218
221
|
textBefore: '',
|
219
222
|
textAfter: '',
|
@@ -237,11 +240,6 @@ export const Default: StoryObj<StoryPropsDefault> = {
|
|
237
240
|
hintWidth: '10rem',
|
238
241
|
hintHasArrow: true,
|
239
242
|
},
|
240
|
-
parameters: {
|
241
|
-
controls: {
|
242
|
-
exclude: ['chipType'],
|
243
|
-
},
|
244
|
-
},
|
245
243
|
render: (args) => <StoryDemo {...args} />,
|
246
244
|
};
|
247
245
|
|
@@ -297,7 +295,6 @@ export const Chips: StoryObj<StoryPropsChips> = {
|
|
297
295
|
args: {
|
298
296
|
...Default.args,
|
299
297
|
chips: ['1 value', '2 value', '3 value', '4 value'],
|
300
|
-
chipType: 'default',
|
301
298
|
},
|
302
299
|
render: (args) => <StoryChips {...args} />,
|
303
300
|
};
|
@@ -103,11 +103,6 @@ const meta: Meta<StorySelectProps> = {
|
|
103
103
|
},
|
104
104
|
if: { arg: 'required', truthy: false },
|
105
105
|
},
|
106
|
-
chipType: {
|
107
|
-
control: 'select',
|
108
|
-
options: ['default', 'text'],
|
109
|
-
if: { arg: 'target', eq: 'textfield-like' },
|
110
|
-
},
|
111
106
|
},
|
112
107
|
args: {
|
113
108
|
target: 'textfield-like',
|
@@ -125,7 +120,6 @@ const meta: Meta<StorySelectProps> = {
|
|
125
120
|
optional: false,
|
126
121
|
required: false,
|
127
122
|
requiredPlacement: 'right',
|
128
|
-
chipType: 'default',
|
129
123
|
},
|
130
124
|
parameters: {
|
131
125
|
controls: {
|
@@ -149,7 +143,6 @@ const meta: Meta<StorySelectProps> = {
|
|
149
143
|
'optional',
|
150
144
|
'required',
|
151
145
|
'requiredPlacement',
|
152
|
-
'chipType',
|
153
146
|
],
|
154
147
|
},
|
155
148
|
},
|
@@ -388,7 +381,7 @@ const SingleStory = (args: StorySelectProps) => {
|
|
388
381
|
export const Single: StoryObj<StorySelectProps> = {
|
389
382
|
parameters: {
|
390
383
|
controls: {
|
391
|
-
exclude: ['chipView', 'isTargetAmount'
|
384
|
+
exclude: ['chipView', 'isTargetAmount'],
|
392
385
|
},
|
393
386
|
},
|
394
387
|
render: (args) => <SingleStory {...args} />,
|
@@ -87,6 +87,12 @@ const meta: Meta<typeof TextField> = {
|
|
87
87
|
type: 'inline-radio',
|
88
88
|
},
|
89
89
|
},
|
90
|
+
hasPlaceholder: {
|
91
|
+
control: {
|
92
|
+
type: 'boolean',
|
93
|
+
},
|
94
|
+
if: { arg: 'labelPlacement', eq: 'inner' },
|
95
|
+
},
|
90
96
|
size: {
|
91
97
|
options: sizes,
|
92
98
|
control: {
|
@@ -134,10 +140,6 @@ const meta: Meta<typeof TextField> = {
|
|
134
140
|
control: { type: 'text' },
|
135
141
|
if: { arg: 'hasHint', truthy: true },
|
136
142
|
},
|
137
|
-
chipType: {
|
138
|
-
control: 'select',
|
139
|
-
options: ['default', 'text'],
|
140
|
-
},
|
141
143
|
},
|
142
144
|
};
|
143
145
|
|
@@ -214,6 +216,7 @@ export const Default: StoryObj<StoryPropsDefault> = {
|
|
214
216
|
view: 'default',
|
215
217
|
label: 'Лейбл',
|
216
218
|
labelPlacement: 'outer',
|
219
|
+
hasPlaceholder: false,
|
217
220
|
titleCaption: 'Подпись к полю',
|
218
221
|
textBefore: '',
|
219
222
|
textAfter: '',
|
@@ -223,11 +226,11 @@ export const Default: StoryObj<StoryPropsDefault> = {
|
|
223
226
|
readOnly: false,
|
224
227
|
enableContentLeft: true,
|
225
228
|
enableContentRight: true,
|
226
|
-
clear: false,
|
227
|
-
hasDivider: false,
|
228
229
|
optional: false,
|
229
230
|
required: false,
|
230
231
|
requiredPlacement: 'right',
|
232
|
+
clear: false,
|
233
|
+
hasDivider: false,
|
231
234
|
hasHint: true,
|
232
235
|
hintText: 'Текст подсказки',
|
233
236
|
hintTrigger: 'hover',
|
@@ -237,11 +240,6 @@ export const Default: StoryObj<StoryPropsDefault> = {
|
|
237
240
|
hintWidth: '10rem',
|
238
241
|
hintHasArrow: true,
|
239
242
|
},
|
240
|
-
parameters: {
|
241
|
-
controls: {
|
242
|
-
exclude: ['chipType'],
|
243
|
-
},
|
244
|
-
},
|
245
243
|
render: (args) => <StoryDemo {...args} />,
|
246
244
|
};
|
247
245
|
|
@@ -297,7 +295,6 @@ export const Chips: StoryObj<StoryPropsChips> = {
|
|
297
295
|
args: {
|
298
296
|
...Default.args,
|
299
297
|
chips: ['1 value', '2 value', '3 value', '4 value'],
|
300
|
-
chipType: 'default',
|
301
298
|
},
|
302
299
|
render: (args) => <StoryChips {...args} />,
|
303
300
|
};
|
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
.base_1jvcf9a_b1w985rt__78f0baf3[readonly] .base_1jvcf9a_i1j28rg8__78f0baf3{color:var(--plasma-textfield-color-readonly);background-color:var(--plasma-textfield-bg-color-readonly);box-shadow:inset 0 0 0 var(--plasma-textfield-border-width) var(--plasma-textfield-border-color-readonly);}.base_1jvcf9a_b1w985rt__78f0baf3[readonly].base_1jvcf9a_textfieldHasDivider__78f0baf3 .base_1jvcf9a_i1j28rg8__78f0baf3:before{background-color:var(--plasma-textfield-divider-color-readonly);}.base_1jvcf9a_b1w985rt__78f0baf3[readonly] .base_1jvcf9a_i1j28rg8__78f0baf3:hover{background-color:var(--plasma-textfield-bg-color-readonly);}.base_1jvcf9a_b1w985rt__78f0baf3[readonly] .base_1jvcf9a_i1j28rg8__78f0baf3:focus-within .base_1jvcf9a_ibt1ohz__78f0baf3,.base_1jvcf9a_b1w985rt__78f0baf3[readonly] .base_1jvcf9a_ibt1ohz__78f0baf3{color:var(--plasma-textfield__placeholder-color-readonly);}.base_1jvcf9a_b1w985rt__78f0baf3[readonly] .base_1jvcf9a_i13qvwoy__78f0baf3{color:var(--plasma-textfield-color-readonly);cursor:default;min-width:unset;}.base_1jvcf9a_b1w985rt__78f0baf3[readonly] .base_1jvcf9a_t600610__78f0baf3{color:var(--plasma-textfield__title-caption-color-readonly);}.base_1jvcf9a_b1w985rt__78f0baf3[readonly] .base_1jvcf9a_lb3k3v1__78f0baf3{color:var(--plasma-textfield__left-helper-color-readonly);}.base_1jvcf9a_b1w985rt__78f0baf3[readonly].base_1jvcf9a_labelPlacementOuter__78f0baf3 .base_1jvcf9a_l1gjsnfi__78f0baf3{color:var(--plasma-textfield__label-color-readonly);}
|
10
10
|
|
11
|
-
.
|
11
|
+
.base_y1lvvc_b15d3bnf__96eb1405.base_y1lvvc_labelPlacementOuter__96eb1405 .base_y1lvvc_l1gjsnfi__96eb1405{position:relative;display:inline-block;color:var(--plasma-textfield__label-color);}.base_y1lvvc_b15d3bnf__96eb1405.base_y1lvvc_labelPlacementInner__96eb1405 .base_y1lvvc_i19ry60d__96eb1405{padding:var(--plasma-textfield-placement_inner__content-padding);}.base_y1lvvc_b15d3bnf__96eb1405.base_y1lvvc_labelPlacementInner__96eb1405 .base_y1lvvc_smqgwd8__96eb1405,.base_y1lvvc_b15d3bnf__96eb1405.base_y1lvvc_labelPlacementInner__96eb1405 .base_y1lvvc_s7hnwwb__96eb1405{padding:var(--plasma-textfield-placement_inner__content-padding);}.base_y1lvvc_b15d3bnf__96eb1405.base_y1lvvc_labelPlacementInner__96eb1405 .base_y1lvvc_i13qvwoy__96eb1405:focus ~ .base_y1lvvc_l1gjsnfi__96eb1405,.base_y1lvvc_b15d3bnf__96eb1405.base_y1lvvc_labelPlacementInner__96eb1405 .base_y1lvvc_i13qvwoy__96eb1405.base_y1lvvc_hasValue__96eb1405 ~ .base_y1lvvc_l1gjsnfi__96eb1405,.base_y1lvvc_b15d3bnf__96eb1405.base_y1lvvc_labelPlacementInner__96eb1405 .base_y1lvvc_i13qvwoy__96eb1405.base_y1lvvc_forcePlaceholder__96eb1405 ~ .base_y1lvvc_l1gjsnfi__96eb1405{color:var(--plasma-textfield__placeholder-color);-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;padding:var(--plasma-textfield-placement_inner__label-padding);font-family:var(--plasma-textfield-placement_inner__label-font-family);font-size:var(--plasma-textfield-placement_inner__label-font-size);font-style:var(--plasma-textfield-placement_inner__label-font-style);font-weight:var(--plasma-textfield-placement_inner__label-font-weight);-webkit-letter-spacing:var(--plasma-textfield-placement_inner__label-letter-spacing);-moz-letter-spacing:var(--plasma-textfield-placement_inner__label-letter-spacing);-ms-letter-spacing:var(--plasma-textfield-placement_inner__label-letter-spacing);letter-spacing:var(--plasma-textfield-placement_inner__label-letter-spacing);line-height:var(--plasma-textfield-placement_inner__label-line-height);}.base_y1lvvc_b15d3bnf__96eb1405.base_y1lvvc_labelPlacementInner__96eb1405 .base_y1lvvc_l1gjsnfi__96eb1405{color:var(--plasma-textfield__placeholder-color);pointer-events:none;position:absolute;top:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;height:var(--plasma-textfield-height);padding-top:calc(calc(var(--plasma-textfield-height) - var(--plasma-textfield__label-line-height)) / 2);padding-bottom:calc(calc(var(--plasma-textfield-height) - var(--plasma-textfield__label-line-height)) / 2);}.base_y1lvvc_b15d3bnf__96eb1405.base_y1lvvc_labelPlacementInner__96eb1405.base_y1lvvc_textfieldClear__96eb1405 .base_y1lvvc_l1gjsnfi__96eb1405{color:var(--plasma-textfield__clear-placeholder-color);}
|
12
12
|
|
13
13
|
.base_l8etux_bbsd6t5__82026c13 .base_l8etux_hq39zt5__82026c13{--plasma-tooltip-background-color:var(--plasma-textfield__tooltip-background-color);--plasma-tooltip-box-shadow:var(--plasma-textfield__tooltip-box-shadow);--plasma-tooltip-color:var(--plasma-textfield__tooltip-color);}
|
14
14
|
|
@@ -20,26 +20,26 @@
|
|
20
20
|
.Tooltip_aay375_s1cz8cv8__390cdb21{--plasma-popover-arrow-mask-width:var(--plasma-tooltip-arrow-mask-width);--plasma-popover-arrow-mask-height:var(--plasma-tooltip-arrow-mask-height);--plasma-popover-arrow-mask-image:var(--plasma-tooltip-arrow-mask-image);--plasma-popover-arrow-background:var(--plasma-tooltip-arrow-background);--plasma-popover-arrow-height:var(--plasma-tooltip-arrow-height);--plasma-popover-arrow-edge-margin:var(--plasma-tooltip-arrow-edge-margin);}.Tooltip_aay375_s1cz8cv8__390cdb21.Tooltip_aay375_tooltipAnimated__390cdb21 .Tooltip_aay375_popoverRoot__390cdb21{-webkit-transition:opacity 200ms ease-in-out,visibility 200ms ease-in-out;transition:opacity 200ms ease-in-out,visibility 200ms ease-in-out;}
|
21
21
|
|
22
22
|
|
23
|
-
.
|
24
|
-
.
|
25
|
-
.
|
26
|
-
.
|
27
|
-
.
|
28
|
-
.
|
29
|
-
.
|
30
|
-
.
|
31
|
-
.
|
32
|
-
.
|
33
|
-
.
|
34
|
-
.
|
23
|
+
.TextField_styles_ppcxpx_i1j28rg8__b8b554b5{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;}
|
24
|
+
.TextField_styles_ppcxpx_i13zudoe__b8b554b5{-webkit-flex:1;-ms-flex:1;flex:1;overflow:scroll;position:relative;width:100%;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-scrollbar-width:none;-moz-scrollbar-width:none;-ms-scrollbar-width:none;scrollbar-width:none;overscroll-behavior:contain;}.TextField_styles_ppcxpx_i13zudoe__b8b554b5::-webkit-scrollbar{display:none;}.TextField_styles_ppcxpx_i13zudoe__b8b554b5.TextField_styles_ppcxpx_hasChips__b8b554b5{height:var(--plasma-textfield__chip-height);border-radius:var(--plasma-textfield__chip-border-radius);}
|
25
|
+
.TextField_styles_ppcxpx_so4bpie__b8b554b5{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;gap:var(--plasma-textfield__chip-gap);margin-right:var(--plasma-textfield__chip-gap);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}
|
26
|
+
.TextField_styles_ppcxpx_i13qvwoy__b8b554b5{box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;padding:0;background-color:transparent;outline:none;width:100%;z-index:1;}.TextField_styles_ppcxpx_i13qvwoy__b8b554b5::-webkit-input-placeholder{opacity:0;}.TextField_styles_ppcxpx_i13qvwoy__b8b554b5::-moz-placeholder{opacity:0;}.TextField_styles_ppcxpx_i13qvwoy__b8b554b5:-ms-input-placeholder{opacity:0;}.TextField_styles_ppcxpx_i13qvwoy__b8b554b5::placeholder{opacity:0;}
|
27
|
+
.TextField_styles_ppcxpx_i19ry60d__b8b554b5{position:relative;-webkit-flex:1;-ms-flex:1;flex:1;min-width:60%;}
|
28
|
+
.TextField_styles_ppcxpx_ibt1ohz__b8b554b5{position:absolute;top:0;left:0;right:0;bottom:0;z-index:0;white-space:nowrap;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font:inherit;-webkit-letter-spacing:inherit;-moz-letter-spacing:inherit;-ms-letter-spacing:inherit;letter-spacing:inherit;line-height:inherit;color:var(--plasma-textfield__placeholder-color);padding:var(--ibt1ohz-0);}
|
29
|
+
.TextField_styles_ppcxpx_olv9av6__b8b554b5{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:var(--olv9av6-0);}
|
30
|
+
.TextField_styles_ppcxpx_t600610__b8b554b5{display:inline-block;margin-left:auto;}
|
31
|
+
.TextField_styles_ppcxpx_suk2zst__b8b554b5{position:relative;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
32
|
+
.TextField_styles_ppcxpx_l1gjsnfi__b8b554b5{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}
|
33
|
+
.TextField_styles_ppcxpx_ssv2kwg__b8b554b5{margin:var(--plasma-textfield__left-content-margin);color:var(--ssv2kwg-0);line-height:0;}
|
34
|
+
.TextField_styles_ppcxpx_s190z894__b8b554b5{line-height:0;margin:var(--plasma-textfield__right-content-margin);color:var(--plasma-textfield-content-right-slot-color,var(--plasma-textfield-content-slot-color));}.TextField_styles_ppcxpx_s190z894__b8b554b5:hover{color:var(--plasma-textfield-content-right-slot-color-hover,var(--plasma-textfield-content-slot-color-hover));cursor:pointer;}.TextField_styles_ppcxpx_s190z894__b8b554b5:active{color:var(--plasma-textfield-content-right-slot-color-active,var(--plasma-textfield-content-slot-color-active));}
|
35
35
|
|
36
36
|
|
37
37
|
|
38
|
-
.
|
39
|
-
.
|
40
|
-
.
|
38
|
+
.TextField_styles_ppcxpx_s14qvple__b8b554b5{color:var(--plasma-textfield__optional-color);}
|
39
|
+
.TextField_styles_ppcxpx_s16itze4__b8b554b5{display:inline-block;line-height:0;}.TextField_styles_ppcxpx_s16itze4__b8b554b5.TextField_styles_ppcxpx_labelPlacementInner__b8b554b5{position:absolute;margin:0;inset:var(--plasma-textfield__hint-inner-label-placement-offset);}
|
40
|
+
.TextField_styles_ppcxpx_h1skqnhr__b8b554b5{color:var(--plasma-textfield__hint-icon-color);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
41
41
|
|
42
|
-
.
|
42
|
+
.TextField_styles_ppcxpx_s8yezh4__b8b554b5{position:absolute;border-radius:50%;background-color:var(--plasma-textfield__indicator-color);}.TextField_styles_ppcxpx_s8yezh4__b8b554b5.TextField_styles_ppcxpx_labelPlacementOuter__b8b554b5{width:var(--plasma-textfield__indicator-size-outer);height:var(--plasma-textfield__indicator-size-outer);inset:var(--plasma-textfield__indicator-placement-outer);}.TextField_styles_ppcxpx_s8yezh4__b8b554b5.TextField_styles_ppcxpx_labelPlacementOuter__b8b554b5.TextField_styles_ppcxpx_requiredAlignRight__b8b554b5{inset:var(--plasma-textfield__indicator-placement-outer-right);}.TextField_styles_ppcxpx_s8yezh4__b8b554b5.TextField_styles_ppcxpx_labelPlacementOuter__b8b554b5.TextField_styles_ppcxpx_requiredAlignRight__b8b554b5.TextField_styles_ppcxpx_textfieldHasHint__b8b554b5{right:calc(-1 * var(--plasma-textfield__indicator-size-outer));}.TextField_styles_ppcxpx_s8yezh4__b8b554b5.TextField_styles_ppcxpx_labelPlacementInner__b8b554b5{width:var(--plasma-textfield__indicator-size-inner);height:var(--plasma-textfield__indicator-size-inner);inset:var(--plasma-textfield__indicator-placement-inner);}.TextField_styles_ppcxpx_s8yezh4__b8b554b5.TextField_styles_ppcxpx_labelPlacementInner__b8b554b5.TextField_styles_ppcxpx_requiredAlignRight__b8b554b5{inset:var(--plasma-textfield__indicator-placement-inner-right);}
|
43
43
|
|
44
44
|
.base_1lwlv7t_b13tc97x__334a4e59{color:var(--plasma-chip-color);background-color:var(--plasma-chip-background);}.base_1lwlv7t_b13tc97x__334a4e59:hover{color:var(--plasma-chip-color-hover);background-color:var(--plasma-chip-background-hover);scale:var(--plasma-chip-scale-hover);}.base_1lwlv7t_b13tc97x__334a4e59:active{color:var(--plasma-chip-color-active);background-color:var(--plasma-chip-background-active);scale:var(--plasma-chip-scale-active);}
|
45
45
|
|
@@ -59,8 +59,7 @@
|
|
59
59
|
.Chip_styles_1mwwhiw_swddmyi__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-right-content-margin-left);margin-right:var(--plasma-chip-right-content-margin-right);}
|
60
60
|
.Chip_styles_1mwwhiw_s1pcflhj__07da4d18{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;margin-left:var(--plasma-chip-clear-content-margin-left);margin-right:var(--plasma-chip-clear-content-margin-right);color:var(--plasma-chip-close-icon-color);}
|
61
61
|
|
62
|
-
.
|
63
|
-
.TextFieldChip_styles_1yosnxc_t4nir3h__b8a89acb{display:block;-webkit-flex:none;-ms-flex:none;flex:none;background:none;border:none;outline:none;padding:0;white-space:nowrap;cursor:pointer;font-family:var(--plasma-textfield-font-family);font-size:var(--plasma-textfield-font-size);font-style:var(--plasma-textfield-font-style);font-weight:var(--plasma-textfield-font-weight);-webkit-letter-spacing:var(--plasma-textfield-letter-spacing);-moz-letter-spacing:var(--plasma-textfield-letter-spacing);-ms-letter-spacing:var(--plasma-textfield-letter-spacing);letter-spacing:var(--plasma-textfield-letter-spacing);line-height:var(--plasma-textfield-line-height);color:var(--plasma-textfield-color);position:relative;}.TextFieldChip_styles_1yosnxc_t4nir3h__b8a89acb::before{content:'';position:absolute;top:0.0625rem;left:0.0625rem;right:0.0625rem;bottom:0.0625rem;z-index:1;display:block;box-sizing:content-box;border:0.0625rem solid transparent;border-radius:calc(var(--plasma-textfield__chip-border-radius) - 0.1rem);-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.TextFieldChip_styles_1yosnxc_t4nir3h__b8a89acb.TextFieldChip_styles_1yosnxc_focusVisible__b8a89acb:focus::before,.TextFieldChip_styles_1yosnxc_t4nir3h__b8a89acb[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.0625rem var(--plasma-textfield-focus-color);}.TextFieldChip_styles_1yosnxc_t4nir3h__b8a89acb:after{content:',';}.TextFieldChip_styles_1yosnxc_t4nir3h__b8a89acb:last-child:after{content:'';}
|
62
|
+
.TextFieldChip_styles_1y8n7la_s32p7ut__8f291676{--plasma-chip-color:var(--plasma-textfield__chip-color);--plasma-chip-background:var(--plasma-textfield__chip-background);--plasma-chip-color-hover:var(--plasma-textfield__chip-color-hover);--plasma-chip-background-hover:var(--plasma-textfield__chip-background-hover);--plasma-chip-color-active:var(--plasma-textfield__chip-color-active);--plasma-chip-background-active:var(--plasma-textfield__chip-background-active);--plasma-chip-background-readonly:var(--plasma-textfield__chip-background-readonly);--plasma-chip-color-readonly:var(--plasma-textfield__chip-color-readonly);--plasma-chip-background-readonly-hover:var(--plasma-textfield__chip-background-readonly-hover);--plasma-chip-color-readonly-hover:var(--plasma-textfield__chip-color-readonly-hover);--plasma-chip-border-radius:var(--plasma-textfield__chip-border-radius);--plasma-chip-width:var(--plasma-textfield__chip-width);--plasma-chip-height:var(--plasma-textfield__chip-height);--plasma-chip-padding-right:var(--plasma-textfield__chip-padding-right);--plasma-chip-padding-left:var(--plasma-textfield__chip-padding-left);--plasma-chip-font-family:var(--plasma-textfield__chip-font-family);--plasma-chip-font-size:var(--plasma-textfield__chip-font-size);--plasma-chip-font-style:var(--plasma-textfield__chip-font-style);--plasma-chip-font-weight:var(--plasma-textfield__chip-font-weight);--plasma-chip-letter-spacing:var(--plasma-textfield__chip-letter-spacing);--plasma-chip-lineheight:var(--plasma-textfield__chip-line-height);--plasma-chip-clear-content-margin-left:var(--plasma-textfield__chip-clear-content-margin-left);--plasma-chip-clear-content-margin-right:var(--plasma-textfield__chip-clear-content-margin-right);--plasma-chip-scale-hover:var(--plasma-textfield__chip-scale-hover);--plasma-chip-scale-active:var(--plasma-textfield__chip-scale-active);--plasma-chip-close-icon-size:var(--plasma-textfield__chip-close-icon-size);--plasma-chip-close-icon-color:var(--plasma-textfield__chip-close-icon-color);--plasma-chip-focus-color:var(--plasma-textfield-focus-color);-webkit-scroll-snap-align:center;-moz-scroll-snap-align:center;-ms-scroll-snap-align:center;scroll-snap-align:center;-webkit-scroll-snap-stop:normal;-moz-scroll-snap-stop:normal;-ms-scroll-snap-stop:normal;scroll-snap-stop:normal;position:relative;}.TextFieldChip_styles_1y8n7la_s32p7ut__8f291676::before{content:'';position:absolute;top:0.0625rem;left:0.0625rem;right:0.0625rem;bottom:0.0625rem;z-index:1;display:block;box-sizing:content-box;border:0.0625rem solid transparent;border-radius:calc(var(--plasma-textfield__chip-border-radius) - 0.1rem);-webkit-transition:box-shadow 0.2s ease-in-out;transition:box-shadow 0.2s ease-in-out;pointer-events:none;}.TextFieldChip_styles_1y8n7la_s32p7ut__8f291676.TextFieldChip_styles_1y8n7la_focusVisible__8f291676:focus::before,.TextFieldChip_styles_1y8n7la_s32p7ut__8f291676[data-focus-visible-added]::before{outline:none;box-shadow:0 0 0 0.0625rem var(--plasma-textfield-focus-color);}.TextFieldChip_styles_1y8n7la_s32p7ut__8f291676[readonly]{opacity:var(--plasma-textfield__chip-opacity-readonly);}
|
64
63
|
|
65
64
|
.IconRoot_7pl7ig_svvlqhf__32c458a1{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;width:var(--svvlqhf-0);height:var(--svvlqhf-0);-webkit-flex:0 0 var(--svvlqhf-0);-ms-flex:0 0 var(--svvlqhf-0);flex:0 0 var(--svvlqhf-0);}
|
66
65
|
|
@@ -10,7 +10,7 @@ import { StyledTextField } from './ui/TextField/TextField.styles.js';
|
|
10
10
|
import { SuggestionItem } from './ui/SuggestionItem/SuggestionItem.js';
|
11
11
|
import { getPlacements } from '../../utils/getPopoverPlacement.js';
|
12
12
|
|
13
|
-
var _excluded = ["value", "onChange", "suggestions", "view", "size", "labelPlacement", "disabled", "readOnly", "label", "leftHelper", "contentLeft", "contentRight", "textBefore", "textAfter", "onScroll", "listMaxHeight", "listWidth", "portal", "filter", "onSuggestionSelect", "threshold", "renderList", "renderListEnd", "onSearch", "hintText"];
|
13
|
+
var _excluded = ["value", "onChange", "suggestions", "view", "size", "labelPlacement", "hasPlaceholder", "disabled", "readOnly", "label", "leftHelper", "contentLeft", "contentRight", "textBefore", "textAfter", "onScroll", "listMaxHeight", "listWidth", "portal", "filter", "onSuggestionSelect", "threshold", "renderList", "renderListEnd", "onSearch", "hintText"];
|
14
14
|
|
15
15
|
/**
|
16
16
|
* Компонент Autocomplete. Поле ввода с подсказками в выпадающем списке.
|
@@ -23,6 +23,7 @@ var autocompleteRoot = function autocompleteRoot(Root) {
|
|
23
23
|
view = _ref.view,
|
24
24
|
size = _ref.size,
|
25
25
|
labelPlacement = _ref.labelPlacement,
|
26
|
+
hasPlaceholder = _ref.hasPlaceholder,
|
26
27
|
disabled = _ref.disabled,
|
27
28
|
readOnly = _ref.readOnly,
|
28
29
|
label = _ref.label,
|
@@ -142,6 +143,11 @@ var autocompleteRoot = function autocompleteRoot(Root) {
|
|
142
143
|
"aria-activedescendant": "".concat(listId, "/").concat(focused),
|
143
144
|
"aria-describedby": helperTextId,
|
144
145
|
hintText: String(hintText || '')
|
146
|
+
}, labelPlacement === 'inner' ? {
|
147
|
+
labelPlacement: labelPlacement,
|
148
|
+
hasPlaceholder: hasPlaceholder
|
149
|
+
} : {
|
150
|
+
labelPlacement: labelPlacement
|
145
151
|
}, rest)),
|
146
152
|
preventOverflow: false,
|
147
153
|
ref: targetRef,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Autocomplete.js","sources":["../../../src/components/Autocomplete/Autocomplete.tsx"],"sourcesContent":["import React, { forwardRef, useState, useReducer } from 'react';\nimport { safeUseId } from '@salutejs/plasma-core';\n\nimport { useDidMountEffect, useOutsideClick } from '../../hooks';\nimport { RootProps } from '../../engines';\nimport { getPlacements } from '../../utils';\n\nimport { focusedReducer } from './reducers/focusedReducer';\nimport { SuggestionItem, StyledTextField } from './ui';\nimport { StyledPopover, Ul, LeftHelper, base, InfiniteLoaderWrapper } from './Autocomplete.styles';\nimport type { AutocompleteProps, SuggestionItemType } from './Autocomplete.types';\nimport { useKeyNavigation } from './hooks/useKeyboardNavigation';\n\n/**\n * Компонент Autocomplete. Поле ввода с подсказками в выпадающем списке.\n */\nexport const autocompleteRoot = (Root: RootProps<HTMLInputElement, AutocompleteProps>) =>\n forwardRef<HTMLInputElement, AutocompleteProps>(\n (\n {\n value: outerValue,\n onChange,\n suggestions,\n view,\n size,\n labelPlacement,\n disabled,\n readOnly,\n label,\n leftHelper,\n contentLeft,\n contentRight,\n textBefore,\n textAfter,\n onScroll,\n listMaxHeight,\n listWidth,\n portal,\n filter,\n onSuggestionSelect,\n threshold = 2,\n renderList,\n renderListEnd,\n onSearch,\n\n hintText,\n\n ...rest\n },\n ref,\n ) => {\n const [focused, dispatchFocused] = useReducer(focusedReducer, null);\n const [innerValue, setInnerValue] = useState<string | number>('');\n const [isOpen, setIsOpen] = useState(false);\n\n const listId = safeUseId();\n const value = outerValue ?? innerValue;\n\n const helperTextId = safeUseId();\n\n const targetRef = useOutsideClick<HTMLDivElement>(() => {\n setIsOpen(false);\n });\n\n const handleFocus = () => {\n if (value.toString().length >= threshold) {\n setIsOpen(true);\n }\n };\n\n const handleItemClick = (e: SuggestionItemType) => {\n setInnerValue(e.label);\n\n if (onSuggestionSelect) {\n onSuggestionSelect(e);\n }\n\n setIsOpen(false);\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const currentValue = e.target.value;\n\n setInnerValue(currentValue);\n\n if (onChange) {\n onChange(e);\n }\n\n if (currentValue.toString().length >= threshold) {\n setIsOpen(true);\n } else {\n setIsOpen(false);\n }\n };\n\n const defaultFilterCallback = ({ label }: { label: string }) => {\n return label.toLowerCase().includes(value.toString().toLowerCase());\n };\n\n const finalResults = suggestions?.filter(filter || defaultFilterCallback) || [];\n\n const { onKeyDown } = useKeyNavigation({\n isOpen,\n setIsOpen,\n focused,\n dispatchFocused,\n finalResults,\n handleItemClick,\n });\n\n useDidMountEffect(() => {\n dispatchFocused({ type: 'reset' });\n }, [value]);\n\n return (\n <Root view={view} size={size} labelPlacement={labelPlacement} disabled={disabled} readOnly={readOnly}>\n <StyledPopover\n opened={isOpen}\n offset={[0, 0]}\n placement={getPlacements('bottom')}\n isFocusTrapped={false}\n usePortal={Boolean(portal)}\n frame={portal}\n target={\n <StyledTextField\n value={value}\n onChange={handleChange}\n onSearch={focused === null ? onSearch : undefined}\n ref={ref}\n size={size}\n view={view}\n labelPlacement={labelPlacement}\n disabled={disabled}\n readOnly={readOnly}\n label={label}\n contentLeft={contentLeft}\n contentRight={contentRight}\n textBefore={textBefore}\n textAfter={textAfter}\n onFocus={handleFocus}\n onKeyDown={onKeyDown}\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-controls={listId}\n aria-expanded={isOpen}\n aria-activedescendant={`${listId}/${focused}`}\n aria-describedby={helperTextId}\n hintText={String(hintText || '')}\n {...rest}\n />\n }\n preventOverflow={false}\n ref={targetRef}\n listWidth={listWidth}\n >\n {(renderList && renderList(finalResults)) ||\n (Boolean(finalResults.length) && (\n <Root\n view={view}\n size={size}\n labelPlacement={labelPlacement}\n disabled={disabled}\n readOnly={readOnly}\n >\n <Ul\n id={listId}\n role=\"listbox\"\n aria-label={label}\n onScroll={onScroll}\n listMaxHeight={listMaxHeight}\n >\n {finalResults.map((suggestion, index) => (\n <SuggestionItem\n key={index}\n item={suggestion}\n onClick={handleItemClick}\n id={`${listId}/${index}`}\n focused={focused === index}\n />\n ))}\n\n {renderListEnd && (\n <InfiniteLoaderWrapper>{renderListEnd()}</InfiniteLoaderWrapper>\n )}\n </Ul>\n </Root>\n ))}\n </StyledPopover>\n\n {/* TODO: Дублируем хелпер для корректного позиционирования списка подсказок */}\n {leftHelper && (\n <LeftHelper id={helperTextId} disabled={disabled} readOnly={readOnly}>\n {leftHelper}\n </LeftHelper>\n )}\n </Root>\n );\n },\n );\n\nexport const autocompleteConfig = {\n name: 'Autocomplete',\n tag: 'div',\n layout: autocompleteRoot,\n base,\n defaults: {\n view: 'default',\n size: 'l',\n labelPlacement: 'outer',\n },\n variations: {\n view: {\n css: '',\n },\n },\n};\n"],"names":["autocompleteRoot","Root","forwardRef","_ref","ref","outerValue","value","onChange","suggestions","view","size","labelPlacement","disabled","readOnly","label","leftHelper","contentLeft","contentRight","textBefore","textAfter","onScroll","listMaxHeight","listWidth","portal","filter","onSuggestionSelect","_ref$threshold","threshold","renderList","renderListEnd","onSearch","hintText","rest","_objectWithoutProperties","_excluded","_useReducer","useReducer","focusedReducer","_useReducer2","_slicedToArray","focused","dispatchFocused","_useState","useState","_useState2","innerValue","setInnerValue","_useState3","_useState4","isOpen","setIsOpen","listId","safeUseId","helperTextId","targetRef","useOutsideClick","handleFocus","toString","length","handleItemClick","e","handleChange","currentValue","target","defaultFilterCallback","_ref2","toLowerCase","includes","finalResults","_useKeyNavigation","useKeyNavigation","onKeyDown","useDidMountEffect","type","React","createElement","StyledPopover","opened","offset","placement","getPlacements","isFocusTrapped","usePortal","Boolean","frame","StyledTextField","_extends","undefined","onFocus","role","concat","String","preventOverflow","Ul","id","map","suggestion","index","SuggestionItem","key","item","onClick","InfiniteLoaderWrapper","LeftHelper","autocompleteConfig","name","tag","layout","base","defaults","variations","css"],"mappings":";;;;;;;;;;;;;;AAaA;AACA;AACA;IACaA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,IAAoD,EAAA;AAAA,EAAA,oBACjFC,UAAU,CACN,UAAAC,IAAA,EA+BIC,GAAG,EACF;AAAA,IAAA,IA9BUC,UAAU,GAAAF,IAAA,CAAjBG,KAAK;MACLC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;MACRC,WAAW,GAAAL,IAAA,CAAXK,WAAW;MACXC,IAAI,GAAAN,IAAA,CAAJM,IAAI;MACJC,IAAI,GAAAP,IAAA,CAAJO,IAAI;MACJC,cAAc,GAAAR,IAAA,CAAdQ,cAAc;MACdC,QAAQ,GAAAT,IAAA,CAARS,QAAQ;MACRC,QAAQ,GAAAV,IAAA,CAARU,QAAQ;MACRC,KAAK,GAAAX,IAAA,CAALW,KAAK;MACLC,UAAU,GAAAZ,IAAA,CAAVY,UAAU;MACVC,WAAW,GAAAb,IAAA,C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G;QACzBzD,OAAO,EAAEA,OAAO,KAAKyD,KAAAA;AAAM,OAC9B,CAAC,CAAA;KACL,CAAC,EAEDpE,aAAa,iBACV6C,KAAA,CAAAC,aAAA,CAAC2B,qBAAqB,EAAA,IAAA,EAAEzE,aAAa,EAA0B,CAEnE,CACF,CAEH,CAAC,EAGfd,UAAU,iBACP2D,KAAA,CAAAC,aAAA,CAAC4B,UAAU,EAAA;AAACT,MAAAA,EAAE,EAAEzC,YAAa;AAACzC,MAAAA,QAAQ,EAAEA,QAAS;AAACC,MAAAA,QAAQ,EAAEA,QAAAA;KACvDE,EAAAA,UACO,CAEd,CAAC,CAAA;AAEf,GACJ,CAAC,CAAA;AAAA,EAAA;AAEE,IAAMyF,kBAAkB,GAAG;AAC9BC,EAAAA,IAAI,EAAE,cAAc;AACpBC,EAAAA,GAAG,EAAE,KAAK;AACVC,EAAAA,MAAM,EAAE3G,gBAAgB;AACxB4G,EAAAA,IAAI,EAAJA,IAAI;AACJC,EAAAA,QAAQ,EAAE;AACNpG,IAAAA,IAAI,EAAE,SAAS;AACfC,IAAAA,IAAI,EAAE,GAAG;AACTC,IAAAA,cAAc,EAAE,OAAA;GACnB;AACDmG,EAAAA,UAAU,EAAE;AACRrG,IAAAA,IAAI,EAAE;AACFsG,MAAAA,GAAG,EAAE,EAAA;AACT,KAAA;AACJ,GAAA;AACJ;;;;"}
|
1
|
+
{"version":3,"file":"Autocomplete.js","sources":["../../../src/components/Autocomplete/Autocomplete.tsx"],"sourcesContent":["import React, { forwardRef, useState, useReducer } from 'react';\nimport { safeUseId } from '@salutejs/plasma-core';\n\nimport { useDidMountEffect, useOutsideClick } from '../../hooks';\nimport { RootProps } from '../../engines';\nimport { getPlacements } from '../../utils';\n\nimport { focusedReducer } from './reducers/focusedReducer';\nimport { SuggestionItem, StyledTextField } from './ui';\nimport { StyledPopover, Ul, LeftHelper, base, InfiniteLoaderWrapper } from './Autocomplete.styles';\nimport type { AutocompleteProps, SuggestionItemType } from './Autocomplete.types';\nimport { useKeyNavigation } from './hooks/useKeyboardNavigation';\n\n/**\n * Компонент Autocomplete. Поле ввода с подсказками в выпадающем списке.\n */\nexport const autocompleteRoot = (Root: RootProps<HTMLInputElement, AutocompleteProps>) =>\n forwardRef<HTMLInputElement, AutocompleteProps>(\n (\n {\n value: outerValue,\n onChange,\n suggestions,\n view,\n size,\n labelPlacement,\n hasPlaceholder,\n disabled,\n readOnly,\n label,\n leftHelper,\n contentLeft,\n contentRight,\n textBefore,\n textAfter,\n onScroll,\n listMaxHeight,\n listWidth,\n portal,\n filter,\n onSuggestionSelect,\n threshold = 2,\n renderList,\n renderListEnd,\n onSearch,\n\n hintText,\n\n ...rest\n },\n ref,\n ) => {\n const [focused, dispatchFocused] = useReducer(focusedReducer, null);\n const [innerValue, setInnerValue] = useState<string | number>('');\n const [isOpen, setIsOpen] = useState(false);\n\n const listId = safeUseId();\n const value = outerValue ?? innerValue;\n\n const helperTextId = safeUseId();\n\n const targetRef = useOutsideClick<HTMLDivElement>(() => {\n setIsOpen(false);\n });\n\n const handleFocus = () => {\n if (value.toString().length >= threshold) {\n setIsOpen(true);\n }\n };\n\n const handleItemClick = (e: SuggestionItemType) => {\n setInnerValue(e.label);\n\n if (onSuggestionSelect) {\n onSuggestionSelect(e);\n }\n\n setIsOpen(false);\n };\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const currentValue = e.target.value;\n\n setInnerValue(currentValue);\n\n if (onChange) {\n onChange(e);\n }\n\n if (currentValue.toString().length >= threshold) {\n setIsOpen(true);\n } else {\n setIsOpen(false);\n }\n };\n\n const defaultFilterCallback = ({ label }: { label: string }) => {\n return label.toLowerCase().includes(value.toString().toLowerCase());\n };\n\n const finalResults = suggestions?.filter(filter || defaultFilterCallback) || [];\n\n const { onKeyDown } = useKeyNavigation({\n isOpen,\n setIsOpen,\n focused,\n dispatchFocused,\n finalResults,\n handleItemClick,\n });\n\n useDidMountEffect(() => {\n dispatchFocused({ type: 'reset' });\n }, [value]);\n\n return (\n <Root view={view} size={size} labelPlacement={labelPlacement} disabled={disabled} readOnly={readOnly}>\n <StyledPopover\n opened={isOpen}\n offset={[0, 0]}\n placement={getPlacements('bottom')}\n isFocusTrapped={false}\n usePortal={Boolean(portal)}\n frame={portal}\n target={\n <StyledTextField\n value={value}\n onChange={handleChange}\n onSearch={focused === null ? onSearch : undefined}\n ref={ref}\n size={size}\n view={view}\n labelPlacement={labelPlacement}\n disabled={disabled}\n readOnly={readOnly}\n label={label}\n contentLeft={contentLeft}\n contentRight={contentRight}\n textBefore={textBefore}\n textAfter={textAfter}\n onFocus={handleFocus}\n onKeyDown={onKeyDown}\n role=\"combobox\"\n aria-autocomplete=\"list\"\n aria-controls={listId}\n aria-expanded={isOpen}\n aria-activedescendant={`${listId}/${focused}`}\n aria-describedby={helperTextId}\n hintText={String(hintText || '')}\n {...(labelPlacement === 'inner'\n ? {\n labelPlacement,\n hasPlaceholder,\n }\n : { labelPlacement })}\n {...rest}\n />\n }\n preventOverflow={false}\n ref={targetRef}\n listWidth={listWidth}\n >\n {(renderList && renderList(finalResults)) ||\n (Boolean(finalResults.length) && (\n <Root\n view={view}\n size={size}\n labelPlacement={labelPlacement}\n disabled={disabled}\n readOnly={readOnly}\n >\n <Ul\n id={listId}\n role=\"listbox\"\n aria-label={label}\n onScroll={onScroll}\n listMaxHeight={listMaxHeight}\n >\n {finalResults.map((suggestion, index) => (\n <SuggestionItem\n key={index}\n item={suggestion}\n onClick={handleItemClick}\n id={`${listId}/${index}`}\n focused={focused === index}\n />\n ))}\n\n {renderListEnd && (\n <InfiniteLoaderWrapper>{renderListEnd()}</InfiniteLoaderWrapper>\n )}\n </Ul>\n </Root>\n ))}\n </StyledPopover>\n\n {/* TODO: Дублируем хелпер для корректного позиционирования списка подсказок */}\n {leftHelper && (\n <LeftHelper id={helperTextId} disabled={disabled} readOnly={readOnly}>\n {leftHelper}\n </LeftHelper>\n )}\n </Root>\n );\n },\n );\n\nexport const autocompleteConfig = {\n name: 'Autocomplete',\n tag: 'div',\n layout: autocompleteRoot,\n base,\n defaults: {\n view: 'default',\n size: 'l',\n labelPlacement: 'outer',\n },\n variations: {\n view: {\n css: '',\n },\n },\n};\n"],"names":["autocompleteRoot","Root","forwardRef","_ref","ref","outerValue","value","onChange","suggestions","view","size","labelPlacement","hasPlaceholder","disabled","readOnly","label","leftHelper","contentLeft","contentRight","textBefore","textAfter","onScroll","listMaxHeight","listWidth","portal","filter","onSuggestionSelect","_ref$threshold","threshold","renderList","renderListEnd","onSearch","hintText","rest","_objectWithoutProperties","_excluded","_useReducer","useReducer","focusedReducer","_useReducer2","_slicedToArray","focused","dispatchFocused","_useState","useState","_useState2","innerValue","setInnerValue","_useState3","_useState4","isOpen","setIsOpen","listId","safeUseId","helperTextId","targetRef","useOutsideClick","handleFocus","toString","length","handleItemClick","e","handleChange","currentValue","target","defaultFilterCallback","_ref2","toLowerCase","includes","finalResults","_useKeyNavigation","useKeyNavigation","onKeyDown","useDidMountEffect","type","React","createElement","StyledPopover","opened","offset","placement","getPlacements","isFocusTrapped","usePortal","Boolean","frame","StyledTextField","_extends","undefined","onFocus","role","concat","String","preventOverflow","Ul","id","map","suggestion","index","SuggestionItem","key","item","onClick","InfiniteLoaderWrapper","LeftHelper","autocompleteConfig","name","tag","layout","base","defaults","variations","css"],"mappings":";;;;;;;;;;;;;;AAaA;AACA;AACA;IACaA,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIC,IAAoD,EAAA;AAAA,EAAA,oBACjFC,UAAU,CACN,UAAAC,IAAA,EAgCIC,GAAG,EACF;AAAA,IAAA,IA/BUC,UAAU,GAAAF,IAAA,CAAjBG,KAAK;MACLC,QAAQ,GAAAJ,IAAA,CAARI,QAAQ;MACRC,WAAW,GAAAL,IAAA,CAAXK,WAAW;MACXC,IAAI,GAAAN,IAAA,CAAJM,IAAI;MACJC,IAAI,GAAAP,IAAA,CAAJO,IAAI;MACJC,cAAc,GAAAR,IAAA,CAAdQ,cAAc;MACdC,cAA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