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/o-s-s/smart/blob.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
class={{this.inactiveClass}}
/>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions addon/components/o-s-s/smart/blob.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ export default {
size: {
description: 'Sets the blob size',
table: {
type: { summary: 'sm | md | xl' },
type: { summary: 'xs | sm | md | xl' },
defaultValue: { summary: 'md' }
},
control: {
type: 'select'
},
options: ['sm', 'md', 'xl']
options: ['xs', 'sm', 'md', 'xl']

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitnit: could be DRYer

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edouardmisset if you mean importing the array from the implem, Storybook can't :p (Ember hell)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I know.
Actually I meant between L. 20 and L. 26. To have a single source of truth (at least in this file).
But it might not be worth it honestly

}
},
parameters: {
Expand Down
2 changes: 1 addition & 1 deletion addon/components/o-s-s/smart/blob.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Component from '@glimmer/component';

type Size = 'sm' | 'md' | 'xl';
type Size = 'xs' | 'sm' | 'md' | 'xl';

interface SmartBlobArgs {
loading?: boolean;
Expand Down
10 changes: 10 additions & 0 deletions app/styles/atoms/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;

&--xs {
height: 18px;
width: 18px;

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

&--sm {
height: 22px;
width: 22px;
Expand Down
6 changes: 4 additions & 2 deletions tests/dummy/app/templates/smart.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
Smart blob
</div>
<div class="fx-row fx-gap-px-24 fx-xalign-center">
<OSS::Smart::Blob @loading={{false}} @size="sm" />
<OSS::Smart::Blob @loading={{this.loading}} @size="xs" />
<OSS::Smart::Blob @loading={{this.loading}} @size="sm" />
<OSS::Smart::Blob @loading={{this.loading}} />
<OSS::Smart::Blob @loading={{true}} @size="xl" />
<OSS::Smart::Blob @loading={{this.loading}} @size="xl" />
<OSS::Button @label="Toggle loading" {{on "click" this.toggleLoading}} />
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/components/o-s-s/smart/blob-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module('Integration | Component | o-s-s/smart/blob', function (hooks) {
});

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