@salutejs/plasma-new-hope 0.134.0-canary.1404.10615452870.0 → 0.134.0-canary.1405.10615646161.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (257) 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 -15
  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 +92 -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_1v4bh9v.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 -1
  40. package/cjs/utils/datejs.js.map +1 -1
  41. package/emotion/cjs/components/DatePicker/RangeDate/RangeDate.js +9 -19
  42. package/emotion/cjs/components/DatePicker/SingleDate/SingleDate.js +5 -12
  43. package/emotion/cjs/components/DatePicker/hooks/useDatePicker.js +7 -9
  44. package/emotion/cjs/components/DatePicker/utils/dateHelper.js +13 -15
  45. package/emotion/cjs/components/InputGroup/InputGroup.js +83 -0
  46. package/emotion/cjs/components/InputGroup/InputGroup.styles.js +17 -0
  47. package/emotion/cjs/components/InputGroup/InputGroup.template-doc.mdx +124 -0
  48. package/emotion/cjs/components/InputGroup/InputGroup.tokens.js +90 -0
  49. package/emotion/cjs/components/InputGroup/InputGroup.types.js +5 -0
  50. package/emotion/cjs/components/InputGroup/index.js +31 -0
  51. package/emotion/cjs/components/InputGroup/variations/_gap/base.js +9 -0
  52. package/emotion/cjs/components/InputGroup/variations/_gap/tokens.json +1 -0
  53. package/emotion/cjs/components/InputGroup/variations/_orientation/base.js +9 -0
  54. package/emotion/cjs/components/InputGroup/variations/_orientation/tokens.json +1 -0
  55. package/emotion/cjs/components/InputGroup/variations/_shape/base.js +11 -0
  56. package/emotion/cjs/components/InputGroup/variations/_shape/tokens.json +1 -0
  57. package/emotion/cjs/components/InputGroup/variations/_size/base.js +10 -0
  58. package/emotion/cjs/components/InputGroup/variations/_size/tokens.json +58 -0
  59. package/emotion/cjs/components/InputGroup/variations/_stretching/base.js +9 -0
  60. package/emotion/cjs/components/InputGroup/variations/_stretching/tokens.json +1 -0
  61. package/emotion/cjs/components/TextField/TextField.js +2 -2
  62. package/emotion/cjs/components/TextField/TextField.tokens.js +2 -1
  63. package/emotion/cjs/components/TextField/index.js +6 -0
  64. package/emotion/cjs/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +1 -34
  65. package/emotion/cjs/examples/plasma_b2c/components/InputGroup/InputGroup.config.js +38 -0
  66. package/emotion/cjs/examples/plasma_b2c/components/InputGroup/InputGroup.js +11 -0
  67. package/emotion/cjs/examples/plasma_b2c/components/InputGroup/InputGroup.stories.tsx +102 -0
  68. package/emotion/cjs/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +1 -35
  69. package/emotion/cjs/examples/plasma_web/components/InputGroup/InputGroup.config.js +38 -0
  70. package/emotion/cjs/examples/plasma_web/components/InputGroup/InputGroup.js +11 -0
  71. package/emotion/cjs/examples/plasma_web/components/InputGroup/InputGroup.stories.tsx +102 -0
  72. package/emotion/cjs/index.js +11 -0
  73. package/emotion/cjs/utils/datejs.js +0 -1
  74. package/emotion/es/components/DatePicker/RangeDate/RangeDate.js +9 -19
  75. package/emotion/es/components/DatePicker/SingleDate/SingleDate.js +5 -12
  76. package/emotion/es/components/DatePicker/hooks/useDatePicker.js +7 -9
  77. package/emotion/es/components/DatePicker/utils/dateHelper.js +13 -15
  78. package/emotion/es/components/InputGroup/InputGroup.js +74 -0
  79. package/emotion/es/components/InputGroup/InputGroup.styles.js +11 -0
  80. package/emotion/es/components/InputGroup/InputGroup.template-doc.mdx +124 -0
  81. package/emotion/es/components/InputGroup/InputGroup.tokens.js +84 -0
  82. package/emotion/es/components/InputGroup/InputGroup.types.js +1 -0
  83. package/emotion/es/components/InputGroup/index.js +2 -0
  84. package/emotion/es/components/InputGroup/variations/_gap/base.js +3 -0
  85. package/emotion/es/components/InputGroup/variations/_gap/tokens.json +1 -0
  86. package/emotion/es/components/InputGroup/variations/_orientation/base.js +3 -0
  87. package/emotion/es/components/InputGroup/variations/_orientation/tokens.json +1 -0
  88. package/emotion/es/components/InputGroup/variations/_shape/base.js +5 -0
  89. package/emotion/es/components/InputGroup/variations/_shape/tokens.json +1 -0
  90. package/emotion/es/components/InputGroup/variations/_size/base.js +4 -0
  91. package/emotion/es/components/InputGroup/variations/_size/tokens.json +58 -0
  92. package/emotion/es/components/InputGroup/variations/_stretching/base.js +3 -0
  93. package/emotion/es/components/InputGroup/variations/_stretching/tokens.json +1 -0
  94. package/emotion/es/components/TextField/TextField.js +2 -2
  95. package/emotion/es/components/TextField/TextField.tokens.js +2 -1
  96. package/emotion/es/components/TextField/index.js +1 -1
  97. package/emotion/es/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +1 -34
  98. package/emotion/es/examples/plasma_b2c/components/InputGroup/InputGroup.config.js +32 -0
  99. package/emotion/es/examples/plasma_b2c/components/InputGroup/InputGroup.js +5 -0
  100. package/emotion/es/examples/plasma_b2c/components/InputGroup/InputGroup.stories.tsx +102 -0
  101. package/emotion/es/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +1 -35
  102. package/emotion/es/examples/plasma_web/components/InputGroup/InputGroup.config.js +32 -0
  103. package/emotion/es/examples/plasma_web/components/InputGroup/InputGroup.js +5 -0
  104. package/emotion/es/examples/plasma_web/components/InputGroup/InputGroup.stories.tsx +102 -0
  105. package/emotion/es/index.js +1 -0
  106. package/emotion/es/utils/datejs.js +0 -1
  107. package/es/components/DatePicker/RangeDate/RangeDate.js +9 -19
  108. package/es/components/DatePicker/RangeDate/RangeDate.js.map +1 -1
  109. package/es/components/DatePicker/SingleDate/SingleDate.js +5 -12
  110. package/es/components/DatePicker/SingleDate/SingleDate.js.map +1 -1
  111. package/es/components/DatePicker/hooks/useDatePicker.js +7 -9
  112. package/es/components/DatePicker/hooks/useDatePicker.js.map +1 -1
  113. package/es/components/DatePicker/utils/dateHelper.js +13 -15
  114. package/es/components/DatePicker/utils/dateHelper.js.map +1 -1
  115. package/es/components/InputGroup/InputGroup.css +11 -0
  116. package/es/components/InputGroup/InputGroup.js +76 -0
  117. package/es/components/InputGroup/InputGroup.js.map +1 -0
  118. package/es/components/InputGroup/InputGroup.styles.js +5 -0
  119. package/es/components/InputGroup/InputGroup.styles.js.map +1 -0
  120. package/es/components/InputGroup/InputGroup.styles_1ivl67d.css +1 -0
  121. package/es/components/InputGroup/InputGroup.tokens.js +87 -0
  122. package/es/components/InputGroup/InputGroup.tokens.js.map +1 -0
  123. package/es/components/InputGroup/variations/_gap/base.js +5 -0
  124. package/es/components/InputGroup/variations/_gap/base.js.map +1 -0
  125. package/es/components/InputGroup/variations/_gap/base_1k4piyx.css +1 -0
  126. package/es/components/InputGroup/variations/_orientation/base.js +5 -0
  127. package/es/components/InputGroup/variations/_orientation/base.js.map +1 -0
  128. package/es/components/InputGroup/variations/_orientation/base_mgs8eg.css +1 -0
  129. package/es/components/InputGroup/variations/_shape/base.js +5 -0
  130. package/es/components/InputGroup/variations/_shape/base.js.map +1 -0
  131. package/es/components/InputGroup/variations/_shape/base_1v4bh9v.css +1 -0
  132. package/es/components/InputGroup/variations/_size/base.js +5 -0
  133. package/es/components/InputGroup/variations/_size/base.js.map +1 -0
  134. package/es/components/InputGroup/variations/_size/base_1vk5vms.css +1 -0
  135. package/es/components/InputGroup/variations/_stretching/base.js +5 -0
  136. package/es/components/InputGroup/variations/_stretching/base.js.map +1 -0
  137. package/es/components/InputGroup/variations/_stretching/base_1cr1a83.css +1 -0
  138. package/es/components/TextField/TextField.js +1 -1
  139. package/es/components/TextField/TextField.js.map +1 -1
  140. package/es/components/TextField/TextField.tokens.js +2 -1
  141. package/es/components/TextField/TextField.tokens.js.map +1 -1
  142. package/es/index.css +12 -0
  143. package/es/index.js +3 -1
  144. package/es/index.js.map +1 -1
  145. package/es/utils/datejs.js +0 -1
  146. package/es/utils/datejs.js.map +1 -1
  147. package/package.json +2 -2
  148. package/styled-components/cjs/components/DatePicker/RangeDate/RangeDate.js +9 -19
  149. package/styled-components/cjs/components/DatePicker/SingleDate/SingleDate.js +5 -12
  150. package/styled-components/cjs/components/DatePicker/hooks/useDatePicker.js +7 -9
  151. package/styled-components/cjs/components/DatePicker/utils/dateHelper.js +13 -15
  152. package/styled-components/cjs/components/InputGroup/InputGroup.js +83 -0
  153. package/styled-components/cjs/components/InputGroup/InputGroup.styles.js +8 -0
  154. package/styled-components/cjs/components/InputGroup/InputGroup.template-doc.mdx +124 -0
  155. package/styled-components/cjs/components/InputGroup/InputGroup.tokens.js +90 -0
  156. package/styled-components/cjs/components/InputGroup/InputGroup.types.js +5 -0
  157. package/styled-components/cjs/components/InputGroup/index.js +31 -0
  158. package/styled-components/cjs/components/InputGroup/variations/_gap/base.js +9 -0
  159. package/styled-components/cjs/components/InputGroup/variations/_gap/tokens.json +1 -0
  160. package/styled-components/cjs/components/InputGroup/variations/_orientation/base.js +9 -0
  161. package/styled-components/cjs/components/InputGroup/variations/_orientation/tokens.json +1 -0
  162. package/styled-components/cjs/components/InputGroup/variations/_shape/base.js +11 -0
  163. package/styled-components/cjs/components/InputGroup/variations/_shape/tokens.json +1 -0
  164. package/styled-components/cjs/components/InputGroup/variations/_size/base.js +10 -0
  165. package/styled-components/cjs/components/InputGroup/variations/_size/tokens.json +58 -0
  166. package/styled-components/cjs/components/InputGroup/variations/_stretching/base.js +9 -0
  167. package/styled-components/cjs/components/InputGroup/variations/_stretching/tokens.json +1 -0
  168. package/styled-components/cjs/components/TextField/TextField.js +1 -1
  169. package/styled-components/cjs/components/TextField/TextField.tokens.js +2 -1
  170. package/styled-components/cjs/components/TextField/index.js +6 -0
  171. package/styled-components/cjs/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +1 -34
  172. package/styled-components/cjs/examples/plasma_b2c/components/InputGroup/InputGroup.config.js +38 -0
  173. package/styled-components/cjs/examples/plasma_b2c/components/InputGroup/InputGroup.js +11 -0
  174. package/styled-components/cjs/examples/plasma_b2c/components/InputGroup/InputGroup.stories.tsx +102 -0
  175. package/styled-components/cjs/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +1 -35
  176. package/styled-components/cjs/examples/plasma_web/components/InputGroup/InputGroup.config.js +38 -0
  177. package/styled-components/cjs/examples/plasma_web/components/InputGroup/InputGroup.js +11 -0
  178. package/styled-components/cjs/examples/plasma_web/components/InputGroup/InputGroup.stories.tsx +102 -0
  179. package/styled-components/cjs/index.js +11 -0
  180. package/styled-components/cjs/utils/datejs.js +0 -1
  181. package/styled-components/es/components/DatePicker/RangeDate/RangeDate.js +9 -19
  182. package/styled-components/es/components/DatePicker/SingleDate/SingleDate.js +5 -12
  183. package/styled-components/es/components/DatePicker/hooks/useDatePicker.js +7 -9
  184. package/styled-components/es/components/DatePicker/utils/dateHelper.js +13 -15
  185. package/styled-components/es/components/InputGroup/InputGroup.js +74 -0
  186. package/styled-components/es/components/InputGroup/InputGroup.styles.js +2 -0
  187. package/styled-components/es/components/InputGroup/InputGroup.template-doc.mdx +124 -0
  188. package/styled-components/es/components/InputGroup/InputGroup.tokens.js +84 -0
  189. package/styled-components/es/components/InputGroup/InputGroup.types.js +1 -0
  190. package/styled-components/es/components/InputGroup/index.js +2 -0
  191. package/styled-components/es/components/InputGroup/variations/_gap/base.js +3 -0
  192. package/styled-components/es/components/InputGroup/variations/_gap/tokens.json +1 -0
  193. package/styled-components/es/components/InputGroup/variations/_orientation/base.js +3 -0
  194. package/styled-components/es/components/InputGroup/variations/_orientation/tokens.json +1 -0
  195. package/styled-components/es/components/InputGroup/variations/_shape/base.js +5 -0
  196. package/styled-components/es/components/InputGroup/variations/_shape/tokens.json +1 -0
  197. package/styled-components/es/components/InputGroup/variations/_size/base.js +4 -0
  198. package/styled-components/es/components/InputGroup/variations/_size/tokens.json +58 -0
  199. package/styled-components/es/components/InputGroup/variations/_stretching/base.js +3 -0
  200. package/styled-components/es/components/InputGroup/variations/_stretching/tokens.json +1 -0
  201. package/styled-components/es/components/TextField/TextField.js +1 -1
  202. package/styled-components/es/components/TextField/TextField.tokens.js +2 -1
  203. package/styled-components/es/components/TextField/index.js +1 -1
  204. package/styled-components/es/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +1 -34
  205. package/styled-components/es/examples/plasma_b2c/components/InputGroup/InputGroup.config.js +32 -0
  206. package/styled-components/es/examples/plasma_b2c/components/InputGroup/InputGroup.js +5 -0
  207. package/styled-components/es/examples/plasma_b2c/components/InputGroup/InputGroup.stories.tsx +102 -0
  208. package/styled-components/es/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +1 -35
  209. package/styled-components/es/examples/plasma_web/components/InputGroup/InputGroup.config.js +32 -0
  210. package/styled-components/es/examples/plasma_web/components/InputGroup/InputGroup.js +5 -0
  211. package/styled-components/es/examples/plasma_web/components/InputGroup/InputGroup.stories.tsx +102 -0
  212. package/styled-components/es/index.js +1 -0
  213. package/styled-components/es/utils/datejs.js +0 -1
  214. package/types/components/DatePicker/DatePickerBase.types.d.ts +0 -6
  215. package/types/components/DatePicker/DatePickerBase.types.d.ts.map +1 -1
  216. package/types/components/DatePicker/RangeDate/RangeDate.d.ts.map +1 -1
  217. package/types/components/DatePicker/SingleDate/SingleDate.d.ts.map +1 -1
  218. package/types/components/DatePicker/hooks/useDatePicker.d.ts +1 -1
  219. package/types/components/DatePicker/hooks/useDatePicker.d.ts.map +1 -1
  220. package/types/components/DatePicker/utils/dateHelper.d.ts +3 -6
  221. package/types/components/DatePicker/utils/dateHelper.d.ts.map +1 -1
  222. package/types/components/InputGroup/InputGroup.d.ts +35 -0
  223. package/types/components/InputGroup/InputGroup.d.ts.map +1 -0
  224. package/types/components/InputGroup/InputGroup.styles.d.ts +2 -0
  225. package/types/components/InputGroup/InputGroup.styles.d.ts.map +1 -0
  226. package/types/components/InputGroup/InputGroup.tokens.d.ts +83 -0
  227. package/types/components/InputGroup/InputGroup.tokens.d.ts.map +1 -0
  228. package/types/components/InputGroup/InputGroup.types.d.ts +62 -0
  229. package/types/components/InputGroup/InputGroup.types.d.ts.map +1 -0
  230. package/types/components/InputGroup/index.d.ts +4 -0
  231. package/types/components/InputGroup/index.d.ts.map +1 -0
  232. package/types/components/InputGroup/variations/_gap/base.d.ts +2 -0
  233. package/types/components/InputGroup/variations/_gap/base.d.ts.map +1 -0
  234. package/types/components/InputGroup/variations/_orientation/base.d.ts +2 -0
  235. package/types/components/InputGroup/variations/_orientation/base.d.ts.map +1 -0
  236. package/types/components/InputGroup/variations/_shape/base.d.ts +2 -0
  237. package/types/components/InputGroup/variations/_shape/base.d.ts.map +1 -0
  238. package/types/components/InputGroup/variations/_size/base.d.ts +2 -0
  239. package/types/components/InputGroup/variations/_size/base.d.ts.map +1 -0
  240. package/types/components/InputGroup/variations/_stretching/base.d.ts +2 -0
  241. package/types/components/InputGroup/variations/_stretching/base.d.ts.map +1 -0
  242. package/types/components/TextField/TextField.tokens.d.ts +1 -0
  243. package/types/components/TextField/TextField.tokens.d.ts.map +1 -1
  244. package/types/components/TextField/index.d.ts +1 -1
  245. package/types/components/TextField/index.d.ts.map +1 -1
  246. package/types/examples/plasma_b2c/components/InputGroup/InputGroup.config.d.ts +31 -0
  247. package/types/examples/plasma_b2c/components/InputGroup/InputGroup.config.d.ts.map +1 -0
  248. package/types/examples/plasma_b2c/components/InputGroup/InputGroup.d.ts +27 -0
  249. package/types/examples/plasma_b2c/components/InputGroup/InputGroup.d.ts.map +1 -0
  250. package/types/examples/plasma_web/components/InputGroup/InputGroup.config.d.ts +31 -0
  251. package/types/examples/plasma_web/components/InputGroup/InputGroup.config.d.ts.map +1 -0
  252. package/types/examples/plasma_web/components/InputGroup/InputGroup.d.ts +27 -0
  253. package/types/examples/plasma_web/components/InputGroup/InputGroup.d.ts.map +1 -0
  254. package/types/index.d.ts +1 -0
  255. package/types/index.d.ts.map +1 -1
  256. package/types/utils/datejs.d.ts +0 -1
  257. 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,102 @@
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 = ComponentProps<typeof InputGroup> & { itemsCount?: number };
12
+ type Story = StoryObj<StoryProps>;
13
+
14
+ const sizes = ['l', 'm', 's', 'xs'];
15
+ const orientationValues = ['horizontal', 'vertical'];
16
+ const gapValues = ['none', 'dense', 'wide'];
17
+ const shapeValues = ['segmented', 'default'];
18
+ const stretchingValues = ['auto', 'filled'];
19
+
20
+ const meta: Meta<typeof InputGroup> = {
21
+ title: 'plasma_web/InputGroup',
22
+ decorators: [WithTheme],
23
+ argTypes: {
24
+ size: {
25
+ options: sizes,
26
+ control: {
27
+ type: 'select',
28
+ },
29
+ },
30
+ orientation: {
31
+ options: orientationValues,
32
+ control: {
33
+ type: 'inline-radio',
34
+ },
35
+ },
36
+ gap: {
37
+ options: gapValues,
38
+ control: {
39
+ type: 'select',
40
+ },
41
+ },
42
+ shape: {
43
+ options: shapeValues,
44
+ control: {
45
+ type: 'select',
46
+ },
47
+ },
48
+ stretching: {
49
+ options: stretchingValues,
50
+ control: {
51
+ type: 'select',
52
+ },
53
+ },
54
+ },
55
+ };
56
+
57
+ export default meta;
58
+
59
+ export const Default: Story = {
60
+ args: {
61
+ size: 'm',
62
+ gap: 'dense',
63
+ orientation: 'horizontal',
64
+ shape: 'default',
65
+ itemsCount: 5,
66
+ stretching: 'auto',
67
+ },
68
+ render: ({ itemsCount, ...args }: StoryProps) => {
69
+ return (
70
+ <InputGroup {...args}>
71
+ {Array(itemsCount)
72
+ .fill(true)
73
+ .map((_, i) => (
74
+ <TextField placeholder={`input #${i}`} />
75
+ ))}
76
+ </InputGroup>
77
+ );
78
+ },
79
+ };
80
+
81
+ export const CustomInputs: Story = {
82
+ args: {
83
+ ...Default.args,
84
+ isCommonInputStyles: false,
85
+ },
86
+ argTypes: {
87
+ ...disableProps(['itemsCount']),
88
+ },
89
+ render: (args: StoryProps) => {
90
+ return (
91
+ <>
92
+ <h3>Группа Input с разными размерами</h3>
93
+ <InputGroup {...args}>
94
+ <TextField placeholder="Размер l" size="l" />
95
+ <TextField placeholder="Размер m" size="m" />
96
+ <TextField placeholder="Размер s" size="s" />
97
+ <TextField placeholder="Размер xs" size="xs" />
98
+ </InputGroup>
99
+ </>
100
+ );
101
+ },
102
+ };
@@ -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,7 +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
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
12
  _dayjs["default"].extend(_customParseFormat["default"]);
