Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addon/components/utils/smart-blob.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Component from '@glimmer/component';

type Size = 'md' | 'xl';
type Size = 'sm' | 'md' | 'xl';
interface SmartBlobArgs {
loading: boolean;
size: Size;
Expand Down
10 changes: 10 additions & 0 deletions app/styles/components/smart-blob.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
border-radius: 100%;
transition: all 1s ease-in-out;

&--sm {
height: 22px;
width: 22px;

.smart-blob {
width: 22px;
height: 22px;
}
}

&--xl {
height: 64px;
width: 64px;
Expand Down
1 change: 1 addition & 0 deletions tests/dummy/app/templates/application.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
/>
<div class="fx-row fx-gap-px-12 fx-xalign-center">
<OSS::ToggleSwitch @value={{this.blobLoading}} @onChange={{this.onBlobSwitch}} />
<Utils::SmartBlob @loading={{this.blobLoading}} @size="sm" />
<Utils::SmartBlob @loading={{this.blobLoading}} />
<Utils::SmartBlob @loading={{this.blobLoading}} @size="xl" />
</div>
Expand Down
10 changes: 6 additions & 4 deletions tests/integration/components/utils/smart-blob-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ module('Integration | Component | utils/smart-blob', function (hooks) {
});

module('@size', function () {
test('it applies the correct size class', async function (assert) {
this.set('size', 'xl');
await render(hbs`<Utils::SmartBlob @size={{this.size}} />`);
['sm', 'xl', 'md'].forEach((size) => {
test(`it applies the correct size class for @size='${size}'`, async function (assert) {
this.set('size', size);
await render(hbs`<Utils::SmartBlob @size={{this.size}} />`);

assert.dom('.smart-blob-container').hasClass('smart-blob-container--xl');
assert.dom('.smart-blob-container').hasClass(`smart-blob-container--${size}`);
});
});

test('it defaults to md size', async function (assert) {
Expand Down
Loading