@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
@@ -1,33 +1,11 @@
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.Expandable = exports.ExpandableGroup = 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 bind_1 = __importDefault(require("classnames/bind"));
33
11
  const expandable_group_module_scss_1 = __importDefault(require("./expandable-group.module.scss"));
@@ -38,9 +16,7 @@ const ItemContext = (0, react_1.createContext)({});
38
16
  * @param props Свойства.
39
17
  * @return Элемент.
40
18
  */
41
- function ExpandableGroup({ gap = 8, itemHeight = 32, lineLimit = 2, defaultExpanded = false, children, onExpand, opener = data => react_1.default.createElement(react_1.default.Fragment, null,
42
- "\u0415\u0449\u0451 ",
43
- data.hiddenCount), className, style, expanded: expandedProp, openerWidth = 72, }) {
19
+ function ExpandableGroup({ gap = 8, itemHeight = 32, lineLimit = 2, defaultExpanded = false, children, onExpand, opener = data => (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["\u0415\u0449\u0451 ", data.hiddenCount] }), className, style, expanded: expandedProp, openerWidth = 72, }) {
44
20
  const wrapperRef = (0, react_1.useRef)(null);
45
21
  const containerRef = (0, react_1.useRef)(null);
46
22
  const openerRef = (0, react_1.useRef)(null);
@@ -65,19 +41,15 @@ function ExpandableGroup({ gap = 8, itemHeight = 32, lineLimit = 2, defaultExpan
65
41
  openerRef,
66
42
  gap,
67
43
  });
68
- return (react_1.default.createElement("div", { ref: wrapperRef, className: cx('root', className), style: Object.assign(Object.assign({}, style), { maxHeight: expanded ? undefined : `${itemHeight * lineLimit + gap * (lineLimit - 1)}px`, '--expandable-item-height': `${itemHeight}px`, '--expandable-opener-width': `${openerWidth}px`, '--expandable-gap': `${gap}px` }) },
69
- react_1.default.createElement("ul", { ref: containerRef, className: expandable_group_module_scss_1.default.inner },
70
- items,
71
- mounted && !expanded && (react_1.default.createElement(ItemContext.Provider, { value: { invisible: hiddenCount === 0, opener: true } },
72
- react_1.default.createElement(ExpandableItem, { ref: openerRef, onClick: () => {
73
- setExpanded(true);
74
- onExpand === null || onExpand === void 0 ? void 0 : onExpand();
75
- }, "data-testid": 'expandable:opener' }, opener({ hiddenCount })))))));
44
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ ref: wrapperRef, className: cx('root', className), style: Object.assign(Object.assign({}, style), { maxHeight: expanded ? undefined : `${itemHeight * lineLimit + gap * (lineLimit - 1)}px`, '--expandable-item-height': `${itemHeight}px`, '--expandable-opener-width': `${openerWidth}px`, '--expandable-gap': `${gap}px` }) }, { children: (0, jsx_runtime_1.jsxs)("ul", Object.assign({ ref: containerRef, className: expandable_group_module_scss_1.default.inner }, { children: [items, mounted && !expanded && ((0, jsx_runtime_1.jsx)(ItemContext.Provider, Object.assign({ value: { invisible: hiddenCount === 0, opener: true } }, { children: (0, jsx_runtime_1.jsx)(ExpandableItem, Object.assign({ ref: openerRef, onClick: () => {
45
+ setExpanded(true);
46
+ onExpand === null || onExpand === void 0 ? void 0 : onExpand();
47
+ }, "data-testid": 'expandable:opener' }, { children: opener({ hiddenCount }) })) })))] })) })));
76
48
  }
77
49
  exports.ExpandableGroup = ExpandableGroup;
78
50
  const ExpandableItem = (0, react_1.forwardRef)(({ children, onClick, 'data-testid': testId = 'expandable:item' }, ref) => {
79
51
  const context = (0, react_1.useContext)(ItemContext);
80
- return (react_1.default.createElement("li", { ref: ref, className: cx('item', context), "data-testid": testId, onClick: onClick }, children));
52
+ return ((0, jsx_runtime_1.jsx)("li", Object.assign({ ref: ref, className: cx('item', context), "data-testid": testId, onClick: onClick }, { children: children })));
81
53
  });
