chore: 🤖 remove unused tab components

This commit is contained in:
Randall Morey committed 2020-06-04 14:20:53 -04:00
1 parent 9950fc63c5
commit e1ece7bf26
10 files changed
-210

No files matched your search

@@ -1,7 +0,0 @@
import Component from '@ember/component';
import layout from '../../../templates/components/rose/layout/tabs';
export default Component.extend({
layout,
tagName: '',
});
@@ -1,26 +0,0 @@
import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
import { hbs } from 'ember-cli-htmlbars';
import { action } from '@storybook/addon-actions';
<Meta title="Rose|Layout" component="Tabs" />
# Tabs
A tabs layout component to hold `Rose::Tab` definitions.
```html
<Rose::Layout::Tabs>
<Rose::Tab @title="Tab item" @badge="3" @icon="info-circle-outline" @disabled={{false}} />
</Rose::Layout::Tabs>
```
<Preview>
<Story name="Tabs">{{
template: hbs`
<Rose::Layout::Tabs>
<Rose::Tab @title="Text" />
<Rose::Tab @title="Text" />
<Rose::Tab @title="Text" />
</Rose::Layout::Tabs>`,
}}</Story>
</Preview>
-7
View File
@@ -1,7 +0,0 @@
import Component from '@ember/component';
import layout from '../../templates/components/rose/tab';
export default Component.extend({
layout,
tagName: '',
});
@@ -1,43 +0,0 @@
import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
import { hbs } from 'ember-cli-htmlbars';
import { action } from '@storybook/addon-actions';
import { text, boolean, select } from '@storybook/addon-knobs';
<Meta title="Rose|Tab" component="Tab" />
# Tab
A tab item component with ability to configure icon, title, and badge sections.
```html
<Rose::Tab @title="Tab item" @badge="3" @icon="info-circle-outline" @disabled={{false}} />
```
<Preview>
<Story name="Basic">{{
template: hbs`
<Rose::Tab
@title={{title}}
@badge={{badge}}
@icon={{icon}}
@disabled={{disabled}}
/>`,
context: {
title: text('title', 'Tab item'),
badge: text('badge', '3'),
icon: select(
'icon',
{
'info-circle-outline': 'info-circle-outline',
'user-square-fill': 'user-square-fill',
'check-circle-outline': 'check-circle-outline',
'copy-action': 'copy-action',
'unfold-more': 'unfold-more',
'unfold-less': 'unfold-less',
},
'info-circle-outline'
),
disabled: boolean('disabled', false)
},
}}</Story>
</Preview>
@@ -4,5 +4,4 @@
@import 'layout';
@import 'notification';
@import 'card';
@import 'tab';
@import 'nav';
@@ -1,53 +0,0 @@
@use '../variables/sizing';
@use '../utilities/type';
.rose-tab {
@include type.type(s);
display: inline-block;
background-color: var(--subtle);
.rose-tab-link {
text-decoration: none;
color: var(--ui-gray);
display: inline-block;
padding: sizing.rems(s) sizing.rems(m);
border-bottom: sizing.rems(xxxs) solid var(--subtle);
&.rose-tab-link-disabled {
cursor: not-allowed;
pointer-events: none;
color: var(--ui-gray-subtler-2);
}
&:active {
color: var(--action);
border-color: var(--action);
background-color: var(--subtle);
}
&:hover {
color: var(--ui-gray);
border-color: var(--ui-gray-subtler-2);
background-color: var(--ui-gray-subtler-4);
}
&:hover:active {
color: var(--action);
border-color: var(--action);
background-color: var(--ui-gray-subtler-4);
}
}
.rose-tab-icon {
svg {
width: sizing.rems(m);
height: sizing.rems(m);
vertical-align: sub;
}
}
.rose-tab-badge {
@include type.type(xs);
margin-left: sizing.rems(xxs);
}
}
@@ -1,8 +1,6 @@
@use '../../variables/sizing';
@use '../../variables/media';
@import 'tabs';
.rose-layout-page {
display: grid;
grid-template-areas:
@@ -1,8 +0,0 @@
@use '../../variables/sizing';
.rose-layout-tabs {
border-bottom: sizing.rems(xxxxs) solid var(--ui-gray-subtler-2);
display: flex;
flex-wrap: wrap;
flex-direction: row;
}
@@ -1,13 +0,0 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, find } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('Integration | Component | rose/layout/tabs', function (hooks) {
setupRenderingTest(hooks);
test('it renders', async function (assert) {
await render(hbs`<Rose::Layout::Tabs />`);
assert.ok(find('.rose-layout-tabs'));
});
});
@@ -1,50 +0,0 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render, find } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
module('Integration | Component | rose/tab', function (hooks) {
setupRenderingTest(hooks);
test('it renders', async function (assert) {
await render(hbs`<Rose::Tab />`);
assert.ok(find('a'));
assert.ok(find('.rose-tab'));
assert.ok(find('.rose-tab-link'));
assert.notOk(find('.rose-tab-icon'));
assert.notOk(find('.rose-tab-badge'));
assert.notOk(find('.rose-tab-link-disabled'));
});
test('it renders with title', async function (assert) {
await render(hbs`<Rose::Tab @title="Tab title" />`);
assert.equal(find('a').title, 'Tab title');
assert.equal(find('.rose-tab-link').textContent.trim(), 'Tab title');
});
test('it renders with icon', async function (assert) {
await render(hbs`<Rose::Tab @icon="info-circle-outline" />`);
assert.ok(find('svg'));
assert.ok(find('.rose-tab-icon'));
});
test('it renders with badge', async function (assert) {
await render(hbs`<Rose::Tab @badge="3" />`);
assert.ok(find('.rose-tab-badge'));
assert.equal(find('.rose-tab-badge').textContent.trim(), '3');
});
test('it render with attributes', async function (assert) {
await render(hbs`<Rose::Tab id="tab" />`);
assert.ok(find('#tab'));
});
test('it renders disabled', async function (assert) {
this.set('disabled', true);
await render(hbs`<Rose::Tab @disabled={{this.disabled}} />`);
assert.ok(find('.rose-tab-link-disabled'));
this.set('disabled', false);
assert.notOk(find('.rose-tab-link-disabled'));
});
});