@sima-land/ui-nucleons 44.2.10 → 45.0.0-alpha.1
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/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 +34 -3
- 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} +2 -2
- package/{colors.js → colors/index.js} +2 -1
- package/colors.scss +2 -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 +47 -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 +32 -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-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-util.scss +37 -0
- package/link/link.module.scss +19 -12
- 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 +56 -65
- 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 +7 -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/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 +59 -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 +96 -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-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/_internal/{checkbox/index.js → page-scroll-lock/types.js} +0 -0
- /package/{hint → hint-deprecated}/hint.module.scss +0 -0
- /package/{select → select-deprecated}/select.module.scss +0 -0
- /package/{upload → upload-area}/upload.svg +0 -0
package/input/utils.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useFieldMouseDown = exports.useFilledState = exports.definePlaceholderColor = exports.defineFilled = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const colors_1 = require("../colors");
|
|
6
|
+
/**
|
|
7
|
+
* Получив значения value и defaultValue для поля, определяет является ли оно заполненным.
|
|
8
|
+
* @param value Значение value.
|
|
9
|
+
* @param defaultValue Значение defaultValue.
|
|
10
|
+
* @return Является ли поле заполненным.
|
|
11
|
+
*/
|
|
12
|
+
function defineFilled(value, defaultValue) {
|
|
13
|
+
return [value, defaultValue].some(v => typeof v !== 'undefined' && `${v}` !== '');
|
|
14
|
+
}
|
|
15
|
+
exports.defineFilled = defineFilled;
|
|
16
|
+
/**
|
|
17
|
+
* Получи информацию о состоянии поля возвращает цвет placeholder.
|
|
18
|
+
* @param state Состояние.
|
|
19
|
+
* @return Цвет.
|
|
20
|
+
*/
|
|
21
|
+
function definePlaceholderColor({ failed, disabled, }) {
|
|
22
|
+
let placeholderColor = undefined;
|
|
23
|
+
switch (true) {
|
|
24
|
+
case failed:
|
|
25
|
+
placeholderColor = colors_1.COLORS.get('additional-deep-red');
|
|
26
|
+
break;
|
|
27
|
+
case disabled:
|
|
28
|
+
placeholderColor = colors_1.COLORS.get('basic-gray24');
|
|
29
|
+
break;
|
|
30
|
+
case !disabled:
|
|
31
|
+
placeholderColor = colors_1.COLORS.get('basic-gray38');
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
return placeholderColor;
|
|
35
|
+
}
|
|
36
|
+
exports.definePlaceholderColor = definePlaceholderColor;
|
|
37
|
+
/**
|
|
38
|
+
* Хук состояния заполненности поля текстовым значением.
|
|
39
|
+
* @param ref Ref элемента поля.
|
|
40
|
+
* @param affectProps Свойства, влияющие на состояние заполненности.
|
|
41
|
+
* @return Кортеж: состояние; функция обновления состояния.
|
|
42
|
+
*/
|
|
43
|
+
function useFilledState(ref, { value, defaultValue, }) {
|
|
44
|
+
const [filled, setFilled] = (0, react_1.useState)(() => defineFilled(value, defaultValue));
|
|
45
|
+
const updateFilled = (0, react_1.useCallback)(event => {
|
|
46
|
+
setFilled(Boolean(event.currentTarget.value));
|
|
47
|
+
}, []);
|
|
48
|
+
(0, react_1.useEffect)(() => {
|
|
49
|
+
var _a;
|
|
50
|
+
setFilled(Boolean((_a = ref.current) === null || _a === void 0 ? void 0 : _a.value));
|
|
51
|
+
});
|
|
52
|
+
return [filled, updateFilled];
|
|
53
|
+
}
|
|
54
|
+
exports.useFilledState = useFilledState;
|
|
55
|
+
/**
|
|
56
|
+
* Хук, формирующий callback события mousedown на блоке поля, фокусирующий пользователя на поле.
|
|
57
|
+
* @param fieldRef Ref элемента поля.
|
|
58
|
+
* @param callback Будет вызвана по событию mousedown.
|
|
59
|
+
* @return Функция обратного вызова.
|
|
60
|
+
*/
|
|
61
|
+
function useFieldMouseDown(fieldRef, callback) {
|
|
62
|
+
return (0, react_1.useCallback)(event => {
|
|
63
|
+
const field = fieldRef.current;
|
|
64
|
+
callback === null || callback === void 0 ? void 0 : callback(event);
|
|
65
|
+
if (!event.defaultPrevented && field && event.target !== field) {
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
field.focus();
|
|
68
|
+
}
|
|
69
|
+
}, [fieldRef, callback]);
|
|
70
|
+
}
|
|
71
|
+
exports.useFieldMouseDown = useFieldMouseDown;
|
package/layout/index.d.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
disabledOn?: Array<Breakpoint>;
|
|
8
|
-
}
|
|
9
|
-
declare const DesktopLayout: React.ForwardRefExoticComponent<LayoutProps & React.RefAttributes<HTMLElement>>;
|
|
10
|
-
declare const MobileLayout: React.ForwardRefExoticComponent<LayoutProps & React.RefAttributes<HTMLElement>>;
|
|
11
|
-
export { DesktopLayout, MobileLayout };
|
|
1
|
+
import { Breakpoint } from '../types';
|
|
2
|
+
import { LayoutProps } from './types';
|
|
3
|
+
import { Layout } from './layout';
|
|
4
|
+
import { MobileLayout, DesktopLayout } from './legacy';
|
|
5
|
+
export type { Breakpoint, LayoutProps };
|
|
6
|
+
export { Layout, MobileLayout, DesktopLayout };
|
package/layout/index.js
CHANGED
|
@@ -1,62 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.MobileLayout = exports.
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
* Возвращает созданный функциональный компонент, формирующий Layout.
|
|
47
|
-
* @param specificClass Специальный класс.
|
|
48
|
-
* @param displayName Отображаемое имя компонента.
|
|
49
|
-
* @return Элемент.
|
|
50
|
-
*/
|
|
51
|
-
const createLayout = (specificClass, displayName) => {
|
|
52
|
-
const Component = (0, react_1.forwardRef)((_a, ref) => {
|
|
53
|
-
var { className, element: Element = 'div', disabledOn = [] } = _a, restProps = __rest(_a, ["className", "element", "disabledOn"]);
|
|
54
|
-
return (react_1.default.createElement(Element, Object.assign({}, restProps, { ref: ref, className: cx('layout', specificClass, className, disabledOn.map(key => `disabled-${key}`)) })));
|
|
55
|
-
});
|
|
56
|
-
Component.displayName = displayName;
|
|
57
|
-
return Component;
|
|
58
|
-
};
|
|
59
|
-
const DesktopLayout = createLayout('desktop', 'DesktopLayout');
|
|
60
|
-
exports.DesktopLayout = DesktopLayout;
|
|
61
|
-
const MobileLayout = createLayout('mobile', 'MobileLayout');
|
|
62
|
-
exports.MobileLayout = MobileLayout;
|
|
3
|
+
exports.DesktopLayout = exports.MobileLayout = exports.Layout = void 0;
|
|
4
|
+
const layout_1 = require("./layout");
|
|
5
|
+
Object.defineProperty(exports, "Layout", { enumerable: true, get: function () { return layout_1.Layout; } });
|
|
6
|
+
const legacy_1 = require("./legacy");
|
|
7
|
+
Object.defineProperty(exports, "MobileLayout", { enumerable: true, get: function () { return legacy_1.MobileLayout; } });
|
|
8
|
+
Object.defineProperty(exports, "DesktopLayout", { enumerable: true, get: function () { return legacy_1.DesktopLayout; } });
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { LayoutProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Контейнер, формирующий отступы по горизонтали в соответствии с дизайн-гайдами.
|
|
5
|
+
* @param props Свойства.
|
|
6
|
+
* @return Элемент.
|
|
7
|
+
*/
|
|
8
|
+
export declare function Layout({ children, className, disabledOn, rootRef, ...rest }: Omit<LayoutProps, 'element'> & {
|
|
9
|
+
rootRef?: Ref<HTMLDivElement>;
|
|
10
|
+
}): JSX.Element;
|
package/layout/layout.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
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.Layout = void 0;
|
|
18
|
+
const react_1 = __importDefault(require("react"));
|
|
19
|
+
const bind_1 = __importDefault(require("classnames/bind"));
|
|
20
|
+
const layout_module_scss_1 = __importDefault(require("./layout.module.scss"));
|
|
21
|
+
const cx = bind_1.default.bind(layout_module_scss_1.default);
|
|
22
|
+
/**
|
|
23
|
+
* Контейнер, формирующий отступы по горизонтали в соответствии с дизайн-гайдами.
|
|
24
|
+
* @param props Свойства.
|
|
25
|
+
* @return Элемент.
|
|
26
|
+
*/
|
|
27
|
+
function Layout(_a) {
|
|
28
|
+
var { children, className, disabledOn = [], rootRef } = _a, rest = __rest(_a, ["children", "className", "disabledOn", "rootRef"]);
|
|
29
|
+
const rootClassName = cx('layout', className, disabledOn.map(key => `disabled-${key}`));
|
|
30
|
+
return (react_1.default.createElement("div", Object.assign({}, rest, { ref: rootRef, className: rootClassName }), children));
|
|
31
|
+
}
|
|
32
|
+
exports.Layout = Layout;
|
|
@@ -1,49 +1,56 @@
|
|
|
1
1
|
@use '../breakpoints';
|
|
2
2
|
|
|
3
3
|
.layout {
|
|
4
|
-
width: var(--l-width);
|
|
5
|
-
margin: 0 var(--l-gutter);
|
|
6
4
|
@each $key, $val in breakpoints.$map {
|
|
7
5
|
@include breakpoints.up($key) {
|
|
8
6
|
&.disabled-#{$key} {
|
|
9
7
|
width: auto;
|
|
10
|
-
|
|
8
|
+
max-width: none;
|
|
9
|
+
padding-left: 0;
|
|
10
|
+
padding-right: 0;
|
|
11
|
+
margin-left: 0;
|
|
12
|
+
margin-right: 0;
|
|
11
13
|
}
|
|
12
14
|
&:not(.disabled-#{$key}) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
// ВАЖНО: не используем 100vw так как при использовании 100vw не вычитается ширина полосы прокрутки страницы
|
|
16
|
+
width: 100%;
|
|
17
|
+
max-width: var(--layout-fixed-width);
|
|
18
|
+
margin-left: auto;
|
|
19
|
+
margin-right: auto;
|
|
20
|
+
padding-left: var(--layout-fluid-gutter);
|
|
21
|
+
padding-right: var(--layout-fluid-gutter);
|
|
15
22
|
}
|
|
16
23
|
}
|
|
17
24
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
--l-width: calc(100vw - (2 * var(--l-gutter)));
|
|
25
|
+
@include breakpoints.up('mxs') {
|
|
26
|
+
--layout-fixed-width: initial;
|
|
27
|
+
--layout-fluid-gutter: 16px;
|
|
28
|
+
}
|
|
23
29
|
@include breakpoints.up('mm') {
|
|
24
|
-
--
|
|
25
|
-
--
|
|
30
|
+
--layout-fixed-width: 656px;
|
|
31
|
+
--layout-fluid-gutter: initial;
|
|
26
32
|
}
|
|
27
33
|
@include breakpoints.up('ml') {
|
|
28
|
-
--
|
|
29
|
-
--
|
|
34
|
+
--layout-fixed-width: 672px;
|
|
35
|
+
--layout-fluid-gutter: initial;
|
|
30
36
|
}
|
|
31
37
|
@include breakpoints.up('xs') {
|
|
32
|
-
--
|
|
33
|
-
--
|
|
38
|
+
--layout-fixed-width: initial;
|
|
39
|
+
--layout-fluid-gutter: 64px;
|
|
34
40
|
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.desktop {
|
|
38
|
-
min-width: 896px;
|
|
39
|
-
--l-gutter: 64px;
|
|
40
|
-
--l-width: calc(100vw - (2 * var(--l-gutter)));
|
|
41
41
|
@include breakpoints.up('l') {
|
|
42
|
-
--
|
|
43
|
-
--
|
|
42
|
+
--layout-fixed-width: 1472px;
|
|
43
|
+
--layout-fluid-gutter: initial;
|
|
44
44
|
}
|
|
45
45
|
@include breakpoints.up('xl') {
|
|
46
|
-
--
|
|
47
|
-
--
|
|
46
|
+
--layout-fixed-width: 1504px;
|
|
47
|
+
--layout-fluid-gutter: initial;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// пока что не даём использовать приватные переменные чтобы не раскрывать принцип работы
|
|
51
|
+
// так как он может измениться
|
|
52
|
+
*:not(.layout) {
|
|
53
|
+
--layout-fixed-width: initial;
|
|
54
|
+
--layout-fluid-gutter: initial;
|
|
48
55
|
}
|
|
49
56
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LayoutProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated На адаптивных страницах стоит использовать Layout.
|
|
5
|
+
*/
|
|
6
|
+
declare const DesktopLayout: React.ForwardRefExoticComponent<LayoutProps & {
|
|
7
|
+
element?: string | undefined;
|
|
8
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated На адаптивных страницах стоит использовать Layout.
|
|
11
|
+
*/
|
|
12
|
+
declare const MobileLayout: React.ForwardRefExoticComponent<LayoutProps & {
|
|
13
|
+
element?: string | undefined;
|
|
14
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
15
|
+
export { DesktopLayout, MobileLayout };
|
package/layout/legacy.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
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.MobileLayout = exports.DesktopLayout = void 0;
|
|
41
|
+
const react_1 = __importStar(require("react"));
|
|
42
|
+
const bind_1 = __importDefault(require("classnames/bind"));
|
|
43
|
+
const legacy_module_scss_1 = __importDefault(require("./legacy.module.scss"));
|
|
44
|
+
const cx = bind_1.default.bind(legacy_module_scss_1.default);
|
|
45
|
+
/**
|
|
46
|
+
* Возвращает созданный функциональный компонент, формирующий Layout.
|
|
47
|
+
* @param specificClass Специальный класс.
|
|
48
|
+
* @param displayName Отображаемое имя компонента.
|
|
49
|
+
* @return Элемент.
|
|
50
|
+
*/
|
|
51
|
+
const createLayout = (specificClass, displayName) => {
|
|
52
|
+
const Component = (0, react_1.forwardRef)((_a, ref) => {
|
|
53
|
+
var { className, element: Element = 'div', disabledOn = [] } = _a, restProps = __rest(_a, ["className", "element", "disabledOn"]);
|
|
54
|
+
return (react_1.default.createElement(Element, Object.assign({}, restProps, { ref: ref, className: cx('layout', specificClass, className, disabledOn.map(key => `disabled-${key}`)) })));
|
|
55
|
+
});
|
|
56
|
+
Component.displayName = displayName;
|
|
57
|
+
return Component;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* @deprecated На адаптивных страницах стоит использовать Layout.
|
|
61
|
+
*/
|
|
62
|
+
const DesktopLayout = createLayout('desktop', 'DesktopLayout');
|
|
63
|
+
exports.DesktopLayout = DesktopLayout;
|
|
64
|
+
/**
|
|
65
|
+
* @deprecated На адаптивных страницах стоит использовать Layout.
|
|
66
|
+
*/
|
|
67
|
+
const MobileLayout = createLayout('mobile', 'MobileLayout');
|
|
68
|
+
exports.MobileLayout = MobileLayout;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@use '../breakpoints';
|
|
2
|
+
|
|
3
|
+
.layout {
|
|
4
|
+
width: var(--l-width);
|
|
5
|
+
margin: 0 var(--l-gutter);
|
|
6
|
+
@each $key, $val in breakpoints.$map {
|
|
7
|
+
@include breakpoints.up($key) {
|
|
8
|
+
&.disabled-#{$key} {
|
|
9
|
+
width: auto;
|
|
10
|
+
margin: 0;
|
|
11
|
+
}
|
|
12
|
+
&:not(.disabled-#{$key}) {
|
|
13
|
+
width: var(--l-width);
|
|
14
|
+
margin: 0 var(--l-gutter);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.mobile {
|
|
21
|
+
--l-gutter: 16px;
|
|
22
|
+
--l-width: calc(100vw - (2 * var(--l-gutter)));
|
|
23
|
+
@include breakpoints.up('mm') {
|
|
24
|
+
--l-width: 656px;
|
|
25
|
+
--l-gutter: auto;
|
|
26
|
+
}
|
|
27
|
+
@include breakpoints.up('ml') {
|
|
28
|
+
--l-width: 672px;
|
|
29
|
+
--l-gutter: auto;
|
|
30
|
+
}
|
|
31
|
+
@include breakpoints.up('xs') {
|
|
32
|
+
--l-width: 792px;
|
|
33
|
+
--l-gutter: auto;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.desktop {
|
|
38
|
+
min-width: 896px;
|
|
39
|
+
--l-gutter: 64px;
|
|
40
|
+
--l-width: calc(100vw - (2 * var(--l-gutter)));
|
|
41
|
+
@include breakpoints.up('l') {
|
|
42
|
+
--l-width: 1472px;
|
|
43
|
+
--l-gutter: auto;
|
|
44
|
+
}
|
|
45
|
+
@include breakpoints.up('xl') {
|
|
46
|
+
--l-width: 1504px;
|
|
47
|
+
--l-gutter: auto;
|
|
48
|
+
}
|
|
49
|
+
}
|
package/layout/types.js
ADDED
package/link/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Token } from '../colors';
|
|
3
|
+
export type LinkColor = Extract<Token, 'basic-blue' | 'basic-gray87' | 'basic-gray38' | 'basic-white' | 'additional-red' | 'additional-teal'>;
|
|
3
4
|
export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
4
5
|
/** Цвет (название токена). */
|
|
5
|
-
color?:
|
|
6
|
+
color?: LinkColor;
|
|
6
7
|
/** Нужно ли оборачивать содержимое комментариями no-index. */
|
|
7
8
|
noIndex?: boolean;
|
|
8
9
|
/** Выводить как псевдо-ссылку. */
|
|
@@ -11,6 +12,8 @@ export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement>
|
|
|
11
12
|
disabled?: boolean;
|
|
12
13
|
/** Идентификатор для систем автоматизированного тестирования. */
|
|
13
14
|
'data-testid'?: string;
|
|
15
|
+
/** Нужно ли подчеркивание. */
|
|
16
|
+
underline?: boolean;
|
|
14
17
|
}
|
|
15
18
|
/**
|
|
16
19
|
* Компонент ссылки.
|
package/link/index.js
CHANGED
|
@@ -57,12 +57,12 @@ const getContentProps = (children, noIndex) => noIndex ? { dangerouslySetInnerHT
|
|
|
57
57
|
* @return Элемент.
|
|
58
58
|
*/
|
|
59
59
|
exports.Link = (0, react_1.forwardRef)(function Link(_a, ref) {
|
|
60
|
-
var { children, className, color = 'basic-blue', disabled, noIndex = false, pseudo, role, tabIndex, 'data-testid': testId = 'anchor' } = _a, restProps = __rest(_a, ["children", "className", "color", "disabled", "noIndex", "pseudo", "role", "tabIndex", 'data-testid']);
|
|
60
|
+
var { children, className, color = 'basic-blue', disabled, noIndex = false, pseudo, role, tabIndex, underline, 'data-testid': testId = 'anchor' } = _a, restProps = __rest(_a, ["children", "className", "color", "disabled", "noIndex", "pseudo", "role", "tabIndex", "underline", 'data-testid']);
|
|
61
61
|
const baseProps = pseudo
|
|
62
62
|
? {
|
|
63
63
|
role: role || 'button',
|
|
64
64
|
tabIndex: disabled ? undefined : tabIndex || 0,
|
|
65
65
|
}
|
|
66
66
|
: { role, tabIndex };
|
|
67
|
-
return (react_1.default.createElement("a", Object.assign({}, baseProps, restProps, { "data-testid": testId, ref: ref, className: cx('link', className, color, { disabled }) }, getContentProps(children, noIndex))));
|
|
67
|
+
return (react_1.default.createElement("a", Object.assign({}, baseProps, restProps, { "data-testid": testId, ref: ref, className: cx('link', className, color, { disabled, underline }) }, getContentProps(children, noIndex))));
|
|
68
68
|
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@use '../colors';
|
|
2
|
+
|
|
3
|
+
@mixin color($key) {
|
|
4
|
+
@if $key == 'basic-blue' {
|
|
5
|
+
color: colors.$basic-blue;
|
|
6
|
+
&:hover {
|
|
7
|
+
color: colors.$additional-deep-blue;
|
|
8
|
+
}
|
|
9
|
+
} @else if $key == 'basic-gray87' {
|
|
10
|
+
color: colors.$basic-gray87;
|
|
11
|
+
&:hover {
|
|
12
|
+
color: colors.$basic-gray54;
|
|
13
|
+
}
|
|
14
|
+
} @else if $key == 'basic-gray38' {
|
|
15
|
+
color: colors.$basic-gray38;
|
|
16
|
+
&:hover {
|
|
17
|
+
color: colors.$basic-gray54;
|
|
18
|
+
}
|
|
19
|
+
} @else if $key == 'basic-white' {
|
|
20
|
+
color: colors.$basic-white;
|
|
21
|
+
&:hover {
|
|
22
|
+
color: colors.$basic-gray4;
|
|
23
|
+
}
|
|
24
|
+
} @else if $key == 'additional-red' {
|
|
25
|
+
color: colors.$additional-red;
|
|
26
|
+
&:hover {
|
|
27
|
+
color: colors.$additional-deep-red;
|
|
28
|
+
}
|
|
29
|
+
} @else if $key == 'additional-teal' {
|
|
30
|
+
color: colors.$additional-teal;
|
|
31
|
+
&:hover {
|
|
32
|
+
color: colors.$additional-green;
|
|
33
|
+
}
|
|
34
|
+
} @else {
|
|
35
|
+
@warn '[link-color] No such color `#{$key}`.';
|
|
36
|
+
}
|
|
37
|
+
}
|
package/link/link.module.scss
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use '../colors';
|
|
2
|
+
@use './link-util';
|
|
2
3
|
|
|
3
4
|
.link,
|
|
4
5
|
.link:link,
|
|
@@ -9,6 +10,9 @@
|
|
|
9
10
|
font-weight: inherit; // @todo выяснить можно ли это убрать
|
|
10
11
|
cursor: default;
|
|
11
12
|
border-bottom-color: transparent;
|
|
13
|
+
&.underline {
|
|
14
|
+
text-decoration: underline;
|
|
15
|
+
}
|
|
12
16
|
}
|
|
13
17
|
|
|
14
18
|
.link:hover {
|
|
@@ -22,22 +26,25 @@
|
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
.link:not(.disabled).basic-blue {
|
|
25
|
-
color
|
|
26
|
-
&:hover {
|
|
27
|
-
color: colors.$additional-deep-blue;
|
|
28
|
-
}
|
|
29
|
+
@include link-util.color('basic-blue');
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
.link:not(.disabled).basic-gray87 {
|
|
32
|
-
color
|
|
33
|
-
&:hover {
|
|
34
|
-
color: colors.$basic-gray54;
|
|
35
|
-
}
|
|
33
|
+
@include link-util.color('basic-gray87');
|
|
36
34
|
}
|
|
37
35
|
|
|
38
36
|
.link:not(.disabled).basic-gray38 {
|
|
39
|
-
color
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
@include link-util.color('basic-gray38');
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.link:not(.disabled).basic-white {
|
|
41
|
+
@include link-util.color('basic-white');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.link:not(.disabled).additional-red {
|
|
45
|
+
@include link-util.color('additional-red');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.link:not(.disabled).additional-teal {
|
|
49
|
+
@include link-util.color('additional-teal');
|
|
43
50
|
}
|
package/loading-overlay/index.js
CHANGED
|
@@ -11,6 +11,7 @@ const loading_overlay_module_scss_1 = __importDefault(require("./loading-overlay
|
|
|
11
11
|
const cx = bind_1.default.bind(loading_overlay_module_scss_1.default);
|
|
12
12
|
/**
|
|
13
13
|
* Компонент перекрытия для отображения состояния загрузки.
|
|
14
|
+
* @deprecated Следует использовать Spinner напрямую.
|
|
14
15
|
* @param props Свойства.
|
|
15
16
|
* @return Элемент.
|
|
16
17
|
*/
|
package/masked-field/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export interface MaskedFieldProps extends Omit<TextFieldProps, 'value' | 'onBlur
|
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Компонент текстового поля (TextField) с маской.
|
|
17
|
+
* @deprecated Теперь нужно использовать MaskedInput.
|
|
17
18
|
* @param props Свойства.
|
|
18
19
|
* @param props.mask Маска.
|
|
19
20
|
* @param props.value Значение.
|
package/masked-field/index.js
CHANGED
|
@@ -41,6 +41,7 @@ const dom_1 = require("@krutoo/input-mask/dist/dom");
|
|
|
41
41
|
const maskCommons = { placeholder: '_', pattern: /\d/ };
|
|
42
42
|
/**
|
|
43
43
|
* Компонент текстового поля (TextField) с маской.
|
|
44
|
+
* @deprecated Теперь нужно использовать MaskedInput.
|
|
44
45
|
* @param props Свойства.
|
|
45
46
|
* @param props.mask Маска.
|
|
46
47
|
* @param props.value Значение.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UseInputMaskOptions, UseInputMaskResult } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Хук для задания маски для поля ввода текста.
|
|
4
|
+
* @todo Возможно стоит перенести в `@krutoo/input-mask`.
|
|
5
|
+
* @param props Опции.
|
|
6
|
+
* @return Интерфейс работы с маской.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useInputMask({ maskOptions: maskOptionsProp, value, defaultValue, }: UseInputMaskOptions): UseInputMaskResult;
|