@sima-land/ui-nucleons 45.0.0-alpha.3 → 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 (199) hide show
  1. package/_internal/custom-scrollbar/index.d.ts +2 -2
  2. package/_internal/custom-scrollbar/index.js +17 -14
  3. package/_internal/dropdown-loading/index.js +2 -3
  4. package/_internal/page-scroll-lock/context.js +3 -25
  5. package/alert/index.d.ts +2 -2
  6. package/alert/index.js +4 -30
  7. package/arrow-button/arrow-button.module.scss +5 -5
  8. package/arrow-button/index.js +18 -19
  9. package/autocomplete/autocomplete.js +49 -76
  10. package/autocomplete-deprecated/index.d.ts +1 -1
  11. package/autocomplete-deprecated/index.js +43 -67
  12. package/avatar/avatar.module.scss +3 -1
  13. package/avatar/index.d.ts +1 -1
  14. package/avatar/index.js +10 -36
  15. package/avatar/user.d.ts +1 -1
  16. package/avatar/user.js +8 -29
  17. package/avatar/utils.d.ts +1 -1
  18. package/avatar/utils.js +12 -10
  19. package/base-input/base-input.js +5 -31
  20. package/base-input-deprecated/index.d.ts +2 -2
  21. package/base-input-deprecated/index.js +8 -34
  22. package/bordered-layout/index.d.ts +1 -1
  23. package/bordered-layout/index.js +2 -3
  24. package/bottom-bar/bottom-bar.js +2 -3
  25. package/box/index.d.ts +1 -1
  26. package/box/index.js +2 -2
  27. package/button/index.d.ts +2 -2
  28. package/button/index.js +6 -32
  29. package/card/index.js +2 -8
  30. package/card/slots.d.ts +1 -1
  31. package/card/slots.js +9 -31
  32. package/carousel/draggable.d.ts +1 -1
  33. package/carousel/draggable.js +5 -28
  34. package/carousel/index.d.ts +1 -1
  35. package/carousel/index.js +17 -43
  36. package/checkbox/index.d.ts +2 -2
  37. package/checkbox/index.js +3 -29
  38. package/checkbox-field/index.d.ts +2 -2
  39. package/checkbox-field/index.js +3 -31
  40. package/chips/index.d.ts +1 -1
  41. package/chips/index.js +3 -25
  42. package/chips/item.d.ts +1 -1
  43. package/chips/item.js +3 -5
  44. package/clean-buttons/index.js +6 -28
  45. package/dot-nav/index.d.ts +1 -1
  46. package/dot-nav/index.js +12 -34
  47. package/dropdown/index.d.ts +2 -2
  48. package/dropdown/index.js +3 -26
  49. package/dropdown-item/index.d.ts +1 -1
  50. package/dropdown-item/index.js +4 -9
  51. package/expandable/index.d.ts +2 -2
  52. package/expandable/index.js +8 -36
  53. package/field-block/index.js +2 -9
  54. package/field-grid/index.d.ts +1 -1
  55. package/field-grid/index.js +43 -65
  56. package/file-icon/index.d.ts +1 -1
  57. package/file-icon/index.js +5 -10
  58. package/group-overflow/index.js +7 -29
  59. package/helpers/define-slots.d.ts +1 -1
  60. package/helpers/events.d.ts +1 -1
  61. package/helpers/on.d.ts +1 -1
  62. package/hint/hint-view.js +3 -3
  63. package/hint/hint.js +3 -8
  64. package/hint/utils.d.ts +4 -1
  65. package/hint/utils.js +4 -3
  66. package/hint-deprecated/index.d.ts +2 -2
  67. package/hint-deprecated/index.js +3 -26
  68. package/hooks/breakpoint/index.js +3 -25
  69. package/info-text/index.js +15 -42
  70. package/input/index.js +8 -30
  71. package/layout/layout.js +2 -2
  72. package/layout/legacy.d.ts +5 -5
  73. package/layout/legacy.js +3 -25
  74. package/link/index.d.ts +6 -3
  75. package/link/index.js +3 -25
  76. package/loading-overlay/index.d.ts +1 -1
  77. package/loading-overlay/index.js +2 -3
  78. package/masked-field/index.d.ts +2 -2
  79. package/masked-field/index.js +3 -25
  80. package/masked-input/masked-input.js +3 -25
  81. package/modal/index.d.ts +1 -1
  82. package/modal/index.js +3 -10
  83. package/modal/slots.js +6 -29
  84. package/modal-overlay/index.js +3 -26
  85. package/no-index/index.d.ts +3 -3
  86. package/no-index/index.js +4 -8
  87. package/no-index-mark/index.d.ts +2 -2
  88. package/no-index-mark/index.js +7 -6
  89. package/package.json +6 -11
  90. package/pagination/index.d.ts +4 -20
  91. package/pagination/index.js +8 -15
  92. package/pagination/pagination-item.d.ts +8 -0
  93. package/pagination/pagination-item.js +31 -0
  94. package/pagination/pagination-item.module.scss +49 -0
  95. package/pagination/pagination.d.ts +8 -0
  96. package/pagination/pagination.js +78 -0
  97. package/pagination/pagination.module.scss +14 -70
  98. package/pagination/types.d.ts +28 -0
  99. package/pagination/types.js +2 -0
  100. package/pagination/utils.d.ts +15 -43
  101. package/pagination/utils.js +38 -87
  102. package/{pagination → pagination-deprecated}/base-pagination.d.ts +6 -1
  103. package/{pagination → pagination-deprecated}/base-pagination.js +33 -33
  104. package/pagination-deprecated/index.d.ts +22 -0
  105. package/pagination-deprecated/index.js +15 -0
  106. package/{pagination → pagination-deprecated}/page-button.d.ts +2 -1
  107. package/{pagination → pagination-deprecated}/page-button.js +3 -5
  108. package/pagination-deprecated/pagination.module.scss +76 -0
  109. package/pagination-deprecated/utils.d.ts +58 -0
  110. package/pagination-deprecated/utils.js +124 -0
  111. package/panel/index.js +3 -6
  112. package/phone-input/images/armenia.png +0 -0
  113. package/phone-input/images/azerbaijan.png +0 -0
  114. package/phone-input/images/belarus.png +0 -0
  115. package/phone-input/images/georgia.png +0 -0
  116. package/phone-input/images/kazakhstan.png +0 -0
  117. package/phone-input/images/kyrgyzstan.png +0 -0
  118. package/phone-input/images/moldova.png +0 -0
  119. package/phone-input/images/other.png +0 -0
  120. package/phone-input/images/russia.png +0 -0
  121. package/phone-input/images/tajikistan.png +0 -0
  122. package/phone-input/images/turkmenistan.png +0 -0
  123. package/phone-input/images/ukraine.png +0 -0
  124. package/phone-input/images/uzbekistan.png +0 -0
  125. package/phone-input/phone-input.js +13 -37
  126. package/phone-input/presets.js +2 -0
  127. package/phone-input-deprecated/index.d.ts +1 -1
  128. package/phone-input-deprecated/index.js +31 -57
  129. package/plate/index.d.ts +2 -2
  130. package/plate/index.js +3 -25
  131. package/popup/popup-view.js +3 -6
  132. package/popup/popup.js +4 -26
  133. package/portal/index.d.ts +1 -1
  134. package/price/index.js +2 -2
  135. package/radio-button/index.js +2 -4
  136. package/range/index.d.ts +1 -1
  137. package/range/index.js +6 -33
  138. package/rating/index.d.ts +1 -1
  139. package/rating/index.js +4 -9
  140. package/readme.md +4 -67
  141. package/screen/index.d.ts +5 -5
  142. package/screen/index.js +11 -37
  143. package/screen/slots.d.ts +3 -3
  144. package/screen/slots.js +9 -31
  145. package/select/parts/block.js +6 -28
  146. package/select/parts/button.js +7 -29
  147. package/select/parts/menu.js +12 -33
  148. package/select/select.js +4 -28
  149. package/select-deprecated/index.d.ts +1 -1
  150. package/select-deprecated/index.js +32 -56
  151. package/side-page/index.js +4 -30
  152. package/side-page/slots.js +4 -4
  153. package/spinner/index.d.ts +1 -1
  154. package/spinner/index.js +3 -5
  155. package/spinner/spinner.module.scss +3 -1
  156. package/stepper/index.d.ts +2 -2
  157. package/stepper/index.js +11 -38
  158. package/stroked-svg/index.d.ts +2 -2
  159. package/stroked-svg/index.js +3 -27
  160. package/styling/sizes.module.scss +3 -1
  161. package/super-ellipse-clip-path/index.js +2 -8
  162. package/switcher-row/index.js +5 -10
  163. package/tabs/index.d.ts +1 -1
  164. package/tabs/index.js +4 -26
  165. package/text/index.d.ts +2 -2
  166. package/text/index.js +3 -25
  167. package/text-button/index.d.ts +2 -2
  168. package/text-button/index.js +4 -7
  169. package/text-button/text-button.module.scss +1 -1
  170. package/text-field/index.d.ts +2 -2
  171. package/text-field/index.js +25 -55
  172. package/textarea/index.js +4 -26
  173. package/timer/index.d.ts +1 -1
  174. package/timer/index.js +3 -25
  175. package/toggle/index.d.ts +2 -2
  176. package/toggle/index.js +3 -27
  177. package/tooltip/index.d.ts +2 -2
  178. package/tooltip/index.js +4 -28
  179. package/top-bar/index.d.ts +1 -1
  180. package/top-bar/index.js +3 -1
  181. package/top-bar/top-bar.js +5 -45
  182. package/top-bar/utils.d.ts +2 -2
  183. package/top-bar/utils.js +6 -28
  184. package/touch-slider/index.d.ts +1 -1
  185. package/touch-slider/index.js +2 -4
  186. package/unknown-content/index.d.ts +1 -1
  187. package/unknown-content/index.js +3 -25
  188. package/upload-area/upload-area.js +8 -38
  189. package/with-hint/index.d.ts +1 -1
  190. package/with-hint/index.js +3 -28
  191. package/with-hint/positioning-hint.d.ts +1 -1
  192. package/with-hint/positioning-hint.js +3 -25
  193. package/with-tooltip/index.d.ts +1 -1
  194. package/with-tooltip/index.js +6 -31
  195. package/with-tooltip/positioning-tooltip.d.ts +1 -1
  196. package/with-tooltip/positioning-tooltip.js +4 -26
  197. package/file-icon/unknown.svg +0 -9
  198. package/rating/star.svg +0 -3
  199. package/upload-area/upload.svg +0 -6
