@deepseek-ai/dsh-client-ui-primitives 0.2.1-rc.5 → 0.2.2-alpha.3

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 (67) hide show
  1. package/README.i18n.yaml +18 -18
  2. package/README.md +45 -15
  3. package/README.zh.md +45 -15
  4. package/lib/AnimatedRows.module.css +7 -0
  5. package/lib/Button.module.css +18 -11
  6. package/lib/CodeCard.module.css +4 -2
  7. package/lib/ConnectionIndicator.module.css +8 -6
  8. package/lib/DetailDocument.module.css +67 -0
  9. package/lib/DiffBlock.module.css +4 -2
  10. package/lib/DisclosureRow.module.css +11 -7
  11. package/lib/HoverCard.module.css +13 -0
  12. package/lib/JsonTree.module.css +45 -9
  13. package/lib/Menu.module.css +55 -17
  14. package/lib/MenuSurface.module.css +16 -0
  15. package/lib/Modal.module.css +4 -2
  16. package/lib/Pill.module.css +4 -2
  17. package/lib/QuotePreview.module.css +101 -0
  18. package/lib/ReadBlock.module.css +4 -2
  19. package/lib/RowDragPreview.module.css +12 -0
  20. package/lib/SearchBlock.module.css +4 -2
  21. package/lib/SegmentedControl.module.css +6 -1
  22. package/lib/SegmentedTabs.module.css +25 -3
  23. package/lib/TerminalBlock.module.css +4 -2
  24. package/lib/Toast.module.css +4 -2
  25. package/lib/UserMessageBubble.module.css +11 -0
  26. package/lib/WebBlock.module.css +14 -2
  27. package/lib/ZoomControls.module.css +54 -0
  28. package/lib/index.js +3923 -4809
  29. package/lib/markdown/JsonBlock.module.css +4 -2
  30. package/lib/markdown/MarkdownText.module.css +37 -12
  31. package/lib/settings-form/fields.module.css +11 -3
  32. package/lib/types/AnimatedRows.d.ts +46 -0
  33. package/lib/types/Button.d.ts +1 -1
  34. package/lib/types/DetailDocument.d.ts +78 -0
  35. package/lib/types/DraggableImage.d.ts +19 -0
  36. package/lib/types/HoverCard.d.ts +7 -2
  37. package/lib/types/HoverCardGroup.d.ts +4 -2
  38. package/lib/types/ImageLightbox.d.ts +4 -1
  39. package/lib/types/Menu.d.ts +25 -9
  40. package/lib/types/MenuSurface.d.ts +9 -0
  41. package/lib/types/QuotePreview.d.ts +24 -0
  42. package/lib/types/SegmentedTabs.d.ts +3 -1
  43. package/lib/types/Tooltip.d.ts +13 -7
  44. package/lib/types/UserMessageBubble.d.ts +11 -0
  45. package/lib/types/ZoomControls.d.ts +27 -0
  46. package/lib/types/document-zoom.d.ts +17 -0
  47. package/lib/types/file-drag-actions.d.ts +32 -0
  48. package/lib/types/focus.d.ts +7 -0
  49. package/lib/types/icons/artwork.d.ts +422 -0
  50. package/lib/types/icons/index.d.ts +199 -194
  51. package/lib/types/icons/shared-artwork.d.ts +6 -12
  52. package/lib/types/image-drag.d.ts +17 -0
  53. package/lib/types/index.d.ts +23 -3
  54. package/lib/types/markdown/MarkdownDelegate.d.ts +26 -3
  55. package/lib/types/markdown/MarkdownText.d.ts +12 -5
  56. package/lib/types/markdown/file-link.d.ts +13 -3
  57. package/lib/types/markdown/highlight.d.ts +22 -0
  58. package/lib/types/markdown/quote-text.d.ts +8 -0
  59. package/lib/types/markdown/render.d.ts +9 -4
  60. package/lib/types/markdown/windows-path-destinations.d.ts +11 -0
  61. package/lib/types/overlay-top-margin.d.ts +9 -2
  62. package/lib/types/use-clipboard-copy.d.ts +14 -0
  63. package/lib/types/useAnchoredPosition.d.ts +22 -22
  64. package/lib/types/useRowDragPreview.d.ts +20 -0
  65. package/lib/types/user-text.d.ts +4 -1
  66. package/package.json +9 -7
  67. package/lib/types/use-copy-feedback.d.ts +0 -14
@@ -53,11 +53,16 @@
53
53
  transition: color 120ms ease;
54
54
  }
55
55
 
56
- .tab:hover:not(:disabled),
57
56
  .tab[aria-selected='true'] {
58
57
  color: var(--dsw-alias-label-primary);
59
58
  }
60
59
 
