Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
feat(design): enhance ColorPicker functionality (#5274)
白熱d069632df81a
diff --git a/packages/design/src/components/color-picker/ColorInput.tsx b/packages/design/src/components/color-picker/ColorInput.tsxindex f0b5dbc3a7..498f50d4d0 100644--- a/packages/design/src/components/color-picker/ColorInput.tsx+++ b/packages/design/src/components/color-picker/ColorInput.tsx@@ -14,21 +14,15 @@* limitations under the License.*/-import { ChevronSortSingle } from '@univerjs/icons';-import React, { useEffect, useMemo, useState } from 'react';-import { Dropdown } from '../dropdown/Dropdown';-import { hexToHsv, hslToHsv, hsvToHex, hsvToHsl, hsvToRgb, rgbToHsv } from './color-conversion';+import type { ChangeEvent } from 'react';+import { useEffect, useMemo, useState } from 'react';+import { hexToHsv, hsvToHex, hsvToRgb, rgbToHsv } from './color-conversion';interface IColorInputProps {hsv: [number, number, number];- alpha: number;- showAlpha?: boolean;- onChangeColor: (h: number, s: number, v: number) => void;- onChangeAlpha: (alpha: number) => void;+ onChange: (h: number, s: number, v: number) => void;}-type ColorFormat = 'hex' | 'rgb' | 'hsl';-interface IInputProps {hsv: [number, number, number];onChange?: (h: number, s: number, v: number) => void;@@ -46,7 +40,7 @@ function HexInput({ hsv, onChange }: IInputProps) {return /^[0-9A-Fa-f]{6}$/.test(hex);};- const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {+ const handleChange = (e: ChangeEvent<HTMLInputElement>) => {const newValue = e.target.value.trim();if (newValue.length > 6) return;@@ -160,222 +154,22 @@ function RgbInput({ hsv, onChange }: IInputProps) {);}-function HslInput({ hsv, onChange }: IInputProps) {- // Local state for HSL values- const [localValues, setLocalValues] = useState({ h: 0, s: 0, l: 0 });-- // Update local values when HSV props change- useEffect(() => {- const [h, s, l] = hsvToHsl(hsv[0], hsv[1], hsv[2]);- setLocalValues({- h: Math.round(h),- s: Math.round(s),- l: Math.round(l),- });- }, [hsv]);-- // Handle input change for each HSL component- const handleChange = (component: 'h' | 's' | 'l', value: string) => {- // Allow only numeric input- if (value !== '' && !/^\d*$/.test(value)) return;-- const numValue = value === '' ? 0 : Number.parseInt(value, 10);-- // Apply range restrictions- if (component === 'h' && numValue > 360) return;- if ((component === 's' || component === 'l') && numValue > 100) return;-- // Update local state- const newValues = { ...localValues, [component]: numValue };- setLocalValues(newValues);-- // Convert to HSV and trigger onChange if valid- if (onChange) {- const hsv = hslToHsv(newValues.h, newValues.s, newValues.l);- onChange(...hsv);- }- };-- // Handle blur event to reset invalid values- const handleBlur = () => {- // Reset to current HSV converted HSL values- const [h, s, l] = hsvToHsl(hsv[0], hsv[1], hsv[2]);- setLocalValues({- h: Math.round(h),- s: Math.round(s),- l: Math.round(l),- });- };-- return (- <div- className={`- univer-flex univer-items-center univer-gap-2- [&>input]:univer-w-11- `}- >- {/* Hue input (0-360) */}- <input- value={localValues.h}- onChange={(e) => handleChange('h', e.target.value)}- onBlur={handleBlur}- maxLength={3}- aria-label="Hue"- />-- {/* Saturation input (0-100) */}- <input- value={localValues.s}- onChange={(e) => handleChange('s', e.target.value)}- onBlur={handleBlur}- maxLength={3}- aria-label="Saturation"- />-- {/* Lightness input (0-100) */}- <input- value={localValues.l}- onChange={(e) => handleChange('l', e.target.value)}- onBlur={handleBlur}- maxLength={3}- aria-label="Lightness"- />- </div>- );-}--interface IAlphaInputProps {- alpha: number; // 0-1- onChange?: (alpha: number) => void;-}--function AlphaInput({ alpha, onChange }: IAlphaInputProps) {- // Local state for input value (0-100)- const [localValue, setLocalValue] = useState('');-- // Update local value when alpha prop changes- useEffect(() => {- setLocalValue(String(Math.round(alpha * 100)));- }, [alpha]);-- // Handle input change- const handleChange = (value: string) => {- // Allow only numeric input- if (value !== '' && !/^\d*$/.test(value)) return;-- const numValue = value === '' ? 0 : Number.parseInt(value, 10);-- // Restrict range to 0-100- if (numValue > 100) return;-- // Update local display value- setLocalValue(value);-- // Convert to decimal and trigger onChange- if (onChange) {- onChange(numValue / 100);- }- };-- // Handle blur event to reset invalid values- const handleBlur = () => {- const currentValue = Math.round(alpha * 100);- setLocalValue(String(currentValue));- };-- return (- <div className="univer-relative">- <input- className="univer-w-14 !univer-pr-5 univer-text-right"- value={localValue}- onChange={(e) => handleChange(e.target.value)}- onBlur={handleBlur}- maxLength={3}- aria-label="Alpha"- inputMode="numeric"- />- <span- className={`- univer-pointer-events-none univer-absolute univer-right-1.5 univer-top-1/2 -univer-translate-y-1/2- univer-text-sm univer-text-gray-400- `}- >- %- </span>- </div>- );-}--export function ColorInput({ hsv, alpha, showAlpha, onChangeColor, onChangeAlpha }: IColorInputProps) {- const [format, setFormat] = useState<ColorFormat>('hex');- const [formatPanelVisible, setFormatPanelVisible] = useState(false);-- function renderInput(format: ColorFormat) {- switch (format) {- case 'hex':- return <HexInput hsv={hsv} onChange={onChangeColor} />;- case 'rgb':- return <RgbInput hsv={hsv} onChange={onChangeColor} />;- case 'hsl':- return <HslInput hsv={hsv} onChange={onChangeColor} />;- default:- return null;- }- }-- function handleSelectFormat(format: ColorFormat) {- setFormatPanelVisible(false);- setFormat(format);- }-+export function ColorInput({ hsv, onChange }: IColorInputProps) {return (<divclassName={`univer-flex univer-gap-2- [&_input]:univer-box-border [&_input]:univer-flex [&_input]:univer-h-8 [&_input]:univer-items-center+ [&_input]:univer-box-border [&_input]:univer-flex [&_input]:univer-h-7 [&_input]:univer-items-center[&_input]:univer-rounded [&_input]:univer-border [&_input]:univer-border-solid[&_input]:univer-border-gray-200 [&_input]:univer-bg-transparent [&_input]:univer-px-1.5[&_input]:univer-text-sm [&_input]:univer-text-gray-700 [&_input]:univer-outline-nonedark:![&_input]:univer-border-gray-600 dark:![&_input]:univer-text-white`}>- <Dropdown- align="start"- overlay={(- <div- className={`- univer-grid univer-w-32- [&>a]:univer-cursor-pointer [&>a]:univer-px-2 [&>a]:univer-py-1 [&>a]:univer-text-sm- dark:!univer-text-white- focus-visible:univer-outline-none- `}- >- <a onClick={() => handleSelectFormat('hex')}>HEX</a>- <a onClick={() => handleSelectFormat('hsl')}>HSL</a>- <a onClick={() => handleSelectFormat('rgb')}>RGB</a>- </div>- )}- open={formatPanelVisible}- onOpenChange={setFormatPanelVisible}- >- <a- className={`- univer-box-border univer-flex univer-h-8 univer-w-32 univer-cursor-pointer univer-items-center- univer-justify-between univer-gap-1 univer-rounded univer-border univer-border-solid- univer-border-gray-200 univer-px-1.5 univer-text-sm univer-text-gray-700- dark:!univer-border-gray-600 dark:!univer-text-white- `}- >- <span>{format.toUpperCase()}</span>- <ChevronSortSingle className="univer-size-5 univer-text-gray-400" />- </a>- </Dropdown>-<div className="univer-relative univer-flex univer-flex-1 univer-gap-2">- {renderInput(format)}+ <HexInput hsv={hsv} onChange={onChange} />+ <RgbInput hsv={hsv} onChange={onChange} /></div>-- {showAlpha && <AlphaInput alpha={alpha} onChange={onChangeAlpha} />}</div>);}diff --git a/packages/design/src/components/color-picker/ColorPicker.stories.tsx b/packages/design/src/components/color-picker/ColorPicker.stories.tsxindex 9a004ab819..43e5bc0c21 100644--- a/packages/design/src/components/color-picker/ColorPicker.stories.tsx+++ b/packages/design/src/components/color-picker/ColorPicker.stories.tsx@@ -15,7 +15,7 @@*/import type { Meta } from '@storybook/react';-import React, { useState } from 'react';+import { useState } from 'react';import { ColorPicker } from './ColorPicker';@@ -34,12 +34,11 @@ export default meta;export const Playground = {render() {const [value, setValue] = useState('#FF0000');- const [format] = useState<'hex' | 'rgb' | 'hsl'>('rgb');return (<>{value}- <ColorPicker showAlpha value={value} onChange={setValue} />+ <ColorPicker value={value} onChange={setValue} /></>);},diff --git a/packages/design/src/components/color-picker/ColorPicker.tsx b/packages/design/src/components/color-picker/ColorPicker.tsxindex dc642f92e6..1233a6f899 100644--- a/packages/design/src/components/color-picker/ColorPicker.tsx+++ b/packages/design/src/components/color-picker/ColorPicker.tsx@@ -14,33 +14,35 @@* limitations under the License.*/-import React, { useCallback, useEffect, useState } from 'react';+import { memo, useCallback, useContext, useEffect, useState } from 'react';import { isBrowser } from '../../helper/is-browser';-import { AlphaSlider } from './AlphaSlider';+import { Button } from '../button/Button';+import { ConfigContext } from '../config-provider/ConfigProvider';+import { Dialog } from '../dialog/Dialog';import { hexToHsv, hsvToHex, hsvToRgb, rgbToHex } from './color-conversion';import { ColorInput } from './ColorInput';import { ColorPresets } from './ColorPresets';import { ColorSpectrum } from './ColorSpectrum';import { HueSlider } from './HueSlider';-const MemoizedColorSpectrum = React.memo(ColorSpectrum);-const MemoizedHueSlider = React.memo(HueSlider);-const MemoizedAlphaSlider = React.memo(AlphaSlider);-const MemoizedColorInput = React.memo(ColorInput);-const MemoizedColorPresets = React.memo(ColorPresets);+const MemoizedColorSpectrum = memo(ColorSpectrum);+const MemoizedHueSlider = memo(HueSlider);+const MemoizedColorInput = memo(ColorInput);+const MemoizedColorPresets = memo(ColorPresets);export interface IColorPickerProps {format?: 'hex';value?: string;- showAlpha?: boolean;onChange?: (value: string) => void;}-export function ColorPicker({ format = 'hex', value = '#000000', showAlpha = false, onChange }: IColorPickerProps) {+export function ColorPicker({ format = 'hex', value = '#000000', onChange }: IColorPickerProps) {if (!isBrowser) return null;+ const { locale } = useContext(ConfigContext);+const [hsv, setHsv] = useState<[number, number, number]>([0, 100, 100]);- const [alpha, setAlpha] = useState(1);+ const [visible, setVisible] = useState(false);const getRgb = useCallback((h: number, s: number, v: number) => {return hsvToRgb(h, s, v);@@ -51,7 +53,6 @@ export function ColorPicker({ format = 'hex', value = '#000000', showAlpha = falif (format === 'hex') {const [h, s, v] = value ? hexToHsv(value) : hsv;setHsv([h, s, v]);- setAlpha(1);}} catch (error) {console.error('Invalid value:', error);@@ -70,54 +71,22 @@ export function ColorPicker({ format = 'hex', value = '#000000', showAlpha = fal}}- function handleAlphaChange(a: number) {- setAlpha(a);- }-- function handleAlphaChanged(a: number) {- if (format === 'hex') {- const hex = hsvToHex(hsv[0], hsv[1], hsv[2]);- onChange?.(hex);- }+ function handleConfirmCustomColor() {+ const [h, s, v] = hsv;+ const hex = hsvToHex(h, s, v);+ onChange?.(hex);+ setVisible(false);}return (<div+ data-u-comp="color-picker"className={`- univer-w-[292px] univer-cursor-default univer-space-y-4 univer-rounded-lg univer-bg-white+ univer-cursor-default univer-space-y-2 univer-rounded-lg univer-bg-whitedark:!univer-bg-gray-700`}onClick={(e) => e.stopPropagation()}>- <MemoizedColorSpectrum- hsv={hsv}- onChange={handleColorChange}- onChanged={handleColorChanged}- />-- <MemoizedHueSlider- hsv={hsv}- onChange={handleColorChange}- onChanged={handleColorChanged}- />-- {showAlpha && (- <MemoizedAlphaSlider- hsv={hsv}- alpha={alpha}- onChange={handleAlphaChange}- onChanged={handleAlphaChanged}- />- )}-- <MemoizedColorInput- hsv={hsv}- alpha={alpha}- showAlpha={showAlpha}- onChangeColor={handleColorChanged}- onChangeAlpha={handleAlphaChanged}- />-<MemoizedColorPresetshsv={hsv}onChange={(h, s, v) => {@@ -125,6 +94,61 @@ export function ColorPicker({ format = 'hex', value = '#000000', showAlpha = falhandleColorChanged(h, s, v);}}/>++ <div className="univer-flex univer-h-7 univer-items-center">+ <a+ className={`+ univer-cursor-pointer univer-gap-2 univer-text-sm univer-text-gray-900 univer-transition-opacity+ dark:!univer-text-white+ hover:univer-opacity-80+ `}+ onClick={() => setVisible(true)}+ >+ {locale?.ColorPicker.more}+ </a>+ </div>++ <Dialog+ className="!univer-w-fit !univer-p-2.5"+ closable={false}+ maskClosable={false}+ open={visible}+ onOpenChange={setVisible}+ >+ <div className="univer-grid univer-w-64 univer-gap-2">+ <MemoizedColorSpectrum+ hsv={hsv}+ onChange={handleColorChange}+ />++ <div className="univer-flex univer-items-center univer-gap-2">+ <div+ className="univer-size-6 univer-flex-shrink-0 univer-rounded-sm"+ style={{+ backgroundColor: hsvToHex(...hsv),+ }}+ />+ <MemoizedHueSlider+ hsv={hsv}+ onChange={handleColorChange}+ />+ </div>++ <MemoizedColorInput+ hsv={hsv}+ onChange={handleColorChange}+ />++ <footer className="univer-flex univer-items-center univer-justify-end univer-gap-2">+ <Button onClick={() => setVisible(false)}>+ {locale?.ColorPicker.cancel}+ </Button>+ <Button variant="primary" onClick={handleConfirmCustomColor}>+ {locale?.ColorPicker.confirm}+ </Button>+ </footer>+ </div>+ </Dialog></div>);}diff --git a/packages/design/src/components/color-picker/ColorPresets.tsx b/packages/design/src/components/color-picker/ColorPresets.tsxindex 16b592e1ce..e62dda1293 100644--- a/packages/design/src/components/color-picker/ColorPresets.tsx+++ b/packages/design/src/components/color-picker/ColorPresets.tsx@@ -14,7 +14,7 @@* limitations under the License.*/-import React, { useCallback } from 'react';+import { useCallback } from 'react';import { clsx } from '../../helper/clsx';import { hexToHsv, hsvToHex } from './color-conversion';import { colorPresets } from './presets';@@ -33,7 +33,10 @@ export function ColorPresets({ hsv, onChange }: IColorPresetsProps) {const currentColor = hsvToHex(hsv[0], hsv[1], hsv[2]);return (- <div className="univer-grid univer-content-center univer-gap-2">+ <div+ data-u-comp="color-picker-presets"+ className="univer-grid univer-content-center univer-gap-2"+ >{colorPresets.map((row, i) => (<divkey={i}diff --git a/packages/design/src/components/color-picker/ColorSpectrum.tsx b/packages/design/src/components/color-picker/ColorSpectrum.tsxindex 5291db85c6..756e83f2d0 100644--- a/packages/design/src/components/color-picker/ColorSpectrum.tsx+++ b/packages/design/src/components/color-picker/ColorSpectrum.tsx@@ -14,7 +14,8 @@* limitations under the License.*/-import React, { useCallback, useEffect, useRef, useState } from 'react';+import type { PointerEvent } from 'react';+import { useCallback, useEffect, useRef, useState } from 'react';interface IColorSpectrumProps {hsv: [number, number, number];@@ -47,7 +48,8 @@ export function ColorSpectrum({ hsv, onChange, onChanged }: IColorSpectrumProps)ctx.fillRect(0, 0, canvas.width, canvas.height);}, [hsv]);- const handlePointerEvent = (e: React.PointerEvent) => {+ const handlePointerEvent = (e: PointerEvent) => {+ e.stopPropagation();const canvas = canvasRef.current;if (!canvas) return;@@ -115,12 +117,13 @@ export function ColorSpectrum({ hsv, onChange, onChanged }: IColorSpectrumProps)return (<div+ data-u-comp="color-picker-spectrum"ref={containerRef}className="univer-relative univer-overflow-hidden"><canvasref={canvasRef}- className="univer-h-[148px] univer-w-full univer-min-w-[260px] univer-cursor-crosshair univer-rounded"+ className="univer-h-full univer-w-full univer-cursor-crosshair univer-rounded"onPointerDown={(e) => {setIsDragging(true);handlePointerEvent(e);diff --git a/packages/design/src/components/color-picker/HueSlider.tsx b/packages/design/src/components/color-picker/HueSlider.tsxindex 0bf5783870..c4a2d32cda 100644--- a/packages/design/src/components/color-picker/HueSlider.tsx+++ b/packages/design/src/components/color-picker/HueSlider.tsx@@ -45,6 +45,7 @@ export function HueSlider({ hsv, onChange, onChanged }: IHueSliderProps) {}, [hsv, thumbSize, onChange]);const handlePointerMove = useCallback((e: PointerEvent) => {+ e.stopPropagation();if (!isDragging) return;calculateHue(e.clientX);}, [isDragging, calculateHue]);@@ -74,7 +75,10 @@ export function HueSlider({ hsv, onChange, onChanged }: IHueSliderProps) {};return (- <div className="univer-relative univer-w-full univer-select-none">+ <div+ data-u-comp="color-picker-hue-slider"+ className="univer-relative univer-w-full univer-select-none"+ ><divref={sliderRef}className={`diff --git a/packages/design/src/components/color-picker/__tests__/__snapshots__/index.spec.tsx.snap b/packages/design/src/components/color-picker/__tests__/__snapshots__/index.spec.tsx.snapindex 466c2ffa2d..deffd5a3ff 100644--- a/packages/design/src/components/color-picker/__tests__/__snapshots__/index.spec.tsx.snap+++ b/packages/design/src/components/color-picker/__tests__/__snapshots__/index.spec.tsx.snap@@ -4,109 +4,14 @@ exports[`ColorPicker > should render correctly 1`] = `<div><divclass="- univer-w-[292px] univer-cursor-default univer-space-y-4 univer-rounded-lg univer-bg-white+ univer-cursor-default univer-space-y-2 univer-rounded-lg univer-bg-whitedark:!univer-bg-gray-700"+ data-u-comp="color-picker">- <div- class="univer-relative univer-overflow-hidden"- >- <canvas- class="univer-h-[148px] univer-w-full univer-min-w-[260px] univer-cursor-crosshair univer-rounded"- />- <div- class="- univer-pointer-events-none univer-absolute univer-left-0 univer-top-0 univer-size-4- univer-rounded-full univer-border-2 univer-border-white univer-shadow-md univer-ring-2- univer-ring-white univer-will-change-transform- "- style="transform: translate(-8px, -8px); transition: transform 0.1s ease-out;"- />- </div>- <div- class="univer-relative univer-w-full univer-select-none"- >- <div- class="- univer-relative univer-h-2 univer-w-full univer-cursor-pointer univer-rounded-full univer-shadow-inner- "- >- <div- class="- univer-absolute univer-top-1/2 univer-box-border univer-size-2 univer-rounded-full- univer-bg-transparent univer-shadow-md univer-ring-2 univer-ring-white univer-transition-transform- univer-duration-75 univer-will-change-transform- "- style="transform: translateY(-50%); transition: all 0.1s ease-out;"- />- </div>- </div>- <div- class="- univer-flex univer-gap-2- [&_input]:univer-box-border [&_input]:univer-flex [&_input]:univer-h-8 [&_input]:univer-items-center- [&_input]:univer-rounded [&_input]:univer-border [&_input]:univer-border-solid- [&_input]:univer-border-gray-200 [&_input]:univer-bg-transparent [&_input]:univer-px-1.5- [&_input]:univer-text-sm [&_input]:univer-text-gray-700 [&_input]:univer-outline-none- dark:![&_input]:univer-border-gray-600 dark:![&_input]:univer-text-white- "- >- <a- aria-controls="radix-«r0»"- aria-expanded="false"- aria-haspopup="dialog"- class="- univer-box-border univer-flex univer-h-8 univer-w-32 univer-cursor-pointer univer-items-center- univer-justify-between univer-gap-1 univer-rounded univer-border univer-border-solid- univer-border-gray-200 univer-px-1.5 univer-text-sm univer-text-gray-700- dark:!univer-border-gray-600 dark:!univer-text-white- "- data-slot="popover-trigger"- data-state="closed"- type="button"- >- <span>- HEX- </span>- <svg- class="univerjs-icon univerjs-icon-chevron-sort-single univer-size-5 univer-text-gray-400"- fill="none"- height="1em"- viewBox="0 0 16 16"- width="1em"- >- <path- clip-rule="evenodd"- d="M7.52892 2.86201C7.78927 2.60166 8.21138 2.60166 8.47173 2.86201L11.1384 5.52868C11.3987 5.78903 11.3987 6.21114 11.1384 6.47149C10.878 6.73184 10.4559 6.73184 10.1956 6.47149L8.00033 4.27622L5.80506 6.47149C5.54471 6.73184 5.1226 6.73184 4.86225 6.47149C4.6019 6.21114 4.6019 5.78903 4.86225 5.52868L7.52892 2.86201ZM4.86225 9.52868C5.1226 9.26833 5.54471 9.26833 5.80506 9.52868L8.00033 11.7239L10.1956 9.52868C10.4559 9.26833 10.878 9.26833 11.1384 9.52868C11.3987 9.78903 11.3987 10.2111 11.1384 10.4715L8.47173 13.1382C8.21138 13.3985 7.78927 13.3985 7.52892 13.1382L4.86225 10.4715C4.6019 10.2111 4.6019 9.78903 4.86225 9.52868Z"- fill="currentColor"- fill-rule="evenodd"- />- </svg>- </a>- <div- class="univer-relative univer-flex univer-flex-1 univer-gap-2"- >- <input- class="- univer-w-full univer-px-2 !univer-pl-4 univer-uppercase- focus:univer-border-primary-500 focus:univer-outline-none- "- maxlength="6"- spellcheck="false"- value="000000"- />- <span- class="- univer-absolute univer-left-1.5 univer-top-1/2 -univer-translate-y-1/2 univer-text-sm- univer-text-gray-400- "- >- #- </span>- </div>- </div><divclass="univer-grid univer-content-center univer-gap-2"+ data-u-comp="color-picker-presets"><divclass="univer-grid univer-grid-flow-col univer-items-center univer-justify-between univer-gap-2"@@ -354,404 +259,16 @@ exports[`ColorPicker > should render correctly 1`] = `/></div></div>- </div>-</div>-`;--exports[`ColorPicker > should render with showAlpha 1`] = `-<div>- <div- class="- univer-w-[292px] univer-cursor-default univer-space-y-4 univer-rounded-lg univer-bg-white- dark:!univer-bg-gray-700- "- >- <div- class="univer-relative univer-overflow-hidden"- >- <canvas- class="univer-h-[148px] univer-w-full univer-min-w-[260px] univer-cursor-crosshair univer-rounded"- />- <div- class="- univer-pointer-events-none univer-absolute univer-left-0 univer-top-0 univer-size-4- univer-rounded-full univer-border-2 univer-border-white univer-shadow-md univer-ring-2- univer-ring-white univer-will-change-transform- "- style="transform: translate(-8px, -8px); transition: transform 0.1s ease-out;"- />- </div><div- class="univer-relative univer-w-full univer-select-none"- >- <div- class="- univer-relative univer-h-2 univer-w-full univer-cursor-pointer univer-rounded-full univer-shadow-inner- "- >- <div- class="- univer-absolute univer-top-1/2 univer-box-border univer-size-2 univer-rounded-full- univer-bg-transparent univer-shadow-md univer-ring-2 univer-ring-white univer-transition-transform- univer-duration-75 univer-will-change-transform- "- style="transform: translateY(-50%); transition: all 0.1s ease-out;"- />- </div>- </div>- <div- class="univer-relative univer-w-full univer-select-none"- >- <div- class="univer-absolute univer-inset-0 univer-rounded-full"- style="background-image: linear-gradient(45deg, #E3E5EA 25%, transparent 25%), linear-gradient(-45deg, #E3E5EA 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #E3E5EA 75%), linear-gradient(-45deg, transparent 75%, #E3E5EA 75%); background-position: 0px 0px, 0px 4px, 4px -4px, -4px 0px; background-size: 8px 8px;"- />- <div- class="- univer-relative univer-h-2 univer-w-full univer-cursor-pointer univer-rounded-full univer-shadow-inner- "- >- <div- class="- univer-absolute univer-top-1/2 univer-box-border univer-size-2 univer-rounded-full- univer-bg-transparent univer-shadow-md univer-ring-2 univer-ring-white univer-transition-transform- univer-duration-75 univer-will-change-transform- "- style="transform: translateY(-50%); transition: all 0.1s ease-out;"- />- </div>- </div>- <div- class="- univer-flex univer-gap-2- [&_input]:univer-box-border [&_input]:univer-flex [&_input]:univer-h-8 [&_input]:univer-items-center- [&_input]:univer-rounded [&_input]:univer-border [&_input]:univer-border-solid- [&_input]:univer-border-gray-200 [&_input]:univer-bg-transparent [&_input]:univer-px-1.5- [&_input]:univer-text-sm [&_input]:univer-text-gray-700 [&_input]:univer-outline-none- dark:![&_input]:univer-border-gray-600 dark:![&_input]:univer-text-white- "+ class="univer-flex univer-h-7 univer-items-center"><a- aria-controls="radix-«r2»"- aria-expanded="false"- aria-haspopup="dialog"class="- univer-box-border univer-flex univer-h-8 univer-w-32 univer-cursor-pointer univer-items-center- univer-justify-between univer-gap-1 univer-rounded univer-border univer-border-solid- univer-border-gray-200 univer-px-1.5 univer-text-sm univer-text-gray-700- dark:!univer-border-gray-600 dark:!univer-text-white+ univer-cursor-pointer univer-gap-2 univer-text-sm univer-text-gray-900 univer-transition-opacity+ dark:!univer-text-white+ hover:univer-opacity-80"- data-slot="popover-trigger"- data-state="closed"- type="button"- >- <span>- HEX- </span>- <svg- class="univerjs-icon univerjs-icon-chevron-sort-single univer-size-5 univer-text-gray-400"- fill="none"- height="1em"- viewBox="0 0 16 16"- width="1em"- >- <path- clip-rule="evenodd"- d="M7.52892 2.86201C7.78927 2.60166 8.21138 2.60166 8.47173 2.86201L11.1384 5.52868C11.3987 5.78903 11.3987 6.21114 11.1384 6.47149C10.878 6.73184 10.4559 6.73184 10.1956 6.47149L8.00033 4.27622L5.80506 6.47149C5.54471 6.73184 5.1226 6.73184 4.86225 6.47149C4.6019 6.21114 4.6019 5.78903 4.86225 5.52868L7.52892 2.86201ZM4.86225 9.52868C5.1226 9.26833 5.54471 9.26833 5.80506 9.52868L8.00033 11.7239L10.1956 9.52868C10.4559 9.26833 10.878 9.26833 11.1384 9.52868C11.3987 9.78903 11.3987 10.2111 11.1384 10.4715L8.47173 13.1382C8.21138 13.3985 7.78927 13.3985 7.52892 13.1382L4.86225 10.4715C4.6019 10.2111 4.6019 9.78903 4.86225 9.52868Z"- fill="currentColor"- fill-rule="evenodd"- />- </svg>- </a>- <div- class="univer-relative univer-flex univer-flex-1 univer-gap-2"- >- <input- class="- univer-w-full univer-px-2 !univer-pl-4 univer-uppercase- focus:univer-border-primary-500 focus:univer-outline-none- "- maxlength="6"- spellcheck="false"- value="000000"- />- <span- class="- univer-absolute univer-left-1.5 univer-top-1/2 -univer-translate-y-1/2 univer-text-sm- univer-text-gray-400- "- >- #- </span>- </div>- <div- class="univer-relative"- >- <input- aria-label="Alpha"- class="univer-w-14 !univer-pr-5 univer-text-right"- inputmode="numeric"- maxlength="3"- value="100"- />- <span- class="- univer-pointer-events-none univer-absolute univer-right-1.5 univer-top-1/2 -univer-translate-y-1/2- univer-text-sm univer-text-gray-400- "- >- %- </span>- </div>- </div>- <div- class="univer-grid univer-content-center univer-gap-2"- >- <div- class="univer-grid univer-grid-flow-col univer-items-center univer-justify-between univer-gap-2"- >- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow !univer-border-gray-200"- style="background-color: #FFFFFF;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #E1EFFE;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #FDE8E8;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #FEECDC;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #FFF4B9;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #DEF7EC;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #D5F5F6;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #EDEBFE;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #FCE8F3;"- type="button"- />- </div>- <div- class="univer-grid univer-grid-flow-col univer-items-center univer-justify-between univer-gap-2"- >- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #CDD0D8;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #A4CAFE;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #F8B4B4;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #FDBA8C;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #FAC815;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #84E1BC;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #7EDCE2;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #CABFFD;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #F8B4D9;"- type="button"- />- </div>- <div- class="univer-grid univer-grid-flow-col univer-items-center univer-justify-between univer-gap-2"- >- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #979DAC;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #3F83F8;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #F05252;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #FF5A1F;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #D49D0F;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #0DA471;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #0694A2;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #9061F9;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #E74694;"- type="button"- />- </div>- <div- class="univer-grid univer-grid-flow-col univer-items-center univer-justify-between univer-gap-2"- >- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #414657;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #1A56DB;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #C81E1E;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #B43403;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #9A6D15;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #046C4E;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #036672;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #6C2BD9;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #BF125D;"- type="button"- />- </div>- <div- class="univer-grid univer-grid-flow-col univer-items-center univer-justify-between univer-gap-2"- >- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow univer-ring-2 univer-ring-offset-2 univer-ring-offset-white dark:!univer-ring-primary-600 dark:!univer-ring-offset-gray-600"- style="background-color: #000000;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #233876;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #771D1D;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #771D1D;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #634312;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #014737;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #014451;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #4A1D96;"- type="button"- />- <button- class="univer-box-border univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow"- style="background-color: #751A3D;"- type="button"- />- </div>+ /></div></div></div>@@ -761,109 +278,14 @@ exports[`ColorPicker > should render with value 1`] = `<div><divclass="- univer-w-[292px] univer-cursor-default univer-space-y-4 univer-rounded-lg univer-bg-white+ univer-cursor-default univer-space-y-2 univer-rounded-lg univer-bg-whitedark:!univer-bg-gray-700"+ data-u-comp="color-picker">- <div- class="univer-relative univer-overflow-hidden"- >- <canvas- class="univer-h-[148px] univer-w-full univer-min-w-[260px] univer-cursor-crosshair univer-rounded"- />- <div- class="- univer-pointer-events-none univer-absolute univer-left-0 univer-top-0 univer-size-4- univer-rounded-full univer-border-2 univer-border-white univer-shadow-md univer-ring-2- univer-ring-white univer-will-change-transform- "- style="transform: translate(-8px, -8px); transition: transform 0.1s ease-out;"- />- </div>- <div- class="univer-relative univer-w-full univer-select-none"- >- <div- class="- univer-relative univer-h-2 univer-w-full univer-cursor-pointer univer-rounded-full univer-shadow-inner- "- >- <div- class="- univer-absolute univer-top-1/2 univer-box-border univer-size-2 univer-rounded-full- univer-bg-transparent univer-shadow-md univer-ring-2 univer-ring-white univer-transition-transform- univer-duration-75 univer-will-change-transform- "- style="transform: translateY(-50%); transition: all 0.1s ease-out;"- />- </div>- </div>- <div- class="- univer-flex univer-gap-2- [&_input]:univer-box-border [&_input]:univer-flex [&_input]:univer-h-8 [&_input]:univer-items-center- [&_input]:univer-rounded [&_input]:univer-border [&_input]:univer-border-solid- [&_input]:univer-border-gray-200 [&_input]:univer-bg-transparent [&_input]:univer-px-1.5- [&_input]:univer-text-sm [&_input]:univer-text-gray-700 [&_input]:univer-outline-none- dark:![&_input]:univer-border-gray-600 dark:![&_input]:univer-text-white- "- >- <a- aria-controls="radix-«r1»"- aria-expanded="false"- aria-haspopup="dialog"- class="- univer-box-border univer-flex univer-h-8 univer-w-32 univer-cursor-pointer univer-items-center- univer-justify-between univer-gap-1 univer-rounded univer-border univer-border-solid- univer-border-gray-200 univer-px-1.5 univer-text-sm univer-text-gray-700- dark:!univer-border-gray-600 dark:!univer-text-white- "- data-slot="popover-trigger"- data-state="closed"- type="button"- >- <span>- HEX- </span>- <svg- class="univerjs-icon univerjs-icon-chevron-sort-single univer-size-5 univer-text-gray-400"- fill="none"- height="1em"- viewBox="0 0 16 16"- width="1em"- >- <path- clip-rule="evenodd"- d="M7.52892 2.86201C7.78927 2.60166 8.21138 2.60166 8.47173 2.86201L11.1384 5.52868C11.3987 5.78903 11.3987 6.21114 11.1384 6.47149C10.878 6.73184 10.4559 6.73184 10.1956 6.47149L8.00033 4.27622L5.80506 6.47149C5.54471 6.73184 5.1226 6.73184 4.86225 6.47149C4.6019 6.21114 4.6019 5.78903 4.86225 5.52868L7.52892 2.86201ZM4.86225 9.52868C5.1226 9.26833 5.54471 9.26833 5.80506 9.52868L8.00033 11.7239L10.1956 9.52868C10.4559 9.26833 10.878 9.26833 11.1384 9.52868C11.3987 9.78903 11.3987 10.2111 11.1384 10.4715L8.47173 13.1382C8.21138 13.3985 7.78927 13.3985 7.52892 13.1382L4.86225 10.4715C4.6019 10.2111 4.6019 9.78903 4.86225 9.52868Z"- fill="currentColor"- fill-rule="evenodd"- />- </svg>- </a>- <div- class="univer-relative univer-flex univer-flex-1 univer-gap-2"- >- <input- class="- univer-w-full univer-px-2 !univer-pl-4 univer-uppercase- focus:univer-border-primary-500 focus:univer-outline-none- "- maxlength="6"- spellcheck="false"- value="ff0000"- />- <span- class="- univer-absolute univer-left-1.5 univer-top-1/2 -univer-translate-y-1/2 univer-text-sm- univer-text-gray-400- "- >- #- </span>- </div>- </div><divclass="univer-grid univer-content-center univer-gap-2"+ data-u-comp="color-picker-presets"><divclass="univer-grid univer-grid-flow-col univer-items-center univer-justify-between univer-gap-2"@@ -1111,6 +533,17 @@ exports[`ColorPicker > should render with value 1`] = `/></div></div>+ <div+ class="univer-flex univer-h-7 univer-items-center"+ >+ <a+ class="+ univer-cursor-pointer univer-gap-2 univer-text-sm univer-text-gray-900 univer-transition-opacity+ dark:!univer-text-white+ hover:univer-opacity-80+ "+ />+ </div></div></div>`;diff --git a/packages/design/src/components/color-picker/__tests__/index.spec.tsx b/packages/design/src/components/color-picker/__tests__/index.spec.tsxindex 1da28351b2..04ef59a9b2 100644--- a/packages/design/src/components/color-picker/__tests__/index.spec.tsx+++ b/packages/design/src/components/color-picker/__tests__/index.spec.tsx@@ -31,10 +31,4 @@ describe('ColorPicker', () => {expect(container).toMatchSnapshot();});-- it('should render with showAlpha', () => {- const { container } = render(<ColorPicker showAlpha />);-- expect(container).toMatchSnapshot();- });});diff --git a/packages/design/src/components/color-picker/color-conversion.ts b/packages/design/src/components/color-picker/color-conversion.tsindex 5ca5f70c5a..5d834828a7 100644--- a/packages/design/src/components/color-picker/color-conversion.ts+++ b/packages/design/src/components/color-picker/color-conversion.ts@@ -114,28 +114,6 @@ export const hsvToHex = (h: number, s: number, v: number): string => {return rgbToHex(r, g, b);};-export const hsvToHsl = (h: number, s: number, v: number): [number, number, number] => {- const l = (2 - s / 100) * v / 2;- const sl = l && l < 50 ? s * v / (l * 2) : s + l;- return [h, sl, l];-};--export const hslToHsv = (h: number, s: number, l: number): [number, number, number] => {- // Convert S and L to decimal form- s /= 100;- l /= 100;-- // Calculate V and S for HSV- const v = l + s * Math.min(l, 1 - l);- const sv = v === 0 ? 0 : 2 * (1 - l / v);-- return [- h, // Hue remains the same- Math.round(sv * 100), // Convert S back to percentage- Math.round(v * 100), // Convert V back to percentage- ];-};-export const parseRgba = (rgba: string): [number, number, number, number] => {const match = rgba.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d+))?\)/);if (!match) throw new Error('Invalid RGBA string');diff --git a/packages/design/src/locale/en-US.ts b/packages/design/src/locale/en-US.tsindex e276e2f006..b62a2ecc5c 100644--- a/packages/design/src/locale/en-US.ts+++ b/packages/design/src/locale/en-US.ts@@ -34,6 +34,11 @@ const locale: ILocale = {Select: {empty: 'None',},+ ColorPicker: {+ more: 'More Colors',+ cancel: 'cancel',+ confirm: 'ok',+ },},};diff --git a/packages/design/src/locale/fa-IR.ts b/packages/design/src/locale/fa-IR.tsindex 15b849b469..2f49486b64 100644--- a/packages/design/src/locale/fa-IR.ts+++ b/packages/design/src/locale/fa-IR.ts@@ -34,6 +34,11 @@ const locale: ILocale = {Select: {empty: 'هیچکدام',},+ ColorPicker: {+ more: 'رنگهای بیشتر',+ cancel: 'لغو',+ confirm: 'باشه',+ },},};diff --git a/packages/design/src/locale/fr-FR.ts b/packages/design/src/locale/fr-FR.tsindex 85dec98548..e2acf1dd24 100644--- a/packages/design/src/locale/fr-FR.ts+++ b/packages/design/src/locale/fr-FR.ts@@ -34,6 +34,11 @@ const locale: ILocale = {Select: {empty: 'Aucun',},+ ColorPicker: {+ more: 'Plus de couleurs',+ cancel: 'annuler',+ confirm: 'ok',+ },},};diff --git a/packages/design/src/locale/interface.ts b/packages/design/src/locale/interface.tsindex 0819413886..13a97b3c9f 100644--- a/packages/design/src/locale/interface.ts+++ b/packages/design/src/locale/interface.ts@@ -22,5 +22,6 @@ export interface ILocale {Picker: typeof PickerZhCN;CascaderList: Record<string, any>;Select: Record<string, any>;+ ColorPicker: Record<string, any>;};}diff --git a/packages/design/src/locale/ru-RU.ts b/packages/design/src/locale/ru-RU.tsindex ca09f01e3a..8719a37fe0 100644--- a/packages/design/src/locale/ru-RU.ts+++ b/packages/design/src/locale/ru-RU.ts@@ -34,6 +34,11 @@ const locale: ILocale = {Select: {empty: 'Нет',},+ ColorPicker: {+ more: 'Больше цветов',+ cancel: 'отмена',+ confirm: 'ок',+ },},};diff --git a/packages/design/src/locale/vi-VN.ts b/packages/design/src/locale/vi-VN.tsindex ffb77f7b6e..727a435b3f 100644--- a/packages/design/src/locale/vi-VN.ts+++ b/packages/design/src/locale/vi-VN.ts@@ -34,6 +34,11 @@ const locale: ILocale = {Select: {empty: 'Không có',},+ ColorPicker: {+ more: 'Màu sắc khác',+ cancel: 'Hủy bỏ',+ confirm: 'Xác nhận',+ },},};diff --git a/packages/design/src/locale/zh-CN.ts b/packages/design/src/locale/zh-CN.tsindex d3b1224dba..8cedf4e342 100644--- a/packages/design/src/locale/zh-CN.ts+++ b/packages/design/src/locale/zh-CN.ts@@ -34,6 +34,11 @@ const locale: ILocale = {Select: {empty: '无',},+ ColorPicker: {+ more: '更多颜色',+ cancel: '取消',+ confirm: '确定',+ },},};diff --git a/packages/design/src/locale/zh-TW.ts b/packages/design/src/locale/zh-TW.tsindex 828b880244..a9513f27cf 100644--- a/packages/design/src/locale/zh-TW.ts+++ b/packages/design/src/locale/zh-TW.ts@@ -34,6 +34,11 @@ const locale: ILocale = {Select: {empty: '無',},+ ColorPicker: {+ more: '更多顏色',+ cancel: '取消',+ confirm: '確定',+ },},};