storybook 9.0.0-alpha.0 → 9.0.0-alpha.10

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 (259) hide show
  1. package/README.md +31 -29
  2. package/assets/browser/favicon.svg +1 -0
  3. package/assets/browser/nunito-sans-bold-italic.woff2 +0 -0
  4. package/assets/browser/nunito-sans-bold.woff2 +0 -0
  5. package/assets/browser/nunito-sans-italic.woff2 +0 -0
  6. package/assets/browser/nunito-sans-regular.woff2 +0 -0
  7. package/assets/docs/addon-controls-args-annotated.png +0 -0
  8. package/assets/docs/addon-controls-args-background-color.png +0 -0
  9. package/assets/docs/addon-controls-args-background-string.png +0 -0
  10. package/assets/docs/addon-controls-args-docs.png +0 -0
  11. package/assets/docs/addon-controls-args-logging.png +0 -0
  12. package/assets/docs/addon-controls-args-no-annotation.png +0 -0
  13. package/assets/docs/addon-controls-args-reflow-slider.png +0 -0
  14. package/assets/docs/addon-controls-args-reflow.png +0 -0
  15. package/assets/docs/addon-controls-args-template.png +0 -0
  16. package/assets/docs/addon-controls-expanded.png +0 -0
  17. package/assets/docs/addon-controls-hero.gif +0 -0
  18. package/assets/docs/addon-controls-install.png +0 -0
  19. package/assets/docs/hero.gif +0 -0
  20. package/assets/docs/message-reference.png +0 -0
  21. package/assets/docs/viewport.png +0 -0
  22. package/assets/server/addon.tsconfig.json +6 -0
  23. package/assets/server/base-preview-body.html +119 -0
  24. package/assets/server/base-preview-head.html +451 -0
  25. package/assets/server/template.ejs +87 -0
  26. package/bin/index.cjs +1 -1
  27. package/dist/actions/decorator.d.ts +6 -0
  28. package/dist/actions/decorator.js +139 -0
  29. package/dist/actions/index.cjs +127 -0
  30. package/dist/actions/index.d.ts +105 -0
  31. package/dist/actions/index.js +112 -0
  32. package/dist/actions/manager.js +1196 -0
  33. package/dist/actions/preview.cjs +165 -0
  34. package/dist/actions/preview.d.ts +55 -0
  35. package/dist/actions/preview.js +156 -0
  36. package/dist/babel/index.cjs +54034 -0
  37. package/dist/babel/index.d.ts +7488 -0
  38. package/dist/babel/index.js +54044 -0
  39. package/dist/bin/index.cjs +119 -0
  40. package/dist/bin/index.js +113 -0
  41. package/dist/builder-manager/index.cjs +2140 -0
  42. package/dist/builder-manager/index.d.ts +19 -0
  43. package/dist/builder-manager/index.js +2162 -0
  44. package/dist/channels/index.cjs +1913 -0
  45. package/dist/channels/index.d.ts +108 -0
  46. package/dist/channels/index.js +1881 -0
  47. package/dist/cli/bin/index.cjs +2687 -0
  48. package/dist/cli/bin/index.d.ts +2 -0
  49. package/dist/cli/bin/index.js +2707 -0
  50. package/dist/cli/index.cjs +17327 -0
  51. package/dist/cli/index.d.ts +209 -0
  52. package/dist/cli/index.js +17349 -0
  53. package/dist/client-logger/index.cjs +80 -0
  54. package/dist/client-logger/index.d.ts +29 -0
  55. package/dist/client-logger/index.js +64 -0
  56. package/dist/common/index.cjs +20569 -0
  57. package/dist/common/index.d.ts +949 -0
  58. package/dist/common/index.js +20654 -0
  59. package/dist/components/index.cjs +27924 -0
  60. package/dist/components/index.d.ts +1423 -0
  61. package/dist/components/index.js +24673 -0
  62. package/dist/controls/decorator.d.ts +5 -0
  63. package/dist/controls/decorator.js +8 -0
  64. package/dist/controls/index.cjs +26 -0
  65. package/dist/controls/index.d.ts +39 -0
  66. package/dist/controls/index.js +6 -0
  67. package/dist/controls/manager.js +5545 -0
  68. package/dist/controls/preview.cjs +26 -0
  69. package/dist/controls/preview.d.ts +55 -0
  70. package/dist/controls/preview.js +9 -0
  71. package/dist/core-events/index.cjs +167 -0
  72. package/dist/core-events/index.d.ts +426 -0
  73. package/dist/core-events/index.js +149 -0
  74. package/dist/core-server/index.cjs +38183 -0
  75. package/dist/core-server/index.d.ts +720 -0
  76. package/dist/core-server/index.js +38272 -0
  77. package/dist/core-server/presets/common-manager.js +20 -0
  78. package/dist/core-server/presets/common-override-preset.cjs +4824 -0
  79. package/dist/core-server/presets/common-override-preset.js +4829 -0
  80. package/dist/core-server/presets/common-preset.cjs +10231 -0
  81. package/dist/core-server/presets/common-preset.js +10309 -0
  82. package/dist/csf/index.cjs +179 -0
  83. package/dist/csf/index.d.ts +750 -0
  84. package/dist/csf/index.js +172 -0
  85. package/dist/csf-tools/index.cjs +1422 -0
  86. package/dist/csf-tools/index.d.ts +250 -0
  87. package/dist/csf-tools/index.js +1439 -0
  88. package/dist/docs-tools/index.cjs +2891 -0
  89. package/dist/docs-tools/index.d.ts +162 -0
  90. package/dist/docs-tools/index.js +2876 -0
  91. package/dist/index.cjs +17 -1
  92. package/dist/index.d.ts +1 -1
  93. package/dist/index.js +2 -7
  94. package/dist/instrumenter/index.cjs +3485 -0
  95. package/dist/instrumenter/index.d.ts +104 -0
  96. package/dist/instrumenter/index.js +4965 -0
  97. package/dist/manager/globals-module-info.cjs +817 -0
  98. package/dist/manager/globals-module-info.d.ts +36 -0
  99. package/dist/manager/globals-module-info.js +804 -0
  100. package/dist/manager/globals-runtime.js +77536 -0
  101. package/dist/manager/globals.cjs +47 -0
  102. package/dist/manager/globals.d.ts +24 -0
  103. package/dist/manager/globals.js +34 -0
  104. package/dist/manager/runtime.js +12323 -0
  105. package/dist/manager-api/index.cjs +11074 -0
  106. package/dist/manager-api/index.d.ts +1512 -0
  107. package/dist/manager-api/index.js +4835 -0
  108. package/dist/manager-errors.d.ts +89 -0
  109. package/dist/manager-errors.js +99 -0
  110. package/dist/node-logger/index.cjs +1642 -0
  111. package/dist/node-logger/index.d.ts +117 -0
  112. package/dist/node-logger/index.js +1652 -0
  113. package/dist/preview/globals.cjs +38 -0
  114. package/dist/preview/globals.d.ts +15 -0
  115. package/dist/preview/globals.js +25 -0
  116. package/dist/preview/runtime.js +43629 -0
  117. package/dist/preview-api/index.cjs +5224 -0
  118. package/dist/preview-api/index.d.ts +1093 -0
  119. package/dist/preview-api/index.js +5292 -0
  120. package/dist/preview-errors.cjs +503 -0
  121. package/dist/preview-errors.d.ts +212 -0
  122. package/dist/preview-errors.js +449 -0
  123. package/dist/router/index.cjs +3296 -0
  124. package/dist/router/index.d.ts +385 -0
  125. package/dist/router/index.js +1843 -0
  126. package/dist/server-errors.cjs +727 -0
  127. package/dist/server-errors.d.ts +296 -0
  128. package/dist/server-errors.js +728 -0
  129. package/dist/telemetry/index.cjs +2756 -0
  130. package/dist/telemetry/index.d.ts +133 -0
  131. package/dist/telemetry/index.js +2797 -0
  132. package/dist/test/index.cjs +35685 -0
  133. package/dist/test/index.d.ts +186 -0
  134. package/dist/test/index.js +33751 -0
  135. package/dist/test/preview.cjs +15869 -0
  136. package/dist/test/preview.d.ts +54 -0
  137. package/dist/test/preview.js +14440 -0
  138. package/dist/test/spy.cjs +257 -0
  139. package/dist/test/spy.d.ts +66 -0
  140. package/dist/test/spy.js +239 -0
  141. package/dist/theming/create.cjs +232 -0
  142. package/dist/theming/create.d.ts +50 -0
  143. package/dist/theming/create.js +216 -0
  144. package/dist/theming/index.cjs +2665 -0
  145. package/dist/theming/index.d.ts +11939 -0
  146. package/dist/theming/index.js +2485 -0
  147. package/dist/types/index.cjs +27 -0
  148. package/dist/types/index.d.ts +2795 -0
  149. package/dist/types/index.js +7 -0
  150. package/dist/viewport/index.cjs +310 -0
  151. package/dist/viewport/index.d.ts +320 -0
  152. package/dist/viewport/index.js +290 -0
  153. package/dist/viewport/manager.js +400 -0
  154. package/dist/viewport/preview.cjs +35 -0
  155. package/dist/viewport/preview.d.ts +69 -0
  156. package/dist/viewport/preview.js +19 -0
  157. package/package.json +518 -209
  158. package/.eslintrc.cjs +0 -31
  159. package/__mocks__/@aw-web-design/x-default-browser.js +0 -2
  160. package/core/babel/index.cjs +0 -1
  161. package/core/babel/index.d.ts +0 -2
  162. package/core/babel/index.js +0 -1
  163. package/core/builder-manager/index.cjs +0 -1
  164. package/core/builder-manager/index.d.ts +0 -2
  165. package/core/builder-manager/index.js +0 -1
  166. package/core/channels/index.cjs +0 -1
  167. package/core/channels/index.d.ts +0 -2
  168. package/core/channels/index.js +0 -1
  169. package/core/cli/bin/index.cjs +0 -1
  170. package/core/cli/bin/index.d.ts +0 -2
  171. package/core/cli/bin/index.js +0 -1
  172. package/core/cli/index.cjs +0 -1
  173. package/core/cli/index.d.ts +0 -2
  174. package/core/cli/index.js +0 -1
  175. package/core/client-logger/index.cjs +0 -1
  176. package/core/client-logger/index.d.ts +0 -2
  177. package/core/client-logger/index.js +0 -1
  178. package/core/common/index.cjs +0 -1
  179. package/core/common/index.d.ts +0 -2
  180. package/core/common/index.js +0 -1
  181. package/core/components/index.cjs +0 -1
  182. package/core/components/index.d.ts +0 -2
  183. package/core/components/index.js +0 -1
  184. package/core/core-events/index.cjs +0 -1
  185. package/core/core-events/index.d.ts +0 -2
  186. package/core/core-events/index.js +0 -1
  187. package/core/core-server/index.cjs +0 -1
  188. package/core/core-server/index.d.ts +0 -2
  189. package/core/core-server/index.js +0 -1
  190. package/core/core-server/presets/common-manager.js +0 -1
  191. package/core/core-server/presets/common-override-preset.cjs +0 -1
  192. package/core/core-server/presets/common-override-preset.js +0 -1
  193. package/core/core-server/presets/common-preset.cjs +0 -1
  194. package/core/core-server/presets/common-preset.js +0 -1
  195. package/core/csf/index.cjs +0 -1
  196. package/core/csf/index.d.ts +0 -2
  197. package/core/csf/index.js +0 -1
  198. package/core/csf-tools/index.cjs +0 -1
  199. package/core/csf-tools/index.d.ts +0 -2
  200. package/core/csf-tools/index.js +0 -1
  201. package/core/docs-tools/index.cjs +0 -1
  202. package/core/docs-tools/index.d.ts +0 -2
  203. package/core/docs-tools/index.js +0 -1
  204. package/core/index.cjs +0 -1
  205. package/core/index.d.ts +0 -2
  206. package/core/index.js +0 -1
  207. package/core/manager/globals-module-info.cjs +0 -1
  208. package/core/manager/globals-module-info.d.ts +0 -2
  209. package/core/manager/globals-module-info.js +0 -1
  210. package/core/manager/globals-runtime.js +0 -1
  211. package/core/manager/globals.cjs +0 -1
  212. package/core/manager/globals.d.ts +0 -2
  213. package/core/manager/globals.js +0 -1
  214. package/core/manager-api/index.cjs +0 -1
  215. package/core/manager-api/index.d.ts +0 -2
  216. package/core/manager-api/index.js +0 -1
  217. package/core/manager-errors.d.ts +0 -2
  218. package/core/manager-errors.js +0 -1
  219. package/core/node-logger/index.cjs +0 -1
  220. package/core/node-logger/index.d.ts +0 -2
  221. package/core/node-logger/index.js +0 -1
  222. package/core/preview/globals.cjs +0 -1
  223. package/core/preview/globals.d.ts +0 -2
  224. package/core/preview/globals.js +0 -1
  225. package/core/preview/runtime.js +0 -1
  226. package/core/preview-api/index.cjs +0 -1
  227. package/core/preview-api/index.d.ts +0 -2
  228. package/core/preview-api/index.js +0 -1
  229. package/core/preview-errors.cjs +0 -1
  230. package/core/preview-errors.d.ts +0 -2
  231. package/core/preview-errors.js +0 -1
  232. package/core/router/index.cjs +0 -1
  233. package/core/router/index.d.ts +0 -2
  234. package/core/router/index.js +0 -1
  235. package/core/server-errors.cjs +0 -1
  236. package/core/server-errors.d.ts +0 -2
  237. package/core/server-errors.js +0 -1
  238. package/core/telemetry/index.cjs +0 -1
  239. package/core/telemetry/index.d.ts +0 -2
  240. package/core/telemetry/index.js +0 -1
  241. package/core/theming/create.cjs +0 -1
  242. package/core/theming/create.d.ts +0 -2
  243. package/core/theming/create.js +0 -1
  244. package/core/theming/index.cjs +0 -1
  245. package/core/theming/index.d.ts +0 -2
  246. package/core/theming/index.js +0 -1
  247. package/core/types/index.cjs +0 -1
  248. package/core/types/index.d.ts +0 -2
  249. package/core/types/index.js +0 -1
  250. package/core.cjs +0 -0
  251. package/core.d.ts +0 -0
  252. package/core.js +0 -1
  253. package/dist/chunk-OWLSIX54.js +0 -8
  254. package/dist/core-path.cjs +0 -1
  255. package/dist/core-path.d.ts +0 -3
  256. package/dist/core-path.js +0 -9
  257. package/dist/proxy.cjs +0 -1
  258. package/dist/proxy.d.ts +0 -2
  259. package/dist/proxy.js +0 -9
