@storybook/addon-interactions 6.5.0-alpha.6 → 6.5.0-alpha.62

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.
Files changed (66) hide show
  1. package/dist/cjs/Panel.js +31 -21
  2. package/dist/cjs/Panel.stories.js +3 -3
  3. package/dist/cjs/Tool.js +8 -6
  4. package/dist/cjs/components/AccountForm/AccountForm.js +8 -8
  5. package/dist/cjs/components/AccountForm/addon-interactions.stories.js +8 -6
  6. package/dist/cjs/components/Interaction/Interaction.js +8 -6
  7. package/dist/cjs/components/Interaction/Interaction.stories.js +3 -3
  8. package/dist/cjs/components/List.js +9 -7
  9. package/dist/cjs/components/MatcherResult.js +8 -8
  10. package/dist/cjs/components/MatcherResult.stories.js +1 -1
  11. package/dist/cjs/components/MethodCall.js +20 -15
  12. package/dist/cjs/components/MethodCall.stories.js +10 -6
  13. package/dist/cjs/components/StatusBadge/StatusBadge.stories.js +1 -1
  14. package/dist/cjs/components/StatusIcon/StatusIcon.stories.js +1 -1
  15. package/dist/cjs/components/Subnav/Subnav.stories.js +1 -1
  16. package/dist/cjs/constants.js +1 -1
  17. package/dist/cjs/{register.js → manager.js} +0 -0
  18. package/dist/cjs/preset/checkActionsLoaded.js +1 -29
  19. package/dist/cjs/preset/{argsEnhancers.js → preview.js} +11 -7
  20. package/dist/cjs/theme.js +1 -1
  21. package/dist/esm/Panel.js +30 -20
  22. package/dist/esm/Panel.stories.js +1 -1
  23. package/dist/esm/Tool.js +3 -2
  24. package/dist/esm/components/AccountForm/AccountForm.js +6 -5
  25. package/dist/esm/components/AccountForm/addon-interactions.stories.js +4 -3
  26. package/dist/esm/components/Interaction/Interaction.js +3 -2
  27. package/dist/esm/components/Interaction/Interaction.stories.js +1 -1
  28. package/dist/esm/components/List.js +3 -2
  29. package/dist/esm/components/MatcherResult.js +4 -4
  30. package/dist/esm/components/MethodCall.js +19 -14
  31. package/dist/esm/components/MethodCall.stories.js +8 -4
  32. package/dist/esm/{register.js → manager.js} +0 -0
  33. package/dist/esm/preset/checkActionsLoaded.js +2 -4
  34. package/dist/esm/preset/{argsEnhancers.js → preview.js} +7 -4
  35. package/dist/modern/Panel.js +21 -9
  36. package/dist/modern/components/AccountForm/AccountForm.js +2 -2
  37. package/dist/modern/components/MethodCall.js +12 -8
  38. package/dist/modern/{register.js → manager.js} +0 -0
  39. package/dist/modern/preset/checkActionsLoaded.js +2 -2
  40. package/dist/modern/preset/{argsEnhancers.js → preview.js} +3 -1
  41. package/dist/ts3.4/Tool.d.ts +0 -1
  42. package/dist/ts3.4/components/Interaction/Interaction.d.ts +0 -1
  43. package/dist/ts3.4/components/MatcherResult.d.ts +0 -1
  44. package/dist/ts3.4/components/MethodCall.d.ts +0 -1
  45. package/dist/ts3.4/components/Subnav/Subnav.d.ts +1 -1
  46. package/dist/ts3.4/{register.d.ts → manager.d.ts} +0 -0
  47. package/dist/ts3.4/preset/{argsEnhancers.d.ts → preview.d.ts} +0 -0
  48. package/dist/ts3.9/Tool.d.ts +0 -1
  49. package/dist/ts3.9/components/Interaction/Interaction.d.ts +0 -1
  50. package/dist/ts3.9/components/MatcherResult.d.ts +0 -1
  51. package/dist/ts3.9/components/MethodCall.d.ts +0 -1
  52. package/dist/ts3.9/components/Subnav/Subnav.d.ts +1 -1
  53. package/dist/ts3.9/{register.d.ts → manager.d.ts} +0 -0
  54. package/dist/ts3.9/preset/preview.d.ts +3 -0
  55. package/manager.js +1 -0
  56. package/package.json +17 -15
  57. package/preset.js +4 -9
  58. package/preview.js +1 -0
  59. package/register.js +6 -1
  60. package/dist/cjs/components/AccountForm/addon-interactions.stories.mdx +0 -33
  61. package/dist/cjs/typings.d.js +0 -1
  62. package/dist/esm/components/AccountForm/addon-interactions.stories.mdx +0 -33
  63. package/dist/esm/typings.d.js +0 -0
  64. package/dist/modern/components/AccountForm/addon-interactions.stories.mdx +0 -33
  65. package/dist/modern/typings.d.js +0 -0
  66. package/dist/ts3.9/preset/argsEnhancers.d.ts +0 -3
