@storybook/ember 7.0.0-alpha.46 → 7.0.0-alpha.47
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/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.47",
|
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,6 +21,7 @@
|
|
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"
|
@@ -30,12 +31,12 @@
|
|
30
31
|
"prep": "node ../../../scripts/prepare.js"
|
31
32
|
},
|
32
33
|
"dependencies": {
|
33
|
-
"@storybook/builder-webpack5": "7.0.0-alpha.
|
34
|
-
"@storybook/core-client": "7.0.0-alpha.
|
35
|
-
"@storybook/core-common": "7.0.0-alpha.
|
36
|
-
"@storybook/docs-tools": "7.0.0-alpha.
|
37
|
-
"@storybook/store": "7.0.0-alpha.
|
38
|
-
"@storybook/types": "7.0.0-alpha.
|
34
|
+
"@storybook/builder-webpack5": "7.0.0-alpha.47",
|
35
|
+
"@storybook/core-client": "7.0.0-alpha.47",
|
36
|
+
"@storybook/core-common": "7.0.0-alpha.47",
|
37
|
+
"@storybook/docs-tools": "7.0.0-alpha.47",
|
38
|
+
"@storybook/store": "7.0.0-alpha.47",
|
39
|
+
"@storybook/types": "7.0.0-alpha.47",
|
39
40
|
"global": "^4.4.0",
|
40
41
|
"react": "16.14.0",
|
41
42
|
"react-dom": "16.14.0",
|
@@ -59,5 +60,5 @@
|
|
59
60
|
"publishConfig": {
|
60
61
|
"access": "public"
|
61
62
|
},
|
62
|
-
"gitHead": "
|
63
|
+
"gitHead": "1c706a4a778831e012343c905f86225fa71491a7"
|
63
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
|
+
};
|