@qiwi/pijma-desktop-extra 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/README.md +0 -0
  2. package/lib/dts/main/amount/AmountProps.d.ts +9 -0
  3. package/lib/dts/main/amount/index.d.ts +3 -0
  4. package/lib/dts/main/checkbox/CheckboxProps.d.ts +9 -0
  5. package/lib/dts/main/checkbox/index.d.ts +7 -0
  6. package/lib/dts/main/chip/ChipProps.d.ts +4 -0
  7. package/lib/dts/main/chip/index.d.ts +4 -0
  8. package/lib/dts/main/date-picker/DatePickerProps.d.ts +4 -0
  9. package/lib/dts/main/date-picker/DatePickerState.d.ts +7 -0
  10. package/lib/dts/main/date-picker/index.d.ts +5 -0
  11. package/lib/dts/main/date-picker/locale.d.ts +3 -0
  12. package/lib/dts/main/date-picker/wrap.d.ts +6 -0
  13. package/lib/dts/main/date-range-picker/DateRangePickerState.d.ts +5 -0
  14. package/lib/dts/main/date-range-picker/DateRangerPickerProps.d.ts +11 -0
  15. package/lib/dts/main/date-range-picker/index.d.ts +15 -0
  16. package/lib/dts/main/divider/DividerProps.d.ts +7 -0
  17. package/lib/dts/main/divider/index.d.ts +3 -0
  18. package/lib/dts/main/dropdown/Container.d.ts +24 -0
  19. package/lib/dts/main/dropdown/ContainerProps.d.ts +13 -0
  20. package/lib/dts/main/dropdown/DropdownProps.d.ts +10 -0
  21. package/lib/dts/main/dropdown/index.d.ts +14 -0
  22. package/lib/dts/main/empty-page/index.d.ts +5 -0
  23. package/lib/dts/main/error-message/ErrorMessageProps.d.ts +6 -0
  24. package/lib/dts/main/error-message/index.d.ts +6 -0
  25. package/lib/dts/main/file-uploader/FileUploaderControl.d.ts +4 -0
  26. package/lib/dts/main/file-uploader/FileUploaderControlProps.d.ts +12 -0
  27. package/lib/dts/main/file-uploader/FileUploaderProps.d.ts +15 -0
  28. package/lib/dts/main/file-uploader/FileUploaderStyles.d.ts +16 -0
  29. package/lib/dts/main/file-uploader/index.d.ts +4 -0
  30. package/lib/dts/main/footer/index.d.ts +6 -0
  31. package/lib/dts/main/header/HeaderProps.d.ts +21 -0
  32. package/lib/dts/main/header/index.d.ts +5 -0
  33. package/lib/dts/main/icon/IconProps.d.ts +7 -0
  34. package/lib/dts/main/icon/index.d.ts +5 -0
  35. package/lib/dts/main/index.d.ts +29 -0
  36. package/lib/dts/main/logo/index.d.ts +2 -0
  37. package/lib/dts/main/menu/MenuProps.d.ts +8 -0
  38. package/lib/dts/main/menu/index.d.ts +10 -0
  39. package/lib/dts/main/menu/interfaces.d.ts +9 -0
  40. package/lib/dts/main/navigation-menu/NavigationMenuProps.d.ts +13 -0
  41. package/lib/dts/main/navigation-menu/index.d.ts +5 -0
  42. package/lib/dts/main/obfuscatedPan/ObfuscatedPanProps.d.ts +4 -0
  43. package/lib/dts/main/obfuscatedPan/index.d.ts +3 -0
  44. package/lib/dts/main/offset/OffsetProps.d.ts +6 -0
  45. package/lib/dts/main/offset/index.d.ts +6 -0
  46. package/lib/dts/main/paginator/PaginatorProps.d.ts +10 -0
  47. package/lib/dts/main/paginator/index.d.ts +25 -0
  48. package/lib/dts/main/product/ProductProps.d.ts +8 -0
  49. package/lib/dts/main/product/ProductState.d.ts +3 -0
  50. package/lib/dts/main/product/index.d.ts +10 -0
  51. package/lib/dts/main/select/SelectProps.d.ts +15 -0
  52. package/lib/dts/main/select/SelectState.d.ts +5 -0
  53. package/lib/dts/main/select/index.d.ts +14 -0
  54. package/lib/dts/main/spinner/index.d.ts +2 -0
  55. package/lib/dts/main/spreader/index.d.ts +6 -0
  56. package/lib/dts/main/step/StepProps.d.ts +10 -0
  57. package/lib/dts/main/step/StepStyle.d.ts +9 -0
  58. package/lib/dts/main/step/index.d.ts +4 -0
  59. package/lib/dts/main/step/interfaces.d.ts +1 -0
  60. package/lib/dts/main/stepper/StepperControl.d.ts +4 -0
  61. package/lib/dts/main/stepper/StepperControlProps.d.ts +10 -0
  62. package/lib/dts/main/stepper/StepperProps.d.ts +6 -0
  63. package/lib/dts/main/stepper/index.d.ts +4 -0
  64. package/lib/dts/main/table/column.d.ts +1 -0
  65. package/lib/dts/main/table/constants.d.ts +3 -0
  66. package/lib/dts/main/table/index.d.ts +3 -0
  67. package/lib/dts/main/theme/color.d.ts +78 -0
  68. package/lib/dts/main/theme/dimen.d.ts +9 -0
  69. package/lib/dts/main/theme/grid.d.ts +1 -0
  70. package/lib/dts/main/theme/index.d.ts +3 -0
  71. package/lib/dts/main/theme/text.d.ts +19 -0
  72. package/lib/dts/main/trinary-check-icon/TrinaryCheckboxProps.d.ts +5 -0
  73. package/lib/dts/main/trinary-check-icon/index.d.ts +4 -0
  74. package/lib/dts/main/user-profile/UserProfileProps.d.ts +4 -0
  75. package/lib/dts/main/user-profile/index.d.ts +5 -0
  76. package/lib/dts/test/amount.d.ts +1 -0
  77. package/lib/dts/test/checkbox.d.ts +1 -0
  78. package/lib/dts/test/datePicker.d.ts +1 -0
  79. package/lib/dts/test/dateRangePicker.d.ts +1 -0
  80. package/lib/dts/test/divider.d.ts +1 -0
  81. package/lib/dts/test/dropdown.d.ts +1 -0
  82. package/lib/dts/test/errorMessage.d.ts +1 -0
  83. package/lib/dts/test/header.d.ts +1 -0
  84. package/lib/dts/test/icon.d.ts +1 -0
  85. package/lib/dts/test/navigationMenu.d.ts +1 -0
  86. package/lib/dts/test/obfuscatedPan.d.ts +1 -0
  87. package/lib/dts/test/offset.d.ts +1 -0
  88. package/lib/dts/test/paginator.d.ts +1 -0
  89. package/lib/dts/test/product.d.ts +1 -0
  90. package/lib/dts/test/select.d.ts +1 -0
  91. package/lib/dts/test/spinner.d.ts +1 -0
  92. package/lib/dts/test/table.d.ts +1 -0
  93. package/lib/dts/test/trinary-check-icon.d.ts +1 -0
  94. package/lib/dts/test/userProfile.d.ts +1 -0
  95. package/lib/es5/main/amount/AmountProps.js +4 -0
  96. package/lib/es5/main/amount/index.js +27 -0
  97. package/lib/es5/main/checkbox/CheckboxProps.js +4 -0
  98. package/lib/es5/main/checkbox/index.js +65 -0
  99. package/lib/es5/main/chip/ChipProps.js +4 -0
  100. package/lib/es5/main/chip/index.js +57 -0
  101. package/lib/es5/main/date-picker/DatePickerProps.js +4 -0
  102. package/lib/es5/main/date-picker/DatePickerState.js +4 -0
  103. package/lib/es5/main/date-picker/index.js +177 -0
  104. package/lib/es5/main/date-picker/locale.js +59 -0
  105. package/lib/es5/main/date-picker/wrap.js +28 -0
  106. package/lib/es5/main/date-range-picker/DateRangePickerState.js +4 -0
  107. package/lib/es5/main/date-range-picker/DateRangerPickerProps.js +4 -0
  108. package/lib/es5/main/date-range-picker/index.js +243 -0
  109. package/lib/es5/main/divider/DividerProps.js +4 -0
  110. package/lib/es5/main/divider/index.js +42 -0
  111. package/lib/es5/main/dropdown/Container.js +145 -0
  112. package/lib/es5/main/dropdown/ContainerProps.js +4 -0
  113. package/lib/es5/main/dropdown/DropdownProps.js +4 -0
  114. package/lib/es5/main/dropdown/index.js +86 -0
  115. package/lib/es5/main/empty-page/index.js +89 -0
  116. package/lib/es5/main/error-message/ErrorMessageProps.js +4 -0
  117. package/lib/es5/main/error-message/index.js +71 -0
  118. package/lib/es5/main/file-uploader/FileUploaderControl.js +28 -0
  119. package/lib/es5/main/file-uploader/FileUploaderControlProps.js +4 -0
  120. package/lib/es5/main/file-uploader/FileUploaderProps.js +4 -0
  121. package/lib/es5/main/file-uploader/FileUploaderStyles.js +60 -0
  122. package/lib/es5/main/file-uploader/index.js +109 -0
  123. package/lib/es5/main/footer/index.js +115 -0
  124. package/lib/es5/main/header/HeaderProps.js +4 -0
  125. package/lib/es5/main/header/index.js +110 -0
  126. package/lib/es5/main/icon/IconProps.js +4 -0
  127. package/lib/es5/main/icon/index.js +54 -0
  128. package/lib/es5/main/index.js +34 -0
  129. package/lib/es5/main/logo/index.js +96 -0
  130. package/lib/es5/main/menu/MenuProps.js +4 -0
  131. package/lib/es5/main/menu/index.js +137 -0
  132. package/lib/es5/main/menu/interfaces.js +4 -0
  133. package/lib/es5/main/navigation-menu/NavigationMenuProps.js +4 -0
  134. package/lib/es5/main/navigation-menu/index.js +65 -0
  135. package/lib/es5/main/obfuscatedPan/ObfuscatedPanProps.js +4 -0
  136. package/lib/es5/main/obfuscatedPan/index.js +22 -0
  137. package/lib/es5/main/offset/OffsetProps.js +4 -0
  138. package/lib/es5/main/offset/index.js +34 -0
  139. package/lib/es5/main/paginator/PaginatorProps.js +4 -0
  140. package/lib/es5/main/paginator/index.js +140 -0
  141. package/lib/es5/main/product/ProductProps.js +4 -0
  142. package/lib/es5/main/product/ProductState.js +4 -0
  143. package/lib/es5/main/product/index.js +139 -0
  144. package/lib/es5/main/select/SelectProps.js +4 -0
  145. package/lib/es5/main/select/SelectState.js +4 -0
  146. package/lib/es5/main/select/index.js +156 -0
  147. package/lib/es5/main/spinner/index.js +22 -0
  148. package/lib/es5/main/spreader/index.js +22 -0
  149. package/lib/es5/main/step/StepProps.js +4 -0
  150. package/lib/es5/main/step/StepStyle.js +54 -0
  151. package/lib/es5/main/step/index.js +46 -0
  152. package/lib/es5/main/step/interfaces.js +4 -0
  153. package/lib/es5/main/stepper/StepperControl.js +32 -0
  154. package/lib/es5/main/stepper/StepperControlProps.js +4 -0
  155. package/lib/es5/main/stepper/StepperProps.js +4 -0
  156. package/lib/es5/main/stepper/index.js +54 -0
  157. package/lib/es5/main/table/column.js +27 -0
  158. package/lib/es5/main/table/constants.js +25 -0
  159. package/lib/es5/main/table/index.js +101 -0
  160. package/lib/es5/main/theme/color.js +127 -0
  161. package/lib/es5/main/theme/dimen.js +32 -0
  162. package/lib/es5/main/theme/grid.js +11 -0
  163. package/lib/es5/main/theme/index.js +25 -0
  164. package/lib/es5/main/theme/text.js +33 -0
  165. package/lib/es5/main/trinary-check-icon/TrinaryCheckboxProps.js +4 -0
  166. package/lib/es5/main/trinary-check-icon/index.js +63 -0
  167. package/lib/es5/main/user-profile/UserProfileProps.js +4 -0
  168. package/lib/es5/main/user-profile/index.js +73 -0
  169. package/lib/es5/test/amount.js +21 -0
  170. package/lib/es5/test/checkbox.js +47 -0
  171. package/lib/es5/test/datePicker.js +35 -0
  172. package/lib/es5/test/dateRangePicker.js +39 -0
  173. package/lib/es5/test/divider.js +24 -0
  174. package/lib/es5/test/dropdown.js +71 -0
  175. package/lib/es5/test/errorMessage.js +29 -0
  176. package/lib/es5/test/header.js +119 -0
  177. package/lib/es5/test/icon.js +31 -0
  178. package/lib/es5/test/navigationMenu.js +105 -0
  179. package/lib/es5/test/obfuscatedPan.js +21 -0
  180. package/lib/es5/test/offset.js +18 -0
  181. package/lib/es5/test/paginator.js +23 -0
  182. package/lib/es5/test/product.js +52 -0
  183. package/lib/es5/test/select.js +30 -0
  184. package/lib/es5/test/spinner.js +18 -0
  185. package/lib/es5/test/table.js +73 -0
  186. package/lib/es5/test/trinary-check-icon.js +32 -0
  187. package/lib/es5/test/userProfile.js +26 -0
  188. package/lib/es6/main/amount/AmountProps.js +1 -0
  189. package/lib/es6/main/amount/index.js +15 -0
  190. package/lib/es6/main/checkbox/CheckboxProps.js +1 -0
  191. package/lib/es6/main/checkbox/index.js +40 -0
  192. package/lib/es6/main/chip/ChipProps.js +1 -0
  193. package/lib/es6/main/chip/index.js +38 -0
  194. package/lib/es6/main/date-picker/DatePickerProps.js +1 -0
  195. package/lib/es6/main/date-picker/DatePickerState.js +1 -0
  196. package/lib/es6/main/date-picker/index.js +143 -0
  197. package/lib/es6/main/date-picker/locale.js +32 -0
  198. package/lib/es6/main/date-picker/wrap.js +214 -0
  199. package/lib/es6/main/date-range-picker/DateRangePickerState.js +1 -0
  200. package/lib/es6/main/date-range-picker/DateRangerPickerProps.js +1 -0
  201. package/lib/es6/main/date-range-picker/index.js +207 -0
  202. package/lib/es6/main/divider/DividerProps.js +1 -0
  203. package/lib/es6/main/divider/index.js +15 -0
  204. package/lib/es6/main/dropdown/Container.js +75 -0
  205. package/lib/es6/main/dropdown/ContainerProps.js +1 -0
  206. package/lib/es6/main/dropdown/DropdownProps.js +1 -0
  207. package/lib/es6/main/dropdown/index.js +47 -0
  208. package/lib/es6/main/empty-page/index.js +70 -0
  209. package/lib/es6/main/error-message/ErrorMessageProps.js +1 -0
  210. package/lib/es6/main/error-message/index.js +42 -0
  211. package/lib/es6/main/file-uploader/FileUploaderControl.js +15 -0
  212. package/lib/es6/main/file-uploader/FileUploaderControlProps.js +1 -0
  213. package/lib/es6/main/file-uploader/FileUploaderProps.js +1 -0
  214. package/lib/es6/main/file-uploader/FileUploaderStyles.js +16 -0
  215. package/lib/es6/main/file-uploader/index.js +77 -0
  216. package/lib/es6/main/footer/index.js +90 -0
  217. package/lib/es6/main/header/HeaderProps.js +1 -0
  218. package/lib/es6/main/header/index.js +84 -0
  219. package/lib/es6/main/icon/IconProps.js +1 -0
  220. package/lib/es6/main/icon/index.js +24 -0
  221. package/lib/es6/main/index.js +29 -0
  222. package/lib/es6/main/logo/index.js +83 -0
  223. package/lib/es6/main/menu/MenuProps.js +1 -0
  224. package/lib/es6/main/menu/index.js +116 -0
  225. package/lib/es6/main/menu/interfaces.js +1 -0
  226. package/lib/es6/main/navigation-menu/NavigationMenuProps.js +1 -0
  227. package/lib/es6/main/navigation-menu/index.js +38 -0
  228. package/lib/es6/main/obfuscatedPan/ObfuscatedPanProps.js +1 -0
  229. package/lib/es6/main/obfuscatedPan/index.js +10 -0
  230. package/lib/es6/main/offset/OffsetProps.js +1 -0
  231. package/lib/es6/main/offset/index.js +7 -0
  232. package/lib/es6/main/paginator/PaginatorProps.js +1 -0
  233. package/lib/es6/main/paginator/index.js +115 -0
  234. package/lib/es6/main/product/ProductProps.js +1 -0
  235. package/lib/es6/main/product/ProductState.js +1 -0
  236. package/lib/es6/main/product/index.js +89 -0
  237. package/lib/es6/main/select/SelectProps.js +1 -0
  238. package/lib/es6/main/select/SelectState.js +1 -0
  239. package/lib/es6/main/select/index.js +118 -0
  240. package/lib/es6/main/spinner/index.js +9 -0
  241. package/lib/es6/main/spreader/index.js +11 -0
  242. package/lib/es6/main/step/StepProps.js +1 -0
  243. package/lib/es6/main/step/StepStyle.js +36 -0
  244. package/lib/es6/main/step/index.js +24 -0
  245. package/lib/es6/main/step/interfaces.js +1 -0
  246. package/lib/es6/main/stepper/StepperControl.js +18 -0
  247. package/lib/es6/main/stepper/StepperControlProps.js +1 -0
  248. package/lib/es6/main/stepper/StepperProps.js +1 -0
  249. package/lib/es6/main/stepper/index.js +37 -0
  250. package/lib/es6/main/table/column.js +16 -0
  251. package/lib/es6/main/table/constants.js +4 -0
  252. package/lib/es6/main/table/index.js +116 -0
  253. package/lib/es6/main/theme/color.js +79 -0
  254. package/lib/es6/main/theme/dimen.js +8 -0
  255. package/lib/es6/main/theme/grid.js +1 -0
  256. package/lib/es6/main/theme/index.js +3 -0
  257. package/lib/es6/main/theme/text.js +12 -0
  258. package/lib/es6/main/trinary-check-icon/TrinaryCheckboxProps.js +1 -0
  259. package/lib/es6/main/trinary-check-icon/index.js +43 -0
  260. package/lib/es6/main/user-profile/UserProfileProps.js +1 -0
  261. package/lib/es6/main/user-profile/index.js +32 -0
  262. package/lib/es6/test/amount.js +16 -0
  263. package/lib/es6/test/checkbox.js +42 -0
  264. package/lib/es6/test/datePicker.js +30 -0
  265. package/lib/es6/test/dateRangePicker.js +34 -0
  266. package/lib/es6/test/divider.js +19 -0
  267. package/lib/es6/test/dropdown.js +66 -0
  268. package/lib/es6/test/errorMessage.js +24 -0
  269. package/lib/es6/test/header.js +114 -0
  270. package/lib/es6/test/icon.js +26 -0
  271. package/lib/es6/test/navigationMenu.js +98 -0
  272. package/lib/es6/test/obfuscatedPan.js +16 -0
  273. package/lib/es6/test/offset.js +13 -0
  274. package/lib/es6/test/paginator.js +18 -0
  275. package/lib/es6/test/product.js +47 -0
  276. package/lib/es6/test/select.js +25 -0
  277. package/lib/es6/test/spinner.js +13 -0
  278. package/lib/es6/test/table.js +64 -0
  279. package/lib/es6/test/trinary-check-icon.js +27 -0
  280. package/lib/es6/test/userProfile.js +21 -0
  281. package/package.json +83 -0
