@morlay/dsh-session-mode 0.0.6 → 0.0.8

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.
@@ -7,7 +7,10 @@ import {
7
7
  IconAgentPresetOutlineRegular,
8
8
  IconChevronDownOutlineRegular,
9
9
  Menu,
10
- } from "@deepseek-ai/dsh-client-ui-primitives";
10
+ SeatButton,
11
+ Stack,
12
+ Text,
13
+ } from "@morlay/dsh-client-ui-primitives/client";
11
14
  import type { PropsLocale, PropsRuntime } from "@deepseek-ai/dsh-client-ui-slots";
12
15
  // Type-only:拉入本包 host 半的 Context / 投影声明(`sessionMode`),让 `projectionValues` 有类型。
13
16
  import type {} from "../index.ts";
@@ -15,7 +18,6 @@ import type {} from "../index.ts";
15
18
  import type {} from "@deepseek-ai/dsh-client-ui-conversation/client";
16
19
  import { selectMode } from "./api.ts";
17
20
  import { useRoster } from "./use-roster.ts";
18
- import css from "./SessionModeSeat.module.css";
19
21
 
20
22
  // 完整 props:composer 工具行左侧槽位的运行时 props + 本包的字典。
21
23
  export type SessionModeSeatProps = PropsRuntime<"conversation.input.left"> &
@@ -50,10 +52,12 @@ export function SessionModeSeat({ sessionId, useSessions, t }: SessionModeSeatPr
50
52
  // 开过 turn 的会话只读:chip 只写当前模式、点不动(判据与 host 拒绝切换读的是同一个投影)。
51
53
  if (editable === false) {
52
54
  return (
53
- <button type="button" className={css.seat} disabled title={t("lockedHint")}>
54
- <IconAgentPresetOutlineRegular className={css.seatIcon} />
55
- <span className={css.seatLabel}>{label}</span>
56
- </button>
55
+ <SeatButton
56
+ disabled
57
+ title={t("lockedHint")}
58
+ icon={<IconAgentPresetOutlineRegular />}
59
+ label={label}
60
+ />
57
61
  );
58
62
  }
59
63
 
@@ -66,10 +70,12 @@ export function SessionModeSeat({ sessionId, useSessions, t }: SessionModeSeatPr
66
70
  items={roster.modes.map((mode) => ({
67
71
  id: mode.id,
68
72
  label: (
69
- <span className={css.item}>
70
- <span className={css.itemName}>{mode.name}</span>
71
- <span className={css.itemDesc}>{mode.description ?? t("noDescription")}</span>
72
- </span>
73
+ <Stack gap={2}>
74
+ <Text size="md">{mode.name}</Text>
75
+ <Text size="sm" tone="tertiary">
76
+ {mode.description ?? t("noDescription")}
77
+ </Text>
78
+ </Stack>
73
79
  ),
74
80
  }))}
75
81
  selectedId={current}
@@ -88,23 +94,19 @@ export function SessionModeSeat({ sessionId, useSessions, t }: SessionModeSeatPr
88
94
  }}
89
95
  align="start"
90
96
  portal
91
- className={css.menuAnchor}
92
97
  anchor={
93
- <button
94
- type="button"
95
- className={css.seat}
98
+ <SeatButton
96
99
  aria-haspopup="menu"
97
100
  aria-expanded={open}
98
101
  title={error ?? t("seatHint")}
99
102
  disabled={busy}
103
+ icon={<IconAgentPresetOutlineRegular />}
104
+ label={label}
105
+ chevron={<IconChevronDownOutlineRegular />}
100
106
  onClick={() => {
101
107
  setOpen((value) => !value);
102
108
  }}
103
- >
104
- <IconAgentPresetOutlineRegular className={css.seatIcon} />
105
- <span className={css.seatLabel}>{label}</span>
106
- <IconChevronDownOutlineRegular className={css.chevron} />
107
- </button>
109
+ />
108
110
  }
109
111
  />
110
112
  );