@sima-land/ui-nucleons 44.2.9 → 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 +2 -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,35 @@
|
|
|
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.PopupView = void 0;
|
|
18
|
+
const react_1 = __importDefault(require("react"));
|
|
19
|
+
const cross_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Stroked/cross"));
|
|
20
|
+
const bind_1 = __importDefault(require("classnames/bind"));
|
|
21
|
+
const popup_view_module_scss_1 = __importDefault(require("./popup-view.module.scss"));
|
|
22
|
+
const cx = bind_1.default.bind(popup_view_module_scss_1.default);
|
|
23
|
+
/**
|
|
24
|
+
* Popup.
|
|
25
|
+
* @param props Свойства.
|
|
26
|
+
* @return Элемент.
|
|
27
|
+
*/
|
|
28
|
+
function PopupView(_a) {
|
|
29
|
+
var { children, onClose, popupRef, className, 'data-testid': testId = 'popup' } = _a, rest = __rest(_a, ["children", "onClose", "popupRef", "className", 'data-testid']);
|
|
30
|
+
return (react_1.default.createElement("div", Object.assign({}, rest, { className: cx('root', className), ref: popupRef, "data-testid": testId }),
|
|
31
|
+
onClose && (react_1.default.createElement("button", { "aria-label": '\u0417\u0430\u043A\u0440\u044B\u0442\u044C', className: cx('close'), onClick: onClose, "data-testid": 'popup:close' },
|
|
32
|
+
react_1.default.createElement(cross_1.default, null))),
|
|
33
|
+
react_1.default.createElement("div", { className: cx('content') }, children)));
|
|
34
|
+
}
|
|
35
|
+
exports.PopupView = PopupView;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
@use '../colors';
|
|
2
|
+
@use '../shadows';
|
|
3
|
+
@use '../utils';
|
|
4
|
+
|
|
5
|
+
.root {
|
|
6
|
+
@include shadows.box-shadow('z2');
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
position: relative;
|
|
9
|
+
max-width: 400px;
|
|
10
|
+
max-height: min(536px, calc(100vh - 16px));
|
|
11
|
+
padding: 40px 8px;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
background: colors.$basic-gray4;
|
|
14
|
+
border-radius: 4px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.close {
|
|
18
|
+
@include utils.reset-button;
|
|
19
|
+
@include utils.focus-visible;
|
|
20
|
+
position: absolute;
|
|
21
|
+
top: 0;
|
|
22
|
+
right: 0;
|
|
23
|
+
width: 40px;
|
|
24
|
+
height: 40px;
|
|
25
|
+
padding: 8px 8px 0 0;
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: flex-start;
|
|
28
|
+
justify-content: flex-end;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.content {
|
|
33
|
+
@include utils.semi-stylized-scrollbars(colors.$basic-gray4);
|
|
34
|
+
font-size: 16px;
|
|
35
|
+
line-height: 24px;
|
|
36
|
+
padding: 0 32px;
|
|
37
|
+
max-height: 456px; // 536 (по гайдам) - 80 (горизонтальные отступы)
|
|
38
|
+
overflow-y: auto;
|
|
39
|
+
overflow-x: hidden;
|
|
40
|
+
}
|
package/popup/popup.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { PopupViewProps } from './popup-view';
|
|
3
|
+
export interface PopupProps extends Omit<PopupViewProps, 'onClose'> {
|
|
4
|
+
/** Элемент для которого нужно показать Popup ил null. */
|
|
5
|
+
showFor?: Element | null;
|
|
6
|
+
/** Сработает при попытке закрыть Popup. */
|
|
7
|
+
onDismiss?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export interface PopupInnerProps extends PopupProps {
|
|
10
|
+
showFor: Element;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Popup, всплывающий когда указан целевой элемент.
|
|
14
|
+
* @param props Свойства.
|
|
15
|
+
* @return Элемент.
|
|
16
|
+
*/
|
|
17
|
+
export declare function Popup({ showFor, ...rest }: PopupProps): JSX.Element;
|
package/popup/popup.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.Popup = void 0;
|
|
38
|
+
const react_1 = __importStar(require("react"));
|
|
39
|
+
const popup_view_1 = require("./popup-view");
|
|
40
|
+
const react_2 = require("@floating-ui/react");
|
|
41
|
+
const hooks_1 = require("../hooks");
|
|
42
|
+
const utils_1 = require("./utils");
|
|
43
|
+
const identity_1 = require("../hooks/identity");
|
|
44
|
+
const portal_1 = require("../portal");
|
|
45
|
+
/**
|
|
46
|
+
* Popup, всплывающий когда указан целевой элемент.
|
|
47
|
+
* @param props Свойства.
|
|
48
|
+
* @return Элемент.
|
|
49
|
+
*/
|
|
50
|
+
function Popup(_a) {
|
|
51
|
+
var { showFor } = _a, rest = __rest(_a, ["showFor"]);
|
|
52
|
+
return react_1.default.createElement(portal_1.Portal, null, showFor && react_1.default.createElement(PopupInner, Object.assign({ showFor: showFor }, rest)));
|
|
53
|
+
}
|
|
54
|
+
exports.Popup = Popup;
|
|
55
|
+
/**
|
|
56
|
+
* Внутренний компонент, необходим из-за использования портала.
|
|
57
|
+
* @param props Свойства.
|
|
58
|
+
* @return Элемент.
|
|
59
|
+
*/
|
|
60
|
+
function PopupInner(_a) {
|
|
61
|
+
var { showFor, popupRef, children, style, onDismiss } = _a, rest = __rest(_a, ["showFor", "popupRef", "children", "style", "onDismiss"]);
|
|
62
|
+
const _b = (0, react_2.useFloating)((0, utils_1.popupFloatingConfig)()), { refs } = _b, floating = __rest(_b, ["refs"]);
|
|
63
|
+
const floatingStyle = (0, utils_1.usePopupFloatingStyle)(floating);
|
|
64
|
+
(0, react_1.useImperativeHandle)(popupRef, () => refs.floating.current);
|
|
65
|
+
(0, react_1.useImperativeHandle)(refs.setReference, () => showFor, [showFor]);
|
|
66
|
+
const anchorRef = (0, identity_1.useIdentityRef)(showFor);
|
|
67
|
+
(0, hooks_1.useOutsideClick)([anchorRef, refs.floating], onDismiss);
|
|
68
|
+
(0, utils_1.useFocusTrap)(refs.floating, {
|
|
69
|
+
enabled: floating.isPositioned,
|
|
70
|
+
afterDeactivate: onDismiss,
|
|
71
|
+
});
|
|
72
|
+
return (react_1.default.createElement(popup_view_1.PopupView, Object.assign({}, rest, { popupRef: refs.setFloating, style: Object.assign(Object.assign({}, style), floatingStyle), onClose: onDismiss }), children));
|
|
73
|
+
}
|
package/popup/utils.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { UseFloatingProps, UseFloatingReturn } from '@floating-ui/react';
|
|
2
|
+
import { RefObject } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Возвращает конфигурацию для `useFloating` по дизайн-гайдам.
|
|
5
|
+
* @return Конфигурация для `useFloating` по дизайн-гайдам.
|
|
6
|
+
*/
|
|
7
|
+
export declare function popupFloatingConfig(): Partial<UseFloatingProps>;
|
|
8
|
+
/**
|
|
9
|
+
* Возвращает стили для элемента с учетом "слоя".
|
|
10
|
+
* @param floating Результат вызова useFloating.
|
|
11
|
+
* @return Стили для элемента с учетом "слоя".
|
|
12
|
+
*/
|
|
13
|
+
export declare function usePopupFloatingStyle({ strategy, x, y, }: Pick<UseFloatingReturn, 'strategy' | 'x' | 'y'>): {
|
|
14
|
+
position: import("@floating-ui/react").Strategy;
|
|
15
|
+
top: number;
|
|
16
|
+
left: number;
|
|
17
|
+
zIndex: number;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Показ всплывающего элемента по клику и скрытие.
|
|
21
|
+
* @param floating Результат вызова useFloating.
|
|
22
|
+
* @return Опции для открывающего и всплывающего элемента.
|
|
23
|
+
*/
|
|
24
|
+
export declare function usePopupOnClick(floating: Pick<UseFloatingReturn, 'context' | 'strategy' | 'x' | 'y'>): {
|
|
25
|
+
getReferenceProps: (userProps?: import("react").HTMLProps<Element> | undefined) => Record<string, unknown>;
|
|
26
|
+
getFloatingProps: (userProps?: import("react").HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
|
|
27
|
+
getItemProps: (userProps?: import("react").HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Хук ловушки фокуса.
|
|
31
|
+
* @todo Вынести в общие утилиты тк понадобится для Modal и тд.
|
|
32
|
+
* @param ref Элемент-контейнер для которого нужно захватить фокус.
|
|
33
|
+
* @param options Опции.
|
|
34
|
+
*/
|
|
35
|
+
export declare function useFocusTrap(ref: RefObject<HTMLElement | SVGElement>, { enabled, afterDeactivate, }: {
|
|
36
|
+
enabled: boolean;
|
|
37
|
+
afterDeactivate?: () => void;
|
|
38
|
+
}): void;
|
package/popup/utils.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useFocusTrap = exports.usePopupOnClick = exports.usePopupFloatingStyle = exports.popupFloatingConfig = void 0;
|
|
4
|
+
const react_1 = require("@floating-ui/react");
|
|
5
|
+
const focus_trap_1 = require("focus-trap");
|
|
6
|
+
const layer_1 = require("../helpers/layer");
|
|
7
|
+
const hooks_1 = require("../hooks");
|
|
8
|
+
const identity_1 = require("../hooks/identity");
|
|
9
|
+
/**
|
|
10
|
+
* Возвращает конфигурацию для `useFloating` по дизайн-гайдам.
|
|
11
|
+
* @return Конфигурация для `useFloating` по дизайн-гайдам.
|
|
12
|
+
*/
|
|
13
|
+
function popupFloatingConfig() {
|
|
14
|
+
return {
|
|
15
|
+
strategy: 'absolute',
|
|
16
|
+
placement: 'right-start',
|
|
17
|
+
middleware: [
|
|
18
|
+
(0, react_1.offset)(8),
|
|
19
|
+
(0, react_1.flip)({
|
|
20
|
+
padding: 16,
|
|
21
|
+
crossAxis: false,
|
|
22
|
+
fallbackAxisSideDirection: 'start',
|
|
23
|
+
}),
|
|
24
|
+
(0, react_1.shift)({
|
|
25
|
+
padding: 16,
|
|
26
|
+
}),
|
|
27
|
+
],
|
|
28
|
+
whileElementsMounted: react_1.autoUpdate,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
exports.popupFloatingConfig = popupFloatingConfig;
|
|
32
|
+
/**
|
|
33
|
+
* Возвращает стили для элемента с учетом "слоя".
|
|
34
|
+
* @param floating Результат вызова useFloating.
|
|
35
|
+
* @return Стили для элемента с учетом "слоя".
|
|
36
|
+
*/
|
|
37
|
+
function usePopupFloatingStyle({ strategy, x, y, }) {
|
|
38
|
+
const layer = (0, layer_1.useLayer)();
|
|
39
|
+
return {
|
|
40
|
+
position: strategy,
|
|
41
|
+
top: y !== null && y !== void 0 ? y : 0,
|
|
42
|
+
left: x !== null && x !== void 0 ? x : 0,
|
|
43
|
+
zIndex: layer + 2,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
exports.usePopupFloatingStyle = usePopupFloatingStyle;
|
|
47
|
+
/**
|
|
48
|
+
* Показ всплывающего элемента по клику и скрытие.
|
|
49
|
+
* @param floating Результат вызова useFloating.
|
|
50
|
+
* @return Опции для открывающего и всплывающего элемента.
|
|
51
|
+
*/
|
|
52
|
+
function usePopupOnClick(floating) {
|
|
53
|
+
const style = usePopupFloatingStyle(floating);
|
|
54
|
+
const click = (0, react_1.useClick)(floating.context);
|
|
55
|
+
const dismiss = (0, react_1.useDismiss)(floating.context);
|
|
56
|
+
return (0, react_1.useInteractions)([click, dismiss, { floating: { style } }]);
|
|
57
|
+
}
|
|
58
|
+
exports.usePopupOnClick = usePopupOnClick;
|
|
59
|
+
/**
|
|
60
|
+
* Хук ловушки фокуса.
|
|
61
|
+
* @todo Вынести в общие утилиты тк понадобится для Modal и тд.
|
|
62
|
+
* @param ref Элемент-контейнер для которого нужно захватить фокус.
|
|
63
|
+
* @param options Опции.
|
|
64
|
+
*/
|
|
65
|
+
function useFocusTrap(ref, { enabled, afterDeactivate, }) {
|
|
66
|
+
const afterDeactivateRef = (0, identity_1.useIdentityRef)(afterDeactivate);
|
|
67
|
+
(0, hooks_1.useIsomorphicLayoutEffect)(() => {
|
|
68
|
+
const element = ref.current;
|
|
69
|
+
if (enabled && element) {
|
|
70
|
+
const trap = (0, focus_trap_1.createFocusTrap)(element, {
|
|
71
|
+
allowOutsideClick: true,
|
|
72
|
+
tabbableOptions: { displayCheck: 'none' },
|
|
73
|
+
onPostDeactivate: afterDeactivateRef.current,
|
|
74
|
+
fallbackFocus: element,
|
|
75
|
+
});
|
|
76
|
+
trap.activate();
|
|
77
|
+
return () => {
|
|
78
|
+
trap.deactivate({ returnFocus: true });
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}, [ref, enabled]);
|
|
82
|
+
}
|
|
83
|
+
exports.useFocusTrap = useFocusTrap;
|
package/price/index.d.ts
CHANGED
|
@@ -18,4 +18,4 @@ export interface PriceProps {
|
|
|
18
18
|
* @param props Параметры компонента.
|
|
19
19
|
* @return Элемент.
|
|
20
20
|
*/
|
|
21
|
-
export declare
|
|
21
|
+
export declare function Price({ className, currencyGrapheme: grapheme, graphemeBefore, crossedOut, value, 'data-testid': testId, }: PriceProps): JSX.Element;
|
package/price/index.js
CHANGED
|
@@ -6,18 +6,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Price = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const utils_1 = require("./utils");
|
|
9
|
-
const price_module_scss_1 = __importDefault(require("./price.module.scss"));
|
|
10
9
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
10
|
+
const price_module_scss_1 = __importDefault(require("./price.module.scss"));
|
|
11
11
|
const cx = bind_1.default.bind(price_module_scss_1.default);
|
|
12
12
|
/**
|
|
13
13
|
* Цена товара с указанием знака валюты.
|
|
14
14
|
* @param props Параметры компонента.
|
|
15
15
|
* @return Элемент.
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
function Price({ className, currencyGrapheme: grapheme, graphemeBefore, crossedOut, value, 'data-testid': testId = 'price', }) {
|
|
18
18
|
const content = (0, utils_1.formatPrice)(value, grapheme, {
|
|
19
19
|
graphemeBefore,
|
|
20
20
|
});
|
|
21
21
|
return (react_1.default.createElement("span", { className: cx('root', className, crossedOut && 'crossed-out'), "data-testid": testId }, content));
|
|
22
|
-
}
|
|
22
|
+
}
|
|
23
23
|
exports.Price = Price;
|
package/price/utils.d.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* @param options Опции.
|
|
6
6
|
* @return Отформатированная цена.
|
|
7
7
|
*/
|
|
8
|
-
export declare
|
|
9
|
-
graphemeBefore?: boolean
|
|
10
|
-
})
|
|
11
|
-
export declare
|
|
12
|
-
export declare
|
|
8
|
+
export declare function formatPrice(value: number | string, grapheme?: string, { graphemeBefore }?: {
|
|
9
|
+
graphemeBefore?: boolean;
|
|
10
|
+
}): string;
|
|
11
|
+
export declare function formatInteger(value: number): string;
|
|
12
|
+
export declare function formatFractional(value: number): string;
|
package/price/utils.js
CHANGED
|
@@ -8,30 +8,30 @@ exports.formatFractional = exports.formatInteger = exports.formatPrice = void 0;
|
|
|
8
8
|
* @param options Опции.
|
|
9
9
|
* @return Отформатированная цена.
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
function formatPrice(value, grapheme, { graphemeBefore } = {}) {
|
|
12
12
|
const number = Number(value);
|
|
13
13
|
return [
|
|
14
14
|
// графема до
|
|
15
15
|
grapheme && graphemeBefore && `${grapheme} `,
|
|
16
16
|
// целая часть
|
|
17
|
-
|
|
17
|
+
formatInteger(number),
|
|
18
18
|
// дробная часть
|
|
19
|
-
Number.isFinite(number) && !Number.isInteger(number) && `,${
|
|
19
|
+
Number.isFinite(number) && !Number.isInteger(number) && `,${formatFractional(number)}`,
|
|
20
20
|
// графема после
|
|
21
21
|
grapheme && !graphemeBefore && ` ${grapheme}`,
|
|
22
22
|
]
|
|
23
23
|
.filter(Boolean)
|
|
24
24
|
.map(s => s.replace(/\s/g, '\u2009')) // заменяем все пробелы на полупробелы
|
|
25
25
|
.join('');
|
|
26
|
-
}
|
|
26
|
+
}
|
|
27
27
|
exports.formatPrice = formatPrice;
|
|
28
|
-
// eslint-disable-next-line require-jsdoc
|
|
29
|
-
|
|
28
|
+
// eslint-disable-next-line require-jsdoc, jsdoc/require-jsdoc
|
|
29
|
+
function formatInteger(value) {
|
|
30
30
|
let result = '0';
|
|
31
31
|
if (Number.isFinite(value)) {
|
|
32
32
|
// если число меньше 0.0001 - округляем до 0.0001
|
|
33
33
|
const valid = value === 0 ? 0 : Math.max(value, 0.0001);
|
|
34
|
-
const integer =
|
|
34
|
+
const integer = toString(valid).replace(/\..*$/g, ''); // все числа до точки
|
|
35
35
|
const separated = [];
|
|
36
36
|
const list = integer.split('');
|
|
37
37
|
while (list.length) {
|
|
@@ -41,23 +41,33 @@ const formatInteger = (value) => {
|
|
|
41
41
|
result = separated.join(' ');
|
|
42
42
|
}
|
|
43
43
|
return result;
|
|
44
|
-
}
|
|
44
|
+
}
|
|
45
45
|
exports.formatInteger = formatInteger;
|
|
46
|
-
// eslint-disable-next-line require-jsdoc
|
|
47
|
-
|
|
48
|
-
let
|
|
46
|
+
// eslint-disable-next-line require-jsdoc, jsdoc/require-jsdoc
|
|
47
|
+
function formatFractional(value) {
|
|
48
|
+
let fractional = '';
|
|
49
49
|
if (Number.isFinite(value) && !Number.isInteger(value)) {
|
|
50
|
-
|
|
51
|
-
// если число меньше 0.0001 - округляем до 0.0001
|
|
52
|
-
result = '0001';
|
|
53
|
-
}
|
|
54
|
-
else if (value < 0.01) {
|
|
55
|
-
result = value.toFixed(4).slice(-4);
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
result = value.toFixed(2).slice(-2);
|
|
59
|
-
}
|
|
50
|
+
fractional = toString(value).replace(/^.*\./g, '');
|
|
60
51
|
}
|
|
61
|
-
return
|
|
62
|
-
}
|
|
52
|
+
return fractional;
|
|
53
|
+
}
|
|
63
54
|
exports.formatFractional = formatFractional;
|
|
55
|
+
/**
|
|
56
|
+
* Округляет число и приводит его к строке по дизайн-гайдам цен.
|
|
57
|
+
* @param value Число.
|
|
58
|
+
* @return Отформатированное число.
|
|
59
|
+
*/
|
|
60
|
+
function toString(value) {
|
|
61
|
+
let result;
|
|
62
|
+
if (value <= 0.0001) {
|
|
63
|
+
// если число меньше 0.0001 - округляем до 0.0001
|
|
64
|
+
result = '0.0001';
|
|
65
|
+
}
|
|
66
|
+
else if (value < 0.01) {
|
|
67
|
+
result = value.toFixed(4);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
result = value.toFixed(2);
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
import { FieldProps, WithTestId } from '../types';
|
|
3
|
+
export interface RadioButtonProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'>, FieldProps, WithTestId {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Радио-кнопка.
|
|
7
|
+
* @param props Свойства.
|
|
8
|
+
* @return Элемент.
|
|
9
|
+
*/
|
|
10
|
+
export declare function RadioButton({ style, className, 'data-testid': testId, ...restProps }: RadioButtonProps): JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
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.RadioButton = void 0;
|
|
18
|
+
const react_1 = __importDefault(require("react"));
|
|
19
|
+
const bind_1 = __importDefault(require("classnames/bind"));
|
|
20
|
+
const radio_button_module_scss_1 = __importDefault(require("./radio-button.module.scss"));
|
|
21
|
+
const cx = bind_1.default.bind(radio_button_module_scss_1.default);
|
|
22
|
+
/**
|
|
23
|
+
* Радио-кнопка.
|
|
24
|
+
* @param props Свойства.
|
|
25
|
+
* @return Элемент.
|
|
26
|
+
*/
|
|
27
|
+
function RadioButton(_a) {
|
|
28
|
+
var { style, className, 'data-testid': testId = 'radio-button' } = _a, restProps = __rest(_a, ["style", "className", 'data-testid']);
|
|
29
|
+
return (react_1.default.createElement("div", { style: style, className: cx('root', className) },
|
|
30
|
+
react_1.default.createElement("input", Object.assign({}, restProps, { type: 'radio', className: cx('input'), "data-testid": testId })),
|
|
31
|
+
react_1.default.createElement("div", { className: cx('circle') })));
|
|
32
|
+
}
|
|
33
|
+
exports.RadioButton = RadioButton;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@use '../colors';
|
|
2
|
+
|
|
3
|
+
.root {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
position: relative;
|
|
6
|
+
width: 16px;
|
|
7
|
+
height: 16px;
|
|
8
|
+
vertical-align: -0.125em; // не понятно почему, но это значение ставит блок ровно по середине строки
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.circle {
|
|
12
|
+
--radio-border-width: 1px;
|
|
13
|
+
--radio-border-color: #{colors.$basic-gray38};
|
|
14
|
+
--radio-color: #fff;
|
|
15
|
+
display: block;
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
border-radius: 50%;
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 100%;
|
|
20
|
+
background: var(--radio-color);
|
|
21
|
+
box-shadow: inset 0 0 0 var(--radio-border-width) var(--radio-border-color);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.input {
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 0;
|
|
27
|
+
left: 0;
|
|
28
|
+
width: 100%;
|
|
29
|
+
margin: 0;
|
|
30
|
+
height: 100%;
|
|
31
|
+
opacity: 0;
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
&:checked + .circle {
|
|
34
|
+
--radio-border-width: 6px;
|
|
35
|
+
--radio-border-color: #{colors.$basic-blue};
|
|
36
|
+
}
|
|
37
|
+
&:not(:checked):disabled + .circle {
|
|
38
|
+
--radio-border-color: #{colors.$basic-gray24};
|
|
39
|
+
--radio-color: #{colors.$basic-gray4};
|
|
40
|
+
}
|
|
41
|
+
&:checked:disabled + .circle {
|
|
42
|
+
--radio-border-width: 6px;
|
|
43
|
+
--radio-border-color: #{colors.$basic-gray24};
|
|
44
|
+
--radio-color: #{colors.$basic-gray4};
|
|
45
|
+
}
|
|
46
|
+
}
|
package/rating/index.d.ts
CHANGED
package/rating/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type StarType = 'full' | 'half' | 'empty';
|