@storybook/addon-a11y 10.1.0-alpha.9 → 10.1.0-beta.0
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/_browser-chunks/chunk-3FKQRDK3.js +13 -0
- package/dist/_browser-chunks/chunk-4BE7D4DS.js +9 -0
- package/dist/_browser-chunks/chunk-CQ2APV2R.js +163 -0
- package/dist/_browser-chunks/matchers-DMFSMG2O.js +1263 -0
- package/dist/index.js +4 -6
- package/dist/manager.js +554 -1741
- package/dist/postinstall.js +12 -7410
- package/dist/preview.js +3 -3
- package/package.json +4 -4
- package/dist/_browser-chunks/chunk-JFJ5UJ7Q.js +0 -11
- package/dist/_browser-chunks/chunk-JZJ5QO7P.js +0 -26
- package/dist/_browser-chunks/chunk-W2OC36OK.js +0 -217
- package/dist/_browser-chunks/matchers-ZRZBO4XZ.js +0 -1987
package/dist/manager.js
CHANGED
|
@@ -6,19 +6,17 @@ import {
|
|
|
6
6
|
PARAM_KEY,
|
|
7
7
|
STATUS_TYPE_ID_A11Y,
|
|
8
8
|
STATUS_TYPE_ID_COMPONENT_TEST
|
|
9
|
-
} from "./_browser-chunks/chunk-
|
|
10
|
-
import
|
|
11
|
-
__name
|
|
12
|
-
} from "./_browser-chunks/chunk-JFJ5UJ7Q.js";
|
|
9
|
+
} from "./_browser-chunks/chunk-3FKQRDK3.js";
|
|
10
|
+
import "./_browser-chunks/chunk-4BE7D4DS.js";
|
|
13
11
|
|
|
14
12
|
// src/manager.tsx
|
|
15
|
-
import
|
|
13
|
+
import React9 from "react";
|
|
16
14
|
import { Badge as Badge3 } from "storybook/internal/components";
|
|
17
15
|
import { addons, types, useAddonState as useAddonState2, useStorybookApi as useStorybookApi3 } from "storybook/manager-api";
|
|
18
16
|
|
|
19
17
|
// src/components/A11YPanel.tsx
|
|
20
|
-
import
|
|
21
|
-
import { Badge as Badge2, Button as
|
|
18
|
+
import React6, { useMemo as useMemo3 } from "react";
|
|
19
|
+
import { Badge as Badge2, Button as Button4 } from "storybook/internal/components";
|
|
22
20
|
import { SyncIcon as SyncIcon2 } from "@storybook/icons";
|
|
23
21
|
import { styled as styled5 } from "storybook/theming";
|
|
24
22
|
|
|
@@ -342,8 +340,7 @@ var axeRuleMapping_wcag_2_0_a_aa = {
|
|
|
342
340
|
axeSummary: "Ensure <video> elements have captions",
|
|
343
341
|
friendlySummary: "Provide captions for all <video> content."
|
|
344
342
|
}
|
|
345
|
-
}
|
|
346
|
-
var axeRuleMapping_wcag_2_1_a_aa = {
|
|
343
|
+
}, axeRuleMapping_wcag_2_1_a_aa = {
|
|
347
344
|
"autocomplete-valid": {
|
|
348
345
|
title: "autocomplete attribute valid",
|
|
349
346
|
axeSummary: "Ensure the autocomplete attribute is correct and suitable for the form field",
|
|
@@ -354,15 +351,13 @@ var axeRuleMapping_wcag_2_1_a_aa = {
|
|
|
354
351
|
axeSummary: "Ensure that text spacing set via inline styles can be adjusted with custom CSS",
|
|
355
352
|
friendlySummary: "Don't lock in text spacing with forced (!important) inline styles\u2014allow user CSS to adjust text spacing."
|
|
356
353
|
}
|
|
357
|
-
}
|
|
358
|
-
var axeRuleMapping_wcag_2_2_a_aa = {
|
|
354
|
+
}, axeRuleMapping_wcag_2_2_a_aa = {
|
|
359
355
|
"target-size": {
|
|
360
356
|
title: "Touch target size",
|
|
361
357
|
axeSummary: "Ensure touch targets have sufficient size and space",
|
|
362
358
|
friendlySummary: "Make sure interactive elements are big enough and not too close together for touch."
|
|
363
359
|
}
|
|
364
|
-
}
|
|
365
|
-
var axeRuleMapping_best_practices = {
|
|
360
|
+
}, axeRuleMapping_best_practices = {
|
|
366
361
|
accesskeys: {
|
|
367
362
|
title: "Unique accesskey",
|
|
368
363
|
axeSummary: "Ensure every accesskey attribute value is unique",
|
|
@@ -503,8 +498,7 @@ var axeRuleMapping_best_practices = {
|
|
|
503
498
|
axeSummary: "Ensure the <caption> does not duplicate the summary attribute text",
|
|
504
499
|
friendlySummary: "Don't use the same text in both a table's <caption> and its summary attribute."
|
|
505
500
|
}
|
|
506
|
-
}
|
|
507
|
-
var axeRuleMapping_wcag_2_x_aaa = {
|
|
501
|
+
}, axeRuleMapping_wcag_2_x_aaa = {
|
|
508
502
|
"color-contrast-enhanced": {
|
|
509
503
|
title: "Enhanced color contrast",
|
|
510
504
|
axeSummary: "Ensure contrast between text and background meets WCAG 2 AAA enhanced contrast thresholds",
|
|
@@ -520,8 +514,7 @@ var axeRuleMapping_wcag_2_x_aaa = {
|
|
|
520
514
|
axeSummary: 'Ensure <meta http-equiv="refresh"> is not used for delayed refresh (no exceptions)',
|
|
521
515
|
friendlySummary: `Don't auto-refresh or redirect pages using <meta http-equiv="refresh"> even with a delay.`
|
|
522
516
|
}
|
|
523
|
-
}
|
|
524
|
-
var axeRuleMapping_experimental = {
|
|
517
|
+
}, axeRuleMapping_experimental = {
|
|
525
518
|
"css-orientation-lock": {
|
|
526
519
|
title: "CSS orientation lock",
|
|
527
520
|
axeSummary: "Ensure content is not locked to a specific display orientation (works in all orientations)",
|
|
@@ -557,15 +550,13 @@ var axeRuleMapping_experimental = {
|
|
|
557
550
|
axeSummary: "Ensure each non-empty data cell in large tables (3\xD73+) has one or more headers",
|
|
558
551
|
friendlySummary: "Every data cell in large tables should be associated with at least one header cell."
|
|
559
552
|
}
|
|
560
|
-
}
|
|
561
|
-
var axeRuleMapping_deprecated = {
|
|
553
|
+
}, axeRuleMapping_deprecated = {
|
|
562
554
|
"aria-roledescription": {
|
|
563
555
|
title: "aria-roledescription",
|
|
564
556
|
axeSummary: "Ensure aria-roledescription is only used on elements with an implicit or explicit role",
|
|
565
557
|
friendlySummary: "Only use aria-roledescription on elements that already have a defined role."
|
|
566
558
|
}
|
|
567
|
-
}
|
|
568
|
-
var combinedRulesMap = {
|
|
559
|
+
}, combinedRulesMap = {
|
|
569
560
|
...axeRuleMapping_wcag_2_0_a_aa,
|
|
570
561
|
...axeRuleMapping_wcag_2_1_a_aa,
|
|
571
562
|
...axeRuleMapping_wcag_2_2_a_aa,
|
|
@@ -576,202 +567,142 @@ var combinedRulesMap = {
|
|
|
576
567
|
};
|
|
577
568
|
|
|
578
569
|
// src/axeRuleMappingHelper.ts
|
|
579
|
-
var getTitleForAxeResult =
|
|
580
|
-
var getFriendlySummaryForAxeResult = /* @__PURE__ */ __name((axeResult) => combinedRulesMap[axeResult.id]?.friendlySummary || axeResult.description, "getFriendlySummaryForAxeResult");
|
|
570
|
+
var getTitleForAxeResult = (axeResult) => combinedRulesMap[axeResult.id]?.title || axeResult.id, getFriendlySummaryForAxeResult = (axeResult) => combinedRulesMap[axeResult.id]?.friendlySummary || axeResult.description;
|
|
581
571
|
|
|
582
572
|
// src/components/A11yContext.tsx
|
|
583
|
-
var unhighlightedSelectors = ["html", "body", "main"]
|
|
584
|
-
var theme = convert(themes.light);
|
|
585
|
-
var colorsByType = {
|
|
573
|
+
var unhighlightedSelectors = ["html", "body", "main"], theme = convert(themes.light), colorsByType = {
|
|
586
574
|
[RuleType.VIOLATION]: theme.color.negative,
|
|
587
575
|
[RuleType.PASS]: theme.color.positive,
|
|
588
576
|
[RuleType.INCOMPLETION]: theme.color.warning
|
|
589
|
-
}
|
|
590
|
-
var A11yContext = createContext({
|
|
577
|
+
}, A11yContext = createContext({
|
|
591
578
|
parameters: {},
|
|
592
579
|
results: void 0,
|
|
593
|
-
highlighted:
|
|
594
|
-
toggleHighlight:
|
|
595
|
-
},
|
|
580
|
+
highlighted: !1,
|
|
581
|
+
toggleHighlight: () => {
|
|
582
|
+
},
|
|
596
583
|
tab: RuleType.VIOLATION,
|
|
597
|
-
handleCopyLink:
|
|
598
|
-
},
|
|
599
|
-
setTab:
|
|
600
|
-
},
|
|
601
|
-
setStatus:
|
|
602
|
-
},
|
|
584
|
+
handleCopyLink: () => {
|
|
585
|
+
},
|
|
586
|
+
setTab: () => {
|
|
587
|
+
},
|
|
588
|
+
setStatus: () => {
|
|
589
|
+
},
|
|
603
590
|
status: "initial",
|
|
604
591
|
error: void 0,
|
|
605
|
-
handleManual:
|
|
606
|
-
},
|
|
592
|
+
handleManual: () => {
|
|
593
|
+
},
|
|
607
594
|
discrepancy: null,
|
|
608
595
|
selectedItems: /* @__PURE__ */ new Map(),
|
|
609
|
-
allExpanded:
|
|
610
|
-
toggleOpen:
|
|
611
|
-
},
|
|
612
|
-
handleCollapseAll:
|
|
613
|
-
},
|
|
614
|
-
handleExpandAll:
|
|
615
|
-
},
|
|
616
|
-
handleJumpToElement:
|
|
617
|
-
},
|
|
618
|
-
handleSelectionChange:
|
|
619
|
-
}
|
|
620
|
-
})
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
const getInitialStatus = useCallback((manual2 = false) => manual2 ? "manual" : "initial", []);
|
|
626
|
-
const manual = useMemo(() => globals?.a11y?.manual ?? false, [globals?.a11y?.manual]);
|
|
627
|
-
const a11ySelection = useMemo(() => {
|
|
628
|
-
const value = api.getQueryParam("a11ySelection");
|
|
629
|
-
if (value) {
|
|
630
|
-
api.setQueryParams({ a11ySelection: "" });
|
|
631
|
-
}
|
|
632
|
-
return value;
|
|
633
|
-
}, [api]);
|
|
634
|
-
const [state, setState] = useAddonState(ADDON_ID, {
|
|
596
|
+
allExpanded: !1,
|
|
597
|
+
toggleOpen: () => {
|
|
598
|
+
},
|
|
599
|
+
handleCollapseAll: () => {
|
|
600
|
+
},
|
|
601
|
+
handleExpandAll: () => {
|
|
602
|
+
},
|
|
603
|
+
handleJumpToElement: () => {
|
|
604
|
+
},
|
|
605
|
+
handleSelectionChange: () => {
|
|
606
|
+
}
|
|
607
|
+
}), A11yContextProvider = (props) => {
|
|
608
|
+
let parameters = useParameter("a11y", {}), [globals] = useGlobals() ?? [], api = useStorybookApi(), getInitialStatus = useCallback((manual2 = !1) => manual2 ? "manual" : "initial", []), manual = useMemo(() => globals?.a11y?.manual ?? !1, [globals?.a11y?.manual]), a11ySelection = useMemo(() => {
|
|
609
|
+
let value = api.getQueryParam("a11ySelection");
|
|
610
|
+
return value && api.setQueryParams({ a11ySelection: "" }), value;
|
|
611
|
+
}, [api]), [state, setState] = useAddonState(ADDON_ID, {
|
|
635
612
|
ui: {
|
|
636
|
-
highlighted:
|
|
613
|
+
highlighted: !1,
|
|
637
614
|
tab: RuleType.VIOLATION
|
|
638
615
|
},
|
|
639
616
|
results: void 0,
|
|
640
617
|
error: void 0,
|
|
641
618
|
status: getInitialStatus(manual)
|
|
642
|
-
})
|
|
643
|
-
const { ui, results, error, status } = state;
|
|
644
|
-
const { storyId } = useStorybookState();
|
|
645
|
-
const currentStoryA11yStatusValue = experimental_useStatusStore(
|
|
619
|
+
}), { ui, results, error, status } = state, { storyId } = useStorybookState(), currentStoryA11yStatusValue = experimental_useStatusStore(
|
|
646
620
|
(allStatuses) => allStatuses[storyId]?.[STATUS_TYPE_ID_A11Y]?.value
|
|
647
621
|
);
|
|
648
|
-
useEffect(() =>
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
);
|
|
658
|
-
return unsubscribe;
|
|
659
|
-
}, [setState, storyId]);
|
|
660
|
-
const handleToggleHighlight = useCallback(() => {
|
|
622
|
+
useEffect(() => experimental_getStatusStore("storybook/component-test").onAllStatusChange(
|
|
623
|
+
(statuses, previousStatuses) => {
|
|
624
|
+
let current = statuses[storyId]?.[STATUS_TYPE_ID_COMPONENT_TEST], previous = previousStatuses[storyId]?.[STATUS_TYPE_ID_COMPONENT_TEST];
|
|
625
|
+
current?.value === "status-value:error" && previous?.value !== "status-value:error" && setState((prev) => ({ ...prev, status: "component-test-error" }));
|
|
626
|
+
}
|
|
627
|
+
), [setState, storyId]);
|
|
628
|
+
let handleToggleHighlight = useCallback(() => {
|
|
661
629
|
setState((prev) => ({ ...prev, ui: { ...prev.ui, highlighted: !prev.ui.highlighted } }));
|
|
662
|
-
}, [setState])
|
|
663
|
-
|
|
664
|
-
const initialValue = /* @__PURE__ */ new Map();
|
|
630
|
+
}, [setState]), [selectedItems, setSelectedItems] = useState(() => {
|
|
631
|
+
let initialValue = /* @__PURE__ */ new Map();
|
|
665
632
|
if (a11ySelection && /^[a-z]+.[a-z-]+.[0-9]+$/.test(a11ySelection)) {
|
|
666
|
-
|
|
633
|
+
let [type, id] = a11ySelection.split(".");
|
|
667
634
|
initialValue.set(`${type}.${id}`, a11ySelection);
|
|
668
635
|
}
|
|
669
636
|
return initialValue;
|
|
670
|
-
})
|
|
671
|
-
const allExpanded = useMemo(() => {
|
|
672
|
-
const currentResults = results?.[ui.tab];
|
|
673
|
-
return currentResults?.every((result) => selectedItems.has(`${ui.tab}.${result.id}`)) ?? false;
|
|
674
|
-
}, [results, selectedItems, ui.tab]);
|
|
675
|
-
const toggleOpen = useCallback(
|
|
637
|
+
}), allExpanded = useMemo(() => results?.[ui.tab]?.every((result) => selectedItems.has(`${ui.tab}.${result.id}`)) ?? !1, [results, selectedItems, ui.tab]), toggleOpen = useCallback(
|
|
676
638
|
(event, type, item) => {
|
|
677
639
|
event.stopPropagation();
|
|
678
|
-
|
|
640
|
+
let key = `${type}.${item.id}`;
|
|
679
641
|
setSelectedItems((prev) => new Map(prev.delete(key) ? prev : prev.set(key, `${key}.1`)));
|
|
680
642
|
},
|
|
681
643
|
[]
|
|
682
|
-
)
|
|
683
|
-
const handleCollapseAll = useCallback(() => {
|
|
644
|
+
), handleCollapseAll = useCallback(() => {
|
|
684
645
|
setSelectedItems(/* @__PURE__ */ new Map());
|
|
685
|
-
}, [])
|
|
686
|
-
const handleExpandAll = useCallback(() => {
|
|
646
|
+
}, []), handleExpandAll = useCallback(() => {
|
|
687
647
|
setSelectedItems(
|
|
688
648
|
(prev) => new Map(
|
|
689
649
|
results?.[ui.tab]?.map((result) => {
|
|
690
|
-
|
|
650
|
+
let key = `${ui.tab}.${result.id}`;
|
|
691
651
|
return [key, prev.get(key) ?? `${key}.1`];
|
|
692
652
|
}) ?? []
|
|
693
653
|
)
|
|
694
654
|
);
|
|
695
|
-
}, [results, ui.tab])
|
|
696
|
-
|
|
697
|
-
const [type, id] = key.split(".");
|
|
655
|
+
}, [results, ui.tab]), handleSelectionChange = useCallback((key) => {
|
|
656
|
+
let [type, id] = key.split(".");
|
|
698
657
|
setSelectedItems((prev) => new Map(prev.set(`${type}.${id}`, key)));
|
|
699
|
-
}, [])
|
|
700
|
-
const handleError = useCallback(
|
|
658
|
+
}, []), handleError = useCallback(
|
|
701
659
|
(err) => {
|
|
702
660
|
setState((prev) => ({ ...prev, status: "error", error: err }));
|
|
703
661
|
},
|
|
704
662
|
[setState]
|
|
705
|
-
)
|
|
706
|
-
const handleResult = useCallback(
|
|
663
|
+
), handleResult = useCallback(
|
|
707
664
|
(axeResults, id) => {
|
|
708
|
-
|
|
709
|
-
setState((prev) =>
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
setSelectedItems((prev) => {
|
|
718
|
-
if (prev.size === 1) {
|
|
719
|
-
const [key] = prev.values();
|
|
720
|
-
document.getElementById(key)?.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
721
|
-
}
|
|
722
|
-
return prev;
|
|
723
|
-
});
|
|
724
|
-
}, 900);
|
|
725
|
-
}
|
|
665
|
+
storyId === id && (setState((prev) => ({ ...prev, status: "ran", results: axeResults })), setTimeout(() => {
|
|
666
|
+
setState((prev) => prev.status === "ran" ? { ...prev, status: "ready" } : prev), setSelectedItems((prev) => {
|
|
667
|
+
if (prev.size === 1) {
|
|
668
|
+
let [key] = prev.values();
|
|
669
|
+
document.getElementById(key)?.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
670
|
+
}
|
|
671
|
+
return prev;
|
|
672
|
+
});
|
|
673
|
+
}, 900));
|
|
726
674
|
},
|
|
727
675
|
[storyId, setState, setSelectedItems]
|
|
728
|
-
)
|
|
729
|
-
const handleSelect = useCallback(
|
|
676
|
+
), handleSelect = useCallback(
|
|
730
677
|
(itemId, details) => {
|
|
731
|
-
|
|
732
|
-
const { helpUrl, nodes } = results?.[type]?.find((r) => r.id === id) || {};
|
|
733
|
-
const openedWindow = helpUrl && window.open(helpUrl, "_blank", "noopener,noreferrer");
|
|
678
|
+
let [type, id] = itemId.split("."), { helpUrl, nodes } = results?.[type]?.find((r) => r.id === id) || {}, openedWindow = helpUrl && window.open(helpUrl, "_blank", "noopener,noreferrer");
|
|
734
679
|
if (nodes && !openedWindow) {
|
|
735
|
-
|
|
680
|
+
let index = nodes.findIndex((n) => details.selectors.some((s) => s === String(n.target))) ?? -1;
|
|
736
681
|
if (index !== -1) {
|
|
737
|
-
|
|
738
|
-
setSelectedItems(/* @__PURE__ */ new Map([[`${type}.${id}`, key]]))
|
|
739
|
-
setTimeout(() => {
|
|
682
|
+
let key = `${type}.${id}.${index + 1}`;
|
|
683
|
+
setSelectedItems(/* @__PURE__ */ new Map([[`${type}.${id}`, key]])), setTimeout(() => {
|
|
740
684
|
document.getElementById(key)?.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
741
685
|
}, 100);
|
|
742
686
|
}
|
|
743
687
|
}
|
|
744
688
|
},
|
|
745
689
|
[results]
|
|
746
|
-
)
|
|
747
|
-
const handleReport = useCallback(
|
|
690
|
+
), handleReport = useCallback(
|
|
748
691
|
({ reporters }) => {
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
if ("error" in a11yReport.result) {
|
|
752
|
-
handleError(a11yReport.result.error);
|
|
753
|
-
} else {
|
|
754
|
-
handleResult(a11yReport.result, storyId);
|
|
755
|
-
}
|
|
756
|
-
}
|
|
692
|
+
let a11yReport = reporters.find((r) => r.type === "a11y");
|
|
693
|
+
a11yReport && ("error" in a11yReport.result ? handleError(a11yReport.result.error) : handleResult(a11yReport.result, storyId));
|
|
757
694
|
},
|
|
758
695
|
[handleError, handleResult, storyId]
|
|
759
|
-
)
|
|
760
|
-
const handleReset = useCallback(
|
|
696
|
+
), handleReset = useCallback(
|
|
761
697
|
({ newPhase }) => {
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
}));
|
|
768
|
-
} else if (newPhase === "afterEach" && !manual) {
|
|
769
|
-
setState((prev) => ({ ...prev, status: "running" }));
|
|
770
|
-
}
|
|
698
|
+
newPhase === "loading" ? setState((prev) => ({
|
|
699
|
+
...prev,
|
|
700
|
+
results: void 0,
|
|
701
|
+
status: manual ? "manual" : "initial"
|
|
702
|
+
})) : newPhase === "afterEach" && !manual && setState((prev) => ({ ...prev, status: "running" }));
|
|
771
703
|
},
|
|
772
704
|
[manual, setState]
|
|
773
|
-
)
|
|
774
|
-
const emit = useChannel(
|
|
705
|
+
), emit = useChannel(
|
|
775
706
|
{
|
|
776
707
|
[EVENTS.RESULT]: handleResult,
|
|
777
708
|
[EVENTS.ERROR]: handleError,
|
|
@@ -780,143 +711,117 @@ var A11yContextProvider = /* @__PURE__ */ __name((props) => {
|
|
|
780
711
|
[STORY_RENDER_PHASE_CHANGED]: handleReset,
|
|
781
712
|
[STORY_FINISHED]: handleReport,
|
|
782
713
|
[STORY_HOT_UPDATED]: () => {
|
|
783
|
-
setState((prev) => ({ ...prev, status: "running" }));
|
|
784
|
-
emit(EVENTS.MANUAL, storyId, parameters);
|
|
714
|
+
setState((prev) => ({ ...prev, status: "running" })), emit(EVENTS.MANUAL, storyId, parameters);
|
|
785
715
|
}
|
|
786
716
|
},
|
|
787
717
|
[handleReset, handleReport, handleSelect, handleError, handleResult, parameters, storyId]
|
|
788
|
-
)
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
}, [emit, parameters, setState, storyId]);
|
|
793
|
-
const handleCopyLink = useCallback(async (linkPath) => {
|
|
794
|
-
const { createCopyToClipboardFunction } = await import("storybook/internal/components");
|
|
718
|
+
), handleManual = useCallback(() => {
|
|
719
|
+
setState((prev) => ({ ...prev, status: "running" })), emit(EVENTS.MANUAL, storyId, parameters);
|
|
720
|
+
}, [emit, parameters, setState, storyId]), handleCopyLink = useCallback(async (linkPath) => {
|
|
721
|
+
let { createCopyToClipboardFunction } = await import("storybook/internal/components");
|
|
795
722
|
await createCopyToClipboardFunction()(`${window.location.origin}${linkPath}`);
|
|
796
|
-
}, [])
|
|
797
|
-
const handleJumpToElement = useCallback(
|
|
723
|
+
}, []), handleJumpToElement = useCallback(
|
|
798
724
|
(target) => emit(SCROLL_INTO_VIEW, target),
|
|
799
725
|
[emit]
|
|
800
726
|
);
|
|
801
727
|
useEffect(() => {
|
|
802
728
|
setState((prev) => ({ ...prev, status: getInitialStatus(manual) }));
|
|
803
729
|
}, [getInitialStatus, manual, setState]);
|
|
804
|
-
|
|
730
|
+
let isInitial = status === "initial";
|
|
805
731
|
useEffect(() => {
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
setState((prev) => {
|
|
810
|
-
const update = { ...prev.ui, highlighted: true };
|
|
811
|
-
const [type] = a11ySelection.split(".") ?? [];
|
|
812
|
-
if (type && Object.values(RuleType).includes(type)) {
|
|
813
|
-
update.tab = type;
|
|
814
|
-
}
|
|
815
|
-
return { ...prev, ui: update };
|
|
732
|
+
a11ySelection && setState((prev) => {
|
|
733
|
+
let update = { ...prev.ui, highlighted: !0 }, [type] = a11ySelection.split(".") ?? [];
|
|
734
|
+
return type && Object.values(RuleType).includes(type) && (update.tab = type), { ...prev, ui: update };
|
|
816
735
|
});
|
|
817
|
-
}, [a11ySelection])
|
|
818
|
-
|
|
819
|
-
emit(REMOVE_HIGHLIGHT, `${ADDON_ID}/selected`);
|
|
820
|
-
emit(REMOVE_HIGHLIGHT, `${ADDON_ID}/others`);
|
|
821
|
-
if (!ui.highlighted || isInitial) {
|
|
736
|
+
}, [a11ySelection]), useEffect(() => {
|
|
737
|
+
if (emit(REMOVE_HIGHLIGHT, `${ADDON_ID}/selected`), emit(REMOVE_HIGHLIGHT, `${ADDON_ID}/others`), !ui.highlighted || isInitial)
|
|
822
738
|
return;
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
if (type !== ui.tab) {
|
|
739
|
+
let selected = Array.from(selectedItems.values()).flatMap((key) => {
|
|
740
|
+
let [type, id, number] = key.split(".");
|
|
741
|
+
if (type !== ui.tab)
|
|
827
742
|
return [];
|
|
828
|
-
|
|
829
|
-
const result = results?.[type]?.find((r) => r.id === id);
|
|
830
|
-
const target = result?.nodes[Number(number) - 1]?.target;
|
|
743
|
+
let target = results?.[type]?.find((r) => r.id === id)?.nodes[Number(number) - 1]?.target;
|
|
831
744
|
return target ? [String(target)] : [];
|
|
832
745
|
});
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
{
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
{
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
];
|
|
902
|
-
})
|
|
903
|
-
});
|
|
904
|
-
}
|
|
746
|
+
selected.length && emit(HIGHLIGHT, {
|
|
747
|
+
id: `${ADDON_ID}/selected`,
|
|
748
|
+
priority: 1,
|
|
749
|
+
selectors: selected,
|
|
750
|
+
styles: {
|
|
751
|
+
outline: `1px solid color-mix(in srgb, ${colorsByType[ui.tab]}, transparent 30%)`,
|
|
752
|
+
backgroundColor: "transparent"
|
|
753
|
+
},
|
|
754
|
+
hoverStyles: {
|
|
755
|
+
outlineWidth: "2px"
|
|
756
|
+
},
|
|
757
|
+
focusStyles: {
|
|
758
|
+
backgroundColor: "transparent"
|
|
759
|
+
},
|
|
760
|
+
menu: results?.[ui.tab].map((result) => {
|
|
761
|
+
let selectors = result.nodes.flatMap((n) => n.target).map(String).filter((e) => selected.includes(e));
|
|
762
|
+
return [
|
|
763
|
+
{
|
|
764
|
+
id: `${ui.tab}.${result.id}:info`,
|
|
765
|
+
title: getTitleForAxeResult(result),
|
|
766
|
+
description: getFriendlySummaryForAxeResult(result),
|
|
767
|
+
selectors
|
|
768
|
+
},
|
|
769
|
+
{
|
|
770
|
+
id: `${ui.tab}.${result.id}`,
|
|
771
|
+
iconLeft: "info",
|
|
772
|
+
iconRight: "shareAlt",
|
|
773
|
+
title: "Learn how to resolve this violation",
|
|
774
|
+
clickEvent: EVENTS.SELECT,
|
|
775
|
+
selectors
|
|
776
|
+
}
|
|
777
|
+
];
|
|
778
|
+
})
|
|
779
|
+
});
|
|
780
|
+
let others = results?.[ui.tab].flatMap((r) => r.nodes.flatMap((n) => n.target).map(String)).filter((e) => ![...unhighlightedSelectors, ...selected].includes(e));
|
|
781
|
+
others?.length && emit(HIGHLIGHT, {
|
|
782
|
+
id: `${ADDON_ID}/others`,
|
|
783
|
+
selectors: others,
|
|
784
|
+
styles: {
|
|
785
|
+
outline: `1px solid color-mix(in srgb, ${colorsByType[ui.tab]}, transparent 30%)`,
|
|
786
|
+
backgroundColor: `color-mix(in srgb, ${colorsByType[ui.tab]}, transparent 60%)`
|
|
787
|
+
},
|
|
788
|
+
hoverStyles: {
|
|
789
|
+
outlineWidth: "2px"
|
|
790
|
+
},
|
|
791
|
+
focusStyles: {
|
|
792
|
+
backgroundColor: "transparent"
|
|
793
|
+
},
|
|
794
|
+
menu: results?.[ui.tab].map((result) => {
|
|
795
|
+
let selectors = result.nodes.flatMap((n) => n.target).map(String).filter((e) => !selected.includes(e));
|
|
796
|
+
return [
|
|
797
|
+
{
|
|
798
|
+
id: `${ui.tab}.${result.id}:info`,
|
|
799
|
+
title: getTitleForAxeResult(result),
|
|
800
|
+
description: getFriendlySummaryForAxeResult(result),
|
|
801
|
+
selectors
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
id: `${ui.tab}.${result.id}`,
|
|
805
|
+
iconLeft: "info",
|
|
806
|
+
iconRight: "shareAlt",
|
|
807
|
+
title: "Learn how to resolve this violation",
|
|
808
|
+
clickEvent: EVENTS.SELECT,
|
|
809
|
+
selectors
|
|
810
|
+
}
|
|
811
|
+
];
|
|
812
|
+
})
|
|
813
|
+
});
|
|
905
814
|
}, [isInitial, emit, ui.highlighted, results, ui.tab, selectedItems]);
|
|
906
|
-
|
|
907
|
-
if (!currentStoryA11yStatusValue)
|
|
815
|
+
let discrepancy = useMemo(() => {
|
|
816
|
+
if (!currentStoryA11yStatusValue)
|
|
908
817
|
return null;
|
|
909
|
-
|
|
910
|
-
if (currentStoryA11yStatusValue === "status-value:success" && results?.violations.length) {
|
|
818
|
+
if (currentStoryA11yStatusValue === "status-value:success" && results?.violations.length)
|
|
911
819
|
return "cliPassedBrowserFailed";
|
|
912
|
-
}
|
|
913
820
|
if (currentStoryA11yStatusValue === "status-value:error" && !results?.violations.length) {
|
|
914
|
-
if (status === "ready" || status === "ran")
|
|
821
|
+
if (status === "ready" || status === "ran")
|
|
915
822
|
return "browserPassedCliFailed";
|
|
916
|
-
|
|
917
|
-
if (status === "manual") {
|
|
823
|
+
if (status === "manual")
|
|
918
824
|
return "cliFailedButModeManual";
|
|
919
|
-
}
|
|
920
825
|
}
|
|
921
826
|
return null;
|
|
922
827
|
}, [results?.violations.length, status, currentStoryA11yStatusValue]);
|
|
@@ -953,12 +858,11 @@ var A11yContextProvider = /* @__PURE__ */ __name((props) => {
|
|
|
953
858
|
...props
|
|
954
859
|
}
|
|
955
860
|
);
|
|
956
|
-
},
|
|
957
|
-
var useA11yContext = /* @__PURE__ */ __name(() => useContext(A11yContext), "useA11yContext");
|
|
861
|
+
}, useA11yContext = () => useContext(A11yContext);
|
|
958
862
|
|
|
959
863
|
// src/components/Report/Report.tsx
|
|
960
864
|
import React3 from "react";
|
|
961
|
-
import { Badge,
|
|
865
|
+
import { Badge, Button as Button2, EmptyTabContent } from "storybook/internal/components";
|
|
962
866
|
import { ChevronSmallDownIcon } from "@storybook/icons";
|
|
963
867
|
import { styled as styled2 } from "storybook/theming";
|
|
964
868
|
|
|
@@ -977,35 +881,29 @@ function _extends() {
|
|
|
977
881
|
return n;
|
|
978
882
|
}, _extends.apply(null, arguments);
|
|
979
883
|
}
|
|
980
|
-
__name(_extends, "_extends");
|
|
981
884
|
|
|
982
885
|
// ../../node_modules/@radix-ui/react-tabs/dist/index.mjs
|
|
983
886
|
import { forwardRef as $1IHzk$forwardRef, createElement as $1IHzk$createElement, useRef as $1IHzk$useRef, useEffect as $1IHzk$useEffect } from "react";
|
|
984
887
|
|
|
985
888
|
// ../../node_modules/@radix-ui/primitive/dist/index.mjs
|
|
986
|
-
function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented =
|
|
987
|
-
return
|
|
988
|
-
originalEventHandler ===
|
|
989
|
-
|
|
990
|
-
}, "handleEvent");
|
|
889
|
+
function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = !0 } = {}) {
|
|
890
|
+
return function(event) {
|
|
891
|
+
if (originalEventHandler?.(event), checkForDefaultPrevented === !1 || !event.defaultPrevented) return ourEventHandler?.(event);
|
|
892
|
+
};
|
|
991
893
|
}
|
|
992
|
-
__name($e42e1063c40fb3ef$export$b9ecd428b558ff10, "$e42e1063c40fb3ef$export$b9ecd428b558ff10");
|
|
993
894
|
|
|
994
895
|
// ../../node_modules/@radix-ui/react-context/dist/index.mjs
|
|
995
896
|
import { createContext as $3bkAK$createContext, useMemo as $3bkAK$useMemo, createElement as $3bkAK$createElement, useContext as $3bkAK$useContext } from "react";
|
|
996
897
|
function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {
|
|
997
898
|
let defaultContexts = [];
|
|
998
899
|
function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
|
|
999
|
-
|
|
1000
|
-
const index = defaultContexts.length;
|
|
900
|
+
let BaseContext = $3bkAK$createContext(defaultContext), index = defaultContexts.length;
|
|
1001
901
|
defaultContexts = [
|
|
1002
902
|
...defaultContexts,
|
|
1003
903
|
defaultContext
|
|
1004
904
|
];
|
|
1005
905
|
function Provider(props) {
|
|
1006
|
-
|
|
1007
|
-
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
|
|
1008
|
-
const value = $3bkAK$useMemo(
|
|
906
|
+
let { scope, children, ...context } = props, Context = scope?.[scopeName][index] || BaseContext, value = $3bkAK$useMemo(
|
|
1009
907
|
() => context,
|
|
1010
908
|
Object.values(context)
|
|
1011
909
|
);
|
|
@@ -1013,28 +911,21 @@ function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeD
|
|
|
1013
911
|
value
|
|
1014
912
|
}, children);
|
|
1015
913
|
}
|
|
1016
|
-
__name(Provider, "Provider");
|
|
1017
914
|
function useContext2(consumerName, scope) {
|
|
1018
|
-
|
|
1019
|
-
const context = $3bkAK$useContext(Context);
|
|
915
|
+
let Context = scope?.[scopeName][index] || BaseContext, context = $3bkAK$useContext(Context);
|
|
1020
916
|
if (context) return context;
|
|
1021
917
|
if (defaultContext !== void 0) return defaultContext;
|
|
1022
918
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
1023
919
|
}
|
|
1024
|
-
|
|
1025
|
-
Provider.displayName = rootComponentName + "Provider";
|
|
1026
|
-
return [
|
|
920
|
+
return Provider.displayName = rootComponentName + "Provider", [
|
|
1027
921
|
Provider,
|
|
1028
922
|
useContext2
|
|
1029
923
|
];
|
|
1030
924
|
}
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
});
|
|
1036
|
-
return /* @__PURE__ */ __name(function useScope(scope) {
|
|
1037
|
-
const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
|
|
925
|
+
let createScope = () => {
|
|
926
|
+
let scopeContexts = defaultContexts.map((defaultContext) => $3bkAK$createContext(defaultContext));
|
|
927
|
+
return function(scope) {
|
|
928
|
+
let contexts = scope?.[scopeName] || scopeContexts;
|
|
1038
929
|
return $3bkAK$useMemo(
|
|
1039
930
|
() => ({
|
|
1040
931
|
[`__scope${scopeName}`]: {
|
|
@@ -1047,29 +938,26 @@ function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeD
|
|
|
1047
938
|
contexts
|
|
1048
939
|
]
|
|
1049
940
|
);
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1052
|
-
createScope.scopeName = scopeName
|
|
1053
|
-
return [
|
|
941
|
+
};
|
|
942
|
+
};
|
|
943
|
+
return createScope.scopeName = scopeName, [
|
|
1054
944
|
$c512c27ab02ef895$export$fd42f52fd3ae1109,
|
|
1055
945
|
$c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps)
|
|
1056
946
|
];
|
|
1057
947
|
}
|
|
1058
|
-
__name($c512c27ab02ef895$export$50c7b4e9d9f19c1, "$c512c27ab02ef895$export$50c7b4e9d9f19c1");
|
|
1059
948
|
function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
|
|
1060
|
-
|
|
949
|
+
let baseScope = scopes[0];
|
|
1061
950
|
if (scopes.length === 1) return baseScope;
|
|
1062
|
-
|
|
1063
|
-
|
|
951
|
+
let createScope1 = () => {
|
|
952
|
+
let scopeHooks = scopes.map(
|
|
1064
953
|
(createScope) => ({
|
|
1065
954
|
useScope: createScope(),
|
|
1066
955
|
scopeName: createScope.scopeName
|
|
1067
956
|
})
|
|
1068
957
|
);
|
|
1069
|
-
return
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
958
|
+
return function(overrideScopes) {
|
|
959
|
+
let nextScopes1 = scopeHooks.reduce((nextScopes, { useScope, scopeName }) => {
|
|
960
|
+
let currentScope = useScope(overrideScopes)[`__scope${scopeName}`];
|
|
1073
961
|
return {
|
|
1074
962
|
...nextScopes,
|
|
1075
963
|
...currentScope
|
|
@@ -1083,12 +971,10 @@ function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
|
|
|
1083
971
|
nextScopes1
|
|
1084
972
|
]
|
|
1085
973
|
);
|
|
1086
|
-
}
|
|
1087
|
-
}
|
|
1088
|
-
createScope1.scopeName = baseScope.scopeName;
|
|
1089
|
-
return createScope1;
|
|
974
|
+
};
|
|
975
|
+
};
|
|
976
|
+
return createScope1.scopeName = baseScope.scopeName, createScope1;
|
|
1090
977
|
}
|
|
1091
|
-
__name($c512c27ab02ef895$var$composeContextScopes, "$c512c27ab02ef895$var$composeContextScopes");
|
|
1092
978
|
|
|
1093
979
|
// ../../node_modules/@radix-ui/react-roving-focus/dist/index.mjs
|
|
1094
980
|
import { forwardRef as $98Iye$forwardRef, createElement as $98Iye$createElement, useRef as $98Iye$useRef, useState as $98Iye$useState, useEffect as $98Iye$useEffect, useCallback as $98Iye$useCallback } from "react";
|
|
@@ -1096,38 +982,26 @@ import { forwardRef as $98Iye$forwardRef, createElement as $98Iye$createElement,
|
|
|
1096
982
|
// ../../node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
1097
983
|
import $6vYhU$react from "react";
|
|
1098
984
|
|
|
1099
|
-
// ../../node_modules/@radix-ui/react-
|
|
985
|
+
// ../../node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
1100
986
|
import { useCallback as $3vqmr$useCallback } from "react";
|
|
1101
987
|
function $6ed0406888f73fc4$var$setRef(ref, value) {
|
|
1102
|
-
|
|
1103
|
-
else if (ref !== null && ref !== void 0) ref.current = value;
|
|
988
|
+
typeof ref == "function" ? ref(value) : ref != null && (ref.current = value);
|
|
1104
989
|
}
|
|
1105
|
-
__name($6ed0406888f73fc4$var$setRef, "$6ed0406888f73fc4$var$setRef");
|
|
1106
990
|
function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
|
|
1107
991
|
return (node) => refs.forEach(
|
|
1108
992
|
(ref) => $6ed0406888f73fc4$var$setRef(ref, node)
|
|
1109
993
|
);
|
|
1110
994
|
}
|
|
1111
|
-
__name($6ed0406888f73fc4$export$43e446d32b3d21af, "$6ed0406888f73fc4$export$43e446d32b3d21af");
|
|
1112
995
|
function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
|
|
1113
996
|
return $3vqmr$useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
|
|
1114
997
|
}
|
|
1115
|
-
__name($6ed0406888f73fc4$export$c7b2cbe3552a0d05, "$6ed0406888f73fc4$export$c7b2cbe3552a0d05");
|
|
1116
998
|
|
|
1117
999
|
// ../../node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
1118
1000
|
import { forwardRef as $9IrjX$forwardRef, Children as $9IrjX$Children, isValidElement as $9IrjX$isValidElement, createElement as $9IrjX$createElement, cloneElement as $9IrjX$cloneElement, Fragment as $9IrjX$Fragment } from "react";
|
|
1119
1001
|
var $5e63c961fc1ce211$export$8c6ed5c666ac1360 = $9IrjX$forwardRef((props, forwardedRef) => {
|
|
1120
|
-
|
|
1121
|
-
const childrenArray = $9IrjX$Children.toArray(children);
|
|
1122
|
-
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
|
|
1002
|
+
let { children, ...slotProps } = props, childrenArray = $9IrjX$Children.toArray(children), slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
|
|
1123
1003
|
if (slottable) {
|
|
1124
|
-
|
|
1125
|
-
const newChildren = childrenArray.map((child) => {
|
|
1126
|
-
if (child === slottable) {
|
|
1127
|
-
if ($9IrjX$Children.count(newElement) > 1) return $9IrjX$Children.only(null);
|
|
1128
|
-
return $9IrjX$isValidElement(newElement) ? newElement.props.children : null;
|
|
1129
|
-
} else return child;
|
|
1130
|
-
});
|
|
1004
|
+
let newElement = slottable.props.children, newChildren = childrenArray.map((child) => child === slottable ? $9IrjX$Children.count(newElement) > 1 ? $9IrjX$Children.only(null) : $9IrjX$isValidElement(newElement) ? newElement.props.children : null : child);
|
|
1131
1005
|
return $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
1132
1006
|
ref: forwardedRef
|
|
1133
1007
|
}), $9IrjX$isValidElement(newElement) ? $9IrjX$cloneElement(newElement, void 0, newChildren) : null);
|
|
@@ -1138,79 +1012,59 @@ var $5e63c961fc1ce211$export$8c6ed5c666ac1360 = $9IrjX$forwardRef((props, forwar
|
|
|
1138
1012
|
});
|
|
1139
1013
|
$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = "Slot";
|
|
1140
1014
|
var $5e63c961fc1ce211$var$SlotClone = $9IrjX$forwardRef((props, forwardedRef) => {
|
|
1141
|
-
|
|
1142
|
-
|
|
1015
|
+
let { children, ...slotProps } = props;
|
|
1016
|
+
return $9IrjX$isValidElement(children) ? $9IrjX$cloneElement(children, {
|
|
1143
1017
|
...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
|
|
1144
1018
|
ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
|
|
1145
|
-
});
|
|
1146
|
-
return $9IrjX$Children.count(children) > 1 ? $9IrjX$Children.only(null) : null;
|
|
1019
|
+
}) : $9IrjX$Children.count(children) > 1 ? $9IrjX$Children.only(null) : null;
|
|
1147
1020
|
});
|
|
1148
1021
|
$5e63c961fc1ce211$var$SlotClone.displayName = "SlotClone";
|
|
1149
|
-
var $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 =
|
|
1150
|
-
return $9IrjX$createElement($9IrjX$Fragment, null, children);
|
|
1151
|
-
}, "$5e63c961fc1ce211$export$d9f1ccf0bdb05d45");
|
|
1022
|
+
var $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children }) => $9IrjX$createElement($9IrjX$Fragment, null, children);
|
|
1152
1023
|
function $5e63c961fc1ce211$var$isSlottable(child) {
|
|
1153
1024
|
return $9IrjX$isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
|
|
1154
1025
|
}
|
|
1155
|
-
__name($5e63c961fc1ce211$var$isSlottable, "$5e63c961fc1ce211$var$isSlottable");
|
|
1156
1026
|
function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
|
|
1157
|
-
|
|
1027
|
+
let overrideProps = {
|
|
1158
1028
|
...childProps
|
|
1159
1029
|
};
|
|
1160
|
-
for (
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
if (slotPropValue && childPropValue) overrideProps[propName] = (...args) => {
|
|
1166
|
-
childPropValue(...args);
|
|
1167
|
-
slotPropValue(...args);
|
|
1168
|
-
};
|
|
1169
|
-
else if (slotPropValue) overrideProps[propName] = slotPropValue;
|
|
1170
|
-
} else if (propName === "style") overrideProps[propName] = {
|
|
1030
|
+
for (let propName in childProps) {
|
|
1031
|
+
let slotPropValue = slotProps[propName], childPropValue = childProps[propName];
|
|
1032
|
+
/^on[A-Z]/.test(propName) ? slotPropValue && childPropValue ? overrideProps[propName] = (...args) => {
|
|
1033
|
+
childPropValue(...args), slotPropValue(...args);
|
|
1034
|
+
} : slotPropValue && (overrideProps[propName] = slotPropValue) : propName === "style" ? overrideProps[propName] = {
|
|
1171
1035
|
...slotPropValue,
|
|
1172
1036
|
...childPropValue
|
|
1173
|
-
}
|
|
1174
|
-
else if (propName === "className") overrideProps[propName] = [
|
|
1037
|
+
} : propName === "className" && (overrideProps[propName] = [
|
|
1175
1038
|
slotPropValue,
|
|
1176
1039
|
childPropValue
|
|
1177
|
-
].filter(Boolean).join(" ");
|
|
1040
|
+
].filter(Boolean).join(" "));
|
|
1178
1041
|
}
|
|
1179
1042
|
return {
|
|
1180
1043
|
...slotProps,
|
|
1181
1044
|
...overrideProps
|
|
1182
1045
|
};
|
|
1183
1046
|
}
|
|
1184
|
-
__name($5e63c961fc1ce211$var$mergeProps, "$5e63c961fc1ce211$var$mergeProps");
|
|
1185
1047
|
|
|
1186
1048
|
// ../../node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
1187
1049
|
function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
1188
|
-
|
|
1189
|
-
const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME);
|
|
1190
|
-
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
|
|
1050
|
+
let PROVIDER_NAME = name + "CollectionProvider", [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME), [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
|
|
1191
1051
|
collectionRef: {
|
|
1192
1052
|
current: null
|
|
1193
1053
|
},
|
|
1194
1054
|
itemMap: /* @__PURE__ */ new Map()
|
|
1195
|
-
})
|
|
1196
|
-
|
|
1197
|
-
const { scope, children } = props;
|
|
1198
|
-
const ref = $6vYhU$react.useRef(null);
|
|
1199
|
-
const itemMap = $6vYhU$react.useRef(/* @__PURE__ */ new Map()).current;
|
|
1055
|
+
}), CollectionProvider = (props) => {
|
|
1056
|
+
let { scope, children } = props, ref = $6vYhU$react.useRef(null), itemMap = $6vYhU$react.useRef(/* @__PURE__ */ new Map()).current;
|
|
1200
1057
|
return $6vYhU$react.createElement(CollectionProviderImpl, {
|
|
1201
1058
|
scope,
|
|
1202
1059
|
itemMap,
|
|
1203
1060
|
collectionRef: ref
|
|
1204
1061
|
}, children);
|
|
1205
|
-
}
|
|
1062
|
+
};
|
|
1206
1063
|
Object.assign(CollectionProvider, {
|
|
1207
1064
|
displayName: PROVIDER_NAME
|
|
1208
1065
|
});
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
const { scope, children } = props;
|
|
1212
|
-
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
1213
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.collectionRef);
|
|
1066
|
+
let COLLECTION_SLOT_NAME = name + "CollectionSlot", CollectionSlot = $6vYhU$react.forwardRef((props, forwardedRef) => {
|
|
1067
|
+
let { scope, children } = props, context = useCollectionContext(COLLECTION_SLOT_NAME, scope), composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.collectionRef);
|
|
1214
1068
|
return $6vYhU$react.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
|
1215
1069
|
ref: composedRefs
|
|
1216
1070
|
}, children);
|
|
@@ -1218,21 +1072,12 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
1218
1072
|
Object.assign(CollectionSlot, {
|
|
1219
1073
|
displayName: COLLECTION_SLOT_NAME
|
|
1220
1074
|
});
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
1228
|
-
$6vYhU$react.useEffect(() => {
|
|
1229
|
-
context.itemMap.set(ref, {
|
|
1230
|
-
ref,
|
|
1231
|
-
...itemData
|
|
1232
|
-
});
|
|
1233
|
-
return () => void context.itemMap.delete(ref);
|
|
1234
|
-
});
|
|
1235
|
-
return $6vYhU$react.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
|
1075
|
+
let ITEM_SLOT_NAME = name + "CollectionItemSlot", ITEM_DATA_ATTR = "data-radix-collection-item", CollectionItemSlot = $6vYhU$react.forwardRef((props, forwardedRef) => {
|
|
1076
|
+
let { scope, children, ...itemData } = props, ref = $6vYhU$react.useRef(null), composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref), context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
1077
|
+
return $6vYhU$react.useEffect(() => (context.itemMap.set(ref, {
|
|
1078
|
+
ref,
|
|
1079
|
+
...itemData
|
|
1080
|
+
}), () => void context.itemMap.delete(ref))), $6vYhU$react.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
|
1236
1081
|
[ITEM_DATA_ATTR]: "",
|
|
1237
1082
|
ref: composedRefs
|
|
1238
1083
|
}, children);
|
|
@@ -1241,23 +1086,19 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
1241
1086
|
displayName: ITEM_SLOT_NAME
|
|
1242
1087
|
});
|
|
1243
1088
|
function useCollection(scope) {
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1089
|
+
let context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
1090
|
+
return $6vYhU$react.useCallback(() => {
|
|
1091
|
+
let collectionNode = context.collectionRef.current;
|
|
1247
1092
|
if (!collectionNode) return [];
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
const orderedItems = items.sort(
|
|
1093
|
+
let orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
1094
|
+
return Array.from(context.itemMap.values()).sort(
|
|
1251
1095
|
(a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
|
|
1252
1096
|
);
|
|
1253
|
-
return orderedItems;
|
|
1254
1097
|
}, [
|
|
1255
1098
|
context.collectionRef,
|
|
1256
1099
|
context.itemMap
|
|
1257
1100
|
]);
|
|
1258
|
-
return getItems;
|
|
1259
1101
|
}
|
|
1260
|
-
__name(useCollection, "useCollection");
|
|
1261
1102
|
return [
|
|
1262
1103
|
{
|
|
1263
1104
|
Provider: CollectionProvider,
|
|
@@ -1268,68 +1109,39 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
1268
1109
|
createCollectionScope
|
|
1269
1110
|
];
|
|
1270
1111
|
}
|
|
1271
|
-
__name($e02a7d9cb1dc128c$export$c74125a8e3af6bb2, "$e02a7d9cb1dc128c$export$c74125a8e3af6bb2");
|
|
1272
|
-
|
|
1273
|
-
// ../../node_modules/@radix-ui/react-roving-focus/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
1274
|
-
import { useCallback as $3vqmr$useCallback2 } from "react";
|
|
1275
|
-
function $6ed0406888f73fc4$var$setRef2(ref, value) {
|
|
1276
|
-
if (typeof ref === "function") ref(value);
|
|
1277
|
-
else if (ref !== null && ref !== void 0) ref.current = value;
|
|
1278
|
-
}
|
|
1279
|
-
__name($6ed0406888f73fc4$var$setRef2, "$6ed0406888f73fc4$var$setRef");
|
|
1280
|
-
function $6ed0406888f73fc4$export$43e446d32b3d21af2(...refs) {
|
|
1281
|
-
return (node) => refs.forEach(
|
|
1282
|
-
(ref) => $6ed0406888f73fc4$var$setRef2(ref, node)
|
|
1283
|
-
);
|
|
1284
|
-
}
|
|
1285
|
-
__name($6ed0406888f73fc4$export$43e446d32b3d21af2, "$6ed0406888f73fc4$export$43e446d32b3d21af");
|
|
1286
|
-
function $6ed0406888f73fc4$export$c7b2cbe3552a0d052(...refs) {
|
|
1287
|
-
return $3vqmr$useCallback2($6ed0406888f73fc4$export$43e446d32b3d21af2(...refs), refs);
|
|
1288
|
-
}
|
|
1289
|
-
__name($6ed0406888f73fc4$export$c7b2cbe3552a0d052, "$6ed0406888f73fc4$export$c7b2cbe3552a0d05");
|
|
1290
1112
|
|
|
1291
1113
|
// ../../node_modules/@radix-ui/react-id/dist/index.mjs
|
|
1292
1114
|
import * as $2AODx$react from "react";
|
|
1293
1115
|
|
|
1294
|
-
// ../../node_modules/@radix-ui/react-
|
|
1116
|
+
// ../../node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
1295
1117
|
import { useLayoutEffect as $dxlwH$useLayoutEffect } from "react";
|
|
1296
|
-
var $9f79659886946c16$export$e5c5a5f917a5871c =
|
|
1118
|
+
var $9f79659886946c16$export$e5c5a5f917a5871c = globalThis?.document ? $dxlwH$useLayoutEffect : () => {
|
|
1297
1119
|
};
|
|
1298
1120
|
|
|
1299
1121
|
// ../../node_modules/@radix-ui/react-id/dist/index.mjs
|
|
1300
|
-
var $1746a345f3d73bb7$var$useReactId = $2AODx$react
|
|
1301
|
-
|
|
1122
|
+
var $1746a345f3d73bb7$var$useReactId = $2AODx$react.useId || (() => {
|
|
1123
|
+
}), $1746a345f3d73bb7$var$count = 0;
|
|
1302
1124
|
function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
1303
|
-
|
|
1304
|
-
$9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
|
1305
|
-
|
|
1306
|
-
(reactId) => reactId
|
|
1125
|
+
let [id, setId] = $2AODx$react.useState($1746a345f3d73bb7$var$useReactId());
|
|
1126
|
+
return $9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
|
1127
|
+
deterministicId || setId(
|
|
1128
|
+
(reactId) => reactId ?? String($1746a345f3d73bb7$var$count++)
|
|
1307
1129
|
);
|
|
1308
1130
|
}, [
|
|
1309
1131
|
deterministicId
|
|
1310
|
-
]);
|
|
1311
|
-
return deterministicId || (id ? `radix-${id}` : "");
|
|
1132
|
+
]), deterministicId || (id ? `radix-${id}` : "");
|
|
1312
1133
|
}
|
|
1313
|
-
__name($1746a345f3d73bb7$export$f680877a34711e37, "$1746a345f3d73bb7$export$f680877a34711e37");
|
|
1314
1134
|
|
|
1315
|
-
// ../../node_modules/@radix-ui/react-
|
|
1135
|
+
// ../../node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
1316
1136
|
import { forwardRef as $4q5Fq$forwardRef, useEffect as $4q5Fq$useEffect, createElement as $4q5Fq$createElement } from "react";
|
|
1317
1137
|
import { flushSync as $4q5Fq$flushSync } from "react-dom";
|
|
1318
1138
|
|
|
1319
|
-
// ../../node_modules/@radix-ui/react-
|
|
1139
|
+
// ../../node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
1320
1140
|
import { forwardRef as $9IrjX$forwardRef2, Children as $9IrjX$Children2, isValidElement as $9IrjX$isValidElement2, createElement as $9IrjX$createElement2, cloneElement as $9IrjX$cloneElement2, Fragment as $9IrjX$Fragment2 } from "react";
|
|
1321
1141
|
var $5e63c961fc1ce211$export$8c6ed5c666ac13602 = $9IrjX$forwardRef2((props, forwardedRef) => {
|
|
1322
|
-
|
|
1323
|
-
const childrenArray = $9IrjX$Children2.toArray(children);
|
|
1324
|
-
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable2);
|
|
1142
|
+
let { children, ...slotProps } = props, childrenArray = $9IrjX$Children2.toArray(children), slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable2);
|
|
1325
1143
|
if (slottable) {
|
|
1326
|
-
|
|
1327
|
-
const newChildren = childrenArray.map((child) => {
|
|
1328
|
-
if (child === slottable) {
|
|
1329
|
-
if ($9IrjX$Children2.count(newElement) > 1) return $9IrjX$Children2.only(null);
|
|
1330
|
-
return $9IrjX$isValidElement2(newElement) ? newElement.props.children : null;
|
|
1331
|
-
} else return child;
|
|
1332
|
-
});
|
|
1144
|
+
let newElement = slottable.props.children, newChildren = childrenArray.map((child) => child === slottable ? $9IrjX$Children2.count(newElement) > 1 ? $9IrjX$Children2.only(null) : $9IrjX$isValidElement2(newElement) ? newElement.props.children : null : child);
|
|
1333
1145
|
return $9IrjX$createElement2($5e63c961fc1ce211$var$SlotClone2, _extends({}, slotProps, {
|
|
1334
1146
|
ref: forwardedRef
|
|
1335
1147
|
}), $9IrjX$isValidElement2(newElement) ? $9IrjX$cloneElement2(newElement, void 0, newChildren) : null);
|
|
@@ -1340,52 +1152,40 @@ var $5e63c961fc1ce211$export$8c6ed5c666ac13602 = $9IrjX$forwardRef2((props, forw
|
|
|
1340
1152
|
});
|
|
1341
1153
|
$5e63c961fc1ce211$export$8c6ed5c666ac13602.displayName = "Slot";
|
|
1342
1154
|
var $5e63c961fc1ce211$var$SlotClone2 = $9IrjX$forwardRef2((props, forwardedRef) => {
|
|
1343
|
-
|
|
1344
|
-
|
|
1155
|
+
let { children, ...slotProps } = props;
|
|
1156
|
+
return $9IrjX$isValidElement2(children) ? $9IrjX$cloneElement2(children, {
|
|
1345
1157
|
...$5e63c961fc1ce211$var$mergeProps2(slotProps, children.props),
|
|
1346
|
-
ref: forwardedRef ? $6ed0406888f73fc4$export$
|
|
1347
|
-
});
|
|
1348
|
-
return $9IrjX$Children2.count(children) > 1 ? $9IrjX$Children2.only(null) : null;
|
|
1158
|
+
ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
|
|
1159
|
+
}) : $9IrjX$Children2.count(children) > 1 ? $9IrjX$Children2.only(null) : null;
|
|
1349
1160
|
});
|
|
1350
1161
|
$5e63c961fc1ce211$var$SlotClone2.displayName = "SlotClone";
|
|
1351
|
-
var $5e63c961fc1ce211$export$d9f1ccf0bdb05d452 =
|
|
1352
|
-
return $9IrjX$createElement2($9IrjX$Fragment2, null, children);
|
|
1353
|
-
}, "$5e63c961fc1ce211$export$d9f1ccf0bdb05d45");
|
|
1162
|
+
var $5e63c961fc1ce211$export$d9f1ccf0bdb05d452 = ({ children }) => $9IrjX$createElement2($9IrjX$Fragment2, null, children);
|
|
1354
1163
|
function $5e63c961fc1ce211$var$isSlottable2(child) {
|
|
1355
1164
|
return $9IrjX$isValidElement2(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d452;
|
|
1356
1165
|
}
|
|
1357
|
-
__name($5e63c961fc1ce211$var$isSlottable2, "$5e63c961fc1ce211$var$isSlottable");
|
|
1358
1166
|
function $5e63c961fc1ce211$var$mergeProps2(slotProps, childProps) {
|
|
1359
|
-
|
|
1167
|
+
let overrideProps = {
|
|
1360
1168
|
...childProps
|
|
1361
1169
|
};
|
|
1362
|
-
for (
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
if (slotPropValue && childPropValue) overrideProps[propName] = (...args) => {
|
|
1368
|
-
childPropValue(...args);
|
|
1369
|
-
slotPropValue(...args);
|
|
1370
|
-
};
|
|
1371
|
-
else if (slotPropValue) overrideProps[propName] = slotPropValue;
|
|
1372
|
-
} else if (propName === "style") overrideProps[propName] = {
|
|
1170
|
+
for (let propName in childProps) {
|
|
1171
|
+
let slotPropValue = slotProps[propName], childPropValue = childProps[propName];
|
|
1172
|
+
/^on[A-Z]/.test(propName) ? slotPropValue && childPropValue ? overrideProps[propName] = (...args) => {
|
|
1173
|
+
childPropValue(...args), slotPropValue(...args);
|
|
1174
|
+
} : slotPropValue && (overrideProps[propName] = slotPropValue) : propName === "style" ? overrideProps[propName] = {
|
|
1373
1175
|
...slotPropValue,
|
|
1374
1176
|
...childPropValue
|
|
1375
|
-
}
|
|
1376
|
-
else if (propName === "className") overrideProps[propName] = [
|
|
1177
|
+
} : propName === "className" && (overrideProps[propName] = [
|
|
1377
1178
|
slotPropValue,
|
|
1378
1179
|
childPropValue
|
|
1379
|
-
].filter(Boolean).join(" ");
|
|
1180
|
+
].filter(Boolean).join(" "));
|
|
1380
1181
|
}
|
|
1381
1182
|
return {
|
|
1382
1183
|
...slotProps,
|
|
1383
1184
|
...overrideProps
|
|
1384
1185
|
};
|
|
1385
1186
|
}
|
|
1386
|
-
__name($5e63c961fc1ce211$var$mergeProps2, "$5e63c961fc1ce211$var$mergeProps");
|
|
1387
1187
|
|
|
1388
|
-
// ../../node_modules/@radix-ui/react-
|
|
1188
|
+
// ../../node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
1389
1189
|
var $8927f6f2acc4f386$var$NODES = [
|
|
1390
1190
|
"a",
|
|
1391
1191
|
"button",
|
|
@@ -1403,33 +1203,28 @@ var $8927f6f2acc4f386$var$NODES = [
|
|
|
1403
1203
|
"span",
|
|
1404
1204
|
"svg",
|
|
1405
1205
|
"ul"
|
|
1406
|
-
]
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
$4q5Fq$
|
|
1412
|
-
window[Symbol.for("radix-ui")] = true;
|
|
1413
|
-
}, []);
|
|
1414
|
-
return $4q5Fq$createElement(Comp, _extends({}, primitiveProps, {
|
|
1206
|
+
], $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node) => {
|
|
1207
|
+
let Node = $4q5Fq$forwardRef((props, forwardedRef) => {
|
|
1208
|
+
let { asChild, ...primitiveProps } = props, Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac13602 : node;
|
|
1209
|
+
return $4q5Fq$useEffect(() => {
|
|
1210
|
+
window[Symbol.for("radix-ui")] = !0;
|
|
1211
|
+
}, []), $4q5Fq$createElement(Comp, _extends({}, primitiveProps, {
|
|
1415
1212
|
ref: forwardedRef
|
|
1416
1213
|
}));
|
|
1417
1214
|
});
|
|
1418
|
-
Node.displayName = `Primitive.${node}
|
|
1419
|
-
return {
|
|
1215
|
+
return Node.displayName = `Primitive.${node}`, {
|
|
1420
1216
|
...primitive,
|
|
1421
1217
|
[node]: Node
|
|
1422
1218
|
};
|
|
1423
1219
|
}, {});
|
|
1424
1220
|
|
|
1425
|
-
// ../../node_modules/@radix-ui/react-
|
|
1221
|
+
// ../../node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
|
1426
1222
|
import { useRef as $lwiWj$useRef, useEffect as $lwiWj$useEffect, useMemo as $lwiWj$useMemo } from "react";
|
|
1427
1223
|
function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
|
1428
|
-
|
|
1429
|
-
$lwiWj$useEffect(() => {
|
|
1224
|
+
let callbackRef = $lwiWj$useRef(callback);
|
|
1225
|
+
return $lwiWj$useEffect(() => {
|
|
1430
1226
|
callbackRef.current = callback;
|
|
1431
|
-
})
|
|
1432
|
-
return $lwiWj$useMemo(
|
|
1227
|
+
}), $lwiWj$useMemo(
|
|
1433
1228
|
() => (...args) => {
|
|
1434
1229
|
var _callbackRef$current;
|
|
1435
1230
|
return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
|
|
@@ -1437,43 +1232,18 @@ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
|
|
1437
1232
|
[]
|
|
1438
1233
|
);
|
|
1439
1234
|
}
|
|
1440
|
-
__name($b1b2314f5f9a1d84$export$25bec8c6f54ee79a, "$b1b2314f5f9a1d84$export$25bec8c6f54ee79a");
|
|
1441
1235
|
|
|
1442
1236
|
// ../../node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
1443
1237
|
import { useCallback as $bnPw9$useCallback, useState as $bnPw9$useState, useRef as $bnPw9$useRef, useEffect as $bnPw9$useEffect } from "react";
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a2(callback) {
|
|
1448
|
-
const callbackRef = $lwiWj$useRef2(callback);
|
|
1449
|
-
$lwiWj$useEffect2(() => {
|
|
1450
|
-
callbackRef.current = callback;
|
|
1451
|
-
});
|
|
1452
|
-
return $lwiWj$useMemo2(
|
|
1453
|
-
() => (...args) => {
|
|
1454
|
-
var _callbackRef$current;
|
|
1455
|
-
return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
|
|
1456
|
-
},
|
|
1457
|
-
[]
|
|
1458
|
-
);
|
|
1459
|
-
}
|
|
1460
|
-
__name($b1b2314f5f9a1d84$export$25bec8c6f54ee79a2, "$b1b2314f5f9a1d84$export$25bec8c6f54ee79a");
|
|
1461
|
-
|
|
1462
|
-
// ../../node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
1463
|
-
function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop, defaultProp, onChange = /* @__PURE__ */ __name(() => {
|
|
1464
|
-
}, "onChange") }) {
|
|
1465
|
-
const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
|
|
1238
|
+
function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop, defaultProp, onChange = () => {
|
|
1239
|
+
} }) {
|
|
1240
|
+
let [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
|
|
1466
1241
|
defaultProp,
|
|
1467
1242
|
onChange
|
|
1468
|
-
})
|
|
1469
|
-
const isControlled = prop !== void 0;
|
|
1470
|
-
const value1 = isControlled ? prop : uncontrolledProp;
|
|
1471
|
-
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a2(onChange);
|
|
1472
|
-
const setValue = $bnPw9$useCallback((nextValue) => {
|
|
1243
|
+
}), isControlled = prop !== void 0, value1 = isControlled ? prop : uncontrolledProp, handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange), setValue = $bnPw9$useCallback((nextValue) => {
|
|
1473
1244
|
if (isControlled) {
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
if (value !== prop) handleChange(value);
|
|
1245
|
+
let value = typeof nextValue == "function" ? nextValue(prop) : nextValue;
|
|
1246
|
+
value !== prop && handleChange(value);
|
|
1477
1247
|
} else setUncontrolledProp(nextValue);
|
|
1478
1248
|
}, [
|
|
1479
1249
|
isControlled,
|
|
@@ -1486,84 +1256,54 @@ function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop, defaultProp, onChange
|
|
|
1486
1256
|
setValue
|
|
1487
1257
|
];
|
|
1488
1258
|
}
|
|
1489
|
-
__name($71cd76cc60e0454e$export$6f32135080cb4c3, "$71cd76cc60e0454e$export$6f32135080cb4c3");
|
|
1490
1259
|
function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp, onChange }) {
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a2(onChange);
|
|
1495
|
-
$bnPw9$useEffect(() => {
|
|
1496
|
-
if (prevValueRef.current !== value) {
|
|
1497
|
-
handleChange(value);
|
|
1498
|
-
prevValueRef.current = value;
|
|
1499
|
-
}
|
|
1260
|
+
let uncontrolledState = $bnPw9$useState(defaultProp), [value] = uncontrolledState, prevValueRef = $bnPw9$useRef(value), handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
1261
|
+
return $bnPw9$useEffect(() => {
|
|
1262
|
+
prevValueRef.current !== value && (handleChange(value), prevValueRef.current = value);
|
|
1500
1263
|
}, [
|
|
1501
1264
|
value,
|
|
1502
1265
|
prevValueRef,
|
|
1503
1266
|
handleChange
|
|
1504
|
-
]);
|
|
1505
|
-
return uncontrolledState;
|
|
1267
|
+
]), uncontrolledState;
|
|
1506
1268
|
}
|
|
1507
|
-
__name($71cd76cc60e0454e$var$useUncontrolledState, "$71cd76cc60e0454e$var$useUncontrolledState");
|
|
1508
1269
|
|
|
1509
1270
|
// ../../node_modules/@radix-ui/react-direction/dist/index.mjs
|
|
1510
1271
|
import { createContext as $7Gjcd$createContext, createElement as $7Gjcd$createElement, useContext as $7Gjcd$useContext } from "react";
|
|
1511
1272
|
var $f631663db3294ace$var$DirectionContext = $7Gjcd$createContext(void 0);
|
|
1512
1273
|
function $f631663db3294ace$export$b39126d51d94e6f3(localDir) {
|
|
1513
|
-
|
|
1274
|
+
let globalDir = $7Gjcd$useContext($f631663db3294ace$var$DirectionContext);
|
|
1514
1275
|
return localDir || globalDir || "ltr";
|
|
1515
1276
|
}
|
|
1516
|
-
__name($f631663db3294ace$export$b39126d51d94e6f3, "$f631663db3294ace$export$b39126d51d94e6f3");
|
|
1517
1277
|
|
|
1518
1278
|
// ../../node_modules/@radix-ui/react-roving-focus/dist/index.mjs
|
|
1519
|
-
var $d7bdfb9eb0fdf311$var$ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus"
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
};
|
|
1524
|
-
var $d7bdfb9eb0fdf311$var$GROUP_NAME = "RovingFocusGroup";
|
|
1525
|
-
var [$d7bdfb9eb0fdf311$var$Collection, $d7bdfb9eb0fdf311$var$useCollection, $d7bdfb9eb0fdf311$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($d7bdfb9eb0fdf311$var$GROUP_NAME);
|
|
1526
|
-
var [$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext, $d7bdfb9eb0fdf311$export$c7109489551a4f4] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($d7bdfb9eb0fdf311$var$GROUP_NAME, [
|
|
1279
|
+
var $d7bdfb9eb0fdf311$var$ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus", $d7bdfb9eb0fdf311$var$EVENT_OPTIONS = {
|
|
1280
|
+
bubbles: !1,
|
|
1281
|
+
cancelable: !0
|
|
1282
|
+
}, $d7bdfb9eb0fdf311$var$GROUP_NAME = "RovingFocusGroup", [$d7bdfb9eb0fdf311$var$Collection, $d7bdfb9eb0fdf311$var$useCollection, $d7bdfb9eb0fdf311$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($d7bdfb9eb0fdf311$var$GROUP_NAME), [$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext, $d7bdfb9eb0fdf311$export$c7109489551a4f4] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($d7bdfb9eb0fdf311$var$GROUP_NAME, [
|
|
1527
1283
|
$d7bdfb9eb0fdf311$var$createCollectionScope
|
|
1528
|
-
])
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
}, $98Iye$createElement($d7bdfb9eb0fdf311$var$RovingFocusGroupImpl, _extends({}, props, {
|
|
1536
|
-
ref: forwardedRef
|
|
1537
|
-
}))));
|
|
1538
|
-
});
|
|
1284
|
+
]), [$d7bdfb9eb0fdf311$var$RovingFocusProvider, $d7bdfb9eb0fdf311$var$useRovingFocusContext] = $d7bdfb9eb0fdf311$var$createRovingFocusGroupContext($d7bdfb9eb0fdf311$var$GROUP_NAME), $d7bdfb9eb0fdf311$export$8699f7c8af148338 = $98Iye$forwardRef((props, forwardedRef) => $98Iye$createElement($d7bdfb9eb0fdf311$var$Collection.Provider, {
|
|
1285
|
+
scope: props.__scopeRovingFocusGroup
|
|
1286
|
+
}, $98Iye$createElement($d7bdfb9eb0fdf311$var$Collection.Slot, {
|
|
1287
|
+
scope: props.__scopeRovingFocusGroup
|
|
1288
|
+
}, $98Iye$createElement($d7bdfb9eb0fdf311$var$RovingFocusGroupImpl, _extends({}, props, {
|
|
1289
|
+
ref: forwardedRef
|
|
1290
|
+
})))));
|
|
1539
1291
|
Object.assign($d7bdfb9eb0fdf311$export$8699f7c8af148338, {
|
|
1540
1292
|
displayName: $d7bdfb9eb0fdf311$var$GROUP_NAME
|
|
1541
1293
|
});
|
|
1542
1294
|
var $d7bdfb9eb0fdf311$var$RovingFocusGroupImpl = $98Iye$forwardRef((props, forwardedRef) => {
|
|
1543
|
-
|
|
1544
|
-
const ref = $98Iye$useRef(null);
|
|
1545
|
-
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d052(forwardedRef, ref);
|
|
1546
|
-
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
1547
|
-
const [currentTabStopId = null, setCurrentTabStopId] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
1295
|
+
let { __scopeRovingFocusGroup, orientation, loop = !1, dir, currentTabStopId: currentTabStopIdProp, defaultCurrentTabStopId, onCurrentTabStopIdChange, onEntryFocus, ...groupProps } = props, ref = $98Iye$useRef(null), composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref), direction = $f631663db3294ace$export$b39126d51d94e6f3(dir), [currentTabStopId = null, setCurrentTabStopId] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
1548
1296
|
prop: currentTabStopIdProp,
|
|
1549
1297
|
defaultProp: defaultCurrentTabStopId,
|
|
1550
1298
|
onChange: onCurrentTabStopIdChange
|
|
1551
|
-
});
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
const [focusableItemsCount, setFocusableItemsCount] = $98Iye$useState(0);
|
|
1557
|
-
$98Iye$useEffect(() => {
|
|
1558
|
-
const node = ref.current;
|
|
1559
|
-
if (node) {
|
|
1560
|
-
node.addEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, handleEntryFocus);
|
|
1561
|
-
return () => node.removeEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, handleEntryFocus);
|
|
1562
|
-
}
|
|
1299
|
+
}), [isTabbingBackOut, setIsTabbingBackOut] = $98Iye$useState(!1), handleEntryFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEntryFocus), getItems = $d7bdfb9eb0fdf311$var$useCollection(__scopeRovingFocusGroup), isClickFocusRef = $98Iye$useRef(!1), [focusableItemsCount, setFocusableItemsCount] = $98Iye$useState(0);
|
|
1300
|
+
return $98Iye$useEffect(() => {
|
|
1301
|
+
let node = ref.current;
|
|
1302
|
+
if (node)
|
|
1303
|
+
return node.addEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, handleEntryFocus), () => node.removeEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, handleEntryFocus);
|
|
1563
1304
|
}, [
|
|
1564
1305
|
handleEntryFocus
|
|
1565
|
-
])
|
|
1566
|
-
return $98Iye$createElement($d7bdfb9eb0fdf311$var$RovingFocusProvider, {
|
|
1306
|
+
]), $98Iye$createElement($d7bdfb9eb0fdf311$var$RovingFocusProvider, {
|
|
1567
1307
|
scope: __scopeRovingFocusGroup,
|
|
1568
1308
|
orientation,
|
|
1569
1309
|
dir: direction,
|
|
@@ -1576,7 +1316,7 @@ var $d7bdfb9eb0fdf311$var$RovingFocusGroupImpl = $98Iye$forwardRef((props, forwa
|
|
|
1576
1316
|
]
|
|
1577
1317
|
),
|
|
1578
1318
|
onItemShiftTab: $98Iye$useCallback(
|
|
1579
|
-
() => setIsTabbingBackOut(
|
|
1319
|
+
() => setIsTabbingBackOut(!0),
|
|
1580
1320
|
[]
|
|
1581
1321
|
),
|
|
1582
1322
|
onFocusableItemAdd: $98Iye$useCallback(
|
|
@@ -1601,62 +1341,46 @@ var $d7bdfb9eb0fdf311$var$RovingFocusGroupImpl = $98Iye$forwardRef((props, forwa
|
|
|
1601
1341
|
...props.style
|
|
1602
1342
|
},
|
|
1603
1343
|
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, () => {
|
|
1604
|
-
isClickFocusRef.current =
|
|
1344
|
+
isClickFocusRef.current = !0;
|
|
1605
1345
|
}),
|
|
1606
1346
|
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, (event) => {
|
|
1607
|
-
|
|
1347
|
+
let isKeyboardFocus = !isClickFocusRef.current;
|
|
1608
1348
|
if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
|
|
1609
|
-
|
|
1610
|
-
event.currentTarget.dispatchEvent(entryFocusEvent)
|
|
1611
|
-
|
|
1612
|
-
const items = getItems().filter(
|
|
1349
|
+
let entryFocusEvent = new CustomEvent($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, $d7bdfb9eb0fdf311$var$EVENT_OPTIONS);
|
|
1350
|
+
if (event.currentTarget.dispatchEvent(entryFocusEvent), !entryFocusEvent.defaultPrevented) {
|
|
1351
|
+
let items = getItems().filter(
|
|
1613
1352
|
(item) => item.focusable
|
|
1614
|
-
)
|
|
1615
|
-
const activeItem = items.find(
|
|
1353
|
+
), activeItem = items.find(
|
|
1616
1354
|
(item) => item.active
|
|
1617
|
-
)
|
|
1618
|
-
const currentItem = items.find(
|
|
1355
|
+
), currentItem = items.find(
|
|
1619
1356
|
(item) => item.id === currentTabStopId
|
|
1620
|
-
)
|
|
1621
|
-
const candidateItems = [
|
|
1357
|
+
), candidateNodes = [
|
|
1622
1358
|
activeItem,
|
|
1623
1359
|
currentItem,
|
|
1624
1360
|
...items
|
|
1625
|
-
].filter(Boolean)
|
|
1626
|
-
const candidateNodes = candidateItems.map(
|
|
1361
|
+
].filter(Boolean).map(
|
|
1627
1362
|
(item) => item.ref.current
|
|
1628
1363
|
);
|
|
1629
1364
|
$d7bdfb9eb0fdf311$var$focusFirst(candidateNodes);
|
|
1630
1365
|
}
|
|
1631
1366
|
}
|
|
1632
|
-
isClickFocusRef.current =
|
|
1367
|
+
isClickFocusRef.current = !1;
|
|
1633
1368
|
}),
|
|
1634
1369
|
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(
|
|
1635
1370
|
props.onBlur,
|
|
1636
|
-
() => setIsTabbingBackOut(
|
|
1371
|
+
() => setIsTabbingBackOut(!1)
|
|
1637
1372
|
)
|
|
1638
1373
|
})));
|
|
1639
|
-
})
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
const id = tabStopId || autoId;
|
|
1645
|
-
const context = $d7bdfb9eb0fdf311$var$useRovingFocusContext($d7bdfb9eb0fdf311$var$ITEM_NAME, __scopeRovingFocusGroup);
|
|
1646
|
-
const isCurrentTabStop = context.currentTabStopId === id;
|
|
1647
|
-
const getItems = $d7bdfb9eb0fdf311$var$useCollection(__scopeRovingFocusGroup);
|
|
1648
|
-
const { onFocusableItemAdd, onFocusableItemRemove } = context;
|
|
1649
|
-
$98Iye$useEffect(() => {
|
|
1650
|
-
if (focusable) {
|
|
1651
|
-
onFocusableItemAdd();
|
|
1652
|
-
return () => onFocusableItemRemove();
|
|
1653
|
-
}
|
|
1374
|
+
}), $d7bdfb9eb0fdf311$var$ITEM_NAME = "RovingFocusGroupItem", $d7bdfb9eb0fdf311$export$ab9df7c53fe8454 = $98Iye$forwardRef((props, forwardedRef) => {
|
|
1375
|
+
let { __scopeRovingFocusGroup, focusable = !0, active = !1, tabStopId, ...itemProps } = props, autoId = $1746a345f3d73bb7$export$f680877a34711e37(), id = tabStopId || autoId, context = $d7bdfb9eb0fdf311$var$useRovingFocusContext($d7bdfb9eb0fdf311$var$ITEM_NAME, __scopeRovingFocusGroup), isCurrentTabStop = context.currentTabStopId === id, getItems = $d7bdfb9eb0fdf311$var$useCollection(__scopeRovingFocusGroup), { onFocusableItemAdd, onFocusableItemRemove } = context;
|
|
1376
|
+
return $98Iye$useEffect(() => {
|
|
1377
|
+
if (focusable)
|
|
1378
|
+
return onFocusableItemAdd(), () => onFocusableItemRemove();
|
|
1654
1379
|
}, [
|
|
1655
1380
|
focusable,
|
|
1656
1381
|
onFocusableItemAdd,
|
|
1657
1382
|
onFocusableItemRemove
|
|
1658
|
-
])
|
|
1659
|
-
return $98Iye$createElement($d7bdfb9eb0fdf311$var$Collection.ItemSlot, {
|
|
1383
|
+
]), $98Iye$createElement($d7bdfb9eb0fdf311$var$Collection.ItemSlot, {
|
|
1660
1384
|
scope: __scopeRovingFocusGroup,
|
|
1661
1385
|
id,
|
|
1662
1386
|
focusable,
|
|
@@ -1667,8 +1391,7 @@ var $d7bdfb9eb0fdf311$export$ab9df7c53fe8454 = $98Iye$forwardRef((props, forward
|
|
|
1667
1391
|
}, itemProps, {
|
|
1668
1392
|
ref: forwardedRef,
|
|
1669
1393
|
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, (event) => {
|
|
1670
|
-
|
|
1671
|
-
else context.onItemFocus(id);
|
|
1394
|
+
focusable ? context.onItemFocus(id) : event.preventDefault();
|
|
1672
1395
|
}),
|
|
1673
1396
|
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(
|
|
1674
1397
|
props.onFocus,
|
|
@@ -1680,19 +1403,18 @@ var $d7bdfb9eb0fdf311$export$ab9df7c53fe8454 = $98Iye$forwardRef((props, forward
|
|
|
1680
1403
|
return;
|
|
1681
1404
|
}
|
|
1682
1405
|
if (event.target !== event.currentTarget) return;
|
|
1683
|
-
|
|
1406
|
+
let focusIntent = $d7bdfb9eb0fdf311$var$getFocusIntent(event, context.orientation, context.dir);
|
|
1684
1407
|
if (focusIntent !== void 0) {
|
|
1685
1408
|
event.preventDefault();
|
|
1686
|
-
|
|
1409
|
+
let candidateNodes = getItems().filter(
|
|
1687
1410
|
(item) => item.focusable
|
|
1688
|
-
)
|
|
1689
|
-
let candidateNodes = items.map(
|
|
1411
|
+
).map(
|
|
1690
1412
|
(item) => item.ref.current
|
|
1691
1413
|
);
|
|
1692
1414
|
if (focusIntent === "last") candidateNodes.reverse();
|
|
1693
1415
|
else if (focusIntent === "prev" || focusIntent === "next") {
|
|
1694
|
-
|
|
1695
|
-
|
|
1416
|
+
focusIntent === "prev" && candidateNodes.reverse();
|
|
1417
|
+
let currentIndex = candidateNodes.indexOf(event.currentTarget);
|
|
1696
1418
|
candidateNodes = context.loop ? $d7bdfb9eb0fdf311$var$wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
|
|
1697
1419
|
}
|
|
1698
1420
|
setTimeout(
|
|
@@ -1716,96 +1438,51 @@ var $d7bdfb9eb0fdf311$var$MAP_KEY_TO_FOCUS_INTENT = {
|
|
|
1716
1438
|
End: "last"
|
|
1717
1439
|
};
|
|
1718
1440
|
function $d7bdfb9eb0fdf311$var$getDirectionAwareKey(key, dir) {
|
|
1719
|
-
|
|
1720
|
-
return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
|
|
1441
|
+
return dir !== "rtl" ? key : key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
|
|
1721
1442
|
}
|
|
1722
|
-
__name($d7bdfb9eb0fdf311$var$getDirectionAwareKey, "$d7bdfb9eb0fdf311$var$getDirectionAwareKey");
|
|
1723
1443
|
function $d7bdfb9eb0fdf311$var$getFocusIntent(event, orientation, dir) {
|
|
1724
|
-
|
|
1725
|
-
if (orientation === "vertical" && [
|
|
1444
|
+
let key = $d7bdfb9eb0fdf311$var$getDirectionAwareKey(event.key, dir);
|
|
1445
|
+
if (!(orientation === "vertical" && [
|
|
1726
1446
|
"ArrowLeft",
|
|
1727
1447
|
"ArrowRight"
|
|
1728
|
-
].includes(key))
|
|
1729
|
-
if (orientation === "horizontal" && [
|
|
1448
|
+
].includes(key)) && !(orientation === "horizontal" && [
|
|
1730
1449
|
"ArrowUp",
|
|
1731
1450
|
"ArrowDown"
|
|
1732
|
-
].includes(key))
|
|
1733
|
-
|
|
1451
|
+
].includes(key)))
|
|
1452
|
+
return $d7bdfb9eb0fdf311$var$MAP_KEY_TO_FOCUS_INTENT[key];
|
|
1734
1453
|
}
|
|
1735
|
-
__name($d7bdfb9eb0fdf311$var$getFocusIntent, "$d7bdfb9eb0fdf311$var$getFocusIntent");
|
|
1736
1454
|
function $d7bdfb9eb0fdf311$var$focusFirst(candidates) {
|
|
1737
|
-
|
|
1738
|
-
for (
|
|
1739
|
-
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
1740
|
-
candidate.focus();
|
|
1741
|
-
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
1742
|
-
}
|
|
1455
|
+
let PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
1456
|
+
for (let candidate of candidates)
|
|
1457
|
+
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT || (candidate.focus(), document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT)) return;
|
|
1743
1458
|
}
|
|
1744
|
-
__name($d7bdfb9eb0fdf311$var$focusFirst, "$d7bdfb9eb0fdf311$var$focusFirst");
|
|
1745
1459
|
function $d7bdfb9eb0fdf311$var$wrapArray(array, startIndex) {
|
|
1746
1460
|
return array.map(
|
|
1747
1461
|
(_, index) => array[(startIndex + index) % array.length]
|
|
1748
1462
|
);
|
|
1749
1463
|
}
|
|
1750
|
-
|
|
1751
|
-
var $d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9 = $d7bdfb9eb0fdf311$export$8699f7c8af148338;
|
|
1752
|
-
var $d7bdfb9eb0fdf311$export$6d08773d2e66f8f2 = $d7bdfb9eb0fdf311$export$ab9df7c53fe8454;
|
|
1464
|
+
var $d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9 = $d7bdfb9eb0fdf311$export$8699f7c8af148338, $d7bdfb9eb0fdf311$export$6d08773d2e66f8f2 = $d7bdfb9eb0fdf311$export$ab9df7c53fe8454;
|
|
1753
1465
|
|
|
1754
1466
|
// ../../node_modules/@radix-ui/react-presence/dist/index.mjs
|
|
1755
1467
|
import { Children as $iqq3r$Children, cloneElement as $iqq3r$cloneElement, useState as $iqq3r$useState, useRef as $iqq3r$useRef, useEffect as $iqq3r$useEffect, useCallback as $iqq3r$useCallback, useReducer as $iqq3r$useReducer } from "react";
|
|
1756
1468
|
import { flushSync as $iqq3r$flushSync } from "react-dom";
|
|
1757
|
-
|
|
1758
|
-
// ../../node_modules/@radix-ui/react-presence/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
1759
|
-
import { useCallback as $3vqmr$useCallback3 } from "react";
|
|
1760
|
-
function $6ed0406888f73fc4$var$setRef3(ref, value) {
|
|
1761
|
-
if (typeof ref === "function") ref(value);
|
|
1762
|
-
else if (ref !== null && ref !== void 0) ref.current = value;
|
|
1763
|
-
}
|
|
1764
|
-
__name($6ed0406888f73fc4$var$setRef3, "$6ed0406888f73fc4$var$setRef");
|
|
1765
|
-
function $6ed0406888f73fc4$export$43e446d32b3d21af3(...refs) {
|
|
1766
|
-
return (node) => refs.forEach(
|
|
1767
|
-
(ref) => $6ed0406888f73fc4$var$setRef3(ref, node)
|
|
1768
|
-
);
|
|
1769
|
-
}
|
|
1770
|
-
__name($6ed0406888f73fc4$export$43e446d32b3d21af3, "$6ed0406888f73fc4$export$43e446d32b3d21af");
|
|
1771
|
-
function $6ed0406888f73fc4$export$c7b2cbe3552a0d053(...refs) {
|
|
1772
|
-
return $3vqmr$useCallback3($6ed0406888f73fc4$export$43e446d32b3d21af3(...refs), refs);
|
|
1773
|
-
}
|
|
1774
|
-
__name($6ed0406888f73fc4$export$c7b2cbe3552a0d053, "$6ed0406888f73fc4$export$c7b2cbe3552a0d05");
|
|
1775
|
-
|
|
1776
|
-
// ../../node_modules/@radix-ui/react-presence/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
1777
|
-
import { useLayoutEffect as $dxlwH$useLayoutEffect2 } from "react";
|
|
1778
|
-
var $9f79659886946c16$export$e5c5a5f917a5871c2 = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? $dxlwH$useLayoutEffect2 : () => {
|
|
1779
|
-
};
|
|
1780
|
-
|
|
1781
|
-
// ../../node_modules/@radix-ui/react-presence/dist/index.mjs
|
|
1782
1469
|
function $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) {
|
|
1783
1470
|
return $iqq3r$useReducer((state, event) => {
|
|
1784
|
-
|
|
1785
|
-
return nextState
|
|
1471
|
+
let nextState = machine[state][event];
|
|
1472
|
+
return nextState ?? state;
|
|
1786
1473
|
}, initialState);
|
|
1787
1474
|
}
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
const { present, children } = props;
|
|
1791
|
-
const presence = $921a889cee6df7e8$var$usePresence(present);
|
|
1792
|
-
const child = typeof children === "function" ? children({
|
|
1475
|
+
var $921a889cee6df7e8$export$99c2b779aa4e8b8b = (props) => {
|
|
1476
|
+
let { present, children } = props, presence = $921a889cee6df7e8$var$usePresence(present), child = typeof children == "function" ? children({
|
|
1793
1477
|
present: presence.isPresent
|
|
1794
|
-
}) : $iqq3r$Children.only(children);
|
|
1795
|
-
|
|
1796
|
-
const forceMount = typeof children === "function";
|
|
1797
|
-
return forceMount || presence.isPresent ? $iqq3r$cloneElement(child, {
|
|
1478
|
+
}) : $iqq3r$Children.only(children), ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(presence.ref, child.ref);
|
|
1479
|
+
return typeof children == "function" || presence.isPresent ? $iqq3r$cloneElement(child, {
|
|
1798
1480
|
ref
|
|
1799
1481
|
}) : null;
|
|
1800
|
-
}
|
|
1482
|
+
};
|
|
1801
1483
|
$921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = "Presence";
|
|
1802
1484
|
function $921a889cee6df7e8$var$usePresence(present) {
|
|
1803
|
-
|
|
1804
|
-
const stylesRef = $iqq3r$useRef({});
|
|
1805
|
-
const prevPresentRef = $iqq3r$useRef(present);
|
|
1806
|
-
const prevAnimationNameRef = $iqq3r$useRef("none");
|
|
1807
|
-
const initialState = present ? "mounted" : "unmounted";
|
|
1808
|
-
const [state, send] = $fe963b355347cc68$export$3e6543de14f8614f(initialState, {
|
|
1485
|
+
let [node1, setNode] = $iqq3r$useState(), stylesRef = $iqq3r$useRef({}), prevPresentRef = $iqq3r$useRef(present), prevAnimationNameRef = $iqq3r$useRef("none"), initialState = present ? "mounted" : "unmounted", [state, send] = $fe963b355347cc68$export$3e6543de14f8614f(initialState, {
|
|
1809
1486
|
mounted: {
|
|
1810
1487
|
UNMOUNT: "unmounted",
|
|
1811
1488
|
ANIMATION_OUT: "unmountSuspended"
|
|
@@ -1818,215 +1495,57 @@ function $921a889cee6df7e8$var$usePresence(present) {
|
|
|
1818
1495
|
MOUNT: "mounted"
|
|
1819
1496
|
}
|
|
1820
1497
|
});
|
|
1821
|
-
$iqq3r$useEffect(() => {
|
|
1822
|
-
|
|
1498
|
+
return $iqq3r$useEffect(() => {
|
|
1499
|
+
let currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
1823
1500
|
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
1824
1501
|
}, [
|
|
1825
1502
|
state
|
|
1826
|
-
])
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
if (hasPresentChanged) {
|
|
1832
|
-
const prevAnimationName = prevAnimationNameRef.current;
|
|
1833
|
-
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(styles);
|
|
1834
|
-
if (present) send("MOUNT");
|
|
1835
|
-
else if (currentAnimationName === "none" || (styles === null || styles === void 0 ? void 0 : styles.display) === "none")
|
|
1836
|
-
send("UNMOUNT");
|
|
1837
|
-
else {
|
|
1838
|
-
const isAnimating = prevAnimationName !== currentAnimationName;
|
|
1839
|
-
if (wasPresent && isAnimating) send("ANIMATION_OUT");
|
|
1840
|
-
else send("UNMOUNT");
|
|
1841
|
-
}
|
|
1842
|
-
prevPresentRef.current = present;
|
|
1503
|
+
]), $9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
|
1504
|
+
let styles = stylesRef.current, wasPresent = prevPresentRef.current;
|
|
1505
|
+
if (wasPresent !== present) {
|
|
1506
|
+
let prevAnimationName = prevAnimationNameRef.current, currentAnimationName = $921a889cee6df7e8$var$getAnimationName(styles);
|
|
1507
|
+
present ? send("MOUNT") : currentAnimationName === "none" || styles?.display === "none" ? send("UNMOUNT") : send(wasPresent && prevAnimationName !== currentAnimationName ? "ANIMATION_OUT" : "UNMOUNT"), prevPresentRef.current = present;
|
|
1843
1508
|
}
|
|
1844
1509
|
}, [
|
|
1845
1510
|
present,
|
|
1846
1511
|
send
|
|
1847
|
-
])
|
|
1848
|
-
$9f79659886946c16$export$e5c5a5f917a5871c2(() => {
|
|
1512
|
+
]), $9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
|
1849
1513
|
if (node1) {
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
}
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
1861
|
-
}, "handleAnimationStart");
|
|
1862
|
-
node1.addEventListener("animationstart", handleAnimationStart);
|
|
1863
|
-
node1.addEventListener("animationcancel", handleAnimationEnd);
|
|
1864
|
-
node1.addEventListener("animationend", handleAnimationEnd);
|
|
1865
|
-
return () => {
|
|
1866
|
-
node1.removeEventListener("animationstart", handleAnimationStart);
|
|
1867
|
-
node1.removeEventListener("animationcancel", handleAnimationEnd);
|
|
1868
|
-
node1.removeEventListener("animationend", handleAnimationEnd);
|
|
1514
|
+
let handleAnimationEnd = (event) => {
|
|
1515
|
+
let isCurrentAnimation = $921a889cee6df7e8$var$getAnimationName(stylesRef.current).includes(event.animationName);
|
|
1516
|
+
event.target === node1 && isCurrentAnimation && $iqq3r$flushSync(
|
|
1517
|
+
() => send("ANIMATION_END")
|
|
1518
|
+
);
|
|
1519
|
+
}, handleAnimationStart = (event) => {
|
|
1520
|
+
event.target === node1 && (prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName(stylesRef.current));
|
|
1521
|
+
};
|
|
1522
|
+
return node1.addEventListener("animationstart", handleAnimationStart), node1.addEventListener("animationcancel", handleAnimationEnd), node1.addEventListener("animationend", handleAnimationEnd), () => {
|
|
1523
|
+
node1.removeEventListener("animationstart", handleAnimationStart), node1.removeEventListener("animationcancel", handleAnimationEnd), node1.removeEventListener("animationend", handleAnimationEnd);
|
|
1869
1524
|
};
|
|
1870
1525
|
} else
|
|
1871
1526
|
send("ANIMATION_END");
|
|
1872
1527
|
}, [
|
|
1873
1528
|
node1,
|
|
1874
1529
|
send
|
|
1875
|
-
])
|
|
1876
|
-
return {
|
|
1530
|
+
]), {
|
|
1877
1531
|
isPresent: [
|
|
1878
1532
|
"mounted",
|
|
1879
1533
|
"unmountSuspended"
|
|
1880
1534
|
].includes(state),
|
|
1881
1535
|
ref: $iqq3r$useCallback((node) => {
|
|
1882
|
-
|
|
1883
|
-
setNode(node);
|
|
1536
|
+
node && (stylesRef.current = getComputedStyle(node)), setNode(node);
|
|
1884
1537
|
}, [])
|
|
1885
1538
|
};
|
|
1886
1539
|
}
|
|
1887
|
-
__name($921a889cee6df7e8$var$usePresence, "$921a889cee6df7e8$var$usePresence");
|
|
1888
1540
|
function $921a889cee6df7e8$var$getAnimationName(styles) {
|
|
1889
|
-
return
|
|
1890
|
-
}
|
|
1891
|
-
__name($921a889cee6df7e8$var$getAnimationName, "$921a889cee6df7e8$var$getAnimationName");
|
|
1892
|
-
|
|
1893
|
-
// ../../node_modules/@radix-ui/react-tabs/node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
1894
|
-
import { forwardRef as $4q5Fq$forwardRef2, useEffect as $4q5Fq$useEffect2, createElement as $4q5Fq$createElement2 } from "react";
|
|
1895
|
-
import { flushSync as $4q5Fq$flushSync2 } from "react-dom";
|
|
1896
|
-
|
|
1897
|
-
// ../../node_modules/@radix-ui/react-tabs/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
1898
|
-
import { forwardRef as $9IrjX$forwardRef3, Children as $9IrjX$Children3, isValidElement as $9IrjX$isValidElement3, createElement as $9IrjX$createElement3, cloneElement as $9IrjX$cloneElement3, Fragment as $9IrjX$Fragment3 } from "react";
|
|
1899
|
-
|
|
1900
|
-
// ../../node_modules/@radix-ui/react-tabs/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
1901
|
-
import { useCallback as $3vqmr$useCallback4 } from "react";
|
|
1902
|
-
function $6ed0406888f73fc4$var$setRef4(ref, value) {
|
|
1903
|
-
if (typeof ref === "function") ref(value);
|
|
1904
|
-
else if (ref !== null && ref !== void 0) ref.current = value;
|
|
1905
|
-
}
|
|
1906
|
-
__name($6ed0406888f73fc4$var$setRef4, "$6ed0406888f73fc4$var$setRef");
|
|
1907
|
-
function $6ed0406888f73fc4$export$43e446d32b3d21af4(...refs) {
|
|
1908
|
-
return (node) => refs.forEach(
|
|
1909
|
-
(ref) => $6ed0406888f73fc4$var$setRef4(ref, node)
|
|
1910
|
-
);
|
|
1911
|
-
}
|
|
1912
|
-
__name($6ed0406888f73fc4$export$43e446d32b3d21af4, "$6ed0406888f73fc4$export$43e446d32b3d21af");
|
|
1913
|
-
|
|
1914
|
-
// ../../node_modules/@radix-ui/react-tabs/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
1915
|
-
var $5e63c961fc1ce211$export$8c6ed5c666ac13603 = $9IrjX$forwardRef3((props, forwardedRef) => {
|
|
1916
|
-
const { children, ...slotProps } = props;
|
|
1917
|
-
const childrenArray = $9IrjX$Children3.toArray(children);
|
|
1918
|
-
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable3);
|
|
1919
|
-
if (slottable) {
|
|
1920
|
-
const newElement = slottable.props.children;
|
|
1921
|
-
const newChildren = childrenArray.map((child) => {
|
|
1922
|
-
if (child === slottable) {
|
|
1923
|
-
if ($9IrjX$Children3.count(newElement) > 1) return $9IrjX$Children3.only(null);
|
|
1924
|
-
return $9IrjX$isValidElement3(newElement) ? newElement.props.children : null;
|
|
1925
|
-
} else return child;
|
|
1926
|
-
});
|
|
1927
|
-
return $9IrjX$createElement3($5e63c961fc1ce211$var$SlotClone3, _extends({}, slotProps, {
|
|
1928
|
-
ref: forwardedRef
|
|
1929
|
-
}), $9IrjX$isValidElement3(newElement) ? $9IrjX$cloneElement3(newElement, void 0, newChildren) : null);
|
|
1930
|
-
}
|
|
1931
|
-
return $9IrjX$createElement3($5e63c961fc1ce211$var$SlotClone3, _extends({}, slotProps, {
|
|
1932
|
-
ref: forwardedRef
|
|
1933
|
-
}), children);
|
|
1934
|
-
});
|
|
1935
|
-
$5e63c961fc1ce211$export$8c6ed5c666ac13603.displayName = "Slot";
|
|
1936
|
-
var $5e63c961fc1ce211$var$SlotClone3 = $9IrjX$forwardRef3((props, forwardedRef) => {
|
|
1937
|
-
const { children, ...slotProps } = props;
|
|
1938
|
-
if ($9IrjX$isValidElement3(children)) return $9IrjX$cloneElement3(children, {
|
|
1939
|
-
...$5e63c961fc1ce211$var$mergeProps3(slotProps, children.props),
|
|
1940
|
-
ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af4(forwardedRef, children.ref) : children.ref
|
|
1941
|
-
});
|
|
1942
|
-
return $9IrjX$Children3.count(children) > 1 ? $9IrjX$Children3.only(null) : null;
|
|
1943
|
-
});
|
|
1944
|
-
$5e63c961fc1ce211$var$SlotClone3.displayName = "SlotClone";
|
|
1945
|
-
var $5e63c961fc1ce211$export$d9f1ccf0bdb05d453 = /* @__PURE__ */ __name(({ children }) => {
|
|
1946
|
-
return $9IrjX$createElement3($9IrjX$Fragment3, null, children);
|
|
1947
|
-
}, "$5e63c961fc1ce211$export$d9f1ccf0bdb05d45");
|
|
1948
|
-
function $5e63c961fc1ce211$var$isSlottable3(child) {
|
|
1949
|
-
return $9IrjX$isValidElement3(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d453;
|
|
1950
|
-
}
|
|
1951
|
-
__name($5e63c961fc1ce211$var$isSlottable3, "$5e63c961fc1ce211$var$isSlottable");
|
|
1952
|
-
function $5e63c961fc1ce211$var$mergeProps3(slotProps, childProps) {
|
|
1953
|
-
const overrideProps = {
|
|
1954
|
-
...childProps
|
|
1955
|
-
};
|
|
1956
|
-
for (const propName in childProps) {
|
|
1957
|
-
const slotPropValue = slotProps[propName];
|
|
1958
|
-
const childPropValue = childProps[propName];
|
|
1959
|
-
const isHandler = /^on[A-Z]/.test(propName);
|
|
1960
|
-
if (isHandler) {
|
|
1961
|
-
if (slotPropValue && childPropValue) overrideProps[propName] = (...args) => {
|
|
1962
|
-
childPropValue(...args);
|
|
1963
|
-
slotPropValue(...args);
|
|
1964
|
-
};
|
|
1965
|
-
else if (slotPropValue) overrideProps[propName] = slotPropValue;
|
|
1966
|
-
} else if (propName === "style") overrideProps[propName] = {
|
|
1967
|
-
...slotPropValue,
|
|
1968
|
-
...childPropValue
|
|
1969
|
-
};
|
|
1970
|
-
else if (propName === "className") overrideProps[propName] = [
|
|
1971
|
-
slotPropValue,
|
|
1972
|
-
childPropValue
|
|
1973
|
-
].filter(Boolean).join(" ");
|
|
1974
|
-
}
|
|
1975
|
-
return {
|
|
1976
|
-
...slotProps,
|
|
1977
|
-
...overrideProps
|
|
1978
|
-
};
|
|
1541
|
+
return styles?.animationName || "none";
|
|
1979
1542
|
}
|
|
1980
|
-
__name($5e63c961fc1ce211$var$mergeProps3, "$5e63c961fc1ce211$var$mergeProps");
|
|
1981
|
-
|
|
1982
|
-
// ../../node_modules/@radix-ui/react-tabs/node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
1983
|
-
var $8927f6f2acc4f386$var$NODES2 = [
|
|
1984
|
-
"a",
|
|
1985
|
-
"button",
|
|
1986
|
-
"div",
|
|
1987
|
-
"form",
|
|
1988
|
-
"h2",
|
|
1989
|
-
"h3",
|
|
1990
|
-
"img",
|
|
1991
|
-
"input",
|
|
1992
|
-
"label",
|
|
1993
|
-
"li",
|
|
1994
|
-
"nav",
|
|
1995
|
-
"ol",
|
|
1996
|
-
"p",
|
|
1997
|
-
"span",
|
|
1998
|
-
"svg",
|
|
1999
|
-
"ul"
|
|
2000
|
-
];
|
|
2001
|
-
var $8927f6f2acc4f386$export$250ffa63cdc0d0342 = $8927f6f2acc4f386$var$NODES2.reduce((primitive, node) => {
|
|
2002
|
-
const Node = $4q5Fq$forwardRef2((props, forwardedRef) => {
|
|
2003
|
-
const { asChild, ...primitiveProps } = props;
|
|
2004
|
-
const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac13603 : node;
|
|
2005
|
-
$4q5Fq$useEffect2(() => {
|
|
2006
|
-
window[Symbol.for("radix-ui")] = true;
|
|
2007
|
-
}, []);
|
|
2008
|
-
return $4q5Fq$createElement2(Comp, _extends({}, primitiveProps, {
|
|
2009
|
-
ref: forwardedRef
|
|
2010
|
-
}));
|
|
2011
|
-
});
|
|
2012
|
-
Node.displayName = `Primitive.${node}`;
|
|
2013
|
-
return {
|
|
2014
|
-
...primitive,
|
|
2015
|
-
[node]: Node
|
|
2016
|
-
};
|
|
2017
|
-
}, {});
|
|
2018
1543
|
|
|
2019
1544
|
// ../../node_modules/@radix-ui/react-tabs/dist/index.mjs
|
|
2020
|
-
var $69cb30bb0017df05$var$TABS_NAME = "Tabs"
|
|
2021
|
-
var [$69cb30bb0017df05$var$createTabsContext, $69cb30bb0017df05$export$355f5bd209d7b13a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($69cb30bb0017df05$var$TABS_NAME, [
|
|
1545
|
+
var $69cb30bb0017df05$var$TABS_NAME = "Tabs", [$69cb30bb0017df05$var$createTabsContext, $69cb30bb0017df05$export$355f5bd209d7b13a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($69cb30bb0017df05$var$TABS_NAME, [
|
|
2022
1546
|
$d7bdfb9eb0fdf311$export$c7109489551a4f4
|
|
2023
|
-
])
|
|
2024
|
-
|
|
2025
|
-
var [$69cb30bb0017df05$var$TabsProvider, $69cb30bb0017df05$var$useTabsContext] = $69cb30bb0017df05$var$createTabsContext($69cb30bb0017df05$var$TABS_NAME);
|
|
2026
|
-
var $69cb30bb0017df05$export$b2539bed5023c21c = $1IHzk$forwardRef((props, forwardedRef) => {
|
|
2027
|
-
const { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = "horizontal", dir, activationMode = "automatic", ...tabsProps } = props;
|
|
2028
|
-
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
2029
|
-
const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
1547
|
+
]), $69cb30bb0017df05$var$useRovingFocusGroupScope = $d7bdfb9eb0fdf311$export$c7109489551a4f4(), [$69cb30bb0017df05$var$TabsProvider, $69cb30bb0017df05$var$useTabsContext] = $69cb30bb0017df05$var$createTabsContext($69cb30bb0017df05$var$TABS_NAME), $69cb30bb0017df05$export$b2539bed5023c21c = $1IHzk$forwardRef((props, forwardedRef) => {
|
|
1548
|
+
let { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = "horizontal", dir, activationMode = "automatic", ...tabsProps } = props, direction = $f631663db3294ace$export$b39126d51d94e6f3(dir), [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
2030
1549
|
prop: valueProp,
|
|
2031
1550
|
onChange: onValueChange,
|
|
2032
1551
|
defaultProp: defaultValue
|
|
@@ -2039,7 +1558,7 @@ var $69cb30bb0017df05$export$b2539bed5023c21c = $1IHzk$forwardRef((props, forwar
|
|
|
2039
1558
|
orientation,
|
|
2040
1559
|
dir: direction,
|
|
2041
1560
|
activationMode
|
|
2042
|
-
}, $1IHzk$createElement($8927f6f2acc4f386$export$
|
|
1561
|
+
}, $1IHzk$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
2043
1562
|
dir: direction,
|
|
2044
1563
|
"data-orientation": orientation
|
|
2045
1564
|
}, tabsProps, {
|
|
@@ -2049,18 +1568,15 @@ var $69cb30bb0017df05$export$b2539bed5023c21c = $1IHzk$forwardRef((props, forwar
|
|
|
2049
1568
|
Object.assign($69cb30bb0017df05$export$b2539bed5023c21c, {
|
|
2050
1569
|
displayName: $69cb30bb0017df05$var$TABS_NAME
|
|
2051
1570
|
});
|
|
2052
|
-
var $69cb30bb0017df05$var$TAB_LIST_NAME = "TabsList"
|
|
2053
|
-
|
|
2054
|
-
const { __scopeTabs, loop = true, ...listProps } = props;
|
|
2055
|
-
const context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TAB_LIST_NAME, __scopeTabs);
|
|
2056
|
-
const rovingFocusGroupScope = $69cb30bb0017df05$var$useRovingFocusGroupScope(__scopeTabs);
|
|
1571
|
+
var $69cb30bb0017df05$var$TAB_LIST_NAME = "TabsList", $69cb30bb0017df05$export$9712d22edc0d78c1 = $1IHzk$forwardRef((props, forwardedRef) => {
|
|
1572
|
+
let { __scopeTabs, loop = !0, ...listProps } = props, context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TAB_LIST_NAME, __scopeTabs), rovingFocusGroupScope = $69cb30bb0017df05$var$useRovingFocusGroupScope(__scopeTabs);
|
|
2057
1573
|
return $1IHzk$createElement($d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9, _extends({
|
|
2058
|
-
asChild:
|
|
1574
|
+
asChild: !0
|
|
2059
1575
|
}, rovingFocusGroupScope, {
|
|
2060
1576
|
orientation: context.orientation,
|
|
2061
1577
|
dir: context.dir,
|
|
2062
1578
|
loop
|
|
2063
|
-
}), $1IHzk$createElement($8927f6f2acc4f386$export$
|
|
1579
|
+
}), $1IHzk$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
2064
1580
|
role: "tablist",
|
|
2065
1581
|
"aria-orientation": context.orientation
|
|
2066
1582
|
}, listProps, {
|
|
@@ -2070,20 +1586,14 @@ var $69cb30bb0017df05$export$9712d22edc0d78c1 = $1IHzk$forwardRef((props, forwar
|
|
|
2070
1586
|
Object.assign($69cb30bb0017df05$export$9712d22edc0d78c1, {
|
|
2071
1587
|
displayName: $69cb30bb0017df05$var$TAB_LIST_NAME
|
|
2072
1588
|
});
|
|
2073
|
-
var $69cb30bb0017df05$var$TRIGGER_NAME = "TabsTrigger"
|
|
2074
|
-
var $69cb30bb0017df05$
|
|
2075
|
-
const { __scopeTabs, value, disabled = false, ...triggerProps } = props;
|
|
2076
|
-
const context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TRIGGER_NAME, __scopeTabs);
|
|
2077
|
-
const rovingFocusGroupScope = $69cb30bb0017df05$var$useRovingFocusGroupScope(__scopeTabs);
|
|
2078
|
-
const triggerId = $69cb30bb0017df05$var$makeTriggerId(context.baseId, value);
|
|
2079
|
-
const contentId = $69cb30bb0017df05$var$makeContentId(context.baseId, value);
|
|
2080
|
-
const isSelected = value === context.value;
|
|
1589
|
+
var $69cb30bb0017df05$var$TRIGGER_NAME = "TabsTrigger", $69cb30bb0017df05$export$8114b9fdfdf9f3ba = $1IHzk$forwardRef((props, forwardedRef) => {
|
|
1590
|
+
let { __scopeTabs, value, disabled = !1, ...triggerProps } = props, context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TRIGGER_NAME, __scopeTabs), rovingFocusGroupScope = $69cb30bb0017df05$var$useRovingFocusGroupScope(__scopeTabs), triggerId = $69cb30bb0017df05$var$makeTriggerId(context.baseId, value), contentId = $69cb30bb0017df05$var$makeContentId(context.baseId, value), isSelected = value === context.value;
|
|
2081
1591
|
return $1IHzk$createElement($d7bdfb9eb0fdf311$export$6d08773d2e66f8f2, _extends({
|
|
2082
|
-
asChild:
|
|
1592
|
+
asChild: !0
|
|
2083
1593
|
}, rovingFocusGroupScope, {
|
|
2084
1594
|
focusable: !disabled,
|
|
2085
1595
|
active: isSelected
|
|
2086
|
-
}), $1IHzk$createElement($8927f6f2acc4f386$export$
|
|
1596
|
+
}), $1IHzk$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
2087
1597
|
type: "button",
|
|
2088
1598
|
role: "tab",
|
|
2089
1599
|
"aria-selected": isSelected,
|
|
@@ -2095,45 +1605,36 @@ var $69cb30bb0017df05$export$8114b9fdfdf9f3ba = $1IHzk$forwardRef((props, forwar
|
|
|
2095
1605
|
}, triggerProps, {
|
|
2096
1606
|
ref: forwardedRef,
|
|
2097
1607
|
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, (event) => {
|
|
2098
|
-
|
|
2099
|
-
else
|
|
2100
|
-
event.preventDefault();
|
|
1608
|
+
!disabled && event.button === 0 && event.ctrlKey === !1 ? context.onValueChange(value) : event.preventDefault();
|
|
2101
1609
|
}),
|
|
2102
1610
|
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event) => {
|
|
2103
|
-
|
|
1611
|
+
[
|
|
2104
1612
|
" ",
|
|
2105
1613
|
"Enter"
|
|
2106
|
-
].includes(event.key)
|
|
1614
|
+
].includes(event.key) && context.onValueChange(value);
|
|
2107
1615
|
}),
|
|
2108
1616
|
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, () => {
|
|
2109
|
-
|
|
2110
|
-
|
|
1617
|
+
let isAutomaticActivation = context.activationMode !== "manual";
|
|
1618
|
+
!isSelected && !disabled && isAutomaticActivation && context.onValueChange(value);
|
|
2111
1619
|
})
|
|
2112
1620
|
})));
|
|
2113
1621
|
});
|
|
2114
1622
|
Object.assign($69cb30bb0017df05$export$8114b9fdfdf9f3ba, {
|
|
2115
1623
|
displayName: $69cb30bb0017df05$var$TRIGGER_NAME
|
|
2116
1624
|
});
|
|
2117
|
-
var $69cb30bb0017df05$var$CONTENT_NAME = "TabsContent"
|
|
2118
|
-
var $69cb30bb0017df05$
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
const contentId = $69cb30bb0017df05$var$makeContentId(context.baseId, value);
|
|
2123
|
-
const isSelected = value === context.value;
|
|
2124
|
-
const isMountAnimationPreventedRef = $1IHzk$useRef(isSelected);
|
|
2125
|
-
$1IHzk$useEffect(() => {
|
|
2126
|
-
const rAF = requestAnimationFrame(
|
|
2127
|
-
() => isMountAnimationPreventedRef.current = false
|
|
1625
|
+
var $69cb30bb0017df05$var$CONTENT_NAME = "TabsContent", $69cb30bb0017df05$export$bd905d70e8fd2ebb = $1IHzk$forwardRef((props, forwardedRef) => {
|
|
1626
|
+
let { __scopeTabs, value, forceMount, children, ...contentProps } = props, context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$CONTENT_NAME, __scopeTabs), triggerId = $69cb30bb0017df05$var$makeTriggerId(context.baseId, value), contentId = $69cb30bb0017df05$var$makeContentId(context.baseId, value), isSelected = value === context.value, isMountAnimationPreventedRef = $1IHzk$useRef(isSelected);
|
|
1627
|
+
return $1IHzk$useEffect(() => {
|
|
1628
|
+
let rAF = requestAnimationFrame(
|
|
1629
|
+
() => isMountAnimationPreventedRef.current = !1
|
|
2128
1630
|
);
|
|
2129
1631
|
return () => cancelAnimationFrame(rAF);
|
|
2130
|
-
}, [])
|
|
2131
|
-
return $1IHzk$createElement(
|
|
1632
|
+
}, []), $1IHzk$createElement(
|
|
2132
1633
|
$921a889cee6df7e8$export$99c2b779aa4e8b8b,
|
|
2133
1634
|
{
|
|
2134
1635
|
present: forceMount || isSelected
|
|
2135
1636
|
},
|
|
2136
|
-
({ present }) => $1IHzk$createElement($8927f6f2acc4f386$export$
|
|
1637
|
+
({ present }) => $1IHzk$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
2137
1638
|
"data-state": isSelected ? "active" : "inactive",
|
|
2138
1639
|
"data-orientation": context.orientation,
|
|
2139
1640
|
role: "tabpanel",
|
|
@@ -2156,15 +1657,10 @@ Object.assign($69cb30bb0017df05$export$bd905d70e8fd2ebb, {
|
|
|
2156
1657
|
function $69cb30bb0017df05$var$makeTriggerId(baseId, value) {
|
|
2157
1658
|
return `${baseId}-trigger-${value}`;
|
|
2158
1659
|
}
|
|
2159
|
-
__name($69cb30bb0017df05$var$makeTriggerId, "$69cb30bb0017df05$var$makeTriggerId");
|
|
2160
1660
|
function $69cb30bb0017df05$var$makeContentId(baseId, value) {
|
|
2161
1661
|
return `${baseId}-content-${value}`;
|
|
2162
1662
|
}
|
|
2163
|
-
|
|
2164
|
-
var $69cb30bb0017df05$export$be92b6f5f03c0fe9 = $69cb30bb0017df05$export$b2539bed5023c21c;
|
|
2165
|
-
var $69cb30bb0017df05$export$54c2e3dc7acea9f5 = $69cb30bb0017df05$export$9712d22edc0d78c1;
|
|
2166
|
-
var $69cb30bb0017df05$export$41fb9f06171c75f4 = $69cb30bb0017df05$export$8114b9fdfdf9f3ba;
|
|
2167
|
-
var $69cb30bb0017df05$export$7c6e2c02157bb7d2 = $69cb30bb0017df05$export$bd905d70e8fd2ebb;
|
|
1663
|
+
var $69cb30bb0017df05$export$be92b6f5f03c0fe9 = $69cb30bb0017df05$export$b2539bed5023c21c, $69cb30bb0017df05$export$54c2e3dc7acea9f5 = $69cb30bb0017df05$export$9712d22edc0d78c1, $69cb30bb0017df05$export$41fb9f06171c75f4 = $69cb30bb0017df05$export$8114b9fdfdf9f3ba, $69cb30bb0017df05$export$7c6e2c02157bb7d2 = $69cb30bb0017df05$export$bd905d70e8fd2ebb;
|
|
2168
1664
|
|
|
2169
1665
|
// src/components/Report/Details.tsx
|
|
2170
1666
|
import { styled } from "storybook/theming";
|
|
@@ -2182,12 +1678,10 @@ var StyledSyntaxHighlighter = styled(SyntaxHighlighter)(
|
|
|
2182
1678
|
}
|
|
2183
1679
|
}
|
|
2184
1680
|
)
|
|
2185
|
-
)
|
|
2186
|
-
var Info = styled.div({
|
|
1681
|
+
), Info = styled.div({
|
|
2187
1682
|
display: "flex",
|
|
2188
1683
|
flexDirection: "column"
|
|
2189
|
-
})
|
|
2190
|
-
var RuleId = styled.div(({ theme: theme2 }) => ({
|
|
1684
|
+
}), RuleId = styled.div(({ theme: theme2 }) => ({
|
|
2191
1685
|
display: "block",
|
|
2192
1686
|
color: theme2.textMutedColor,
|
|
2193
1687
|
fontFamily: theme2.typography.fonts.mono,
|
|
@@ -2197,24 +1691,20 @@ var RuleId = styled.div(({ theme: theme2 }) => ({
|
|
|
2197
1691
|
"@container (min-width: 800px)": {
|
|
2198
1692
|
display: "none"
|
|
2199
1693
|
}
|
|
2200
|
-
}))
|
|
2201
|
-
var Description = styled.p({
|
|
1694
|
+
})), Description = styled.p({
|
|
2202
1695
|
margin: 0
|
|
2203
|
-
})
|
|
2204
|
-
var Wrapper = styled.div({
|
|
1696
|
+
}), Wrapper = styled.div({
|
|
2205
1697
|
display: "flex",
|
|
2206
1698
|
flexDirection: "column",
|
|
2207
1699
|
padding: "0 15px 20px 15px",
|
|
2208
1700
|
gap: 20
|
|
2209
|
-
})
|
|
2210
|
-
var Columns = styled.div({
|
|
1701
|
+
}), Columns = styled.div({
|
|
2211
1702
|
gap: 15,
|
|
2212
1703
|
"@container (min-width: 800px)": {
|
|
2213
1704
|
display: "grid",
|
|
2214
1705
|
gridTemplateColumns: "50% 50%"
|
|
2215
1706
|
}
|
|
2216
|
-
})
|
|
2217
|
-
var Content = styled.div(({ theme: theme2, side }) => ({
|
|
1707
|
+
}), Content = styled.div(({ theme: theme2, side }) => ({
|
|
2218
1708
|
display: side === "left" ? "flex" : "none",
|
|
2219
1709
|
flexDirection: "column",
|
|
2220
1710
|
gap: 15,
|
|
@@ -2229,8 +1719,7 @@ var Content = styled.div(({ theme: theme2, side }) => ({
|
|
|
2229
1719
|
"@container (min-width: 800px)": {
|
|
2230
1720
|
display: side === "left" ? "none" : "flex"
|
|
2231
1721
|
}
|
|
2232
|
-
}))
|
|
2233
|
-
var Item = styled(Button)(({ theme: theme2 }) => ({
|
|
1722
|
+
})), Item = styled(Button)(({ theme: theme2 }) => ({
|
|
2234
1723
|
fontFamily: theme2.typography.fonts.mono,
|
|
2235
1724
|
fontWeight: theme2.typography.weight.regular,
|
|
2236
1725
|
color: theme2.textMutedColor,
|
|
@@ -2246,52 +1735,44 @@ var Item = styled(Button)(({ theme: theme2 }) => ({
|
|
|
2246
1735
|
color: theme2.color.secondary,
|
|
2247
1736
|
backgroundColor: theme2.background.hoverable
|
|
2248
1737
|
}
|
|
2249
|
-
}))
|
|
2250
|
-
var Messages = styled.div({
|
|
1738
|
+
})), Messages = styled.div({
|
|
2251
1739
|
display: "flex",
|
|
2252
1740
|
flexDirection: "column",
|
|
2253
1741
|
gap: 10
|
|
2254
|
-
})
|
|
2255
|
-
var Actions = styled.div({
|
|
1742
|
+
}), Actions = styled.div({
|
|
2256
1743
|
display: "flex",
|
|
2257
1744
|
gap: 10
|
|
2258
|
-
})
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
onClick();
|
|
2263
|
-
setCopied(true);
|
|
2264
|
-
const timeout = setTimeout(() => setCopied(false), 2e3);
|
|
1745
|
+
}), CopyButton = ({ onClick }) => {
|
|
1746
|
+
let [copied, setCopied] = useState3(!1), handleClick = useCallback2(() => {
|
|
1747
|
+
onClick(), setCopied(!0);
|
|
1748
|
+
let timeout = setTimeout(() => setCopied(!1), 2e3);
|
|
2265
1749
|
return () => clearTimeout(timeout);
|
|
2266
1750
|
}, [onClick]);
|
|
2267
|
-
return React2.createElement(Button, { onClick: handleClick }, copied ? React2.createElement(CheckIcon, null) : React2.createElement(CopyIcon, null), " ", copied ? "Copied" : "Copy link");
|
|
2268
|
-
}, "
|
|
2269
|
-
var Details = /* @__PURE__ */ __name(({ id, item, type, selection, handleSelectionChange }) => React2.createElement(Wrapper, { id }, React2.createElement(Info, null, React2.createElement(RuleId, null, item.id), React2.createElement(Description, null, getFriendlySummaryForAxeResult(item), " ", React2.createElement(Link, { href: item.helpUrl, target: "_blank", rel: "noopener noreferrer", withArrow: true }, "Learn how to resolve this violation"))), React2.createElement(
|
|
1751
|
+
return React2.createElement(Button, { ariaLabel: !1, onClick: handleClick }, copied ? React2.createElement(CheckIcon, null) : React2.createElement(CopyIcon, null), " ", copied ? "Copied" : "Copy link");
|
|
1752
|
+
}, Details = ({ id, item, type, selection, handleSelectionChange }) => React2.createElement(Wrapper, { id }, React2.createElement(Info, null, React2.createElement(RuleId, null, item.id), React2.createElement(Description, null, getFriendlySummaryForAxeResult(item), " ", React2.createElement(Link, { href: item.helpUrl, target: "_blank", rel: "noopener noreferrer", withArrow: !0 }, "Learn how to resolve this violation"))), React2.createElement(
|
|
2270
1753
|
$69cb30bb0017df05$export$be92b6f5f03c0fe9,
|
|
2271
1754
|
{
|
|
2272
1755
|
defaultValue: selection,
|
|
2273
1756
|
orientation: "vertical",
|
|
2274
1757
|
value: selection,
|
|
2275
1758
|
onValueChange: handleSelectionChange,
|
|
2276
|
-
asChild:
|
|
1759
|
+
asChild: !0
|
|
2277
1760
|
},
|
|
2278
1761
|
React2.createElement(Columns, null, React2.createElement($69cb30bb0017df05$export$54c2e3dc7acea9f5, { "aria-label": type }, item.nodes.map((node, index) => {
|
|
2279
|
-
|
|
2280
|
-
return React2.createElement(Fragment, { key }, React2.createElement($69cb30bb0017df05$export$41fb9f06171c75f4, { value: key, asChild:
|
|
1762
|
+
let key = `${type}.${item.id}.${index + 1}`;
|
|
1763
|
+
return React2.createElement(Fragment, { key }, React2.createElement($69cb30bb0017df05$export$41fb9f06171c75f4, { value: key, asChild: !0 }, React2.createElement(Item, { ariaLabel: !1, variant: "ghost", size: "medium", id: key }, index + 1, ". ", node.html)), React2.createElement($69cb30bb0017df05$export$7c6e2c02157bb7d2, { value: key, asChild: !0 }, React2.createElement(Content, { side: "left" }, getContent(node))));
|
|
2281
1764
|
})), item.nodes.map((node, index) => {
|
|
2282
|
-
|
|
2283
|
-
return React2.createElement($69cb30bb0017df05$export$7c6e2c02157bb7d2, { key, value: key, asChild:
|
|
1765
|
+
let key = `${type}.${item.id}.${index + 1}`;
|
|
1766
|
+
return React2.createElement($69cb30bb0017df05$export$7c6e2c02157bb7d2, { key, value: key, asChild: !0 }, React2.createElement(Content, { side: "right" }, getContent(node)));
|
|
2284
1767
|
}))
|
|
2285
|
-
))
|
|
1768
|
+
));
|
|
2286
1769
|
function getContent(node) {
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
const rules = [...any, ...all, ...none];
|
|
2290
|
-
return React2.createElement(React2.Fragment, null, React2.createElement(Messages, null, rules.map((rule) => React2.createElement("div", { key: rule.id }, `${rule.message}${/(\.|: [^.]+\.*)$/.test(rule.message) ? "" : "."}`))), React2.createElement(Actions, null, React2.createElement(Button, { onClick: () => handleJumpToElement(node.target.toString()) }, React2.createElement(LocationIcon, null), " Jump to element"), React2.createElement(CopyButton, { onClick: () => handleCopyLink(node.linkPath) })), React2.createElement(
|
|
1770
|
+
let { handleCopyLink, handleJumpToElement } = useA11yContext(), { any, all, none, html, target } = node, rules = [...any, ...all, ...none];
|
|
1771
|
+
return React2.createElement(React2.Fragment, null, React2.createElement(Messages, null, rules.map((rule) => React2.createElement("div", { key: rule.id }, `${rule.message}${/(\.|: [^.]+\.*)$/.test(rule.message) ? "" : "."}`))), React2.createElement(Actions, null, React2.createElement(Button, { ariaLabel: !1, onClick: () => handleJumpToElement(node.target.toString()) }, React2.createElement(LocationIcon, null), " Jump to element"), React2.createElement(CopyButton, { onClick: () => handleCopyLink(node.linkPath) })), React2.createElement(
|
|
2291
1772
|
StyledSyntaxHighlighter,
|
|
2292
1773
|
{
|
|
2293
1774
|
language: "jsx",
|
|
2294
|
-
wrapLongLines:
|
|
1775
|
+
wrapLongLines: !0
|
|
2295
1776
|
},
|
|
2296
1777
|
`/* element */
|
|
2297
1778
|
${html}`
|
|
@@ -2299,13 +1780,12 @@ ${html}`
|
|
|
2299
1780
|
StyledSyntaxHighlighter,
|
|
2300
1781
|
{
|
|
2301
1782
|
language: "css",
|
|
2302
|
-
wrapLongLines:
|
|
1783
|
+
wrapLongLines: !0
|
|
2303
1784
|
},
|
|
2304
1785
|
`/* selector */
|
|
2305
1786
|
${target} {}`
|
|
2306
1787
|
));
|
|
2307
1788
|
}
|
|
2308
|
-
__name(getContent, "getContent");
|
|
2309
1789
|
|
|
2310
1790
|
// src/components/Report/Report.tsx
|
|
2311
1791
|
var impactStatus = {
|
|
@@ -2313,25 +1793,21 @@ var impactStatus = {
|
|
|
2313
1793
|
moderate: "warning",
|
|
2314
1794
|
serious: "negative",
|
|
2315
1795
|
critical: "critical"
|
|
2316
|
-
}
|
|
2317
|
-
var impactLabels = {
|
|
1796
|
+
}, impactLabels = {
|
|
2318
1797
|
minor: "Minor",
|
|
2319
1798
|
moderate: "Moderate",
|
|
2320
1799
|
serious: "Serious",
|
|
2321
1800
|
critical: "Critical"
|
|
2322
|
-
}
|
|
2323
|
-
var Wrapper2 = styled2.div(({ theme: theme2 }) => ({
|
|
1801
|
+
}, Wrapper2 = styled2.div(({ theme: theme2 }) => ({
|
|
2324
1802
|
display: "flex",
|
|
2325
1803
|
flexDirection: "column",
|
|
2326
1804
|
width: "100%",
|
|
2327
1805
|
borderBottom: `1px solid ${theme2.appBorderColor}`,
|
|
2328
1806
|
containerType: "inline-size",
|
|
2329
1807
|
fontSize: theme2.typography.size.s2
|
|
2330
|
-
}))
|
|
2331
|
-
var Icon = styled2(ChevronSmallDownIcon)({
|
|
1808
|
+
})), Icon = styled2(ChevronSmallDownIcon)({
|
|
2332
1809
|
transition: "transform 0.1s ease-in-out"
|
|
2333
|
-
})
|
|
2334
|
-
var HeaderBar = styled2.div(({ theme: theme2 }) => ({
|
|
1810
|
+
}), HeaderBar = styled2.div(({ theme: theme2 }) => ({
|
|
2335
1811
|
display: "flex",
|
|
2336
1812
|
justifyContent: "space-between",
|
|
2337
1813
|
alignItems: "center",
|
|
@@ -2346,15 +1822,13 @@ var HeaderBar = styled2.div(({ theme: theme2 }) => ({
|
|
|
2346
1822
|
"&:hover": {
|
|
2347
1823
|
color: theme2.color.secondary
|
|
2348
1824
|
}
|
|
2349
|
-
}))
|
|
2350
|
-
var Title = styled2.div(({ theme: theme2 }) => ({
|
|
1825
|
+
})), Title = styled2.div(({ theme: theme2 }) => ({
|
|
2351
1826
|
display: "flex",
|
|
2352
1827
|
alignItems: "baseline",
|
|
2353
1828
|
flexGrow: 1,
|
|
2354
1829
|
fontSize: theme2.typography.size.s2,
|
|
2355
1830
|
gap: 8
|
|
2356
|
-
}))
|
|
2357
|
-
var RuleId2 = styled2.div(({ theme: theme2 }) => ({
|
|
1831
|
+
})), RuleId2 = styled2.div(({ theme: theme2 }) => ({
|
|
2358
1832
|
display: "none",
|
|
2359
1833
|
color: theme2.textMutedColor,
|
|
2360
1834
|
fontFamily: theme2.typography.fonts.mono,
|
|
@@ -2362,16 +1836,14 @@ var RuleId2 = styled2.div(({ theme: theme2 }) => ({
|
|
|
2362
1836
|
"@container (min-width: 800px)": {
|
|
2363
1837
|
display: "block"
|
|
2364
1838
|
}
|
|
2365
|
-
}))
|
|
2366
|
-
var Count = styled2.div(({ theme: theme2 }) => ({
|
|
1839
|
+
})), Count = styled2.div(({ theme: theme2 }) => ({
|
|
2367
1840
|
display: "flex",
|
|
2368
1841
|
alignItems: "center",
|
|
2369
1842
|
justifyContent: "center",
|
|
2370
1843
|
color: theme2.textMutedColor,
|
|
2371
1844
|
width: 28,
|
|
2372
1845
|
height: 28
|
|
2373
|
-
}))
|
|
2374
|
-
var Report = /* @__PURE__ */ __name(({
|
|
1846
|
+
})), Report = ({
|
|
2375
1847
|
items,
|
|
2376
1848
|
empty,
|
|
2377
1849
|
type,
|
|
@@ -2379,17 +1851,16 @@ var Report = /* @__PURE__ */ __name(({
|
|
|
2379
1851
|
selectedItems,
|
|
2380
1852
|
toggleOpen
|
|
2381
1853
|
}) => React3.createElement(React3.Fragment, null, items && items.length ? items.map((item) => {
|
|
2382
|
-
|
|
2383
|
-
const detailsId = `details:${id}`;
|
|
2384
|
-
const selection = selectedItems.get(id);
|
|
2385
|
-
const title = getTitleForAxeResult(item);
|
|
1854
|
+
let id = `${type}.${item.id}`, detailsId = `details:${id}`, selection = selectedItems.get(id), title = getTitleForAxeResult(item);
|
|
2386
1855
|
return React3.createElement(Wrapper2, { key: id }, React3.createElement(HeaderBar, { onClick: (event) => toggleOpen(event, type, item), "data-active": !!selection }, React3.createElement(Title, null, React3.createElement("strong", null, title), React3.createElement(RuleId2, null, item.id)), item.impact && React3.createElement(Badge, { status: type === RuleType.PASS ? "neutral" : impactStatus[item.impact] }, impactLabels[item.impact]), React3.createElement(Count, null, item.nodes.length), React3.createElement(
|
|
2387
|
-
|
|
1856
|
+
Button2,
|
|
2388
1857
|
{
|
|
2389
1858
|
onClick: (event) => toggleOpen(event, type, item),
|
|
2390
|
-
|
|
1859
|
+
ariaLabel: `${selection ? "Collapse" : "Expand"} details for: ${title}`,
|
|
2391
1860
|
"aria-expanded": !!selection,
|
|
2392
|
-
"aria-controls": detailsId
|
|
1861
|
+
"aria-controls": detailsId,
|
|
1862
|
+
variant: "ghost",
|
|
1863
|
+
padding: "small"
|
|
2393
1864
|
},
|
|
2394
1865
|
React3.createElement(Icon, { style: { transform: `rotate(${selection ? -180 : 0}deg)` } })
|
|
2395
1866
|
)), selection ? React3.createElement(
|
|
@@ -2402,604 +1873,27 @@ var Report = /* @__PURE__ */ __name(({
|
|
|
2402
1873
|
handleSelectionChange
|
|
2403
1874
|
}
|
|
2404
1875
|
) : React3.createElement("div", { id: detailsId }));
|
|
2405
|
-
}) : React3.createElement(EmptyTabContent, { title: empty }))
|
|
1876
|
+
}) : React3.createElement(EmptyTabContent, { title: empty }));
|
|
2406
1877
|
|
|
2407
1878
|
// src/components/Tabs.tsx
|
|
2408
|
-
import * as React5 from "react";
|
|
2409
|
-
import { IconButton as IconButton2, ScrollArea, TooltipNote, WithTooltip } from "storybook/internal/components";
|
|
2410
|
-
import { CollapseIcon, ExpandAltIcon, EyeCloseIcon, EyeIcon, SyncIcon } from "@storybook/icons";
|
|
2411
|
-
|
|
2412
|
-
// ../../node_modules/react-resize-detector/build/index.esm.js
|
|
2413
1879
|
import * as React4 from "react";
|
|
2414
|
-
import {
|
|
2415
|
-
import {
|
|
2416
|
-
|
|
2417
|
-
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
2418
|
-
d2.__proto__ = b2;
|
|
2419
|
-
} || function(d2, b2) {
|
|
2420
|
-
for (var p in b2) if (Object.prototype.hasOwnProperty.call(b2, p)) d2[p] = b2[p];
|
|
2421
|
-
};
|
|
2422
|
-
return extendStatics(d, b);
|
|
2423
|
-
}, "extendStatics");
|
|
2424
|
-
function __extends(d, b) {
|
|
2425
|
-
if (typeof b !== "function" && b !== null)
|
|
2426
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
2427
|
-
extendStatics(d, b);
|
|
2428
|
-
function __() {
|
|
2429
|
-
this.constructor = d;
|
|
2430
|
-
}
|
|
2431
|
-
__name(__, "__");
|
|
2432
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
2433
|
-
}
|
|
2434
|
-
__name(__extends, "__extends");
|
|
2435
|
-
var __assign = /* @__PURE__ */ __name(function() {
|
|
2436
|
-
__assign = Object.assign || /* @__PURE__ */ __name(function __assign2(t) {
|
|
2437
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2438
|
-
s = arguments[i];
|
|
2439
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
2440
|
-
}
|
|
2441
|
-
return t;
|
|
2442
|
-
}, "__assign");
|
|
2443
|
-
return __assign.apply(this, arguments);
|
|
2444
|
-
}, "__assign");
|
|
2445
|
-
function __rest(s, e) {
|
|
2446
|
-
var t = {};
|
|
2447
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2448
|
-
t[p] = s[p];
|
|
2449
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
2450
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
2451
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
2452
|
-
t[p[i]] = s[p[i]];
|
|
2453
|
-
}
|
|
2454
|
-
return t;
|
|
2455
|
-
}
|
|
2456
|
-
__name(__rest, "__rest");
|
|
2457
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
2458
|
-
function isObject$3(value) {
|
|
2459
|
-
var type = typeof value;
|
|
2460
|
-
return value != null && (type == "object" || type == "function");
|
|
2461
|
-
}
|
|
2462
|
-
__name(isObject$3, "isObject$3");
|
|
2463
|
-
var isObject_1 = isObject$3;
|
|
2464
|
-
var freeGlobal$1 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
2465
|
-
var _freeGlobal = freeGlobal$1;
|
|
2466
|
-
var freeGlobal = _freeGlobal;
|
|
2467
|
-
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
2468
|
-
var root$2 = freeGlobal || freeSelf || Function("return this")();
|
|
2469
|
-
var _root = root$2;
|
|
2470
|
-
var root$1 = _root;
|
|
2471
|
-
var now$1 = /* @__PURE__ */ __name(function() {
|
|
2472
|
-
return root$1.Date.now();
|
|
2473
|
-
}, "now$1");
|
|
2474
|
-
var now_1 = now$1;
|
|
2475
|
-
var reWhitespace = /\s/;
|
|
2476
|
-
function trimmedEndIndex$1(string) {
|
|
2477
|
-
var index = string.length;
|
|
2478
|
-
while (index-- && reWhitespace.test(string.charAt(index))) {
|
|
2479
|
-
}
|
|
2480
|
-
return index;
|
|
2481
|
-
}
|
|
2482
|
-
__name(trimmedEndIndex$1, "trimmedEndIndex$1");
|
|
2483
|
-
var _trimmedEndIndex = trimmedEndIndex$1;
|
|
2484
|
-
var trimmedEndIndex = _trimmedEndIndex;
|
|
2485
|
-
var reTrimStart = /^\s+/;
|
|
2486
|
-
function baseTrim$1(string) {
|
|
2487
|
-
return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
|
|
2488
|
-
}
|
|
2489
|
-
__name(baseTrim$1, "baseTrim$1");
|
|
2490
|
-
var _baseTrim = baseTrim$1;
|
|
2491
|
-
var root = _root;
|
|
2492
|
-
var Symbol$2 = root.Symbol;
|
|
2493
|
-
var _Symbol = Symbol$2;
|
|
2494
|
-
var Symbol$1 = _Symbol;
|
|
2495
|
-
var objectProto$1 = Object.prototype;
|
|
2496
|
-
var hasOwnProperty = objectProto$1.hasOwnProperty;
|
|
2497
|
-
var nativeObjectToString$1 = objectProto$1.toString;
|
|
2498
|
-
var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0;
|
|
2499
|
-
function getRawTag$1(value) {
|
|
2500
|
-
var isOwn = hasOwnProperty.call(value, symToStringTag$1), tag = value[symToStringTag$1];
|
|
2501
|
-
try {
|
|
2502
|
-
value[symToStringTag$1] = void 0;
|
|
2503
|
-
var unmasked = true;
|
|
2504
|
-
} catch (e) {
|
|
2505
|
-
}
|
|
2506
|
-
var result = nativeObjectToString$1.call(value);
|
|
2507
|
-
if (unmasked) {
|
|
2508
|
-
if (isOwn) {
|
|
2509
|
-
value[symToStringTag$1] = tag;
|
|
2510
|
-
} else {
|
|
2511
|
-
delete value[symToStringTag$1];
|
|
2512
|
-
}
|
|
2513
|
-
}
|
|
2514
|
-
return result;
|
|
2515
|
-
}
|
|
2516
|
-
__name(getRawTag$1, "getRawTag$1");
|
|
2517
|
-
var _getRawTag = getRawTag$1;
|
|
2518
|
-
var objectProto = Object.prototype;
|
|
2519
|
-
var nativeObjectToString = objectProto.toString;
|
|
2520
|
-
function objectToString$1(value) {
|
|
2521
|
-
return nativeObjectToString.call(value);
|
|
2522
|
-
}
|
|
2523
|
-
__name(objectToString$1, "objectToString$1");
|
|
2524
|
-
var _objectToString = objectToString$1;
|
|
2525
|
-
var Symbol2 = _Symbol;
|
|
2526
|
-
var getRawTag = _getRawTag;
|
|
2527
|
-
var objectToString = _objectToString;
|
|
2528
|
-
var nullTag = "[object Null]";
|
|
2529
|
-
var undefinedTag = "[object Undefined]";
|
|
2530
|
-
var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0;
|
|
2531
|
-
function baseGetTag$1(value) {
|
|
2532
|
-
if (value == null) {
|
|
2533
|
-
return value === void 0 ? undefinedTag : nullTag;
|
|
2534
|
-
}
|
|
2535
|
-
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
|
2536
|
-
}
|
|
2537
|
-
__name(baseGetTag$1, "baseGetTag$1");
|
|
2538
|
-
var _baseGetTag = baseGetTag$1;
|
|
2539
|
-
function isObjectLike$1(value) {
|
|
2540
|
-
return value != null && typeof value == "object";
|
|
2541
|
-
}
|
|
2542
|
-
__name(isObjectLike$1, "isObjectLike$1");
|
|
2543
|
-
var isObjectLike_1 = isObjectLike$1;
|
|
2544
|
-
var baseGetTag = _baseGetTag;
|
|
2545
|
-
var isObjectLike = isObjectLike_1;
|
|
2546
|
-
var symbolTag = "[object Symbol]";
|
|
2547
|
-
function isSymbol$1(value) {
|
|
2548
|
-
return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
|
|
2549
|
-
}
|
|
2550
|
-
__name(isSymbol$1, "isSymbol$1");
|
|
2551
|
-
var isSymbol_1 = isSymbol$1;
|
|
2552
|
-
var baseTrim = _baseTrim;
|
|
2553
|
-
var isObject$2 = isObject_1;
|
|
2554
|
-
var isSymbol = isSymbol_1;
|
|
2555
|
-
var NAN = 0 / 0;
|
|
2556
|
-
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
2557
|
-
var reIsBinary = /^0b[01]+$/i;
|
|
2558
|
-
var reIsOctal = /^0o[0-7]+$/i;
|
|
2559
|
-
var freeParseInt = parseInt;
|
|
2560
|
-
function toNumber$1(value) {
|
|
2561
|
-
if (typeof value == "number") {
|
|
2562
|
-
return value;
|
|
2563
|
-
}
|
|
2564
|
-
if (isSymbol(value)) {
|
|
2565
|
-
return NAN;
|
|
2566
|
-
}
|
|
2567
|
-
if (isObject$2(value)) {
|
|
2568
|
-
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
|
|
2569
|
-
value = isObject$2(other) ? other + "" : other;
|
|
2570
|
-
}
|
|
2571
|
-
if (typeof value != "string") {
|
|
2572
|
-
return value === 0 ? value : +value;
|
|
2573
|
-
}
|
|
2574
|
-
value = baseTrim(value);
|
|
2575
|
-
var isBinary = reIsBinary.test(value);
|
|
2576
|
-
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
|
|
2577
|
-
}
|
|
2578
|
-
__name(toNumber$1, "toNumber$1");
|
|
2579
|
-
var toNumber_1 = toNumber$1;
|
|
2580
|
-
var isObject$1 = isObject_1;
|
|
2581
|
-
var now = now_1;
|
|
2582
|
-
var toNumber = toNumber_1;
|
|
2583
|
-
var FUNC_ERROR_TEXT$1 = "Expected a function";
|
|
2584
|
-
var nativeMax = Math.max;
|
|
2585
|
-
var nativeMin = Math.min;
|
|
2586
|
-
function debounce$1(func, wait, options) {
|
|
2587
|
-
var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
|
|
2588
|
-
if (typeof func != "function") {
|
|
2589
|
-
throw new TypeError(FUNC_ERROR_TEXT$1);
|
|
2590
|
-
}
|
|
2591
|
-
wait = toNumber(wait) || 0;
|
|
2592
|
-
if (isObject$1(options)) {
|
|
2593
|
-
leading = !!options.leading;
|
|
2594
|
-
maxing = "maxWait" in options;
|
|
2595
|
-
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
2596
|
-
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
2597
|
-
}
|
|
2598
|
-
function invokeFunc(time) {
|
|
2599
|
-
var args = lastArgs, thisArg = lastThis;
|
|
2600
|
-
lastArgs = lastThis = void 0;
|
|
2601
|
-
lastInvokeTime = time;
|
|
2602
|
-
result = func.apply(thisArg, args);
|
|
2603
|
-
return result;
|
|
2604
|
-
}
|
|
2605
|
-
__name(invokeFunc, "invokeFunc");
|
|
2606
|
-
function leadingEdge(time) {
|
|
2607
|
-
lastInvokeTime = time;
|
|
2608
|
-
timerId = setTimeout(timerExpired, wait);
|
|
2609
|
-
return leading ? invokeFunc(time) : result;
|
|
2610
|
-
}
|
|
2611
|
-
__name(leadingEdge, "leadingEdge");
|
|
2612
|
-
function remainingWait(time) {
|
|
2613
|
-
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
|
|
2614
|
-
return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
|
|
2615
|
-
}
|
|
2616
|
-
__name(remainingWait, "remainingWait");
|
|
2617
|
-
function shouldInvoke(time) {
|
|
2618
|
-
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
|
|
2619
|
-
return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
|
|
2620
|
-
}
|
|
2621
|
-
__name(shouldInvoke, "shouldInvoke");
|
|
2622
|
-
function timerExpired() {
|
|
2623
|
-
var time = now();
|
|
2624
|
-
if (shouldInvoke(time)) {
|
|
2625
|
-
return trailingEdge(time);
|
|
2626
|
-
}
|
|
2627
|
-
timerId = setTimeout(timerExpired, remainingWait(time));
|
|
2628
|
-
}
|
|
2629
|
-
__name(timerExpired, "timerExpired");
|
|
2630
|
-
function trailingEdge(time) {
|
|
2631
|
-
timerId = void 0;
|
|
2632
|
-
if (trailing && lastArgs) {
|
|
2633
|
-
return invokeFunc(time);
|
|
2634
|
-
}
|
|
2635
|
-
lastArgs = lastThis = void 0;
|
|
2636
|
-
return result;
|
|
2637
|
-
}
|
|
2638
|
-
__name(trailingEdge, "trailingEdge");
|
|
2639
|
-
function cancel() {
|
|
2640
|
-
if (timerId !== void 0) {
|
|
2641
|
-
clearTimeout(timerId);
|
|
2642
|
-
}
|
|
2643
|
-
lastInvokeTime = 0;
|
|
2644
|
-
lastArgs = lastCallTime = lastThis = timerId = void 0;
|
|
2645
|
-
}
|
|
2646
|
-
__name(cancel, "cancel");
|
|
2647
|
-
function flush() {
|
|
2648
|
-
return timerId === void 0 ? result : trailingEdge(now());
|
|
2649
|
-
}
|
|
2650
|
-
__name(flush, "flush");
|
|
2651
|
-
function debounced() {
|
|
2652
|
-
var time = now(), isInvoking = shouldInvoke(time);
|
|
2653
|
-
lastArgs = arguments;
|
|
2654
|
-
lastThis = this;
|
|
2655
|
-
lastCallTime = time;
|
|
2656
|
-
if (isInvoking) {
|
|
2657
|
-
if (timerId === void 0) {
|
|
2658
|
-
return leadingEdge(lastCallTime);
|
|
2659
|
-
}
|
|
2660
|
-
if (maxing) {
|
|
2661
|
-
clearTimeout(timerId);
|
|
2662
|
-
timerId = setTimeout(timerExpired, wait);
|
|
2663
|
-
return invokeFunc(lastCallTime);
|
|
2664
|
-
}
|
|
2665
|
-
}
|
|
2666
|
-
if (timerId === void 0) {
|
|
2667
|
-
timerId = setTimeout(timerExpired, wait);
|
|
2668
|
-
}
|
|
2669
|
-
return result;
|
|
2670
|
-
}
|
|
2671
|
-
__name(debounced, "debounced");
|
|
2672
|
-
debounced.cancel = cancel;
|
|
2673
|
-
debounced.flush = flush;
|
|
2674
|
-
return debounced;
|
|
2675
|
-
}
|
|
2676
|
-
__name(debounce$1, "debounce$1");
|
|
2677
|
-
var debounce_1 = debounce$1;
|
|
2678
|
-
var debounce = debounce_1;
|
|
2679
|
-
var isObject = isObject_1;
|
|
2680
|
-
var FUNC_ERROR_TEXT = "Expected a function";
|
|
2681
|
-
function throttle(func, wait, options) {
|
|
2682
|
-
var leading = true, trailing = true;
|
|
2683
|
-
if (typeof func != "function") {
|
|
2684
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
2685
|
-
}
|
|
2686
|
-
if (isObject(options)) {
|
|
2687
|
-
leading = "leading" in options ? !!options.leading : leading;
|
|
2688
|
-
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
2689
|
-
}
|
|
2690
|
-
return debounce(func, wait, {
|
|
2691
|
-
"leading": leading,
|
|
2692
|
-
"maxWait": wait,
|
|
2693
|
-
"trailing": trailing
|
|
2694
|
-
});
|
|
2695
|
-
}
|
|
2696
|
-
__name(throttle, "throttle");
|
|
2697
|
-
var throttle_1 = throttle;
|
|
2698
|
-
var patchResizeHandler = /* @__PURE__ */ __name(function(resizeCallback, refreshMode, refreshRate, refreshOptions) {
|
|
2699
|
-
switch (refreshMode) {
|
|
2700
|
-
case "debounce":
|
|
2701
|
-
return debounce_1(resizeCallback, refreshRate, refreshOptions);
|
|
2702
|
-
case "throttle":
|
|
2703
|
-
return throttle_1(resizeCallback, refreshRate, refreshOptions);
|
|
2704
|
-
default:
|
|
2705
|
-
return resizeCallback;
|
|
2706
|
-
}
|
|
2707
|
-
}, "patchResizeHandler");
|
|
2708
|
-
var isFunction = /* @__PURE__ */ __name(function(fn) {
|
|
2709
|
-
return typeof fn === "function";
|
|
2710
|
-
}, "isFunction");
|
|
2711
|
-
var isSSR = /* @__PURE__ */ __name(function() {
|
|
2712
|
-
return typeof window === "undefined";
|
|
2713
|
-
}, "isSSR");
|
|
2714
|
-
var isDOMElement = /* @__PURE__ */ __name(function(element) {
|
|
2715
|
-
return element instanceof Element || element instanceof HTMLDocument;
|
|
2716
|
-
}, "isDOMElement");
|
|
2717
|
-
var createNotifier = /* @__PURE__ */ __name(function(onResize, setSize, handleWidth, handleHeight) {
|
|
2718
|
-
return function(_a) {
|
|
2719
|
-
var width = _a.width, height = _a.height;
|
|
2720
|
-
setSize(function(prev) {
|
|
2721
|
-
if (prev.width === width && prev.height === height) {
|
|
2722
|
-
return prev;
|
|
2723
|
-
}
|
|
2724
|
-
if (prev.width === width && !handleHeight || prev.height === height && !handleWidth) {
|
|
2725
|
-
return prev;
|
|
2726
|
-
}
|
|
2727
|
-
if (onResize && isFunction(onResize)) {
|
|
2728
|
-
onResize(width, height);
|
|
2729
|
-
}
|
|
2730
|
-
return { width, height };
|
|
2731
|
-
});
|
|
2732
|
-
};
|
|
2733
|
-
}, "createNotifier");
|
|
2734
|
-
var ResizeDetector = (
|
|
2735
|
-
/** @class */
|
|
2736
|
-
function(_super) {
|
|
2737
|
-
__extends(ResizeDetector2, _super);
|
|
2738
|
-
function ResizeDetector2(props) {
|
|
2739
|
-
var _this = _super.call(this, props) || this;
|
|
2740
|
-
_this.cancelHandler = function() {
|
|
2741
|
-
if (_this.resizeHandler && _this.resizeHandler.cancel) {
|
|
2742
|
-
_this.resizeHandler.cancel();
|
|
2743
|
-
_this.resizeHandler = null;
|
|
2744
|
-
}
|
|
2745
|
-
};
|
|
2746
|
-
_this.attachObserver = function() {
|
|
2747
|
-
var _a2 = _this.props, targetRef = _a2.targetRef, observerOptions = _a2.observerOptions;
|
|
2748
|
-
if (isSSR()) {
|
|
2749
|
-
return;
|
|
2750
|
-
}
|
|
2751
|
-
if (targetRef && targetRef.current) {
|
|
2752
|
-
_this.targetRef.current = targetRef.current;
|
|
2753
|
-
}
|
|
2754
|
-
var element = _this.getElement();
|
|
2755
|
-
if (!element) {
|
|
2756
|
-
return;
|
|
2757
|
-
}
|
|
2758
|
-
if (_this.observableElement && _this.observableElement === element) {
|
|
2759
|
-
return;
|
|
2760
|
-
}
|
|
2761
|
-
_this.observableElement = element;
|
|
2762
|
-
_this.resizeObserver.observe(element, observerOptions);
|
|
2763
|
-
};
|
|
2764
|
-
_this.getElement = function() {
|
|
2765
|
-
var _a2 = _this.props, querySelector = _a2.querySelector, targetDomEl = _a2.targetDomEl;
|
|
2766
|
-
if (isSSR())
|
|
2767
|
-
return null;
|
|
2768
|
-
if (querySelector)
|
|
2769
|
-
return document.querySelector(querySelector);
|
|
2770
|
-
if (targetDomEl && isDOMElement(targetDomEl))
|
|
2771
|
-
return targetDomEl;
|
|
2772
|
-
if (_this.targetRef && isDOMElement(_this.targetRef.current))
|
|
2773
|
-
return _this.targetRef.current;
|
|
2774
|
-
var currentElement = findDOMNode(_this);
|
|
2775
|
-
if (!currentElement)
|
|
2776
|
-
return null;
|
|
2777
|
-
var renderType = _this.getRenderType();
|
|
2778
|
-
switch (renderType) {
|
|
2779
|
-
case "renderProp":
|
|
2780
|
-
return currentElement;
|
|
2781
|
-
case "childFunction":
|
|
2782
|
-
return currentElement;
|
|
2783
|
-
case "child":
|
|
2784
|
-
return currentElement;
|
|
2785
|
-
case "childArray":
|
|
2786
|
-
return currentElement;
|
|
2787
|
-
default:
|
|
2788
|
-
return currentElement.parentElement;
|
|
2789
|
-
}
|
|
2790
|
-
};
|
|
2791
|
-
_this.createResizeHandler = function(entries) {
|
|
2792
|
-
var _a2 = _this.props, _b = _a2.handleWidth, handleWidth = _b === void 0 ? true : _b, _c = _a2.handleHeight, handleHeight = _c === void 0 ? true : _c, onResize = _a2.onResize;
|
|
2793
|
-
if (!handleWidth && !handleHeight)
|
|
2794
|
-
return;
|
|
2795
|
-
var notifyResize = createNotifier(onResize, _this.setState.bind(_this), handleWidth, handleHeight);
|
|
2796
|
-
entries.forEach(function(entry) {
|
|
2797
|
-
var _a3 = entry && entry.contentRect || {}, width = _a3.width, height = _a3.height;
|
|
2798
|
-
var shouldSetSize = !_this.skipOnMount && !isSSR();
|
|
2799
|
-
if (shouldSetSize) {
|
|
2800
|
-
notifyResize({ width, height });
|
|
2801
|
-
}
|
|
2802
|
-
_this.skipOnMount = false;
|
|
2803
|
-
});
|
|
2804
|
-
};
|
|
2805
|
-
_this.getRenderType = function() {
|
|
2806
|
-
var _a2 = _this.props, render = _a2.render, children = _a2.children;
|
|
2807
|
-
if (isFunction(render)) {
|
|
2808
|
-
return "renderProp";
|
|
2809
|
-
}
|
|
2810
|
-
if (isFunction(children)) {
|
|
2811
|
-
return "childFunction";
|
|
2812
|
-
}
|
|
2813
|
-
if (isValidElement(children)) {
|
|
2814
|
-
return "child";
|
|
2815
|
-
}
|
|
2816
|
-
if (Array.isArray(children)) {
|
|
2817
|
-
return "childArray";
|
|
2818
|
-
}
|
|
2819
|
-
return "parent";
|
|
2820
|
-
};
|
|
2821
|
-
var skipOnMount = props.skipOnMount, refreshMode = props.refreshMode, _a = props.refreshRate, refreshRate = _a === void 0 ? 1e3 : _a, refreshOptions = props.refreshOptions;
|
|
2822
|
-
_this.state = {
|
|
2823
|
-
width: void 0,
|
|
2824
|
-
height: void 0
|
|
2825
|
-
};
|
|
2826
|
-
_this.skipOnMount = skipOnMount;
|
|
2827
|
-
_this.targetRef = createRef();
|
|
2828
|
-
_this.observableElement = null;
|
|
2829
|
-
if (isSSR()) {
|
|
2830
|
-
return _this;
|
|
2831
|
-
}
|
|
2832
|
-
_this.resizeHandler = patchResizeHandler(_this.createResizeHandler, refreshMode, refreshRate, refreshOptions);
|
|
2833
|
-
_this.resizeObserver = new window.ResizeObserver(_this.resizeHandler);
|
|
2834
|
-
return _this;
|
|
2835
|
-
}
|
|
2836
|
-
__name(ResizeDetector2, "ResizeDetector");
|
|
2837
|
-
ResizeDetector2.prototype.componentDidMount = function() {
|
|
2838
|
-
this.attachObserver();
|
|
2839
|
-
};
|
|
2840
|
-
ResizeDetector2.prototype.componentDidUpdate = function() {
|
|
2841
|
-
this.attachObserver();
|
|
2842
|
-
};
|
|
2843
|
-
ResizeDetector2.prototype.componentWillUnmount = function() {
|
|
2844
|
-
if (isSSR()) {
|
|
2845
|
-
return;
|
|
2846
|
-
}
|
|
2847
|
-
this.observableElement = null;
|
|
2848
|
-
this.resizeObserver.disconnect();
|
|
2849
|
-
this.cancelHandler();
|
|
2850
|
-
};
|
|
2851
|
-
ResizeDetector2.prototype.render = function() {
|
|
2852
|
-
var _a = this.props, render = _a.render, children = _a.children, _b = _a.nodeType, WrapperTag = _b === void 0 ? "div" : _b;
|
|
2853
|
-
var _c = this.state, width = _c.width, height = _c.height;
|
|
2854
|
-
var childProps = { width, height, targetRef: this.targetRef };
|
|
2855
|
-
var renderType = this.getRenderType();
|
|
2856
|
-
var typedChildren;
|
|
2857
|
-
switch (renderType) {
|
|
2858
|
-
case "renderProp":
|
|
2859
|
-
return render && render(childProps);
|
|
2860
|
-
case "childFunction":
|
|
2861
|
-
typedChildren = children;
|
|
2862
|
-
return typedChildren(childProps);
|
|
2863
|
-
case "child":
|
|
2864
|
-
typedChildren = children;
|
|
2865
|
-
if (typedChildren.type && typeof typedChildren.type === "string") {
|
|
2866
|
-
childProps.targetRef;
|
|
2867
|
-
var nativeProps = __rest(childProps, ["targetRef"]);
|
|
2868
|
-
return cloneElement(typedChildren, nativeProps);
|
|
2869
|
-
}
|
|
2870
|
-
return cloneElement(typedChildren, childProps);
|
|
2871
|
-
case "childArray":
|
|
2872
|
-
typedChildren = children;
|
|
2873
|
-
return typedChildren.map(function(el) {
|
|
2874
|
-
return !!el && cloneElement(el, childProps);
|
|
2875
|
-
});
|
|
2876
|
-
default:
|
|
2877
|
-
return React4.createElement(WrapperTag, null);
|
|
2878
|
-
}
|
|
2879
|
-
};
|
|
2880
|
-
return ResizeDetector2;
|
|
2881
|
-
}(PureComponent)
|
|
2882
|
-
);
|
|
2883
|
-
var useEnhancedEffect = isSSR() ? useEffect2 : useLayoutEffect;
|
|
2884
|
-
function useResizeDetector(props) {
|
|
2885
|
-
if (props === void 0) {
|
|
2886
|
-
props = {};
|
|
2887
|
-
}
|
|
2888
|
-
var _a = props.skipOnMount, skipOnMount = _a === void 0 ? false : _a, refreshMode = props.refreshMode, _b = props.refreshRate, refreshRate = _b === void 0 ? 1e3 : _b, refreshOptions = props.refreshOptions, _c = props.handleWidth, handleWidth = _c === void 0 ? true : _c, _d = props.handleHeight, handleHeight = _d === void 0 ? true : _d, targetRef = props.targetRef, observerOptions = props.observerOptions, onResize = props.onResize;
|
|
2889
|
-
var skipResize = useRef(skipOnMount);
|
|
2890
|
-
var localRef = useRef(null);
|
|
2891
|
-
var ref = targetRef !== null && targetRef !== void 0 ? targetRef : localRef;
|
|
2892
|
-
var resizeHandler = useRef();
|
|
2893
|
-
var _e = useState4({
|
|
2894
|
-
width: void 0,
|
|
2895
|
-
height: void 0
|
|
2896
|
-
}), size = _e[0], setSize = _e[1];
|
|
2897
|
-
useEnhancedEffect(function() {
|
|
2898
|
-
if (isSSR()) {
|
|
2899
|
-
return;
|
|
2900
|
-
}
|
|
2901
|
-
var notifyResize = createNotifier(onResize, setSize, handleWidth, handleHeight);
|
|
2902
|
-
var resizeCallback = /* @__PURE__ */ __name(function(entries) {
|
|
2903
|
-
if (!handleWidth && !handleHeight)
|
|
2904
|
-
return;
|
|
2905
|
-
entries.forEach(function(entry) {
|
|
2906
|
-
var _a2 = entry && entry.contentRect || {}, width = _a2.width, height = _a2.height;
|
|
2907
|
-
var shouldSetSize = !skipResize.current && !isSSR();
|
|
2908
|
-
if (shouldSetSize) {
|
|
2909
|
-
notifyResize({ width, height });
|
|
2910
|
-
}
|
|
2911
|
-
skipResize.current = false;
|
|
2912
|
-
});
|
|
2913
|
-
}, "resizeCallback");
|
|
2914
|
-
resizeHandler.current = patchResizeHandler(resizeCallback, refreshMode, refreshRate, refreshOptions);
|
|
2915
|
-
var resizeObserver = new window.ResizeObserver(resizeHandler.current);
|
|
2916
|
-
if (ref.current) {
|
|
2917
|
-
resizeObserver.observe(ref.current, observerOptions);
|
|
2918
|
-
}
|
|
2919
|
-
return function() {
|
|
2920
|
-
resizeObserver.disconnect();
|
|
2921
|
-
var patchedResizeHandler = resizeHandler.current;
|
|
2922
|
-
if (patchedResizeHandler && patchedResizeHandler.cancel) {
|
|
2923
|
-
patchedResizeHandler.cancel();
|
|
2924
|
-
}
|
|
2925
|
-
};
|
|
2926
|
-
}, [refreshMode, refreshRate, refreshOptions, handleWidth, handleHeight, onResize, observerOptions, ref.current]);
|
|
2927
|
-
return __assign({ ref }, size);
|
|
2928
|
-
}
|
|
2929
|
-
__name(useResizeDetector, "useResizeDetector");
|
|
2930
|
-
|
|
2931
|
-
// src/components/Tabs.tsx
|
|
2932
|
-
import { styled as styled3 } from "storybook/theming";
|
|
1880
|
+
import { Button as Button3, TabsView } from "storybook/internal/components";
|
|
1881
|
+
import { CollapseIcon, ExpandAltIcon, EyeCloseIcon, EyeIcon, SyncIcon } from "@storybook/icons";
|
|
1882
|
+
import { styled as styled3, useTheme } from "storybook/theming";
|
|
2933
1883
|
var Container = styled3.div({
|
|
2934
1884
|
width: "100%",
|
|
2935
1885
|
position: "relative",
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
var Item2 = styled3.button(
|
|
2939
|
-
({ theme: theme2 }) => ({
|
|
2940
|
-
textDecoration: "none",
|
|
2941
|
-
padding: "10px 15px",
|
|
2942
|
-
cursor: "pointer",
|
|
2943
|
-
color: theme2.textMutedColor,
|
|
2944
|
-
fontWeight: theme2.typography.weight.bold,
|
|
2945
|
-
fontSize: theme2.typography.size.s2 - 1,
|
|
2946
|
-
lineHeight: 1,
|
|
2947
|
-
height: 40,
|
|
2948
|
-
border: "none",
|
|
2949
|
-
borderBottom: "3px solid transparent",
|
|
2950
|
-
background: "transparent",
|
|
2951
|
-
"&:focus": {
|
|
2952
|
-
outline: "0 none",
|
|
2953
|
-
borderColor: theme2.color.secondary
|
|
2954
|
-
}
|
|
2955
|
-
}),
|
|
2956
|
-
({ active, theme: theme2 }) => active ? {
|
|
2957
|
-
opacity: 1,
|
|
2958
|
-
color: theme2.color.secondary,
|
|
2959
|
-
borderColor: theme2.color.secondary
|
|
2960
|
-
} : {}
|
|
2961
|
-
);
|
|
2962
|
-
var Subnav = styled3.div(({ theme: theme2 }) => ({
|
|
2963
|
-
boxShadow: `${theme2.appBorderColor} 0 -1px 0 0 inset`,
|
|
2964
|
-
background: theme2.background.app,
|
|
2965
|
-
position: "sticky",
|
|
2966
|
-
top: 0,
|
|
2967
|
-
zIndex: 1,
|
|
1886
|
+
height: "100%",
|
|
1887
|
+
overflow: "hidden",
|
|
2968
1888
|
display: "flex",
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
overflow: "auto",
|
|
2972
|
-
paddingRight: 10,
|
|
2973
|
-
gap: 6,
|
|
2974
|
-
scrollbarColor: `${theme2.barTextColor} ${theme2.background.app}`,
|
|
2975
|
-
scrollbarWidth: "thin"
|
|
2976
|
-
}));
|
|
2977
|
-
var TabsWrapper = styled3.div({});
|
|
2978
|
-
var ActionsWrapper = styled3.div({
|
|
1889
|
+
flexDirection: "column"
|
|
1890
|
+
}), ActionsWrapper = styled3.div({
|
|
2979
1891
|
display: "flex",
|
|
2980
|
-
flexBasis: "100%",
|
|
2981
1892
|
justifyContent: "flex-end",
|
|
2982
|
-
containerType: "inline-size",
|
|
2983
|
-
// 96px is the total width of the buttons without labels
|
|
2984
|
-
minWidth: 96,
|
|
2985
1893
|
gap: 6
|
|
2986
|
-
})
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
"@container (max-width: 193px)": {
|
|
2990
|
-
span: {
|
|
2991
|
-
display: "none"
|
|
2992
|
-
}
|
|
2993
|
-
}
|
|
2994
|
-
});
|
|
2995
|
-
var Tabs = /* @__PURE__ */ __name(({ tabs }) => {
|
|
2996
|
-
const { ref } = useResizeDetector({
|
|
2997
|
-
refreshMode: "debounce",
|
|
2998
|
-
handleHeight: false,
|
|
2999
|
-
handleWidth: true
|
|
3000
|
-
});
|
|
3001
|
-
const {
|
|
3002
|
-
tab: activeTab,
|
|
1894
|
+
}), Tabs = ({ tabs }) => {
|
|
1895
|
+
let {
|
|
1896
|
+
tab,
|
|
3003
1897
|
setTab,
|
|
3004
1898
|
toggleHighlight,
|
|
3005
1899
|
highlighted,
|
|
@@ -3007,67 +1901,54 @@ var Tabs = /* @__PURE__ */ __name(({ tabs }) => {
|
|
|
3007
1901
|
allExpanded,
|
|
3008
1902
|
handleCollapseAll,
|
|
3009
1903
|
handleExpandAll
|
|
3010
|
-
} = useA11yContext();
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
setTab(event.currentTarget.getAttribute("data-type"));
|
|
3014
|
-
},
|
|
3015
|
-
[setTab]
|
|
3016
|
-
);
|
|
3017
|
-
return React5.createElement(Container, { ref }, React5.createElement(Subnav, null, React5.createElement(TabsWrapper, { role: "tablist" }, tabs.map((tab, index) => React5.createElement(
|
|
3018
|
-
Item2,
|
|
3019
|
-
{
|
|
3020
|
-
role: "tab",
|
|
3021
|
-
key: index,
|
|
3022
|
-
"data-type": tab.type,
|
|
3023
|
-
"data-active": activeTab === tab.type,
|
|
3024
|
-
"aria-selected": activeTab === tab.type,
|
|
3025
|
-
active: activeTab === tab.type,
|
|
3026
|
-
onClick: handleToggle
|
|
3027
|
-
},
|
|
3028
|
-
tab.label
|
|
3029
|
-
))), React5.createElement(ActionsWrapper, null, React5.createElement(
|
|
3030
|
-
WithTooltip,
|
|
3031
|
-
{
|
|
3032
|
-
as: "div",
|
|
3033
|
-
hasChrome: false,
|
|
3034
|
-
placement: "top",
|
|
3035
|
-
tooltip: React5.createElement(TooltipNote, { note: "Highlight elements with accessibility violations" }),
|
|
3036
|
-
trigger: "hover"
|
|
3037
|
-
},
|
|
3038
|
-
React5.createElement(ToggleButton, { onClick: toggleHighlight, active: highlighted }, highlighted ? React5.createElement(EyeCloseIcon, null) : React5.createElement(EyeIcon, null), React5.createElement("span", null, highlighted ? "Hide highlights" : "Show highlights"))
|
|
3039
|
-
), React5.createElement(
|
|
3040
|
-
WithTooltip,
|
|
3041
|
-
{
|
|
3042
|
-
as: "div",
|
|
3043
|
-
hasChrome: false,
|
|
3044
|
-
placement: "top",
|
|
3045
|
-
tooltip: React5.createElement(TooltipNote, { note: allExpanded ? "Collapse all" : "Expand all" }),
|
|
3046
|
-
trigger: "hover"
|
|
3047
|
-
},
|
|
3048
|
-
React5.createElement(
|
|
3049
|
-
IconButton2,
|
|
3050
|
-
{
|
|
3051
|
-
onClick: allExpanded ? handleCollapseAll : handleExpandAll,
|
|
3052
|
-
"aria-label": allExpanded ? "Collapse all" : "Expand all"
|
|
3053
|
-
},
|
|
3054
|
-
allExpanded ? React5.createElement(CollapseIcon, null) : React5.createElement(ExpandAltIcon, null)
|
|
3055
|
-
)
|
|
3056
|
-
), React5.createElement(
|
|
3057
|
-
WithTooltip,
|
|
1904
|
+
} = useA11yContext(), theme2 = useTheme();
|
|
1905
|
+
return React4.createElement(Container, null, React4.createElement(
|
|
1906
|
+
TabsView,
|
|
3058
1907
|
{
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
1908
|
+
backgroundColor: theme2.background.app,
|
|
1909
|
+
panelProps: { hasScrollbar: !0 },
|
|
1910
|
+
tabs: tabs.map((tab2) => ({
|
|
1911
|
+
id: tab2.type,
|
|
1912
|
+
title: tab2.label,
|
|
1913
|
+
children: tab2.panel
|
|
1914
|
+
})),
|
|
1915
|
+
selected: tab,
|
|
1916
|
+
onSelectionChange: (key) => setTab(key),
|
|
1917
|
+
tools: React4.createElement(ActionsWrapper, null, React4.createElement(
|
|
1918
|
+
Button3,
|
|
1919
|
+
{
|
|
1920
|
+
variant: "ghost",
|
|
1921
|
+
padding: "small",
|
|
1922
|
+
onClick: toggleHighlight,
|
|
1923
|
+
ariaLabel: highlighted ? "Hide accessibility test result highlights" : "Highlight elements with accessibility test results"
|
|
1924
|
+
},
|
|
1925
|
+
highlighted ? React4.createElement(EyeCloseIcon, null) : React4.createElement(EyeIcon, null)
|
|
1926
|
+
), React4.createElement(
|
|
1927
|
+
Button3,
|
|
1928
|
+
{
|
|
1929
|
+
variant: "ghost",
|
|
1930
|
+
padding: "small",
|
|
1931
|
+
onClick: allExpanded ? handleCollapseAll : handleExpandAll,
|
|
1932
|
+
ariaLabel: allExpanded ? "Collapse all results" : "Expand all results",
|
|
1933
|
+
"aria-expanded": allExpanded
|
|
1934
|
+
},
|
|
1935
|
+
allExpanded ? React4.createElement(CollapseIcon, null) : React4.createElement(ExpandAltIcon, null)
|
|
1936
|
+
), React4.createElement(
|
|
1937
|
+
Button3,
|
|
1938
|
+
{
|
|
1939
|
+
variant: "ghost",
|
|
1940
|
+
padding: "small",
|
|
1941
|
+
onClick: handleManual,
|
|
1942
|
+
ariaLabel: "Rerun accessibility scan"
|
|
1943
|
+
},
|
|
1944
|
+
React4.createElement(SyncIcon, null)
|
|
1945
|
+
))
|
|
1946
|
+
}
|
|
1947
|
+
));
|
|
1948
|
+
};
|
|
3068
1949
|
|
|
3069
1950
|
// src/components/TestDiscrepancyMessage.tsx
|
|
3070
|
-
import
|
|
1951
|
+
import React5, { useMemo as useMemo2 } from "react";
|
|
3071
1952
|
import { Link as Link2 } from "storybook/internal/components";
|
|
3072
1953
|
import { useStorybookApi as useStorybookApi2 } from "storybook/manager-api";
|
|
3073
1954
|
import { styled as styled4 } from "storybook/theming";
|
|
@@ -3091,15 +1972,12 @@ var Wrapper3 = styled4.div(({ theme: { color, typography, background } }) => ({
|
|
|
3091
1972
|
borderRadius: "2px",
|
|
3092
1973
|
boxShadow: "0 0 0 1px rgba(0, 0, 0, 0.1)"
|
|
3093
1974
|
}
|
|
3094
|
-
}))
|
|
3095
|
-
|
|
3096
|
-
const api = useStorybookApi2();
|
|
3097
|
-
const docsUrl = api.getDocsUrl({
|
|
1975
|
+
})), TestDiscrepancyMessage = ({ discrepancy }) => {
|
|
1976
|
+
let docsUrl = useStorybookApi2().getDocsUrl({
|
|
3098
1977
|
subpath: DOCUMENTATION_DISCREPANCY_LINK,
|
|
3099
|
-
versioned:
|
|
3100
|
-
renderer:
|
|
3101
|
-
})
|
|
3102
|
-
const message = useMemo2(() => {
|
|
1978
|
+
versioned: !0,
|
|
1979
|
+
renderer: !0
|
|
1980
|
+
}), message = useMemo2(() => {
|
|
3103
1981
|
switch (discrepancy) {
|
|
3104
1982
|
case "browserPassedCliFailed":
|
|
3105
1983
|
return "Accessibility checks passed in this browser but failed in the CLI.";
|
|
@@ -3111,23 +1989,18 @@ var TestDiscrepancyMessage = /* @__PURE__ */ __name(({ discrepancy }) => {
|
|
|
3111
1989
|
return null;
|
|
3112
1990
|
}
|
|
3113
1991
|
}, [discrepancy]);
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
}
|
|
3117
|
-
return React6.createElement(Wrapper3, null, message, " ", React6.createElement(Link2, { href: docsUrl, target: "_blank", withArrow: true }, "Learn what could cause this"));
|
|
3118
|
-
}, "TestDiscrepancyMessage");
|
|
1992
|
+
return message ? React5.createElement(Wrapper3, null, message, " ", React5.createElement(Link2, { href: docsUrl, target: "_blank", withArrow: !0 }, "Learn what could cause this")) : null;
|
|
1993
|
+
};
|
|
3119
1994
|
|
|
3120
1995
|
// src/components/A11YPanel.tsx
|
|
3121
1996
|
var RotatingIcon = styled5(SyncIcon2)(({ theme: theme2 }) => ({
|
|
3122
1997
|
animation: `${theme2.animation.rotate360} 1s linear infinite;`,
|
|
3123
1998
|
margin: 4
|
|
3124
|
-
}))
|
|
3125
|
-
var Tab = styled5.div({
|
|
1999
|
+
})), Tab = styled5.div({
|
|
3126
2000
|
display: "flex",
|
|
3127
2001
|
alignItems: "center",
|
|
3128
2002
|
gap: 6
|
|
3129
|
-
})
|
|
3130
|
-
var Centered = styled5.span(({ theme: theme2 }) => ({
|
|
2003
|
+
}), Centered = styled5.span(({ theme: theme2 }) => ({
|
|
3131
2004
|
display: "flex",
|
|
3132
2005
|
flexDirection: "column",
|
|
3133
2006
|
alignItems: "center",
|
|
@@ -3154,9 +2027,8 @@ var Centered = styled5.span(({ theme: theme2 }) => ({
|
|
|
3154
2027
|
borderRadius: 4,
|
|
3155
2028
|
padding: "2px 3px"
|
|
3156
2029
|
}
|
|
3157
|
-
}))
|
|
3158
|
-
|
|
3159
|
-
const {
|
|
2030
|
+
})), A11YPanel = () => {
|
|
2031
|
+
let {
|
|
3160
2032
|
parameters,
|
|
3161
2033
|
tab,
|
|
3162
2034
|
results,
|
|
@@ -3167,17 +2039,16 @@ var A11YPanel = /* @__PURE__ */ __name(() => {
|
|
|
3167
2039
|
handleSelectionChange,
|
|
3168
2040
|
selectedItems,
|
|
3169
2041
|
toggleOpen
|
|
3170
|
-
} = useA11yContext()
|
|
3171
|
-
|
|
3172
|
-
const { passes, incomplete, violations } = results ?? {
|
|
2042
|
+
} = useA11yContext(), tabs = useMemo3(() => {
|
|
2043
|
+
let { passes, incomplete, violations } = results ?? {
|
|
3173
2044
|
passes: [],
|
|
3174
2045
|
incomplete: [],
|
|
3175
2046
|
violations: []
|
|
3176
2047
|
};
|
|
3177
2048
|
return [
|
|
3178
2049
|
{
|
|
3179
|
-
label:
|
|
3180
|
-
panel:
|
|
2050
|
+
label: React6.createElement(Tab, null, "Violations", React6.createElement(Badge2, { compact: !0, status: tab === "violations" ? "active" : "neutral" }, violations.length)),
|
|
2051
|
+
panel: React6.createElement(
|
|
3181
2052
|
Report,
|
|
3182
2053
|
{
|
|
3183
2054
|
items: violations,
|
|
@@ -3192,8 +2063,8 @@ var A11YPanel = /* @__PURE__ */ __name(() => {
|
|
|
3192
2063
|
type: RuleType.VIOLATION
|
|
3193
2064
|
},
|
|
3194
2065
|
{
|
|
3195
|
-
label:
|
|
3196
|
-
panel:
|
|
2066
|
+
label: React6.createElement(Tab, null, "Passes", React6.createElement(Badge2, { compact: !0, status: tab === "passes" ? "active" : "neutral" }, passes.length)),
|
|
2067
|
+
panel: React6.createElement(
|
|
3197
2068
|
Report,
|
|
3198
2069
|
{
|
|
3199
2070
|
items: passes,
|
|
@@ -3208,8 +2079,8 @@ var A11YPanel = /* @__PURE__ */ __name(() => {
|
|
|
3208
2079
|
type: RuleType.PASS
|
|
3209
2080
|
},
|
|
3210
2081
|
{
|
|
3211
|
-
label:
|
|
3212
|
-
panel:
|
|
2082
|
+
label: React6.createElement(Tab, null, "Inconclusive", React6.createElement(Badge2, { compact: !0, status: tab === "incomplete" ? "active" : "neutral" }, incomplete.length)),
|
|
2083
|
+
panel: React6.createElement(
|
|
3213
2084
|
Report,
|
|
3214
2085
|
{
|
|
3215
2086
|
items: incomplete,
|
|
@@ -3225,74 +2096,70 @@ var A11YPanel = /* @__PURE__ */ __name(() => {
|
|
|
3225
2096
|
}
|
|
3226
2097
|
];
|
|
3227
2098
|
}, [tab, results, handleSelectionChange, selectedItems, toggleOpen]);
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
}
|
|
3231
|
-
return React7.createElement(React7.Fragment, null, discrepancy && React7.createElement(TestDiscrepancyMessage, { discrepancy }), status === "ready" || status === "ran" ? React7.createElement(Tabs, { key: "tabs", tabs }) : React7.createElement(Centered, { style: { marginTop: discrepancy ? "1em" : 0 } }, status === "initial" && React7.createElement("div", null, React7.createElement(RotatingIcon, { size: 12 }), React7.createElement("strong", null, "Preparing accessibility scan"), React7.createElement("p", null, "Please wait while the addon is initializing...")), status === "manual" && React7.createElement(React7.Fragment, null, React7.createElement("div", null, React7.createElement("strong", null, "Accessibility tests run manually for this story"), React7.createElement("p", null, "Results will not show when using the testing module. You can still run accessibility tests manually.")), React7.createElement(Button2, { size: "medium", onClick: handleManual }, "Run accessibility scan"), React7.createElement("p", null, "Update ", React7.createElement("code", null, "globals.a11y.manual"), " to disable manual mode.")), status === "running" && React7.createElement("div", null, React7.createElement(RotatingIcon, { size: 12 }), React7.createElement("strong", null, "Accessibility scan in progress"), React7.createElement("p", null, "Please wait while the accessibility scan is running...")), status === "error" && React7.createElement(React7.Fragment, null, React7.createElement("div", null, React7.createElement("strong", null, "The accessibility scan encountered an error"), React7.createElement("p", null, typeof error === "string" ? error : error instanceof Error ? error.toString() : JSON.stringify(error, null, 2))), React7.createElement(Button2, { size: "medium", onClick: handleManual }, "Rerun accessibility scan")), status === "component-test-error" && React7.createElement(React7.Fragment, null, React7.createElement("div", null, React7.createElement("strong", null, "This story's component tests failed"), React7.createElement("p", null, "Automated accessibility tests will not run until this is resolved. You can still test manually.")), React7.createElement(Button2, { size: "medium", onClick: handleManual }, "Run accessibility scan"))));
|
|
3232
|
-
}, "A11YPanel");
|
|
2099
|
+
return parameters.disable || parameters.test === "off" ? React6.createElement(Centered, null, React6.createElement("div", null, React6.createElement("strong", null, "Accessibility tests are disabled for this story"), React6.createElement("p", null, "Update", " ", React6.createElement("code", null, parameters.disable ? "parameters.a11y.disable" : "parameters.a11y.test"), " ", "to enable accessibility tests."))) : React6.createElement(React6.Fragment, null, discrepancy && React6.createElement(TestDiscrepancyMessage, { discrepancy }), status === "ready" || status === "ran" ? React6.createElement(Tabs, { key: "tabs", tabs }) : React6.createElement(Centered, { style: { marginTop: discrepancy ? "1em" : 0 } }, status === "initial" && React6.createElement("div", null, React6.createElement(RotatingIcon, { size: 12 }), React6.createElement("strong", null, "Preparing accessibility scan"), React6.createElement("p", null, "Please wait while the addon is initializing...")), status === "manual" && React6.createElement(React6.Fragment, null, React6.createElement("div", null, React6.createElement("strong", null, "Accessibility tests run manually for this story"), React6.createElement("p", null, "Results will not show when using the testing module. You can still run accessibility tests manually.")), React6.createElement(Button4, { ariaLabel: !1, size: "medium", onClick: handleManual }, "Run accessibility scan"), React6.createElement("p", null, "Update ", React6.createElement("code", null, "globals.a11y.manual"), " to disable manual mode.")), status === "running" && React6.createElement("div", null, React6.createElement(RotatingIcon, { size: 12 }), React6.createElement("strong", null, "Accessibility scan in progress"), React6.createElement("p", null, "Please wait while the accessibility scan is running...")), status === "error" && React6.createElement(React6.Fragment, null, React6.createElement("div", null, React6.createElement("strong", null, "The accessibility scan encountered an error"), React6.createElement("p", null, typeof error == "string" ? error : error instanceof Error ? error.toString() : JSON.stringify(error, null, 2))), React6.createElement(Button4, { ariaLabel: !1, size: "medium", onClick: handleManual }, "Rerun accessibility scan")), status === "component-test-error" && React6.createElement(React6.Fragment, null, React6.createElement("div", null, React6.createElement("strong", null, "This story's component tests failed"), React6.createElement("p", null, "Automated accessibility tests will not run until this is resolved. You can still test manually.")), React6.createElement(Button4, { ariaLabel: !1, size: "medium", onClick: handleManual }, "Run accessibility scan"))));
|
|
2100
|
+
};
|
|
3233
2101
|
|
|
3234
2102
|
// src/components/VisionSimulator.tsx
|
|
3235
|
-
import
|
|
3236
|
-
import {
|
|
2103
|
+
import React8, { useState as useState4 } from "react";
|
|
2104
|
+
import { Select } from "storybook/internal/components";
|
|
3237
2105
|
import { AccessibilityIcon } from "@storybook/icons";
|
|
3238
2106
|
import { Global, styled as styled6 } from "storybook/theming";
|
|
3239
2107
|
|
|
3240
2108
|
// src/components/ColorFilters.tsx
|
|
3241
|
-
import * as
|
|
3242
|
-
var Filters =
|
|
2109
|
+
import * as React7 from "react";
|
|
2110
|
+
var Filters = (props) => React7.createElement("svg", { ...props }, React7.createElement("defs", null, React7.createElement("filter", { id: "protanopia" }, React7.createElement(
|
|
3243
2111
|
"feColorMatrix",
|
|
3244
2112
|
{
|
|
3245
2113
|
in: "SourceGraphic",
|
|
3246
2114
|
type: "matrix",
|
|
3247
2115
|
values: "0.567, 0.433, 0, 0, 0 0.558, 0.442, 0, 0, 0 0, 0.242, 0.758, 0, 0 0, 0, 0, 1, 0"
|
|
3248
2116
|
}
|
|
3249
|
-
)),
|
|
2117
|
+
)), React7.createElement("filter", { id: "protanomaly" }, React7.createElement(
|
|
3250
2118
|
"feColorMatrix",
|
|
3251
2119
|
{
|
|
3252
2120
|
in: "SourceGraphic",
|
|
3253
2121
|
type: "matrix",
|
|
3254
2122
|
values: "0.817, 0.183, 0, 0, 0 0.333, 0.667, 0, 0, 0 0, 0.125, 0.875, 0, 0 0, 0, 0, 1, 0"
|
|
3255
2123
|
}
|
|
3256
|
-
)),
|
|
2124
|
+
)), React7.createElement("filter", { id: "deuteranopia" }, React7.createElement(
|
|
3257
2125
|
"feColorMatrix",
|
|
3258
2126
|
{
|
|
3259
2127
|
in: "SourceGraphic",
|
|
3260
2128
|
type: "matrix",
|
|
3261
2129
|
values: "0.625, 0.375, 0, 0, 0 0.7, 0.3, 0, 0, 0 0, 0.3, 0.7, 0, 0 0, 0, 0, 1, 0"
|
|
3262
2130
|
}
|
|
3263
|
-
)),
|
|
2131
|
+
)), React7.createElement("filter", { id: "deuteranomaly" }, React7.createElement(
|
|
3264
2132
|
"feColorMatrix",
|
|
3265
2133
|
{
|
|
3266
2134
|
in: "SourceGraphic",
|
|
3267
2135
|
type: "matrix",
|
|
3268
2136
|
values: "0.8, 0.2, 0, 0, 0 0.258, 0.742, 0, 0, 0 0, 0.142, 0.858, 0, 0 0, 0, 0, 1, 0"
|
|
3269
2137
|
}
|
|
3270
|
-
)),
|
|
2138
|
+
)), React7.createElement("filter", { id: "tritanopia" }, React7.createElement(
|
|
3271
2139
|
"feColorMatrix",
|
|
3272
2140
|
{
|
|
3273
2141
|
in: "SourceGraphic",
|
|
3274
2142
|
type: "matrix",
|
|
3275
2143
|
values: "0.95, 0.05, 0, 0, 0 0, 0.433, 0.567, 0, 0 0, 0.475, 0.525, 0, 0 0, 0, 0, 1, 0"
|
|
3276
2144
|
}
|
|
3277
|
-
)),
|
|
2145
|
+
)), React7.createElement("filter", { id: "tritanomaly" }, React7.createElement(
|
|
3278
2146
|
"feColorMatrix",
|
|
3279
2147
|
{
|
|
3280
2148
|
in: "SourceGraphic",
|
|
3281
2149
|
type: "matrix",
|
|
3282
2150
|
values: "0.967, 0.033, 0, 0, 0 0, 0.733, 0.267, 0, 0 0, 0.183, 0.817, 0, 0 0, 0, 0, 1, 0"
|
|
3283
2151
|
}
|
|
3284
|
-
)),
|
|
2152
|
+
)), React7.createElement("filter", { id: "achromatopsia" }, React7.createElement(
|
|
3285
2153
|
"feColorMatrix",
|
|
3286
2154
|
{
|
|
3287
2155
|
in: "SourceGraphic",
|
|
3288
2156
|
type: "matrix",
|
|
3289
2157
|
values: "0.299, 0.587, 0.114, 0, 0 0.299, 0.587, 0.114, 0, 0 0.299, 0.587, 0.114, 0, 0 0, 0, 0, 1, 0"
|
|
3290
2158
|
}
|
|
3291
|
-
))))
|
|
2159
|
+
))));
|
|
3292
2160
|
|
|
3293
2161
|
// src/components/VisionSimulator.tsx
|
|
3294
|
-
var iframeId = "storybook-preview-iframe"
|
|
3295
|
-
var baseList = [
|
|
2162
|
+
var iframeId = "storybook-preview-iframe", baseList = [
|
|
3296
2163
|
{ name: "blurred vision", percentage: 22.9 },
|
|
3297
2164
|
{ name: "deuteranomaly", percentage: 2.7 },
|
|
3298
2165
|
{ name: "deuteranopia", percentage: 0.56 },
|
|
@@ -3302,27 +2169,13 @@ var baseList = [
|
|
|
3302
2169
|
{ name: "tritanopia", percentage: 0.016 },
|
|
3303
2170
|
{ name: "achromatopsia", percentage: 1e-4 },
|
|
3304
2171
|
{ name: "grayscale" }
|
|
3305
|
-
]
|
|
3306
|
-
var getFilter = /* @__PURE__ */ __name((filterName) => {
|
|
3307
|
-
if (!filterName) {
|
|
3308
|
-
return "none";
|
|
3309
|
-
}
|
|
3310
|
-
if (filterName === "blurred vision") {
|
|
3311
|
-
return "blur(2px)";
|
|
3312
|
-
}
|
|
3313
|
-
if (filterName === "grayscale") {
|
|
3314
|
-
return "grayscale(100%)";
|
|
3315
|
-
}
|
|
3316
|
-
return `url('#${filterName}')`;
|
|
3317
|
-
}, "getFilter");
|
|
3318
|
-
var Hidden = styled6.div({
|
|
2172
|
+
], getFilter = (filterName) => filterName ? filterName === "blurred vision" ? "blur(2px)" : filterName === "grayscale" ? "grayscale(100%)" : `url('#${filterName}')` : "none", Hidden = styled6.div({
|
|
3319
2173
|
"&, & svg": {
|
|
3320
2174
|
position: "absolute",
|
|
3321
2175
|
width: 0,
|
|
3322
2176
|
height: 0
|
|
3323
2177
|
}
|
|
3324
|
-
})
|
|
3325
|
-
var ColorIcon = styled6.span(
|
|
2178
|
+
}), ColorIcon = styled6.span(
|
|
3326
2179
|
{
|
|
3327
2180
|
background: "linear-gradient(to right, #F44336, #FF9800, #FFEB3B, #8BC34A, #2196F3, #9C27B0)",
|
|
3328
2181
|
borderRadius: "1rem",
|
|
@@ -3330,52 +2183,23 @@ var ColorIcon = styled6.span(
|
|
|
3330
2183
|
height: "1rem",
|
|
3331
2184
|
width: "1rem"
|
|
3332
2185
|
},
|
|
3333
|
-
({ filter }) => ({
|
|
3334
|
-
filter: getFilter(filter)
|
|
2186
|
+
({ $filter }) => ({
|
|
2187
|
+
filter: getFilter($filter)
|
|
3335
2188
|
}),
|
|
3336
2189
|
({ theme: theme2 }) => ({
|
|
3337
2190
|
boxShadow: `${theme2.appBorderColor} 0 0 0 1px inset`
|
|
3338
2191
|
})
|
|
3339
|
-
)
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
flexDirection: "column"
|
|
3343
|
-
});
|
|
3344
|
-
var Title2 = styled6.span({
|
|
3345
|
-
textTransform: "capitalize"
|
|
3346
|
-
});
|
|
3347
|
-
var Description2 = styled6.span(({ theme: theme2 }) => ({
|
|
3348
|
-
fontSize: 11,
|
|
3349
|
-
color: theme2.textMutedColor
|
|
3350
|
-
}));
|
|
3351
|
-
var getColorList = /* @__PURE__ */ __name((active, set) => [
|
|
3352
|
-
...active !== null ? [
|
|
3353
|
-
{
|
|
3354
|
-
id: "reset",
|
|
3355
|
-
title: "Reset color filter",
|
|
3356
|
-
onClick: /* @__PURE__ */ __name(() => {
|
|
3357
|
-
set(null);
|
|
3358
|
-
}, "onClick"),
|
|
3359
|
-
right: void 0,
|
|
3360
|
-
active: false
|
|
3361
|
-
}
|
|
3362
|
-
] : [],
|
|
3363
|
-
...baseList.map((i) => {
|
|
3364
|
-
const description = i.percentage !== void 0 ? `${i.percentage}% of users` : void 0;
|
|
2192
|
+
), VisionSimulator = () => {
|
|
2193
|
+
let [filter, setFilter] = useState4(null), options = baseList.map(({ name, percentage }) => {
|
|
2194
|
+
let description = percentage !== void 0 ? `${percentage}% of users` : void 0;
|
|
3365
2195
|
return {
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
}, "onClick"),
|
|
3371
|
-
right: React9.createElement(ColorIcon, { filter: i.name }),
|
|
3372
|
-
active: active === i
|
|
2196
|
+
title: name,
|
|
2197
|
+
description,
|
|
2198
|
+
icon: React8.createElement(ColorIcon, { $filter: name }),
|
|
2199
|
+
value: name
|
|
3373
2200
|
};
|
|
3374
|
-
})
|
|
3375
|
-
|
|
3376
|
-
var VisionSimulator = /* @__PURE__ */ __name(() => {
|
|
3377
|
-
const [filter, setFilter] = useState5(null);
|
|
3378
|
-
return React9.createElement(React9.Fragment, null, filter && React9.createElement(
|
|
2201
|
+
});
|
|
2202
|
+
return React8.createElement(React8.Fragment, null, filter && React8.createElement(
|
|
3379
2203
|
Global,
|
|
3380
2204
|
{
|
|
3381
2205
|
styles: {
|
|
@@ -3384,54 +2208,43 @@ var VisionSimulator = /* @__PURE__ */ __name(() => {
|
|
|
3384
2208
|
}
|
|
3385
2209
|
}
|
|
3386
2210
|
}
|
|
3387
|
-
),
|
|
3388
|
-
|
|
2211
|
+
), React8.createElement(
|
|
2212
|
+
Select,
|
|
3389
2213
|
{
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
},
|
|
3401
|
-
React9.createElement(IconButton3, { key: "filter", active: !!filter, title: "Vision simulator" }, React9.createElement(AccessibilityIcon, null))
|
|
3402
|
-
), React9.createElement(Hidden, null, React9.createElement(Filters, null)));
|
|
3403
|
-
}, "VisionSimulator");
|
|
2214
|
+
resetLabel: "Reset color filter",
|
|
2215
|
+
onReset: () => setFilter(null),
|
|
2216
|
+
icon: React8.createElement(AccessibilityIcon, null),
|
|
2217
|
+
ariaLabel: "Vision simulator",
|
|
2218
|
+
defaultOptions: filter?.name,
|
|
2219
|
+
options,
|
|
2220
|
+
onSelect: (selected) => setFilter(() => ({ name: selected }))
|
|
2221
|
+
}
|
|
2222
|
+
), React8.createElement(Hidden, null, React8.createElement(Filters, null)));
|
|
2223
|
+
};
|
|
3404
2224
|
|
|
3405
2225
|
// src/manager.tsx
|
|
3406
|
-
var
|
|
3407
|
-
|
|
3408
|
-
const selectedPanel = api.getSelectedPanel();
|
|
3409
|
-
const [{ results }] = useAddonState2(ADDON_ID, {
|
|
2226
|
+
var Title2 = () => {
|
|
2227
|
+
let selectedPanel = useStorybookApi3().getSelectedPanel(), [{ results }] = useAddonState2(ADDON_ID, {
|
|
3410
2228
|
ui: {
|
|
3411
|
-
highlighted:
|
|
2229
|
+
highlighted: !1,
|
|
3412
2230
|
tab: RuleType.VIOLATION
|
|
3413
2231
|
},
|
|
3414
2232
|
results: void 0,
|
|
3415
2233
|
error: void 0,
|
|
3416
2234
|
status: "initial"
|
|
3417
|
-
});
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
const count = violationsNb + incompleteNb;
|
|
3421
|
-
const suffix = count === 0 ? null : React10.createElement(Badge3, { compact: true, status: selectedPanel === PANEL_ID ? "active" : "neutral" }, count);
|
|
3422
|
-
return React10.createElement("div", { style: { display: "flex", alignItems: "center", gap: 6 } }, React10.createElement("span", null, "Accessibility"), suffix);
|
|
3423
|
-
}, "Title");
|
|
2235
|
+
}), violationsNb = results?.violations?.length ?? 0, incompleteNb = results?.incomplete?.length ?? 0, count = violationsNb + incompleteNb, suffix = count === 0 ? null : React9.createElement(Badge3, { compact: !0, status: selectedPanel === PANEL_ID ? "active" : "neutral" }, count);
|
|
2236
|
+
return React9.createElement("div", { style: { display: "flex", alignItems: "center", gap: 6 } }, React9.createElement("span", null, "Accessibility"), suffix);
|
|
2237
|
+
};
|
|
3424
2238
|
addons.register(ADDON_ID, (api) => {
|
|
3425
2239
|
addons.add(PANEL_ID, {
|
|
3426
2240
|
title: "",
|
|
3427
2241
|
type: types.TOOL,
|
|
3428
|
-
match:
|
|
3429
|
-
render:
|
|
3430
|
-
})
|
|
3431
|
-
|
|
3432
|
-
title: Title3,
|
|
2242
|
+
match: ({ viewMode, tabId }) => viewMode === "story" && !tabId,
|
|
2243
|
+
render: () => React9.createElement(VisionSimulator, null)
|
|
2244
|
+
}), addons.add(PANEL_ID, {
|
|
2245
|
+
title: Title2,
|
|
3433
2246
|
type: types.PANEL,
|
|
3434
|
-
render:
|
|
2247
|
+
render: ({ active = !0 }) => React9.createElement(A11yContextProvider, null, active ? React9.createElement(A11YPanel, null) : null),
|
|
3435
2248
|
paramKey: PARAM_KEY
|
|
3436
2249
|
});
|
|
3437
2250
|
});
|