@megafon/ui-core 9.4.0 → 9.4.1-old-ui-images

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 (133) hide show
  1. package/dist/es/components/Accordion/Accordion.js +3 -1
  2. package/dist/es/components/Badges/CounterBadge/CounterBadge.js +1 -1
  3. package/dist/es/components/Badges/InfoBadge/InfoBadge.js +16 -28
  4. package/dist/es/components/Badges/PriceBadge/PriceBadge.js +16 -28
  5. package/dist/es/components/Badges/PromoBadge/PromoBadge.js +0 -1
  6. package/dist/es/components/Badges/StatusBadge/StatusBadge.js +9 -13
  7. package/dist/es/components/Badges/TimerBadge/TimerBadge.js +1 -3
  8. package/dist/es/components/Buttons/Button/Button.js +1 -1
  9. package/dist/es/components/Buttons/ButtonClose/ButtonClose.js +2 -1
  10. package/dist/es/components/Calendar/components/_Month/Month.js +6 -2
  11. package/dist/es/components/Checkbox/Checkbox.js +1 -1
  12. package/dist/es/components/Chips/Chips/Chip.js +6 -2
  13. package/dist/es/components/ContentView/ContentView.css +1 -1
  14. package/dist/es/components/ContentView/ContentView.d.ts +1 -1
  15. package/dist/es/components/ContentView/img/alarm.png +0 -0
  16. package/dist/es/components/ContentView/img/empty.png +0 -0
  17. package/dist/es/components/ContentView/img/error.png +0 -0
  18. package/dist/es/components/ContentView/img/fail.png +0 -0
  19. package/dist/es/components/ContentView/img/searchNoResult.png +0 -0
  20. package/dist/es/components/ContentView/img/submit.png +0 -0
  21. package/dist/es/components/ContentView/img/success.png +0 -0
  22. package/dist/es/components/ContentView/img/update.png +0 -0
  23. package/dist/es/components/ContentView/img/waiting.png +0 -0
  24. package/dist/es/components/Counter/Counter.js +2 -2
  25. package/dist/es/components/ErrorLoad/ErrorLoad.js +3 -1
  26. package/dist/es/components/ListData/ListData.js +13 -9
  27. package/dist/es/components/ListData/components/ListDataSortable.js +3 -1
  28. package/dist/es/components/Modal/Modal.js +3 -27
  29. package/dist/es/components/Modal/_ModalContent/ModalContent.js +3 -2
  30. package/dist/es/components/Modal/_ModalMobile/ModalMobile.css +1 -1
  31. package/dist/es/components/Modal/_ModalMobile/ModalMobile.d.ts +0 -1
  32. package/dist/es/components/Modal/_ModalMobile/ModalMobile.js +4 -9
  33. package/dist/es/components/Modal/utils/utils.d.ts +0 -1
  34. package/dist/es/components/Modal/utils/utils.js +2 -3
  35. package/dist/es/components/MultipleSelect/MultipleSelect.js +5 -2
  36. package/dist/es/components/NavArrow/NavArrow.js +4 -4
  37. package/dist/es/components/Notification/Notification.js +9 -13
  38. package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +4 -2
  39. package/dist/es/components/Parameter/Parameter.js +1 -3
  40. package/dist/es/components/Row/Row.js +1 -1
  41. package/dist/es/components/Search/Search.js +3 -3
  42. package/dist/es/components/SectionAccordionGroup/SectionAccordionGroup.js +3 -1
  43. package/dist/es/components/Snackbar/Snackbar.js +6 -10
  44. package/dist/es/components/Stepper/Stepper.js +1 -1
  45. package/dist/es/components/Switcher/Switcher.js +1 -3
  46. package/dist/es/components/Tabs/Tabs.js +1 -1
  47. package/dist/es/components/TextField/TextField.js +7 -13
  48. package/dist/es/components/Tooltip/Tooltip.js +3 -5
  49. package/dist/es/components/UploadForm/UploadField/components/_UploadFieldDropArea/UploadFieldDropArea.js +1 -5
  50. package/dist/es/components/UploadForm/UploadFileItem/UploadFileItem.js +4 -3
  51. package/dist/es/components/UploadForm/UploadFileItem/components/_UploadFileItemIcon/UploadFileItemIcon.js +0 -6
  52. package/dist/es/index.d.ts +0 -1
  53. package/dist/es/index.js +0 -1
  54. package/dist/lib/components/Accordion/Accordion.js +3 -1
  55. package/dist/lib/components/Badges/CounterBadge/CounterBadge.js +1 -1
  56. package/dist/lib/components/Badges/InfoBadge/InfoBadge.js +16 -28
  57. package/dist/lib/components/Badges/PriceBadge/PriceBadge.js +16 -28
  58. package/dist/lib/components/Badges/PromoBadge/PromoBadge.js +0 -1
  59. package/dist/lib/components/Badges/StatusBadge/StatusBadge.js +9 -13
  60. package/dist/lib/components/Badges/TimerBadge/TimerBadge.js +1 -3
  61. package/dist/lib/components/Buttons/Button/Button.js +1 -1
  62. package/dist/lib/components/Buttons/ButtonClose/ButtonClose.js +2 -1
  63. package/dist/lib/components/Calendar/components/_Month/Month.js +6 -2
  64. package/dist/lib/components/Checkbox/Checkbox.js +1 -1
  65. package/dist/lib/components/Chips/Chips/Chip.js +6 -2
  66. package/dist/lib/components/ContentView/ContentView.css +1 -1
  67. package/dist/lib/components/ContentView/ContentView.d.ts +1 -1
  68. package/dist/lib/components/ContentView/img/alarm.png +0 -0
  69. package/dist/lib/components/ContentView/img/empty.png +0 -0
  70. package/dist/lib/components/ContentView/img/error.png +0 -0
  71. package/dist/lib/components/ContentView/img/fail.png +0 -0
  72. package/dist/lib/components/ContentView/img/searchNoResult.png +0 -0
  73. package/dist/lib/components/ContentView/img/submit.png +0 -0
  74. package/dist/lib/components/ContentView/img/success.png +0 -0
  75. package/dist/lib/components/ContentView/img/update.png +0 -0
  76. package/dist/lib/components/ContentView/img/waiting.png +0 -0
  77. package/dist/lib/components/Counter/Counter.js +2 -2
  78. package/dist/lib/components/ErrorLoad/ErrorLoad.js +3 -1
  79. package/dist/lib/components/ListData/ListData.js +13 -9
  80. package/dist/lib/components/ListData/components/ListDataSortable.js +3 -1
  81. package/dist/lib/components/Modal/Modal.js +3 -27
  82. package/dist/lib/components/Modal/_ModalContent/ModalContent.js +3 -2
  83. package/dist/lib/components/Modal/_ModalMobile/ModalMobile.css +1 -1
  84. package/dist/lib/components/Modal/_ModalMobile/ModalMobile.d.ts +0 -1
  85. package/dist/lib/components/Modal/_ModalMobile/ModalMobile.js +4 -9
  86. package/dist/lib/components/Modal/utils/utils.d.ts +0 -1
  87. package/dist/lib/components/Modal/utils/utils.js +2 -3
  88. package/dist/lib/components/MultipleSelect/MultipleSelect.js +5 -2
  89. package/dist/lib/components/NavArrow/NavArrow.js +4 -4
  90. package/dist/lib/components/Notification/Notification.js +9 -13
  91. package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +4 -2
  92. package/dist/lib/components/Parameter/Parameter.js +1 -3
  93. package/dist/lib/components/Row/Row.js +1 -1
  94. package/dist/lib/components/Search/Search.js +3 -3
  95. package/dist/lib/components/SectionAccordionGroup/SectionAccordionGroup.js +3 -1
  96. package/dist/lib/components/Snackbar/Snackbar.js +6 -10
  97. package/dist/lib/components/Stepper/Stepper.js +1 -1
  98. package/dist/lib/components/Switcher/Switcher.js +1 -3
  99. package/dist/lib/components/Tabs/Tabs.js +1 -1
  100. package/dist/lib/components/TextField/TextField.js +7 -13
  101. package/dist/lib/components/Tooltip/Tooltip.js +3 -5
  102. package/dist/lib/components/UploadForm/UploadField/components/_UploadFieldDropArea/UploadFieldDropArea.js +1 -5
  103. package/dist/lib/components/UploadForm/UploadFileItem/UploadFileItem.js +4 -3
  104. package/dist/lib/components/UploadForm/UploadFileItem/components/_UploadFileItemIcon/UploadFileItemIcon.js +0 -6
  105. package/dist/lib/index.d.ts +0 -1
  106. package/dist/lib/index.js +0 -7
  107. package/package.json +3 -4
  108. package/dist/es/components/ContentView/img/info.png +0 -0
  109. package/dist/es/components/Modal/utils/usePreventScroll.d.ts +0 -17
  110. package/dist/es/components/Modal/utils/usePreventScroll.js +0 -252
  111. package/dist/es/hooks/useEvent.d.ts +0 -3
  112. package/dist/es/hooks/useEvent.js +0 -11
  113. package/dist/es/hooks/useLatest.d.ts +0 -2
  114. package/dist/es/hooks/useLatest.js +0 -8
  115. package/dist/es/hooks/useVisualViewport.d.ts +0 -10
  116. package/dist/es/hooks/useVisualViewport.js +0 -55
  117. package/dist/es/utils/browser.d.ts +0 -7
  118. package/dist/es/utils/browser.js +0 -30
  119. package/dist/es/utils/is.d.ts +0 -19
  120. package/dist/es/utils/is.js +0 -70
  121. package/dist/lib/components/ContentView/img/info.png +0 -0
  122. package/dist/lib/components/Modal/utils/usePreventScroll.d.ts +0 -17
  123. package/dist/lib/components/Modal/utils/usePreventScroll.js +0 -263
  124. package/dist/lib/hooks/useEvent.d.ts +0 -3
  125. package/dist/lib/hooks/useEvent.js +0 -17
  126. package/dist/lib/hooks/useLatest.d.ts +0 -2
  127. package/dist/lib/hooks/useLatest.js +0 -14
  128. package/dist/lib/hooks/useVisualViewport.d.ts +0 -10
  129. package/dist/lib/hooks/useVisualViewport.js +0 -62
  130. package/dist/lib/utils/browser.d.ts +0 -7
  131. package/dist/lib/utils/browser.js +0 -42
  132. package/dist/lib/utils/is.d.ts +0 -19
  133. package/dist/lib/utils/is.js +0 -92