package/panel/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.Panel = exports.LINK_COLOR_BY_TYPE = void 0;
7
- const react_1 = __importDefault(require("react"));
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const colors_1 = require("../styling/colors");
9
9
  const bind_1 = __importDefault(require("classnames/bind"));
10
10
  const panel_module_scss_1 = __importDefault(require("./panel.module.scss"));
@@ -41,10 +41,7 @@ exports.LINK_COLOR_BY_TYPE = {
41
41
  function Panel({ type = 'info', adornmentStart, adornmentEnd, className, style, children, 'data-testid': testId = 'panel', }) {
42
42
  const textColor = PANEL_COLORS_BY_TYPE[type].textColor;
43
43
  const panelColor = PANEL_COLORS_BY_TYPE[type].panelColor;
44
- return (react_1.default.createElement("div", { className: cx('root', `type-${type}`, (0, colors_1.bgColor)(panelColor), (0, colors_1.color)(textColor), className), "data-testid": testId, style: style },
45
- adornmentStart && react_1.default.createElement("div", { className: cx('adornment') }, adornmentStart),
46
- react_1.default.createElement("div", { className: cx('main') }, children),
47
- adornmentEnd && react_1.default.createElement("div", { className: cx('adornment') }, adornmentEnd)));
44
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: cx('root', `type-${type}`, (0, colors_1.bgColor)(panelColor), (0, colors_1.color)(textColor), className), "data-testid": testId, style: style }, { children: [adornmentStart && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('adornment') }, { children: adornmentStart })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('main') }, { children: children })), adornmentEnd && (0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('adornment') }, { children: adornmentEnd }))] })));
48
45
  }
