@alifd/chat 0.3.32 → 0.3.33-beta.0

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.
@@ -0,0 +1,363 @@
1
+ .next-sr-only {
2
+ position: absolute;
3
+ width: 1px;
4
+ height: 1px;
5
+ padding: 0;
6
+ overflow: hidden;
7
+ clip: rect(0, 0, 0, 0);
8
+ white-space: nowrap;
9
+ border: 0;
10
+ top: 0;
11
+ margin: -1px;
12
+ }
13
+
14
+ .next-icon[dir=rtl]::before {
15
+ transform: rotateY(180deg);
16
+ }
17
+
18
+ @font-face {
19
+ font-family: ChatNextIcon;
20
+ src: url("//at.alicdn.com/t/font_515771_xjdbujl2iu.eot");
21
+ src: url("//at.alicdn.com/t/font_515771_xjdbujl2iu.eot?#iefix") format("embedded-opentype"), url("//at.alicdn.com/t/font_515771_xjdbujl2iu.woff2") format("woff2"), url("//at.alicdn.com/t/font_515771_xjdbujl2iu.woff") format("woff"), url("//at.alicdn.com/t/font_515771_xjdbujl2iu.ttf") format("truetype"), url("//at.alicdn.com/t/font_515771_xjdbujl2iu.svg#NextIcon") format("svg");
22
+ font-display: swap;
23
+ }
24
+
25
+ .ct-icon {
26
+ font-family: ChatNextIcon !important;
27
+ }
28
+
29
+ .next-icon {
30
+ display: inline-block;
31
+ font-family: NextIcon;
32
+ font-style: normal;
33
+ font-weight: normal;
34
+ text-transform: none;
35
+ -webkit-font-smoothing: antialiased;
36
+ -moz-osx-font-smoothing: grayscale;
37
+ }
38
+
39
+ .next-icon:before {
40
+ display: inline-block;
41
+ vertical-align: middle;
42
+ text-align: center;
43
+ }
44
+ .next-icon-smile:before {
45
+ content: "\e65f";
46
+ content: var(--icon-content-smile, "\e65f");
47
+ }
48
+ .next-icon-cry:before {
49
+ content: "\e65d";
50
+ content: var(--icon-content-cry, "\e65d");
51
+ }
52
+ .next-icon-success:before {
53
+ content: "\e60a";
54
+ content: var(--icon-content-success, "\e60a");
55
+ }
56
+ .next-icon-warning:before {
57
+ content: "\e60b";
58
+ content: var(--icon-content-warning, "\e60b");
59
+ }
60
+ .next-icon-prompt:before {
61
+ content: "\e60c";
62
+ content: var(--icon-content-prompt, "\e60c");
63
+ }
64
+ .next-icon-error:before {
65
+ content: "\e60d";
66
+ content: var(--icon-content-error, "\e60d");
67
+ }
68
+ .next-icon-help:before {
69
+ content: "\e673";
70
+ content: var(--icon-content-help, "\e673");
71
+ }
72
+ .next-icon-clock:before {
73
+ content: "\e621";
74
+ content: var(--icon-content-clock, "\e621");
75
+ }
76
+ .next-icon-success-filling:before {
77
+ content: "\e63a";
78
+ content: var(--icon-content-success-filling, "\e63a");
79
+ }
80
+ .next-icon-delete-filling:before {
81
+ content: "\e623";
82
+ content: var(--icon-content-delete-filling, "\e623");
83
+ }
84
+ .next-icon-favorites-filling:before {
85
+ content: "\e60e";
86
+ content: var(--icon-content-favorites-filling, "\e60e");
87
+ }
88
+ .next-icon-add:before {
89
+ content: "\e655";
90
+ content: var(--icon-content-add, "\e655");
91
+ }
92
+ .next-icon-minus:before {
93
+ content: "\e601";
94
+ content: var(--icon-content-minus, "\e601");
95
+ }
96
+ .next-icon-arrow-up:before {
97
+ content: "\e625";
98
+ content: var(--icon-content-arrow-up, "\e625");
99
+ }
100
+ .next-icon-arrow-down:before {
101
+ content: "\e63d";
102
+ content: var(--icon-content-arrow-down, "\e63d");
103
+ }
104
+ .next-icon-arrow-left:before {
105
+ content: "\e61d";
106
+ content: var(--icon-content-arrow-left, "\e61d");
107
+ }
108
+ .next-icon-arrow-right:before {
109
+ content: "\e619";
110
+ content: var(--icon-content-arrow-right, "\e619");
111
+ }
112
+ .next-icon-arrow-double-left:before {
113
+ content: "\e659";
114
+ content: var(--icon-content-arrow-double-left, "\e659");
115
+ }
116
+ .next-icon-arrow-double-right:before {
117
+ content: "\e65e";
118
+ content: var(--icon-content-arrow-double-right, "\e65e");
119
+ }
120
+ .next-icon-switch:before {
121
+ content: "\e6b3";
122
+ content: var(--icon-content-switch, "\e6b3");
123
+ }
124
+ .next-icon-sorting:before {
125
+ content: "\e634";
126
+ content: var(--icon-content-sorting, "\e634");
127
+ }
128
+ .next-icon-descending:before {
129
+ content: "\e61f";
130
+ content: var(--icon-content-descending, "\e61f");
131
+ }
132
+ .next-icon-ascending:before {
133
+ content: "\e61e";
134
+ content: var(--icon-content-ascending, "\e61e");
135
+ }
136
+ .next-icon-select:before {
137
+ content: "\e632";
138
+ content: var(--icon-content-select, "\e632");
139
+ }
140
+ .next-icon-semi-select:before {
141
+ content: "\e633";
142
+ content: var(--icon-content-semi-select, "\e633");
143
+ }
144
+ .next-icon-search:before {
145
+ content: "\e656";
146
+ content: var(--icon-content-search, "\e656");
147
+ }
148
+ .next-icon-close:before {
149
+ content: "\e626";
150
+ content: var(--icon-content-close, "\e626");
151
+ }
152
+ .next-icon-ellipsis:before {
153
+ content: "\e654";
154
+ content: var(--icon-content-ellipsis, "\e654");
155
+ }
156
+ .next-icon-picture:before {
157
+ content: "\e631";
158
+ content: var(--icon-content-picture, "\e631");
159
+ }
160
+ .next-icon-calendar:before {
161
+ content: "\e607";
162
+ content: var(--icon-content-calendar, "\e607");
163
+ }
164
+ .next-icon-ashbin:before {
165
+ content: "\e639";
166
+ content: var(--icon-content-ashbin, "\e639");
167
+ }
168
+ .next-icon-upload:before {
169
+ content: "\e7ee";
170
+ content: var(--icon-content-upload, "\e7ee");
171
+ }
172
+ .next-icon-download:before {
173
+ content: "\e628";
174
+ content: var(--icon-content-download, "\e628");
175
+ }
176
+ .next-icon-set:before {
177
+ content: "\e683";
178
+ content: var(--icon-content-set, "\e683");
179
+ }
180
+ .next-icon-edit:before {
181
+ content: "\e63b";
182
+ content: var(--icon-content-edit, "\e63b");
183
+ }
184
+ .next-icon-refresh:before {
185
+ content: "\e677";
186
+ content: var(--icon-content-refresh, "\e677");
187
+ }
188
+ .next-icon-filter:before {
189
+ content: "\e627";
190
+ content: var(--icon-content-filter, "\e627");
191
+ }
192
+ .next-icon-attachment:before {
193
+ content: "\e665";
194
+ content: var(--icon-content-attachment, "\e665");
195
+ }
196
+ .next-icon-account:before {
197
+ content: "\e608";
198
+ content: var(--icon-content-account, "\e608");
199
+ }
200
+ .next-icon-email:before {
201
+ content: "\e605";
202
+ content: var(--icon-content-email, "\e605");
203
+ }
204
+ .next-icon-atm:before {
205
+ content: "\e606";
206
+ content: var(--icon-content-atm, "\e606");
207
+ }
208
+ .next-icon-loading:before {
209
+ content: "\e646";
210
+ content: var(--icon-content-loading, "\e646");
211
+ animation: loadingCircle 1s infinite linear;
212
+ }
213
+ .next-icon-eye:before {
214
+ content: "\e611";
215
+ content: var(--icon-content-eye, "\e611");
216
+ }
217
+ .next-icon-copy:before {
218
+ content: "\e60f";
219
+ content: var(--icon-content-copy, "\e60f");
220
+ }
221
+ .next-icon-toggle-left:before {
222
+ content: "\e602";
223
+ content: var(--icon-content-toggle-left, "\e602");
224
+ }
225
+ .next-icon-toggle-right:before {
226
+ content: "\e603";
227
+ content: var(--icon-content-toggle-right, "\e603");
228
+ }
229
+ .next-icon-eye-close:before {
230
+ content: "\e600";
231
+ content: var(--icon-content-eye-close, "\e600");
232
+ }
233
+ .next-icon-unlock:before {
234
+ content: "\e615";
235
+ content: var(--icon-content-unlock, "\e615");
236
+ }
237
+ .next-icon-lock:before {
238
+ content: "\e617";
239
+ content: var(--icon-content-lock, "\e617");
240
+ }
241
+ .next-icon-exit:before {
242
+ content: "\e616";
243
+ content: var(--icon-content-exit, "\e616");
244
+ }
245
+ .next-icon-chart-bar:before {
246
+ content: "\e612";
247
+ content: var(--icon-content-chart-bar, "\e612");
248
+ }
249
+ .next-icon-chart-pie:before {
250
+ content: "\e613";
251
+ content: var(--icon-content-chart-pie, "\e613");
252
+ }
253
+ .next-icon-form:before {
254
+ content: "\e7fb";
255
+ content: var(--icon-content-form, "\e7fb");
256
+ }
257
+ .next-icon-detail:before {
258
+ content: "\e7f8";
259
+ content: var(--icon-content-detail, "\e7f8");
260
+ }
261
+ .next-icon-list:before {
262
+ content: "\e7f9";
263
+ content: var(--icon-content-list, "\e7f9");
264
+ }
265
+ .next-icon-dashboard:before {
266
+ content: "\e7fa";
267
+ content: var(--icon-content-dashboard, "\e7fa");
268
+ }
269
+
270
+ @keyframes loadingCircle {
271
+ 0% {
272
+ transform-origin: 50% 50%;
273
+ transform: rotate(0deg);
274
+ }
275
+ 100% {
276
+ transform-origin: 50% 50%;
277
+ transform: rotate(360deg);
278
+ }
279
+ }
280
+ .next-icon.next-xxs:before, .next-icon.next-xxs .next-icon-remote {
281
+ width: 8px;
282
+ width: var(--icon-xxs, 8px);
283
+ font-size: 8px;
284
+ font-size: var(--icon-xxs, 8px);
285
+ line-height: inherit;
286
+ }
287
+ @media all and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: 0.001dpcm) {
288
+ .next-icon.next-xxs {
289
+ transform: scale(0.5);
290
+ margin-left: -4px;
291
+ margin-left: calc(0px - var(--icon-s, 16px)/2 + var(--icon-xxs, 8px)/2);
292
+ margin-right: -4px;
293
+ margin-right: calc(0px - var(--icon-s, 16px)/2 + var(--icon-xxs, 8px)/2);
294
+ }
295
+ .next-icon.next-xxs:before {
296
+ width: 16px;
297
+ width: var(--icon-s, 16px);
298
+ font-size: 16px;
299
+ font-size: var(--icon-s, 16px);
300
+ }
301
+ }
302
+ .next-icon.next-xs:before, .next-icon.next-xs .next-icon-remote {
303
+ width: 12px;
304
+ width: var(--icon-xs, 12px);
305
+ font-size: 12px;
306
+ font-size: var(--icon-xs, 12px);
307
+ line-height: inherit;
308
+ }
309
+ .next-icon.next-small:before, .next-icon.next-small .next-icon-remote {
310
+ width: 16px;
311
+ width: var(--icon-s, 16px);
312
+ font-size: 16px;
313
+ font-size: var(--icon-s, 16px);
314
+ line-height: inherit;
315
+ }
316
+ .next-icon.next-medium:before, .next-icon.next-medium .next-icon-remote {
317
+ width: 20px;
318
+ width: var(--icon-m, 20px);
319
+ font-size: 20px;
320
+ font-size: var(--icon-m, 20px);
321
+ line-height: inherit;
322
+ }
323
+ .next-icon.next-large:before, .next-icon.next-large .next-icon-remote {
324
+ width: 24px;
325
+ width: var(--icon-l, 24px);
326
+ font-size: 24px;
327
+ font-size: var(--icon-l, 24px);
328
+ line-height: inherit;
329
+ }
330
+ .next-icon.next-xl:before, .next-icon.next-xl .next-icon-remote {
331
+ width: 32px;
332
+ width: var(--icon-xl, 32px);
333
+ font-size: 32px;
334
+ font-size: var(--icon-xl, 32px);
335
+ line-height: inherit;
336
+ }
337
+ .next-icon.next-xxl:before, .next-icon.next-xxl .next-icon-remote {
338
+ width: 48px;
339
+ width: var(--icon-xxl, 48px);
340
+ font-size: 48px;
341
+ font-size: var(--icon-xxl, 48px);
342
+ line-height: inherit;
343
+ }
344
+ .next-icon.next-xxxl:before, .next-icon.next-xxxl .next-icon-remote {
345
+ width: 64px;
346
+ width: var(--icon-xxxl, 64px);
347
+ font-size: 64px;
348
+ font-size: var(--icon-xxxl, 64px);
349
+ line-height: inherit;
350
+ }
351
+ .next-icon.next-inherit:before, .next-icon.next-inherit .next-icon-remote {
352
+ width: inherit;
353
+ font-size: inherit;
354
+ line-height: inherit;
355
+ }
356
+
357
+ .next-icon.next-inherit .next-icon-remote,
358
+ .next-icon .next-icon-remote {
359
+ width: 1em;
360
+ height: 1em;
361
+ vertical-align: middle;
362
+ fill: currentColor;
363
+ }
package/es/index.d.ts CHANGED
@@ -31,4 +31,5 @@ export { default as RadioGroup } from './radio-group';
31
31
  export { default as CheckboxGroup } from './checkbox-group';
