@antscorp/antsomi-ui 1.3.3 → 1.3.5

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 (138) hide show
  1. package/es/assets/css/main.scss +4 -0
  2. package/es/components/atoms/Button/index.d.ts +1 -8
  3. package/es/components/atoms/Flex/Flex.d.ts +2 -0
  4. package/es/components/atoms/Flex/Flex.js +1 -0
  5. package/es/components/atoms/Flex/index.d.ts +1 -0
  6. package/es/components/atoms/Flex/index.js +1 -0
  7. package/es/components/atoms/Input/Input.d.ts +11 -3
  8. package/es/components/atoms/Input/Input.js +3 -0
  9. package/es/components/atoms/Popover/Popover.d.ts +1 -1
  10. package/es/components/atoms/Progress/Progress.d.ts +1 -1
  11. package/es/components/atoms/Radio/index.d.ts +3 -3
  12. package/es/components/atoms/Slider/index.d.ts +2 -1
  13. package/es/components/atoms/Slider/index.js +9 -16
  14. package/es/components/atoms/SliderV2/index.d.ts +5 -0
  15. package/es/components/atoms/SliderV2/index.js +23 -0
  16. package/es/components/atoms/Space/Space.d.ts +1 -1
  17. package/es/components/atoms/Spin/Spin.d.ts +2 -1
  18. package/es/components/atoms/Spin/styled.d.ts +1 -1
  19. package/es/components/atoms/Statistic/Statistic.d.ts +1 -4
  20. package/es/components/atoms/index.d.ts +3 -0
  21. package/es/components/atoms/index.js +3 -0
  22. package/es/components/common/ConfigProvider/ConfigProvider.d.ts +1 -0
  23. package/es/components/common/ConfigProvider/ConfigProvider.js +1 -0
  24. package/es/components/common/ConfigProvider/GlobalStyle.js +38 -1
  25. package/es/components/icons/ArrowGrowIcon.d.ts +2 -1
  26. package/es/components/icons/AudioRecordIcon.d.ts +2 -1
  27. package/es/components/icons/BugIcon.d.ts +2 -1
  28. package/es/components/icons/CameraIcon.d.ts +2 -1
  29. package/es/components/icons/CaptureIcon.d.ts +2 -1
  30. package/es/components/icons/CheckSlimIcon.d.ts +2 -1
  31. package/es/components/icons/CloseIcon.d.ts +2 -1
  32. package/es/components/icons/CommentIcon.d.ts +2 -1
  33. package/es/components/icons/EventIcon.d.ts +2 -1
  34. package/es/components/icons/FreeDrawIcon.d.ts +2 -1
  35. package/es/components/icons/GPTIcon.d.ts +2 -1
  36. package/es/components/icons/GPTIconV2.d.ts +2 -1
  37. package/es/components/icons/GPTIconV3.d.ts +2 -1
  38. package/es/components/icons/HighlightIcon.d.ts +2 -1
  39. package/es/components/icons/IdeaIcon.d.ts +2 -1
  40. package/es/components/icons/InvisibleIcon.d.ts +2 -1
  41. package/es/components/icons/MuteIcon.d.ts +2 -1
  42. package/es/components/icons/OpenUrlIcon.d.ts +2 -1
  43. package/es/components/icons/PauseIcon.d.ts +2 -1
  44. package/es/components/icons/PlaneIcon.d.ts +2 -1
  45. package/es/components/icons/RequestIcon.d.ts +2 -1
  46. package/es/components/icons/StopRecordIcon.d.ts +2 -1
  47. package/es/components/icons/UserIcon.d.ts +2 -1
  48. package/es/components/icons/VerticalDotsIcon.d.ts +2 -1
  49. package/es/components/icons/WarningIcon.d.ts +2 -1
  50. package/es/components/molecules/CaptureScreen/CaptureScreen.d.ts +2 -1
  51. package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.d.ts +2 -1
  52. package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.d.ts +2 -1
  53. package/es/components/molecules/Collapse/Collapse.d.ts +3 -3
  54. package/es/components/molecules/Collapse/Collapse.js +9 -0
  55. package/es/components/molecules/ColorPicker/CustomPicker/index.js +9 -18
  56. package/es/components/molecules/ColorPicker/CustomPicker/styled.d.ts +5 -1
  57. package/es/components/molecules/ColorPicker/CustomPicker/styled.js +14 -3
  58. package/es/components/molecules/ColorPicker/index.js +3 -3
  59. package/es/components/molecules/ColorSetting/index.js +3 -3
  60. package/es/components/molecules/ColorSetting/styled.d.ts +1 -8
  61. package/es/components/molecules/FontFamilySelect/constants.d.ts +307 -0
  62. package/es/components/molecules/FontFamilySelect/constants.js +257 -0
  63. package/es/components/molecules/FontFamilySelect/index.d.ts +17 -0
  64. package/es/components/molecules/FontFamilySelect/index.js +53 -0
  65. package/es/components/molecules/FontSetting/constants.d.ts +3 -0
  66. package/es/components/molecules/FontSetting/constants.js +22 -0
  67. package/es/components/molecules/FontSetting/index.d.ts +24 -0
  68. package/es/components/molecules/FontSetting/index.js +54 -0
  69. package/es/components/molecules/FontSetting/types.d.ts +22 -0
  70. package/es/components/molecules/FontSetting/types.js +1 -0
  71. package/es/components/molecules/FontWeightSelect/constants.d.ts +28 -0
  72. package/es/components/molecules/FontWeightSelect/constants.js +11 -0
  73. package/es/components/molecules/FontWeightSelect/index.d.ts +9 -0
  74. package/es/components/molecules/FontWeightSelect/index.js +39 -0
  75. package/es/components/molecules/Form/Form.d.ts +1 -0
  76. package/es/components/molecules/Form/Form.js +1 -0
  77. package/es/components/molecules/Form/index.d.ts +1 -0
  78. package/es/components/molecules/Form/index.js +1 -0
  79. package/es/components/molecules/GradientSetting/index.d.ts +19 -2
  80. package/es/components/molecules/GradientSetting/index.js +52 -30
  81. package/es/components/molecules/GradientSetting/styled.d.ts +1 -0
  82. package/es/components/molecules/GradientSetting/styled.js +59 -0
  83. package/es/components/molecules/IconSelection/styled.d.ts +1 -8
  84. package/es/components/molecules/InputNumber/index.js +2 -2
  85. package/es/components/molecules/Modal/Modal.d.ts +2 -2
  86. package/es/components/molecules/Modal/styled.d.ts +1 -1
  87. package/es/components/molecules/Popconfirm/Popconfirm.d.ts +1 -1
  88. package/es/components/molecules/Select/Select.d.ts +6 -4
  89. package/es/components/molecules/Select/Select.js +23 -2
  90. package/es/components/molecules/Select/Test.d.ts +2 -1
  91. package/es/components/molecules/SettingWrapper/index.d.ts +1 -2
  92. package/es/components/molecules/SettingWrapperPopover/index.d.ts +16 -0
  93. package/es/components/molecules/SettingWrapperPopover/index.js +17 -0
  94. package/es/components/molecules/TextDecorationSelect/constants.d.ts +19 -0
  95. package/es/components/molecules/TextDecorationSelect/constants.js +26 -0
  96. package/es/components/molecules/TextDecorationSelect/index.d.ts +15 -0
  97. package/es/components/molecules/TextDecorationSelect/index.js +45 -0
  98. package/es/components/molecules/TextTransformSelect/constants.d.ts +13 -0
  99. package/es/components/molecules/TextTransformSelect/constants.js +19 -0
  100. package/es/components/molecules/TextTransformSelect/index.d.ts +9 -0
  101. package/es/components/molecules/TextTransformSelect/index.js +39 -0
  102. package/es/components/molecules/TreeSelect/TreeSelect.d.ts +3 -4
  103. package/es/components/molecules/UploadImage/MediaIcon.d.ts +2 -1
  104. package/es/components/molecules/index.d.ts +8 -0
  105. package/es/components/molecules/index.js +7 -0
  106. package/es/components/organism/Help/styled.d.ts +6 -16
  107. package/es/components/organism/Table/ExplorePivotTable/styled.d.ts +1 -0
  108. package/es/constants/storybook.d.ts +2 -1
  109. package/es/constants/theme.js +25 -3
  110. package/es/test.d.ts +2 -1
  111. package/es/test.js +26 -39
  112. package/package.json +6 -5
  113. package/dist/0173b5993573afa04880.woff +0 -0
  114. package/dist/0dfb9214dfd945cd7290.png +0 -1
  115. package/dist/2883cad25a2b4e87ce5f.eot +0 -0
  116. package/dist/4f54a37971347e3d7122.png +0 -1
  117. package/dist/574b7bee0563a9fe9a29.png +0 -1
  118. package/dist/6b586356e837581204dc.svg +0 -1
  119. package/dist/72eec5c1c786b45a667f.ttf +0 -0
  120. package/dist/bc6bf11c6f5e6743aa4c.png +0 -1
  121. package/dist/dbc405edd6e0806efbc9.svg +0 -1
  122. package/dist/e32f09119052a55cce3c.png +0 -1
  123. package/dist/e3851b9384a984c6fdb5.png +0 -1
  124. package/dist/index.js +0 -2
  125. package/dist/index.js.LICENSE.txt +0 -69
  126. package/dist/main.css +0 -68
  127. package/dist/public/icons/2d496b55d85a9545d7311c073af442bb.png +0 -0
  128. package/dist/public/icons/2fbb4e0927d18e3f8e5c6511ab88d5b3.png +0 -0
  129. package/dist/public/icons/725a52bd91a3ce534b10833df510e5fa.png +0 -0
  130. package/dist/public/icons/7d037e0b378e87a82804443636cd0e13.svg +0 -346
  131. package/dist/public/icons/90553767e0a05b9585a54797cfd9ce51.png +0 -0
  132. package/dist/public/icons/bb64e23a1ff390a416d765ee556096ab.svg +0 -87
  133. package/dist/public/icons/d327b24e9c5d8f486f08d253aab58ce6.png +0 -0
  134. package/dist/public/icons/f1cf266d0a0a53ce07f2dbb859869b7a.png +0 -0
  135. package/dist/public/icons/placeholder-image.png +0 -0
  136. package/dist/public/icons/transparent.svg +0 -1
  137. package/es/components/atoms/Popover/styled.d.ts +0 -4
  138. package/es/components/atoms/Popover/styled.js +0 -5