49
46
  exports.Panel = Panel;
50
47
  /**
@@ -53,6 +50,6 @@ exports.Panel = Panel;
53
50
  * @return Элемент.
54
51
  */
55
52
  function PanelUnknownContent({ markup }) {
56
- return react_1.default.createElement("div", { className: cx('unknown-content'), dangerouslySetInnerHTML: { __html: markup } });
53
+ return (0, jsx_runtime_1.jsx)("div", { className: cx('unknown-content'), dangerouslySetInnerHTML: { __html: markup } });
57
54
  }
58
55
  Panel.UnknownContent = PanelUnknownContent;
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -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.PhoneInput = 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_item_1 = require("../dropdown-item");
43
21
  const hooks_1 = require("../hooks");
44
22
  const masked_input_1 = require("../masked-input");
@@ -46,8 +24,8 @@ const presets_1 = require("./presets");
46
24
  const utils_1 = require("./utils");
47
25
  const select_1 = require("../select");
48
26
  const utils_2 = require("../select/utils");
49
- const up_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/up"));
50
- const down_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/down"));
27
+ const Up_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/Up"));
28
+ const Down_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/Down"));
51
29
  const bind_1 = __importDefault(require("classnames/bind"));
52
30
  const phone_input_module_scss_1 = __importDefault(require("./phone-input.module.scss"));
53
31
  const cx = bind_1.default.bind(phone_input_module_scss_1.default);
@@ -96,7 +74,7 @@ function PhoneInput(_a) {
96
74
  setCountry(selected);
97
75
  setCleanValue('');
98
76
  }, []);
