@morlay/dsh-client-ui-primitives 0.0.8 → 0.0.10

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 (44) hide show
  1. package/README.md +17 -18
  2. package/dist/client-B68ClH7Y.mjs +3730 -0
  3. package/dist/client-Bbcei33M.cjs +17197 -0
  4. package/dist/client.cjs +54 -0
  5. package/dist/client.d.cts +4 -0
  6. package/dist/client.d.mts +2 -664
  7. package/dist/client.mjs +2 -3728
  8. package/dist/index-AMHtcyMt.d.mts +647 -0
  9. package/dist/index.cjs +54 -0
  10. package/dist/index.d.mts +4 -5
  11. package/dist/index.mjs +4 -5
  12. package/dist/reference-hchCWm3z.cjs +482 -0
  13. package/dist/reference.cjs +4 -0
  14. package/dist/reference.d.mts +3 -0
  15. package/dist/reference.mjs +1 -0
  16. package/package.json +28 -30
  17. package/src/client/controls/IconButton.tsx +4 -2
  18. package/src/client/controls/ModelRouteList.module.css +1 -1
  19. package/src/client/controls/SeatButton.module.css +1 -1
  20. package/src/client/controls/SeatButton.tsx +1 -2
  21. package/src/client/controls/classes.ts +1 -3
  22. package/src/client/controls/index.ts +1 -7
  23. package/src/client/index.ts +7 -1
  24. package/src/client/layout/Row.tsx +20 -17
  25. package/src/client/layout/Stack.tsx +19 -16
  26. package/src/client/layout/Text.tsx +8 -1
  27. package/src/client/schema-form/Editor.tsx +26 -9
  28. package/src/client/schema-form/SchemaForm.tsx +6 -1
  29. package/src/client/schema-form/index.ts +5 -0
  30. package/src/client/schema-form/schema-form.module.css +16 -16
  31. package/src/client/schema-form/testing/fake-scope.ts +0 -1
  32. package/src/client/schema-form/value.tsx +8 -3
  33. package/src/client/settings-form/SettingsFieldRow.module.css +1 -1
  34. package/src/client/settings-form/SettingsFieldRow.tsx +4 -2
  35. package/src/index.ts +6 -2
  36. package/src/reference-markdown.tsx +2 -6
  37. package/dist/rolldown-runtime-EAsCxrDo.mjs +0 -14
  38. package/locale/en.json +0 -6
  39. package/locale/zh.json +0 -6
  40. package/src/client/controls/SearchInput.module.css +0 -11
  41. package/src/client/controls/SearchInput.tsx +0 -22
  42. package/src/client/controls/Tabs.module.css +0 -48
  43. package/src/client/controls/Tabs.tsx +0 -57
  44. /package/src/{client/markdown-text.ts → markdown-text.ts} +0 -0
@@ -51,7 +51,7 @@
51
51
  outline-offset: -2px;
52
52
  }
53
53
 
54
- .item[aria-disabled='true'] {
54
+ .item[aria-disabled="true"] {
55
55
  cursor: not-allowed;
56
56
  opacity: 0.4;
57
57
  }
@@ -19,7 +19,7 @@
19
19
  }
20
20
 
21
21
  .seat:not(:disabled):hover,
22
- .seat[aria-expanded='true'],
22
+ .seat[aria-expanded="true"],
23
23
  .expanded {
24
24
  background: var(--dsw-alias-interactive-bg-hover);
25
25
  }
@@ -5,8 +5,7 @@ import type { ButtonHTMLAttributes, ReactNode } from "react";
5
5
  import { classes } from "./classes.ts";
6
6
  import css from "./SeatButton.module.css";
7
7
 
8
- export interface SeatButtonProps
9
- extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
8
+ export interface SeatButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
10
9
  // 座位上的图标(16px 那一档)。
11
10
  icon: ReactNode;
12
11
  // 座位上的文本;放不下就以省略号收窄。
@@ -1,7 +1,5 @@
1
1
  // 拼 class 名:CSS Modules 的映射查表给 `string | undefined`(`exactOptionalPropertyTypes` 下没命中的键是
