@salutejs/plasma-new-hope 0.270.0-canary.1770.13386075549.0 → 0.270.0-dev.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (217) hide show
  1. package/cjs/components/Autocomplete/Autocomplete.css +1 -1
  2. package/cjs/components/Combobox/ComboboxNew/Combobox.css +1 -1
  3. package/cjs/components/DatePicker/RangeDate/RangeDate.css +2 -2
  4. package/cjs/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +2 -2
  5. package/cjs/components/DatePicker/SingleDate/SingleDate.css +1 -1
  6. package/cjs/components/Pagination/Pagination.css +1 -1
  7. package/cjs/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +1 -1
  8. package/cjs/components/Range/Range.css +2 -2
  9. package/cjs/components/Range/Range.styles.js.map +1 -1
  10. package/cjs/components/Range/Range.tokens.js +0 -2
  11. package/cjs/components/Range/Range.tokens.js.map +1 -1
  12. package/cjs/components/Range/variations/_readonly/base.js +1 -1
  13. package/cjs/components/Range/variations/_readonly/base.js.map +1 -1
  14. package/cjs/components/Range/variations/_readonly/{base_1jlqwtc.css → base_8q1gx8.css} +1 -1
  15. package/cjs/components/Select/Select.css +1 -1
  16. package/cjs/components/Select/ui/Target/Target.css +1 -1
  17. package/cjs/components/Select/ui/Target/ui/Textfield/Textfield.css +1 -1
  18. package/cjs/components/Slider/Slider.css +1 -1
  19. package/cjs/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +1 -1
  20. package/cjs/components/TextArea/TextArea.js +7 -9
  21. package/cjs/components/TextArea/TextArea.js.map +1 -1
  22. package/cjs/components/TextArea/TextArea.tokens.js +0 -3
  23. package/cjs/components/TextArea/TextArea.tokens.js.map +1 -1
  24. package/cjs/components/TextArea/variations/_clear/base.js.map +1 -1
  25. package/cjs/components/TextField/TextField.tokens.js +0 -1
  26. package/cjs/components/TextField/TextField.tokens.js.map +1 -1
  27. package/cjs/components/TextField/variations/_read-only/base.js +1 -1
  28. package/cjs/components/TextField/variations/_read-only/base.js.map +1 -1
  29. package/cjs/components/TextField/variations/_read-only/base_oizdmx.css +1 -0
  30. package/cjs/index.css +2 -4
  31. package/emotion/cjs/components/Range/Range.styles.js +10 -10
  32. package/emotion/cjs/components/Range/Range.tokens.js +0 -2
  33. package/emotion/cjs/components/Range/variations/_readonly/base.js +1 -1
  34. package/emotion/cjs/components/TextArea/TextArea.js +8 -10
  35. package/emotion/cjs/components/TextArea/TextArea.tokens.js +0 -3
  36. package/emotion/cjs/components/TextArea/variations/_clear/base.js +1 -1
  37. package/emotion/cjs/components/TextField/TextField.tokens.js +0 -1
  38. package/emotion/cjs/components/TextField/variations/_read-only/base.js +1 -1
  39. package/emotion/cjs/components/_Icon/Icons/IconChevronLeft.js +3 -8
  40. package/emotion/cjs/components/_Icon/index.js +0 -7
  41. package/emotion/cjs/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +1 -1
  42. package/emotion/cjs/examples/plasma_b2c/components/Range/Range.config.js +7 -7
  43. package/emotion/cjs/examples/plasma_b2c/components/Range/Range.stories.tsx +7 -14
  44. package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.config.js +14 -17
  45. package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +20 -71
  46. package/emotion/cjs/examples/plasma_b2c/components/TextField/TextField.config.js +22 -22
  47. package/emotion/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +26 -92
  48. package/emotion/cjs/examples/plasma_b2c/components/Tokens/Tokens.stories.tsx +28 -22
  49. package/emotion/cjs/examples/plasma_b2c/components/Tokens/Tokens.styles.js +14 -14
  50. package/emotion/cjs/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +1 -1
  51. package/emotion/cjs/examples/plasma_web/components/Range/Range.config.js +7 -7
  52. package/emotion/cjs/examples/plasma_web/components/Range/Range.stories.tsx +7 -14
  53. package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +20 -71
  54. package/emotion/cjs/examples/plasma_web/components/TextField/TextField.config.js +22 -22
  55. package/emotion/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +25 -85
  56. package/emotion/cjs/examples/plasma_web/components/Tokens/Tokens.stories.tsx +28 -22
  57. package/emotion/cjs/examples/plasma_web/components/Tokens/Tokens.styles.js +14 -14
  58. package/emotion/es/components/Range/Range.styles.js +10 -10
  59. package/emotion/es/components/Range/Range.tokens.js +0 -2
  60. package/emotion/es/components/Range/variations/_readonly/base.js +1 -1
  61. package/emotion/es/components/TextArea/TextArea.js +4 -6
  62. package/emotion/es/components/TextArea/TextArea.tokens.js +0 -3
  63. package/emotion/es/components/TextArea/variations/_clear/base.js +1 -1
  64. package/emotion/es/components/TextField/TextField.tokens.js +0 -1
  65. package/emotion/es/components/TextField/variations/_read-only/base.js +2 -2
  66. package/emotion/es/components/_Icon/Icons/IconChevronLeft.js +3 -8
  67. package/emotion/es/components/_Icon/index.js +0 -1
  68. package/emotion/es/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +1 -1
  69. package/emotion/es/examples/plasma_b2c/components/Range/Range.config.js +7 -7
  70. package/emotion/es/examples/plasma_b2c/components/Range/Range.stories.tsx +7 -14
  71. package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.config.js +14 -17
  72. package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +20 -71
  73. package/emotion/es/examples/plasma_b2c/components/TextField/TextField.config.js +22 -22
  74. package/emotion/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +26 -92
  75. package/emotion/es/examples/plasma_b2c/components/Tokens/Tokens.stories.tsx +28 -22
  76. package/emotion/es/examples/plasma_b2c/components/Tokens/Tokens.styles.js +14 -14
  77. package/emotion/es/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +1 -1
  78. package/emotion/es/examples/plasma_web/components/Range/Range.config.js +7 -7
  79. package/emotion/es/examples/plasma_web/components/Range/Range.stories.tsx +7 -14
  80. package/emotion/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +20 -71
  81. package/emotion/es/examples/plasma_web/components/TextField/TextField.config.js +22 -22
  82. package/emotion/es/examples/plasma_web/components/TextField/TextField.stories.tsx +25 -85
  83. package/emotion/es/examples/plasma_web/components/Tokens/Tokens.stories.tsx +28 -22
  84. package/emotion/es/examples/plasma_web/components/Tokens/Tokens.styles.js +14 -14
  85. package/es/components/Autocomplete/Autocomplete.css +1 -1
  86. package/es/components/Combobox/ComboboxNew/Combobox.css +1 -1
  87. package/es/components/DatePicker/RangeDate/RangeDate.css +2 -2
  88. package/es/components/DatePicker/RangeDate/RangeDatePopover/RangeDatePopover.css +2 -2
  89. package/es/components/DatePicker/SingleDate/SingleDate.css +1 -1
  90. package/es/components/Pagination/Pagination.css +1 -1
  91. package/es/components/Pagination/ui/PaginationSelectPerPage/PaginationSelectPerPage.css +1 -1
  92. package/es/components/Range/Range.css +2 -2
  93. package/es/components/Range/Range.styles.js.map +1 -1
  94. package/es/components/Range/Range.tokens.js +0 -2
  95. package/es/components/Range/Range.tokens.js.map +1 -1
  96. package/es/components/Range/variations/_readonly/base.js +1 -1
  97. package/es/components/Range/variations/_readonly/base.js.map +1 -1
  98. package/es/components/Range/variations/_readonly/{base_1jlqwtc.css → base_8q1gx8.css} +1 -1
  99. package/es/components/Select/Select.css +1 -1
  100. package/es/components/Select/ui/Target/Target.css +1 -1
  101. package/es/components/Select/ui/Target/ui/Textfield/Textfield.css +1 -1
  102. package/es/components/Slider/Slider.css +1 -1
  103. package/es/components/Slider/components/DoubleUncontrolled/DoubleUncontrolled.css +1 -1
  104. package/es/components/TextArea/TextArea.js +7 -9
  105. package/es/components/TextArea/TextArea.js.map +1 -1
  106. package/es/components/TextArea/TextArea.tokens.js +0 -3
  107. package/es/components/TextArea/TextArea.tokens.js.map +1 -1
  108. package/es/components/TextArea/variations/_clear/base.js.map +1 -1
  109. package/es/components/TextField/TextField.tokens.js +0 -1
  110. package/es/components/TextField/TextField.tokens.js.map +1 -1
  111. package/es/components/TextField/variations/_read-only/base.js +1 -1
  112. package/es/components/TextField/variations/_read-only/base.js.map +1 -1
  113. package/es/components/TextField/variations/_read-only/base_oizdmx.css +1 -0
  114. package/es/index.css +2 -4
  115. package/package.json +5 -5
  116. package/styled-components/cjs/components/Range/Range.tokens.js +0 -2
  117. package/styled-components/cjs/components/Range/variations/_readonly/base.js +1 -1
  118. package/styled-components/cjs/components/TextArea/TextArea.js +7 -9
  119. package/styled-components/cjs/components/TextArea/TextArea.tokens.js +0 -3
  120. package/styled-components/cjs/components/TextField/TextField.tokens.js +0 -1
  121. package/styled-components/cjs/components/TextField/variations/_read-only/base.js +1 -1
  122. package/styled-components/cjs/components/_Icon/Icons/IconChevronLeft.js +3 -8
  123. package/styled-components/cjs/components/_Icon/index.js +0 -7
  124. package/styled-components/cjs/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +1 -1
  125. package/styled-components/cjs/examples/plasma_b2c/components/Range/Range.config.js +1 -1
  126. package/styled-components/cjs/examples/plasma_b2c/components/Range/Range.stories.tsx +7 -14
  127. package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.config.js +0 -3
  128. package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +20 -71
  129. package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.config.js +7 -7
  130. package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +26 -92
  131. package/styled-components/cjs/examples/plasma_b2c/components/Tokens/Tokens.stories.tsx +28 -22
  132. package/styled-components/cjs/examples/plasma_b2c/components/Tokens/Tokens.styles.js +2 -2
  133. package/styled-components/cjs/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +1 -1
  134. package/styled-components/cjs/examples/plasma_web/components/Range/Range.config.js +1 -1
  135. package/styled-components/cjs/examples/plasma_web/components/Range/Range.stories.tsx +7 -14
  136. package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +20 -71
  137. package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.config.js +7 -7
  138. package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +25 -85
  139. package/styled-components/cjs/examples/plasma_web/components/Tokens/Tokens.stories.tsx +28 -22
  140. package/styled-components/cjs/examples/plasma_web/components/Tokens/Tokens.styles.js +2 -2
  141. package/styled-components/es/components/Range/Range.tokens.js +0 -2
  142. package/styled-components/es/components/Range/variations/_readonly/base.js +1 -1
  143. package/styled-components/es/components/TextArea/TextArea.js +3 -5
  144. package/styled-components/es/components/TextArea/TextArea.tokens.js +0 -3
  145. package/styled-components/es/components/TextField/TextField.tokens.js +0 -1
  146. package/styled-components/es/components/TextField/variations/_read-only/base.js +2 -2
  147. package/styled-components/es/components/_Icon/Icons/IconChevronLeft.js +3 -8
  148. package/styled-components/es/components/_Icon/index.js +0 -1
  149. package/styled-components/es/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +1 -1
  150. package/styled-components/es/examples/plasma_b2c/components/Range/Range.config.js +1 -1
  151. package/styled-components/es/examples/plasma_b2c/components/Range/Range.stories.tsx +7 -14
  152. package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.config.js +0 -3
  153. package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +20 -71
  154. package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.config.js +7 -7
  155. package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +26 -92
  156. package/styled-components/es/examples/plasma_b2c/components/Tokens/Tokens.stories.tsx +28 -22
  157. package/styled-components/es/examples/plasma_b2c/components/Tokens/Tokens.styles.js +2 -2
  158. package/styled-components/es/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +1 -1
  159. package/styled-components/es/examples/plasma_web/components/Range/Range.config.js +1 -1
  160. package/styled-components/es/examples/plasma_web/components/Range/Range.stories.tsx +7 -14
  161. package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +20 -71
  162. package/styled-components/es/examples/plasma_web/components/TextField/TextField.config.js +7 -7
  163. package/styled-components/es/examples/plasma_web/components/TextField/TextField.stories.tsx +25 -85
  164. package/styled-components/es/examples/plasma_web/components/Tokens/Tokens.stories.tsx +28 -22
  165. package/styled-components/es/examples/plasma_web/components/Tokens/Tokens.styles.js +2 -2
  166. package/types/components/Range/Range.tokens.d.ts +0 -2
  167. package/types/components/Range/Range.tokens.d.ts.map +1 -1
  168. package/types/components/Range/variations/_readonly/base.d.ts.map +1 -1
  169. package/types/components/TextArea/TextArea.d.ts +2 -3
  170. package/types/components/TextArea/TextArea.d.ts.map +1 -1
  171. package/types/components/TextArea/TextArea.tokens.d.ts +0 -3
  172. package/types/components/TextArea/TextArea.tokens.d.ts.map +1 -1
  173. package/types/components/TextArea/variations/_clear/base.d.ts.map +1 -1
  174. package/types/components/TextField/TextField.tokens.d.ts +0 -1
  175. package/types/components/TextField/TextField.tokens.d.ts.map +1 -1
  176. package/types/components/TextField/variations/_read-only/base.d.ts.map +1 -1
  177. package/types/components/_Icon/Icons/IconChevronLeft.d.ts.map +1 -1
  178. package/types/components/_Icon/index.d.ts +0 -1
  179. package/types/components/_Icon/index.d.ts.map +1 -1
  180. package/types/examples/plasma_b2c/components/Range/Range.config.d.ts.map +1 -1
  181. package/types/examples/plasma_b2c/components/TextArea/TextArea.config.d.ts +0 -3
  182. package/types/examples/plasma_b2c/components/TextArea/TextArea.config.d.ts.map +1 -1
  183. package/types/examples/plasma_b2c/components/TextArea/TextArea.d.ts +0 -3
  184. package/types/examples/plasma_b2c/components/TextArea/TextArea.d.ts.map +1 -1
  185. package/types/examples/plasma_b2c/components/TextField/TextField.config.d.ts.map +1 -1
  186. package/types/examples/plasma_web/components/Range/Range.config.d.ts.map +1 -1
  187. package/types/examples/plasma_web/components/TextField/TextField.config.d.ts.map +1 -1
  188. package/cjs/components/TextArea/variations/_read-only/base.js +0 -9
  189. package/cjs/components/TextArea/variations/_read-only/base.js.map +0 -1
  190. package/cjs/components/TextArea/variations/_read-only/base_om8eo9.css +0 -1
  191. package/cjs/components/TextField/variations/_read-only/base_sr3to2.css +0 -1
  192. package/emotion/cjs/components/TextArea/variations/_read-only/base.js +0 -10
  193. package/emotion/cjs/components/TextArea/variations/_read-only/tokens.json +0 -1
  194. package/emotion/cjs/components/_Icon/Icon.assets/Lock.js +0 -26
  195. package/emotion/cjs/components/_Icon/Icons/IconLock.js +0 -29
  196. package/emotion/es/components/TextArea/variations/_read-only/base.js +0 -4
  197. package/emotion/es/components/TextArea/variations/_read-only/tokens.json +0 -1
  198. package/emotion/es/components/_Icon/Icon.assets/Lock.js +0 -19
  199. package/emotion/es/components/_Icon/Icons/IconLock.js +0 -22
  200. package/es/components/TextArea/variations/_read-only/base.js +0 -5
  201. package/es/components/TextArea/variations/_read-only/base.js.map +0 -1
  202. package/es/components/TextArea/variations/_read-only/base_om8eo9.css +0 -1
  203. package/es/components/TextField/variations/_read-only/base_sr3to2.css +0 -1
  204. package/styled-components/cjs/components/TextArea/variations/_read-only/base.js +0 -10
  205. package/styled-components/cjs/components/TextArea/variations/_read-only/tokens.json +0 -1
  206. package/styled-components/cjs/components/_Icon/Icon.assets/Lock.js +0 -26
  207. package/styled-components/cjs/components/_Icon/Icons/IconLock.js +0 -29
  208. package/styled-components/es/components/TextArea/variations/_read-only/base.js +0 -4
  209. package/styled-components/es/components/TextArea/variations/_read-only/tokens.json +0 -1
  210. package/styled-components/es/components/_Icon/Icon.assets/Lock.js +0 -19
  211. package/styled-components/es/components/_Icon/Icons/IconLock.js +0 -22
  212. package/types/components/TextArea/variations/_read-only/base.d.ts +0 -2
  213. package/types/components/TextArea/variations/_read-only/base.d.ts.map +0 -1
  214. package/types/components/_Icon/Icon.assets/Lock.d.ts +0 -4
  215. package/types/components/_Icon/Icon.assets/Lock.d.ts.map +0 -1
  216. package/types/components/_Icon/Icons/IconLock.d.ts +0 -4
  217. package/types/components/_Icon/Icons/IconLock.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import React, { ChangeEvent, ComponentProps, Dispatch, SetStateAction, useState } from 'react';