82
54
  exports.Expandable = {
83
55
  Group: ExpandableGroup,
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.FieldBlock = exports.FIELD_BLOCK_DEFAULTS = exports.FIELD_BLOCK_HEIGHT = void 0;
7
- const react_1 = __importDefault(require("react"));
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const bind_1 = __importDefault(require("classnames/bind"));
9
9
  const field_block_module_scss_1 = __importDefault(require("./field-block.module.scss"));
10
10
  const cx = bind_1.default.bind(field_block_module_scss_1.default);
@@ -31,13 +31,6 @@ function FieldBlock({ size = exports.FIELD_BLOCK_DEFAULTS.size, main, mainProps,
31
31
  'no-label': !needLabel,
32
32
  }, rootProps === null || rootProps === void 0 ? void 0 : rootProps.className);
33
33
  const blockClassName = cx('block', fixedHeight && 'fixed-height', blockProps === null || blockProps === void 0 ? void 0 : blockProps.className);
34
- return (react_1.default.createElement("div", Object.assign({}, rootProps, { ref: rootRef, className: rootClassName, "data-testid": testId }),
35
- react_1.default.createElement("div", Object.assign({}, blockProps, { ref: blockRef, className: blockClassName, "data-testid": 'field-block:block' }),
36
- adornmentStart && (react_1.default.createElement("div", { className: cx('col', 'adornment-col', 'start'), "data-testid": 'field-block:adornment-start' }, adornmentStart)),
37
- react_1.default.createElement("div", { className: cx('col', 'main-col') },
38
- needLabel && (react_1.default.createElement("label", Object.assign({}, labelProps, { className: cx('label', labelProps === null || labelProps === void 0 ? void 0 : labelProps.className), "data-testid": 'field-block:label' }), label)),
39
- react_1.default.createElement("div", Object.assign({}, mainProps, { className: cx('main', mainProps === null || mainProps === void 0 ? void 0 : mainProps.className), "data-testid": 'field-block:main' }), main)),
40
- adornmentEnd && (react_1.default.createElement("div", { className: cx('col', 'adornment-col', 'end'), "data-testid": 'field-block:adornment-end' }, adornmentEnd))),
41
- caption && (react_1.default.createElement("div", { className: cx('caption'), "data-testid": 'field-block:caption' }, caption))));
34
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, rootProps, { ref: rootRef, className: rootClassName, "data-testid": testId }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({}, blockProps, { ref: blockRef, className: blockClassName, "data-testid": 'field-block:block' }, { children: [adornmentStart && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('col', 'adornment-col', 'start'), "data-testid": 'field-block:adornment-start' }, { children: adornmentStart }))), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: cx('col', 'main-col') }, { children: [needLabel && ((0, jsx_runtime_1.jsx)("label", Object.assign({}, labelProps, { className: cx('label', labelProps === null || labelProps === void 0 ? void 0 : labelProps.className), "data-testid": 'field-block:label' }, { children: label }))), (0, jsx_runtime_1.jsx)("div", Object.assign({}, mainProps, { className: cx('main', mainProps === null || mainProps === void 0 ? void 0 : mainProps.className), "data-testid": 'field-block:main' }, { children: main }))] })), adornmentEnd && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('col', 'adornment-col', 'end'), "data-testid": 'field-block:adornment-end' }, { children: adornmentEnd })))] })), caption && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('caption'), "data-testid": 'field-block:caption' }, { children: caption })))] })));
42
35
  }
43
36
  exports.FieldBlock = FieldBlock;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { TextFieldProps } from '../text-field';
3
3
  type ItOrArray<T> = T[] | T;
4
4
  type CellSize = 'full' | 'half' | 'third';
@@ -1,33 +1,11 @@
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.FieldGrid = 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 bind_1 = __importDefault(require("classnames/bind"));
32
10
  const field_grid_module_scss_1 = __importDefault(require("./field-grid.module.scss"));
33
11
  const cx = bind_1.default.bind(field_grid_module_scss_1.default);
