Skip to content

Commit

Permalink
Merge pull request #627 from tokens-studio/clsx-fix
Browse files Browse the repository at this point in the history
fix clsx missing in build
  • Loading branch information
mck authored Jan 8, 2025
2 parents 8e6dca2 + bc6bd68 commit 0308204
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 16 deletions.
9 changes: 9 additions & 0 deletions .changeset/heavy-queens-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@tokens-studio/react-storybook-graph-engine": patch
"@tokens-studio/graph-engine-nodes-preview": patch
"@tokens-studio/lit-storybook": patch
"@tokens-studio/graph-editor": patch
"@tokens-studio/graph-engine-ui": patch
---

Fix clsx and remove classnames.
2 changes: 2 additions & 0 deletions packages/documentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"@docusaurus/preset-classic": "^3.2.1",
"@docusaurus/theme-mermaid": "^3.2.1",
"@mdx-js/react": "^3.0.0",
"@tokens-studio/tokens": "*",
"@tokens-studio/ui": "*",
"clsx": "^2.0.0",
"prism-react-renderer": "^2.3.0",
"@tokens-studio/graph-editor": "*"
Expand Down
5 changes: 3 additions & 2 deletions packages/graph-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@
"@rematch/core": "2.2.0",
"@tokens-studio/graph-engine": "*",
"@tokens-studio/icons": "^0.1.4",
"@tokens-studio/tokens": "^0.3.7",
"@tokens-studio/types": "^0.5.1",
"@tokens-studio/ui": "^1.0.13",
"@xzdarcy/react-timeline-editor": "^0.1.9",
"array-move": "^4.0.0",
"classnames": "^2.3.2",
"clsx": "^2.1.1",
"cmdk": "^0.2.0",
"copy-to-clipboard": "^3.3.3",
"dagre": "^0.8.5",
Expand Down Expand Up @@ -139,4 +140,4 @@
"publishConfig": {
"access": "public"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useCanDeleteNode } from '@/hooks/useCanDeleteNode.js';
import { useLocalGraph } from '@/hooks/index.js';
import { useToast } from '@/hooks/useToast.js';
import React, { useCallback } from 'react';
import classNames from 'classnames/dedupe.js';
import clsx from 'clsx';

export interface INodeContextMenuProps {
id: string;
Expand Down Expand Up @@ -54,12 +54,12 @@ const applyFilters = (
if (!lookup[x.id]) {
return {
...x,
className: classNames(x.className, 'filtered'),
className: clsx(x.className, 'filtered'),
};
}
return {
...x,
className: classNames(x.className, {
className: clsx(x.className, {
filtered: false,
}),
};
Expand Down Expand Up @@ -136,7 +136,7 @@ export const NodeContextMenu = ({ id, nodes }: INodeContextMenuProps) => {
//Remove filtering
return {
...x,
className: classNames(x.className, {
className: clsx(x.className, {
filtered: false,
}),
};
Expand Down
4 changes: 2 additions & 2 deletions packages/storybook-lit/src/components/context/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ContextConsumer } from '@lit/context';
import { ContextProvider } from '@lit/context';
import { createContext } from '@lit/context';
import { customElement, property } from 'lit/decorators.js';
import cx from 'classnames';
import clsx from 'clsx';

export type ContextDefaults = Record<string, string>;

Expand All @@ -27,7 +27,7 @@ export const useStyledClass =

const klass = `${baseClass}--${theme}`;

return cx(baseClass, klass);
return clsx(baseClass, klass);
};

export const themeContext = createContext<Theme>('theme');
Expand Down
4 changes: 2 additions & 2 deletions packages/storybook-react/src/context/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import cx from 'classnames';
import clsx from 'clsx';
export const ContextProvider = React.createContext({});

export const ThemeProvider = ({ children, ...rest }) => {
Expand Down Expand Up @@ -29,5 +29,5 @@ export const useStyledClass = (

const klass = `${baseClass}--${theme}`;

return cx(baseClass, klass);
return clsx(baseClass, klass);
};
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@ts-rest/serverless": "^3.51.0",
"@uiw/react-md-editor": "4.0.4",
"@vercel/otel": "1.8.1",
"classnames": "2.3.2",
"clsx": "^2.1.1",
"copy-to-clipboard": "3.3.3",
"critters": "0.0.16",
"cross-env": "7.0.3",
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8758,11 +8758,6 @@ classcat@^5.0.3, classcat@^5.0.4:
resolved "https://registry.yarnpkg.com/classcat/-/classcat-5.0.5.tgz#8c209f359a93ac302404a10161b501eba9c09c77"
integrity sha512-JhZUT7JFcQy/EzW605k/ktHtncoo9vnyW/2GspNYwFlN1C/WmjuV/xtS04e9SOkL2sTdw0VAZ2UGCcQ9lR6p6w==

[email protected]:
version "2.3.2"
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.2.tgz#351d813bf0137fcc6a76a16b88208d2560a0d924"
integrity sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==

[email protected], classnames@^2.2.1, classnames@^2.2.6, classnames@^2.3.2, classnames@^2.5.1:
version "2.5.1"
resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.5.1.tgz#ba774c614be0f016da105c858e7159eae8e7687b"
Expand Down

0 comments on commit 0308204

Please sign in to comment.