14
13
  _dayjs["default"].extend(_quarterOfYear["default"]);
@@ -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,41 +1,39 @@
1
1
  import { customDayjs } from '../../../utils/datejs';
2
- import 'dayjs/locale/ru';
3
- import 'dayjs/locale/en';
4
- export var formatInputValue = function formatInputValue(value, format, lang) {
5
- if (!value || !lang) {
2
+ export var formatInputValue = function formatInputValue(value, format) {
3
+ if (!value) {
6
4
  return '';
7
5
  }
8
6
  if (format && customDayjs(value, format, true).isValid()) {
9
- return customDayjs(value, format).locale(lang).format(format);
7
+ return customDayjs(value, format).format(format);
10
8
  }
11
9
  if (format && String(value).length >= 10 && String(new Date(value)) !== 'Invalid Date') {
12
- return customDayjs(value).locale(lang).format(format);
10
+ return customDayjs(value).format(format);
13
11
  }
14
12
  return String(value);
15
13
  };
16
- export var formatCalendarValue = function formatCalendarValue(value, format, lang) {
17
- if (!value || !lang) {
14
+ export var formatCalendarValue = function formatCalendarValue(value, format) {
15
+ if (!value) {
18
16
  return undefined;
19
17
  }
20
18
  if (format && customDayjs(value, format, true).isValid()) {
21
- return customDayjs(value, format, true).locale(lang).toDate();
19
+ return customDayjs(value, format, true).toDate();
22
20
  }
23
21
  if (String(new Date(value)) !== 'Invalid Date') {
24
- return customDayjs(value).locale(lang).toDate();
22
+ return customDayjs(value).toDate();
25
23
  }
26
24
  return undefined;
27
25
  };
28
- export var getDateFromFormat = function getDateFromFormat(value, format, lang) {
29
- if (format && customDayjs(value, format, true).isValid() && lang) {
26
+ export var getDateFromFormat = function getDateFromFormat(value, format) {
27
+ if (format && customDayjs(value, format, true).isValid()) {
30
28
  return {
31
- value: customDayjs(value, format, true).locale(lang).toDate(),
29
+ value: customDayjs(value, format, true).toDate(),
32
30
  isError: false,
33
31
  isSuccess: true
34
32
  };
35
33
  }
36
- if (!format && String(new Date(value)) !== 'Invalid Date' && lang) {
34
+ if (!format && String(new Date(value)) !== 'Invalid Date') {
37
35
  return {
38
- value: customDayjs(value).locale(lang).toDate(),
36
+ value: customDayjs(value).toDate(),
39
37
  isError: false,
40
38
  isSuccess: true
41
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
+ orientation: orientation,
40
+ shape: shape,
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,124 @@
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 isCommonButtonStyles={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
+ ### Ориентация InputGroup и отступы между input
66
+
67
+ InputGroup может располагаться вертикально или горизонтально и иметь три вида отступов:
68
+
69
+ ```tsx live
70
+ import React from 'react';
71
+ import { InputGroup, TextField } from '@salutejs/{{ package }}';
72
+
73
+ export function App() {
74
+ return (
75
+ <div>
76
+ <InputGroup size="xs" orientation="vertical" gap="none">
77
+ {Array(5)
78
+ .fill(true)
79
+ .map((_, i) => (
80
+ <TextField placeholder={`input #${i}`} />
81
+ ))}
82
+ </InputGroup>
83
+
84
+ <InputGroup size="xs" orientation="horizontal" gap="wide">
85
+ {Array(4)
86
+ .fill(true)
87
+ .map((_, i) => (
88
+ <TextField placeholder={`input #${i}`} />
89
+ ))}
90
+ </InputGroup>
91
+ </div>
92
+ );
93
+ }
94
+ ```
95
+
96
+ ### Границы input
97
+ Границы input задаются с помощью свойства `shape`.
98
+
99
+ ```tsx live
100
+ import React from 'react';
101
+ import { InputGroup, TextField } from '@salutejs/{{ package }}';
102
+
103
+ export function App() {
104
+ return (
105
+ <div>
106
+ <InputGroup size="xs" shape="segmented">
107
+ {Array(3)
108
+ .fill(true)
109
+ .map((_, i) => (
110
+ <TextField placeholder={`input #${i}`} />
111
+ ))}
112
+ </InputGroup>
113
+
114
+ <InputGroup size="xs" shape="default">
115
+ {Array(3)
116
+ .fill(true)
117
+ .map((_, i) => (
118
+ <TextField placeholder={`input #${i}`} />
119
+ ))}
120
+ </InputGroup>
121
+ </div>
122
+ );
123
+ }
124
+ ```