@@ -50,10 +28,10 @@ const TypeCheck = {
50
28
  */
51
29
  const FieldGrid = ({ children, rootProps }) => {
52
30
  const rows = react_1.Children.toArray(children).filter(TypeCheck.isRow);
53
- return (react_1.default.createElement("div", Object.assign({}, rootProps, { className: cx('container', rootProps === null || rootProps === void 0 ? void 0 : rootProps.className) }), rows.map((row, index) => (0, react_1.cloneElement)(row, {
54
- isFirst: index === 0,
55
- isLast: index === rows.length - 1,
56
- }))));
31
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, rootProps, { className: cx('container', rootProps === null || rootProps === void 0 ? void 0 : rootProps.className) }, { children: rows.map((row, index) => (0, react_1.cloneElement)(row, {
32
+ isFirst: index === 0,
33
+ isLast: index === rows.length - 1,
34
+ })) })));
57
35
  };
58
36
  exports.FieldGrid = FieldGrid;
59
37
  /**
@@ -69,45 +47,45 @@ const Row = ({ isFirst: isFirstRow, isLast: isLastRow, children }) => {
69
47
  .filter(TypeCheck.isCell)
70
48
  .slice(0, 3);
71
49
  const cellSize = cellSizeByCount[cells.length];
72
- return (react_1.default.createElement(react_1.default.Fragment, null, cells.map((cell, index) => {
73
- const isFirstCell = index === 0;
74
- const isLastCell = index === cells.length - 1;
75
- let rounds = 'none';
76
- if (isFirstRow && isLastRow) {
77
- if (isFirstCell && isLastCell) {
78
- rounds = 'all';
79
- }
80
- else if (isFirstCell) {
81
- rounds = 'left';
82
- }
83
- else if (isLastCell) {
84
- rounds = 'right';
85
- }
86
- }
87
- else if (isFirstRow) {
88
- if (isFirstCell && isLastCell) {
89
- rounds = 'top';
90
- }
91
- else if (isFirstCell) {
92
- rounds = 'topLeft';
93
- }
94
- else if (isLastCell) {
95
- rounds = 'topRight';
96
- }
97
- }
98
- else if (isLastRow) {
99
- if (isFirstCell && isLastCell) {
100
- rounds = 'bottom';
50
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: cells.map((cell, index) => {
51
+ const isFirstCell = index === 0;
52
+ const isLastCell = index === cells.length - 1;
53
+ let rounds = 'none';
54
+ if (isFirstRow && isLastRow) {
55
+ if (isFirstCell && isLastCell) {
56
+ rounds = 'all';
57
+ }
58
+ else if (isFirstCell) {
59
+ rounds = 'left';
60
+ }
61
+ else if (isLastCell) {
62
+ rounds = 'right';
63
+ }
101
64
  }
102
- else if (isFirstCell) {
103
- rounds = 'bottomLeft';
65
+ else if (isFirstRow) {
66
+ if (isFirstCell && isLastCell) {
67
+ rounds = 'top';
68
+ }
69
+ else if (isFirstCell) {
70
+ rounds = 'topLeft';
71
+ }
72
+ else if (isLastCell) {
73
+ rounds = 'topRight';
74
+ }
104
75
  }
105
- else if (isLastCell) {
106
- rounds = 'bottomRight';
76
+ else if (isLastRow) {
77
+ if (isFirstCell && isLastCell) {
78
+ rounds = 'bottom';
79
+ }
80
+ else if (isFirstCell) {
81
+ rounds = 'bottomLeft';
82
+ }
83
+ else if (isLastCell) {
84
+ rounds = 'bottomRight';
85
+ }
107
86
  }
108
- }
109
- return (0, react_1.cloneElement)(cell, { size: cellSize, rounds });
110
- })));
87
+ return (0, react_1.cloneElement)(cell, { size: cellSize, rounds });
88
+ }) }));
111
89
  };
112
90
  /**
113
91
  * Компонент элемента для сетки полей. Может быть использован только как дочерний для FieldGrid.Row.
@@ -132,7 +110,7 @@ const Cell = ({ size, rounds, field, renderField }) => {
132
110
  className: cx(field.props.className, 'size-full'),
133
111
  });
134
112
  }
135
- return react_1.default.createElement("div", { className: cx('cell', `size-${size}`) }, content);
113
+ return (0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('cell', `size-${size}`) }, { children: content }));
136
114
  };
137
115
  exports.FieldGrid.Row = Row;
138
116
  exports.FieldGrid.Cell = Cell;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  export interface FileIconProps extends Omit<React.SVGAttributes<SVGSVGElement>, 'type'> {
3
3
  /** Тип файла. */
