@salutejs/plasma-new-hope 0.152.0-canary.1450.11010505842.0 → 0.152.0-canary.1451.11029152908.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. package/cjs/components/TextArea/TextArea.js +21 -15
  2. package/cjs/components/TextArea/TextArea.js.map +1 -1
  3. package/cjs/components/TextArea/TextArea.tokens.js +13 -2
  4. package/cjs/components/TextArea/TextArea.tokens.js.map +1 -1
  5. package/cjs/components/TextArea/variations/_clear/base.js +9 -0
  6. package/cjs/components/TextArea/variations/_clear/base.js.map +1 -0
  7. package/cjs/components/TextArea/variations/_clear/base_e36t9c.css +1 -0
  8. package/cjs/components/TextArea/variations/_view/base.js +1 -1
  9. package/cjs/components/TextArea/variations/_view/base.js.map +1 -1
  10. package/cjs/components/TextArea/variations/_view/base_d83rii.css +1 -0
  11. package/cjs/index.css +3 -1
  12. package/emotion/cjs/components/TextArea/TextArea.js +22 -16
  13. package/emotion/cjs/components/TextArea/TextArea.template-doc.mdx +29 -0
  14. package/emotion/cjs/components/TextArea/TextArea.tokens.js +13 -2
  15. package/emotion/cjs/components/TextArea/variations/_clear/base.js +10 -0
  16. package/emotion/cjs/components/TextArea/variations/_view/base.js +2 -2
  17. package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.config.js +12 -9
  18. package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +17 -10
  19. package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.config.js +12 -9
  20. package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +17 -11
  21. package/emotion/es/components/TextArea/TextArea.js +20 -14
  22. package/emotion/es/components/TextArea/TextArea.template-doc.mdx +29 -0
  23. package/emotion/es/components/TextArea/TextArea.tokens.js +13 -2
  24. package/emotion/es/components/TextArea/variations/_clear/base.js +4 -0
  25. package/emotion/es/components/TextArea/variations/_view/base.js +2 -2
  26. package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.config.js +12 -9
  27. package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +17 -10
  28. package/emotion/es/examples/plasma_web/components/TextArea/TextArea.config.js +12 -9
  29. package/emotion/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +17 -11
  30. package/es/components/TextArea/TextArea.js +21 -15
  31. package/es/components/TextArea/TextArea.js.map +1 -1
  32. package/es/components/TextArea/TextArea.tokens.js +13 -2
  33. package/es/components/TextArea/TextArea.tokens.js.map +1 -1
  34. package/es/components/TextArea/variations/_clear/base.js +5 -0
  35. package/es/components/TextArea/variations/_clear/base.js.map +1 -0
  36. package/es/components/TextArea/variations/_clear/base_e36t9c.css +1 -0
  37. package/es/components/TextArea/variations/_view/base.js +1 -1
  38. package/es/components/TextArea/variations/_view/base.js.map +1 -1
  39. package/es/components/TextArea/variations/_view/base_d83rii.css +1 -0
  40. package/es/index.css +3 -1
  41. package/package.json +2 -2
  42. package/styled-components/cjs/components/TextArea/TextArea.js +21 -15
  43. package/styled-components/cjs/components/TextArea/TextArea.template-doc.mdx +29 -0
  44. package/styled-components/cjs/components/TextArea/TextArea.tokens.js +13 -2
  45. package/styled-components/cjs/components/TextArea/variations/_clear/base.js +10 -0
  46. package/styled-components/cjs/components/TextArea/variations/_view/base.js +1 -1
  47. package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.config.js +12 -9
  48. package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +17 -10
  49. package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.config.js +11 -8
  50. package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +17 -11
  51. package/styled-components/es/components/TextArea/TextArea.js +19 -13
  52. package/styled-components/es/components/TextArea/TextArea.template-doc.mdx +29 -0
  53. package/styled-components/es/components/TextArea/TextArea.tokens.js +13 -2
  54. package/styled-components/es/components/TextArea/variations/_clear/base.js +4 -0
  55. package/styled-components/es/components/TextArea/variations/_view/base.js +1 -1
  56. package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.config.js +12 -9
  57. package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +17 -10
  58. package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.config.js +11 -8
  59. package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +17 -11
  60. package/types/components/TextArea/TextArea.d.ts +4 -0
  61. package/types/components/TextArea/TextArea.d.ts.map +1 -1
  62. package/types/components/TextArea/TextArea.tokens.d.ts +11 -0
  63. package/types/components/TextArea/TextArea.tokens.d.ts.map +1 -1
  64. package/types/components/TextArea/TextArea.types.d.ts +15 -3
  65. package/types/components/TextArea/TextArea.types.d.ts.map +1 -1
  66. package/types/components/TextArea/variations/_clear/base.d.ts +2 -0
  67. package/types/components/TextArea/variations/_clear/base.d.ts.map +1 -0
  68. package/types/examples/plasma_b2c/components/TextArea/TextArea.config.d.ts +3 -0
  69. package/types/examples/plasma_b2c/components/TextArea/TextArea.config.d.ts.map +1 -1
  70. package/types/examples/plasma_b2c/components/TextArea/TextArea.d.ts +81 -0
  71. package/types/examples/plasma_b2c/components/TextArea/TextArea.d.ts.map +1 -1
  72. package/types/examples/plasma_web/components/TextArea/TextArea.config.d.ts +3 -0
  73. package/types/examples/plasma_web/components/TextArea/TextArea.config.d.ts.map +1 -1
  74. package/types/examples/plasma_web/components/TextArea/TextArea.d.ts +81 -0
  75. package/types/examples/plasma_web/components/TextArea/TextArea.d.ts.map +1 -1
  76. package/cjs/components/TextArea/variations/_view/base_8npjyq.css +0 -1
  77. 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 { tertiary } from '@salutejs/plasma-core';
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);