@salutejs/plasma-new-hope 0.270.0-canary.1757.13385858717.0 → 0.270.0-canary.1770.13386075549.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/Autocomplete/Autocomplete.css +1 -1
- package/cjs/components/Calendar/CalendarBase/CalendarBase.js +2 -4
- package/cjs/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +2 -4
- package/cjs/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +2 -4
- package/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +2 -4
- package/cjs/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js.map +1 -1
- package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +2 -4
- package/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js.map +1 -1
- package/cjs/components/Combobox/ComboboxNew/Combobox.css +1 -1
- package/cjs/components/DatePicker/RangeDate/RangeDate.css +2 -2
- package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +2 -2
- package/cjs/components/DatePicker/SingleDate/SingleDate.css +1 -1
- package/cjs/components/Pagination/Pagination.css +1 -1
- package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +1 -1
- package/cjs/components/Range/Range.css +2 -2
- package/cjs/components/Range/Range.styles.js.map +1 -1
- package/cjs/components/Range/Range.tokens.js +2 -0
- package/cjs/components/Range/Range.tokens.js.map +1 -1
- package/cjs/components/Range/variations/_readonly/base.js +1 -1
- package/cjs/components/Range/variations/_readonly/base.js.map +1 -1
- package/cjs/components/Range/variations/_readonly/{base_8q1gx8.css → base_1jlqwtc.css} +1 -1
- package/cjs/components/Select/Select.css +1 -1
- package/cjs/components/Select/ui/Target/Target.css +1 -1
- package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.css +1 -1
- package/cjs/components/Slider/Slider.css +1 -1
- package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +1 -1
- package/cjs/components/TextArea/TextArea.js +9 -7
- package/cjs/components/TextArea/TextArea.js.map +1 -1
- package/cjs/components/TextArea/TextArea.tokens.js +3 -0
- package/cjs/components/TextArea/TextArea.tokens.js.map +1 -1
- package/cjs/components/TextArea/variations/_clear/base.js.map +1 -1
- package/cjs/components/TextArea/variations/_read-only/base.js +9 -0
- package/cjs/components/TextArea/variations/_read-only/base.js.map +1 -0
- package/cjs/components/TextArea/variations/_read-only/base_om8eo9.css +1 -0
- package/cjs/components/TextField/TextField.tokens.js +1 -0
- package/cjs/components/TextField/TextField.tokens.js.map +1 -1
- package/cjs/components/TextField/variations/_read-only/base.js +1 -1
- package/cjs/components/TextField/variations/_read-only/base.js.map +1 -1
- package/cjs/components/TextField/variations/_read-only/base_sr3to2.css +1 -0
- package/cjs/index.css +4 -2
- package/emotion/cjs/components/Calendar/CalendarBase/CalendarBase.js +2 -4
- package/emotion/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +2 -4
- package/emotion/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +2 -4
- package/emotion/cjs/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +2 -4
- package/emotion/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +2 -4
- package/emotion/cjs/components/Range/Range.styles.js +10 -10
- package/emotion/cjs/components/Range/Range.tokens.js +2 -0
- package/emotion/cjs/components/Range/variations/_readonly/base.js +1 -1
- package/emotion/cjs/components/TextArea/TextArea.js +10 -8
- package/emotion/cjs/components/TextArea/TextArea.tokens.js +3 -0
- package/emotion/cjs/components/TextArea/variations/_clear/base.js +1 -1
- package/emotion/cjs/components/TextArea/variations/_read-only/base.js +10 -0
- package/emotion/cjs/components/TextArea/variations/_read-only/tokens.json +1 -0
- package/emotion/cjs/components/TextField/TextField.tokens.js +1 -0
- package/emotion/cjs/components/TextField/variations/_read-only/base.js +1 -1
- package/emotion/cjs/components/_Icon/Icon.assets/Lock.js +26 -0
- package/emotion/cjs/components/_Icon/Icons/IconChevronLeft.js +8 -3
- package/emotion/cjs/components/_Icon/Icons/IconLock.js +29 -0
- package/emotion/cjs/components/_Icon/index.js +7 -0
- package/emotion/cjs/examples/plasma_b2c/components/Calendar/Calendar.stories.tsx +10 -10
- package/emotion/cjs/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +1 -13
- package/emotion/cjs/examples/plasma_b2c/components/Range/Range.config.js +7 -7
- package/emotion/cjs/examples/plasma_b2c/components/Range/Range.stories.tsx +14 -7
- package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.config.js +17 -14
- package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -20
- package/emotion/cjs/examples/plasma_b2c/components/TextField/TextField.config.js +22 -22
- package/emotion/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +92 -26
- package/emotion/cjs/examples/plasma_web/components/Calendar/Calendar.stories.tsx +10 -10
- package/emotion/cjs/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +0 -12
- package/emotion/cjs/examples/plasma_web/components/Range/Range.config.js +7 -7
- package/emotion/cjs/examples/plasma_web/components/Range/Range.stories.tsx +14 -7
- package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +71 -20
- package/emotion/cjs/examples/plasma_web/components/TextField/TextField.config.js +22 -22
- package/emotion/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +85 -25
- package/emotion/es/components/Calendar/CalendarBase/CalendarBase.js +2 -4
- package/emotion/es/components/Calendar/CalendarDouble/CalendarDouble.js +2 -4
- package/emotion/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +2 -4
- package/emotion/es/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +2 -4
- package/emotion/es/components/Calendar/ui/CalendarYears/CalendarYears.js +2 -4
- package/emotion/es/components/Range/Range.styles.js +10 -10
- package/emotion/es/components/Range/Range.tokens.js +2 -0
- package/emotion/es/components/Range/variations/_readonly/base.js +1 -1
- package/emotion/es/components/TextArea/TextArea.js +6 -4
- package/emotion/es/components/TextArea/TextArea.tokens.js +3 -0
- package/emotion/es/components/TextArea/variations/_clear/base.js +1 -1
- package/emotion/es/components/TextArea/variations/_read-only/base.js +4 -0
- package/emotion/es/components/TextArea/variations/_read-only/tokens.json +1 -0
- package/emotion/es/components/TextField/TextField.tokens.js +1 -0
- package/emotion/es/components/TextField/variations/_read-only/base.js +2 -2
- package/emotion/es/components/_Icon/Icon.assets/Lock.js +19 -0
- package/emotion/es/components/_Icon/Icons/IconChevronLeft.js +8 -3
- package/emotion/es/components/_Icon/Icons/IconLock.js +22 -0
- package/emotion/es/components/_Icon/index.js +1 -0
- package/emotion/es/examples/plasma_b2c/components/Calendar/Calendar.stories.tsx +10 -10
- package/emotion/es/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +1 -13
- package/emotion/es/examples/plasma_b2c/components/Range/Range.config.js +7 -7
- package/emotion/es/examples/plasma_b2c/components/Range/Range.stories.tsx +14 -7
- package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.config.js +17 -14
- package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -20
- package/emotion/es/examples/plasma_b2c/components/TextField/TextField.config.js +22 -22
- package/emotion/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +92 -26
- package/emotion/es/examples/plasma_web/components/Calendar/Calendar.stories.tsx +10 -10
- package/emotion/es/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +0 -12
- package/emotion/es/examples/plasma_web/components/Range/Range.config.js +7 -7
- package/emotion/es/examples/plasma_web/components/Range/Range.stories.tsx +14 -7
- package/emotion/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +71 -20
- package/emotion/es/examples/plasma_web/components/TextField/TextField.config.js +22 -22
- package/emotion/es/examples/plasma_web/components/TextField/TextField.stories.tsx +85 -25
- package/es/components/Autocomplete/Autocomplete.css +1 -1
- package/es/components/Calendar/CalendarBase/CalendarBase.js +2 -4
- package/es/components/Calendar/CalendarBase/CalendarBase.js.map +1 -1
- package/es/components/Calendar/CalendarDouble/CalendarDouble.js +2 -4
- package/es/components/Calendar/CalendarDouble/CalendarDouble.js.map +1 -1
- package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +2 -4
- package/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js.map +1 -1
- package/es/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +2 -4
- package/es/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js.map +1 -1
- package/es/components/Calendar/ui/CalendarYears/CalendarYears.js +2 -4
- package/es/components/Calendar/ui/CalendarYears/CalendarYears.js.map +1 -1
- package/es/components/Combobox/ComboboxNew/Combobox.css +1 -1
- package/es/components/DatePicker/RangeDate/RangeDate.css +2 -2
- package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +2 -2
- package/es/components/DatePicker/SingleDate/SingleDate.css +1 -1
- package/es/components/Pagination/Pagination.css +1 -1
- package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +1 -1
- package/es/components/Range/Range.css +2 -2
- package/es/components/Range/Range.styles.js.map +1 -1
- package/es/components/Range/Range.tokens.js +2 -0
- package/es/components/Range/Range.tokens.js.map +1 -1
- package/es/components/Range/variations/_readonly/base.js +1 -1
- package/es/components/Range/variations/_readonly/base.js.map +1 -1
- package/es/components/Range/variations/_readonly/{base_8q1gx8.css → base_1jlqwtc.css} +1 -1
- package/es/components/Select/Select.css +1 -1
- package/es/components/Select/ui/Target/Target.css +1 -1
- package/es/components/Select/ui/Target/ui/Textfield/Textfield.css +1 -1
- package/es/components/Slider/Slider.css +1 -1
- package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +1 -1
- package/es/components/TextArea/TextArea.js +9 -7
- package/es/components/TextArea/TextArea.js.map +1 -1
- package/es/components/TextArea/TextArea.tokens.js +3 -0
- package/es/components/TextArea/TextArea.tokens.js.map +1 -1
- package/es/components/TextArea/variations/_clear/base.js.map +1 -1
- package/es/components/TextArea/variations/_read-only/base.js +5 -0
- package/es/components/TextArea/variations/_read-only/base.js.map +1 -0
- package/es/components/TextArea/variations/_read-only/base_om8eo9.css +1 -0
- package/es/components/TextField/TextField.tokens.js +1 -0
- package/es/components/TextField/TextField.tokens.js.map +1 -1
- package/es/components/TextField/variations/_read-only/base.js +1 -1
- package/es/components/TextField/variations/_read-only/base.js.map +1 -1
- package/es/components/TextField/variations/_read-only/base_sr3to2.css +1 -0
- package/es/index.css +4 -2
- package/package.json +2 -2
- package/styled-components/cjs/components/Calendar/CalendarBase/CalendarBase.js +2 -4
- package/styled-components/cjs/components/Calendar/CalendarDouble/CalendarDouble.js +2 -4
- package/styled-components/cjs/components/Calendar/ui/CalendarMonths/CalendarMonths.js +2 -4
- package/styled-components/cjs/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +2 -4
- package/styled-components/cjs/components/Calendar/ui/CalendarYears/CalendarYears.js +2 -4
- package/styled-components/cjs/components/Range/Range.tokens.js +2 -0
- package/styled-components/cjs/components/Range/variations/_readonly/base.js +1 -1
- package/styled-components/cjs/components/TextArea/TextArea.js +9 -7
- package/styled-components/cjs/components/TextArea/TextArea.tokens.js +3 -0
- package/styled-components/cjs/components/TextArea/variations/_read-only/base.js +10 -0
- package/styled-components/cjs/components/TextArea/variations/_read-only/tokens.json +1 -0
- package/styled-components/cjs/components/TextField/TextField.tokens.js +1 -0
- package/styled-components/cjs/components/TextField/variations/_read-only/base.js +1 -1
- package/styled-components/cjs/components/_Icon/Icon.assets/Lock.js +26 -0
- package/styled-components/cjs/components/_Icon/Icons/IconChevronLeft.js +8 -3
- package/styled-components/cjs/components/_Icon/Icons/IconLock.js +29 -0
- package/styled-components/cjs/components/_Icon/index.js +7 -0
- package/styled-components/cjs/examples/plasma_b2c/components/Calendar/Calendar.stories.tsx +10 -10
- package/styled-components/cjs/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +1 -13
- package/styled-components/cjs/examples/plasma_b2c/components/Range/Range.config.js +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/Range/Range.stories.tsx +14 -7
- package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.config.js +3 -0
- package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -20
- package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.config.js +7 -7
- package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +92 -26
- package/styled-components/cjs/examples/plasma_web/components/Calendar/Calendar.stories.tsx +10 -10
- package/styled-components/cjs/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +0 -12
- package/styled-components/cjs/examples/plasma_web/components/Range/Range.config.js +1 -1
- package/styled-components/cjs/examples/plasma_web/components/Range/Range.stories.tsx +14 -7
- package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +71 -20
- package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.config.js +7 -7
- package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +85 -25
- package/styled-components/es/components/Calendar/CalendarBase/CalendarBase.js +2 -4
- package/styled-components/es/components/Calendar/CalendarDouble/CalendarDouble.js +2 -4
- package/styled-components/es/components/Calendar/ui/CalendarMonths/CalendarMonths.js +2 -4
- package/styled-components/es/components/Calendar/ui/CalendarQuarters/CalendarQuarters.js +2 -4
- package/styled-components/es/components/Calendar/ui/CalendarYears/CalendarYears.js +2 -4
- package/styled-components/es/components/Range/Range.tokens.js +2 -0
- package/styled-components/es/components/Range/variations/_readonly/base.js +1 -1
- package/styled-components/es/components/TextArea/TextArea.js +5 -3
- package/styled-components/es/components/TextArea/TextArea.tokens.js +3 -0
- package/styled-components/es/components/TextArea/variations/_read-only/base.js +4 -0
- package/styled-components/es/components/TextArea/variations/_read-only/tokens.json +1 -0
- package/styled-components/es/components/TextField/TextField.tokens.js +1 -0
- package/styled-components/es/components/TextField/variations/_read-only/base.js +2 -2
- package/styled-components/es/components/_Icon/Icon.assets/Lock.js +19 -0
- package/styled-components/es/components/_Icon/Icons/IconChevronLeft.js +8 -3
- package/styled-components/es/components/_Icon/Icons/IconLock.js +22 -0
- package/styled-components/es/components/_Icon/index.js +1 -0
- package/styled-components/es/examples/plasma_b2c/components/Calendar/Calendar.stories.tsx +10 -10
- package/styled-components/es/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +1 -13
- package/styled-components/es/examples/plasma_b2c/components/Range/Range.config.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/Range/Range.stories.tsx +14 -7
- package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.config.js +3 -0
- package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +71 -20
- package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.config.js +7 -7
- package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +92 -26
- package/styled-components/es/examples/plasma_web/components/Calendar/Calendar.stories.tsx +10 -10
- package/styled-components/es/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +0 -12
- package/styled-components/es/examples/plasma_web/components/Range/Range.config.js +1 -1
- package/styled-components/es/examples/plasma_web/components/Range/Range.stories.tsx +14 -7
- package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +71 -20
- package/styled-components/es/examples/plasma_web/components/TextField/TextField.config.js +7 -7
- package/styled-components/es/examples/plasma_web/components/TextField/TextField.stories.tsx +85 -25
- package/types/components/Calendar/CalendarBase/CalendarBase.d.ts.map +1 -1
- package/types/components/Calendar/CalendarDouble/CalendarDouble.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarMonths/CalendarMonths.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarQuarters/CalendarQuarters.d.ts.map +1 -1
- package/types/components/Calendar/ui/CalendarYears/CalendarYears.d.ts.map +1 -1
- package/types/components/Range/Range.tokens.d.ts +2 -0
- package/types/components/Range/Range.tokens.d.ts.map +1 -1
- package/types/components/Range/variations/_readonly/base.d.ts.map +1 -1
- package/types/components/TextArea/TextArea.d.ts +3 -2
- package/types/components/TextArea/TextArea.d.ts.map +1 -1
- package/types/components/TextArea/TextArea.tokens.d.ts +3 -0
- package/types/components/TextArea/TextArea.tokens.d.ts.map +1 -1
- package/types/components/TextArea/variations/_clear/base.d.ts.map +1 -1
- package/types/components/TextArea/variations/_read-only/base.d.ts +2 -0
- package/types/components/TextArea/variations/_read-only/base.d.ts.map +1 -0
- 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/variations/_read-only/base.d.ts.map +1 -1
- package/types/components/_Icon/Icon.assets/Lock.d.ts +4 -0
- package/types/components/_Icon/Icon.assets/Lock.d.ts.map +1 -0
- package/types/components/_Icon/Icons/IconChevronLeft.d.ts.map +1 -1
- package/types/components/_Icon/Icons/IconLock.d.ts +4 -0
- package/types/components/_Icon/Icons/IconLock.d.ts.map +1 -0
- package/types/components/_Icon/index.d.ts +1 -0
- package/types/components/_Icon/index.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/Range/Range.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/TextArea/TextArea.config.d.ts +3 -0
- package/types/examples/plasma_b2c/components/TextArea/TextArea.config.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/TextArea/TextArea.d.ts +3 -0
- package/types/examples/plasma_b2c/components/TextArea/TextArea.d.ts.map +1 -1
- package/types/examples/plasma_b2c/components/TextField/TextField.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/Range/Range.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/TextField/TextField.config.d.ts.map +1 -1
- package/cjs/components/TextField/variations/_read-only/base_oizdmx.css +0 -1
- package/es/components/TextField/variations/_read-only/base_oizdmx.css +0 -1
@@ -8,6 +8,7 @@ import { textAreaConfig } from '../../../../components/TextArea';
|
|
8
8
|
import { mergeConfig } from '../../../../engines';
|
9
9
|
import { WithTheme, argTypesFromConfig } from '../../../_helpers';
|
10
10
|
import type { PopoverPlacement } from '../Popover/Popover';
|
11
|
+
import { IconLock } from '../../../../components/_Icon';
|
11
12
|
|
12
13
|
import { config } from './TextArea.config';
|
13
14
|
import { TextArea } from './TextArea';
|
@@ -38,6 +39,16 @@ const placements: Array<PopoverPlacement> = [
|
|
38
39
|
'auto',
|
39
40
|
];
|
40
41
|
|
42
|
+
const getIcon = (IconComponent: React.ReactElement, size: string, readOnly = false) => {
|
43
|
+
const iconSize = size === 'xs' ? 'xs' : 's';
|
44
|
+
|
45
|
+
if (readOnly) {
|
46
|
+
return <IconLock size={iconSize} color="var(--text-secondary)" style={{ opacity: 0.4 }} />;
|
47
|
+
}
|
48
|
+
|
49
|
+
return <IconComponent size={iconSize} color="inherit" />;
|
50
|
+
};
|
51
|
+
|
41
52
|
type StoryTextAreaPropsCustom = {
|
42
53
|
hasHint?: boolean;
|
43
54
|
enableContentRight?: boolean;
|
@@ -61,19 +72,25 @@ const meta: Meta<StoryTextAreaProps> = {
|
|
61
72
|
control: {
|
62
73
|
type: 'boolean',
|
63
74
|
},
|
64
|
-
if: {
|
75
|
+
if: {
|
76
|
+
arg: 'optional',
|
77
|
+
truthy: false,
|
78
|
+
},
|
65
79
|
},
|
66
80
|
optional: {
|
67
81
|
control: {
|
68
82
|
type: 'boolean',
|
69
83
|
},
|
70
|
-
if: {
|
84
|
+
if: {
|
85
|
+
arg: 'required',
|
86
|
+
truthy: false,
|
87
|
+
},
|
71
88
|
},
|
72
89
|
size: {
|
73
90
|
options: sizes,
|
74
91
|
defaultValue: 'm',
|
75
92
|
control: {
|
76
|
-
type: '
|
93
|
+
type: 'inline-radio',
|
77
94
|
},
|
78
95
|
},
|
79
96
|
view: {
|
@@ -92,19 +109,28 @@ const meta: Meta<StoryTextAreaProps> = {
|
|
92
109
|
control: {
|
93
110
|
type: 'boolean',
|
94
111
|
},
|
95
|
-
if: {
|
112
|
+
if: {
|
113
|
+
arg: 'clear',
|
114
|
+
truthy: true,
|
115
|
+
},
|
96
116
|
},
|
97
117
|
cols: {
|
98
118
|
control: {
|
99
119
|
type: 'number',
|
100
120
|
},
|
101
|
-
if: {
|
121
|
+
if: {
|
122
|
+
arg: 'clear',
|
123
|
+
truthy: false,
|
124
|
+
},
|
102
125
|
},
|
103
126
|
rows: {
|
104
127
|
control: {
|
105
128
|
type: 'number',
|
106
129
|
},
|
107
|
-
if: {
|
130
|
+
if: {
|
131
|
+
arg: 'clear',
|
132
|
+
truthy: false,
|
133
|
+
},
|
108
134
|
},
|
109
135
|
hasHint: {
|
110
136
|
control: {
|
@@ -113,47 +139,65 @@ const meta: Meta<StoryTextAreaProps> = {
|
|
113
139
|
},
|
114
140
|
hintText: {
|
115
141
|
control: { type: 'text' },
|
116
|
-
if: {
|
142
|
+
if: {
|
143
|
+
arg: 'hasHint',
|
144
|
+
truthy: true,
|
145
|
+
},
|
117
146
|
},
|
118
147
|
hintView: {
|
119
148
|
options: hintViews,
|
120
149
|
control: {
|
121
150
|
type: 'select',
|
122
151
|
},
|
123
|
-
if: {
|
152
|
+
if: {
|
153
|
+
arg: 'hasHint',
|
154
|
+
truthy: true,
|
155
|
+
},
|
124
156
|
},
|
125
157
|
hintSize: {
|
126
158
|
options: hintSizes,
|
127
159
|
control: {
|
128
160
|
type: 'select',
|
129
161
|
},
|
130
|
-
if: {
|
162
|
+
if: {
|
163
|
+
arg: 'hasHint',
|
164
|
+
truthy: true,
|
165
|
+
},
|
131
166
|
},
|
132
167
|
hintTrigger: {
|
133
168
|
options: hintTriggers,
|
134
169
|
control: {
|
135
170
|
type: 'inline-radio',
|
136
171
|
},
|
137
|
-
if: {
|
172
|
+
if: {
|
173
|
+
arg: 'hasHint',
|
174
|
+
truthy: true,
|
175
|
+
},
|
138
176
|
},
|
139
177
|
hintPlacement: {
|
140
178
|
options: placements,
|
141
179
|
control: {
|
142
180
|
type: 'select',
|
143
181
|
},
|
144
|
-
if: {
|
182
|
+
if: {
|
183
|
+
arg: 'hasHint',
|
184
|
+
truthy: true,
|
185
|
+
},
|
145
186
|
mappers: placements,
|
146
187
|
},
|
147
188
|
hintHasArrow: {
|
148
189
|
control: { type: 'boolean' },
|
149
|
-
if: {
|
190
|
+
if: {
|
191
|
+
arg: 'hasHint',
|
192
|
+
truthy: true,
|
193
|
+
},
|
150
194
|
},
|
151
195
|
hintWidth: {
|
152
196
|
control: { type: 'text' },
|
153
|
-
if: {
|
154
|
-
|
155
|
-
|
156
|
-
|
197
|
+
if: {
|
198
|
+
arg: 'hasHint',
|
199
|
+
truthy: true,
|
200
|
+
},
|
157
201
|
},
|
158
202
|
width: {
|
159
203
|
control: { type: 'text' },
|
@@ -172,6 +216,7 @@ const meta: Meta<StoryTextAreaProps> = {
|
|
172
216
|
},
|
173
217
|
...disableProps([
|
174
218
|
'helperBlock',
|
219
|
+
'helperText',
|
175
220
|
'$isFocused',
|
176
221
|
'contentRight',
|
177
222
|
'autoComplete',
|
@@ -195,6 +240,7 @@ const meta: Meta<StoryTextAreaProps> = {
|
|
195
240
|
'hintOffset',
|
196
241
|
'hintContentLeft',
|
197
242
|
'hintView',
|
243
|
+
'hintOpened',
|
198
244
|
]),
|
199
245
|
},
|
200
246
|
args: {
|
@@ -238,19 +284,24 @@ const onBlur = action('onBlur');
|
|
238
284
|
const StoryDefault = (props: StoryTextAreaProps) => {
|
239
285
|
const [value, setValue] = useState('Значение поля');
|
240
286
|
|
241
|
-
const iconSize = props.size === 'xs' ? 'xs' : 's';
|
242
|
-
|
243
287
|
return (
|
244
288
|
<TextArea
|
245
289
|
value={value}
|
246
|
-
contentRight={
|
290
|
+
contentRight={
|
291
|
+
props.enableContentRight || props.readOnly
|
292
|
+
? getIcon(IconPlaceholder, props.size, props.readOnly)
|
293
|
+
: undefined
|
294
|
+
}
|
247
295
|
onChange={(e) => {
|
248
296
|
setValue(e.target.value);
|
249
297
|
onChange(e);
|
250
298
|
}}
|
251
299
|
onFocus={onFocus}
|
252
300
|
onBlur={onBlur}
|
253
|
-
style={{
|
301
|
+
style={{
|
302
|
+
width: '70%',
|
303
|
+
margin: '0 auto',
|
304
|
+
}}
|
254
305
|
{...props}
|
255
306
|
/>
|
256
307
|
);
|
@@ -33,12 +33,12 @@ var config = exports.config = {
|
|
33
33
|
"true": /*#__PURE__*/(0, _styledComponents.css)([""])
|
34
34
|
},
|
35
35
|
chipView: {
|
36
|
-
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-hover);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-active);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--inverse-text-secondary);", ":
|
37
|
-
secondary: /*#__PURE__*/(0, _styledComponents.css)(["", ":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);", ":var(--text-secondary);", ":
|
38
|
-
accent: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--surface-accent-hover);", ":var(--on-dark-text-primary);", ":var(--surface-accent-active);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":
|
39
|
-
positive: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":var(--surface-positive-hover);", ":var(--on-dark-text-primary);", ":var(--surface-positive-active);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":
|
40
|
-
warning: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-warning);", ":var(--on-dark-text-primary);", ":var(--surface-warning-hover);", ":var(--on-dark-text-primary);", ":var(--surface-warning-active);", ":var(--surface-warning);", ":var(--on-dark-text-primary);", ":var(--surface-warning);", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":
|
41
|
-
negative: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--surface-negative-hover);", ":var(--on-dark-text-primary);", ":var(--surface-negative-active);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":
|
36
|
+
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-hover);", ":var(--inverse-text-primary);", ":var(--surface-solid-default-active);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--surface-solid-default);", ":var(--inverse-text-primary);", ":var(--inverse-text-secondary);", ":1;"], _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.chipCloseIconColor, _TextField.textFieldTokens.chipOpacityReadonly),
|
37
|
+
secondary: /*#__PURE__*/(0, _styledComponents.css)(["", ":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);", ":var(--text-secondary);", ":1;"], _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.chipCloseIconColor, _TextField.textFieldTokens.chipOpacityReadonly),
|
38
|
+
accent: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--surface-accent-hover);", ":var(--on-dark-text-primary);", ":var(--surface-accent-active);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--surface-accent);", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":1;"], _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.chipCloseIconColor, _TextField.textFieldTokens.chipOpacityReadonly),
|
39
|
+
positive: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":var(--surface-positive-hover);", ":var(--on-dark-text-primary);", ":var(--surface-positive-active);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":var(--surface-positive);", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":1;"], _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.chipCloseIconColor, _TextField.textFieldTokens.chipOpacityReadonly),
|
40
|
+
warning: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-warning);", ":var(--on-dark-text-primary);", ":var(--surface-warning-hover);", ":var(--on-dark-text-primary);", ":var(--surface-warning-active);", ":var(--surface-warning);", ":var(--on-dark-text-primary);", ":var(--surface-warning);", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":1;"], _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.chipCloseIconColor, _TextField.textFieldTokens.chipOpacityReadonly),
|
41
|
+
negative: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-dark-text-primary);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--surface-negative-hover);", ":var(--on-dark-text-primary);", ":var(--surface-negative-active);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--surface-negative);", ":var(--on-dark-text-primary);", ":var(--on-dark-text-secondary);", ":1;"], _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.chipCloseIconColor, _TextField.textFieldTokens.chipOpacityReadonly)
|
42
42
|
},
|
43
43
|
hintView: {
|
44
44
|
"default": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--surface-solid-card-brightness);", ":var(--shadow-down-hard-m,0px 4px 12px 0px rgba(0,0,0,0.16),0px 1px 4px 0px rgba(0,0,0,0.08));", ":var(--text-primary);", ":var(--surface-solid-card);"], _TextField.textFieldTokens.tooltipBackgroundColor, _TextField.textFieldTokens.tooltipBoxShadow, _TextField.textFieldTokens.tooltipColor, _TextField.textFieldTokens.tooltipArrowBackground)
|
@@ -51,7 +51,7 @@ var config = exports.config = {
|
|
51
51
|
"true": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;"], _TextField.textFieldTokens.disabledOpacity)
|
52
52
|
},
|
53
53
|
readOnly: {
|
54
|
-
"true": /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--text-
|
54
|
+
"true": /*#__PURE__*/(0, _styledComponents.css)(["", ":0.4;", ":var(--text-primary);", ":var(--surface-transparent-primary);", ":var(--surface-transparent-tertiary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-primary);", ":var(--surface-transparent-primary);"], _TextField.textFieldTokens.readOnlyOpacity, _TextField.textFieldTokens.colorReadOnly, _TextField.textFieldTokens.backgroundColorReadOnly, _TextField.textFieldTokens.borderColorReadOnly, _TextField.textFieldTokens.placeholderColorReadOnly, _TextField.textFieldTokens.leftHelperColorReadOnly, _TextField.textFieldTokens.titleCaptionColorReadOnly, _TextField.textFieldTokens.labelColorReadOnly, _TextField.textFieldTokens.dividerColorReadOnly)
|
55
55
|
}
|
56
56
|
}
|
57
57
|
};
|
package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx
CHANGED
@@ -4,7 +4,7 @@ import { action } from '@storybook/addon-actions';
|
|
4
4
|
import { IconPlaceholder } from '@salutejs/plasma-sb-utils';
|
5
5
|
|
6
6
|
import { WithTheme } from '../../../_helpers';
|
7
|
-
import { IconCross } from '../../../../components/_Icon';
|
7
|
+
import { IconCross, IconLock } from '../../../../components/_Icon';
|
8
8
|
import type { PopoverPlacement } from '../Popover/Popover';
|
9
9
|
|
10
10
|
import { TextField } from './TextField';
|
@@ -43,6 +43,16 @@ const placements: Array<PopoverPlacement> = [
|
|
43
43
|
'auto',
|
44
44
|
];
|
45
45
|
|
46
|
+
const getIcon = (IconComponent: React.ReactElement, size: string, readOnly = false) => {
|
47
|
+
const iconSize = size === 'xs' ? 'xs' : 's';
|
48
|
+
|
49
|
+
if (readOnly) {
|
50
|
+
return <IconLock size={iconSize} color="var(--text-secondary)" style={{ opacity: 0.4 }} />;
|
51
|
+
}
|
52
|
+
|
53
|
+
return <IconComponent size={iconSize} color="inherit" />;
|
54
|
+
};
|
55
|
+
|
46
56
|
const meta: Meta<typeof TextField> = {
|
47
57
|
title: 'web/Data Entry/TextField',
|
48
58
|
component: TextField,
|
@@ -58,19 +68,28 @@ const meta: Meta<typeof TextField> = {
|
|
58
68
|
control: {
|
59
69
|
type: 'boolean',
|
60
70
|
},
|
61
|
-
if: {
|
71
|
+
if: {
|
72
|
+
arg: 'optional',
|
73
|
+
truthy: false,
|
74
|
+
},
|
62
75
|
},
|
63
76
|
optional: {
|
64
77
|
control: {
|
65
78
|
type: 'boolean',
|
66
79
|
},
|
67
|
-
if: {
|
80
|
+
if: {
|
81
|
+
arg: 'required',
|
82
|
+
truthy: false,
|
83
|
+
},
|
68
84
|
},
|
69
85
|
hasDivider: {
|
70
86
|
control: {
|
71
87
|
type: 'boolean',
|
72
88
|
},
|
73
|
-
if: {
|
89
|
+
if: {
|
90
|
+
arg: 'clear',
|
91
|
+
truthy: true,
|
92
|
+
},
|
74
93
|
},
|
75
94
|
view: {
|
76
95
|
options: views,
|
@@ -93,7 +112,10 @@ const meta: Meta<typeof TextField> = {
|
|
93
112
|
control: {
|
94
113
|
type: 'boolean',
|
95
114
|
},
|
96
|
-
if: {
|
115
|
+
if: {
|
116
|
+
arg: 'labelPlacement',
|
117
|
+
eq: 'inner',
|
118
|
+
},
|
97
119
|
},
|
98
120
|
size: {
|
99
121
|
options: sizes,
|
@@ -103,51 +125,75 @@ const meta: Meta<typeof TextField> = {
|
|
103
125
|
},
|
104
126
|
hintText: {
|
105
127
|
control: { type: 'text' },
|
106
|
-
if: {
|
128
|
+
if: {
|
129
|
+
arg: 'hasHint',
|
130
|
+
truthy: true,
|
131
|
+
},
|
107
132
|
},
|
108
133
|
hintView: {
|
109
134
|
options: hintViews,
|
110
135
|
control: {
|
111
136
|
type: 'select',
|
112
137
|
},
|
113
|
-
if: {
|
138
|
+
if: {
|
139
|
+
arg: 'hasHint',
|
140
|
+
truthy: true,
|
141
|
+
},
|
114
142
|
},
|
115
143
|
hintSize: {
|
116
144
|
options: hintSizes,
|
117
145
|
control: {
|
118
146
|
type: 'select',
|
119
147
|
},
|
120
|
-
if: {
|
148
|
+
if: {
|
149
|
+
arg: 'hasHint',
|
150
|
+
truthy: true,
|
151
|
+
},
|
121
152
|
},
|
122
153
|
hintTargetPlacement: {
|
123
154
|
options: hintTargetPlacements,
|
124
155
|
control: {
|
125
156
|
type: 'inline-radio',
|
126
157
|
},
|
127
|
-
if: {
|
158
|
+
if: {
|
159
|
+
arg: 'hasHint',
|
160
|
+
truthy: true,
|
161
|
+
},
|
128
162
|
},
|
129
163
|
hintTrigger: {
|
130
164
|
options: hintTriggers,
|
131
165
|
control: {
|
132
166
|
type: 'inline-radio',
|
133
167
|
},
|
134
|
-
if: {
|
168
|
+
if: {
|
169
|
+
arg: 'hasHint',
|
170
|
+
truthy: true,
|
171
|
+
},
|
135
172
|
},
|
136
173
|
hintPlacement: {
|
137
174
|
options: placements,
|
138
175
|
control: {
|
139
176
|
type: 'select',
|
140
177
|
},
|
141
|
-
if: {
|
178
|
+
if: {
|
179
|
+
arg: 'hasHint',
|
180
|
+
truthy: true,
|
181
|
+
},
|
142
182
|
mappers: placements,
|
143
183
|
},
|
144
184
|
hintHasArrow: {
|
145
185
|
control: { type: 'boolean' },
|
146
|
-
if: {
|
186
|
+
if: {
|
187
|
+
arg: 'hasHint',
|
188
|
+
truthy: true,
|
189
|
+
},
|
147
190
|
},
|
148
191
|
hintWidth: {
|
149
192
|
control: { type: 'text' },
|
150
|
-
if: {
|
193
|
+
if: {
|
194
|
+
arg: 'hasHint',
|
195
|
+
truthy: true,
|
196
|
+
},
|
151
197
|
},
|
152
198
|
chipType: {
|
153
199
|
control: 'select',
|
@@ -183,19 +229,28 @@ type StoryPropsDefault = Omit<
|
|
183
229
|
enableContentRight: boolean;
|
184
230
|
};
|
185
231
|
|
186
|
-
const StoryDemo = ({ enableContentLeft, enableContentRight, view, ...rest }: StoryPropsDefault) => {
|
232
|
+
const StoryDemo = ({ enableContentLeft, enableContentRight, view, readOnly, ...rest }: StoryPropsDefault) => {
|
187
233
|
const [text, setText] = useState('Значение поля');
|
188
234
|
|
189
|
-
const
|
235
|
+
const contentRight = enableContentRight || readOnly ? getIcon(IconCross, rest.size, readOnly) : undefined;
|
190
236
|
|
191
237
|
return (
|
192
|
-
<div
|
238
|
+
<div
|
239
|
+
style={{
|
240
|
+
display: 'flex',
|
241
|
+
flexDirection: 'column',
|
242
|
+
gap: '2rem',
|
243
|
+
width: '70%',
|
244
|
+
margin: '0 auto',
|
245
|
+
}}
|
246
|
+
>
|
193
247
|
<TextField
|
194
248
|
{...rest}
|
195
249
|
enumerationType="plain"
|
196
250
|
value={text}
|
197
|
-
|
198
|
-
|
251
|
+
readOnly={readOnly}
|
252
|
+
contentLeft={enableContentLeft ? getIcon(IconPlaceholder, rest.size) : undefined}
|
253
|
+
contentRight={contentRight}
|
199
254
|
view={view}
|
200
255
|
onChange={(e) => {
|
201
256
|
setText(e.target.value);
|
@@ -211,9 +266,10 @@ const StoryDemo = ({ enableContentLeft, enableContentRight, view, ...rest }: Sto
|
|
211
266
|
label="Uncontrolled TextField"
|
212
267
|
defaultValue="Дефолтное значение"
|
213
268
|
enumerationType="plain"
|
214
|
-
contentLeft={enableContentLeft ?
|
215
|
-
contentRight={
|
269
|
+
contentLeft={enableContentLeft ? getIcon(IconPlaceholder, rest.size) : undefined}
|
270
|
+
contentRight={contentRight}
|
216
271
|
view={view}
|
272
|
+
readOnly={readOnly}
|
217
273
|
onFocus={onFocus}
|
218
274
|
onBlur={onBlur}
|
219
275
|
onSearch={onSearch}
|
@@ -285,10 +341,10 @@ type StoryPropsChips = Omit<
|
|
285
341
|
enableContentRight: boolean;
|
286
342
|
};
|
287
343
|
|
288
|
-
const StoryChips = ({ enableContentLeft, enableContentRight, view, ...rest }: StoryPropsChips) => {
|
344
|
+
const StoryChips = ({ enableContentLeft, enableContentRight, view, readOnly, ...rest }: StoryPropsChips) => {
|
289
345
|
const [text, setText] = useState('Значение поля');
|
290
346
|
|
291
|
-
const
|
347
|
+
const contentRight = enableContentRight || readOnly ? getIcon(IconCross, rest.size, readOnly) : undefined;
|
292
348
|
|
293
349
|
const validateChip = (value) => (value === '1 value' ? { view: 'negative' } : {});
|
294
350
|
|
@@ -297,9 +353,10 @@ const StoryChips = ({ enableContentLeft, enableContentRight, view, ...rest }: St
|
|
297
353
|
{...rest}
|
298
354
|
enumerationType="chip"
|
299
355
|
value={text}
|
300
|
-
contentLeft={enableContentLeft ?
|
301
|
-
contentRight={
|
356
|
+
contentLeft={enableContentLeft ? getIcon(IconPlaceholder, rest.size) : undefined}
|
357
|
+
contentRight={contentRight}
|
302
358
|
view={view}
|
359
|
+
readOnly={readOnly}
|
303
360
|
onChange={(e) => {
|
304
361
|
setText(e.target.value);
|
305
362
|
onChange(e.target.value);
|
@@ -308,7 +365,10 @@ const StoryChips = ({ enableContentLeft, enableContentRight, view, ...rest }: St
|
|
308
365
|
onBlur={onBlur}
|
309
366
|
onChangeChips={onChipsChange}
|
310
367
|
chipValidator={validateChip}
|
311
|
-
style={{
|
368
|
+
style={{
|
369
|
+
width: '70%',
|
370
|
+
margin: '0 auto',
|
371
|
+
}}
|
312
372
|
/>
|
313
373
|
);
|
314
374
|
};
|
@@ -23,8 +23,8 @@ import { IsOutOfRange, StyledCalendar } from './CalendarBase.styles';
|
|
23
23
|
export var calendarBaseRoot = function calendarBaseRoot(Root) {
|
24
24
|
return /*#__PURE__*/forwardRef(function (_ref, outerRootRef) {
|
25
25
|
var externalValue = _ref.value,
|
26
|
-
|
27
|
-
|
26
|
+
min = _ref.min,
|
27
|
+
max = _ref.max,
|
28
28
|
includeEdgeDates = _ref.includeEdgeDates,
|
29
29
|
_ref$type = _ref.type,
|
30
30
|
type = _ref$type === void 0 ? 'Days' : _ref$type,
|
@@ -63,8 +63,6 @@ export var calendarBaseRoot = function calendarBaseRoot(Root) {
|
|
63
63
|
_useState8 = _slicedToArray(_useState7, 2),
|
64
64
|
outOfRangeKey = _useState8[0],
|
65
65
|
setOutOfRangeKey = _useState8[1];
|
66
|
-
var min = minDate && new Date(minDate);
|
67
|
-
var max = maxDate && new Date(maxDate);
|
68
66
|
var _useReducer = useReducer(reducer, getInitialState(value, min, type)),
|
69
67
|
_useReducer2 = _slicedToArray(_useReducer, 2),
|
70
68
|
state = _useReducer2[0],
|
@@ -24,8 +24,8 @@ import { StyledCalendar, StyledSeparator, StyledWrapper } from './CalendarDouble
|
|
24
24
|
export var calendarDoubleRoot = function calendarDoubleRoot(Root) {
|
25
25
|
return /*#__PURE__*/forwardRef(function (_ref, outerRootRef) {
|
26
26
|
var externalValue = _ref.value,
|
27
|
-
|
28
|
-
|
27
|
+
min = _ref.min,
|
28
|
+
max = _ref.max,
|
29
29
|
includeEdgeDates = _ref.includeEdgeDates,
|
30
30
|
_ref$type = _ref.type,
|
31
31
|
type = _ref$type === void 0 ? 'Days' : _ref$type,
|
@@ -64,8 +64,6 @@ export var calendarDoubleRoot = function calendarDoubleRoot(Root) {
|
|
64
64
|
_useState8 = _slicedToArray(_useState7, 2),
|
65
65
|
outOfRangeKey = _useState8[0],
|
66
66
|
setOutOfRangeKey = _useState8[1];
|
67
|
-
var min = minDate && new Date(minDate);
|
68
|
-
var max = maxDate && new Date(maxDate);
|
69
67
|
var _useReducer = useReducer(reducer, getInitialState(value, min, type, true)),
|
70
68
|
_useReducer2 = _slicedToArray(_useReducer, 2),
|
71
69
|
state = _useReducer2[0],
|
@@ -35,15 +35,13 @@ export var CalendarMonths = function CalendarMonths(_ref) {
|
|
35
35
|
onSetSelected = _ref.onSetSelected,
|
36
36
|
onKeyDown = _ref.onKeyDown,
|
37
37
|
locale = _ref.locale;
|
38
|
-
var minDate = min ? new Date(min.getFullYear(), min.getMonth(), 1) : undefined;
|
39
|
-
var maxDate = max ? new Date(max.getFullYear(), max.getMonth() + 1, 0) : undefined;
|
40
38
|
var _useMonths = useMonths({
|
41
39
|
date: currentDate,
|
42
40
|
value: value,
|
43
41
|
eventList: eventList,
|
44
42
|
disabledList: disabledList,
|
45
|
-
min:
|
46
|
-
max:
|
43
|
+
min: min,
|
44
|
+
max: max,
|
47
45
|
locale: locale
|
48
46
|
}),
|
49
47
|
_useMonths2 = _slicedToArray(_useMonths, 2),
|
@@ -34,15 +34,13 @@ export var CalendarQuarters = function CalendarQuarters(_ref) {
|
|
34
34
|
onHoverQuarter = _ref.onHoverQuarter,
|
35
35
|
onSetSelected = _ref.onSetSelected,
|
36
36
|
onKeyDown = _ref.onKeyDown;
|
37
|
-
var minDate = min ? new Date(min.getFullYear(), min.getMonth(), 1) : undefined;
|
38
|
-
var maxDate = max ? new Date(max.getFullYear(), max.getMonth() + 1, 0) : undefined;
|
39
37
|
var _useQuarters = useQuarters({
|
40
38
|
date: currentDate,
|
41
39
|
value: value,
|
42
40
|
eventList: eventList,
|
43
41
|
disabledList: disabledList,
|
44
|
-
min:
|
45
|
-
max:
|
42
|
+
min: min,
|
43
|
+
max: max
|
46
44
|
}),
|
47
45
|
_useQuarters2 = _slicedToArray(_useQuarters, 2),
|
48
46
|
quarters = _useQuarters2[0],
|
@@ -35,16 +35,14 @@ export var CalendarYears = function CalendarYears(_ref) {
|
|
35
35
|
onHoverYear = _ref.onHoverYear,
|
36
36
|
onSetSelected = _ref.onSetSelected,
|
37
37
|
onKeyDown = _ref.onKeyDown;
|
38
|
-
var minDate = min ? new Date(min.getFullYear(), 0, 1) : undefined;
|
39
|
-
var maxDate = max ? new Date(max.getFullYear(), 11, 31) : undefined;
|
40
38
|
var _useYears = useYears({
|
41
39
|
date: currentDate,
|
42
40
|
value: value,
|
43
41
|
startYear: startYear,
|
44
42
|
eventList: eventList,
|
45
43
|
disabledList: disabledList,
|
46
|
-
min:
|
47
|
-
max:
|
44
|
+
min: min,
|
45
|
+
max: max
|
48
46
|
}),
|
49
47
|
_useYears2 = _slicedToArray(_useYears, 2),
|
50
48
|
years = _useYears2[0],
|
@@ -20,6 +20,7 @@ export var tokens = {
|
|
20
20
|
/** Токены разделителя */
|
21
21
|
dividerColor: '--plasma-range__divider-color',
|
22
22
|
dividerColorReadOnly: '--plasma-range__divider-color-readonly',
|
23
|
+
dividerOpacityReadOnly: '--plasma-range__divider-opacity-readonly',
|
23
24
|
dividerPadding: '--plasma-range__divider-padding',
|
24
25
|
dividerFontFamily: '--plasma-range__divider-font-family',
|
25
26
|
dividerFontStyle: '--plasma-range__divider-font-style',
|
@@ -30,6 +31,7 @@ export var tokens = {
|
|
30
31
|
/** Токены слотов для контента */
|
31
32
|
leftContentMargin: '--plasma-range__left-content-margin',
|
32
33
|
rightContentMargin: '--plasma-range__right-content-margin',
|
34
|
+
rightContentOpacityReadOnly: '--plasma-range__right-content-opacity-readonly',
|
33
35
|
/** Токены лейбла */
|
34
36
|
labelColor: '--plasma-range__label-color',
|
35
37
|
labelColorReadOnly: '--plasma-range__label-color-readonly',
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import { css } from 'styled-components';
|
2
2
|
import { tokens } from '../../Range.tokens';
|
3
3
|
import { ContentWrapper, LeftHelper, StyledContentLeft, StyledContentRight, StyledDivider, StyledLabel } from '../../Range.styles';
|
4
|
-
export var base = /*#__PURE__*/css(["&[readonly]{cursor:default;", "{background:var(", ");}", "{display:block;color:var(", ");}", "{color:var(", ");}", "{color:var(", ");}", ",", "{color:var(", ");}}"], ContentWrapper, tokens.backgroundReadOnly, StyledLabel, tokens.labelColorReadOnly, LeftHelper, tokens.leftHelperColorReadOnly, StyledDivider, tokens.dividerColorReadOnly, StyledContentLeft, StyledContentRight, tokens.textFieldColorReadOnly);
|
4
|
+
export var base = /*#__PURE__*/css(["&[readonly]{cursor:default;", "{background:var(", ");}", "{display:block;color:var(", ");}", "{color:var(", ");}", "{color:var(", ");opacity:var(", ");}", ",", "{color:var(", ");}", "{opacity:var(", ");}}"], ContentWrapper, tokens.backgroundReadOnly, StyledLabel, tokens.labelColorReadOnly, LeftHelper, tokens.leftHelperColorReadOnly, StyledDivider, tokens.dividerColorReadOnly, tokens.dividerOpacityReadOnly, StyledContentLeft, StyledContentRight, tokens.textFieldColorReadOnly, StyledContentRight, tokens.rightContentOpacityReadOnly);
|
@@ -30,6 +30,7 @@ import { classes } from './TextArea.tokens';
|
|
30
30
|
import { base as viewCSS } from './variations/_view/base';
|
31
31
|
import { base as sizeCSS } from './variations/_size/base';
|
32
32
|
import { base as clearCSS } from './variations/_clear/base';
|
33
|
+
import { base as readOnlyCSS } from './variations/_read-only/base';
|
33
34
|
import { base as disabledCSS } from './variations/_disabled/base';
|
34
35
|
import { base as hintViewCSS } from './variations/_hint-view/base';
|
35
36
|
import { base as hintSizeCSS } from './variations/_hint-size/base';
|
@@ -350,11 +351,12 @@ export var textAreaConfig = {
|
|
350
351
|
css: clearCSS,
|
351
352
|
attrs: true
|
352
353
|
},
|
353
|
-
|
354
|
-
css:
|
354
|
+
readOnly: {
|
355
|
+
css: readOnlyCSS,
|
355
356
|
attrs: true
|
356
357
|
},
|
357
|
-
|
358
|
+
disabled: {
|
359
|
+
css: disabledCSS,
|
358
360
|
attrs: true
|
359
361
|
},
|
360
362
|
hintView: {
|
@@ -60,6 +60,9 @@ export var tokens = {
|
|
60
60
|
/** Цвет текста для элемента textarea */
|
61
61
|
inputColor: '--plasma-textarea-input-color',
|
62
62
|
clearInputColor: '--plasma-textarea-input-clear-color',
|
63
|
+
inputColorReadOnly: '--plasma-textarea-input-color-read-only',
|
64
|
+
backgroundColorReadOnly: '--plasma-textarea-background-color-read-only',
|
65
|
+
readOnlyOpacity: '--plasma-textarea-read-only-opacity',
|
63
66
|
/** Цвет текста для элемента textarea в состоянии focus */
|
64
67
|
inputColorFocus: '--plasma-textarea-input-color-focus',
|
65
68
|
/** Цвет каретки для элемента textarea */
|