Merge pull request #810 from hashicorp/toolbar

feat: 🎸 toolbar component
This commit is contained in:
Susmitha Girumala authored and GitHub committed 2021-11-01 14:04:57 -04:00
commit 8bf9a5f21e
7 files changed
+63

No files matched your search

@@ -0,0 +1,3 @@
<div ...attributes class="rose-toolbar">
{{yield}}
</div>
@@ -0,0 +1,24 @@
import { Meta, Story, Preview } from '@storybook/addon-docs/blocks';
import { hbs } from 'ember-cli-htmlbars';
import { action } from '@storybook/addon-actions';
<Meta title="Rose|Toolbar" component="Toolbar" />
# Toolbar
renders a toolbar
```htmlbars
<Rose::Toolbar as |toolbar|>
</Rose::Toolbar>
```
<Preview>
<Story name="Toolbar">{{
template: hbs`
<Rose::Toolbar as |toolbar|>
toolbar
</Rose::Toolbar>
`,
}}</Story>
</Preview>
@@ -18,3 +18,4 @@
@import 'message';
@import 'link-button';
@import 'badge';
@import 'toolbar';
@@ -0,0 +1 @@
@import 'toolbar';
@@ -0,0 +1,13 @@
@use '../../variables/sizing';
@use '../../variables/media';
$xxs: sizing.rems(xxs); // 4
$xxxxs: sizing.rems(xxxxs); // 1
.rose-toolbar {
background-color: var(--ui-gray-subtler-6);
.rose-form {
padding: $xxs + $xxxxs;
}
}
@@ -0,0 +1 @@
export { default } from 'rose/components/rose/toolbar';
@@ -0,0 +1,20 @@
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/toolbar', function (hooks) {
setupRenderingTest(hooks);
test('it renders', async function (assert) {
assert.expect(1);
await render(hbs`<Rose::Toolbar />`);
assert.ok(find('.rose-toolbar'));
});
test('it renders with attributes', async function (assert) {
assert.expect(1);
await render(hbs`<Rose::Toolbar id="toolbar"/>`);
assert.ok(find('#toolbar'));
});
});