@@ -0,0 +1,118 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Icon, styled } from '@qiwi/pijma-core';
3
+ import { TextField } from '@qiwi/pijma-desktop';
4
+ import { isEmpty } from 'lodash-es';
5
+ import React, { Component } from 'react';
6
+ import { Dropdown } from '../dropdown/index.js';
7
+ const Container = styled('div')`
8
+ position: relative;
9
+ outline: none;
10
+ `;
11
+ const IconWrapper = styled('div')`
12
+ width: 24px;
13
+ height: 24px;
14
+ display: inline-block;
15
+ `;
16
+ export class Select extends Component {
17
+ onFocus() {
18
+ if (this.props.disabled) {
19
+ return;
20
+ }
21
+ clearTimeout(this._timeoutID);
22
+ this.setState({
23
+ isOpen: true
24
+ });
25
+ }
26
+ onBlur() {
27
+ if (this.props.disabled) {
28
+ return;
29
+ }
30
+ this._timeoutID = setTimeout(()=>{
31
+ this.setState({
32
+ isOpen: false
33
+ });
34
+ }, 10);
35
+ }
36
+ selectItem(el) {
37
+ clearTimeout(this._timeoutID);
38
+ if (this.props.onChange) {
39
+ if (this.props.multiSelect) {
40
+ this.props.onChange(el);
41
+ if (!el) {
42
+ this.onBlur();
43
+ }
44
+ } else {
45
+ this.props.onChange(el.value);
46
+ this.onBlur();
47
+ }
48
+ }
49
+ if (!this.props.value) {
50
+ this.setState({
51
+ isOpen: false,
52
+ currentItem: el
53
+ });
54
+ }
55
+ }
56
+ render() {
57
+ const { items , title , defaultItem , value , error , multiSelect , mapping , emptyValue , renderItem , } = this.props;
58
+ const currentItem = items.find((el)=>el.value === value) || {
59
+ name: '',
60
+ value: ''
61
+ };
62
+ const valueName = currentItem.name || this.state.currentItem && this.state.currentItem.name || defaultItem;
63
+ let multiValue = valueName;
64
+ if (multiSelect && typeof value !== 'string') {
65
+ multiValue = value.map((el)=>mapping[el]);
66
+ }
67
+ return /*#__PURE__*/ _jsxs(Container, {
68
+ onFocus: this.onFocus,
69
+ tabIndex: 0,
70
+ ref: this.inputRef,
71
+ onBlur: this.onBlur,
72
+ children: [
73
+ /*#__PURE__*/ _jsx(TextField, {
74
+ ...this.props,
75
+ autoFocus: this.state.focus,
76
+ title: title || '',
77
+ onChange: ()=>{
78
+ /* noop */ },
79
+ onBlur: multiSelect ? ()=>{
80
+ /* noop */ } : this.onBlur,
81
+ value: !isEmpty(multiValue) ? [].concat(multiValue).join(', ') : emptyValue || '',
82
+ hint: /*#__PURE__*/ _jsx(IconWrapper, {
83
+ onClick: this.focusOnInput,
84
+ children: /*#__PURE__*/ _jsx(Icon, {
85
+ name: "angle-small-down"
86
+ })
87
+ }),
88
+ error: error
89
+ }),
90
+ /*#__PURE__*/ _jsx(Dropdown, {
91
+ show: this.state.isOpen,
92
+ items: items,
93
+ value: multiSelect ? value : valueName,
94
+ onChange: this.selectItem,
95
+ focus: this.focusOnInput,
96
+ multiSelect: multiSelect,
97
+ renderItem: renderItem
98
+ })
99
+ ]
100
+ });
101
+ }
102
+ constructor(props){
103
+ super(props);
104
+ this.focusOnInput = ()=>{
105
+ this.inputRef.current.focus();
106
+ };
107
+ this.currentItem = this.props.value || this.props.defaultItem;
108
+ this.state = {
109
+ isOpen: false,
110
+ currentItem: this.props.items.find((el)=>el.value === this.currentItem) || {}
111
+ };
112
+ this.inputRef = /*#__PURE__*/ React.createRef();
113
+ this._timeoutID = -1;
114
+ this.onBlur = this.onBlur.bind(this);
115
+ this.onFocus = this.onFocus.bind(this);
116
+ this.selectItem = this.selectItem.bind(this);
117
+ }
118
+ }
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Spinner } from '@qiwi/pijma-core';
3
+ import React from 'react';
4
+ import { COLOR, DIMEN } from '../theme/index.js';
5
+ export const B2bSpinner = ()=>/*#__PURE__*/ _jsx(Spinner, {
6
+ color: COLOR.PRIMARY,
7
+ width: DIMEN.SPINNER_SIZE,
8
+ height: DIMEN.SPINNER_SIZE
9
+ });
@@ -0,0 +1,11 @@
1
+ import { styled } from '@qiwi/pijma-core';
2
+ export default styled('div')`
3
+ display: flex;
4
+ flex-direction: column;
5
+ margin: 0 auto;
6
+ max-width: 1280px;
7
+ min-width: 400px;
8
+ > * {
9
+ padding: 0 50px !important;
10
+ }
11
+ `;
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,36 @@
1
+ import { styled } from '@qiwi/pijma-core';
2
+ export default styled.button`
3
+ width: 40px;
4
+ height: 40px;
5
+ border: 1px solid;
6
+ border-radius: 50%;
7
+ color: ${({ variant , theme })=>{
8
+ switch(variant){
9
+ case 'active':
10
+ return theme.color.brand;
11
+ case 'focus':
12
+ return theme.color.white;
13
+ default:
14
+ return theme.color.black;
15
+ }
16
+ }};
17
+ border-color: ${({ variant , theme })=>{
18
+ switch(variant){
19
+ case 'active':
20
+ return theme.color.brand;
21
+ case 'focus':
22
+ return 'transparent';
23
+ default:
24
+ }
25
+ }};
26
+ background-color: ${({ variant , theme })=>{
27
+ switch(variant){
28
+ case 'active':
29
+ return theme.color.white;
30
+ case 'focus':
31
+ return theme.color.brand;
32
+ default:
33
+ return '#e6e6e6';
34
+ }
35
+ }};
36
+ `;
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { ButtonControl, Typo } from '@qiwi/pijma-core';
3
+ import { Text } from '@qiwi/pijma-desktop';
4
+ import React from 'react';
5
+ import StepButton from './StepStyle.js';
6
+ const Step = (props)=>{
7
+ const { icon , text , variant ='default' , ...rest } = props;
8
+ return /*#__PURE__*/ _jsx(ButtonControl, {
9
+ ...rest,
10
+ children: ({ active , focus , hover , ...events })=>/*#__PURE__*/ _jsx(StepButton, {
11
+ variant: variant,
12
+ ...events,
13
+ children: /*#__PURE__*/ _jsx(Text, {
14
+ children: /*#__PURE__*/ _jsx(Typo, {
15
+ css: {
16
+ overflowWrap: 'normal'
17
+ },
18
+ children: icon || text
19
+ })
20
+ })
21
+ })
22
+ });
23
+ };
24
+ export { Step };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import React, { useMemo } from 'react';
3
+ const StepperControl = ({ step , steps , children })=>{
4
+ const stepsArray = useMemo(()=>Array.from(new Array(steps)), [
5
+ steps
6
+ ]);
7
+ return /*#__PURE__*/ _jsx(_Fragment, {
8
+ children: stepsArray.map((_, index)=>{
9
+ const currentStep = index + 1;
10
+ const variant = currentStep === step ? 'focus' : currentStep < step ? 'active' : 'default';
11
+ return children({
12
+ currentStep,
13
+ variant
14
+ });
15
+ })
16
+ });
17
+ };
18
+ export default StepperControl;
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,37 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Flex, FlexItem } from '@qiwi/pijma-core';
3
+ import React, { Fragment } from 'react';
4
+ import { Divider } from '../divider/index.js';
5
+ import { Step } from '../step/index.js';
6
+ import StepperControl from './StepperControl.js';
7
+ const Stepper = ({ step =1 , steps , dividerWidth =25 , onChange , })=>{
8
+ if (!steps || steps <= 1) {
9
+ return null;
10
+ }
11
+ return /*#__PURE__*/ _jsx(Flex, {
12
+ align: "center",
13
+ children: /*#__PURE__*/ _jsx(StepperControl, {
14
+ steps: steps,
15
+ step: step,
16
+ children: ({ variant , currentStep })=>/*#__PURE__*/ _jsxs(Fragment, {
17
+ children: [
18
+ /*#__PURE__*/ _jsx(FlexItem, {
19
+ children: /*#__PURE__*/ _jsx(Step, {
20
+ variant: variant,
21
+ text: currentStep,
22
+ onClick: ()=>onChange && onChange(currentStep)
23
+ })
24
+ }),
25
+ currentStep < steps && /*#__PURE__*/ _jsx(FlexItem, {
26
+ width: dividerWidth,
27
+ px: 3,
28
+ children: /*#__PURE__*/ _jsx(Divider, {
29
+ active: variant === 'active'
30
+ })
31
+ })
32
+ ]
33
+ }, currentStep)
34
+ })
35
+ });
36
+ };
37
+ export { Stepper };
@@ -0,0 +1,16 @@
1
+ export function columnFactory(el, mapping) {
2
+ switch(typeof el){
3
+ case 'string':
4
+ return mapping[el] || {
5
+ accessor: el
6
+ };
7
+ case 'number':
8
+ return {
9
+ width: el
10
+ };
11
+ case 'object':
12
+ return el;
13
+ default:
14
+ throw new Error(`unsupported table column type: ${typeof el}`);
15
+ }
16
+ }
@@ -0,0 +1,4 @@
1
+ import { themes } from '@qiwi/pijma-core';
2
+ export const borderColor = themes.orange.color.gray.light;
3
+ export const tableHoverColor = 'rgba(0, 0, 0, 0.05)';
4
+ export const activeBackground = '#fbe9b8bd';
@@ -0,0 +1,116 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { styled } from '@qiwi/pijma-core';
3
+ import React from 'react';
4
+ import { useTable } from 'react-table';
5
+ import { activeBackground, borderColor, tableHoverColor } from './constants.js';
6
+ const TrWrapper = styled('tr')`
7
+ background-color: ${(props)=>props.active ? activeBackground : 'none'};
8
+ ${(props)=>props.cursor ? 'cursor: ' + props.cursor + ';' : ''};
9
+ `;
10
+ const TableWrapper = styled.div`
11
+ width: 100%;
12
+ table {
13
+ width: 100%;
14
+ border-spacing: 0;
15
+ font-family: 'Museo Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
16
+ font-size: 10pt;
17
+ text-overflow: ellipsis;
18
+
19
+ overflow: hidden;
20
+ overflow-wrap: break-word;
21
+ thead {
22
+ tr th {
23
+ border-bottom: 1px solid rgba(0, 0, 0, 0.05);
24
+ font-size: 10pt;
25
+ font-weight: 150;
26
+ color: rgb(102, 102, 102);
27
+ text-align: start;
28
+ user-select: none;
29
+ :first-child {
30
+ padding-left: 32px;
31
+ }
32
+ :last-child {
33
+ padding-right: 20px;
34
+ }
35
+ }
36
+ font-weight: 300;
37
+ border-bottom: 1px solid ${borderColor};
38
+ }
39
+
40
+ tbody {
41
+ tr {
42
+ :hover {
43
+ background-color: ${tableHoverColor};
44
+ cursor: pointer;
45
+ }
46
+ :last-child {
47
+ td {
48
+ border-bottom: 0;
49
+ }
50
+ }
51
+ td {
52
+ :first-child {
53
+ padding-left: 32px;
54
+ }
55
+ :last-child {
56
+ padding-right: 20px;
57
+ }
58
+ }
59
+ }
60
+ }
61
+
62
+ th,
63
+ td {
64
+ margin: 0;
65
+ padding: 0.25rem 12px;
66
+
67
+ :last-child {
68
+ border-right: 0;
69
+ }
70
+ }
71
+ }
72
+ `;
73
+ export const Table = ({ columns , data , onSelect , rowCursor , isActive })=>{
74
+ // Use the state and functions returned from useTable to build your UI
75
+ const { getTableProps , getTableBodyProps , headerGroups , rows , prepareRow } = useTable({
76
+ columns,
77
+ data
78
+ });
79
+ // Render the UI for your table
80
+ return /*#__PURE__*/ _jsx(TableWrapper, {
81
+ children: /*#__PURE__*/ _jsxs("table", {
82
+ ...getTableProps(),
83
+ children: [
84
+ /*#__PURE__*/ _jsx("thead", {
85
+ children: headerGroups.map((headerGroup, i)=>/*#__PURE__*/ _jsx("tr", {
86
+ ...headerGroup.getHeaderGroupProps(),
87
+ children: headerGroup.headers.map((column, i)=>/*#__PURE__*/ _jsx("th", {
88
+ ...column.getHeaderProps(),
89
+ children: column.render('Header')
90
+ }, i))
91
+ }, i))
92
+ }),
93
+ /*#__PURE__*/ _jsx("tbody", {
94
+ ...getTableBodyProps(),
95
+ children: rows.map((row, i)=>{
96
+ prepareRow(row);
97
+ return /*#__PURE__*/ _jsx(TrWrapper, {
98
+ "data-cy": 'table-row',
99
+ ...row.getRowProps(),
100
+ active: isActive ? isActive(row.original) : false,
101
+ cursor: rowCursor,
102
+ children: row.cells.map((cell, i)=>{
103
+ return /*#__PURE__*/ _jsx("td", {
104
+ onClick: ()=>typeof onSelect === 'function' && onSelect(row.original),
105
+ ...cell.getCellProps(),
106
+ children: cell.render('Cell')
107
+ }, i);
108
+ })
109
+ }, i);
110
+ })
111
+ })
112
+ ]
113
+ })
114
+ });
115
+ };
116
+ export { columnFactory } from './column.js';
@@ -0,0 +1,79 @@
1
+ // The main QIWI color
2
+ export const PRIMARY = '#ff8c00';
3
+ export const HOVER = '#FF8200';
4
+ export const BRAND = {
5
+ Primary: PRIMARY,
6
+ Secondary1: '#FF9E16',
7
+ Secondary2: '#FFB242',
8
+ Visa: '#1A1F71'
9
+ };
10
+ export const BACKGROUND = {
11
+ Primary: '#FFF',
12
+ Accented: '#F5F5F5',
13
+ Undercoat: '#F9F9F9',
14
+ Shadow: '#DDD',
15
+ Reject: '#f0dfcb',
16
+ Approved: '#dff0cb',
17
+ Pending: '#ffff99',
18
+ Balance: '#eff4fa',
19
+ ErrorLimit: '#fcf2f3',
20
+ REJECTBLOCK: '#fff6e9'
21
+ };
22
+ export const TEXT = {
23
+ Primary: '#000',
24
+ Secondary1: '#666',
25
+ Secondary2: '#999',
26
+ Secondary3: '#CCC',
27
+ Secondary4: '#EEE',
28
+ Error: '#D0021B',
29
+ Error2: '#9f2636',
30
+ Error1: '#ED4848',
31
+ Success: '#4BBD5C',
32
+ Success1: '#55D467'
33
+ };
34
+ export const LINK = {
35
+ Primary: '#0023A0'
36
+ };
37
+ export const LABEL = {};
38
+ export const STATUS = {
39
+ NEW: '#000',
40
+ ERROR: '#D0021B',
41
+ REJECTED: '#945623',
42
+ APPROVAL_PENDING: '#ff8f11',
43
+ COMPLETED: '#4BBD5C',
44
+ CASHIER_APPROVAL_PENDING: '#dd6d00',
45
+ ACCOUNTANT_APPROVAL_PENDING: '#ff8f11',
46
+ ACCOUNTANT_APPROVED: '#4BBD5C',
47
+ PAYMENT_PENDING: '#ff8f11'
48
+ };
49
+ export const BACKGROUND_COMMENT = {
50
+ NEW: '#ddd',
51
+ ERROR: '#fae6e9',
52
+ REJECTED: '#d0bba9',
53
+ APPROVAL_PENDING: '#ff8f11',
54
+ COMPLETED: '#4BBD5C',
55
+ CASHIER_APPROVAL_PENDING: '#fff2e2',
56
+ ACCOUNTANT_APPROVAL_PENDING: '#ff8f11',
57
+ ACCOUNTANT_APPROVED: '#4BBD5C',
58
+ PAYMENT_PENDING: '#ff8f11'
59
+ };
60
+ export const USER_STATUS = {
61
+ DRAFT: '#666',
62
+ INVITED: '#4566aa',
63
+ INVITE_EXPIRED: '#4566aa',
64
+ PHONE_CONFIRMED: '#4a7c11',
65
+ INVITE_PHONE_CONFIRMED: '#4a7c11',
66
+ VERIFIED: '#4a7c11',
67
+ BLOCKED: '#d0021b',
68
+ PHONE_NOT_CONFIRMED: '#ff9d26'
69
+ };
70
+ export const POINT_STATUS = {
71
+ ACTIVE: '#19aa11',
72
+ BLOCKED: '#666'
73
+ };
74
+ export const SHADOW = {
75
+ Z1: ' 0px 1px 2px rgba(0, 0, 0, 0.12)',
76
+ Z2: ' 0px 8px 16px rgba(0, 0, 0, 0.8)',
77
+ Z3: ' 0px 14px 32px rgba(0, 0, 0, 0.16)',
78
+ Z4: ' 0px 28px 52px rgba(0, 0, 0, 0.16)'
79
+ };
@@ -0,0 +1,8 @@
1
+ export const SITE_WIDTH = '1180px';
2
+ export const SITE_INVITE_WIDTH = '780px';
3
+ export const SPINNER_SIZE = '50px';
4
+ export default {
5
+ SITE_WIDTH,
6
+ SITE_INVITE_WIDTH,
7
+ SPINNER_SIZE
8
+ };
@@ -0,0 +1 @@
1
+ export const PRIMARY_OFFSET = '40px';
@@ -0,0 +1,3 @@
1
+ export * as COLOR from './color.js';
2
+ export * as TEXT from './text.js';
3
+ export * as DIMEN from './dimen.js';
@@ -0,0 +1,12 @@
1
+ export const FONT_SIZE = {
2
+ Big: 24,
3
+ Medium: 20,
4
+ Normal: 17,
5
+ Small: 16,
6
+ XSmall: 10
7
+ };
8
+ export const LINE_HEIGHT = 1.4;
9
+ export default {
10
+ FONT_SIZE,
11
+ LINE_HEIGHT
12
+ };
@@ -0,0 +1,43 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Path, Rect, Svg } from '@qiwi/pijma-core';
3
+ import React from 'react';
4
+ export const TrinaryCheckIcon = ({ focused , disabled , value })=>{
5
+ return /*#__PURE__*/ _jsxs(Svg, {
6
+ viewBox: "0 0 24 24",
7
+ width: "24px",
8
+ height: "24px",
9
+ children: [
10
+ /*#__PURE__*/ _jsx(Rect, {
11
+ width: "18",
12
+ height: "18",
13
+ x: "3",
14
+ y: "3",
15
+ rx: "3",
16
+ ry: "3",
17
+ fill: "#e6e6e6",
18
+ transition: "all 100ms cubic-bezier(0.4, 0.0, 0.2, 1)"
19
+ }),
20
+ /*#__PURE__*/ _jsx(Path, {
21
+ d: "M6 3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3zm1 2a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2H7z",
22
+ fill: focused && !disabled ? '#ff8c00' : 'transparent',
23
+ transition: "all 100ms cubic-bezier(0.4, 0.0, 0.2, 1)"
24
+ }),
25
+ /*#__PURE__*/ _jsx(Rect, {
26
+ width: "10",
27
+ height: "3",
28
+ x: "7",
29
+ y: "10.5",
30
+ fillRule: "nonzero",
31
+ rx: "1.5",
32
+ fill: value === 1 ? disabled ? '#ccc' : '#000' : 'transparent',
33
+ transition: "all 100ms cubic-bezier(0.4, 0.0, 0.2, 1)"
34
+ }),
35
+ /*#__PURE__*/ _jsx(Path, {
36
+ d: "M7.553 8.732a1.5 1.5 0 1 0-2.106 2.136l4.565 4.5a1.5 1.5 0 0 0 2.156-.051l9.957-10.8a1.5 1.5 0 1 0-2.206-2.034l-8.905 9.66-3.461-3.411z",
37
+ fill: value === 2 || value === true ? disabled ? '#ccc' : '#000' : 'transparent',
38
+ transition: "all 100ms cubic-bezier(0.4, 0.0, 0.2, 1)"
39
+ })
40
+ ]
41
+ });
42
+ };
43
+ export default TrinaryCheckIcon;
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Flex, Icon, styled } from '@qiwi/pijma-core';
3
+ import React, { Component } from 'react';
4
+ const IconWrapper = styled('div')`
5
+ width: 24px;
6
+ height: 24px;
7
+ float: left;
8
+ margin-left: 20px;
9
+ cursor: pointer;
10
+ `;
11
+ const ProfileWrapper = styled('div')``;
12
+ const Username = styled('div')``;
13
+ export class UserProfile extends Component {
14
+ render() {
15
+ const { onClick , userName } = this.props;
16
+ return /*#__PURE__*/ _jsx(ProfileWrapper, {
17
+ children: /*#__PURE__*/ _jsxs(Flex, {
18
+ children: [
19
+ /*#__PURE__*/ _jsx(Username, {
20
+ children: userName
21
+ }),
22
+ /*#__PURE__*/ _jsx(IconWrapper, {
23
+ onClick: onClick,
24
+ children: /*#__PURE__*/ _jsx(Icon, {
25
+ name: "logout"
26
+ })
27
+ })
28
+ ]
29
+ })
30
+ });
31
+ }
32
+ }
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import renderer from 'react-test-renderer';
4
+ import { Amount } from '../main/index.js';
5
+ describe('Amount', ()=>{
6
+ it('is properly exported from lib index', ()=>{
7
+ expect(Amount).not.toBeUndefined();
8
+ });
9
+ it('renders correctly', ()=>{
10
+ const amount = renderer.create(/*#__PURE__*/ _jsx(Amount, {
11
+ value: "100000",
12
+ currency: "RUB"
13
+ })).toJSON();
14
+ expect(amount).toMatchSnapshot();
15
+ });
16
+ });
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import renderer from 'react-test-renderer';
4
+ import { Checkbox } from '../main/index.js';
5
+ describe('Checkbox', ()=>{
6
+ it('is properly exported from lib index', ()=>{
7
+ expect(Checkbox).not.toBeUndefined();
8
+ });
9
+ it('renders correctly unchecked value in trinary mode', ()=>{
10
+ const checkbox = renderer.create(/*#__PURE__*/ _jsx(Checkbox, {
11
+ value: 0,
12
+ trinary: true
13
+ })).toJSON();
14
+ expect(checkbox).toMatchSnapshot();
15
+ });
16
+ it('renders correctly half-checked value in trinary mode', ()=>{
17
+ const checkbox = renderer.create(/*#__PURE__*/ _jsx(Checkbox, {
18
+ value: 1,
19
+ trinary: true
20
+ })).toJSON();
21
+ expect(checkbox).toMatchSnapshot();
22
+ });
23
+ it('renders correctly checked value in trinary mode', ()=>{
24
+ const checkbox = renderer.create(/*#__PURE__*/ _jsx(Checkbox, {
25
+ value: 2,
26
+ trinary: true
27
+ })).toJSON();
28
+ expect(checkbox).toMatchSnapshot();
29
+ });
30
+ it('renders correctly unchecked value', ()=>{
31
+ const checkbox = renderer.create(/*#__PURE__*/ _jsx(Checkbox, {
32
+ value: false
33
+ })).toJSON();
34
+ expect(checkbox).toMatchSnapshot();
35
+ });
36
+ it('renders correctly checked value', ()=>{
37
+ const checkbox = renderer.create(/*#__PURE__*/ _jsx(Checkbox, {
38
+ value: true
39
+ })).toJSON();
40
+ expect(checkbox).toMatchSnapshot();
41
+ });
42
+ });