@univerjs/design 0.15.0 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/lib/cjs/index.js +64 -60
  2. package/lib/cjs/locale/ca-ES.js +1 -1
  3. package/lib/cjs/locale/en-US.js +1 -1
  4. package/lib/cjs/locale/es-ES.js +1 -1
  5. package/lib/cjs/locale/fa-IR.js +1 -1
  6. package/lib/cjs/locale/fr-FR.js +1 -1
  7. package/lib/cjs/locale/ja-JP.js +1 -1
  8. package/lib/cjs/locale/ko-KR.js +1 -1
  9. package/lib/cjs/locale/ru-RU.js +1 -1
  10. package/lib/cjs/locale/vi-VN.js +1 -1
  11. package/lib/cjs/locale/zh-CN.js +1 -1
  12. package/lib/cjs/locale/zh-TW.js +1 -1
  13. package/lib/es/index.js +6116 -5782
  14. package/lib/es/locale/ca-ES.js +10 -0
  15. package/lib/es/locale/en-US.js +10 -0
  16. package/lib/es/locale/es-ES.js +10 -0
  17. package/lib/es/locale/fa-IR.js +10 -0
  18. package/lib/es/locale/fr-FR.js +10 -0
  19. package/lib/es/locale/ja-JP.js +10 -0
  20. package/lib/es/locale/ko-KR.js +10 -0
  21. package/lib/es/locale/ru-RU.js +10 -0
  22. package/lib/es/locale/vi-VN.js +10 -0
  23. package/lib/es/locale/zh-CN.js +10 -0
  24. package/lib/es/locale/zh-TW.js +10 -0
  25. package/lib/index.css +1 -1
  26. package/lib/index.js +6116 -5782
  27. package/lib/locale/ca-ES.js +10 -0
  28. package/lib/locale/en-US.js +10 -0
  29. package/lib/locale/es-ES.js +10 -0
  30. package/lib/locale/fa-IR.js +10 -0
  31. package/lib/locale/fr-FR.js +10 -0
  32. package/lib/locale/ja-JP.js +10 -0
  33. package/lib/locale/ko-KR.js +10 -0
  34. package/lib/locale/ru-RU.js +10 -0
  35. package/lib/locale/vi-VN.js +10 -0
  36. package/lib/locale/zh-CN.js +10 -0
  37. package/lib/locale/zh-TW.js +10 -0
  38. package/lib/types/components/color-picker/ColorInput.d.ts +4 -2
  39. package/lib/types/components/color-picker/ColorPicker.d.ts +1 -1
  40. package/lib/types/components/color-picker/ColorPicker.stories.d.ts +3 -0
  41. package/lib/types/components/color-picker/color-conversion.d.ts +1 -0
  42. package/lib/types/components/gradient-color-picker/GradientColorPicker.d.ts +31 -0
  43. package/lib/types/components/gradient-color-picker/GradientColorPicker.stories.d.ts +7 -0
  44. package/lib/types/index.d.ts +1 -0
  45. package/lib/types/locale/en-US.d.ts +10 -0
  46. package/lib/umd/index.js +54 -50
  47. package/lib/umd/locale/ca-ES.js +1 -1
  48. package/lib/umd/locale/en-US.js +1 -1
  49. package/lib/umd/locale/es-ES.js +1 -1
  50. package/lib/umd/locale/fa-IR.js +1 -1
  51. package/lib/umd/locale/fr-FR.js +1 -1
  52. package/lib/umd/locale/ja-JP.js +1 -1
  53. package/lib/umd/locale/ko-KR.js +1 -1
  54. package/lib/umd/locale/ru-RU.js +1 -1
  55. package/lib/umd/locale/vi-VN.js +1 -1
  56. package/lib/umd/locale/zh-CN.js +1 -1
  57. package/lib/umd/locale/zh-TW.js +1 -1
  58. package/package.json +6 -6
@@ -32,6 +32,16 @@ const e = {
32
32
  more: "Més colors",
33
33
  cancel: "cancel·la",
34
34
  confirm: "ok"
35
+ },
36
+ GradientColorPicker: {
37
+ linear: "Lineal",
38
+ radial: "Radial",
39
+ angular: "Angular",
40
+ diamond: "Diamant",
41
+ offset: "Desplaçament",
42
+ angle: "Angle",
43
+ flip: "Girar",
44
+ delete: "Eliminar"
35
45
  }
36
46
  }
37
47
  };
