@storybook/addon-interactions 6.4.7 → 6.5.0-alpha.2
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/dist/cjs/components/Interaction/Interaction.js +3 -1
- package/dist/cjs/components/Subnav/Subnav.js +32 -40
- package/dist/esm/components/Interaction/Interaction.js +3 -1
- package/dist/esm/components/Subnav/Subnav.js +31 -40
- package/dist/modern/components/Interaction/Interaction.js +3 -1
- package/dist/modern/components/Subnav/Subnav.js +16 -26
- package/package.json +9 -9
|
@@ -70,7 +70,9 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
70
70
|
var MethodCallWrapper = _theming.styled.div(function () {
|
|
71
71
|
return {
|
|
72
72
|
fontFamily: _theming.typography.fonts.mono,
|
|
73
|
-
fontSize: _theming.typography.size.s1
|
|
73
|
+
fontSize: _theming.typography.size.s1,
|
|
74
|
+
overflowWrap: 'break-word',
|
|
75
|
+
inlineSize: 'calc( 100% - 40px )'
|
|
74
76
|
};
|
|
75
77
|
});
|
|
76
78
|
|
|
@@ -17,24 +17,30 @@ var _StatusBadge = require("../StatusBadge/StatusBadge");
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var SubnavWrapper = _theming.styled.div(function (_ref) {
|
|
21
21
|
var theme = _ref.theme;
|
|
22
22
|
return {
|
|
23
23
|
background: theme.background.app,
|
|
24
24
|
borderBottom: "1px solid ".concat(theme.appBorderColor),
|
|
25
|
-
height: 40,
|
|
26
|
-
display: 'flex',
|
|
27
|
-
alignItems: 'center',
|
|
28
|
-
justifyContent: 'space-between',
|
|
29
|
-
paddingLeft: 15,
|
|
30
25
|
position: 'sticky',
|
|
31
26
|
top: 0,
|
|
32
27
|
zIndex: 1
|
|
33
28
|
};
|
|
34
29
|
});
|
|
35
30
|
|
|
36
|
-
var
|
|
31
|
+
var StyledSubnav = _theming.styled.nav(function (_ref2) {
|
|
37
32
|
var theme = _ref2.theme;
|
|
33
|
+
return {
|
|
34
|
+
height: 40,
|
|
35
|
+
display: 'flex',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
justifyContent: 'space-between',
|
|
38
|
+
paddingLeft: 15
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
var StyledButton = (0, _theming.styled)(_components.Button)(function (_ref3) {
|
|
43
|
+
var theme = _ref3.theme;
|
|
38
44
|
return {
|
|
39
45
|
borderRadius: 4,
|
|
40
46
|
padding: 6,
|
|
@@ -46,14 +52,14 @@ var StyledButton = (0, _theming.styled)(_components.Button)(function (_ref2) {
|
|
|
46
52
|
}
|
|
47
53
|
};
|
|
48
54
|
});
|
|
49
|
-
var Note = (0, _theming.styled)(_components.TooltipNote)(function (
|
|
50
|
-
var theme =
|
|
55
|
+
var Note = (0, _theming.styled)(_components.TooltipNote)(function (_ref4) {
|
|
56
|
+
var theme = _ref4.theme;
|
|
51
57
|
return {
|
|
52
58
|
fontFamily: theme.typography.fonts.base
|
|
53
59
|
};
|
|
54
60
|
});
|
|
55
|
-
var StyledIconButton = (0, _theming.styled)(_components.IconButton)(function (
|
|
56
|
-
var theme =
|
|
61
|
+
var StyledIconButton = (0, _theming.styled)(_components.IconButton)(function (_ref5) {
|
|
62
|
+
var theme = _ref5.theme;
|
|
57
63
|
return {
|
|
58
64
|
color: theme.color.mediumdark,
|
|
59
65
|
margin: '0 3px'
|
|
@@ -63,12 +69,13 @@ exports.StyledIconButton = StyledIconButton;
|
|
|
63
69
|
var StyledSeparator = (0, _theming.styled)(_components.Separator)({
|
|
64
70
|
marginTop: 0
|
|
65
71
|
});
|
|
66
|
-
var StyledLocation = (0, _theming.styled)(_components.P)(function (
|
|
67
|
-
var theme =
|
|
72
|
+
var StyledLocation = (0, _theming.styled)(_components.P)(function (_ref6) {
|
|
73
|
+
var theme = _ref6.theme;
|
|
68
74
|
return {
|
|
69
75
|
color: theme.textMutedColor,
|
|
70
76
|
justifyContent: 'flex-end',
|
|
71
77
|
textAlign: 'right',
|
|
78
|
+
whiteSpace: 'nowrap',
|
|
72
79
|
marginTop: 'auto',
|
|
73
80
|
marginBottom: 1,
|
|
74
81
|
paddingRight: 15,
|
|
@@ -90,79 +97,64 @@ var JumpToEndButton = (0, _theming.styled)(StyledButton)({
|
|
|
90
97
|
marginBottom: 1,
|
|
91
98
|
lineHeight: '12px'
|
|
92
99
|
});
|
|
93
|
-
var withTooltipModifiers = [{
|
|
94
|
-
name: 'preventOverflow',
|
|
95
|
-
options: {
|
|
96
|
-
padding: 0
|
|
97
|
-
}
|
|
98
|
-
}, {
|
|
99
|
-
name: 'offset',
|
|
100
|
-
options: {
|
|
101
|
-
offset: [0, -2]
|
|
102
|
-
}
|
|
103
|
-
}];
|
|
104
100
|
|
|
105
|
-
var Subnav = function Subnav(
|
|
106
|
-
var controls =
|
|
107
|
-
controlStates =
|
|
108
|
-
status =
|
|
109
|
-
storyFileName =
|
|
110
|
-
onScrollToEnd =
|
|
101
|
+
var Subnav = function Subnav(_ref7) {
|
|
102
|
+
var controls = _ref7.controls,
|
|
103
|
+
controlStates = _ref7.controlStates,
|
|
104
|
+
status = _ref7.status,
|
|
105
|
+
storyFileName = _ref7.storyFileName,
|
|
106
|
+
onScrollToEnd = _ref7.onScrollToEnd;
|
|
111
107
|
var buttonText = status === _instrumenter.CallStates.ERROR ? 'Scroll to error' : 'Scroll to end';
|
|
112
|
-
return /*#__PURE__*/_react.default.createElement(_components.Bar, null, /*#__PURE__*/_react.default.createElement(StyledSubnav, null, /*#__PURE__*/_react.default.createElement(Group, null, /*#__PURE__*/_react.default.createElement(_StatusBadge.StatusBadge, {
|
|
108
|
+
return /*#__PURE__*/_react.default.createElement(SubnavWrapper, null, /*#__PURE__*/_react.default.createElement(_components.Bar, null, /*#__PURE__*/_react.default.createElement(StyledSubnav, null, /*#__PURE__*/_react.default.createElement(Group, null, /*#__PURE__*/_react.default.createElement(_StatusBadge.StatusBadge, {
|
|
113
109
|
status: status
|
|
114
110
|
}), /*#__PURE__*/_react.default.createElement(JumpToEndButton, {
|
|
115
111
|
onClick: onScrollToEnd,
|
|
116
112
|
disabled: !onScrollToEnd
|
|
117
113
|
}, buttonText), /*#__PURE__*/_react.default.createElement(StyledSeparator, null), /*#__PURE__*/_react.default.createElement(_components.WithTooltip, {
|
|
118
|
-
modifiers: withTooltipModifiers,
|
|
119
114
|
hasChrome: false,
|
|
120
|
-
trigger: controlStates.start ? 'hover' : 'none',
|
|
121
115
|
tooltip: /*#__PURE__*/_react.default.createElement(Note, {
|
|
122
116
|
note: "Go to start"
|
|
123
117
|
})
|
|
124
118
|
}, /*#__PURE__*/_react.default.createElement(RewindButton, {
|
|
119
|
+
containsIcon: true,
|
|
125
120
|
onClick: controls.start,
|
|
126
121
|
disabled: !controlStates.start
|
|
127
122
|
}, /*#__PURE__*/_react.default.createElement(_components.Icons, {
|
|
128
123
|
icon: "rewind"
|
|
129
124
|
}))), /*#__PURE__*/_react.default.createElement(_components.WithTooltip, {
|
|
130
|
-
modifiers: withTooltipModifiers,
|
|
131
125
|
hasChrome: false,
|
|
132
|
-
trigger: controlStates.back ? 'hover' : 'none',
|
|
133
126
|
tooltip: /*#__PURE__*/_react.default.createElement(Note, {
|
|
134
127
|
note: "Go back"
|
|
135
128
|
})
|
|
136
129
|
}, /*#__PURE__*/_react.default.createElement(StyledIconButton, {
|
|
130
|
+
containsIcon: true,
|
|
137
131
|
onClick: controls.back,
|
|
138
132
|
disabled: !controlStates.back
|
|
139
133
|
}, /*#__PURE__*/_react.default.createElement(_components.Icons, {
|
|
140
134
|
icon: "playback"
|
|
141
135
|
}))), /*#__PURE__*/_react.default.createElement(_components.WithTooltip, {
|
|
142
|
-
modifiers: withTooltipModifiers,
|
|
143
136
|
hasChrome: false,
|
|
144
|
-
trigger: controlStates.next ? 'hover' : 'none',
|
|
145
137
|
tooltip: /*#__PURE__*/_react.default.createElement(Note, {
|
|
146
138
|
note: "Go forward"
|
|
147
139
|
})
|
|
148
140
|
}, /*#__PURE__*/_react.default.createElement(StyledIconButton, {
|
|
141
|
+
containsIcon: true,
|
|
149
142
|
onClick: controls.next,
|
|
150
143
|
disabled: !controlStates.next
|
|
151
144
|
}, /*#__PURE__*/_react.default.createElement(_components.Icons, {
|
|
152
145
|
icon: "playnext"
|
|
153
146
|
}))), /*#__PURE__*/_react.default.createElement(_components.WithTooltip, {
|
|
154
|
-
modifiers: withTooltipModifiers,
|
|
155
|
-
trigger: controlStates.end ? 'hover' : 'none',
|
|
156
147
|
hasChrome: false,
|
|
157
148
|
tooltip: /*#__PURE__*/_react.default.createElement(Note, {
|
|
158
149
|
note: "Go to end"
|
|
159
150
|
})
|
|
160
151
|
}, /*#__PURE__*/_react.default.createElement(StyledIconButton, {
|
|
152
|
+
containsIcon: true,
|
|
161
153
|
onClick: controls.end,
|
|
162
154
|
disabled: !controlStates.end
|
|
163
155
|
}, /*#__PURE__*/_react.default.createElement(_components.Icons, {
|
|
164
156
|
icon: "fastforward"
|
|
165
|
-
})))), storyFileName && /*#__PURE__*/_react.default.createElement(Group, null, /*#__PURE__*/_react.default.createElement(StyledLocation, null, storyFileName))));
|
|
157
|
+
})))), storyFileName && /*#__PURE__*/_react.default.createElement(Group, null, /*#__PURE__*/_react.default.createElement(StyledLocation, null, storyFileName)))));
|
|
166
158
|
};
|
|
167
159
|
|
|
168
160
|
exports.Subnav = Subnav;
|
|
@@ -33,7 +33,9 @@ import { StatusIcon } from '../StatusIcon/StatusIcon';
|
|
|
33
33
|
var MethodCallWrapper = styled.div(function () {
|
|
34
34
|
return {
|
|
35
35
|
fontFamily: typography.fonts.mono,
|
|
36
|
-
fontSize: typography.size.s1
|
|
36
|
+
fontSize: typography.size.s1,
|
|
37
|
+
overflowWrap: 'break-word',
|
|
38
|
+
inlineSize: 'calc( 100% - 40px )'
|
|
37
39
|
};
|
|
38
40
|
});
|
|
39
41
|
var RowContainer = styled('div', {
|
|
@@ -3,23 +3,28 @@ import { Button, IconButton, Icons, Separator, P, TooltipNote, WithTooltip, Bar
|
|
|
3
3
|
import { CallStates } from '@storybook/instrumenter';
|
|
4
4
|
import { styled } from '@storybook/theming';
|
|
5
5
|
import { StatusBadge } from '../StatusBadge/StatusBadge';
|
|
6
|
-
var
|
|
6
|
+
var SubnavWrapper = styled.div(function (_ref) {
|
|
7
7
|
var theme = _ref.theme;
|
|
8
8
|
return {
|
|
9
9
|
background: theme.background.app,
|
|
10
10
|
borderBottom: "1px solid ".concat(theme.appBorderColor),
|
|
11
|
-
height: 40,
|
|
12
|
-
display: 'flex',
|
|
13
|
-
alignItems: 'center',
|
|
14
|
-
justifyContent: 'space-between',
|
|
15
|
-
paddingLeft: 15,
|
|
16
11
|
position: 'sticky',
|
|
17
12
|
top: 0,
|
|
18
13
|
zIndex: 1
|
|
19
14
|
};
|
|
20
15
|
});
|
|
21
|
-
var
|
|
16
|
+
var StyledSubnav = styled.nav(function (_ref2) {
|
|
22
17
|
var theme = _ref2.theme;
|
|
18
|
+
return {
|
|
19
|
+
height: 40,
|
|
20
|
+
display: 'flex',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
justifyContent: 'space-between',
|
|
23
|
+
paddingLeft: 15
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
var StyledButton = styled(Button)(function (_ref3) {
|
|
27
|
+
var theme = _ref3.theme;
|
|
23
28
|
return {
|
|
24
29
|
borderRadius: 4,
|
|
25
30
|
padding: 6,
|
|
@@ -31,14 +36,14 @@ var StyledButton = styled(Button)(function (_ref2) {
|
|
|
31
36
|
}
|
|
32
37
|
};
|
|
33
38
|
});
|
|
34
|
-
var Note = styled(TooltipNote)(function (
|
|
35
|
-
var theme =
|
|
39
|
+
var Note = styled(TooltipNote)(function (_ref4) {
|
|
40
|
+
var theme = _ref4.theme;
|
|
36
41
|
return {
|
|
37
42
|
fontFamily: theme.typography.fonts.base
|
|
38
43
|
};
|
|
39
44
|
});
|
|
40
|
-
export var StyledIconButton = styled(IconButton)(function (
|
|
41
|
-
var theme =
|
|
45
|
+
export var StyledIconButton = styled(IconButton)(function (_ref5) {
|
|
46
|
+
var theme = _ref5.theme;
|
|
42
47
|
return {
|
|
43
48
|
color: theme.color.mediumdark,
|
|
44
49
|
margin: '0 3px'
|
|
@@ -47,12 +52,13 @@ export var StyledIconButton = styled(IconButton)(function (_ref4) {
|
|
|
47
52
|
var StyledSeparator = styled(Separator)({
|
|
48
53
|
marginTop: 0
|
|
49
54
|
});
|
|
50
|
-
var StyledLocation = styled(P)(function (
|
|
51
|
-
var theme =
|
|
55
|
+
var StyledLocation = styled(P)(function (_ref6) {
|
|
56
|
+
var theme = _ref6.theme;
|
|
52
57
|
return {
|
|
53
58
|
color: theme.textMutedColor,
|
|
54
59
|
justifyContent: 'flex-end',
|
|
55
60
|
textAlign: 'right',
|
|
61
|
+
whiteSpace: 'nowrap',
|
|
56
62
|
marginTop: 'auto',
|
|
57
63
|
marginBottom: 1,
|
|
58
64
|
paddingRight: 15,
|
|
@@ -72,76 +78,61 @@ var JumpToEndButton = styled(StyledButton)({
|
|
|
72
78
|
marginBottom: 1,
|
|
73
79
|
lineHeight: '12px'
|
|
74
80
|
});
|
|
75
|
-
var
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
name: 'offset',
|
|
82
|
-
options: {
|
|
83
|
-
offset: [0, -2]
|
|
84
|
-
}
|
|
85
|
-
}];
|
|
86
|
-
export var Subnav = function Subnav(_ref6) {
|
|
87
|
-
var controls = _ref6.controls,
|
|
88
|
-
controlStates = _ref6.controlStates,
|
|
89
|
-
status = _ref6.status,
|
|
90
|
-
storyFileName = _ref6.storyFileName,
|
|
91
|
-
onScrollToEnd = _ref6.onScrollToEnd;
|
|
81
|
+
export var Subnav = function Subnav(_ref7) {
|
|
82
|
+
var controls = _ref7.controls,
|
|
83
|
+
controlStates = _ref7.controlStates,
|
|
84
|
+
status = _ref7.status,
|
|
85
|
+
storyFileName = _ref7.storyFileName,
|
|
86
|
+
onScrollToEnd = _ref7.onScrollToEnd;
|
|
92
87
|
var buttonText = status === CallStates.ERROR ? 'Scroll to error' : 'Scroll to end';
|
|
93
|
-
return /*#__PURE__*/React.createElement(Bar, null, /*#__PURE__*/React.createElement(StyledSubnav, null, /*#__PURE__*/React.createElement(Group, null, /*#__PURE__*/React.createElement(StatusBadge, {
|
|
88
|
+
return /*#__PURE__*/React.createElement(SubnavWrapper, null, /*#__PURE__*/React.createElement(Bar, null, /*#__PURE__*/React.createElement(StyledSubnav, null, /*#__PURE__*/React.createElement(Group, null, /*#__PURE__*/React.createElement(StatusBadge, {
|
|
94
89
|
status: status
|
|
95
90
|
}), /*#__PURE__*/React.createElement(JumpToEndButton, {
|
|
96
91
|
onClick: onScrollToEnd,
|
|
97
92
|
disabled: !onScrollToEnd
|
|
98
93
|
}, buttonText), /*#__PURE__*/React.createElement(StyledSeparator, null), /*#__PURE__*/React.createElement(WithTooltip, {
|
|
99
|
-
modifiers: withTooltipModifiers,
|
|
100
94
|
hasChrome: false,
|
|
101
|
-
trigger: controlStates.start ? 'hover' : 'none',
|
|
102
95
|
tooltip: /*#__PURE__*/React.createElement(Note, {
|
|
103
96
|
note: "Go to start"
|
|
104
97
|
})
|
|
105
98
|
}, /*#__PURE__*/React.createElement(RewindButton, {
|
|
99
|
+
containsIcon: true,
|
|
106
100
|
onClick: controls.start,
|
|
107
101
|
disabled: !controlStates.start
|
|
108
102
|
}, /*#__PURE__*/React.createElement(Icons, {
|
|
109
103
|
icon: "rewind"
|
|
110
104
|
}))), /*#__PURE__*/React.createElement(WithTooltip, {
|
|
111
|
-
modifiers: withTooltipModifiers,
|
|
112
105
|
hasChrome: false,
|
|
113
|
-
trigger: controlStates.back ? 'hover' : 'none',
|
|
114
106
|
tooltip: /*#__PURE__*/React.createElement(Note, {
|
|
115
107
|
note: "Go back"
|
|
116
108
|
})
|
|
117
109
|
}, /*#__PURE__*/React.createElement(StyledIconButton, {
|
|
110
|
+
containsIcon: true,
|
|
118
111
|
onClick: controls.back,
|
|
119
112
|
disabled: !controlStates.back
|
|
120
113
|
}, /*#__PURE__*/React.createElement(Icons, {
|
|
121
114
|
icon: "playback"
|
|
122
115
|
}))), /*#__PURE__*/React.createElement(WithTooltip, {
|
|
123
|
-
modifiers: withTooltipModifiers,
|
|
124
116
|
hasChrome: false,
|
|
125
|
-
trigger: controlStates.next ? 'hover' : 'none',
|
|
126
117
|
tooltip: /*#__PURE__*/React.createElement(Note, {
|
|
127
118
|
note: "Go forward"
|
|
128
119
|
})
|
|
129
120
|
}, /*#__PURE__*/React.createElement(StyledIconButton, {
|
|
121
|
+
containsIcon: true,
|
|
130
122
|
onClick: controls.next,
|
|
131
123
|
disabled: !controlStates.next
|
|
132
124
|
}, /*#__PURE__*/React.createElement(Icons, {
|
|
133
125
|
icon: "playnext"
|
|
134
126
|
}))), /*#__PURE__*/React.createElement(WithTooltip, {
|
|
135
|
-
modifiers: withTooltipModifiers,
|
|
136
|
-
trigger: controlStates.end ? 'hover' : 'none',
|
|
137
127
|
hasChrome: false,
|
|
138
128
|
tooltip: /*#__PURE__*/React.createElement(Note, {
|
|
139
129
|
note: "Go to end"
|
|
140
130
|
})
|
|
141
131
|
}, /*#__PURE__*/React.createElement(StyledIconButton, {
|
|
132
|
+
containsIcon: true,
|
|
142
133
|
onClick: controls.end,
|
|
143
134
|
disabled: !controlStates.end
|
|
144
135
|
}, /*#__PURE__*/React.createElement(Icons, {
|
|
145
136
|
icon: "fastforward"
|
|
146
|
-
})))), storyFileName && /*#__PURE__*/React.createElement(Group, null, /*#__PURE__*/React.createElement(StyledLocation, null, storyFileName))));
|
|
137
|
+
})))), storyFileName && /*#__PURE__*/React.createElement(Group, null, /*#__PURE__*/React.createElement(StyledLocation, null, storyFileName)))));
|
|
147
138
|
};
|
|
@@ -7,7 +7,9 @@ import { MethodCall } from '../MethodCall';
|
|
|
7
7
|
import { StatusIcon } from '../StatusIcon/StatusIcon';
|
|
8
8
|
const MethodCallWrapper = styled.div(() => ({
|
|
9
9
|
fontFamily: typography.fonts.mono,
|
|
10
|
-
fontSize: typography.size.s1
|
|
10
|
+
fontSize: typography.size.s1,
|
|
11
|
+
overflowWrap: 'break-word',
|
|
12
|
+
inlineSize: 'calc( 100% - 40px )'
|
|
11
13
|
}));
|
|
12
14
|
const RowContainer = styled('div', {
|
|
13
15
|
shouldForwardProp: prop => !['call'].includes(prop)
|
|
@@ -3,19 +3,23 @@ import { Button, IconButton, Icons, Separator, P, TooltipNote, WithTooltip, Bar
|
|
|
3
3
|
import { CallStates } from '@storybook/instrumenter';
|
|
4
4
|
import { styled } from '@storybook/theming';
|
|
5
5
|
import { StatusBadge } from '../StatusBadge/StatusBadge';
|
|
6
|
-
const
|
|
6
|
+
const SubnavWrapper = styled.div(({
|
|
7
7
|
theme
|
|
8
8
|
}) => ({
|
|
9
9
|
background: theme.background.app,
|
|
10
10
|
borderBottom: `1px solid ${theme.appBorderColor}`,
|
|
11
|
+
position: 'sticky',
|
|
12
|
+
top: 0,
|
|
13
|
+
zIndex: 1
|
|
14
|
+
}));
|
|
15
|
+
const StyledSubnav = styled.nav(({
|
|
16
|
+
theme
|
|
17
|
+
}) => ({
|
|
11
18
|
height: 40,
|
|
12
19
|
display: 'flex',
|
|
13
20
|
alignItems: 'center',
|
|
14
21
|
justifyContent: 'space-between',
|
|
15
|
-
paddingLeft: 15
|
|
16
|
-
position: 'sticky',
|
|
17
|
-
top: 0,
|
|
18
|
-
zIndex: 1
|
|
22
|
+
paddingLeft: 15
|
|
19
23
|
}));
|
|
20
24
|
const StyledButton = styled(Button)(({
|
|
21
25
|
theme
|
|
@@ -49,6 +53,7 @@ const StyledLocation = styled(P)(({
|
|
|
49
53
|
color: theme.textMutedColor,
|
|
50
54
|
justifyContent: 'flex-end',
|
|
51
55
|
textAlign: 'right',
|
|
56
|
+
whiteSpace: 'nowrap',
|
|
52
57
|
marginTop: 'auto',
|
|
53
58
|
marginBottom: 1,
|
|
54
59
|
paddingRight: 15,
|
|
@@ -67,17 +72,6 @@ const JumpToEndButton = styled(StyledButton)({
|
|
|
67
72
|
marginBottom: 1,
|
|
68
73
|
lineHeight: '12px'
|
|
69
74
|
});
|
|
70
|
-
const withTooltipModifiers = [{
|
|
71
|
-
name: 'preventOverflow',
|
|
72
|
-
options: {
|
|
73
|
-
padding: 0
|
|
74
|
-
}
|
|
75
|
-
}, {
|
|
76
|
-
name: 'offset',
|
|
77
|
-
options: {
|
|
78
|
-
offset: [0, -2]
|
|
79
|
-
}
|
|
80
|
-
}];
|
|
81
75
|
export const Subnav = ({
|
|
82
76
|
controls,
|
|
83
77
|
controlStates,
|
|
@@ -86,58 +80,54 @@ export const Subnav = ({
|
|
|
86
80
|
onScrollToEnd
|
|
87
81
|
}) => {
|
|
88
82
|
const buttonText = status === CallStates.ERROR ? 'Scroll to error' : 'Scroll to end';
|
|
89
|
-
return /*#__PURE__*/React.createElement(Bar, null, /*#__PURE__*/React.createElement(StyledSubnav, null, /*#__PURE__*/React.createElement(Group, null, /*#__PURE__*/React.createElement(StatusBadge, {
|
|
83
|
+
return /*#__PURE__*/React.createElement(SubnavWrapper, null, /*#__PURE__*/React.createElement(Bar, null, /*#__PURE__*/React.createElement(StyledSubnav, null, /*#__PURE__*/React.createElement(Group, null, /*#__PURE__*/React.createElement(StatusBadge, {
|
|
90
84
|
status: status
|
|
91
85
|
}), /*#__PURE__*/React.createElement(JumpToEndButton, {
|
|
92
86
|
onClick: onScrollToEnd,
|
|
93
87
|
disabled: !onScrollToEnd
|
|
94
88
|
}, buttonText), /*#__PURE__*/React.createElement(StyledSeparator, null), /*#__PURE__*/React.createElement(WithTooltip, {
|
|
95
|
-
modifiers: withTooltipModifiers,
|
|
96
89
|
hasChrome: false,
|
|
97
|
-
trigger: controlStates.start ? 'hover' : 'none',
|
|
98
90
|
tooltip: /*#__PURE__*/React.createElement(Note, {
|
|
99
91
|
note: "Go to start"
|
|
100
92
|
})
|
|
101
93
|
}, /*#__PURE__*/React.createElement(RewindButton, {
|
|
94
|
+
containsIcon: true,
|
|
102
95
|
onClick: controls.start,
|
|
103
96
|
disabled: !controlStates.start
|
|
104
97
|
}, /*#__PURE__*/React.createElement(Icons, {
|
|
105
98
|
icon: "rewind"
|
|
106
99
|
}))), /*#__PURE__*/React.createElement(WithTooltip, {
|
|
107
|
-
modifiers: withTooltipModifiers,
|
|
108
100
|
hasChrome: false,
|
|
109
|
-
trigger: controlStates.back ? 'hover' : 'none',
|
|
110
101
|
tooltip: /*#__PURE__*/React.createElement(Note, {
|
|
111
102
|
note: "Go back"
|
|
112
103
|
})
|
|
113
104
|
}, /*#__PURE__*/React.createElement(StyledIconButton, {
|
|
105
|
+
containsIcon: true,
|
|
114
106
|
onClick: controls.back,
|
|
115
107
|
disabled: !controlStates.back
|
|
116
108
|
}, /*#__PURE__*/React.createElement(Icons, {
|
|
117
109
|
icon: "playback"
|
|
118
110
|
}))), /*#__PURE__*/React.createElement(WithTooltip, {
|
|
119
|
-
modifiers: withTooltipModifiers,
|
|
120
111
|
hasChrome: false,
|
|
121
|
-
trigger: controlStates.next ? 'hover' : 'none',
|
|
122
112
|
tooltip: /*#__PURE__*/React.createElement(Note, {
|
|
123
113
|
note: "Go forward"
|
|
124
114
|
})
|
|
125
115
|
}, /*#__PURE__*/React.createElement(StyledIconButton, {
|
|
116
|
+
containsIcon: true,
|
|
126
117
|
onClick: controls.next,
|
|
127
118
|
disabled: !controlStates.next
|
|
128
119
|
}, /*#__PURE__*/React.createElement(Icons, {
|
|
129
120
|
icon: "playnext"
|
|
130
121
|
}))), /*#__PURE__*/React.createElement(WithTooltip, {
|
|
131
|
-
modifiers: withTooltipModifiers,
|
|
132
|
-
trigger: controlStates.end ? 'hover' : 'none',
|
|
133
122
|
hasChrome: false,
|
|
134
123
|
tooltip: /*#__PURE__*/React.createElement(Note, {
|
|
135
124
|
note: "Go to end"
|
|
136
125
|
})
|
|
137
126
|
}, /*#__PURE__*/React.createElement(StyledIconButton, {
|
|
127
|
+
containsIcon: true,
|
|
138
128
|
onClick: controls.end,
|
|
139
129
|
disabled: !controlStates.end
|
|
140
130
|
}, /*#__PURE__*/React.createElement(Icons, {
|
|
141
131
|
icon: "fastforward"
|
|
142
|
-
})))), storyFileName && /*#__PURE__*/React.createElement(Group, null, /*#__PURE__*/React.createElement(StyledLocation, null, storyFileName))));
|
|
132
|
+
})))), storyFileName && /*#__PURE__*/React.createElement(Group, null, /*#__PURE__*/React.createElement(StyledLocation, null, storyFileName)))));
|
|
143
133
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/addon-interactions",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.5.0-alpha.2",
|
|
4
4
|
"description": "Automate, test and debug user interactions",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook-addons",
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
"prepare": "node ../../scripts/prepare.js"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@storybook/addons": "6.
|
|
45
|
-
"@storybook/api": "6.
|
|
46
|
-
"@storybook/components": "6.
|
|
47
|
-
"@storybook/core-common": "6.
|
|
48
|
-
"@storybook/core-events": "6.
|
|
44
|
+
"@storybook/addons": "6.5.0-alpha.2",
|
|
45
|
+
"@storybook/api": "6.5.0-alpha.2",
|
|
46
|
+
"@storybook/components": "6.5.0-alpha.2",
|
|
47
|
+
"@storybook/core-common": "6.5.0-alpha.2",
|
|
48
|
+
"@storybook/core-events": "6.5.0-alpha.2",
|
|
49
49
|
"@storybook/csf": "0.0.2--canary.87bc651.0",
|
|
50
|
-
"@storybook/instrumenter": "6.
|
|
51
|
-
"@storybook/theming": "6.
|
|
50
|
+
"@storybook/instrumenter": "6.5.0-alpha.2",
|
|
51
|
+
"@storybook/theming": "6.5.0-alpha.2",
|
|
52
52
|
"global": "^4.4.0",
|
|
53
53
|
"jest-mock": "^27.0.6",
|
|
54
54
|
"polished": "^4.0.5",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "ca9d89393f36d156e34819fe120eb7e6819245f4",
|
|
78
78
|
"sbmodern": "dist/modern/index.js",
|
|
79
79
|
"storybook": {
|
|
80
80
|
"displayName": "Interactions",
|