@sima-land/ui-nucleons 45.0.0-alpha.4 → 45.0.0-alpha.5

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 (190) hide show
  1. package/_internal/custom-scrollbar/index.js +5 -27
  2. package/_internal/dropdown-loading/index.js +2 -3
  3. package/_internal/page-scroll-lock/context.js +3 -25
  4. package/alert/index.d.ts +2 -2
  5. package/alert/index.js +4 -30
  6. package/arrow-button/index.js +18 -19
  7. package/autocomplete/autocomplete.js +49 -76
  8. package/autocomplete-deprecated/index.d.ts +1 -1
  9. package/autocomplete-deprecated/index.js +43 -67
  10. package/avatar/avatar.module.scss +3 -1
  11. package/avatar/index.d.ts +1 -1
  12. package/avatar/index.js +7 -33
  13. package/avatar/user.d.ts +1 -1
  14. package/avatar/user.js +8 -29
  15. package/base-input/base-input.js +5 -31
  16. package/base-input-deprecated/index.d.ts +2 -2
  17. package/base-input-deprecated/index.js +8 -34
  18. package/bordered-layout/index.d.ts +1 -1
  19. package/bordered-layout/index.js +2 -3
  20. package/bottom-bar/bottom-bar.js +2 -3
  21. package/box/index.d.ts +1 -1
  22. package/box/index.js +2 -2
  23. package/button/index.d.ts +2 -2
  24. package/button/index.js +6 -32
  25. package/card/index.js +2 -8
  26. package/card/slots.d.ts +1 -1
  27. package/card/slots.js +9 -31
  28. package/carousel/draggable.d.ts +1 -1
  29. package/carousel/draggable.js +5 -28
  30. package/carousel/index.d.ts +1 -1
  31. package/carousel/index.js +17 -43
  32. package/checkbox/index.d.ts +2 -2
  33. package/checkbox/index.js +3 -29
  34. package/checkbox-field/index.d.ts +2 -2
  35. package/checkbox-field/index.js +3 -31
  36. package/chips/index.d.ts +1 -1
  37. package/chips/index.js +3 -25
  38. package/chips/item.d.ts +1 -1
  39. package/chips/item.js +3 -5
  40. package/clean-buttons/index.js +6 -28
  41. package/dot-nav/index.d.ts +1 -1
  42. package/dot-nav/index.js +12 -34
  43. package/dropdown/index.d.ts +2 -2
  44. package/dropdown/index.js +3 -26
  45. package/dropdown-item/index.d.ts +1 -1
  46. package/dropdown-item/index.js +4 -9
  47. package/expandable/index.d.ts +2 -2
  48. package/expandable/index.js +8 -36
  49. package/field-block/index.js +2 -9
  50. package/field-grid/index.d.ts +1 -1
  51. package/field-grid/index.js +43 -65
  52. package/file-icon/index.d.ts +1 -1
  53. package/file-icon/index.js +5 -10
  54. package/group-overflow/index.js +6 -30
  55. package/helpers/define-slots.d.ts +1 -1
  56. package/helpers/events.d.ts +1 -1
  57. package/helpers/on.d.ts +1 -1
  58. package/hint/hint-view.js +3 -3
  59. package/hint/hint.js +3 -8
  60. package/hint-deprecated/index.d.ts +2 -2
  61. package/hint-deprecated/index.js +3 -26
  62. package/hooks/breakpoint/index.js +3 -25
  63. package/info-text/index.js +15 -42
  64. package/input/index.js +8 -30
  65. package/layout/layout.js +2 -2
  66. package/layout/legacy.d.ts +5 -5
  67. package/layout/legacy.js +3 -25
  68. package/link/index.d.ts +6 -3
  69. package/link/index.js +3 -25
  70. package/loading-overlay/index.d.ts +1 -1
  71. package/loading-overlay/index.js +2 -3
  72. package/masked-field/index.d.ts +2 -2
  73. package/masked-field/index.js +3 -25
  74. package/masked-input/masked-input.js +3 -25
  75. package/modal/index.d.ts +1 -1
  76. package/modal/index.js +3 -10
  77. package/modal/slots.js +6 -29
  78. package/modal-overlay/index.js +3 -26
  79. package/no-index/index.d.ts +3 -3
  80. package/no-index/index.js +4 -8
  81. package/no-index-mark/index.d.ts +2 -2
  82. package/no-index-mark/index.js +7 -6
  83. package/package.json +6 -11
  84. package/pagination/index.d.ts +4 -20
  85. package/pagination/index.js +8 -15
  86. package/pagination/pagination-item.d.ts +8 -0
  87. package/pagination/pagination-item.js +31 -0
  88. package/pagination/pagination-item.module.scss +49 -0
  89. package/pagination/pagination.d.ts +8 -0
  90. package/pagination/pagination.js +78 -0
  91. package/pagination/pagination.module.scss +14 -70
  92. package/pagination/types.d.ts +28 -0
  93. package/pagination/types.js +2 -0
  94. package/pagination/utils.d.ts +15 -43
  95. package/pagination/utils.js +38 -87
  96. package/{pagination → pagination-deprecated}/base-pagination.d.ts +6 -1
  97. package/{pagination → pagination-deprecated}/base-pagination.js +33 -33
  98. package/pagination-deprecated/index.d.ts +22 -0
  99. package/pagination-deprecated/index.js +15 -0
  100. package/{pagination → pagination-deprecated}/page-button.d.ts +2 -1
  101. package/{pagination → pagination-deprecated}/page-button.js +3 -5
  102. package/pagination-deprecated/pagination.module.scss +76 -0
  103. package/pagination-deprecated/utils.d.ts +58 -0
  104. package/pagination-deprecated/utils.js +124 -0
  105. package/panel/index.js +3 -6
  106. package/phone-input/images/armenia.png +0 -0
  107. package/phone-input/images/azerbaijan.png +0 -0
  108. package/phone-input/images/belarus.png +0 -0
  109. package/phone-input/images/georgia.png +0 -0
  110. package/phone-input/images/kazakhstan.png +0 -0
  111. package/phone-input/images/kyrgyzstan.png +0 -0
  112. package/phone-input/images/moldova.png +0 -0
  113. package/phone-input/images/other.png +0 -0
  114. package/phone-input/images/russia.png +0 -0
  115. package/phone-input/images/tajikistan.png +0 -0
  116. package/phone-input/images/turkmenistan.png +0 -0
  117. package/phone-input/images/ukraine.png +0 -0
  118. package/phone-input/images/uzbekistan.png +0 -0
  119. package/phone-input/phone-input.js +13 -37
  120. package/phone-input/presets.js +2 -0
  121. package/phone-input-deprecated/index.d.ts +1 -1
  122. package/phone-input-deprecated/index.js +31 -57
  123. package/plate/index.d.ts +2 -2
  124. package/plate/index.js +3 -25
  125. package/popup/popup-view.js +3 -6
  126. package/popup/popup.js +4 -26
  127. package/portal/index.d.ts +1 -1
  128. package/price/index.js +2 -2
  129. package/radio-button/index.js +2 -4
  130. package/range/index.d.ts +1 -1
  131. package/range/index.js +6 -33
  132. package/rating/index.d.ts +1 -1
  133. package/rating/index.js +4 -9
  134. package/readme.md +4 -67
  135. package/screen/index.d.ts +5 -5
  136. package/screen/index.js +11 -37
  137. package/screen/slots.d.ts +3 -3
  138. package/screen/slots.js +9 -31
  139. package/select/parts/block.js +6 -28
  140. package/select/parts/button.js +7 -29
  141. package/select/parts/menu.js +12 -33
  142. package/select/select.js +4 -28
  143. package/select-deprecated/index.d.ts +1 -1
  144. package/select-deprecated/index.js +32 -56
  145. package/side-page/index.js +4 -30
  146. package/side-page/slots.js +4 -4
  147. package/spinner/index.d.ts +1 -1
  148. package/spinner/index.js +3 -5
  149. package/spinner/spinner.module.scss +3 -1
  150. package/stepper/index.d.ts +2 -2
  151. package/stepper/index.js +11 -38
  152. package/stroked-svg/index.d.ts +2 -2
  153. package/stroked-svg/index.js +3 -27
  154. package/styling/sizes.module.scss +3 -1
  155. package/super-ellipse-clip-path/index.js +2 -8
  156. package/switcher-row/index.js +5 -10
  157. package/tabs/index.d.ts +1 -1
  158. package/tabs/index.js +4 -26
  159. package/text/index.d.ts +2 -2
  160. package/text/index.js +3 -25
  161. package/text-button/index.d.ts +2 -2
  162. package/text-button/index.js +4 -7
  163. package/text-field/index.d.ts +2 -2
  164. package/text-field/index.js +25 -55
  165. package/textarea/index.js +4 -26
  166. package/timer/index.d.ts +1 -1
  167. package/timer/index.js +3 -25
  168. package/toggle/index.d.ts +2 -2
  169. package/toggle/index.js +3 -27
  170. package/tooltip/index.d.ts +2 -2
  171. package/tooltip/index.js +4 -28
  172. package/top-bar/top-bar.js +5 -45
  173. package/top-bar/utils.d.ts +2 -2
  174. package/top-bar/utils.js +6 -28
  175. package/touch-slider/index.d.ts +1 -1
  176. package/touch-slider/index.js +2 -4
  177. package/unknown-content/index.d.ts +1 -1
  178. package/unknown-content/index.js +3 -25
  179. package/upload-area/upload-area.js +8 -38
  180. package/with-hint/index.d.ts +1 -1
  181. package/with-hint/index.js +3 -28
  182. package/with-hint/positioning-hint.d.ts +1 -1
  183. package/with-hint/positioning-hint.js +3 -25
  184. package/with-tooltip/index.d.ts +1 -1
  185. package/with-tooltip/index.js +6 -31
  186. package/with-tooltip/positioning-tooltip.d.ts +1 -1
  187. package/with-tooltip/positioning-tooltip.js +4 -26
  188. package/file-icon/unknown.svg +0 -9
  189. package/rating/star.svg +0 -3
  190. package/upload-area/upload.svg +0 -6
