@salutejs/plasma-new-hope 0.178.0-canary.1514.11575933383.0 → 0.178.1-canary.1515.11581730946.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. package/cjs/components/Counter/Counter.css +1 -1
  2. package/cjs/components/Counter/Counter.js +3 -13
  3. package/cjs/components/Counter/Counter.js.map +1 -1
  4. package/cjs/components/Counter/Counter.tokens.js +0 -4
  5. package/cjs/components/Counter/Counter.tokens.js.map +1 -1
  6. package/cjs/components/Counter/variations/_size/base.js +1 -1
  7. package/cjs/components/Counter/variations/_size/base.js.map +1 -1
  8. package/cjs/components/Counter/variations/_size/{base_4mz17d.css → base_1z0ohiy.css} +1 -1
  9. package/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  10. package/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js.map +1 -1
  11. package/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  12. package/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js.map +1 -1
  13. package/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  14. package/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js.map +1 -1
  15. package/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  16. package/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js.map +1 -1
  17. package/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js +4 -2
  18. package/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js.map +1 -1
  19. package/cjs/components/Popover/Popover.js +2 -1
  20. package/cjs/components/Popover/Popover.js.map +1 -1
  21. package/cjs/components/Popup/Popup.js +2 -2
  22. package/cjs/components/Popup/Popup.js.map +1 -1
  23. package/cjs/components/Popup/PopupContext.js +1 -1
  24. package/cjs/components/Popup/PopupContext.js.map +1 -1
  25. package/cjs/components/Portal/Portal.js +4 -0
  26. package/cjs/components/Portal/Portal.js.map +1 -1
  27. package/cjs/index.css +1 -1
  28. package/emotion/cjs/components/Counter/Counter.js +3 -13
  29. package/emotion/cjs/components/Counter/Counter.template-doc.mdx +2 -2
  30. package/emotion/cjs/components/Counter/Counter.tokens.js +1 -4
  31. package/emotion/cjs/components/Counter/variations/_size/base.js +1 -1
  32. package/emotion/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  33. package/emotion/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  34. package/emotion/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  35. package/emotion/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  36. package/emotion/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js +6 -4
  37. package/emotion/cjs/components/Popover/Popover.js +2 -1
  38. package/emotion/cjs/components/Popup/Popup.js +1 -1
  39. package/emotion/cjs/components/Popup/PopupContext.js +1 -1
  40. package/emotion/cjs/components/Portal/Portal.js +4 -0
  41. package/emotion/cjs/examples/plasma_b2c/components/Counter/Counter.config.js +9 -12
  42. package/emotion/cjs/examples/plasma_b2c/components/Counter/Counter.stories.tsx +5 -7
  43. package/emotion/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +9 -6
  44. package/emotion/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +10 -6
  45. package/emotion/cjs/examples/plasma_web/components/Counter/Counter.config.js +9 -12
  46. package/emotion/cjs/examples/plasma_web/components/Counter/Counter.stories.tsx +5 -7
  47. package/emotion/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +9 -6
  48. package/emotion/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -6
  49. package/emotion/es/components/Counter/Counter.js +3 -13
  50. package/emotion/es/components/Counter/Counter.template-doc.mdx +2 -2
  51. package/emotion/es/components/Counter/Counter.tokens.js +0 -3
  52. package/emotion/es/components/Counter/variations/_size/base.js +2 -2
  53. package/emotion/es/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  54. package/emotion/es/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  55. package/emotion/es/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  56. package/emotion/es/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  57. package/emotion/es/components/Dropdown/ui/DropdownOld/DropdownOld.js +4 -2
  58. package/emotion/es/components/Popover/Popover.js +2 -1
  59. package/emotion/es/components/Popup/Popup.js +1 -1
  60. package/emotion/es/components/Popup/PopupContext.js +1 -1
  61. package/emotion/es/components/Portal/Portal.js +4 -0
  62. package/emotion/es/examples/plasma_b2c/components/Counter/Counter.config.js +9 -12
  63. package/emotion/es/examples/plasma_b2c/components/Counter/Counter.stories.tsx +5 -7
  64. package/emotion/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +9 -6
  65. package/emotion/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +10 -6
  66. package/emotion/es/examples/plasma_web/components/Counter/Counter.config.js +9 -12
  67. package/emotion/es/examples/plasma_web/components/Counter/Counter.stories.tsx +5 -7
  68. package/emotion/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +9 -6
  69. package/emotion/es/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -6
  70. package/es/components/Counter/Counter.css +1 -1
  71. package/es/components/Counter/Counter.js +3 -13
  72. package/es/components/Counter/Counter.js.map +1 -1
  73. package/es/components/Counter/Counter.tokens.js +1 -4
  74. package/es/components/Counter/Counter.tokens.js.map +1 -1
  75. package/es/components/Counter/variations/_size/base.js +1 -1
  76. package/es/components/Counter/variations/_size/base.js.map +1 -1
  77. package/es/components/Counter/variations/_size/{base_4mz17d.css → base_1z0ohiy.css} +1 -1
  78. package/es/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  79. package/es/components/Dropdown/ui/DropdownDivider/DropdownDivider.js.map +1 -1
  80. package/es/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  81. package/es/components/Dropdown/ui/DropdownFooter/DropdownFooter.js.map +1 -1
  82. package/es/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  83. package/es/components/Dropdown/ui/DropdownGroup/DropdownGroup.js.map +1 -1
  84. package/es/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  85. package/es/components/Dropdown/ui/DropdownHeader/DropdownHeader.js.map +1 -1
  86. package/es/components/Dropdown/ui/DropdownOld/DropdownOld.js +4 -2
  87. package/es/components/Dropdown/ui/DropdownOld/DropdownOld.js.map +1 -1
  88. package/es/components/Popover/Popover.js +2 -1
  89. package/es/components/Popover/Popover.js.map +1 -1
  90. package/es/components/Popup/Popup.js +2 -2
  91. package/es/components/Popup/Popup.js.map +1 -1
  92. package/es/components/Popup/PopupContext.js +1 -1
  93. package/es/components/Popup/PopupContext.js.map +1 -1
  94. package/es/components/Portal/Portal.js +4 -0
  95. package/es/components/Portal/Portal.js.map +1 -1
  96. package/es/index.css +1 -1
  97. package/package.json +4 -4
  98. package/styled-components/cjs/components/Counter/Counter.js +3 -13
  99. package/styled-components/cjs/components/Counter/Counter.template-doc.mdx +2 -2
  100. package/styled-components/cjs/components/Counter/Counter.tokens.js +1 -4
  101. package/styled-components/cjs/components/Counter/variations/_size/base.js +1 -1
  102. package/styled-components/cjs/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  103. package/styled-components/cjs/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  104. package/styled-components/cjs/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  105. package/styled-components/cjs/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  106. package/styled-components/cjs/components/Dropdown/ui/DropdownOld/DropdownOld.js +6 -4
  107. package/styled-components/cjs/components/Popover/Popover.js +2 -1
  108. package/styled-components/cjs/components/Popup/Popup.js +1 -1
  109. package/styled-components/cjs/components/Popup/PopupContext.js +1 -1
  110. package/styled-components/cjs/components/Portal/Portal.js +4 -0
  111. package/styled-components/cjs/examples/plasma_b2c/components/Counter/Counter.config.js +2 -5
  112. package/styled-components/cjs/examples/plasma_b2c/components/Counter/Counter.stories.tsx +5 -7
  113. package/styled-components/cjs/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +9 -6
  114. package/styled-components/cjs/examples/plasma_b2c/components/TextField/TextField.stories.tsx +10 -6
  115. package/styled-components/cjs/examples/plasma_web/components/Counter/Counter.config.js +2 -5
  116. package/styled-components/cjs/examples/plasma_web/components/Counter/Counter.stories.tsx +5 -7
  117. package/styled-components/cjs/examples/plasma_web/components/TextArea/TextArea.stories.tsx +9 -6
  118. package/styled-components/cjs/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -6
  119. package/styled-components/es/components/Counter/Counter.js +3 -13
  120. package/styled-components/es/components/Counter/Counter.template-doc.mdx +2 -2
  121. package/styled-components/es/components/Counter/Counter.tokens.js +0 -3
  122. package/styled-components/es/components/Counter/variations/_size/base.js +2 -2
  123. package/styled-components/es/components/Dropdown/ui/DropdownDivider/DropdownDivider.js +2 -2
  124. package/styled-components/es/components/Dropdown/ui/DropdownFooter/DropdownFooter.js +2 -2
  125. package/styled-components/es/components/Dropdown/ui/DropdownGroup/DropdownGroup.js +2 -2
  126. package/styled-components/es/components/Dropdown/ui/DropdownHeader/DropdownHeader.js +2 -2
  127. package/styled-components/es/components/Dropdown/ui/DropdownOld/DropdownOld.js +4 -2
  128. package/styled-components/es/components/Popover/Popover.js +2 -1
  129. package/styled-components/es/components/Popup/Popup.js +1 -1
  130. package/styled-components/es/components/Popup/PopupContext.js +1 -1
  131. package/styled-components/es/components/Portal/Portal.js +4 -0
  132. package/styled-components/es/examples/plasma_b2c/components/Counter/Counter.config.js +2 -5
  133. package/styled-components/es/examples/plasma_b2c/components/Counter/Counter.stories.tsx +5 -7
  134. package/styled-components/es/examples/plasma_b2c/components/TextArea/TextArea.stories.tsx +9 -6
  135. package/styled-components/es/examples/plasma_b2c/components/TextField/TextField.stories.tsx +10 -6
  136. package/styled-components/es/examples/plasma_web/components/Counter/Counter.config.js +2 -5
  137. package/styled-components/es/examples/plasma_web/components/Counter/Counter.stories.tsx +5 -7
  138. package/styled-components/es/examples/plasma_web/components/TextArea/TextArea.stories.tsx +9 -6
  139. package/styled-components/es/examples/plasma_web/components/TextField/TextField.stories.tsx +10 -6
  140. package/types/components/Counter/Counter.d.ts.map +1 -1
  141. package/types/components/Counter/Counter.tokens.d.ts +0 -3
  142. package/types/components/Counter/Counter.tokens.d.ts.map +1 -1
  143. package/types/components/Counter/Counter.types.d.ts +2 -2
  144. package/types/components/Counter/variations/_size/base.d.ts.map +1 -1
  145. package/types/components/Dropdown/ui/DropdownDivider/DropdownDivider.d.ts.map +1 -1
  146. package/types/components/Dropdown/ui/DropdownFooter/DropdownFooter.d.ts.map +1 -1
  147. package/types/components/Dropdown/ui/DropdownGroup/DropdownGroup.d.ts.map +1 -1
  148. package/types/components/Dropdown/ui/DropdownHeader/DropdownHeader.d.ts.map +1 -1
  149. package/types/components/Dropdown/ui/DropdownOld/DropdownOld.d.ts.map +1 -1
  150. package/types/components/Popover/Popover.d.ts.map +1 -1
  151. package/types/components/Popup/PopupContext.d.ts.map +1 -1
  152. package/types/components/Portal/Portal.d.ts.map +1 -1
  153. package/types/examples/plasma_b2c/components/Counter/Counter.config.d.ts +0 -3
  154. package/types/examples/plasma_b2c/components/Counter/Counter.config.d.ts.map +1 -1
  155. package/types/examples/plasma_b2c/components/Counter/Counter.d.ts +0 -3
  156. package/types/examples/plasma_b2c/components/Counter/Counter.d.ts.map +1 -1
  157. package/types/examples/plasma_web/components/Counter/Counter.config.d.ts +0 -3
  158. package/types/examples/plasma_web/components/Counter/Counter.config.d.ts.map +1 -1
  159. package/types/examples/plasma_web/components/Counter/Counter.d.ts +0 -3
  160. package/types/examples/plasma_web/components/Counter/Counter.d.ts.map +1 -1