@@ -31,7 +31,7 @@ var ArrowLeft = function ArrowLeft(props) {
31
31
  return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
32
32
  viewBox: "0 0 20 20"
33
33
  }, props), /*#__PURE__*/React.createElement("path", {
34
- d: "M8.502 5.304a1 1 0 011.436 1.392L7.713 8.993H14.5a1 1 0 110 2H7.7l2.238 2.31a1 1 0 01-1.436 1.393l-3.61-3.726a1.396 1.396 0 010-1.94l3.61-3.726z"
34
+ d: "M12 13l-3-3 3-3-1-1-4 4 4 4z"
35
35
  }));
36
36
  };
37
37
  var Swiper = null;
@@ -30,43 +30,37 @@ var Hide = function Hide(props) {
30
30
  return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
31
31
  viewBox: "0 0 32 32"
32
32
  }, props), /*#__PURE__*/React.createElement("path", {
33
- fillRule: "evenodd",
34
- clipRule: "evenodd",
35
- d: "M23.036 7.588c.553-.55 1.45-.55 2.004 0a1.4 1.4 0 01-.001 1.99l-1.221 1.21c.464.367.907.771 1.324 1.213l2.306 2.441c.74.784.736 1.995-.01 2.774l-2.335 2.437c-3.536 3.69-8.827 4.73-13.353 3.123l-1.646 1.636c-.553.55-1.45.55-2.003 0a1.401 1.401 0 010-1.99L23.036 7.588zm-7.865 11.79c.268.054.545.084.83.084 2.339 0 4.235-1.884 4.235-4.208 0-.282-.03-.558-.083-.824l-4.982 4.949z"
36
- }), /*#__PURE__*/React.createElement("path", {
37
- d: "M6.832 12c3.113-3.295 7.619-4.511 11.76-3.65l-2.719 2.699c-2.238.065-4.04 1.855-4.105 4.079L7.06 19.806a12.697 12.697 0 01-.168-.172l-2.334-2.448a2.005 2.005 0 01-.007-2.771l2.28-2.414z"
33
+ d: "M5.82 17.45l-1.65 2.31L5.8 21l1.65-2.3a15.9 15.9 0 002.67 1.3l-.87 2.71 1.92.63.86-2.7a15.64 15.64 0 003 .48V24h2v-2.84a15.64 15.64 0 003-.48l.86 2.7 1.92-.63-.93-2.75a15.9 15.9 0 002.67-1.38L26.2 21l1.63-1.2-1.65-2.31a16.16 16.16 0 001.82-1.8l-1.51-1.35a13.8 13.8 0 01-21 0L4 15.69a16.15 16.15 0 001.82 1.76zM23 11.92l1-1.77a16 16 0 00-16 0l1 1.77a14 14 0 0114 0z"
38
34
  }));