@@ -1,11 +1,26 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
1
12
  var _a;
2
13
  // Libraries
3
14
  import { Select as AntdSelect } from 'antd';
4
15
  import React from 'react';
16
+ // Components
17
+ import { Flex } from '@antscorp/antsomi-ui/es/components/atoms';
18
+ import { Text } from '../../atoms/Text';
5
19
  // Icons
6
20
  import Icon from '@antscorp/icons';
7
21
  // Constants
8
- import { THEME } from '../../../constants';
22
+ import { THEME } from '@antscorp/antsomi-ui/es/constants';
23
+ // Styled
9
24
  import { StyledTag, TagCloseBtn } from './styled';
10
25
  const tagRender = (props) => {
11
26
  const { label, closable, onClose } = props;
@@ -18,11 +33,17 @@ const tagRender = (props) => {
18
33
  fontSize: 10,
19
34
  } })) }, label));
20
35
  };
21
- const CustomSelect = props => React.createElement(AntdSelect, Object.assign({}, props));
36
+ const CustomSelect = props => {
37
+ const { label, labelProps } = props, rest = __rest(props, ["label", "labelProps"]);
38
+ return (React.createElement(Flex, { vertical: true, gap: 4 },
39
+ typeof label === 'string' ? React.createElement(Text, Object.assign({}, labelProps), label) : label,
40
+ React.createElement(AntdSelect, Object.assign({}, rest))));
41
+ };
22
42
  const Select = CustomSelect;
