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(deps-dev): bump dumi-plugin-color-chunk from 1.1.2 to 2.1.0 #632

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
13 changes: 5 additions & 8 deletions .dumi/theme/builtins/ColorChunk/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import type { ColorInput } from '@ctrl/tinycolor';
import { TinyColor } from '@ctrl/tinycolor';
import { FastColor } from '@ant-design/fast-color';
import type { ColorInput } from '@ant-design/fast-color';
import { createStyles } from 'antd-style';
import * as React from 'react';

const useStyle = createStyles(({ token, css }) => ({
codeSpan: css`
Expand All @@ -22,17 +22,14 @@ const useStyle = createStyles(({ token, css }) => ({
}));

interface ColorChunkProps {
value?: ColorInput;
value: ColorInput;
}

const ColorChunk: React.FC<React.PropsWithChildren<ColorChunkProps>> = (props) => {
const { styles } = useStyle();
const { value, children } = props;

const dotColor = React.useMemo(() => {
const _color = new TinyColor(value).toHex8String();
return _color.endsWith('ff') ? _color.slice(0, -2) : _color;
}, [value]);
const dotColor = React.useMemo(() => new FastColor(value).toHexString(), [value]);

return (
<span className={styles.codeSpan}>
Expand Down
8 changes: 4 additions & 4 deletions .dumi/theme/builtins/TokenCompare/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// 用于 color.md 中的颜色对比
import React from 'react';
import { TinyColor } from '@ctrl/tinycolor';
import { FastColor } from '@ant-design/fast-color';
import { Flex, theme } from 'antd';
import { createStyles } from 'antd-style';
import tokenMeta from 'antd/es/version/token-meta.json';
import classNames from 'classnames';
// 用于 color.md 中的颜色对比
import React from 'react';

import useLocale from '../../../hooks/useLocale';

Expand Down Expand Up @@ -55,7 +55,7 @@ const useStyle = createStyles(({ token, css }) => {
});

function color2Rgba(color: string) {
return `#${new TinyColor(color).toHex8().toUpperCase()}`;
return `#${new FastColor(color).toHexString().toUpperCase()}`;
}

interface ColorCircleProps {
Expand Down
10 changes: 5 additions & 5 deletions .dumi/theme/common/styles/Markdown.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TinyColor } from '@ctrl/tinycolor';
import { FastColor } from '@ant-design/fast-color';
import { Global, css } from '@emotion/react';
import { useTheme } from 'antd-style';
import React from 'react';
Expand Down Expand Up @@ -392,7 +392,7 @@ const GlobalStyle: React.FC = () => {
background: ${demoGridColor};
&:nth-child(2n + 1) {
background: ${new TinyColor(demoGridColor).setAlpha(0.75).toHex8String()};
background: ${new FastColor(demoGridColor).setA(0.75).toHexString()};
}
}
Expand All @@ -408,12 +408,12 @@ const GlobalStyle: React.FC = () => {
}
${antCls}-row .demo-col-1 {
background: ${new TinyColor(demoGridColor).setAlpha(0.75).toHexString()};
background: ${new FastColor(demoGridColor).setA(0.75).toHexString()};
}
${antCls}-row .demo-col-2,
.code-box-demo ${antCls}-row .demo-col-2 {
background: ${new TinyColor(demoGridColor).setAlpha(0.75).toHexString()};
background: ${new FastColor(demoGridColor).setA(0.75).toHexString()};
}
${antCls}-row .demo-col-3,
Expand All @@ -424,7 +424,7 @@ const GlobalStyle: React.FC = () => {
${antCls}-row .demo-col-4,
.code-box-demo ${antCls}-row .demo-col-4 {
background: ${new TinyColor(demoGridColor).setAlpha(0.6).toHexString()};
background: ${new FastColor(demoGridColor).setA(0.6).toHexString()};
}
${antCls}-row .demo-col-5,
Expand Down
4 changes: 2 additions & 2 deletions .dumi/theme/slots/Footer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { FastColor } from '@ant-design/fast-color';
import {
AntDesignOutlined,
BgColorsOutlined,
Expand All @@ -12,7 +13,6 @@ import {
UsergroupAddOutlined,
ZhihuOutlined,
} from '@ant-design/icons';
import { TinyColor } from '@ctrl/tinycolor';
import { createStyles } from 'antd-style';
import getAlphaColor from 'antd/es/theme/util/getAlphaColor';
import { FormattedMessage } from 'dumi';
Expand All @@ -38,7 +38,7 @@ const locales = {
const useStyle = () => {
const { isMobile } = useContext(SiteContext);
return createStyles(({ token, css }) => {
const background = new TinyColor(getAlphaColor('#f0f3fa', '#fff'))
const background = new FastColor(getAlphaColor('#f0f3fa', '#fff'))
.onBackground(token.colorBgContainer)
.toHexString();

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
"@biomejs/biome": "^1.9.0",
"@codecov/webpack-plugin": "^1.4.0",
"@codesandbox/sandpack-react": "^2.19.8",
"@ctrl/tinycolor": "^4.1.0",
"@emotion/react": "^11.13.5",
"@emotion/server": "^11.11.0",
"@happy-dom/jest-environment": "^17.4.3",
Expand Down Expand Up @@ -175,7 +174,7 @@
"dayjs": "^1.11.13",
"dekko": "^0.2.1",
"dumi": "^2.4.17",
"dumi-plugin-color-chunk": "^1.1.2",
"dumi-plugin-color-chunk": "^2.1.0",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This update to dumi-plugin-color-chunk from version 1.1.2 to 2.1.0 includes breaking changes. Ensure that the application is compatible with the new version, especially regarding the props value and children.

"esbuild-loader": "^4.2.2",
"fast-glob": "^3.3.2",
"father": "4.5.2",
Expand Down