@octohirono/stitch-design-system 0.2.0 → 0.4.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.
- package/dist/components/BarChart/BarChart.js +32 -31
- package/dist/components/ChatFile/ChatFile.d.ts +34 -0
- package/dist/components/ChatFile/ChatFile.js +71 -0
- package/dist/components/ChatFile/chat-file.module.js +12 -0
- package/dist/components/ChatFile/index.d.ts +2 -0
- package/dist/components/ChatImage/ChatImage.d.ts +31 -0
- package/dist/components/ChatImage/ChatImage.js +88 -0
- package/dist/components/ChatImage/chat-image.module.js +12 -0
- package/dist/components/ChatImage/index.d.ts +2 -0
- package/dist/components/ChatInput/ChatInput.d.ts +77 -0
- package/dist/components/ChatInput/ChatInput.js +88 -0
- package/dist/components/ChatInput/chat-input.module.js +11 -0
- package/dist/components/ChatInput/index.d.ts +2 -0
- package/dist/components/ChatList/ChatList.d.ts +58 -0
- package/dist/components/ChatList/ChatList.js +49 -0
- package/dist/components/ChatList/chat-list.module.js +7 -0
- package/dist/components/ChatList/index.d.ts +2 -0
- package/dist/components/ChatMessage/ChatMessage.d.ts +52 -0
- package/dist/components/ChatMessage/ChatMessage.js +71 -0
- package/dist/components/ChatMessage/chat-message.module.js +21 -0
- package/dist/components/ChatMessage/index.d.ts +2 -0
- package/dist/components/ChatMessageActions/ChatMessageActions.d.ts +40 -0
- package/dist/components/ChatMessageActions/ChatMessageActions.js +34 -0
- package/dist/components/ChatMessageActions/chat-message-actions.module.js +7 -0
- package/dist/components/ChatMessageActions/index.d.ts +2 -0
- package/dist/components/ChatVoice/ChatVoice.d.ts +39 -0
- package/dist/components/ChatVoice/ChatVoice.js +44 -0
- package/dist/components/ChatVoice/chat-voice.module.js +12 -0
- package/dist/components/ChatVoice/index.d.ts +2 -0
- package/dist/components/Collapse/collapse.module.js +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +41 -34
- package/dist/components/ContextMenu/context-menu.module.js +10 -9
- package/dist/components/DropdownMenu/DropdownMenu.js +45 -38
- package/dist/components/DropdownMenu/dropdown-menu.module.js +10 -9
- package/dist/components/Icon/Icon.d.ts +20 -0
- package/dist/components/Icon/Icon.js +35 -2
- package/dist/components/Image/Image.js +1 -1
- package/dist/components/Image/image.module.js +14 -14
- package/dist/components/NavigationMenu/NavigationMenu.d.ts +1 -1
- package/dist/components/NavigationMenu/navigation-menu.module.js +3 -3
- package/dist/components/PieChart/PieChart.js +27 -26
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Select/Select.js +87 -83
- package/dist/components/Select/select.module.js +10 -9
- package/dist/components/TypingIndicator/TypingIndicator.d.ts +24 -0
- package/dist/components/TypingIndicator/TypingIndicator.js +29 -0
- package/dist/components/TypingIndicator/index.d.ts +2 -0
- package/dist/components/TypingIndicator/typing-indicator.module.js +8 -0
- package/dist/components/_internal/dataviz/ChartLegendLabel.d.ts +6 -0
- package/dist/components/_internal/dataviz/ChartLegendLabel.js +9 -0
- package/dist/components/_internal/dataviz/index.d.ts +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +36 -28
- package/dist/style.css +962 -467
- package/dist/themes/phantom.css +75 -0
- package/dist/themes/seline.css +31 -0
- package/dist/themes/steep.css +42 -2
- package/package.json +1 -1
|
@@ -68,8 +68,21 @@ var r = {
|
|
|
68
68
|
"M7 18h13"
|
|
69
69
|
],
|
|
70
70
|
"arrow-up-right": ["M7 17L17 7", "M8 7h9v9"],
|
|
71
|
-
"arrow-down-right": ["M7 7L17 17", "M17 8v9H8"]
|
|
72
|
-
|
|
71
|
+
"arrow-down-right": ["M7 7L17 17", "M17 8v9H8"],
|
|
72
|
+
send: ["M22 2L11 13", "M22 2L15 22 11 13 2 9z"],
|
|
73
|
+
play: ["M8 5v14l11-7z"],
|
|
74
|
+
pause: ["M8 5h3v14H8z", "M13 5h3v14h-3z"],
|
|
75
|
+
file: ["M13 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V9z", "M13 3v6h6"],
|
|
76
|
+
download: [
|
|
77
|
+
"M12 4v11",
|
|
78
|
+
"M8 11l4 4 4-4",
|
|
79
|
+
"M5 20h14"
|
|
80
|
+
]
|
|
81
|
+
}, i = /* @__PURE__ */ new Set([
|
|
82
|
+
"dot",
|
|
83
|
+
"play",
|
|
84
|
+
"pause"
|
|
85
|
+
]), a = ({ name: a, src: o, size: s = 24, label: c, strokeWidth: l, className: u, style: d, ...f }) => {
|
|
73
86
|
let p = t(e.icon, u), m = c == null ? { "aria-hidden": !0 } : {
|
|
74
87
|
role: "img",
|
|
75
88
|
"aria-label": c
|
|
@@ -169,6 +182,26 @@ var o = [
|
|
|
169
182
|
{
|
|
170
183
|
name: "arrow-down-right",
|
|
171
184
|
label: "Trend down"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: "send",
|
|
188
|
+
label: "Send"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "play",
|
|
192
|
+
label: "Play"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: "pause",
|
|
196
|
+
label: "Pause"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
name: "file",
|
|
200
|
+
label: "File"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: "download",
|
|
204
|
+
label: "Download"
|
|
172
205
|
}
|
|
173
206
|
];
|
|
174
207
|
//#endregion
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
//#region packages/react/src/components/Image/image.module.less
|
|
2
|
-
var e = "
|
|
2
|
+
var e = "_image_94mwe_1", t = "_img_94mwe_19", n = "_loaded_94mwe_26", r = "_error_94mwe_29", i = "_preview_94mwe_71", a = "_mask_94mwe_82", o = "_dialog_94mwe_92", s = "_previewImg_94mwe_97", c = "_closeBtn_94mwe_105", l = {
|
|
3
3
|
image: e,
|
|
4
4
|
img: t,
|
|
5
5
|
loaded: n,
|
|
6
6
|
error: r,
|
|
7
|
-
"image-accent": "_image-
|
|
8
|
-
"image-danger": "_image-
|
|
9
|
-
"image-success": "_image-
|
|
10
|
-
"image-warning": "_image-
|
|
11
|
-
"image-info": "_image-
|
|
12
|
-
"image-cat-1": "_image-cat-
|
|
13
|
-
"image-cat-2": "_image-cat-
|
|
14
|
-
"image-cat-3": "_image-cat-
|
|
15
|
-
"image-cat-4": "_image-cat-
|
|
16
|
-
"image-cat-5": "_image-cat-
|
|
17
|
-
"image-cat-6": "_image-cat-
|
|
7
|
+
"image-accent": "_image-accent_94mwe_38",
|
|
8
|
+
"image-danger": "_image-danger_94mwe_41",
|
|
9
|
+
"image-success": "_image-success_94mwe_44",
|
|
10
|
+
"image-warning": "_image-warning_94mwe_47",
|
|
11
|
+
"image-info": "_image-info_94mwe_50",
|
|
12
|
+
"image-cat-1": "_image-cat-1_94mwe_53",
|
|
13
|
+
"image-cat-2": "_image-cat-2_94mwe_56",
|
|
14
|
+
"image-cat-3": "_image-cat-3_94mwe_59",
|
|
15
|
+
"image-cat-4": "_image-cat-4_94mwe_62",
|
|
16
|
+
"image-cat-5": "_image-cat-5_94mwe_65",
|
|
17
|
+
"image-cat-6": "_image-cat-6_94mwe_68",
|
|
18
18
|
preview: i,
|
|
19
19
|
mask: a,
|
|
20
|
-
"stitch-image-fade-in": "_stitch-image-fade-
|
|
20
|
+
"stitch-image-fade-in": "_stitch-image-fade-in_94mwe_1",
|
|
21
21
|
dialog: o,
|
|
22
22
|
previewImg: s,
|
|
23
|
-
"stitch-image-zoom-in": "_stitch-image-zoom-
|
|
23
|
+
"stitch-image-zoom-in": "_stitch-image-zoom-in_94mwe_1",
|
|
24
24
|
closeBtn: c
|
|
25
25
|
};
|
|
26
26
|
//#endregion
|
|
@@ -12,7 +12,7 @@ export interface NavItem {
|
|
|
12
12
|
href?: string;
|
|
13
13
|
/** 展开面板内容:给了即渲染为可展开项(`Trigger` + `Content`),内容自由 ReactNode */
|
|
14
14
|
content?: React.ReactNode;
|
|
15
|
-
/** 标记为当前项:底层挂 `data-active` + `aria-current="page"
|
|
15
|
+
/** 标记为当前项:底层挂 `data-active` + `aria-current="page"`,皮上走品牌前景强调(`--stitch-brand`) */
|
|
16
16
|
active?: boolean;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region packages/react/src/components/NavigationMenu/navigation-menu.module.less
|
|
2
|
-
var e = "
|
|
2
|
+
var e = "_root_i0lyd_1", t = "_list_i0lyd_8", n = "_item_i0lyd_16", r = "_link_i0lyd_19", i = "_trigger_i0lyd_20", a = "_caret_i0lyd_52", o = "_viewportWrapper_i0lyd_60", s = "_viewport_i0lyd_60", c = "_content_i0lyd_85", l = {
|
|
3
3
|
root: e,
|
|
4
4
|
list: t,
|
|
5
5
|
item: n,
|
|
@@ -8,8 +8,8 @@ var e = "_root_phcem_1", t = "_list_phcem_8", n = "_item_phcem_16", r = "_link_p
|
|
|
8
8
|
caret: a,
|
|
9
9
|
viewportWrapper: o,
|
|
10
10
|
viewport: s,
|
|
11
|
-
"stitch-navigation-menu-in": "_stitch-navigation-menu-
|
|
12
|
-
"stitch-navigation-menu-out": "_stitch-navigation-menu-
|
|
11
|
+
"stitch-navigation-menu-in": "_stitch-navigation-menu-in_i0lyd_1",
|
|
12
|
+
"stitch-navigation-menu-out": "_stitch-navigation-menu-out_i0lyd_1",
|
|
13
13
|
content: c
|
|
14
14
|
};
|
|
15
15
|
//#endregion
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import { catColor as e } from "../_internal/dataviz/chartColors.js";
|
|
2
2
|
import { ChartFrame as t } from "../_internal/dataviz/ChartFrame.js";
|
|
3
3
|
import { ChartTooltip as n } from "../_internal/dataviz/ChartTooltip.js";
|
|
4
|
-
import r from "
|
|
4
|
+
import { renderLegendLabel as r } from "../_internal/dataviz/ChartLegendLabel.js";
|
|
5
|
+
import i from "./pie-chart.module.js";
|
|
5
6
|
import "react";
|
|
6
|
-
import
|
|
7
|
-
import { jsx as
|
|
8
|
-
import { Cell as
|
|
7
|
+
import a from "clsx";
|
|
8
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
9
|
+
import { Cell as c, Label as l, Legend as u, Pie as d, PieChart as f, Tooltip as p } from "recharts";
|
|
9
10
|
//#region packages/react/src/components/PieChart/PieChart.tsx
|
|
10
|
-
var
|
|
11
|
-
let
|
|
11
|
+
var m = ({ data: m, angleField: h, colorField: g, innerRadius: _ = 0, centerLabel: v, legend: y = !0, height: b = 300, valueFormatter: x, ariaLabel: S, className: C }) => {
|
|
12
|
+
let w = (e) => {
|
|
12
13
|
let { active: t, payload: r } = e, i = r?.map((e) => ({
|
|
13
14
|
name: e.name,
|
|
14
|
-
value:
|
|
15
|
+
value: x && typeof e.value == "number" ? x(e.value) : e.value,
|
|
15
16
|
color: e.color
|
|
16
17
|
}));
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ o(n, {
|
|
18
19
|
active: t,
|
|
19
20
|
payload: i
|
|
20
21
|
});
|
|
21
|
-
},
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
ariaLabel:
|
|
24
|
-
height:
|
|
25
|
-
className: i
|
|
26
|
-
children: /* @__PURE__ */
|
|
22
|
+
}, T = `${Math.max(0, Math.min(1, _)) * 100}%`, E = _ > 0 && v != null && v !== "";
|
|
23
|
+
return /* @__PURE__ */ o(t, {
|
|
24
|
+
ariaLabel: S,
|
|
25
|
+
height: b,
|
|
26
|
+
className: a(i.chart, C),
|
|
27
|
+
children: /* @__PURE__ */ s(f, {
|
|
27
28
|
margin: {
|
|
28
29
|
top: 8,
|
|
29
30
|
right: 8,
|
|
@@ -31,26 +32,26 @@ var p = ({ data: p, angleField: m, colorField: h, innerRadius: g = 0, centerLabe
|
|
|
31
32
|
left: 4
|
|
32
33
|
},
|
|
33
34
|
children: [
|
|
34
|
-
/* @__PURE__ */
|
|
35
|
-
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
data:
|
|
38
|
-
dataKey:
|
|
39
|
-
nameKey:
|
|
40
|
-
innerRadius:
|
|
35
|
+
/* @__PURE__ */ o(p, { content: w }),
|
|
36
|
+
y && /* @__PURE__ */ o(u, { formatter: r }),
|
|
37
|
+
/* @__PURE__ */ s(d, {
|
|
38
|
+
data: m,
|
|
39
|
+
dataKey: h,
|
|
40
|
+
nameKey: g,
|
|
41
|
+
innerRadius: T,
|
|
41
42
|
outerRadius: "80%",
|
|
42
43
|
stroke: "var(--stitch-bg-elevated)",
|
|
43
44
|
isAnimationActive: !1,
|
|
44
|
-
children: [
|
|
45
|
+
children: [m.map((t, n) => /* @__PURE__ */ o(c, { fill: e(n) }, n)), E && /* @__PURE__ */ o(l, {
|
|
45
46
|
position: "center",
|
|
46
|
-
value:
|
|
47
|
-
className:
|
|
47
|
+
value: v,
|
|
48
|
+
className: i.center
|
|
48
49
|
})]
|
|
49
50
|
})
|
|
50
51
|
]
|
|
51
52
|
})
|
|
52
53
|
});
|
|
53
54
|
};
|
|
54
|
-
|
|
55
|
+
m.displayName = "PieChart";
|
|
55
56
|
//#endregion
|
|
56
|
-
export {
|
|
57
|
+
export { m as PieChart };
|
|
@@ -23,7 +23,7 @@ export interface SelectOption {
|
|
|
23
23
|
* wrap),Home/End 跳首尾启用项,Enter/Space 选中当前高亮,Esc 关闭并把焦点还给 trigger;
|
|
24
24
|
* trigger `:focus-visible` 焦点环走 `--stitch-focus-ring`。
|
|
25
25
|
* - **图标走 `<Icon>` 非裸 `<svg>`**:箭头 `<Icon name="chevron-down">`(`size="1em"` 跟随字号,
|
|
26
|
-
* 展开 `rotate(180deg)` +
|
|
26
|
+
* 展开 `rotate(180deg)` + 转品牌前景强调 brand 色),选中项尾随 `<Icon name="check">`。
|
|
27
27
|
* - **标准正下方展开**:浮层在 trigger 正下方展开(`top:100%`,`max-height` + 滚动),非侧向弹出/
|
|
28
28
|
* 视口翻转定位——这是标准化取舍,保证可预期的下拉手感。
|
|
29
29
|
*/
|
|
@@ -1,118 +1,122 @@
|
|
|
1
1
|
import { Icon as e } from "../Icon/Icon.js";
|
|
2
|
-
import t from "
|
|
3
|
-
import
|
|
4
|
-
import c from "
|
|
5
|
-
import
|
|
2
|
+
import { ScrollArea as t } from "../ScrollArea/ScrollArea.js";
|
|
3
|
+
import n from "./select.module.js";
|
|
4
|
+
import { useCallback as r, useEffect as i, useId as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
5
|
+
import l from "clsx";
|
|
6
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
6
7
|
//#region packages/react/src/components/Select/Select.tsx
|
|
7
|
-
var
|
|
8
|
-
let [
|
|
9
|
-
|
|
10
|
-
if (!
|
|
8
|
+
var f = ({ options: f, value: p, defaultValue: m, onChange: h, placeholder: g = "请选择", size: _ = "middle", disabled: v = !1, className: y, style: b, "aria-label": x, "aria-labelledby": S }) => {
|
|
9
|
+
let [C, w] = c(m), T = p !== void 0, E = T ? p : C, [D, O] = c(!1), [k, A] = c(null), j = s(null), M = s(null), N = `stitch-select-${a().replace(/:/g, "")}`, P = `${N}-listbox`, F = (e) => `${N}-option-${e}`, I = f.find((e) => e.value === E), L = I ? I.label : g, R = I !== void 0, z = o(() => f.filter((e) => !e.disabled).map((e) => e.value), [f]);
|
|
10
|
+
i(() => {
|
|
11
|
+
if (!D) return;
|
|
11
12
|
let e = (e) => {
|
|
12
|
-
|
|
13
|
+
j.current && !j.current.contains(e.target) && O(!1);
|
|
13
14
|
};
|
|
14
15
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
15
|
-
}, [
|
|
16
|
-
if (
|
|
17
|
-
let e =
|
|
18
|
-
|
|
19
|
-
} else
|
|
20
|
-
}, [
|
|
21
|
-
let
|
|
22
|
-
|
|
23
|
-
}, [
|
|
24
|
-
if (!
|
|
25
|
-
let t =
|
|
26
|
-
|
|
16
|
+
}, [D]), i(() => {
|
|
17
|
+
if (D) {
|
|
18
|
+
let e = z[0] ?? null;
|
|
19
|
+
A(E != null && z.includes(E) ? E : e);
|
|
20
|
+
} else A(null);
|
|
21
|
+
}, [D]);
|
|
22
|
+
let B = r((e) => {
|
|
23
|
+
T || w(e), h?.(e), O(!1), M.current?.focus();
|
|
24
|
+
}, [T, h]), V = (e) => {
|
|
25
|
+
if (!z.length) return;
|
|
26
|
+
let t = k == null ? -1 : z.indexOf(k), n = t < 0 ? e === 1 ? 0 : z.length - 1 : (t + e + z.length) % z.length;
|
|
27
|
+
A(z[n]);
|
|
27
28
|
};
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
ref:
|
|
30
|
-
className:
|
|
31
|
-
style:
|
|
29
|
+
return /* @__PURE__ */ d("div", {
|
|
30
|
+
ref: j,
|
|
31
|
+
className: l(n.wrapper, v && n.disabled, y),
|
|
32
|
+
style: b,
|
|
32
33
|
onKeyDown: (e) => {
|
|
33
|
-
if (
|
|
34
|
+
if (v) return;
|
|
34
35
|
let { key: t } = e;
|
|
35
|
-
if (!
|
|
36
|
-
(t === "Enter" || t === " " || t === "ArrowDown" || t === "ArrowUp") && (e.preventDefault(),
|
|
36
|
+
if (!D) {
|
|
37
|
+
(t === "Enter" || t === " " || t === "ArrowDown" || t === "ArrowUp") && (e.preventDefault(), O(!0));
|
|
37
38
|
return;
|
|
38
39
|
}
|
|
39
40
|
switch (t) {
|
|
40
41
|
case "Escape":
|
|
41
|
-
e.preventDefault(),
|
|
42
|
+
e.preventDefault(), O(!1), M.current?.focus();
|
|
42
43
|
break;
|
|
43
44
|
case "ArrowDown":
|
|
44
|
-
e.preventDefault(),
|
|
45
|
+
e.preventDefault(), V(1);
|
|
45
46
|
break;
|
|
46
47
|
case "ArrowUp":
|
|
47
|
-
e.preventDefault(),
|
|
48
|
+
e.preventDefault(), V(-1);
|
|
48
49
|
break;
|
|
49
50
|
case "Home":
|
|
50
|
-
e.preventDefault(),
|
|
51
|
+
e.preventDefault(), z.length && A(z[0]);
|
|
51
52
|
break;
|
|
52
53
|
case "End":
|
|
53
|
-
e.preventDefault(),
|
|
54
|
+
e.preventDefault(), z.length && A(z[z.length - 1]);
|
|
54
55
|
break;
|
|
55
56
|
case "Enter":
|
|
56
|
-
case " ": e.preventDefault(),
|
|
57
|
+
case " ": e.preventDefault(), k != null && B(k);
|
|
57
58
|
}
|
|
58
59
|
},
|
|
59
|
-
children: [/* @__PURE__ */
|
|
60
|
-
ref:
|
|
61
|
-
className:
|
|
62
|
-
onClick: () => !
|
|
60
|
+
children: [/* @__PURE__ */ d("div", {
|
|
61
|
+
ref: M,
|
|
62
|
+
className: l(n.trigger, n[_], D && n.open),
|
|
63
|
+
onClick: () => !v && O((e) => !e),
|
|
63
64
|
role: "combobox",
|
|
64
65
|
"aria-haspopup": "listbox",
|
|
65
|
-
"aria-expanded":
|
|
66
|
-
"aria-controls":
|
|
67
|
-
"aria-activedescendant":
|
|
68
|
-
"aria-disabled":
|
|
69
|
-
"aria-label":
|
|
70
|
-
"aria-labelledby":
|
|
71
|
-
tabIndex:
|
|
72
|
-
children: [/* @__PURE__ */
|
|
73
|
-
className:
|
|
74
|
-
children:
|
|
75
|
-
}), /* @__PURE__ */
|
|
66
|
+
"aria-expanded": D,
|
|
67
|
+
"aria-controls": D ? P : void 0,
|
|
68
|
+
"aria-activedescendant": D && k != null ? F(k) : void 0,
|
|
69
|
+
"aria-disabled": v || void 0,
|
|
70
|
+
"aria-label": x,
|
|
71
|
+
"aria-labelledby": S,
|
|
72
|
+
tabIndex: v ? -1 : 0,
|
|
73
|
+
children: [/* @__PURE__ */ u("span", {
|
|
74
|
+
className: R ? n.value : n.placeholder,
|
|
75
|
+
children: L
|
|
76
|
+
}), /* @__PURE__ */ u(e, {
|
|
76
77
|
name: "chevron-down",
|
|
77
78
|
size: "1em",
|
|
78
|
-
className:
|
|
79
|
+
className: l(n.arrow, D && n.arrowOpen)
|
|
79
80
|
})]
|
|
80
|
-
}),
|
|
81
|
-
className:
|
|
81
|
+
}), D && /* @__PURE__ */ u("div", {
|
|
82
|
+
className: n.dropdown,
|
|
82
83
|
role: "listbox",
|
|
83
|
-
id:
|
|
84
|
-
"aria-label":
|
|
85
|
-
"aria-labelledby":
|
|
86
|
-
"aria-activedescendant":
|
|
87
|
-
children:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
children:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
84
|
+
id: P,
|
|
85
|
+
"aria-label": x,
|
|
86
|
+
"aria-labelledby": S,
|
|
87
|
+
"aria-activedescendant": k == null ? void 0 : F(k),
|
|
88
|
+
children: /* @__PURE__ */ u(t, {
|
|
89
|
+
className: n.dropdownScroll,
|
|
90
|
+
children: f.map((t) => {
|
|
91
|
+
let r = E === t.value, i = k === t.value;
|
|
92
|
+
return /* @__PURE__ */ d("div", {
|
|
93
|
+
id: F(t.value),
|
|
94
|
+
role: "option",
|
|
95
|
+
"aria-selected": r,
|
|
96
|
+
"aria-disabled": t.disabled || void 0,
|
|
97
|
+
className: l(n.option, {
|
|
98
|
+
[n.optionActive]: i,
|
|
99
|
+
[n.optionSelected]: r,
|
|
100
|
+
[n.optionDisabled]: t.disabled
|
|
101
|
+
}),
|
|
102
|
+
onClick: () => !t.disabled && B(t.value),
|
|
103
|
+
onMouseEnter: () => {
|
|
104
|
+
t.disabled || A(t.value);
|
|
105
|
+
},
|
|
106
|
+
children: [/* @__PURE__ */ u("span", {
|
|
107
|
+
className: n.optionLabel,
|
|
108
|
+
children: t.label
|
|
109
|
+
}), r && /* @__PURE__ */ u(e, {
|
|
110
|
+
name: "check",
|
|
111
|
+
size: "1em",
|
|
112
|
+
className: n.checkMark
|
|
113
|
+
})]
|
|
114
|
+
}, String(t.value));
|
|
115
|
+
})
|
|
112
116
|
})
|
|
113
117
|
})]
|
|
114
118
|
});
|
|
115
119
|
};
|
|
116
|
-
|
|
120
|
+
f.displayName = "Select";
|
|
117
121
|
//#endregion
|
|
118
|
-
export {
|
|
122
|
+
export { f as Select };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region packages/react/src/components/Select/select.module.less
|
|
2
|
-
var e = "
|
|
2
|
+
var e = "_wrapper_158od_1", t = "_trigger_158od_8", n = "_open_158od_30", r = "_small_158od_33", i = "_middle_158od_38", a = "_large_158od_43", o = "_value_158od_48", s = "_placeholder_158od_55", c = "_arrow_158od_62", l = "_arrowOpen_158od_67", u = "_dropdown_158od_71", d = "_dropdownFadeIn_158od_1", f = "_dropdownScroll_158od_86", p = "_option_158od_102", m = "_optionLabel_158od_115", h = "_optionActive_158od_119", g = "_optionSelected_158od_122", _ = "_checkMark_158od_126", v = "_optionDisabled_158od_130", y = "_disabled_158od_137", b = {
|
|
3
3
|
wrapper: e,
|
|
4
4
|
trigger: t,
|
|
5
5
|
open: n,
|
|
@@ -12,13 +12,14 @@ var e = "_wrapper_13o0n_1", t = "_trigger_13o0n_8", n = "_open_13o0n_30", r = "_
|
|
|
12
12
|
arrowOpen: l,
|
|
13
13
|
dropdown: u,
|
|
14
14
|
dropdownFadeIn: d,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
dropdownScroll: f,
|
|
16
|
+
option: p,
|
|
17
|
+
optionLabel: m,
|
|
18
|
+
optionActive: h,
|
|
19
|
+
optionSelected: g,
|
|
20
|
+
checkMark: _,
|
|
21
|
+
optionDisabled: v,
|
|
22
|
+
disabled: y
|
|
22
23
|
};
|
|
23
24
|
//#endregion
|
|
24
|
-
export { c as arrow, l as arrowOpen,
|
|
25
|
+
export { c as arrow, l as arrowOpen, _ as checkMark, b as default, y as disabled, u as dropdown, d as dropdownFadeIn, f as dropdownScroll, a as large, i as middle, n as open, p as option, h as optionActive, v as optionDisabled, m as optionLabel, g as optionSelected, s as placeholder, r as small, t as trigger, o as value, e as wrapper };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 「对方正在输入」指示:三点循环动画(IM 语境是**对方**的态)。点为角色变量小元素
|
|
4
|
+
* (`--stitch-text-muted` 铺底的小圆,非 emoji / Unicode / 裸 svg),动效走 `--stitch-motion-*`
|
|
5
|
+
* (不超设计动效窗)。无 Ant 对应件 → 取 Ant 最近惯例(`label` 可访问名 + 透传原生属性)。
|
|
6
|
+
*
|
|
7
|
+
* 跨-prop 注意事项:
|
|
8
|
+
* - **纯呈现件**:只画「正在输入」的三点动画,不含业务(谁在输入、何时出现由上层决定)。
|
|
9
|
+
* - **可及名走 `label`**:根节点 `role="status"`(`aria-live` 区,屏幕阅读器读出 `label`),
|
|
10
|
+
* 三点纯装饰(`aria-hidden`)。默认可访问名「对方正在输入」。
|
|
11
|
+
* - **动效降级**:尊重 `prefers-reduced-motion`——用户关动效时三点停在静止态、不循环。
|
|
12
|
+
*/
|
|
13
|
+
export interface TypingIndicatorProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
14
|
+
/**
|
|
15
|
+
* 可访问名(屏幕阅读器读出,如「张三正在输入」)
|
|
16
|
+
* @default '对方正在输入'
|
|
17
|
+
*/
|
|
18
|
+
label?: string;
|
|
19
|
+
/** 自定义类名(挂到根容器) */
|
|
20
|
+
className?: string;
|
|
21
|
+
/** 行内样式(挂到根容器) */
|
|
22
|
+
style?: React.CSSProperties;
|
|
23
|
+
}
|
|
24
|
+
export declare const TypingIndicator: React.FC<TypingIndicatorProps>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import e from "./typing-indicator.module.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import t from "clsx";
|
|
4
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
|
+
//#region packages/react/src/components/TypingIndicator/TypingIndicator.tsx
|
|
6
|
+
var i = ({ label: i = "对方正在输入", className: a, style: o, ...s }) => /* @__PURE__ */ r("span", {
|
|
7
|
+
className: t(e.indicator, a),
|
|
8
|
+
style: o,
|
|
9
|
+
role: "status",
|
|
10
|
+
"aria-label": i,
|
|
11
|
+
...s,
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ n("span", {
|
|
14
|
+
className: e.dot,
|
|
15
|
+
"aria-hidden": "true"
|
|
16
|
+
}),
|
|
17
|
+
/* @__PURE__ */ n("span", {
|
|
18
|
+
className: e.dot,
|
|
19
|
+
"aria-hidden": "true"
|
|
20
|
+
}),
|
|
21
|
+
/* @__PURE__ */ n("span", {
|
|
22
|
+
className: e.dot,
|
|
23
|
+
"aria-hidden": "true"
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
});
|
|
27
|
+
i.displayName = "TypingIndicator";
|
|
28
|
+
//#endregion
|
|
29
|
+
export { i as TypingIndicator };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region packages/react/src/components/TypingIndicator/typing-indicator.module.less
|
|
2
|
+
var e = "_indicator_hslxz_1", t = "_dot_hslxz_11", n = {
|
|
3
|
+
indicator: e,
|
|
4
|
+
dot: t,
|
|
5
|
+
"stitch-typing-bounce": "_stitch-typing-bounce_hslxz_1"
|
|
6
|
+
};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { n as default, t as dot, e as indicator };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
//#region packages/react/src/components/_internal/dataviz/ChartLegendLabel.tsx
|
|
4
|
+
var t = (t) => /* @__PURE__ */ e("span", {
|
|
5
|
+
style: { color: "var(--stitch-text-primary)" },
|
|
6
|
+
children: t
|
|
7
|
+
});
|
|
8
|
+
//#endregion
|
|
9
|
+
export { t as renderLegendLabel };
|
|
@@ -3,3 +3,4 @@ export { ChartFrame } from './ChartFrame';
|
|
|
3
3
|
export type { ChartFrameProps } from './ChartFrame';
|
|
4
4
|
export { ChartTooltip } from './ChartTooltip';
|
|
5
5
|
export type { ChartTooltipProps, ChartTooltipEntry } from './ChartTooltip';
|
|
6
|
+
export { renderLegendLabel } from './ChartLegendLabel';
|
package/dist/index.d.ts
CHANGED
|
@@ -52,6 +52,22 @@ export { Table } from './components/Table';
|
|
|
52
52
|
export type { TableProps, TableColumn } from './components/Table';
|
|
53
53
|
export { CodeBlock } from './components/CodeBlock';
|
|
54
54
|
export type { CodeBlockProps } from './components/CodeBlock';
|
|
55
|
+
export { ChatMessage } from './components/ChatMessage';
|
|
56
|
+
export type { ChatMessageProps, ChatMessageVariant, ChatMessageStatus, } from './components/ChatMessage';
|
|
57
|
+
export { ChatMessageActions } from './components/ChatMessageActions';
|
|
58
|
+
export type { ChatMessageActionsProps, ChatMessageAction, } from './components/ChatMessageActions';
|
|
59
|
+
export { ChatList } from './components/ChatList';
|
|
60
|
+
export type { ChatListProps, ChatListItem } from './components/ChatList';
|
|
61
|
+
export { ChatInput } from './components/ChatInput';
|
|
62
|
+
export type { ChatInputProps, ChatInputSubmitType, ChatInputAutoSize, } from './components/ChatInput';
|
|
63
|
+
export { TypingIndicator } from './components/TypingIndicator';
|
|
64
|
+
export type { TypingIndicatorProps } from './components/TypingIndicator';
|
|
65
|
+
export { ChatImage } from './components/ChatImage';
|
|
66
|
+
export type { ChatImageProps } from './components/ChatImage';
|
|
67
|
+
export { ChatFile } from './components/ChatFile';
|
|
68
|
+
export type { ChatFileProps } from './components/ChatFile';
|
|
69
|
+
export { ChatVoice } from './components/ChatVoice';
|
|
70
|
+
export type { ChatVoiceProps } from './components/ChatVoice';
|
|
55
71
|
export { LineChart } from './components/LineChart';
|
|
56
72
|
export type { LineChartProps, LineChartSeries } from './components/LineChart';
|
|
57
73
|
export { BarChart } from './components/BarChart';
|