Skip to content

Commit e57c2cb

Browse files
committed
Smart component: Fix input css issue
1 parent 8dfb020 commit e57c2cb

File tree

7 files changed

+35
-24
lines changed

7 files changed

+35
-24
lines changed

addon/components/o-s-s/smart/immersive/select.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
@loadingMore={{@loadingMore}}
4343
@onBottomReached={{@onBottomReached}}
4444
@enableKeyboard={{true}}
45+
@searchEnabled={{@searchEnabled}}
4546
class={{concat "margin-top-px-0 upf-power-select__dropdown " this.dropdownAddressableClass}}
4647
id={{this.portalId}}
4748
{{on "click" this.noop}}

addon/components/o-s-s/smart/immersive/select.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ interface OSSSmartImmersiveSelectComponentSignature extends BaseDropdownArgs {
1717
maxItemWidth?: number;
1818
addressableAs?: string;
1919
multiple?: boolean;
20+
searchEnabled?: boolean;
2021
onChange?: (item: string) => void;
2122
onSearch?: (keyword: string) => void;
2223
onBottomReached?: () => void;

addon/components/o-s-s/smart/input.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
</div>
1919
{{else}}
2020
{{#if @loading}}
21-
<div class="smart-input__animated-text fx-row fx-xalign-center upf-input wrapper">
22-
<span class="rainbow rainbow_text_animated">{{@placeholder}}</span>
21+
<div class="upf-input loading-placeholder fx-row fx-xalign-center">
22+
<span class="smart_text_animated">{{@placeholder}}</span>
2323
</div>
2424
{{else}}
2525
<Input

app/styles/atoms/smart-input.less

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,40 @@
44
.oss-input-container {
55
width: 100%;
66
position: relative;
7-
}
8-
9-
.smart-input__animated-text {
10-
.smart-input__animated-text--normal.text {
11-
color: transparent;
12-
width: 100%;
13-
}
7+
display: flex;
148

15-
.upf-input {
9+
.loading-placeholder {
10+
pointer-events: none;
11+
display: flex;
12+
flex: 1;
13+
align-items: center;
14+
width: fit-content;
1615
position: relative;
17-
width: 100%;
18-
border: 1px solid var(--color-gray-100);
1916
}
2017

21-
&.smart-input-wrapper {
22-
position: relative;
23-
border: none;
24-
min-width: 50px;
18+
.upf-input.loading-placeholder {
19+
padding: 0px;
2520
}
2621

27-
.smart-input__animated-text--normal {
28-
.font-weight-semibold;
29-
color: var(--color-gray-400);
30-
padding: 5px var(--spacing-px-6);
22+
.smart_text_animated {
23+
background: var(--color-gray-400);
24+
background: linear-gradient(
25+
130deg,
26+
var(--color-gray-400) 18%,
27+
var(--color-gray-300) 25%,
28+
rgba(250, 198, 255, 1) 56%,
29+
var(--color-primary-100) 62%,
30+
var(--color-white) 66%,
31+
rgba(250, 198, 255, 0.58) 68%,
32+
var(--color-gray-300) 73%,
33+
var(--color-gray-400) 85%
34+
);
35+
-webkit-background-clip: text;
36+
background-clip: text;
37+
color: transparent;
38+
animation: smart_loading_text_animation 3.5s ease-in-out infinite;
39+
background-size: 600% 100%;
40+
padding: 6px 12px;
3141
}
3242
}
3343
}

app/styles/oss-components.less

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747
@import 'atoms/social-post-badge';
4848
@import 'atoms/pulsating-dot';
4949
@import 'atoms/pill';
50+
@import 'atoms/smart-input';
51+
@import 'atoms/smart-feedback';
5052
@import 'atoms/smart/immersive-input';
5153
@import 'atoms/smart/immersive-currency-input';
5254
@import 'atoms/smart/immersive-select';

tests/dummy/app/templates/smart.hbs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,23 +345,20 @@
345345
@label="Label"
346346
@placeholder="Placeholder"
347347
@loading={{this.toggleInputLoadingValue}}
348-
@generating={{this.toggleInputGeneratingValue}}
349348
/>
350349

351350
<OSS::Smart::Input
352351
@value={{null}}
353352
@label="Label"
354353
@placeholder="Placeholder"
355354
@loading={{this.toggleInputLoadingValue}}
356-
@generating={{this.toggleInputGeneratingValue}}
357355
/>
358356

359357
<OSS::Smart::Input
360358
@value={{"value"}}
361359
@label="Label"
362360
@placeholder="Placeholder"
363361
@loading={{this.toggleInputLoadingValue}}
364-
@generating={{this.toggleInputGeneratingValue}}
365362
/>
366363
</div>
367364
<div

tests/integration/components/o-s-s/smart/input-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ module('Integration | Component | o-s-s/smart/input', function (hooks) {
111111
/>
112112
`);
113113

114-
assert.dom('.rainbow_text_animated').hasText('Smart...');
114+
assert.dom('.smart_text_animated').hasText('Smart...');
115115
});
116116
});
117117

0 commit comments

Comments
 (0)