@storybook/addon-vitest 0.0.0-pr-32458-sha-6b5f19fe → 0.0.0-pr-32412-sha-4e0feb24

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.
@@ -0,0 +1,295 @@
1
+ import CJS_COMPAT_NODE_URL_tr2v1yz0ftg from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_tr2v1yz0ftg from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_tr2v1yz0ftg from "node:module";
4
+
5
+ var __filename = CJS_COMPAT_NODE_URL_tr2v1yz0ftg.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_tr2v1yz0ftg.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_tr2v1yz0ftg.createRequire(import.meta.url);
8
+
9
+ // ------------------------------------------------------------
10
+ // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
+ // ------------------------------------------------------------
12
+ import {
13
+ __name
14
+ } from "./chunk-X2ZIL2ID.js";
15
+
16
+ // src/utils.ts
17
+ function getAddonNames(mainConfig) {
18
+ const addons = mainConfig.addons || [];
19
+ const addonList = addons.map((addon) => {
20
+ let name = "";
21
+ if (typeof addon === "string") {
22
+ name = addon;
23
+ } else if (typeof addon === "object") {
24
+ name = addon.name;
25
+ }
26
+ return name;
27
+ });
28
+ return addonList.filter((item) => item != null);
29
+ }
30
+ __name(getAddonNames, "getAddonNames");
31
+ function errorToErrorLike(error) {
32
+ return {
33
+ message: error.message,
34
+ name: error.name,
35
+ // avoid duplicating the error message in the stack trace
36
+ stack: error.stack?.replace(error.message, ""),
37
+ cause: error.cause && error.cause instanceof Error ? errorToErrorLike(error.cause) : void 0
38
+ };
39
+ }
40
+ __name(errorToErrorLike, "errorToErrorLike");
41
+
42
+ // ../../node_modules/find-up/index.js
43
+ import path2 from "node:path";
44
+
45
+ // ../../node_modules/locate-path/index.js
46
+ import process from "node:process";
47
+ import path from "node:path";
48
+ import fs, { promises as fsPromises } from "node:fs";
49
+ import { fileURLToPath } from "node:url";
50
+
51
+ // ../../node_modules/yocto-queue/index.js
52
+ var Node = class {
53
+ static {
54
+ __name(this, "Node");
55
+ }
56
+ value;
57
+ next;
58
+ constructor(value) {
59
+ this.value = value;
60
+ }
61
+ };
62
+ var Queue = class {
63
+ static {
64
+ __name(this, "Queue");
65
+ }
66
+ #head;
67
+ #tail;
68
+ #size;
69
+ constructor() {
70
+ this.clear();
71
+ }
72
+ enqueue(value) {
73
+ const node = new Node(value);
74
+ if (this.#head) {
75
+ this.#tail.next = node;
76
+ this.#tail = node;
77
+ } else {
78
+ this.#head = node;
79
+ this.#tail = node;
80
+ }
81
+ this.#size++;
82
+ }
83
+ dequeue() {
84
+ const current = this.#head;
85
+ if (!current) {
86
+ return;
87
+ }
88
+ this.#head = this.#head.next;
89
+ this.#size--;
90
+ return current.value;
91
+ }
92
+ peek() {
93
+ if (!this.#head) {
94
+ return;
95
+ }
96
+ return this.#head.value;
97
+ }
98
+ clear() {
99
+ this.#head = void 0;
100
+ this.#tail = void 0;
101
+ this.#size = 0;
102
+ }
103
+ get size() {
104
+ return this.#size;
105
+ }
106
+ *[Symbol.iterator]() {
107
+ let current = this.#head;
108
+ while (current) {
109
+ yield current.value;
110
+ current = current.next;
111
+ }
112
+ }
113
+ *drain() {
114
+ while (this.#head) {
115
+ yield this.dequeue();
116
+ }
117
+ }
118
+ };
119
+
120
+ // ../../node_modules/locate-path/node_modules/p-limit/index.js
121
+ function pLimit(concurrency) {
122
+ if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
123
+ throw new TypeError("Expected `concurrency` to be a number from 1 and up");
124
+ }
125
+ const queue = new Queue();
126
+ let activeCount = 0;
127
+ const next = /* @__PURE__ */ __name(() => {
128
+ activeCount--;
129
+ if (queue.size > 0) {
130
+ queue.dequeue()();
131
+ }
132
+ }, "next");
133
+ const run = /* @__PURE__ */ __name(async (fn, resolve, args) => {
134
+ activeCount++;
135
+ const result = (async () => fn(...args))();
136
+ resolve(result);
137
+ try {
138
+ await result;
139
+ } catch {
140
+ }
141
+ next();
142
+ }, "run");
143
+ const enqueue = /* @__PURE__ */ __name((fn, resolve, args) => {
144
+ queue.enqueue(run.bind(void 0, fn, resolve, args));
145
+ (async () => {
146
+ await Promise.resolve();
147
+ if (activeCount < concurrency && queue.size > 0) {
148
+ queue.dequeue()();
149
+ }
150
+ })();
151
+ }, "enqueue");
152
+ const generator = /* @__PURE__ */ __name((fn, ...args) => new Promise((resolve) => {
153
+ enqueue(fn, resolve, args);
154
+ }), "generator");
155
+ Object.defineProperties(generator, {
156
+ activeCount: {
157
+ get: /* @__PURE__ */ __name(() => activeCount, "get")
158
+ },
159
+ pendingCount: {
160
+ get: /* @__PURE__ */ __name(() => queue.size, "get")
161
+ },
162
+ clearQueue: {
163
+ value: /* @__PURE__ */ __name(() => {
164
+ queue.clear();
165
+ }, "value")
166
+ }
167
+ });
168
+ return generator;
169
+ }
170
+ __name(pLimit, "pLimit");
171
+
172
+ // ../../node_modules/locate-path/node_modules/p-locate/index.js
173
+ var EndError = class extends Error {
174
+ static {
175
+ __name(this, "EndError");
176
+ }
177
+ constructor(value) {
178
+ super();
179
+ this.value = value;
180
+ }
181
+ };
182
+ var testElement = /* @__PURE__ */ __name(async (element, tester) => tester(await element), "testElement");
183
+ var finder = /* @__PURE__ */ __name(async (element) => {
184
+ const values = await Promise.all(element);
185
+ if (values[1] === true) {
186
+ throw new EndError(values[0]);
187
+ }
188
+ return false;
189
+ }, "finder");
190
+ async function pLocate(iterable, tester, {
191
+ concurrency = Number.POSITIVE_INFINITY,
192
+ preserveOrder = true
193
+ } = {}) {
194
+ const limit = pLimit(concurrency);
195
+ const items = [...iterable].map((element) => [element, limit(testElement, element, tester)]);
196
+ const checkLimit = pLimit(preserveOrder ? 1 : Number.POSITIVE_INFINITY);
197
+ try {
198
+ await Promise.all(items.map((element) => checkLimit(finder, element)));
199
+ } catch (error) {
200
+ if (error instanceof EndError) {
201
+ return error.value;
202
+ }
203
+ throw error;
204
+ }
205
+ }
206
+ __name(pLocate, "pLocate");
207
+
208
+ // ../../node_modules/locate-path/index.js
209
+ var typeMappings = {
210
+ directory: "isDirectory",
211
+ file: "isFile"
212
+ };
213
+ function checkType(type) {
214
+ if (Object.hasOwnProperty.call(typeMappings, type)) {
215
+ return;
216
+ }
217
+ throw new Error(`Invalid type specified: ${type}`);
218
+ }
219
+ __name(checkType, "checkType");
220
+ var matchType = /* @__PURE__ */ __name((type, stat) => stat[typeMappings[type]](), "matchType");
221
+ var toPath = /* @__PURE__ */ __name((urlOrPath) => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath, "toPath");
222
+ async function locatePath(paths, {
223
+ cwd = process.cwd(),
224
+ type = "file",
225
+ allowSymlinks = true,
226
+ concurrency,
227
+ preserveOrder
228
+ } = {}) {
229
+ checkType(type);
230
+ cwd = toPath(cwd);
231
+ const statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat;
232
+ return pLocate(paths, async (path_) => {
233
+ try {
234
+ const stat = await statFunction(path.resolve(cwd, path_));
235
+ return matchType(type, stat);
236
+ } catch {
237
+ return false;
238
+ }
239
+ }, { concurrency, preserveOrder });
240
+ }
241
+ __name(locatePath, "locatePath");
242
+
243
+ // ../../node_modules/find-up/node_modules/unicorn-magic/node.js
244
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
245
+ function toPath2(urlOrPath) {
246
+ return urlOrPath instanceof URL ? fileURLToPath2(urlOrPath) : urlOrPath;
247
+ }
248
+ __name(toPath2, "toPath");
249
+
250
+ // ../../node_modules/find-up/index.js
251
+ var findUpStop = Symbol("findUpStop");
252
+ async function findUpMultiple(name, options = {}) {
253
+ let directory = path2.resolve(toPath2(options.cwd) ?? "");
254
+ const { root } = path2.parse(directory);
255
+ const stopAt = path2.resolve(directory, toPath2(options.stopAt ?? root));
256
+ const limit = options.limit ?? Number.POSITIVE_INFINITY;
257
+ const paths = [name].flat();
258
+ const runMatcher = /* @__PURE__ */ __name(async (locateOptions) => {
259
+ if (typeof name !== "function") {
260
+ return locatePath(paths, locateOptions);
261
+ }
262
+ const foundPath = await name(locateOptions.cwd);
263
+ if (typeof foundPath === "string") {
264
+ return locatePath([foundPath], locateOptions);
265
+ }
266
+ return foundPath;
267
+ }, "runMatcher");
268
+ const matches = [];
269
+ while (true) {
270
+ const foundPath = await runMatcher({ ...options, cwd: directory });
271
+ if (foundPath === findUpStop) {
272
+ break;
273
+ }
274
+ if (foundPath) {
275
+ matches.push(path2.resolve(directory, foundPath));
276
+ }
277
+ if (directory === stopAt || matches.length >= limit) {
278
+ break;
279
+ }
280
+ directory = path2.dirname(directory);
281
+ }
282
+ return matches;
283
+ }
284
+ __name(findUpMultiple, "findUpMultiple");
285
+ async function findUp(name, options = {}) {
286
+ const matches = await findUpMultiple(name, { ...options, limit: 1 });
287
+ return matches[0];
288
+ }
289
+ __name(findUp, "findUp");
290
+
291
+ export {
292
+ getAddonNames,
293
+ errorToErrorLike,
294
+ findUp
295
+ };
package/dist/manager.js CHANGED
@@ -37,8 +37,8 @@ import { addons as addons2 } from "storybook/manager-api";
37
37
 
