@ds-mo/ui 8.3.1 → 9.1.0

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 (184) hide show
  1. package/README.md +28 -3
  2. package/dist/.build-stamp +1 -1
  3. package/dist/agent-patterns.json +233 -0
  4. package/dist/agent.json +155 -174
  5. package/dist/angular/ds-menu.d.ts +6 -1
  6. package/dist/angular/ds-menu.js +7 -4
  7. package/dist/angular/ds-swatch-picker.d.ts +15 -0
  8. package/dist/angular/{ds-pagination.js → ds-swatch-picker.js} +15 -15
  9. package/dist/angular/index.d.ts +1 -1
  10. package/dist/angular/index.js +1 -2
  11. package/dist/angular/proxies.d.ts +1 -2
  12. package/dist/angular/proxies.js +1 -2
  13. package/dist/components/ds-app-shell.js +1 -1
  14. package/dist/components/ds-badge.js +1 -1
  15. package/dist/components/ds-banner.js +1 -1
  16. package/dist/components/ds-bar-nav.js +1 -1
  17. package/dist/components/ds-bar-nav.js.map +1 -1
  18. package/dist/components/ds-button-filled.js +1 -1
  19. package/dist/components/ds-button-unfilled.js +1 -1
  20. package/dist/components/ds-card-data-viz-donut.js +1 -1
  21. package/dist/components/ds-card-setting.js +1 -1
  22. package/dist/components/ds-card-shell-data-viz.js +1 -1
  23. package/dist/components/ds-card.js +1 -1
  24. package/dist/components/ds-chart-bar.js +1 -1
  25. package/dist/components/ds-chart-bar.js.map +1 -1
  26. package/dist/components/ds-chart-donut.js +1 -1
  27. package/dist/components/ds-chart-legend.js +1 -1
  28. package/dist/components/ds-chart-line.js +1 -1
  29. package/dist/components/ds-checkbox.js +1 -1
  30. package/dist/components/ds-chip.js +1 -1
  31. package/dist/components/ds-empty-state.js +1 -1
  32. package/dist/components/ds-field.js +1 -1
  33. package/dist/components/ds-input.js +1 -1
  34. package/dist/components/ds-menu.js +1 -1
  35. package/dist/components/ds-modal.js +1 -1
  36. package/dist/components/ds-panel-nav.js +1 -1
  37. package/dist/components/ds-panel-nav.js.map +1 -1
  38. package/dist/components/ds-panel-sub-nav.js +1 -1
  39. package/dist/components/ds-panel-tools.js +1 -1
  40. package/dist/components/ds-radio.js +1 -1
  41. package/dist/components/ds-select-multi.js +1 -1
  42. package/dist/components/ds-select-multi.js.map +1 -1
  43. package/dist/components/ds-select.js +1 -1
  44. package/dist/components/ds-select.js.map +1 -1
  45. package/dist/components/ds-shell-gradient-picker.js +1 -1
  46. package/dist/components/ds-shell-gradient-picker.js.map +1 -1
  47. package/dist/components/ds-shell-gradient-swatch.js +1 -1
  48. package/dist/components/ds-shell-gradient-swatch.js.map +1 -1
  49. package/dist/components/ds-skeleton.js +1 -1
  50. package/dist/components/ds-skeleton.js.map +1 -1
  51. package/dist/components/ds-slider.js +1 -1
  52. package/dist/components/ds-slider.js.map +1 -1
  53. package/dist/components/{ds-pagination.d.ts → ds-swatch-picker.d.ts} +4 -4
  54. package/dist/components/ds-swatch-picker.js +2 -0
  55. package/dist/components/ds-swatch-picker.js.map +1 -0
  56. package/dist/components/ds-tab-group.js +1 -1
  57. package/dist/components/ds-tag.js +1 -1
  58. package/dist/components/ds-text.js +1 -1
  59. package/dist/components/ds-tooltip-data-viz.js +1 -1
  60. package/dist/components/ds-tooltip.js +1 -1
  61. package/dist/components/{p-CysJosvS.js → p-B-zhgAvL.js} +2 -2
  62. package/dist/components/{p-C21sIElQ.js → p-BLzivrE3.js} +2 -2
  63. package/dist/components/{p-DAuadHYu.js → p-BbV68F23.js} +2 -2
  64. package/dist/components/{p-_y99wWNU.js → p-C7RObioO.js} +2 -2
  65. package/dist/components/{p-DxQ4gzbA.js → p-CZ9wemOA.js} +2 -2
  66. package/dist/components/{p-BKA6houZ.js → p-CbS_WWs2.js} +2 -2
  67. package/dist/components/p-D1HFMTdC.js +2 -0
  68. package/dist/components/p-D1HFMTdC.js.map +1 -0
  69. package/dist/components/{p-BGcSrHKl.js → p-DT2MK8Kt.js} +2 -2
  70. package/dist/components/{p-DV23KMU-.js → p-DyZj3k9S.js} +2 -2
  71. package/dist/components/p-HBIxvS5C.js +2 -0
  72. package/dist/components/p-HBIxvS5C.js.map +1 -0
  73. package/dist/components/{p-D6hvtWDk.js → p-KRGBGTu5.js} +2 -2
  74. package/dist/components/p-l6PmnW_P.js +2 -0
  75. package/dist/components/p-l6PmnW_P.js.map +1 -0
  76. package/dist/components/p-tQ1QHeOE.js +2 -0
  77. package/dist/components/p-tQ1QHeOE.js.map +1 -0
  78. package/dist/docs/components.json +546 -1024
  79. package/dist/lib/components/Menu/menu-placement.d.ts +6 -3
  80. package/dist/lib/shell/index.d.ts +2 -2
  81. package/dist/lib/shell/index.js +40 -39
  82. package/dist/lib/shell/index.js.map +3 -3
  83. package/dist/lib/shell/shell-gradient-presets.d.ts +15 -0
  84. package/dist/lib/utils/choice-popup-alignment.d.ts +20 -0
  85. package/dist/lib/utils/index.d.ts +2 -0
  86. package/dist/lib/utils/index.js +16 -0
  87. package/dist/lib/utils/index.js.map +3 -3
  88. package/dist/mcp/cli.js +31409 -0
  89. package/dist/mcp-data/registry/app-shell.json +210 -0
  90. package/dist/mcp-data/registry/badge.json +289 -0
  91. package/dist/mcp-data/registry/banner.json +206 -0
  92. package/dist/mcp-data/registry/bar-nav.json +341 -0
  93. package/dist/mcp-data/registry/button-filled.json +386 -0
  94. package/dist/mcp-data/registry/button-unfilled.json +537 -0
  95. package/dist/mcp-data/registry/card-data-viz-donut.json +143 -0
  96. package/dist/mcp-data/registry/card-setting.json +194 -0
  97. package/dist/mcp-data/registry/card-shell-data-viz.json +173 -0
  98. package/dist/mcp-data/registry/card.json +126 -0
  99. package/dist/mcp-data/registry/chart-bar.json +121 -0
  100. package/dist/mcp-data/registry/chart-donut.json +257 -0
  101. package/dist/mcp-data/registry/chart-legend.json +209 -0
  102. package/dist/mcp-data/registry/chart-line.json +153 -0
  103. package/dist/mcp-data/registry/checkbox.json +361 -0
  104. package/dist/mcp-data/registry/chip.json +276 -0
  105. package/dist/mcp-data/registry/divider.json +225 -0
  106. package/dist/mcp-data/registry/empty-state.json +197 -0
  107. package/dist/mcp-data/registry/field.json +222 -0
  108. package/dist/mcp-data/registry/icon.json +242 -0
  109. package/dist/mcp-data/registry/input.json +597 -0
  110. package/dist/mcp-data/registry/loader.json +192 -0
  111. package/dist/mcp-data/registry/menu.json +459 -0
  112. package/dist/mcp-data/registry/modal.json +150 -0
  113. package/dist/mcp-data/registry/panel-nav.json +622 -0
  114. package/dist/mcp-data/registry/panel-sub-nav.json +249 -0
  115. package/dist/mcp-data/registry/panel-tools.json +374 -0
  116. package/dist/mcp-data/registry/radio.json +374 -0
  117. package/dist/mcp-data/registry/registry.json +5389 -0
  118. package/dist/mcp-data/registry/select-multi.json +755 -0
  119. package/dist/mcp-data/registry/select.json +740 -0
  120. package/dist/mcp-data/registry/shell-gradient-picker.json +195 -0
  121. package/dist/mcp-data/registry/shell-gradient-swatch.json +215 -0
  122. package/dist/mcp-data/registry/skeleton.json +282 -0
  123. package/dist/mcp-data/registry/slider.json +657 -0
  124. package/dist/mcp-data/registry/swatch-picker.json +231 -0
  125. package/dist/mcp-data/registry/switch.json +361 -0
  126. package/dist/mcp-data/registry/tab-group.json +255 -0
  127. package/dist/mcp-data/registry/tag.json +352 -0
  128. package/dist/mcp-data/registry/text.json +371 -0
  129. package/dist/mcp-data/registry/tooltip-data-viz.json +158 -0
  130. package/dist/mcp-data/registry/tooltip.json +311 -0
  131. package/dist/react/components.d.ts +1 -2
  132. package/dist/react/components.js +1 -2
  133. package/dist/react/ds-menu.d.ts +1 -0
  134. package/dist/react/ds-menu.js +2 -1
  135. package/dist/react/ds-swatch-picker.d.ts +12 -0
  136. package/dist/react/ds-swatch-picker.js +12 -0
  137. package/dist/types/components/Menu/Menu.d.ts +7 -1
  138. package/dist/types/components/Menu/menu-placement.d.ts +6 -3
  139. package/dist/types/components/Menu/menu-types.d.ts +14 -1
  140. package/dist/types/components/ShellGradientPicker/ShellGradientPicker.d.ts +2 -5
  141. package/dist/types/components/ShellGradientSwatch/ShellGradientSwatch.d.ts +1 -0
  142. package/dist/types/components/SwatchPicker/SwatchPicker.d.ts +21 -0
  143. package/dist/types/components/SwatchPicker/swatch-picker-types.d.ts +26 -0
  144. package/dist/types/components.d.ts +117 -237
  145. package/dist/types/shell/index.d.ts +2 -2
  146. package/dist/types/shell/shell-gradient-presets.d.ts +15 -0
  147. package/dist/types/utils/choice-popup-alignment.d.ts +21 -0
  148. package/dist/types/utils/index.d.ts +2 -0
  149. package/package.json +6 -2
  150. package/dist/angular/ds-pagination.d.ts +0 -15
  151. package/dist/angular/ds-table.d.ts +0 -33
  152. package/dist/angular/ds-table.js +0 -48
  153. package/dist/components/ds-pagination.js +0 -2
  154. package/dist/components/ds-pagination.js.map +0 -1
  155. package/dist/components/ds-table.d.ts +0 -11
  156. package/dist/components/ds-table.js +0 -2
  157. package/dist/components/ds-table.js.map +0 -1
  158. package/dist/components/p-CKV6rOGa.js +0 -2
  159. package/dist/components/p-CKV6rOGa.js.map +0 -1
  160. package/dist/components/p-CSTr2132.js +0 -2
  161. package/dist/components/p-CSTr2132.js.map +0 -1
  162. package/dist/components/p-C_cu-HIT.js +0 -2
  163. package/dist/components/p-C_cu-HIT.js.map +0 -1
  164. package/dist/components/p-D0B9uDTP.js +0 -2
  165. package/dist/components/p-D0B9uDTP.js.map +0 -1
  166. package/dist/components/p-DhxWfdX0.js +0 -2
  167. package/dist/components/p-DhxWfdX0.js.map +0 -1
  168. package/dist/components/p-Pip-LNhl.js +0 -2
  169. package/dist/components/p-Pip-LNhl.js.map +0 -1
  170. package/dist/react/ds-pagination.d.ts +0 -12
  171. package/dist/react/ds-pagination.js +0 -12
  172. package/dist/react/ds-table.d.ts +0 -21
  173. package/dist/react/ds-table.js +0 -16
  174. package/dist/types/components/Pagination/Pagination.d.ts +0 -14
  175. package/dist/types/components/Table/Table.d.ts +0 -56
  176. /package/dist/components/{p-CysJosvS.js.map → p-B-zhgAvL.js.map} +0 -0
  177. /package/dist/components/{p-C21sIElQ.js.map → p-BLzivrE3.js.map} +0 -0
  178. /package/dist/components/{p-DAuadHYu.js.map → p-BbV68F23.js.map} +0 -0
  179. /package/dist/components/{p-_y99wWNU.js.map → p-C7RObioO.js.map} +0 -0
  180. /package/dist/components/{p-DxQ4gzbA.js.map → p-CZ9wemOA.js.map} +0 -0
  181. /package/dist/components/{p-BKA6houZ.js.map → p-CbS_WWs2.js.map} +0 -0
  182. /package/dist/components/{p-BGcSrHKl.js.map → p-DT2MK8Kt.js.map} +0 -0
  183. /package/dist/components/{p-DV23KMU-.js.map → p-DyZj3k9S.js.map} +0 -0
  184. /package/dist/components/{p-D6hvtWDk.js.map → p-KRGBGTu5.js.map} +0 -0