39
35
  };
40
36
  var Show = function Show(props) {
41
37
  return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
42
38
  viewBox: "0 0 32 32"
43
39
  }, props), /*#__PURE__*/React.createElement("path", {
44
- fillRule: "evenodd",
45
- clipRule: "evenodd",
46
- d: "M6.833 12.31c4.936-5.08 13.373-5.08 18.31 0l2.305 2.373a1.91 1.91 0 01-.01 2.698l-2.335 2.369c-4.933 5.007-13.287 4.999-18.209-.019l-2.335-2.38a1.91 1.91 0 01-.007-2.693l2.28-2.348zM16 10.45a5.55 5.55 0 100 11.101 5.55 5.55 0 000-11.101z"
40
+ d: "M26 11.69l1.73-2-1.49-1.34-1.82 2.15a15.67 15.67 0 00-2.59-1.34l1.1-2.8-1.86-.73-1.14 2.9A15.53 15.53 0 0017 8.07V5h-2v3.07a15.53 15.53 0 00-2.93.47l-1.14-2.9-1.86.73 1.1 2.8a15.67 15.67 0 00-2.59 1.33L5.76 8.35l-1.52 1.3 1.73 2A19.78 19.78 0 004 13.5L5.46 15A13.72 13.72 0 0116 10a13.55 13.55 0 0110.52 5L28 13.5a19.78 19.78 0 00-2-1.81z"
47
41
  }), /*#__PURE__*/React.createElement("path", {
48
- d: "M18.824 13.273c0 .753-.633 1.364-1.412 1.364-.78 0-1.412-.611-1.412-1.364 0-.753.632-1.364 1.412-1.364.78 0 1.412.61 1.412 1.364z"
42
+ d: "M20 16a4 4 0 10-4 4 4 4 0 004-4zm-6 0a2 2 0 112 2 2 2 0 01-2-2z"
49
43
  }));
50
44
  };
51
45
  var ClearIcon = function ClearIcon(props) {
52
46
  return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
53
47
  viewBox: "0 0 32 32"
54
48
  }, props), /*#__PURE__*/React.createElement("path", {
55
- d: "M9.405 9.402a1.558 1.558 0 012.201 0l4.348 4.344 4.337-4.333a1.555 1.555 0 112.201 2.2l-4.338 4.331 4.339 4.335a1.555 1.555 0 11-2.201 2.2l-4.34-4.336-4.348 4.346a1.554 1.554 0 11-2.2-2.2l4.348-4.344L9.405 11.6a1.554 1.554 0 010-2.2z"
49
+ className: "ClearIcon__st0",
50
+ d: "M16 14.5L11.5 10 10 11.5l4.5 4.5-4.5 4.5 1.5 1.5 4.5-4.5 4.5 4.5 1.5-1.5-4.5-4.5 4.5-4.5-1.5-1.5-4.5 4.5z"
56
51
  }));
57
52
  };
58
53
  var CheckedIcon = function CheckedIcon(props) {
59
54
  return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
60
55
  viewBox: "0 0 32 32"
61
56
  }, props), /*#__PURE__*/React.createElement("path", {
62
- d: "M11.033 15.1l3.39 3.39 6.817-6.742c.578-.572 1.483-.595 2.02-.051.538.544.504 1.449-.075 2.021l-7.858 7.773c-.576.57-1.476.595-2.015.056L8.95 17.185c-.54-.541-.512-1.446.063-2.021.576-.576 1.48-.604 2.021-.063z"
57
+ d: "M22.2 9l-7.8 9.4-3.6-3.7L9 16.5c3.6 3.7 5.4 5.5 5.5 5.5.1 0 3.3-3.8 9.5-11.3L22.2 9z"
63
58
  }));
64
59
  };
65
60
  var ResizeIcon = function ResizeIcon(props) {
66
61
  return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
67
62
  width: 12,
68
- height: 12,
69
- viewBox: "0 0 12 12"
63
+ height: 12
70
64
  }, props), /*#__PURE__*/React.createElement("path", {
71
65
  d: "M1 11L11 1M7 11l4-4"
72
66
  }));
@@ -21,14 +21,13 @@ var RightArrow = function RightArrow(props) {
21
21
  return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
22
22
  viewBox: "0 0 20 20"
23
23
  }, props), /*#__PURE__*/React.createElement("path", {
24
- d: "M10.084 5.282a1 1 0 011.414.022l3.61 3.726c.522.54.523 1.4 0 1.94l-3.61 3.726a1 1 0 01-1.436-1.392l2.225-2.297H5.5a1 1 0 010-2h6.8l-2.239-2.31a1 1 0 01.023-1.415z"
24
+ d: "M8 13l3-3-3-3 1-1 4 4-4 4z"
25
25
  }));
26
26
  };
