@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.
Files changed (58) hide show
  1. package/dist/components/BarChart/BarChart.js +32 -31
  2. package/dist/components/ChatFile/ChatFile.d.ts +34 -0
  3. package/dist/components/ChatFile/ChatFile.js +71 -0
  4. package/dist/components/ChatFile/chat-file.module.js +12 -0
  5. package/dist/components/ChatFile/index.d.ts +2 -0
  6. package/dist/components/ChatImage/ChatImage.d.ts +31 -0
  7. package/dist/components/ChatImage/ChatImage.js +88 -0
  8. package/dist/components/ChatImage/chat-image.module.js +12 -0
  9. package/dist/components/ChatImage/index.d.ts +2 -0
  10. package/dist/components/ChatInput/ChatInput.d.ts +77 -0
  11. package/dist/components/ChatInput/ChatInput.js +88 -0
  12. package/dist/components/ChatInput/chat-input.module.js +11 -0
  13. package/dist/components/ChatInput/index.d.ts +2 -0
  14. package/dist/components/ChatList/ChatList.d.ts +58 -0
  15. package/dist/components/ChatList/ChatList.js +49 -0
  16. package/dist/components/ChatList/chat-list.module.js +7 -0
  17. package/dist/components/ChatList/index.d.ts +2 -0
  18. package/dist/components/ChatMessage/ChatMessage.d.ts +52 -0
  19. package/dist/components/ChatMessage/ChatMessage.js +71 -0
  20. package/dist/components/ChatMessage/chat-message.module.js +21 -0
  21. package/dist/components/ChatMessage/index.d.ts +2 -0
  22. package/dist/components/ChatMessageActions/ChatMessageActions.d.ts +40 -0
  23. package/dist/components/ChatMessageActions/ChatMessageActions.js +34 -0
  24. package/dist/components/ChatMessageActions/chat-message-actions.module.js +7 -0
  25. package/dist/components/ChatMessageActions/index.d.ts +2 -0
  26. package/dist/components/ChatVoice/ChatVoice.d.ts +39 -0
  27. package/dist/components/ChatVoice/ChatVoice.js +44 -0
  28. package/dist/components/ChatVoice/chat-voice.module.js +12 -0
  29. package/dist/components/ChatVoice/index.d.ts +2 -0
  30. package/dist/components/Collapse/collapse.module.js +1 -1
  31. package/dist/components/ContextMenu/ContextMenu.js +41 -34
  32. package/dist/components/ContextMenu/context-menu.module.js +10 -9
  33. package/dist/components/DropdownMenu/DropdownMenu.js +45 -38
  34. package/dist/components/DropdownMenu/dropdown-menu.module.js +10 -9
  35. package/dist/components/Icon/Icon.d.ts +20 -0
  36. package/dist/components/Icon/Icon.js +35 -2
  37. package/dist/components/Image/Image.js +1 -1
  38. package/dist/components/Image/image.module.js +14 -14
  39. package/dist/components/NavigationMenu/NavigationMenu.d.ts +1 -1
  40. package/dist/components/NavigationMenu/navigation-menu.module.js +3 -3
  41. package/dist/components/PieChart/PieChart.js +27 -26
  42. package/dist/components/Select/Select.d.ts +1 -1
  43. package/dist/components/Select/Select.js +87 -83
  44. package/dist/components/Select/select.module.js +10 -9
  45. package/dist/components/TypingIndicator/TypingIndicator.d.ts +24 -0
  46. package/dist/components/TypingIndicator/TypingIndicator.js +29 -0
  47. package/dist/components/TypingIndicator/index.d.ts +2 -0
  48. package/dist/components/TypingIndicator/typing-indicator.module.js +8 -0
  49. package/dist/components/_internal/dataviz/ChartLegendLabel.d.ts +6 -0
  50. package/dist/components/_internal/dataviz/ChartLegendLabel.js +9 -0
  51. package/dist/components/_internal/dataviz/index.d.ts +1 -0
  52. package/dist/index.d.ts +16 -0
  53. package/dist/index.js +36 -28
  54. package/dist/style.css +962 -467
  55. package/dist/themes/phantom.css +75 -0
  56. package/dist/themes/seline.css +31 -0
  57. package/dist/themes/steep.css +42 -2
  58. 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
