Add harness workflow and Material showcase design system
This commit is contained in:
@@ -1,12 +1,7 @@
|
||||
import "../src/preview.css";
|
||||
|
||||
import type { Preview } from "@storybook/react";
|
||||
import {
|
||||
defaultSkin,
|
||||
setSkin,
|
||||
skinDetails,
|
||||
skinNames
|
||||
} from "@ai-ui/ui";
|
||||
import { defaultSkin, setSkin } from "@ai-ui/ui";
|
||||
import {
|
||||
defaultMotionMode,
|
||||
defaultTheme,
|
||||
@@ -21,7 +16,7 @@ import {
|
||||
const preview: Preview = {
|
||||
globalTypes: {
|
||||
theme: {
|
||||
description: "Preview theme",
|
||||
description: "Preview dynamic seed preset",
|
||||
toolbar: {
|
||||
icon: "paintbrush",
|
||||
dynamicTitle: true,
|
||||
@@ -32,7 +27,7 @@ const preview: Preview = {
|
||||
}
|
||||
},
|
||||
motionMode: {
|
||||
description: "Preview motion mode",
|
||||
description: "Preview motion baseline",
|
||||
toolbar: {
|
||||
icon: "contrast",
|
||||
dynamicTitle: true,
|
||||
@@ -41,22 +36,10 @@ const preview: Preview = {
|
||||
title: motionModeDetails[modeName].label
|
||||
}))
|
||||
}
|
||||
},
|
||||
skin: {
|
||||
description: "Preview component skin",
|
||||
toolbar: {
|
||||
icon: "mirror",
|
||||
dynamicTitle: true,
|
||||
items: skinNames.map((skinName) => ({
|
||||
value: skinName,
|
||||
title: skinDetails[skinName].label
|
||||
}))
|
||||
}
|
||||
}
|
||||
},
|
||||
initialGlobals: {
|
||||
motionMode: defaultMotionMode,
|
||||
skin: defaultSkin,
|
||||
theme: defaultTheme
|
||||
},
|
||||
parameters: {
|
||||
@@ -82,11 +65,11 @@ const preview: Preview = {
|
||||
if (typeof document !== "undefined") {
|
||||
setTheme(context.globals.theme ?? defaultTheme);
|
||||
setMotionMode(context.globals.motionMode ?? defaultMotionMode);
|
||||
setSkin(context.globals.skin ?? defaultSkin);
|
||||
setSkin(defaultSkin);
|
||||
|
||||
document.body.dataset.theme = context.globals.theme ?? defaultTheme;
|
||||
document.body.dataset.motion = context.globals.motionMode ?? defaultMotionMode;
|
||||
document.body.dataset.skin = context.globals.skin ?? defaultSkin;
|
||||
document.body.dataset.skin = defaultSkin;
|
||||
}
|
||||
|
||||
return Story();
|
||||
|
||||
Reference in New Issue
Block a user