@@ -0,0 +1,311 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "tooltip",
4
+ "title": "Tooltip",
5
+ "description": "Supplementary, non-interactive visual label for an already named action, shown on mouse or hover-capable pen and keyboard focus.",
6
+ "type": "registry:ui",
7
+ "meta": {
8
+ "library": "@ds-mo/ui",
9
+ "distribution": "npm",
10
+ "storybook": "https://zainadeel.github.io/compomo/?path=/story/tooltip",
11
+ "source": "src/wc/components/Tooltip/Tooltip.tsx",
12
+ "intentStatus": "complete",
13
+ "intent": {
14
+ "audience": "general",
15
+ "status": "stable",
16
+ "summary": "Supplementary, non-interactive visual label for an already named action, shown on mouse or hover-capable pen and keyboard focus.",
17
+ "useWhen": [
18
+ "An icon-only or dense control benefits from a short visual label for sighted mouse, pen, and keyboard users.",
19
+ "A non-essential keyboard shortcut should appear beside a concise visual label.",
20
+ "Adjacent chrome actions need delayed first disclosure with instant warm handoff between tooltips."
21
+ ],
22
+ "avoidWhen": [
23
+ "The tooltip would be the trigger's only accessible name or contain information required to complete the task.",
24
+ "The popup needs links, buttons, rich content, a close action, click-to-open behavior, or touch access.",
25
+ "The callout follows a chart cursor or data point rather than a slotted control."
26
+ ],
27
+ "alternatives": [
28
+ {
29
+ "when": "The popup contains a contextual list of actions or options.",
30
+ "component": "component:ds-menu",
31
+ "reason": "Menu provides interactive content, keyboard navigation, selection, and close behavior."
32
+ },
33
+ {
34
+ "when": "The content requires focus management, substantial explanation, confirmation, or a form.",
35
+ "component": "component:ds-modal",
36
+ "reason": "Modal provides dialog semantics and focus containment."
37
+ },
38
+ {
39
+ "when": "A chart needs a cursor- or data-point-positioned value callout.",
40
+ "component": "component:ds-tooltip-data-viz",
41
+ "reason": "TooltipDataViz accepts chart coordinates and is designed for data visualization hover feedback."
42
+ }
43
+ ],
44
+ "commonlyComposedWith": [
45
+ "component:ds-button-filled",
46
+ "component:ds-button-unfilled",
47
+ "component:ds-panel-nav",
48
+ "component:ds-panel-tools"
49
+ ],
50
+ "accessibility": [
51
+ "The slotted trigger must have its own accessible name, usually an aria-label that closely matches the visual tooltip label.",
52
+ "Tooltip content is supplementary and non-essential; touch input intentionally does not open it.",
53
+ "While open, the trigger is linked to the role=tooltip popup with aria-describedby; the relationship is removed when the popup leaves the DOM without disturbing consumer description IDs.",
54
+ "Keyboard focus opens the tooltip and Escape dismisses it without moving focus."
55
+ ],
56
+ "states": [
57
+ "The first hover or keyboard focus waits for delay; moving to another tooltip shortly after dismissal opens it immediately.",
58
+ "An empty or whitespace-only label suppresses the popup while preserving the wrapper.",
59
+ "Only one tooltip remains active globally; warm handoff removes the previous popup before showing the next.",
60
+ "The preferred side flips when it cannot fit, then alignment is clamped to viewport padding.",
61
+ "Reduced motion removes enter and exit fades while retaining the final visible or hidden state."
62
+ ],
63
+ "responsiveBehavior": [
64
+ "The portaled popup follows trigger and popup resize, viewport resize, and nested scrolling while open.",
65
+ "Touch users rely on the trigger's accessible and visible context rather than tooltip disclosure.",
66
+ "Keep labels concise and non-wrapping; use inline text or a larger disclosure component for essential explanation."
67
+ ],
68
+ "frameworkCaveats": {
69
+ "customElements": [
70
+ "Place exactly one trigger element as the component's light-DOM child.",
71
+ "Replacing the slotted trigger rebinds pointer and focus behavior automatically.",
72
+ "sideOffset, alignOffset, and delay accept numbers or TokoMo CSS values."
73
+ ],
74
+ "react": [
75
+ "Wrap one focusable trigger with DsTooltip; keep the trigger's aria-label independent from the tooltip label."
76
+ ],
77
+ "angular": [
78
+ "Wrap one focusable trigger with DsTooltip and use property binding when offset or delay values are not plain strings."
79
+ ]
80
+ },
81
+ "references": [
82
+ {
83
+ "label": "Storybook behavior examples",
84
+ "path": "src/wc/components/Tooltip/Tooltip.stories.ts"
85
+ },
86
+ {
87
+ "label": "Cross-browser behavior and accessibility coverage",
88
+ "path": "tests/e2e/tooltip.spec.ts"
89
+ },
90
+ {
91
+ "label": "Positioning unit coverage",
92
+ "path": "tests/tooltip-position.test.ts"
93
+ }
94
+ ]
95
+ },
96
+ "api": {
97
+ "props": {
98
+ "align": {
99
+ "type": "TooltipAlign",
100
+ "resolvedType": "\"center\" | \"end\" | \"start\"",
101
+ "attribute": "align",
102
+ "default": "'center'",
103
+ "required": false,
104
+ "mutable": false
105
+ },
106
+ "alignOffset": {
107
+ "type": "number | string",
108
+ "resolvedType": "number | string",
109
+ "attribute": "align-offset",
110
+ "default": "0",
111
+ "required": false,
112
+ "mutable": false,
113
+ "description": "Cross-axis offset — number (px) or TokoMo length."
114
+ },
115
+ "delay": {
116
+ "type": "number | string",
117
+ "resolvedType": "number | string",
118
+ "attribute": "delay",
119
+ "default": "TOKEN_DEFAULTS.animationDelayMedium3",
120
+ "required": false,
121
+ "mutable": false,
122
+ "description": "Hover show delay before the tooltip appears.\nDefault: `--effect-animation-delay-medium-3` (1000ms). Accepts a number (ms)\nor a TokoMo time token / `var(--effect-animation-delay-*)`. Applies to the\ninitial hover/focus show only — after a recent dismiss, reopen is instant.\nPrefer the default; override only for denser chrome or rare/destructive actions."
123
+ },
124
+ "label": {
125
+ "type": "string",
126
+ "resolvedType": "string",
127
+ "attribute": "label",
128
+ "required": true,
129
+ "mutable": false,
130
+ "description": "Tooltip text. Empty/whitespace skips show — useful when the wrapper must stay\nmounted for layout/animation stability (e.g. PanelNav expand/collapse)."
131
+ },
132
+ "shortcutKey": {
133
+ "type": "string | undefined",
134
+ "resolvedType": "string | undefined",
135
+ "attribute": "shortcut-key",
136
+ "required": false,
137
+ "mutable": false
138
+ },
139
+ "shortcutKeyPosition": {
140
+ "type": "'start' | 'end'",
141
+ "resolvedType": "\"end\" | \"start\"",
142
+ "attribute": "shortcut-key-position",
143
+ "default": "'end'",
144
+ "required": false,
145
+ "mutable": false
146
+ },
147
+ "side": {
148
+ "type": "TooltipSide",
149
+ "resolvedType": "\"bottom\" | \"left\" | \"right\" | \"top\"",
150
+ "attribute": "side",
151
+ "default": "'top'",
152
+ "required": false,
153
+ "mutable": false
154
+ },
155
+ "sideOffset": {
156
+ "type": "number | string",
157
+ "resolvedType": "number | string",
158
+ "attribute": "side-offset",
159
+ "default": "TOKEN_CSS_LENGTHS.space050",
160
+ "required": false,
161
+ "mutable": false,
162
+ "description": "Gap between anchor and tooltip — number (px) or TokoMo length."
163
+ },
164
+ "size": {
165
+ "type": "TooltipSize",
166
+ "resolvedType": "\"md\" | \"sm\" | \"xs\"",
167
+ "attribute": "size",
168
+ "default": "'md'",
169
+ "required": false,
170
+ "mutable": false,
171
+ "description": "Control density (height, padding, type)."
172
+ }
173
+ },
174
+ "events": [],
175
+ "methods": [],
176
+ "slots": []
177
+ },
178
+ "props": {
179
+ "align": {
180
+ "type": "TooltipAlign",
181
+ "resolvedType": "\"center\" | \"end\" | \"start\"",
182
+ "attribute": "align",
183
+ "default": "'center'",
184
+ "required": false,
185
+ "mutable": false
186
+ },
187
+ "alignOffset": {
188
+ "type": "number | string",
189
+ "resolvedType": "number | string",
190
+ "attribute": "align-offset",
191
+ "default": "0",
192
+ "required": false,
193
+ "mutable": false,
194
+ "description": "Cross-axis offset — number (px) or TokoMo length."
195
+ },
196
+ "delay": {
197
+ "type": "number | string",
198
+ "resolvedType": "number | string",
199
+ "attribute": "delay",
200
+ "default": "TOKEN_DEFAULTS.animationDelayMedium3",
201
+ "required": false,
202
+ "mutable": false,
203
+ "description": "Hover show delay before the tooltip appears.\nDefault: `--effect-animation-delay-medium-3` (1000ms). Accepts a number (ms)\nor a TokoMo time token / `var(--effect-animation-delay-*)`. Applies to the\ninitial hover/focus show only — after a recent dismiss, reopen is instant.\nPrefer the default; override only for denser chrome or rare/destructive actions."
204
+ },
205
+ "label": {
206
+ "type": "string",
207
+ "resolvedType": "string",
208
+ "attribute": "label",
209
+ "required": true,
210
+ "mutable": false,
211
+ "description": "Tooltip text. Empty/whitespace skips show — useful when the wrapper must stay\nmounted for layout/animation stability (e.g. PanelNav expand/collapse)."
212
+ },
213
+ "shortcutKey": {
214
+ "type": "string | undefined",
215
+ "resolvedType": "string | undefined",
216
+ "attribute": "shortcut-key",
217
+ "required": false,
218
+ "mutable": false
219
+ },
220
+ "shortcutKeyPosition": {
221
+ "type": "'start' | 'end'",
222
+ "resolvedType": "\"end\" | \"start\"",
223
+ "attribute": "shortcut-key-position",
224
+ "default": "'end'",
225
+ "required": false,
226
+ "mutable": false
227
+ },
228
+ "side": {
229
+ "type": "TooltipSide",
230
+ "resolvedType": "\"bottom\" | \"left\" | \"right\" | \"top\"",
231
+ "attribute": "side",
232
+ "default": "'top'",
233
+ "required": false,
234
+ "mutable": false
235
+ },
236
+ "sideOffset": {
237
+ "type": "number | string",
238
+ "resolvedType": "number | string",
239
+ "attribute": "side-offset",
240
+ "default": "TOKEN_CSS_LENGTHS.space050",
241
+ "required": false,
242
+ "mutable": false,
243
+ "description": "Gap between anchor and tooltip — number (px) or TokoMo length."
244
+ },
245
+ "size": {
246
+ "type": "TooltipSize",
247
+ "resolvedType": "\"md\" | \"sm\" | \"xs\"",
248
+ "attribute": "size",
249
+ "default": "'md'",
250
+ "required": false,
251
+ "mutable": false,
252
+ "description": "Control density (height, padding, type)."
253
+ }
254
+ },
255
+ "events": [],
256
+ "methods": [],
257
+ "slots": [],
258
+ "exports": {
259
+ "customElement": "ds-tooltip",
260
+ "react": "DsTooltip",
261
+ "angular": "DsTooltip"
262
+ },
263
+ "consumption": {
264
+ "install": "npm install @ds-mo/ui @ds-mo/tokens @ds-mo/icons",
265
+ "cssSetup": "import '@ds-mo/tokens';\nimport '@ds-mo/tokens/reset';\nimport '@ds-mo/tokens/globals';",
266
+ "customElements": {
267
+ "import": "import '@ds-mo/ui/dist/components/ds-tooltip.js';",
268
+ "example": "<ds-tooltip></ds-tooltip>"
269
+ },
270
+ "react": {
271
+ "import": "import { DsTooltip } from '@ds-mo/ui/react';",
272
+ "example": "<DsTooltip />"
273
+ },
274
+ "angular": {
275
+ "import": "import { DsTooltip } from '@ds-mo/ui/angular/ds-tooltip';",
276
+ "example": "<ds-tooltip></ds-tooltip>"
277
+ },
278
+ "peerDependencies": {
279
+ "required": [
280
+ "@ds-mo/tokens ^3.1.1",
281
+ "@ds-mo/icons ^6.2.0"
282
+ ],
283
+ "frameworks": "Custom Elements; React 18/19 wrappers; Angular 19-22 standalone adapters."
284
+ }
285
+ }
286
+ },
287
+ "dependencies": [
288
+ "@ds-mo/ui",
289
+ "@ds-mo/tokens"
290
+ ],
291
+ "registryDependencies": [
292
+ "text"
293
+ ],
294
+ "files": [
295
+ {
296
+ "path": "src/wc/components/Tooltip/Tooltip.css",
297
+ "content": "@import '../../utils/control-density.css';\n@import '../../utils/key-hint.css';\n\n.tooltip-popup {\n box-sizing: border-box;\n background-color: var(--color-background-primary);\n border-radius: var(--ds-control-radius, var(--dimension-radius-025));\n box-shadow: var(--effect-elevation-elevated-floating);\n white-space: nowrap;\n pointer-events: none;\n animation: tooltipFadeIn var(--effect-motion-short-2) forwards;\n will-change: transform;\n backface-visibility: hidden;\n}\n\n/* Warm handoff between nearby triggers — no enter fade (avoids 20–100ms lag). */\n.tooltip-popup--instant {\n animation: none;\n opacity: 1;\n}\n\n.tooltip-popup--closing {\n animation: tooltipFadeOut var(--effect-motion-short-3) forwards;\n}\n\n/* Density: md / sm / xs via `.ds-control--*` on `.tooltip-inner`. */\n.tooltip-inner {\n box-sizing: border-box;\n height: var(--ds-control-height, var(--dimension-size-400));\n display: flex;\n align-items: center;\n gap: var(--ds-control-gap, var(--dimension-space-050));\n padding: 0 var(--ds-control-padding-inline, var(--dimension-space-075));\n}\n\n/*\n * Label layout lives on ds-text (metric-box + control label-inset).\n * NOTE: Stencil scopes this to `ds-text.sc-ds-tooltip`, but portaled\n * createElement ds-text loses that class when Text's <Host class> renders.\n * `renderPopupContent` therefore also sets these as inline styles.\n */\n.tooltip-inner > ds-text {\n flex-shrink: 0;\n min-width: max-content;\n max-width: none;\n padding: 0 var(--ds-control-label-inset, var(--dimension-space-025));\n color: var(--color-foreground-primary);\n}\n\n@keyframes tooltipFadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n}\n\n@keyframes tooltipFadeOut {\n from { opacity: 1; }\n to { opacity: 0; }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .tooltip-popup,\n .tooltip-popup--instant {\n animation: none;\n opacity: 1;\n }\n\n .tooltip-popup--closing {\n animation: none;\n opacity: 0;\n }\n}\n",
298
+ "type": "registry:ui"
299
+ },
300
+ {
301
+ "path": "src/wc/components/Tooltip/Tooltip.tsx",
302
+ "content": "import { Component, Prop, Element, Watch, h, Host } from '@stencil/core';\nimport {\n CONTROL_TEXT_VARIANT,\n resolveCssLengthPx,\n resolveCssTimeMs,\n resolveMotionTimeMs,\n TOKEN_CSS_LENGTHS,\n TOKEN_DEFAULTS,\n} from '../../utils';\nimport type { TextVariant } from '../Text/text-types';\nimport { shortcutKeyLabels } from '../../utils/shortcut-key';\nimport { computeTooltipPosition } from './tooltip-position';\n// Side-effect: register `ds-text` — the portal builds it via createElement, not JSX.\nimport '../Text/Text';\n\nexport type TooltipSide = 'top' | 'right' | 'bottom' | 'left';\nexport type TooltipAlign = 'start' | 'center' | 'end';\nexport type TooltipSize = 'md' | 'sm' | 'xs';\n\nconst FALLBACK_HEIGHT: Record<TooltipSize, string> = {\n md: TOKEN_DEFAULTS.size400,\n sm: TOKEN_DEFAULTS.size300,\n xs: TOKEN_DEFAULTS.size200,\n};\n\nlet lastDismissedAt = 0;\nlet tooltipIdCounter = 0;\n/** Currently open tooltip — force-cleared on warm handoff so tips don't cross-fade. */\nlet activeTooltip: Tooltip | null = null;\n\ntype DsTextEl = HTMLElement & {\n as: string;\n variant: TextVariant;\n emphasis: boolean;\n color: string;\n wrap: string;\n};\n\nfunction createDsText(opts: {\n variant: TextVariant;\n emphasis?: boolean;\n color?: string;\n wrap?: 'wrap' | 'nowrap' | 'balance' | 'pretty';\n text: string;\n}): DsTextEl {\n const el = document.createElement('ds-text') as DsTextEl;\n el.as = 'span';\n el.variant = opts.variant;\n el.emphasis = opts.emphasis ?? false;\n el.color = opts.color ?? 'inherit';\n if (opts.wrap) el.wrap = opts.wrap;\n el.textContent = opts.text;\n return el;\n}\n\n/**\n * Control-density label styles for portaled ds-text.\n * Scoped CSS requires `sc-ds-tooltip` on the host, but Text's `<Host class>`\n * overwrites imperative className — so these must be inline to stick.\n */\nfunction styleTooltipLabel(el: HTMLElement) {\n el.style.flexShrink = '0';\n el.style.minWidth = 'max-content';\n el.style.maxWidth = 'none';\n el.style.padding = '0 var(--ds-control-label-inset, var(--dimension-space-025))';\n el.style.color = 'var(--color-foreground-primary)';\n}\n\n/**\n * Imperative body portal for the popup.\n * Stencil must not own the portaled node — moving a VDOM child to `document.body`\n * causes recreate → re-portal → @State loops that freeze the page.\n */\n@Component({\n tag: 'ds-tooltip',\n styleUrl: 'Tooltip.css',\n scoped: true,\n})\nexport class Tooltip {\n @Element() el!: HTMLElement;\n\n /**\n * Tooltip text. Empty/whitespace skips show — useful when the wrapper must stay\n * mounted for layout/animation stability (e.g. PanelNav expand/collapse).\n */\n @Prop() label!: string;\n\n /** Control density (height, padding, type). */\n @Prop() size: TooltipSize = 'md';\n\n @Prop() side: TooltipSide = 'top';\n @Prop() align: TooltipAlign = 'center';\n /** Gap between anchor and tooltip — number (px) or TokoMo length. */\n @Prop() sideOffset: number | string = TOKEN_CSS_LENGTHS.space050;\n /** Cross-axis offset — number (px) or TokoMo length. */\n @Prop() alignOffset: number | string = 0;\n /**\n * Hover show delay before the tooltip appears.\n * Default: `--effect-animation-delay-medium-3` (1000ms). Accepts a number (ms)\n * or a TokoMo time token / `var(--effect-animation-delay-*)`. Applies to the\n * initial hover/focus show only — after a recent dismiss, reopen is instant.\n * Prefer the default; override only for denser chrome or rare/destructive actions.\n */\n @Prop() delay: number | string = TOKEN_DEFAULTS.animationDelayMedium3;\n @Prop() shortcutKey: string | undefined;\n @Prop() shortcutKeyPosition: 'start' | 'end' = 'end';\n\n private tooltipId = `ds-tooltip-${++tooltipIdCounter}`;\n private delayTimer: ReturnType<typeof setTimeout> | null = null;\n private closeTimer: ReturnType<typeof setTimeout> | null = null;\n private anchor: HTMLElement | null = null;\n private popupEl: HTMLElement | null = null;\n private positionObserver: ResizeObserver | null = null;\n private anchorObserver: MutationObserver | null = null;\n private positionFrame: number | null = null;\n private skipEnterAnimation = false;\n private isOpen = false;\n private lastInteractionWasKeyboard = false;\n private pointerEnterHandler = (event: PointerEvent) => {\n if (event.pointerType === 'touch') return;\n this.show();\n };\n private pointerLeaveHandler = (event: PointerEvent) => {\n if (event.pointerType === 'touch') return;\n this.hide();\n };\n private pointerDownHandler = (event: PointerEvent) => {\n this.lastInteractionWasKeyboard = false;\n if (event.pointerType === 'touch' && (this.isOpen || this.popupEl)) this.hideInstant();\n };\n private keyDownHandler = () => {\n this.lastInteractionWasKeyboard = true;\n };\n /** focusin/focusout so nested focus targets (e.g. ds-button-* inner button) still open the tip. */\n private focusHandler = () => {\n if (this.lastInteractionWasKeyboard || this.anchor?.matches(':focus-visible')) this.show();\n };\n private blurHandler: (e: FocusEvent) => void = (e) => {\n const next = e.relatedTarget as Node | null;\n if (next && this.anchor?.contains(next)) return;\n this.hide();\n };\n private scrollResizeHandler = () => {\n if (this.positionFrame !== null) return;\n this.positionFrame = requestAnimationFrame(() => {\n this.positionFrame = null;\n this.calculatePosition();\n });\n };\n private escapeHandler = (event: KeyboardEvent) => {\n if (event.key !== 'Escape' || !this.isOpen) return;\n event.preventDefault();\n this.hide();\n };\n\n componentDidLoad() {\n this.bindAnchor();\n this.anchorObserver = new MutationObserver(() => this.handleSlotChange());\n this.anchorObserver.observe(this.el, { childList: true });\n }\n\n disconnectedCallback() {\n if (activeTooltip === this) activeTooltip = null;\n this.anchorObserver?.disconnect();\n this.anchorObserver = null;\n this.unbindAnchor();\n this.clearTimers();\n this.destroyPopup();\n }\n\n @Watch('label')\n @Watch('size')\n @Watch('side')\n @Watch('align')\n @Watch('sideOffset')\n @Watch('alignOffset')\n @Watch('shortcutKey')\n @Watch('shortcutKeyPosition')\n onContentOrPositionChange() {\n if (!this.label?.trim()) {\n if (this.isOpen || this.popupEl) this.hideInstant();\n return;\n }\n if (!this.popupEl || !this.isOpen) return;\n this.renderPopupContent();\n this.schedulePosition();\n }\n\n private get viewportPadPx(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.space050, TOKEN_DEFAULTS.space050);\n }\n\n private get sideOffsetPx(): number {\n return resolveCssLengthPx(this.sideOffset, TOKEN_DEFAULTS.space050);\n }\n\n private get alignOffsetPx(): number {\n return resolveCssLengthPx(this.alignOffset, 0);\n }\n\n private get hoverDelayMs(): number {\n return resolveCssTimeMs(this.delay, TOKEN_DEFAULTS.animationDelayMedium3);\n }\n\n private get instantReopenMs(): number {\n return resolveCssTimeMs(\n TOKEN_DEFAULTS.animationDurationMedium1,\n TOKEN_DEFAULTS.animationDurationMedium1,\n );\n }\n\n private get fadeOutMs(): number {\n return resolveMotionTimeMs(TOKEN_DEFAULTS.motionShort3, TOKEN_DEFAULTS.animationDurationShort3);\n }\n\n private get tooltipFallbackWidthPx(): number {\n return resolveCssLengthPx(TOKEN_DEFAULTS.tooltipFallbackWidth, TOKEN_DEFAULTS.tooltipFallbackWidth);\n }\n\n private get tooltipFallbackHeightPx(): number {\n const token = FALLBACK_HEIGHT[this.size];\n return resolveCssLengthPx(token, token);\n }\n\n private bindAnchor() {\n const slot = this.el.querySelector('slot') as HTMLSlotElement | null;\n const slotted = slot?.assignedElements?.() ?? [];\n const child = (slotted[0] ?? this.el.firstElementChild) as HTMLElement | null;\n if (!child || child === this.anchor) return;\n this.anchor = child;\n child.addEventListener('pointerenter', this.pointerEnterHandler);\n child.addEventListener('pointerleave', this.pointerLeaveHandler);\n child.addEventListener('pointerdown', this.pointerDownHandler);\n child.addEventListener('keydown', this.keyDownHandler);\n child.addEventListener('focusin', this.focusHandler);\n child.addEventListener('focusout', this.blurHandler);\n }\n\n private unbindAnchor() {\n if (!this.anchor) return;\n this.unlinkDescribedBy();\n this.anchor.removeEventListener('pointerenter', this.pointerEnterHandler);\n this.anchor.removeEventListener('pointerleave', this.pointerLeaveHandler);\n this.anchor.removeEventListener('pointerdown', this.pointerDownHandler);\n this.anchor.removeEventListener('keydown', this.keyDownHandler);\n this.anchor.removeEventListener('focusin', this.focusHandler);\n this.anchor.removeEventListener('focusout', this.blurHandler);\n this.anchor = null;\n }\n\n private linkDescribedBy() {\n if (!this.anchor || !this.popupEl) return;\n const ids = new Set((this.anchor.getAttribute('aria-describedby') ?? '').split(/\\s+/).filter(Boolean));\n ids.add(this.tooltipId);\n this.anchor.setAttribute('aria-describedby', Array.from(ids).join(' '));\n }\n\n private unlinkDescribedBy() {\n if (!this.anchor) return;\n const ids = (this.anchor.getAttribute('aria-describedby') ?? '')\n .split(/\\s+/)\n .filter(id => id && id !== this.tooltipId);\n if (ids.length) this.anchor.setAttribute('aria-describedby', ids.join(' '));\n else this.anchor.removeAttribute('aria-describedby');\n }\n\n private handleSlotChange = () => {\n const slot = this.el.querySelector('slot') as HTMLSlotElement | null;\n const next = (slot?.assignedElements?.()[0] ?? this.el.firstElementChild) as HTMLElement | null;\n if (next === this.anchor) return;\n if (this.isOpen || this.popupEl) this.hideInstant();\n this.unbindAnchor();\n this.bindAnchor();\n };\n\n private clearTimers() {\n if (this.delayTimer) { clearTimeout(this.delayTimer); this.delayTimer = null; }\n if (this.closeTimer) { clearTimeout(this.closeTimer); this.closeTimer = null; }\n }\n\n private setupOpenListeners() {\n window.addEventListener('scroll', this.scrollResizeHandler, true);\n window.addEventListener('resize', this.scrollResizeHandler);\n document.addEventListener('keydown', this.escapeHandler);\n }\n\n private teardownOpenListeners() {\n window.removeEventListener('scroll', this.scrollResizeHandler, true);\n window.removeEventListener('resize', this.scrollResizeHandler);\n document.removeEventListener('keydown', this.escapeHandler);\n if (this.positionFrame !== null) {\n cancelAnimationFrame(this.positionFrame);\n this.positionFrame = null;\n }\n }\n\n private destroyPopup() {\n this.teardownOpenListeners();\n this.positionObserver?.disconnect();\n this.positionObserver = null;\n this.unlinkDescribedBy();\n if (!this.popupEl) return;\n this.popupEl.remove();\n this.popupEl = null;\n }\n\n /**\n * Position after `ds-text` upgrades and lays out. Measuring synchronously in\n * `mountPopup` reads a collapsed/fallback width and places left/right tips wrong.\n */\n private schedulePosition() {\n if (!this.popupEl) return;\n\n const reapplyLabelStyles = () => {\n const label = this.popupEl?.querySelector(':scope > .tooltip-inner > ds-text');\n if (label instanceof HTMLElement) styleTooltipLabel(label);\n };\n\n requestAnimationFrame(() => {\n reapplyLabelStyles();\n this.calculatePosition();\n requestAnimationFrame(() => {\n reapplyLabelStyles();\n this.calculatePosition();\n });\n });\n\n this.positionObserver?.disconnect();\n this.positionObserver = new ResizeObserver(() => this.calculatePosition());\n this.positionObserver.observe(this.popupEl);\n if (this.anchor) this.positionObserver.observe(this.anchor);\n }\n\n /** Drop the open tip immediately (warm handoff to another tooltip). */\n private hideInstant() {\n this.clearTimers();\n lastDismissedAt = Date.now();\n if (activeTooltip === this) activeTooltip = null;\n this.destroyPopup();\n this.isOpen = false;\n this.skipEnterAnimation = false;\n }\n\n private show() {\n // Empty label = wrapper present for DOM stability (e.g. PanelNav expand/collapse)\n // but no tip should appear.\n if (!this.label?.trim()) return;\n this.clearTimers();\n let instant = Date.now() - lastDismissedAt < this.instantReopenMs;\n if (activeTooltip && activeTooltip !== this) {\n activeTooltip.hideInstant();\n instant = true;\n }\n // eslint-disable-next-line @typescript-eslint/no-this-alias -- module singleton tracks the active instance\n activeTooltip = this;\n this.skipEnterAnimation = instant;\n if (instant) {\n this.mountPopup();\n return;\n }\n this.delayTimer = setTimeout(() => {\n this.delayTimer = null;\n if (!this.label?.trim()) return;\n this.mountPopup();\n }, this.hoverDelayMs);\n }\n\n private hide() {\n this.clearTimers();\n if (!this.popupEl && !this.isOpen) return;\n lastDismissedAt = Date.now();\n if (!this.popupEl) {\n this.isOpen = false;\n return;\n }\n this.popupEl.classList.remove('tooltip-popup--instant');\n this.popupEl.classList.add('tooltip-popup--closing');\n if (this.fadeOutMs === 0) {\n if (activeTooltip === this) activeTooltip = null;\n this.destroyPopup();\n this.isOpen = false;\n this.skipEnterAnimation = false;\n return;\n }\n this.closeTimer = setTimeout(() => {\n this.closeTimer = null;\n if (activeTooltip === this) activeTooltip = null;\n this.destroyPopup();\n this.isOpen = false;\n this.skipEnterAnimation = false;\n }, this.fadeOutMs);\n }\n\n private mountPopup() {\n if (!this.popupEl) {\n const tip = document.createElement('div');\n tip.id = this.tooltipId;\n tip.setAttribute('role', 'tooltip');\n // `sc-ds-tooltip` is required for Stencil scoped CSS to match outside the host.\n tip.className = 'tooltip-popup sc-ds-tooltip';\n Object.assign(tip.style, {\n position: 'fixed',\n left: '0',\n top: '0',\n zIndex: 'var(--dimension-z-index-tooltip)',\n pointerEvents: 'none',\n });\n document.body.appendChild(tip);\n this.popupEl = tip;\n }\n\n this.setupOpenListeners();\n this.linkDescribedBy();\n this.popupEl.classList.toggle('tooltip-popup--instant', this.skipEnterAnimation);\n this.popupEl.classList.remove('tooltip-popup--closing');\n this.renderPopupContent();\n this.schedulePosition();\n this.isOpen = true;\n }\n\n private renderPopupContent() {\n if (!this.popupEl) return;\n const textVariant = CONTROL_TEXT_VARIANT[this.size];\n const density =\n this.size === 'md' ? 'ds-control--md' : this.size === 'sm' ? 'ds-control--sm' : 'ds-control--xs';\n // Every layout node needs `sc-ds-tooltip` so scoped selectors (`.foo.sc-ds-tooltip`) match.\n const sc = 'sc-ds-tooltip';\n\n const inner = document.createElement('div');\n inner.className = `tooltip-inner ${density} ${sc}`;\n\n const appendShortcut = (position: 'start' | 'end') => {\n if (!this.shortcutKey || this.shortcutKeyPosition !== position) return;\n const group = document.createElement('span');\n group.className = `key-hint-group ${sc}`;\n group.setAttribute('aria-hidden', 'true');\n\n for (const label of shortcutKeyLabels(this.shortcutKey)) {\n const hint = document.createElement('span');\n const wide = Array.from(label).length > 1 ? ' key-hint--wide' : '';\n hint.className = `key-hint${wide} ${sc}`;\n const text = document.createElement('span');\n text.className = `key-hint__label ${sc}`;\n text.textContent = label;\n hint.appendChild(text);\n group.appendChild(hint);\n }\n inner.appendChild(group);\n };\n\n appendShortcut('start');\n\n // ds-text is the layout box (metric-box + 2px control label-inset).\n // Inline styles required — see styleTooltipLabel.\n const label = createDsText({ variant: textVariant, wrap: 'nowrap', text: this.label });\n styleTooltipLabel(label);\n inner.appendChild(label);\n\n appendShortcut('end');\n\n this.popupEl.replaceChildren(inner);\n }\n\n private calculatePosition() {\n if (!this.anchor || !this.popupEl) return;\n const tip = this.popupEl;\n const a = this.anchor.getBoundingClientRect();\n const tw = tip.offsetWidth || this.tooltipFallbackWidthPx;\n const th = tip.offsetHeight || this.tooltipFallbackHeightPx;\n const { x, y, resolvedSide } = computeTooltipPosition({\n anchorRect: a,\n popupWidth: tw,\n popupHeight: th,\n side: this.side,\n align: this.align,\n sideOffsetPx: this.sideOffsetPx,\n alignOffsetPx: this.alignOffsetPx,\n viewportPadPx: this.viewportPadPx,\n viewportWidth: window.innerWidth,\n viewportHeight: window.innerHeight,\n });\n tip.dataset.side = resolvedSide;\n tip.style.transform = `translate(${Math.round(x)}px, ${Math.round(y)}px)`;\n }\n\n render() {\n return (\n <Host style={{ display: 'contents' }}>\n <slot onSlotchange={this.handleSlotChange} />\n </Host>\n );\n }\n}\n",
303
+ "type": "registry:ui"
304
+ },
305
+ {
306
+ "path": "src/wc/components/Tooltip/tooltip-position.ts",
307
+ "content": "import type { TooltipAlign, TooltipSide } from './Tooltip';\n\nexport interface TooltipPositionInput {\n anchorRect: Pick<DOMRectReadOnly, 'top' | 'left' | 'right' | 'bottom' | 'width' | 'height'>;\n popupWidth: number;\n popupHeight: number;\n side: TooltipSide;\n align: TooltipAlign;\n sideOffsetPx: number;\n alignOffsetPx: number;\n viewportPadPx: number;\n viewportWidth: number;\n viewportHeight: number;\n}\n\nexport interface TooltipPosition {\n x: number;\n y: number;\n resolvedSide: TooltipSide;\n}\n\nconst OPPOSITE_SIDE: Record<TooltipSide, TooltipSide> = {\n top: 'bottom',\n right: 'left',\n bottom: 'top',\n left: 'right',\n};\n\nfunction rawPosition(\n input: TooltipPositionInput,\n side: TooltipSide,\n): Pick<TooltipPosition, 'x' | 'y'> {\n const {\n anchorRect: anchor,\n popupWidth,\n popupHeight,\n align,\n sideOffsetPx,\n alignOffsetPx,\n } = input;\n\n if (side === 'top' || side === 'bottom') {\n return {\n x:\n align === 'start'\n ? anchor.left + alignOffsetPx\n : align === 'end'\n ? anchor.right - popupWidth + alignOffsetPx\n : anchor.left + anchor.width / 2 - popupWidth / 2 + alignOffsetPx,\n y: side === 'top'\n ? anchor.top - popupHeight - sideOffsetPx\n : anchor.bottom + sideOffsetPx,\n };\n }\n\n return {\n x: side === 'left'\n ? anchor.left - popupWidth - sideOffsetPx\n : anchor.right + sideOffsetPx,\n y:\n align === 'start'\n ? anchor.top + alignOffsetPx\n : align === 'end'\n ? anchor.bottom - popupHeight + alignOffsetPx\n : anchor.top + anchor.height / 2 - popupHeight / 2 + alignOffsetPx,\n };\n}\n\nfunction mainAxisOverflow(\n input: TooltipPositionInput,\n side: TooltipSide,\n position: Pick<TooltipPosition, 'x' | 'y'>,\n): number {\n const {\n popupWidth,\n popupHeight,\n viewportPadPx,\n viewportWidth,\n viewportHeight,\n } = input;\n\n if (side === 'top' || side === 'bottom') {\n return Math.max(viewportPadPx - position.y, 0) +\n Math.max(position.y + popupHeight - (viewportHeight - viewportPadPx), 0);\n }\n\n return Math.max(viewportPadPx - position.x, 0) +\n Math.max(position.x + popupWidth - (viewportWidth - viewportPadPx), 0);\n}\n\n/** Flip on the preferred axis when needed, then clamp within the viewport. */\nexport function computeTooltipPosition(input: TooltipPositionInput): TooltipPosition {\n const preferred = rawPosition(input, input.side);\n const oppositeSide = OPPOSITE_SIDE[input.side];\n const opposite = rawPosition(input, oppositeSide);\n const preferredOverflow = mainAxisOverflow(input, input.side, preferred);\n const oppositeOverflow = mainAxisOverflow(input, oppositeSide, opposite);\n const useOpposite = preferredOverflow > 0 && oppositeOverflow < preferredOverflow;\n const resolvedSide = useOpposite ? oppositeSide : input.side;\n const position = useOpposite ? opposite : preferred;\n const maxX = Math.max(input.viewportPadPx, input.viewportWidth - input.popupWidth - input.viewportPadPx);\n const maxY = Math.max(input.viewportPadPx, input.viewportHeight - input.popupHeight - input.viewportPadPx);\n\n return {\n x: Math.min(Math.max(position.x, input.viewportPadPx), maxX),\n y: Math.min(Math.max(position.y, input.viewportPadPx), maxY),\n resolvedSide,\n };\n}\n",
308
+ "type": "registry:ui"
309
+ }
310
+ ]
311
+ }
@@ -26,7 +26,6 @@ export { DsInput } from "./ds-input.js";
26
26
  export { DsLoader } from "./ds-loader.js";
