@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.
- package/_internal/custom-scrollbar/index.d.ts +13 -7
- package/_internal/custom-scrollbar/index.js +29 -15
- package/_internal/dropdown-loading/index.d.ts +3 -3
- package/_internal/dropdown-loading/index.js +4 -2
- package/_internal/page-scroll-lock/adapters/body-scroll-lock.d.ts +39 -0
- package/_internal/page-scroll-lock/adapters/body-scroll-lock.js +62 -0
- package/_internal/page-scroll-lock/adapters/ui-nucleons.d.ts +25 -0
- package/_internal/page-scroll-lock/adapters/ui-nucleons.js +103 -0
- package/_internal/page-scroll-lock/context.d.ts +13 -0
- package/_internal/page-scroll-lock/context.js +54 -0
- package/_internal/page-scroll-lock/hook.d.ts +12 -0
- package/_internal/page-scroll-lock/hook.js +26 -0
- package/_internal/page-scroll-lock/index.d.ts +4 -0
- package/_internal/page-scroll-lock/index.js +9 -0
- package/_internal/page-scroll-lock/types.d.ts +22 -0
- package/_internal/{checkbox/index.js → page-scroll-lock/types.js} +0 -0
- package/_internal/readme.md +2 -0
- package/_internal/utils/dropdown.d.ts +1 -0
- package/_internal/utils/dropdown.js +1 -0
- package/alert/alert.module.scss +1 -24
- package/alert/index.d.ts +11 -17
- package/alert/index.js +33 -16
- package/arrow-button/arrow-button.module.scss +2 -0
- package/arrow-button/index.d.ts +2 -2
- package/autocomplete/autocomplete.d.ts +8 -0
- package/autocomplete/autocomplete.js +190 -0
- package/autocomplete/autocomplete.module.scss +2 -15
- package/autocomplete/index.d.ts +2 -27
- package/autocomplete/index.js +2 -126
- package/autocomplete/types.d.ts +19 -0
- package/autocomplete/types.js +2 -0
- package/autocomplete-deprecated/autocomplete.module.scss +20 -0
- package/autocomplete-deprecated/index.d.ts +28 -0
- package/autocomplete-deprecated/index.js +130 -0
- package/avatar/index.d.ts +2 -2
- package/avatar/user.d.ts +1 -1
- package/base-input/base-input.d.ts +11 -0
- package/base-input/base-input.js +96 -0
- package/base-input/base-input.module.scss +3 -3
- package/base-input/index.d.ts +2 -23
- package/base-input/index.js +2 -76
- package/base-input/types.d.ts +31 -0
- package/base-input/types.js +2 -0
- package/base-input/utils.d.ts +6 -0
- package/base-input/utils.js +14 -0
- package/base-input-deprecated/base-input.module.scss +66 -0
- package/base-input-deprecated/index.d.ts +24 -0
- package/base-input-deprecated/index.js +80 -0
- package/bordered-layout/index.d.ts +1 -0
- package/bordered-layout/index.js +1 -0
- package/bottom-bar/bottom-bar-util.scss +20 -0
- package/bottom-bar/bottom-bar.d.ts +12 -0
- package/bottom-bar/bottom-bar.js +47 -0
- package/bottom-bar/bottom-bar.module.scss +14 -0
- package/bottom-bar/index.d.ts +2 -21
- package/bottom-bar/index.js +5 -44
- package/bottom-bar/types.d.ts +10 -0
- package/bottom-bar/types.js +2 -0
- package/box/index.d.ts +1 -1
- package/breakpoints.scss +1 -1
- package/button/button.module.scss +70 -53
- package/button/index.d.ts +26 -41
- package/button/index.js +22 -46
- package/card/index.d.ts +2 -1
- package/card/index.js +23 -6
- package/card/slots.d.ts +17 -3
- package/card/slots.js +15 -13
- package/carousel/draggable.d.ts +7 -3
- package/carousel/draggable.js +10 -3
- package/carousel/helpers/draggable-event.d.ts +5 -2
- package/carousel/helpers/draggable-event.js +5 -0
- package/carousel/index.d.ts +1 -1
- package/carousel/index.js +24 -24
- package/checkbox/checkbox.module.scss +1 -0
- package/checkbox/index.d.ts +3 -3
- package/checkbox-field/index.d.ts +3 -0
- package/checkbox-field/index.js +3 -0
- package/clean-buttons/clean-buttons-util.scss +15 -0
- package/clean-buttons/clean-buttons.module.scss +5 -3
- package/clean-buttons/index.d.ts +16 -7
- package/clean-buttons/index.js +17 -14
- package/clean-buttons/types.d.ts +1 -1
- package/clean-buttons/utils.d.ts +5 -1
- package/clean-buttons/utils.js +4 -0
- package/{colors.d.ts → colors/index.d.ts} +1 -1
- package/{colors.js → colors/index.js} +0 -0
- package/dot-nav/index.d.ts +1 -1
- package/dropdown/index.d.ts +1 -0
- package/dropdown/utils.d.ts +19 -0
- package/dropdown/utils.js +45 -0
- package/dropdown-item/dropdown-item.module.scss +80 -15
- package/dropdown-item/index.d.ts +20 -9
- package/dropdown-item/index.js +12 -9
- package/dropdown-item/types.d.ts +3 -0
- package/dropdown-item/types.js +2 -0
- package/dropdown-item/utils.d.ts +45 -0
- package/dropdown-item/utils.js +89 -0
- package/expandable/utils.js +3 -3
- package/field-block/field-block.module.scss +155 -0
- package/field-block/index.d.ts +63 -0
- package/field-block/index.js +43 -0
- package/field-grid/index.d.ts +5 -4
- package/field-grid/index.js +1 -0
- package/helpers/bounds-of.d.ts +5 -1
- package/helpers/bounds-of.js +5 -0
- package/helpers/center-of.d.ts +4 -1
- package/helpers/center-of.js +8 -1
- package/helpers/create-container.d.ts +5 -2
- package/helpers/create-container.js +7 -2
- package/helpers/define-slots.d.ts +3 -3
- package/helpers/define-slots.js +5 -3
- package/helpers/events.d.ts +16 -8
- package/helpers/events.js +41 -15
- package/helpers/find-child-element.d.ts +12 -9
- package/helpers/find-child-element.js +9 -5
- package/helpers/find-offset-parent.d.ts +1 -2
- package/helpers/find-offset-parent.js +2 -2
- package/helpers/find-sibling-index.d.ts +11 -8
- package/helpers/find-sibling-index.js +8 -3
- package/helpers/fit-element-height.d.ts +5 -5
- package/helpers/fit-element-height.js +9 -7
- package/helpers/format-date.d.ts +11 -11
- package/helpers/format-date.js +15 -13
- package/helpers/format-number.d.ts +1 -1
- package/helpers/format-number.js +2 -2
- package/helpers/get-date-interval-data.d.ts +4 -1
- package/helpers/get-date-interval-data.js +7 -2
- package/helpers/get-declination.d.ts +5 -1
- package/helpers/get-declination.js +5 -0
- package/helpers/get-fraction-depth.d.ts +1 -1
- package/helpers/get-fraction-depth.js +2 -2
- package/helpers/get-no-index.d.ts +2 -2
- package/helpers/get-no-index.js +4 -3
- package/helpers/get-relative-pos.d.ts +4 -1
- package/helpers/get-relative-pos.js +7 -2
- package/helpers/get-scroll-parent.d.ts +1 -2
- package/helpers/get-scroll-parent.js +5 -5
- package/helpers/is-browser.d.ts +4 -1
- package/helpers/is-browser.js +8 -1
- package/helpers/is-fully-scrolled.d.ts +3 -3
- package/helpers/is-fully-scrolled.js +2 -2
- package/helpers/is-touch-device.d.ts +1 -1
- package/helpers/is-touch-device.js +4 -5
- package/helpers/layer.d.ts +1 -1
- package/helpers/layer.js +2 -2
- package/helpers/max-index-of.d.ts +4 -1
- package/helpers/max-index-of.js +7 -2
- package/helpers/media-query-list.d.ts +1 -1
- package/helpers/media-query-list.js +2 -2
- package/helpers/on.d.ts +4 -1
- package/helpers/on.js +7 -2
- package/helpers/point.d.ts +4 -1
- package/helpers/point.js +8 -1
- package/helpers/rename.d.ts +3 -1
- package/helpers/rename.js +1 -0
- package/helpers/scroll-to-child.d.ts +1 -1
- package/helpers/scroll-to-child.js +3 -2
- package/helpers/styles.d.ts +8 -2
- package/helpers/styles.js +18 -4
- package/helpers/with-prevent.d.ts +9 -6
- package/helpers/with-prevent.js +16 -9
- package/hint/hint-view.d.ts +26 -0
- package/hint/hint-view.js +43 -0
- package/hint/hint-view.module.scss +31 -0
- package/hint/hint.d.ts +14 -0
- package/hint/hint.js +41 -0
- package/hint/index.d.ts +5 -8
- package/hint/index.js +13 -48
- package/hint/utils.d.ts +61 -0
- package/hint/utils.js +161 -0
- package/{hint → hint-deprecated}/hint.module.scss +0 -0
- package/hint-deprecated/index.d.ts +11 -0
- package/hint-deprecated/index.js +53 -0
- package/hooks/breakpoint/index.d.ts +7 -4
- package/hooks/breakpoint/index.js +21 -13
- package/hooks/breakpoint/types.d.ts +3 -4
- package/hooks/breakpoint/utils.d.ts +2 -1
- package/hooks/breakpoint/utils.js +2 -1
- package/hooks/index.d.ts +8 -8
- package/hooks/index.js +27 -19
- package/hooks/intersection/test-utils.d.ts +1 -1
- package/hooks/intersection/test-utils.js +2 -1
- package/hooks/styles.d.ts +6 -0
- package/hooks/styles.js +26 -0
- package/info-text/index.d.ts +23 -0
- package/info-text/index.js +60 -0
- package/info-text/info-text.module.scss +28 -0
- package/input/index.d.ts +32 -0
- package/input/index.js +96 -0
- package/input/input.module.scss +20 -0
- package/input/utils.d.ts +36 -0
- package/input/utils.js +71 -0
- package/layout/index.d.ts +6 -11
- package/layout/index.js +6 -60
- package/layout/layout.d.ts +10 -0
- package/layout/layout.js +32 -0
- package/layout/layout.module.scss +33 -26
- package/layout/legacy.d.ts +15 -0
- package/layout/legacy.js +68 -0
- package/layout/legacy.module.scss +49 -0
- package/layout/types.d.ts +6 -0
- package/layout/types.js +2 -0
- package/link/index.d.ts +4 -1
- package/link/index.js +2 -2
- package/link/link.module.scss +10 -0
- package/loading-overlay/index.d.ts +1 -0
- package/loading-overlay/index.js +1 -0
- package/masked-field/index.d.ts +1 -0
- package/masked-field/index.js +1 -0
- package/masked-input/hook.d.ts +8 -0
- package/masked-input/hook.js +72 -0
- package/masked-input/index.d.ts +5 -0
- package/masked-input/index.js +7 -0
- package/masked-input/masked-input.d.ts +8 -0
- package/masked-input/masked-input.js +73 -0
- package/masked-input/types.d.ts +51 -0
- package/masked-input/types.js +2 -0
- package/masked-input/utils.d.ts +15 -0
- package/masked-input/utils.js +49 -0
- package/modal/index.d.ts +10 -12
- package/modal/index.js +27 -64
- package/modal/modal.module.scss +98 -55
- package/modal/slots.d.ts +13 -10
- package/modal/slots.js +30 -28
- package/modal/utils.d.ts +8 -10
- package/modal/utils.js +2 -26
- package/modal-overlay/index.d.ts +13 -0
- package/modal-overlay/index.js +60 -0
- package/modal-overlay/modal-overlay-util.scss +1 -0
- package/modal-overlay/modal-overlay.module.scss +14 -0
- package/modal-overlay/utils.d.ts +14 -0
- package/modal-overlay/utils.js +32 -0
- package/package.json +49 -41
- package/pagination/utils.d.ts +2 -2
- package/panel/index.d.ts +27 -13
- package/panel/index.js +43 -9
- package/panel/panel.module.scss +49 -8
- package/phone-input/index.d.ts +4 -28
- package/phone-input/index.js +2 -121
- package/phone-input/phone-input.d.ts +8 -0
- package/phone-input/phone-input.js +133 -0
- package/phone-input/phone-input.module.scss +8 -32
- package/phone-input/presets.d.ts +21 -22
- package/phone-input/presets.js +1 -2
- package/phone-input/types.d.ts +6 -0
- package/phone-input/types.js +2 -0
- package/phone-input/utils.d.ts +30 -1
- package/phone-input/utils.js +52 -3
- package/phone-input-deprecated/index.d.ts +29 -0
- package/phone-input-deprecated/index.js +124 -0
- package/phone-input-deprecated/phone-input.module.scss +41 -0
- package/plate/index.d.ts +3 -3
- package/plate/index.js +2 -2
- package/plate/plate.module.scss +3 -0
- package/popup/index.d.ts +5 -0
- package/popup/index.js +12 -0
- package/popup/popup-view.d.ts +14 -0
- package/popup/popup-view.js +35 -0
- package/popup/popup-view.module.scss +40 -0
- package/popup/popup.d.ts +17 -0
- package/popup/popup.js +73 -0
- package/popup/utils.d.ts +38 -0
- package/popup/utils.js +83 -0
- package/price/index.d.ts +1 -1
- package/price/index.js +3 -3
- package/price/utils.d.ts +5 -5
- package/price/utils.js +33 -23
- package/radio-button/index.d.ts +10 -0
- package/radio-button/index.js +33 -0
- package/radio-button/radio-button.module.scss +46 -0
- package/rating/index.d.ts +2 -1
- package/rating/types.d.ts +1 -1
- package/readme.md +34 -41
- package/screen/index.d.ts +4 -2
- package/screen/index.js +34 -3
- package/screen/screen.module.scss +0 -2
- package/screen/slots.d.ts +2 -8
- package/screen/slots.js +8 -9
- package/screen/utils.d.ts +2 -1
- package/select/index.d.ts +2 -33
- package/select/index.js +3 -109
- package/select/parts/block.d.ts +8 -0
- package/select/parts/block.js +70 -0
- package/select/parts/block.module.scss +3 -0
- package/select/parts/button.d.ts +8 -0
- package/select/parts/button.js +69 -0
- package/select/parts/menu.d.ts +8 -0
- package/select/parts/menu.js +105 -0
- package/select/parts/menu.module.scss +4 -0
- package/select/select.d.ts +14 -0
- package/select/select.js +145 -0
- package/select/types.d.ts +55 -0
- package/select/types.js +2 -0
- package/select/utils.d.ts +3 -0
- package/select/utils.js +13 -0
- package/select-deprecated/index.d.ts +34 -0
- package/select-deprecated/index.js +112 -0
- package/{select → select-deprecated}/select.module.scss +0 -0
- package/shadows.scss +18 -0
- package/side-page/index.d.ts +11 -26
- package/side-page/index.js +21 -26
- package/side-page/side-page.module.scss +35 -29
- package/side-page/slots.d.ts +12 -20
- package/side-page/slots.js +16 -28
- package/spinner/index.d.ts +18 -6
- package/spinner/index.js +25 -12
- package/spinner/spinner.module.scss +8 -0
- package/stepper/index.d.ts +18 -10
- package/stepper/index.js +17 -8
- package/stepper/stepper.module.scss +14 -15
- package/styling/fonts.d.ts +3 -3
- package/switcher-row/index.d.ts +42 -0
- package/switcher-row/index.js +59 -0
- package/switcher-row/switcher-row.module.scss +55 -0
- package/text/index.d.ts +1 -1
- package/text-button/index.d.ts +42 -0
- package/text-button/index.js +46 -0
- package/text-button/text-button.module.scss +99 -0
- package/text-field/index.d.ts +7 -6
- package/text-field/index.js +3 -2
- package/textarea/index.d.ts +21 -0
- package/textarea/index.js +85 -0
- package/textarea/textarea.module.scss +15 -0
- package/toggle/index.d.ts +3 -3
- package/toggle/toggle.module.scss +17 -8
- package/tooltip/index.d.ts +1 -0
- package/tooltip/index.js +1 -0
- package/top-bar/index.d.ts +3 -40
- package/top-bar/index.js +4 -60
- package/top-bar/top-bar-util.scss +29 -0
- package/top-bar/top-bar.d.ts +9 -0
- package/top-bar/top-bar.js +101 -0
- package/top-bar/top-bar.module.scss +129 -67
- package/top-bar/types.d.ts +31 -0
- package/top-bar/types.js +2 -0
- package/top-bar/utils.d.ts +14 -0
- package/top-bar/utils.js +56 -0
- package/touch-slider/index.d.ts +1 -0
- package/touch-slider/index.js +3 -2
- package/types.d.ts +18 -0
- package/types.js +2 -0
- package/unknown-content/index.d.ts +3 -3
- package/unknown-content/index.js +3 -3
- package/unknown-content/unknown-content.module.scss +16 -12
- package/upload-area/index.d.ts +2 -0
- package/upload-area/index.js +5 -0
- package/upload-area/types.d.ts +32 -0
- package/upload-area/types.js +2 -0
- package/upload-area/upload-area-util.scss +17 -0
- package/upload-area/upload-area.d.ts +8 -0
- package/upload-area/upload-area.js +105 -0
- package/upload-area/upload-area.module.scss +78 -0
- package/{upload → upload-area}/upload.svg +0 -0
- package/upload-area/utils.d.ts +17 -0
- package/upload-area/utils.js +48 -0
- package/utils.scss +74 -1
- package/with-hint/index.d.ts +3 -2
- package/with-hint/index.js +1 -0
- package/with-hint/positioning-hint.d.ts +1 -1
- package/with-hint/positioning-hint.js +2 -2
- package/with-tooltip/index.d.ts +2 -1
- package/with-tooltip/index.js +1 -0
- package/with-tooltip/utils.d.ts +2 -2
- package/_internal/body-scroll.d.ts +0 -23
- package/_internal/body-scroll.js +0 -41
- package/_internal/checkbox/index.d.ts +0 -5
- package/constants.d.ts +0 -6
- package/constants.js +0 -9
- package/nav-bar/index.d.ts +0 -46
- package/nav-bar/index.js +0 -76
- package/nav-bar/nav-bar.module.scss +0 -95
- package/upload/area.d.ts +0 -25
- package/upload/area.js +0 -65
- package/upload/area.module.scss +0 -44
- package/upload/utils.d.ts +0 -29
- package/upload/utils.js +0 -45
package/side-page/index.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
74
|
-
const
|
|
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
|
-
|
|
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:
|
|
83
|
-
body:
|
|
84
|
-
footer:
|
|
78
|
+
header: SidePage.Header,
|
|
79
|
+
body: SidePage.Body,
|
|
80
|
+
footer: SidePage.Footer,
|
|
85
81
|
});
|
|
86
|
-
|
|
87
|
-
return (react_1.default.createElement(
|
|
88
|
-
react_1.default.createElement(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
-
|
|
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
|
-
.
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.size-m
|
|
30
|
-
|
|
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
|
-
.
|
|
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:
|
|
66
|
+
background-color: modal-overlay-util.$overlay-color;
|
|
61
67
|
overflow: hidden;
|
|
62
|
-
.
|
|
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:
|
|
70
|
-
.
|
|
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
|
-
.
|
|
85
|
+
.side-page {
|
|
80
86
|
transition: transform var(--transition-duration) ease-in-out;
|
|
81
87
|
transform: translateX(100%);
|
|
82
88
|
}
|
package/side-page/slots.d.ts
CHANGED
|
@@ -1,34 +1,26 @@
|
|
|
1
|
-
import
|
|
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
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
|
20
|
-
|
|
21
|
-
|
|
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
|
|
30
|
-
({ padded, ...props }: BottomBarProps & {
|
|
31
|
-
padded?: boolean | undefined;
|
|
32
|
-
}): JSX.Element;
|
|
33
|
-
displayName: string;
|
|
34
|
-
};
|
|
26
|
+
export declare function SidePageFooter({ ...props }: BottomBarProps): JSX.Element;
|
package/side-page/slots.js
CHANGED
|
@@ -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
|
|
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
|
-
|
|
30
|
-
var { onBack, onClose } = _a, topBarProps = __rest(_a, ["onBack", "onClose"]);
|
|
31
|
-
return (react_1.default.createElement(top_bar_1.TopBar, Object.assign({}, topBarProps, { size: '
|
|
32
|
-
|
|
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
|
-
|
|
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
|
-
|
|
59
|
-
var
|
|
60
|
-
props
|
|
61
|
-
|
|
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';
|
package/spinner/index.d.ts
CHANGED
|
@@ -1,22 +1,34 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Token } from '../colors';
|
|
3
|
-
|
|
4
|
-
|
|
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?:
|
|
10
|
+
size?: SpinnerSize | SpinnerLegacySize;
|
|
8
11
|
/** Цвет. */
|
|
9
|
-
color?:
|
|
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<
|
|
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
|
|
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
|
-
|
|
26
|
-
const readySize = (0, lodash_1.has)(exports.DIAMETERS, size) ? size : '
|
|
27
|
-
const readyColor =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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,
|
package/stepper/index.d.ts
CHANGED
|
@@ -1,30 +1,38 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
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<
|
|
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?:
|
|
21
|
+
onAdd?: MouseEventHandler;
|
|
13
22
|
/** Сработает при вычитании. */
|
|
14
|
-
onSubtract?:
|
|
23
|
+
onSubtract?: MouseEventHandler;
|
|
15
24
|
/** Размер. */
|
|
16
|
-
size?:
|
|
25
|
+
size?: StepperSize;
|
|
17
26
|
/** Идентификатор для систем автоматизированного тестирования. */
|
|
18
27
|
'data-testid'?: string;
|
|
19
28
|
/** Стили корневого элемента. */
|
|
20
|
-
style?:
|
|
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,
|
|
53
|
-
var
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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", {
|
|
66
|
-
react_1.default.createElement(plus_1.default,
|
|
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
|
|
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
|
-
&.
|
|
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
|
-
|
|
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
|
-
|
|
80
|
-
|
|
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
|
}
|
package/styling/fonts.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
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 {};
|