@salutejs/plasma-new-hope 0.135.0-canary.1404.10631789671.0 → 0.135.0-canary.1405.10631388441.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (261) hide show
  1. package/cjs/components/DatePicker/RangeDate/RangeDate.js +9 -19
  2. package/cjs/components/DatePicker/RangeDate/RangeDate.js.map +1 -1
  3. package/cjs/components/DatePicker/SingleDate/SingleDate.js +5 -12
  4. package/cjs/components/DatePicker/SingleDate/SingleDate.js.map +1 -1
  5. package/cjs/components/DatePicker/hooks/useDatePicker.js +7 -9
  6. package/cjs/components/DatePicker/hooks/useDatePicker.js.map +1 -1
  7. package/cjs/components/DatePicker/utils/dateHelper.js +13 -13
  8. package/cjs/components/DatePicker/utils/dateHelper.js.map +1 -1
  9. package/cjs/components/InputGroup/InputGroup.css +11 -0
  10. package/cjs/components/InputGroup/InputGroup.js +81 -0
  11. package/cjs/components/InputGroup/InputGroup.js.map +1 -0
  12. package/cjs/components/InputGroup/InputGroup.styles.js +9 -0
  13. package/cjs/components/InputGroup/InputGroup.styles.js.map +1 -0
  14. package/cjs/components/InputGroup/InputGroup.styles_1ivl67d.css +1 -0
  15. package/cjs/components/InputGroup/InputGroup.tokens.js +94 -0
  16. package/cjs/components/InputGroup/InputGroup.tokens.js.map +1 -0
  17. package/cjs/components/InputGroup/variations/_gap/base.js +9 -0
  18. package/cjs/components/InputGroup/variations/_gap/base.js.map +1 -0
  19. package/cjs/components/InputGroup/variations/_gap/base_1k4piyx.css +1 -0
  20. package/cjs/components/InputGroup/variations/_orientation/base.js +9 -0
  21. package/cjs/components/InputGroup/variations/_orientation/base.js.map +1 -0
  22. package/cjs/components/InputGroup/variations/_orientation/base_mgs8eg.css +1 -0
  23. package/cjs/components/InputGroup/variations/_shape/base.js +9 -0
  24. package/cjs/components/InputGroup/variations/_shape/base.js.map +1 -0
  25. package/cjs/components/InputGroup/variations/_shape/base_3k0aw7.css +1 -0
  26. package/cjs/components/InputGroup/variations/_size/base.js +9 -0
  27. package/cjs/components/InputGroup/variations/_size/base.js.map +1 -0
  28. package/cjs/components/InputGroup/variations/_size/base_1vk5vms.css +1 -0
  29. package/cjs/components/InputGroup/variations/_stretching/base.js +9 -0
  30. package/cjs/components/InputGroup/variations/_stretching/base.js.map +1 -0
  31. package/cjs/components/InputGroup/variations/_stretching/base_1cr1a83.css +1 -0
  32. package/cjs/components/TextField/TextField.js +1 -1
  33. package/cjs/components/TextField/TextField.js.map +1 -1
  34. package/cjs/components/TextField/TextField.tokens.js +2 -1
  35. package/cjs/components/TextField/TextField.tokens.js.map +1 -1
  36. package/cjs/index.css +12 -0
  37. package/cjs/index.js +7 -0
  38. package/cjs/index.js.map +1 -1
  39. package/cjs/utils/datejs.js +0 -2
  40. package/cjs/utils/datejs.js.map +1 -1
  41. package/emotion/cjs/components/DatePicker/DatePicker.template-doc.mdx +0 -32
  42. package/emotion/cjs/components/DatePicker/RangeDate/RangeDate.js +9 -19
  43. package/emotion/cjs/components/DatePicker/SingleDate/SingleDate.js +5 -12
  44. package/emotion/cjs/components/DatePicker/hooks/useDatePicker.js +7 -9
  45. package/emotion/cjs/components/DatePicker/utils/dateHelper.js +13 -13
  46. package/emotion/cjs/components/InputGroup/InputGroup.js +83 -0
  47. package/emotion/cjs/components/InputGroup/InputGroup.styles.js +17 -0
  48. package/emotion/cjs/components/InputGroup/InputGroup.template-doc.mdx +126 -0
  49. package/emotion/cjs/components/InputGroup/InputGroup.tokens.js +92 -0
  50. package/emotion/cjs/components/InputGroup/InputGroup.types.js +5 -0
  51. package/emotion/cjs/components/InputGroup/index.js +31 -0
  52. package/emotion/cjs/components/InputGroup/variations/_gap/base.js +9 -0
  53. package/emotion/cjs/components/InputGroup/variations/_gap/tokens.json +1 -0
  54. package/emotion/cjs/components/InputGroup/variations/_orientation/base.js +9 -0
  55. package/emotion/cjs/components/InputGroup/variations/_orientation/tokens.json +1 -0
  56. package/emotion/cjs/components/InputGroup/variations/_shape/base.js +11 -0
  57. package/emotion/cjs/components/InputGroup/variations/_shape/tokens.json +1 -0
  58. package/emotion/cjs/components/InputGroup/variations/_size/base.js +10 -0
  59. package/emotion/cjs/components/InputGroup/variations/_size/tokens.json +58 -0
  60. package/emotion/cjs/components/InputGroup/variations/_stretching/base.js +9 -0
  61. package/emotion/cjs/components/InputGroup/variations/_stretching/tokens.json +1 -0
  62. package/emotion/cjs/components/TextField/TextField.js +2 -2
  63. package/emotion/cjs/components/TextField/TextField.tokens.js +2 -1
  64. package/emotion/cjs/components/TextField/index.js +6 -0
  65. package/emotion/cjs/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +0 -33
  66. package/emotion/cjs/examples/plasma_b2c/components/InputGroup/InputGroup.config.js +38 -0
  67. package/emotion/cjs/examples/plasma_b2c/components/InputGroup/InputGroup.js +11 -0
  68. package/emotion/cjs/examples/plasma_b2c/components/InputGroup/InputGroup.stories.tsx +116 -0
  69. package/emotion/cjs/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +0 -34
  70. package/emotion/cjs/examples/plasma_web/components/InputGroup/InputGroup.config.js +38 -0
  71. package/emotion/cjs/examples/plasma_web/components/InputGroup/InputGroup.js +11 -0
  72. package/emotion/cjs/examples/plasma_web/components/InputGroup/InputGroup.stories.tsx +116 -0
  73. package/emotion/cjs/index.js +11 -0
  74. package/emotion/cjs/utils/datejs.js +0 -2
  75. package/emotion/es/components/DatePicker/DatePicker.template-doc.mdx +0 -32
  76. package/emotion/es/components/DatePicker/RangeDate/RangeDate.js +9 -19
  77. package/emotion/es/components/DatePicker/SingleDate/SingleDate.js +5 -12
  78. package/emotion/es/components/DatePicker/hooks/useDatePicker.js +7 -9
  79. package/emotion/es/components/DatePicker/utils/dateHelper.js +13 -13
  80. package/emotion/es/components/InputGroup/InputGroup.js +74 -0
  81. package/emotion/es/components/InputGroup/InputGroup.styles.js +11 -0
  82. package/emotion/es/components/InputGroup/InputGroup.template-doc.mdx +126 -0
  83. package/emotion/es/components/InputGroup/InputGroup.tokens.js +86 -0
  84. package/emotion/es/components/InputGroup/InputGroup.types.js +1 -0
  85. package/emotion/es/components/InputGroup/index.js +2 -0
  86. package/emotion/es/components/InputGroup/variations/_gap/base.js +3 -0
  87. package/emotion/es/components/InputGroup/variations/_gap/tokens.json +1 -0
  88. package/emotion/es/components/InputGroup/variations/_orientation/base.js +3 -0
  89. package/emotion/es/components/InputGroup/variations/_orientation/tokens.json +1 -0
  90. package/emotion/es/components/InputGroup/variations/_shape/base.js +5 -0
  91. package/emotion/es/components/InputGroup/variations/_shape/tokens.json +1 -0
  92. package/emotion/es/components/InputGroup/variations/_size/base.js +4 -0
  93. package/emotion/es/components/InputGroup/variations/_size/tokens.json +58 -0
  94. package/emotion/es/components/InputGroup/variations/_stretching/base.js +3 -0
  95. package/emotion/es/components/InputGroup/variations/_stretching/tokens.json +1 -0
  96. package/emotion/es/components/TextField/TextField.js +2 -2
  97. package/emotion/es/components/TextField/TextField.tokens.js +2 -1
  98. package/emotion/es/components/TextField/index.js +1 -1
  99. package/emotion/es/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +0 -33
  100. package/emotion/es/examples/plasma_b2c/components/InputGroup/InputGroup.config.js +32 -0
  101. package/emotion/es/examples/plasma_b2c/components/InputGroup/InputGroup.js +5 -0
  102. package/emotion/es/examples/plasma_b2c/components/InputGroup/InputGroup.stories.tsx +116 -0
  103. package/emotion/es/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +0 -34
  104. package/emotion/es/examples/plasma_web/components/InputGroup/InputGroup.config.js +32 -0
  105. package/emotion/es/examples/plasma_web/components/InputGroup/InputGroup.js +5 -0
  106. package/emotion/es/examples/plasma_web/components/InputGroup/InputGroup.stories.tsx +116 -0
  107. package/emotion/es/index.js +1 -0
  108. package/emotion/es/utils/datejs.js +0 -2
  109. package/es/components/DatePicker/RangeDate/RangeDate.js +9 -19
  110. package/es/components/DatePicker/RangeDate/RangeDate.js.map +1 -1
  111. package/es/components/DatePicker/SingleDate/SingleDate.js +5 -12
  112. package/es/components/DatePicker/SingleDate/SingleDate.js.map +1 -1
  113. package/es/components/DatePicker/hooks/useDatePicker.js +7 -9
  114. package/es/components/DatePicker/hooks/useDatePicker.js.map +1 -1
  115. package/es/components/DatePicker/utils/dateHelper.js +13 -13
  116. package/es/components/DatePicker/utils/dateHelper.js.map +1 -1
  117. package/es/components/InputGroup/InputGroup.css +11 -0
  118. package/es/components/InputGroup/InputGroup.js +76 -0
  119. package/es/components/InputGroup/InputGroup.js.map +1 -0
  120. package/es/components/InputGroup/InputGroup.styles.js +5 -0
  121. package/es/components/InputGroup/InputGroup.styles.js.map +1 -0
  122. package/es/components/InputGroup/InputGroup.styles_1ivl67d.css +1 -0
  123. package/es/components/InputGroup/InputGroup.tokens.js +89 -0
  124. package/es/components/InputGroup/InputGroup.tokens.js.map +1 -0
  125. package/es/components/InputGroup/variations/_gap/base.js +5 -0
  126. package/es/components/InputGroup/variations/_gap/base.js.map +1 -0
  127. package/es/components/InputGroup/variations/_gap/base_1k4piyx.css +1 -0
  128. package/es/components/InputGroup/variations/_orientation/base.js +5 -0
  129. package/es/components/InputGroup/variations/_orientation/base.js.map +1 -0
  130. package/es/components/InputGroup/variations/_orientation/base_mgs8eg.css +1 -0
  131. package/es/components/InputGroup/variations/_shape/base.js +5 -0
  132. package/es/components/InputGroup/variations/_shape/base.js.map +1 -0
  133. package/es/components/InputGroup/variations/_shape/base_3k0aw7.css +1 -0
  134. package/es/components/InputGroup/variations/_size/base.js +5 -0
  135. package/es/components/InputGroup/variations/_size/base.js.map +1 -0
  136. package/es/components/InputGroup/variations/_size/base_1vk5vms.css +1 -0
  137. package/es/components/InputGroup/variations/_stretching/base.js +5 -0
  138. package/es/components/InputGroup/variations/_stretching/base.js.map +1 -0
  139. package/es/components/InputGroup/variations/_stretching/base_1cr1a83.css +1 -0
  140. package/es/components/TextField/TextField.js +1 -1
  141. package/es/components/TextField/TextField.js.map +1 -1
  142. package/es/components/TextField/TextField.tokens.js +2 -1
  143. package/es/components/TextField/TextField.tokens.js.map +1 -1
  144. package/es/index.css +12 -0
  145. package/es/index.js +3 -1
  146. package/es/index.js.map +1 -1
  147. package/es/utils/datejs.js +0 -2
  148. package/es/utils/datejs.js.map +1 -1
  149. package/package.json +2 -2
  150. package/styled-components/cjs/components/DatePicker/DatePicker.template-doc.mdx +0 -32
  151. package/styled-components/cjs/components/DatePicker/RangeDate/RangeDate.js +9 -19
  152. package/styled-components/cjs/components/DatePicker/SingleDate/SingleDate.js +5 -12
  153. package/styled-components/cjs/components/DatePicker/hooks/useDatePicker.js +7 -9
  154. package/styled-components/cjs/components/DatePicker/utils/dateHelper.js +13 -13
  155. package/styled-components/cjs/components/InputGroup/InputGroup.js +83 -0
  156. package/styled-components/cjs/components/InputGroup/InputGroup.styles.js +8 -0
  157. package/styled-components/cjs/components/InputGroup/InputGroup.template-doc.mdx +126 -0
  158. package/styled-components/cjs/components/InputGroup/InputGroup.tokens.js +92 -0
  159. package/styled-components/cjs/components/InputGroup/InputGroup.types.js +5 -0
  160. package/styled-components/cjs/components/InputGroup/index.js +31 -0
  161. package/styled-components/cjs/components/InputGroup/variations/_gap/base.js +9 -0
  162. package/styled-components/cjs/components/InputGroup/variations/_gap/tokens.json +1 -0
  163. package/styled-components/cjs/components/InputGroup/variations/_orientation/base.js +9 -0
  164. package/styled-components/cjs/components/InputGroup/variations/_orientation/tokens.json +1 -0
  165. package/styled-components/cjs/components/InputGroup/variations/_shape/base.js +11 -0
  166. package/styled-components/cjs/components/InputGroup/variations/_shape/tokens.json +1 -0
  167. package/styled-components/cjs/components/InputGroup/variations/_size/base.js +10 -0
  168. package/styled-components/cjs/components/InputGroup/variations/_size/tokens.json +58 -0
  169. package/styled-components/cjs/components/InputGroup/variations/_stretching/base.js +9 -0
  170. package/styled-components/cjs/components/InputGroup/variations/_stretching/tokens.json +1 -0
  171. package/styled-components/cjs/components/TextField/TextField.js +1 -1
  172. package/styled-components/cjs/components/TextField/TextField.tokens.js +2 -1
  173. package/styled-components/cjs/components/TextField/index.js +6 -0
  174. package/styled-components/cjs/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +0 -33
  175. package/styled-components/cjs/examples/plasma_b2c/components/InputGroup/InputGroup.config.js +38 -0
  176. package/styled-components/cjs/examples/plasma_b2c/components/InputGroup/InputGroup.js +11 -0
  177. package/styled-components/cjs/examples/plasma_b2c/components/InputGroup/InputGroup.stories.tsx +116 -0
  178. package/styled-components/cjs/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +0 -34
  179. package/styled-components/cjs/examples/plasma_web/components/InputGroup/InputGroup.config.js +38 -0
  180. package/styled-components/cjs/examples/plasma_web/components/InputGroup/InputGroup.js +11 -0
  181. package/styled-components/cjs/examples/plasma_web/components/InputGroup/InputGroup.stories.tsx +116 -0
  182. package/styled-components/cjs/index.js +11 -0
  183. package/styled-components/cjs/utils/datejs.js +0 -2
  184. package/styled-components/es/components/DatePicker/DatePicker.template-doc.mdx +0 -32
  185. package/styled-components/es/components/DatePicker/RangeDate/RangeDate.js +9 -19
  186. package/styled-components/es/components/DatePicker/SingleDate/SingleDate.js +5 -12
  187. package/styled-components/es/components/DatePicker/hooks/useDatePicker.js +7 -9
  188. package/styled-components/es/components/DatePicker/utils/dateHelper.js +13 -13
  189. package/styled-components/es/components/InputGroup/InputGroup.js +74 -0
  190. package/styled-components/es/components/InputGroup/InputGroup.styles.js +2 -0
  191. package/styled-components/es/components/InputGroup/InputGroup.template-doc.mdx +126 -0
  192. package/styled-components/es/components/InputGroup/InputGroup.tokens.js +86 -0
  193. package/styled-components/es/components/InputGroup/InputGroup.types.js +1 -0
  194. package/styled-components/es/components/InputGroup/index.js +2 -0
  195. package/styled-components/es/components/InputGroup/variations/_gap/base.js +3 -0
  196. package/styled-components/es/components/InputGroup/variations/_gap/tokens.json +1 -0
  197. package/styled-components/es/components/InputGroup/variations/_orientation/base.js +3 -0
  198. package/styled-components/es/components/InputGroup/variations/_orientation/tokens.json +1 -0
  199. package/styled-components/es/components/InputGroup/variations/_shape/base.js +5 -0
  200. package/styled-components/es/components/InputGroup/variations/_shape/tokens.json +1 -0
  201. package/styled-components/es/components/InputGroup/variations/_size/base.js +4 -0
  202. package/styled-components/es/components/InputGroup/variations/_size/tokens.json +58 -0
  203. package/styled-components/es/components/InputGroup/variations/_stretching/base.js +3 -0
  204. package/styled-components/es/components/InputGroup/variations/_stretching/tokens.json +1 -0
  205. package/styled-components/es/components/TextField/TextField.js +1 -1
  206. package/styled-components/es/components/TextField/TextField.tokens.js +2 -1
  207. package/styled-components/es/components/TextField/index.js +1 -1
  208. package/styled-components/es/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +0 -33
  209. package/styled-components/es/examples/plasma_b2c/components/InputGroup/InputGroup.config.js +32 -0
  210. package/styled-components/es/examples/plasma_b2c/components/InputGroup/InputGroup.js +5 -0
  211. package/styled-components/es/examples/plasma_b2c/components/InputGroup/InputGroup.stories.tsx +116 -0
  212. package/styled-components/es/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +0 -34
  213. package/styled-components/es/examples/plasma_web/components/InputGroup/InputGroup.config.js +32 -0
  214. package/styled-components/es/examples/plasma_web/components/InputGroup/InputGroup.js +5 -0
  215. package/styled-components/es/examples/plasma_web/components/InputGroup/InputGroup.stories.tsx +116 -0
  216. package/styled-components/es/index.js +1 -0
  217. package/styled-components/es/utils/datejs.js +0 -2
  218. package/types/components/DatePicker/DatePickerBase.types.d.ts +0 -6
  219. package/types/components/DatePicker/DatePickerBase.types.d.ts.map +1 -1
  220. package/types/components/DatePicker/RangeDate/RangeDate.d.ts.map +1 -1
  221. package/types/components/DatePicker/SingleDate/SingleDate.d.ts.map +1 -1
  222. package/types/components/DatePicker/hooks/useDatePicker.d.ts +1 -1
  223. package/types/components/DatePicker/hooks/useDatePicker.d.ts.map +1 -1
  224. package/types/components/DatePicker/utils/dateHelper.d.ts +3 -4
  225. package/types/components/DatePicker/utils/dateHelper.d.ts.map +1 -1
  226. package/types/components/InputGroup/InputGroup.d.ts +35 -0
  227. package/types/components/InputGroup/InputGroup.d.ts.map +1 -0
  228. package/types/components/InputGroup/InputGroup.styles.d.ts +2 -0
  229. package/types/components/InputGroup/InputGroup.styles.d.ts.map +1 -0
  230. package/types/components/InputGroup/InputGroup.tokens.d.ts +85 -0
  231. package/types/components/InputGroup/InputGroup.tokens.d.ts.map +1 -0
  232. package/types/components/InputGroup/InputGroup.types.d.ts +84 -0
  233. package/types/components/InputGroup/InputGroup.types.d.ts.map +1 -0
  234. package/types/components/InputGroup/index.d.ts +4 -0
  235. package/types/components/InputGroup/index.d.ts.map +1 -0
  236. package/types/components/InputGroup/variations/_gap/base.d.ts +2 -0
  237. package/types/components/InputGroup/variations/_gap/base.d.ts.map +1 -0
  238. package/types/components/InputGroup/variations/_orientation/base.d.ts +2 -0
  239. package/types/components/InputGroup/variations/_orientation/base.d.ts.map +1 -0
  240. package/types/components/InputGroup/variations/_shape/base.d.ts +2 -0
  241. package/types/components/InputGroup/variations/_shape/base.d.ts.map +1 -0
  242. package/types/components/InputGroup/variations/_size/base.d.ts +2 -0
  243. package/types/components/InputGroup/variations/_size/base.d.ts.map +1 -0
  244. package/types/components/InputGroup/variations/_stretching/base.d.ts +2 -0
  245. package/types/components/InputGroup/variations/_stretching/base.d.ts.map +1 -0
  246. package/types/components/TextField/TextField.tokens.d.ts +1 -0
  247. package/types/components/TextField/TextField.tokens.d.ts.map +1 -1
  248. package/types/components/TextField/index.d.ts +1 -1
  249. package/types/components/TextField/index.d.ts.map +1 -1
  250. package/types/examples/plasma_b2c/components/InputGroup/InputGroup.config.d.ts +31 -0
  251. package/types/examples/plasma_b2c/components/InputGroup/InputGroup.config.d.ts.map +1 -0
  252. package/types/examples/plasma_b2c/components/InputGroup/InputGroup.d.ts +43 -0
  253. package/types/examples/plasma_b2c/components/InputGroup/InputGroup.d.ts.map +1 -0
  254. package/types/examples/plasma_web/components/InputGroup/InputGroup.config.d.ts +31 -0
  255. package/types/examples/plasma_web/components/InputGroup/InputGroup.config.d.ts.map +1 -0
  256. package/types/examples/plasma_web/components/InputGroup/InputGroup.d.ts +43 -0
  257. package/types/examples/plasma_web/components/InputGroup/InputGroup.d.ts.map +1 -0
  258. package/types/index.d.ts +1 -0
  259. package/types/index.d.ts.map +1 -1
  260. package/types/utils/datejs.d.ts +0 -2
  261. package/types/utils/datejs.d.ts.map +1 -1
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.InputGroup = void 0;
7
+ var _InputGroup = /*#__PURE__*/require("../../../../components/InputGroup");
8
+ var _engines = /*#__PURE__*/require("../../../../engines");
9
+ var _InputGroup2 = /*#__PURE__*/require("./InputGroup.config");
10
+ var mergedConfig = /*#__PURE__*/(0, _engines.mergeConfig)(_InputGroup.inputGroupConfig, _InputGroup2.config);
11
+ var InputGroup = exports.InputGroup = /*#__PURE__*/(0, _engines.component)(mergedConfig);
@@ -0,0 +1,116 @@
1
+ import React from 'react';
2
+ import type { ComponentProps } from 'react';
3
+ import type { StoryObj, Meta } from '@storybook/react';
4
+ import { disableProps } from '@salutejs/plasma-sb-utils';
5
+
6
+ import { WithTheme } from '../../../_helpers';
7
+ import { TextField } from '../TextField/TextField';
8
+
9
+ import { InputGroup } from './InputGroup';
10
+
11
+ type StoryProps = Omit<ComponentProps<typeof InputGroup>, 'gap'> & {
12
+ itemsCount?: number;
13
+ gapDefaultShape?: string;
14
+ gapSegmentedShape?: string;
15
+ };
16
+ type Story = StoryObj<StoryProps>;
17
+
18
+ const sizes = ['l', 'm', 's', 'xs'];
19
+ const orientationValues = ['horizontal', 'vertical'];
20
+ const gapDefaultValues = ['dense', 'wide'];
21
+ const gapSegmentedValues = ['none', 'dense'];
22
+ const shapeValues = ['segmented', 'default'];
23
+ const stretchingValues = ['auto', 'filled'];
24
+
25
+ const meta: Meta<typeof InputGroup> = {
26
+ title: 'plasma_web/InputGroup',
27
+ decorators: [WithTheme],
28
+ argTypes: {
29
+ size: {
30
+ options: sizes,
31
+ control: {
32
+ type: 'select',
33
+ },
34
+ },
35
+ orientation: {
36
+ options: orientationValues,
37
+ control: {
38
+ type: 'inline-radio',
39
+ },
40
+ },
41
+ shape: {
42
+ options: shapeValues,
43
+ control: {
44
+ type: 'select',
45
+ },
46
+ },
47
+ stretching: {
48
+ options: stretchingValues,
49
+ control: {
50
+ type: 'select',
51
+ },
52
+ },
53
+ ...disableProps(['gap']),
54
+ },
55
+ };
56
+
57
+ export default meta;
58
+
59
+ export const Default: Story = {
60
+ argTypes: {
61
+ gapDefaultShape: {
62
+ options: gapDefaultValues,
63
+ control: { type: 'select' },
64
+ if: { arg: 'shape', eq: 'default' },
65
+ },
66
+ gapSegmentedShape: {
67
+ options: gapSegmentedValues,
68
+ control: { type: 'select' },
69
+ if: { arg: 'shape', eq: 'segmented' },
70
+ },
71
+ },
72
+ args: {
73
+ size: 'm',
74
+ shape: 'default',
75
+ gapDefaultShape: 'dense',
76
+ gapSegmentedShape: 'dense',
77
+ orientation: 'horizontal',
78
+ itemsCount: 5,
79
+ stretching: 'auto',
80
+ },
81
+ render: ({ itemsCount, gapDefaultShape, gapSegmentedShape, ...args }: StoryProps) => {
82
+ return (
83
+ <InputGroup {...args} gap={(gapDefaultShape || gapSegmentedShape) as any}>
84
+ {Array(itemsCount)
85
+ .fill(true)
86
+ .map((_, i) => (
87
+ <TextField placeholder={`input #${i}`} />
88
+ ))}
89
+ </InputGroup>
90
+ );
91
+ },
92
+ };
93
+
94
+ export const CustomInputs: Story = {
95
+ args: {
96
+ ...Default.args,
97
+ isCommonInputStyles: false,
98
+ },
99
+ argTypes: {
100
+ ...Default.argTypes,
101
+ ...disableProps(['itemsCount']),
102
+ },
103
+ render: ({ gapDefaultShape, gapSegmentedShape, ...args }: StoryProps) => {
104
+ return (
105
+ <>
106
+ <h3>Группа Input с разными размерами</h3>
107
+ <InputGroup {...args} gap={(gapDefaultShape || gapSegmentedShape) as any}>
108
+ <TextField placeholder="Размер l" size="l" />
109
+ <TextField placeholder="Размер m" size="m" />
110
+ <TextField placeholder="Размер s" size="s" />
111
+ <TextField placeholder="Размер xs" size="xs" />
112
+ </InputGroup>
113
+ </>
114
+ );
115
+ },
116
+ };
@@ -190,6 +190,17 @@ Object.keys(_TextField).forEach(function (key) {
190
190
  }
191
191
  });