@@ -4,7 +4,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
4
4
 
5
5
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
6
 
7
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
7
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8
8
 
9
9
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
10
10
 
@@ -17,15 +17,19 @@ import "core-js/modules/es.regexp.to-string.js";
17
17
  import "core-js/modules/es.symbol.js";
18
18
  import "core-js/modules/es.symbol.description.js";
19
19
  import "core-js/modules/es.object.to-string.js";
20
+ import "core-js/modules/es.array.iterator.js";
20
21
  import "core-js/modules/es.map.js";
21
22
  import "core-js/modules/es.string.iterator.js";
22
- import "core-js/modules/es.array.iterator.js";
23
23
  import "core-js/modules/web.dom-collections.iterator.js";
24
24
  import "core-js/modules/es.symbol.iterator.js";
25
25
  import "core-js/modules/es.array.from.js";
26
26
  import "core-js/modules/es.array.slice.js";
27
27
  import "core-js/modules/es.function.name.js";
28
28
 
29
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
30
+
31
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
32
+
29
33
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
30
34
 
31
35
  import React from 'react';
@@ -53,9 +57,9 @@ export default {
53
57
  }
54
58
  };
55
59
 
56
- var FooBar = function FooBar() {
60
+ var FooBar = /*#__PURE__*/_createClass(function FooBar() {
57
61
  _classCallCheck(this, FooBar);
58
- };
62
+ });
59
63
 
