@storybook/ember 7.0.0-alpha.5 → 7.0.0-alpha.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/client/preview/config.js +2 -2
- package/dist/cjs/client/preview/index.js +5 -15
- package/dist/cjs/client/preview/render.js +11 -8
- package/dist/cjs/client/preview/types.js +5 -1
- package/dist/cjs/index.js +0 -24
- package/dist/cjs/preset.js +11 -2
- package/dist/cjs/types.js +5 -0
- package/dist/esm/client/preview/config.js +1 -1
- package/dist/esm/client/preview/index.js +5 -10
- package/dist/esm/client/preview/render.js +9 -6
- package/dist/esm/client/preview/types.js +1 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/preset.js +7 -2
- package/dist/esm/types.js +1 -0
- package/dist/types/src/client/preview/config.d.ts +2 -2
- package/dist/types/src/client/preview/index.d.ts +5 -7
- package/dist/types/src/client/preview/render.d.ts +3 -3
- package/dist/types/src/client/preview/types.d.ts +8 -3
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/preset.d.ts +4 -11
- package/dist/types/src/server/framework-preset-babel-ember.d.ts +1 -1
- package/dist/types/src/server/framework-preset-ember-docs.d.ts +1 -1
- package/dist/types/src/types.d.ts +25 -0
- package/jest.config.js +7 -0
- package/package.json +17 -10
- package/template/cli/1-Button.stories.js +61 -0
- package/LICENSE +0 -21
package/README.md
CHANGED
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.parameters = void 0;
|
7
|
-
Object.defineProperty(exports, "
|
7
|
+
Object.defineProperty(exports, "renderToCanvas", {
|
8
8
|
enumerable: true,
|
9
9
|
get: function () {
|
10
|
-
return _render.
|
10
|
+
return _render.renderToCanvas;
|
11
11
|
}
|
12
12
|
});
|
13
13
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.storiesOf = exports.
|
6
|
+
exports.storiesOf = exports.raw = exports.forceReRender = exports.configure = void 0;
|
7
7
|
|
8
8
|
var _coreClient = require("@storybook/core-client");
|
9
9
|
|
@@ -15,30 +15,20 @@ const {
|
|
15
15
|
configure: coreConfigure,
|
16
16
|
clientApi,
|
17
17
|
forceReRender
|
18
|
-
} = (0, _coreClient.start)(_render.
|
18
|
+
} = (0, _coreClient.start)(_render.renderToCanvas);
|
19
19
|
exports.forceReRender = forceReRender;
|
20
20
|
const {
|
21
|
-
setAddon,
|
22
|
-
addDecorator,
|
23
|
-
addParameters,
|
24
|
-
clearDecorators,
|
25
|
-
getStorybook,
|
26
21
|
raw
|
27
22
|
} = clientApi;
|
28
23
|
exports.raw = raw;
|
29
|
-
|
30
|
-
exports.clearDecorators = clearDecorators;
|
31
|
-
exports.addParameters = addParameters;
|
32
|
-
exports.addDecorator = addDecorator;
|
33
|
-
exports.setAddon = setAddon;
|
34
|
-
const framework = 'ember';
|
24
|
+
const FRAMEWORK = 'ember';
|
35
25
|
|
36
26
|
const storiesOf = (kind, m) => clientApi.storiesOf(kind, m).addParameters({
|
37
|
-
framework
|
27
|
+
framework: FRAMEWORK
|
38
28
|
});
|
39
29
|
|
40
30
|
exports.storiesOf = storiesOf;
|
41
31
|
|
42
|
-
const configure = (loadable, m) => coreConfigure(
|
32
|
+
const configure = (loadable, m) => coreConfigure(FRAMEWORK, loadable, m);
|
43
33
|
|
44
34
|
exports.configure = configure;
|
@@ -3,19 +3,22 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.renderToCanvas = renderToCanvas;
|
7
7
|
|
8
8
|
var _global = _interopRequireDefault(require("global"));
|
9
9
|
|
10
|
-
var _tsDedent =
|
10
|
+
var _tsDedent = require("ts-dedent");
|
11
|
+
|
12
|
+
var _component = _interopRequireDefault(require("@ember/component"));
|
11
13
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
15
|
|
16
|
+
// @ts-expect-error (Converted from ts-ignore)
|
14
17
|
const {
|
15
18
|
window: globalWindow,
|
16
19
|
document
|
17
20
|
} = _global.default;
|
18
|
-
const rootEl = document.getElementById('root');
|
21
|
+
const rootEl = document.getElementById('storybook-root');
|
19
22
|
|
20
23
|
const config = globalWindow.require(`${globalWindow.STORYBOOK_NAME}/config/environment`);
|
21
24
|
|
@@ -45,7 +48,7 @@ function render(options, el) {
|
|
45
48
|
const appInstancePrivate = app.buildInstance();
|
46
49
|
return appInstancePrivate.boot().then(() => appInstancePrivate);
|
47
50
|
}).then(instance => {
|
48
|
-
instance.register('component:story-mode',
|
51
|
+
instance.register('component:story-mode', _component.default.extend(Object.assign({
|
49
52
|
layout: template || options
|
50
53
|
}, context)));
|
51
54
|
const component = instance.lookup('component:story-mode');
|
@@ -63,19 +66,19 @@ function render(options, el) {
|
|
63
66
|
});
|
64
67
|
}
|
65
68
|
|
66
|
-
function
|
69
|
+
function renderToCanvas({
|
67
70
|
storyFn,
|
68
71
|
kind,
|
69
72
|
name,
|
70
73
|
showMain,
|
71
74
|
showError
|
72
|
-
},
|
75
|
+
}, canvasElement) {
|
73
76
|
const element = storyFn();
|
74
77
|
|
75
78
|
if (!element) {
|
76
79
|
showError({
|
77
80
|
title: `Expecting a Ember element from the story: "${name}" of "${kind}".`,
|
78
|
-
description: (0, _tsDedent.
|
81
|
+
description: (0, _tsDedent.dedent)`
|
79
82
|
Did you forget to return the Ember element from the story?
|
80
83
|
Use "() => hbs('{{component}}')" or "() => { return {
|
81
84
|
template: hbs\`{{component}}\`
|
@@ -86,5 +89,5 @@ function renderToDOM({
|
|
86
89
|
}
|
87
90
|
|
88
91
|
showMain();
|
89
|
-
render(element,
|
92
|
+
render(element, canvasElement);
|
90
93
|
}
|
package/dist/cjs/index.js
CHANGED
@@ -3,18 +3,6 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
Object.defineProperty(exports, "addDecorator", {
|
7
|
-
enumerable: true,
|
8
|
-
get: function () {
|
9
|
-
return _preview.addDecorator;
|
10
|
-
}
|
11
|
-
});
|
12
|
-
Object.defineProperty(exports, "addParameters", {
|
13
|
-
enumerable: true,
|
14
|
-
get: function () {
|
15
|
-
return _preview.addParameters;
|
16
|
-
}
|
17
|
-
});
|
18
6
|
Object.defineProperty(exports, "configure", {
|
19
7
|
enumerable: true,
|
20
8
|
get: function () {
|
@@ -27,24 +15,12 @@ Object.defineProperty(exports, "forceReRender", {
|
|
27
15
|
return _preview.forceReRender;
|
28
16
|
}
|
29
17
|
});
|
30
|
-
Object.defineProperty(exports, "getStorybook", {
|
31
|
-
enumerable: true,
|
32
|
-
get: function () {
|
33
|
-
return _preview.getStorybook;
|
34
|
-
}
|
35
|
-
});
|
36
18
|
Object.defineProperty(exports, "raw", {
|
37
19
|
enumerable: true,
|
38
20
|
get: function () {
|
39
21
|
return _preview.raw;
|
40
22
|
}
|
41
23
|
});
|
42
|
-
Object.defineProperty(exports, "setAddon", {
|
43
|
-
enumerable: true,
|
44
|
-
get: function () {
|
45
|
-
return _preview.setAddon;
|
46
|
-
}
|
47
|
-
});
|
48
24
|
Object.defineProperty(exports, "storiesOf", {
|
49
25
|
enumerable: true,
|
50
26
|
get: function () {
|
package/dist/cjs/preset.js
CHANGED
@@ -4,12 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.core = exports.addons = void 0;
|
7
|
+
|
8
|
+
var _path = _interopRequireDefault(require("path"));
|
9
|
+
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
|
+
|
7
12
|
const addons = [require.resolve('./server/framework-preset-babel-ember'), require.resolve('./server/framework-preset-ember-docs')];
|
8
13
|
exports.addons = addons;
|
9
14
|
|
10
|
-
const core = async config => {
|
15
|
+
const core = async (config, options) => {
|
16
|
+
const framework = await options.presets.apply('framework');
|
11
17
|
return Object.assign({}, config, {
|
12
|
-
builder:
|
18
|
+
builder: {
|
19
|
+
name: _path.default.dirname(require.resolve(_path.default.join('@storybook/builder-webpack5', 'package.json'))),
|
20
|
+
options: typeof framework === 'string' ? {} : framework.options.builder || {}
|
21
|
+
}
|
13
22
|
});
|
14
23
|
};
|
15
24
|
|
@@ -1,22 +1,17 @@
|
|
1
1
|
import { start } from '@storybook/core-client';
|
2
2
|
import './globals';
|
3
|
-
import {
|
3
|
+
import { renderToCanvas } from './render';
|
4
4
|
const {
|
5
5
|
configure: coreConfigure,
|
6
6
|
clientApi,
|
7
7
|
forceReRender
|
8
|
-
} = start(
|
8
|
+
} = start(renderToCanvas);
|
9
9
|
export const {
|
10
|
-
setAddon,
|
11
|
-
addDecorator,
|
12
|
-
addParameters,
|
13
|
-
clearDecorators,
|
14
|
-
getStorybook,
|
15
10
|
raw
|
16
11
|
} = clientApi;
|
17
|
-
const
|
12
|
+
const FRAMEWORK = 'ember';
|
18
13
|
export const storiesOf = (kind, m) => clientApi.storiesOf(kind, m).addParameters({
|
19
|
-
framework
|
14
|
+
framework: FRAMEWORK
|
20
15
|
});
|
21
|
-
export const configure = (loadable, m) => coreConfigure(
|
16
|
+
export const configure = (loadable, m) => coreConfigure(FRAMEWORK, loadable, m);
|
22
17
|
export { forceReRender };
|
@@ -1,10 +1,13 @@
|
|
1
1
|
import global from 'global';
|
2
|
-
import dedent from 'ts-dedent';
|
2
|
+
import { dedent } from 'ts-dedent';
|
3
|
+
// @ts-expect-error (Converted from ts-ignore)
|
4
|
+
import Component from '@ember/component'; // eslint-disable-line import/no-unresolved
|
5
|
+
|
3
6
|
const {
|
4
7
|
window: globalWindow,
|
5
8
|
document
|
6
9
|
} = global;
|
7
|
-
const rootEl = document.getElementById('root');
|
10
|
+
const rootEl = document.getElementById('storybook-root');
|
8
11
|
|
9
12
|
const config = globalWindow.require(`${globalWindow.STORYBOOK_NAME}/config/environment`);
|
10
13
|
|
@@ -34,7 +37,7 @@ function render(options, el) {
|
|
34
37
|
const appInstancePrivate = app.buildInstance();
|
35
38
|
return appInstancePrivate.boot().then(() => appInstancePrivate);
|
36
39
|
}).then(instance => {
|
37
|
-
instance.register('component:story-mode',
|
40
|
+
instance.register('component:story-mode', Component.extend(Object.assign({
|
38
41
|
layout: template || options
|
39
42
|
}, context)));
|
40
43
|
const component = instance.lookup('component:story-mode');
|
@@ -52,13 +55,13 @@ function render(options, el) {
|
|
52
55
|
});
|
53
56
|
}
|
54
57
|
|
55
|
-
export function
|
58
|
+
export function renderToCanvas({
|
56
59
|
storyFn,
|
57
60
|
kind,
|
58
61
|
name,
|
59
62
|
showMain,
|
60
63
|
showError
|
61
|
-
},
|
64
|
+
}, canvasElement) {
|
62
65
|
const element = storyFn();
|
63
66
|
|
64
67
|
if (!element) {
|
@@ -75,5 +78,5 @@ export function renderToDOM({
|
|
75
78
|
}
|
76
79
|
|
77
80
|
showMain();
|
78
|
-
render(element,
|
81
|
+
render(element, canvasElement);
|
79
82
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/dist/esm/index.js
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
-
|
1
|
+
/// <reference types="webpack-env" />
|
2
|
+
export { storiesOf, configure, forceReRender, raw } from './client/preview'; // optimization: stop HMR propagation in webpack
|
2
3
|
|
3
4
|
module?.hot?.decline();
|
package/dist/esm/preset.js
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
+
import path from 'path';
|
1
2
|
export const addons = [require.resolve('./server/framework-preset-babel-ember'), require.resolve('./server/framework-preset-ember-docs')];
|
2
|
-
export const core = async config => {
|
3
|
+
export const core = async (config, options) => {
|
4
|
+
const framework = await options.presets.apply('framework');
|
3
5
|
return Object.assign({}, config, {
|
4
|
-
builder:
|
6
|
+
builder: {
|
7
|
+
name: path.dirname(require.resolve(path.join('@storybook/builder-webpack5', 'package.json'))),
|
8
|
+
options: typeof framework === 'string' ? {} : framework.options.builder || {}
|
9
|
+
}
|
5
10
|
});
|
6
11
|
};
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -1,9 +1,7 @@
|
|
1
1
|
import './globals';
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
export declare const storiesOf: (kind: string, m: any) => import("lib/addons/dist/types").StoryApi<import("./types").OptionsArgs>;
|
8
|
-
export declare const configure: (loadable: any, m: any) => void;
|
2
|
+
import type { EmberRenderer } from './types';
|
3
|
+
declare const forceReRender: () => void;
|
4
|
+
export declare const raw: ((...args: any[]) => never) | (() => import("lib/types/dist").Store_BoundStory<EmberRenderer>[]);
|
5
|
+
export declare const storiesOf: (kind: string, m: any) => import("lib/types/dist").Addon_StoryApi<import("./types").OptionsArgs>;
|
6
|
+
export declare const configure: (loadable: any, m: any) => any;
|
9
7
|
export { forceReRender };
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
export declare function
|
1
|
+
import type { Store_RenderContext } from '@storybook/types';
|
2
|
+
import type { EmberRenderer } from './types';
|
3
|
+
export declare function renderToCanvas({ storyFn, kind, name, showMain, showError }: Store_RenderContext<EmberRenderer>, canvasElement: EmberRenderer['canvasElement']): void;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
import type { WebRenderer } from '@storybook/types';
|
2
|
+
export type { RenderContext } from '@storybook/types';
|
2
3
|
export interface ShowErrorArgs {
|
3
4
|
title: string;
|
4
5
|
description: string;
|
@@ -8,7 +9,11 @@ export interface OptionsArgs {
|
|
8
9
|
context: any;
|
9
10
|
element: any;
|
10
11
|
}
|
11
|
-
|
12
|
+
/**
|
13
|
+
* @deprecated Use `EmberRenderer` instead.
|
14
|
+
*/
|
15
|
+
export declare type EmberFramework = EmberRenderer;
|
16
|
+
export interface EmberRenderer extends WebRenderer {
|
12
17
|
component: any;
|
13
18
|
storyResult: OptionsArgs;
|
14
|
-
}
|
19
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
export { storiesOf,
|
1
|
+
export { storiesOf, configure, forceReRender, raw } from './client/preview';
|
@@ -1,11 +1,4 @@
|
|
1
|
-
import type {
|
2
|
-
|
3
|
-
export declare const
|
4
|
-
|
5
|
-
disableWebpackDefaults?: boolean | undefined;
|
6
|
-
channelOptions?: Partial<import("telejson").Options> | undefined;
|
7
|
-
disableProjectJson?: boolean | undefined;
|
8
|
-
disableTelemetry?: boolean | undefined;
|
9
|
-
enableCrashReports?: boolean | undefined;
|
10
|
-
crossOriginIsolated?: boolean | undefined;
|
11
|
-
}>;
|
1
|
+
import type { PresetProperty } from '@storybook/types';
|
2
|
+
import type { StorybookConfig } from './types';
|
3
|
+
export declare const addons: PresetProperty<'addons', StorybookConfig>;
|
4
|
+
export declare const core: PresetProperty<'core', StorybookConfig>;
|
@@ -1,4 +1,4 @@
|
|
1
1
|
import type { TransformOptions } from '@babel/core';
|
2
|
-
import type { StorybookConfig, Options } from '@storybook/
|
2
|
+
import type { StorybookConfig, Options } from '@storybook/types';
|
3
3
|
export declare function babel(config: TransformOptions, options: Options): TransformOptions;
|
4
4
|
export declare const previewAnnotations: StorybookConfig['previewAnnotations'];
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import type { StorybookConfig } from '@storybook/
|
1
|
+
import type { StorybookConfig } from '@storybook/types';
|
2
2
|
export declare const previewAnnotations: StorybookConfig['previewAnnotations'];
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import type { StorybookConfig as StorybookConfigBase, TypescriptOptions as TypescriptOptionsReact } from '@storybook/core-webpack';
|
2
|
+
import type { StorybookConfigWebpack, BuilderOptions, TypescriptOptions as TypescriptOptionsBuilder } from '@storybook/builder-webpack5';
|
3
|
+
declare type FrameworkName = '@storybook/ember-webpack5';
|
4
|
+
declare type BuilderName = '@storybook/builder-webpack5';
|
5
|
+
export declare type FrameworkOptions = {
|
6
|
+
builder?: BuilderOptions;
|
7
|
+
};
|
8
|
+
declare type StorybookConfigFramework = {
|
9
|
+
framework: FrameworkName | {
|
10
|
+
name: FrameworkName;
|
11
|
+
options: FrameworkOptions;
|
12
|
+
};
|
13
|
+
core?: StorybookConfigBase['core'] & {
|
14
|
+
builder?: BuilderName | {
|
15
|
+
name: BuilderName;
|
16
|
+
options: BuilderOptions;
|
17
|
+
};
|
18
|
+
};
|
19
|
+
typescript?: Partial<TypescriptOptionsBuilder & TypescriptOptionsReact> & StorybookConfigBase['typescript'];
|
20
|
+
};
|
21
|
+
/**
|
22
|
+
* The interface for Storybook configuration in `main.ts` files.
|
23
|
+
*/
|
24
|
+
export declare type StorybookConfig = Omit<StorybookConfigBase, keyof StorybookConfigWebpack | keyof StorybookConfigFramework> & StorybookConfigWebpack & StorybookConfigFramework;
|
25
|
+
export {};
|
package/jest.config.js
ADDED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@storybook/ember",
|
3
|
-
"version": "7.0.0-alpha.
|
3
|
+
"version": "7.0.0-alpha.50",
|
4
4
|
"description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.",
|
5
5
|
"homepage": "https://github.com/storybookjs/storybook/tree/main/frameworks/ember",
|
6
6
|
"bugs": {
|
@@ -21,31 +21,38 @@
|
|
21
21
|
"types": "dist/types/index.d.ts",
|
22
22
|
"files": [
|
23
23
|
"dist/**/*",
|
24
|
+
"template/**/*",
|
24
25
|
"README.md",
|
25
26
|
"*.js",
|
26
27
|
"*.d.ts"
|
27
28
|
],
|
28
29
|
"scripts": {
|
29
|
-
"
|
30
|
+
"check": "../../../scripts/node_modules/.bin/tsc --noEmit",
|
31
|
+
"prep": "node ../../../scripts/prepare.js"
|
30
32
|
},
|
31
33
|
"dependencies": {
|
32
|
-
"@storybook/builder-webpack5": "7.0.0-alpha.
|
33
|
-
"@storybook/core-client": "7.0.0-alpha.
|
34
|
-
"@storybook/core-common": "7.0.0-alpha.
|
35
|
-
"@storybook/docs-tools": "7.0.0-alpha.
|
36
|
-
"@storybook/store": "7.0.0-alpha.
|
37
|
-
"
|
34
|
+
"@storybook/builder-webpack5": "7.0.0-alpha.50",
|
35
|
+
"@storybook/core-client": "7.0.0-alpha.50",
|
36
|
+
"@storybook/core-common": "7.0.0-alpha.50",
|
37
|
+
"@storybook/docs-tools": "7.0.0-alpha.50",
|
38
|
+
"@storybook/store": "7.0.0-alpha.50",
|
39
|
+
"@storybook/types": "7.0.0-alpha.50",
|
38
40
|
"global": "^4.4.0",
|
39
41
|
"react": "16.14.0",
|
40
42
|
"react-dom": "16.14.0",
|
41
43
|
"read-pkg-up": "^7.0.1",
|
42
44
|
"ts-dedent": "^2.0.0"
|
43
45
|
},
|
46
|
+
"devDependencies": {
|
47
|
+
"ember-source": "~3.28.1",
|
48
|
+
"typescript": "~4.6.3"
|
49
|
+
},
|
44
50
|
"peerDependencies": {
|
45
51
|
"@babel/core": "*",
|
52
|
+
"@types/ember__component": "4.0.8",
|
46
53
|
"babel-plugin-ember-modules-api-polyfill": "^2.12.0",
|
47
54
|
"babel-plugin-htmlbars-inline-precompile": "2 || 3",
|
48
|
-
"ember-source": "
|
55
|
+
"ember-source": "~3.28.1"
|
49
56
|
},
|
50
57
|
"engines": {
|
51
58
|
"node": ">=10.13.0"
|
@@ -53,5 +60,5 @@
|
|
53
60
|
"publishConfig": {
|
54
61
|
"access": "public"
|
55
62
|
},
|
56
|
-
"gitHead": "
|
63
|
+
"gitHead": "77184d039091f4782dc4540df6d271a24fb3e242"
|
57
64
|
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import { hbs } from 'ember-cli-htmlbars';
|
2
|
+
import { action } from '@storybook/addon-actions';
|
3
|
+
import { linkTo } from '@storybook/addon-links';
|
4
|
+
|
5
|
+
// More on default export: https://storybook.js.org/docs/ember/writing-stories/introduction#default-export
|
6
|
+
export default {
|
7
|
+
title: 'Button',
|
8
|
+
render: (args) => ({
|
9
|
+
template: hbs`<button {{action onClick}}>{{label}}</button>`,
|
10
|
+
context: args,
|
11
|
+
}),
|
12
|
+
// More on argTypes: https://storybook.js.org/docs/ember/api/argtypes
|
13
|
+
argTypes: {
|
14
|
+
label: { control: 'text' },
|
15
|
+
},
|
16
|
+
};
|
17
|
+
|
18
|
+
// More on component templates: https://storybook.js.org/docs/ember/writing-stories/introduction#using-args
|
19
|
+
export const Text = {
|
20
|
+
args: {
|
21
|
+
label: 'Button',
|
22
|
+
onClick: action('onClick'),
|
23
|
+
},
|
24
|
+
};
|
25
|
+
|
26
|
+
export const Emoji = {
|
27
|
+
args: {
|
28
|
+
label: '😀 😎 👍 💯',
|
29
|
+
},
|
30
|
+
};
|
31
|
+
|
32
|
+
export const TextWithAction = {
|
33
|
+
render: () => ({
|
34
|
+
template: hbs`
|
35
|
+
<button {{action onClick}}>
|
36
|
+
Trigger Action
|
37
|
+
</button>
|
38
|
+
`,
|
39
|
+
context: {
|
40
|
+
onClick: () => action('This was clicked')(),
|
41
|
+
},
|
42
|
+
}),
|
43
|
+
name: 'With an action',
|
44
|
+
parameters: {
|
45
|
+
notes: 'My notes on a button with emojis',
|
46
|
+
},
|
47
|
+
};
|
48
|
+
|
49
|
+
export const ButtonWithLinkToAnotherStory = {
|
50
|
+
render: () => ({
|
51
|
+
template: hbs`
|
52
|
+
<button {{action onClick}}>
|
53
|
+
Go to Welcome Story
|
54
|
+
</button>
|
55
|
+
`,
|
56
|
+
context: {
|
57
|
+
onClick: linkTo('example-introduction--page'),
|
58
|
+
},
|
59
|
+
}),
|
60
|
+
name: 'button with link to another story',
|
61
|
+
};
|
package/LICENSE
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2017 Kadira Inc. <hello@kadira.io>
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|