32
32
  export { default as Select } from './select';
33
33
  export { default as Flip } from './flip';
34
+ export { default as ToolStatus } from './tool-status';
34
35
  export declare const version: string;
package/es/index.js CHANGED
@@ -31,4 +31,5 @@ export { default as RadioGroup } from './radio-group';
31
31
  export { default as CheckboxGroup } from './checkbox-group';
32
32
  export { default as Select } from './select';
33
33
  export { default as Flip } from './flip';
34
- export const version = '0.3.32';
34
+ export { default as ToolStatus } from './tool-status';
35
+ export const version = '0.3.33-beta.0';
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @component ToolStatus
3
+ * @en ToolStatus
4
+ * @type 通用 - ToolStatus
5
+ * @when ToolStatus
6
+ */
7
+ import React from 'react';
8
+ import { ToolStatusProps } from './types';
9
+ export * from './types';
10
+ declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<ToolStatusProps & React.RefAttributes<HTMLDivElement>, "key" | keyof ToolStatusProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, HTMLDivElement, {}>;
11
+ export default _default;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @component ToolStatus
3
+ * @en ToolStatus
4
+ * @type 通用 - ToolStatus
5
+ * @when ToolStatus
6
+ */
7
+ import React, { forwardRef } from 'react';
8
+ import { ConfigProvider } from '@alifd/next';
9
+ import Icon from '../icon';
10
+ import cs from 'classnames';
11
+ import { PREFIX_DEFAULT } from '../utils';
12
+ const SUCCESS_ICON = 'success';
13
+ const ERROR_ICON = 'error';
14
+ const LOADING_ICON = 'loading';
15
+ const ToolStatus = forwardRef((props, ref) => {
16
+ const { className, selected = false, status, result = '', onToolClick, extra } = props;
17
+ const handleClick = (event) => {
18
+ event.stopPropagation();
19
+ onToolClick === null || onToolClick === void 0 ? void 0 : onToolClick(props);
20
+ };
21
+ const statusClassName = selected ? 'selected' : '';
22
+ return (React.createElement("div", { className: cs(`${PREFIX_DEFAULT}tool-status ${statusClassName} ${status}`, className), ref: ref, onClick: (e) => {
23
+ handleClick(e);
24
+ } },
25
+ React.createElement("div", { className: 'main-content' },
26
+ React.createElement(Icon, { size: 'small', type: status === 'error' ? ERROR_ICON : status === 'success' ? SUCCESS_ICON : LOADING_ICON }),
27
+ React.createElement("div", { className: 'content-result' }, result)),
28
+ extra && React.createElement("div", { className: 'extra-content' }, extra)));
29
+ });
30
+ export * from './types';
31
+ export default ConfigProvider.config(ToolStatus);
@@ -0,0 +1,42 @@
1
+ @import "../core/variables.scss";
2
+
3
+ .#{$prefix}tool-status {
4
+ width: fit-content;
5
+ transition: width 0.3s ease-in-out;
6
+ background-color: $color-fill1-1;//$color-brand1-1;
7
+ padding: $s-1;
8
+ border-radius: $s-2;
9
+ box-sizing: border-box;
10
+ border: solid 1px $color-fill1-1;
11
+ align-items: center;
12
+
13
+ &.selected {
14
+ background-color: $color-fill1-2;
15
+ }
16
+
17
+ &.success {
18
+ i {
19
+ color: $color-success-3;
20
+ }
21
+ }
22
+
23
+ &.error {
24
+ i {
25
+ color: $color-error-3;
26
+ }
27
+ }
28
+
29
+ &.loading {
30
+ i {
31
+ color: $color-brand1-6;
32
+ }
33
+ }
34
+
35
+ .main-content {
36
+ display: flex;
37
+ .content-result {
38
+ margin-left: 4px;
39
+ }
40
+ }
41
+
42
+ }
@@ -0,0 +1,2 @@
1
+ import '../icon/style';
2
+ import './main.scss';
@@ -0,0 +1,2 @@
1
+ import '../icon/style';
2
+ import './main.scss';
@@ -0,0 +1,28 @@
1
+ import React, { type ReactNode } from 'react';
2
+ import { type CommonProps } from '@alifd/next';
3
+ /**
4
+ * 参考来源属性
5
+ */
6
+ export interface ToolStatusProps extends React.HTMLAttributes<HTMLElement>, CommonProps {
7
+ className?: string;
8
+ /**
9
+ * 是否被选中
10
+ */
11
+ selected?: boolean;
12
+ /**
13
+ * 工具调用状态
14
+ */
15
+ status?: 'loading' | 'success' | 'error';
16
+ /**
17
+ * 工具调用结果
18
+ */
19
+ result?: string | ReactNode;
20
+ /**
21
+ * 工具点击
22
+ */
23
+ onToolClick?: (data: ToolStatusProps) => void;
24
+ /**
25
+ * 额外需要渲染的内容
26
+ */
27
+ extra?: string | ReactNode;
28
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -95,3 +95,7 @@ $color-data1-10: var(--color-data1-10, #6f9200) !default; // ?
95
95
 
96
96
  $color-bg-1: var(--color-bg-1, #ffffff) !default; // ?
97
97
 
98
+
99
+ $color-error-3: var(--color-error-3, rgb(255, 82, 25)) !default;
100
+
101
+ $color-success-3: var(--color-success-3, #00b042) !default;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @component 输入框
3
+ * @en Input
4
+ * @type 通用 - General
5
+ * @remarks 同 Next Input,按钮用于开始一个即时操作。- Same as Next.Input, Input used to trigger an action.
6
+ * @when 标记一个(或封装一组)操作命令,响应用户点击行为,触发相应的业务逻辑。- Inputs are used for emphasizing important functions on your page.
7
+ * @others
8
+ * ## 无障碍键盘操作指南
9
+ * | 按键 | 说明 |
10
+ * | :---- | :---------- |
11
+ * | Enter | 触发 onClick 事件 |
12
+ * | SPACE | 触发 onClick 事件 |
13
+ * @othersEn
14
+ * ## ARIA and KeyBoard
15
+ * | KeyBoard | Description |
16
+ * | :---------- | :------------------------------ |
17
+ * | Enter | Trigger the onClick event |
18
+ * | SPACE | Trigger the onClick event |
19
+ */
20
+ import React from 'react';
21
+ export * from './types';
22
+ declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<Pick<any, string | number | symbol> & React.RefAttributes<import("@alifd/next/types/config-provider/types").ConfiguredComponent<import("@alifd/next/types/input").InputProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/input/input").default<import("@alifd/next/types/input").InputProps>> & Pick<import("@alifd/next/types/input/input").default<import("@alifd/next/types/input").InputProps>, "focus" | "getInputNode">>, string | number | symbol> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/config-provider/types").ConfiguredComponent<import("@alifd/next/types/input").InputProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("@alifd/next/types/input/input").default<import("@alifd/next/types/input").InputProps>> & Pick<import("@alifd/next/types/input/input").default<import("@alifd/next/types/input").InputProps>, "focus" | "getInputNode">, {}>;
23
+ export default _default;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ /**
3
+ * @component 输入框
4
+ * @en Input
5
+ * @type 通用 - General
6
+ * @remarks 同 Next Input,按钮用于开始一个即时操作。- Same as Next.Input, Input used to trigger an action.
7
+ * @when 标记一个(或封装一组)操作命令,响应用户点击行为,触发相应的业务逻辑。- Inputs are used for emphasizing important functions on your page.
8
+ * @others
9
+ * ## 无障碍键盘操作指南
10
+ * | 按键 | 说明 |
11
+ * | :---- | :---------- |
12
+ * | Enter | 触发 onClick 事件 |
13
+ * | SPACE | 触发 onClick 事件 |
14
+ * @othersEn
15
+ * ## ARIA and KeyBoard
16
+ * | KeyBoard | Description |
17
+ * | :---------- | :------------------------------ |
18
+ * | Enter | Trigger the onClick event |
19
+ * | SPACE | Trigger the onClick event |
20
+ */
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ const tslib_1 = require("tslib");
23
+ const react_1 = tslib_1.__importStar(require("react"));
24
+ const next_1 = require("@alifd/next");
25
+ const classnames_1 = tslib_1.__importDefault(require("classnames"));
26
+ const utils_1 = require("../utils");
27
+ const Input = (0, react_1.forwardRef)((_a, ref) => {
28
+ var { className, size = 'medium' } = _a, props = tslib_1.__rest(_a, ["className", "size"]);
29
+ return (react_1.default.createElement(next_1.Input, Object.assign({}, props, { className: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}input`, className), size: size, ref: ref })));
30
+ });
31
+ const InputWithSub = (0, utils_1.assignSubComponent)(Input, {
32
+ displayName: 'Input',
33
+ });
34
+ tslib_1.__exportStar(require("./types"), exports);
35
+ exports.default = next_1.ConfigProvider.config(InputWithSub);
@@ -0,0 +1,5 @@
1
+ @import "../core/variables.scss";
2
+
3
+ .#{$prefix}input {
4
+
5
+ }
@@ -0,0 +1 @@
1
+ import '@alifd/next/lib/input/style2';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("@alifd/next/lib/input/style2");