23
43
  Select.OptGroup = AntdSelect.OptGroup;
24
44
  Select.Option = AntdSelect.Option;
25
45
  Select.defaultProps = {
46
+ labelProps: { color: '#66666' },
26
47
  suffixIcon: (React.createElement(Icon, { type: "icon-ants-expand-more", style: { fontSize: 16, color: (_a = THEME.token) === null || _a === void 0 ? void 0 : _a.bw10 } })),
27
48
  tagRender,
28
49
  };
@@ -1,2 +1,3 @@
1
- declare const SelectTest: () => JSX.Element;
1
+ import React from 'react';
2
+ declare const SelectTest: () => React.JSX.Element;
2
3
  export default SelectTest;
@@ -1,5 +1,5 @@
1
1
  import React, { CSSProperties } from 'react';
2
- interface SettingWrapperProps {
2
+ export interface SettingWrapperProps {
3
3
  label: string;
4
4
  className?: string;
5
5
  labelColor?: string;
@@ -10,4 +10,3 @@ interface SettingWrapperProps {
10
10
  children?: React.ReactNode;
11
11
  }
12
12
  export declare const SettingWrapper: React.FC<SettingWrapperProps>;
13
- export {};
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { SettingWrapperProps } from '../SettingWrapper';
3
+ import { PopoverProps } from 'antd';
4
+ export type SettingWrapperPopoverProps = {
5
+ label: string;
6
+ wrapperProps?: Omit<SettingWrapperProps, 'label'>;
7
+ popoverProps?: Omit<PopoverProps, 'content'>;
8
+ iconPopover?: React.ReactNode;
9
+ };
10
+ /**
11
+ * Renders a popover wrapper for a setting.
12
+ *
13
+ * @param {React.PropsWithChildren<SettingWrapperPopoverProps>} props - The props object containing the label, children, wrapperProps and popoverProps.
14
+ * @returns {React.ReactElement} The rendered popover wrapper.
15
+ */
16
+ export declare const SettingWrapperPopover: React.FC<React.PropsWithChildren<SettingWrapperPopoverProps>>;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { SettingWrapper } from '../SettingWrapper';
3
+ import { Button, Icon, Popover } from '../../atoms';
4
+ /**
5
+ * Renders a popover wrapper for a setting.
6
+ *
7
+ * @param {React.PropsWithChildren<SettingWrapperPopoverProps>} props - The props object containing the label, children, wrapperProps and popoverProps.
8
+ * @returns {React.ReactElement} The rendered popover wrapper.
9
+ */
10
+ export const SettingWrapperPopover = ({ label, children, wrapperProps, popoverProps, iconPopover, }) => {
11
+ var _a, _b;
12
+ return (React.createElement(SettingWrapper, Object.assign({ label: label, labelStyle: Object.assign({ fontWeight: 'bold' }, ((_a = wrapperProps === null || wrapperProps === void 0 ? void 0 : wrapperProps.labelStyle) !== null && _a !== void 0 ? _a : {})) }, (wrapperProps !== null && wrapperProps !== void 0 ? wrapperProps : {})),
13
+ React.createElement(Popover, Object.assign({ content: children, trigger: ['click'], overlayInnerStyle: Object.assign({ padding: '12px 16px', minWidth: 288, maxHeight: '90vh', overflow: 'auto' }, ((_b = popoverProps === null || popoverProps === void 0 ? void 0 : popoverProps.overlayInnerStyle) !== null && _b !== void 0 ? _b : {})) }, (popoverProps !== null && popoverProps !== void 0 ? popoverProps : {})), iconPopover)));
14
+ };
15
+ SettingWrapperPopover.defaultProps = {
16
+ iconPopover: React.createElement(Button, { icon: React.createElement(Icon, { type: "icon-ants-edit-2" }), type: "text" }),
17
+ };
@@ -0,0 +1,19 @@
1
+ export declare const OPTION_TEXT_DECORATION: readonly [{
2
+ readonly label: "None";
3
+ readonly value: "none";
4
+ }, {
5
+ readonly label: "Underline";
6
+ readonly value: "underline";
7
+ }, {
8
+ readonly label: "Overline";
9
+ readonly value: "overline";
10
+ }, {
11
+ readonly label: "Line Through";
12
+ readonly value: "line-through";
13
+ }, {
14
+ readonly label: "Underline - Overline";
15
+ readonly value: "underline overline";
16
+ }, {
17
+ readonly label: "Underline - Line Through";
18
+ readonly value: "underline line-through";
19
+ }];
@@ -0,0 +1,26 @@
1
+ export const OPTION_TEXT_DECORATION = [
2
+ {
3
+ label: 'None',
4
+ value: 'none',
5
+ },
6
+ {
7
+ label: 'Underline',
8
+ value: 'underline',
9
+ },
10
+ {
11
+ label: 'Overline',
12
+ value: 'overline',
13
+ },
14
+ {
15
+ label: 'Line Through',
16
+ value: 'line-through',
17
+ },
18
+ {
19
+ label: 'Underline - Overline',
20
+ value: 'underline overline',
21
+ },
22
+ {
23
+ label: 'Underline - Line Through',
24
+ value: 'underline line-through',
25
+ },
26
+ ];
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { SelectProps } from '../Select';
3
+ import { OPTION_TEXT_DECORATION } from './constants';
4
+ export type TextDecorationSelectProps = Omit<SelectProps, 'onChange'> & {
5
+ label?: string;
6
+ showOptions?: (typeof OPTION_TEXT_DECORATION)[number]['label'][];
7
+ onChange?: (textTransform: (typeof OPTION_TEXT_DECORATION)[number]['value']) => void;
8
+ };
9
+ /**
10
+ * Generates a function comment for the given function body.
11
+ *
12
+ * @param {TextDecorationSelectProps} props - the props for the TextDecorationSelect component
13
+ * @return {React.FC<TextDecorationSelectProps>} the TextDecorationSelect component
14
+ */
15
+ export declare const TextDecorationSelect: React.FC<TextDecorationSelectProps>;
@@ -0,0 +1,45 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React, { useEffect, useMemo, useState } from 'react';
13
+ import { Select } from '../Select';
14
+ import { OPTION_TEXT_DECORATION } from './constants';
15
+ import { SettingWrapper } from '../SettingWrapper';
16
+ /**
17
+ * Generates a function comment for the given function body.
18
+ *
19
+ * @param {TextDecorationSelectProps} props - the props for the TextDecorationSelect component
20
+ * @return {React.FC<TextDecorationSelectProps>} the TextDecorationSelect component
21
+ */
22
+ export const TextDecorationSelect = (props) => {
23
+ const { defaultValue, label, value, showOptions, onChange } = props, selectProps = __rest(props, ["defaultValue", "label", "value", "showOptions", "onChange"]);
24
+ const [selected, setSelected] = useState(defaultValue || value);
25
+ useEffect(() => {
26
+ setSelected(value === null || value === void 0 ? void 0 : value.toString());
27
+ }, [value]);
28
+ const textDecorationOptions = useMemo(() => {
29
+ let draftFontFamily = [...OPTION_TEXT_DECORATION];
30
+ if (showOptions === null || showOptions === void 0 ? void 0 : showOptions.length) {
31
+ draftFontFamily = OPTION_TEXT_DECORATION.filter(({ label }) => showOptions.some(font => font === label));
32
+ }
33
+ return draftFontFamily;
34
+ }, [showOptions]);
35
+ const handleChange = (value) => {
36
+ if (onChange && typeof onChange === 'function') {
37
+ onChange(value);
38
+ }
39
+ };
40
+ return (React.createElement(SettingWrapper, { label: label !== null && label !== void 0 ? label : '', containerStyle: { width: '100%' }, vertical: true },
41
+ React.createElement(Select, Object.assign({ value: selected, options: [...textDecorationOptions], style: { width: '100%' }, onChange: select => {
42
+ setSelected(select);
43
+ handleChange(select);
44
+ }, showSearch: true }, selectProps))));
45
+ };
@@ -0,0 +1,13 @@
1
+ export declare const OPTION_TEXT_TRANSFORM: readonly [{
2
+ readonly label: "None";
3
+ readonly value: "none";
4
+ }, {
5
+ readonly label: "Capitalize";
6
+ readonly value: "capitalize";
7
+ }, {
8
+ readonly label: "Uppercase";
9
+ readonly value: "uppercase";
10
+ }, {
11
+ readonly label: "Lowercase";
12
+ readonly value: "lowercase";
13
+ }];
@@ -0,0 +1,19 @@
1
+ // export const LABEL_TEXT_TRANSFORM = 'None' || 'Capitalize' || 'Uppercase' || 'Lowercase';
2
+ export const OPTION_TEXT_TRANSFORM = [
3
+ {
4
+ label: 'None',
5
+ value: 'none',
6
+ },
7
+ {
8
+ label: 'Capitalize',
9
+ value: 'capitalize',
10
+ },
11
+ {
12
+ label: 'Uppercase',
13
+ value: 'uppercase',
14
+ },
15
+ {
16
+ label: 'Lowercase',
17
+ value: 'lowercase',
18
+ },
19
+ ];
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { SelectProps } from '../Select';
3
+ import { OPTION_TEXT_TRANSFORM } from './constants';
4
+ export type TextTransformSelectProps = Omit<SelectProps, 'onChange'> & {
5
+ label?: string;
6
+ showOptions?: (typeof OPTION_TEXT_TRANSFORM)[number]['label'][];
7
+ onChange?: (textTransform: (typeof OPTION_TEXT_TRANSFORM)[number]['value']) => void;
8
+ };
9
+ export declare const TextTransformSelect: React.FC<TextTransformSelectProps>;
@@ -0,0 +1,39 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React, { useEffect, useMemo, useState } from 'react';
13
+ import { Select } from '../Select';
14
+ import { SettingWrapper } from '../SettingWrapper';
15
+ import { OPTION_TEXT_TRANSFORM } from './constants';
16
+ export const TextTransformSelect = (props) => {
17
+ const { defaultValue, label, value, showOptions, onChange } = props, selectProps = __rest(props, ["defaultValue", "label", "value", "showOptions", "onChange"]);
18
+ const [selected, setSelected] = useState(defaultValue || value);
19
+ useEffect(() => {
20
+ setSelected(value === null || value === void 0 ? void 0 : value.toString());
21
+ }, [value]);
22
+ const textTransformOptions = useMemo(() => {
23
+ let draftFontFamily = [...OPTION_TEXT_TRANSFORM];
24
+ if (showOptions === null || showOptions === void 0 ? void 0 : showOptions.length) {
25
+ draftFontFamily = OPTION_TEXT_TRANSFORM.filter(({ label }) => showOptions.some(font => font === label));
26
+ }
27
+ return draftFontFamily;
28
+ }, [showOptions]);
29
+ const handleChange = (value) => {
30
+ if (onChange && typeof onChange === 'function') {
31
+ onChange(value);
32
+ }
33
+ };
34
+ return (React.createElement(SettingWrapper, { label: label !== null && label !== void 0 ? label : '', containerStyle: { width: '100%' }, vertical: true },
35
+ React.createElement(Select, Object.assign({ value: selected, options: [...textTransformOptions], style: { width: '100%' }, onChange: select => {
36
+ setSelected(select);
37
+ handleChange(select);
38
+ }, showSearch: true }, selectProps))));
39
+ };
@@ -1,12 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  export declare const TreeSelect: (<ValueType = any, OptionType extends import("rc-tree-select/lib/TreeSelect").BaseOptionType | import("rc-tree-select/lib/TreeSelect").DefaultOptionType = import("rc-tree-select/lib/TreeSelect").DefaultOptionType>(props: import("antd").TreeSelectProps<ValueType, OptionType> & {
3
3
  children?: import("react").ReactNode;
4
- } & {
5
- ref?: import("react").Ref<import("antd").RefSelectProps> | undefined;
6
- }) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
4
+ } & import("react").RefAttributes<import("antd").RefSelectProps>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
5
+ displayName?: string | undefined;
7
6
  TreeNode: import("react").FC<import("rc-tree-select/lib/TreeNode").TreeNodeProps>;
8
7
  SHOW_ALL: "SHOW_ALL";
9
8
  SHOW_PARENT: "SHOW_PARENT";
10
9
  SHOW_CHILD: "SHOW_CHILD";
11
- _InternalPanelDoNotUseOrYouWillBeFired: any;
10
+ _InternalPanelDoNotUseOrYouWillBeFired: (props: import("antd/es/_util/type").AnyObject) => import("react").JSX.Element;
12
11
  };
@@ -1,2 +1,3 @@
1
- declare const MediaIcon: (_props: any) => JSX.Element;
1
+ import React from 'react';
2
+ declare const MediaIcon: (_props: any) => React.JSX.Element;
2
3
  export default MediaIcon;
@@ -25,6 +25,14 @@ export { InputNumberWithUnit } from './InputNumberWithUnit';
25
25
  export { GradientSetting } from './GradientSetting';
26
26
  export { Collapse } from './Collapse';
27
27
  export { Drawer } from './Drawer';
28
+ export { SettingWrapperPopover } from './SettingWrapperPopover';
29
+ export { FontWeightSelect } from './FontWeightSelect';
30
+ export { FontFamilySelect } from './FontFamilySelect';
31
+ export { TextDecorationSelect } from './TextDecorationSelect';
32
+ export { TextTransformSelect } from './TextTransformSelect';
33
+ export { FontSetting, FontSettingEdit } from './FontSetting';
34
+ export { Form } from './Form';
28
35
  export type { AdvancedPickerProps, TAdvancedPickerOption, TAdvancedRangePickerTimeRange, } from './DatePicker';
29
36
  export type { ColorPickerProps } from './ColorPicker';
30
37
  export type { AlignEditProps, AlignSettingProps } from './AlignSetting';
38
+ export type { TFontSettingProps, TFontSettingEditProps } from './FontSetting';
@@ -25,3 +25,10 @@ export { InputNumberWithUnit } from './InputNumberWithUnit';
25
25
  export { GradientSetting } from './GradientSetting';
26
26
  export { Collapse } from './Collapse';
27
27
  export { Drawer } from './Drawer';
28
+ export { SettingWrapperPopover } from './SettingWrapperPopover';
29
+ export { FontWeightSelect } from './FontWeightSelect';
30
+ export { FontFamilySelect } from './FontFamilySelect';
31
+ export { TextDecorationSelect } from './TextDecorationSelect';
32
+ export { TextTransformSelect } from './TextTransformSelect';
33
+ export { FontSetting, FontSettingEdit } from './FontSetting';
34
+ export { Form } from './Form';
@@ -1,16 +1,10 @@
1
1
  /// <reference types="react" />
2
2
  export declare const DropDown: import("styled-components").StyledComponent<import("react").FC<import("antd").DropDownProps> & {
3
+ _InternalPanelDoNotUseOrYouWillBeFired: import("react").FC<import("antd").DropDownProps>;
4
+ } & {
3
5
  Button: import("react").FC<import("antd/es/dropdown").DropdownButtonProps>;
4
- _InternalPanelDoNotUseOrYouWillBeFired: (props: import("antd").DropDownProps) => JSX.Element;
5
6
  }, any, {}, never>;
6
- export declare const ButtonFeedback: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Partial<{
7
- href: string;
8
- target?: string | undefined;
9
- onClick?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
10
- } & import("antd/es/button/button").BaseButtonProps & Omit<import("react").AnchorHTMLAttributes<HTMLAnchorElement | HTMLButtonElement>, "type" | "onClick"> & {
11
- htmlType?: "button" | "reset" | "submit" | undefined;
12
- onClick?: import("react").MouseEventHandler<HTMLButtonElement> | undefined;
13
- } & Omit<import("react").ButtonHTMLAttributes<HTMLButtonElement>, "type" | "onClick">> & import("react").RefAttributes<HTMLElement>> & {
7
+ export declare const ButtonFeedback: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").ButtonProps & import("react").RefAttributes<HTMLElement>> & {
14
8
  Group: import("react").FC<import("antd/es/button").ButtonGroupProps>;
15
9
  }, any, {
16
10
  height?: number | undefined;
@@ -21,7 +15,7 @@ export declare const Overlay: import("styled-components").StyledComponent<"div",
21
15
  export declare const Text: import("styled-components").StyledComponent<"span", any, {}, never>;
22
16
  export declare const Label: import("styled-components").StyledComponent<"span", any, {}, never>;
23
17
  export declare const SendFeedback: import("styled-components").StyledComponent<"div", any, {}, never>;
24
- export declare const ControlGroup: import("styled-components").StyledComponent<import("react").FC<import("antd").SpaceProps> & {
18
+ export declare const ControlGroup: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").SpaceProps & import("react").RefAttributes<HTMLDivElement>> & {
25
19
  Compact: import("react").FC<import("antd/es/space/Compact").SpaceCompactProps>;
26
20
  }, any, {}, never>;
27
21
  export declare const ControlLabel: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/typography/Text").TextProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
@@ -64,15 +58,11 @@ export declare const TitleSearch: import("styled-components").StyledComponent<"s
64
58
  export declare const WrapperSearch: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd/es/input").SearchProps & import("react").RefAttributes<import("antd").InputRef>>, any, {}, never>;
65
59
  export declare const TreeContent: import("styled-components").StyledComponent<(<T extends import("rc-tree").BasicDataNode | import("antd").TreeDataNode = import("antd").TreeDataNode>(props: import("antd").TreeProps<T> & {
66
60
  children?: import("react").ReactNode;
67
- } & {
68
- ref?: import("react").Ref<import("rc-tree/lib/Tree").default<import("antd").TreeDataNode>> | undefined;
69
- }) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
61
+ } & import("react").RefAttributes<import("rc-tree/lib/Tree").default<import("antd").TreeDataNode>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
70
62
  TreeNode: import("react").FC<import("rc-tree").TreeNodeProps<import("antd").TreeDataNode>>;
71
63
  DirectoryTree: (<T_1 extends import("rc-tree").BasicDataNode | import("antd").TreeDataNode = import("antd").TreeDataNode>(props: import("antd/es/tree").DirectoryTreeProps<T_1> & {
72
64
  children?: import("react").ReactNode;
73
- } & {
74
- ref?: import("react").Ref<import("rc-tree/lib/Tree").default<import("antd").TreeDataNode>> | undefined;
75
- }) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
65
+ } & import("react").RefAttributes<import("rc-tree/lib/Tree").default<import("antd").TreeDataNode>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) & {
76
66
  displayName?: string | undefined;
77
67
  };
78
68
  }, any, {}, never>;