27
27
  export { DsMenu } from "./ds-menu.js";
28
28
  export { DsModal } from "./ds-modal.js";
29
- export { DsPagination } from "./ds-pagination.js";
30
29
  export { DsPanelNav } from "./ds-panel-nav.js";
31
30
  export { DsPanelSubNav } from "./ds-panel-sub-nav.js";
32
31
  export { DsPanelTools } from "./ds-panel-tools.js";
@@ -37,9 +36,9 @@ export { DsShellGradientPicker } from "./ds-shell-gradient-picker.js";
37
36
  export { DsShellGradientSwatch } from "./ds-shell-gradient-swatch.js";
38
37
  export { DsSkeleton } from "./ds-skeleton.js";
39
38
  export { DsSlider } from "./ds-slider.js";
39
+ export { DsSwatchPicker } from "./ds-swatch-picker.js";
40
40
  export { DsSwitch } from "./ds-switch.js";
41
41
  export { DsTabGroup } from "./ds-tab-group.js";
42
- export { DsTable } from "./ds-table.js";
43
42
  export { DsTag } from "./ds-tag.js";
44
43
  export { DsText } from "./ds-text.js";
45
44
  export { DsTooltipDataViz } from "./ds-tooltip-data-viz.js";
@@ -27,7 +27,6 @@ export { DsInput } from "./ds-input.js";
27
27
  export { DsLoader } from "./ds-loader.js";