@@ -0,0 +1,451 @@
1
+ <base target="_parent" />
2
+
3
+ <style>
4
+ /* While we aren't showing the main block yet, but still preparing, we want everything the user
5
+ has rendered, which may or may not be in #storybook-root, to be display none */
6
+ .sb-show-preparing-story:not(.sb-show-main) > :not(.sb-preparing-story) {
7
+ display: none;
8
+ }
9
+
10
+ .sb-show-preparing-docs:not(.sb-show-main) > :not(.sb-preparing-docs) {
11
+ display: none;
12
+ }
13
+
14
+ /* Hide our own blocks when we aren't supposed to be showing them */
15
+ :not(.sb-show-preparing-story) > .sb-preparing-story,
16
+ :not(.sb-show-preparing-docs) > .sb-preparing-docs,
17
+ :not(.sb-show-nopreview) > .sb-nopreview,
18
+ :not(.sb-show-errordisplay) > .sb-errordisplay {
19
+ display: none;
20
+ }
21
+
22
+ .sb-show-main.sb-main-centered {
23
+ margin: 0;
24
+ display: flex;
25
+ align-items: center;
26
+ min-height: 100vh;
27
+ }
28
+
29
+ .sb-show-main.sb-main-centered #storybook-root {
30
+ box-sizing: border-box;
31
+ margin: auto;
32
+ padding: 1rem;
33
+ max-height: 100%;
34
+ /* Hack for centering correctly in IE11 */
35
+ }
36
+
37
+ /* Vertical centering fix for IE11 */
38
+ @media screen and (-ms-high-contrast: none), (-ms-high-contrast: active) {
39
+ .sb-show-main.sb-main-centered:after {
40
+ content: '';
41
+ min-height: inherit;
42
+ font-size: 0;
43
+ }
44
+ }
45
+
46
+ .sb-show-main.sb-main-fullscreen {
47
+ margin: 0;
48
+ padding: 0;
49
+ display: block;
50
+ }
51
+
52
+ .sb-show-main.sb-main-padded {
53
+ margin: 0;
54
+ padding: 1rem;
55
+ display: block;
56
+ box-sizing: border-box;
57
+ }
58
+
59
+ .sb-wrapper {
60
+ position: fixed;
61
+ top: 0;
62
+ bottom: 0;
63
+ left: 0;
64
+ right: 0;
65
+ box-sizing: border-box;
66
+
67
+ padding: 40px;
68
+ font-family:
69
+ 'Nunito Sans',
70
+ -apple-system,
71
+ '.SFNSText-Regular',
72
+ 'San Francisco',
73
+ BlinkMacSystemFont,
74
+ 'Segoe UI',
75
+ 'Helvetica Neue',
76
+ Helvetica,
77
+ Arial,
78
+ sans-serif;
79
+ -webkit-font-smoothing: antialiased;
80
+ overflow: auto;
81
+ }
82
+
83
+ @media (max-width: 700px) {
84
+ .sb-wrapper {
85
+ padding: 20px;
86
+ }
87
+ }
88
+
89
+ @media (max-width: 500px) {
90
+ .sb-wrapper {
91
+ padding: 10px;
92
+ }
93
+ }
94
+
95
+ .sb-heading {
96
+ font-size: 14px;
97
+ font-weight: 600;
98
+ letter-spacing: 0.2px;
99
+ margin: 10px 0;
100
+ padding-right: 25px;
101
+ }
102
+
103
+ .sb-nopreview {
104
+ display: flex;
105
+ align-content: center;
106
+ justify-content: center;
107
+ box-sizing: border-box;
108
+ }
109
+
110
+ .sb-nopreview_main {
111
+ margin: auto;
112
+ padding: 30px;
113
+ border-radius: 10px;
114
+ background: rgba(0, 0, 0, 0.03);
115
+ }
116
+
117
+ .sb-nopreview_heading {
118
+ text-align: center;
119
+ }
120
+
121
+ .sb-errordisplay {
122
+ background: #f6f9fc;
123
+ color: black;
124
+ z-index: 999999;
125
+ width: 100vw;
126
+ min-height: 100vh;
127
+ box-sizing: border-box;
128
+
129
+ & ol {
130
+ padding-left: 18px;
131
+ margin: 0;
132
+ }
133
+
134
+ & h1 {
135
+ font-family: Nunito Sans;
136
+ font-size: 22px;
137
+ font-weight: 400;
138
+ line-height: 30px;
139
+ font-weight: normal;
140
+ margin: 0;
141
+
142
+ &::before {
143
+ content: '';
144
+ display: inline-block;
145
+ width: 12px;
146
+ height: 12px;
147
+ background: #ff4400;
148
+ border-radius: 50%;
149
+ margin-right: 8px;
150
+ }
151
+ }
152
+
153
+ & p,
154
+ & ol {
155
+ font-family: Nunito Sans;
156
+ font-size: 14px;
157
+ font-weight: 400;
158
+ line-height: 19px;
159
+ margin: 0;
160
+ }
161
+
162
+ & li + li {
163
+ margin: 0;
164
+ padding: 0;
165
+ padding-top: 12px;
166
+ }
167
+
168
+ & a {
169
+ color: currentColor;
170
+ }
171
+ }
172
+
173
+ .sb-errordisplay_main {
174
+ margin: auto;
175
+ padding: 24px;
176
+ display: flex;
177
+ box-sizing: border-box;
178
+
179
+ flex-direction: column;
180
+ min-height: 100%;
181
+ width: 100%;
182
+ border-radius: 6px;
183
+ background: white;
184
+ border: 1px solid #ff0000;
185
+ box-shadow: 0 0 64px rgba(0, 0, 0, 0.1);
186
+ gap: 24px;
187
+ }
188
+
189
+ .sb-errordisplay_code {
190
+ padding: 10px;
191
+ flex: 1;
192
+ background: #242424;
193
+ color: #c6c6c6;
194
+ box-sizing: border-box;
195
+
196
+ font-size: 14px;
197
+ font-weight: 400;
198
+ line-height: 19px;
199
+ border-radius: 4px;
200
+
201
+ font-family: 'Operator Mono', 'Fira Code Retina', 'Fira Code', 'FiraCode-Retina', 'Andale Mono',
202
+ 'Lucida Console', Consolas, Monaco, monospace;
203
+ margin: 0;
204
+ overflow: auto;
205
+ }
206
+
207
+ .sb-errordisplay pre {
208
+ white-space: pre-wrap;
209
+ white-space: revert;
210
+ }
211
+
212
+ @-webkit-keyframes sb-rotate360 {
213
+ from {
214
+ transform: rotate(0deg);
215
+ }
216
+
217
+ to {
218
+ transform: rotate(360deg);
219
+ }
220
+ }
221
+
222
+ @keyframes sb-rotate360 {
223
+ from {
224
+ transform: rotate(0deg);
225
+ }
226
+
227
+ to {
228
+ transform: rotate(360deg);
229
+ }
230
+ }
231
+
232
+ @-webkit-keyframes sb-glow {
233
+ 0%,
234
+ 100% {
235
+ opacity: 1;
236
+ }
237
+
238
+ 50% {
239
+ opacity: 0.4;
240
+ }
241
+ }
242
+
243
+ @keyframes sb-glow {
244
+ 0%,
245
+ 100% {
246
+ opacity: 1;
247
+ }
248
+
249
+ 50% {
250
+ opacity: 0.4;
251
+ }
252
+ }
253
+
254
+ /* We display the preparing loaders *over* the rendering story */
255
+ .sb-preparing-story,
256
+ .sb-preparing-docs {
257
+ background-color: white;
258
+ /* Maximum possible z-index. It would be better to use stacking contexts to ensure it's always
259
+ on top, but this isn't possible as it would require making CSS changes that could affect user code */
260
+ z-index: 2147483647;
261
+ }
262
+
263
+ .sb-loader {
264
+ -webkit-animation: sb-rotate360 0.7s linear infinite;
265
+ animation: sb-rotate360 0.7s linear infinite;
266
+ border-color: rgba(97, 97, 97, 0.29);
267
+ border-radius: 50%;
268
+ border-style: solid;
269
+ border-top-color: #646464;
270
+ border-width: 2px;
271
+ display: inline-block;
272
+ height: 32px;
273
+ left: 50%;
274
+ margin-left: -16px;
275
+ margin-top: -16px;
276
+ mix-blend-mode: difference;
277
+ overflow: hidden;
278
+ position: absolute;
279
+ top: 50%;
280
+ transition: all 200ms ease-out;
281
+ vertical-align: top;
282
+ width: 32px;
283
+ z-index: 4;
284
+ }
285
+
286
+ .sb-previewBlock {
287
+ background: #fff;
288
+ border: 1px solid rgba(0, 0, 0, 0.1);
289
+ border-radius: 4px;
290
+ box-shadow: rgba(0, 0, 0, 0.1) 0 1px 3px 0;
291
+ margin: 25px auto 40px;
292
+ max-width: 600px;
293
+ }
294
+
295
+ .sb-previewBlock_header {
296
+ align-items: center;
297
+ box-shadow: rgba(0, 0, 0, 0.1) 0 -1px 0 0 inset;
298
+ display: flex;
299
+ gap: 14px;
300
+ height: 40px;
301
+ padding: 0 12px;
302
+ }
303
+
304
+ .sb-previewBlock_icon {
305
+ -webkit-animation: sb-glow 1.5s ease-in-out infinite;
306
+ animation: sb-glow 1.5s ease-in-out infinite;
307
+ background: #e6e6e6;
308
+ height: 14px;
309
+ width: 14px;
310
+ }
311
+
312
+ .sb-previewBlock_icon:last-child {
313
+ margin-left: auto;
314
+ }
315
+
316
+ .sb-previewBlock_body {
317
+ -webkit-animation: sb-glow 1.5s ease-in-out infinite;
318
+ animation: sb-glow 1.5s ease-in-out infinite;
319
+ height: 182px;
320
+ position: relative;
321
+ }
322
+
323
+ .sb-argstableBlock {
324
+ border-collapse: collapse;
325
+ border-spacing: 0;
326
+ font-size: 13px;
327
+ line-height: 20px;
328
+ margin: 25px auto 40px;
329
+ max-width: 600px;
330
+ text-align: left;
331
+ width: 100%;
332
+ }
333
+
334
+ .sb-argstableBlock th:first-of-type,
335
+ .sb-argstableBlock td:first-of-type {
336
+ padding-left: 20px;
337
+ }
338
+
339
+ .sb-argstableBlock th:nth-of-type(2),
340
+ .sb-argstableBlock td:nth-of-type(2) {
341
+ width: 35%;
342
+ }
343
+
344
+ .sb-argstableBlock th:nth-of-type(3),
345
+ .sb-argstableBlock td:nth-of-type(3) {
346
+ width: 15%;
347
+ }
348
+
349
+ .sb-argstableBlock th:last-of-type,
350
+ .sb-argstableBlock td:last-of-type {
351
+ width: 25%;
352
+ padding-right: 20px;
353
+ }
354
+
355
+ .sb-argstableBlock th span,
356
+ .sb-argstableBlock td span {
357
+ -webkit-animation: sb-glow 1.5s ease-in-out infinite;
358
+ animation: sb-glow 1.5s ease-in-out infinite;
359
+ background-color: rgba(0, 0, 0, 0.1);
360
+ border-radius: 0;
361
+ box-shadow: none;
362
+ color: transparent;
363
+ }
364
+
365
+ .sb-argstableBlock th {
366
+ padding: 10px 15px;
367
+ }
368
+
369
+ .sb-argstableBlock-body {
370
+ border-radius: 4px;
371
+ box-shadow:
372
+ rgba(0, 0, 0, 0.1) 0 1px 3px 1px,
373
+ rgba(0, 0, 0, 0.065) 0 0 0 1px;
374
+ }
375
+
376
+ .sb-argstableBlock-body tr {
377
+ background: transparent;
378
+ overflow: hidden;
379
+ }
380
+
381
+ .sb-argstableBlock-body tr:not(:first-child) {
382
+ border-top: 1px solid #e6e6e6;
383
+ }
384
+
385
+ .sb-argstableBlock-body tr:first-child td:first-child {
386
+ border-top-left-radius: 4px;
387
+ }
388
+
389
+ .sb-argstableBlock-body tr:first-child td:last-child {
390
+ border-top-right-radius: 4px;
391
+ }
392
+
393
+ .sb-argstableBlock-body tr:last-child td:first-child {
394
+ border-bottom-left-radius: 4px;
395
+ }
396
+
397
+ .sb-argstableBlock-body tr:last-child td:last-child {
398
+ border-bottom-right-radius: 4px;
399
+ }
400
+
401
+ .sb-argstableBlock-body td {
402
+ background: #fff;
403
+ padding-bottom: 10px;
404
+ padding-top: 10px;
405
+ vertical-align: top;
406
+ }
407
+
408
+ .sb-argstableBlock-body td:not(:first-of-type) {
409
+ padding-left: 15px;
410
+ padding-right: 15px;
411
+ }
412
+
413
+ .sb-argstableBlock-body button {
414
+ -webkit-animation: sb-glow 1.5s ease-in-out infinite;
415
+ animation: sb-glow 1.5s ease-in-out infinite;
416
+ background-color: rgba(0, 0, 0, 0.1);
417
+ border: 0;
418
+ border-radius: 0;
419
+ box-shadow: none;
420
+ color: transparent;
421
+ display: inline;
422
+ font-size: 12px;
423
+ line-height: 1;
424
+ padding: 10px 16px;
425
+ }
426
+
427
+ .sb-argstableBlock-summary {
428
+ margin-top: 4px;
429
+ }
430
+
431
+ .sb-argstableBlock-code {
432
+ margin-right: 4px;
433
+ margin-bottom: 4px;
434
+ padding: 2px 5px;
435
+ }
436
+ </style>
437
+
438
+ <script>
439
+ /* globals window */
440
+ /* eslint-disable no-underscore-dangle */
441
+ try {
442
+ if (window.top !== window) {
443
+ window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.top.__REACT_DEVTOOLS_GLOBAL_HOOK__;
444
+ window.__VUE_DEVTOOLS_GLOBAL_HOOK__ = window.top.__VUE_DEVTOOLS_GLOBAL_HOOK__;
445
+ window.top.__VUE_DEVTOOLS_CONTEXT__ = window.document;
446
+ }
447
+ } catch (e) {
448
+ // eslint-disable-next-line no-console
449
+ console.warn('unable to connect to top frame for connecting dev tools');
450
+ }
451
+ </script>
@@ -0,0 +1,87 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+
6
+ <title><%= typeof title !== 'undefined'? title : 'Storybook'%></title>
7
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
8
+
9
+ <% if (favicon.endsWith('.svg')) {%>
10
+ <link rel="icon" type="image/svg+xml" href="./<%= favicon %>" />
11
+ <% } else if (favicon.endsWith('.ico')) { %>
12
+ <link rel="icon" type="image/x-icon" href="./<%= favicon %>" />
13
+ <% } %>
14
+ <style>
15
+ @font-face {
16
+ font-family: 'Nunito Sans';
17
+ font-style: normal;
18
+ font-weight: 400;
19
+ font-display: swap;
20
+ src: url('./sb-common-assets/nunito-sans-regular.woff2') format('woff2');
21
+ }
22
+
23
+ @font-face {
24
+ font-family: 'Nunito Sans';
25
+ font-style: italic;
26
+ font-weight: 400;
27
+ font-display: swap;
28
+ src: url('./sb-common-assets/nunito-sans-italic.woff2') format('woff2');
29
+ }
30
+
31
+ @font-face {
32
+ font-family: 'Nunito Sans';
33
+ font-style: normal;
34
+ font-weight: 700;
35
+ font-display: swap;
36
+ src: url('./sb-common-assets/nunito-sans-bold.woff2') format('woff2');
37
+ }
38
+
39
+ @font-face {
40
+ font-family: 'Nunito Sans';
41
+ font-style: italic;
42
+ font-weight: 700;
43
+ font-display: swap;
44
+ src: url('./sb-common-assets/nunito-sans-bold-italic.woff2') format('woff2');
45
+ }
46
+ </style>
47
+
48
+ <link href="./sb-manager/runtime.js" rel="modulepreload" />
49
+
50
+ <% files.js.forEach(file => { %>
51
+ <link href="<%= file %>" rel="modulepreload" />
52
+ <% }); %> <% if (typeof head !== 'undefined') { %> <%- head %> <% } %>
53
+
54
+ <style>
55
+ #storybook-root[hidden] {
56
+ display: none !important;
57
+ }
58
+ </style>
59
+
60
+ <% files.css.forEach(file => { %>
61
+ <link href="<%= file %>" rel="stylesheet" />
62
+ <% }); %>
63
+ </head>
64
+ <body>
65
+ <div id="root"></div>
66
+
67
+ <% if (typeof globals !== 'undefined' && Object.keys(globals).length) { %>
68
+ <script>
69
+ <% for (var varName in globals) { %>
70
+ <% if (globals[varName] !== undefined) { %>
71
+ window['<%=varName%>'] = <%- (globals[varName]) %>;
72
+ <% } %>
73
+ <% } %>
74
+ </script>
75
+ <% } %>
76
+
77
+ <script type="module">
78
+ import './sb-manager/globals-runtime.js';
79
+
80
+ <% files.js.forEach(file => { %>
81
+ import '<%= file %>';
82
+ <% }); %>
83
+
84
+ import './sb-manager/runtime.js';
85
+ </script>
86
+ </body>
87
+ </html>
package/bin/index.cjs CHANGED
@@ -23,4 +23,4 @@ process.once('uncaughtException', (error) => {
23
23
  throw error;
24
24
  });
