@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
@@ -90,6 +90,18 @@ export const IconCheckOutlineRegular = productIcon('check-outline', 'regular')
90
90
  /** Medium IconCheckOutline artwork with a 1.3px stroke. */
91
91
  export const IconCheckOutlineMedium = productIcon('check-outline', 'medium')
92
92
 
93
+ /** Closed envelope with an unread dot, using the regular product stroke. */
94
+ export const IconMailUnreadOutlineRegular = productIcon('mail-unread-outline', 'regular')
95
+
96
+ /** Closed envelope with an unread dot, using the medium product stroke. */
97
+ export const IconMailUnreadOutlineMedium = productIcon('mail-unread-outline', 'medium')
98
+
99
+ /** Open envelope for read content, using the regular product stroke. */
100
+ export const IconMailReadOutlineRegular = productIcon('mail-read-outline', 'regular')
101
+
102
+ /** Open envelope for read content, using the medium product stroke. */
103
+ export const IconMailReadOutlineMedium = productIcon('mail-read-outline', 'medium')
104
+
93
105
  /** Regular one-pixel IconBranchOutline artwork. */
94
106
  export const IconBranchOutlineRegular = productIcon('branch-outline', 'regular')
95
107
 
@@ -252,10 +264,10 @@ export const IconWarningOutlineRegular = productIcon('warning-outline', 'regular
252
264
  /** Medium IconWarningOutline artwork with a 1.3px stroke. */
253
265
  export const IconWarningOutlineMedium = productIcon('warning-outline', 'medium')
254
266
 
255
- /** Regular IconCheckCircleFill artwork (circled check); its fill-only geometry is weight-independent. */
267
+ /** Regular one-pixel IconCheckCircleFill artwork. */
256
268
  export const IconCheckCircleFillRegular = productIcon('check-circle-fill', 'regular')
257
269
 
258
- /** Medium IconCheckCircleFill artwork; it matches Regular because the geometry is fill-only. */
270
+ /** Medium IconCheckCircleFill artwork with a fixed 1.3px stroke. */
259
271
  export const IconCheckCircleFillMedium = productIcon('check-circle-fill', 'medium')
260
272
 
261
273
  /** Regular rounded warning triangle with an exclamation mark. */
@@ -450,6 +462,12 @@ export const IconListPenOutlineRegular = productIcon('list-pen-outline', 'regula
450
462
  /** Medium IconListPenOutline artwork with a 1.3px stroke. */
451
463
  export const IconListPenOutlineMedium = productIcon('list-pen-outline', 'medium')
452
464
 
465
+ /** Regular one-pixel IconFilesDiffOutline artwork. */
466
+ export const IconFilesDiffOutlineRegular = productIcon('files-diff-outline', 'regular')
467
+
468
+ /** Medium IconFilesDiffOutline artwork with a 1.3px stroke. */
469
+ export const IconFilesDiffOutlineMedium = productIcon('files-diff-outline', 'medium')
470
+
453
471
  /** Regular one-pixel IconGoalOutline artwork. */
454
472
  export const IconGoalOutlineRegular = productIcon('goal-outline', 'regular')
455
473
 
@@ -480,10 +498,10 @@ export const IconQuestionOutlineRegular = productIcon('question-outline', 'regul
480
498
  /** Medium IconQuestionOutline artwork with a 1.3px stroke. */
481
499
  export const IconQuestionOutlineMedium = productIcon('question-outline', 'medium')
482
500
 
483
- /** Regular IconInfoOutline artwork; its fill-only geometry is weight-independent. */
501
+ /** Regular one-pixel IconInfoOutline artwork. */
484
502
  export const IconInfoOutlineRegular = productIcon('info-outline', 'regular')
485
503
 
486
- /** Medium IconInfoOutline artwork; its fill-only geometry is weight-independent. */
504
+ /** Medium IconInfoOutline artwork with a fixed 1.3px stroke. */
487
505
  export const IconInfoOutlineMedium = productIcon('info-outline', 'medium')
488
506
 
489
507
  /** Regular one-pixel plugin pinwheel artwork. */
@@ -549,7 +567,7 @@ export const IconShieldOutlineMedium = productIcon('shield-outline', 'medium')
549
567
  /** Regular one-pixel IconCheckCircleOutline artwork. */
550
568
  export const IconCheckCircleOutlineRegular = productIcon('check-circle-outline', 'regular')
551
569
 
552
- /** Medium IconCheckCircleOutline artwork with a 1.3px stroke. */
570
+ /** Medium IconCheckCircleOutline artwork with a fixed 1.3px stroke. */
553
571
  export const IconCheckCircleOutlineMedium = productIcon('check-circle-outline', 'medium')
554
572
 
555
573
  /** Regular one-pixel IconUnarchiveOutline artwork. */
@@ -638,3 +656,9 @@ export const IconSaveOutlineRegular = productIcon('save-outline', 'regular')
638
656
 
639
657
  /** Medium floppy-disk save action. */
640
658
  export const IconSaveOutlineMedium = productIcon('save-outline', 'medium')
659
+
660
+ /** Regular remote connection phone artwork; both weights preserve its filled contours. */
661
+ export const IconRemoteConnectionOutlineRegular = productIcon('remote-connection-outline', 'regular')
662
+
663
+ /** Medium remote connection phone artwork; both weights preserve its filled contours. */
664
+ export const IconRemoteConnectionOutlineMedium = productIcon('remote-connection-outline', 'medium')
@@ -1,6 +1,6 @@
1
1
  /** Shared props for every product icon component. */
2
2
  export interface IconProps {
3
- /** Square edge in px; defaults to the glyph's own drawn size. */
3
+ /** Rendered height in CSS px; stroked geometry retains its Regular or Medium width. */
4
4
  size?: number | undefined
5
5
  /** Extra class for layout placement; color rides currentColor.
6
6
  * (`| undefined` for exactOptionalPropertyTypes: callers forward their own optional prop.) */
@@ -12,9 +12,9 @@ interface WeightedArtworkProps extends IconProps {
12
12
  */
13
13
  export const ChatLinesOutlineArtwork = ({ size = 16, className, strokeWidth }: WeightedArtworkProps) => (
14
14
  <svg width={size} height={size} className={className} viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" strokeWidth={strokeWidth}>
15
- <path d="M5 6.75H11" stroke="currentColor" />
16
- <path d="M5 9H8" stroke="currentColor" />
17
- <path d="M2.37067 11.2497C1.5872 9.89252 1.32042 8.29798 1.61945 6.7597C1.91847 5.22141 2.76317 3.84293 3.99801 2.87809C5.23285 1.91325 6.7747 1.427 8.33964 1.50888C9.90458 1.59076 11.3873 2.23526 12.5147 3.32369C13.6422 4.41232 14.3384 5.8717 14.4751 7.43304C14.6118 8.99438 14.1797 10.5525 13.2585 11.8205C12.3372 13.0885 10.9889 13.9809 9.4617 14.3334C8.18666 14.6277 6.8587 14.529 5.64964 14.0601C5.17095 13.8745 4.76937 13.4929 4.26509 13.3963C3.67389 13.2832 2.95232 13.5595 2.0377 14.3334" stroke="currentColor" />
15
+ <path vectorEffect="non-scaling-stroke" d="M5 6.75H11" stroke="currentColor" />
16
+ <path vectorEffect="non-scaling-stroke" d="M5 9H8" stroke="currentColor" />
17
+ <path vectorEffect="non-scaling-stroke" d="M2.37067 11.2497C1.5872 9.89252 1.32042 8.29798 1.61945 6.7597C1.91847 5.22141 2.76317 3.84293 3.99801 2.87809C5.23285 1.91325 6.7747 1.427 8.33964 1.50888C9.90458 1.59076 11.3873 2.23526 12.5147 3.32369C13.6422 4.41232 14.3384 5.8717 14.4751 7.43304C14.6118 8.99438 14.1797 10.5525 13.2585 11.8205C12.3372 13.0885 10.9889 13.9809 9.4617 14.3334C8.18666 14.6277 6.8587 14.529 5.64964 14.0601C5.17095 13.8745 4.76937 13.4929 4.26509 13.3963C3.67389 13.2832 2.95232 13.5595 2.0377 14.3334" stroke="currentColor" />
18
18
  </svg>
19
19
  )
20
20
 
@@ -25,10 +25,10 @@ export const ChatLinesOutlineArtwork = ({ size = 16, className, strokeWidth }: W
25
25
  */
26
26
  export const GlobeOutlineArtwork = ({ size = 14, className, strokeWidth }: WeightedArtworkProps) => (
27
27
  <svg width={size} height={size} className={className} viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" strokeWidth={strokeWidth}>
28
- <path d="M7.99986 14.0887C11.3626 14.0887 14.0886 11.3627 14.0886 7.99998C14.0886 4.63727 11.3626 1.91125 7.99986 1.91125C4.63715 1.91125 1.91113 4.63727 1.91113 7.99998C1.91113 11.3627 4.63715 14.0887 7.99986 14.0887Z" stroke="currentColor" />
29
- <path d="M2.34619 8H13.6538" stroke="currentColor" strokeLinecap="square" />
30
- <path d="M7.99976 14.0889C9.23509 14.0889 10.1743 11.3629 10.1743 8.00006C10.1743 4.63739 9.23509 1.91138 7.99976 1.91138" stroke="currentColor" />
31
- <path d="M7.99973 14.0889C6.76445 14.0889 5.8252 11.3629 5.8252 8.00006C5.8252 4.63739 6.76445 1.91138 7.99973 1.91138" stroke="currentColor" />
28
+ <path vectorEffect="non-scaling-stroke" d="M7.99986 14.0887C11.3626 14.0887 14.0886 11.3627 14.0886 7.99998C14.0886 4.63727 11.3626 1.91125 7.99986 1.91125C4.63715 1.91125 1.91113 4.63727 1.91113 7.99998C1.91113 11.3627 4.63715 14.0887 7.99986 14.0887Z" stroke="currentColor" />
29
+ <path vectorEffect="non-scaling-stroke" d="M2.34619 8H13.6538" stroke="currentColor" strokeLinecap="square" />
30
+ <path vectorEffect="non-scaling-stroke" d="M7.99976 14.0889C9.23509 14.0889 10.1743 11.3629 10.1743 8.00006C10.1743 4.63739 9.23509 1.91138 7.99976 1.91138" stroke="currentColor" />
31
+ <path vectorEffect="non-scaling-stroke" d="M7.99973 14.0889C6.76445 14.0889 5.8252 11.3629 5.8252 8.00006C5.8252 4.63739 6.76445 1.91138 7.99973 1.91138" stroke="currentColor" />
32
32
  </svg>
33
33
  )
34
34
 
@@ -39,9 +39,9 @@ export const GlobeOutlineArtwork = ({ size = 14, className, strokeWidth }: Weigh
39
39
  */
40
40
  export const CodeBracketsArtwork = ({ size = 14, className, strokeWidth }: WeightedArtworkProps) => (
41
41
  <svg width={size} height={size} className={className} viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" strokeWidth={strokeWidth}>
42
- <path d="M4.67398 4.25061L1.36094 7.86484C1.29085 7.9413 1.29085 8.05866 1.36094 8.13513L4.67398 11.7494" stroke="currentColor" />
43
- <path d="M11.3262 4.25061L14.6392 7.86484C14.7093 7.9413 14.7093 8.05866 14.6392 8.13513L11.3262 11.7494" stroke="currentColor" />
44
- <path d="M9.56222 3.62573L6.43774 12.3743" stroke="currentColor" />
42
+ <path vectorEffect="non-scaling-stroke" d="M4.67398 4.25061L1.36094 7.86484C1.29085 7.9413 1.29085 8.05866 1.36094 8.13513L4.67398 11.7494" stroke="currentColor" />
43
+ <path vectorEffect="non-scaling-stroke" d="M11.3262 4.25061L14.6392 7.86484C14.7093 7.9413 14.7093 8.05866 14.6392 8.13513L11.3262 11.7494" stroke="currentColor" />
44
+ <path vectorEffect="non-scaling-stroke" d="M9.56222 3.62573L6.43774 12.3743" stroke="currentColor" />
45
45
  </svg>
46
46
  )
47
47
 
@@ -52,8 +52,8 @@ export const CodeBracketsArtwork = ({ size = 14, className, strokeWidth }: Weigh
52
52
  */
53
53
  export const BrowseOutlineArtwork = ({ size = 16, className, strokeWidth }: WeightedArtworkProps) => (
54
54
  <svg width={size} height={size} className={className} viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" strokeWidth={strokeWidth}>
55
- <path d="M4.9375 5.90295H11.0625" stroke="currentColor" />
56
- <path d="M4.9375 9.02991H8.27841" stroke="currentColor" />
55
+ <path vectorEffect="non-scaling-stroke" d="M4.9375 5.90295H11.0625" stroke="currentColor" />
56
+ <path vectorEffect="non-scaling-stroke" d="M4.9375 9.02991H8.27841" stroke="currentColor" />
57
57
  <path d="M12.5 1.32617C13.3039 1.32617 14 1.95171 14 2.77637V13.2246C13.9996 14.0489 13.3036 14.6738 12.5 14.6738H3.5C2.69637 14.6738 2.00042 14.0489 2 13.2246V2.77637C2 1.95171 2.69613 1.32617 3.5 1.32617H12.5ZM3.5 2.32617C3.1993 2.32617 3 2.55186 3 2.77637V13.2246C3.00044 13.4489 3.19963 13.6738 3.5 13.6738H12.5C12.8004 13.6738 12.9996 13.4489 13 13.2246V2.77637C13 2.55186 12.8007 2.32617 12.5 2.32617H3.5Z" fill="currentColor" />
58
58
  </svg>
59
59
  )
@@ -65,7 +65,7 @@ export const BrowseOutlineArtwork = ({ size = 16, className, strokeWidth }: Weig
65
65
  */
66
66
  export const FolderCloseArtwork = ({ size = 16, className, strokeWidth }: WeightedArtworkProps) => (
67
67
  <svg width={size} height={size} className={className} viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" strokeWidth={strokeWidth}>
68
- <path d="M1.50439 3.11059C1.50439 2.55831 1.95211 2.1106 2.50439 2.1106H5.43389C5.67773 2.1106 5.91318 2.19969 6.09593 2.36113L7.71649 3.79265C7.89924 3.95409 8.1347 4.04319 8.3785 4.04319H13.4958C14.0481 4.04319 14.4958 4.4909 14.4958 5.04319V12.8894C14.4958 13.4417 14.0481 13.8894 13.4958 13.8894H2.50439C1.95211 13.8894 1.50439 13.4417 1.50439 12.8894V4.04319V3.11059Z" stroke="currentColor" />
69
- <path d="M3.63501 7.66614H12.3647" stroke="currentColor" />
68
+ <path vectorEffect="non-scaling-stroke" d="M1.50439 3.11059C1.50439 2.55831 1.95211 2.1106 2.50439 2.1106H5.43389C5.67773 2.1106 5.91318 2.19969 6.09593 2.36113L7.71649 3.79265C7.89924 3.95409 8.1347 4.04319 8.3785 4.04319H13.4958C14.0481 4.04319 14.4958 4.4909 14.4958 5.04319V12.8894C14.4958 13.4417 14.0481 13.8894 13.4958 13.8894H2.50439C1.95211 13.8894 1.50439 13.4417 1.50439 12.8894V4.04319V3.11059Z" stroke="currentColor" />
69
+ <path vectorEffect="non-scaling-stroke" d="M3.63501 7.66614H12.3647" stroke="currentColor" />
70
70
  </svg>
71
71
  )
package/src/index.ts CHANGED
@@ -26,6 +26,8 @@ export type { SegmentedTab } from './SegmentedTabs.tsx'
26
26
  export { Tag } from './Tag.tsx'
27
27
  export type { TagTone } from './Tag.tsx'
28
28
  export { PathLabel } from './PathLabel.tsx'
29
+ export { MarqueeText, useHoverMarquee } from './Marquee.tsx'
30
+ export type { HoverMarquee, HoverMarqueeOptions, MarqueeTextProps } from './Marquee.tsx'
29
31
  export { Switch } from './Switch.tsx'
30
32
  export { SegmentedControl } from './SegmentedControl.tsx'
31
33
  export type { SegmentedControlOption } from './SegmentedControl.tsx'
@@ -92,7 +94,6 @@ export type {
92
94
  export { CODE_HIGHLIGHT_EXTENSIONS, languageForPath, useCodeHighlighter } from './code-highlighting.ts'
93
95
  export type { CodeHighlighter, HighlightSpan } from './code-highlighting.ts'
94
96
  export { relativeTime } from './relative-time.ts'
95
- export { rankByName } from './rank-by-name.ts'
96
97
  export { isDarwinDesktop } from './darwin-desktop.ts'
97
98
  export type { RelativeTime, RelativeTimeUnit } from './relative-time.ts'
98
99
  export { JsonTree } from './JsonTree.tsx'
@@ -13,7 +13,7 @@ export const INPUT_MODALITY_ATTRIBUTE = 'data-input-modality'
13
13
 
14
14
  const FOCUS_NAVIGATION = new Set(['Tab', 'Home', 'End', 'PageUp', 'PageDown'])
15
15
 
16
- let pointer = false
16
+ let pointerType: string | null = null
17
17
  let pointerOwnsFocus = false
18
18
  let keyFocusOrigin: EventTarget | undefined
19
19
 
@@ -26,18 +26,26 @@ function publish(): void {
26
26
  * @returns True after pointer input; false after any key.
27
27
  */
28
28
  export function pointerModality(): boolean {
29
- return pointer
29
+ return pointerType !== null
30
+ }
31
+
32
+ /**
33
+ * Whether the most recent pointer or keyboard input was touch.
34
+ * @returns True after touch input until another pointer or key is used.
35
+ */
36
+ export function touchModality(): boolean {
37
+ return pointerType === 'touch'
30
38
  }
31
39
 
32
40
  if (typeof window !== 'undefined') {
33
- window.addEventListener('pointerdown', () => {
34
- pointer = true
41
+ window.addEventListener('pointerdown', (event) => {
42
+ pointerType = event.pointerType
35
43
  pointerOwnsFocus = true
36
44
  keyFocusOrigin = undefined
37
45
  publish()
38
46
  }, true)
39
47
  window.addEventListener('keydown', (event) => {
40
- pointer = false
48
+ pointerType = null
41
49
  if (event.isComposing) {
42
50
  keyFocusOrigin = undefined
43
51
  return
@@ -51,7 +51,9 @@
51
51
  margin-top: 8px;
52
52
  }
53
53
 
54
- .markdown :where(h4, h5, h6):has(+ :where(ul, ol)) {
54
+ .markdown :where(h4):has(+ :where(ul, ol)),
55
+ .markdown :where(h5):has(+ :where(ul, ol)),
56
+ .markdown :where(h6):has(+ :where(ul, ol)) {
55
57
  margin-bottom: 8px;
56
58
  }
57
59
 
@@ -93,17 +95,18 @@
93
95
  box-shadow: 0 0 0 2px var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
94
96
  }
95
97
 
96
- /* Leading link-category glyph inside anchors, file mentions, and
97
- URL-promoted inline code: outline glyphs ride the link's currentColor.
98
- 1.1em keeps the glyph proportional to the surrounding text's size (it
99
- shrinks with the code chip's 0.875em); the small negative offset seats
100
- its optical center on the cap height. */
98
+ /* Inline icon boxes follow the text middle, preserving their internal whitespace.
99
+ Separate the link from preceding prose more than the icon from its label. */
101
100
  .linkIcon {
102
101
  flex: none;
103
102
  width: 1.1em;
104
103
  height: 1.1em;
105
- vertical-align: -0.25em;
106
- margin-right: 5px;
104
+ vertical-align: calc(0.5cap - 0.55em);
105
+ margin-inline: 0.25em 0.125em;
106
+ }
107
+
108
+ .markdown code .linkIcon {
109
+ margin-inline-start: 0;
107
110
  }
108
111
 
109
112
  .markdown :where(ul, ol) {
@@ -421,7 +424,7 @@
421
424
  color: inherit;
422
425
  }
423
426
 
424
- .compact :global(.md-code-block) > :has(> [data-code-block-banner]) {
427
+ .compact :global(.md-code-block) > div:has(> [data-code-block-banner]) {
425
428
  position: static;
426
429
  z-index: auto;
427
430
  }
@@ -457,7 +460,15 @@
457
460
  }
458
461
 
459
462
  /* Keep KaTeX's inline baseline and scroll the containing block only when needed. */
460
- .compact :is(p, h1, h2, h3, h4, h5, h6, ul, ol):has(:global(.katex)) {
463
+ .compact p:has(:global(.katex)),
464
+ .compact h1:has(:global(.katex)),
465
+ .compact h2:has(:global(.katex)),
466
+ .compact h3:has(:global(.katex)),
467
+ .compact h4:has(:global(.katex)),
468
+ .compact h5:has(:global(.katex)),
469
+ .compact h6:has(:global(.katex)),
470
+ .compact ul:has(:global(.katex)),
471
+ .compact ol:has(:global(.katex)) {
461
472
  overflow-x: auto;
462
473
  overflow-y: hidden;
463
474
  /* KaTeX descenders can paint one pixel below a fractional line-box edge. */
@@ -1,4 +1,7 @@
1
- /** Let asterisk strong emphasis close after punctuation when CJK prose continues without whitespace. */
1
+ /**
2
+ * Let asterisk strong emphasis open after CJK prose before punctuation, and close after punctuation
3
+ * before CJK prose, without whitespace.
4
+ */
2
5
 
3
6
  import { attention } from 'micromark-core-commonmark'
4
7
  import { unicodePunctuation } from 'micromark-util-character'
@@ -46,15 +49,19 @@ const tokenizeCjkFriendlyAttention: Tokenizer = function (effects, ok, nok) {
46
49
 
47
50
  const token = effects.exit('attentionSequence')
48
51
  const after = classifyCharacter(code)
49
- const open = !after || (after === constants.characterGroupPunctuation && Boolean(before))
52
+ const commonMarkOpen = !after || (after === constants.characterGroupPunctuation && Boolean(before))
50
53
  || attentionMarkers.includes(code)
51
54
  const commonMarkClose = !before
52
55
  || (before === constants.characterGroupPunctuation && Boolean(after))
53
56
  || attentionMarkers.includes(previous)
54
57
  const markerCount = token.end.offset - token.start.offset
58
+ const cjkStrongOpen = markerCount >= 2
59
+ && isCjkCharacter(previous)
60
+ && unicodePunctuation(code)
55
61
  const cjkStrongClose = markerCount >= 2
56
62
  && unicodePunctuation(previous)
57
63
  && isCjkCharacter(code)
64
+ const open = commonMarkOpen || cjkStrongOpen
58
65
  const close = commonMarkClose || cjkStrongClose
59
66
 
60
67
  token._open = open
@@ -4,6 +4,7 @@ import type { RefObject, SyntheticEvent } from 'react'
4
4
  import type { MenuEntry, MenuItem } from './Menu.tsx'
5
5
  import { submenuNeedsPage } from './menu-submenu-position.ts'
6
6
  import { usePointerGrace } from './pointer-grace.ts'
7
+ import { menuPopupSelector } from './useModalLayer.ts'
7
8
 
8
9
  /** Whether a pointer event can request hover interactions.
9
10
  * @param event - current pointer, including mixed-input touch events.
@@ -42,9 +43,10 @@ export function useMenuSubmenu(options: {
42
43
  items: readonly MenuEntry[]
43
44
  footer: readonly MenuEntry[] | undefined
44
45
  listRef: RefObject<HTMLDivElement>
46
+ searchRowsRef: RefObject<HTMLDivElement>
45
47
  refocusAnchor: () => void
46
48
  }): MenuSubmenu {
47
- const { open, items, footer, listRef, refocusAnchor } = options
49
+ const { open, items, footer, listRef, searchRowsRef, refocusAnchor } = options
48
50
  const [expanded, setExpanded] = useState<{ id: string; trigger: HTMLButtonElement; activated: boolean } | null>(null)
49
51
  const panelRef = useRef<HTMLDivElement>(null)
50
52
  // A DOM target suppresses its focus-open handler until focus restoration completes.
@@ -160,12 +162,13 @@ export function useMenuSubmenu(options: {
160
162
  // React DOM normalizes text-node event targets to their parent element.
161
163
  const row = (event.target as Element).closest('button[role="menuitem"]')
162
164
  if (row === null || row.getAttribute('aria-haspopup') === 'menu') return
163
- if (row.closest('[role="menu"]') === event.currentTarget) collapse()
165
+ const rootRows = searchRowsRef.current ?? listRef.current
166
+ if (rootRows !== null && row.closest(menuPopupSelector) === rootRows) collapse()
164
167
  }
165
168
  return {
166
169
  entry, panelRef, parentAnchor, measured, page, hidden,
167
170
  contains,
168
- activeList: (focused: Node | null) => page || contains(focused) ? panelRef.current : listRef.current,
171
+ activeList: (focused: Node | null) => page || contains(focused) ? panelRef.current : searchRowsRef.current ?? listRef.current,
169
172
  returnToParent: (): boolean => {
170
173
  if (entry === undefined || hidden) return false
171
174
  returnToParent()
@@ -4,8 +4,11 @@ import type { RefObject } from 'react'
4
4
  import { observeComposition } from './keyboard-composition.ts'
5
5
  import { focusWithoutRing } from './focus.ts'
6
6
 
7
+ /** Active menu popups, including search controls outside the menu's ARIA row group. */
8
+ export const menuPopupSelector = '[data-menu-popup], [role="menu"]'
9
+
7
10
  /** Dialog and menu elements whose document order determines foreground shortcut ownership. */
8
- export const modalSelector = '[role="dialog"][aria-modal="true"], [role="menu"]'
11
+ export const modalSelector = `[role="dialog"][aria-modal="true"], ${menuPopupSelector}`
9
12
 
10
13
  const layers = new WeakMap<Document, { element: HTMLElement; close: () => void }[]>()
11
14
 
@@ -77,7 +80,7 @@ export function useModalLayer(dialog: RefObject<HTMLElement | null>, open: boole
77
80
  }
78
81
  if (event.key !== 'Tab') return
79
82
  // Portaled menus own their traversal while they contain focus.
80
- if (document.activeElement?.closest('[role="menu"]')) return
83
+ if (document.activeElement?.closest(menuPopupSelector)) return
81
84
  const items = [...element.querySelectorAll<HTMLElement>(focusable)]
82
85
  .filter(item => !item.closest('[inert], [hidden]'))
83
86
  const first = items[0] ?? element
@@ -1,7 +0,0 @@
1
- .exits {
2
- position: absolute;
3
- inset: 0;
4
- contain: strict;
5
- overflow: clip;
6
- pointer-events: none;
7
- }
@@ -1,84 +0,0 @@
1
- /* Button sizes share the global control-radius scale. */
2
- .button {
3
- box-sizing: border-box;
4
- display: inline-flex;
5
- align-items: center;
6
- justify-content: center;
7
- gap: 4px;
8
- border: none;
9
- border-radius: var(--dsw-radius-md);
10
- cursor: pointer;
11
- font-size: 14px;
12
- line-height: 22px;
13
- color: var(--dsw-alias-label-primary);
14
- background: transparent;
15
- padding: 0 14px;
16
- }
17
-
18
- .button:disabled {
19
- cursor: not-allowed;
20
- opacity: 0.4;
21
- }
22
-
23
- .md {
24
- height: 36px;
25
- }
26
-
27
- /* Compact controls retain their dimensions across filled and outlined variants. */
28
- .sm {
29
- height: 28px;
30
- font-size: 12px;
31
- line-height: 18px;
32
- padding: 0 10px;
33
- border-radius: var(--dsw-radius-sm);
34
- }
35
-
36
- .primary {
37
- background: var(--dsw-alias-button-primary-fill);
38
- color: var(--dsw-alias-label-primary-foreground);
39
- }
40
-
41
- @media (hover: hover) {
42
- .primary:hover:not(:disabled) {
43
- background: var(--dsw-alias-button-primary-hover);
44
- }
45
-
46
- .ghost:hover:not(:disabled) {
47
- background: var(--dsw-alias-interactive-bg-hover);
48
- }
49
- }
50
-
51
- .ghost:active:not(:disabled) {
52
- background: var(--dsw-alias-interactive-bg-active);
53
- }
54
-
55
- /* The transparent border preserves layout; the inset stroke stays complete at fractional widths. */
56
- .outline {
57
- border: 0.5px solid transparent;
58
- background: transparent;
59
- box-shadow: inset 0 0 0 var(--dsh-hairline-width, 0.5px) var(--dsh-button-outline-color, var(--dsw-alias-border-l3));
60
- }
61
-
62
- @media (hover: hover) {
63
- .outline:hover:not(:disabled) {
64
- background: var(--dsw-alias-interactive-bg-hover);
65
- }
66
- }
67
-
68
- .toolbar {
69
- background: var(--dsw-alias-button-tool-bar-fill);
70
- }
71
-
72
- @media (hover: hover) {
73
- .toolbar:hover:not(:disabled) {
74
- background: var(--dsw-alias-button-tool-bar-hover);
75
- }
76
- }
77
-
78
- .icon {
79
- display: inline-flex;
80
- width: 16px;
81
- height: 16px;
82
- align-items: center;
83
- justify-content: center;
84
- }
@@ -1,28 +0,0 @@
1
- .checkbox {
2
- display: inline-flex;
3
- align-items: center;
4
- gap: 6px;
5
- font-size: 14px;
6
- line-height: 20px;
7
- color: var(--dsw-alias-label-primary);
8
- cursor: pointer;
9
- }
10
-
11
- .checkbox input {
12
- flex: 0 0 auto;
13
- width: 16px;
14
- height: 16px;
15
- margin: 0;
16
- accent-color: var(--dsw-alias-brand-primary);
17
- cursor: inherit;
18
- }
19
-
20
- .checkbox input:focus-visible {
21
- outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
22
- outline-offset: 2px;
23
- }
24
-
25
- .checkbox:has(input:disabled) {
26
- cursor: default;
27
- opacity: 0.5;
28
- }
@@ -1,85 +0,0 @@
1
- .card {
2
- position: relative;
3
- margin: 16px 0;
4
- color: var(--dsw-alias-label-primary);
5
- background: var(--dsw-alias-markdown-code-block);
6
- border-radius: var(--dsw-radius-lg);
7
- font: var(--dsw-font-markdown-code-block);
8
- }
9
-
10
- .header {
11
- display: flex;
12
- align-items: center;
13
- justify-content: space-between;
14
- gap: 12px;
15
- padding: 10px 18px 8px 22px;
16
- background: var(--dsl-code-block-background, var(--dsw-alias-markdown-code-block));
17
- border-top-left-radius: inherit;
18
- border-top-right-radius: inherit;
19
- color: var(--dsw-alias-label-secondary);
20
- font: 11px/18px var(--dsw-font-family);
21
- }
22
-
23
- .heading {
24
- display: flex;
25
- align-items: baseline;
26
- gap: 12px;
27
- min-width: 0;
28
- }
29
-
30
- .language {
31
- color: var(--dsw-alias-label-tertiary);
32
- flex: none;
33
- font-family: var(--ds-font-family-code);
34
- }
35
-
36
- .title {
37
- color: var(--dsw-alias-label-tertiary);
38
- overflow: hidden;
39
- text-overflow: ellipsis;
40
- white-space: nowrap;
41
- }
42
-
43
- .actions {
44
- display: flex;
45
- align-items: center;
46
- gap: 4px;
47
- flex: none;
48
- }
49
-
50
- .status {
51
- margin-right: 8px;
52
- color: var(--dsw-alias-label-tertiary);
53
- white-space: nowrap;
54
- }
55
-
56
- .action {
57
- display: inline-flex;
58
- align-items: center;
59
- justify-content: center;
60
- width: 24px;
61
- height: 24px;
62
- padding: 0;
63
- border: 0;
64
- border-radius: var(--dsw-radius-sm);
65
- color: var(--dsw-alias-label-secondary);
66
- background: transparent;
67
- cursor: pointer;
68
- }
69
-
70
- @media (hover: hover) {
71
- .action:hover {
72
- background: var(--dsw-alias-interactive-bg-hover);
73
- }
74
- }
75
-
76
- .action:focus-visible {
77
- outline: 1px solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
78
- outline-offset: 2px;
79
- }
80
-
81
- .body {
82
- padding: 6px 22px 20px;
83
- font: var(--dsw-font-markdown-code-block);
84
- overflow-x: auto;
85
- }
@@ -1,12 +0,0 @@
1
- .text {
2
- display: block;
3
- min-width: 0;
4
- overflow-x: auto;
5
- white-space: var(--dsl-command-whitespace, pre);
6
- overflow-wrap: anywhere;
7
- }
8
-
9
- .text:focus-visible {
10
- outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
11
- outline-offset: -2px;
12
- }