99
- return (react_1.default.createElement(select_1.Select, { opener: react_1.default.createElement(PhoneMaskedInput, Object.assign({}, props, { "data-testid": testId, country: country, inputRef: inputRef, blockRef: blockRef, label: label, mask: country.mask, onFocus: (event, data) => {
77
+ return ((0, jsx_runtime_1.jsx)(select_1.Select, Object.assign({ opener: (0, jsx_runtime_1.jsx)(PhoneMaskedInput, Object.assign({}, props, { "data-testid": testId, country: country, inputRef: inputRef, blockRef: blockRef, label: label, mask: country.mask, onFocus: (event, data) => {
100
78
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(event, processData(data));
101
79
  }, onChange: (event, data) => {
102
80
  onChange === null || onChange === void 0 ? void 0 : onChange(event, processData(data));
@@ -105,11 +83,11 @@ function PhoneInput(_a) {
105
83
  }, value: cleanValue })), onValueChange: itemValue => {
106
84
  const item = presets_1.countriesList.find(c => c.id === itemValue);
107
85
  item && changeCountry(item);
108
- } }, presets_1.countriesList.map((item, index) => (react_1.default.createElement(dropdown_item_1.DropdownItem, { value: item.id, key: index, size: 'm', role: 'menuitem', onMouseDown: event => {
109
- // ВАЖНО: клик по блоку поля вызывает фокус на поле и preventDefault()
110
- // отменяем с помощью другого preventDefault()
111
- event.preventDefault();
112
- }, selected: item.id === country.id, startContent: react_1.default.createElement("img", { alt: '', width: 24, height: 24, src: item.imageSrc }), endContent: item.code }, item.name)))));
86
+ } }, { children: presets_1.countriesList.map((item, index) => ((0, jsx_runtime_1.jsx)(dropdown_item_1.DropdownItem, Object.assign({ value: item.id, size: 'm', role: 'menuitem', onMouseDown: event => {
87
+ // ВАЖНО: клик по блоку поля вызывает фокус на поле и preventDefault()
88
+ // отменяем с помощью другого preventDefault()
89
+ event.preventDefault();
90
+ }, selected: item.id === country.id, startContent: (0, jsx_runtime_1.jsx)("img", { alt: '', width: 24, height: 24, src: item.imageSrc }), endContent: item.code }, { children: item.name }), index))) })));
113
91
  }
114
92
  exports.PhoneInput = PhoneInput;
115
93
  /**
@@ -124,10 +102,8 @@ function PhoneMaskedInput(_a) {
124
102
  const [openerFocused, setOpenerFocused] = (0, react_1.useState)(false);
125
103
  (0, react_1.useImperativeHandle)(blockRefProp, () => blockRef.current);
126
104
  (0, react_1.useImperativeHandle)(select.anchorRef, () => blockRef.current);
127
- const ArrowSVG = select.opened ? up_1.default : down_1.default;
128
- return (react_1.default.createElement(masked_input_1.MaskedInput, Object.assign({}, props, {
105
+ const ArrowSVG = select.opened ? Up_1.default : Down_1.default;
106
+ return ((0, jsx_runtime_1.jsx)(masked_input_1.MaskedInput, Object.assign({}, props, {
129
107
  // ВАЖНО: undefined нужен для поведения по умолчанию если меню скрыто и кнопка не в фокусе
130
- focused: select.opened || openerFocused || undefined, blockRef: blockRef, baseInputProps: Object.assign({ restPlaceholder: country.id === presets_1.IDS.other ? '' : undefined }, props.baseInputProps), adornmentEnd: react_1.default.createElement("div", { ref: select.openerRef, tabIndex: 0, onFocus: () => setOpenerFocused(true), onBlur: () => setOpenerFocused(false), role: 'combobox', "aria-label": '\u0412\u044B\u0431\u043E\u0440 \u0441\u0442\u0440\u0430\u043D\u044B', className: cx('opener'), "data-testid": 'phone-input:menu-opener', onKeyDown: select.onKeyDown, onMouseDown: select.onMouseDown },
131
- react_1.default.createElement("img", { alt: '', width: 24, height: 24, src: country.imageSrc }),
132
- react_1.default.createElement(ArrowSVG, { className: phone_input_module_scss_1.default.arrow })) })));
108
+ focused: select.opened || openerFocused || undefined, blockRef: blockRef, baseInputProps: Object.assign({ restPlaceholder: country.id === presets_1.IDS.other ? '' : undefined }, props.baseInputProps), adornmentEnd: (0, jsx_runtime_1.jsxs)("div", Object.assign({ ref: select.openerRef, tabIndex: 0, onFocus: () => setOpenerFocused(true), onBlur: () => setOpenerFocused(false), role: 'combobox', "aria-label": '\u0412\u044B\u0431\u043E\u0440 \u0441\u0442\u0440\u0430\u043D\u044B', className: cx('opener'), "data-testid": 'phone-input:menu-opener', onKeyDown: select.onKeyDown, onMouseDown: select.onMouseDown }, { children: [(0, jsx_runtime_1.jsx)("img", { alt: '', width: 24, height: 24, src: country.imageSrc }), (0, jsx_runtime_1.jsx)(ArrowSVG, { className: phone_input_module_scss_1.default.arrow })] })) })));
133
109
  }
@@ -77,6 +77,8 @@ const IMAGES = {
77
77
  [exports.IDS.ukraine]: ukraine_png_1.default,
78
78
  [exports.IDS.other]: other_png_1.default,
79
79
  };
80
+ // @todo <Flag country='russia' /> под капотом оптимизация для флагов состоящих только из полос
81
+ // (простые флаги можно сделать на css чтобы не хранить лишние png)
80
82
  const CODES = {
81
83
  [exports.IDS.russia]: '+7',
82
84
  [exports.IDS.kazakhstan]: '+7',
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { TextFieldProps } from '../text-field';
3
3
  import { MaskState } from '../masked-field';
4
4
  import { Country } from '../phone-input/presets';
@@ -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,9 +15,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
15
  };
39
16
  Object.defineProperty(exports, "__esModule", { value: true });
40
17
  exports.PhoneInput = void 0;
41
- const react_1 = __importStar(require("react"));
42
- const down_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/down"));
43
- const up_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/up"));
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
+ const react_1 = require("react");
20
+ const Down_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/Down"));
21
+ const Up_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Arrows/Up"));
44
22
  const dropdown_1 = require("../dropdown");
45
23
  const dropdown_item_1 = require("../dropdown-item");
46
24
  const text_field_1 = require("../text-field");
@@ -78,12 +56,10 @@ const PhoneInput = (_a) => {
78
56
  (0, hooks_1.useOutsideClick)(rootRef, () => {
79
57
  toggleMenu(false);
80
58
  });
81
- const AdornmentSVG = withMenu ? up_1.default : down_1.default;
82
- const commonFieldProps = Object.assign(Object.assign({}, restProps), { label, multiline: false, className: cx('field'), endAdornment: (react_1.default.createElement("div", { ref: openerRef, className: cx('adornment'), "data-testid": 'phone-input:dropdown-opener', onClick: () => {
59
+ const AdornmentSVG = withMenu ? Up_1.default : Down_1.default;
60
+ const commonFieldProps = Object.assign(Object.assign({}, restProps), { label, multiline: false, className: cx('field'), endAdornment: ((0, jsx_runtime_1.jsxs)("div", Object.assign({ ref: openerRef, className: cx('adornment'), "data-testid": 'phone-input:dropdown-opener', onClick: () => {
83
61
  toggleMenu(a => !a);
84
- } },
85
- react_1.default.createElement("img", { alt: '', width: 24, height: 24, src: country.imageSrc }),
86
- react_1.default.createElement(AdornmentSVG, { className: cx('arrow') }))), onClick: event => {
62
+ } }, { children: [(0, jsx_runtime_1.jsx)("img", { alt: '', width: 24, height: 24, src: country.imageSrc }), (0, jsx_runtime_1.jsx)(AdornmentSVG, { className: cx('arrow') })] }))), onClick: event => {
87
63
  const opener = openerRef.current;
88
64
  if (opener instanceof Node &&
89
65
  event.target instanceof Node &&
@@ -94,31 +70,29 @@ const PhoneInput = (_a) => {
94
70
  toggleMenu(false);
95
71
  }
96
72
  } });
97
- return (react_1.default.createElement("div", { ref: rootRef, "data-testid": testId, style: style, className: cx('root', className) },
98
- country.id === presets_1.IDS.other ? (react_1.default.createElement(text_field_1.TextField, Object.assign({}, commonFieldProps, { value: cleanValue, onChange: (e) => {
99
- const nextValue = e.target.value.replace(/\D/g, '').slice(0, 20);
100
- e.target.value = nextValue;
101
- setCleanValue(nextValue);
102
- onChange && onChange(e);
103
- }, onBlur: e => {
104
- onBlur &&
105
- onBlur(e, {
106
- value: e.target.value,
107
- cleanValue: e.target.value,
108
- ready: e.target.value.length > 0,
109
- });
110
- } }))) : (react_1.default.createElement(masked_field_1.MaskedField, Object.assign({}, commonFieldProps, {
111
- // убираем код страны, так как он уже зашит в маску
112
- value: cleanValue, mask: country.mask, onBlur: (event, state) => {
113
- onBlur &&
114
- onBlur(event, Object.assign(Object.assign({}, state), {
115
- // вставляем код страны обратно в чистое значение
116
- cleanValue: `${country.codeChars}${state.cleanValue}` }));
117
- } }))),
118
- withMenu && (react_1.default.createElement(dropdown_1.Dropdown, { role: 'menu', className: cx('menu'), "data-testid": 'phone-input:dropdown' }, presets_1.countriesList.map((item, index) => item.id === country.id ? null : (react_1.default.createElement(dropdown_item_1.DropdownItem, { key: index, size: 'm', role: 'menuitem', className: cx('menu-item'), onClick: () => {
119
- toggleMenu(false);
120
- setCountry(item);
121
- onCountrySelect && onCountrySelect(item);
122
- }, startContent: react_1.default.createElement("img", { alt: '', width: 24, height: 24, src: item.imageSrc, className: cx('country-icon') }), endContent: item.code }, item.name)))))));
73
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ ref: rootRef, "data-testid": testId, style: style, className: cx('root', className) }, { children: [country.id === presets_1.IDS.other ? ((0, jsx_runtime_1.jsx)(text_field_1.TextField, Object.assign({}, commonFieldProps, { value: cleanValue, onChange: (e) => {
74
+ const nextValue = e.target.value.replace(/\D/g, '').slice(0, 20);
75
+ e.target.value = nextValue;
76
+ setCleanValue(nextValue);
77
+ onChange && onChange(e);
78
+ }, onBlur: e => {
79
+ onBlur &&
80
+ onBlur(e, {
81
+ value: e.target.value,
82
+ cleanValue: e.target.value,
83
+ ready: e.target.value.length > 0,
84
+ });
85
+ } }))) : ((0, jsx_runtime_1.jsx)(masked_field_1.MaskedField, Object.assign({}, commonFieldProps, {
86
+ // убираем код страны, так как он уже зашит в маску
87
+ value: cleanValue, mask: country.mask, onBlur: (event, state) => {
88
+ onBlur &&
89
+ onBlur(event, Object.assign(Object.assign({}, state), {
90
+ // вставляем код страны обратно в чистое значение
91
+ cleanValue: `${country.codeChars}${state.cleanValue}` }));
92
+ } }))), withMenu && ((0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, Object.assign({ role: 'menu', className: cx('menu'), "data-testid": 'phone-input:dropdown' }, { children: presets_1.countriesList.map((item, index) => item.id === country.id ? null : ((0, jsx_runtime_1.jsx)(dropdown_item_1.DropdownItem, Object.assign({ size: 'm', role: 'menuitem', className: cx('menu-item'), onClick: () => {
93
+ toggleMenu(false);
94
+ setCountry(item);
95
+ onCountrySelect && onCountrySelect(item);
96
+ }, startContent: (0, jsx_runtime_1.jsx)("img", { alt: '', width: 24, height: 24, src: item.imageSrc, className: cx('country-icon') }), endContent: item.code }, { children: item.name }), index))) })))] })));
123
97
  };
124
98
  exports.PhoneInput = PhoneInput;
package/plate/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { BoxShadow } from '../styling/shadows';
3
3
  export interface PlateProps extends React.HTMLAttributes<HTMLDivElement> {
4
4
  /** Тень. */
@@ -12,4 +12,4 @@ export interface PlateProps extends React.HTMLAttributes<HTMLDivElement> {
12
12
  * Plate это просто div с возможностью легко задавать тень и скругления.
13
13
  * И он должен оставаться компонентом, который только задает оформление обычного div.
14
14
  */
15
- export declare const Plate: React.ForwardRefExoticComponent<PlateProps & React.RefAttributes<HTMLDivElement | null>>;
15
+ export declare const Plate: import("react").ForwardRefExoticComponent<PlateProps & import("react").RefAttributes<HTMLDivElement | null>>;
package/plate/index.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,7 +15,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
38
15
  };
39
16
  Object.defineProperty(exports, "__esModule", { value: true });
40
17
  exports.Plate = 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 shapes_1 = require("../styling/shapes");
44
22
  const classnames_1 = __importDefault(require("classnames"));
@@ -49,5 +27,5 @@ const plate_module_scss_1 = __importDefault(require("./plate.module.scss"));
49
27
  */
50
28
  exports.Plate = (0, react_1.forwardRef)(function Plate(_a, ref) {
51
29
  var { className, children, rounds = 's', shadow = 'z1', 'data-testid': testId = 'plate' } = _a, restProps = __rest(_a, ["className", "children", "rounds", "shadow", 'data-testid']);
52
- return (react_1.default.createElement("div", Object.assign({ ref: ref, className: (0, classnames_1.default)(plate_module_scss_1.default.root, className, shadow && shadows_1.BoxShadow[shadow], rounds === 's' && shapes_1.SmallRounds.all, rounds === 'm' && shapes_1.MediumRounds.all), "data-testid": testId, children: children }, restProps)));
30
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({ ref: ref, className: (0, classnames_1.default)(plate_module_scss_1.default.root, className, shadow && shadows_1.BoxShadow[shadow], rounds === 's' && shapes_1.SmallRounds.all, rounds === 'm' && shapes_1.MediumRounds.all), "data-testid": testId, children: children }, restProps)));
53
31
  });
@@ -15,8 +15,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.PopupView = void 0;
18
- const react_1 = __importDefault(require("react"));
19
- const cross_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/cross"));
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
+ const Cross_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/Cross"));
20
20
  const bind_1 = __importDefault(require("classnames/bind"));
21
21
  const popup_view_module_scss_1 = __importDefault(require("./popup-view.module.scss"));
22
22
  const cx = bind_1.default.bind(popup_view_module_scss_1.default);
@@ -27,9 +27,6 @@ const cx = bind_1.default.bind(popup_view_module_scss_1.default);
27
27
  */
28
28
  function PopupView(_a) {
29
29
  var { children, onClose, popupRef, className, 'data-testid': testId = 'popup' } = _a, rest = __rest(_a, ["children", "onClose", "popupRef", "className", 'data-testid']);
30
- return (react_1.default.createElement("div", Object.assign({}, rest, { className: cx('root', className), ref: popupRef, "data-testid": testId }),
31
- onClose && (react_1.default.createElement("button", { "aria-label": '\u0417\u0430\u043A\u0440\u044B\u0442\u044C', className: cx('close'), onClick: onClose, "data-testid": 'popup:close' },
32
- react_1.default.createElement(cross_1.default, null))),
33
- react_1.default.createElement("div", { className: cx('content') }, children)));
30
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, rest, { className: cx('root', className), ref: popupRef, "data-testid": testId }, { children: [onClose && ((0, jsx_runtime_1.jsx)("button", Object.assign({ "aria-label": '\u0417\u0430\u043A\u0440\u044B\u0442\u044C', className: cx('close'), onClick: onClose, "data-testid": 'popup:close' }, { children: (0, jsx_runtime_1.jsx)(Cross_1.default, {}) }))), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: cx('content') }, { children: children }))] })));
34
31
  }