@@ -32,6 +32,16 @@ const e = {
32
32
  more: "More Colors",
33
33
  cancel: "cancel",
34
34
  confirm: "ok"
35
+ },
36
+ GradientColorPicker: {
37
+ linear: "Linear",
38
+ radial: "Radial",
39
+ angular: "Angular",
40
+ diamond: "Diamond",
41
+ offset: "Offset",
42
+ angle: "Angle",
43
+ flip: "Flip",
44
+ delete: "Delete"
35
45
  }
36
46
  }
37
47
  };
@@ -32,6 +32,16 @@ const e = {
32
32
  more: "Més colors",
33
33
  cancel: "cancel·la",
34
34
  confirm: "ok"
35
+ },
36
+ GradientColorPicker: {
37
+ linear: "Lineal",
38
+ radial: "Radial",
39
+ angular: "Angular",
40
+ diamond: "Diamant",
41
+ offset: "Desplaçament",
42
+ angle: "Angle",
43
+ flip: "Girar",
44
+ delete: "Eliminar"
35
45
  }
36
46
  }
37
47
  };
@@ -32,6 +32,16 @@ const e = {
32
32
  more: "رنگ‌های بیشتر",
33
33
  cancel: "لغو",
34
34
  confirm: "باشه"
35
+ },
36
+ GradientColorPicker: {
37
+ linear: "خطی",
38
+ radial: "شعاعی",
39
+ angular: "زاویه‌ای",
40
+ diamond: "الماسی",
41
+ offset: "افست",
42
+ angle: "زاویه",
43
+ flip: "برگردان",
44
+ delete: "حذف"
35
45
  }
36
46
  }
37
47
  };
@@ -32,6 +32,16 @@ const e = {
32
32
  more: "Plus de couleurs",
33
33
  cancel: "annuler",
34
34
  confirm: "ok"
35
+ },
36
+ GradientColorPicker: {
37
+ linear: "Linéaire",
38
+ radial: "Radial",
39
+ angular: "Angulaire",
40
+ diamond: "Diamant",
41
+ offset: "Décalage",
42
+ angle: "Angle",
43
+ flip: "Retourner",
44
+ delete: "Supprimer"
35
45
  }
36
46
  }
37
47
  };
@@ -32,6 +32,16 @@ const e = {
32
32
  more: "その他の色",
33
33
  cancel: "キャンセル",
34
34
  confirm: "確認"
35
+ },
36
+ GradientColorPicker: {
37
+ linear: "線形",
38
+ radial: "円形",
39
+ angular: "角度",
40
+ diamond: "菱形",
41
+ offset: "オフセット",
42
+ angle: "角度",
43
+ flip: "反転",
44
+ delete: "削除"
35
45
  }
36
46
  }
37
47
  };
@@ -32,6 +32,16 @@ const e = {
32
32
  more: "추가 색상",
33
33
  cancel: "취소",
34
34
  confirm: "확인"
35
+ },
36
+ GradientColorPicker: {
37
+ linear: "선형",
38
+ radial: "방사형",
39
+ angular: "각도형",
40
+ diamond: "다이아몬드형",
41
+ offset: "오프셋",
42
+ angle: "각도",
43
+ flip: "뒤집기",
44
+ delete: "삭제"
35
45
  }
36
46
  }
37
47
  };
@@ -32,6 +32,16 @@ const e = {
32
32
  more: "Больше цветов",
33
33
  cancel: "отмена",
34
34
  confirm: "ок"
35
+ },
36
+ GradientColorPicker: {
37
+ linear: "линейный",
38
+ radial: "радиальный",
39
+ angular: "угловой",
40
+ diamond: "ромбовидный",
41
+ offset: "смещение",
42
+ angle: "угол",
43
+ flip: "перевернуть",
44
+ delete: "удалить"
35
45
  }
36
46
  }
37
47
  };
@@ -32,6 +32,16 @@ const n = {
32
32
  more: "Màu sắc khác",
33
33
  cancel: "Hủy bỏ",
34
34
  confirm: "Xác nhận"
35
+ },
36
+ GradientColorPicker: {
37
+ linear: "Tuyến tính",
38
+ radial: "Tỏa ra",
39
+ angular: "Góc",
40
+ diamond: "Hình thoi",
41
+ offset: "Độ lệch",
42
+ angle: "Góc",
43
+ flip: "Lật",
44
+ delete: "Xóa"
35
45
  }
36
46
  }
37
47
  };
@@ -32,6 +32,16 @@ const e = {
32
32
  more: "更多颜色",
33
33
  cancel: "取消",
34
34
  confirm: "确定"
35
+ },
36
+ GradientColorPicker: {
37
+ linear: "线性",
38
+ radial: "径向",
39
+ angular: "角向",
40
+ diamond: "菱形",
41
+ offset: "偏移",
42
+ angle: "角度",
43
+ flip: "翻转",
44
+ delete: "删除"
35
45
  }
