@deepseek-ai/dsh-client-ui-primitives 0.2.2-rc.5 → 0.2.3-alpha.2

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 (137) hide show
  1. package/README.i18n.yaml +12 -12
  2. package/README.md +21 -10
  3. package/README.zh.md +21 -10
  4. package/lib/index.js +2961 -868
  5. package/lib/index.js.map +1 -1
  6. package/lib/types/Checkbox.d.ts.map +1 -1
  7. package/lib/types/Checkbox.js.map +1 -1
  8. package/lib/types/HoverCard.d.ts +5 -3
  9. package/lib/types/HoverCard.d.ts.map +1 -1
  10. package/lib/types/HoverCard.js.map +1 -1
  11. package/lib/types/ImageLightbox.d.ts.map +1 -1
  12. package/lib/types/ImageLightbox.js.map +1 -1
  13. package/lib/types/LinkIcon.js.map +1 -1
  14. package/lib/types/Marquee.d.ts +35 -0
  15. package/lib/types/Marquee.d.ts.map +1 -0
  16. package/lib/types/Marquee.js.map +1 -0
  17. package/lib/types/Menu.d.ts +24 -5
  18. package/lib/types/Menu.d.ts.map +1 -1
  19. package/lib/types/Menu.js.map +1 -1
  20. package/lib/types/PermissionIcon.d.ts.map +1 -1
  21. package/lib/types/PermissionIcon.js.map +1 -1
  22. package/lib/types/SearchField.d.ts +18 -0
  23. package/lib/types/SearchField.d.ts.map +1 -0
  24. package/lib/types/SearchField.js.map +1 -0
  25. package/lib/types/Switch.d.ts +5 -1
  26. package/lib/types/Switch.d.ts.map +1 -1
  27. package/lib/types/Switch.js.map +1 -1
  28. package/lib/types/TerminalBlock.js.map +1 -1
  29. package/lib/types/clipboard.d.ts +4 -2
  30. package/lib/types/clipboard.d.ts.map +1 -1
  31. package/lib/types/clipboard.js.map +1 -1
  32. package/lib/types/icons/artwork.d.ts +16 -0
  33. package/lib/types/icons/artwork.d.ts.map +1 -1
  34. package/lib/types/icons/artwork.js.map +1 -1
  35. package/lib/types/icons/index.d.ts +21 -5
  36. package/lib/types/icons/index.d.ts.map +1 -1
  37. package/lib/types/icons/index.js.map +1 -1
  38. package/lib/types/icons/props.d.ts +1 -1
  39. package/lib/types/icons/props.d.ts.map +1 -1
  40. package/lib/types/icons/shared-artwork.js.map +1 -1
  41. package/lib/types/index.d.ts +2 -1
  42. package/lib/types/index.d.ts.map +1 -1
  43. package/lib/types/index.js.map +1 -1
  44. package/lib/types/input-modality.d.ts +5 -0
  45. package/lib/types/input-modality.d.ts.map +1 -1
  46. package/lib/types/input-modality.js.map +1 -1
  47. package/lib/types/markdown/cjkFriendlyStrong.d.ts +4 -1
  48. package/lib/types/markdown/cjkFriendlyStrong.d.ts.map +1 -1
  49. package/lib/types/markdown/cjkFriendlyStrong.js.map +1 -1
  50. package/lib/types/useMenuSubmenu.d.ts +1 -0
  51. package/lib/types/useMenuSubmenu.d.ts.map +1 -1
  52. package/lib/types/useMenuSubmenu.js.map +1 -1
  53. package/lib/types/useModalLayer.d.ts +3 -1
  54. package/lib/types/useModalLayer.d.ts.map +1 -1
  55. package/lib/types/useModalLayer.js.map +1 -1
  56. package/package.json +8 -8
  57. package/src/Checkbox.module.css +43 -2
  58. package/src/Checkbox.tsx +7 -3
  59. package/src/HoverCard.module.css +42 -0
  60. package/src/HoverCard.tsx +53 -49
  61. package/src/ImageLightbox.tsx +2 -1
  62. package/src/Input.module.css +7 -1
  63. package/src/LinkIcon.tsx +9 -9
  64. package/src/Marquee.module.css +47 -0
  65. package/src/Marquee.tsx +109 -0
  66. package/src/Menu.module.css +34 -4
  67. package/src/Menu.tsx +138 -35
  68. package/src/Modal.module.css +8 -4
  69. package/src/PermissionIcon.tsx +10 -12
  70. package/src/Pill.module.css +11 -1
  71. package/src/RiskConfirmation.module.css +6 -1
  72. package/src/SearchField.module.css +74 -0
  73. package/src/SearchField.tsx +37 -0
  74. package/src/SegmentedTabs.module.css +4 -10
  75. package/src/Switch.tsx +7 -1
  76. package/src/TerminalBlock.tsx +4 -4
  77. package/src/clipboard.ts +29 -15
  78. package/src/icons/artwork.ts +89 -85
  79. package/src/icons/index.tsx +29 -5
  80. package/src/icons/props.ts +1 -1
  81. package/src/icons/shared-artwork.tsx +14 -14
  82. package/src/index.ts +2 -1
  83. package/src/input-modality.ts +13 -5
  84. package/src/markdown/MarkdownText.module.css +21 -10
  85. package/src/markdown/cjkFriendlyStrong.ts +9 -2
  86. package/src/useMenuSubmenu.ts +6 -3
  87. package/src/useModalLayer.ts +5 -2
  88. package/lib/AnimatedRows.module.css +0 -7
  89. package/lib/Button.module.css +0 -84
  90. package/lib/Checkbox.module.css +0 -28
  91. package/lib/CodeCard.module.css +0 -85
  92. package/lib/CommandText.module.css +0 -12
  93. package/lib/ConnectionIndicator.module.css +0 -120
  94. package/lib/DetailDocument.module.css +0 -67
  95. package/lib/DiffBlock.module.css +0 -82
  96. package/lib/DisclosureRow.module.css +0 -115
  97. package/lib/FileTypeIcon.module.css +0 -50
  98. package/lib/HoverCard.module.css +0 -108
  99. package/lib/ImageLightbox.module.css +0 -54
  100. package/lib/ImagePreview.module.css +0 -24
  101. package/lib/InlineEditor.module.css +0 -23
  102. package/lib/Input.module.css +0 -38
  103. package/lib/JsonTree.module.css +0 -371
  104. package/lib/Menu.module.css +0 -443
  105. package/lib/MenuGroup.module.css +0 -37
  106. package/lib/MenuSurface.module.css +0 -65
  107. package/lib/Modal.module.css +0 -147
  108. package/lib/PathLabel.module.css +0 -28
  109. package/lib/Pill.module.css +0 -30
  110. package/lib/QuotePreview.module.css +0 -138
  111. package/lib/ReadBlock.module.css +0 -45
  112. package/lib/RiskConfirmation.module.css +0 -47
  113. package/lib/RowDragPreview.module.css +0 -12
  114. package/lib/SearchBlock.module.css +0 -114
  115. package/lib/SegmentedControl.module.css +0 -81
  116. package/lib/SegmentedTabs.module.css +0 -77
  117. package/lib/ShortcutKeys.module.css +0 -33
  118. package/lib/StateDot.module.css +0 -100
  119. package/lib/Switch.module.css +0 -49
  120. package/lib/Tag.module.css +0 -57
  121. package/lib/TerminalBlock.module.css +0 -207
  122. package/lib/TextShimmer.module.css +0 -88
  123. package/lib/Toast.module.css +0 -102
  124. package/lib/Tooltip.module.css +0 -68
  125. package/lib/UserMessageBubble.module.css +0 -11
  126. package/lib/WebBlock.module.css +0 -153
  127. package/lib/ZoomControls.module.css +0 -54
  128. package/lib/markdown/CodeBlock.module.css +0 -209
  129. package/lib/markdown/JsonBlock.module.css +0 -34
  130. package/lib/markdown/MarkdownText.module.css +0 -511
  131. package/lib/settings-form/SettingsForm.module.css +0 -53
  132. package/lib/settings-form/fields.module.css +0 -153
  133. package/lib/types/rank-by-name.d.ts +0 -22
  134. package/lib/types/rank-by-name.d.ts.map +0 -1
  135. package/lib/types/rank-by-name.js.map +0 -1
  136. package/lib/user-text.module.css +0 -46
  137. package/src/rank-by-name.ts +0 -93