35
32
  exports.PopupView = PopupView;
package/popup/popup.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.Popup = 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 popup_view_1 = require("./popup-view");
40
18
  const react_2 = require("@floating-ui/react");
41
19
  const hooks_1 = require("../hooks");
@@ -49,7 +27,7 @@ const portal_1 = require("../portal");
49
27
  */
50
28
  function Popup(_a) {
51
29
  var { showFor } = _a, rest = __rest(_a, ["showFor"]);
52
- return react_1.default.createElement(portal_1.Portal, null, showFor && react_1.default.createElement(PopupInner, Object.assign({ showFor: showFor }, rest)));
30
+ return (0, jsx_runtime_1.jsx)(portal_1.Portal, { children: showFor && (0, jsx_runtime_1.jsx)(PopupInner, Object.assign({ showFor: showFor }, rest)) });
53
31
  }
54
32
  exports.Popup = Popup;
55
33
  /**
@@ -69,5 +47,5 @@ function PopupInner(_a) {
69
47
  enabled: floating.isPositioned,
70
48
  afterDeactivate: onDismiss,
71
49
  });
72
- return (react_1.default.createElement(popup_view_1.PopupView, Object.assign({}, rest, { popupRef: refs.setFloating, style: Object.assign(Object.assign({}, style), floatingStyle), onClose: onDismiss }), children));
50
+ return ((0, jsx_runtime_1.jsx)(popup_view_1.PopupView, Object.assign({}, rest, { popupRef: refs.setFloating, style: Object.assign(Object.assign({}, style), floatingStyle), onClose: onDismiss }, { children: children })));
73
51
  }
package/portal/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  export interface PortalProps {
3
3
  /** Вернет элемент, в который нужно вывести содержимое через портал. */