25
25
 
26
- require('../dist/proxy.cjs');
26
+ require('../dist/bin/index.cjs');
@@ -0,0 +1,6 @@
1
+ import { Renderer, PartialStoryFn } from 'storybook/internal/types';
2
+
3
+ /** @deprecated Will be removed in Storybook v10 */
4
+ declare const withActions: <T extends Renderer>(storyFn: PartialStoryFn<T>) => T['storyResult'];
5
+
6
+ export { withActions };
@@ -0,0 +1,139 @@
1
+ var j = Object.defineProperty;
2
+ var r = (o, e) => j(o, "name", { value: e, configurable: !0 });
3
+
4
+ // src/actions/decorator.ts
5
+ import { global as F } from "@storybook/global";
6
+ import { makeDecorator as M, useEffect as C } from "storybook/preview-api";
7
+
8
+ // src/actions/constants.ts
9
+ var h = "actions", y = "storybook/actions", L = `${y}/panel`, g = `${y}/action-event`, W = `${y}/action-clear`;
10
+
11
+ // src/actions/runtime/action.ts
12
+ import { ImplicitActionsDuringRendering as S } from "storybook/internal/preview-errors";
13
+ import { global as E } from "@storybook/global";
14
+ import { addons as I } from "storybook/preview-api";
15
+ import { v4 as P } from "uuid";
16
+
17
+ // src/actions/runtime/configureActions.ts
18
+ var a = {
19
+ depth: 10,
20
+ clearOnStoryChange: !0,
21
+ limit: 50
22
+ };
23
+
24
+ // src/actions/runtime/action.ts
25
+ var A = /* @__PURE__ */ r((o, e) => {
26
+ let t = Object.getPrototypeOf(o);
27
+ return !t || e(t) ? t : A(t, e);
28
+ }, "findProto"), x = /* @__PURE__ */ r((o) => !!(typeof o == "object" && o && A(o, (e) => /^Synthetic(?:Base)?Event$/.test(e.constructor.name)) &&
29
+ typeof o.persist == "function"), "isReactSyntheticEvent"), k = /* @__PURE__ */ r((o) => {
30
+ if (x(o)) {
31
+ let e = Object.create(
32
+ o.constructor.prototype,
33
+ Object.getOwnPropertyDescriptors(o)
34
+ );
35
+ e.persist();
36
+ let t = Object.getOwnPropertyDescriptor(e, "view"), n = t?.value;
37
+ return typeof n == "object" && n?.constructor.name === "Window" && Object.defineProperty(e, "view", {
38
+ ...t,
39
+ value: Object.create(n.constructor.prototype)
40
+ }), e;
41
+ }
42
+ return o;
43
+ }, "serializeArg"), T = /* @__PURE__ */ r(() => typeof crypto == "object" && typeof crypto.getRandomValues == "function" ? P() : (
44
+ // pseudo random id, example response lo1e7zm4832bkr7yfl7
45
+ Date.now().toString(36) + Math.random().toString(36).substring(2)
46
+ ), "generateId");
47
+ function O(o, e = {}) {
48
+ let t = {
49
+ ...a,
50
+ ...e
51
+ }, n = /* @__PURE__ */ r(function(...i) {
52
+ if (e.implicit) {
53
+ let u = ("__STORYBOOK_PREVIEW__" in E ? (
54
+ // eslint-disable-next-line no-underscore-dangle
55
+ E.__STORYBOOK_PREVIEW__
56
+ ) : void 0)?.storyRenders.find(
57
+ (s) => s.phase === "playing" || s.phase === "rendering"
58
+ );
59
+ if (u) {
60
+ let s = !globalThis?.FEATURES?.disallowImplicitActionsInRenderV8, d = new S({
61
+ phase: u.phase,
62
+ name: o,
63
+ deprecated: s
64
+ });
65
+ if (s)
66
+ console.warn(d);
67
+ else
68
+ throw d;
69
+ }
70
+ }
71
+ let m = I.getChannel(), p = T(), l = 5, f = i.map(k), R = i.length > 1 ? f : f[0], D = {
72
+ id: p,
73
+ count: 0,
74
+ data: { name: o, args: R },
75
+ options: {
76
+ ...t,
77
+ maxDepth: l + (t.depth || 3),
78
+ allowFunction: t.allowFunction || !1
79
+ }
80
+ };
81
+ m.emit(g, D);
82
+ }, "actionHandler");
83
+ return n.isAction = !0, n.implicit = e.implicit, n;
84
+ }
85
+ r(O, "action");
86
+
87
+ // src/actions/runtime/actions.ts
88
+ var b = /* @__PURE__ */ r((...o) => {
89
+ let e = a, t = o;
90
+ t.length === 1 && Array.isArray(t[0]) && ([t] = t), t.length !== 1 && typeof t[t.length - 1] != "string" && (e = {
91
+ ...a,
92
+ ...t.pop()
93
+ });
94
+ let n = t[0];
95
+ (t.length !== 1 || typeof n == "string") && (n = {}, t.forEach((i) => {
96
+ n[i] = i;
97
+ }));
98
+ let c = {};
99
+ return Object.keys(n).forEach((i) => {
100
+ c[i] = O(n[i], e);
101
+ }), c;
102
+ }, "actions");
103
+
104
+ // src/actions/decorator.ts
105
+ var { document: v, Element: w } = F, N = /^(\S+)\s*(.*)$/, V = w != null && !w.prototype.matches, Y = V ? "msMatchesSelector" : "matches", _ = /* @__PURE__ */ r(
106
+ (o, e) => {
107
+ if (o[Y](e))
108
+ return !0;
109
+ let t = o.parentElement;
110
+ return t ? _(t, e) : !1;
111
+ }, "hasMatchInAncestry"), $ = /* @__PURE__ */ r((o, ...e) => {
112
+ let t = o(...e);
113
+ return Object.entries(t).map(([n, c]) => {
114
+ let [i, m, p] = n.match(N) || [];
115
+ return {
116
+ eventName: m,
117
+ handler: /* @__PURE__ */ r((l) => {
118
+ (!p || _(l.target, p)) && c(l);
119
+ }, "handler")
120
+ };
121
+ });
122
+ }, "createHandlers"), B = /* @__PURE__ */ r((o, ...e) => {
123
+ let t = v && v.getElementById("storybook-root");
124
+ C(() => {
125
+ if (t != null) {
126
+ let n = $(o, ...e);
127
+ return n.forEach(({ eventName: c, handler: i }) => t.addEventListener(c, i)), () => n.forEach(({ eventName: c, handler: i }) => t.removeEventListener(
128
+ c, i));
129
+ }
130
+ }, [t, o, e]);
131
+ }, "applyEventHandlers"), mt = M({
132
+ name: "withActions",
133
+ parameterName: h,
134
+ skipIfNoParametersOrOptions: !0,
135
+ wrapper: /* @__PURE__ */ r((o, e, { parameters: t }) => (t?.handles && B(b, ...t.handles), o(e)), "wrapper")
136
+ });
137
+ export {
138
+ mt as withActions
139
+ };