deps: bump dumi-plugin-color-chunk to 2.1.0 (#53215)

* Revert "docs: fix color (#52459)"

This reverts commit 3639d949be.

* deps: bump dumi-plugin-color-chunk to 2.1.0
This commit is contained in:
𝑾𝒖𝒙𝒉 2025-03-20 10:17:05 +08:00 committed by GitHub
parent 78a7ff7670
commit 1596b96163
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 8 deletions

View File

@ -1,6 +1,6 @@
import * as React from 'react';
// @ts-ignore
import { TinyColor } from 'dumi-plugin-color-chunk/component';
import { FastColor } from '@ant-design/fast-color';
import type { ColorInput } from '@ant-design/fast-color';
import { createStyles } from 'antd-style';
const useStyle = createStyles(({ token, css }) => ({
@ -22,17 +22,14 @@ const useStyle = createStyles(({ token, css }) => ({
}));
interface ColorChunkProps {
value: any;
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}>

View File

@ -236,7 +236,7 @@
"dekko": "^0.2.1",
"dotenv": "^16.4.5",
"dumi": "~2.4.17",
"dumi-plugin-color-chunk": "^1.1.2",
"dumi-plugin-color-chunk": "^2.1.0",
"env-paths": "^3.0.0",
"eslint": "^9.15.0",
"eslint-plugin-compat": "^6.0.1",