4
4
  type?: string;
@@ -10,14 +10,10 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  }
11
11
  return t;
12
12
  };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
13
  Object.defineProperty(exports, "__esModule", { value: true });
17
14
  exports.FileIcon = void 0;
18
- const react_1 = __importDefault(require("react"));
15
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
16
  const colors_1 = require("../colors");
20
- const unknown_svg_1 = __importDefault(require("./unknown.svg"));
21
17
  const VARIANTS = {
22
18
  doc: { fill: colors_1.COLORS.get('additional-electric-blue') },
23
19
  xls: { fill: colors_1.COLORS.get('additional-light-green') },
@@ -25,6 +21,9 @@ const VARIANTS = {
25
21
  jpg: { fill: colors_1.COLORS.get('additional-deep-orange') },
26
22
  xml: { fill: colors_1.COLORS.get('additional-deep-purple') },
27
23
  zip: { fill: colors_1.COLORS.get('additional-teal') },
24
+ png: { fill: colors_1.COLORS.get('additional-purple') },
25
+ mov: { fill: colors_1.COLORS.get('additional-blue-gray') },
26
+ mp4: { fill: colors_1.COLORS.get('additional-blue-gray') },
28
27
  };
29
28
  /**
30
29
  * Компонент иконки файла.
@@ -34,10 +33,6 @@ const VARIANTS = {
34
33
  const FileIcon = (_a) => {
35
34
  var { type } = _a, svgProps = __rest(_a, ["type"]);
36
35
  const typeProps = VARIANTS[type];
37
- return type && typeProps ? (react_1.default.createElement("svg", Object.assign({ width: '32', height: '32', viewBox: '0 0 32 32' }, svgProps),
38
- react_1.default.createElement("path", { opacity: '0.88', d: 'M6 5C6 3.89543 6.89543 3 8 3H20L26 9V27C26 28.1046 25.1046 29 24 29H8C6.89543 29 6 28.1046 6 27V5Z', fill: typeProps.fill }),
39
- react_1.default.createElement("path", { opacity: '0.32', d: 'M21 9L26 9L20 3L20 8C20 8.55229 20.4477 9 21 9Z', fill: 'white' }),
40
- react_1.default.createElement("path", { opacity: '0.24', d: 'M25.1667 9L21 9L26 15L26 9C25.5833 9 25.6269 9 25.1667 9Z', fill: 'black' }),
41
- react_1.default.createElement("text", { x: '16', y: '23', textAnchor: 'middle', fontSize: '6.5', fontWeight: '700', fill: '#fff' }, type.toUpperCase()))) : (react_1.default.createElement(unknown_svg_1.default, Object.assign({}, svgProps)));
36
+ return type && typeProps ? ((0, jsx_runtime_1.jsxs)("svg", Object.assign({ width: '32', height: '32', viewBox: '0 0 32 32' }, svgProps, { children: [(0, jsx_runtime_1.jsx)("path", { opacity: '0.88', d: 'M6 5C6 3.89543 6.89543 3 8 3H20L26 9V27C26 28.1046 25.1046 29 24 29H8C6.89543 29 6 28.1046 6 27V5Z', fill: typeProps.fill }), (0, jsx_runtime_1.jsx)("path", { opacity: '0.32', d: 'M21 9L26 9L20 3L20 8C20 8.55229 20.4477 9 21 9Z', fill: 'white' }), (0, jsx_runtime_1.jsx)("path", { opacity: '0.24', d: 'M25.1667 9L21 9L26 15L26 9C25.5833 9 25.6269 9 25.1667 9Z', fill: 'black' }), (0, jsx_runtime_1.jsx)("text", Object.assign({ x: '16', y: '23', textAnchor: 'middle', fontSize: '6.5', fontWeight: '700', fill: '#fff' }, { children: type.toUpperCase() }))] }))) : ((0, jsx_runtime_1.jsxs)("svg", Object.assign({ width: '32', height: '32', viewBox: '0 0 32 32', fill: 'none' }, svgProps, { children: [(0, jsx_runtime_1.jsx)("path", { opacity: '0.88', d: 'M6 5C6 3.89543 6.89543 3 8 3H20L26 9V27C26 28.1046 25.1046 29 24 29H8C6.89543 29 6 28.1046 6 27V5Z', fill: '#C2C2C2' }), (0, jsx_runtime_1.jsx)("path", { opacity: '0.32', d: 'M21 9L26 9L20 3L20 8C20 8.55229 20.4477 9 21 9Z', fill: 'white' }), (0, jsx_runtime_1.jsx)("path", { opacity: '0.24', d: 'M25.1667 9L21 9L26 15L26 9C25.5833 9 25.6269 9 25.1667 9Z', fill: 'black' }), (0, jsx_runtime_1.jsxs)("g", Object.assign({ opacity: '0.8' }, { children: [(0, jsx_runtime_1.jsx)("path", { d: 'M9 22H23V24H9V22Z', fill: 'white' }), (0, jsx_runtime_1.jsx)("path", { d: 'M9 18H19V20H9V18Z', fill: 'white' })] }))] })));
42
37
  };
43
38
  exports.FileIcon = FileIcon;
@@ -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.GroupOverflow = 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 utils_1 = require("./utils");
43
21
  const classnames_1 = __importDefault(require("classnames"));
44
22
  const group_overflow_module_scss_1 = __importDefault(require("./group-overflow.module.scss"));
@@ -52,12 +30,10 @@ function GroupOverflow(_a) {
52
30
  const ref = (0, react_1.useRef)(null);
53
31
  const { state, start } = (0, utils_1.useItemsHide)(ref, el => { var _a; return (_a = el.parentElement) === null || _a === void 0 ? void 0 : _a.parentElement; });
54
32
  const total = react_1.Children.count(children);
55
- return (react_1.default.createElement("div", Object.assign({ className: (0, classnames_1.default)(group_overflow_module_scss_1.default.root, className), style: typeof gap === 'number'
33
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: (0, classnames_1.default)(group_overflow_module_scss_1.default.root, className), style: typeof gap === 'number'
56
34
  ? Object.assign(Object.assign({}, style), { '--group-overflow-gap': `${gap}px` })
57
- : style }, restProps),
58
- react_1.default.createElement("div", { ref: ref, className: group_overflow_module_scss_1.default.items }, state === 'initial'
59
- ? react_1.Children.toArray(children)
60
- : react_1.Children.toArray(children).slice(0, start)),
61
- state !== 'initial' && start < total && tail && (react_1.default.createElement("div", { className: group_overflow_module_scss_1.default.more }, tail({ hiddenCount: total - start })))));
35
+ : style }, restProps, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ ref: ref, className: group_overflow_module_scss_1.default.items }, { children: state === 'initial'
36
+ ? react_1.Children.toArray(children)
37
+ : react_1.Children.toArray(children).slice(0, start) })), state !== 'initial' && start < total && tail && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: group_overflow_module_scss_1.default.more }, { children: tail({ hiddenCount: total - start }) })))] })));
62
38
  }
63
39
  exports.GroupOverflow = GroupOverflow;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  export type SlotsDict = Record<string, React.ElementType>;
3
3
  export type Slots<M extends SlotsDict> = {
4
4
  [key in keyof M]: React.ReactElement<React.ComponentProps<M[key]>, M[key]> | undefined;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  export type EventWithPosition<T extends HTMLElement = HTMLElement> = MouseEvent | TouchEvent | React.MouseEvent<T> | React.TouchEvent<T>;
3
3
  /**
4
4
  * Проверяет, является ли событие событием нажатия основной кнопки мыши.
package/helpers/on.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  /**
3
3
  * Выполняет подписку на событие целевого объекта.
4
4
  * @param target Целевой объект.
package/hint/hint-view.js CHANGED
@@ -15,7 +15,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.HintView = exports.arrowSquareSize = void 0;
18
- const react_1 = __importDefault(require("react"));
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
19
  const bind_1 = __importDefault(require("classnames/bind"));
20
20
  const hint_view_module_scss_1 = __importDefault(require("./hint-view.module.scss"));
21
21
  const cx = bind_1.default.bind(hint_view_module_scss_1.default);
@@ -28,7 +28,7 @@ exports.arrowSquareSize = Math.sqrt(4 * 4 + 4 * 4);
28
28
  */
29
29
  function HintView(_a) {
30
30
  var { hintRef, className, children, 'data-testid': testId = 'hint' } = _a, rest = __rest(_a, ["hintRef", "className", "children", 'data-testid']);
31
- return (react_1.default.createElement("div", Object.assign({ ref: hintRef, className: cx('root', className), "data-testid": testId }, rest), children));
31
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ ref: hintRef, className: cx('root', className), "data-testid": testId }, rest, { children: children })));
32
32
  }
