Skip to content

Commit

Permalink
Merge pull request #11279 from hashicorp/f-ui/storybook-upgrade
Browse files Browse the repository at this point in the history
UI: Storybook upgrade
  • Loading branch information
DingoEatingFuzz authored Oct 7, 2021
2 parents 0881b94 + b9937df commit c50b751
Show file tree
Hide file tree
Showing 40 changed files with 3,265 additions and 1,649 deletions.
3 changes: 0 additions & 3 deletions ui/.storybook/addons.js

This file was deleted.

69 changes: 0 additions & 69 deletions ui/.storybook/config.js

This file was deleted.

14 changes: 14 additions & 0 deletions ui/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* eslint-env node */
module.exports = {
addons: [
'@storybook/addon-docs',
'@storybook/addon-storysource',
'@storybook/addon-knobs',
'@storybook/addon-viewport',
],
stories: [
'../stories/theme/*.stories.js',
'../stories/components/*.stories.js',
'../stories/charts/*.stories.js',
],
};
41 changes: 41 additions & 0 deletions ui/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { addDecorator, addParameters } from '@storybook/ember';
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport';
import theme from './theme.js';

addParameters({
viewport: { viewports: INITIAL_VIEWPORTS },
options: {
showPanel: true,
theme,
},
});

addDecorator(storyFn => {
let { template, context } = storyFn();

let wrapperElementStyle = {
margin: '20px',
};

let applicationWrapperElement = document.createElement('div');
Object.assign(applicationWrapperElement.style, wrapperElementStyle);

let storybookElement = document.createElement('div');
storybookElement.setAttribute('id', 'storybook');

let wormhole = document.createElement('div');
wormhole.setAttribute('id', 'ember-basic-dropdown-wormhole');

storybookElement.appendChild(wormhole);

applicationWrapperElement.appendChild(storybookElement);
storybookElement.appendTo = function appendTo(el) {
el.appendChild(applicationWrapperElement);
};

return {
template,
context,
element: storybookElement,
};
});
12 changes: 6 additions & 6 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@glimmer/component": "^1.0.1",
"@glimmer/tracking": "^1.0.0",
"@hashicorp/structure-icons": "^1.3.0",
"@storybook/ember-cli-storybook": "^0.2.0",
"@storybook/ember-cli-storybook": "https://github.com/DingoEatingFuzz/ember-cli-storybook#c207500",
"anser": "^1.4.8",
"babel-eslint": "^10.1.0",
"base64-js": "^1.3.1",
Expand Down Expand Up @@ -131,11 +131,11 @@
},
"optionalDependencies": {
"@babel/plugin-transform-member-expression-literals": "^7.2.0",
"@storybook/addon-knobs": "^5.2.5",
"@storybook/addon-storysource": "^5.2.5",
"@storybook/addon-viewport": "^5.2.5",
"@storybook/addons": "^5.2.5",
"@storybook/ember": "^5.2.5",
"@storybook/addon-knobs": "^6.3.1",
"@storybook/addon-storysource": "^6.3.10",
"@storybook/addon-viewport": "^6.3.10",
"@storybook/addons": "^6.3.10",
"@storybook/ember": "^6.3.10",
"babel-loader": "^8.0.6",
"ember-cli-get-component-path-option": "^1.0.0",
"ember-cli-string-utils": "^1.1.0"
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/charts/distribution-bar.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { on } from '@ember/object/evented';
import DelayedTruth from '../utils/delayed-truth';

export default {
title: 'Charts|Distribution Bar',
title: 'Charts/Distribution Bar',
};

export let Standard = () => {
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/charts/gauge-chart.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import DelayedArray from '../utils/delayed-array';
import DelayedTruth from '../utils/delayed-truth';

export default {
title: 'Charts|Gauge Chart',
title: 'Charts/Gauge Chart',
};

let totalVariations = [
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/charts/line-chart.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import moment from 'moment';
import DelayedArray from '../utils/delayed-array';

export default {
title: 'Charts|Line Chart',
title: 'Charts/Line Chart',
};

let data1 = [
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/charts/primitives.stories.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hbs from 'htmlbars-inline-precompile';

export default {
title: 'Charts|Primitives',
title: 'Charts/Primitives',
};

export let Tooltip = () => ({
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/charts/progress-bar.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import EmberObject, { computed } from '@ember/object';
import { on } from '@ember/object/evented';

export default {
title: 'Charts|Progress Bar',
title: 'Charts/Progress Bar',
};

export let Standard = () => {
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/charts/stats-time-series.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import moment from 'moment';
import DelayedArray from '../utils/delayed-array';

export default {
title: 'Charts|Stats Time Series',
title: 'Charts/Stats Time Series',
};

let ts = offset =>
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/components/accordion.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import hbs from 'htmlbars-inline-precompile';
import productMetadata from '../../app/utils/styleguide/product-metadata';

export default {
title: 'Components|Accordion',
title: 'Components/Accordion',
};

export let Standard = () => {
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/components/alerts.stories.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hbs from 'htmlbars-inline-precompile';

export default {
title: 'Components|Alerts',
title: 'Components/Alerts',
};

export let Standard = () => {
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/components/boxed-section.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import hbs from 'htmlbars-inline-precompile';
import { withKnobs, optionsKnob } from '@storybook/addon-knobs';

export default {
title: 'Components|Boxed Section',
title: 'Components/Boxed Section',
decorators: [withKnobs],
};

Expand Down
2 changes: 1 addition & 1 deletion ui/stories/components/breadcrumbs.stories.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hbs from 'htmlbars-inline-precompile';

export default {
title: 'Components|Breadcrumbs',
title: 'Components/Breadcrumbs',
};

export let Standard = () => {
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/components/buttons.stories.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hbs from 'htmlbars-inline-precompile';

export default {
title: 'Components|Buttons',
title: 'Components/Buttons',
};

export let Standard = () => {
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/components/copy-button.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import hbs from 'htmlbars-inline-precompile';
import { withKnobs, text } from '@storybook/addon-knobs';

export default {
title: 'Components|Copy Button',
title: 'Components/Copy Button',
decorators: [withKnobs],
};

Expand Down
2 changes: 1 addition & 1 deletion ui/stories/components/diff-viewer.stories.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hbs from 'htmlbars-inline-precompile';

export default {
title: 'Components|Diff Viewer',
title: 'Components/Diff Viewer',
};

export let DiffViewerWithInsertions = () => {
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/components/dropdown.stories.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hbs from 'htmlbars-inline-precompile';

export default {
title: 'Components|Dropdown',
title: 'Components/Dropdown',
};

let options = [
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/components/filter-facets.stories.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hbs from 'htmlbars-inline-precompile';

export default {
title: 'Components|Filter Facets',
title: 'Components/Filter Facets',
};

let options1 = [
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/components/gutter-menu.stories.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hbs from 'htmlbars-inline-precompile';

export default {
title: 'Components|Gutter Menu',
title: 'Components/Gutter Menu',
};

export let Standard = () => {
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/components/header.stories.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hbs from 'htmlbars-inline-precompile';

export default {
title: 'Components|Header',
title: 'Components/Header',
};

export let Header = () => {
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/components/inline-definitions.stories.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hbs from 'htmlbars-inline-precompile';

export default {
title: 'Components|Inline Definitions',
title: 'Components/Inline Definitions',
};

export let Standard = () => {
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/components/json-viewer.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import hbs from 'htmlbars-inline-precompile';
import DelayedTruth from '../utils/delayed-truth';

export default {
title: 'Components|JSON Viewer',
title: 'Components/JSON Viewer',
};

export let Standard = () => {
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/components/log-stream.stories.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hbs from 'htmlbars-inline-precompile';

export default {
title: 'Components|Log Stream',
title: 'Components/Log Stream',
};

export let LogStream = () => {
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/components/metrics.stories.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hbs from 'htmlbars-inline-precompile';

export default {
title: 'Components|Metrics',
title: 'Components/Metrics',
};

export let Standard = () => {
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/components/page-tabs.stories.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hbs from 'htmlbars-inline-precompile';

export default {
title: 'Components|Page Tabs',
title: 'Components/Page Tabs',
};

export let Standard = () => {
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/components/page-title.stories.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hbs from 'htmlbars-inline-precompile';

export default {
title: 'Components|Page Title',
title: 'Components/Page Title',
};

export let Standard = () => {
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/components/proxy-tag.stories.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hbs from 'htmlbars-inline-precompile';

export default {
title: 'Components|Proxy Tag',
title: 'Components/Proxy Tag',
};

export let ProxyTag = () => {
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/components/search-box.stories.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hbs from 'htmlbars-inline-precompile';

export default {
title: 'Components|Search Box',
title: 'Components/Search Box',
};

export let Standard = () => {
Expand Down
2 changes: 1 addition & 1 deletion ui/stories/components/stepper-input.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import hbs from 'htmlbars-inline-precompile';
import { withKnobs, optionsKnob } from '@storybook/addon-knobs';

export default {
title: 'Components|Stepper Input',
title: 'Components/Stepper Input',
decorators: [withKnobs],
};

Expand Down
2 changes: 1 addition & 1 deletion ui/stories/components/table-configuration.stories.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import hbs from 'htmlbars-inline-precompile';

export default {
title: 'Components|Table, Configuration',
title: 'Components/Table, Configuration',
};

export let TableConfiguration = () => {
Expand Down
Loading

0 comments on commit c50b751

Please sign in to comment.