@@ -1,153 +0,0 @@
1
- .block {
2
- --dsl-web-radius: var(--dsw-radius-lg);
3
-
4
- margin: 16px 0;
5
- padding: 12px 14px;
6
- color: var(--dsw-alias-label-primary);
7
- background: var(--dsw-alias-markdown-code-block);
8
- border-radius: var(--dsl-web-radius);
9
- }
10
-
11
- /* The provider answer reads as body prose above the citation list; its own
12
- MarkdownText margins are trimmed so the list sits tight under it. */
13
- .answer {
14
- margin-bottom: 8px;
15
- }
16
-
17
- .answer > :global(div) > :first-child {
18
- margin-top: 0;
19
- }
20
-
21
- .answer > :global(div) > :last-child {
22
- margin-bottom: 0;
23
- }
24
-
25
- /* The citation list: ordered so each source reads as a numbered reference. The
26
- whole list — the sources the tool returned, matching what the model saw —
27
- renders here; a max-height caps the card so a long list scrolls in place
28
- rather than growing the card unbounded. The height is a design constant of the
29
- card's geometry, not a deployment choice, so it lives here rather than a plugin
30
- config field.
31
-
32
- `overflow-y` makes this a scroll container, which also clips inline-start
33
- overflow: a marker wider than `padding-left` loses its leading digits with no
34
- way to scroll them back. Markers are right-aligned to the content edge, so the
35
- padding must fit the widest one the list can produce. `searchMaxResults` is an
36
- unbounded positive integer, so the padding is sized in `em` — against this
37
- element's own font, the one a marker inherits — to hold a three-digit marker
38
- (`999. ` measures 2.35em in the app font stack) plus the gap the one-digit
39
- case already had. */
40
- .sources {
41
- margin: 0;
42
- padding-left: 2.5em;
43
- display: flex;
44
- flex-direction: column;
45
- gap: 10px;
46
- max-height: 320px;
47
- overflow-y: auto;
48
- }
49
-
50
- .source {
51
- min-width: 0;
52
- }
53
-
54
- .sourceLink {
55
- color: var(--dsw-alias-link);
56
- font-size: 14px;
57
- font-weight: 500;
58
- line-height: 20px;
59
- word-break: break-word;
60
- text-decoration: none;
61
- }
62
-
63
- /* Leading URL glyph inside source and fetch links; rides the link color.
64
- 1.1em follows each link's own font size. */
65
- .linkIcon {
66
- width: 1.1em;
67
- height: 1.1em;
68
- vertical-align: -0.25em;
69
- margin-right: 5px;
70
- }
71
-
72
- .sourceLink:focus-visible {
73
- text-decoration: underline dotted;
74
- text-underline-offset: 3px;
75
- }
76
-
77
- @media (hover: hover) {
78
- .sourceLink:hover {
79
- text-decoration: underline dotted;
80
- text-underline-offset: 3px;
81
- }
82
- }
83
-
84
- .snippet {
85
- margin-top: 2px;
86
- color: var(--dsw-alias-label-secondary);
87
- font-size: 13px;
88
- line-height: 19px;
89
- word-break: break-word;
90
- }
91
-
92
- .published {
93
- margin-top: 2px;
94
- color: var(--dsw-alias-label-tertiary);
95
- font: var(--dsw-font-xs-13);
96
- }
97
-
98
- .truncated {
99
- margin-top: 8px;
100
- color: var(--dsw-alias-label-tertiary);
101
- font: var(--dsw-font-xs-13);
102
- }
103
-
104
- .empty {
105
- color: var(--dsw-alias-label-secondary);
106
- font: var(--dsw-font-xs-13);
107
- }
108
-
109
- /* The fetch card is a compact summary: the URL over a status/truncation row. */
110
- .fetch {
111
- display: flex;
112
- flex-direction: column;
113
- gap: 6px;
114
- }
115
-
116
- .fetchUrl {
117
- color: var(--dsw-alias-link);
118
- font-family: var(--ds-font-family-code);
119
- font-size: 13px;
120
- font-weight: 500;
121
- line-height: 19px;
122
- word-break: break-all;
123
- text-decoration: none;
124
- }
125
-
126
- .fetchUrl:focus-visible {
127
- text-decoration: underline dotted;
128
- text-underline-offset: 3px;
129
- }
130
-
131
- @media (hover: hover) {
132
- .fetchUrl:hover {
133
- text-decoration: underline dotted;
134
- text-underline-offset: 3px;
135
- }
136
- }
137
-
138
- .fetchMeta {
139
- display: flex;
140
- align-items: baseline;
141
- gap: 12px;
142
- }
143
-
144
- .status {
145
- color: var(--dsw-alias-label-secondary);
146
- font: var(--dsw-font-xs-13);
147
- }
148
-
149
- /* The fetch card's truncation note sits inline beside the status, so it drops
150
- the search card's top margin. */
151
- .fetch .truncated {
152
- margin-top: 0;
153
- }
@@ -1,54 +0,0 @@
1
- /* Zero specificity lets an owner className move the toolbar regardless of stylesheet order. */
2
- :where(.panel) {
3
- bottom: 14px;
4
- }
5
-
6
- .panel {
7
- position: absolute;
8
- z-index: 2;
9
- inset-inline-start: 50%;
10
- display: flex;
11
- align-items: center;
12
- gap: 2px;
13
- box-sizing: border-box;
14
- padding: 4px 6px;
15
- /* TODO: replace this border and the literal shadow with `border: 0` and `--dsw-elevation-panel`
16
- * (docs/web-styling.md#component-rules), with visual review of the document preview. */
17
- border: 0.5px solid var(--dsw-alias-border-l3);
18
- border-radius: var(--dsw-radius-lg);
19
- color: var(--dsw-alias-label-primary);
20
- background: var(--dsw-alias-bg-layer-1);
21
- box-shadow: 0 8px 24px light-dark(#0000001a, #00000060), 0 2px 5px light-dark(#00000009, #00000035);
22
- font-size: 12px;
23
- line-height: 18px;
24
- opacity: 0;
25
- pointer-events: none;
26
- transform: translate(-50%, 16px) scale(0.98);
27
- transition: opacity 160ms ease-in, transform 160ms cubic-bezier(0.4, 0, 1, 1);
28
- will-change: opacity, transform;
29
- }
30
-
31
- .visible {
32
- opacity: 1;
33
- pointer-events: auto;
34
- transform: translate(-50%, 0) scale(1);
35
- transition: opacity 140ms ease-out, transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
36
- }
37
-
38
- .controlAnchor { display: flex; }
39
- .zoomButton { width: 28px; padding: 0; flex: none; }
40
- .percent { display: inline-flex; align-items: center; justify-content: center; gap: 2px; min-width: 58px; padding-inline: 6px; font-variant-numeric: tabular-nums; }
41
- .zoomMenu { min-width: 112px; }
42
-
43
- @media (hover: none), (pointer: coarse) {
44
- .panel {
45
- opacity: 1;
46
- pointer-events: auto;
47
- transform: translate(-50%, 0) scale(1);
48
- }
49
- }
50
-
51
- @media (prefers-reduced-motion: reduce) {
52
- .panel,
53
- .visible { transition-duration: 0.01ms; }
54
- }
@@ -1,209 +0,0 @@
1
- /* Visual baseline: deepsuite `@deepseek/md` code-block.css. Highlight colors
2
- stay on the existing shiki `--shiki-*` sheet (not Prism highlight.css). */
3
-
4
- .block {
5
- --dsl-code-block-banner-background-color: var(--dsw-alias-markdown-code-block-banner);
6
- --dsl-code-block-border-radius: var(--dsw-radius-lg);
7
- /* Local 11/18 instead of the shared --dsw-font-xs-13: the banner scales
8
- with the markdown 0.875 ladder without shrinking every other xs-13 use. */
9
- --dsl-code-block-banner-font: 11px/18px var(--dsw-font-family);
10
- --dsl-code-block-content-font: var(--dsw-font-markdown-code-block);
11
- --dsl-code-block-background: var(--dsw-alias-markdown-code-block);
12
-
13
- position: relative;
14
- margin: 16px 0;
15
- color: var(--dsw-alias-label-primary);
16
- background: var(--dsl-code-block-background);
17
- border-radius: var(--dsl-code-block-border-radius);
18
- }
19
-
20
- .block:not(:last-child) {
21
- margin-bottom: 11px;
22
- }
23
-
24
- .bannerWrap {
25
- position: sticky;
26
- top: 0;
27
- z-index: 6;
28
- background-color: var(--dsw-alias-bg-base);
29
- border-top-left-radius: var(--dsl-code-block-border-radius);
30
- border-top-right-radius: var(--dsl-code-block-border-radius);
31
- }
32
-
33
- .banner {
34
- background: var(--dsl-code-block-banner-background-color);
35
- padding: 9px 14px;
36
- display: flex;
37
- justify-content: space-between;
38
- align-items: center;
39
- gap: 12px;
40
- font: var(--dsl-code-block-banner-font);
41
- border-top-left-radius: var(--dsl-code-block-border-radius);
42
- border-top-right-radius: var(--dsl-code-block-border-radius);
43
- }
44
-
45
- .infostring {
46
- color: var(--dsw-alias-label-primary);
47
- font-family: var(--ds-font-family-code);
48
- font-size: 11px;
49
- line-height: 18px;
50
- min-width: 0;
51
- overflow: hidden;
52
- text-overflow: ellipsis;
53
- white-space: nowrap;
54
- }
55
-
56
- .action {
57
- display: flex;
58
- align-items: center;
59
- flex-shrink: 0;
60
- }
61
-
62
- .copyButton {
63
- background-color: rgb(255 255 255 / 0);
64
- border: none;
65
- padding: 0;
66
- margin: 0;
67
- color: inherit;
68
- cursor: pointer;
69
- font: inherit;
70
- }
71
-
72
- /* Consumers may turn the stable content node into a viewport without changing
73
- the default CodeBlock layout. */
74
- .content {
75
- display: contents;
76
- }
77
-
78
- .block :where(pre) {
79
- font: var(--dsl-code-block-content-font);
80
- padding: 16px;
81
- margin: 0 !important;
82
- overflow-x: auto;
83
- white-space: pre-wrap;
84
- word-break: break-all;
85
- background: var(--dsl-code-block-background);
86
- /* Bottom radii live on <pre>: overflow:hidden on .block would kill the
87
- sticky banner, and this opaque fill otherwise squares off the wrapper. */
88
- border-bottom-left-radius: var(--dsl-code-block-border-radius);
89
- border-bottom-right-radius: var(--dsl-code-block-border-radius);
90
- }
91
-
92
- /* Shiki inlines its theme background var; route it to the repo token. */
93
- .block :where(pre.shiki) {
94
- background: var(--dsl-code-block-background) !important;
95
- }
96
-
97
- .block :where(pre) code {
98
- font: inherit;
99
- background: none;
100
- padding: 0;
101
- }
102
-
103
- .plain {
104
- color: var(--dsw-alias-label-primary);
105
- }
106
-
107
- .card :where(pre) {
108
- padding: 6px 22px 20px;
109
- word-break: normal;
110
- overflow-wrap: anywhere;
111
- }
112
-
113
- .card[data-code-wrap='false'] {
114
- --dsl-code-block-line-white-space: pre;
115
- }
116
-
117
- .card[data-code-wrap='false'] :where(pre) {
118
- white-space: pre;
119
- overflow-wrap: normal;
120
- }
121
-
122
- .numbered :where(pre) code {
123
- display: block;
124
- counter-reset: source-line;
125
- white-space: normal;
126
- }
127
-
128
- .numbered :where(pre) code > :global(.line) {
129
- position: relative;
130
- display: block;
131
- min-height: 1lh;
132
- padding-inline-start: calc(var(--dsl-code-block-line-number-width) + 12px);
133
- counter-increment: source-line;
134
- white-space: var(--dsl-code-block-line-white-space, pre-wrap);
135
- }
136
-
137
- .numbered :where(pre) code > :global(.line)::before {
138
- position: absolute;
139
- inset-inline-start: 0;
140
- width: var(--dsl-code-block-line-number-width);
141
- color: var(--dsw-alias-label-tertiary);
142
- text-align: end;
143
- content: counter(source-line);
144
- user-select: none;
145
- }
146
-
147
- /* Diff fences paint full-bleed rows with the Sidebar file diff's row colors;
148
- the row's own inline padding keeps the marker clear of the inset bar. */
149
- .diffFence :where(pre) {
150
- padding: 8px 0 16px;
151
- }
152
-
153
- .diffLine {
154
- display: inline-block;
155
- width: 100%;
156
- }
157
-
158
- /* Numbered gutters already make `.line` a full-width block; keep the padding
159
- box intact instead of stacking a second 100% width on it. */
160
- .numbered .diffLine {
161
- display: block;
162
- width: auto;
163
- }
164
-
165
- .diffFence .diffLine {
166
- padding: 0 16px;
167
- box-sizing: border-box;
168
- }
169
-
170
- /* A non-wrapping fence scrolls horizontally: rows cover the scrollable width,
171
- not just the visible box, so the fill and left bar survive scrolling. */
172
- .diffFence[data-code-wrap='false'] .diffLine {
173
- width: max-content;
174
- min-width: 100%;
175
- }
176
-
177
- .diffAdd {
178
- background: var(--dsw-alias-file-diff-added-bg);
179
- box-shadow: inset 3px 0 0 var(--dsw-alias-file-diff-added-marker);
180
- }
181
-
182
- .diffDel {
183
- background: var(--dsw-alias-file-diff-deleted-bg);
184
- box-shadow: inset 3px 0 0 var(--dsw-alias-file-diff-deleted-marker);
185
- }
186
-
187
- .diffMarker {
188
- margin-inline-end: 1ch;
189
- }
190
-
191
- .diffAdd .diffMarker {
192
- color: var(--dsw-alias-file-diff-added-marker);
193
- }
194
-
195
- .diffDel .diffMarker {
196
- color: var(--dsw-alias-file-diff-deleted-marker);
197
- }
198
-
199
- .diffContext {
200
- color: var(--dsw-alias-label-secondary);
201
- }
202
-
203
- .diffHunk {
204
- color: var(--dsw-alias-label-secondary);
205
- }
206
-
207
- .diffMeta {
208
- color: var(--dsw-alias-label-tertiary);
209
- }
@@ -1,34 +0,0 @@
1
- .root {
2
- margin: 4px 0;
3
- }
4
-
5
- .toggle {
6
- font-size: 12px;
7
- line-height: 18px;
8
- color: var(--dsw-alias-label-secondary);
9
- padding: 2px 6px;
10
- border: none;
11
- background: transparent;
12
- cursor: pointer;
13
- border-radius: var(--dsw-radius-sm);
14
- }
15
-
16
- @media (hover: hover) {
17
- .toggle:hover {
18
- background: var(--dsw-alias-interactive-bg-hover);
19
- }
20
- }
21
-
22
- .body {
23
- margin: 4px 0 0;
24
- padding: 8px;
25
- max-height: 200px;
26
- overflow: auto;
27
- background: var(--dsw-alias-markdown-code-block);
28
- border: 0.5px solid var(--dsw-alias-border-l1);
29
- border-radius: var(--dsw-radius-lg);
30
- font-family: var(--ds-font-family-code);
31
- font-size: 11px;
32
- line-height: 16px;
33
- color: var(--dsw-alias-label-primary);
34
- }