38
38
  // src/components/GlobalErrorModal.tsx
39
39
  import React, { useContext } from "react";
40
- import { Button, Modal } from "storybook/internal/components";
41
- import { SyncIcon } from "@storybook/icons";
40
+ import { Button, IconButton, Modal } from "storybook/internal/components";
41
+ import { CloseIcon, SyncIcon } from "@storybook/icons";
42
42
  import { useStorybookApi } from "storybook/manager-api";
43
43
  import { styled } from "storybook/theming";
44
44
  var ModalBar = styled.div({
@@ -85,6 +85,7 @@ __name(ErrorCause, "ErrorCause");
85
85
  function GlobalErrorModal({ onRerun, storeState }) {
86
86
  const api = useStorybookApi();
87
87
  const { isModalOpen, setModalOpen } = useContext(GlobalErrorContext);
88
+ const handleClose = /* @__PURE__ */ __name(() => setModalOpen?.(false), "handleClose");
88
89
  const troubleshootURL = api.getDocsUrl({
89
90
  subpath: DOCUMENTATION_FATAL_ERROR_LINK,
90
91
  versioned: true,
@@ -95,7 +96,7 @@ function GlobalErrorModal({ onRerun, storeState }) {
95
96
  currentRun: { unhandledErrors }
96
97
  } = storeState;
97
98
  const content = fatalError ? React.createElement(React.Fragment, null, React.createElement("p", null, fatalError.error.name || "Error"), fatalError.message && React.createElement("p", null, fatalError.message), fatalError.error.message && React.createElement("p", null, fatalError.error.message), fatalError.error.stack && React.createElement("p", null, fatalError.error.stack), fatalError.error.cause && React.createElement(ErrorCause, { error: fatalError.error.cause })) : unhandledErrors.length > 0 ? React.createElement("ol", null, unhandledErrors.map((error) => React.createElement("li", { key: error.name + error.message }, React.createElement("p", null, error.name, ": ", error.message), error.VITEST_TEST_PATH && React.createElement("p", null, 'This error originated in "', React.createElement("b", null, error.VITEST_TEST_PATH), `". It doesn't mean the error was thrown inside the file itself, but while it was running.`), error.VITEST_TEST_NAME && React.createElement(React.Fragment, null, React.createElement("p", null, `The latest test that might've caused the error is "`, React.createElement("b", null, error.VITEST_TEST_NAME), '". It might mean one of the following:'), React.createElement("ul", null, React.createElement("li", null, "The error was thrown, while Vitest was running this test."), React.createElement("li", null, "If the error occurred after the test had been completed, this was the last documented test before it was thrown."))), error.stacks && React.createElement(React.Fragment, null, React.createElement("p", null, React.createElement("b", null, "Stacks:")), React.createElement("ul", null, error.stacks.map((stack) => React.createElement("li", { key: stack.file + stack.line + stack.column }, stack.file, ":", stack.line, ":", stack.column, " - ", stack.method || "unknown method")))), error.stack && React.createElement("p", null, error.stack), error.cause ? React.createElement(ErrorCause, { error: error.cause }) : null))) : null;
98
- return React.createElement(Modal, { ariaLabel: "Storybook Tests error details", onOpenChange: setModalOpen, open: isModalOpen }, React.createElement(ModalBar, null, React.createElement(ModalTitle, null, "Storybook Tests error details"), React.createElement(ModalActionBar, null, React.createElement(Button, { onClick: onRerun, variant: "ghost", ariaLabel: false }, React.createElement(SyncIcon, null), "Rerun"), React.createElement(Button, { variant: "ghost", ariaLabel: false, asChild: true }, React.createElement("a", { target: "_blank", href: troubleshootURL, rel: "noreferrer" }, "Troubleshoot")), React.createElement(Modal.Close, null))), React.createElement(ModalStackTrace, null, content, React.createElement("br", null), React.createElement("br", null), "Troubleshoot:", " ", React.createElement(TroubleshootLink, { target: "_blank", href: troubleshootURL }, troubleshootURL)));
99
+ return React.createElement(Modal, { onEscapeKeyDown: handleClose, onInteractOutside: handleClose, open: isModalOpen }, React.createElement(ModalBar, null, React.createElement(ModalTitle, null, "Storybook Tests error details"), React.createElement(ModalActionBar, null, React.createElement(Button, { onClick: onRerun, variant: "ghost" }, React.createElement(SyncIcon, null), "Rerun"), React.createElement(Button, { variant: "ghost", asChild: true }, React.createElement("a", { target: "_blank", href: troubleshootURL, rel: "noreferrer" }, "Troubleshoot")), React.createElement(IconButton, { onClick: handleClose, "aria-label": "Close modal" }, React.createElement(CloseIcon, null)))), React.createElement(ModalStackTrace, null, content, React.createElement("br", null), React.createElement("br", null), "Troubleshoot:", " ", React.createElement(TroubleshootLink, { target: "_blank", href: troubleshootURL }, troubleshootURL)));
99
100
  }
100
101
  __name(GlobalErrorModal, "GlobalErrorModal");
101
102
 
@@ -433,11 +434,12 @@ var useTestProvider = /* @__PURE__ */ __name((api, entryId) => {
433
434
  // src/components/TestProviderRender.tsx
434
435
  import React3 from "react";
435
436
  import {
436
- Button as Button2,
437
437
  Form,
438
+ IconButton as IconButton2,
438
439
  ListItem,
439
440
  ProgressSpinner,
440
- ToggleButton
441
+ TooltipNote,
442
+ WithTooltip
441
443
  } from "storybook/internal/components";
442
444
  import { EyeIcon, InfoIcon, PlayHollowIcon, StopAltIcon } from "@storybook/icons";
443
445
  import { addons } from "storybook/manager-api";
@@ -550,8 +552,8 @@ var TestStatusIcon = styled3.div(
550
552
  "--status-background": `${theme.color.defaultText}66`
551
553
  },
552
554
  ({ status, theme }) => status === "unknown" && {
553
- "--status-color": theme.textMutedColor,
554
- "--status-background": `${theme.textMutedColor}66`
555
+ "--status-color": theme.color.mediumdark,
556
+ "--status-background": `${theme.color.mediumdark}66`
555
557
  }
556
558
  );
557
559
 
@@ -640,61 +642,76 @@ var TestProviderRender = /* @__PURE__ */ __name(({
640
642
  isSettingsUpdated
641
643
  }
642
644
  )), React3.createElement(Actions, null, !entry && React3.createElement(
643
- ToggleButton,
645
+ WithTooltip,
644
646
  {
645
- ariaLabel: isRunning ? "Watch mode (cannot toggle while running)" : "Watch mode",
646
- tooltip: isRunning ? "Watch mode unavailable while running" : `Watch mode is ${watching ? "enabled" : "disabled"}`,
647
- padding: "small",
648
- size: "medium",
649
- variant: "ghost",
650
- pressed: watching,
651
- onClick: () => store.send({
652
- type: "TOGGLE_WATCHING",
653
- payload: {
654
- to: !watching
655
- }
656
- }),
657
- disabled: isRunning
647
+ hasChrome: false,
648
+ trigger: "hover",
649
+ tooltip: React3.createElement(TooltipNote, { note: `${watching ? "Disable" : "Enable"} watch mode` })
658
650
  },
659
- React3.createElement(EyeIcon, null)
651
+ React3.createElement(
652
+ IconButton2,
653
+ {
654
+ "aria-label": `${watching ? "Disable" : "Enable"} watch mode`,
655
+ size: "medium",
656
+ active: watching,
657
+ onClick: () => store.send({
658
+ type: "TOGGLE_WATCHING",
659
+ payload: {
660
+ to: !watching
661
+ }
662
+ }),
663
+ disabled: isRunning
664
+ },
665
+ React3.createElement(EyeIcon, null)
666
+ )
660
667
  ), isRunning ? React3.createElement(
661
- Button2,
668
+ WithTooltip,
662
669
  {
663
- ariaLabel: cancelling ? "Stop test run (already stopping...)" : "Stop test run",
664
- padding: "none",
665
- size: "medium",
666
- variant: "ghost",
667
- onClick: () => store.send({
668
- type: "CANCEL_RUN"
669
- }),
670
- disabled: cancelling || isStarting
670
+ hasChrome: false,
671
+ trigger: "hover",
672
+ tooltip: React3.createElement(TooltipNote, { note: cancelling ? "Stopping..." : "Stop test run" })
671
673
  },
672
674
  React3.createElement(
673
- Progress,
675
+ IconButton2,
674
676
  {
675
- percentage: finishedTestCount && storeState.currentRun.totalTestCount ? finishedTestCount / storeState.currentRun.totalTestCount * 100 : void 0
677
+ "aria-label": cancelling ? "Stopping..." : "Stop test run",
678
+ padding: "none",
679
+ size: "medium",
680
+ onClick: () => store.send({
681
+ type: "CANCEL_RUN"
682
+ }),
683
+ disabled: cancelling || isStarting
676
684
  },
677
- React3.createElement(StopIcon, null)
685
+ React3.createElement(
686
+ Progress,
687
+ {
688
+ percentage: finishedTestCount && storeState.currentRun.totalTestCount ? finishedTestCount / storeState.currentRun.totalTestCount * 100 : void 0
689
+ },
690
+ React3.createElement(StopIcon, null)
691
+ )
678
692
  )
679
693
  ) : React3.createElement(
680
- Button2,
694
+ WithTooltip,
681
695
  {
682
- ariaLabel: "Start test run",
683
- padding: "small",
684
- size: "medium",
685
- variant: "ghost",
686
- onClick: () => {
687
- let storyIds;
688
- if (entry) {
689
- storyIds = entry.type === "story" ? [entry.id] : api.findAllLeafStoryIds(entry.id);
690
- }
691
- store.send({
692
- type: "TRIGGER_RUN",
693
- payload: { storyIds, triggeredBy: entry?.type ?? "global" }
694
- });
695
- }
696
+ hasChrome: false,
697
+ trigger: "hover",
698
+ tooltip: React3.createElement(TooltipNote, { note: "Start test run" })
696
699
  },
697
- React3.createElement(PlayHollowIcon, null)
700
+ React3.createElement(
701
+ IconButton2,
702
+ {
703
+ "aria-label": "Start test run",
704
+ size: "medium",
705
+ onClick: () => store.send({
706
+ type: "TRIGGER_RUN",
707
+ payload: {
708
+ storyIds: entry ? api.findAllLeafStoryIds(entry.id) : void 0,
709
+ triggeredBy: entry ? entry.type : "global"
710
+ }
711
+ })
712
+ },
713
+ React3.createElement(PlayHollowIcon, null)
714
+ )
698
715
  ))), React3.createElement(Extras, null, React3.createElement(Row, null, React3.createElement(
699
716
  ListItem,
700
717
  {
@@ -703,24 +720,35 @@ var TestProviderRender = /* @__PURE__ */ __name(({
703
720
  icon: entry ? null : React3.createElement(Form.Checkbox, { checked: true, disabled: true })
704
721
  }
705
722
  ), React3.createElement(
706
- Button2,
723
+ WithTooltip,
707
724
  {
708
- ariaLabel: `${componentTestStatusLabel}${componentTestStatusValueToStoryIds["status-value:error"].length + componentTestStatusValueToStoryIds["status-value:warning"].length > 0 ? ` (${componentTestStatusValueToStoryIds["status-value:error"].length + componentTestStatusValueToStoryIds["status-value:warning"].length} errors or warnings so far)` : ""}`,
709
- tooltip: componentTestStatusLabel,
710
- padding: "small",
711
- size: "medium",
712
- variant: "ghost",
713
- disabled: componentTestStatusValueToStoryIds["status-value:error"].length === 0 && componentTestStatusValueToStoryIds["status-value:warning"].length === 0 && componentTestStatusValueToStoryIds["status-value:success"].length === 0,
714
- onClick: () => {
715
- openPanel({
716
- api,
717
- panelId: PANEL_ID,
718
- entryId: componentTestStatusValueToStoryIds["status-value:error"][0] ?? componentTestStatusValueToStoryIds["status-value:warning"][0] ?? componentTestStatusValueToStoryIds["status-value:success"][0] ?? entry?.id
719
- });
720
- }
725
+ hasChrome: false,
726
+ trigger: "hover",
727
+ tooltip: React3.createElement(TooltipNote, { note: componentTestStatusLabel })
721
728
  },
722
- React3.createElement(TestStatusIcon, { status: componentTestStatusIcon, isRunning }),
723
- componentTestStatusValueToStoryIds["status-value:error"].length + componentTestStatusValueToStoryIds["status-value:warning"].length || null
729
+ React3.createElement(
730
+ IconButton2,
731
+ {
732
+ size: "medium",
733
+ disabled: componentTestStatusValueToStoryIds["status-value:error"].length === 0 && componentTestStatusValueToStoryIds["status-value:warning"].length === 0 && componentTestStatusValueToStoryIds["status-value:success"].length === 0,
734
+ onClick: () => {
735
+ openPanel({
736
+ api,
737
+ panelId: PANEL_ID,
738
+ entryId: componentTestStatusValueToStoryIds["status-value:error"][0] ?? componentTestStatusValueToStoryIds["status-value:warning"][0] ?? componentTestStatusValueToStoryIds["status-value:success"][0] ?? entry?.id
739
+ });
740
+ }
741
+ },
742
+ React3.createElement(
743
+ TestStatusIcon,
744
+ {
745
+ status: componentTestStatusIcon,
746
+ "aria-label": componentTestStatusLabel,
747
+ isRunning
748
+ }
749
+ ),
750
+ componentTestStatusValueToStoryIds["status-value:error"].length + componentTestStatusValueToStoryIds["status-value:warning"].length || null
751
+ )
724
752
  )), !entry && React3.createElement(Row, null, React3.createElement(
725
753
  ListItem,
726
754
  {
@@ -738,53 +766,39 @@ var TestProviderRender = /* @__PURE__ */ __name(({
738
766
  }
739
767
  )
740
768
  }
741
- ), watching || currentRun.triggeredBy && !FULL_RUN_TRIGGERS.includes(currentRun.triggeredBy) ? React3.createElement(
742
- Button2,
743
- {
744
- padding: "small",
745
- size: "medium",
746
- variant: "ghost",
747
- disabled: true,
748
- ariaLabel: watching ? `Coverage unavailable in watch mode` : `Coverage unavailable when running focused tests`
749
- },
750
- React3.createElement(InfoIcon, null)
751
- ) : currentRun.coverageSummary ? React3.createElement(
752
- Button2,
769
+ ), React3.createElement(
770
+ WithTooltip,
753
771
  {
754
- asChild: true,
755
- padding: "small",
756
- size: "medium",
757
- variant: "ghost",
758
- ariaLabel: (
759
- // FIXME: I can't deduce from the original tooltip logic whether this use case
760
- // is logically possible or not. It is a reachable conditional branch in the original code.
761
- isRunning ? "Open coverage report (testing still in progress)" : `Open coverage report (${currentRun.coverageSummary.percentage}% coverage)`
772
+ hasChrome: false,
773
+ trigger: "hover",
774
+ tooltip: React3.createElement(
775
+ TooltipNote,
776
+ {
777
+ note: watching ? "Unavailable in watch mode" : currentRun.triggeredBy && !FULL_RUN_TRIGGERS.includes(currentRun.triggeredBy) ? "Unavailable when running focused tests" : isRunning ? "Testing in progress" : currentRun.coverageSummary ? "View coverage report" : fatalError ? "Component tests crashed" : "Run tests to calculate coverage"
778
+ }
762
779
  )
763
780
  },
764
- React3.createElement("a", { href: "/coverage/index.html", target: "_blank" }, React3.createElement(
781
+ watching || currentRun.triggeredBy && !FULL_RUN_TRIGGERS.includes(currentRun.triggeredBy) ? React3.createElement(IconButton2, { size: "medium", disabled: true }, React3.createElement(
782
+ InfoIcon,
783
+ {
784
+ "aria-label": watching ? `Coverage is unavailable in watch mode` : `Coverage is unavailable when running focused tests`
785
+ }
786
+ )) : currentRun.coverageSummary ? React3.createElement(IconButton2, { asChild: true, size: "medium" }, React3.createElement("a", { href: "/coverage/index.html", target: "_blank", "aria-label": "Open coverage report" }, React3.createElement(
765
787
  TestStatusIcon,
766
788
  {
767
789
  isRunning,
768
790
  percentage: currentRun.coverageSummary.percentage,
769
- status: currentRun.coverageSummary.status
791
+ status: currentRun.coverageSummary.status,
792
+ "aria-label": `Coverage status: ${currentRun.coverageSummary.status}`
770
793
  }
771
- ), currentRun.coverageSummary.percentage, "%")
772
- ) : React3.createElement(
773
- Button2,
774
- {
775
- padding: "small",
776
- size: "medium",
777
- variant: "ghost",
778
- disabled: true,
779
- ariaLabel: isRunning ? "Coverage unavailable, testing still in progress" : fatalError ? "Coverage unavailable, component tests crashed" : "Coverage unavailable, run tests first"
780
- },
781
- React3.createElement(
794
+ ), React3.createElement("span", { "aria-label": `${currentRun.coverageSummary.percentage} percent coverage` }, currentRun.coverageSummary.percentage, "%"))) : React3.createElement(IconButton2, { size: "medium", disabled: true }, React3.createElement(
782
795
  TestStatusIcon,
783
796
  {
784
797
  isRunning,
785
- status: fatalError ? "critical" : "unknown"
798
+ status: fatalError ? "critical" : "unknown",
799
+ "aria-label": "Coverage status: unknown"
786
800
  }
787
- )
801
+ ))
788
802
  )), hasA11yAddon && React3.createElement(Row, null, React3.createElement(
789
803
  ListItem,
790
804
  {
@@ -803,23 +817,35 @@ var TestProviderRender = /* @__PURE__ */ __name(({
803
817
  )
804
818
  }
805
819
  ), React3.createElement(
806
- Button2,
820
+ WithTooltip,
807
821
  {
808
- ariaLabel: a11yStatusLabel,
809
- padding: "small",
810
- size: "medium",
811
- variant: "ghost",
812
- disabled: a11yStatusValueToStoryIds["status-value:error"].length === 0 && a11yStatusValueToStoryIds["status-value:warning"].length === 0 && a11yStatusValueToStoryIds["status-value:success"].length === 0,
813
- onClick: () => {
814
- openPanel({
815
- api,
816
- entryId: a11yStatusValueToStoryIds["status-value:error"][0] ?? a11yStatusValueToStoryIds["status-value:warning"][0] ?? a11yStatusValueToStoryIds["status-value:success"][0] ?? entry?.id,
817
- panelId: PANEL_ID2
818
- });
819
- }
822
+ hasChrome: false,
823
+ trigger: "hover",
824
+ tooltip: React3.createElement(TooltipNote, { note: a11yStatusLabel })
820
825
  },
821
- React3.createElement(TestStatusIcon, { status: a11yStatusIcon, isRunning }),
822
- a11yStatusValueToStoryIds["status-value:error"].length + a11yStatusValueToStoryIds["status-value:warning"].length || null
826
+ React3.createElement(
827
+ IconButton2,
828
+ {
829
+ size: "medium",
830
+ disabled: a11yStatusValueToStoryIds["status-value:error"].length === 0 && a11yStatusValueToStoryIds["status-value:warning"].length === 0 && a11yStatusValueToStoryIds["status-value:success"].length === 0,
831
+ onClick: () => {
832
+ openPanel({
833
+ api,
834
+ entryId: a11yStatusValueToStoryIds["status-value:error"][0] ?? a11yStatusValueToStoryIds["status-value:warning"][0] ?? a11yStatusValueToStoryIds["status-value:success"][0] ?? entry?.id,
835
+ panelId: PANEL_ID2
836
+ });
837
+ }
838
+ },
839
+ React3.createElement(
840
+ TestStatusIcon,
841
+ {
842
+ status: a11yStatusIcon,
843
+ "aria-label": a11yStatusLabel,
844
+ isRunning
845
+ }
846
+ ),
847
+ a11yStatusValueToStoryIds["status-value:error"].length + a11yStatusValueToStoryIds["status-value:warning"].length || null
848
+ )
823
849
  ))));
824
850
  }, "TestProviderRender");
825
851
 
@@ -1,23 +1,23 @@
1
- import CJS_COMPAT_NODE_URL_y82ktfk8gw from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_y82ktfk8gw from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_y82ktfk8gw from "node:module";
1
+ import CJS_COMPAT_NODE_URL_tr2v1yz0ftg from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_tr2v1yz0ftg from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_tr2v1yz0ftg from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_y82ktfk8gw.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_y82ktfk8gw.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_y82ktfk8gw.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_tr2v1yz0ftg.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_tr2v1yz0ftg.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_tr2v1yz0ftg.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
12
  import {
13
13
  require_gte
14
- } from "../_node-chunks/chunk-45EFBH2V.js";
14
+ } from "../_node-chunks/chunk-UJYZKRFO.js";
15
15
  import {
16
16
  __commonJS,
17
17
  __name,
18
18
  __require,
19
19
  __toESM
20
- } from "../_node-chunks/chunk-CA23L3FE.js";
20
+ } from "../_node-chunks/chunk-X2ZIL2ID.js";
21
21
 
22
22
  // ../../node_modules/istanbul-lib-report/node_modules/make-dir/index.js
23
23
  var require_make_dir = __commonJS({