28
28
  export { DsMenu } from "./ds-menu.js";
29
29
  export { DsModal } from "./ds-modal.js";
30
- export { DsPagination } from "./ds-pagination.js";
31
30
  export { DsPanelNav } from "./ds-panel-nav.js";
32
31
  export { DsPanelSubNav } from "./ds-panel-sub-nav.js";
33
32
  export { DsPanelTools } from "./ds-panel-tools.js";
@@ -38,9 +37,9 @@ export { DsShellGradientPicker } from "./ds-shell-gradient-picker.js";
38
37
  export { DsShellGradientSwatch } from "./ds-shell-gradient-swatch.js";
39
38
  export { DsSkeleton } from "./ds-skeleton.js";
40
39
  export { DsSlider } from "./ds-slider.js";
40
+ export { DsSwatchPicker } from "./ds-swatch-picker.js";
41
41
  export { DsSwitch } from "./ds-switch.js";
42
42
  export { DsTabGroup } from "./ds-tab-group.js";
43
- export { DsTable } from "./ds-table.js";
44
43
  export { DsTag } from "./ds-tag.js";
45
44
  export { DsText } from "./ds-text.js";
46
45
  export { DsTooltipDataViz } from "./ds-tooltip-data-viz.js";
@@ -10,5 +10,6 @@ export type DsMenuEvents = {
10
10
  onDsClose: EventName<DsMenuCustomEvent<void>>;
11
11
  onDsSelect: EventName<DsMenuCustomEvent<MenuItemData>>;
12
12
  onDsGradientSelect: EventName<DsMenuCustomEvent<ShellGradientPreset>>;
13
+ onDsSwatchSelect: EventName<DsMenuCustomEvent<string>>;
13
14
  };