192
192
  });
193
+ var _InputGroup = /*#__PURE__*/require("./components/InputGroup");
194
+ Object.keys(_InputGroup).forEach(function (key) {
195
+ if (key === "default" || key === "__esModule") return;
196
+ if (key in exports && exports[key] === _InputGroup[key]) return;
197
+ Object.defineProperty(exports, key, {
198
+ enumerable: true,
199
+ get: function get() {
200
+ return _InputGroup[key];
201
+ }
202
+ });
203
+ });
193
204
  var _Switch = /*#__PURE__*/require("./components/Switch");
194
205
  Object.keys(_Switch).forEach(function (key) {
195
206
  if (key === "default" || key === "__esModule") return;
@@ -8,8 +8,6 @@ var _dayjs = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("dayjs"))
8
8
  var _customParseFormat = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("dayjs/plugin/customParseFormat"));
9
9
  var _quarterOfYear = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("dayjs/plugin/quarterOfYear"));
10
10
  var _advancedFormat = /*#__PURE__*/_interopRequireDefault( /*#__PURE__*/require("dayjs/plugin/advancedFormat"));
11
- require("dayjs/locale/ru");
12
- require("dayjs/locale/en");
13
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14
12
  _dayjs["default"].extend(_customParseFormat["default"]);
15
13
  _dayjs["default"].extend(_quarterOfYear["default"]);