27
27
  var ArrowWithContour = function ArrowWithContour(props) {
28
28
  return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
29
29
  width: 32,
30
- height: 12,
31
- viewBox: "0 0 32 12"
30
+ height: 12
32
31
  }, props), /*#__PURE__*/React.createElement("path", {
33
32
  fillRule: "evenodd",
34
33
  clipRule: "evenodd",
@@ -42,8 +41,7 @@ var ArrowWithContour = function ArrowWithContour(props) {
42
41
  var Arrow = function Arrow(props) {
43
42
  return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
44
43
  width: 42,
45
- height: 12,
46
- viewBox: "0 0 42 12"
44
+ height: 12
47
45
  }, props), /*#__PURE__*/React.createElement("path", {
48
46
  fillRule: "evenodd",
49
47
  clipRule: "evenodd",
@@ -20,11 +20,7 @@ var CloudUpload = function CloudUpload(props) {
20
20
  return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
21
21
  viewBox: "0 0 40 40"
22
22
  }, props), /*#__PURE__*/React.createElement("path", {
23
- fillRule: "evenodd",
24
- clipRule: "evenodd",
25
- d: "M19.28 24.394a.93.93 0 011.424 0l2.822 3.337c.526.622.094 1.59-.712 1.59h-.947v2.44c0 1.06-.84 1.92-1.876 1.92-1.037 0-1.88-.86-1.88-1.92v-2.44h-.942a.933.933 0 01-.89-.655c-.003-.01-.01-.02-.013-.03a1.01 1.01 0 01-.038-.235.955.955 0 01.228-.67l2.823-3.337z"
26
- }), /*#__PURE__*/React.createElement("path", {
27
- d: "M19.011 8.68c3.733 0 6.898 2.484 8.013 5.926.47-.094.956-.144 1.454-.144 4.154 0 7.522 3.436 7.522 7.677 0 4.24-3.368 7.678-7.522 7.678-.86 0-1.719.004-2.578.01-.293 0-.483-.322-.396-.601a2.876 2.876 0 00-.554-2.752l-2.821-3.336a2.784 2.784 0 00-4.052-.235l-.22.233-2.824 3.337a2.873 2.873 0 00-.552 2.756c.088.279-.1.6-.393.6H9.344v-.018C6.367 29.653 4 27.141 4 24.061c0-3.18 2.526-5.758 5.642-5.758.337 0 .667.03.989.088a8.959 8.959 0 01-.063-1.058c0-4.779 3.78-8.652 8.443-8.652z"
23
+ d: "M19 36V22l-2.38 3.9-1.71-1L19 18h1.88l4.14 6.85-1.71 1L21 22v14zM8.21 32H14v-2H8.21A4.27 4.27 0 014 25.6a4.27 4.27 0 014.21-4.4h2.07V18a9.94 9.94 0 019.66-10 9.94 9.94 0 019.66 10v1h1a5.49 5.49 0 010 11H26v2h4.6a7.49 7.49 0 001-14.91A11.94 11.94 0 0019.94 6 11.94 11.94 0 008.27 18v1.16h-.06A6.27 6.27 0 002 25.6 6.27 6.27 0 008.21 32z"
28
24
  }));
29
25
  };
30
26
  var cn = (0, _uiHelpers.cnCreate)('mfui-9-upload-field-drop-area');
@@ -19,16 +19,17 @@ var DownloadIcon = function DownloadIcon(props) {
19
19
  return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
20
20
  viewBox: "0 0 32 32"
21
21
  }, props), /*#__PURE__*/React.createElement("path", {
22
- d: "M26.4 14.507a1.6 1.6 0 011.601 1.6c0 1.5-.318 2.984-.93 4.363a11.295 11.295 0 01-2.625 3.67 12.08 12.08 0 01-3.888 2.427 12.67 12.67 0 01-9.115 0 12.083 12.083 0 01-3.888-2.427 11.295 11.295 0 01-2.625-3.67A10.75 10.75 0 014 16.107a1.6 1.6 0 113.2 0c0 1.048.22 2.09.653 3.065a8.097 8.097 0 001.884 2.63 8.881 8.881 0 002.86 1.78 9.453 9.453 0 003.403.631 9.45 9.45 0 003.402-.63 8.883 8.883 0 002.86-1.782 8.096 8.096 0 001.883-2.629 7.55 7.55 0 00.655-3.065 1.6 1.6 0 011.6-1.6z"
22
+ d: "M15.04 5.99L14.97 17l-1.26-1.49-1.42 1.41L15.37 20h1.26l3.08-3.08-1.42-1.41-1.32 1.55.07-11.05-2-.02z"
23
23
  }), /*#__PURE__*/React.createElement("path", {
24
- d: "M16 6.418a1.6 1.6 0 011.6 1.6v5.813l2.062-2.085a1.6 1.6 0 012.275 2.25l-4.231 4.278-.183.167a2.4 2.4 0 01-3.047 0l-.183-.167-4.23-4.278a1.6 1.6 0 112.275-2.25L14.4 13.83V8.018a1.6 1.6 0 011.6-1.6z"
24
+ d: "M8 17H6a10 10 0 0020 0h-2a8 8 0 01-16 0z"
25
25
  }));
26
26
  };
27
27
  var CancelIcon = function CancelIcon(props) {
28
28
  return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
29
29
  viewBox: "0 0 32 32"
30
30
  }, props), /*#__PURE__*/React.createElement("path", {
31
- d: "M9.405 9.402a1.558 1.558 0 012.201 0l4.348 4.344 4.337-4.333a1.555 1.555 0 112.201 2.2l-4.338 4.331 4.339 4.335a1.555 1.555 0 11-2.201 2.2l-4.34-4.336-4.348 4.346a1.554 1.554 0 11-2.2-2.2l4.348-4.344L9.405 11.6a1.554 1.554 0 010-2.2z"
31
+ className: "CancelIcon__st0",
32
+ d: "M16 14.5L11.5 10 10 11.5l4.5 4.5-4.5 4.5 1.5 1.5 4.5-4.5 4.5 4.5 1.5-1.5-4.5-4.5 4.5-4.5-1.5-1.5-4.5 4.5z"
32
33
  }));
33
34
  };
34
35
  var MAX_PROGRESS = 100;