2
2
  // undefined),一个没命中的类名不该在 DOM 上留一个空串。
3
3
  export function classes(...names: readonly (string | false | null | undefined)[]): string {
4
- return names
5
- .filter((name): name is string => typeof name === "string" && name !== "")
6
- .join(" ");
4
+ return names.filter((name): name is string => typeof name === "string" && name !== "").join(" ");
7
5
  }
@@ -8,10 +8,8 @@
8
8
  export { Bubble, type BubbleProps } from "./Bubble.tsx";
9
9
  export { Button, type ButtonProps, type ButtonTone } from "./Button.tsx";
10
10
  export { DisclosureRow, type DisclosureRowProps } from "./DisclosureRow.tsx";
11
- export { SearchInput, type SearchInputProps, type SearchInputWidth } from "./SearchInput.tsx";
12
11
  export { SeatButton, type SeatButtonProps } from "./SeatButton.tsx";
13
12
  export { Spinner, type SpinnerProps } from "./Spinner.tsx";
14
- export { Tabs, type TabItem, type TabsProps } from "./Tabs.tsx";
15
13
  export { TimeLabel, type TimeLabelProps } from "./TimeLabel.tsx";
16
14
  export { VisuallyHidden, type VisuallyHiddenProps } from "./VisuallyHidden.tsx";
17
15
  export { IconButton, type IconButtonProps } from "./IconButton.tsx";
@@ -21,10 +19,6 @@ export {
21
19
  type ModelRouteListProps,
22
20
  } from "./ModelRouteList.tsx";
23
21
  export { MultilineField, type MultilineFieldProps } from "./MultilineField.tsx";
24
- export {
25
- SearchSelect,
26
- type SearchSelectOption,
27
- type SearchSelectProps,
28
- } from "./SearchSelect.tsx";
22
+ export { SearchSelect, type SearchSelectOption, type SearchSelectProps } from "./SearchSelect.tsx";
29
23
  export { TagInput, type TagInputProps } from "./TagInput.tsx";
30
24
  export { mergeTags, parseTagList } from "./tags.ts";
@@ -12,7 +12,13 @@ export * from "./settings-form/index.ts";
12
12
  export * from "./controls/index.ts";
13
13
  // `Button` 与 `DisclosureRow` 是本包包装版(官方那份 + 文字不换行 / 危险档 / 两条固定的布局类):
14
14
  // 两个星号导出之间必须显式点名,否则判成歧义。
15
- export { Button, DisclosureRow, type ButtonProps, type ButtonTone, type DisclosureRowProps } from "./controls/index.ts";
15
+ export {
16
+ Button,
17
+ DisclosureRow,
18
+ type ButtonProps,
19
+ type ButtonTone,
20
+ type DisclosureRowProps,
21
+ } from "./controls/index.ts";
16
22
  // 按行 schema 自动生成的行配置页(原 `@morlay/dsh-client-ui-schema-form/client`,2026-09-28 合并进来):
17
23
  // 两者都是"对话 UI / 设置页的基础面",拆成两行会各自注册一遍、还要求每个 bundle 都插齐两行。
18
24
  // 只**具名导出**它那一面的门面:`export *` 会与 settings-form 的样式 / token 重名。
@@ -41,23 +41,26 @@ export interface RowProps extends HTMLAttributes<HTMLDivElement> {
41
41
  pad?: LayoutPad;
42
42
  }
43
43
 
