@sima-land/moleculas 13.1.3 → 13.2.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.
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LayoutProps } from '@sima-land/ui-nucleons/layout';
|
|
3
|
+
export declare type OptionSize = 's' | 'm' | 'l' | 'xl';
|
|
4
|
+
export interface SelectScreenOptionProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
|
+
size?: OptionSize;
|
|
6
|
+
selected?: boolean;
|
|
7
|
+
withSelectedIcon?: boolean;
|
|
8
|
+
}
|
|
3
9
|
export interface SelectScreenProps {
|
|
4
10
|
items?: any[];
|
|
5
11
|
getItemName?: (item: any) => string;
|
|
@@ -27,6 +33,4 @@ export interface SelectScreenProps {
|
|
|
27
33
|
*/
|
|
28
34
|
export declare const SelectScreen: ({ items, getItemName, displayItem, isItemSelected, onItemClick, title, subtitle, onBack, onClose, }: SelectScreenProps) => JSX.Element;
|
|
29
35
|
export declare const SelectScreenLayout: ({ children, ...props }: LayoutProps) => JSX.Element;
|
|
30
|
-
export declare const SelectScreenOption: ({ children, className, selected, ...props }:
|
|
31
|
-
selected?: boolean | undefined;
|
|
32
|
-
}) => JSX.Element;
|
|
36
|
+
export declare const SelectScreenOption: ({ children, className, selected, withSelectedIcon, size, ...props }: SelectScreenOptionProps) => JSX.Element;
|
|
@@ -72,10 +72,10 @@ const SelectScreenLayout = (_a) => {
|
|
|
72
72
|
};
|
|
73
73
|
exports.SelectScreenLayout = SelectScreenLayout;
|
|
74
74
|
const SelectScreenOption = (_a) => {
|
|
75
|
-
var { children, className, selected } = _a, props = __rest(_a, ["children", "className", "selected"]);
|
|
76
|
-
return (react_1.default.createElement("button", Object.assign({}, props, { type: 'button', className: (0, classnames_1.default)(select_screen_module_scss_1.default.item, className), "data-testid": 'select-screen:option' }),
|
|
75
|
+
var { children, className, selected, withSelectedIcon = selected, size = 'm' } = _a, props = __rest(_a, ["children", "className", "selected", "withSelectedIcon", "size"]);
|
|
76
|
+
return (react_1.default.createElement("button", Object.assign({}, props, { type: 'button', className: (0, classnames_1.default)(select_screen_module_scss_1.default.item, className, select_screen_module_scss_1.default[`size-${size}`]), "data-testid": 'select-screen:option' }),
|
|
77
77
|
children,
|
|
78
|
-
selected && react_1.default.createElement(check_1.default, {
|
|
78
|
+
selected && withSelectedIcon && react_1.default.createElement(check_1.default, { role: 'presentation', className: select_screen_module_scss_1.default.icon })));
|
|
79
79
|
};
|
|
80
80
|
exports.SelectScreenOption = SelectScreenOption;
|
|
81
81
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@use 'node_modules/@sima-land/ui-nucleons/breakpoints';
|
|
2
|
-
@
|
|
2
|
+
@use 'node_modules/@sima-land/ui-nucleons/colors';
|
|
3
3
|
|
|
4
4
|
.container {
|
|
5
5
|
--gutter: 24px;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
align-items: center;
|
|
21
21
|
justify-content: space-between;
|
|
22
22
|
width: 100%;
|
|
23
|
-
padding: 16px;
|
|
23
|
+
padding: 8px 16px;
|
|
24
24
|
font-size: 16px;
|
|
25
25
|
line-height: 24px;
|
|
26
26
|
height: 48px;
|
|
@@ -29,7 +29,36 @@
|
|
|
29
29
|
outline: 0;
|
|
30
30
|
font: inherit;
|
|
31
31
|
background-color: transparent;
|
|
32
|
+
text-align: left;
|
|
32
33
|
&:active {
|
|
33
|
-
background-color:
|
|
34
|
+
background-color: colors.$gray4;
|
|
34
35
|
}
|
|
36
|
+
&:disabled {
|
|
37
|
+
color: colors.$gray24;
|
|
38
|
+
.icon {
|
|
39
|
+
fill: colors.$gray24;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.size-s {
|
|
45
|
+
height: 40px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.size-m {
|
|
49
|
+
height: 48px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.size-l {
|
|
53
|
+
height: 56px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.size-xl {
|
|
57
|
+
height: 72px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.icon {
|
|
61
|
+
display: block;
|
|
62
|
+
margin-left: 8px;
|
|
63
|
+
fill: colors.$gray87;
|
|
35
64
|
}
|