@@ -95,43 +95,44 @@ const meta: Meta<typeof TextField> = {
95
95
  },
96
96
  hintText: {
97
97
  control: { type: 'text' },
98
+ if: { arg: 'hasHint', truthy: true },
98
99
  },
99
100
  hintView: {
100
101
  options: hintViews,
101
102
  control: {
102
103
  type: 'select',
103
104
  },
104
- if: { arg: 'hintText', neq: '' },
105
+ if: { arg: 'hasHint', truthy: true },
105
106
  },
106
107
  hintSize: {
107
108
  options: hintSizes,
108
109
  control: {
109
110
  type: 'select',
110
111
  },
111
- if: { arg: 'hintText', neq: '' },
112
+ if: { arg: 'hasHint', truthy: true },
112
113
  },
113
114
  hintTrigger: {
114
115
  options: hintTriggers,
115
116
  control: {
116
117
  type: 'inline-radio',
117
118
  },
118
- if: { arg: 'hintText', neq: '' },
119
+ if: { arg: 'hasHint', truthy: true },
119
120
  },
120
121
  hintPlacement: {
121
122
  options: placements,
122
123
  control: {
123
124
  type: 'select',
124
125
  },
125
- if: { arg: 'hintText', neq: '' },
126
+ if: { arg: 'hasHint', truthy: true },
126
127
  mappers: placements,
127
128
  },