14
15
  export declare const DsMenu: StencilReactComponent<DsMenuElement, DsMenuEvents, Components.DsMenu>;
@@ -10,7 +10,8 @@ export const DsMenu = /*@__PURE__*/ createComponent({
10
10
  events: {
11
11
  onDsClose: 'dsClose',
12
12
  onDsSelect: 'dsSelect',
13
- onDsGradientSelect: 'dsGradientSelect'
13
+ onDsGradientSelect: 'dsGradientSelect',
14
+ onDsSwatchSelect: 'dsSwatchSelect'
14
15
  },
15
16
  defineCustomElement: defineDsMenu
16
17
  });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was automatically generated by the Stencil React Output Target.
3
+ * Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
4
+ */
5
+ import type { EventName, StencilReactComponent } from '@stencil/react-output-target/runtime';
6
+ import { type DsSwatchPickerCustomEvent } from "@ds-mo/ui";
7
+ import type { Components } from "@ds-mo/ui/dist/components";
8
+ import { DsSwatchPicker as DsSwatchPickerElement } from "@ds-mo/ui/dist/components/ds-swatch-picker.js";
9
+ export type DsSwatchPickerEvents = {
10
+ onDsChange: EventName<DsSwatchPickerCustomEvent<string>>;
11
+ };
12
+ export declare const DsSwatchPicker: StencilReactComponent<DsSwatchPickerElement, DsSwatchPickerEvents, Components.DsSwatchPicker>;
@@ -0,0 +1,12 @@
1
+ 'use client';
2
+ import { createComponent } from '@stencil/react-output-target/runtime';
3
+ import React from 'react';
4
+ import { DsSwatchPicker as DsSwatchPickerElement, defineCustomElement as defineDsSwatchPicker } from "@ds-mo/ui/dist/components/ds-swatch-picker.js";
5
+ export const DsSwatchPicker = /*@__PURE__*/ createComponent({
6
+ tagName: 'ds-swatch-picker',
7
+ elementClass: DsSwatchPickerElement,
8
+ // @ts-ignore - ignore potential React type mismatches between the Stencil Output Target and your project.
9
+ react: React,
10
+ events: { onDsChange: 'dsChange' },
11
+ defineCustomElement: defineDsSwatchPicker
12
+ });
@@ -1,7 +1,8 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
+ import { type ChoicePopupAnchorAlignment } from '../../utils';
2
3
  import { type MenuAlign, type MenuSide } from './menu-position';