@@ -1,4 +1,5 @@
1
1
  export declare const StyledTable: import("styled-components").StyledComponent<import("antd/es/table/interface").RefTable & {
2
+ displayName?: string | undefined;
2
3
  SELECTION_COLUMN: {};
3
4
  EXPAND_COLUMN: {};
4
5
  SELECTION_ALL: "SELECT_ALL";
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  export declare const TABLE_API_COLUMNS: ({
2
3
  title: string;
3
4
  dataIndex: string;
@@ -7,5 +8,5 @@ export declare const TABLE_API_COLUMNS: ({
7
8
  title: string;
8
9
  dataIndex: string;
9
10
  key: string;
10
- render: (text: any) => JSX.Element;
11
+ render: (text: any) => React.JSX.Element;
11
12
  })[];
@@ -1,4 +1,4 @@
1
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
1
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
2
2
  // Types
3
3
  import { theme } from 'antd';
4
4
  // Variables
@@ -64,6 +64,7 @@ export const THEME = {
64
64
  accent2: '#dddddd',
65
65
  accent3: '#d2d2d2',
66
66
  accent5: '#999999',
67
+ gray5: '#d9d9d9',
67
68
  gold1,
68
69
  gold6,
69
70
  },
@@ -128,7 +129,9 @@ THEME.components = {
128
129
  controlHeight: 31,
129
130
  },
130
131
  Divider: {
131
- marginLG: 10,
132
+ marginLG: 15,
133
+ marginXL: 15,
134
+ colorSplit: (_r = THEME.token) === null || _r === void 0 ? void 0 : _r.accent3,
132
135
  },
133
136
  Checkbox: {
134
137
  controlInteractiveSize: 18,
@@ -141,6 +144,25 @@ THEME.components = {
141
144
  },
142
145
  Tabs: {
143
146
  colorPrimary: '#1F5FAC',
144
- margin: 20,
147
+ horizontalItemPadding: '10px 20px',
148
+ horizontalItemGutter: 0,
149
+ lineWidthBold: 3,
150
+ titleFontSize: 14,
151
+ titleFontSizeLG: 14,
152
+ titleFontSizeSM: 14,
153
+ horizontalMargin: '0px',
154
+ },
155
+ Collapse: {
156
+ headerBg: '#FFF',
157
+ borderRadiusLG: 0,
158
+ headerPadding: '15px 10px',
159
+ },
160
+ Switch: {
161
+ colorTextQuaternary: (_s = THEME.token) === null || _s === void 0 ? void 0 : _s.bw0,
162
+ colorTextTertiary: (_t = THEME.token) === null || _t === void 0 ? void 0 : _t.bw0,
163
+ handleSize: 12,
164
+ handleSizeSM: 7,
165
+ trackMinWidth: 30,
166
+ handleBg: (_u = THEME.token) === null || _u === void 0 ? void 0 : _u.colorPrimary,
145
167
  },
146
168
  };
package/es/test.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import '@antscorp/icons/main.css';
2
3
  export declare const BACKGROUND_COLOR_STYLE: {
3
4
  SOLID: {
@@ -10,4 +11,4 @@ export declare const BACKGROUND_COLOR_STYLE: {
10
11
  };
11
12
  };
12
13
  export declare const customColors: string[];
13
- export declare const App: () => JSX.Element;
14
+ export declare const App: () => React.JSX.Element;
package/es/test.js CHANGED
@@ -1,10 +1,13 @@
1
1
  /* eslint-disable @typescript-eslint/no-unused-vars */
2
2
  import React, { useState } from 'react';
3
- import ReactDOM from 'react-dom';
3
+ import { createRoot } from 'react-dom/client';
4
4
  import '@antscorp/icons/main.css';
5
- import { ColorSetting, ConfigProvider, EdgeSetting, IconSelection, InputNumberWithUnit, PositionSetting, RadioGroup, SettingWrapper, SliderWithInputNumber, Space, UploadImage, } from './components';
6
- // Constants
7
- import { THEME } from './constants';
5
+ import { ConfigProvider, EdgeSetting, GradientSetting, IconSelection, PositionSetting, SettingWrapper,
6
+ // Slider,
7
+ SliderWithInputNumber, Space, UploadImage, } from './components';
8
+ // import { Slider } from 'antd';
9
+ import { Slider } from '@antscorp/antsomi-ui/es/components/atoms/Slider';
10
+ import { Rate } from './components/atoms/Rate';
8
11
  export const BACKGROUND_COLOR_STYLE = {
9
12
  SOLID: {
10
13
  value: 'color',
@@ -28,7 +31,6 @@ export const customColors = [
28
31
  '#57b8c2',
29
32
  ];
30
33
  export const App = () => {
31
- var _a;
32
34
  const [state, setState] = useState({
33
35
  option: {
34
36
  dateType: 'today',
@@ -97,15 +99,7 @@ export const App = () => {
97
99
  React.createElement("h2", { style: { textAlign: 'center' } }, "Test component of media template"),
98
100
  React.createElement(Space, { size: 20, direction: "vertical" },
99
101
  React.createElement(SettingWrapper, { vertical: true, label: "Color Setting" },
100
- React.createElement(ColorSetting, { label: "Background Color", labelStyling: { color: (_a = THEME.token) === null || _a === void 0 ? void 0 : _a.colorIcon }, color: colorSettingState.color, customColors: colorSettingState.customColors, callback: callbackColorSetting, onChange: handleChangeColorSetting })),
101
- React.createElement(SettingWrapper, { vertical: true, label: "Input number with unit" },
102
- React.createElement(InputNumberWithUnit, { unit: "px", min: 0, max: 2000, value: 700, onChange: value => {
103
- console.log('onChange:: ', value);
104
- }, onChangeUnit: unit => {
105
- console.log('onChangeUnit:: ', unit);
106
- } })),
107
- React.createElement(SettingWrapper, { label: "Radio Group" },
108
- React.createElement(RadioGroup, { options: Object.values(BACKGROUND_COLOR_STYLE), value: radioValue, onChange: e => handleChangeRadio(e) })),
102
+ React.createElement(GradientSetting, null)),
109
103
  React.createElement(SliderWithInputNumber, { label: "Size (px)", labelStyling: { marginTop: 10 }, min: 0, max: 100, value: sliderValue, onAfterChange: handleChangeSlider }),
110
104
  React.createElement(EdgeSetting, { label: "Notification Spacing", unit: "px", linked: false, values: edge,
111
105
  // edgeLabels={[t(translations.column.title), t(translations.row.title)]}
@@ -140,29 +134,22 @@ export const App = () => {
140
134
  console.log('onChangeSvg', value);
141
135
  } }))))));
142
136
  // ------------------------ Media template components test end -------------------------
143
- // return (
144
- // <DatePicker.AdvancedRangePicker
145
- // disabled
146
- // showTime={false}
147
- // timeRange={{
148
- // startDate: {
149
- // date: '',
150
- // calculationDate: 'years',
151
- // value: 1,
152
- // calculationType: 'minus',
153
- // dateType: 'today',
154
- // },
155
- // endDate: {
156
- // date: '',
157
- // calculationDate: 'days',
158
- // value: 1,
159
- // calculationType: 'minus',
160
- // dateType: 'today',
161
- // },
162
- // }}
163
- // />
164
- // );
137
+ return (React.createElement("div", { style: { width: '500px', margin: '32px' } },
138
+ React.createElement(GradientSetting, { onChange: e => console.log('gradient change') }),
139
+ React.createElement("br", null),
140
+ React.createElement("br", null),
141
+ React.createElement("br", null),
142
+ React.createElement("br", null),
143
+ React.createElement(Slider, { className: "test-classname", min: -10, max: 10, onChange: e => console.log('slider change', e) }),
144
+ React.createElement("br", null),
145
+ React.createElement("br", null),
146
+ React.createElement(Rate, null),
147
+ React.createElement("br", null),
148
+ React.createElement("br", null),
149
+ React.createElement(Slider, { className: "test-classname" })));
165
150
  };
166
- ReactDOM.render(React.createElement(React.StrictMode, null,
167
- React.createElement(ConfigProvider, { locale: "vi" },
168
- React.createElement(App, null))), document.getElementById('root'));
151
+ const container = document.getElementById('root');
152
+ const root = createRoot(container);
153
+ root.render(React.createElement(React.StrictMode, null,
154
+ React.createElement(ConfigProvider, { locale: "en" },
155
+ React.createElement(App, null))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.3",
3
+ "version": "1.3.5",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",
@@ -19,6 +19,7 @@
19
19
  "unpkg": "dist/index.js",
20
20
  "types": "es/index.d.ts",
21
21
  "scripts": {
22
+ "publish": "npm run clean && npm run build:es",
22
23
  "build:es": "npm run copy-files && npm run ts-compile",
23
24
  "clean": "rimraf dist lib es",
24
25
  "dev": "vite",
@@ -65,7 +66,7 @@
65
66
  "@fortawesome/free-solid-svg-icons": "6.1.1",
66
67
  "@fortawesome/react-fontawesome": "0.2.0",
67
68
  "@tinymce/tinymce-react": "^3.7.0",
68
- "antd": "^5.3.2",
69
+ "antd": "5.12.6",
69
70
  "axios": "^1.4.0",
70
71
  "babel-plugin-file-loader": "^2.0.0",
71
72
  "dayjs": "^1.11.7",
@@ -73,6 +74,8 @@
73
74
  "highlight.js": "^11.8.0",
74
75
  "html-to-image": "^1.11.11",
75
76
  "html2canvas": "^1.4.1",
77
+ "i18next": "21.6.16",
78
+ "i18next-browser-languagedetector": "6.1.2",
76
79
  "lodash": "^4.17.21",
77
80
  "moment": "2.29.2",
78
81
  "qs": "6.10.3",
@@ -83,9 +86,7 @@
83
86
  "rehype-highlight": "^6.0.0",
84
87
  "remark-gfm": "^3.0.1",
85
88
  "ts-dedent": "^2.2.0",
86
- "tui-image-editor": "^3.15.3",
87
- "i18next": "21.6.16",
88
- "i18next-browser-languagedetector": "6.1.2"
89
+ "tui-image-editor": "^3.15.3"
89
90
  },
90
91
  "devDependencies": {
91
92
  "@ant-design/cssinjs": "^1.6.2",
Binary file
@@ -1 +0,0 @@
1
- export default __webpack_public_path__ + "/public/icons/d327b24e9c5d8f486f08d253aab58ce6.png";
Binary file
@@ -1 +0,0 @@
1
- export default __webpack_public_path__ + "/public/icons/725a52bd91a3ce534b10833df510e5fa.png";
@@ -1 +0,0 @@
1
- export default __webpack_public_path__ + "/public/icons/2d496b55d85a9545d7311c073af442bb.png";
@@ -1 +0,0 @@
1
- export default __webpack_public_path__ + "/public/icons/bb64e23a1ff390a416d765ee556096ab.svg";
Binary file