60
64
  export var Args = function Args() {
61
65
  return /*#__PURE__*/React.createElement("div", {
File without changes
@@ -1,7 +1,5 @@
1
1
  import "core-js/modules/es.array.join.js";
2
- import "core-js/modules/es.promise.js";
3
- import "core-js/modules/es.object.to-string.js";
4
- import { checkAddonOrder } from '@storybook/core-common';
2
+ import { checkAddonOrder, serverRequire } from '@storybook/core-common';
5
3
  import path from 'path';
6
4
  export var checkActionsLoaded = function checkActionsLoaded(configDir) {
7
5
  checkAddonOrder({
@@ -15,7 +13,7 @@ export var checkActionsLoaded = function checkActionsLoaded(configDir) {
15
13
  },
16
14
  configFile: path.isAbsolute(configDir) ? path.join(configDir, 'main') : path.join(process.cwd(), configDir, 'main'),
17
15
  getConfig: function getConfig(configFile) {
18
- return import(configFile);
16
+ return serverRequire(configFile);
19
17
  }
20
18
  });
21
19
  };
@@ -6,25 +6,28 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
6
6
 
7
7
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
8
8
 
9
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
9
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
10
10
 
11
11
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
12
 
13
+ import "core-js/modules/es.object.to-string.js";
13
14
  import "core-js/modules/es.object.entries.js";
14
15
  import "core-js/modules/es.function.name.js";
15
16
  import "core-js/modules/es.symbol.js";
16
17
  import "core-js/modules/es.symbol.description.js";
17
- import "core-js/modules/es.object.to-string.js";
18
18
  import "core-js/modules/es.symbol.iterator.js";
19
- import "core-js/modules/es.string.iterator.js";
20
19
  import "core-js/modules/es.array.iterator.js";
20
+ import "core-js/modules/es.string.iterator.js";
21
21
  import "core-js/modules/web.dom-collections.iterator.js";
22
22
  import "core-js/modules/es.array.slice.js";
23
23
  import "core-js/modules/es.array.from.js";
24
+ import "core-js/modules/es.regexp.exec.js";
24
25
  import { addons } from '@storybook/addons';
25
26
  import { FORCE_REMOUNT, STORY_RENDER_PHASE_CHANGED } from '@storybook/core-events';
26
27
  import { instrument } from '@storybook/instrumenter';
27
- import { fn } from 'jest-mock'; // Aliasing `fn` to `action` here, so we get a more descriptive label in the UI.
28
+ import { ModuleMocker } from 'jest-mock';
29
+ var JestMock = new ModuleMocker(global);
30
+ var fn = JestMock.fn.bind(JestMock); // Aliasing `fn` to `action` here, so we get a more descriptive label in the UI.
28
31
 
29
32
  var _instrument = instrument({
30
33
  action: fn
@@ -1,3 +1,6 @@
1
+ const _excluded = ["calls", "controls", "controlStates", "interactions", "fileName", "hasException", "isPlaying", "onScrollToEnd", "endRef"],
2
+ _excluded2 = ["status"];
3
+
1
4
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
5
 
3
6
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -32,7 +35,7 @@ const TabStatus = ({
32
35
  return container && /*#__PURE__*/ReactDOM.createPortal(children, container);
33
36
  };
34
37
 
35
- export const AddonPanelPure = /*#__PURE__*/React.memo((_ref) => {
38
+ export const AddonPanelPure = /*#__PURE__*/React.memo(_ref => {
36
39
  let {
37
40
  calls,
38
41
  controls,
@@ -44,7 +47,7 @@ export const AddonPanelPure = /*#__PURE__*/React.memo((_ref) => {
44
47
  onScrollToEnd,
45
48
  endRef
46
49
  } = _ref,
47
- panelProps = _objectWithoutPropertiesLoose(_ref, ["calls", "controls", "controlStates", "interactions", "fileName", "hasException", "isPlaying", "onScrollToEnd", "endRef"]);
50
+ panelProps = _objectWithoutPropertiesLoose(_ref, _excluded);
48
51
 
49
52
  return /*#__PURE__*/React.createElement(AddonPanel, panelProps, controlStates.debugger && interactions.length > 0 && /*#__PURE__*/React.createElement(Subnav, {
50
53
  controls: controls,
@@ -75,8 +78,8 @@ export const Panel = props => {
75
78
 
76
79
  const calls = React.useRef(new Map());
77
80
 
78
- const setCall = (_ref2) => {
79
- let call = _objectWithoutPropertiesLoose(_ref2, ["status"]);
81
+ const setCall = _ref2 => {
82
+ let call = _objectWithoutPropertiesLoose(_ref2, _excluded2);
80
83
 
81
84
  return calls.current.set(call.id, call);
82
85
  };
@@ -90,11 +93,20 @@ export const Panel = props => {
90
93
  }));
91
94
  const endRef = React.useRef();
92
95
  React.useEffect(() => {
93
- const observer = new global.window.IntersectionObserver(([end]) => setScrollTarget(end.isIntersecting ? undefined : end.target), {
94
- root: global.window.document.querySelector('#panel-tab-content')
95
- });
96
- if (endRef.current) observer.observe(endRef.current);
97
- return () => observer.disconnect();
96
+ let observer;
97
+
98
+ if (global.window.IntersectionObserver) {
99
+ observer = new global.window.IntersectionObserver(([end]) => setScrollTarget(end.isIntersecting ? undefined : end.target), {
100
+ root: global.window.document.querySelector('#panel-tab-content')
101
+ });
102
+ if (endRef.current) observer.observe(endRef.current);
103
+ }
104
+
105
+ return () => {
106
+ var _observer;
107
+
108
+ return (_observer = observer) === null || _observer === void 0 ? void 0 : _observer.disconnect();
109
+ };
98
110
  }, []);
99
111
  const emit = useChannel({
100
112
  [EVENTS.CALL]: setCall,
@@ -1,9 +1,9 @@
1
1
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
2
 
3
+ /* eslint-disable import/no-extraneous-dependencies */
3
4
  import { Icons, WithTooltip } from '@storybook/components';
4
5
  import { keyframes, styled } from '@storybook/theming';
5
- import { ErrorMessage, Field as FormikInput, Form as FormikForm, Formik // eslint-disable-next-line import/no-extraneous-dependencies
6
- } from 'formik';
6
+ import { ErrorMessage, Field as FormikInput, Form as FormikForm, Formik } from 'formik';
7
7
  import React, { useCallback, useState } from 'react';
8
8
  const errorMap = {
9
9
  email: {
@@ -1,3 +1,7 @@
1
+ const _excluded = ["value", "nested", "callsById"],
2
+ _excluded2 = ["value"],
3
+ _excluded3 = ["value"],
4
+ _excluded4 = ["value"];
1
5
  import "core-js/modules/es.array.reduce.js";
2
6
 
3
7
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
@@ -93,14 +97,14 @@ const interleave = (nodes, separator) => nodes.flatMap((node, index) => index ==
93
97
  key: `sep${index}`
94
98
  })]);
95
99
 
96
- export const Node = (_ref) => {
100
+ export const Node = _ref => {
97
101
  var _value$constructor, _value$constructor2;
98
102
 
99
103
  let {
100
104
  value,
101
105
  callsById
102
106
  } = _ref,
103
- props = _objectWithoutPropertiesLoose(_ref, ["value", "nested", "callsById"]);
107
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
104
108
 
105
109
  switch (true) {
106
110
  case value === null:
@@ -194,11 +198,11 @@ export const UndefinedNode = props => {
194
198
  }
195
199
  }, props), "undefined");
196
200
  };
197
- export const StringNode = (_ref2) => {
201
+ export const StringNode = _ref2 => {
198
202
  let {
199
203
  value
200
204
  } = _ref2,
201
- props = _objectWithoutPropertiesLoose(_ref2, ["value"]);
205
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
202
206
 
203
207
  const colors = useThemeColors();
204
208
  return /*#__PURE__*/React.createElement("span", _extends({
@@ -207,11 +211,11 @@ export const StringNode = (_ref2) => {
207
211
  }
208
212
  }, props), JSON.stringify(ellipsize(value, 50)));
209
213
  };
210
- export const NumberNode = (_ref3) => {
214
+ export const NumberNode = _ref3 => {
211
215
  let {
212
216
  value
213
217
  } = _ref3,
214
- props = _objectWithoutPropertiesLoose(_ref3, ["value"]);
218
+ props = _objectWithoutPropertiesLoose(_ref3, _excluded3);
215
219
 
216
220
  const colors = useThemeColors();
217
221
  return /*#__PURE__*/React.createElement("span", _extends({
@@ -220,11 +224,11 @@ export const NumberNode = (_ref3) => {
220
224
  }
221
225
  }, props), value);
222
226
  };
223
- export const BooleanNode = (_ref4) => {
227
+ export const BooleanNode = _ref4 => {
224
228
  let {
225
229
  value
226
230
  } = _ref4,
227
- props = _objectWithoutPropertiesLoose(_ref4, ["value"]);
231
+ props = _objectWithoutPropertiesLoose(_ref4, _excluded4);
228
232
 
229
233
  const colors = useThemeColors();
230
234
  return /*#__PURE__*/React.createElement("span", _extends({
File without changes
@@ -1,4 +1,4 @@
1
- import { checkAddonOrder } from '@storybook/core-common';
1
+ import { checkAddonOrder, serverRequire } from '@storybook/core-common';
2
2
  import path from 'path';
3
3
  export const checkActionsLoaded = configDir => {
4
4
  checkAddonOrder({
@@ -11,6 +11,6 @@ export const checkActionsLoaded = configDir => {
11
11
  inEssentials: false
12
12
  },
13
13
  configFile: path.isAbsolute(configDir) ? path.join(configDir, 'main') : path.join(process.cwd(), configDir, 'main'),
14
- getConfig: configFile => import(configFile)
14
+ getConfig: configFile => serverRequire(configFile)
15
15
  });
16
16
  };
@@ -2,7 +2,9 @@ import "core-js/modules/es.array.reduce.js";
2
2
  import { addons } from '@storybook/addons';
3
3
  import { FORCE_REMOUNT, STORY_RENDER_PHASE_CHANGED } from '@storybook/core-events';
4
4
  import { instrument } from '@storybook/instrumenter';
5
- import { fn } from 'jest-mock'; // Aliasing `fn` to `action` here, so we get a more descriptive label in the UI.
5
+ import { ModuleMocker } from 'jest-mock';
6
+ const JestMock = new ModuleMocker(global);
7
+ const fn = JestMock.fn.bind(JestMock); // Aliasing `fn` to `action` here, so we get a more descriptive label in the UI.
6
8
 
7
9
  const {
8
10
  action
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const Tool: () => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Call, ControlStates } from '@storybook/instrumenter';
3
2
  import { Controls } from '../../Panel';
4
3
  export declare const Interaction: ({ call, callsById, controls, controlStates, }: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const Received: ({ value, parsed }: {
3
2
  value: any;
4
3
  parsed?: boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Call, ElementRef } from '@storybook/instrumenter';
3
2
  export declare const Node: ({ value, nested, callsById, ...props }: {
4
3
  [props: string]: any;
@@ -8,5 +8,5 @@ export interface SubnavProps {
8
8
  storyFileName?: string;
9
9
  onScrollToEnd?: () => void;
10
10
  }
11
- export declare const StyledIconButton: import("@emotion/styled-base").StyledComponent<any, Pick<any, string | number | symbol>, import("@storybook/theming").Theme>;
11
+ export declare const StyledIconButton: import("@storybook/theming").StyledComponent<any, Pick<any, string | number | symbol>, import("@storybook/theming").Theme>;
12
12
  export declare const Subnav: React.FC<SubnavProps>;
File without changes
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const Tool: () => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Call, ControlStates } from '@storybook/instrumenter';
3
2
  import { Controls } from '../../Panel';
4
3
  export declare const Interaction: ({ call, callsById, controls, controlStates, }: {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export declare const Received: ({ value, parsed }: {
3
2
  value: any;
4
3
  parsed?: boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Call, ElementRef } from '@storybook/instrumenter';
3
2
  export declare const Node: ({ value, nested, callsById, ...props }: {
4
3
  [props: string]: any;
@@ -8,5 +8,5 @@ export interface SubnavProps {
8
8
  storyFileName?: string;
9
9
  onScrollToEnd?: () => void;
10
10
  }
11
- export declare const StyledIconButton: import("@emotion/styled-base").StyledComponent<any, Pick<any, string | number | symbol>, import("@storybook/theming").Theme>;
11
+ export declare const StyledIconButton: import("@storybook/theming").StyledComponent<any, Pick<any, string | number | symbol>, import("@storybook/theming").Theme>;
12
12
  export declare const Subnav: React.FC<SubnavProps>;
File without changes
@@ -0,0 +1,3 @@
1
+ import type { Args } from '@storybook/addons';
2
+ import type { AnyFramework, ArgsEnhancer } from '@storybook/csf';
3
+ export declare const argsEnhancers: ArgsEnhancer<AnyFramework, Args>[];
package/manager.js ADDED
@@ -0,0 +1 @@
1
+ import './dist/esm/manager';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-interactions",
3
- "version": "6.5.0-alpha.6",
3
+ "version": "6.5.0-alpha.62",
4
4
  "description": "Automate, test and debug user interactions",
5
5
  "keywords": [
6
6
  "storybook-addons",
@@ -21,8 +21,8 @@
21
21
  "url": "https://opencollective.com/storybook"
22
22
  },
23
23
  "license": "MIT",
24
- "main": "dist/cjs/register.js",
25
- "module": "dist/esm/register.js",
24
+ "main": "dist/cjs/index.js",
25
+ "module": "dist/esm/index.js",
26
26
  "types": "dist/ts3.9/index.d.ts",
27
27
  "typesVersions": {
28
28
  "<3.8": {
@@ -41,17 +41,19 @@
41
41
  "prepare": "node ../../scripts/prepare.js"
42
42
  },
43
43
  "dependencies": {
44
- "@storybook/addons": "6.5.0-alpha.6",
45
- "@storybook/api": "6.5.0-alpha.6",
46
- "@storybook/components": "6.5.0-alpha.6",
47
- "@storybook/core-common": "6.5.0-alpha.6",
48
- "@storybook/core-events": "6.5.0-alpha.6",
49
- "@storybook/csf": "0.0.2--canary.87bc651.0",
50
- "@storybook/instrumenter": "6.5.0-alpha.6",
51
- "@storybook/theming": "6.5.0-alpha.6",
44
+ "@storybook/addons": "6.5.0-alpha.62",
45
+ "@storybook/api": "6.5.0-alpha.62",
46
+ "@storybook/client-logger": "6.5.0-alpha.62",
47
+ "@storybook/components": "6.5.0-alpha.62",
48
+ "@storybook/core-common": "6.5.0-alpha.62",
49
+ "@storybook/core-events": "6.5.0-alpha.62",
50
+ "@storybook/csf": "0.0.2--canary.7c6c115.0",
51
+ "@storybook/instrumenter": "6.5.0-alpha.62",
52
+ "@storybook/theming": "6.5.0-alpha.62",
53
+ "core-js": "^3.8.2",
52
54
  "global": "^4.4.0",
53
55
  "jest-mock": "^27.0.6",
54
- "polished": "^4.0.5",
56
+ "polished": "^4.2.2",
55
57
  "ts-dedent": "^2.2.0"
56
58
  },
57
59
  "devDependencies": {
@@ -60,8 +62,8 @@
60
62
  "formik": "^2.2.9"
61
63
  },
62
64
  "peerDependencies": {
63
- "react": "^16.8.0 || ^17.0.0",
64
- "react-dom": "^16.8.0 || ^17.0.0"
65
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
66
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
65
67
  },
66
68
  "peerDependenciesMeta": {
67
69
  "react": {
@@ -74,7 +76,7 @@
74
76
  "publishConfig": {
75
77
  "access": "public"
76
78
  },
77
- "gitHead": "f2ec6752a3e940f99ead3ab721b513e5d1b76e17",
79
+ "gitHead": "e6025078374acd23cb15d3480c882229742a7ac1",
78
80
  "sbmodern": "dist/modern/index.js",
79
81
  "storybook": {
80
82
  "displayName": "Interactions",
package/preset.js CHANGED
@@ -1,15 +1,10 @@
1
- function config(entry = []) {
2
- return [...entry, require.resolve('./dist/esm/preset/argsEnhancers')];
3
- }
1
+ const { checkActionsLoaded } = require('./dist/cjs/preset/checkActionsLoaded');
4
2
 
5
- function managerEntries(entry = [], options) {
6
- // eslint-disable-next-line global-require
7
- const { checkActionsLoaded } = require('./dist/cjs/preset/checkActionsLoaded');
3
+ function previewAnnotations(entry = [], options) {
8
4
  checkActionsLoaded(options.configDir);
9
- return [...entry, require.resolve('./dist/esm/register')];
5
+ return entry;
10
6
  }
11
7
 
12
8
  module.exports = {
13
- config,
14
- managerEntries,
9
+ previewAnnotations,
15
10
  };
package/preview.js ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/esm/preset/preview';
package/register.js CHANGED
@@ -1 +1,6 @@
1
- import './dist/esm/register';
1
+ import { once } from '@storybook/client-logger';
2
+ import './manager';
3
+
4
+ once.warn(
5
+ 'register.js is deprecated see https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-registerjs'
6
+ );
@@ -1,33 +0,0 @@
1
- import { Meta, Canvas, Story } from '@storybook/addon-docs';
2
- import { expect } from '@storybook/jest';
3
- import { within, waitFor, fireEvent, userEvent } from '@storybook/testing-library';
4
-
5
- import { AccountForm } from './AccountForm';
6
-
7
- <Meta
8
- title="Addons/Interactions/Mdx"
9
- component={AccountForm}
10
- parameters={{ layout: 'centered', theme: 'light' }}
11
- argTypes={{
12
- onSubmit: { action: true },
13
- }}
14
- />
15
-
16
- ## AccountForm
17
-
18
- <Canvas>
19
- <Story
20
- name="StandardEmailFilled"
21
- args={{
22
- passwordVerification: false,
23
- }}
24
- play={async (context) => {
25
- const { args, canvasElement } = context
26
- const canvas = within(canvasElement)
27
-
28
- await userEvent.type(canvas.getByTestId('email'), 'username@email.com')
29
- await userEvent.type(canvas.getByTestId('password1'), 'thepassword')
30
- await userEvent.click(canvas.getByRole('button', { name: /create account/i }))
31
- expect(args.onSubmit).not.toHaveBeenCalled()
32
- }}/>
33
- </Canvas>
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,33 +0,0 @@
1
- import { Meta, Canvas, Story } from '@storybook/addon-docs';
2
- import { expect } from '@storybook/jest';
3
- import { within, waitFor, fireEvent, userEvent } from '@storybook/testing-library';
4
-
5
- import { AccountForm } from './AccountForm';
6
-
7
- <Meta
8
- title="Addons/Interactions/Mdx"
9
- component={AccountForm}
10
- parameters={{ layout: 'centered', theme: 'light' }}
11
- argTypes={{
12
- onSubmit: { action: true },
13
- }}
14
- />
15
-
16
- ## AccountForm
17
-
18
- <Canvas>
19
- <Story
20
- name="StandardEmailFilled"
21
- args={{
22
- passwordVerification: false,
23
- }}
24
- play={async (context) => {
25
- const { args, canvasElement } = context
26
- const canvas = within(canvasElement)
27
-
28
- await userEvent.type(canvas.getByTestId('email'), 'username@email.com')
29
- await userEvent.type(canvas.getByTestId('password1'), 'thepassword')
30
- await userEvent.click(canvas.getByRole('button', { name: /create account/i }))
31
- expect(args.onSubmit).not.toHaveBeenCalled()
32
- }}/>
33
- </Canvas>
File without changes
@@ -1,33 +0,0 @@
1
- import { Meta, Canvas, Story } from '@storybook/addon-docs';
2
- import { expect } from '@storybook/jest';
3
- import { within, waitFor, fireEvent, userEvent } from '@storybook/testing-library';
4
-
5
- import { AccountForm } from './AccountForm';
6
-
7
- <Meta
8
- title="Addons/Interactions/Mdx"
9
- component={AccountForm}
10
- parameters={{ layout: 'centered', theme: 'light' }}
11
- argTypes={{
12
- onSubmit: { action: true },
13
- }}
14
- />
15
-
16
- ## AccountForm
17
-
18
- <Canvas>
19
- <Story
20
- name="StandardEmailFilled"
21
- args={{
22
- passwordVerification: false,
23
- }}
24
- play={async (context) => {
25
- const { args, canvasElement } = context
26
- const canvas = within(canvasElement)
27
-
28
- await userEvent.type(canvas.getByTestId('email'), 'username@email.com')
29
- await userEvent.type(canvas.getByTestId('password1'), 'thepassword')
30
- await userEvent.click(canvas.getByRole('button', { name: /create account/i }))
31
- expect(args.onSubmit).not.toHaveBeenCalled()
32
- }}/>
33
- </Canvas>
File without changes
@@ -1,3 +0,0 @@
1
- import { Args } from '@storybook/addons';
2
- import { AnyFramework, ArgsEnhancer } from '@storybook/csf';
3
- export declare const argsEnhancers: ArgsEnhancer<AnyFramework, Args>[];