@salutejs/plasma-new-hope 0.152.0-canary.1450.11010505842.0 → 0.152.0-canary.1451.11017866198.0
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/components/TextArea/TextArea.js +21 -15
- package/cjs/components/TextArea/TextArea.js.map +1 -1
- package/cjs/components/TextArea/TextArea.tokens.js +13 -2
- package/cjs/components/TextArea/TextArea.tokens.js.map +1 -1
- package/cjs/components/TextArea/variations/_clear/base.js +9 -0
- package/cjs/components/TextArea/variations/_clear/base.js.map +1 -0
- package/cjs/components/TextArea/variations/_clear/base_e36t9c.css +1 -0
- package/cjs/components/TextArea/variations/_view/base.js +1 -1
- package/cjs/components/TextArea/variations/_view/base.js.map +1 -1
- package/cjs/components/TextArea/variations/_view/base_d83rii.css +1 -0
- package/cjs/index.css +3 -1
- package/emotion/cjs/components/TextArea/TextArea.js +22 -16
- package/emotion/cjs/components/TextArea/TextArea.template-doc.mdx +29 -0
- package/emotion/cjs/components/TextArea/TextArea.tokens.js +13 -2
- package/emotion/cjs/components/TextArea/variations/_clear/base.js +10 -0
- package/emotion/cjs/components/TextArea/variations/_view/base.js +2 -2
- package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.config.js +12 -9
- package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +17 -10
- package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.config.js +12 -9
- package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +17 -11
- package/emotion/es/components/TextArea/TextArea.js +20 -14
- package/emotion/es/components/TextArea/TextArea.template-doc.mdx +29 -0
- package/emotion/es/components/TextArea/TextArea.tokens.js +13 -2
- package/emotion/es/components/TextArea/variations/_clear/base.js +4 -0
- package/emotion/es/components/TextArea/variations/_view/base.js +2 -2
- package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.config.js +12 -9
- package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +17 -10
- package/emotion/es/examples/plasma_web/components/TextArea/TextArea.config.js +12 -9
- package/emotion/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +17 -11
- package/es/components/TextArea/TextArea.js +21 -15
- package/es/components/TextArea/TextArea.js.map +1 -1
- package/es/components/TextArea/TextArea.tokens.js +13 -2
- package/es/components/TextArea/TextArea.tokens.js.map +1 -1
- package/es/components/TextArea/variations/_clear/base.js +5 -0
- package/es/components/TextArea/variations/_clear/base.js.map +1 -0
- package/es/components/TextArea/variations/_clear/base_e36t9c.css +1 -0
- package/es/components/TextArea/variations/_view/base.js +1 -1
- package/es/components/TextArea/variations/_view/base.js.map +1 -1
- package/es/components/TextArea/variations/_view/base_d83rii.css +1 -0
- package/es/index.css +3 -1
- package/package.json +2 -2
- package/styled-components/cjs/components/TextArea/TextArea.js +21 -15
- package/styled-components/cjs/components/TextArea/TextArea.template-doc.mdx +29 -0
- package/styled-components/cjs/components/TextArea/TextArea.tokens.js +13 -2
- package/styled-components/cjs/components/TextArea/variations/_clear/base.js +10 -0
- package/styled-components/cjs/components/TextArea/variations/_view/base.js +1 -1
- package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.config.js +12 -9
- package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +17 -10
- package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.config.js +11 -8
- package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +17 -11
- package/styled-components/es/components/TextArea/TextArea.js +19 -13
- package/styled-components/es/components/TextArea/TextArea.template-doc.mdx +29 -0
- package/styled-components/es/components/TextArea/TextArea.tokens.js +13 -2
- package/styled-components/es/components/TextArea/variations/_clear/base.js +4 -0
- package/styled-components/es/components/TextArea/variations/_view/base.js +1 -1
- package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.config.js +12 -9
- package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +17 -10
- package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.config.js +11 -8
- package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +17 -11
- package/types/components/TextArea/TextArea.d.ts +4 -0
- package/types/components/TextArea/TextArea.d.ts.map +1 -1
- package/types/components/TextArea/TextArea.tokens.d.ts +11 -0
- package/types/components/TextArea/TextArea.tokens.d.ts.map +1 -1
- package/types/components/TextArea/TextArea.types.d.ts +15 -3
- package/types/components/TextArea/TextArea.types.d.ts.map +1 -1
- package/types/components/TextArea/variations/_clear/base.d.ts +2 -0
- package/types/components/TextArea/variations/_clear/base.d.ts.map +1 -0
- 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 +81 -0
- package/types/examples/plasma_b2c/components/TextArea/TextArea.d.ts.map +1 -1
- package/types/examples/plasma_web/components/TextArea/TextArea.config.d.ts +3 -0
- package/types/examples/plasma_web/components/TextArea/TextArea.config.d.ts.map +1 -1
- package/types/examples/plasma_web/components/TextArea/TextArea.d.ts +81 -0
- package/types/examples/plasma_web/components/TextArea/TextArea.d.ts.map +1 -1
- package/cjs/components/TextArea/variations/_view/base_8npjyq.css +0 -1
- package/es/components/TextArea/variations/_view/base_8npjyq.css +0 -1
@@ -2,8 +2,7 @@ import React, { useState } from 'react';
|
|
2
2
|
import type { ComponentProps } from 'react';
|
3
3
|
import type { Meta, StoryObj } from '@storybook/react';
|
4
4
|
import { action } from '@storybook/addon-actions';
|
5
|
-
import {
|
6
|
-
import styled from '@emotion/styled';
|
5
|
+
import { IconPlaceholder } from '@salutejs/plasma-sb-utils';
|
7
6
|
|
8
7
|
import { textAreaConfig } from '../../../../components/TextArea';
|
9
8
|
import { mergeConfig } from '../../../../engines';
|
@@ -48,11 +47,13 @@ const meta: Meta<StoryTextAreaProps> = {
|
|
48
47
|
control: {
|
49
48
|
type: 'number',
|
50
49
|
},
|
50
|
+
if: { arg: 'clear', truthy: false },
|
51
51
|
},
|
52
52
|
cols: {
|
53
53
|
control: {
|
54
54
|
type: 'number',
|
55
55
|
},
|
56
|
+
if: { arg: 'clear', truthy: false },
|
56
57
|
},
|
57
58
|
labelPlacement: {
|
58
59
|
options: labelPlacements,
|
@@ -60,11 +61,20 @@ const meta: Meta<StoryTextAreaProps> = {
|
|
60
61
|
type: 'select',
|
61
62
|
},
|
62
63
|
},
|
64
|
+
hasDivider: {
|
65
|
+
control: {
|
66
|
+
type: 'boolean',
|
67
|
+
},
|
68
|
+
if: { arg: 'clear', truthy: true },
|
69
|
+
},
|
63
70
|
},
|
64
71
|
args: {
|
65
72
|
id: 'example-textarea',
|
73
|
+
view: 'default',
|
74
|
+
size: 's',
|
66
75
|
enableContentRight: true,
|
67
76
|
label: 'Подсказка',
|
77
|
+
labelPlacements: 'outer',
|
68
78
|
placeholder: 'Заполните многострочное поле',
|
69
79
|
leftHelper: 'Подсказка к полю слева',
|
70
80
|
rightHelper: 'Подсказка к полю справа',
|
@@ -76,6 +86,8 @@ const meta: Meta<StoryTextAreaProps> = {
|
|
76
86
|
optional: false,
|
77
87
|
required: false,
|
78
88
|
requiredPlacement: 'right',
|
89
|
+
clear: false,
|
90
|
+
hasDivider: false,
|
79
91
|
},
|
80
92
|
};
|
81
93
|
|
@@ -85,20 +97,15 @@ const onChange = action('onChange');
|
|
85
97
|
const onFocus = action('onFocus');
|
86
98
|
const onBlur = action('onBlur');
|
87
99
|
|
88
|
-
const IconPlaceholder = styled.div`
|
89
|
-
width: 1.5rem;
|
90
|
-
height: 1.5rem;
|
91
|
-
border-radius: 50%;
|
92
|
-
background: ${tertiary};
|
93
|
-
`;
|
94
|
-
|
95
100
|
const StoryDefault = (props: StoryTextAreaProps) => {
|
96
101
|
const [value, setValue] = useState('Значение поля');
|
97
102
|
|
103
|
+
const iconSize = props.size === 'xs' ? 'xs' : 's';
|
104
|
+
|
98
105
|
return (
|
99
106
|
<TextArea
|
100
107
|
value={value}
|
101
|
-
contentRight={props.enableContentRight ? <IconPlaceholder /> : undefined}
|
108
|
+
contentRight={props.enableContentRight ? <IconPlaceholder size={iconSize} /> : undefined}
|
102
109
|
onChange={(e) => {
|
103
110
|
setValue(e.target.value);
|
104
111
|
onChange(e);
|