package/screen/slots.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { TopBarProps } from '../top-bar';
3
3
  export interface HeaderSlotProps extends TopBarProps {
4
4
  /** Будет вызвана при нажатии на кнопку-стрелку. */
@@ -15,9 +15,9 @@ export declare const HeaderSlot: ({ divided, title, subtitle, buttons, onBack, o
15
15
  /**
16
16
  * Слот основного контента экрана.
17
17
  */
18
- export declare const BodySlot: React.ForwardRefExoticComponent<{
18
+ export declare const BodySlot: import("react").ForwardRefExoticComponent<{
19
19
  children?: React.ReactNode;
20
- } & React.RefAttributes<HTMLDivElement | null>>;
20
+ } & import("react").RefAttributes<HTMLDivElement | null>>;
21
21
  /**
22
22
  * Слот футера экрана.
23
23
  * @param props Свойства.
package/screen/slots.js CHANGED
@@ -1,27 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __rest = (this && this.__rest) || function (s, e) {
26
3
  var t = {};
27
4
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -38,10 +15,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
15
  };
39
16
  Object.defineProperty(exports, "__esModule", { value: true });
40
17
  exports.FooterSlot = exports.BodySlot = exports.HeaderSlot = void 0;
41
- const react_1 = __importStar(require("react"));
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
+ const react_1 = require("react");
42
20
  const lodash_1 = require("lodash");
43
- const arrow_left_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Stroked/arrow-left"));
44
- const cross_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Stroked/cross"));
21
+ const ArrowLeft_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Stroked/ArrowLeft"));
22
+ const Cross_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Stroked/Cross"));
45
23
  const page_scroll_lock_1 = require("../_internal/page-scroll-lock");
46
24
  const hooks_1 = require("../hooks");
47
25
  const loading_overlay_1 = require("../loading-overlay");
@@ -55,11 +33,11 @@ const top_bar_1 = require("../top-bar");
55
33
  */
56
34
  const HeaderSlot = (_a) => {
57
35
  var { divided, title, subtitle, buttons, onBack, onClose } = _a, restProps = __rest(_a, ["divided", "title", "subtitle", "buttons", "onBack", "onClose"]);
58
- return (react_1.default.createElement(top_bar_1.TopBar, Object.assign({}, restProps, { size: 's', title: title, subtitle: subtitle, divided: divided, buttons: Object.assign(Object.assign({}, buttons), { start: onBack
36
+ return ((0, jsx_runtime_1.jsx)(top_bar_1.TopBar, Object.assign({}, restProps, { size: 's', title: title, subtitle: subtitle, divided: divided, buttons: Object.assign(Object.assign({}, buttons), { start: onBack
59
37
  ? {
60
38
  // ВАЖНО: не подмешиваем свойства из buttons.start
61
39
  // чтобы не распылять конфигурацию одной и той же кнопки по нескольким местам
62
- icon: react_1.default.createElement(arrow_left_1.default, null),
40
+ icon: (0, jsx_runtime_1.jsx)(ArrowLeft_1.default, {}),
63
41
  onClick: onBack,
64
42
  'aria-label': 'Вернуться назад',
65
43
  'data-testid': 'screen:back',
@@ -68,7 +46,7 @@ const HeaderSlot = (_a) => {
68
46
  ? {
69
47
  // ВАЖНО: не подмешиваем свойства из buttons.end
70
48
  // чтобы не распылять конфигурацию одной и той же кнопки по нескольким местам
71
- icon: react_1.default.createElement(cross_1.default, null),
49
+ icon: (0, jsx_runtime_1.jsx)(Cross_1.default, {}),
72
50
  onClick: onClose,
73
51
  'aria-label': `Закрыть ${title || ''}`.trim(),
74
52
  'data-testid': 'screen:close',
@@ -90,12 +68,12 @@ exports.BodySlot = (0, react_1.forwardRef)(function BodySlot({ children }, outer
90
68
  (0, hooks_1.useInfiniteScroll)(ref, { onFullScroll, threshold: fullScrollThreshold });
91
69
  return (
92
70
  // ВАЖНО: элемент с ref должен выводиться всегда (без условий), т.к. он нужен для блокировки прокрутки
93
- react_1.default.createElement("div", { ref: ref, className: screen_module_scss_1.default.body, "data-testid": 'screen:body' }, loading ? (react_1.default.createElement(loading_overlay_1.LoadingOverlay, Object.assign({}, loadingOverlayProps, { fill: false, style: { height: '100%' } }))) : (children)));
71
+ (0, jsx_runtime_1.jsx)("div", Object.assign({ ref: ref, className: screen_module_scss_1.default.body, "data-testid": 'screen:body' }, { children: loading ? ((0, jsx_runtime_1.jsx)(loading_overlay_1.LoadingOverlay, Object.assign({}, loadingOverlayProps, { fill: false, style: { height: '100%' } }))) : (children) })));
94
72
  });
95
73
  /**
96
74
  * Слот футера экрана.
97
75
  * @param props Свойства.
98
76
  * @return Элемент.
99
77
  */
100
- const FooterSlot = ({ children }) => react_1.default.createElement(react_1.default.Fragment, null, children);
78
+ const FooterSlot = ({ children }) => (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
101
79
  exports.FooterSlot = FooterSlot;
@@ -1,38 +1,16 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
4
  };
28
5
  Object.defineProperty(exports, "__esModule", { value: true });
29
6
  exports.SelectFieldBlock = void 0;
30
- const react_1 = __importStar(require("react"));
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_1 = require("react");
31
9
  const utils_1 = require("../utils");
32
10
  const field_block_1 = require("../../field-block");
33
11
  const colors_1 = require("../../colors");
34
- const up_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/up"));
35
- const down_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/down"));
12
+ const Up_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/Up"));
13
+ const Down_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/Down"));
36
14
  const block_module_scss_1 = __importDefault(require("./block.module.scss"));
37
15
  const classnames_1 = __importDefault(require("classnames"));
38
16
  /**
@@ -44,12 +22,12 @@ function SelectFieldBlock(props) {
44
22
  var _a;
45
23
  const binding = (0, react_1.useContext)(utils_1.SelectContext);
46
24
  const [focused, setFocused] = (0, react_1.useState)(false);
47
- const ArrowSVG = binding.opened ? up_1.default : down_1.default;
25
+ const ArrowSVG = binding.opened ? Up_1.default : Down_1.default;
48
26
  // @todo прокидывать ref в props.blockRef при необходимости
49
27
  const ref = (0, react_1.useRef)(null);
50
28
  (0, react_1.useImperativeHandle)(binding.anchorRef, () => ref.current);
51
29
  (0, react_1.useImperativeHandle)(binding.openerRef, () => ref.current);
52
- return (react_1.default.createElement(field_block_1.FieldBlock, Object.assign({ label: binding.label, adornmentEnd: react_1.default.createElement(ArrowSVG, { fill: colors_1.COLORS.get('basic-gray24') }) }, props, { failed: binding.failed, disabled: binding.disabled, fixedHeight: true, blockRef: ref, blockProps: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.blockProps), { onFocus: event => {
30
+ return ((0, jsx_runtime_1.jsx)(field_block_1.FieldBlock, Object.assign({ label: binding.label, adornmentEnd: (0, jsx_runtime_1.jsx)(ArrowSVG, { fill: colors_1.COLORS.get('basic-gray24') }) }, props, { failed: binding.failed, disabled: binding.disabled, fixedHeight: true, blockRef: ref, blockProps: Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.blockProps), { onFocus: event => {
53
31
  var _a, _b;
54
32
  setFocused(true);
55
33
  (_b = (_a = props.blockProps) === null || _a === void 0 ? void 0 : _a.onFocus) === null || _b === void 0 ? void 0 : _b.call(_a, event);
@@ -1,27 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __rest = (this && this.__rest) || function (s, e) {
26
3
  var t = {};
27
4
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -38,11 +15,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
15
  };
39
16
  Object.defineProperty(exports, "__esModule", { value: true });
40
17
  exports.SelectTextButton = void 0;
41
- const react_1 = __importStar(require("react"));
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
+ const react_1 = require("react");
42
20
  const text_button_1 = require("../../text-button");
43
21
  const utils_1 = require("../utils");
44
- const up_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/up"));
45
- const down_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/down"));
22
+ const Up_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/Up"));
23
+ const Down_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/Down"));
46
24
  /**
47
25
  * Компонент открывашки в виде текстовой кнопки.
48
26
  * @param props Свойства.
@@ -52,11 +30,11 @@ function SelectTextButton(_a) {
52
30
  var { buttonRef: buttonRefProp, children, onKeyDown, onMouseDown } = _a, props = __rest(_a, ["buttonRef", "children", "onKeyDown", "onMouseDown"]);
53
31
  const buttonRef = (0, react_1.useRef)(null);
54
32
  const binding = (0, react_1.useContext)(utils_1.SelectContext);
55
- const ArrowSVG = binding.opened ? up_1.default : down_1.default;
33
+ const ArrowSVG = binding.opened ? Up_1.default : Down_1.default;
56
34
  (0, react_1.useImperativeHandle)(buttonRefProp, () => buttonRef.current);
57
35
  (0, react_1.useImperativeHandle)(binding.anchorRef, () => buttonRef.current);
58
36
  (0, react_1.useImperativeHandle)(binding.openerRef, () => buttonRef.current);
59
- return (react_1.default.createElement(text_button_1.TextButton, Object.assign({ iconGutter: 4, endIcon: ArrowSVG }, props, { as: 'button', onMouseDown: event => {
37
+ return ((0, jsx_runtime_1.jsx)(text_button_1.TextButton, Object.assign({ iconGutter: 4, endIcon: ArrowSVG }, props, { as: 'button', onMouseDown: event => {
60
38
  var _a;
61
39
  (_a = binding.onMouseDown) === null || _a === void 0 ? void 0 : _a.call(binding, event);
62
40
  onMouseDown === null || onMouseDown === void 0 ? void 0 : onMouseDown(event);
@@ -64,6 +42,6 @@ function SelectTextButton(_a) {
64
42
  var _a;
65
43
  (_a = binding.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(binding, event);
66
44
  onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
67
- }, disabled: binding.disabled, buttonRef: buttonRef, role: 'combobox' }), children !== null && children !== void 0 ? children : (binding.value || binding.label)));
45
+ }, disabled: binding.disabled, buttonRef: buttonRef, role: 'combobox' }, { children: children !== null && children !== void 0 ? children : (binding.value || binding.label) })));
68
46
  }
69
47
  exports.SelectTextButton = SelectTextButton;
@@ -1,27 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __rest = (this && this.__rest) || function (s, e) {
26
3
  var t = {};
27
4
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -38,7 +15,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
15
  };
39
16
  Object.defineProperty(exports, "__esModule", { value: true });
40
17
  exports.SelectMenu = void 0;
41
- const react_1 = __importStar(require("react"));
18
+ const react_1 = require("react");
19
+ const jsx_runtime_1 = require("react/jsx-runtime");
20
+ const react_2 = require("react");
42
21
  const dropdown_1 = require("../../dropdown");
43
22
  const dropdown_item_1 = require("../../dropdown-item");
44
23
  const utils_1 = require("../../dropdown-item/utils");
@@ -56,13 +35,13 @@ const MenuItemAttr = {
56
35
  */
57
36
  function SelectMenu(_a) {
58
37
  var { loading, children, menuRef, value, onKeyDown, onItemSelect } = _a, restProps = __rest(_a, ["loading", "children", "menuRef", "value", "onKeyDown", "onItemSelect"]);
59
- const ref = (0, react_1.useRef)(null);
60
- const osComponentRef = (0, react_1.useRef)(null);
61
- const [activeIndex, setActiveIndex] = (0, react_1.useState)(-1);
62
- const items = react_1.Children.toArray(children).filter(utils_1.DropdownItemUtils.is);
63
- (0, react_1.useImperativeHandle)(menuRef, () => ref.current);
38
+ const ref = (0, react_2.useRef)(null);
39
+ const osComponentRef = (0, react_2.useRef)(null);
40
+ const [activeIndex, setActiveIndex] = (0, react_2.useState)(-1);
41
+ const items = react_2.Children.toArray(children).filter(utils_1.DropdownItemUtils.is);
42
+ (0, react_2.useImperativeHandle)(menuRef, () => ref.current);
64
43
  // прокрутка до элемента списка
65
- (0, react_1.useEffect)(() => {
44
+ (0, react_2.useEffect)(() => {
66
45
  var _a, _b;
67
46
  const menu = ref.current;
68
47
  const itemSelector = `[${MenuItemAttr.name}="${MenuItemAttr.value}"]`;
@@ -74,7 +53,7 @@ function SelectMenu(_a) {
74
53
  });
75
54
  }
76
55
  }, [activeIndex]);
77
- const handleMenuKeyDown = (0, react_1.useCallback)(event => {
56
+ const handleMenuKeyDown = (0, react_2.useCallback)(event => {
78
57
  onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event);
79
58
  switch (event.code) {
80
59
  case 'Enter': {
@@ -93,13 +72,13 @@ function SelectMenu(_a) {
93
72
  break;
94
73
  }
95
74
  }, [items, activeIndex, onKeyDown]);
96
- const handleItemClick = (0, react_1.useCallback)((item) => item.props.disabled
75
+ const handleItemClick = (0, react_2.useCallback)((item) => item.props.disabled
97
76
  ? undefined
98
77
  : event => {
99
78
  var _a, _b;
100
79
  (_b = (_a = item.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, event);
101
80
  onItemSelect === null || onItemSelect === void 0 ? void 0 : onItemSelect(item);
102
81
  }, [onItemSelect]);
103
- return (react_1.default.createElement(dropdown_1.Dropdown, Object.assign({}, restProps, { ref: ref, tabIndex: 0, role: 'listbox', onKeyDown: handleMenuKeyDown, className: (0, classnames_1.default)(menu_module_scss_1.default.menu, restProps.className), customScrollbarProps: { osComponentRef } }), loading ? (react_1.default.createElement(dropdown_loading_1.DropdownLoading, { "data-testid": 'select:loading-area' })) : (items.map((item, index) => (react_1.default.createElement(dropdown_item_1.DropdownItem, Object.assign({ checked: activeIndex === index, selected: value === utils_1.DropdownItemUtils.getValue(item) }, item.props, { key: index, role: 'option', onClick: handleItemClick(item) }, { [MenuItemAttr.name]: MenuItemAttr.value })))))));
82
+ return ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, Object.assign({}, restProps, { ref: ref, tabIndex: 0, role: 'listbox', onKeyDown: handleMenuKeyDown, className: (0, classnames_1.default)(menu_module_scss_1.default.menu, restProps.className), customScrollbarProps: { osComponentRef } }, { children: loading ? ((0, jsx_runtime_1.jsx)(dropdown_loading_1.DropdownLoading, { "data-testid": 'select:loading-area' })) : (items.map((item, index) => ((0, react_1.createElement)(dropdown_item_1.DropdownItem, Object.assign({ checked: activeIndex === index, selected: value === utils_1.DropdownItemUtils.getValue(item) }, item.props, { key: index, role: 'option', onClick: handleItemClick(item) }, { [MenuItemAttr.name]: MenuItemAttr.value }))))) })));
104
83
  }
105
84
  exports.SelectMenu = SelectMenu;
package/select/select.js CHANGED
@@ -1,27 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __rest = (this && this.__rest) || function (s, e) {
26
3
  var t = {};
27
4
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -35,7 +12,8 @@ var __rest = (this && this.__rest) || function (s, e) {
35
12
  };
36
13
  Object.defineProperty(exports, "__esModule", { value: true });
37
14
  exports.Select = void 0;
38
- const react_1 = __importStar(require("react"));
15
+ const jsx_runtime_1 = require("react/jsx-runtime");
16
+ const react_1 = require("react");
39
17
  const utils_1 = require("./utils");
40
18
  const identity_1 = require("../hooks/identity");
41
19
  const utils_2 = require("../dropdown-item/utils");
@@ -49,7 +27,7 @@ const utils_3 = require("../dropdown/utils");
49
27
  * @param props Свойства.
50
28
  * @return Элемент.
51
29
  */
52
- function Select({ children, disabled, failed, loading, onValueChange, onMenuToggle, value, defaultValue, label, opener = react_1.default.createElement(block_1.SelectFieldBlock, null), renderValue = v => v, dropdownProps, }) {
30
+ function Select({ children, disabled, failed, loading, onValueChange, onMenuToggle, value, defaultValue, label, opener = (0, jsx_runtime_1.jsx)(block_1.SelectFieldBlock, {}), renderValue = v => v, dropdownProps, }) {
53
31
  // @todo по аналогии с <select /> надо проверять, есть ли значение в списке переданных
54
32
  const [initialValue] = (0, react_1.useState)(() => { var _a; return (_a = value !== null && value !== void 0 ? value : defaultValue) !== null && _a !== void 0 ? _a : ''; });
55
33
  const [currentValue, setCurrentValue] = (0, react_1.useState)(initialValue);
@@ -136,9 +114,7 @@ function Select({ children, disabled, failed, loading, onValueChange, onMenuTogg
136
114
  setNeedMenu(false);
137
115
  (_a = openerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
138
116
  } });
139
- return (react_1.default.createElement(react_1.default.Fragment, null,
140
- react_1.default.createElement(utils_1.SelectContext.Provider, { value: openerBinding }, (0, react_1.isValidElement)(opener) && opener),
141
- react_1.default.createElement(react_2.FloatingPortal, { id: '' }, needMenu && react_1.default.createElement(menu_1.SelectMenu, Object.assign({}, menuProps), children))));
117
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(utils_1.SelectContext.Provider, Object.assign({ value: openerBinding }, { children: (0, react_1.isValidElement)(opener) && opener })), (0, jsx_runtime_1.jsx)(react_2.FloatingPortal, Object.assign({ id: '' }, { children: needMenu && (0, jsx_runtime_1.jsx)(menu_1.SelectMenu, Object.assign({}, menuProps, { children: children })) }))] }));
142
118
  }
143
119
  exports.Select = Select;
144
120
  Select.FieldBlock = block_1.SelectFieldBlock;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { TextFieldProps } from '../text-field';
3
3
  type Size = 's' | 'm' | 'l' | 'xl';
4
4
  export interface SelectProps extends Omit<TextFieldProps, 'style' | 'endAdornment'> {
@@ -1,27 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __rest = (this && this.__rest) || function (s, e) {
26
3
  var t = {};
27
4
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -38,14 +15,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
15
  };
39
16
  Object.defineProperty(exports, "__esModule", { value: true });
40
17
  exports.Select = exports.renderDefaultArrow = void 0;
41
- const react_1 = __importStar(require("react"));
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
+ const react_1 = require("react");
42
20
  const dropdown_1 = require("../dropdown");
43
21
  const dropdown_item_1 = require("../dropdown-item");
44
22
  const text_field_1 = require("../text-field");
45
23
  const dropdown_2 = require("../_internal/utils/dropdown");
46
24
  const bind_1 = __importDefault(require("classnames/bind"));
47
- const down_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/down"));
48
- const up_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/up"));
25
+ const Down_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/Down"));
26
+ const Up_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/Up"));
49
27
  const select_module_scss_1 = __importDefault(require("./select.module.scss"));
50
28
  const colors_1 = require("../colors");
51
29
  const dropdown_loading_1 = require("../_internal/dropdown-loading");
@@ -57,8 +35,8 @@ const cx = bind_1.default.bind(select_module_scss_1.default);
57
35
  * @return Элемент.
58
36
  */
59
37
  const renderDefaultArrow = (opened) => {
60
- const ArrowSVG = opened ? up_1.default : down_1.default;
61
- return react_1.default.createElement(ArrowSVG, { fill: colors_1.COLORS.get('basic-gray38') });
38
+ const ArrowSVG = opened ? Up_1.default : Down_1.default;
39
+ return (0, jsx_runtime_1.jsx)(ArrowSVG, { fill: colors_1.COLORS.get('basic-gray38') });
62
40
  };
63
41
  exports.renderDefaultArrow = renderDefaultArrow;
64
42
  /**
@@ -78,35 +56,33 @@ const Select = (_a) => {
78
56
  onMenuToggle && onMenuToggle(opened);
79
57
  }, [opened]);
80
58
  (0, hooks_1.useOutsideClick)(rootRef, toggleMenu.bind(null, false));
81
- return (react_1.default.createElement("div", { ref: rootRef, style: style, className: cx('root', className), "data-testid": dataTestId },
82
- react_1.default.createElement(text_field_1.TextField, Object.assign({}, restProps, { size: size, blockProps: {
83
- ref: fieldRef,
84
- tabIndex: 0,
85
- onMouseDown: () => {
86
- toggleMenu(a => !a);
87
- },
88
- onKeyDown: e => {
89
- e.key === 'Enter' && toggleMenu(true);
90
- },
91
- }, onClick: e => {
92
- e.preventDefault();
93
- onClick && onClick(e);
94
- }, className: select_module_scss_1.default.field, "data-testid": 'select:field', label: label, focused: opened, baseInputProps: {
95
- // чтобы не ловить фокус на поле
96
- style: { pointerEvents: 'none' },
97
- tabIndex: -1,
98
- }, value: value, multiline: false, variant: 'desktop', readOnly: true, endAdornment: typeof endAdornment === 'function' ? endAdornment(opened) : endAdornment })),
99
- opened && (loading || options.length > 0) && (react_1.default.createElement(dropdown_1.Dropdown, Object.assign({}, (0, dropdown_2.placeDropdown)(size), { ref: menuRef, "data-testid": 'select:menu', role: 'menu', tabIndex: -1, className: cx('menu'), onKeyDown: event => {
100
- if (event.key === 'Enter') {
59
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ ref: rootRef, style: style, className: cx('root', className), "data-testid": dataTestId }, { children: [(0, jsx_runtime_1.jsx)(text_field_1.TextField, Object.assign({}, restProps, { size: size, blockProps: {
60
+ ref: fieldRef,
61
+ tabIndex: 0,
62
+ onMouseDown: () => {
63
+ toggleMenu(a => !a);
64
+ },
65
+ onKeyDown: e => {
66
+ e.key === 'Enter' && toggleMenu(true);
67
+ },
68
+ }, onClick: e => {
69
+ e.preventDefault();
70
+ onClick && onClick(e);
71
+ }, className: select_module_scss_1.default.field, "data-testid": 'select:field', label: label, focused: opened, baseInputProps: {
72
+ // чтобы не ловить фокус на поле
73
+ style: { pointerEvents: 'none' },
74
+ tabIndex: -1,
75
+ }, value: value, multiline: false, variant: 'desktop', readOnly: true, endAdornment: typeof endAdornment === 'function' ? endAdornment(opened) : endAdornment })), opened && (loading || options.length > 0) && ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, Object.assign({}, (0, dropdown_2.placeDropdown)(size), { ref: menuRef, "data-testid": 'select:menu', role: 'menu', tabIndex: -1, className: cx('menu'), onKeyDown: event => {
76
+ if (event.key === 'Enter') {
77
+ toggleMenu(false);
78
+ fieldRef.current && fieldRef.current.focus();
79
+ }
80
+ }, onBlur: () => {
101
81
  toggleMenu(false);
102
82
  fieldRef.current && fieldRef.current.focus();
103
- }
104
- }, onBlur: () => {
105
- toggleMenu(false);
106
- fieldRef.current && fieldRef.current.focus();
107
- } }), loading ? (react_1.default.createElement(dropdown_loading_1.DropdownLoading, { "data-testid": 'select:loading-area' })) : (options.map((option, index) => (react_1.default.createElement(dropdown_item_1.DropdownItem, { size: optionSize, key: index, role: 'menuitem', onClick: () => {
108
- toggleMenu(false);
109
- onSelect && onSelect(option);
110
- } }, renderOption(option)))))))));
83
+ } }, { children: loading ? ((0, jsx_runtime_1.jsx)(dropdown_loading_1.DropdownLoading, { "data-testid": 'select:loading-area' })) : (options.map((option, index) => ((0, jsx_runtime_1.jsx)(dropdown_item_1.DropdownItem, Object.assign({ size: optionSize, role: 'menuitem', onClick: () => {
84
+ toggleMenu(false);
85
+ onSelect && onSelect(option);
86
+ } }, { children: renderOption(option) }), index)))) })))] })));
111
87
  };
112
88
  exports.Select = Select;
@@ -1,27 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __rest = (this && this.__rest) || function (s, e) {
26
3
  var t = {};
27
4
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -38,7 +15,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
15
  };
39
16
  Object.defineProperty(exports, "__esModule", { value: true });
40
17
  exports.SidePage = void 0;
41
- const react_1 = __importStar(require("react"));
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
+ const react_1 = require("react");
42
20
  const define_slots_1 = require("../helpers/define-slots");
43
21
  const page_scroll_lock_1 = require("../_internal/page-scroll-lock");
44
22
  const slots_1 = require("./slots");
@@ -62,7 +40,7 @@ const transitionClasses = {
62
40
  function SidePage(_a) {
63
41
  var { shown, withTransitions, onEnter, onEntering, onEntered, onExit, onExiting, onExited } = _a, restProps = __rest(_a, ["shown", "withTransitions", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited"]);
64
42
  const transitionDuration = withTransitions ? 300 : 0;
65
- return (react_1.default.createElement(CSSTransition_1.default, { in: shown, timeout: transitionDuration, classNames: transitionClasses, unmountOnExit: true, onEntering: onEntering, onEnter: onEnter, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited }, transitionStatus => (react_1.default.createElement(SidePageInner, Object.assign({}, restProps, { transitionStatus, transitionDuration })))));
43
+ return ((0, jsx_runtime_1.jsx)(CSSTransition_1.default, Object.assign({ in: shown, timeout: transitionDuration, classNames: transitionClasses, unmountOnExit: true, onEntering: onEntering, onEnter: onEnter, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited }, { children: transitionStatus => ((0, jsx_runtime_1.jsx)(SidePageInner, Object.assign({}, restProps, { transitionStatus, transitionDuration }))) })));
66
44
  }
67
45
  exports.SidePage = SidePage;
68
46
  /**
@@ -80,11 +58,7 @@ function SidePageInner({ size = 'm', children, onClose, withScrollDisable = fals
80
58
  footer: SidePage.Footer,
81
59
  });
82
60
  const overlayProps = Object.assign({ style: { '--transition-duration': `${transitionDuration}ms` } }, (transitionStatus !== 'entering' && overlayClickBind));
83
- return (react_1.default.createElement(modal_overlay_1.ModalOverlay, Object.assign({}, overlayProps),
84
- react_1.default.createElement("div", { className: cx('side-page', `size-${size}`) },
85
- header,
86
- react_1.default.createElement("div", { ref: ref, className: cx('body') }, body),
87
- footer)));
61
+ return ((0, jsx_runtime_1.jsx)(modal_overlay_1.ModalOverlay, Object.assign({}, overlayProps, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: cx('side-page', `size-${size}`) }, { children: [header, (0, jsx_runtime_1.jsx)("div", Object.assign({ ref: ref, className: cx('body') }, { children: body })), footer] })) })));
88
62
  }
89
63
  SidePage.Header = slots_1.SidePageHeader;
90
64
  SidePage.Body = slots_1.SidePageBody;
@@ -15,7 +15,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.SidePageFooter = exports.SidePageBody = exports.SidePageHeader = void 0;
18
- const react_1 = __importDefault(require("react"));
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
19
  const top_bar_1 = require("../top-bar");
20
20
  const bottom_bar_1 = require("../bottom-bar");
21
21
  const utils_1 = require("../top-bar/utils");
@@ -28,7 +28,7 @@ const side_page_module_scss_1 = __importDefault(require("./side-page.module.scss
28
28
  */
29
29
  function SidePageHeader(_a) {
30
30
  var { onBack, onClose, buttons } = _a, topBarProps = __rest(_a, ["onBack", "onClose", "buttons"]);
31
- return (react_1.default.createElement(top_bar_1.TopBar, Object.assign({}, topBarProps, { size: 'unset', className: side_page_module_scss_1.default.header, buttons: (0, utils_1.navigationButtons)({ buttons, onBack, onClose }) })));
31
+ return ((0, jsx_runtime_1.jsx)(top_bar_1.TopBar, Object.assign({}, topBarProps, { size: 'unset', className: side_page_module_scss_1.default.header, buttons: (0, utils_1.navigationButtons)({ buttons, onBack, onClose }) })));
32
32
  }
33
33
  exports.SidePageHeader = SidePageHeader;
34
34
  /**
@@ -37,7 +37,7 @@ exports.SidePageHeader = SidePageHeader;
37
37
  * @return Элемент.
38
38
  */
39
39
  function SidePageBody({ children }) {
40
- return react_1.default.createElement(react_1.default.Fragment, null, children);
40
+ return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
41
41
  }
42
42
  exports.SidePageBody = SidePageBody;
43
43
  /**
@@ -47,6 +47,6 @@ exports.SidePageBody = SidePageBody;
47
47
  */
48
48
  function SidePageFooter(_a) {
49
49
  var props = __rest(_a, []);
50
- return react_1.default.createElement(bottom_bar_1.BottomBar, Object.assign({}, props, { size: 'unset', className: (0, classnames_1.default)(side_page_module_scss_1.default.footer) }));
50
+ return (0, jsx_runtime_1.jsx)(bottom_bar_1.BottomBar, Object.assign({}, props, { size: 'unset', className: (0, classnames_1.default)(side_page_module_scss_1.default.footer) }));
51
51
  }
52
52
  exports.SidePageFooter = SidePageFooter;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { Token } from '../colors';
3
3
  /**
4
4
  * @deprecated Следует использовать 's' | 'm' | 'l'.
package/spinner/index.js CHANGED
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.SpinnerSVG = exports.Spinner = exports.DIAMETERS = void 0;
7
- const react_1 = __importDefault(require("react"));
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const lodash_1 = require("lodash");
9
9
  const colors_1 = require("../colors");
10
10
  const bind_1 = __importDefault(require("classnames/bind"));
@@ -28,8 +28,7 @@ const DEFAULT_COLOR = 'basic-blue';
28
28
  function Spinner({ size = 'm', color = DEFAULT_COLOR, className, style, 'data-testid': testId = 'spinner', }) {
29
29
  const readySize = (0, lodash_1.has)(exports.DIAMETERS, size) ? size : 'm';
30
30
  const readyColor = colors_1.COLORS.has(color) ? color : DEFAULT_COLOR;
31
- return (react_1.default.createElement("div", { className: className, style: style, "data-testid": testId },
32
- react_1.default.createElement(SpinnerSVG, { size: readySize, color: readyColor, "data-testid": null })));
31
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: className, style: style, "data-testid": testId }, { children: (0, jsx_runtime_1.jsx)(SpinnerSVG, { size: readySize, color: readyColor, "data-testid": null }) })));
33
32
  }
34
33
  exports.Spinner = Spinner;
35
34
  /**
@@ -41,7 +40,6 @@ exports.Spinner = Spinner;
41
40
  function SpinnerSVG({ size = 'm', color = DEFAULT_COLOR, className, style, 'data-testid': testId = 'spinner', }) {
42
41
  const diameter = exports.DIAMETERS[size];
43
42
  const radius = diameter / 2;
44
- return (react_1.default.createElement("svg", { style: style, className: cx('spinner', `size-${size}`, className), viewBox: `0 0 ${diameter} ${diameter}`, width: diameter, height: diameter, stroke: colors_1.COLORS.get(color), "data-testid": testId },
45
- react_1.default.createElement("circle", { className: cx('circle'), cx: radius, cy: radius, r: radius - 1 })));
43
+ return ((0, jsx_runtime_1.jsx)("svg", Object.assign({ style: style, className: cx('spinner', `size-${size}`, className), viewBox: `0 0 ${diameter} ${diameter}`, width: diameter, height: diameter, stroke: colors_1.COLORS.get(color), "data-testid": testId }, { children: (0, jsx_runtime_1.jsx)("circle", { className: cx('circle'), cx: radius, cy: radius, r: radius - 1 }) })));
46
44
  }
47
45
  exports.SpinnerSVG = SpinnerSVG;