@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
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SwitcherRow = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const checkbox_1 = require("../checkbox");
|
|
9
|
+
const define_slots_1 = require("../helpers/define-slots");
|
|
10
|
+
const radio_button_1 = require("../radio-button");
|
|
11
|
+
const toggle_1 = require("../toggle");
|
|
12
|
+
const bind_1 = __importDefault(require("classnames/bind"));
|
|
13
|
+
const switcher_row_module_scss_1 = __importDefault(require("./switcher-row.module.scss"));
|
|
14
|
+
const cx = bind_1.default.bind(switcher_row_module_scss_1.default);
|
|
15
|
+
/**
|
|
16
|
+
* Блок вывода полей-переключателей (Checkbox, Toggle, RadioButton).
|
|
17
|
+
* @param props Свойства.
|
|
18
|
+
* @return Элемент.
|
|
19
|
+
*/
|
|
20
|
+
function SwitcherRow({ children, className, style, textAlign, fieldPosition = 'start', 'data-testid': testId = 'switcher-row', }) {
|
|
21
|
+
var _a;
|
|
22
|
+
const { toggle, checkbox, radio, label, comment } = (0, define_slots_1.defineSlots)(children, {
|
|
23
|
+
toggle: toggle_1.Toggle,
|
|
24
|
+
checkbox: checkbox_1.Checkbox,
|
|
25
|
+
radio: radio_button_1.RadioButton,
|
|
26
|
+
label: SwitcherRowLabel,
|
|
27
|
+
comment: SwitcherRowComment,
|
|
28
|
+
});
|
|
29
|
+
const input = (_a = toggle !== null && toggle !== void 0 ? toggle : checkbox) !== null && _a !== void 0 ? _a : radio;
|
|
30
|
+
const failed = input === null || input === void 0 ? void 0 : input.props.failed;
|
|
31
|
+
const disabled = input === null || input === void 0 ? void 0 : input.props.disabled;
|
|
32
|
+
const fieldId = input === null || input === void 0 ? void 0 : input.props.id;
|
|
33
|
+
const fieldColumn = input && react_1.default.createElement("div", { className: cx('col', 'field-col') }, input);
|
|
34
|
+
return (react_1.default.createElement("div", { className: cx('root', `text-align-${textAlign}`, { failed, disabled }, className), style: style, "data-testid": testId },
|
|
35
|
+
fieldPosition === 'start' && fieldColumn,
|
|
36
|
+
react_1.default.createElement("label", { className: cx('col', 'main-col'), htmlFor: fieldId },
|
|
37
|
+
label && (react_1.default.createElement("span", { className: cx('label', { 'for-toggle': toggle }), "data-testid": 'switcher-row:label' }, label)),
|
|
38
|
+
comment && (react_1.default.createElement("span", { className: cx('comment'), "data-testid": 'switcher-row:comment' }, comment))),
|
|
39
|
+
fieldPosition === 'end' && fieldColumn));
|
|
40
|
+
}
|
|
41
|
+
exports.SwitcherRow = SwitcherRow;
|
|
42
|
+
/**
|
|
43
|
+
* Слот ярлыка.
|
|
44
|
+
* @param props Свойства.
|
|
45
|
+
* @return Элемент.
|
|
46
|
+
*/
|
|
47
|
+
function SwitcherRowLabel({ children }) {
|
|
48
|
+
return react_1.default.createElement(react_1.default.Fragment, null, children);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Слот комментария.
|
|
52
|
+
* @param props Свойства.
|
|
53
|
+
* @return Элемент.
|
|
54
|
+
*/
|
|
55
|
+
function SwitcherRowComment({ children }) {
|
|
56
|
+
return react_1.default.createElement(react_1.default.Fragment, null, children);
|
|
57
|
+
}
|
|
58
|
+
SwitcherRow.Label = SwitcherRowLabel;
|
|
59
|
+
SwitcherRow.Comment = SwitcherRowComment;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
@use '../colors';
|
|
2
|
+
|
|
3
|
+
.root {
|
|
4
|
+
--label-color: #{colors.$basic-gray87};
|
|
5
|
+
--comment-color: #{colors.$basic-gray38};
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: row;
|
|
8
|
+
&.text-align-left {
|
|
9
|
+
text-align: left;
|
|
10
|
+
}
|
|
11
|
+
&.text-align-right {
|
|
12
|
+
text-align: right;
|
|
13
|
+
}
|
|
14
|
+
&.disabled {
|
|
15
|
+
--label-color: #{colors.$basic-gray24};
|
|
16
|
+
--comment-color: #{colors.$basic-gray24};
|
|
17
|
+
}
|
|
18
|
+
&.failed {
|
|
19
|
+
--label-color: #{colors.$additional-deep-red};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.col + .col {
|
|
24
|
+
margin-left: 12px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.field-col {
|
|
28
|
+
flex-grow: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.main-col {
|
|
32
|
+
flex-grow: 1;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.label {
|
|
37
|
+
display: block;
|
|
38
|
+
font-size: inherit;
|
|
39
|
+
line-height: inherit;
|
|
40
|
+
font-weight: inherit;
|
|
41
|
+
color: var(--label-color);
|
|
42
|
+
&.for-toggle {
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
font-size: 16px;
|
|
45
|
+
line-height: 24px;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.comment {
|
|
50
|
+
display: block;
|
|
51
|
+
font-size: 14px;
|
|
52
|
+
line-height: 20px;
|
|
53
|
+
font-weight: 400;
|
|
54
|
+
color: var(--comment-color);
|
|
55
|
+
}
|
package/text/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Size, LineHeight, Weight } from '../styling/fonts';
|
|
3
3
|
import { Token } from '../colors';
|
|
4
|
-
|
|
4
|
+
type Align = 'left' | 'center' | 'right' | 'justify';
|
|
5
5
|
export interface TextProps {
|
|
6
6
|
/** Направление. */
|
|
7
7
|
align?: Align;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { AnchorHTMLAttributes, ButtonHTMLAttributes, ComponentType, Ref, SVGAttributes } from 'react';
|
|
2
|
+
import { LinkColor } from '../link';
|
|
3
|
+
export type TextButtonSize = 's' | 'm';
|
|
4
|
+
export type TextButtonColor = LinkColor;
|
|
5
|
+
interface CommonProps {
|
|
6
|
+
/** Размер. */
|
|
7
|
+
size?: TextButtonSize;
|
|
8
|
+
/** Цвет. */
|
|
9
|
+
color?: TextButtonColor;
|
|
10
|
+
/** Иконка перед текстом. */
|
|
11
|
+
startIcon?: ComponentType<SVGAttributes<SVGSVGElement>>;
|
|
12
|
+
/** Иконка после текста. */
|
|
13
|
+
endIcon?: ComponentType<SVGAttributes<SVGSVGElement>>;
|
|
14
|
+
/** Ref для элемента button. Будет заполнен только при appearance: 'button'. */
|
|
15
|
+
buttonRef?: Ref<HTMLButtonElement>;
|
|
16
|
+
/** Ref для элемента a. Будет заполнен только при appearance: 'link'. */
|
|
17
|
+
anchorRef?: Ref<HTMLAnchorElement>;
|
|
18
|
+
/** Нужно ли выводить подчеркивание. */
|
|
19
|
+
underline?: boolean;
|
|
20
|
+
/** Отключенное состояние. */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/** Отступ от иконок. */
|
|
23
|
+
iconGutter?: 4 | 8;
|
|
24
|
+
/** Идентификатор для систем автоматизированного тестирования. */
|
|
25
|
+
'data-testid'?: string;
|
|
26
|
+
}
|
|
27
|
+
export type TextButtonAsButtonProps = CommonProps & Omit<ButtonHTMLAttributes<HTMLButtonElement>, keyof CommonProps> & {
|
|
28
|
+
/** Какой элемент выводить в качестве текстовой кнопки. */
|
|
29
|
+
as?: 'button';
|
|
30
|
+
};
|
|
31
|
+
export type TextButtonAsAnchorProps = CommonProps & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, keyof CommonProps> & {
|
|
32
|
+
/** Какой элемент выводить в качестве текстовой кнопки. */
|
|
33
|
+
as: 'anchor';
|
|
34
|
+
};
|
|
35
|
+
export type TextButtonProps = TextButtonAsButtonProps | TextButtonAsAnchorProps;
|
|
36
|
+
/**
|
|
37
|
+
* Текстовая кнопка.
|
|
38
|
+
* @param props Свойства.
|
|
39
|
+
* @return Элемент.
|
|
40
|
+
*/
|
|
41
|
+
export declare function TextButton({ size, color, children, className, startIcon: StartIcon, endIcon: EndIcon, buttonRef, anchorRef, underline, disabled, iconGutter, 'data-testid': testId, ...restProps }: TextButtonProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.TextButton = void 0;
|
|
18
|
+
const react_1 = __importDefault(require("react"));
|
|
19
|
+
const bind_1 = __importDefault(require("classnames/bind"));
|
|
20
|
+
const text_button_module_scss_1 = __importDefault(require("./text-button.module.scss"));
|
|
21
|
+
const cx = bind_1.default.bind(text_button_module_scss_1.default);
|
|
22
|
+
/**
|
|
23
|
+
* Текстовая кнопка.
|
|
24
|
+
* @param props Свойства.
|
|
25
|
+
* @return Элемент.
|
|
26
|
+
*/
|
|
27
|
+
function TextButton(_a) {
|
|
28
|
+
var { size = 'm', color = 'basic-blue', children, className, startIcon: StartIcon, endIcon: EndIcon, buttonRef, anchorRef, underline, disabled, iconGutter = 8, 'data-testid': testId = 'text-button' } = _a, restProps = __rest(_a, ["size", "color", "children", "className", "startIcon", "endIcon", "buttonRef", "anchorRef", "underline", "disabled", "iconGutter", 'data-testid']);
|
|
29
|
+
const rooClassName = cx('root', `color-${color}`, `size-${size}`, `icon-gutter-${iconGutter}`, underline && 'underline', disabled && 'disabled', className);
|
|
30
|
+
const content = (react_1.default.createElement(react_1.default.Fragment, null,
|
|
31
|
+
StartIcon && react_1.default.createElement(StartIcon, { className: cx('icon-start') }),
|
|
32
|
+
children,
|
|
33
|
+
EndIcon && react_1.default.createElement(EndIcon, { className: cx('icon-end') })));
|
|
34
|
+
let result;
|
|
35
|
+
switch (restProps.as) {
|
|
36
|
+
case 'anchor':
|
|
37
|
+
result = (react_1.default.createElement("a", Object.assign({}, restProps, { ref: anchorRef, className: rooClassName, "data-testid": testId }), content));
|
|
38
|
+
break;
|
|
39
|
+
case 'button':
|
|
40
|
+
default:
|
|
41
|
+
result = (react_1.default.createElement("button", Object.assign({}, restProps, { ref: buttonRef, className: rooClassName, disabled: disabled, "data-testid": testId }), content));
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
exports.TextButton = TextButton;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
@use '../colors';
|
|
2
|
+
@use '../utils';
|
|
3
|
+
|
|
4
|
+
.root {
|
|
5
|
+
@include utils.reset-button;
|
|
6
|
+
@include utils.focus-visible;
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
font-weight: 600;
|
|
10
|
+
white-space: nowrap;
|
|
11
|
+
background: transparent;
|
|
12
|
+
padding: 0;
|
|
13
|
+
margin: 0;
|
|
14
|
+
border: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.root,
|
|
18
|
+
.root:link,
|
|
19
|
+
.root:visited,
|
|
20
|
+
.root:hover,
|
|
21
|
+
.root:active {
|
|
22
|
+
cursor: default;
|
|
23
|
+
text-decoration: none;
|
|
24
|
+
border-bottom-color: transparent;
|
|
25
|
+
&.underline {
|
|
26
|
+
box-shadow: inset 0 -1px 0 0 currentColor;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.root:hover {
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.size-s {
|
|
35
|
+
font-size: 14px;
|
|
36
|
+
line-height: 20px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.size-m {
|
|
40
|
+
font-size: 16px;
|
|
41
|
+
line-height: 24px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.icon-gutter-4 {
|
|
45
|
+
--text-button-icon-gutter: 4px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.icon-gutter-8 {
|
|
49
|
+
--text-button-icon-gutter: 8px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// ниже двойные классы для высокой специфичности в монолите
|
|
53
|
+
.root.disabled {
|
|
54
|
+
color: colors.$basic-gray24;
|
|
55
|
+
pointer-events: none;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.root:not(.disabled).color-basic-blue {
|
|
59
|
+
color: colors.$basic-blue;
|
|
60
|
+
&:hover {
|
|
61
|
+
color: colors.$additional-deep-blue;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.root:not(.disabled).color-basic-gray87 {
|
|
66
|
+
color: colors.$basic-gray87;
|
|
67
|
+
&:hover {
|
|
68
|
+
color: colors.$basic-gray54;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.root:not(.disabled).color-basic-gray38 {
|
|
73
|
+
color: colors.$basic-gray38;
|
|
74
|
+
&:hover {
|
|
75
|
+
color: colors.$basic-gray54;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.root:not(.disabled).color-basic-white {
|
|
80
|
+
color: colors.$basic-white;
|
|
81
|
+
&:hover {
|
|
82
|
+
color: colors.$basic-gray4;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// иконки
|
|
87
|
+
.icon-start,
|
|
88
|
+
.icon-end {
|
|
89
|
+
flex-shrink: 0;
|
|
90
|
+
fill: currentColor;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.icon-start {
|
|
94
|
+
margin-right: var(--text-button-icon-gutter);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.icon-end {
|
|
98
|
+
margin-left: var(--text-button-icon-gutter);
|
|
99
|
+
}
|
package/text-field/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { BaseInputProps } from '../base-input';
|
|
2
|
+
import { BaseInputProps } from '../base-input-deprecated';
|
|
3
3
|
import { SmallRounds } from '../styling/shapes';
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
|
|
4
|
+
type Variant = 'desktop' | 'mobile';
|
|
5
|
+
export type DesktopSize = 'xs' | 's' | 'l';
|
|
6
|
+
type Classes = {
|
|
7
7
|
root?: string;
|
|
8
8
|
baseInput?: string;
|
|
9
9
|
blockFocused?: string;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
type IgnoredInputProps = 'size' | 'onClick' | 'onInput' | 'onChange' | 'onKeyDown' | 'onKeyUp' | 'onSelect';
|
|
12
12
|
export interface TextFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, IgnoredInputProps> {
|
|
13
13
|
/** Ярлык. */
|
|
14
14
|
label?: string;
|
|
@@ -57,10 +57,11 @@ export declare const HEIGHTS: {
|
|
|
57
57
|
readonly l: 56;
|
|
58
58
|
};
|
|
59
59
|
export declare const DEFAULTS: {
|
|
60
|
-
readonly size: "
|
|
60
|
+
readonly size: "xs" | "s" | "l";
|
|
61
61
|
};
|
|
62
62
|
/**
|
|
63
63
|
* Компонент текстового поля.
|
|
64
|
+
* @deprecated На адаптивных страницах следует использовать Input или Textarea.
|
|
64
65
|
* @param props Свойства.
|
|
65
66
|
* @return Элемент.
|
|
66
67
|
*/
|
package/text-field/index.js
CHANGED
|
@@ -30,7 +30,7 @@ exports.TextField = exports.DEFAULTS = exports.HEIGHTS = void 0;
|
|
|
30
30
|
const react_1 = __importStar(require("react"));
|
|
31
31
|
const lodash_1 = require("lodash");
|
|
32
32
|
const box_1 = require("../box");
|
|
33
|
-
const
|
|
33
|
+
const base_input_deprecated_1 = require("../base-input-deprecated");
|
|
34
34
|
const shapes_1 = require("../styling/shapes");
|
|
35
35
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
36
36
|
const text_field_module_scss_1 = __importDefault(require("./text-field.module.scss"));
|
|
@@ -52,6 +52,7 @@ const isVisible = (value) => !(0, lodash_1.isNil)(value) && `${value}` !== '';
|
|
|
52
52
|
const modifiersToClasses = ({ disabled, failed, focused, variant, }) => cx(disabled && 'disabled', failed && 'failed', focused && 'focused', variant && `variant-${variant}`);
|
|
53
53
|
/**
|
|
54
54
|
* Компонент текстового поля.
|
|
55
|
+
* @deprecated На адаптивных страницах следует использовать Input или Textarea.
|
|
55
56
|
* @param props Свойства.
|
|
56
57
|
* @return Элемент.
|
|
57
58
|
*/
|
|
@@ -87,7 +88,7 @@ exports.TextField = (0, react_1.forwardRef)(function TextField({ autoFocus, capt
|
|
|
87
88
|
react_1.default.createElement("div", { className: cx('main-column') },
|
|
88
89
|
withLabel && (react_1.default.createElement("label", { className: cx('label', commonModifyClasses, hasValue && 'filled', labelAsPlaceholder && 'as-placeholder'), htmlFor: id, children: label, "data-testid": 'text-field:label' })),
|
|
89
90
|
react_1.default.createElement("div", { className: cx('input-wrapper') },
|
|
90
|
-
react_1.default.createElement(
|
|
91
|
+
react_1.default.createElement(base_input_deprecated_1.BaseInput, Object.assign({}, baseInputProps, { type: type, id: id, name: name, autoComplete: autoComplete, "data-testid": 'text-field:field', multiline: multiline, ref: baseInputRef, placeholder: withLabel && labelAsPlaceholder ? undefined : placeholder, restPlaceholder: withLabel && labelAsPlaceholder ? undefined : restPlaceholder, autoFocus: autoFocus, className: cx('base-input', commonModifyClasses, classes.baseInput, size && `size-${size}`), defaultValue: defaultValue, value: value, readOnly: readOnly, disabled: disabled, onFocus: (event) => {
|
|
91
92
|
onFocus && onFocus(event);
|
|
92
93
|
toggleHasValue(Boolean(event.target.value));
|
|
93
94
|
toggleFocused(true);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TextareaHTMLAttributes, Ref } from 'react';
|
|
2
|
+
import { BaseInputAsTextareaProps } from '../base-input';
|
|
3
|
+
import { FieldBlockProps } from '../field-block';
|
|
4
|
+
type HTMLTextareaProps = Pick<TextareaHTMLAttributes<HTMLTextAreaElement>, 'autoComplete' | 'autoFocus' | 'defaultValue' | 'disabled' | 'id' | 'name' | 'onBlur' | 'onChange' | 'onFocus' | 'onInput' | 'placeholder' | 'readOnly' | 'required' | 'rows' | 'value'>;
|
|
5
|
+
export interface TextareaProps extends HTMLTextareaProps, FieldBlockProps {
|
|
6
|
+
/** Ref элемента textarea. */
|
|
7
|
+
textareaRef?: Ref<HTMLTextAreaElement>;
|
|
8
|
+
/** Свойства BaseInputProps. */
|
|
9
|
+
baseInputProps?: BaseInputAsTextareaProps;
|
|
10
|
+
/** Стили корневого элемента. */
|
|
11
|
+
style?: Required<FieldBlockProps>['rootProps']['style'];
|
|
12
|
+
/** CSS-класс корневого элемента. */
|
|
13
|
+
className?: Required<FieldBlockProps>['rootProps']['className'];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Текстовая область.
|
|
17
|
+
* @param props Свойства.
|
|
18
|
+
* @return Элемент.
|
|
19
|
+
*/
|
|
20
|
+
export declare function Textarea({ textareaRef, baseInputProps, style, className, autoComplete, autoFocus, defaultValue, disabled, id, name, onBlur, onChange, onFocus, onInput, placeholder, readOnly, required, rows, value, label, failed, caption, blockProps, 'data-testid': testId, ...restProps }: TextareaProps): JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.Textarea = void 0;
|
|
41
|
+
const react_1 = __importStar(require("react"));
|
|
42
|
+
const base_input_1 = require("../base-input");
|
|
43
|
+
const field_block_1 = require("../field-block");
|
|
44
|
+
const utils_1 = require("../input/utils");
|
|
45
|
+
const bind_1 = __importDefault(require("classnames/bind"));
|
|
46
|
+
const textarea_module_scss_1 = __importDefault(require("./textarea.module.scss"));
|
|
47
|
+
const cx = bind_1.default.bind(textarea_module_scss_1.default);
|
|
48
|
+
/**
|
|
49
|
+
* Текстовая область.
|
|
50
|
+
* @param props Свойства.
|
|
51
|
+
* @return Элемент.
|
|
52
|
+
*/
|
|
53
|
+
function Textarea(_a) {
|
|
54
|
+
var {
|
|
55
|
+
// specific Textarea props
|
|
56
|
+
textareaRef, baseInputProps,
|
|
57
|
+
// root props
|
|
58
|
+
style, className,
|
|
59
|
+
// textarea element props (popular)
|
|
60
|
+
autoComplete, autoFocus, defaultValue, disabled, id, name, onBlur, onChange, onFocus, onInput, placeholder, readOnly, required, rows = 4, value,
|
|
61
|
+
// FieldBlock props
|
|
62
|
+
label, failed, caption, blockProps, 'data-testid': testId = 'textarea' } = _a, restProps = __rest(_a, ["textareaRef", "baseInputProps", "style", "className", "autoComplete", "autoFocus", "defaultValue", "disabled", "id", "name", "onBlur", "onChange", "onFocus", "onInput", "placeholder", "readOnly", "required", "rows", "value", "label", "failed", "caption", "blockProps", 'data-testid']);
|
|
63
|
+
const ref = (0, react_1.useRef)(null);
|
|
64
|
+
const [filled, updateFilled] = (0, utils_1.useFilledState)(ref, { value, defaultValue });
|
|
65
|
+
const [focused, setFocused] = (0, react_1.useState)(false);
|
|
66
|
+
const handleMouseDown = (0, utils_1.useFieldMouseDown)(ref, blockProps === null || blockProps === void 0 ? void 0 : blockProps.onMouseDown);
|
|
67
|
+
(0, react_1.useImperativeHandle)(textareaRef, () => ref.current);
|
|
68
|
+
return (react_1.default.createElement(field_block_1.FieldBlock, Object.assign({}, restProps, { rootProps: Object.assign(Object.assign({}, restProps.rootProps), { style,
|
|
69
|
+
className }), "data-testid": testId, caption: caption, disabled: disabled, failed: failed, fixedHeight: false, focused: focused, label: label, labelAsPlaceholder: !focused && !filled, labelProps: { htmlFor: id }, size: 'l', blockProps: Object.assign(Object.assign({}, blockProps), { onMouseDown: handleMouseDown }), main: react_1.default.createElement(base_input_1.BaseInput, Object.assign({}, baseInputProps, { textareaRef: ref, multiline: true, className: cx('textarea', baseInputProps === null || baseInputProps === void 0 ? void 0 : baseInputProps.className), style: Object.assign(Object.assign({}, baseInputProps === null || baseInputProps === void 0 ? void 0 : baseInputProps.style), { '--placeholder-color': (0, utils_1.definePlaceholderColor)({ failed, disabled }) }), autoComplete: autoComplete, autoFocus: autoFocus, defaultValue: defaultValue, disabled: disabled, id: id, name: name, placeholder: placeholder, readOnly: readOnly, required: required, rows: rows, value: value, onFocus: (event) => {
|
|
70
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
|
|
71
|
+
updateFilled(event);
|
|
72
|
+
setFocused(true);
|
|
73
|
+
}, onBlur: (event) => {
|
|
74
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
75
|
+
updateFilled(event);
|
|
76
|
+
setFocused(false);
|
|
77
|
+
}, onInput: (event) => {
|
|
78
|
+
onInput === null || onInput === void 0 ? void 0 : onInput(event);
|
|
79
|
+
updateFilled(event);
|
|
80
|
+
}, onChange: (event) => {
|
|
81
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(event);
|
|
82
|
+
updateFilled(event);
|
|
83
|
+
} })), mainProps: { className: cx('main') } })));
|
|
84
|
+
}
|
|
85
|
+
exports.Textarea = Textarea;
|
package/toggle/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
2
|
+
import { CheckboxInputProps } from '../types';
|
|
3
|
+
export type ToggleProps = CheckboxInputProps;
|
|
4
4
|
/**
|
|
5
5
|
* Компонент стилизованного переключателя (input[type=checkbox]).
|
|
6
6
|
*/
|
|
7
|
-
export declare const Toggle: React.ForwardRefExoticComponent<
|
|
7
|
+
export declare const Toggle: React.ForwardRefExoticComponent<CheckboxInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -11,14 +11,23 @@
|
|
|
11
11
|
|
|
12
12
|
.input {
|
|
13
13
|
display: none;
|
|
14
|
+
&:not(:checked) + .switch {
|
|
15
|
+
--toggle-slider-position: 2px;
|
|
16
|
+
}
|
|
14
17
|
&:checked + .switch {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
18
|
+
--toggle-slider-position: calc(100% - 22px);
|
|
19
|
+
}
|
|
20
|
+
&:not(:checked):not(:disabled) + .switch {
|
|
21
|
+
--toggle-primary-color: #{colors.$basic-gray12};
|
|
22
|
+
}
|
|
23
|
+
&:checked:not(:disabled) + .switch {
|
|
24
|
+
--toggle-primary-color: #{colors.$basic-blue};
|
|
25
|
+
}
|
|
26
|
+
&:not(:checked):disabled + .switch {
|
|
27
|
+
--toggle-primary-color: #{colors.$basic-gray4};
|
|
19
28
|
}
|
|
20
|
-
&:disabled + .switch {
|
|
21
|
-
|
|
29
|
+
&:checked:disabled + .switch {
|
|
30
|
+
--toggle-primary-color: #{colors.$basic-gray24};
|
|
22
31
|
}
|
|
23
32
|
}
|
|
24
33
|
|
|
@@ -28,13 +37,13 @@
|
|
|
28
37
|
width: 44px;
|
|
29
38
|
height: 24px;
|
|
30
39
|
border-radius: 12px;
|
|
31
|
-
background:
|
|
40
|
+
background: var(--toggle-primary-color);
|
|
32
41
|
transition: background 0.16s ease-in-out;
|
|
33
42
|
&::after {
|
|
34
43
|
content: '';
|
|
35
44
|
position: absolute;
|
|
36
45
|
top: 2px;
|
|
37
|
-
left:
|
|
46
|
+
left: var(--toggle-slider-position);
|
|
38
47
|
display: block;
|
|
39
48
|
width: 20px;
|
|
40
49
|
height: 20px;
|
package/tooltip/index.d.ts
CHANGED
package/tooltip/index.js
CHANGED
|
@@ -34,6 +34,7 @@ const tooltip_module_scss_1 = __importDefault(require("./tooltip.module.scss"));
|
|
|
34
34
|
const cx = bind_1.default.bind(tooltip_module_scss_1.default);
|
|
35
35
|
/**
|
|
36
36
|
* Компонент подсказки.
|
|
37
|
+
* @deprecated Можно использовать `popup`.
|
|
37
38
|
* @param props Свойства.
|
|
38
39
|
* @return Элемент.
|
|
39
40
|
*/
|
package/top-bar/index.d.ts
CHANGED
|
@@ -1,40 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
icon?: React.ReactNode;
|
|
5
|
-
'data-testid'?: string;
|
|
6
|
-
}
|
|
7
|
-
export interface TopBarProps {
|
|
8
|
-
/** Свойства кнопок. */
|
|
9
|
-
buttonsProps?: {
|
|
10
|
-
start?: ButtonProps;
|
|
11
|
-
startSecondary?: ButtonProps;
|
|
12
|
-
end?: ButtonProps;
|
|
13
|
-
endSecondary?: ButtonProps;
|
|
14
|
-
};
|
|
15
|
-
/** CSS-класс корневого элемента. */
|
|
16
|
-
className?: string;
|
|
17
|
-
/** Размер. */
|
|
18
|
-
size?: TopBarSize;
|
|
19
|
-
/** Подзаголовок. */
|
|
20
|
-
subtitle?: string;
|
|
21
|
-
/** Заголовок. */
|
|
22
|
-
title?: string;
|
|
23
|
-
/** Нужна ли разделительная черта снизу. */
|
|
24
|
-
divided?: boolean;
|
|
25
|
-
}
|
|
26
|
-
export declare const TOP_BAR_HEIGHT: Readonly<Record<TopBarSize, number>>;
|
|
27
|
-
/**
|
|
28
|
-
* Компонент шапки модальных окон/экранов.
|
|
29
|
-
* @param props Свойства.
|
|
30
|
-
* @return Элемент.
|
|
31
|
-
*/
|
|
32
|
-
export declare const TopBar: ({ divided, size, title, subtitle, buttonsProps: { start, startSecondary, end, endSecondary }, className, }: TopBarProps) => JSX.Element;
|
|
33
|
-
/**
|
|
34
|
-
* Компонент кнопки-иконки.
|
|
35
|
-
* @param props Свойства. Поддерживаются свойства button.
|
|
36
|
-
* @param props.icon Иконка.
|
|
37
|
-
* @return Элемент.
|
|
38
|
-
*/
|
|
39
|
-
export declare const IconButton: ({ icon, ...buttonProps }: ButtonProps) => JSX.Element;
|
|
40
|
-
export {};
|
|
1
|
+
export type { TopBarProps, TopBarSize } from './types';
|
|
2
|
+
export type { navigationButtons } from './utils';
|
|
3
|
+
export { TopBar, TOP_BAR_HEIGHT } from './top-bar';
|