@sima-land/ui-nucleons 44.2.10 → 45.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (376) hide show
  1. package/_internal/custom-scrollbar/index.d.ts +13 -7
  2. package/_internal/custom-scrollbar/index.js +29 -15
  3. package/_internal/dropdown-loading/index.d.ts +3 -3
  4. package/_internal/dropdown-loading/index.js +4 -2
  5. package/_internal/page-scroll-lock/adapters/body-scroll-lock.d.ts +39 -0
  6. package/_internal/page-scroll-lock/adapters/body-scroll-lock.js +62 -0
  7. package/_internal/page-scroll-lock/adapters/ui-nucleons.d.ts +25 -0
  8. package/_internal/page-scroll-lock/adapters/ui-nucleons.js +103 -0
  9. package/_internal/page-scroll-lock/context.d.ts +13 -0
  10. package/_internal/page-scroll-lock/context.js +54 -0
  11. package/_internal/page-scroll-lock/hook.d.ts +12 -0
  12. package/_internal/page-scroll-lock/hook.js +26 -0
  13. package/_internal/page-scroll-lock/index.d.ts +4 -0
  14. package/_internal/page-scroll-lock/index.js +9 -0
  15. package/_internal/page-scroll-lock/types.d.ts +22 -0
  16. package/_internal/{checkbox/index.js → page-scroll-lock/types.js} +0 -0
  17. package/_internal/readme.md +2 -0
  18. package/_internal/utils/dropdown.d.ts +1 -0
  19. package/_internal/utils/dropdown.js +1 -0
  20. package/alert/alert.module.scss +1 -24
  21. package/alert/index.d.ts +11 -17
  22. package/alert/index.js +33 -16
  23. package/arrow-button/arrow-button.module.scss +2 -0
  24. package/arrow-button/index.d.ts +2 -2
  25. package/autocomplete/autocomplete.d.ts +8 -0
  26. package/autocomplete/autocomplete.js +190 -0
  27. package/autocomplete/autocomplete.module.scss +2 -15
  28. package/autocomplete/index.d.ts +2 -27
  29. package/autocomplete/index.js +2 -126
  30. package/autocomplete/types.d.ts +19 -0
  31. package/autocomplete/types.js +2 -0
  32. package/autocomplete-deprecated/autocomplete.module.scss +20 -0
  33. package/autocomplete-deprecated/index.d.ts +28 -0
  34. package/autocomplete-deprecated/index.js +130 -0
  35. package/avatar/index.d.ts +2 -2
  36. package/avatar/user.d.ts +1 -1
  37. package/base-input/base-input.d.ts +11 -0
  38. package/base-input/base-input.js +96 -0
  39. package/base-input/base-input.module.scss +3 -3
  40. package/base-input/index.d.ts +2 -23
  41. package/base-input/index.js +2 -76
  42. package/base-input/types.d.ts +31 -0
  43. package/base-input/types.js +2 -0
  44. package/base-input/utils.d.ts +6 -0
  45. package/base-input/utils.js +14 -0
  46. package/base-input-deprecated/base-input.module.scss +66 -0
  47. package/base-input-deprecated/index.d.ts +24 -0
  48. package/base-input-deprecated/index.js +80 -0
  49. package/bordered-layout/index.d.ts +1 -0
  50. package/bordered-layout/index.js +1 -0
  51. package/bottom-bar/bottom-bar-util.scss +20 -0
  52. package/bottom-bar/bottom-bar.d.ts +12 -0
  53. package/bottom-bar/bottom-bar.js +47 -0
  54. package/bottom-bar/bottom-bar.module.scss +14 -0
  55. package/bottom-bar/index.d.ts +2 -21
  56. package/bottom-bar/index.js +5 -44
  57. package/bottom-bar/types.d.ts +10 -0
  58. package/bottom-bar/types.js +2 -0
  59. package/box/index.d.ts +1 -1
  60. package/breakpoints.scss +1 -1
  61. package/button/button.module.scss +70 -53
  62. package/button/index.d.ts +26 -41
  63. package/button/index.js +22 -46
  64. package/card/index.d.ts +2 -1
  65. package/card/index.js +23 -6
  66. package/card/slots.d.ts +17 -3
  67. package/card/slots.js +15 -13
  68. package/carousel/draggable.d.ts +7 -3
  69. package/carousel/draggable.js +10 -3
  70. package/carousel/helpers/draggable-event.d.ts +5 -2
  71. package/carousel/helpers/draggable-event.js +5 -0
  72. package/carousel/index.d.ts +1 -1
  73. package/carousel/index.js +24 -24
  74. package/checkbox/checkbox.module.scss +1 -0
  75. package/checkbox/index.d.ts +3 -3
  76. package/checkbox-field/index.d.ts +3 -0
  77. package/checkbox-field/index.js +3 -0
  78. package/clean-buttons/clean-buttons-util.scss +15 -0
  79. package/clean-buttons/clean-buttons.module.scss +5 -3
  80. package/clean-buttons/index.d.ts +16 -7
  81. package/clean-buttons/index.js +17 -14
  82. package/clean-buttons/types.d.ts +1 -1
  83. package/clean-buttons/utils.d.ts +5 -1
  84. package/clean-buttons/utils.js +4 -0
  85. package/{colors.d.ts → colors/index.d.ts} +1 -1
  86. package/{colors.js → colors/index.js} +0 -0
  87. package/dot-nav/index.d.ts +1 -1
  88. package/dropdown/index.d.ts +1 -0
  89. package/dropdown/utils.d.ts +19 -0
  90. package/dropdown/utils.js +45 -0
  91. package/dropdown-item/dropdown-item.module.scss +80 -15
  92. package/dropdown-item/index.d.ts +20 -9
  93. package/dropdown-item/index.js +12 -9
  94. package/dropdown-item/types.d.ts +3 -0
  95. package/dropdown-item/types.js +2 -0
  96. package/dropdown-item/utils.d.ts +45 -0
  97. package/dropdown-item/utils.js +89 -0
  98. package/expandable/utils.js +3 -3
  99. package/field-block/field-block.module.scss +155 -0
  100. package/field-block/index.d.ts +63 -0
  101. package/field-block/index.js +43 -0
  102. package/field-grid/index.d.ts +5 -4
  103. package/field-grid/index.js +1 -0
  104. package/helpers/bounds-of.d.ts +5 -1
  105. package/helpers/bounds-of.js +5 -0
  106. package/helpers/center-of.d.ts +4 -1
  107. package/helpers/center-of.js +8 -1
  108. package/helpers/create-container.d.ts +5 -2
  109. package/helpers/create-container.js +7 -2
  110. package/helpers/define-slots.d.ts +3 -3
  111. package/helpers/define-slots.js +5 -3
  112. package/helpers/events.d.ts +16 -8
  113. package/helpers/events.js +41 -15
  114. package/helpers/find-child-element.d.ts +12 -9
  115. package/helpers/find-child-element.js +9 -5
  116. package/helpers/find-offset-parent.d.ts +1 -2
  117. package/helpers/find-offset-parent.js +2 -2
  118. package/helpers/find-sibling-index.d.ts +11 -8
  119. package/helpers/find-sibling-index.js +8 -3
  120. package/helpers/fit-element-height.d.ts +5 -5
  121. package/helpers/fit-element-height.js +9 -7
  122. package/helpers/format-date.d.ts +11 -11
  123. package/helpers/format-date.js +15 -13
  124. package/helpers/format-number.d.ts +1 -1
  125. package/helpers/format-number.js +2 -2
  126. package/helpers/get-date-interval-data.d.ts +4 -1
  127. package/helpers/get-date-interval-data.js +7 -2
  128. package/helpers/get-declination.d.ts +5 -1
  129. package/helpers/get-declination.js +5 -0
  130. package/helpers/get-fraction-depth.d.ts +1 -1
  131. package/helpers/get-fraction-depth.js +2 -2
  132. package/helpers/get-no-index.d.ts +2 -2
  133. package/helpers/get-no-index.js +4 -3
  134. package/helpers/get-relative-pos.d.ts +4 -1
  135. package/helpers/get-relative-pos.js +7 -2
  136. package/helpers/get-scroll-parent.d.ts +1 -2
  137. package/helpers/get-scroll-parent.js +5 -5
  138. package/helpers/is-browser.d.ts +4 -1
  139. package/helpers/is-browser.js +8 -1
  140. package/helpers/is-fully-scrolled.d.ts +3 -3
  141. package/helpers/is-fully-scrolled.js +2 -2
  142. package/helpers/is-touch-device.d.ts +1 -1
  143. package/helpers/is-touch-device.js +4 -5
  144. package/helpers/layer.d.ts +1 -1
  145. package/helpers/layer.js +2 -2
  146. package/helpers/max-index-of.d.ts +4 -1
  147. package/helpers/max-index-of.js +7 -2
  148. package/helpers/media-query-list.d.ts +1 -1
  149. package/helpers/media-query-list.js +2 -2
  150. package/helpers/on.d.ts +4 -1
  151. package/helpers/on.js +7 -2
  152. package/helpers/point.d.ts +4 -1
  153. package/helpers/point.js +8 -1
  154. package/helpers/rename.d.ts +3 -1
  155. package/helpers/rename.js +1 -0
  156. package/helpers/scroll-to-child.d.ts +1 -1
  157. package/helpers/scroll-to-child.js +3 -2
  158. package/helpers/styles.d.ts +8 -2
  159. package/helpers/styles.js +18 -4
  160. package/helpers/with-prevent.d.ts +9 -6
  161. package/helpers/with-prevent.js +16 -9
  162. package/hint/hint-view.d.ts +26 -0
  163. package/hint/hint-view.js +43 -0
  164. package/hint/hint-view.module.scss +31 -0
  165. package/hint/hint.d.ts +14 -0
  166. package/hint/hint.js +41 -0
  167. package/hint/index.d.ts +5 -8
  168. package/hint/index.js +13 -48
  169. package/hint/utils.d.ts +61 -0
  170. package/hint/utils.js +161 -0
  171. package/{hint → hint-deprecated}/hint.module.scss +0 -0
  172. package/hint-deprecated/index.d.ts +11 -0
  173. package/hint-deprecated/index.js +53 -0
  174. package/hooks/breakpoint/index.d.ts +7 -4
  175. package/hooks/breakpoint/index.js +21 -13
  176. package/hooks/breakpoint/types.d.ts +3 -4
  177. package/hooks/breakpoint/utils.d.ts +2 -1
  178. package/hooks/breakpoint/utils.js +2 -1
  179. package/hooks/index.d.ts +8 -8
  180. package/hooks/index.js +27 -19
  181. package/hooks/intersection/test-utils.d.ts +1 -1
  182. package/hooks/intersection/test-utils.js +2 -1
  183. package/hooks/styles.d.ts +6 -0
  184. package/hooks/styles.js +26 -0
  185. package/info-text/index.d.ts +23 -0
  186. package/info-text/index.js +60 -0
  187. package/info-text/info-text.module.scss +28 -0
  188. package/input/index.d.ts +32 -0
  189. package/input/index.js +96 -0
  190. package/input/input.module.scss +20 -0
  191. package/input/utils.d.ts +36 -0
  192. package/input/utils.js +71 -0
  193. package/layout/index.d.ts +6 -11
  194. package/layout/index.js +6 -60
  195. package/layout/layout.d.ts +10 -0
  196. package/layout/layout.js +32 -0
  197. package/layout/layout.module.scss +33 -26
  198. package/layout/legacy.d.ts +15 -0
  199. package/layout/legacy.js +68 -0
  200. package/layout/legacy.module.scss +49 -0
  201. package/layout/types.d.ts +6 -0
  202. package/layout/types.js +2 -0
  203. package/link/index.d.ts +4 -1
  204. package/link/index.js +2 -2
  205. package/link/link.module.scss +10 -0
  206. package/loading-overlay/index.d.ts +1 -0
  207. package/loading-overlay/index.js +1 -0
  208. package/masked-field/index.d.ts +1 -0
  209. package/masked-field/index.js +1 -0
  210. package/masked-input/hook.d.ts +8 -0
  211. package/masked-input/hook.js +72 -0
  212. package/masked-input/index.d.ts +5 -0
  213. package/masked-input/index.js +7 -0
  214. package/masked-input/masked-input.d.ts +8 -0
  215. package/masked-input/masked-input.js +73 -0
  216. package/masked-input/types.d.ts +51 -0
  217. package/masked-input/types.js +2 -0
  218. package/masked-input/utils.d.ts +15 -0
  219. package/masked-input/utils.js +49 -0
  220. package/modal/index.d.ts +10 -12
  221. package/modal/index.js +27 -64
  222. package/modal/modal.module.scss +98 -55
  223. package/modal/slots.d.ts +13 -10
  224. package/modal/slots.js +30 -28
  225. package/modal/utils.d.ts +8 -10
  226. package/modal/utils.js +2 -26
  227. package/modal-overlay/index.d.ts +13 -0
  228. package/modal-overlay/index.js +60 -0
  229. package/modal-overlay/modal-overlay-util.scss +1 -0
  230. package/modal-overlay/modal-overlay.module.scss +14 -0
  231. package/modal-overlay/utils.d.ts +14 -0
  232. package/modal-overlay/utils.js +32 -0
  233. package/package.json +49 -41
  234. package/pagination/utils.d.ts +2 -2
  235. package/panel/index.d.ts +27 -13
  236. package/panel/index.js +43 -9
  237. package/panel/panel.module.scss +49 -8
  238. package/phone-input/index.d.ts +4 -28
  239. package/phone-input/index.js +2 -121
  240. package/phone-input/phone-input.d.ts +8 -0
  241. package/phone-input/phone-input.js +133 -0
  242. package/phone-input/phone-input.module.scss +8 -32
  243. package/phone-input/presets.d.ts +21 -22
  244. package/phone-input/presets.js +1 -2
  245. package/phone-input/types.d.ts +6 -0
  246. package/phone-input/types.js +2 -0
  247. package/phone-input/utils.d.ts +30 -1
  248. package/phone-input/utils.js +52 -3
  249. package/phone-input-deprecated/index.d.ts +29 -0
  250. package/phone-input-deprecated/index.js +124 -0
  251. package/phone-input-deprecated/phone-input.module.scss +41 -0
  252. package/plate/index.d.ts +3 -3
  253. package/plate/index.js +2 -2
  254. package/plate/plate.module.scss +3 -0
  255. package/popup/index.d.ts +5 -0
  256. package/popup/index.js +12 -0
  257. package/popup/popup-view.d.ts +14 -0
  258. package/popup/popup-view.js +35 -0
  259. package/popup/popup-view.module.scss +40 -0
  260. package/popup/popup.d.ts +17 -0
  261. package/popup/popup.js +73 -0
  262. package/popup/utils.d.ts +38 -0
  263. package/popup/utils.js +83 -0
  264. package/price/index.d.ts +1 -1
  265. package/price/index.js +3 -3
  266. package/price/utils.d.ts +5 -5
  267. package/price/utils.js +33 -23
  268. package/radio-button/index.d.ts +10 -0
  269. package/radio-button/index.js +33 -0
  270. package/radio-button/radio-button.module.scss +46 -0
  271. package/rating/index.d.ts +2 -1
  272. package/rating/types.d.ts +1 -1
  273. package/readme.md +34 -41
  274. package/screen/index.d.ts +4 -2
  275. package/screen/index.js +34 -3
  276. package/screen/screen.module.scss +0 -2
  277. package/screen/slots.d.ts +2 -8
  278. package/screen/slots.js +8 -9
  279. package/screen/utils.d.ts +2 -1
  280. package/select/index.d.ts +2 -33
  281. package/select/index.js +3 -109
  282. package/select/parts/block.d.ts +8 -0
  283. package/select/parts/block.js +70 -0
  284. package/select/parts/block.module.scss +3 -0
  285. package/select/parts/button.d.ts +8 -0
  286. package/select/parts/button.js +69 -0
  287. package/select/parts/menu.d.ts +8 -0
  288. package/select/parts/menu.js +105 -0
  289. package/select/parts/menu.module.scss +4 -0
  290. package/select/select.d.ts +14 -0
  291. package/select/select.js +145 -0
  292. package/select/types.d.ts +55 -0
  293. package/select/types.js +2 -0
  294. package/select/utils.d.ts +3 -0
  295. package/select/utils.js +13 -0
  296. package/select-deprecated/index.d.ts +34 -0
  297. package/select-deprecated/index.js +112 -0
  298. package/{select → select-deprecated}/select.module.scss +0 -0
  299. package/shadows.scss +18 -0
  300. package/side-page/index.d.ts +11 -26
  301. package/side-page/index.js +21 -26
  302. package/side-page/side-page.module.scss +35 -29
  303. package/side-page/slots.d.ts +12 -20
  304. package/side-page/slots.js +16 -28
  305. package/spinner/index.d.ts +18 -6
  306. package/spinner/index.js +25 -12
  307. package/spinner/spinner.module.scss +8 -0
  308. package/stepper/index.d.ts +18 -10
  309. package/stepper/index.js +17 -8
  310. package/stepper/stepper.module.scss +14 -15
  311. package/styling/fonts.d.ts +3 -3
  312. package/switcher-row/index.d.ts +42 -0
  313. package/switcher-row/index.js +59 -0
  314. package/switcher-row/switcher-row.module.scss +55 -0
  315. package/text/index.d.ts +1 -1
  316. package/text-button/index.d.ts +42 -0
  317. package/text-button/index.js +46 -0
  318. package/text-button/text-button.module.scss +99 -0
  319. package/text-field/index.d.ts +7 -6
  320. package/text-field/index.js +3 -2
  321. package/textarea/index.d.ts +21 -0
  322. package/textarea/index.js +85 -0
  323. package/textarea/textarea.module.scss +15 -0
  324. package/toggle/index.d.ts +3 -3
  325. package/toggle/toggle.module.scss +17 -8
  326. package/tooltip/index.d.ts +1 -0
  327. package/tooltip/index.js +1 -0
  328. package/top-bar/index.d.ts +3 -40
  329. package/top-bar/index.js +4 -60
  330. package/top-bar/top-bar-util.scss +29 -0
  331. package/top-bar/top-bar.d.ts +9 -0
  332. package/top-bar/top-bar.js +101 -0
  333. package/top-bar/top-bar.module.scss +129 -67
  334. package/top-bar/types.d.ts +31 -0
  335. package/top-bar/types.js +2 -0
  336. package/top-bar/utils.d.ts +14 -0
  337. package/top-bar/utils.js +56 -0
  338. package/touch-slider/index.d.ts +1 -0
  339. package/touch-slider/index.js +3 -2
  340. package/types.d.ts +18 -0
  341. package/types.js +2 -0
  342. package/unknown-content/index.d.ts +3 -3
  343. package/unknown-content/index.js +3 -3
  344. package/unknown-content/unknown-content.module.scss +16 -12
  345. package/upload-area/index.d.ts +2 -0
  346. package/upload-area/index.js +5 -0
  347. package/upload-area/types.d.ts +32 -0
  348. package/upload-area/types.js +2 -0
  349. package/upload-area/upload-area-util.scss +17 -0
  350. package/upload-area/upload-area.d.ts +8 -0
  351. package/upload-area/upload-area.js +105 -0
  352. package/upload-area/upload-area.module.scss +78 -0
  353. package/{upload → upload-area}/upload.svg +0 -0
  354. package/upload-area/utils.d.ts +17 -0
  355. package/upload-area/utils.js +48 -0
  356. package/utils.scss +74 -1
  357. package/with-hint/index.d.ts +3 -2
  358. package/with-hint/index.js +1 -0
  359. package/with-hint/positioning-hint.d.ts +1 -1
  360. package/with-hint/positioning-hint.js +2 -2
  361. package/with-tooltip/index.d.ts +2 -1
  362. package/with-tooltip/index.js +1 -0
  363. package/with-tooltip/utils.d.ts +2 -2
  364. package/_internal/body-scroll.d.ts +0 -23
  365. package/_internal/body-scroll.js +0 -41
  366. package/_internal/checkbox/index.d.ts +0 -5
  367. package/constants.d.ts +0 -6
  368. package/constants.js +0 -9
  369. package/nav-bar/index.d.ts +0 -46
  370. package/nav-bar/index.js +0 -76
  371. package/nav-bar/nav-bar.module.scss +0 -95
  372. package/upload/area.d.ts +0 -25
  373. package/upload/area.js +0 -65
  374. package/upload/area.module.scss +0 -44
  375. package/upload/utils.d.ts +0 -29
  376. package/upload/utils.js +0 -45