4
4
  defineRoot?: () => HTMLElement;
package/price/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.Price = void 0;
7
- const react_1 = __importDefault(require("react"));
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const utils_1 = require("./utils");
9
9
  const bind_1 = __importDefault(require("classnames/bind"));
10
10
  const price_module_scss_1 = __importDefault(require("./price.module.scss"));
@@ -18,6 +18,6 @@ function Price({ className, currencyGrapheme: grapheme, graphemeBefore, crossedO
18
18
  const content = (0, utils_1.formatPrice)(value, grapheme, {
19
19
  graphemeBefore,
20
20
  });
21
- return (react_1.default.createElement("span", { className: cx('root', className, crossedOut && 'crossed-out'), "data-testid": testId }, content));
21
+ return ((0, jsx_runtime_1.jsx)("span", Object.assign({ className: cx('root', className, crossedOut && 'crossed-out'), "data-testid": testId }, { children: content })));
22
22
  }
23
23
  exports.Price = Price;
@@ -15,7 +15,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.RadioButton = 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 radio_button_module_scss_1 = __importDefault(require("./radio-button.module.scss"));
21
21
  const cx = bind_1.default.bind(radio_button_module_scss_1.default);
@@ -26,8 +26,6 @@ const cx = bind_1.default.bind(radio_button_module_scss_1.default);
26
26
  */
27
27
  function RadioButton(_a) {
28
28
  var { style, className, 'data-testid': testId = 'radio-button' } = _a, restProps = __rest(_a, ["style", "className", 'data-testid']);
29
- return (react_1.default.createElement("div", { style: style, className: cx('root', className) },
30
- react_1.default.createElement("input", Object.assign({}, restProps, { type: 'radio', className: cx('input'), "data-testid": testId })),
31
- react_1.default.createElement("div", { className: cx('circle') })));
29
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ style: style, className: cx('root', className) }, { children: [(0, jsx_runtime_1.jsx)("input", Object.assign({}, restProps, { type: 'radio', className: cx('input'), "data-testid": testId })), (0, jsx_runtime_1.jsx)("div", { className: cx('circle') })] })));
32
30
  }
