Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove chromatic modes #305

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/elements-react-stories/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const config: StorybookConfig = {
options: {},
},

viteFinal: async (config) =>
viteFinal: (config) =>
mergeConfig(config, {
plugins: [nxViteTsPaths(), vitePluginRequire()],
resolve: {
Expand Down
18 changes: 0 additions & 18 deletions packages/elements-react-stories/.storybook/modes.ts

This file was deleted.

25 changes: 18 additions & 7 deletions packages/elements-react-stories/.storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// Copyright © 2024 Ory Corp
// SPDX-License-Identifier: Apache-2.0

import type { Decorator, Preview } from "@storybook/react"
import { chromaticModes } from "./modes"
import "@ory/elements-react/theme/styles.css"
import type { Decorator, Preview } from "@storybook/react"
import { merge } from "lodash"
import "./global.css"

Expand All @@ -23,17 +22,26 @@ const preview: Preview = {
date: /Date$/i,
},
},
chromatic: {
modes: chromaticModes,
},
},
}

const withI18next: Decorator = (Story, context) => {
const { locale } = context.globals

return (
<Story args={merge({}, { config: { intl: { locale } } }, context.args)} />
<Story
args={merge(
{},
{
config: {
intl: {
locale: locale && typeof locale === "string" ? locale : "en",
},
},
},
context.args,
)}
/>
)
}

Expand All @@ -48,7 +56,10 @@ export const globalTypes = {
icon: "globe",
items: [
{ value: "en", title: "English" },
{ value: "de", title: "Deutsch" },
{ value: "de", title: "German" },
{ value: "sv", title: "Swedish" },
{ value: "fr", title: "French" },
{ value: "es", title: "Spanish" },
],
showName: true,
},
Expand Down
9 changes: 8 additions & 1 deletion packages/elements-react-stories/project.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{
"targets": {}
"targets": {
"storybook": {
"dependsOn": ["@ory/elements-react:build"]
},
"build-storybook": {
"dependsOn": ["@ory/elements-react:build"]
}
}
}
9 changes: 8 additions & 1 deletion packages/legacy-stories/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@
"projectType": "library",
"tags": [],
"// targets": "to see all targets run: nx show project legacy-stories --web",
"targets": {}
"targets": {
"storybook": {
"dependsOn": ["@ory/elements-react:build"]
},
"build-storybook": {
"dependsOn": ["@ory/elements-react:build"]
}
}
}
Loading