36
46
  }
37
47
  };
@@ -32,6 +32,16 @@ const e = {
32
32
  more: "更多顏色",
33
33
  cancel: "取消",
34
34
  confirm: "確定"
35
+ },
36
+ GradientColorPicker: {
37
+ linear: "線性",
38
+ radial: "徑向",
39
+ angular: "角向",
40
+ diamond: "菱形",
41
+ offset: "偏移",
42
+ angle: "角度",
43
+ flip: "翻轉",
44
+ delete: "刪除"
35
45
  }
36
46
  }
37
47
  };
@@ -15,7 +15,9 @@
15
15
  */
16
16
  interface IColorInputProps {
17
17
  hsv: [number, number, number];
18
- onChange: (h: number, s: number, v: number) => void;
18
+ alpha: number;
19
+ format: 'hex' | 'rgba';
20
+ onChange: (h: number, s: number, v: number, a?: number) => void;
19
21
  }
20
- export declare function ColorInput({ hsv, onChange }: IColorInputProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function ColorInput({ hsv, alpha, format, onChange }: IColorInputProps): import("react/jsx-runtime").JSX.Element;
21
23
  export {};
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export interface IColorPickerProps {
17
- format?: 'hex';
17
+ format?: 'hex' | 'rgba';
18
18
  value?: string;
19
19
  onChange?: (value: string) => void;
20
20
  }
@@ -5,3 +5,6 @@ export default meta;
5
5
  export declare const Playground: {
6
6
  render(): import("react/jsx-runtime").JSX.Element;
7
7
  };
8
+ export declare const RgbaFormat: {
9
+ render(): import("react/jsx-runtime").JSX.Element;
10
+ };
@@ -18,4 +18,5 @@ export declare const rgbToHex: (r: number, g: number, b: number) => string;
18
18
  export declare const rgbToHsv: (r: number, g: number, b: number) => [number, number, number];
19
19
  export declare const hexToHsv: (hex: string) => [number, number, number];
20
20
  export declare const hsvToHex: (h: number, s: number, v: number) => string;
21
+ export declare const hsvToRgba: (h: number, s: number, v: number, a: number) => string;
21
22
  export declare const parseRgba: (rgba: string) => [number, number, number, number];
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export type GradientType = 'linear' | 'radial' | 'angular' | 'diamond';
17
+ export interface IGradientStop {
18
+ color: string;
19
+ offset: number;
20
+ }
21
+ export interface IGradientValue {
22
+ type: GradientType;
23
+ stops: IGradientStop[];
24
+ angle?: number;
25
+ }
26
+ export interface IGradientColorPickerProps {
27
+ className?: string;
28
+ value?: IGradientValue;
29
+ onChange?: (value: IGradientValue) => void;
30
+ }
31
+ export declare function GradientColorPicker(props: IGradientColorPickerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { Meta } from '@storybook/react';
2
+ import { GradientColorPicker } from './GradientColorPicker';
3
+ declare const meta: Meta<typeof GradientColorPicker>;
4
+ export default meta;
5
+ export declare const Playground: {
6
+ render(): import("react/jsx-runtime").JSX.Element;
7
+ };
@@ -35,6 +35,7 @@ export { DropdownMenu, type IDropdownMenuProps } from './components/dropdown-men
35
35
  export { Dropdown, type IDropdownProps } from './components/dropdown/Dropdown';
36
36
  export { FormDualColumnLayout, FormLayout, type IFormDualColumnLayoutProps, type IFormLayoutProps } from './components/form-layout';
37
37
  export { Gallery, type IGalleryProps } from './components/gallery/Gallery';
38
+ export { GradientColorPicker, type GradientType, type IGradientColorPickerProps, type IGradientStop, type IGradientValue } from './components/gradient-color-picker/GradientColorPicker';
38
39
  export { HoverCard, type IHoverCardProps } from './components/hover-card/HoverCard';
39
40
  export { type IInputNumberProps, InputNumber } from './components/input-number/InputNumber';
40
41
  export { type IInputProps, Input } from './components/input/Input';
@@ -35,6 +35,16 @@ declare const locale: {
35
35
  cancel: string;
36
36
  confirm: string;
37
37
  };
38
+ GradientColorPicker: {
39
+ linear: string;
40
+ radial: string;
41
+ angular: string;
42
+ diamond: string;
43
+ offset: string;
44
+ angle: string;
45
+ flip: string;
46
+ delete: string;
47
+ };
38
48
  };
39
49
  };
40
50
  export default locale;