refactor(custom-widgets): simplify authoring prompt (#6695)

This commit is contained in:
Thomas authored and GitHub committed 2026-08-24 09:24:53 +02:00
1 parent fcca57ddf7
commit e7c8e2e01e
6 files changed
+72 -1707

No files matched your search

@@ -10,6 +10,8 @@ interface CustomWidgetPreviewSizeControlProps {
onChange(value: string): void;
}
const previewSizeShortLabels = { compact: "S", standard: "M", wide: "L" } as const;
function CustomWidgetPreviewSizeControlContent({ value, onChange }: CustomWidgetPreviewSizeControlProps) {
const t = useI18n("customWidget.workbench.preview");
@@ -23,7 +25,7 @@ function CustomWidgetPreviewSizeControlContent({ value, onChange }: CustomWidget
value: "compact",
label: (
<span title={t("size.compact")}>
<span aria-hidden>{t("size.compactShort")}</span>
<span aria-hidden>{previewSizeShortLabels.compact}</span>
<VisuallyHidden>{t("size.compact")}</VisuallyHidden>
</span>
),
@@ -32,7 +34,7 @@ function CustomWidgetPreviewSizeControlContent({ value, onChange }: CustomWidget
value: "standard",
label: (
<span title={t("size.standard")}>
<span aria-hidden>{t("size.standardShort")}</span>
<span aria-hidden>{previewSizeShortLabels.standard}</span>
<VisuallyHidden>{t("size.standard")}</VisuallyHidden>
</span>
),
@@ -41,7 +43,7 @@ function CustomWidgetPreviewSizeControlContent({ value, onChange }: CustomWidget
value: "wide",
label: (
<span title={t("size.wide")}>
<span aria-hidden>{t("size.wideShort")}</span>
<span aria-hidden>{previewSizeShortLabels.wide}</span>
<VisuallyHidden>{t("size.wide")}</VisuallyHidden>
</span>
),