33
33
  exports.HintView = HintView;
34
34
  /**
@@ -38,6 +38,6 @@ exports.HintView = HintView;
38
38
  */
39
39
  function HintArrow(_a) {
40
40
  var { arrowRef, className } = _a, rest = __rest(_a, ["arrowRef", "className"]);
41
- return react_1.default.createElement("div", Object.assign({ ref: arrowRef, className: cx('arrow', className) }, rest));
41
+ return (0, jsx_runtime_1.jsx)("div", Object.assign({ ref: arrowRef, className: cx('arrow', className) }, rest));
42
42
  }
43
43
  HintView.Arrow = HintArrow;
package/hint/hint.js CHANGED
@@ -10,12 +10,9 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  }
11
11
  return t;
12
12
  };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
13
  Object.defineProperty(exports, "__esModule", { value: true });
17
14
  exports.Hint = void 0;
18
- const react_1 = __importDefault(require("react"));
15
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
16
  const portal_1 = require("../portal");
20
17
  const hint_view_1 = require("./hint-view");
21
18
  /**
@@ -25,7 +22,7 @@ const hint_view_1 = require("./hint-view");
25
22
  */
26
23
  function Hint(_a) {
27
24
  var { open } = _a, rest = __rest(_a, ["open"]);
28
- return react_1.default.createElement(portal_1.Portal, null, open && react_1.default.createElement(HintInner, Object.assign({}, rest)));
25
+ return (0, jsx_runtime_1.jsx)(portal_1.Portal, { children: open && (0, jsx_runtime_1.jsx)(HintInner, Object.assign({}, rest)) });
29
26
  }
