@antscorp/antsomi-ui 1.2.2-beta.7 → 1.2.3

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 (102) hide show
  1. package/CHANGELOG.md +77 -72
  2. package/README.md +78 -78
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.LICENSE.txt +0 -17
  5. package/dist/types/components/atoms/Button/Button.d.ts +1 -1
  6. package/dist/types/components/atoms/Button/Button.stories.d.ts +32 -32
  7. package/dist/types/components/atoms/Button/__tests__/Button.test.d.ts +1 -1
  8. package/dist/types/components/atoms/Button/index.d.ts +10 -10
  9. package/dist/types/components/atoms/Button/test.d.ts +3 -3
  10. package/dist/types/components/atoms/Checkbox/Checkbox.d.ts +1 -1
  11. package/dist/types/components/atoms/Checkbox/Checkbox.stories.d.ts +15 -15
  12. package/dist/types/components/atoms/Checkbox/__tests__/Checkbox.test.d.ts +1 -1
  13. package/dist/types/components/atoms/Checkbox/index.d.ts +1 -1
  14. package/dist/types/components/atoms/Divider/Divider.d.ts +1 -1
  15. package/dist/types/components/atoms/Divider/Divider.stories.d.ts +8 -8
  16. package/dist/types/components/atoms/Divider/index.d.ts +1 -1
  17. package/dist/types/components/atoms/Input/Input.d.ts +7 -7
  18. package/dist/types/components/atoms/Input/Input.stories.d.ts +19 -19
  19. package/dist/types/components/atoms/Input/__tests__/Input.test.d.ts +1 -1
  20. package/dist/types/components/atoms/Input/index.d.ts +1 -1
  21. package/dist/types/components/atoms/InputNumber/InputNumber.d.ts +6 -6
  22. package/dist/types/components/atoms/InputNumber/InputNumber.stories.d.ts +16 -16
  23. package/dist/types/components/atoms/InputNumber/__tests__/InputNumber.test.d.ts +1 -1
  24. package/dist/types/components/atoms/InputNumber/index.d.ts +1 -1
  25. package/dist/types/components/atoms/Radio/Radio.d.ts +1 -1
  26. package/dist/types/components/atoms/Radio/index.d.ts +1 -1
  27. package/dist/types/components/atoms/Space/Space.d.ts +1 -1
  28. package/dist/types/components/atoms/Space/index.d.ts +1 -1
  29. package/dist/types/components/atoms/Tag/Tag.d.ts +1 -1
  30. package/dist/types/components/atoms/Tag/index.d.ts +1 -1
  31. package/dist/types/components/atoms/Tooltip/Tooltip.d.ts +1 -1
  32. package/dist/types/components/atoms/Tooltip/index.d.ts +1 -1
  33. package/dist/types/components/atoms/Typography/Text.d.ts +1 -1
  34. package/dist/types/components/atoms/Typography/index.d.ts +1 -1
  35. package/dist/types/components/atoms/index.d.ts +10 -10
  36. package/dist/types/components/common/ConfigProvider/ConfigProvider.d.ts +10 -10
  37. package/dist/types/components/common/ConfigProvider/GlobalStyle.d.ts +5 -5
  38. package/dist/types/components/common/ConfigProvider/index.d.ts +1 -1
  39. package/dist/types/components/common/index.d.ts +1 -1
  40. package/dist/types/components/icons/EventIcon.d.ts +3 -3
  41. package/dist/types/components/icons/index.d.ts +1 -6
  42. package/dist/types/components/index.d.ts +4 -4
  43. package/dist/types/components/molecules/Alert/Alert.d.ts +1 -1
  44. package/dist/types/components/molecules/Alert/index.d.ts +1 -1
  45. package/dist/types/components/molecules/Cascader/Cascader.d.ts +1 -1
  46. package/dist/types/components/molecules/Cascader/index.d.ts +1 -1
  47. package/dist/types/components/molecules/CustomComponent/CustomComponent.d.ts +2 -2
  48. package/dist/types/components/molecules/CustomComponent/index.d.ts +1 -1
  49. package/dist/types/components/molecules/DatePicker/DatePicker.d.ts +8 -8
  50. package/dist/types/components/molecules/DatePicker/DatePicker.stories.d.ts +4 -4
  51. package/dist/types/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.d.ts +28 -28
  52. package/dist/types/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.stories.d.ts +5 -5
  53. package/dist/types/components/molecules/DatePicker/components/AdvancedPicker/constants.d.ts +53 -53
  54. package/dist/types/components/molecules/DatePicker/components/AdvancedPicker/index.d.ts +3 -3
  55. package/dist/types/components/molecules/DatePicker/components/AdvancedPicker/styled.d.ts +7 -7
  56. package/dist/types/components/molecules/DatePicker/components/AdvancedPicker/types.d.ts +14 -14
  57. package/dist/types/components/molecules/DatePicker/components/AdvancedPicker/utils.d.ts +15 -15
  58. package/dist/types/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.d.ts +15 -15
  59. package/dist/types/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.stories.d.ts +9 -9
  60. package/dist/types/components/molecules/DatePicker/components/AdvancedRangePicker/constants.d.ts +4 -4
  61. package/dist/types/components/molecules/DatePicker/components/AdvancedRangePicker/index.d.ts +2 -2
  62. package/dist/types/components/molecules/DatePicker/components/AdvancedRangePicker/types.d.ts +17 -17
  63. package/dist/types/components/molecules/DatePicker/index.d.ts +3 -3
  64. package/dist/types/components/molecules/Dropdown/Dropdown.d.ts +1 -1
  65. package/dist/types/components/molecules/Dropdown/index.d.ts +1 -1
  66. package/dist/types/components/molecules/Modal/Modal.d.ts +1 -1
  67. package/dist/types/components/molecules/Modal/index.d.ts +1 -1
  68. package/dist/types/components/molecules/Select/Select.d.ts +15 -15
  69. package/dist/types/components/molecules/Select/Select.stories.d.ts +28 -28
  70. package/dist/types/components/molecules/Select/Test.d.ts +3 -3
  71. package/dist/types/components/molecules/Select/index.d.ts +2 -2
  72. package/dist/types/components/molecules/Select/styled.d.ts +4 -4
  73. package/dist/types/components/molecules/index.d.ts +7 -9
  74. package/dist/types/components/organism/Table/Table.d.ts +1 -1
  75. package/dist/types/components/organism/Table/index.d.ts +1 -1
  76. package/dist/types/components/organism/index.d.ts +1 -1
  77. package/dist/types/constants/index.d.ts +1 -1
  78. package/dist/types/constants/theme.d.ts +12 -12
  79. package/dist/types/hooks/index.d.ts +2 -2
  80. package/dist/types/index.d.ts +1 -1
  81. package/dist/types/locales/i18n.d.ts +73 -73
  82. package/dist/types/locales/translations.d.ts +37 -37
  83. package/dist/types/locales/types.d.ts +15 -15
  84. package/dist/types/test.d.ts +3 -3
  85. package/dist/types/types/index.d.ts +6 -6
  86. package/dist/types/utils/common.d.ts +8 -8
  87. package/dist/types/utils/handleError.d.ts +2 -2
  88. package/package.json +122 -126
  89. package/dist/main.css +0 -9
  90. package/dist/types/components/icons/CloseIcon.d.ts +0 -3
  91. package/dist/types/components/icons/GPTIcon.d.ts +0 -1
  92. package/dist/types/components/icons/PlaneIcon.d.ts +0 -1
  93. package/dist/types/components/icons/UserIcon.d.ts +0 -1
  94. package/dist/types/components/icons/WarningIcon.d.ts +0 -1
  95. package/dist/types/components/molecules/ChatBox/ChatBox.d.ts +0 -5
  96. package/dist/types/components/molecules/ChatBox/ChatBox.stories.d.ts +0 -0
  97. package/dist/types/components/molecules/ChatBox/ask.d.ts +0 -3
  98. package/dist/types/components/molecules/ChatBox/constants.d.ts +0 -6
  99. package/dist/types/components/molecules/ChatBox/index.d.ts +0 -1
  100. package/dist/types/components/molecules/ChatBox/styled.d.ts +0 -8
  101. package/dist/types/components/molecules/ChatBox/types.d.ts +0 -22
  102. package/dist/types/components/molecules/ChatBox/utils.d.ts +0 -0