@@ -15,7 +15,6 @@ var AttachIcon = function AttachIcon(props) {
15
15
  return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
16
16
  width: 32,
17
17
  height: 32,
18
- viewBox: "0 0 32 32",
19
18
  fill: "none"
20
19
  }, props), /*#__PURE__*/React.createElement("path", {
21
20
  d: "M25.538 8.297c-.944-.997-2.2-1.547-3.535-1.547-1.336 0-2.591.55-3.536 1.547l-7.881 8.325c-1.17 1.236-1.17 3.246 0 4.482a2.891 2.891 0 004.242 0l5.19-5.482c.39-.413.39-1.082 0-1.494a.963.963 0 00-1.414 0l-5.19 5.482a.964.964 0 01-1.414 0 1.1 1.1 0 010-1.494l7.881-8.325a2.902 2.902 0 012.122-.928c.8 0 1.554.33 2.12.928 1.17 1.236 1.17 3.246 0 4.481l-8.588 9.072c-1.95 2.06-5.121 2.06-7.07 0A5.4 5.4 0 017 19.61a5.4 5.4 0 011.464-3.735l8.589-9.072c.39-.412.39-1.081 0-1.494a.963.963 0 00-1.414 0L7.05 14.382C5.728 15.778 5 17.635 5 19.61c0 1.975.728 3.832 2.05 5.228C8.415 26.28 10.207 27 12 27c1.792 0 3.585-.72 4.95-2.162l8.588-9.072c1.95-2.06 1.95-5.41 0-7.469z",
@@ -26,7 +25,6 @@ var ExcelIcon = function ExcelIcon(props) {
26
25
  return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
27
26
  width: 32,
28
27
  height: 32,
29
- viewBox: "0 0 32 32",
30
28
  fill: "none"
31
29
  }, props), /*#__PURE__*/React.createElement("path", {
32
30
  d: "M8 3a1 1 0 011-1h10v7H8V3z",
@@ -96,7 +94,6 @@ var ImageIcon = function ImageIcon(props) {
96
94
  return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
97
95
  width: 32,
98
96
  height: 32,
99
- viewBox: "0 0 32 32",
100
97
  fill: "none"
101
98
  }, props), /*#__PURE__*/React.createElement("path", {
102
99
  d: "M5.21 2.058h21.578c1.74 0 3.154 1.508 3.154 3.366V26.58c0 1.855-1.414 3.362-3.154 3.362H5.21c-1.74 0-3.152-1.507-3.152-3.362V5.424c0-1.858 1.413-3.366 3.152-3.366zm6.7 5.181c-1.681 0-3.045 1.28-3.045 3.074 0 1.795 1.364 2.946 3.046 2.946 1.682 0 3.046-1.151 3.046-2.946 0-1.794-1.364-3.074-3.046-3.074zM6.2 26.832h19.165c.841 0 1.216-.65.836-1.45L21.758 15.13c-.378-.801-1.527-.713-2.038 0l-5.615 6.374c-.511.713-1.21.634-2.03.223l-2.811-1.493c-.408-.28-1.171-.544-1.654.191L5.55 25.5c-.481.736-.191 1.332.65 1.332z",
@@ -107,7 +104,6 @@ var PdfIcon = function PdfIcon(props) {
107
104
  return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
108
105
  width: 32,
109
106
  height: 32,
110
- viewBox: "0 0 32 32",
111
107
  fill: "none"
112
108
  }, props), /*#__PURE__*/React.createElement("circle", {
113
109
  cx: 16,
@@ -125,7 +121,6 @@ var PowerIcon = function PowerIcon(props) {
125
121
  return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
126
122
  width: 32,
127
123
  height: 32,
128
- viewBox: "0 0 32 32",
129
124
  fill: "none"
130
125
  }, props), /*#__PURE__*/React.createElement("circle", {
131
126
  cx: 17,
@@ -188,7 +183,6 @@ var WordIcon = function WordIcon(props) {
188
183
  return /*#__PURE__*/React.createElement("svg", (0, _extends2["default"])({
189
184
  width: 32,
190
185
  height: 32,
191
- viewBox: "0 0 32 32",
192
186
  fill: "none"
193
187
  }, props), /*#__PURE__*/React.createElement("path", {
194
188
  d: "M8 3a1 1 0 011-1h20a1 1 0 011 1v6H8V3z",
@@ -89,6 +89,5 @@ export { default as UploadFileItemIcon } from './components/UploadForm/UploadFil
89
89
  export { default as useDragAndDrop } from './components/UploadForm/UploadField/components/useDragAndDrop';
90
90
  export { default as useGradient } from './components/Carousel/useGradient';
91
91
  export { default as usePagination } from './components/Pagination/usePagination';
92
- export { default as usePreventScroll } from './components/Modal/utils/usePreventScroll';
93
92
  export { default as utils } from './components/Modal/utils/utils';
94
93
  export { default as ValueField } from './components/ValueField/ValueField';
package/dist/lib/index.js CHANGED
@@ -555,12 +555,6 @@ Object.defineProperty(exports, "usePagination", {
555
555
  return _usePagination["default"];
556
556
  }
557
557
  });
558
- Object.defineProperty(exports, "usePreventScroll", {
559
- enumerable: true,
560
- get: function get() {
561
- return _usePreventScroll["default"];
562
- }
563
- });
564
558
  Object.defineProperty(exports, "utils", {
565
559
  enumerable: true,
566
560
  get: function get() {
@@ -658,7 +652,6 @@ var _UploadFileItemIcon = _interopRequireDefault(require("./components/UploadFor
658
652
  var _useDragAndDrop = _interopRequireDefault(require("./components/UploadForm/UploadField/components/useDragAndDrop"));
659
653
  var _useGradient = _interopRequireDefault(require("./components/Carousel/useGradient"));
660
654
  var _usePagination = _interopRequireDefault(require("./components/Pagination/usePagination"));
661
- var _usePreventScroll = _interopRequireDefault(require("./components/Modal/utils/usePreventScroll"));
662
655
  var _utils = _interopRequireDefault(require("./components/Modal/utils/utils"));
663
656
  var _ValueField = _interopRequireDefault(require("./components/ValueField/ValueField"));
664
657
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@megafon/ui-core",
3
- "version": "9.4.0",
3
+ "version": "9.4.1-old-ui-images",
4
4
  "files": [
5
5
  "dist",
6
6
  "styles"
@@ -50,7 +50,7 @@
50
50
  "@babel/preset-env": "^7.8.6",
51
51
  "@babel/preset-react": "^7.8.3",
52
52
  "@babel/preset-typescript": "^7.8.3",
53
- "@megafon/ui-icons": "^4.0.1",
53
+ "@megafon/ui-icons": "^3.16.0",
54
54
  "@svgr/core": "^2.4.1",
55
55
  "@testing-library/jest-dom": "^6.5.0",
56
56
  "@testing-library/react": "^16.0.1",
@@ -103,6 +103,5 @@
103
103
  "simplebar": "^6.2.6",
104
104
  "simplebar-react": "^3.2.5",
105
105
  "swiper": "^12.1.2"
106
- },
107
- "gitHead": "c28ce3fb0ec00755000ff405a4ae1efe950064fb"
106
+ }
108
107
  }
@@ -1,17 +0,0 @@
1
- import { useEffect } from 'react';
2
- export declare const useIsomorphicLayoutEffect: typeof useEffect;
3
- interface PreventScrollOptions {
4
- /** Whether the scroll lock is disabled. */
5
- isDisabled?: boolean;
6
- focusCallback?: () => void;
7
- }
8
- export declare function isScrollable(node: Element): boolean;
9
- export declare function getScrollParent(node: Element): Element;
10
- /**
11
- * Prevents scrolling on the document body on mount, and
12
- * restores it on unmount. Also ensures that content does not
13
- * shift due to the scrollbars disappearing.
14
- */
15
- declare function usePreventScroll(options?: PreventScrollOptions): void;
16
- export declare function isInput(target: Element): boolean;
17
- export default usePreventScroll;
@@ -1,252 +0,0 @@
1
- import "core-js/modules/es.array.iterator.js";
2
- import "core-js/modules/es.object.to-string.js";
3
- import "core-js/modules/es.regexp.exec.js";
4
- import "core-js/modules/es.regexp.test.js";
5
- import "core-js/modules/es.set.js";
6
- import "core-js/modules/es.string.iterator.js";
7
- import "core-js/modules/web.dom-collections.iterator.js";
8
- // This code comes from https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/overlays/src/usePreventScroll.ts
9
- /* eslint-disable */
10
- import { useEffect, useLayoutEffect } from 'react';
11
- import { isIOS } from "../../../utils/browser";
12
- var KEYBOARD_BUFFER = 24;
13
- export var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;
14
- function chain() {
15
- for (var _len = arguments.length, callbacks = new Array(_len), _key = 0; _key < _len; _key++) {
16
- callbacks[_key] = arguments[_key];
17
- }
18
- return function () {
19
- for (var _i = 0, _callbacks = callbacks; _i < _callbacks.length; _i++) {
20
- var callback = _callbacks[_i];
21
- if (typeof callback === 'function') {
22
- callback.apply(void 0, arguments);
23
- }
24
- }
25
- };
26
- }
27
- // @ts-ignore
28
- var visualViewport = typeof document !== 'undefined' && window.visualViewport;
29
- export function isScrollable(node) {
30
- var style = window.getComputedStyle(node);
31
- return /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
32
- }
33
- export function getScrollParent(node) {
34
- if (isScrollable(node)) {
35
- node = node.parentElement;
36
- }
37
- while (node && !isScrollable(node)) {
38
- node = node.parentElement;
39
- }
40
- return node || document.scrollingElement || document.documentElement;
41
- }
42
- // HTML input types that do not cause the software keyboard to appear.
43
- var nonTextInputTypes = new Set(['checkbox', 'radio', 'range', 'color', 'file', 'image', 'button', 'submit', 'reset']);
44
- // The number of active usePreventScroll calls. Used to determine whether to revert back to the original page style/scroll position
45
- var preventScrollCount = 0;
46
- var restore;
47
- /**
48
- * Prevents scrolling on the document body on mount, and
49
- * restores it on unmount. Also ensures that content does not
50
- * shift due to the scrollbars disappearing.
51
- */
52
- function usePreventScroll() {
53
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
54
- var isDisabled = options.isDisabled;
55
- useIsomorphicLayoutEffect(function () {
56
- if (isDisabled) {
57
- return;
58
- }
59
- preventScrollCount++;
60
- if (preventScrollCount === 1) {
61
- if (isIOS()) {
62
- restore = preventScrollMobileSafari();
63
- }
64
- }
65
- return function () {
66
- preventScrollCount--;
67
- if (preventScrollCount === 0) {
68
- restore === null || restore === void 0 ? void 0 : restore();
69
- }
70
- };
71
- }, [isDisabled]);
72
- }
73
- // Mobile Safari is a whole different beast. Even with overflow: hidden,
74
- // it still scrolls the page in many situations:
75
- //
76
- // 1. When the bottom toolbar and address bar are collapsed, page scrolling is always allowed.
77
- // 2. When the keyboard is visible, the viewport does not resize. Instead, the keyboard covers part of
78
- // it, so it becomes scrollable.
79
- // 3. When tapping on an input, the page always scrolls so that the input is centered in the visual viewport.
80
- // This may cause even fixed position elements to scroll off the screen.
81
- // 4. When using the next/previous buttons in the keyboard to navigate between inputs, the whole page always
82
- // scrolls, even if the input is inside a nested scrollable element that could be scrolled instead.
83
- //
84
- // In order to work around these cases, and prevent scrolling without jankiness, we do a few things:
85
- //
86
- // 1. Prevent default on `touchmove` events that are not in a scrollable element. This prevents touch scrolling
87
- // on the window.
88
- // 2. Prevent default on `touchmove` events inside a scrollable element when the scroll position is at the
89
- // top or bottom. This avoids the whole page scrolling instead, but does prevent overscrolling.
90
- // 3. Prevent default on `touchend` events on input elements and handle focusing the element ourselves.
91
- // 4. When focusing an input, apply a transform to trick Safari into thinking the input is at the top
92
- // of the page, which prevents it from scrolling the page. After the input is focused, scroll the element
93
- // into view ourselves, without scrolling the whole page.
94
- // 5. Offset the body by the scroll position using a negative margin and scroll to the top. This should appear the
95
- // same visually, but makes the actual scroll position always zero. This is required to make all of the
96
- // above work or Safari will still try to scroll the page when focusing an input.
97
- // 6. As a last resort, handle window scroll events, and scroll back to the top. This can happen when attempting
98
- // to navigate to an input with the next/previous buttons that's outside a modal.
99
- function preventScrollMobileSafari() {
100
- var scrollable;
101
- var lastY = 0;
102
- var onTouchStart = function onTouchStart(e) {
103
- // Store the nearest scrollable parent element from the element that the user touched.
104
- scrollable = getScrollParent(e.target);
105
- if (scrollable === document.documentElement && scrollable === document.body) {
106
- return;
107
- }
108
- lastY = e.changedTouches[0].pageY;
109
- };
110
- var onTouchMove = function onTouchMove(e) {
111
- // Prevent scrolling the window.
112
- if (!scrollable || scrollable === document.documentElement || scrollable === document.body) {
113
- e.preventDefault();
114
- return;
115
- }
116
- // Prevent scrolling up when at the top and scrolling down when at the bottom
117
- // of a nested scrollable area, otherwise mobile Safari will start scrolling
118
- // the window instead. Unfortunately, this disables bounce scrolling when at
119
- // the top but it's the best we can do.
120
- var y = e.changedTouches[0].pageY;
121
- var _scrollable = scrollable,
122
- scrollTop = _scrollable.scrollTop;
123
- var bottom = scrollable.scrollHeight - scrollable.clientHeight;
124
- if (bottom === 0) {
125
- return;
126
- }
127
- if (scrollTop <= 0 && y > lastY || scrollTop >= bottom && y < lastY) {
128
- e.preventDefault();
129
- }
130
- lastY = y;
131
- };
132
- var onTouchEnd = function onTouchEnd(e) {
133
- var target = e.target;
134
- // Apply this change if we're not already focused on the target element
135
- if (isInput(target) && target !== document.activeElement) {
136
- e.preventDefault();
137
- // Apply a transform to trick Safari into thinking the input is at the top of the page
138
- // so it doesn't try to scroll it into view. When tapping on an input, this needs to
139
- // be done before the "focus" event, so we have to focus the element ourselves.
140
- target.style.transform = 'translateY(-2000px)';
141
- target.focus();
142
- requestAnimationFrame(function () {
143
- target.style.transform = '';
144
- });
145
- }
146
- };
147
- var onFocus = function onFocus(e) {
148
- var target = e.target;
149
- if (isInput(target)) {
150
- // Transform also needs to be applied in the focus event in cases where focus moves
151
- // other than tapping on an input directly, e.g. the next/previous buttons in the
152
- // software keyboard. In these cases, it seems applying the transform in the focus event
153
- // is good enough, whereas when tapping an input, it must be done before the focus event. 🤷‍♂️
154
- target.style.transform = 'translateY(-2000px)';
155
- requestAnimationFrame(function () {
156
- target.style.transform = '';
157
- // This will have prevented the browser from scrolling the focused element into view,
158
- // so we need to do this ourselves in a way that doesn't cause the whole page to scroll.
159
- if (visualViewport) {
160
- if (visualViewport.height < window.innerHeight) {
161
- // If the keyboard is already visible, do this after one additional frame
162
- // to wait for the transform to be removed.
163
- requestAnimationFrame(function () {
164
- scrollIntoView(target);
165
- });
166
- } else {
167
- // Otherwise, wait for the visual viewport to resize before scrolling so we can
168
- // measure the correct position to scroll to.
169
- visualViewport.addEventListener('resize', function () {
170
- return scrollIntoView(target);
171
- }, {
172
- once: true
173
- });
174
- }
175
- }
176
- });
177
- }
178
- };
179
- var onWindowScroll = function onWindowScroll() {
180
- // Last resort. If the window scrolled, scroll it back to the top.
181
- // It should always be at the top because the body will have a negative margin (see below).
182
- window.scrollTo(0, 0);
183
- };
184
- // Record the original scroll position so we can restore it.
185
- // Then apply a negative margin to the body to offset it by the scroll position. This will
186
- // enable us to scroll the window to the top, which is required for the rest of this to work.
187
- var scrollX = window.pageXOffset;
188
- var scrollY = window.pageYOffset;
189
- var restoreStyles = chain(setStyle(document.documentElement, 'paddingRight', "".concat(window.innerWidth - document.documentElement.clientWidth, "px")));
190
- // Scroll to the top. The negative margin on the body will make this appear the same.
191
- window.scrollTo(0, 0);
192
- var removeEvents = chain(addEvent(document, 'touchstart', onTouchStart, {
193
- passive: false,
194
- capture: true
195
- }), addEvent(document, 'touchmove', onTouchMove, {
196
- passive: false,
197
- capture: true
198
- }), addEvent(document, 'touchend', onTouchEnd, {
199
- passive: false,
200
- capture: true
201
- }), addEvent(document, 'focus', onFocus, true), addEvent(window, 'scroll', onWindowScroll));
202
- return function () {
203
- // Restore styles and scroll the page back to where it was.
204
- restoreStyles();
205
- removeEvents();
206
- window.scrollTo(scrollX, scrollY);
207
- };
208
- }
209
- // Sets a CSS property on an element, and returns a function to revert it to the previous value.
210
- function setStyle(element, style, value) {
211
- // https://github.com/microsoft/TypeScript/issues/17827#issuecomment-391663310
212
- // @ts-ignore
213
- var cur = element.style[style];
214
- // @ts-ignore
215
- element.style[style] = value;
216
- return function () {
217
- // @ts-ignore
218
- element.style[style] = cur;
219
- };
220
- }
221
- // Adds an event listener to an element, and returns a function to remove it.
222
- function addEvent(target, event, handler, options) {
223
- // @ts-ignore
224
- target.addEventListener(event, handler, options);
225
- return function () {
226
- // @ts-ignore
227
- target.removeEventListener(event, handler, options);
228
- };
229
- }
230
- function scrollIntoView(target) {
231
- var root = document.scrollingElement || document.documentElement;
232
- while (target && target !== root) {
233
- // Find the parent scrollable element and adjust the scroll position if the target is not already in view.
234
- var scrollable = getScrollParent(target);
235
- if (scrollable !== document.documentElement && scrollable !== document.body && scrollable !== target) {
236
- var scrollableTop = scrollable.getBoundingClientRect().top;
237
- var targetTop = target.getBoundingClientRect().top;
238
- var targetBottom = target.getBoundingClientRect().bottom;
239
- // Buffer is needed for some edge cases
240
- var keyboardHeight = scrollable.getBoundingClientRect().bottom + KEYBOARD_BUFFER;
241
- if (targetBottom > keyboardHeight) {
242
- scrollable.scrollTop += targetTop - scrollableTop;
243
- }
244
- }
245
- // @ts-ignore
246
- target = scrollable.parentElement;
247
- }
248
- }
249
- export function isInput(target) {
250
- return target instanceof HTMLInputElement && !nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
251
- }
252
- export default usePreventScroll;
@@ -1,3 +0,0 @@
1
- type Fn<ARGS extends unknown[], R> = (...args: ARGS) => R;
2
- export declare const useEvent: <A extends unknown[], R>(fn: Fn<A, R>) => Fn<A, R>;
3
- export {};
@@ -1,11 +0,0 @@
1
- import { useMemo } from 'react';
2
- import { useLatest } from "./useLatest";
3
- export var useEvent = function useEvent(fn) {
4
- var ref = useLatest(fn);
5
- return useMemo(function () {
6
- return function () {
7
- var current = ref.current;
8
- return current.apply(void 0, arguments);
9
- };
10
- }, [ref]);
11
- };
@@ -1,2 +0,0 @@
1
- import type { RefObject } from 'react';
2
- export declare const useLatest: <T>(value: T) => RefObject<T>;
@@ -1,8 +0,0 @@
1
- import { useInsertionEffect, useRef } from 'react';
2
- export var useLatest = function useLatest(value) {
3
- var valueRef = useRef(value);
4
- useInsertionEffect(function () {
5
- valueRef.current = value;
6
- }, [value]);
7
- return valueRef;
8
- };
@@ -1,10 +0,0 @@
1
- type Metrics = {
2
- keyboardOffset: number;
3
- viewportHeight: number;
4
- isKeyboardOpen: boolean;
5
- };
6
- declare function useVisualViewport({ enabled, onChange, }: {
7
- enabled?: boolean;
8
- onChange: (metrics: Metrics) => void;
9
- }): Metrics;
10
- export default useVisualViewport;
@@ -1,55 +0,0 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import { useEffect, useState } from 'react';
3
- import { useEvent } from "./useEvent";
4
- var getDefaultMetrics = function getDefaultMetrics() {
5
- return {
6
- keyboardOffset: 0,
7
- viewportHeight: window.innerHeight,
8
- isKeyboardOpen: false
9
- };
10
- };
11
- var getMetrics = function getMetrics() {
12
- var viewport = window.visualViewport;
13
- if (!viewport) {
14
- return getDefaultMetrics();
15
- }
16
- var keyboardOffset = Math.max(0, window.innerHeight - viewport.height - viewport.offsetTop);
17
- var isKeyboardOpen = viewport.height < window.innerHeight && window.innerHeight - viewport.height > 150;
18
- return {
19
- keyboardOffset: keyboardOffset,
20
- viewportHeight: viewport.height,
21
- isKeyboardOpen: isKeyboardOpen
22
- };
23
- };
24
- function useVisualViewport(_ref) {
25
- var _ref$enabled = _ref.enabled,
26
- enabled = _ref$enabled === void 0 ? true : _ref$enabled,
27
- onChange = _ref.onChange;
28
- var _useState = useState(function () {
29
- return getMetrics();
30
- }),
31
- _useState2 = _slicedToArray(_useState, 2),
32
- metrics = _useState2[0],
33
- setMetrics = _useState2[1];
34
- var onChangeMetrics = useEvent(onChange);
35
- useEffect(function () {
36
- if (!enabled) {
37
- return undefined;
38
- }
39
- var updateMetrics = function updateMetrics() {
40
- var currentMetrics = getMetrics();
41
- setMetrics(currentMetrics);
42
- onChangeMetrics(currentMetrics);
43
- };
44
- updateMetrics();
45
- var viewport = window.visualViewport;
46
- viewport === null || viewport === void 0 ? void 0 : viewport.addEventListener('resize', updateMetrics);
47
- viewport === null || viewport === void 0 ? void 0 : viewport.addEventListener('scroll', updateMetrics);
48
- return function () {
49
- viewport === null || viewport === void 0 ? void 0 : viewport.removeEventListener('resize', updateMetrics);
50
- viewport === null || viewport === void 0 ? void 0 : viewport.removeEventListener('scroll', updateMetrics);
51
- };
52
- }, [enabled, onChangeMetrics]);
53
- return metrics;
54
- }
55
- export default useVisualViewport;
@@ -1,7 +0,0 @@
1
- export declare function isMobileFirefox(): boolean | undefined;
2
- export declare function testPlatform(re: RegExp): boolean | undefined;
3
- export declare function isMac(): boolean | undefined;
4
- export declare function isIPhone(): boolean | undefined;
5
- export declare function isSafari(): boolean | undefined;
6
- export declare function isIPad(): boolean | undefined;
7
- export declare function isIOS(): boolean | undefined;
@@ -1,30 +0,0 @@
1
- import "core-js/modules/es.regexp.exec.js";
2
- import "core-js/modules/es.regexp.test.js";
3
- export function isMobileFirefox() {
4
- var _navigator = navigator,
5
- userAgent = _navigator.userAgent;
6
- return typeof window !== 'undefined' && (/Firefox/.test(userAgent) && /Mobile/.test(userAgent) ||
7
- // Android Firefox
8
- /FxiOS/.test(userAgent)) // iOS Firefox
9
- ;
10
- }
11
- export function testPlatform(re) {
12
- return typeof window !== 'undefined' && window.navigator != null ? re.test(window.navigator.platform) : undefined;
13
- }
14
- export function isMac() {
15
- return testPlatform(/^Mac/);
16
- }
17
- export function isIPhone() {
18
- return testPlatform(/^iPhone/);
19
- }
20
- export function isSafari() {
21
- return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
22
- }
23
- export function isIPad() {
24
- return testPlatform(/^iPad/) ||
25
- // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
26
- isMac() && navigator.maxTouchPoints > 1;
27
- }
28
- export function isIOS() {
29
- return isIPhone() || isIPad();
30
- }