33
31
  exports.RadioButton = RadioButton;
package/range/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React, { Component } from 'react';
1
+ import { Component } from 'react';
2
2
  import { Container } from '../helpers/create-container';
3
3
  interface CallbackData {
4
4
  startValue: number;
package/range/index.js CHANGED
@@ -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.Range = 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 with_prevent_1 = __importDefault(require("../helpers/with-prevent"));
32
10
  const bounds_of_1 = __importDefault(require("../helpers/bounds-of"));
33
11
  const create_container_1 = __importDefault(require("../helpers/create-container"));
@@ -273,15 +251,10 @@ class Range extends react_1.Component {
273
251
  render() {
274
252
  var _a;
275
253
  const [start, finish] = this.getPercents();
276
- return (react_1.default.createElement("div", Object.assign({}, this.props.wrapperProps, { className: cx('range-wrapper-base', 'range-wrapper-styled', this.props.disabled && 'disabled', (_a = this.props.wrapperProps) === null || _a === void 0 ? void 0 : _a.className) }),
277
- react_1.default.createElement("div", { className: cx('track-base', 'available-base', 'available-styled') }),
278
- react_1.default.createElement("div", { ref: this.rangeRef, className: cx('track-base', 'selected-base', 'selected-styled'), style: {
279
- left: `${start}%`,
280
- width: `${finish - start}%`,
281
- } }),
282
- react_1.default.createElement("div", { ref: this.containerRef, className: cx('range-container-base', 'range-container-styled') },
283
- react_1.default.createElement("button", { type: 'button', "aria-label": '\u041D\u0430\u0447\u0430\u043B\u044C\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D\u0430', ref: this.startThumbRef, className: cx('thumb-base', 'thumb-styled'), style: { left: `${start}%` }, "data-testid": 'range:thumb-start' }),
284
- react_1.default.createElement("button", { type: 'button', "aria-label": '\u041A\u043E\u043D\u0435\u0447\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D\u0430', ref: this.finishThumbRef, className: cx('thumb-base', 'thumb-styled'), style: { left: `${finish}%` }, "data-testid": 'range:thumb-end' }))));
254
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, this.props.wrapperProps, { className: cx('range-wrapper-base', 'range-wrapper-styled', this.props.disabled && 'disabled', (_a = this.props.wrapperProps) === null || _a === void 0 ? void 0 : _a.className) }, { children: [(0, jsx_runtime_1.jsx)("div", { className: cx('track-base', 'available-base', 'available-styled') }), (0, jsx_runtime_1.jsx)("div", { ref: this.rangeRef, className: cx('track-base', 'selected-base', 'selected-styled'), style: {
255
+ left: `${start}%`,
256
+ width: `${finish - start}%`,
257
+ } }), (0, jsx_runtime_1.jsxs)("div", Object.assign({ ref: this.containerRef, className: cx('range-container-base', 'range-container-styled') }, { children: [(0, jsx_runtime_1.jsx)("button", { type: 'button', "aria-label": '\u041D\u0430\u0447\u0430\u043B\u044C\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D\u0430', ref: this.startThumbRef, className: cx('thumb-base', 'thumb-styled'), style: { left: `${start}%` }, "data-testid": 'range:thumb-start' }), (0, jsx_runtime_1.jsx)("button", { type: 'button', "aria-label": '\u041A\u043E\u043D\u0435\u0447\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D\u0430', ref: this.finishThumbRef, className: cx('thumb-base', 'thumb-styled'), style: { left: `${finish}%` }, "data-testid": 'range:thumb-end' })] }))] })));
285
258
  }