30
27
  exports.Hint = Hint;
31
28
  /**
@@ -35,7 +32,5 @@ exports.Hint = Hint;
35
32
  */
36
33
  function HintInner(_a) {
37
34
  var { arrowRef, children } = _a, rest = __rest(_a, ["arrowRef", "children"]);
38
- return (react_1.default.createElement(hint_view_1.HintView, Object.assign({}, rest),
39
- children,
40
- react_1.default.createElement(hint_view_1.HintView.Arrow, { arrowRef: arrowRef })));
35
+ return ((0, jsx_runtime_1.jsxs)(hint_view_1.HintView, Object.assign({}, rest, { children: [children, (0, jsx_runtime_1.jsx)(hint_view_1.HintView.Arrow, { arrowRef: arrowRef })] })));
41
36
  }
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  type Direction = 'top' | 'left' | 'bottom' | 'right';
3
3
  export interface HintProps extends React.HTMLAttributes<HTMLDivElement> {
4
4
  /** С какой стороны появляется хинт. */
@@ -7,5 +7,5 @@ export interface HintProps extends React.HTMLAttributes<HTMLDivElement> {
7
7
  /**
8
8
  * @deprecated Теперь нужно использовать `hint`.
9
9
  */
10
- export declare const Hint: React.ForwardRefExoticComponent<HintProps & React.RefAttributes<HTMLDivElement | null>>;
10
+ export declare const Hint: import("react").ForwardRefExoticComponent<HintProps & import("react").RefAttributes<HTMLDivElement | null>>;
11
11
  export {};
@@ -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.Hint = 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 shadows_1 = require("../styling/shadows");
43
21
  const bind_1 = __importDefault(require("classnames/bind"));
44
22
  const hint_module_scss_1 = __importDefault(require("./hint.module.scss"));
@@ -48,6 +26,5 @@ const cx = bind_1.default.bind(hint_module_scss_1.default);
48
26
  */
49
27
  exports.Hint = (0, react_1.forwardRef)((_a, ref) => {
50
28
  var { children, className, direction } = _a, restProps = __rest(_a, ["children", "className", "direction"]);
51
- return (react_1.default.createElement("div", Object.assign({}, restProps, { ref: ref, className: cx('root', className, direction), "data-testid": 'hint' }),
52
- react_1.default.createElement("div", { className: cx('body', shadows_1.BoxShadow.z4) }, children)));
29
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, restProps, { ref: ref, className: cx('root', className, direction), "data-testid": 'hint' }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('body', shadows_1.BoxShadow.z4) }, { children: children })) })));
53
30
  });