@@ -40,11 +40,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
40
40
  exports.SidePage = void 0;
41
41
  const react_1 = __importStar(require("react"));
42
42
  const define_slots_1 = require("../helpers/define-slots");
43
- const utils_1 = require("../modal/utils");
44
- const layer_1 = require("../helpers/layer");
45
- const body_scroll_1 = require("../_internal/body-scroll");
43
+ const page_scroll_lock_1 = require("../_internal/page-scroll-lock");
46
44
  const slots_1 = require("./slots");
47
45
  const CSSTransition_1 = __importDefault(require("react-transition-group/CSSTransition"));
46
+ const modal_overlay_1 = require("../modal-overlay");
47
+ const utils_1 = require("../modal-overlay/utils");
48
48
  const bind_1 = __importDefault(require("classnames/bind"));
49
49
  const side_page_module_scss_1 = __importDefault(require("./side-page.module.scss"));
50
50
  const cx = bind_1.default.bind(side_page_module_scss_1.default);
@@ -59,38 +59,33 @@ const transitionClasses = {
59
59
  * @param props Свойства.
60
60
  * @return Элемент.
61
61
  */
62
- const SidePage = (_a) => {
62
+ function SidePage(_a) {
63
63
  var { shown, withTransitions, onEnter, onEntering, onEntered, onExit, onExiting, onExited } = _a, restProps = __rest(_a, ["shown", "withTransitions", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited"]);
64
64
  const transitionDuration = withTransitions ? 300 : 0;
65
65
  return (react_1.default.createElement(CSSTransition_1.default, { in: shown, timeout: transitionDuration, classNames: transitionClasses, unmountOnExit: true, onEntering: onEntering, onEnter: onEnter, onEntered: onEntered, onExit: onExit, onExiting: onExiting, onExited: onExited }, transitionStatus => (react_1.default.createElement(SidePageInner, Object.assign({}, restProps, { transitionStatus, transitionDuration })))));
66
- };
66
+ }
67
67
  exports.SidePage = SidePage;
68
68
  /**
69
69
  * Фиктивный компонент, необходимый для того чтобы задействовать хук блокировки прокрутки внутри CSSTransition.
70
70
  * @param props Свойства.
71
71
  * @return Элемент.
72
72
  */
73
- const SidePageInner = ({ size = 'm', children, onClose, withScrollDisable, scrollDisableOptions, transitionStatus, transitionDuration, }) => {
74
- const layer = (0, layer_1.useLayer)() + 100;
75
- const overlayBind = (0, utils_1.useCloseHandler)(onClose);
73
+ function SidePageInner({ size = 'm', children, onClose, withScrollDisable = false, scrollDisableOptions, transitionStatus, transitionDuration, }) {
74
+ const overlayClickBind = (0, utils_1.useExactClick)(onClose);
76
75
  const ref = (0, react_1.useRef)(null);
77
- const overlayStyles = {
78
- zIndex: layer,
79
- '--transition-duration': `${transitionDuration}ms`,
80
- };
76
+ (0, page_scroll_lock_1.usePageScrollLock)(ref, Object.assign({ lockEnabled: withScrollDisable }, scrollDisableOptions));
81
77
  const { header, body, footer } = (0, define_slots_1.defineSlots)(children, {
82
- header: exports.SidePage.Header,
83
- body: exports.SidePage.Body,
84
- footer: exports.SidePage.Footer,
78
+ header: SidePage.Header,
79
+ body: SidePage.Body,
80
+ footer: SidePage.Footer,
85
81
  });
86
- (0, body_scroll_1.useBodyScrollLock)(ref, withScrollDisable, scrollDisableOptions);
87
- return (react_1.default.createElement("div", Object.assign({ ref: ref, className: cx('overlay'), style: overlayStyles }, (transitionStatus !== 'entering' && overlayBind)),
88
- react_1.default.createElement(layer_1.LayerProvider, { value: layer },
89
- react_1.default.createElement("div", { className: cx('main', `size-${size}`) },
90
- header,
91
- react_1.default.createElement("div", { className: cx('body') }, body),
92
- footer))));
93
- };
94
- exports.SidePage.Header = slots_1.SidePageHeader;
95
- exports.SidePage.Body = slots_1.SidePageBody;
96
- exports.SidePage.Footer = slots_1.SidePageFooter;
82
+ const overlayProps = Object.assign({ style: { '--transition-duration': `${transitionDuration}ms` } }, (transitionStatus !== 'entering' && overlayClickBind));
83
+ return (react_1.default.createElement(modal_overlay_1.ModalOverlay, Object.assign({}, overlayProps),
84
+ react_1.default.createElement("div", { className: cx('side-page', `size-${size}`) },
85
+ header,
86
+ react_1.default.createElement("div", { ref: ref, className: cx('body') }, body),
87
+ footer)));
88
+ }
89
+ SidePage.Header = slots_1.SidePageHeader;
90
+ SidePage.Body = slots_1.SidePageBody;
91
+ SidePage.Footer = slots_1.SidePageFooter;
@@ -1,17 +1,10 @@
1
1
  @use '../colors';
2
+ @use '../breakpoints';
3
+ @use '../top-bar/top-bar-util';
4
+ @use '../bottom-bar/bottom-bar-util';
5
+ @use '../modal-overlay/modal-overlay-util';
2
6
 
3
- $overlay-color: rgba(0, 0, 0, 0.24);
4
-
5
- .overlay {
6
- position: fixed;
7
- top: 0;
8
- left: 0;
9
- right: 0;
10
- bottom: 0;
11
- background: $overlay-color;
12
- }
13
-
14
- .main {
7
+ .side-page {
15
8
  position: absolute;
16
9
  top: 0;
17
10
  right: 0;
@@ -20,18 +13,34 @@ $overlay-color: rgba(0, 0, 0, 0.24);
20
13
  display: flex;
21
14
  flex-direction: column;
22
15
  background: #fff;
23
- }
24
-
25
- .size-s {
26
- max-width: 488px;
27
- }
28
-
29
- .size-m {
30
- max-width: 968px;
16
+ @include breakpoints.down('xs') {
17
+ width: 100%;
18
+ .header {
19
+ @include top-bar-util.size-m;
20
+ }
21
+ .footer {
22
+ @include bottom-bar-util.size-m;
23
+ }
24
+ }
25
+ @include breakpoints.up('xs') {
26
+ &.size-s {
27
+ max-width: 488px;
28
+ }
29
+ &.size-m {
30
+ max-width: 968px;
31
+ }
32
+ .header {
33
+ @include top-bar-util.size-xl;
34
+ }
35
+ .footer {
36
+ @include bottom-bar-util.size-l;
37
+ }
38
+ }
31
39
  }
32
40
 
33
41
  .header {
34
42
  flex-shrink: 0;
43
+ width: 100%;
35
44
  }
36
45
 
37
46
  .body {
@@ -42,32 +51,29 @@ $overlay-color: rgba(0, 0, 0, 0.24);
42
51
  .footer {
43
52
  flex-shrink: 0;
44
53
  width: 100%;
45
- &.padded {
46
- padding: 0 40px;
47
- }
48
54
  }
49
55
 
50
56
  // transitions
51
57
  .enter {
52
58
  background-color: transparent;
53
- .main {
59
+ .side-page {
54
60
  transform: translateX(100%);
55
61
  }
56
62
  }
57
63
 
58
64
  .enter-active {
59
65
  transition: background-color var(--transition-duration) ease-in-out;
60
- background-color: $overlay-color;
66
+ background-color: modal-overlay-util.$overlay-color;
61
67
  overflow: hidden;
62
- .main {
68
+ .side-page {
63
69
  transition: transform var(--transition-duration) ease-in-out;
64
70
  transform: translateX(0);
65
71
  }
66
72
  }
67
73
 
68
74
  .exit {
69
- background-color: $overlay-color;
70
- .main {
75
+ background-color: modal-overlay-util.$overlay-color;
76
+ .side-page {
71
77
  transform: translateX(0);
72
78
  }
73
79
  }
@@ -76,7 +82,7 @@ $overlay-color: rgba(0, 0, 0, 0.24);
76
82
  transition: background-color var(--transition-duration) ease-in-out;
77
83
  background-color: transparent;
78
84
  overflow: hidden;
79
- .main {
85
+ .side-page {
80
86
  transition: transform var(--transition-duration) ease-in-out;
81
87
  transform: translateX(100%);
82
88
  }
@@ -1,34 +1,26 @@
1
- import React from 'react';
1
+ import { ReactNode } from 'react';
2
2
  import { TopBarProps } from '../top-bar';
3
3
  import { BottomBarProps } from '../bottom-bar';
4
4
  /**
5
+ * Шапка SidePage.
5
6
  * @param props Свойства.
6
7
  * @return Элемент.
7
8
  */
8
- export declare const SidePageHeader: {
9
- ({ onBack, onClose, ...topBarProps }: TopBarProps & {
10
- onBack?: (() => void) | undefined;
11
- onClose?: (() => void) | undefined;
12
- }): JSX.Element;
13
- displayName: string;
14
- };
9
+ export declare function SidePageHeader({ onBack, onClose, buttons, ...topBarProps }: TopBarProps & {
10
+ onBack?: () => void;
11
+ onClose?: () => void;
12
+ }): JSX.Element;
15
13
  /**
14
+ * Основной контент SidePage.
16
15
  * @param props Свойства.
17
16
  * @return Элемент.
18
17
  */
19
- export declare const SidePageBody: {
20
- ({ children }: {
21
- children?: React.ReactNode;
22
- }): JSX.Element;
23
- displayName: string;
24
- };
18
+ export declare function SidePageBody({ children }: {
19
+ children?: ReactNode;
20
+ }): JSX.Element;
25
21
  /**
22
+ * Подвал SidePage.
26
23
  * @param props Свойства.
27
24
  * @return Элемент.
28
25
  */
29
- export declare const SidePageFooter: {
30
- ({ padded, ...props }: BottomBarProps & {
31
- padded?: boolean | undefined;
32
- }): JSX.Element;
33
- displayName: string;
34
- };
26
+ export declare function SidePageFooter({ ...props }: BottomBarProps): JSX.Element;
@@ -18,47 +18,35 @@ exports.SidePageFooter = exports.SidePageBody = exports.SidePageHeader = void 0;
18
18
  const react_1 = __importDefault(require("react"));
19
19
  const top_bar_1 = require("../top-bar");
20
20
  const bottom_bar_1 = require("../bottom-bar");
21
- const cross_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Stroked/cross"));
22
- const arrow_left_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Stroked/arrow-left"));
23
- const side_page_module_scss_1 = __importDefault(require("./side-page.module.scss"));
21
+ const utils_1 = require("../top-bar/utils");
24
22
  const classnames_1 = __importDefault(require("classnames"));
23
+ const side_page_module_scss_1 = __importDefault(require("./side-page.module.scss"));
25
24
  /**
25
+ * Шапка SidePage.
26
26
  * @param props Свойства.
27
27
  * @return Элемент.
28
28
  */
29
- const SidePageHeader = (_a) => {
30
- var { onBack, onClose } = _a, topBarProps = __rest(_a, ["onBack", "onClose"]);
31
- return (react_1.default.createElement(top_bar_1.TopBar, Object.assign({}, topBarProps, { size: 'm', className: side_page_module_scss_1.default.header, buttonsProps: Object.assign(Object.assign(Object.assign({}, topBarProps.buttonsProps), (onBack && {
32
- start: {
33
- 'data-testid': 'side-page:back',
34
- onClick: onBack,
35
- icon: react_1.default.createElement(arrow_left_1.default, null),
36
- },
37
- })), (onClose && {
38
- end: {
39
- 'data-testid': 'side-page:close',
40
- onClick: onClose,
41
- icon: react_1.default.createElement(cross_1.default, null),
42
- },
43
- })) })));
44
- };
29
+ function SidePageHeader(_a) {
30
+ var { onBack, onClose, buttons } = _a, topBarProps = __rest(_a, ["onBack", "onClose", "buttons"]);
31
+ return (react_1.default.createElement(top_bar_1.TopBar, Object.assign({}, topBarProps, { size: 'unset', className: side_page_module_scss_1.default.header, buttons: (0, utils_1.navigationButtons)({ buttons, onBack, onClose }) })));
32
+ }
45
33
  exports.SidePageHeader = SidePageHeader;
46
- exports.SidePageHeader.displayName = 'SidePage.Header';
47
34
  /**
35
+ * Основной контент SidePage.
48
36
  * @param props Свойства.
49
37
  * @return Элемент.
50
38
  */
51
- const SidePageBody = ({ children }) => react_1.default.createElement(react_1.default.Fragment, null, children);
39
+ function SidePageBody({ children }) {
40
+ return react_1.default.createElement(react_1.default.Fragment, null, children);
41
+ }
52
42
  exports.SidePageBody = SidePageBody;
53
- exports.SidePageBody.displayName = 'SidePage.Body';
54
43
  /**
44
+ * Подвал SidePage.
55
45
  * @param props Свойства.
56
46
  * @return Элемент.
57
47
  */
58
- const SidePageFooter = (_a) => {
59
- var { padded = true } = _a, // @todo по умолчанию true для обратной совместимости - убрать true в ближайшем мажоре
60
- props = __rest(_a, ["padded"]);
61
- return (react_1.default.createElement(bottom_bar_1.BottomBar, Object.assign({}, props, { size: 'l', className: (0, classnames_1.default)(side_page_module_scss_1.default.footer, padded && side_page_module_scss_1.default.padded) })));
62
- };
48
+ function SidePageFooter(_a) {
49
+ var props = __rest(_a, []);
50
+ return react_1.default.createElement(bottom_bar_1.BottomBar, Object.assign({}, props, { size: 'unset', className: (0, classnames_1.default)(side_page_module_scss_1.default.footer) }));
51
+ }
63
52
  exports.SidePageFooter = SidePageFooter;
64
- exports.SidePageFooter.displayName = 'SidePage.Footer';
@@ -1,22 +1,34 @@
1
1
  import React from 'react';
2
2
  import { Token } from '../colors';
3
- declare type SpinnerColor = Extract<Token, 'basic-blue' | 'basic-white'>;
4
- declare type Size = 'small' | 'medium' | 'large';
3
+ /**
4
+ * @deprecated Следует использовать 's' | 'm' | 'l'.
5
+ */
6
+ type SpinnerLegacySize = 'small' | 'medium' | 'large';
7
+ export type SpinnerSize = 's' | 'm' | 'l';
5
8
  export interface SpinnerProps {
6
9
  /** Размер. */
7
- size?: Size;
10
+ size?: SpinnerSize | SpinnerLegacySize;
8
11
  /** Цвет. */
9
- color?: SpinnerColor;
12
+ color?: Token;
10
13
  /** Класс. */
11
14
  className?: string;
12
15
  /** Стили. */
13
16
  style?: React.CSSProperties;
17
+ /** Идентификатор для систем автоматизированного тестирования. */
18
+ 'data-testid'?: string | null;
14
19
  }
15
- export declare const DIAMETERS: Record<Size, number>;
20
+ export declare const DIAMETERS: Record<SpinnerSize | SpinnerLegacySize, number>;
16
21
  /**
17
22
  * Компонент спиннера.
18
23
  * @param props Свойства.
19
24
  * @return Элемент.
20
25
  */
21
- export declare const Spinner: ({ size, color, className, style, }: SpinnerProps) => JSX.Element;
26
+ export declare function Spinner({ size, color, className, style, 'data-testid': testId, }: SpinnerProps): JSX.Element;
27
+ /**
28
+ * Спиннер.
29
+ * Выделен в отдельный компонент для возможности использования без обертки в виде div.
30
+ * @param props Свойства.
31
+ * @return Элемент.
32
+ */
33
+ export declare function SpinnerSVG({ size, color, className, style, 'data-testid': testId, }: SpinnerProps): JSX.Element;
22
34
  export {};
package/spinner/index.js CHANGED
@@ -3,32 +3,45 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Spinner = exports.DIAMETERS = void 0;
6
+ exports.SpinnerSVG = exports.Spinner = exports.DIAMETERS = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const lodash_1 = require("lodash");
9
- const bind_1 = __importDefault(require("classnames/bind"));
10
9
  const colors_1 = require("../colors");
10
+ const bind_1 = __importDefault(require("classnames/bind"));
11
11
  const spinner_module_scss_1 = __importDefault(require("./spinner.module.scss"));
12
12
  const cx = bind_1.default.bind(spinner_module_scss_1.default);
13
13
  exports.DIAMETERS = {
14
+ s: 20,
15
+ m: 48,
16
+ l: 80,
17
+ // legacy, @todo удалить со временем:
14
18
  small: 20,
15
19
  medium: 48,
16
20
  large: 80,
17
21
  };
18
22
  const DEFAULT_COLOR = 'basic-blue';
19
- const AVAILABLE_COLORS = ['basic-blue', 'basic-white'];
20
23
  /**
21
24
  * Компонент спиннера.
22
25
  * @param props Свойства.
23
26
  * @return Элемент.
24
27
  */
25
- const Spinner = ({ size = 'medium', color = DEFAULT_COLOR, className, style, }) => {
26
- const readySize = (0, lodash_1.has)(exports.DIAMETERS, size) ? size : 'medium';
27
- const readyColor = AVAILABLE_COLORS.includes(color) ? color : DEFAULT_COLOR;
28
- const diameter = exports.DIAMETERS[readySize];
29
- const radius = diameter / 2;
30
- return (react_1.default.createElement("div", { className: className, style: style },
31
- react_1.default.createElement("svg", { className: cx('spinner', `size-${readySize}`), viewBox: `0 0 ${diameter} ${diameter}`, width: diameter, height: diameter, stroke: colors_1.COLORS.get(readyColor) },
32
- react_1.default.createElement("circle", { className: cx('circle'), cx: radius, cy: radius, r: radius - 1 }))));
33
- };
28
+ function Spinner({ size = 'm', color = DEFAULT_COLOR, className, style, 'data-testid': testId = 'spinner', }) {
29
+ const readySize = (0, lodash_1.has)(exports.DIAMETERS, size) ? size : 'm';
30
+ const readyColor = colors_1.COLORS.has(color) ? color : DEFAULT_COLOR;
31
+ return (react_1.default.createElement("div", { className: className, style: style, "data-testid": testId },
32
+ react_1.default.createElement(SpinnerSVG, { size: readySize, color: readyColor, "data-testid": null })));
33
+ }
34
34
  exports.Spinner = Spinner;
35
+ /**
36
+ * Спиннер.
37
+ * Выделен в отдельный компонент для возможности использования без обертки в виде div.
38
+ * @param props Свойства.
39
+ * @return Элемент.
40
+ */
41
+ function SpinnerSVG({ size = 'm', color = DEFAULT_COLOR, className, style, 'data-testid': testId = 'spinner', }) {
42
+ const diameter = exports.DIAMETERS[size];
43
+ const radius = diameter / 2;
44
+ return (react_1.default.createElement("svg", { style: style, className: cx('spinner', `size-${size}`, className), viewBox: `0 0 ${diameter} ${diameter}`, width: diameter, height: diameter, stroke: colors_1.COLORS.get(color), "data-testid": testId },
45
+ react_1.default.createElement("circle", { className: cx('circle'), cx: radius, cy: radius, r: radius - 1 })));
46
+ }
47
+ exports.SpinnerSVG = SpinnerSVG;
@@ -1,10 +1,18 @@
1
1
  $pi: 3.141592653589793;
2
2
  $sizes: (
3
+ s: 20,
4
+ m: 48,
5
+ l: 80,
6
+ // legacy, @todo удалить со временем:
3
7
  small: 20,
4
8
  medium: 48,
5
9
  large: 80,
6
10
  );
7
11
  $durations: (
12
+ s: 600ms,
13
+ m: 750ms,
14
+ l: 950ms,
15
+ // legacy, @todo удалить со временем:
8
16
  small: 600ms,
9
17
  medium: 750ms,
10
18
  large: 950ms,
@@ -1,30 +1,38 @@
1
- import React from 'react';
2
- declare type Size = 's' | 'm';
3
- interface StepperCSS extends React.CSSProperties {
1
+ import React, { CSSProperties, InputHTMLAttributes, MouseEventHandler } from 'react';
2
+ /** Размер Stepper (влияет на высоту и минимальную ширину). */
3
+ export type StepperSize = 's' | 'm';
4
+ /** Стили Stepper. */
5
+ export interface StepperStyle extends CSSProperties {
6
+ /** Ширина. */
4
7
  '--stepper-width'?: string;
5
8
  }
6
- export interface StepperProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'style'> {
9
+ export interface StepperProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'style'> {
7
10
  /** Нужно ли выводить кнопку добавления. */
8
11
  canAdd?: boolean;
9
12
  /** Нужно ли выводить кнопку вычитания. */
10
13
  canSubtract?: boolean;
14
+ /** Делает кнопку "+" отключенной. */
15
+ plusDisabled?: boolean;
16
+ /** Делает кнопку "-" отключенной. */
17
+ minusDisabled?: boolean;
18
+ /** Нужно ли предотвращать blur на поле при нажатии "+/-". */
19
+ buttonClickBehavior?: 'prevent-input-blur';
11
20
  /** Сработает при добавлении. */
12
- onAdd?: React.MouseEventHandler;
21
+ onAdd?: MouseEventHandler;
13
22
  /** Сработает при вычитании. */
14
- onSubtract?: React.MouseEventHandler;
23
+ onSubtract?: MouseEventHandler;
15
24
  /** Размер. */
16
- size?: Size;
25
+ size?: StepperSize;
17
26
  /** Идентификатор для систем автоматизированного тестирования. */
18
27
  'data-testid'?: string;
19
28
  /** Стили корневого элемента. */
20
- style?: StepperCSS;
29
+ style?: StepperStyle;
21
30
  /** Нужно ли показывать состояние ошибки. */
22
31
  failed?: boolean;
23
32
  }
24
33
  /**
25
- * Компонент поля количества.
34
+ * Stepper - поле ввода количества.
26
35
  * @param props Свойства.
27
36
  * @return Элемент.
28
37
  */
29
38
  export declare const Stepper: React.ForwardRefExoticComponent<StepperProps & React.RefAttributes<HTMLInputElement>>;
30
- export {};
package/stepper/index.js CHANGED
@@ -45,16 +45,25 @@ const stepper_module_scss_1 = __importDefault(require("./stepper.module.scss"));
45
45
  const bind_1 = __importDefault(require("classnames/bind"));
46
46
  const cx = bind_1.default.bind(stepper_module_scss_1.default);
47
47
  /**
48
- * Компонент поля количества.
48
+ * Stepper - поле ввода количества.
49
49
  * @param props Свойства.
50
50
  * @return Элемент.
51
51
  */
52
- exports.Stepper = (0, react_1.forwardRef)((_a, ref) => {
53
- var { canAdd = true, canSubtract = true, className, disabled, readOnly, onAdd, onBlur, onChange, onFocus, onSubtract, size = 'm', style, value, failed, 'data-testid': testId = 'stepper' } = _a, inputProps = __rest(_a, ["canAdd", "canSubtract", "className", "disabled", "readOnly", "onAdd", "onBlur", "onChange", "onFocus", "onSubtract", "size", "style", "value", "failed", 'data-testid']);
52
+ exports.Stepper = (0, react_1.forwardRef)(function Stepper(_a, forwardedRef) {
53
+ var _b, _c;
54
+ var { buttonClickBehavior, canAdd = true, canSubtract = true, className, disabled, plusDisabled = disabled, minusDisabled = disabled, readOnly, onAdd, onBlur, onChange, onFocus, onSubtract, size = 'm', style, value, failed, 'data-testid': testId = 'stepper' } = _a, inputProps = __rest(_a, ["buttonClickBehavior", "canAdd", "canSubtract", "className", "disabled", "plusDisabled", "minusDisabled", "readOnly", "onAdd", "onBlur", "onChange", "onFocus", "onSubtract", "size", "style", "value", "failed", 'data-testid']);
55
+ const ref = (0, react_1.useRef)(null);
54
56
  const [focused, setFocused] = (0, react_1.useState)(false);
55
- return (react_1.default.createElement("div", { "data-testid": testId, style: style, className: cx('root', `size-${size}`, { disabled, focused, readonly: readOnly, failed }, className) },
56
- react_1.default.createElement("button", { className: cx('button', { hidden: !canSubtract }), "data-testid": 'stepper:minus', onClick: canSubtract && !disabled && !readOnly ? onSubtract : undefined },
57
- react_1.default.createElement(minus_1.default, null)),
57
+ (0, react_1.useImperativeHandle)(forwardedRef, () => ref.current);
58
+ const noBlurOnMousedown = (0, react_1.useCallback)(event => {
59
+ if (focused && event.target !== ref.current && buttonClickBehavior === 'prevent-input-blur') {
60
+ event.preventDefault();
61
+ }
62
+ }, [focused, buttonClickBehavior]);
63
+ const rootClassName = cx('root', `size-${size}`, { disabled, focused, failed }, className);
64
+ return (react_1.default.createElement("div", { "data-testid": testId, style: style, className: rootClassName, onMouseDown: noBlurOnMousedown },
65
+ react_1.default.createElement("button", { tabIndex: -1, hidden: !canSubtract, disabled: (_b = minusDisabled !== null && minusDisabled !== void 0 ? minusDisabled : disabled) !== null && _b !== void 0 ? _b : readOnly, className: cx('button'), "data-testid": 'stepper:minus', "aria-label": '\u0423\u043C\u0435\u043D\u044C\u0448\u0438\u0442\u044C', onMouseDown: noBlurOnMousedown, onClick: canSubtract && !minusDisabled && !disabled && !readOnly ? onSubtract : undefined },
66
+ react_1.default.createElement(minus_1.default, { className: stepper_module_scss_1.default.svg })),
58
67
  react_1.default.createElement("input", Object.assign({}, inputProps, { ref: ref, readOnly: readOnly, "data-testid": 'stepper:input', className: cx('input'), value: value, disabled: disabled, onChange: onChange, onFocus: e => {
59
68
  setFocused(true);
60
69
  onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
@@ -62,6 +71,6 @@ exports.Stepper = (0, react_1.forwardRef)((_a, ref) => {
62
71
  setFocused(false);
63
72
  onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
64
73
  } })),
65
- react_1.default.createElement("button", { className: cx('button', { hidden: !canAdd }), "data-testid": 'stepper:plus', onClick: canAdd && !disabled && !readOnly ? onAdd : undefined },
66
- react_1.default.createElement(plus_1.default, null))));
74
+ react_1.default.createElement("button", { tabIndex: -1, hidden: !canAdd, disabled: (_c = plusDisabled !== null && plusDisabled !== void 0 ? plusDisabled : disabled) !== null && _c !== void 0 ? _c : readOnly, className: cx('button'), "data-testid": 'stepper:plus', "aria-label": '\u0423\u0432\u0435\u043B\u0438\u0447\u0438\u0442\u044C', onMouseDown: noBlurOnMousedown, onClick: canAdd && !plusDisabled && !disabled && !readOnly ? onAdd : undefined },
75
+ react_1.default.createElement(plus_1.default, { className: stepper_module_scss_1.default.svg }))));
67
76
  });
@@ -7,24 +7,15 @@
7
7
  border-radius: 4px;
8
8
  color: colors.$basic-gray87;
9
9
  background: colors.$basic-gray8;
10
- &.focused:not(.disabled) {
10
+ &.focused {
11
11
  border-color: colors.$basic-blue;
12
12
  }
13
13
  &.disabled {
14
14
  color: colors.$basic-gray24;
15
15
  border-color: colors.$basic-gray4;
16
16
  background: colors.$basic-gray4;
17
- .button {
18
- fill: colors.$basic-gray24;
19
- }
20
17
  }
21
- &.readonly {
22
- .button {
23
- fill: colors.$basic-gray24;
24
- }
25
- }
26
- &.failed:not(.disabled):not(.focused) {
27
- border-color: transparent;
18
+ &.failed {
28
19
  color: colors.$additional-deep-red;
29
20
  }
30
21
  &.size-s {
@@ -65,7 +56,7 @@
65
56
  background: transparent;
66
57
  width: var(--stepper-button-width);
67
58
  height: 100%;
68
- fill: colors.$basic-gray87;
59
+ color: colors.$basic-gray87;
69
60
  flex-shrink: 0;
70
61
  &:first-child {
71
62
  justify-content: flex-end;
@@ -73,11 +64,19 @@
73
64
  &:last-child {
74
65
  justify-content: flex-start;
75
66
  }
76
- &:not(.hidden) {
67
+ &:not(.hidden):not(:disabled) {
77
68
  cursor: pointer;
78
69
  }
79
- &.hidden {
80
- opacity: 0;
70
+ &:disabled {
71
+ color: colors.$basic-gray24;
81
72
  pointer-events: none;
82
73
  }
74
+ &[hidden] {
75
+ pointer-events: none;
76
+ opacity: 0;
77
+ }
78
+ }
79
+
80
+ .svg {
81
+ fill: currentColor;
83
82
  }
@@ -1,6 +1,6 @@
1
- export declare type Size = 12 | 14 | 16 | 20 | 24 | 32 | 48 | 64;
2
- export declare type LineHeight = 16 | 20 | 24 | 28 | 32 | 40 | 60 | 80;
3
- export declare type Weight = 400 | 600 | 700;
1
+ export type Size = 12 | 14 | 16 | 20 | 24 | 32 | 48 | 64;
2
+ export type LineHeight = 16 | 20 | 24 | 28 | 32 | 40 | 60 | 80;
3
+ export type Weight = 400 | 600 | 700;
4
4
  export declare const SIZES: Set<Size>;
5
5
  export declare const LINE_HEIGHTS: Set<LineHeight>;
6
6
  export declare const WEIGHTS: Set<Weight>;
@@ -0,0 +1,42 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ export interface SwitcherRowProps {
3
+ /** Содержимое. */
4
+ children?: ReactNode;
5
+ /** Направление текста. */
6
+ textAlign?: 'left' | 'right';
7
+ /** Стили корневого элемента. */
8
+ style?: CSSProperties;
9
+ /** CSS-класс корневого элемента. */
10
+ className?: string;
11
+ /** Позиция поля. */
12
+ fieldPosition?: 'start' | 'end';
13
+ /** Идентификатор для систем автоматизированного тестирования. */
14
+ 'data-testid'?: string;
15
+ }
16
+ /**
17
+ * Блок вывода полей-переключателей (Checkbox, Toggle, RadioButton).
18
+ * @param props Свойства.
19
+ * @return Элемент.
20
+ */
21
+ export declare function SwitcherRow({ children, className, style, textAlign, fieldPosition, 'data-testid': testId, }: SwitcherRowProps): JSX.Element;
22
+ export declare namespace SwitcherRow {
23
+ var Label: typeof SwitcherRowLabel;
24
+ var Comment: typeof SwitcherRowComment;
25
+ }
26
+ /**
27
+ * Слот ярлыка.
28
+ * @param props Свойства.
29
+ * @return Элемент.
30
+ */
31
+ declare function SwitcherRowLabel({ children }: {
32
+ children?: ReactNode;
33
+ }): JSX.Element;
34
+ /**
35
+ * Слот комментария.
36
+ * @param props Свойства.
37
+ * @return Элемент.
38
+ */
39
+ declare function SwitcherRowComment({ children }: {
40
+ children?: ReactNode;
41
+ }): JSX.Element;
42
+ export {};