Skip to content

Commit

Permalink
chore: remove chromatic modes (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-jonas authored Dec 5, 2024
1 parent cab08a5 commit 4c0db56
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 28 deletions.
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"]
}
}
}

0 comments on commit 4c0db56

Please sign in to comment.