@@ -70,38 +70,6 @@ export function App() {
70
70
  }
71
71
  ```
72
72
 
73
- ### Язык даты
74
- Язык даты задается с помощью свойства `lang`.
75
-
76
- | Обозначение | Отображение | Описание |
77
- |-------------|-------------|---------------------|
78
- | ru | June | Английский Язык |
79
- | en | июнь | Русский язык |
80
-
81
- По умолчанию используется `ru`
82
-
83
- ```tsx live
84
- import React from 'react';
85
- import { DatePicker } from '@salutejs/{{ package }}';
86
- import { IconDone } from '@salutejs/plasma-icons';
87
-
88
- export function App() {
89
- return (
90
- <div style=\{{ height: "450px" }}>
91
- <DatePicker
92
- label="Лейбл"
93
- leftHelper="Подсказка к полю"
94
- placeholder="Введите дату"
95
- format="DD MMMM YYYY"
96
- lang="en"
97
- maskWithFormat
98
- contentRight={<IconDone size="s" />}
99
- />
100
- </div>
101
- );
102
- }
103
- ```
104
-
105
73
  ### Валидация и индикация успешного ввода даты.
106
74
  За индикацию ошибки или успешного ввода отвечают `valueError`, `valueSuccess`.
107
75
  В данном примере валидация происходит при нажатии клавиши `Enter` после ввода значений:
@@ -1,4 +1,4 @@
1
- var _excluded = ["className", "isDoubleCalendar", "opened", "label", "leftHelper", "contentLeft", "contentRight", "view", "size", "readOnly", "disabled", "dividerVariant", "dividerIcon", "defaultFirstDate", "defaultSecondDate", "firstValueError", "secondValueError", "firstValueSuccess", "secondValueSuccess", "firstPlaceholder", "secondPlaceholder", "firstTextfieldContentLeft", "firstTextfieldContentRight", "secondTextfieldContentLeft", "secondTextfieldContentRight", "firstTextfieldTextBefore", "secondTextfieldTextBefore", "firstTextfieldTextAfter", "secondTextfieldTextAfter", "format", "lang", "maskWithFormat", "min", "max", "includeEdgeDates", "eventList", "disabledList", "eventMonthList", "disabledMonthList", "eventQuarterList", "disabledQuarterList", "eventYearList", "disabledYearList", "type", "placement", "closeOnOverlayClick", "closeOnEsc", "offset", "onToggle", "onChangeFirstValue", "onChangeSecondValue", "onCommitFirstDate", "onCommitSecondDate", "onFocusFirstTextfield", "onFocusSecondTextfield", "onBlurFirstTextfield", "onBlurSecondTextfield"];
1
+ var _excluded = ["className", "isDoubleCalendar", "opened", "label", "leftHelper", "contentLeft", "contentRight", "view", "size", "readOnly", "disabled", "dividerVariant", "dividerIcon", "defaultFirstDate", "defaultSecondDate", "firstValueError", "secondValueError", "firstValueSuccess", "secondValueSuccess", "firstPlaceholder", "secondPlaceholder", "firstTextfieldContentLeft", "firstTextfieldContentRight", "secondTextfieldContentLeft", "secondTextfieldContentRight", "firstTextfieldTextBefore", "secondTextfieldTextBefore", "firstTextfieldTextAfter", "secondTextfieldTextAfter", "format", "maskWithFormat", "min", "max", "includeEdgeDates", "eventList", "disabledList", "eventMonthList", "disabledMonthList", "eventQuarterList", "disabledQuarterList", "eventYearList", "disabledYearList", "type", "placement", "closeOnOverlayClick", "closeOnEsc", "offset", "onToggle", "onChangeFirstValue", "onChangeSecondValue", "onCommitFirstDate", "onCommitSecondDate", "onFocusFirstTextfield", "onFocusSecondTextfield", "onBlurFirstTextfield", "onBlurSecondTextfield"];
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
4
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -61,8 +61,6 @@ export var datePickerRangeRoot = function datePickerRangeRoot(Root) {
61
61
  secondTextfieldTextAfter = _ref.secondTextfieldTextAfter,
62
62
  _ref$format = _ref.format,
63
63
  format = _ref$format === void 0 ? 'DD.MM.YYYY' : _ref$format,
64
- _ref$lang = _ref.lang,
65
- lang = _ref$lang === void 0 ? 'ru' : _ref$lang,
66
64
  maskWithFormat = _ref.maskWithFormat,
67
65
  min = _ref.min,
68
66
  max = _ref.max,
@@ -109,19 +107,19 @@ export var datePickerRangeRoot = function datePickerRangeRoot(Root) {
109
107
  _useState6 = _slicedToArray(_useState5, 2),
110
108
  isInnerOpen = _useState6[0],
111
109
  setIsInnerOpen = _useState6[1];
112
- var _useState7 = useState(formatCalendarValue(defaultFirstDate, format, lang)),
110
+ var _useState7 = useState(formatCalendarValue(defaultFirstDate, format)),
113
111
  _useState8 = _slicedToArray(_useState7, 2),
114
112
  calendarFirstValue = _useState8[0],
115
113
  setCalendarFirstValue = _useState8[1];
116
- var _useState9 = useState(formatInputValue(defaultFirstDate, format, lang)),
114
+ var _useState9 = useState(formatInputValue(defaultFirstDate, format)),
117
115
  _useState10 = _slicedToArray(_useState9, 2),
118
116
  inputFirstValue = _useState10[0],
119
117
  setInputFirstValue = _useState10[1];
120
- var _useState11 = useState(formatCalendarValue(defaultSecondDate, format, lang)),
118
+ var _useState11 = useState(formatCalendarValue(defaultSecondDate, format)),
121
119
  _useState12 = _slicedToArray(_useState11, 2),
122
120
  calendarSecondValue = _useState12[0],
123
121
  setCalendarSecondValue = _useState12[1];
124
- var _useState13 = useState(formatInputValue(defaultSecondDate, format, lang)),
122
+ var _useState13 = useState(formatInputValue(defaultSecondDate, format)),
125
123
  _useState14 = _slicedToArray(_useState13, 2),
126
124
  inputSecondValue = _useState14[0],
127
125
  setInputSecondValue = _useState14[1];
@@ -135,7 +133,6 @@ export var datePickerRangeRoot = function datePickerRangeRoot(Root) {
135
133
  setIsInnerOpen: setIsInnerOpen,
136
134
  dateFormatDelimiter: dateFormatDelimiter,
137
135
  format: format,
138
- lang: lang,
139
136
  disabled: disabled,
140
137
  readOnly: readOnly,
141
138
  maskWithFormat: maskWithFormat,
@@ -154,7 +151,6 @@ export var datePickerRangeRoot = function datePickerRangeRoot(Root) {
154
151
  setIsInnerOpen: setIsInnerOpen,
155
152
  dateFormatDelimiter: dateFormatDelimiter,
156
153
  format: format,
157
- lang: lang,
158
154
  disabled: disabled,
159
155
  readOnly: readOnly,
160
156
  maskWithFormat: maskWithFormat,
@@ -239,19 +235,13 @@ export var datePickerRangeRoot = function datePickerRangeRoot(Root) {
239
235
  });
240
236
  }, [opened]);
241
237
  useEffect(function () {
242
- setCalendarFirstValue(formatCalendarValue(defaultFirstDate, format, lang));
243
- setInputFirstValue(formatInputValue(defaultFirstDate, format, lang));
238
+ setCalendarFirstValue(formatCalendarValue(defaultFirstDate, format));
239
+ setInputFirstValue(formatInputValue(defaultFirstDate, format));
244
240
  }, [defaultFirstDate]);
245
241
  useEffect(function () {
246
- setCalendarSecondValue(formatCalendarValue(defaultSecondDate, format, lang));
247
- setInputSecondValue(formatInputValue(defaultSecondDate, format, lang));
242
+ setCalendarSecondValue(formatCalendarValue(defaultSecondDate, format));
243
+ setInputSecondValue(formatInputValue(defaultSecondDate, format));
248
244
  }, [defaultSecondDate]);
249
- useEffect(function () {
250
- setCalendarFirstValue(formatCalendarValue(defaultFirstDate, format, lang));
251
- setInputFirstValue(formatInputValue(defaultFirstDate, format, lang));
252
- setCalendarSecondValue(formatCalendarValue(defaultSecondDate, format, lang));
253
- setInputSecondValue(formatInputValue(defaultSecondDate, format, lang));
254
- }, [format, lang]);
255
245
  return /*#__PURE__*/React.createElement(Root, _extends({
256
246
  ref: rootRef,
257
247
  view: view,
@@ -1,4 +1,4 @@
1
- var _excluded = ["className", "opened", "label", "labelPlacement", "placeholder", "leftHelper", "contentLeft", "contentRight", "textBefore", "textAfter", "view", "size", "readOnly", "disabled", "defaultDate", "valueError", "valueSuccess", "format", "lang", "maskWithFormat", "min", "max", "includeEdgeDates", "eventList", "disabledList", "eventMonthList", "disabledMonthList", "eventQuarterList", "disabledQuarterList", "eventYearList", "disabledYearList", "type", "placement", "closeOnOverlayClick", "offset", "onChangeValue", "onCommitDate", "onToggle", "onFocus", "onBlur"];
1
+ var _excluded = ["className", "opened", "label", "labelPlacement", "placeholder", "leftHelper", "contentLeft", "contentRight", "textBefore", "textAfter", "view", "size", "readOnly", "disabled", "defaultDate", "valueError", "valueSuccess", "format", "maskWithFormat", "min", "max", "includeEdgeDates", "eventList", "disabledList", "eventMonthList", "disabledMonthList", "eventQuarterList", "disabledQuarterList", "eventYearList", "disabledYearList", "type", "placement", "closeOnOverlayClick", "offset", "onChangeValue", "onCommitDate", "onToggle", "onFocus", "onBlur"];
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
4
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -46,8 +46,6 @@ export var datePickerRoot = function datePickerRoot(Root) {
46
46
  valueSuccess = _ref.valueSuccess,
47
47
  _ref$format = _ref.format,
48
48
  format = _ref$format === void 0 ? 'DD.MM.YYYY' : _ref$format,
49
- _ref$lang = _ref.lang,
50
- lang = _ref$lang === void 0 ? 'ru' : _ref$lang,
51
49
  maskWithFormat = _ref.maskWithFormat,
52
50
  min = _ref.min,
53
51
  max = _ref.max,
@@ -79,11 +77,11 @@ export var datePickerRoot = function datePickerRoot(Root) {
79
77
  _useState2 = _slicedToArray(_useState, 2),
80
78
  isInnerOpen = _useState2[0],
81
79
  setIsInnerOpen = _useState2[1];
82
- var _useState3 = useState(formatCalendarValue(defaultDate, format, lang)),
80
+ var _useState3 = useState(formatCalendarValue(defaultDate, format)),
83
81
  _useState4 = _slicedToArray(_useState3, 2),
84
82
  calendarValue = _useState4[0],
85
83
  setCalendarValue = _useState4[1];
86
- var _useState5 = useState(formatInputValue(defaultDate, format, lang)),
84
+ var _useState5 = useState(formatInputValue(defaultDate, format)),
87
85
  _useState6 = _slicedToArray(_useState5, 2),
88
86
  inputValue = _useState6[0],
89
87
  setInputValue = _useState6[1];
@@ -98,7 +96,6 @@ export var datePickerRoot = function datePickerRoot(Root) {
98
96
  setIsInnerOpen: setIsInnerOpen,
99
97
  dateFormatDelimiter: dateFormatDelimiter,
100
98
  format: format,
101
- lang: lang,
102
99
  disabled: disabled,
103
100
  readOnly: readOnly,
104
101
  maskWithFormat: maskWithFormat,
@@ -148,13 +145,9 @@ export var datePickerRoot = function datePickerRoot(Root) {
148
145
  });
149
146
  }, [opened]);
150
147
  useEffect(function () {
151
- setCalendarValue(formatCalendarValue(defaultDate, format, lang));
152
- setInputValue(formatInputValue(defaultDate, format, lang));
148
+ setCalendarValue(formatCalendarValue(defaultDate, format));
149
+ setInputValue(formatInputValue(defaultDate, format));
153
150
  }, [defaultDate]);
154
- useEffect(function () {
155
- setCalendarValue(formatCalendarValue(defaultDate, format, lang));
156
- setInputValue(formatInputValue(defaultDate, format, lang));
157
- }, [format, lang]);
158
151
  return /*#__PURE__*/React.createElement(Root, _extends({
159
152
  view: view,
160
153
  size: size,
@@ -7,8 +7,6 @@ export var useDatePicker = function useDatePicker(_ref) {
7
7
  setIsInnerOpen = _ref.setIsInnerOpen,
8
8
  dateFormatDelimiter = _ref.dateFormatDelimiter,
9
9
  format = _ref.format,
10
- _ref$lang = _ref.lang,
11
- lang = _ref$lang === void 0 ? 'ru' : _ref$lang,
12
10
  disabled = _ref.disabled,
13
11
  readOnly = _ref.readOnly,
14
12
  maskWithFormat = _ref.maskWithFormat,
@@ -39,9 +37,9 @@ export var useDatePicker = function useDatePicker(_ref) {
39
37
  if (!format) {
40
38
  setCalendarValue(formatCalendarValue(newValue));
41
39
  } else if ((newValue === null || newValue === void 0 ? void 0 : newValue.length) === format.length) {
42
- setCalendarValue(formatCalendarValue(newValue, format, lang));
40
+ setCalendarValue(formatCalendarValue(newValue, format));
43
41
  }
44
- setInputValue(formatInputValue(newValue, format, lang));
42
+ setInputValue(formatInputValue(newValue, format));
45
43
  onChangeValue === null || onChangeValue === void 0 || onChangeValue(event, newValue);
46
44
  };
47
45
  var handleCommitDate = function handleCommitDate(date, applyFormat, isCalendarValue, dateInfo) {
@@ -54,17 +52,17 @@ export var useDatePicker = function useDatePicker(_ref) {
54
52
  return onCommitDate === null || onCommitDate === void 0 ? void 0 : onCommitDate('', false, true);
55
53
  }
56
54
  if (isCalendarValue) {
57
- setCalendarValue(formatCalendarValue(date, format, lang));
58
- setInputValue(formatInputValue(date, format, lang));
55
+ setCalendarValue(formatCalendarValue(date, format));
56
+ setInputValue(formatInputValue(date, format));
59
57
  return onCommitDate === null || onCommitDate === void 0 ? void 0 : onCommitDate(date, false, true, dateInfo);
60
58
  }
61
59
  var formatString = applyFormat ? format : undefined;
62
- var _getDateFromFormat = getDateFromFormat(date, formatString, lang),
60
+ var _getDateFromFormat = getDateFromFormat(date, formatString),
63
61
  newDate = _getDateFromFormat.value,
64
62
  isError = _getDateFromFormat.isError,
65
63
  isSuccess = _getDateFromFormat.isSuccess;
66
- setCalendarValue(formatCalendarValue(newDate, format, lang));
67
- setInputValue(formatInputValue(newDate, format, lang));
64
+ setCalendarValue(formatCalendarValue(newDate, format));
65
+ setInputValue(formatInputValue(newDate, format));
68
66
  onCommitDate === null || onCommitDate === void 0 || onCommitDate(newDate, isError, isSuccess);
69
67
  };
70
68
  return {
@@ -1,39 +1,39 @@
1
1
  import { customDayjs } from '../../../utils/datejs';
2
- export var formatInputValue = function formatInputValue(value, format, lang) {
3
- if (!value || !lang) {
2
+ export var formatInputValue = function formatInputValue(value, format) {
3
+ if (!value) {
4
4
  return '';
5
5
  }
6
6
  if (format && customDayjs(value, format, true).isValid()) {
7
- return customDayjs(value, format).locale(lang).format(format);
7
+ return customDayjs(value, format).format(format);
8
8
  }
9
9
  if (format && String(value).length >= 10 && String(new Date(value)) !== 'Invalid Date') {
10
- return customDayjs(value).locale(lang).format(format);
10
+ return customDayjs(value).format(format);
11
11
  }
12
12
  return String(value);
13
13
  };
14
- export var formatCalendarValue = function formatCalendarValue(value, format, lang) {
15
- if (!value || !lang) {
14
+ export var formatCalendarValue = function formatCalendarValue(value, format) {
15
+ if (!value) {
16
16
  return undefined;
17
17
  }
18
18
  if (format && customDayjs(value, format, true).isValid()) {
19
- return customDayjs(value, format, true).locale(lang).toDate();
19
+ return customDayjs(value, format, true).toDate();
20
20
  }
21
21
  if (String(new Date(value)) !== 'Invalid Date') {
22
- return customDayjs(value).locale(lang).toDate();
22
+ return customDayjs(value).toDate();
23
23
  }
24
24
  return undefined;
25
25
  };
26
- export var getDateFromFormat = function getDateFromFormat(value, format, lang) {
27
- if (format && customDayjs(value, format, true).isValid() && lang) {
26
+ export var getDateFromFormat = function getDateFromFormat(value, format) {
27
+ if (format && customDayjs(value, format, true).isValid()) {
28
28
  return {
29
- value: customDayjs(value, format, true).locale(lang).toDate(),
29
+ value: customDayjs(value, format, true).toDate(),
30
30
  isError: false,
31
31
  isSuccess: true
32
32
  };
33
33
  }
34
- if (!format && String(new Date(value)) !== 'Invalid Date' && lang) {
34
+ if (!format && String(new Date(value)) !== 'Invalid Date') {
35
35
  return {
36
- value: customDayjs(value).locale(lang).toDate(),
36
+ value: customDayjs(value).toDate(),
37
37
  isError: false,
38
38
  isSuccess: true
39
39
  };
@@ -0,0 +1,74 @@
1
+ var _excluded = ["children", "className", "size", "stretching", "gap", "orientation", "shape", "isCommonInputStyles"];
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
+ 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
+ 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
+ import React, { forwardRef } from 'react';
6
+ import { cx } from '../../utils';
7
+ import { base as sizeCSS } from './variations/_size/base';
8
+ import { base as gapCSS } from './variations/_gap/base';
9
+ import { base as shapeCSS } from './variations/_shape/base';
10
+ import { base as orientationCSS } from './variations/_orientation/base';
11
+ import { base as stretchingCSS } from './variations/_stretching/base';
12
+ import { base } from './InputGroup.styles';
13
+ import { classes } from './InputGroup.tokens';
14
+ export var inputGroupRoot = function inputGroupRoot(Root) {
15
+ return /*#__PURE__*/forwardRef(function (props, ref) {
16
+ var children = props.children,
17
+ className = props.className,
18
+ size = props.size,
19
+ _props$stretching = props.stretching,
20
+ stretching = _props$stretching === void 0 ? 'auto' : _props$stretching,
21
+ _props$gap = props.gap,
22
+ gap = _props$gap === void 0 ? 'dense' : _props$gap,
23
+ _props$orientation = props.orientation,
24
+ orientation = _props$orientation === void 0 ? 'horizontal' : _props$orientation,
25
+ _props$shape = props.shape,
26
+ shape = _props$shape === void 0 ? 'default' : _props$shape,
27
+ _props$isCommonInputS = props.isCommonInputStyles,
28
+ isCommonInputStyles = _props$isCommonInputS === void 0 ? true : _props$isCommonInputS,
29
+ rest = _objectWithoutProperties(props, _excluded);
30
+ var orientationClass = classes[orientation];
31
+ var gapClass = classes[gap];
32
+ var shapeClass = classes[shape];
33
+ var stretchingClass = classes["".concat(stretching, "Stretching")];
34
+ var overrideStylesClass = isCommonInputStyles ? classes.inputGroupOverrideStyles : undefined;
35
+ return /*#__PURE__*/React.createElement(Root, _extends({
36
+ ref: ref,
37
+ size: size,
38
+ gap: gap,
39
+ shape: shape,
40
+ orientation: orientation,
41
+ className: cx(overrideStylesClass, orientationClass, gapClass, shapeClass, stretchingClass, className)
42
+ }, rest), children);
43
+ });
44
+ };
45
+ export var inputGroupConfig = {
46
+ name: 'InputGroup',
47
+ tag: 'div',
48
+ layout: inputGroupRoot,
49
+ base: base,
50
+ variations: {
51
+ size: {
52
+ css: sizeCSS
53
+ },
54
+ gap: {
55
+ css: gapCSS
56
+ },
57
+ orientation: {
58
+ css: orientationCSS
59
+ },
60
+ shape: {
61
+ css: shapeCSS
62
+ },
63
+ stretching: {
64
+ css: stretchingCSS
65
+ }
66
+ },
67
+ defaults: {
68
+ size: 'm',
69
+ gap: 'dense',
70
+ orientation: 'horizontal',
71
+ shape: 'default',
72
+ stretching: 'auto'
73
+ }
74
+ };
@@ -0,0 +1,11 @@
1
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
2
+ import { css } from '@emotion/react';
3
+ export var base = process.env.NODE_ENV === "production" ? {
4
+ name: "d6pg61-plasma-new-hope__base",
5
+ styles: "display:inline-flex;label:plasma-new-hope__base;"
6
+ } : {
7
+ name: "d6pg61-plasma-new-hope__base",
8
+ styles: "display:inline-flex;label:plasma-new-hope__base;",
9
+ map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy1lbW90aW9uL2NvbXBvbmVudHMvSW5wdXRHcm91cC9JbnB1dEdyb3VwLnN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFdUIiLCJmaWxlIjoiLi4vLi4vLi4vLi4vc3JjLWVtb3Rpb24vY29tcG9uZW50cy9JbnB1dEdyb3VwL0lucHV0R3JvdXAuc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuXG5leHBvcnQgY29uc3QgYmFzZSA9IGNzc2BcbiAgICBkaXNwbGF5OiBpbmxpbmUtZmxleDtcbmA7XG4iXX0= */",
10
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
11
+ };
@@ -0,0 +1,126 @@
1
+ ---
2
+ id: inputGroup
3
+ title: InputGroup
4
+ ---
5
+
6
+ import { PropsTable, Description } from '@site/src/components';
7
+
8
+ # InputGroup
9
+ <Description name="InputGroup" />
10
+ <PropsTable name="InputGroup" exclude={['css']} />
11
+
12
+ ## Использование
13
+ Компонент `InputGroup` - это обертка для Input. Принимает в себя группу input.
14
+
15
+ ```tsx live
16
+ import React from 'react';
17
+ import { InputGroup, TextField } from '@salutejs/{{ package }}';
18
+
19
+ export function App() {
20
+ return (
21
+ <InputGroup>
22
+ {Array(5)
23
+ .fill(true)
24
+ .map((_, i) => (
25
+ <TextField placeholder={`input #${i}`} />
26
+ ))}
27
+ </InputGroup>
28
+ );
29
+ }
30
+ ```
31
+
32
+ ## Примеры
33
+
34
+ ### Размер группы input
35
+ Размер InputGroup задается с помощью свойства `size`.
36
+ С помощью свойства `isCommonInputStyles` можно отключить переопределение стилей для всех input внутри группы.
37
+ Тогда каждкаждый input будет иметь настраиваемый размер.
38
+
39
+ ```tsx live
40
+ import React from 'react';
41
+ import { InputGroup, TextField } from '@salutejs/{{ package }}';
42
+
43
+ export function App() {
44
+ return (
45
+ <div>
46
+ <InputGroup size="s" view="secondary">
47
+ {Array(5)
48
+ .fill(true)
49
+ .map((_, i) => (
50
+ <TextField placeholder={`input #${i}`} />
51
+ ))}
52
+ </InputGroup>
53
+
54
+ <InputGroup isCommonInputStyles={false}>
55
+ <TextField placeholder="Размер l" size="l" />
56
+ <TextField placeholder="Размер m" size="m" />
57
+ <TextField placeholder="Размер s" size="s" />
58
+ <TextField placeholder="Размер xs" size="xs" />
59
+ </InputGroup>
60
+ </div>
61
+ );
62
+ }
63
+ ```
64
+
65
+ ### Границы input
66
+ Границы input задаются с помощью свойства `shape`.
67
+
68
+ ```tsx live
69
+ import React from 'react';
70
+ import { InputGroup, TextField } from '@salutejs/{{ package }}';
71
+
72
+ export function App() {
73
+ return (
74
+ <div>
75
+ <InputGroup size="xs" shape="segmented">
76
+ {Array(3)
77
+ .fill(true)
78
+ .map((_, i) => (
79
+ <TextField placeholder={`input #${i}`} />
80
+ ))}
81
+ </InputGroup>
82
+
83
+ <InputGroup size="xs" shape="default">
84
+ {Array(3)
85
+ .fill(true)
86
+ .map((_, i) => (
87
+ <TextField placeholder={`input #${i}`} />
88
+ ))}
89
+ </InputGroup>
90
+ </div>
91
+ );
92
+ }
93
+ ```
94
+
95
+ ### Ориентация InputGroup и отступы между input
96
+
97
+ InputGroup может располагаться вертикально или горизонтально и иметь два вида отступов, в зависимости от shape.
98
+ При `shape='default'`, `gap` может принимать значения `dense` и `wide`;
99
+ При `shape='segmented'`, `gap` может принимать значения `none` и `dense`;
100
+
101
+ ```tsx live
102
+ import React from 'react';
103
+ import { InputGroup, TextField } from '@salutejs/{{ package }}';
104
+
105
+ export function App() {
106
+ return (
107
+ <div>
108
+ <InputGroup size="xs" orientation="vertical" shape="segmented" gap="none">
109
+ {Array(5)
110
+ .fill(true)
111
+ .map((_, i) => (
112
+ <TextField placeholder={`input #${i}`} />
113
+ ))}
114
+ </InputGroup>
115
+
116
+ <InputGroup size="xs" orientation="horizontal" gap="wide">
117
+ {Array(4)
118
+ .fill(true)
119
+ .map((_, i) => (
120
+ <TextField placeholder={`input #${i}`} />
121
+ ))}
122
+ </InputGroup>
123
+ </div>
124
+ );
125
+ }
126
+ ```