@sima-land/ui-nucleons 44.2.1 → 44.2.4
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/checkbox/checkbox.module.scss +21 -0
- package/checkbox/index.js +6 -18
- package/expandable/expandable-group.module.scss +10 -2
- package/expandable/index.d.ts +2 -1
- package/expandable/index.js +10 -15
- package/expandable/utils.d.ts +5 -2
- package/expandable/utils.js +16 -11
- package/package.json +1 -1
- package/stepper/index.d.ts +2 -2
- package/stepper/index.js +4 -2
- package/stepper/stepper.module.scss +24 -9
- package/text-field/text-field.module.scss +5 -5
- package/checkbox/svg/checked.svg +0 -4
- package/checkbox/svg/disabled-checked.svg +0 -4
- package/checkbox/svg/disabled-unchecked.svg +0 -3
- package/checkbox/svg/unchecked.svg +0 -3
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use '../colors';
|
|
2
|
+
|
|
1
3
|
.root {
|
|
2
4
|
position: relative;
|
|
3
5
|
display: inline-block;
|
|
@@ -17,4 +19,23 @@
|
|
|
17
19
|
opacity: 0;
|
|
18
20
|
margin: 0;
|
|
19
21
|
padding: 0;
|
|
22
|
+
&:not(:checked) + svg .mark {
|
|
23
|
+
display: none;
|
|
24
|
+
}
|
|
25
|
+
&:not(:checked) + svg .square {
|
|
26
|
+
fill: #fff;
|
|
27
|
+
stroke: colors.$basic-gray24;
|
|
28
|
+
}
|
|
29
|
+
&:checked + svg .square {
|
|
30
|
+
fill: colors.$basic-blue;
|
|
31
|
+
stroke: colors.$basic-blue;
|
|
32
|
+
}
|
|
33
|
+
&:disabled:not(:checked) + svg .square {
|
|
34
|
+
fill: colors.$basic-gray4;
|
|
35
|
+
stroke: colors.$basic-gray24;
|
|
36
|
+
}
|
|
37
|
+
&:disabled:checked + svg .square {
|
|
38
|
+
fill: colors.$basic-gray12;
|
|
39
|
+
stroke: colors.$basic-gray12;
|
|
40
|
+
}
|
|
20
41
|
}
|
package/checkbox/index.js
CHANGED
|
@@ -39,10 +39,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
40
|
exports.Checkbox = void 0;
|
|
41
41
|
const react_1 = __importStar(require("react"));
|
|
42
|
-
const checked_svg_1 = __importDefault(require("./svg/checked.svg"));
|
|
43
|
-
const unchecked_svg_1 = __importDefault(require("./svg/unchecked.svg"));
|
|
44
|
-
const disabled_checked_svg_1 = __importDefault(require("./svg/disabled-checked.svg"));
|
|
45
|
-
const disabled_unchecked_svg_1 = __importDefault(require("./svg/disabled-unchecked.svg"));
|
|
46
42
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
47
43
|
const checkbox_module_scss_1 = __importDefault(require("./checkbox.module.scss"));
|
|
48
44
|
const cx = bind_1.default.bind(checkbox_module_scss_1.default);
|
|
@@ -50,21 +46,13 @@ const cx = bind_1.default.bind(checkbox_module_scss_1.default);
|
|
|
50
46
|
* Компонент стилизованного переключателя (input[type=checkbox]).
|
|
51
47
|
*/
|
|
52
48
|
exports.Checkbox = (0, react_1.forwardRef)((_a, ref) => {
|
|
53
|
-
var { className, style, 'data-testid': testId = 'checkbox',
|
|
49
|
+
var { className, style, 'data-testid': testId = 'checkbox' } = _a,
|
|
54
50
|
// input props
|
|
55
|
-
|
|
56
|
-
const [isChecked, toggleCheck] = (0, react_1.useState)(Boolean(checked));
|
|
57
|
-
(0, react_1.useEffect)(() => {
|
|
58
|
-
toggleCheck(Boolean(checked));
|
|
59
|
-
}, [checked]);
|
|
51
|
+
restProps = __rest(_a, ["className", "style", 'data-testid']);
|
|
60
52
|
return (react_1.default.createElement("span", { className: cx('root', className), style: style },
|
|
61
|
-
react_1.default.createElement("input", Object.assign({}, restProps, { "data-testid": testId, ref: ref, type: 'checkbox', className: cx('input'),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
!isChecked && !disabled && react_1.default.createElement(unchecked_svg_1.default, null),
|
|
66
|
-
isChecked && !disabled && react_1.default.createElement(checked_svg_1.default, null),
|
|
67
|
-
!isChecked && disabled && react_1.default.createElement(disabled_unchecked_svg_1.default, null),
|
|
68
|
-
isChecked && disabled && react_1.default.createElement(disabled_checked_svg_1.default, null)));
|
|
53
|
+
react_1.default.createElement("input", Object.assign({}, restProps, { "data-testid": testId, ref: ref, type: 'checkbox', className: cx('input') })),
|
|
54
|
+
react_1.default.createElement("svg", { width: '16', height: '16', viewBox: '0 0 16 16', fill: 'none' },
|
|
55
|
+
react_1.default.createElement("rect", { x: '0.5', y: '0.5', width: '15', height: '15', rx: '1.5', className: cx('square') }),
|
|
56
|
+
react_1.default.createElement("path", { fillRule: 'evenodd', clipRule: 'evenodd', d: 'M10.8 5.21967L6.4 9.18934L5.36569 8.21967C5.05327 7.92678 4.54673 7.92678 4.23431 8.21967C3.9219 8.51256 3.9219 8.98744 4.23431 9.28033L5.83431 10.7803C6.14673 11.0732 6.65327 11.0732 6.96569 10.7803L11.7657 6.28033C12.0781 5.98744 12.0781 5.51256 11.7657 5.21967C11.4533 4.92678 11.1124 4.92678 10.8 5.21967Z', fill: 'white', className: cx('mark') }))));
|
|
69
57
|
});
|
|
70
58
|
exports.Checkbox.displayName = 'Checkbox';
|
|
@@ -4,17 +4,25 @@
|
|
|
4
4
|
|
|
5
5
|
.inner {
|
|
6
6
|
display: flex;
|
|
7
|
-
margin: 0;
|
|
8
7
|
padding: 0;
|
|
9
8
|
flex-wrap: wrap;
|
|
9
|
+
margin: 0 calc(var(--expandable-gap) * -1) calc(var(--expandable-gap) * -1) 0;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.item {
|
|
13
13
|
display: block;
|
|
14
|
-
margin: 0;
|
|
15
14
|
padding: 0;
|
|
16
15
|
max-width: 100%;
|
|
16
|
+
height: var(--expandable-item-height);
|
|
17
|
+
margin: 0 (var(--expandable-gap)) var(--expandable-gap) 0;
|
|
17
18
|
&.hidden {
|
|
18
19
|
display: none;
|
|
19
20
|
}
|
|
21
|
+
&.invisible {
|
|
22
|
+
opacity: 0;
|
|
23
|
+
pointer-events: none;
|
|
24
|
+
}
|
|
25
|
+
&.opener {
|
|
26
|
+
width: var(--expandable-opener-width);
|
|
27
|
+
}
|
|
20
28
|
}
|
package/expandable/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export interface ExpandableGroupProps {
|
|
|
22
22
|
style?: CSSProperties;
|
|
23
23
|
/** Нужно ли выводить список развернутым. */
|
|
24
24
|
expanded?: boolean;
|
|
25
|
+
openerWidth?: number;
|
|
25
26
|
}
|
|
26
27
|
export interface GroupItemProps {
|
|
27
28
|
children?: ReactNode;
|
|
@@ -33,7 +34,7 @@ export interface GroupItemProps {
|
|
|
33
34
|
* @param props Свойства.
|
|
34
35
|
* @return Элемент.
|
|
35
36
|
*/
|
|
36
|
-
export declare function ExpandableGroup({ gap, itemHeight, lineLimit, defaultExpanded, children, onExpand, opener, className, style, expanded: expandedProp, }: ExpandableGroupProps): JSX.Element;
|
|
37
|
+
export declare function ExpandableGroup({ gap, itemHeight, lineLimit, defaultExpanded, children, onExpand, opener, className, style, expanded: expandedProp, openerWidth, }: ExpandableGroupProps): JSX.Element;
|
|
37
38
|
export declare const Expandable: {
|
|
38
39
|
readonly Group: typeof ExpandableGroup;
|
|
39
40
|
readonly Item: React.ForwardRefExoticComponent<GroupItemProps & React.RefAttributes<HTMLLIElement>>;
|
package/expandable/index.js
CHANGED
|
@@ -32,7 +32,7 @@ const utils_1 = require("./utils");
|
|
|
32
32
|
const bind_1 = __importDefault(require("classnames/bind"));
|
|
33
33
|
const expandable_group_module_scss_1 = __importDefault(require("./expandable-group.module.scss"));
|
|
34
34
|
const cx = bind_1.default.bind(expandable_group_module_scss_1.default);
|
|
35
|
-
const
|
|
35
|
+
const ItemContext = (0, react_1.createContext)({});
|
|
36
36
|
/**
|
|
37
37
|
* Группа элементов с ограничением на число выводимых строк и возможностью показать все.
|
|
38
38
|
* @param props Свойства.
|
|
@@ -40,7 +40,7 @@ const GroupContext = (0, react_1.createContext)({ gap: 8, itemHeight: 32 });
|
|
|
40
40
|
*/
|
|
41
41
|
function ExpandableGroup({ gap = 8, itemHeight = 32, lineLimit = 2, defaultExpanded = false, children, onExpand, opener = data => react_1.default.createElement(react_1.default.Fragment, null,
|
|
42
42
|
"\u0415\u0449\u0451 ",
|
|
43
|
-
data.hiddenCount), className, style, expanded: expandedProp, }) {
|
|
43
|
+
data.hiddenCount), className, style, expanded: expandedProp, openerWidth = 72, }) {
|
|
44
44
|
const wrapperRef = (0, react_1.useRef)(null);
|
|
45
45
|
const containerRef = (0, react_1.useRef)(null);
|
|
46
46
|
const openerRef = (0, react_1.useRef)(null);
|
|
@@ -58,31 +58,26 @@ function ExpandableGroup({ gap = 8, itemHeight = 32, lineLimit = 2, defaultExpan
|
|
|
58
58
|
(0, react_1.useEffect)(() => {
|
|
59
59
|
expandedProp !== undefined && setExpanded(expandedProp);
|
|
60
60
|
}, [expandedProp]);
|
|
61
|
-
(0, react_1.useEffect)(() => {
|
|
62
|
-
setMounted(true);
|
|
63
|
-
}, []);
|
|
64
61
|
const { hiddenCount } = (0, utils_1.useExpandable)({
|
|
65
62
|
expanded,
|
|
66
63
|
wrapperRef,
|
|
67
64
|
containerRef,
|
|
68
65
|
openerRef,
|
|
66
|
+
gap,
|
|
69
67
|
});
|
|
70
|
-
return (react_1.default.createElement(
|
|
71
|
-
react_1.default.createElement("
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
return (react_1.default.createElement("div", { ref: wrapperRef, className: cx('root', className), style: Object.assign(Object.assign({}, style), { maxHeight: expanded ? undefined : `${itemHeight * lineLimit + gap * (lineLimit - 1)}px`, '--expandable-item-height': `${itemHeight}px`, '--expandable-opener-width': `${openerWidth}px`, '--expandable-gap': `${gap}px` }) },
|
|
69
|
+
react_1.default.createElement("ul", { ref: containerRef, className: expandable_group_module_scss_1.default.inner },
|
|
70
|
+
items,
|
|
71
|
+
mounted && !expanded && (react_1.default.createElement(ItemContext.Provider, { value: { invisible: hiddenCount === 0, opener: true } },
|
|
72
|
+
react_1.default.createElement(ExpandableItem, { ref: openerRef, onClick: () => {
|
|
75
73
|
setExpanded(true);
|
|
76
74
|
onExpand === null || onExpand === void 0 ? void 0 : onExpand();
|
|
77
75
|
}, "data-testid": 'expandable:opener' }, opener({ hiddenCount })))))));
|
|
78
76
|
}
|
|
79
77
|
exports.ExpandableGroup = ExpandableGroup;
|
|
80
78
|
const ExpandableItem = (0, react_1.forwardRef)(({ children, onClick, 'data-testid': testId = 'expandable:item' }, ref) => {
|
|
81
|
-
const
|
|
82
|
-
return (react_1.default.createElement("li", { ref: ref, className: cx('item'), "data-testid": testId, onClick: onClick,
|
|
83
|
-
height: `${itemHeight}px`,
|
|
84
|
-
margin: `0 ${gap}px ${gap}px 0`,
|
|
85
|
-
} }, children));
|
|
79
|
+
const context = (0, react_1.useContext)(ItemContext);
|
|
80
|
+
return (react_1.default.createElement("li", { ref: ref, className: cx('item', context), "data-testid": testId, onClick: onClick }, children));
|
|
86
81
|
});
|
|
87
82
|
exports.Expandable = {
|
|
88
83
|
Group: ExpandableGroup,
|
package/expandable/utils.d.ts
CHANGED
|
@@ -8,13 +8,15 @@ export interface ViewState {
|
|
|
8
8
|
* @param options.wrapperRef Реф элемента, формирующего ограничение по высоте.
|
|
9
9
|
* @param options.containerRef Реф элемента, содержащего список.
|
|
10
10
|
* @param options.openerRef Реф элемента "открывашки".
|
|
11
|
+
* @param options.gap Расстояние между элементами списка.
|
|
11
12
|
* @return Рассчитанные данные: кол-во скрытых элементов.
|
|
12
13
|
*/
|
|
13
|
-
export declare function useExpandable({ expanded, wrapperRef, containerRef, openerRef, }: {
|
|
14
|
+
export declare function useExpandable({ expanded, wrapperRef, containerRef, openerRef, gap, }: {
|
|
14
15
|
expanded: boolean;
|
|
15
16
|
wrapperRef: RefObject<HTMLElement>;
|
|
16
17
|
containerRef: RefObject<HTMLElement>;
|
|
17
18
|
openerRef: RefObject<HTMLElement>;
|
|
19
|
+
gap: number;
|
|
18
20
|
}): {
|
|
19
21
|
hiddenCount: number;
|
|
20
22
|
};
|
|
@@ -23,6 +25,7 @@ export declare function useExpandable({ expanded, wrapperRef, containerRef, open
|
|
|
23
25
|
* @param wrapper Элемент, формирующий ограничение по высоте.
|
|
24
26
|
* @param items Элементы, все кроме "закрывашки".
|
|
25
27
|
* @param opener Элемент "закрывашки".
|
|
28
|
+
* @param gap Расстояние между элементами списка.
|
|
26
29
|
* @return Состояние.
|
|
27
30
|
*/
|
|
28
|
-
export declare function defineViewState(wrapper: HTMLElement, items: Element[], opener: HTMLElement): ViewState;
|
|
31
|
+
export declare function defineViewState(wrapper: HTMLElement, items: Element[], opener: HTMLElement, gap: number): ViewState;
|
package/expandable/utils.js
CHANGED
|
@@ -14,9 +14,10 @@ const expandable_group_module_scss_1 = __importDefault(require("./expandable-gro
|
|
|
14
14
|
* @param options.wrapperRef Реф элемента, формирующего ограничение по высоте.
|
|
15
15
|
* @param options.containerRef Реф элемента, содержащего список.
|
|
16
16
|
* @param options.openerRef Реф элемента "открывашки".
|
|
17
|
+
* @param options.gap Расстояние между элементами списка.
|
|
17
18
|
* @return Рассчитанные данные: кол-во скрытых элементов.
|
|
18
19
|
*/
|
|
19
|
-
function useExpandable({ expanded, wrapperRef, containerRef, openerRef, }) {
|
|
20
|
+
function useExpandable({ expanded, wrapperRef, containerRef, openerRef, gap, }) {
|
|
20
21
|
const [hiddenCount, setHiddenCount] = (0, react_1.useState)(0);
|
|
21
22
|
const calc = (0, react_1.useCallback)(() => {
|
|
22
23
|
const wrapperEl = wrapperRef.current;
|
|
@@ -37,17 +38,19 @@ function useExpandable({ expanded, wrapperRef, containerRef, openerRef, }) {
|
|
|
37
38
|
item.classList.remove(expandable_group_module_scss_1.default.hidden);
|
|
38
39
|
}
|
|
39
40
|
// определяем какие элементы не влезли в ограничение по высоте
|
|
40
|
-
const state = defineViewState(wrapperEl, items, openerEl);
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
item.
|
|
41
|
+
const state = defineViewState(wrapperEl, items, openerEl, gap);
|
|
42
|
+
if (state.lastVisibleIndex !== -1) {
|
|
43
|
+
// делаем невидимыми элементы списка которые не влезли
|
|
44
|
+
for (const [index, item] of items.entries()) {
|
|
45
|
+
if (item !== openerEl && index >= state.lastVisibleIndex) {
|
|
46
|
+
item.classList.add(expandable_group_module_scss_1.default.hidden);
|
|
47
|
+
}
|
|
45
48
|
}
|
|
46
49
|
}
|
|
47
|
-
setHiddenCount(items.length - state.lastVisibleIndex);
|
|
50
|
+
setHiddenCount(state.lastVisibleIndex !== -1 ? items.length - state.lastVisibleIndex : 0);
|
|
48
51
|
}
|
|
49
52
|
}
|
|
50
|
-
}, [expanded]);
|
|
53
|
+
}, [expanded, gap]);
|
|
51
54
|
// пересчитываем после каждого rerender'а
|
|
52
55
|
(0, hooks_1.useIsomorphicLayoutEffect)(calc);
|
|
53
56
|
// пересчитываем при resize
|
|
@@ -60,9 +63,10 @@ exports.useExpandable = useExpandable;
|
|
|
60
63
|
* @param wrapper Элемент, формирующий ограничение по высоте.
|
|
61
64
|
* @param items Элементы, все кроме "закрывашки".
|
|
62
65
|
* @param opener Элемент "закрывашки".
|
|
66
|
+
* @param gap Расстояние между элементами списка.
|
|
63
67
|
* @return Состояние.
|
|
64
68
|
*/
|
|
65
|
-
function defineViewState(wrapper, items, opener) {
|
|
69
|
+
function defineViewState(wrapper, items, opener, gap) {
|
|
66
70
|
const state = { lastVisibleIndex: -1 };
|
|
67
71
|
const parentRect = wrapper.getBoundingClientRect();
|
|
68
72
|
const firstHiddenNodeIndex = items.findIndex(child => {
|
|
@@ -75,9 +79,10 @@ function defineViewState(wrapper, items, opener) {
|
|
|
75
79
|
if (lastVisible) {
|
|
76
80
|
const rightBound = lastVisible.getBoundingClientRect().right;
|
|
77
81
|
const rightContainerBound = wrapper.getBoundingClientRect().right;
|
|
78
|
-
//
|
|
79
|
-
const isOpenerFit = rightContainerBound - rightBound >= opener.clientWidth
|
|
82
|
+
// хватает ли кнопке места после последнего видимого дочернего элемента с учетом отступа между элементами
|
|
83
|
+
const isOpenerFit = rightContainerBound - rightBound - gap >= opener.clientWidth;
|
|
80
84
|
// если хватает места - ставим кнопку после последнего, иначе - вместо
|
|
85
|
+
// @todo возможна ситуация когда нужно будет удалить N элементов чтобы влезла кнопка
|
|
81
86
|
state.lastVisibleIndex = lastVisibleIndex + Number(isOpenerFit);
|
|
82
87
|
}
|
|
83
88
|
}
|
package/package.json
CHANGED
package/stepper/index.d.ts
CHANGED
|
@@ -9,9 +9,9 @@ export interface StepperProps extends Omit<React.InputHTMLAttributes<HTMLInputEl
|
|
|
9
9
|
/** Нужно ли выводить кнопку вычитания. */
|
|
10
10
|
canSubtract?: boolean;
|
|
11
11
|
/** Сработает при добавлении. */
|
|
12
|
-
onAdd?: React.MouseEventHandler
|
|
12
|
+
onAdd?: React.MouseEventHandler;
|
|
13
13
|
/** Сработает при вычитании. */
|
|
14
|
-
onSubtract?: React.MouseEventHandler
|
|
14
|
+
onSubtract?: React.MouseEventHandler;
|
|
15
15
|
/** Размер. */
|
|
16
16
|
size?: Size;
|
|
17
17
|
/** Идентификатор для систем автоматизированного тестирования. */
|
package/stepper/index.js
CHANGED
|
@@ -53,7 +53,8 @@ exports.Stepper = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
53
53
|
var { canAdd = true, canSubtract = true, className, disabled, readOnly, onAdd, onBlur, onChange, onFocus, onSubtract, size = 'm', style, value, failed, 'data-testid': testId = 'stepper' } = _a, inputProps = __rest(_a, ["canAdd", "canSubtract", "className", "disabled", "readOnly", "onAdd", "onBlur", "onChange", "onFocus", "onSubtract", "size", "style", "value", "failed", 'data-testid']);
|
|
54
54
|
const [focused, setFocused] = (0, react_1.useState)(false);
|
|
55
55
|
return (react_1.default.createElement("div", { "data-testid": testId, style: style, className: cx('root', `size-${size}`, { disabled, focused, readonly: readOnly, failed }, className) },
|
|
56
|
-
react_1.default.createElement(
|
|
56
|
+
react_1.default.createElement("button", { className: cx('button', { hidden: !canSubtract }), "data-testid": 'stepper:minus', onClick: canSubtract && !disabled && !readOnly ? onSubtract : undefined },
|
|
57
|
+
react_1.default.createElement(minus_1.default, null)),
|
|
57
58
|
react_1.default.createElement("input", Object.assign({}, inputProps, { ref: ref, readOnly: readOnly, "data-testid": 'stepper:input', className: cx('input'), value: value, disabled: disabled, onChange: onChange, onFocus: e => {
|
|
58
59
|
setFocused(true);
|
|
59
60
|
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
@@ -61,5 +62,6 @@ exports.Stepper = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
61
62
|
setFocused(false);
|
|
62
63
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
63
64
|
} })),
|
|
64
|
-
react_1.default.createElement(
|
|
65
|
+
react_1.default.createElement("button", { className: cx('button', { hidden: !canAdd }), "data-testid": 'stepper:plus', onClick: canAdd && !disabled && !readOnly ? onAdd : undefined },
|
|
66
|
+
react_1.default.createElement(plus_1.default, null))));
|
|
65
67
|
});
|
|
@@ -3,18 +3,19 @@
|
|
|
3
3
|
.root {
|
|
4
4
|
display: flex;
|
|
5
5
|
align-items: center;
|
|
6
|
-
border: 1px solid
|
|
6
|
+
border: 1px solid transparent;
|
|
7
7
|
border-radius: 4px;
|
|
8
8
|
color: colors.$basic-gray87;
|
|
9
|
-
background:
|
|
9
|
+
background: colors.$basic-gray8;
|
|
10
10
|
&.focused:not(.disabled) {
|
|
11
11
|
border-color: colors.$basic-blue;
|
|
12
12
|
}
|
|
13
13
|
&.disabled {
|
|
14
14
|
color: colors.$basic-gray24;
|
|
15
|
-
border-color: colors.$basic-
|
|
15
|
+
border-color: colors.$basic-gray4;
|
|
16
|
+
background: colors.$basic-gray4;
|
|
16
17
|
.button {
|
|
17
|
-
fill: colors.$basic-
|
|
18
|
+
fill: colors.$basic-gray24;
|
|
18
19
|
}
|
|
19
20
|
}
|
|
20
21
|
&.readonly {
|
|
@@ -23,17 +24,18 @@
|
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
&.failed:not(.disabled):not(.focused) {
|
|
26
|
-
border-color:
|
|
27
|
+
border-color: transparent;
|
|
28
|
+
color: colors.$additional-deep-red;
|
|
27
29
|
}
|
|
28
30
|
&.size-s {
|
|
31
|
+
--stepper-button-width: 24px;
|
|
29
32
|
width: var(--stepper-width, 122px);
|
|
30
33
|
height: 40px;
|
|
31
|
-
padding: 0 8px;
|
|
32
34
|
}
|
|
33
35
|
&.size-m {
|
|
36
|
+
--stepper-button-width: 32px;
|
|
34
37
|
width: var(--stepper-width, 160px);
|
|
35
38
|
height: 48px;
|
|
36
|
-
padding: 0 16px;
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
41
|
|
|
@@ -42,7 +44,7 @@
|
|
|
42
44
|
padding: 0;
|
|
43
45
|
|
|
44
46
|
// не надо делать transparent: https://stackoverflow.com/q/43483363/13166471
|
|
45
|
-
background:
|
|
47
|
+
background: inherit;
|
|
46
48
|
outline: 0;
|
|
47
49
|
width: 0;
|
|
48
50
|
flex-grow: 1;
|
|
@@ -56,8 +58,21 @@
|
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
.button {
|
|
59
|
-
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
border: 0;
|
|
64
|
+
padding: 0;
|
|
65
|
+
background: transparent;
|
|
66
|
+
width: var(--stepper-button-width);
|
|
67
|
+
height: 100%;
|
|
68
|
+
fill: colors.$basic-gray87;
|
|
60
69
|
flex-shrink: 0;
|
|
70
|
+
&:first-child {
|
|
71
|
+
justify-content: flex-end;
|
|
72
|
+
}
|
|
73
|
+
&:last-child {
|
|
74
|
+
justify-content: flex-start;
|
|
75
|
+
}
|
|
61
76
|
&:not(.hidden) {
|
|
62
77
|
cursor: pointer;
|
|
63
78
|
}
|
|
@@ -91,7 +91,7 @@ input.reset {
|
|
|
91
91
|
box-shadow: inset 0 -1px colors.$basic-blue;
|
|
92
92
|
}
|
|
93
93
|
&.failed:not(:disabled) {
|
|
94
|
-
box-shadow: inset 0 -1px colors.$additional-red;
|
|
94
|
+
box-shadow: inset 0 -1px colors.$additional-deep-red;
|
|
95
95
|
}
|
|
96
96
|
&:not(.multiline) {
|
|
97
97
|
height: 48px;
|
|
@@ -158,12 +158,12 @@ input.reset {
|
|
|
158
158
|
}
|
|
159
159
|
&.failed.focused,
|
|
160
160
|
&.failed.filled {
|
|
161
|
-
color: colors.$additional-red;
|
|
161
|
+
color: colors.$additional-deep-red;
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
&.variant-desktop {
|
|
165
165
|
&.failed:not(.focused):not(.filled) {
|
|
166
|
-
color: colors.$additional-red;
|
|
166
|
+
color: colors.$additional-deep-red;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
}
|
|
@@ -190,7 +190,7 @@ input.reset {
|
|
|
190
190
|
text-overflow: ellipsis;
|
|
191
191
|
}
|
|
192
192
|
&.variant-desktop.failed {
|
|
193
|
-
color: colors.$additional-red;
|
|
193
|
+
color: colors.$additional-deep-red;
|
|
194
194
|
--placeholder-color: #{colors.$additional-deep-red};
|
|
195
195
|
}
|
|
196
196
|
}
|
|
@@ -200,6 +200,6 @@ input.reset {
|
|
|
200
200
|
line-height: 16px;
|
|
201
201
|
color: colors.$basic-gray38;
|
|
202
202
|
&.failed {
|
|
203
|
-
color: colors.$additional-red;
|
|
203
|
+
color: colors.$additional-deep-red;
|
|
204
204
|
}
|
|
205
205
|
}
|
package/checkbox/svg/checked.svg
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<rect width="16" height="16" rx="2" fill="#1F84DB"/>
|
|
3
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.8 5.21967L6.4 9.18934L5.36569 8.21967C5.05327 7.92678 4.54673 7.92678 4.23431 8.21967C3.9219 8.51256 3.9219 8.98744 4.23431 9.28033L5.83431 10.7803C6.14673 11.0732 6.65327 11.0732 6.96569 10.7803L11.7657 6.28033C12.0781 5.98744 12.0781 5.51256 11.7657 5.21967C11.4533 4.92678 11.1124 4.92678 10.8 5.21967Z" fill="white"/>
|
|
4
|
-
</svg>
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<rect width="16" height="16" rx="2" fill="#E0E0E0"/>
|
|
3
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.8 5.21967L6.4 9.18934L5.36569 8.21967C5.05327 7.92678 4.54673 7.92678 4.23431 8.21967C3.9219 8.51256 3.9219 8.98744 4.23431 9.28033L5.83431 10.7803C6.14673 11.0732 6.65327 11.0732 6.96569 10.7803L11.7657 6.28033C12.0781 5.98744 12.0781 5.51256 11.7657 5.21967C11.4533 4.92678 11.1124 4.92678 10.8 5.21967Z" fill="#F5F5F5"/>
|
|
4
|
-
</svg>
|