@itcase/ui 1.0.87 → 1.0.88
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.
|
@@ -60,6 +60,8 @@ const Choice = /*#__PURE__*/React__default.default.forwardRef(function Choice(pr
|
|
|
60
60
|
iconStrokeDisabled,
|
|
61
61
|
activeIcon,
|
|
62
62
|
iconSize,
|
|
63
|
+
labelTextActiveColorDisabled,
|
|
64
|
+
labelTextColorDisabled,
|
|
63
65
|
activeIconItemFill,
|
|
64
66
|
iconItemFill,
|
|
65
67
|
iconStroke,
|
|
@@ -91,6 +93,10 @@ const Choice = /*#__PURE__*/React__default.default.forwardRef(function Choice(pr
|
|
|
91
93
|
prefix: 'fill_',
|
|
92
94
|
propsKey: 'fill'
|
|
93
95
|
});
|
|
96
|
+
const fillDisabledClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
97
|
+
prefix: 'fill_disabled_',
|
|
98
|
+
propsKey: 'fillDisabled'
|
|
99
|
+
});
|
|
94
100
|
const fillHoverClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
95
101
|
prefix: 'fill_hover_',
|
|
96
102
|
propsKey: 'fillHover'
|
|
@@ -99,13 +105,17 @@ const Choice = /*#__PURE__*/React__default.default.forwardRef(function Choice(pr
|
|
|
99
105
|
prefix: 'fill_active_',
|
|
100
106
|
propsKey: 'fillActive'
|
|
101
107
|
});
|
|
108
|
+
const fillActiveDisabledClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
109
|
+
prefix: 'fill_active_disabled_',
|
|
110
|
+
propsKey: 'fillActiveDisabled'
|
|
111
|
+
});
|
|
102
112
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
103
|
-
className: clsx__default.default(className, 'choice', shapeClass, fillClass, borderColorClass, borderWidthClass, borderTypeClass, set && `choice_set_${set}`, size && `choice_size_${size}`, type && `choice_type_${type}`),
|
|
113
|
+
className: clsx__default.default(className, 'choice', shapeClass, !isDisabled ? fillClass : fillDisabledClass, borderColorClass, borderWidthClass, borderTypeClass, set && `choice_set_${set}`, size && `choice_size_${size}`, type && `choice_type_${type}`),
|
|
104
114
|
ref: controlRef
|
|
105
115
|
}, /*#__PURE__*/React__default.default.createElement("div", {
|
|
106
116
|
className: "choice__wrapper"
|
|
107
117
|
}, options?.map((item, i) => /*#__PURE__*/React__default.default.createElement("div", {
|
|
108
|
-
className: clsx__default.default('choice__item', fillHoverClass, item.value
|
|
118
|
+
className: clsx__default.default('choice__item', !isDisabled && fillHoverClass, item.value !== active.value && isDisabled && 'choice__item_state_disabled', item.value === active.value ? !isDisabled ? fillActiveClass : fillActiveDisabledClass : !isDisabled ? fillClass : fillDisabledClass, item.value === active.value && isDisabled && 'choice__item_active_state_disabled', item.value === active.value && 'choice__item_active'),
|
|
109
119
|
key: item.value,
|
|
110
120
|
ref: optionsRefs.get(item.value)
|
|
111
121
|
}, /*#__PURE__*/React__default.default.createElement("input", {
|
|
@@ -118,11 +128,11 @@ const Choice = /*#__PURE__*/React__default.default.forwardRef(function Choice(pr
|
|
|
118
128
|
value: item.value,
|
|
119
129
|
onChange: event => onChange(event, item)
|
|
120
130
|
}), /*#__PURE__*/React__default.default.createElement("label", {
|
|
121
|
-
className: clsx__default.default('choice__item-label'),
|
|
131
|
+
className: clsx__default.default('choice__item-label', isDisabled && 'choice__item-label_state_disabled'),
|
|
122
132
|
htmlFor: `${name}-${item.value}`
|
|
123
133
|
}, before, item.label && /*#__PURE__*/React__default.default.createElement(index.Text, {
|
|
124
134
|
size: labelTextSize,
|
|
125
|
-
textColor: item.value === active.value ? labelTextActiveColor : labelTextColor
|
|
135
|
+
textColor: item.value === active.value ? !isDisabled ? labelTextActiveColor : labelTextActiveColorDisabled : !isDisabled ? labelTextColor : labelTextColorDisabled
|
|
126
136
|
}, item.label), (icon || activeIcon) && /*#__PURE__*/React__default.default.createElement(index$1.Icon, {
|
|
127
137
|
className: "choice__item-icon",
|
|
128
138
|
iconFill: item.value === active.value ? activeIconItemFill : iconItemFill,
|
|
@@ -1,36 +1,3 @@
|
|
|
1
|
-
.choice {
|
|
2
|
-
position: relative;
|
|
3
|
-
display: flex;
|
|
4
|
-
align-items: center;
|
|
5
|
-
&__wrapper {
|
|
6
|
-
position: relative;
|
|
7
|
-
display: flex;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
.choice {
|
|
11
|
-
&_shape {
|
|
12
|
-
&_rounded {
|
|
13
|
-
border-radius: var(--choice-shape-rounded, 8px);
|
|
14
|
-
overflow: hidden;
|
|
15
|
-
}
|
|
16
|
-
&_circular {
|
|
17
|
-
border-radius: 50%;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
.choice {
|
|
22
|
-
&_size {
|
|
23
|
-
@each $size in xs, s, m, l, xl, xxl, tiny, compact, normal, large {
|
|
24
|
-
&_$(size) {
|
|
25
|
-
^^&__item {
|
|
26
|
-
&-label {
|
|
27
|
-
padding: var(--choice-item-size-$(size)-padding, 9px 16px);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
1
|
.choice__item {
|
|
35
2
|
min-width: 30px;
|
|
36
3
|
position: relative;
|
|
@@ -41,8 +8,20 @@
|
|
|
41
8
|
&:not(:last-child) {
|
|
42
9
|
border-right: 1px solid var(--choice-border-color);
|
|
43
10
|
}
|
|
11
|
+
&_state_disabled {
|
|
12
|
+
background: var(--choice-item-state-disabled-background, #ECECEC);
|
|
13
|
+
&:hover {
|
|
14
|
+
background: var(--choice-item-state-disabled-background, #ECECEC);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
44
17
|
&_active {
|
|
45
18
|
background: var(--choice-item-background-active);
|
|
19
|
+
&_state_disabled {
|
|
20
|
+
background: var(--choice-item-active-state-disabled-background, #ccc);
|
|
21
|
+
&:hover {
|
|
22
|
+
background: var(--choice-item-active-state-disabled-background, #ccc);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
46
25
|
}
|
|
47
26
|
& input {
|
|
48
27
|
width: 100%;
|
|
@@ -68,8 +47,48 @@
|
|
|
68
47
|
padding: var(--choice-item-icon-padding);
|
|
69
48
|
}
|
|
70
49
|
}
|
|
50
|
+
|
|
51
|
+
.choice {
|
|
52
|
+
&_shape {
|
|
53
|
+
&_rounded {
|
|
54
|
+
border-radius: var(--choice-shape-rounded, 8px);
|
|
55
|
+
overflow: hidden;
|
|
56
|
+
}
|
|
57
|
+
&_circular {
|
|
58
|
+
border-radius: 50%;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.choice {
|
|
64
|
+
&_size {
|
|
65
|
+
@each $size in xs, s, m, l, xl, xxl, tiny, compact, normal, large {
|
|
66
|
+
&_$(size) {
|
|
67
|
+
^^&__item {
|
|
68
|
+
&-label {
|
|
69
|
+
padding: var(--choice-item-size-$(size)-padding, 9px 16px);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.choice {
|
|
78
|
+
position: relative;
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
&__wrapper {
|
|
82
|
+
position: relative;
|
|
83
|
+
display: flex;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
71
87
|
:root {
|
|
88
|
+
|
|
72
89
|
--choice-item-background-hover: var(--color-surface-secondary);
|
|
90
|
+
|
|
73
91
|
--choice-item-background-active: var(--color-surface-active);
|
|
92
|
+
|
|
74
93
|
--choice-border-color: var(--color-surface-border-tertiary);
|
|
75
94
|
}
|
|
@@ -8,8 +8,20 @@
|
|
|
8
8
|
&:not(:last-child) {
|
|
9
9
|
border-right: 1px solid var(--choice-border-color);
|
|
10
10
|
}
|
|
11
|
+
&_state_disabled {
|
|
12
|
+
background: var(--choice-item-state-disabled-background, #ECECEC);
|
|
13
|
+
&:hover {
|
|
14
|
+
background: var(--choice-item-state-disabled-background, #ECECEC);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
11
17
|
&_active {
|
|
12
18
|
background: var(--choice-item-background-active);
|
|
19
|
+
&_state_disabled {
|
|
20
|
+
background: var(--choice-item-active-state-disabled-background, #ccc);
|
|
21
|
+
&:hover {
|
|
22
|
+
background: var(--choice-item-active-state-disabled-background, #ccc);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
13
25
|
}
|
|
14
26
|
& input {
|
|
15
27
|
width: 100%;
|