128
129
  hintHasArrow: {
129
130
  control: { type: 'boolean' },
130
- if: { arg: 'hintText', neq: '' },
131
+ if: { arg: 'hasHint', truthy: true },
131
132
  },
132
133
  hintWidth: {
133
134
  control: { type: 'text' },
134
- if: { arg: 'hintText', neq: '' },
135
+ if: { arg: 'hasHint', truthy: true },
135
136
  },
136
137
  },
137
138
  };
@@ -158,6 +159,7 @@ type StoryPropsDefault = Omit<
158
159
  | 'chips'
159
160
  | 'onChangeChips'
160
161
  > & {
162
+ hasHint: boolean;
161
163
  enableContentLeft: boolean;
162
164
  enableContentRight: boolean;
163
165
  };
@@ -222,6 +224,7 @@ export const Default: StoryObj<StoryPropsDefault> = {
222
224
  requiredPlacement: 'right',
223
225
  clear: false,
224
226
  hasDivider: false,
227
+ hasHint: true,
225
228
  hintText: 'Текст подсказки',
226
229
  hintTrigger: 'hover',
227
230
  hintView: 'default',
@@ -251,6 +254,7 @@ type StoryPropsChips = Omit<
251
254
  | 'minLength'
252
255
  | 'enumerationType'
253
256
  > & {
257
+ hasHint: boolean;
254
258
  enableContentLeft: boolean;
255
259
  enableContentRight: boolean;
256
260
  };
@@ -22,11 +22,8 @@ var config = exports.config = {
22
22
  light: /*#__PURE__*/(0, _styledComponents.css)(["", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default);"], _Counter.counterTokens.color, _Counter.counterTokens.background)
23
23
  },
24
24
  size: {
25
- l: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":1.75rem;", ":0.625rem;", ":0.625rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight),
26
- m: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":1.5rem;", ":0.5rem;", ":0.5rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight),
27
- s: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":1.25rem;", ":0.375rem;", ":0.375rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight),
28
- xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":1rem;", ":0.25rem;", ":0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight),
29
- xxs: /*#__PURE__*/(0, _styledComponents.css)(["", ":1rem;", ":0.75rem;", ":0.125rem;", ":0.125rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight)
25
+ xs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":1rem;", ":0.25rem;", ":0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight),
26
+ xxs: /*#__PURE__*/(0, _styledComponents.css)(["", ":0.5rem;", ":0.75rem;", ":0.25rem;", ":0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], _Counter.counterTokens.borderRadius, _Counter.counterTokens.height, _Counter.counterTokens.paddingRight, _Counter.counterTokens.paddingLeft, _Counter.counterTokens.fontFamily, _Counter.counterTokens.fontSize, _Counter.counterTokens.fontStyle, _Counter.counterTokens.fontWeight, _Counter.counterTokens.letterSpacing, _Counter.counterTokens.lineHeight)
30
27
  }
31
28
  }
32
29
  };
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { disableProps } from '@salutejs/plasma-sb-utils';
2
3
  import type { StoryObj, Meta } from '@storybook/react';
3
4
 
@@ -5,22 +6,19 @@ import { WithTheme } from '../../../_helpers';
5
6
 
6
7
  import { Counter } from './Counter';
7
8
 
8
- const sizes = ['l', 'm', 's', 'xs', 'xxs'];
9
- const views = ['default', 'accent', 'positive', 'warning', 'negative', 'dark', 'light'];
10
-
11
9
  const meta: Meta<typeof Counter> = {
12
10
  title: 'plasma_web/Counter',
13
11
  component: Counter,
14
12
  decorators: [WithTheme],
15
13
  argTypes: {
16
14
  size: {
17
- options: sizes,
15
+ options: ['xs', 'xxs'],
18
16
  control: {
19
17
  type: 'select',
20
18
  },
21
19
  },
22
20
  view: {
23
- options: views,
21
+ options: ['default', 'accent', 'positive', 'warning', 'negative', 'dark', 'light'],
24
22
  control: {
25
23
  type: 'select',
26
24
  },
@@ -35,8 +33,8 @@ type Story = StoryObj<typeof Counter>;
35
33
 
36
34
  export const Default: Story = {
37
35
  args: {
38
- count: 123,
39
- maxCount: 200,
36
+ count: 25,
37
+ maxCount: 100,
40
38
  view: 'default',
41
39
  size: 'xs',
42
40
  },
@@ -37,6 +37,7 @@ const placements: Array<PopoverPlacement> = [
37
37
  ];
38
38
 
39
39
  type StoryTextAreaPropsCustom = {
40
+ hasHint?: boolean;
40
41
  enableContentRight?: boolean;
41
42
  };
42
43
 
@@ -92,43 +93,44 @@ const meta: Meta<StoryTextAreaProps> = {
92
93
  },
93
94
  hintText: {
94
95
  control: { type: 'text' },
96
+ if: { arg: 'hasHint', truthy: true },
95
97
  },
96
98
  hintView: {
97
99
  options: hintViews,
98
100
  control: {
99
101
  type: 'select',
100
102
  },
101
- if: { arg: 'hintText', neq: '' },
103
+ if: { arg: 'hasHint', truthy: true },
102
104
  },
103
105
  hintSize: {
104
106
  options: hintSizes,
105
107
  control: {
106
108
  type: 'select',
107
109
  },
108
- if: { arg: 'hintText', neq: '' },
110
+ if: { arg: 'hasHint', truthy: true },
109
111
  },
110
112
  hintTrigger: {
111
113
  options: hintTriggers,
112
114
  control: {
113
115
  type: 'inline-radio',
114
116
  },
115
- if: { arg: 'hintText', neq: '' },
117
+ if: { arg: 'hasHint', truthy: true },
116
118
  },
117
119
  hintPlacement: {
118
120
  options: placements,
119
121
  control: {
120
122
  type: 'select',
121
123
  },
122
- if: { arg: 'hintText', neq: '' },
124
+ if: { arg: 'hasHint', truthy: true },
123
125
  mappers: placements,
124
126
  },
125
127
  hintHasArrow: {
126
128
  control: { type: 'boolean' },
127
- if: { arg: 'hintText', neq: '' },
129
+ if: { arg: 'hasHint', truthy: true },
128
130
  },
129
131
  hintWidth: {
130
132
  control: { type: 'text' },
131
- if: { arg: 'hintText', neq: '' },
133
+ if: { arg: 'hasHint', truthy: true },
132
134
  },
133
135
  },
134
136
  args: {
@@ -152,6 +154,7 @@ const meta: Meta<StoryTextAreaProps> = {
152
154
  requiredPlacement: 'right',
153
155
  clear: false,
154
156
  hasDivider: false,
157
+ hasHint: true,
155
158
  hintText: 'Текст подсказки',
156
159
  hintTrigger: 'hover',
157
160
  hintView: 'default',
@@ -95,43 +95,44 @@ const meta: Meta<typeof TextField> = {
95
95
  },
96
96
  hintText: {
97
97
  control: { type: 'text' },
98
+ if: { arg: 'hasHint', truthy: true },
98
99
  },
99
100
  hintView: {
100
101
  options: hintViews,
101
102
  control: {
102
103
  type: 'select',
103
104
  },
104
- if: { arg: 'hintText', neq: '' },
105
+ if: { arg: 'hasHint', truthy: true },
105
106
  },
106
107
  hintSize: {
107
108
  options: hintSizes,
108
109
  control: {
109
110
  type: 'select',
110
111
  },
111
- if: { arg: 'hintText', neq: '' },
112
+ if: { arg: 'hasHint', truthy: true },
112
113
  },
113
114
  hintTrigger: {
114
115
  options: hintTriggers,
115
116
  control: {
116
117
  type: 'inline-radio',
117
118
  },
118
- if: { arg: 'hintText', neq: '' },
119
+ if: { arg: 'hasHint', truthy: true },
119
120
  },
120
121
  hintPlacement: {
121
122
  options: placements,
122
123
  control: {
123
124
  type: 'select',
124
125
  },
125
- if: { arg: 'hintText', neq: '' },
126
+ if: { arg: 'hasHint', truthy: true },
126
127
  mappers: placements,
127
128
  },
128
129
  hintHasArrow: {
129
130
  control: { type: 'boolean' },
130
- if: { arg: 'hintText', neq: '' },
131
+ if: { arg: 'hasHint', truthy: true },
131
132
  },
132
133
  hintWidth: {
133
134
  control: { type: 'text' },
134
- if: { arg: 'hintText', neq: '' },
135
+ if: { arg: 'hasHint', truthy: true },
135
136
  },
136
137
  },
137
138
  };
@@ -158,6 +159,7 @@ type StoryPropsDefault = Omit<
158
159
  | 'chips'
159
160
  | 'onChangeChips'
160
161
  > & {
162
+ hasHint: boolean;
161
163
  enableContentLeft: boolean;
162
164
  enableContentRight: boolean;
163
165
  };
@@ -222,6 +224,7 @@ export const Default: StoryObj<StoryPropsDefault> = {
222
224
  optional: false,
223
225
  required: false,
224
226
  requiredPlacement: 'right',
227
+ hasHint: true,
225
228
  hintText: 'Текст подсказки',
226
229
  hintTrigger: 'hover',
227
230
  hintView: 'default',
@@ -251,6 +254,7 @@ type StoryPropsChips = Omit<
251
254
  | 'minLength'
252
255
  | 'enumerationType'
253
256
  > & {
257
+ hasHint: boolean;
254
258
  enableContentLeft: boolean;
255
259
  enableContentRight: boolean;
256
260
  };
@@ -1,34 +1,24 @@
1
- var _excluded = ["count", "maxCount", "size", "view", "className"];
1
+ var _excluded = ["count", "maxCount", "size", "view"];
2
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
5
  import React, { forwardRef } from 'react';
6
- import { cx } from '../../utils';
7
6
  import { base as viewCSS } from './variations/_view/base';
8
7
  import { base as sizeCSS } from './variations/_size/base';
9
8
  import { base } from './Counter.styles';
10
- import { classes } from './Counter.tokens';
11
- var MIN_COUNT = 1;
12
9
  export var counterRoot = function counterRoot(Root) {
13
10
  return /*#__PURE__*/forwardRef(function (props, ref) {
14
11
  var count = props.count,
15
12
  maxCount = props.maxCount,
16
13
  size = props.size,
17
14
  view = props.view,
18
- className = props.className,
19
15
  rest = _objectWithoutProperties(props, _excluded);
20
- var currentCount = count < MIN_COUNT ? MIN_COUNT : count;
21
- var currentMaxCount = maxCount && maxCount < MIN_COUNT ? MIN_COUNT : maxCount;
22
- var isCurrentCountOneDigit = currentCount >= 0 && currentCount < 10;
23
- var isCurrentMaxCountExceeded = currentMaxCount && currentCount > currentMaxCount;
24
- var content = isCurrentMaxCountExceeded ? "".concat(currentMaxCount, "+") : currentCount;
25
- var roundClass = !isCurrentMaxCountExceeded && isCurrentCountOneDigit ? classes.round : undefined;
16
+ var content = maxCount && count > maxCount ? "".concat(maxCount, "+") : count;
26
17
  return /*#__PURE__*/React.createElement(Root, _extends({
27
18
  ref: ref,
28
19
  view: view,
29
20
  size: size,
30
- count: count,
31
- className: cx(roundClass, className)
21
+ count: count
32
22
  }, rest), content);
33
23
  });
34
24
  };
@@ -12,7 +12,7 @@ import { PropsTable, Description } from '@site/src/components';
12
12
  ## Примеры
13
13
 
14
14
  ### Максимальное значение числового badge
15
- Задается с помощью свойства `maxCount`. Как и `count`, не может быть меньше 1.
15
+ Задается с помощью свойства `maxCount`.
16
16
 
17
17
  ```tsx live
18
18
  import React from 'react';
@@ -29,7 +29,7 @@ export function App() {
29
29
  ```
30
30
 
31
31
  ### Размер числового badge
32
- Размер задается с помощью свойства `size`. Возможные значения свойства: `xxs`, `xs`, `s`, `m`, `l`.
32
+ Размер задается с помощью свойства `size`. Возможные значения свойства: `"xs"` или `"xxs"`.
33
33
 
34
34
  ```tsx live
35
35
  import React from 'react';
@@ -1,6 +1,3 @@
1
- export var classes = {
2
- round: '--plasma-counter-round'
3
- };
4
1
  export var tokens = {
5
2
  background: '--plasma-counter-background',
6
3
  color: '--plasma-counter-color',
@@ -1,3 +1,3 @@
1
1
  import { css } from 'styled-components';
2
- import { classes, tokens } from '../../Counter.tokens';
3
- export var base = /*#__PURE__*/css(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");border-radius:var(", ");height:var(", ");padding-top:var(", ");padding-right:var(", ");padding-bottom:var(", ");padding-left:var(", ");&.", "{width:var(", ");}"], tokens.fontFamily, tokens.fontSize, tokens.fontStyle, tokens.fontWeight, tokens.letterSpacing, tokens.lineHeight, tokens.borderRadius, tokens.height, tokens.paddingTop, tokens.paddingRight, tokens.paddingBottom, tokens.paddingLeft, classes.round, tokens.height);
2
+ import { tokens } from '../../Counter.tokens';
3
+ export var base = /*#__PURE__*/css(["font-family:var(", ");font-size:var(", ");font-style:var(", ");font-weight:var(", ");letter-spacing:var(", ");line-height:var(", ");border-radius:var(", ");height:var(", ");padding-top:var(", ");padding-right:var(", ");padding-bottom:var(", ");padding-left:var(", ");"], tokens.fontFamily, tokens.fontSize, tokens.fontStyle, tokens.fontWeight, tokens.letterSpacing, tokens.lineHeight, tokens.borderRadius, tokens.height, tokens.paddingTop, tokens.paddingRight, tokens.paddingBottom, tokens.paddingLeft);
@@ -3,7 +3,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
5
  import React, { forwardRef } from 'react';
6
- import { useUniqId } from '@salutejs/plasma-core';
6
+ import { safeUseId } from '../../../../utils';
7
7
  import { base as viewCSS } from './variations/_view/base';
8
8
  import { base as sizeCSS } from './variations/_size/base';
9
9
  import { StyledDropdownDivider } from './DropdownDivider.styles';
@@ -17,7 +17,7 @@ export var dropdownDividerRoot = function dropdownDividerRoot(Root) {
17
17
  view = _ref.view,
18
18
  size = _ref.size,
19
19
  rest = _objectWithoutProperties(_ref, _excluded);
20
- var uniqId = useUniqId();
20
+ var uniqId = safeUseId();
21
21
  var innerId = id || uniqId;
22
22
  return /*#__PURE__*/React.createElement(Root, {
23
23
  id: innerId,
@@ -3,7 +3,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
5
  import React, { forwardRef } from 'react';
6
- import { useUniqId } from '@salutejs/plasma-core';
6
+ import { safeUseId } from '../../../../utils';
7
7
  import { base as viewCSS } from './variations/_view/base';
8
8
  import { base as sizeCSS } from './variations/_size/base';
9
9
  import { StyledDropdownFooter } from './DropdownFooter.styles';
@@ -18,7 +18,7 @@ export var dropdownFooterRoot = function dropdownFooterRoot(Root) {
18
18
  view = _ref.view,
19
19
  size = _ref.size,
20
20
  rest = _objectWithoutProperties(_ref, _excluded);
21
- var uniqId = useUniqId();
21
+ var uniqId = safeUseId();
22
22
  var innerId = id || uniqId;
23
23
  return /*#__PURE__*/React.createElement(Root, {
24
24
  id: innerId,
@@ -3,7 +3,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
5
  import React, { forwardRef } from 'react';
6
- import { useUniqId } from '@salutejs/plasma-core';
6
+ import { safeUseId } from '../../../../utils';
7
7
  import { base as viewCSS } from './variations/_view/base';
8
8
  import { base as sizeCSS } from './variations/_size/base';
9
9
  import { StyledDropdownGroup, StyledDropdownLabel } from './DropdownGroup.styles';
@@ -21,7 +21,7 @@ export var dropdownGroupRoot = function dropdownGroupRoot(Root) {
21
21
  view = _ref.view,
22
22
  size = _ref.size,
23
23
  rest = _objectWithoutProperties(_ref, _excluded);
24
- var uniqId = useUniqId();
24
+ var uniqId = safeUseId();
25
25
  var innerId = id || uniqId;
26
26
  return /*#__PURE__*/React.createElement(Root, {
27
27
  id: innerId,
@@ -3,7 +3,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
5
  import React, { forwardRef } from 'react';
6
- import { useUniqId } from '@salutejs/plasma-core';
6
+ import { safeUseId } from '../../../../utils';
7
7
  import { base as viewCSS } from './variations/_view/base';
8
8
  import { base as sizeCSS } from './variations/_size/base';
9
9
  import { StyledDropdownHeader } from './DropdownHeader.styles';
@@ -18,7 +18,7 @@ export var dropdownHeaderRoot = function dropdownHeaderRoot(Root) {
18
18
  size = _ref.size,
19
19
  children = _ref.children,
20
20
  rest = _objectWithoutProperties(_ref, _excluded);
21
- var uniqId = useUniqId();
21
+ var uniqId = safeUseId();
22
22
  var innerId = id || uniqId;
23
23
  return /*#__PURE__*/React.createElement(Root, {
24
24
  id: innerId,
@@ -3,7 +3,9 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
3
3
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
5
  import React, { forwardRef, useRef } from 'react';
6
- import { useFocusTrap, useForkRef, useUniqId } from '@salutejs/plasma-core';
6
+ import { useForkRef } from '@salutejs/plasma-core';
7
+ import { useFocusTrap } from '../../../../hooks';
8
+ import { safeUseId } from '../../../../utils';
7
9
  import { base as viewCSS } from './variations/_view/base';
8
10
  import { base as sizeCSS } from './variations/_size/base';
9
11
  import { StyledDropdown, StyledPopover } from './Dropdown.styles';
@@ -42,7 +44,7 @@ export var dropdownOldRoot = function dropdownOldRoot(Root) {
42
44
  closeOnEsc = _ref$closeOnEsc === void 0 ? false : _ref$closeOnEsc,
43
45
  rest = _objectWithoutProperties(_ref, _excluded);
44
46
  var innerIsOpen = Boolean(isOpen || opened);
45
- var uniqId = useUniqId();
47
+ var uniqId = safeUseId();
46
48
  var innerId = id || uniqId;
47
49
  var rootRef = useRef(null);
48
50
  var dropdownRef = useRef(null);
@@ -16,7 +16,8 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
16
16
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
17
17
  import React, { useRef, useCallback, useEffect, useState, forwardRef } from 'react';
18
18
  import { usePopper } from 'react-popper';
19
- import { useFocusTrap, useForkRef } from '@salutejs/plasma-core';
19
+ import { useForkRef } from '@salutejs/plasma-core';
20
+ import { useFocusTrap } from '../../hooks';
20
21
  import { cx } from '../../utils';
21
22
  import { Portal } from '../Portal';
22
23
  import { base as viewCSS } from './variations/_view/base';
@@ -130,7 +130,7 @@ export var popupRoot = function popupRoot(Root) {
130
130
  animationInfo: animationInfo,
131
131
  setVisible: setVisible
132
132
  }, children));
133
- if (typeof frame !== 'string' && frame && frame.current) {
133
+ if (typeof frame !== 'string' && frame && frame.current && canUseDOM) {
134
134
  return /*#__PURE__*/React.createElement(Portal, {
135
135
  container: frame.current
136
136
  }, rootNode);
@@ -82,7 +82,7 @@ export var PopupProvider = function PopupProvider(_ref) {
82
82
  };
83
83
  return /*#__PURE__*/React.createElement(PopupContext.Provider, {
84
84
  value: context
85
- }, children, /*#__PURE__*/React.createElement(Portal, {
85
+ }, children, canUseDOM && /*#__PURE__*/React.createElement(Portal, {
86
86
  container: document.body
87
87
  }, /*#__PURE__*/React.createElement(StyledPortal, {
88
88
  id: rootId
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import ReactDOM from 'react-dom';
3
+ import { canUseDOM } from '../../utils';
3
4
  /**
4
5
  * Вспомогательный компонент. Используется в Popup, Popover.
5
6
  * Представляет собой ReactDOM.createPortal() в форме компонента.
@@ -9,6 +10,9 @@ export var Portal = function Portal(_ref) {
9
10
  container = _ref.container,
10
11
  _ref$disabled = _ref.disabled,
11
12
  disabled = _ref$disabled === void 0 ? false : _ref$disabled;
13
+ if (!canUseDOM) {
14
+ return null;
15
+ }
12
16
  var portalContainer = typeof container === 'function' ? container() : container;
13
17
  return /*#__PURE__*/React.createElement(React.Fragment, null, disabled && children, !disabled && /*#__PURE__*/ReactDOM.createPortal(children, portalContainer));
14
18
  };
@@ -16,11 +16,8 @@ export var config = {
16
16
  light: /*#__PURE__*/css(["", ":var(--on-light-text-primary);", ":var(--on-dark-surface-solid-default);"], counterTokens.color, counterTokens.background)
17
17
  },
18
18
  size: {
19
- l: /*#__PURE__*/css(["", ":1rem;", ":1.75rem;", ":0.625rem;", ":0.625rem;", ":var(--plasma-typo-body-s-font-family);", ":var(--plasma-typo-body-s-font-size);", ":var(--plasma-typo-body-s-font-style);", ":var(--plasma-typo-body-s-font-weight);", ":var(--plasma-typo-body-s-letter-spacing);", ":var(--plasma-typo-body-s-line-height);"], counterTokens.borderRadius, counterTokens.height, counterTokens.paddingRight, counterTokens.paddingLeft, counterTokens.fontFamily, counterTokens.fontSize, counterTokens.fontStyle, counterTokens.fontWeight, counterTokens.letterSpacing, counterTokens.lineHeight),
20
- m: /*#__PURE__*/css(["", ":1rem;", ":1.5rem;", ":0.5rem;", ":0.5rem;", ":var(--plasma-typo-body-xs-font-family);", ":var(--plasma-typo-body-xs-font-size);", ":var(--plasma-typo-body-xs-font-style);", ":var(--plasma-typo-body-xs-font-weight);", ":var(--plasma-typo-body-xs-letter-spacing);", ":var(--plasma-typo-body-xs-line-height);"], counterTokens.borderRadius, counterTokens.height, counterTokens.paddingRight, counterTokens.paddingLeft, counterTokens.fontFamily, counterTokens.fontSize, counterTokens.fontStyle, counterTokens.fontWeight, counterTokens.letterSpacing, counterTokens.lineHeight),
21
- s: /*#__PURE__*/css(["", ":1rem;", ":1.25rem;", ":0.375rem;", ":0.375rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], counterTokens.borderRadius, counterTokens.height, counterTokens.paddingRight, counterTokens.paddingLeft, counterTokens.fontFamily, counterTokens.fontSize, counterTokens.fontStyle, counterTokens.fontWeight, counterTokens.letterSpacing, counterTokens.lineHeight),
22
- xs: /*#__PURE__*/css(["", ":1rem;", ":1rem;", ":0.25rem;", ":0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], counterTokens.borderRadius, counterTokens.height, counterTokens.paddingRight, counterTokens.paddingLeft, counterTokens.fontFamily, counterTokens.fontSize, counterTokens.fontStyle, counterTokens.fontWeight, counterTokens.letterSpacing, counterTokens.lineHeight),
23
- xxs: /*#__PURE__*/css(["", ":1rem;", ":0.75rem;", ":0.125rem;", ":0.125rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], counterTokens.borderRadius, counterTokens.height, counterTokens.paddingRight, counterTokens.paddingLeft, counterTokens.fontFamily, counterTokens.fontSize, counterTokens.fontStyle, counterTokens.fontWeight, counterTokens.letterSpacing, counterTokens.lineHeight)
19
+ xs: /*#__PURE__*/css(["", ":0.5rem;", ":1rem;", ":0.25rem;", ":0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], counterTokens.borderRadius, counterTokens.height, counterTokens.paddingRight, counterTokens.paddingLeft, counterTokens.fontFamily, counterTokens.fontSize, counterTokens.fontStyle, counterTokens.fontWeight, counterTokens.letterSpacing, counterTokens.lineHeight),
20
+ xxs: /*#__PURE__*/css(["", ":0.5rem;", ":0.75rem;", ":0.25rem;", ":0.25rem;", ":var(--plasma-typo-body-xxs-font-family);", ":var(--plasma-typo-body-xxs-font-size);", ":var(--plasma-typo-body-xxs-font-style);", ":var(--plasma-typo-body-xxs-font-weight);", ":var(--plasma-typo-body-xxs-letter-spacing);", ":var(--plasma-typo-body-xxs-line-height);"], counterTokens.borderRadius, counterTokens.height, counterTokens.paddingRight, counterTokens.paddingLeft, counterTokens.fontFamily, counterTokens.fontSize, counterTokens.fontStyle, counterTokens.fontWeight, counterTokens.letterSpacing, counterTokens.lineHeight)
24
21
  }
25
22
  }
26
23
  };
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { disableProps } from '@salutejs/plasma-sb-utils';
2
3
  import type { StoryObj, Meta } from '@storybook/react';
3
4
 
@@ -5,22 +6,19 @@ import { WithTheme } from '../../../_helpers';
5
6
 
6
7
  import { Counter } from './Counter';
7
8
 
8
- const sizes = ['l', 'm', 's', 'xs', 'xxs'];
9
- const views = ['default', 'accent', 'positive', 'warning', 'negative', 'dark', 'light'];
10
-
11
9
  const meta: Meta<typeof Counter> = {
12
10
  title: 'plasma_b2c/Counter',
13
11
  component: Counter,
14
12
  decorators: [WithTheme],
15
13
  argTypes: {
16
14
  size: {
17
- options: sizes,
15
+ options: ['xs', 'xxs'],
18
16
  control: {
19
17
  type: 'select',
20
18
  },
21
19
  },
22
20
  view: {
23
- options: views,
21
+ options: ['default', 'accent', 'positive', 'warning', 'negative', 'dark', 'light'],
24
22
  control: {
25
23
  type: 'select',
26
24
  },
@@ -35,8 +33,8 @@ type Story = StoryObj<typeof Counter>;
35
33
 
36
34
  export const Default: Story = {
37
35
  args: {
38
- count: 123,
39
- maxCount: 200,
36
+ count: 25,
37
+ maxCount: 100,
40
38
  view: 'default',
41
39
  size: 'xs',
42
40
  },
@@ -37,6 +37,7 @@ const placements: Array<PopoverPlacement> = [
37
37
  ];
38
38
 
39
39
  type StoryTextAreaPropsCustom = {
40
+ hasHint?: boolean;
40
41
  enableContentRight?: boolean;
41
42
  };
42
43
 
@@ -92,43 +93,44 @@ const meta: Meta<StoryTextAreaProps> = {
92
93
  },
93
94
  hintText: {
94
95
  control: { type: 'text' },
96
+ if: { arg: 'hasHint', truthy: true },
95
97
  },
96
98
  hintView: {
97
99
  options: hintViews,
98
100
  control: {
99
101
  type: 'select',
100
102
  },
101
- if: { arg: 'hintText', neq: '' },
103
+ if: { arg: 'hasHint', truthy: true },
102
104
  },
103
105
  hintSize: {
104
106
  options: hintSizes,
105
107
  control: {
106
108
  type: 'select',
107
109
  },
108
- if: { arg: 'hintText', neq: '' },
110
+ if: { arg: 'hasHint', truthy: true },
109
111
  },
110
112
  hintTrigger: {
111
113
  options: hintTriggers,
112
114
  control: {
113
115
  type: 'inline-radio',
114
116
  },
115
- if: { arg: 'hintText', neq: '' },
117
+ if: { arg: 'hasHint', truthy: true },
116
118
  },
117
119
  hintPlacement: {
118
120
  options: placements,
119
121
  control: {
120
122
  type: 'select',
121
123
  },
122
- if: { arg: 'hintText', neq: '' },
124
+ if: { arg: 'hasHint', truthy: true },
123
125
  mappers: placements,
124
126
  },
125
127
  hintHasArrow: {
126
128
  control: { type: 'boolean' },
127
- if: { arg: 'hintText', neq: '' },
129
+ if: { arg: 'hasHint', truthy: true },
128
130
  },
129
131
  hintWidth: {
130
132
  control: { type: 'text' },
131
- if: { arg: 'hintText', neq: '' },
133
+ if: { arg: 'hasHint', truthy: true },
132
134
  },
133
135
  },
134
136
  args: {
@@ -152,6 +154,7 @@ const meta: Meta<StoryTextAreaProps> = {
152
154
  requiredPlacement: 'right',
153
155
  clear: false,
154
156
  hasDivider: false,
157
+ hasHint: true,
155
158
  hintText: 'Текст подсказки',
156
159
  hintTrigger: 'hover',
157
160
  hintView: 'default',