@@ -1,73 +1,73 @@
1
- export declare const translationsJson: {
2
- en: {
3
- translation: {
4
- global: {
5
- minus: string;
6
- plus: string;
7
- };
8
- button: {};
9
- datePicker: {
10
- startDate: string;
11
- endDate: string;
12
- dateTypes: {
13
- today: string;
14
- firstDayOfWeekMonSun: string;
15
- firstDayOfWeekSunSat: string;
16
- firstDayOfMonth: string;
17
- firstDayOfQuarter: string;
18
- firstDayOfYear: string;
19
- lastDayOfWeekMonSun: string;
20
- lastDayOfWeekSunSat: string;
21
- lastDayOfMonth: string;
22
- lastDayOfQuarter: string;
23
- lastDayOfYear: string;
24
- fixed: string;
25
- };
26
- seconds: string;
27
- minutes: string;
28
- hours: string;
29
- days: string;
30
- weeks: string;
31
- months: string;
32
- quarters: string;
33
- years: string;
34
- };
35
- };
36
- };
37
- vi: {
38
- translation: {
39
- global: {
40
- minus: string;
41
- plus: string;
42
- };
43
- button: {};
44
- datePicker: {
45
- startDate: string;
46
- endDate: string;
47
- dateTypes: {
48
- today: string;
49
- firstDayOfWeekMonSun: string;
50
- firstDayOfWeekSunSat: string;
51
- firstDayOfMonth: string;
52
- firstDayOfQuarter: string;
53
- firstDayOfYear: string;
54
- lastDayOfWeekMonSun: string;
55
- lastDayOfWeekSunSat: string;
56
- lastDayOfMonth: string;
57
- lastDayOfQuarter: string;
58
- lastDayOfYear: string;
59
- fixed: string;
60
- };
61
- seconds: string;
62
- minutes: string;
63
- hours: string;
64
- days: string;
65
- weeks: string;
66
- months: string;
67
- quarters: string;
68
- years: string;
69
- };
70
- };
71
- };
72
- };
73
- export declare const i18n: Promise<import("i18next").TFunction<"translation", undefined, "translation">>;
1
+ export declare const translationsJson: {
2
+ en: {
3
+ translation: {
4
+ global: {
5
+ minus: string;
6
+ plus: string;
7
+ };
8
+ button: {};
9
+ datePicker: {
10
+ startDate: string;
11
+ endDate: string;
12
+ dateTypes: {
13
+ today: string;
14
+ firstDayOfWeekMonSun: string;
15
+ firstDayOfWeekSunSat: string;
16
+ firstDayOfMonth: string;
17
+ firstDayOfQuarter: string;
18
+ firstDayOfYear: string;
19
+ lastDayOfWeekMonSun: string;
20
+ lastDayOfWeekSunSat: string;
21
+ lastDayOfMonth: string;
22
+ lastDayOfQuarter: string;
23
+ lastDayOfYear: string;
24
+ fixed: string;
25
+ };
26
+ seconds: string;
27
+ minutes: string;
28
+ hours: string;
29
+ days: string;
30
+ weeks: string;
31
+ months: string;
32
+ quarters: string;
33
+ years: string;
34
+ };
35
+ };
36
+ };
37
+ vi: {
38
+ translation: {
39
+ global: {
40
+ minus: string;
41
+ plus: string;
42
+ };
43
+ button: {};
44
+ datePicker: {
45
+ startDate: string;
46
+ endDate: string;
47
+ dateTypes: {
48
+ today: string;
49
+ firstDayOfWeekMonSun: string;
50
+ firstDayOfWeekSunSat: string;
51
+ firstDayOfMonth: string;
52
+ firstDayOfQuarter: string;
53
+ firstDayOfYear: string;
54
+ lastDayOfWeekMonSun: string;
55
+ lastDayOfWeekSunSat: string;
56
+ lastDayOfMonth: string;
57
+ lastDayOfQuarter: string;
58
+ lastDayOfYear: string;
59
+ fixed: string;
60
+ };
61
+ seconds: string;
62
+ minutes: string;
63
+ hours: string;
64
+ days: string;
65
+ weeks: string;
66
+ months: string;
67
+ quarters: string;
68
+ years: string;
69
+ };
70
+ };
71
+ };
72
+ };
73
+ export declare const i18n: Promise<import("i18next").TFunction<"translation", undefined, "translation">>;
@@ -1,37 +1,37 @@
1
- import { ConvertedToObjectType, TranslationJsonType } from './types';
2
- export declare const translations: ConvertedToObjectType<TranslationJsonType>;
3
- export declare const convertLanguageJsonToObject: (json: any, objToConvertTo?: ConvertedToObjectType<{
4
- global: {
5
- minus: string;
6
- plus: string;
7
- };
8
- button: {};
9
- datePicker: {
10
- startDate: string;
11
- endDate: string;
12
- dateTypes: {
13
- today: string;
14
- firstDayOfWeekMonSun: string;
15
- firstDayOfWeekSunSat: string;
16
- firstDayOfMonth: string;
17
- firstDayOfQuarter: string;
18
- firstDayOfYear: string;
19
- lastDayOfWeekMonSun: string;
20
- lastDayOfWeekSunSat: string;
21
- lastDayOfMonth: string;
22
- lastDayOfQuarter: string;
23
- lastDayOfYear: string;
24
- fixed: string;
25
- };
26
- seconds: string;
27
- minutes: string;
28
- hours: string;
29
- days: string;
30
- weeks: string;
31
- months: string;
32
- quarters: string;
33
- years: string;
34
- };
35
- }>, current?: string) => void;
36
- export declare const t: (id: string, ...rest: any[]) => [string, ...any[]];
37
- export declare const getTranslateMessage: (id: string, defaultMessage?: string, value?: Record<string, unknown>) => string;
1
+ import { ConvertedToObjectType, TranslationJsonType } from './types';
2
+ export declare const translations: ConvertedToObjectType<TranslationJsonType>;
3
+ export declare const convertLanguageJsonToObject: (json: any, objToConvertTo?: ConvertedToObjectType<{
4
+ global: {
5
+ minus: string;
6
+ plus: string;
7
+ };
8
+ button: {};
9
+ datePicker: {
10
+ startDate: string;
11
+ endDate: string;
12
+ dateTypes: {
13
+ today: string;
14
+ firstDayOfWeekMonSun: string;
15
+ firstDayOfWeekSunSat: string;
16
+ firstDayOfMonth: string;
17
+ firstDayOfQuarter: string;
18
+ firstDayOfYear: string;
19
+ lastDayOfWeekMonSun: string;
20
+ lastDayOfWeekSunSat: string;
21
+ lastDayOfMonth: string;
22
+ lastDayOfQuarter: string;
23
+ lastDayOfYear: string;
24
+ fixed: string;
25
+ };
26
+ seconds: string;
27
+ minutes: string;
28
+ hours: string;
29
+ days: string;
30
+ weeks: string;
31
+ months: string;
32
+ quarters: string;
33
+ years: string;
34
+ };
35
+ }>, current?: string) => void;
36
+ export declare const t: (id: string, ...rest: any[]) => [string, ...any[]];
37
+ export declare const getTranslateMessage: (id: string, defaultMessage?: string, value?: Record<string, unknown>) => string;
@@ -1,15 +1,15 @@
1
- export type ConvertedToObjectType<T> = {
2
- [P in keyof T]: T[P] extends string ? string : ConvertedToObjectType<T[P]>;
3
- };
4
- /**
5
-
6
- If you don't want non-existing keys to throw ts error you can simply do(also keeping the intellisense)
7
-
8
- export type ConvertedToObjectType<T> = {
9
- [P in keyof T]: T[P] extends string ? string : ConvertedToObjectType<T[P]>;
10
- } & {
11
- [P: string]: any;
12
- };
13
-
14
- */
15
- export type TranslationJsonType = typeof import('./en/translation.json');
1
+ export type ConvertedToObjectType<T> = {
2
+ [P in keyof T]: T[P] extends string ? string : ConvertedToObjectType<T[P]>;
3
+ };
4
+ /**
5
+
6
+ If you don't want non-existing keys to throw ts error you can simply do(also keeping the intellisense)
7
+
8
+ export type ConvertedToObjectType<T> = {
9
+ [P in keyof T]: T[P] extends string ? string : ConvertedToObjectType<T[P]>;
10
+ } & {
11
+ [P: string]: any;
12
+ };
13
+
14
+ */
15
+ export type TranslationJsonType = typeof import('./en/translation.json');
@@ -1,3 +1,3 @@
1
- /// <reference types="react" />
2
- import '@antscorp/icons/main.css';
3
- export declare const App: () => JSX.Element;
1
+ /// <reference types="react" />
2
+ import '@antscorp/icons/main.css';
3
+ export declare const App: () => JSX.Element;
@@ -1,6 +1,6 @@
1
- export type THandleErrorPayload = {
2
- path: string;
3
- name: string;
4
- args: Record<string, any>;
5
- };
6
- export type TLocale = 'en' | 'vi';
1
+ export type THandleErrorPayload = {
2
+ path: string;
3
+ name: string;
4
+ args: Record<string, any>;
5
+ };
6
+ export type TLocale = 'en' | 'vi';
@@ -1,8 +1,8 @@
1
- /**
2
- * Function to reorder list
3
- * @param {Object[]} list - list of item want to reorder
4
- * @param {number} startIndex - start item index want to replace position: ;
5
- * @param {number} endIndex - end item index want to replace position: ;
6
- * @returns {object[]}
7
- */
8
- export declare const reorder: (list: Array<Record<string, unknown> | string | number>, startIndex: number, endIndex: number) => any[];
1
+ /**
2
+ * Function to reorder list
3
+ * @param {Object[]} list - list of item want to reorder
4
+ * @param {number} startIndex - start item index want to replace position: ;
5
+ * @param {number} endIndex - end item index want to replace position: ;
6
+ * @returns {object[]}
7
+ */
8
+ export declare const reorder: (list: Array<Record<string, unknown> | string | number>, startIndex: number, endIndex: number) => any[];
@@ -1,2 +1,2 @@
1
- import { THandleErrorPayload } from 'src/types';
2
- export declare const handleError: (error: any, payload: THandleErrorPayload) => void;
1
+ import { THandleErrorPayload } from 'src/types';
2
+ export declare const handleError: (error: any, payload: THandleErrorPayload) => void;
package/package.json CHANGED
@@ -1,126 +1,122 @@
1
- {
2
- "name": "@antscorp/antsomi-ui",
3
- "version": "1.2.2-beta.7",
4
- "description": "An enterprise-class UI design language and React UI library.",
5
- "main": "dist/index.js",
6
- "files": [
7
- "dist"
8
- ],
9
- "types": "dist/types",
10
- "scripts": {
11
- "dev": "vite",
12
- "build": "webpack --config webpack.build.js",
13
- "eslint": "eslint --ext js,ts,tsx",
14
- "lint": "yarn run eslint src",
15
- "lint:fix": "yarn run eslint src --fix",
16
- "storybook": "start-storybook -p 6006 -s public",
17
- "build-storybook": "build-storybook",
18
- "serve-storybook": "serve storybook-static",
19
- "version": "auto-changelog -p && git add CHANGELOG.md",
20
- "test": "jest",
21
- "test:changed": "jest --onlyChanged",
22
- "test:watch": "jest --watch",
23
- "test:coverage": "jest --coverage"
24
- },
25
- "husky": {
26
- "hooks": {
27
- "pre-commit": "lint-staged"
28
- }
29
- },
30
- "lint-staged": {
31
- "*.{ts,tsx,js,jsx}": [
32
- "yarn lint:fix"
33
- ]
34
- },
35
- "author": "",
36
- "license": "MIT",
37
- "dependencies": {
38
- "antd": "^5.3.2",
39
- "dayjs": "^1.11.7",
40
- "highlight.js": "^11.8.0",
41
- "lodash": "^4.17.21",
42
- "react-markdown": "^8.0.7",
43
- "rehype-highlight": "^6.0.0",
44
- "remark-gfm": "^3.0.1",
45
- "ts-dedent": "^2.2.0"
46
- },
47
- "devDependencies": {
48
- "@ant-design/cssinjs": "^1.6.2",
49
- "@antscorp/eslint-config-antsomi": "1.0.4",
50
- "@antscorp/icons": "^0.26.47",
51
- "@babel/core": "^7.21.3",
52
- "@babel/preset-env": "^7.20.2",
53
- "@babel/preset-react": "^7.18.6",
54
- "@commitlint/cli": "17.5.0",
55
- "@commitlint/config-conventional": "17.4.4",
56
- "@emotion/react": "^11.10.6",
57
- "@storybook/addon-actions": "^6.5.16",
58
- "@storybook/addon-essentials": "^6.5.16",
59
- "@storybook/addon-interactions": "^6.5.16",
60
- "@storybook/addon-links": "^6.5.16",
61
- "@storybook/addon-postcss": "^2.0.0",
62
- "@storybook/builder-webpack5": "^6.5.16",
63
- "@storybook/manager-webpack5": "^6.5.16",
64
- "@storybook/react": "^6.5.16",
65
- "@storybook/testing-library": "^0.0.13",
66
- "@testing-library/jest-dom": "^5.16.5",
67
- "@testing-library/react": "^14.0.0",
68
- "@types/jest": "^29.5.0",
69
- "@types/node": "^18.15.10",
70
- "@types/react": "^18.0.33",
71
- "@types/react-dom": "^18.0.11",
72
- "@types/react-test-renderer": "^18.0.0",
73
- "@types/styled-components": "^5.1.26",
74
- "@typescript-eslint/eslint-plugin": "^5.55.0",
75
- "@typescript-eslint/parser": "^5.55.0",
76
- "@vitejs/plugin-react": "^3.1.0",
77
- "auto-changelog": "^2.4.0",
78
- "babel-loader": "^8.3.0",
79
- "clsx": "^1.2.1",
80
- "css-loader": "^6.7.3",
81
- "date-fns": "^2.29.3",
82
- "eslint": "^8.36.0",
83
- "eslint-config-airbnb": "^19.0.4",
84
- "eslint-config-airbnb-typescript": "^17.0.0",
85
- "eslint-config-prettier": "^8.8.0",
86
- "eslint-plugin-import": "^2.27.5",
87
- "eslint-plugin-jsx-a11y": "^6.7.1",
88
- "eslint-plugin-prettier": "^4.2.1",
89
- "eslint-plugin-react": "^7.32.2",
90
- "eslint-plugin-react-hooks": "^4.6.0",
91
- "eslint-plugin-storybook": "^0.6.11",
92
- "file-loader": "^6.2.0",
93
- "husky": "^8.0.3",
94
- "i18next": "^22.4.14",
95
- "i18next-browser-languagedetector": "^7.0.1",
96
- "jest": "^29.5.0",
97
- "jest-environment-jsdom": "^29.5.0",
98
- "lint-staged": "^13.2.0",
99
- "mini-css-extract-plugin": "^2.7.5",
100
- "postcss": "^8.4.21",
101
- "postcss-loader": "^7.1.0",
102
- "prettier": "^2.8.7",
103
- "react": "18.2.0",
104
- "react-dom": "18.2.0",
105
- "react-fast-compare": "^3.2.1",
106
- "react-i18next": "^12.2.0",
107
- "sass": "^1.60.0",
108
- "sass-loader": "^13.2.2",
109
- "style-loader": "^3.3.2",
110
- "styled-components": "^5.3.9",
111
- "terser-webpack-plugin": "^5.3.7",
112
- "ts-jest": "^29.1.0",
113
- "ts-loader": "^9.4.2",
114
- "ts-node": "^10.9.1",
115
- "tsconfig-paths-webpack-plugin": "^4.0.1",
116
- "typescript": "^4.9.4",
117
- "vite": "^4.2.1",
118
- "webpack": "^5.78.0",
119
- "webpack-cli": "^5.0.1"
120
- },
121
- "peerDependencies": {
122
- "@antscorp/icons": ">=0.26.0",
123
- "react": ">=16.9.0",
124
- "react-dom": ">=16.9.0"
125
- }
126
- }
1
+ {
2
+ "name": "@antscorp/antsomi-ui",
3
+ "version": "1.2.3",
4
+ "description": "An enterprise-class UI design language and React UI library.",
5
+ "main": "dist/index.js",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "types": "dist/types",
10
+ "scripts": {
11
+ "dev": "vite",
12
+ "build": "webpack --config webpack.build.js",
13
+ "eslint": "eslint --ext js,ts,tsx",
14
+ "lint": "yarn run eslint src",
15
+ "lint:fix": "yarn run eslint src --fix",
16
+ "storybook": "start-storybook -p 6006 -s public",
17
+ "build-storybook": "build-storybook",
18
+ "serve-storybook": "serve storybook-static",
19
+ "version": "auto-changelog -p && git add CHANGELOG.md",
20
+ "test": "jest",
21
+ "test:changed": "jest --onlyChanged",
22
+ "test:watch": "jest --watch",
23
+ "test:coverage": "jest --coverage"
24
+ },
25
+ "husky": {
26
+ "hooks": {
27
+ "pre-commit": "lint-staged"
28
+ }
29
+ },
30
+ "lint-staged": {
31
+ "*.{ts,tsx,js,jsx}": [
32
+ "yarn lint:fix"
33
+ ]
34
+ },
35
+ "author": "",
36
+ "license": "MIT",
37
+ "dependencies": {
38
+ "antd": "^5.3.2",
39
+ "dayjs": "^1.11.7",
40
+ "lodash": "^4.17.21",
41
+ "ts-dedent": "^2.2.0"
42
+ },
43
+ "devDependencies": {
44
+ "@ant-design/cssinjs": "^1.6.2",
45
+ "@antscorp/eslint-config-antsomi": "1.0.4",
46
+ "@antscorp/icons": "^0.26.47",
47
+ "@babel/core": "^7.21.3",
48
+ "@babel/preset-env": "^7.20.2",
49
+ "@babel/preset-react": "^7.18.6",
50
+ "@commitlint/cli": "17.5.0",
51
+ "@commitlint/config-conventional": "17.4.4",
52
+ "@emotion/react": "^11.10.6",
53
+ "@storybook/addon-actions": "^6.5.16",
54
+ "@storybook/addon-essentials": "^6.5.16",
55
+ "@storybook/addon-interactions": "^6.5.16",
56
+ "@storybook/addon-links": "^6.5.16",
57
+ "@storybook/addon-postcss": "^2.0.0",
58
+ "@storybook/builder-webpack5": "^6.5.16",
59
+ "@storybook/manager-webpack5": "^6.5.16",
60
+ "@storybook/react": "^6.5.16",
61
+ "@storybook/testing-library": "^0.0.13",
62
+ "@testing-library/jest-dom": "^5.16.5",
63
+ "@testing-library/react": "^14.0.0",
64
+ "@types/jest": "^29.5.0",
65
+ "@types/node": "^18.15.10",
66
+ "@types/react": "^18.0.33",
67
+ "@types/react-dom": "^18.0.11",
68
+ "@types/react-test-renderer": "^18.0.0",
69
+ "@types/styled-components": "^5.1.26",
70
+ "@typescript-eslint/eslint-plugin": "^5.55.0",
71
+ "@typescript-eslint/parser": "^5.55.0",
72
+ "@vitejs/plugin-react": "^3.1.0",
73
+ "auto-changelog": "^2.4.0",
74
+ "babel-loader": "^8.3.0",
75
+ "clsx": "^1.2.1",
76
+ "css-loader": "^6.7.3",
77
+ "date-fns": "^2.29.3",
78
+ "eslint": "^8.36.0",
79
+ "eslint-config-airbnb": "^19.0.4",
80
+ "eslint-config-airbnb-typescript": "^17.0.0",
81
+ "eslint-config-prettier": "^8.8.0",
82
+ "eslint-plugin-import": "^2.27.5",
83
+ "eslint-plugin-jsx-a11y": "^6.7.1",
84
+ "eslint-plugin-prettier": "^4.2.1",
85
+ "eslint-plugin-react": "^7.32.2",
86
+ "eslint-plugin-react-hooks": "^4.6.0",
87
+ "eslint-plugin-storybook": "^0.6.11",
88
+ "file-loader": "^6.2.0",
89
+ "husky": "^8.0.3",
90
+ "i18next": "^22.4.14",
91
+ "i18next-browser-languagedetector": "^7.0.1",
92
+ "jest": "^29.5.0",
93
+ "jest-environment-jsdom": "^29.5.0",
94
+ "lint-staged": "^13.2.0",
95
+ "mini-css-extract-plugin": "^2.7.5",
96
+ "postcss": "^8.4.21",
97
+ "postcss-loader": "^7.1.0",
98
+ "prettier": "^2.8.7",
99
+ "react": "18.2.0",
100
+ "react-dom": "18.2.0",
101
+ "react-fast-compare": "^3.2.1",
102
+ "react-i18next": "^12.2.0",
103
+ "sass": "^1.60.0",
104
+ "sass-loader": "^13.2.2",
105
+ "style-loader": "^3.3.2",
106
+ "styled-components": "^5.3.9",
107
+ "terser-webpack-plugin": "^5.3.7",
108
+ "ts-jest": "^29.1.0",
109
+ "ts-loader": "^9.4.2",
110
+ "ts-node": "^10.9.1",
111
+ "tsconfig-paths-webpack-plugin": "^4.0.1",
112
+ "typescript": "^4.9.4",
113
+ "vite": "^4.2.1",
114
+ "webpack": "^5.78.0",
115
+ "webpack-cli": "^5.0.1"
116
+ },
117
+ "peerDependencies": {
118
+ "@antscorp/icons": ">=0.26.0",
119
+ "react": ">=16.9.0",
120
+ "react-dom": ">=16.9.0"
121
+ }
122
+ }
package/dist/main.css DELETED
@@ -1,9 +0,0 @@
1
- pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#1e1e1e;color:#dcdcdc}.hljs-keyword,.hljs-literal,.hljs-name,.hljs-symbol{color:#569cd6}.hljs-link{color:#569cd6;text-decoration:underline}.hljs-built_in,.hljs-type{color:#4ec9b0}.hljs-class,.hljs-number{color:#b8d7a3}.hljs-meta .hljs-string,.hljs-string{color:#d69d85}.hljs-regexp,.hljs-template-tag{color:#9a5334}.hljs-formula,.hljs-function,.hljs-params,.hljs-subst,.hljs-title{color:#dcdcdc}.hljs-comment,.hljs-quote{color:#57a64a;font-style:italic}.hljs-doctag{color:#608b4e}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-tag{color:#9b9b9b}.hljs-template-variable,.hljs-variable{color:#bd63c5}.hljs-attr,.hljs-attribute{color:#9cdcfe}.hljs-section{color:gold}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-bullet,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-selector-pseudo,.hljs-selector-tag{color:#d7ba7d}.hljs-addition{background-color:#144212;display:inline-block;width:100%}.hljs-deletion{background-color:#600;display:inline-block;width:100%}
2
- .KGc1EPYUUD9g4R6Ib_jB p {
3
- font-size: 14px;
4
- }
5
-
6
- .KGc1EPYUUD9g4R6Ib_jB > p:first-child {
7
- margin-top: 0 !important;
8
- }
9
- .chat{display:flex;flex-direction:column;height:100%;padding:2rem;border-radius:1rem;border:1px solid #ddd;box-shadow:0 4px 6px rgba(49,54,68,.05),0 5px 20px rgba(49,54,68,.08)}.logs{flex:1;overflow-y:auto;margin-bottom:1rem}.log{gap:.4rem;display:flex;flex-direction:column}@keyframes blink{to{visibility:hidden}}​.streaming>div{white-space:pre-wrap}.streaming>div>:not(ol):not(ul):not(pre):last-child:after,.streaming>div>ol:last-child li:last-child:after,.streaming>div>pre:last-child code:after,.streaming>div>ul:last-child li:last-child:after{-webkit-animation:blink 1s steps(5, start) infinite;animation:blink 1s steps(5, start) infinite;content:"▋";margin-left:.25rem;vertical-align:baseline}
@@ -1,3 +0,0 @@
1
- export declare const CloseIcon: ({ ...props }: {
2
- [x: string]: any;
3
- }) => JSX.Element;
@@ -1 +0,0 @@
1
- export declare const GPTIcon: () => JSX.Element;
@@ -1 +0,0 @@
1
- export declare const PlaneIcon: (props: any) => JSX.Element;
@@ -1 +0,0 @@
1
- export declare const UserIcon: (props: any) => JSX.Element;
@@ -1 +0,0 @@
1
- export declare const WarningIcon: (props: any) => JSX.Element;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import 'highlight.js/styles/vs2015.css';
3
- import { IChatBoxProps } from './types';
4
- import './style.scss';
5
- export declare const ChatBox: React.FC<IChatBoxProps>;
@@ -1,3 +0,0 @@
1
- import type { Message } from './types';
2
- declare const ask: (onMessage: (data: string | null) => void, messages: Partial<Message>[], token?: string) => Promise<void>;
3
- export default ask;
@@ -1,6 +0,0 @@
1
- import { Role } from "./types";
2
- export declare const CONVERSATION: {
3
- role: Role;
4
- content: string;
5
- }[];
6
- export declare const LIMIT_MESSAGE = 30;
@@ -1 +0,0 @@
1
- export { ChatBox } from './ChatBox';
@@ -1,8 +0,0 @@
1
- export declare const ChatBoxWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- export declare const ChatBoxHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- export declare const ChatBoxBody: import("styled-components").StyledComponent<"div", any, {}, never>;
4
- export declare const ChatBoxFooter: import("styled-components").StyledComponent<"div", any, {}, never>;
5
- export declare const MessageItemWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
6
- export declare const WarningWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
7
- export declare const InputWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
8
- export declare const TypingCursor: import("styled-components").StyledComponent<"div", any, {}, never>;