2
2
  import type { StoryObj, Meta } from '@storybook/react';
3
3
  import { action } from '@storybook/addon-actions';
4
- import { disableProps, IconPlaceholder } from '@salutejs/plasma-sb-utils';
4
+ import { IconPlaceholder } from '@salutejs/plasma-sb-utils';
5
5
 
6
6
  import { WithTheme } from '../../../_helpers';
7
7
  import { IconChevronLeft } from '../../../../components/_Icon';
@@ -45,10 +45,7 @@ const meta: Meta<typeof Range> = {
45
45
  control: {
46
46
  type: 'select',
47
47
  },
48
- if: {
49
- arg: 'required',
50
- truthy: true,
51
- },
48
+ if: { arg: 'required', truthy: true },
52
49
  },
53
50
  ...disableProps(['view']),
54
51
  },
@@ -79,14 +76,10 @@ const getSizeForIcon = (size) => {
79
76
  return size;
80
77
  };
81
78
 
82
- const ActionButton = ({ size, readOnly }) => {
79
+ const ActionButton = ({ size }) => {
83
80
  return (
84
- <IconButton view="clear" size={size} disabled={readOnly}>
85
- <IconChevronLeft
86
- color={readOnly ? 'var(--text-secondary)' : 'inherit'}
87
- size={getSizeForIcon(size)}
88
- style={{ transform: 'rotate(180deg)' }}
89
- />
81
+ <IconButton view="clear" size={size}>
82
+ <IconChevronLeft size={getSizeForIcon(size)} />
90
83
  </IconButton>
91
84
  );
92
85
  };
@@ -122,7 +115,7 @@ const StoryDefault = ({
122
115
  firstValue={firstValue}
123
116
  secondValue={secondValue}
124
117
  contentLeft={enableContentLeft ? <IconPlaceholder size={iconSize} /> : undefined}
125
- contentRight={enableContentRight ? <ActionButton size={size} readOnly={rest.readOnly} /> : undefined}
118
+ contentRight={enableContentRight ? <ActionButton size={size} /> : undefined}
126
119
  firstTextfieldContentLeft={
127
120
  enableFirstTextfieldContentLeft ? <IconPlaceholder size={iconSize} /> : undefined
128
121
  }
@@ -273,7 +266,7 @@ const StoryDemo = ({ enableContentLeft, enableContentRight, size, ...rest }: Sto
273
266
  firstValueSuccess={firstValueSuccess}
274
267
  secondValueSuccess={secondValueSuccess}
275
268
  contentLeft={enableContentLeft ? <IconPlaceholder size={iconSize} /> : undefined}
276
- contentRight={enableContentRight ? <ActionButton size={size} readOnly={rest.readOnly} /> : undefined}
269
+ contentRight={enableContentRight ? <ActionButton size={size} /> : undefined}
277
270
  onChangeFirstValue={(e) => {
278
271
  handleChangeValue(
279
272
  e,
@@ -8,7 +8,6 @@ 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';
12
11
 
13
12
  import { config } from './TextArea.config';
14
13
  import { TextArea } from './TextArea';
@@ -39,16 +38,6 @@ const placements: Array<PopoverPlacement> = [
39
38
  'auto',
40
39
  ];
41
40
 
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
-
52
41
  type StoryTextAreaPropsCustom = {
53
42
  hasHint?: boolean;
54
43
  enableContentRight?: boolean;
@@ -72,25 +61,19 @@ const meta: Meta<StoryTextAreaProps> = {
72
61
  control: {
73
62
  type: 'boolean',
74
63
  },
75
- if: {
76
- arg: 'optional',
77
- truthy: false,
78
- },
64
+ if: { arg: 'optional', truthy: false },
79
65
  },
80
66
  optional: {
81
67
  control: {
82
68
  type: 'boolean',
83
69
  },
84
- if: {
85
- arg: 'required',
86
- truthy: false,
87
- },
70
+ if: { arg: 'required', truthy: false },
88
71
  },
89
72
  size: {
90
73
  options: sizes,
91
74
  defaultValue: 'm',
92
75
  control: {
93
- type: 'inline-radio',
76
+ type: 'select',
94
77
  },
95
78
  },
96
79
  view: {
@@ -109,28 +92,19 @@ const meta: Meta<StoryTextAreaProps> = {
109
92
  control: {
110
93
  type: 'boolean',
111
94
  },
112
- if: {
113
- arg: 'clear',
114
- truthy: true,
115
- },
95
+ if: { arg: 'clear', truthy: true },
116
96
  },
117
97
  cols: {
118
98
  control: {
119
99
  type: 'number',
120
100
  },
121
- if: {
122
- arg: 'clear',
123
- truthy: false,
124
- },
101
+ if: { arg: 'clear', truthy: false },
125
102
  },
126
103
  rows: {
127
104
  control: {
128
105
  type: 'number',
129
106
  },
130
- if: {
131
- arg: 'clear',
132
- truthy: false,
133
- },
107
+ if: { arg: 'clear', truthy: false },
134
108
  },
135
109
  hasHint: {
136
110
  control: {
@@ -139,65 +113,47 @@ const meta: Meta<StoryTextAreaProps> = {
139
113
  },
140
114
  hintText: {
141
115
  control: { type: 'text' },
142
- if: {
143
- arg: 'hasHint',
144
- truthy: true,
145
- },
116
+ if: { arg: 'hasHint', truthy: true },
146
117
  },
147
118
  hintView: {
148
119
  options: hintViews,
149
120
  control: {
150
121
  type: 'select',
151
122
  },
152
- if: {
153
- arg: 'hasHint',
154
- truthy: true,
155
- },
123
+ if: { arg: 'hasHint', truthy: true },
156
124
  },
157
125
  hintSize: {
158
126
  options: hintSizes,
159
127
  control: {
160
128
  type: 'select',
161
129
  },
162
- if: {
163
- arg: 'hasHint',
164
- truthy: true,
165
- },
130
+ if: { arg: 'hasHint', truthy: true },
166
131
  },
167
132
  hintTrigger: {
168
133
  options: hintTriggers,
169
134
  control: {
170
135
  type: 'inline-radio',
171
136
  },
172
- if: {
173
- arg: 'hasHint',
174
- truthy: true,
175
- },
137
+ if: { arg: 'hasHint', truthy: true },
176
138
  },
177
139
  hintPlacement: {
178
140
  options: placements,
179
141
  control: {
180
142
  type: 'select',
181
143
  },
182
- if: {
183
- arg: 'hasHint',
184
- truthy: true,
185
- },
144
+ if: { arg: 'hasHint', truthy: true },
186
145
  mappers: placements,
187
146
  },
188
147
  hintHasArrow: {
189
148
  control: { type: 'boolean' },
190
- if: {
191
- arg: 'hasHint',
192
- truthy: true,
193
- },
149
+ if: { arg: 'hasHint', truthy: true },
194
150
  },
195
151
  hintWidth: {
196
152
  control: { type: 'text' },
197
- if: {
198
- arg: 'hasHint',
199
- truthy: true,
200
- },
153
+ if: { arg: 'hasHint', truthy: true },
154
+ },
155
+ helperText: {
156
+ control: { type: 'text' },
201
157
  },
202
158
  width: {
203
159
  control: { type: 'text' },
@@ -216,7 +172,6 @@ const meta: Meta<StoryTextAreaProps> = {
216
172
  },
217
173
  ...disableProps([
218
174
  'helperBlock',
219
- 'helperText',
220
175
  '$isFocused',
221
176
  'contentRight',
222
177
  'autoComplete',
@@ -240,7 +195,6 @@ const meta: Meta<StoryTextAreaProps> = {
240
195
  'hintOffset',
241
196
  'hintContentLeft',
242
197
  'hintView',
243
- 'hintOpened',
244
198
  ]),
245
199
  },
246
200
  args: {
@@ -284,24 +238,19 @@ const onBlur = action('onBlur');
284
238
  const StoryDefault = (props: StoryTextAreaProps) => {
285
239
  const [value, setValue] = useState('Значение поля');
286
240
 
241
+ const iconSize = props.size === 'xs' ? 'xs' : 's';
242
+
287
243
  return (
288
244
  <TextArea
289
245
  value={value}
290
- contentRight={
291
- props.enableContentRight || props.readOnly
292
- ? getIcon(IconPlaceholder, props.size, props.readOnly)
293
- : undefined
294
- }
246
+ contentRight={props.enableContentRight ? <IconPlaceholder size={iconSize} /> : undefined}
295
247
  onChange={(e) => {
296
248
  setValue(e.target.value);
297
249
  onChange(e);
298
250
  }}
299
251
  onFocus={onFocus}
300
252
  onBlur={onBlur}
301
- style={{
302
- width: '70%',
303
- margin: '0 auto',
304
- }}
253
+ style={{ width: '70%', margin: '0 auto' }}
305
254
  {...props}
306
255
  />
307
256
  );
@@ -27,12 +27,12 @@ export var config = {
27
27
  "true": /*#__PURE__*/css([""])
28
28
  },
29
29
  chipView: {
30
- "default": /*#__PURE__*/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;"], tokens.chipColor, tokens.chipBackground, tokens.chipColorHover, tokens.chipBackgroundHover, tokens.chipColorActive, tokens.chipBackgroundActive, tokens.chipBackgroundReadOnly, tokens.chipColorReadOnly, tokens.chipBackgroundReadOnlyHover, tokens.chipColorReadOnlyHover, tokens.chipCloseIconColor, tokens.chipOpacityReadonly),
31
- secondary: /*#__PURE__*/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;"], tokens.chipColor, tokens.chipBackground, tokens.chipColorHover, tokens.chipBackgroundHover, tokens.chipColorActive, tokens.chipBackgroundActive, tokens.chipBackgroundReadOnly, tokens.chipColorReadOnly, tokens.chipBackgroundReadOnlyHover, tokens.chipColorReadOnlyHover, tokens.chipCloseIconColor, tokens.chipOpacityReadonly),
32
- accent: /*#__PURE__*/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;"], tokens.chipColor, tokens.chipBackground, tokens.chipColorHover, tokens.chipBackgroundHover, tokens.chipColorActive, tokens.chipBackgroundActive, tokens.chipBackgroundReadOnly, tokens.chipColorReadOnly, tokens.chipBackgroundReadOnlyHover, tokens.chipColorReadOnlyHover, tokens.chipCloseIconColor, tokens.chipOpacityReadonly),
33
- positive: /*#__PURE__*/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;"], tokens.chipColor, tokens.chipBackground, tokens.chipColorHover, tokens.chipBackgroundHover, tokens.chipColorActive, tokens.chipBackgroundActive, tokens.chipBackgroundReadOnly, tokens.chipColorReadOnly, tokens.chipBackgroundReadOnlyHover, tokens.chipColorReadOnlyHover, tokens.chipCloseIconColor, tokens.chipOpacityReadonly),
34
- warning: /*#__PURE__*/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;"], tokens.chipColor, tokens.chipBackground, tokens.chipColorHover, tokens.chipBackgroundHover, tokens.chipColorActive, tokens.chipBackgroundActive, tokens.chipBackgroundReadOnly, tokens.chipColorReadOnly, tokens.chipBackgroundReadOnlyHover, tokens.chipColorReadOnlyHover, tokens.chipCloseIconColor, tokens.chipOpacityReadonly),
35
- negative: /*#__PURE__*/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;"], tokens.chipColor, tokens.chipBackground, tokens.chipColorHover, tokens.chipBackgroundHover, tokens.chipColorActive, tokens.chipBackgroundActive, tokens.chipBackgroundReadOnly, tokens.chipColorReadOnly, tokens.chipBackgroundReadOnlyHover, tokens.chipColorReadOnlyHover, tokens.chipCloseIconColor, tokens.chipOpacityReadonly)
30
+ "default": /*#__PURE__*/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);", ":0.72;"], tokens.chipColor, tokens.chipBackground, tokens.chipColorHover, tokens.chipBackgroundHover, tokens.chipColorActive, tokens.chipBackgroundActive, tokens.chipBackgroundReadOnly, tokens.chipColorReadOnly, tokens.chipBackgroundReadOnlyHover, tokens.chipColorReadOnlyHover, tokens.chipCloseIconColor, tokens.chipOpacityReadonly),
31
+ secondary: /*#__PURE__*/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);", ":0.72;"], tokens.chipColor, tokens.chipBackground, tokens.chipColorHover, tokens.chipBackgroundHover, tokens.chipColorActive, tokens.chipBackgroundActive, tokens.chipBackgroundReadOnly, tokens.chipColorReadOnly, tokens.chipBackgroundReadOnlyHover, tokens.chipColorReadOnlyHover, tokens.chipCloseIconColor, tokens.chipOpacityReadonly),
32
+ accent: /*#__PURE__*/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);", ":0.72;"], tokens.chipColor, tokens.chipBackground, tokens.chipColorHover, tokens.chipBackgroundHover, tokens.chipColorActive, tokens.chipBackgroundActive, tokens.chipBackgroundReadOnly, tokens.chipColorReadOnly, tokens.chipBackgroundReadOnlyHover, tokens.chipColorReadOnlyHover, tokens.chipCloseIconColor, tokens.chipOpacityReadonly),
33
+ positive: /*#__PURE__*/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);", ":0.72;"], tokens.chipColor, tokens.chipBackground, tokens.chipColorHover, tokens.chipBackgroundHover, tokens.chipColorActive, tokens.chipBackgroundActive, tokens.chipBackgroundReadOnly, tokens.chipColorReadOnly, tokens.chipBackgroundReadOnlyHover, tokens.chipColorReadOnlyHover, tokens.chipCloseIconColor, tokens.chipOpacityReadonly),
34
+ warning: /*#__PURE__*/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);", ":0.72;"], tokens.chipColor, tokens.chipBackground, tokens.chipColorHover, tokens.chipBackgroundHover, tokens.chipColorActive, tokens.chipBackgroundActive, tokens.chipBackgroundReadOnly, tokens.chipColorReadOnly, tokens.chipBackgroundReadOnlyHover, tokens.chipColorReadOnlyHover, tokens.chipCloseIconColor, tokens.chipOpacityReadonly),
35
+ negative: /*#__PURE__*/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);", ":0.72;"], tokens.chipColor, tokens.chipBackground, tokens.chipColorHover, tokens.chipBackgroundHover, tokens.chipColorActive, tokens.chipBackgroundActive, tokens.chipBackgroundReadOnly, tokens.chipColorReadOnly, tokens.chipBackgroundReadOnlyHover, tokens.chipColorReadOnlyHover, tokens.chipCloseIconColor, tokens.chipOpacityReadonly)
36
36
  },
37
37
  hintView: {
38
38
  "default": /*#__PURE__*/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);"], tokens.tooltipBackgroundColor, tokens.tooltipBoxShadow, tokens.tooltipColor, tokens.tooltipArrowBackground)
@@ -45,7 +45,7 @@ export var config = {
45
45
  "true": /*#__PURE__*/css(["", ":0.4;"], tokens.disabledOpacity)
46
46
  },
47
47
  readOnly: {
48
- "true": /*#__PURE__*/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);"], tokens.readOnlyOpacity, tokens.colorReadOnly, tokens.backgroundColorReadOnly, tokens.borderColorReadOnly, tokens.placeholderColorReadOnly, tokens.leftHelperColorReadOnly, tokens.titleCaptionColorReadOnly, tokens.labelColorReadOnly, tokens.dividerColorReadOnly)
48
+ "true": /*#__PURE__*/css(["", ":var(--text-secondary);", ":var(--surface-clear);", ":var(--surface-transparent-tertiary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary);", ":var(--text-secondary);"], tokens.colorReadOnly, tokens.backgroundColorReadOnly, tokens.borderColorReadOnly, tokens.placeholderColorReadOnly, tokens.leftHelperColorReadOnly, tokens.titleCaptionColorReadOnly, tokens.labelColorReadOnly)
49
49
  }
50
50
  }
51
51
  };
@@ -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, IconLock } from '../../../../components/_Icon';
7
+ import { IconCross } from '../../../../components/_Icon';
8
8
  import type { PopoverPlacement } from '../Popover/Popover';
9
9
 
10
10
  import { TextField } from './TextField';
@@ -43,16 +43,6 @@ 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
-
56
46
  const meta: Meta<typeof TextField> = {
57
47
  title: 'web/Data Entry/TextField',
58
48
  component: TextField,
@@ -68,28 +58,19 @@ const meta: Meta<typeof TextField> = {
68
58
  control: {
69
59
  type: 'boolean',
70
60
  },
71
- if: {
72
- arg: 'optional',
73
- truthy: false,
74
- },
61
+ if: { arg: 'optional', truthy: false },
75
62
  },
76
63
  optional: {
77
64
  control: {
78
65
  type: 'boolean',
79
66
  },
80
- if: {
81
- arg: 'required',
82
- truthy: false,
83
- },
67
+ if: { arg: 'required', truthy: false },
84
68
  },
85
69
  hasDivider: {
86
70
  control: {
87
71
  type: 'boolean',
88
72
  },
89
- if: {
90
- arg: 'clear',
91
- truthy: true,
92
- },
73
+ if: { arg: 'clear', truthy: true },
93
74
  },
94
75
  view: {
95
76
  options: views,
@@ -112,10 +93,7 @@ const meta: Meta<typeof TextField> = {
112
93
  control: {
113
94
  type: 'boolean',
114
95
  },
115
- if: {
116
- arg: 'labelPlacement',
117
- eq: 'inner',
118
- },
96
+ if: { arg: 'labelPlacement', eq: 'inner' },
119
97
  },
120
98
  size: {
121
99
  options: sizes,
@@ -125,75 +103,51 @@ const meta: Meta<typeof TextField> = {
125
103
  },
126
104
  hintText: {
127
105
  control: { type: 'text' },
128
- if: {
129
- arg: 'hasHint',
130
- truthy: true,
131
- },
106
+ if: { arg: 'hasHint', truthy: true },
132
107
  },
133
108
  hintView: {
134
109
  options: hintViews,
135
110
  control: {
136
111
  type: 'select',
137
112
  },
138
- if: {
139
- arg: 'hasHint',
140
- truthy: true,
141
- },
113
+ if: { arg: 'hasHint', truthy: true },
142
114
  },
143
115
  hintSize: {
144
116
  options: hintSizes,
145
117
  control: {
146
118
  type: 'select',
147
119
  },
148
- if: {
149
- arg: 'hasHint',
150
- truthy: true,
151
- },
120
+ if: { arg: 'hasHint', truthy: true },
152
121
  },
153
122
  hintTargetPlacement: {
154
123
  options: hintTargetPlacements,
155
124
  control: {
156
125
  type: 'inline-radio',
157
126
  },
158
- if: {
159
- arg: 'hasHint',
160
- truthy: true,
161
- },
127
+ if: { arg: 'hasHint', truthy: true },
162
128
  },
163
129
  hintTrigger: {
164
130
  options: hintTriggers,
165
131
  control: {
166
132
  type: 'inline-radio',
167
133
  },
168
- if: {
169
- arg: 'hasHint',
170
- truthy: true,
171
- },
134
+ if: { arg: 'hasHint', truthy: true },
172
135
  },
173
136
  hintPlacement: {
174
137
  options: placements,
175
138
  control: {
176
139
  type: 'select',
177
140
  },
178
- if: {
179
- arg: 'hasHint',
180
- truthy: true,
181
- },
141
+ if: { arg: 'hasHint', truthy: true },
182
142
  mappers: placements,
183
143
  },
184
144
  hintHasArrow: {
185
145
  control: { type: 'boolean' },
186
- if: {
187
- arg: 'hasHint',
188
- truthy: true,
189
- },
146
+ if: { arg: 'hasHint', truthy: true },
190
147
  },
191
148
  hintWidth: {
192
149
  control: { type: 'text' },
193
- if: {
194
- arg: 'hasHint',
195
- truthy: true,
196
- },
150
+ if: { arg: 'hasHint', truthy: true },
197
151
  },
198
152
  chipType: {
199
153
  control: 'select',
@@ -229,28 +183,19 @@ type StoryPropsDefault = Omit<
229
183
  enableContentRight: boolean;
230
184
  };
231
185
 
232
- const StoryDemo = ({ enableContentLeft, enableContentRight, view, readOnly, ...rest }: StoryPropsDefault) => {
186
+ const StoryDemo = ({ enableContentLeft, enableContentRight, view, ...rest }: StoryPropsDefault) => {
233
187
  const [text, setText] = useState('Значение поля');
234
188
 
235
- const contentRight = enableContentRight || readOnly ? getIcon(IconCross, rest.size, readOnly) : undefined;
189
+ const iconSize = rest.size === 'xs' ? 'xs' : 's';
236
190
 
237
191
  return (
238
- <div
239
- style={{
240
- display: 'flex',
241
- flexDirection: 'column',
242
- gap: '2rem',
243
- width: '70%',
244
- margin: '0 auto',
245
- }}
246
- >
192
+ <div style={{ display: 'flex', flexDirection: 'column', gap: '2rem', width: '70%', margin: '0 auto' }}>
247
193
  <TextField
248
194
  {...rest}
249
195
  enumerationType="plain"
250
196
  value={text}
251
- readOnly={readOnly}
252
- contentLeft={enableContentLeft ? getIcon(IconPlaceholder, rest.size) : undefined}
253
- contentRight={contentRight}
197
+ contentLeft={enableContentLeft ? <IconCross color="inherit" size={iconSize} /> : undefined}
198
+ contentRight={enableContentRight ? <IconCross color="inherit" size={iconSize} /> : undefined}
254
199
  view={view}
255
200
  onChange={(e) => {
256
201
  setText(e.target.value);
@@ -266,10 +211,9 @@ const StoryDemo = ({ enableContentLeft, enableContentRight, view, readOnly, ...r
266
211
  label="Uncontrolled TextField"
267
212
  defaultValue="Дефолтное значение"
268
213
  enumerationType="plain"
269
- contentLeft={enableContentLeft ? getIcon(IconPlaceholder, rest.size) : undefined}
270
- contentRight={contentRight}
214
+ contentLeft={enableContentLeft ? <IconPlaceholder size={iconSize} /> : undefined}
215
+ contentRight={enableContentRight ? <IconPlaceholder size={iconSize} /> : undefined}
271
216
  view={view}
272
- readOnly={readOnly}
273
217
  onFocus={onFocus}
274
218
  onBlur={onBlur}
275
219
  onSearch={onSearch}
@@ -341,10 +285,10 @@ type StoryPropsChips = Omit<
341
285
  enableContentRight: boolean;
342
286
  };
343
287
 
344
- const StoryChips = ({ enableContentLeft, enableContentRight, view, readOnly, ...rest }: StoryPropsChips) => {
288
+ const StoryChips = ({ enableContentLeft, enableContentRight, view, ...rest }: StoryPropsChips) => {
345
289
  const [text, setText] = useState('Значение поля');
346
290
 
347
- const contentRight = enableContentRight || readOnly ? getIcon(IconCross, rest.size, readOnly) : undefined;
291
+ const iconSize = rest.size === 'xs' ? 'xs' : 's';
348
292
 
349
293
  const validateChip = (value) => (value === '1 value' ? { view: 'negative' } : {});
350
294
 
@@ -353,10 +297,9 @@ const StoryChips = ({ enableContentLeft, enableContentRight, view, readOnly, ...
353
297
  {...rest}
354
298
  enumerationType="chip"
355
299
  value={text}
356
- contentLeft={enableContentLeft ? getIcon(IconPlaceholder, rest.size) : undefined}
357
- contentRight={contentRight}
300
+ contentLeft={enableContentLeft ? <IconPlaceholder size={iconSize} /> : undefined}
301
+ contentRight={enableContentRight ? <IconPlaceholder size={iconSize} /> : undefined}
358
302
  view={view}
359
- readOnly={readOnly}
360
303
  onChange={(e) => {
361
304
  setText(e.target.value);
362
305
  onChange(e.target.value);
@@ -365,10 +308,7 @@ const StoryChips = ({ enableContentLeft, enableContentRight, view, readOnly, ...
365
308
  onBlur={onBlur}
366
309
  onChangeChips={onChipsChange}
367
310
  chipValidator={validateChip}
368
- style={{
369
- width: '70%',
370
- margin: '0 auto',
371
- }}
311
+ style={{ width: '70%', margin: '0 auto' }}
372
312
  />
373
313
  );
374
314
  };
@@ -69,11 +69,11 @@ const StoryDemo = ({ context }) => {
69
69
 
70
70
  return (
71
71
  <>
72
- {Object.entries(groupedTokens).map(([category, value]) => (
72
+ {Object.entries(groupedTokens).map(([category, subcategoties]) => (
73
73
  <CategoryContainer key={category}>
74
74
  <Category>{category}</Category>
75
75
  <Accordion view="clear" size="s" stretching="filled" defaultActiveEventKey={[0]}>
76
- {Object.entries(value).map(([subcategory, value2], index) => (
76
+ {Object.entries(subcategoties).map(([subcategory, subcategoryTokens], index) => (
77
77
  <StyledAccordionItem
78
78
  key={subcategory}
79
79
  eventKey={index}
@@ -85,31 +85,37 @@ const StoryDemo = ({ context }) => {
85
85
  <ColorCircle disableShadow />
86
86
  Color
87
87
  </ColumnTitle>
88
+ <ColumnTitle>Tone</ColumnTitle>
88
89
  <ColumnTitle>Opacity</ColumnTitle>
89
90
  </AccordionInfo>
90
91
  }
91
92
  >
92
93
  <TokenInfoWrapper>
93
- {Object.entries(value2).map(([token, { value: value3, opacity }]) => (
94
- <AccordionInfo key={token}>
95
- <TokenInfo className="copy" onClick={() => copyToClipboard(token)}>
96
- {token}
97
- </TokenInfo>
98
- <TokenInfo
99
- className="color copy"
100
- onClick={() => copyToClipboard(value3, opacity?.alpha)}
101
- >
102
- <ColorCircle background={value3} />
103
- <div>
104
- {value3.includes('gradient') ? 'Градиент' : value3}
105
- {opacity && <OpacityPart>{opacity.alpha}</OpacityPart>}
106
- </div>
107
- </TokenInfo>
108
- {opacity && (
109
- <TokenInfo className="opacity">{opacity.parsedAlpha}</TokenInfo>
110
- )}
111
- </AccordionInfo>
112
- ))}
94
+ {Object.entries(subcategoryTokens).map(
95
+ ([token, { value, opacity, tone, colorName }]) => (
96
+ <AccordionInfo key={token}>
97
+ <TokenInfo className="copy" onClick={() => copyToClipboard(token)}>
98
+ {token}
99
+ </TokenInfo>
100
+ <TokenInfo
101
+ className="color copy"
102
+ onClick={() => copyToClipboard(value, opacity?.alpha)}
103
+ >
104
+ <ColorCircle background={value} />
105
+ <div>
106
+ {value.includes('gradient') ? 'Градиент' : colorName || value}
107
+ {!colorName && opacity && (
108
+ <OpacityPart>{opacity.alpha}</OpacityPart>
109
+ )}
110
+ </div>
111
+ </TokenInfo>
112
+ <TokenInfo className="no-interaction">
113
+ {tone !== 'none' && tone}
114
+ </TokenInfo>
115
+ <TokenInfo className="no-interaction">{opacity?.parsedAlpha}</TokenInfo>
116
+ </AccordionInfo>
117
+ ),
118
+ )}
113
119
  </TokenInfoWrapper>
114
120
  </StyledAccordionItem>
115
121
  ))}
@@ -9,7 +9,7 @@ export var Category = /*#__PURE__*/styled.h2.withConfig({
9
9
  })(["margin:0 0 1.125rem 1.5rem;", ";"], h2);
10
10
  export var AccordionInfo = /*#__PURE__*/styled.div.withConfig({
11
11
  componentId: "plasma-new-hope__sc-1ptu1dv-2"
12
- })(["display:grid;grid-template-columns:18rem 7.938rem 3.813rem;grid-column-gap:1.5rem;font-family:var(--plasma-typo-body-m-font-family);font-size:var(--plasma-typo-body-m-font-size);font-style:var(--plasma-typo-body-m-font-style);font-weight:var(--plasma-typo-body-m-font-weight);letter-spacing:var(--plasma-typo-body-m-letter-spacing);line-height:var(--plasma-typo-body-m-line-height);"]);
12
+ })(["display:grid;grid-template-columns:18rem 7.938rem 2.375rem 3.813rem;grid-column-gap:1.5rem;font-family:var(--plasma-typo-body-m-font-family);font-size:var(--plasma-typo-body-m-font-size);font-style:var(--plasma-typo-body-m-font-style);font-weight:var(--plasma-typo-body-m-font-weight);letter-spacing:var(--plasma-typo-body-m-letter-spacing);line-height:var(--plasma-typo-body-m-line-height);"]);
13
13
  export var Subcategory = /*#__PURE__*/styled.div.withConfig({
14
14
  componentId: "plasma-new-hope__sc-1ptu1dv-3"
15
15
  })(["color:var(--text-secondary);"]);
@@ -27,7 +27,7 @@ export var OpacityPart = /*#__PURE__*/styled.span.withConfig({
27
27
  })(["color:var(--text-secondary);padding-left:0.125rem;"]);
28
28
  export var TokenInfo = /*#__PURE__*/styled.div.withConfig({
29
29
  componentId: "plasma-new-hope__sc-1ptu1dv-8"
30
- })(["color:var(--text-paragraph);cursor:default;&.copy{cursor:copy;}&.color{display:flex;align-items:center;gap:0.5rem;}&.opacity{text-align:right;}&:not(.opacity):hover{color:var(--text-paragraph-hover);", "{color:var(--text-paragraph-hover);}}&:not(.opacity):active{color:var(--text-paragraph-active);", "{color:var(--text-secondary-active);}}"], OpacityPart, OpacityPart);
30
+ })(["color:var(--text-paragraph);cursor:default;&.copy{cursor:copy;}&.color{display:flex;align-items:center;gap:0.5rem;}&.no-interaction{text-align:right;}&:not(.no-interaction):hover{color:var(--text-paragraph-hover);", "{color:var(--text-paragraph-hover);}}&:not(.no-interaction):active{color:var(--text-paragraph-active);", "{color:var(--text-secondary-active);}}"], OpacityPart, OpacityPart);
31
31
  export var ColorCircle = /*#__PURE__*/styled.div.withConfig({
32
32
  componentId: "plasma-new-hope__sc-1ptu1dv-9"
33
33
  })(["width:1.25rem;height:1.25rem;border-radius:50%;background:", ";box-shadow:", ";"], function (props) {
@@ -20,7 +20,6 @@ export declare const tokens: {
20
20
  /** Токены разделителя */
21
21
  dividerColor: string;
22
22
  dividerColorReadOnly: string;
23
- dividerOpacityReadOnly: string;
24
23
  dividerPadding: string;
25
24
  dividerFontFamily: string;
26
25
  dividerFontStyle: string;
@@ -31,7 +30,6 @@ export declare const tokens: {
31
30
  /** Токены слотов для контента */
32
31
  leftContentMargin: string;
33
32
  rightContentMargin: string;
34
- rightContentOpacityReadOnly: string;
35
33
  /** Токены лейбла */
36
34
  labelColor: string;
37
35
  labelColorReadOnly: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Range.tokens.d.ts","sourceRoot":"","sources":["../../../src/components/Range/Range.tokens.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;;;;;;CAOnB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;IAYf,yBAAyB;;;;;;;;;;;IAYzB,iCAAiC;;;;IAKjC,oBAAoB;;;;;;;;;;IAYpB,wBAAwB;;;;;;;;IAUxB,qCAAqC;;;;;;;;;;;;IAcrC,6DAA6D;;IAG7D,yCAAyC;;IAGzC,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiD5B,CAAC"}
1
+ {"version":3,"file":"Range.tokens.d.ts","sourceRoot":"","sources":["../../../src/components/Range/Range.tokens.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;;;;;;CAOnB,CAAC;AAEF,eAAO,MAAM,MAAM;;;;;;;;;;;IAYf,yBAAyB;;;;;;;;;;IAWzB,iCAAiC;;;IAIjC,oBAAoB;;;;;;;;;;IAYpB,wBAAwB;;;;;;;;IAUxB,qCAAqC;;;;;;;;;;;;IAcrC,6DAA6D;;IAG7D,yCAAyC;;IAGzC,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiD5B,CAAC"}