Bug 1830927 - Remove storybook auto-titlePrefix for UI Widgets r=hjones

Differential Revision: https://phabricator.services.mozilla.com/D178198
This commit is contained in:
Mark Striemer 2023-05-16 20:23:45 +00:00
Родитель 306c2dd755
Коммит f30b1ad2ae
7 изменённых файлов: 9 добавлений и 12 удалений

Просмотреть файл

@ -37,11 +37,7 @@ module.exports = {
"../**/*.stories.md",
"../stories/**/*.stories.mdx",
"../stories/**/*.stories.@(js|jsx|mjs|ts|tsx|md)",
{
directory: `${projectRoot}/toolkit/content/widgets`,
files: `**/*.stories.@(js|jsx|mjs|ts|tsx|md)`,
titlePrefix: "UI Widgets",
},
`${projectRoot}/toolkit/content/widgets/**/*.stories.@(js|jsx|mjs|ts|tsx|md)`,
],
// Additions to the staticDirs might also need to get added to
// MozXULElement.importCss in preview.mjs to enable auto-reloading.

Просмотреть файл

@ -88,7 +88,8 @@ module.exports = function markdownStoryLoader(source) {
let componentName = storyNameRegex.exec(relativePath)?.groups?.name;
if (componentName) {
// Get the common name for a component e.g. Toggle for moz-toggle
storyPath = separateWords(componentName).replace(/^Moz/g, "");
storyPath =
"UI Widgets/" + separateWords(componentName).replace(/^Moz/g, "");
}
}
@ -100,7 +101,7 @@ module.exports = function markdownStoryLoader(source) {
import { Meta, Description, Canvas } from "@storybook/addon-docs";
<Meta
title="${storyPath}/${storyTitle}"
title="${storyPath}/${storyTitle}"
parameters={{
previewTabs: {
canvas: { hidden: true },

Просмотреть файл

@ -53,7 +53,7 @@ import {{ html }} from "../vendor/lit.all.mjs";
import "./{element_name}.mjs";
export default {{
title: "{story_name}",
title: "UI Widgets/{story_name}",
component: "{element_name}",
argTypes: {{
variant: {{

Просмотреть файл

@ -10,7 +10,7 @@ import {
} from "./moz-button-group.mjs";
export default {
title: "Button Group",
title: "UI Widgets/Button Group",
component: "moz-button-group",
argTypes: {
platform: {

Просмотреть файл

@ -9,7 +9,7 @@ import "./moz-label.mjs";
MozXULElement.insertFTLIfNeeded("locales-preview/moz-label.storybook.ftl");
export default {
title: "Label",
title: "UI Widgets/Label",
component: "moz-label",
argTypes: {
inputType: {

Просмотреть файл

@ -18,7 +18,7 @@ const fluentStrings = [
];
export default {
title: "Support Link",
title: "UI Widgets/Support Link",
component: "moz-support-link",
argTypes: {
"data-l10n-id": {

Просмотреть файл

@ -8,7 +8,7 @@ import "./moz-toggle.mjs";
import "../moz-support-link/moz-support-link.mjs";
export default {
title: "Toggle",
title: "UI Widgets/Toggle",
component: "moz-toggle",
parameters: {
status: "in-development",