@semcore/inline-input 2.0.0 → 3.0.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/CHANGELOG.md +19 -0
- package/lib/cjs/InlineInput.js +55 -72
- package/lib/cjs/InlineInput.js.map +1 -1
- package/lib/cjs/index.d.ts +163 -0
- package/lib/cjs/style/inline-input.shadow.css +25 -13
- package/lib/es6/InlineInput.js +55 -72
- package/lib/es6/InlineInput.js.map +1 -1
- package/lib/es6/index.d.ts +163 -0
- package/lib/es6/style/inline-input.shadow.css +25 -13
- package/package.json +3 -3
- package/src/InlineInput.tsx +11 -5
- package/src/style/inline-input.shadow.css +25 -13
package/src/InlineInput.tsx
CHANGED
|
@@ -232,10 +232,13 @@ const ConfirmControl: React.FC<ConfirmControlAsProps> = (props) => {
|
|
|
232
232
|
|
|
233
233
|
if (props.loading) {
|
|
234
234
|
return sstyled(props.styles)(
|
|
235
|
-
<SAddon render={Box}>{hasChildren ? <Children /> : <Spin size="
|
|
235
|
+
<SAddon render={Box}>{hasChildren ? <Children /> : <Spin size="xs" />}</SAddon>,
|
|
236
236
|
) as React.ReactElement;
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
+
const sstyles = sstyled(props.styles);
|
|
240
|
+
const sConfirmIconStyles = sstyles.cn('SConfirmIcon', {});
|
|
241
|
+
|
|
239
242
|
return sstyled(props.styles)(
|
|
240
243
|
<SAddon render={Box} onKeyDown={handleKeydown}>
|
|
241
244
|
{hasChildren ? (
|
|
@@ -246,9 +249,9 @@ const ConfirmControl: React.FC<ConfirmControlAsProps> = (props) => {
|
|
|
246
249
|
tag={props.icon ?? CheckM}
|
|
247
250
|
aria-label={`${title} ${props.value ?? ''}`}
|
|
248
251
|
role="button"
|
|
249
|
-
interactive
|
|
250
|
-
color="green-300"
|
|
251
252
|
onClick={handleConfirm}
|
|
253
|
+
className={sConfirmIconStyles.className}
|
|
254
|
+
style={sConfirmIconStyles.style}
|
|
252
255
|
/>
|
|
253
256
|
<Tooltip.Popper p={3}>{props.title}</Tooltip.Popper>
|
|
254
257
|
</Tooltip>
|
|
@@ -287,6 +290,9 @@ const CancelControl: React.FC<CancelControlAsProps> = (props) => {
|
|
|
287
290
|
) as React.ReactElement;
|
|
288
291
|
}
|
|
289
292
|
|
|
293
|
+
const sstyles = sstyled(props.styles);
|
|
294
|
+
const sCancelIconStyles = sstyles.cn('SCancelIcon', {});
|
|
295
|
+
|
|
290
296
|
return sstyled(props.styles)(
|
|
291
297
|
<SAddon render={Box} onKeyDown={handleKeydown}>
|
|
292
298
|
{hasChildren ? (
|
|
@@ -297,9 +303,9 @@ const CancelControl: React.FC<CancelControlAsProps> = (props) => {
|
|
|
297
303
|
tag={props.icon ?? CloseM}
|
|
298
304
|
aria-label={title}
|
|
299
305
|
role="button"
|
|
300
|
-
interactive
|
|
301
|
-
color="gray-300"
|
|
302
306
|
onClick={handleCancel}
|
|
307
|
+
className={sCancelIconStyles.className}
|
|
308
|
+
style={sCancelIconStyles.style}
|
|
303
309
|
/>
|
|
304
310
|
<Tooltip.Popper p={3}>{title}</Tooltip.Popper>
|
|
305
311
|
</Tooltip>
|
|
@@ -23,12 +23,13 @@ SInlineInput[disabled] {
|
|
|
23
23
|
SValue {
|
|
24
24
|
/* hack for firefox */
|
|
25
25
|
min-width: 0;
|
|
26
|
+
|
|
26
27
|
width: 100%;
|
|
27
28
|
height: 100%;
|
|
28
29
|
padding: 4px;
|
|
29
30
|
border: none;
|
|
30
31
|
box-sizing: border-box;
|
|
31
|
-
color: var(--
|
|
32
|
+
color: var(--gray-800);
|
|
32
33
|
font-size: inherit;
|
|
33
34
|
line-height: 1.2;
|
|
34
35
|
text-overflow: ellipsis;
|
|
@@ -41,11 +42,7 @@ SValue {
|
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
&::placeholder {
|
|
44
|
-
color: var(--
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&:read-only ~ SUnderline {
|
|
48
|
-
/* background: var(--gray96); */
|
|
45
|
+
color: var(--gray-300);
|
|
49
46
|
}
|
|
50
47
|
|
|
51
48
|
&[disabled] {
|
|
@@ -81,26 +78,41 @@ SAddon[disabled] {
|
|
|
81
78
|
pointer-events: none;
|
|
82
79
|
}
|
|
83
80
|
|
|
81
|
+
SConfirmIcon {
|
|
82
|
+
color: var(--green-300);
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
}
|
|
85
|
+
SConfirmIcon:hover {
|
|
86
|
+
color: var(--green-400);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
SCancelIcon {
|
|
90
|
+
color: var(--gray-300);
|
|
91
|
+
cursor: pointer;
|
|
92
|
+
}
|
|
93
|
+
SCancelIcon:hover {
|
|
94
|
+
color: var(--gray-400);
|
|
95
|
+
}
|
|
96
|
+
|
|
84
97
|
SInlineInput[focused] {
|
|
85
98
|
z-index: 1;
|
|
86
99
|
}
|
|
87
|
-
|
|
88
100
|
SInlineInput[focused] SUnderline {
|
|
89
|
-
border-color: var(--blue-400);
|
|
90
|
-
box-shadow: var(--
|
|
101
|
+
border-bottom-color: var(--blue-400);
|
|
102
|
+
box-shadow: var(--keyboard-focus);
|
|
91
103
|
}
|
|
92
104
|
|
|
93
105
|
SInlineInput[state='valid'] SUnderline {
|
|
94
|
-
border-color: var(--green-200);
|
|
106
|
+
border-bottom-color: var(--green-200);
|
|
95
107
|
}
|
|
96
108
|
SInlineInput[state='valid'][focused] SUnderline {
|
|
97
|
-
border-color: var(--green-400);
|
|
109
|
+
border-bottom-color: var(--green-400);
|
|
98
110
|
box-shadow: var(--keyboard-focus-valid);
|
|
99
111
|
}
|
|
100
112
|
SInlineInput[state='invalid'] SUnderline {
|
|
101
|
-
border-color: var(--red-200);
|
|
113
|
+
border-bottom-color: var(--red-200);
|
|
102
114
|
}
|
|
103
115
|
SInlineInput[state='invalid'][focused] SUnderline {
|
|
104
|
-
border-color: var(--red-400);
|
|
116
|
+
border-bottom-color: var(--red-400);
|
|
105
117
|
box-shadow: var(--keyboard-focus-invalid);
|
|
106
118
|
}
|