44
- export const Row = forwardRef<HTMLElement, RowProps>(function Row({
45
- as: Element = "div",
46
- gap,
47
- align,
48
- justify,
49
- wrap = false,
50
- grow = false,
51
- boxed = false,
52
- fixed = false,
53
- narrow = false,
54
- push = false,
55
- plain = false,
56
- pad,
57
- className,
58
- children,
59
- ...rest
60
- }, ref): ReactNode {
44
+ export const Row = forwardRef<HTMLElement, RowProps>(function Row(
45
+ {
46
+ as: Element = "div",
47
+ gap,
48
+ align,
49
+ justify,
50
+ wrap = false,
51
+ grow = false,
52
+ boxed = false,
53
+ fixed = false,
54
+ narrow = false,
55
+ push = false,
56
+ plain = false,
57
+ pad,
58
+ className,
59
+ children,
60
+ ...rest
61
+ },
62
+ ref,
63
+ ): ReactNode {
61
64
  return (
62
65
  <Element
63
66
  ref={ref}
@@ -38,22 +38,25 @@ export interface StackProps extends HTMLAttributes<HTMLDivElement> {
38
38
  plain?: boolean;
39
39
  }
40
40
 
41
- export const Stack = forwardRef<HTMLElement, StackProps>(function Stack({
42
- as: Element = "div",
43
- gap,
44
- align,
45
- pad,
46
- grow = false,
47
- boxed = false,
48
- fixed = false,
49
- narrow = false,
50
- fill = false,
51
- scroll = false,
52
- plain = false,
53
- className,
54
- children,
55
- ...rest
56
- }, ref): ReactNode {
41
+ export const Stack = forwardRef<HTMLElement, StackProps>(function Stack(
42
+ {
43
+ as: Element = "div",
44
+ gap,
45
+ align,
46
+ pad,
47
+ grow = false,
48
+ boxed = false,
49
+ fixed = false,
50
+ narrow = false,
51
+ fill = false,
52
+ scroll = false,
53
+ plain = false,
54
+ className,
55
+ children,
56
+ ...rest
57
+ },
58
+ ref,
59
+ ): ReactNode {
57
60
  return (
58
61
  <Element
59
62
  ref={ref}
@@ -4,7 +4,14 @@
4
4
  import type { ElementType, HTMLAttributes, ReactNode } from "react";
5
5
  import { classes } from "../controls/classes.ts";
6
6
  import css from "./layout.module.css";
7
- import { sizeClass, toneClass, weightClass, type TextSize, type TextTone, type TextWeight } from "./scales.ts";
7
+ import {
8
+ sizeClass,
9
+ toneClass,
10
+ weightClass,
11
+ type TextSize,
12
+ type TextTone,
13
+ type TextWeight,
14
+ } from "./scales.ts";
8
15
 
9
16
  export interface TextProps extends Omit<HTMLAttributes<HTMLElement>, "children" | "color"> {
10
17
  // 渲染成哪个元素(标题用 `h4`、说明用 `p`、行内摘要用 `span`)。
@@ -201,7 +201,8 @@ function Row({
201
201
  </>
202
202
  ) : line.kind === "open" ? (
203
203
  <>
204
- <button className={css.lineFold}
204
+ <button
205
+ className={css.lineFold}
205
206
  data-role="fold"
206
207
  type="button"
207
208
  aria-expanded={!line.collapsed}
@@ -258,7 +259,8 @@ function Row({
258
259
  />
259
260
  );
260
261
  return (
261
- <div className={css.lineRow}
262
+ <div
263
+ className={css.lineRow}
262
264
  data-line={line.kind}
263
265
  data-field-path={line.path.join(".")}
264
266
  data-selected={selected === key ? "true" : undefined}
@@ -272,7 +274,8 @@ function Row({
272
274
  : undefined
273
275
  }
274
276
  >
275
- <span className={css.lineNumber}
277
+ <span
278
+ className={css.lineNumber}
276
279
  data-role="number"
277
280
  onClick={() => {
278
281
  onSelect(line.path);
@@ -362,7 +365,8 @@ function FieldLine({
362
365
  return (
363
366
  <>
364
367
  <span className={css.lineFoldSpacer} data-role="fold" />
365
- <span className={css.lineKey}
368
+ <span
369
+ className={css.lineKey}
366
370
  data-role="key"
367
371
  data-index={member?.index === undefined ? undefined : "true"}
368
372
  title={member?.key ?? line.node.key}
@@ -417,7 +421,8 @@ function FieldLine({
417
421
  ) : null}
418
422
  {/* 编辑态只留输入框:原值不再在它旁边画一遍。 */}
419
423
  {isEditing || line.variantsStandIn ? null : (
420
- <span className={css.valueSlot}
424
+ <span
425
+ className={css.valueSlot}
421
426
  data-role="value"
422
427
  onClick={() => {
423
428
  if (editable) onEdit(key);
@@ -435,7 +440,11 @@ function FieldLine({
435
440
  />
436
441
  {isEditing ? (
437
442
  // 编辑态:确认收起这一格的编辑、取消把值退回去——都在输入框旁边,不用记快捷键。
438
- <span className={classes(css.lineActions, css.hoverActions)} data-role="actions" data-editing="true">
443
+ <span
444
+ className={classes(css.lineActions, css.hoverActions)}
445
+ data-role="actions"
446
+ data-editing="true"
447
+ >
439
448
  <button
440
449
  type="button"
441
450
  aria-label={t("confirmEdit")}
@@ -549,7 +558,8 @@ function VariantSelect({
549
558
  setOpen(false);
550
559
  }}
551
560
  anchor={
552
- <button className={css.valueTrigger}
561
+ <button
562
+ className={css.valueTrigger}
553
563
  type="button"
554
564
  data-role="variant"
555
565
  disabled={disabled}
@@ -558,7 +568,9 @@ function VariantSelect({
558
568
  setOpen(true);
559
569
  }}
560
570
  >
561
- <span className={css.lineValue} data-tone="empty">{current?.label ?? ""}</span>
571
+ <span className={css.lineValue} data-tone="empty">
572
+ {current?.label ?? ""}
573
+ </span>
562
574
  <IconChevronDownOutlineRegular size={ICON_SIZE} />
563
575
  </button>
564
576
  }
@@ -585,7 +597,12 @@ function LinePrefix({
585
597
  const indexed = member !== undefined && member.index !== undefined;
586
598
  return (
587
599
  <>
588
- <span className={css.lineKey} data-role="key" data-index={indexed ? "true" : undefined} title={key}>
600
+ <span
601
+ className={css.lineKey}
602
+ data-role="key"
603
+ data-index={indexed ? "true" : undefined}
604
+ title={key}
605
+ >
589
606
  {key}
590
607
  </span>
591
608
  <span className={css.lineToken}>{indexed ? " " : ": "}</span>
@@ -26,7 +26,12 @@ export function SchemaForm(props: SchemaFormComponentProps): ReactNode {
26
26
  save: t("save"),
27
27
  saving: t("saving"),
28
28
  };
29
- if (!state.configured) return <p className={css.hint} role="status">{t("noSchema")}</p>;
29
+ if (!state.configured)
30
+ return (
31
+ <p className={css.hint} role="status">
32
+ {t("noSchema")}
33
+ </p>
34
+ );
30
35
  return (
31
36
  <SettingsForm
32
37
  labels={labels}
@@ -57,6 +57,11 @@ export { parseFor } from "./fields.tsx";
57
57
  export { containerShape, editorLines, visibleFields } from "./lines.ts";
58
58
  export type { EditorLine, FoldState } from "./lines.ts";
59
59
  export { SchemaFormController, canRender, optionsFor, projectRoot } from "./controller.ts";
60
+ // 行投影的输入件:外部的「真配置验收」要按与控制器同一套算法自己排行(见各消费包 client 面的 __tests__)。
61
+ export { addableAt, fieldKey } from "./controller.ts";
62
+ export { readPath } from "./schema-node.ts";
63
+ export type { SchemaFormTranslate } from "./slot-contract.ts";
64
+ export { zh } from "./locales.ts";
60
65
  export { failureOf } from "./draft.ts";
61
66
  export type { ValidationFailure } from "./draft.ts";
62
67
  export { walkFields, projectNode } from "./schema-node.ts";
@@ -27,40 +27,40 @@
27
27
  }
28
28
 
29
29
  /* 选中一行(点行号):整行留一层底色,便于对着行号找内容。 */
30
- .lineRow[data-selected='true'] {
30
+ .lineRow[data-selected="true"] {
31
31
  background: var(--dsw-alias-bg-layer-3);
32
32
  }
33
33
 
34
34
  /* 本页改过还没保存:左边一道强调色,和「已经存进用户层」的浅灰区分开。 */
35
- .lineRow[data-dirty='true'] {
35
+ .lineRow[data-dirty="true"] {
36
36
  box-shadow: inset 2px 0 0 var(--dsw-alias-brand-primary);
37
37
  }
38
38
 
39
- .lineRow[data-overridden='true'] {
39
+ .lineRow[data-overridden="true"] {
40
40
  box-shadow: inset 2px 0 0 var(--dsw-elevation-stroke-color);
41
41
  }
42
42
 
43
43
  /* 改过的字段名用强调色(存没存看左边那道条);出错时红优先。 */
44
- .lineRow[data-dirty='true'] [data-role='key'] {
44
+ .lineRow[data-dirty="true"] [data-role="key"] {
45
45
  color: var(--dsw-alias-brand-primary);
46
46
  }
47
47
 
48
- .lineRow[data-overridden='true'] [data-role='key'] {
48
+ .lineRow[data-overridden="true"] [data-role="key"] {
49
49
  color: var(--dsw-alias-brand-primary);
50
50
  }
51
51
 
52
52
  /* 有问题的行:半透明红底 + 左侧一道实红条,字段名与注释位那句都是红字。 */
53
- .lineRow[data-invalid='true'] {
53
+ .lineRow[data-invalid="true"] {
54
54
  background: color-mix(in srgb, var(--dsw-alias-state-error-secondary) 12%, transparent);
55
55
  box-shadow: inset 2px 0 0 var(--dsw-alias-state-error-primary);
56
56
  }
57
57
 
58
- .lineRow[data-invalid='true'] [data-role='key'] {
58
+ .lineRow[data-invalid="true"] [data-role="key"] {
59
59
  color: var(--dsw-alias-state-error-primary);
60
60
  }
61
61
 
62
62
  /* 行内的行为按钮(撤回 / 恢复默认 / 复制 / 移除):平时透明,悬停这一行才显形。 */
63
- .lineRow:hover [data-role='actions'] {
63
+ .lineRow:hover [data-role="actions"] {
64
64
  opacity: 1;
65
65
  }
66
66
 
@@ -116,7 +116,7 @@
116
116
  color: var(--dsw-alias-label-primary);
117
117
  }
118
118
 
119
- .lineKey[data-index='true'] {
119
+ .lineKey[data-index="true"] {
120
120
  color: var(--dsw-alias-label-caption);
121
121
  }
122
122
 
@@ -138,15 +138,15 @@
138
138
  color: var(--dsw-alias-state-business-primary);
139
139
  }
140
140
 
141
- .lineValue[data-tone='number'] {
141
+ .lineValue[data-tone="number"] {
142
142
  color: var(--dsw-alias-state-warn-primary);
143
143
  }
144
144
 
145
- .lineValue[data-tone='boolean'] {
145
+ .lineValue[data-tone="boolean"] {
146
146
  color: var(--dsw-alias-state-success-primary);
147
147
  }
148
148
 
149
- .lineValue[data-tone='empty'] {
149
+ .lineValue[data-tone="empty"] {
150
150
  color: var(--dsw-alias-label-caption);
151
151
  }
152
152
 
@@ -296,18 +296,18 @@
296
296
 
297
297
  /* 编辑态的两个按钮常显,而且**要有底色与描边**:行底色上只有淡色图标是看不见的,
298
298
  所以这里给实体按钮(theme 的描边 + 一层底),确认用成功档、取消用中性档。 */
299
- .hoverActions[data-editing='true'] {
299
+ .hoverActions[data-editing="true"] {
300
300
  opacity: 1;
301
301
  gap: 6px;
302
302
  }
303
303
 
304
- .hoverActions[data-editing='true'] > button {
304
+ .hoverActions[data-editing="true"] > button {
305
305
  box-shadow: 0 0 0 0.5px var(--dsw-elevation-stroke-color);
306
306
  background: var(--dsw-alias-bg-layer-1);
307
307
  color: var(--dsw-alias-label-primary);
308
308
  }
309
309
 
310
- .hoverActions[data-editing='true'] > button:first-of-type {
310
+ .hoverActions[data-editing="true"] > button:first-of-type {
311
311
  color: var(--dsw-alias-state-success-primary);
312
312
  }
313
313
 
@@ -322,7 +322,7 @@
322
322
  margin-left: 6px;
323
323
  }
324
324
 
325
- .addWrap[data-invalid='true'] input {
325
+ .addWrap[data-invalid="true"] input {
326
326
  border-color: var(--dsw-alias-state-error-primary);
327
327
  }
328
328
 
@@ -27,7 +27,6 @@ export class FakeScope implements ConfigForm<Section> {
27
27
  user: undefined,
28
28
  writable: true,
29
29
  revision: 7,
30
- mode: "host",
31
30
  ...overrides,
32
31
  };
33
32
  }
@@ -56,7 +56,10 @@ export function InlineValue({ owner }: { owner: SchemaFieldOwnerProps }): ReactN
56
56
  const text = tokenText(owner.value);
57
57
  return (
58
58
  <TruncatedTooltip label={text}>
59
- <span className={css.lineValue} data-tone={owner.node.readOnly === null ? tokenTone(owner.value) : "empty"}>
59
+ <span
60
+ className={css.lineValue}
61
+ data-tone={owner.node.readOnly === null ? tokenTone(owner.value) : "empty"}
62
+ >
60
63
  {text}
61
64
  </span>
62
65
  </TruncatedTooltip>
@@ -102,7 +105,8 @@ function OptionSelect({
102
105
  setOpen(false);
103
106
  }}
104
107
  anchor={
105
- <button className={css.valueTrigger}
108
+ <button
109
+ className={css.valueTrigger}
106
110
  type="button"
107
111
  disabled={owner.disabled}
108
112
  aria-label={owner.label}
@@ -110,7 +114,8 @@ function OptionSelect({
110
114
  setOpen(true);
111
115
  }}
112
116
  >
113
- <span className={css.lineValue}
117
+ <span
118
+ className={css.lineValue}
114
119
  data-tone={current === undefined ? tokenTone(owner.value) : tokenTone(current.value)}
115
120
  >
116
121
  {label}
@@ -5,7 +5,7 @@
5
5
  flex-direction: column;
6
6
  }
7
7
 
8
- .row[data-divider='true'] {
8
+ .row[data-divider="true"] {
9
9
  border-top: 0.5px solid var(--dsw-alias-border-l2);
10
10
  }
11
11
 
@@ -6,8 +6,10 @@ import type { HTMLAttributes, ReactNode } from "react";
6
6
  import { classes } from "../controls/classes.ts";
7
7
  import css from "./SettingsFieldRow.module.css";
8
8
 
9
- export interface SettingsFieldRowProps
10
- extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "color"> {
9
+ export interface SettingsFieldRowProps extends Omit<
10
+ HTMLAttributes<HTMLDivElement>,
11
+ "children" | "color"
12
+ > {
11
13
  // 字段名。
12
14
  label: string;
13
15
  // 字段下面那句说明("这一项到底管什么")。
package/src/index.ts CHANGED
@@ -1,4 +1,8 @@
1
+ /**
2
+ * 引用解析的 host 侧工具。
3
+ *
4
+ * 本包是**普通库**(UI 原语 + 引用解析),不是 cordis 插件包:没有 `./client` 那类"浏览器半"出口,
5
+ * 默认出口就是库本体(浏览器组件),这里只留 host 侧也用得着的那部分。
6
+ */
1
7
  export { findReferences, parseReferenceToken } from "./reference.ts";
2
8
  export type { Reference, ReferenceSpan } from "./reference.ts";
3
-
4
- export function apply(): void {}
@@ -13,12 +13,8 @@
13
13
  // 因此 `code-review` 这种没有路径特征的 skill 也能稳定成 chip、而普通 inline code 不会。
14
14
 
15
15
  import { memo, useMemo } from "react";
16
- import { MarkdownText } from "./client/markdown-text.ts";
17
- import type {
18
- MarkdownFileMentions,
19
- MarkdownLabels,
20
- MarkdownPathImages,
21
- } from "./client/markdown-text.ts";
16
+ import { MarkdownText } from "./markdown-text.ts";
17
+ import type { MarkdownFileMentions, MarkdownLabels, MarkdownPathImages } from "./markdown-text.ts";
22
18
  import {
23
19
  findReferences,
24
20
  formatReference,
@@ -1,14 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __defProp = Object.defineProperty;
3
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
4
- var __exportAll = (all, no_symbols) => {
5
- let target = {};
6
- for (var name in all) __defProp(target, name, {
7
- get: all[name],
8
- enumerable: true
9
- });
10
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
11
- return target;
12
- };
13
- //#endregion
14
- export { __exportAll as n, __commonJSMin as t };
package/locale/en.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "meta": {
3
- "title": "UI Primitives",
4
- "description": "The shared base for the conversation UI and the settings pages: the css-in-js styling layer, the reference parser and renderer (one source shared with the host), the staged settings-form primitives forked from upstream, and the schema-generated row config pages (field-slot injection). Inlined by the client rows that use it, not an assembly row."
5
- }
6
- }
package/locale/zh.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "meta": {
3
- "title": "UI 基础层",
4
- "description": "对话 UI 与设置页共用的基础面:css-in-js 样式层、host 与 client 共用一份源码的引用解析与渲染转换、上游 fork 过来的暂存式设置表单原语,以及按 schema 自动生成的行配置页(字段槽注入)。随用到它的 client 行内联,不是装配行。"
5
- }
6
- }
@@ -1,11 +0,0 @@
1
- /* 宽度档:搜索框那一档是固定宽(列表里的搜索行),`full` 撑满。 */
2
- .search {
3
- width: 360px;
4
- max-width: 100%;
5
- flex: none;
6
- }
7
-
8
- .full {
9
- width: 100%;
10
- flex: none;
11
- }
@@ -1,22 +0,0 @@
1
- // 搜索输入:官方 `Input` + 宽度档(列表与设置面的搜索框是固定一档宽)。
2
-
3
- import type { ComponentProps, ReactNode } from "react";
4
- import { Input } from "@deepseek-ai/dsh-client-ui-primitives";
5
- import { classes } from "./classes.ts";
6
- import css from "./SearchInput.module.css";
7
-
8
- export type SearchInputWidth = "search" | "full";
9
-
10
- export type SearchInputProps = ComponentProps<typeof Input> & {
11
- // 宽度档:`search`(360px,列表的搜索行)或 `full`(撑满)。
12
- width?: SearchInputWidth;
13
- };
14
-
15
- export function SearchInput({ width = "search", className, ...rest }: SearchInputProps): ReactNode {
16
- return (
17
- <Input
18
- className={classes(className, width === "search" ? css.search : css.full)}
19
- {...rest}
20
- />
21
- );
22
- }
@@ -1,48 +0,0 @@
1
- /* 页内的 tab 条:与官方会话头部同形(`ConversationRoot.module.css` 的 .tabs/.tab/.tabActive),
2
- 选中态是品牌蓝文字 + 2px 下划线。 */
3
- .tabs {
4
- position: relative;
5
- z-index: 1;
6
- display: flex;
7
- gap: 36px;
8
- margin-top: 10px;
9
- padding-left: 8px;
10
- flex: none;
11
- }
12
-
13
- .tab {
14
- position: relative;
15
- padding: 0 0 9px;
16
- border: none;
17
- background: transparent;
18
- font-size: 13px;
19
- line-height: 16px;
20
- font-weight: 500;
21
- color: var(--dsw-alias-label-tertiary);
22
- cursor: pointer;
23
- }
24
-
25
- /* 下划线始终占位(透明到选中),选中时只换颜色——文字因此不会跳。 */
26
- .tab::after {
27
- content: "";
28
- position: absolute;
29
- right: 0;
30
- bottom: -1px;
31
- left: 0;
32
- height: 2px;
33
- border-radius: 2px;
34
- background: transparent;
35
- }
36
-
37
- .tabActive {
38
- color: var(--dsw-alias-state-business-primary);
39
- }
40
-
41
- .tabActive::after {
42
- background: var(--dsw-alias-state-business-primary);
43
- }
44
-
45
- .tab:disabled {
46
- cursor: not-allowed;
47
- opacity: 0.4;
48
- }