3
4
  import type { MenuItemData, MenuSection } from './menu-types';
4
- import type { ShellGradientPreset } from '../../shell/shell-gradient-presets';
5
+ import { type ShellGradientPreset } from '../../shell/shell-gradient-presets';
5
6
  export declare class Menu {
6
7
  el: HTMLElement;
7
8
  open: boolean;
@@ -9,6 +10,8 @@ export declare class Menu {
9
10
  sections: MenuSection[];
10
11
  side: MenuSide;
11
12
  align: MenuAlign;
13
+ /** Align choice-row edges to the anchor by default; use `popup-frame` only for custom frame geometry. */
14
+ anchorAlignment: ChoicePopupAnchorAlignment;
12
15
  /** Gap between anchor and menu — number (px) or TokoMo length (`var(--dimension-space-050)`, etc.). */
13
16
  sideOffset: number | string;
14
17
  /** Cross-axis offset — number (px) or TokoMo length. */
@@ -33,6 +36,8 @@ export declare class Menu {
33
36
  dsSelect: EventEmitter<MenuItemData>;
34
37
  /** Emitted when a `gradient-picker` section swatch is chosen. */
35
38
  dsGradientSelect: EventEmitter<ShellGradientPreset>;
39
+ /** Emitted when a generic `swatch-picker` section option is chosen. */
40
+ dsSwatchSelect: EventEmitter<string>;
36
41
  private clickOutsideHandler;
37
42
  private scrollResizeHandler;
38
43
  private closeTimer;
@@ -74,6 +79,7 @@ export declare class Menu {
74
79
  private focusItem;
75
80
  private handleItemClick;
76
81
  private handleGradientSelect;
82
+ private handleSwatchSelect;
77
83
  render(): any;
78
84
  }
79
85
  //# sourceMappingURL=Menu.d.ts.map
@@ -1,8 +1,10 @@
1
+ import type { ChoicePopupAnchorAlignment } from '../../utils/choice-popup-alignment';
1
2
  import type { MenuAlign, MenuSide } from './menu-position';
2
3
  /** Placement props bindable on `ds-menu` (side, align, offsets). */
3
4
  export interface MenuPlacement {
4
5
  side: MenuSide;
5
6
  align: MenuAlign;
7
+ anchorAlignment: ChoicePopupAnchorAlignment;
6
8
  sideOffset: number | string;
7
9
  alignOffset: number | string;
8
10
  }
@@ -11,14 +13,15 @@ export interface MenuPlacement {
11
13
  * Anchor from `dsNavUserAction` detail `{ anchor }` (id `ds-panel-nav-user-menu-anchor`).
12
14
  *
13
15
  * Not for BarNav overflow menus — those use `side="bottom"` / `align="end"` internally.
14
- * `align: 'end'` bottom-aligns on the anchor; offsets nudge into the content area:
16
+ * `align: 'end'` bottom-aligns the last choice cell on the anchor; the side offset nudges into the content area:
15
17
  * - `sideOffset` space-100 + space-050 (12px): 4px past the panel-nav outer edge (anchor is ~8px inset).
16
- * - `alignOffset` space-050 (4px): 4px below the footer user row.
18
+ * - `anchorAlignment: 'choice-cell'`: the shared section inset puts the last row edge on the footer user row.
17
19
  */
18
20
  export declare const PANEL_NAV_USER_MENU_PLACEMENT: {
19
21
  readonly side: "right";
20
22
  readonly align: "end";
23
+ readonly anchorAlignment: "choice-cell";
21
24
  readonly sideOffset: "calc(var(--dimension-space-100) + var(--dimension-space-050))";
22
- readonly alignOffset: "var(--dimension-space-050)";
25
+ readonly alignOffset: 0;
23
26
  };
24
27
  //# sourceMappingURL=menu-placement.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import type { ShellGradientPreset } from '../../shell/shell-gradient-presets';
2
+ import type { SwatchPickerOption, SwatchPickerSection } from '../SwatchPicker/swatch-picker-types';
2
3
  export type { MenuAlign, MenuSide } from './menu-position';
3
4
  export { PANEL_NAV_USER_MENU_PLACEMENT, type MenuPlacement, } from './menu-placement';
4
5
  export interface MenuItemData {
@@ -20,10 +21,22 @@ export interface MenuItemsSection {
20
21
  }
21
22
  export interface MenuGradientPickerSection {
22
23
  header?: string;
24
+ /** @deprecated Use the generic `swatch-picker` section. */
23
25
  variant: 'gradient-picker';
24
26
  value: ShellGradientPreset;
25
27
  }
26
- export type MenuSection = MenuItemsSection | MenuGradientPickerSection;
28
+ export interface MenuSwatchPickerSection {
29
+ header?: string;
30
+ variant: 'swatch-picker';
31
+ value: string;
32
+ options?: SwatchPickerOption[];
33
+ sections?: SwatchPickerSection[];
34
+ groupLabel?: string;
35
+ }
36
+ export type MenuSection = MenuItemsSection | MenuGradientPickerSection | MenuSwatchPickerSection;
27
37
  export declare function isMenuGradientPickerSection(section: MenuSection): section is MenuGradientPickerSection;
38
+ export declare function isMenuSwatchPickerSection(section: MenuSection): section is MenuSwatchPickerSection;
39
+ export declare function isMenuPickerSection(section: MenuSection): section is MenuGradientPickerSection | MenuSwatchPickerSection;
28
40
  export type { ShellGradientPreset };
41
+ export type { SwatchPickerOption, SwatchPickerSection };
29
42
  //# sourceMappingURL=menu-types.d.ts.map
@@ -1,15 +1,12 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
2
  import { type ShellGradientPreset } from '../ShellGradientSwatch/shell-gradient-swatch-types';
3
+ /** @deprecated Use `ds-swatch-picker` with shell preset options. */
3
4
  export declare class ShellGradientPicker {
4
5
  /** Active shell wash preset. */
5
6
  value: ShellGradientPreset;
6
7
  groupLabel: string;
7
8
  dsChange: EventEmitter<ShellGradientPreset>;
8
- el: HTMLElement;
9
- private handleSwatchSelect;
10
- private focusSwatch;
11
- private handleSwatchKeyDown;
12
- private renderSwatch;
9
+ private handleChange;
13
10
  render(): any;
14
11
  }
15
12
  //# sourceMappingURL=ShellGradientPicker.d.ts.map
@@ -1,5 +1,6 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
2
  import { type ShellGradientPreset } from './shell-gradient-swatch-types';
3
+ /** @deprecated Use `ds-swatch-picker`; individual swatches are implementation detail. */
3
4
  export declare class ShellGradientSwatch {
4
5
  /** Wash preset this orb previews. */
5
6
  preset: ShellGradientPreset;
@@ -0,0 +1,21 @@
1
+ import { EventEmitter } from '../../stencil-public-runtime';
2
+ import { type SwatchPickerOption, type SwatchPickerSection } from './swatch-picker-types';
3
+ export declare class SwatchPicker {
4
+ el: HTMLElement;
5
+ /** Selected option value. */
6
+ value: string;
7
+ /** Flat option list. Sections take precedence when supplied. Assign as a JavaScript property. */
8
+ options: SwatchPickerOption[];
9
+ /** Visually separated option groups that remain one radio group. Assign as a JavaScript property. */
10
+ sections: SwatchPickerSection[];
11
+ /** Accessible name for the complete one-of-many choice. */
12
+ groupLabel: string;
13
+ dsChange: EventEmitter<string>;
14
+ private get activeOptions();
15
+ private selectOption;
16
+ private focusOption;
17
+ private handleOptionKeyDown;
18
+ private renderOption;
19
+ render(): any;
20
+ }
21
+ //# sourceMappingURL=SwatchPicker.d.ts.map
@@ -0,0 +1,26 @@
1
+ export interface SwatchPickerPreview {
2
+ /** CSS color used as the swatch base or as a complete flat-color preview. */
3
+ backgroundColor?: string;
4
+ /** CSS gradient used as the swatch image. */
5
+ backgroundImage?: string;
6
+ /** Optional preview-layer opacity, clamped to the inclusive 0–1 range. */
7
+ opacity?: number;
8
+ }
9
+ export interface SwatchPickerOption {
10
+ /** Stable value emitted when this option is selected. */
11
+ value: string;
12
+ /** Accessible option name; the visual preview never replaces this label. */
13
+ label: string;
14
+ preview: SwatchPickerPreview;
15
+ isInactive?: boolean;
16
+ }
17
+ export interface SwatchPickerSection {
18
+ /** Sections remain one radio group and are separated visually. */
19
+ options: SwatchPickerOption[];
20
+ }
21
+ export type SwatchPickerNavigationKey = 'ArrowDown' | 'ArrowLeft' | 'ArrowRight' | 'ArrowUp' | 'Home' | 'End';
22
+ export declare function flattenSwatchPickerOptions(options: readonly SwatchPickerOption[], sections: readonly SwatchPickerSection[]): SwatchPickerOption[];
23
+ export declare function resolveSwatchPickerTabIndex(options: readonly SwatchPickerOption[], value: string): number;
24
+ export declare function resolveSwatchPickerNavigationIndex(options: readonly SwatchPickerOption[], currentIndex: number, key: SwatchPickerNavigationKey): number | null;
25
+ export declare function normalizeSwatchPickerOpacity(opacity: number | undefined): number;
26
+ //# sourceMappingURL=swatch-picker-types.d.ts.map