60
+ @media (hover: hover) {
61
+ .tab:hover:not(:disabled) {
62
+ color: var(--dsw-alias-label-primary);
63
+ }
64
+ }
65
+
61
66
  .tab:disabled {
62
67
  cursor: default;
63
68
  opacity: 0.4;
@@ -1,14 +1,16 @@
1
1
  .tabs {
2
+ --segmented-tabs-inset: 4px;
3
+
2
4
  position: relative;
3
5
  display: grid;
4
- padding: 4px;
6
+ padding: var(--segmented-tabs-inset);
5
7
  border-radius: var(--dsw-radius-lg);
6
8
  background: var(--dsw-alias-bg-module-platform);
7
9
  }
8
10
 
9
11
  .indicator {
10
12
  position: absolute;
11
- inset: 4px auto 4px 4px;
13
+ inset: var(--segmented-tabs-inset) auto var(--segmented-tabs-inset) var(--segmented-tabs-inset);
12
14
  box-sizing: border-box;
13
15
  border: 0.5px solid var(--dsw-alias-border-l3);
14
16
  border-radius: var(--dsw-radius-md);
@@ -30,16 +32,36 @@
30
32
  transition: color 180ms ease;
31
33
  }
32
34
 
33
- .tab:hover,
34
35
  .tab[aria-selected='true'] {
35
36
  background: transparent;
36
37
  color: var(--dsw-alias-label-primary);
37
38
  }
38
39
 
40
+ @media (hover: hover) {
41
+ .tab:hover {
42
+ background: transparent;
43
+ color: var(--dsw-alias-label-primary);
44
+ }
45
+ }
46
+
39
47
  .tab[aria-selected='true'] {
40
48
  font-weight: 600;
41
49
  }
42
50
 
51
+ .tabs[data-size='sm'] {
52
+ --segmented-tabs-inset: 2px;
53
+
54
+ border-radius: calc(var(--dsw-radius-md) + var(--segmented-tabs-inset));
55
+ }
56
+
57
+ .tabs[data-size='sm'] .tab {
58
+ height: 30px;
59
+ }
60
+
61
+ .tabs[data-size='sm'] .tab[aria-selected='true'] {
62
+ font-weight: 500;
63
+ }
64
+
43
65
  .tab:focus-visible {
44
66
  outline: none;
45
67
  text-decoration: underline;
@@ -194,8 +194,10 @@
194
194
  text-align: left;
195
195
  }
196
196
 
197
- .expand:hover {
198
- color: var(--dsw-alias-label-secondary);
197
+ @media (hover: hover) {
198
+ .expand:hover {
199
+ color: var(--dsw-alias-label-secondary);
200
+ }
199
201
  }
200
202
 
201
203
  .empty {
@@ -69,8 +69,10 @@
69
69
  pointer-events: auto;
70
70
  }
71
71
 
72
- .action:hover {
73
- opacity: 0.8;
72
+ @media (hover: hover) {
73
+ .action:hover {
74
+ opacity: 0.8;
75
+ }
74
76
  }
75
77
 
76
78
  @keyframes dsh-toast-in {
@@ -0,0 +1,11 @@
1
+ .bubble {
2
+ max-width: 100%;
3
+ background: var(--dsw-specific-bubble);
4
+ border-radius: var(--dsw-radius-xl);
5
+ padding: 10px 16px;
6
+ font-size: var(--dsh-content-font-size, 14px);
7
+ line-height: calc(22px + var(--dsh-content-font-delta, 0px));
8
+ color: var(--dsw-alias-label-primary);
9
+ white-space: pre-wrap;
10
+ word-break: break-word;
11
+ }
@@ -69,12 +69,18 @@
69
69
  margin-right: 5px;
70
70
  }
71
71
 
72
- .sourceLink:hover,
73
72
  .sourceLink:focus-visible {
74
73
  text-decoration: underline dotted;
75
74
  text-underline-offset: 3px;
76
75
  }
77
76
 
77
+ @media (hover: hover) {
78
+ .sourceLink:hover {
79
+ text-decoration: underline dotted;
80
+ text-underline-offset: 3px;
81
+ }
82
+ }
83
+
78
84
  .snippet {
79
85
  margin-top: 2px;
80
86
  color: var(--dsw-alias-label-secondary);
@@ -117,12 +123,18 @@
117
123
  text-decoration: none;
118
124
  }
119
125
 
120
- .fetchUrl:hover,
121
126
  .fetchUrl:focus-visible {
122
127
  text-decoration: underline dotted;
123
128
  text-underline-offset: 3px;
124
129
  }
125
130
 
131
+ @media (hover: hover) {
132
+ .fetchUrl:hover {
133
+ text-decoration: underline dotted;
134
+ text-underline-offset: 3px;
135
+ }
136
+ }
137
+
126
138
  .fetchMeta {
127
139
  display: flex;
128
140
  align-items: baseline;
@@ -0,0 +1,54 @@
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
+ }