refactor: 💡 remove card component from desktop (#2798)

This commit is contained in:
Priya Patel authored and GitHub committed 2025-04-29 17:28:59 -06:00
1 parent c5353d6e5e
commit 185af6f00e
3 files changed
-127

No files matched your search

-37
View File
@@ -1,37 +0,0 @@
{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
}}
<section class='card'>
{{#if (if (has-block 'header') true @heading)}}
<header class='card-header'>
{{#if @heading}}
<Hds::Text::Display
@tag='h2'
@size='400'
@weight='bold'
class='header-spacing'
>
{{#if @icon}}
<Hds::Icon @name={{@icon}} />
{{/if}}
{{@heading}}
</Hds::Text::Display>
{{/if}}
{{yield to='header'}}
</header>
{{/if}}
<div class='card-body'>
{{yield to='body'}}
</div>
{{#if (has-block 'footer')}}
<footer class='card-footer'>
{{yield to='footer'}}
</footer>
{{/if}}
</section>
-37
View File
@@ -274,43 +274,6 @@
z-index: 5500;
}
// Card component (app/components/card)
.card {
border: sizing.rems(xxxxs) solid var(--ui-gray-subtler-3);
display: flex;
flex-direction: column;
margin-bottom: sizing.rems(m);
.card-header {
align-items: center;
border-bottom: sizing.rems(xxxxs) solid var(--ui-gray-subtler-3);
display: flex;
justify-content: space-between;
padding: sizing.rems(s) sizing.rems(s) sizing.rems(s) sizing.rems(m);
h2 {
@include type.type(s, normal);
color: var(--ui-gray-starker-1);
margin: 0;
padding: sizing.rems(xxs) + sizing.rems(xxxs) 0;
}
.hds-icon {
margin-right: sizing.rems(xxxs);
}
}
.card-body {
padding: sizing.rems(s);
}
.card-footer {
border-top: sizing.rems(xxxxs) solid var(--ui-gray-subtler-3);
padding: sizing.rems(s);
}
}
// Hidden secret component (app/components/hidden-secret)
.hidden-secret {
display: flex;
@@ -1,53 +0,0 @@
/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, find } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
module('Integration | Component | card', function (hooks) {
setupRenderingTest(hooks);
test('it renders', async function (assert) {
await render(hbs`<Card />`);
assert.ok(find('.card'));
});
test('it renders with content', async function (assert) {
await render(hbs`
<Card>
<:header></:header>
<:body></:body>
<:footer></:footer>
</Card>
`);
assert.ok(find('.card'));
assert.ok(find('.card-header'));
assert.ok(find('.card-body'));
assert.ok(find('.card-footer'));
});
test('header renders an icon when defined', async function (assert) {
await render(hbs`
<Card
@heading='This is a heading test'
@icon='key'>
<:header></:header>
<:body></:body>
<:footer></:footer>
</Card>
`);
assert.dom('.card').exists();
assert.dom('.card-header').exists();
assert.dom('.card-header .hds-icon').isVisible();
assert.strictEqual(
this.element.textContent.trim(),
'This is a heading test',
);
});
});