286
259
  }
287
260
  exports.Range = Range;
package/rating/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  export type StarSize = 's' | 'm';
3
3
  export interface RatingProps extends React.HTMLAttributes<HTMLDivElement> {
4
4
  /** Размер. */
package/rating/index.js CHANGED
@@ -15,10 +15,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.Rating = void 0;
18
- const react_1 = __importDefault(require("react"));
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
19
  const utils_1 = require("./utils");
20
20
  const bind_1 = __importDefault(require("classnames/bind"));
21
- const star_svg_1 = __importDefault(require("./star.svg"));
21
+ const Star_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Filled/Star"));
22
22
  const rating_module_scss_1 = __importDefault(require("./rating.module.scss"));
23
23
  const cx = bind_1.default.bind(rating_module_scss_1.default);
24
24
  /**
@@ -28,7 +28,7 @@ const cx = bind_1.default.bind(rating_module_scss_1.default);
28
28
  */
29
29
  const Rating = (_a) => {
30
30
  var { size = 's', value, className, 'data-testid': testId = 'rating' } = _a, restProps = __rest(_a, ["size", "value", "className", 'data-testid']);
31
- return (react_1.default.createElement("div", Object.assign({}, restProps, { className: cx('root', className), "data-testid": testId, "data-rating": value }), (0, utils_1.getStars)(Math.min(5, value), 5).map((type, index) => (react_1.default.createElement(Star, { key: index, type: type, size: size })))));
31
+ return ((0, jsx_runtime_1.jsx)("div", Object.assign({}, restProps, { className: cx('root', className), "data-testid": testId, "data-rating": value }, { children: (0, utils_1.getStars)(Math.min(5, value), 5).map((type, index) => ((0, jsx_runtime_1.jsx)(Star, { type: type, size: size }, index))) })));
32
32
  };
33
33
  exports.Rating = Rating;
34
34
  /**
@@ -36,9 +36,4 @@ exports.Rating = Rating;
36
36
  * @param props Свойства.
37
37
  * @return Элемент.
38
38
  */
39
- const Star = ({ type, size }) => (react_1.default.createElement("div", { className: cx('star', `size-${size}`) },
40
- type === 'empty' && react_1.default.createElement(star_svg_1.default, { className: cx('svg') }),
41
- type === 'half' && (react_1.default.createElement(react_1.default.Fragment, null,
42
- react_1.default.createElement(star_svg_1.default, { className: cx('svg') }),
43
- react_1.default.createElement(star_svg_1.default, { className: cx('svg', 'half'), preserveAspectRatio: 'xMinYMin slice' }))),
44
- type === 'full' && react_1.default.createElement(star_svg_1.default, { className: cx('svg', 'full') })));
39
+ const Star = ({ type, size }) => ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: cx('star', `size-${size}`) }, { children: [type === 'empty' && (0, jsx_runtime_1.jsx)(Star_1.default, { className: cx('svg') }), type === 'half' && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Star_1.default, { className: cx('svg') }), (0, jsx_runtime_1.jsx)(Star_1.default, { className: cx('svg', 'half'), preserveAspectRatio: 'xMinYMin slice' })] })), type === 'full' && (0, jsx_runtime_1.jsx)(Star_1.default, { className: cx('svg', 'full') })] })));