- }, i = /* @__PURE__ */ new Set(["dot"]), a = ({ name: a, src: o, size: s = 24, label: c, strokeWidth: l, className: u, style: d, ...f }) => {
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
@@ -76,7 +76,7 @@ var d = (e) => e === "default" ? "" : t[`image-${e}`], f = ({ src: f, alt: p = "
76
76
  onClick: () => k(!1),
77
77
  children: /* @__PURE__ */ c(e, {
78
78
  name: "close",
79
- size: 16
79
+ size: 14
80
80
  })
81
81
  }), /* @__PURE__ */ c("img", {
82
82
  src: f,
@@ -1,26 +1,26 @@
1
1
  //#region packages/react/src/components/Image/image.module.less
2
- var e = "_image_15m2u_1", t = "_img_15m2u_19", n = "_loaded_15m2u_26", r = "_error_15m2u_29", i = "_preview_15m2u_71", a = "_mask_15m2u_82", o = "_dialog_15m2u_92", s = "_previewImg_15m2u_97", c = "_closeBtn_15m2u_105", l = {
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-accent_15m2u_38",
8
- "image-danger": "_image-danger_15m2u_41",
9
- "image-success": "_image-success_15m2u_44",
10
- "image-warning": "_image-warning_15m2u_47",
11
- "image-info": "_image-info_15m2u_50",
12
- "image-cat-1": "_image-cat-1_15m2u_53",
13
- "image-cat-2": "_image-cat-2_15m2u_56",
14
- "image-cat-3": "_image-cat-3_15m2u_59",
15
- "image-cat-4": "_image-cat-4_15m2u_62",
16
- "image-cat-5": "_image-cat-5_15m2u_65",
17
- "image-cat-6": "_image-cat-6_15m2u_68",
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-in_15m2u_1",
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-in_15m2u_1",
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"`,皮上走激活态(`--stitch-accent`) */
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 = "_root_phcem_1", t = "_list_phcem_8", n = "_item_phcem_16", r = "_link_phcem_19", i = "_trigger_phcem_20", a = "_caret_phcem_52", o = "_viewportWrapper_phcem_60", s = "_viewport_phcem_60", c = "_content_phcem_85", l = {
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-in_phcem_1",
12
- "stitch-navigation-menu-out": "_stitch-navigation-menu-out_phcem_1",
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 "./pie-chart.module.js";
4
+ import { renderLegendLabel as r } from "../_internal/dataviz/ChartLegendLabel.js";
5
+ import i from "./pie-chart.module.js";
5
6
  import "react";
6
- import i from "clsx";
7
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
8
- import { Cell as s, Label as c, Legend as l, Pie as u, PieChart as d, Tooltip as f } from "recharts";
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 p = ({ data: p, angleField: m, colorField: h, innerRadius: g = 0, centerLabel: _, legend: v = !0, height: y = 300, valueFormatter: b, ariaLabel: x, className: S }) => {
11
- let C = (e) => {
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: b && typeof e.value == "number" ? b(e.value) : e.value,
15
+ value: x && typeof e.value == "number" ? x(e.value) : e.value,
15
16
  color: e.color
16
17
  }));
17
- return /* @__PURE__ */ a(n, {
18
+ return /* @__PURE__ */ o(n, {
18
19
  active: t,
19
20
  payload: i
20
21
  });
21
- }, w = `${Math.max(0, Math.min(1, g)) * 100}%`, T = g > 0 && _ != null && _ !== "";
22
- return /* @__PURE__ */ a(t, {
23
- ariaLabel: x,
24
- height: y,
25
- className: i(r.chart, S),
26
- children: /* @__PURE__ */ o(d, {
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__ */ a(f, { content: C }),
35
- v && /* @__PURE__ */ a(l, { wrapperStyle: { color: "var(--stitch-text-primary)" } }),
36
- /* @__PURE__ */ o(u, {
37
- data: p,
38
- dataKey: m,
39
- nameKey: h,
40
- innerRadius: w,
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: [p.map((t, n) => /* @__PURE__ */ a(s, { fill: e(n) }, n)), T && /* @__PURE__ */ a(c, {
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: r.center
47
+ value: v,
48
+ className: i.center
48
49
  })]
49
50
  })
50
51
  ]
51
52
  })
52
53
  });
53
54
  };
54
- p.displayName = "PieChart";
55
+ m.displayName = "PieChart";
55
56
  //#endregion
56
- export { p as PieChart };
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)` + 转 accent 色),选中项尾随 `<Icon name="check">`。
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 "./select.module.js";
3
- import { useCallback as n, useEffect as r, useId as i, useMemo as a, useRef as o, useState as s } from "react";
4
- import c from "clsx";
5
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
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 d = ({ options: d, value: f, defaultValue: p, onChange: m, placeholder: h = "请选择", size: g = "middle", disabled: _ = !1, className: v, style: y, "aria-label": b, "aria-labelledby": x }) => {
8
- let [S, C] = s(p), w = f !== void 0, T = w ? f : S, [E, D] = s(!1), [O, k] = s(null), A = o(null), j = o(null), M = `stitch-select-${i().replace(/:/g, "")}`, N = `${M}-listbox`, P = (e) => `${M}-option-${e}`, F = d.find((e) => e.value === T), I = F ? F.label : h, L = F !== void 0, R = a(() => d.filter((e) => !e.disabled).map((e) => e.value), [d]);
9
- r(() => {
10
- if (!E) return;
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
- A.current && !A.current.contains(e.target) && D(!1);
13
+ j.current && !j.current.contains(e.target) && O(!1);
13
14
  };
14
15
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
15
- }, [E]), r(() => {
16
- if (E) {
17
- let e = R[0] ?? null;
18
- k(T != null && R.includes(T) ? T : e);
19
- } else k(null);
20
- }, [E]);
21
- let z = n((e) => {
22
- w || C(e), m?.(e), D(!1), j.current?.focus();
23
- }, [w, m]), B = (e) => {
24
- if (!R.length) return;
25
- let t = O == null ? -1 : R.indexOf(O), n = t < 0 ? e === 1 ? 0 : R.length - 1 : (t + e + R.length) % R.length;
26
- k(R[n]);
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__ */ u("div", {
29
- ref: A,
30
- className: c(t.wrapper, _ && t.disabled, v),
31
- style: y,
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 (_) return;
34
+ if (v) return;
34
35
  let { key: t } = e;
35
- if (!E) {
36
- (t === "Enter" || t === " " || t === "ArrowDown" || t === "ArrowUp") && (e.preventDefault(), D(!0));
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(), D(!1), j.current?.focus();
42
+ e.preventDefault(), O(!1), M.current?.focus();
42
43
  break;
43
44
  case "ArrowDown":
44
- e.preventDefault(), B(1);
45
+ e.preventDefault(), V(1);
45
46
  break;
46
47
  case "ArrowUp":
47
- e.preventDefault(), B(-1);
48
+ e.preventDefault(), V(-1);
48
49
  break;
49
50
  case "Home":
50
- e.preventDefault(), R.length && k(R[0]);
51
+ e.preventDefault(), z.length && A(z[0]);
51
52
  break;
52
53
  case "End":
53
- e.preventDefault(), R.length && k(R[R.length - 1]);
54
+ e.preventDefault(), z.length && A(z[z.length - 1]);
54
55
  break;
55
56
  case "Enter":
56
- case " ": e.preventDefault(), O != null && z(O);
57
+ case " ": e.preventDefault(), k != null && B(k);
57
58
  }
58
59
  },
59
- children: [/* @__PURE__ */ u("div", {
60
- ref: j,
61
- className: c(t.trigger, t[g], E && t.open),
62
- onClick: () => !_ && D((e) => !e),
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": E,
66
- "aria-controls": E ? N : void 0,
67
- "aria-activedescendant": E && O != null ? P(O) : void 0,
68
- "aria-disabled": _ || void 0,
69
- "aria-label": b,
70
- "aria-labelledby": x,
71
- tabIndex: _ ? -1 : 0,
72
- children: [/* @__PURE__ */ l("span", {
73
- className: L ? t.value : t.placeholder,
74
- children: I
75
- }), /* @__PURE__ */ l(e, {
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: c(t.arrow, E && t.arrowOpen)
79
+ className: l(n.arrow, D && n.arrowOpen)
79
80
  })]
80
- }), E && /* @__PURE__ */ l("div", {
81
- className: t.dropdown,
81
+ }), D && /* @__PURE__ */ u("div", {
82
+ className: n.dropdown,
82
83
  role: "listbox",
83
- id: N,
84
- "aria-label": b,
85
- "aria-labelledby": x,
86
- "aria-activedescendant": O == null ? void 0 : P(O),
87
- children: d.map((n) => {
88
- let r = T === n.value, i = O === n.value;
89
- return /* @__PURE__ */ u("div", {
90
- id: P(n.value),
91
- role: "option",
92
- "aria-selected": r,
93
- "aria-disabled": n.disabled || void 0,
94
- className: c(t.option, {
95
- [t.optionActive]: i,
96
- [t.optionSelected]: r,
97
- [t.optionDisabled]: n.disabled
98
- }),
99
- onClick: () => !n.disabled && z(n.value),
100
- onMouseEnter: () => {
101
- n.disabled || k(n.value);
102
- },
103
- children: [/* @__PURE__ */ l("span", {
104
- className: t.optionLabel,
105
- children: n.label
106
- }), r && /* @__PURE__ */ l(e, {
107
- name: "check",
108
- size: "1em",
109
- className: t.checkMark
110
- })]
111
- }, String(n.value));
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
- d.displayName = "Select";
120
+ f.displayName = "Select";
117
121
  //#endregion
118
- export { d as Select };
122
+ export { f as Select };
@@ -1,5 +1,5 @@
1
1
  //#region packages/react/src/components/Select/select.module.less
2
- var e = "_wrapper_13o0n_1", t = "_trigger_13o0n_8", n = "_open_13o0n_30", r = "_small_13o0n_33", i = "_middle_13o0n_38", a = "_large_13o0n_43", o = "_value_13o0n_48", s = "_placeholder_13o0n_55", c = "_arrow_13o0n_62", l = "_arrowOpen_13o0n_67", u = "_dropdown_13o0n_71", d = "_dropdownFadeIn_13o0n_1", f = "_option_13o0n_98", p = "_optionLabel_13o0n_111", m = "_optionActive_13o0n_115", h = "_optionSelected_13o0n_118", g = "_checkMark_13o0n_122", _ = "_optionDisabled_13o0n_126", v = "_disabled_13o0n_133", y = {
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
- option: f,
16
- optionLabel: p,
17
- optionActive: m,
18
- optionSelected: h,
19
- checkMark: g,
20
- optionDisabled: _,
21
- disabled: v
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, g as checkMark, y as default, v as disabled, u as dropdown, d as dropdownFadeIn, a as large, i as middle, n as open, f as option, m as optionActive, _ as optionDisabled, p as optionLabel, h as optionSelected, s as placeholder, r as small, t as trigger, o as value, e as wrapper };
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,2 @@
1
+ export { TypingIndicator } from './TypingIndicator';
2
+ export type { TypingIndicatorProps } from './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,6 @@
1
+ import React from 'react';
2
+ /**
3
+ * recharts `<Legend formatter>` 用的标签渲染器:把图例**文字**裹成中性墨色
4
+ * `var(--stitch-text-primary)`,不吃系列色(色卡色另由 recharts 默认承载,不在此)。
5
+ */
6
+ export declare const renderLegendLabel: (value: React.ReactNode) => React.ReactElement;
@@ -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';