@@ -1,33 +1,11 @@
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.useBreakpoint = exports.BreakpointProvider = 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 __1 = require("..");
32
10
  const is_browser_1 = __importDefault(require("../../helpers/is-browser"));
33
11
  const utils_1 = require("./utils");
@@ -43,7 +21,7 @@ function BreakpointProvider({ children }) {
43
21
  (0, __1.useIsomorphicLayoutEffect)(() => {
44
22
  (0, is_browser_1.default)() && setRegistry((0, utils_1.createRegistry)());
45
23
  }, []);
46
- return react_1.default.createElement(Context.Provider, { value: contextValue }, children);
24
+ return (0, jsx_runtime_1.jsx)(Context.Provider, Object.assign({ value: contextValue }, { children: children }));
47
25
  }
48
26
  exports.BreakpointProvider = BreakpointProvider;
49
27
  /**
@@ -1,34 +1,12 @@
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.InfoText = void 0;
30
- const react_1 = __importStar(require("react"));
31
- const information_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/information"));
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_1 = require("react");
9
+ const Information_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Information"));
32
10
  const bind_1 = __importDefault(require("classnames/bind"));
33
11
  const info_text_module_scss_1 = __importDefault(require("./info-text.module.scss"));
34
12
  const cx = bind_1.default.bind(info_text_module_scss_1.default);
@@ -39,22 +17,17 @@ const cx = bind_1.default.bind(info_text_module_scss_1.default);
39
17
  * @return Элемент.
40
18
  */
41
19
  function InfoText({ children, style, className, iconRef, onIconClick, iconActive, 'data-testid': testId = 'info-text', }) {
42
- return (react_1.default.createElement("span", { style: style, className: className, "data-testid": testId }, react_1.Children.toArray(children).map((item, index, array) => {
43
- if (index < array.length - 1) {
44
- return item;
45
- }
46
- else {
47
- const text = String(item);
48
- const lastSpaceIndex = text.lastIndexOf(' ');
49
- const head = text.slice(0, lastSpaceIndex);
50
- const last = text.slice(lastSpaceIndex);
51
- return (react_1.default.createElement(react_1.Fragment, { key: index },
52
- head,
53
- last && (react_1.default.createElement("span", { className: info_text_module_scss_1.default.last },
54
- last,
55
- react_1.default.createElement("button", { ref: iconRef, type: 'button', "aria-label": '\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u0435\u0435', disabled: !onIconClick, "aria-hidden": !onIconClick, onClick: onIconClick, className: cx('button', { active: iconActive }), "data-testid": 'info-text:icon' },
56
- react_1.default.createElement(information_1.default, { className: cx('icon') }))))));
57
- }
58
- })));
20
+ return ((0, jsx_runtime_1.jsx)("span", Object.assign({ style: style, className: className, "data-testid": testId }, { children: react_1.Children.toArray(children).map((item, index, array) => {
21
+ if (index < array.length - 1) {
22
+ return item;
23
+ }
24
+ else {
25
+ const text = String(item);
26
+ const lastSpaceIndex = text.lastIndexOf(' ');
27
+ const head = text.slice(0, lastSpaceIndex);
28
+ const last = text.slice(lastSpaceIndex);
29
+ return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [head, last && ((0, jsx_runtime_1.jsxs)("span", Object.assign({ className: info_text_module_scss_1.default.last }, { children: [last, (0, jsx_runtime_1.jsx)("button", Object.assign({ ref: iconRef, type: 'button', "aria-label": '\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u0435\u0435', disabled: !onIconClick, "aria-hidden": !onIconClick, onClick: onIconClick, className: cx('button', { active: iconActive }), "data-testid": 'info-text:icon' }, { children: (0, jsx_runtime_1.jsx)(Information_1.default, { className: cx('icon') }) }))] })))] }, index));
30
+ }
31
+ }) })));
59
32
  }
60
33
  exports.InfoText = InfoText;