@adobe/spectrum-wc-core 0.0.0-snapshot.20260922095923

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 (335) hide show
  1. package/README.md +39 -0
  2. package/dist/_virtual/_@oxc-project_runtime@0.124.0/helpers/decorate.js +9 -0
  3. package/dist/components/accordion/Accordion.base.d.ts +59 -0
  4. package/dist/components/accordion/Accordion.base.js +69 -0
  5. package/dist/components/accordion/Accordion.base.js.map +1 -0
  6. package/dist/components/accordion/Accordion.types.d.ts +22 -0
  7. package/dist/components/accordion/Accordion.types.js +21 -0
  8. package/dist/components/accordion/Accordion.types.js.map +1 -0
  9. package/dist/components/accordion/AccordionItem.base.d.ts +96 -0
  10. package/dist/components/accordion/AccordionItem.base.js +93 -0
  11. package/dist/components/accordion/AccordionItem.base.js.map +1 -0
  12. package/dist/components/accordion/index.d.ts +14 -0
  13. package/dist/components/accordion/index.js +4 -0
  14. package/dist/components/action-button/ActionButton.types.d.ts +15 -0
  15. package/dist/components/action-button/ActionButton.types.js +12 -0
  16. package/dist/components/action-button/ActionButton.types.js.map +1 -0
  17. package/dist/components/action-button/index.d.ts +12 -0
  18. package/dist/components/action-button/index.js +2 -0
  19. package/dist/components/action-group/ActionGroup.base.d.ts +108 -0
  20. package/dist/components/action-group/ActionGroup.base.js +53 -0
  21. package/dist/components/action-group/ActionGroup.base.js.map +1 -0
  22. package/dist/components/action-group/ActionGroup.types.d.ts +17 -0
  23. package/dist/components/action-group/ActionGroup.types.js +12 -0
  24. package/dist/components/action-group/ActionGroup.types.js.map +1 -0
  25. package/dist/components/action-group/index.d.ts +13 -0
  26. package/dist/components/action-group/index.js +3 -0
  27. package/dist/components/alert-banner/AlertBanner.base.d.ts +36 -0
  28. package/dist/components/alert-banner/AlertBanner.base.js +57 -0
  29. package/dist/components/alert-banner/AlertBanner.base.js.map +1 -0
  30. package/dist/components/alert-banner/AlertBanner.types.d.ts +13 -0
  31. package/dist/components/alert-banner/AlertBanner.types.js +10 -0
  32. package/dist/components/alert-banner/AlertBanner.types.js.map +1 -0
  33. package/dist/components/alert-banner/index.d.ts +13 -0
  34. package/dist/components/alert-banner/index.js +3 -0
  35. package/dist/components/asset/Asset.base.d.ts +101 -0
  36. package/dist/components/asset/Asset.base.js +130 -0
  37. package/dist/components/asset/Asset.base.js.map +1 -0
  38. package/dist/components/asset/Asset.types.d.ts +31 -0
  39. package/dist/components/asset/Asset.types.js +14 -0
  40. package/dist/components/asset/Asset.types.js.map +1 -0
  41. package/dist/components/asset/index.d.ts +13 -0
  42. package/dist/components/asset/index.js +3 -0
  43. package/dist/components/avatar/Avatar.base.d.ts +53 -0
  44. package/dist/components/avatar/Avatar.base.js +52 -0
  45. package/dist/components/avatar/Avatar.base.js.map +1 -0
  46. package/dist/components/avatar/Avatar.types.d.ts +19 -0
  47. package/dist/components/avatar/Avatar.types.js +24 -0
  48. package/dist/components/avatar/Avatar.types.js.map +1 -0
  49. package/dist/components/avatar/index.d.ts +13 -0
  50. package/dist/components/avatar/index.js +3 -0
  51. package/dist/components/badge/Badge.base.d.ts +114 -0
  52. package/dist/components/badge/Badge.base.js +49 -0
  53. package/dist/components/badge/Badge.base.js.map +1 -0
  54. package/dist/components/badge/Badge.types.d.ts +21 -0
  55. package/dist/components/badge/Badge.types.js +43 -0
  56. package/dist/components/badge/Badge.types.js.map +1 -0
  57. package/dist/components/badge/index.d.ts +13 -0
  58. package/dist/components/badge/index.js +3 -0
  59. package/dist/components/button/Button.base.d.ts +78 -0
  60. package/dist/components/button/Button.base.js +51 -0
  61. package/dist/components/button/Button.base.js.map +1 -0
  62. package/dist/components/button/Button.types.d.ts +19 -0
  63. package/dist/components/button/Button.types.js +16 -0
  64. package/dist/components/button/Button.types.js.map +1 -0
  65. package/dist/components/button/index.d.ts +13 -0
  66. package/dist/components/button/index.js +3 -0
  67. package/dist/components/button-group/ButtonGroup.base.d.ts +89 -0
  68. package/dist/components/button-group/ButtonGroup.base.js +60 -0
  69. package/dist/components/button-group/ButtonGroup.base.js.map +1 -0
  70. package/dist/components/button-group/ButtonGroup.types.d.ts +17 -0
  71. package/dist/components/button-group/ButtonGroup.types.js +15 -0
  72. package/dist/components/button-group/ButtonGroup.types.js.map +1 -0
  73. package/dist/components/button-group/index.d.ts +13 -0
  74. package/dist/components/button-group/index.js +3 -0
  75. package/dist/components/card/Card.base.d.ts +172 -0
  76. package/dist/components/card/Card.base.js +123 -0
  77. package/dist/components/card/Card.base.js.map +1 -0
  78. package/dist/components/card/Card.types.d.ts +18 -0
  79. package/dist/components/card/Card.types.js +21 -0
  80. package/dist/components/card/Card.types.js.map +1 -0
  81. package/dist/components/card/index.d.ts +13 -0
  82. package/dist/components/card/index.js +3 -0
  83. package/dist/components/color-handle/ColorHandle.base.d.ts +51 -0
  84. package/dist/components/color-handle/ColorHandle.base.js +39 -0
  85. package/dist/components/color-handle/ColorHandle.base.js.map +1 -0
  86. package/dist/components/color-handle/ColorHandle.types.d.ts +30 -0
  87. package/dist/components/color-handle/color-contrast.d.ts +55 -0
  88. package/dist/components/color-handle/color-contrast.js +49 -0
  89. package/dist/components/color-handle/color-contrast.js.map +1 -0
  90. package/dist/components/color-handle/index.d.ts +14 -0
  91. package/dist/components/color-handle/index.js +3 -0
  92. package/dist/components/color-loupe/ColorLoupe.base.d.ts +41 -0
  93. package/dist/components/color-loupe/ColorLoupe.base.js +21 -0
  94. package/dist/components/color-loupe/ColorLoupe.base.js.map +1 -0
  95. package/dist/components/color-loupe/index.d.ts +12 -0
  96. package/dist/components/color-loupe/index.js +2 -0
  97. package/dist/components/divider/Divider.base.d.ts +43 -0
  98. package/dist/components/divider/Divider.base.js +42 -0
  99. package/dist/components/divider/Divider.base.js.map +1 -0
  100. package/dist/components/divider/Divider.types.d.ts +15 -0
  101. package/dist/components/divider/Divider.types.js +10 -0
  102. package/dist/components/divider/Divider.types.js.map +1 -0
  103. package/dist/components/divider/index.d.ts +13 -0
  104. package/dist/components/divider/index.js +3 -0
  105. package/dist/components/dropzone/Dropzone.base.d.ts +74 -0
  106. package/dist/components/dropzone/Dropzone.base.js +82 -0
  107. package/dist/components/dropzone/Dropzone.base.js.map +1 -0
  108. package/dist/components/dropzone/Dropzone.types.d.ts +43 -0
  109. package/dist/components/dropzone/Dropzone.types.js +15 -0
  110. package/dist/components/dropzone/Dropzone.types.js.map +1 -0
  111. package/dist/components/dropzone/index.d.ts +13 -0
  112. package/dist/components/dropzone/index.js +3 -0
  113. package/dist/components/icon/Icon.base.d.ts +36 -0
  114. package/dist/components/icon/Icon.base.js +28 -0
  115. package/dist/components/icon/Icon.base.js.map +1 -0
  116. package/dist/components/icon/Icon.types.d.ts +13 -0
  117. package/dist/components/icon/Icon.types.js +12 -0
  118. package/dist/components/icon/Icon.types.js.map +1 -0
  119. package/dist/components/icon/index.d.ts +13 -0
  120. package/dist/components/icon/index.js +3 -0
  121. package/dist/components/illustrated-message/IllustratedMessage.base.d.ts +60 -0
  122. package/dist/components/illustrated-message/IllustratedMessage.base.js +59 -0
  123. package/dist/components/illustrated-message/IllustratedMessage.base.js.map +1 -0
  124. package/dist/components/illustrated-message/IllustratedMessage.types.d.ts +15 -0
  125. package/dist/components/illustrated-message/IllustratedMessage.types.js +10 -0
  126. package/dist/components/illustrated-message/IllustratedMessage.types.js.map +1 -0
  127. package/dist/components/illustrated-message/index.d.ts +13 -0
  128. package/dist/components/illustrated-message/index.js +3 -0
  129. package/dist/components/infield-button/InfieldButton.base.d.ts +28 -0
  130. package/dist/components/infield-button/InfieldButton.base.js +22 -0
  131. package/dist/components/infield-button/InfieldButton.base.js.map +1 -0
  132. package/dist/components/infield-button/InfieldButton.types.d.ts +13 -0
  133. package/dist/components/infield-button/InfieldButton.types.js +11 -0
  134. package/dist/components/infield-button/InfieldButton.types.js.map +1 -0
  135. package/dist/components/infield-button/index.d.ts +13 -0
  136. package/dist/components/infield-button/index.js +3 -0
  137. package/dist/components/meter/Meter.base.d.ts +40 -0
  138. package/dist/components/meter/Meter.base.js +32 -0
  139. package/dist/components/meter/Meter.base.js.map +1 -0
  140. package/dist/components/meter/Meter.types.d.ts +13 -0
  141. package/dist/components/meter/Meter.types.js +11 -0
  142. package/dist/components/meter/Meter.types.js.map +1 -0
  143. package/dist/components/meter/index.d.ts +13 -0
  144. package/dist/components/meter/index.js +3 -0
  145. package/dist/components/popover/Popover.base.d.ts +226 -0
  146. package/dist/components/popover/Popover.base.js +287 -0
  147. package/dist/components/popover/Popover.base.js.map +1 -0
  148. package/dist/components/popover/Popover.types.d.ts +39 -0
  149. package/dist/components/popover/Popover.types.js +24 -0
  150. package/dist/components/popover/Popover.types.js.map +1 -0
  151. package/dist/components/popover/index.d.ts +13 -0
  152. package/dist/components/popover/index.js +3 -0
  153. package/dist/components/progress-bar/ProgressBar.base.d.ts +34 -0
  154. package/dist/components/progress-bar/ProgressBar.base.js +21 -0
  155. package/dist/components/progress-bar/ProgressBar.base.js.map +1 -0
  156. package/dist/components/progress-bar/ProgressBar.types.d.ts +12 -0
  157. package/dist/components/progress-bar/index.d.ts +13 -0
  158. package/dist/components/progress-bar/index.js +2 -0
  159. package/dist/components/progress-circle/ProgressCircle.base.d.ts +83 -0
  160. package/dist/components/progress-circle/ProgressCircle.base.js +77 -0
  161. package/dist/components/progress-circle/ProgressCircle.base.js.map +1 -0
  162. package/dist/components/progress-circle/ProgressCircle.types.d.ts +15 -0
  163. package/dist/components/progress-circle/ProgressCircle.types.js +10 -0
  164. package/dist/components/progress-circle/ProgressCircle.types.js.map +1 -0
  165. package/dist/components/progress-circle/index.d.ts +13 -0
  166. package/dist/components/progress-circle/index.js +3 -0
  167. package/dist/components/status-light/StatusLight.base.d.ts +69 -0
  168. package/dist/components/status-light/StatusLight.base.js +32 -0
  169. package/dist/components/status-light/StatusLight.base.js.map +1 -0
  170. package/dist/components/status-light/StatusLight.types.d.ts +19 -0
  171. package/dist/components/status-light/StatusLight.types.js +32 -0
  172. package/dist/components/status-light/StatusLight.types.js.map +1 -0
  173. package/dist/components/status-light/index.d.ts +13 -0
  174. package/dist/components/status-light/index.js +3 -0
  175. package/dist/components/tabs/Tab.base.d.ts +49 -0
  176. package/dist/components/tabs/Tab.base.js +39 -0
  177. package/dist/components/tabs/Tab.base.js.map +1 -0
  178. package/dist/components/tabs/Tab.types.d.ts +17 -0
  179. package/dist/components/tabs/TabPanel.base.d.ts +49 -0
  180. package/dist/components/tabs/TabPanel.base.js +36 -0
  181. package/dist/components/tabs/TabPanel.base.js.map +1 -0
  182. package/dist/components/tabs/TabPanel.types.d.ts +17 -0
  183. package/dist/components/tabs/Tabs.base.d.ts +221 -0
  184. package/dist/components/tabs/Tabs.base.js +213 -0
  185. package/dist/components/tabs/Tabs.base.js.map +1 -0
  186. package/dist/components/tabs/Tabs.types.d.ts +55 -0
  187. package/dist/components/tabs/Tabs.types.js +6 -0
  188. package/dist/components/tabs/Tabs.types.js.map +1 -0
  189. package/dist/components/tabs/index.d.ts +17 -0
  190. package/dist/components/tabs/index.js +5 -0
  191. package/dist/components/tooltip/Tooltip.base.d.ts +159 -0
  192. package/dist/components/tooltip/Tooltip.base.js +198 -0
  193. package/dist/components/tooltip/Tooltip.base.js.map +1 -0
  194. package/dist/components/tooltip/Tooltip.types.d.ts +18 -0
  195. package/dist/components/tooltip/Tooltip.types.js +15 -0
  196. package/dist/components/tooltip/Tooltip.types.js.map +1 -0
  197. package/dist/components/tooltip/index.d.ts +13 -0
  198. package/dist/components/tooltip/index.js +3 -0
  199. package/dist/controllers/color-controller/index.d.ts +12 -0
  200. package/dist/controllers/color-controller/index.js +2 -0
  201. package/dist/controllers/color-controller/src/color-controller.d.ts +226 -0
  202. package/dist/controllers/color-controller/src/color-controller.js +253 -0
  203. package/dist/controllers/color-controller/src/color-controller.js.map +1 -0
  204. package/dist/controllers/drag-and-drop-controller/index.d.ts +12 -0
  205. package/dist/controllers/drag-and-drop-controller/index.js +2 -0
  206. package/dist/controllers/drag-and-drop-controller/src/drag-and-drop-controller.d.ts +68 -0
  207. package/dist/controllers/drag-and-drop-controller/src/drag-and-drop-controller.js +56 -0
  208. package/dist/controllers/drag-and-drop-controller/src/drag-and-drop-controller.js.map +1 -0
  209. package/dist/controllers/focusgroup-navigation-controller/index.d.ts +12 -0
  210. package/dist/controllers/focusgroup-navigation-controller/index.js +2 -0
  211. package/dist/controllers/focusgroup-navigation-controller/src/focusgroup-navigation-controller.d.ts +496 -0
  212. package/dist/controllers/focusgroup-navigation-controller/src/focusgroup-navigation-controller.js +345 -0
  213. package/dist/controllers/focusgroup-navigation-controller/src/focusgroup-navigation-controller.js.map +1 -0
  214. package/dist/controllers/hover-controller/index.d.ts +12 -0
  215. package/dist/controllers/hover-controller/index.js +2 -0
  216. package/dist/controllers/hover-controller/src/hover-controller.d.ts +118 -0
  217. package/dist/controllers/hover-controller/src/hover-controller.js +90 -0
  218. package/dist/controllers/hover-controller/src/hover-controller.js.map +1 -0
  219. package/dist/controllers/index.d.ts +26 -0
  220. package/dist/controllers/index.js +18 -0
  221. package/dist/controllers/language-resolution.d.ts +87 -0
  222. package/dist/controllers/language-resolution.js +56 -0
  223. package/dist/controllers/language-resolution.js.map +1 -0
  224. package/dist/controllers/live-selection-controller/index.d.ts +12 -0
  225. package/dist/controllers/live-selection-controller/index.js +2 -0
  226. package/dist/controllers/live-selection-controller/src/live-selection-controller.d.ts +144 -0
  227. package/dist/controllers/live-selection-controller/src/live-selection-controller.js +36 -0
  228. package/dist/controllers/live-selection-controller/src/live-selection-controller.js.map +1 -0
  229. package/dist/controllers/page-scroll-lock-controller/index.d.ts +12 -0
  230. package/dist/controllers/page-scroll-lock-controller/index.js +2 -0
  231. package/dist/controllers/page-scroll-lock-controller/src/page-scroll-lock.d.ts +20 -0
  232. package/dist/controllers/page-scroll-lock-controller/src/page-scroll-lock.js +30 -0
  233. package/dist/controllers/page-scroll-lock-controller/src/page-scroll-lock.js.map +1 -0
  234. package/dist/controllers/pending-controller/index.d.ts +12 -0
  235. package/dist/controllers/pending-controller/index.js +2 -0
  236. package/dist/controllers/pending-controller/src/pending-controller.d.ts +95 -0
  237. package/dist/controllers/pending-controller/src/pending-controller.js +55 -0
  238. package/dist/controllers/pending-controller/src/pending-controller.js.map +1 -0
  239. package/dist/controllers/placement-controller/index.d.ts +12 -0
  240. package/dist/controllers/placement-controller/index.js +4 -0
  241. package/dist/controllers/placement-controller/src/fallback-placements.d.ts +9 -0
  242. package/dist/controllers/placement-controller/src/fallback-placements.js +71 -0
  243. package/dist/controllers/placement-controller/src/fallback-placements.js.map +1 -0
  244. package/dist/controllers/placement-controller/src/placement-controller.d.ts +152 -0
  245. package/dist/controllers/placement-controller/src/placement-controller.js +129 -0
  246. package/dist/controllers/placement-controller/src/placement-controller.js.map +1 -0
  247. package/dist/controllers/placement-controller/src/placement-conversion.d.ts +35 -0
  248. package/dist/controllers/placement-controller/src/placement-conversion.js +54 -0
  249. package/dist/controllers/placement-controller/src/placement-conversion.js.map +1 -0
  250. package/dist/controllers/placement-controller/src/types.d.ts +128 -0
  251. package/dist/controllers/placement-controller/src/types.js +29 -0
  252. package/dist/controllers/placement-controller/src/types.js.map +1 -0
  253. package/dist/controllers/slot-attribute-propagation-controller/index.d.ts +12 -0
  254. package/dist/controllers/slot-attribute-propagation-controller/index.js +2 -0
  255. package/dist/controllers/slot-attribute-propagation-controller/src/slot-attribute-propagation-controller.d.ts +65 -0
  256. package/dist/controllers/slot-attribute-propagation-controller/src/slot-attribute-propagation-controller.js +33 -0
  257. package/dist/controllers/slot-attribute-propagation-controller/src/slot-attribute-propagation-controller.js.map +1 -0
  258. package/dist/controllers/slot-presence-controller/index.d.ts +12 -0
  259. package/dist/controllers/slot-presence-controller/index.js +2 -0
  260. package/dist/controllers/slot-presence-controller/src/slot-presence-controller.d.ts +57 -0
  261. package/dist/controllers/slot-presence-controller/src/slot-presence-controller.js +44 -0
  262. package/dist/controllers/slot-presence-controller/src/slot-presence-controller.js.map +1 -0
  263. package/dist/controllers/slot-text-controller/index.d.ts +12 -0
  264. package/dist/controllers/slot-text-controller/index.js +2 -0
  265. package/dist/controllers/slot-text-controller/src/slot-text-controller.d.ts +92 -0
  266. package/dist/controllers/slot-text-controller/src/slot-text-controller.js +53 -0
  267. package/dist/controllers/slot-text-controller/src/slot-text-controller.js.map +1 -0
  268. package/dist/directives/index.d.ts +15 -0
  269. package/dist/directives/index.js +3 -0
  270. package/dist/directives/pending-spinner/index.d.ts +12 -0
  271. package/dist/directives/pending-spinner/index.js +1 -0
  272. package/dist/directives/pending-spinner/src/pending-spinner.d.ts +22 -0
  273. package/dist/directives/pending-spinner/src/pending-spinner.js +39 -0
  274. package/dist/directives/pending-spinner/src/pending-spinner.js.map +1 -0
  275. package/dist/element/define-element.d.ts +16 -0
  276. package/dist/element/define-element.js +8 -0
  277. package/dist/element/define-element.js.map +1 -0
  278. package/dist/element/index.d.ts +14 -0
  279. package/dist/element/index.js +4 -0
  280. package/dist/element/spectrum-element.d.ts +69 -0
  281. package/dist/element/spectrum-element.js +85 -0
  282. package/dist/element/spectrum-element.js.map +1 -0
  283. package/dist/element/version.d.ts +19 -0
  284. package/dist/element/version.js +6 -0
  285. package/dist/element/version.js.map +1 -0
  286. package/dist/mixins/disabled-mixin.d.ts +30 -0
  287. package/dist/mixins/disabled-mixin.js +27 -0
  288. package/dist/mixins/disabled-mixin.js.map +1 -0
  289. package/dist/mixins/index.d.ts +16 -0
  290. package/dist/mixins/index.js +5 -0
  291. package/dist/mixins/linear-progress-mixin.d.ts +41 -0
  292. package/dist/mixins/linear-progress-mixin.js +115 -0
  293. package/dist/mixins/linear-progress-mixin.js.map +1 -0
  294. package/dist/mixins/pending-mixin.d.ts +45 -0
  295. package/dist/mixins/pending-mixin.js +50 -0
  296. package/dist/mixins/pending-mixin.js.map +1 -0
  297. package/dist/mixins/sized-mixin.d.ts +49 -0
  298. package/dist/mixins/sized-mixin.js +42 -0
  299. package/dist/mixins/sized-mixin.js.map +1 -0
  300. package/dist/utils/actual-placement.d.ts +10 -0
  301. package/dist/utils/actual-placement.js +8 -0
  302. package/dist/utils/actual-placement.js.map +1 -0
  303. package/dist/utils/capitalize.d.ts +26 -0
  304. package/dist/utils/capitalize.js +8 -0
  305. package/dist/utils/capitalize.js.map +1 -0
  306. package/dist/utils/deep-contains.d.ts +26 -0
  307. package/dist/utils/deep-contains.js +14 -0
  308. package/dist/utils/deep-contains.js.map +1 -0
  309. package/dist/utils/dev-validation.d.ts +88 -0
  310. package/dist/utils/dev-validation.js +33 -0
  311. package/dist/utils/dev-validation.js.map +1 -0
  312. package/dist/utils/dismissible-stack.d.ts +26 -0
  313. package/dist/utils/dismissible-stack.js +16 -0
  314. package/dist/utils/dismissible-stack.js.map +1 -0
  315. package/dist/utils/focusable-selectors.d.ts +43 -0
  316. package/dist/utils/focusable-selectors.js +18 -0
  317. package/dist/utils/focusable-selectors.js.map +1 -0
  318. package/dist/utils/get-active-element.d.ts +31 -0
  319. package/dist/utils/get-active-element.js +11 -0
  320. package/dist/utils/get-active-element.js.map +1 -0
  321. package/dist/utils/get-label-from-slot.d.ts +12 -0
  322. package/dist/utils/get-label-from-slot.js +10 -0
  323. package/dist/utils/get-label-from-slot.js.map +1 -0
  324. package/dist/utils/index.d.ts +22 -0
  325. package/dist/utils/index.js +12 -0
  326. package/dist/utils/is-focus-visible-in-tree.d.ts +33 -0
  327. package/dist/utils/is-focus-visible-in-tree.js +11 -0
  328. package/dist/utils/is-focus-visible-in-tree.js.map +1 -0
  329. package/dist/utils/resolve-trigger.d.ts +42 -0
  330. package/dist/utils/resolve-trigger.js +23 -0
  331. package/dist/utils/resolve-trigger.js.map +1 -0
  332. package/dist/utils/transition.d.ts +53 -0
  333. package/dist/utils/transition.js +26 -0
  334. package/dist/utils/transition.js.map +1 -0
  335. package/package.json +644 -0
@@ -0,0 +1,35 @@
1
+ import { Placement as FloatingPlacement } from '@floating-ui/dom';
2
+ import { Placement } from './types.js';
3
+ /** Writing direction used to resolve logical sides to physical sides. */
4
+ export type Direction = 'ltr' | 'rtl';
5
+ /**
6
+ * Normalize a hyphenated `Placement` for Floating UI's `computePosition`.
7
+ *
8
+ * - Logical **sides** (`start`, `end`) resolve to `left` / `right` per the
9
+ * `direction` argument (`start` is left in LTR, right in RTL). Floating UI
10
+ * has no logical primary side, so this must be resolved here for the panel
11
+ * to land on the correct side.
12
+ * - Logical **alignments** (`bottom-start`, `top-end`) pass through unchanged —
13
+ * Floating UI's own RTL handling flips those, so they must not be flipped here.
14
+ * - Physical alignments (`bottom-left`, `left-top`, `start-top`, etc.) map to
15
+ * the nearest Floating UI placement.
16
+ *
17
+ * @param placement - Customer-facing hyphenated placement.
18
+ * @param direction - Writing direction of the trigger; defaults to `'ltr'`.
19
+ * @returns Placement value understood by Floating UI.
20
+ */
21
+ export declare function toFloatingPlacement(placement: Placement, direction?: Direction): FloatingPlacement;
22
+ /**
23
+ * Surface a Floating UI placement as the public hyphenated `Placement`
24
+ * form for `actualPlacement` and `onPlacementChange`.
25
+ *
26
+ * Floating UI emits four placements that don't appear in the SWC `Placement`
27
+ * union (`left-start`, `left-end`, `right-start`, `right-end`) — those map
28
+ * back to their physical equivalents (`left-top`, `left-bottom`, `right-top`,
29
+ * `right-bottom`). The remaining eight Floating UI placements are already
30
+ * valid SWC `Placement` values.
31
+ *
32
+ * @param placement - Placement returned by Floating UI after `flip`.
33
+ * @returns Customer-facing hyphenated placement in the SWC `Placement` union.
34
+ */
35
+ export declare function fromFloatingPlacement(placement: FloatingPlacement): Placement;
@@ -0,0 +1,54 @@
1
+ //#region controllers/placement-controller/src/placement-conversion.ts
2
+ var e = new Set(["start", "end"]), t = {
3
+ ltr: {
4
+ start: "left",
5
+ end: "right"
6
+ },
7
+ rtl: {
8
+ start: "right",
9
+ end: "left"
10
+ }
11
+ }, n = {
12
+ start: "left",
13
+ end: "right"
14
+ }, r = {
15
+ bottom: {
16
+ left: "bottom-start",
17
+ right: "bottom-end"
18
+ },
19
+ top: {
20
+ left: "top-start",
21
+ right: "top-end"
22
+ },
23
+ left: {
24
+ top: "left-start",
25
+ bottom: "left-end"
26
+ },
27
+ right: {
28
+ top: "right-start",
29
+ bottom: "right-end"
30
+ }
31
+ }, i = {
32
+ "left-start": "left-top",
33
+ "left-end": "left-bottom",
34
+ "right-start": "right-top",
35
+ "right-end": "right-bottom"
36
+ };
37
+ function a(i, a = "ltr") {
38
+ var o;
39
+ let [s, c] = i.split("-");
40
+ if (e.has(s)) {
41
+ var l, u, d;
42
+ let e = (l = t[a][s]) == null ? s : l;
43
+ return c ? ((u = r[e]) == null ? void 0 : u[c]) || `${e}-${(d = n[c]) == null ? c : d}` : e;
44
+ }
45
+ return c ? c === "start" || c === "end" ? `${s}-${c}` : ((o = r[s]) == null ? void 0 : o[c]) || `${s}-${c}` : s;
46
+ }
47
+ function o(e) {
48
+ var t;
49
+ return (t = i[e]) == null ? e : t;
50
+ }
51
+ //#endregion
52
+ export { o as fromFloatingPlacement, a as toFloatingPlacement };
53
+
54
+ //# sourceMappingURL=placement-conversion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"placement-conversion.js","names":[],"sources":["../../../../controllers/placement-controller/src/placement-conversion.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type { Placement as FloatingPlacement } from '@floating-ui/dom';\n\nimport type { Placement } from './types.js';\n\n/** Writing direction used to resolve logical sides to physical sides. */\nexport type Direction = 'ltr' | 'rtl';\n\nconst LOGICAL_SIDES = new Set(['start', 'end']);\n\n/**\n * Logical inline **sides** resolve to physical sides per the writing direction:\n * `start` is the left in LTR and the right in RTL (and vice versa for `end`).\n * Floating UI has no logical primary side, so this resolution must happen here\n * — the physical side it receives is what determines which side it positions on.\n */\nconst LOGICAL_SIDE_TO_PHYSICAL: Record<Direction, Record<string, string>> = {\n ltr: { start: 'left', end: 'right' },\n rtl: { start: 'right', end: 'left' },\n};\n\n/**\n * Logical **alignment** fallback for a logical side paired with a logical\n * alignment. Cross-axis alignment for left/right sides is vertical, so it is\n * direction-independent; this is only a guard for inputs outside the standard\n * placement set.\n */\nconst LOGICAL_TO_PHYSICAL: Record<string, string> = {\n start: 'left',\n end: 'right',\n};\n\n/**\n * Physical cross-axis labels mapped to Floating UI's start/end alignment on\n * each primary side. Floating UI only supports `start` / `end` alignment\n * suffixes; SWC exposes physical (`top`/`bottom`/`left`/`right`) cross-axis\n * names that this table translates.\n */\nconst PHYSICAL_ALIGNMENT_TO_FLOATING: Record<\n string,\n Record<string, FloatingPlacement>\n> = {\n bottom: { left: 'bottom-start', right: 'bottom-end' },\n top: { left: 'top-start', right: 'top-end' },\n left: { top: 'left-start', bottom: 'left-end' },\n right: { top: 'right-start', bottom: 'right-end' },\n};\n\n/**\n * Reverse lookup for Floating UI placements that aren't valid SWC Placement\n * values. Used by `fromFloatingPlacement` to map the four Floating UI\n * outputs that have no direct SWC equivalent (`left-start`, `left-end`,\n * `right-start`, `right-end`) back into the SWC union. Other Floating UI\n * placements are already valid Placement values and pass through unchanged.\n */\nconst FLOATING_TO_SWC_PLACEMENT: Partial<Record<FloatingPlacement, Placement>> =\n {\n 'left-start': 'left-top',\n 'left-end': 'left-bottom',\n 'right-start': 'right-top',\n 'right-end': 'right-bottom',\n };\n\n/**\n * Normalize a hyphenated `Placement` for Floating UI's `computePosition`.\n *\n * - Logical **sides** (`start`, `end`) resolve to `left` / `right` per the\n * `direction` argument (`start` is left in LTR, right in RTL). Floating UI\n * has no logical primary side, so this must be resolved here for the panel\n * to land on the correct side.\n * - Logical **alignments** (`bottom-start`, `top-end`) pass through unchanged —\n * Floating UI's own RTL handling flips those, so they must not be flipped here.\n * - Physical alignments (`bottom-left`, `left-top`, `start-top`, etc.) map to\n * the nearest Floating UI placement.\n *\n * @param placement - Customer-facing hyphenated placement.\n * @param direction - Writing direction of the trigger; defaults to `'ltr'`.\n * @returns Placement value understood by Floating UI.\n */\nexport function toFloatingPlacement(\n placement: Placement,\n direction: Direction = 'ltr'\n): FloatingPlacement {\n const [primary, alignment] = placement.split('-') as [string, string?];\n\n if (LOGICAL_SIDES.has(primary)) {\n const physicalPrimary =\n LOGICAL_SIDE_TO_PHYSICAL[direction][primary] ?? primary;\n if (!alignment) {\n return physicalPrimary as FloatingPlacement;\n }\n // For logical sides combined with a physical sub-alignment\n // (e.g. `start-top`, `end-bottom`), use the physical-alignment table on\n // the resolved physical side. Without this, the function returns\n // strings like `left-top` that aren't valid Floating UI placements.\n const mapped = PHYSICAL_ALIGNMENT_TO_FLOATING[physicalPrimary]?.[alignment];\n if (mapped) {\n return mapped;\n }\n const physicalAlignment = LOGICAL_TO_PHYSICAL[alignment] ?? alignment;\n return `${physicalPrimary}-${physicalAlignment}` as FloatingPlacement;\n }\n\n if (!alignment) {\n return primary as FloatingPlacement;\n }\n\n if (alignment === 'start' || alignment === 'end') {\n return `${primary}-${alignment}` as FloatingPlacement;\n }\n\n const mapped = PHYSICAL_ALIGNMENT_TO_FLOATING[primary]?.[alignment];\n if (mapped) {\n return mapped;\n }\n\n return `${primary}-${alignment}` as FloatingPlacement;\n}\n\n/**\n * Surface a Floating UI placement as the public hyphenated `Placement`\n * form for `actualPlacement` and `onPlacementChange`.\n *\n * Floating UI emits four placements that don't appear in the SWC `Placement`\n * union (`left-start`, `left-end`, `right-start`, `right-end`) — those map\n * back to their physical equivalents (`left-top`, `left-bottom`, `right-top`,\n * `right-bottom`). The remaining eight Floating UI placements are already\n * valid SWC `Placement` values.\n *\n * @param placement - Placement returned by Floating UI after `flip`.\n * @returns Customer-facing hyphenated placement in the SWC `Placement` union.\n */\nexport function fromFloatingPlacement(placement: FloatingPlacement): Placement {\n return FLOATING_TO_SWC_PLACEMENT[placement] ?? (placement as Placement);\n}\n"],"mappings":";AAmBA,IAAM,IAAgB,IAAI,IAAI,CAAC,SAAS,MAAM,CAAC,EAQzC,IAAsE;CAC1E,KAAK;EAAE,OAAO;EAAQ,KAAK;EAAS;CACpC,KAAK;EAAE,OAAO;EAAS,KAAK;EAAQ;CACrC,EAQK,IAA8C;CAClD,OAAO;CACP,KAAK;CACN,EAQK,IAGF;CACF,QAAQ;EAAE,MAAM;EAAgB,OAAO;EAAc;CACrD,KAAK;EAAE,MAAM;EAAa,OAAO;EAAW;CAC5C,MAAM;EAAE,KAAK;EAAc,QAAQ;EAAY;CAC/C,OAAO;EAAE,KAAK;EAAe,QAAQ;EAAa;CACnD,EASK,IACJ;CACE,cAAc;CACd,YAAY;CACZ,eAAe;CACf,aAAa;CACd;AAkBH,SAAgB,EACd,GACA,IAAuB,OACJ;;CACnB,IAAM,CAAC,GAAS,KAAa,EAAU,MAAM,IAAI;AAEjD,KAAI,EAAc,IAAI,EAAQ,EAAE;;EAC9B,IAAM,KAAA,IACJ,EAAyB,GAAW,OAAA,OAAY,IAAZ;AAatC,SAZK,MAOC,IAAS,EAA+B,OAAA,OAAA,KAAA,IAAA,EAAmB,OAK1D,GAAG,EAAgB,IAAA,IADA,EAAoB,OAAA,OAAc,IAAd,MAVrC;;AA2BX,QAbK,IAID,MAAc,WAAW,MAAc,QAClC,GAAG,EAAQ,GAAG,QAGjB,IAAS,EAA+B,OAAA,OAAA,KAAA,IAAA,EAAW,OAKlD,GAAG,EAAQ,GAAG,MAZZ;;AA4BX,SAAgB,EAAsB,GAAyC;;AAC7E,SAAA,IAAO,EAA0B,OAAA,OAAe,IAAf"}
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Copyright 2026 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ /**
13
+ * The full set of hyphenated placement values accepted by the public API
14
+ * (`'bottom'`, `'bottom-start'`, `'start-top'`, etc.).
15
+ *
16
+ * Physical-alignment variants (`top-left`, `bottom-right`) are distinct from
17
+ * logical-alignment variants (`top-start`, `bottom-end`) — physical stays fixed
18
+ * regardless of direction; logical reverses in RTL via CSS.
19
+ */
20
+ export declare const ALL_PLACEMENTS: readonly ["bottom", "bottom-left", "bottom-right", "bottom-start", "bottom-end", "top", "top-left", "top-right", "top-start", "top-end", "left", "left-top", "left-bottom", "start", "start-top", "start-bottom", "right", "right-top", "right-bottom", "end", "end-top", "end-bottom"];
21
+ /**
22
+ * The placement of the element with respect to its anchor element
23
+ * (hyphenated form).
24
+ */
25
+ export type Placement = (typeof ALL_PLACEMENTS)[number];
26
+ /**
27
+ * A virtual trigger reference accepted by `PlacementController`. Mirrors
28
+ * the Floating UI virtual-element shape: anything that can report its bounding
29
+ * rect and (optionally) its context element is a valid anchor.
30
+ */
31
+ export interface VirtualTrigger {
32
+ getBoundingClientRect(): DOMRect;
33
+ contextElement?: Element;
34
+ }
35
+ /**
36
+ * Options passed to `PlacementController.start`.
37
+ */
38
+ export interface PlacementOptions {
39
+ /**
40
+ * Preferred side and alignment of the floating element relative to the
41
+ * **trigger** (hyphenated, for example `'bottom'`, `'bottom-start'`).
42
+ *
43
+ * This is the requested placement. When `shouldFlip` is enabled,
44
+ * Floating UI may compute a different side if the requested one does not fit.
45
+ * The result is surfaced on `PlacementController.actualPlacement` and
46
+ * via `onPlacementChange`.
47
+ *
48
+ * @default 'bottom'
49
+ */
50
+ placement?: Placement;
51
+ /**
52
+ * Gap along the **placement direction** between the trigger and the floating
53
+ * element, in pixels (Floating UI `offset` main axis).
54
+ *
55
+ * For `'bottom'`, this is the space below the trigger. This is **not**
56
+ * viewport padding — see `containerPadding` for inset from the overflow
57
+ * boundary.
58
+ *
59
+ * Defaults to `0` so the controller-host contract stays neutral; each
60
+ * consuming component sets its own pattern-specific default.
61
+ *
62
+ * @default 0
63
+ */
64
+ offset?: number;
65
+ /**
66
+ * Slide along the **trigger edge**, perpendicular to the placement
67
+ * direction, in pixels (Floating UI `offset` cross axis).
68
+ *
69
+ * Adjusts alignment such as `'bottom-start'` vs `'bottom-end'` without
70
+ * changing viewport inset. This is **not** `containerPadding`.
71
+ *
72
+ * @default 0
73
+ */
74
+ crossOffset?: number;
75
+ /**
76
+ * Minimum inset from the **overflow boundary**, in pixels, used for
77
+ * collision detection.
78
+ *
79
+ * Floating UI applies this as padding around the boundary it uses for
80
+ * collision detection. By default that is the floating element's clipping
81
+ * ancestors, capped by the visual viewport — so fixed or top-layer popovers
82
+ * usually behave like screen-edge inset, while surfaces inside a scrollable
83
+ * clipping parent use that container's edges instead.
84
+ *
85
+ * This is **not** the gap from the trigger — use `offset` and
86
+ * `crossOffset` for trigger-relative spacing.
87
+ *
88
+ * @default 8
89
+ */
90
+ containerPadding?: number;
91
+ /**
92
+ * Whether Floating UI may **flip** the floating element to the opposite side when the
93
+ * requested `placement` does not fit within the overflow boundary.
94
+ *
95
+ * When `false`, the floating element stays on the requested side even if it
96
+ * overflows — useful for tooltips that must not jump above the trigger.
97
+ *
98
+ * @default true
99
+ */
100
+ shouldFlip?: boolean;
101
+ /**
102
+ * Optional tip element ("arrow") that should point at the trigger from
103
+ * the floating element's edge. When provided, the controller installs
104
+ * Floating UI's `arrow` middleware and writes an inline `translate` on
105
+ * this element after every compute so it stays aligned with the trigger
106
+ * even when `shift` slides the floating panel sideways. CSS positions
107
+ * the tip relative to the floating element's edge (typically with a
108
+ * negative offset for the half-size of the arrow); the controller only
109
+ * moves it along that edge.
110
+ */
111
+ tipElement?: HTMLElement;
112
+ /**
113
+ * Minimum inset of the tip element from the floating element's
114
+ * corners, in pixels. Passed straight to the `arrow` middleware as
115
+ * its `padding`. Only meaningful when `tipElement` is provided.
116
+ *
117
+ * @default 8
118
+ */
119
+ tipPadding?: number;
120
+ /**
121
+ * Called with the computed hyphenated placement, on change only: once after
122
+ * the first compute, then again whenever an `autoUpdate` tick produces a
123
+ * different value. Computes that resolve to the same placement do not
124
+ * re-notify, so wiring this to reactive state will not re-render on every
125
+ * scroll or resize.
126
+ */
127
+ onPlacementChange?: (placement: Placement) => void;
128
+ }
@@ -0,0 +1,29 @@
1
+ //#region controllers/placement-controller/src/types.ts
2
+ var e = [
3
+ "bottom",
4
+ "bottom-left",
5
+ "bottom-right",
6
+ "bottom-start",
7
+ "bottom-end",
8
+ "top",
9
+ "top-left",
10
+ "top-right",
11
+ "top-start",
12
+ "top-end",
13
+ "left",
14
+ "left-top",
15
+ "left-bottom",
16
+ "start",
17
+ "start-top",
18
+ "start-bottom",
19
+ "right",
20
+ "right-top",
21
+ "right-bottom",
22
+ "end",
23
+ "end-top",
24
+ "end-bottom"
25
+ ];
26
+ //#endregion
27
+ export { e as ALL_PLACEMENTS };
28
+
29
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../controllers/placement-controller/src/types.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n// ─────────────────────────\n// PLACEMENT\n// ─────────────────────────\n\n/**\n * The full set of hyphenated placement values accepted by the public API\n * (`'bottom'`, `'bottom-start'`, `'start-top'`, etc.).\n *\n * Physical-alignment variants (`top-left`, `bottom-right`) are distinct from\n * logical-alignment variants (`top-start`, `bottom-end`) — physical stays fixed\n * regardless of direction; logical reverses in RTL via CSS.\n */\nexport const ALL_PLACEMENTS = [\n 'bottom',\n 'bottom-left',\n 'bottom-right',\n 'bottom-start',\n 'bottom-end',\n 'top',\n 'top-left',\n 'top-right',\n 'top-start',\n 'top-end',\n 'left',\n 'left-top',\n 'left-bottom',\n 'start',\n 'start-top',\n 'start-bottom',\n 'right',\n 'right-top',\n 'right-bottom',\n 'end',\n 'end-top',\n 'end-bottom',\n] as const;\n\n/**\n * The placement of the element with respect to its anchor element\n * (hyphenated form).\n */\nexport type Placement = (typeof ALL_PLACEMENTS)[number];\n\n// ─────────────────────────\n// VIRTUAL TRIGGER\n// ─────────────────────────\n\n/**\n * A virtual trigger reference accepted by `PlacementController`. Mirrors\n * the Floating UI virtual-element shape: anything that can report its bounding\n * rect and (optionally) its context element is a valid anchor.\n */\nexport interface VirtualTrigger {\n getBoundingClientRect(): DOMRect;\n contextElement?: Element;\n}\n\n// ─────────────────────────\n// OPTIONS\n// ─────────────────────────\n\n/**\n * Options passed to `PlacementController.start`.\n */\nexport interface PlacementOptions {\n /**\n * Preferred side and alignment of the floating element relative to the\n * **trigger** (hyphenated, for example `'bottom'`, `'bottom-start'`).\n *\n * This is the requested placement. When `shouldFlip` is enabled,\n * Floating UI may compute a different side if the requested one does not fit.\n * The result is surfaced on `PlacementController.actualPlacement` and\n * via `onPlacementChange`.\n *\n * @default 'bottom'\n */\n placement?: Placement;\n\n /**\n * Gap along the **placement direction** between the trigger and the floating\n * element, in pixels (Floating UI `offset` main axis).\n *\n * For `'bottom'`, this is the space below the trigger. This is **not**\n * viewport padding — see `containerPadding` for inset from the overflow\n * boundary.\n *\n * Defaults to `0` so the controller-host contract stays neutral; each\n * consuming component sets its own pattern-specific default.\n *\n * @default 0\n */\n offset?: number;\n\n /**\n * Slide along the **trigger edge**, perpendicular to the placement\n * direction, in pixels (Floating UI `offset` cross axis).\n *\n * Adjusts alignment such as `'bottom-start'` vs `'bottom-end'` without\n * changing viewport inset. This is **not** `containerPadding`.\n *\n * @default 0\n */\n crossOffset?: number;\n\n /**\n * Minimum inset from the **overflow boundary**, in pixels, used for\n * collision detection.\n *\n * Floating UI applies this as padding around the boundary it uses for\n * collision detection. By default that is the floating element's clipping\n * ancestors, capped by the visual viewport — so fixed or top-layer popovers\n * usually behave like screen-edge inset, while surfaces inside a scrollable\n * clipping parent use that container's edges instead.\n *\n * This is **not** the gap from the trigger — use `offset` and\n * `crossOffset` for trigger-relative spacing.\n *\n * @default 8\n */\n containerPadding?: number;\n\n /**\n * Whether Floating UI may **flip** the floating element to the opposite side when the\n * requested `placement` does not fit within the overflow boundary.\n *\n * When `false`, the floating element stays on the requested side even if it\n * overflows — useful for tooltips that must not jump above the trigger.\n *\n * @default true\n */\n shouldFlip?: boolean;\n\n /**\n * Optional tip element (\"arrow\") that should point at the trigger from\n * the floating element's edge. When provided, the controller installs\n * Floating UI's `arrow` middleware and writes an inline `translate` on\n * this element after every compute so it stays aligned with the trigger\n * even when `shift` slides the floating panel sideways. CSS positions\n * the tip relative to the floating element's edge (typically with a\n * negative offset for the half-size of the arrow); the controller only\n * moves it along that edge.\n */\n tipElement?: HTMLElement;\n\n /**\n * Minimum inset of the tip element from the floating element's\n * corners, in pixels. Passed straight to the `arrow` middleware as\n * its `padding`. Only meaningful when `tipElement` is provided.\n *\n * @default 8\n */\n tipPadding?: number;\n\n /**\n * Called with the computed hyphenated placement, on change only: once after\n * the first compute, then again whenever an `autoUpdate` tick produces a\n * different value. Computes that resolve to the same placement do not\n * re-notify, so wiring this to reactive state will not re-render on every\n * scroll or resize.\n */\n onPlacementChange?: (placement: Placement) => void;\n}\n"],"mappings":";AAwBA,IAAa,IAAiB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright 2026 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ export { SlotAttributePropagationController, type SlotAttributePropagationControllerOptions, } from './src/slot-attribute-propagation-controller.js';
@@ -0,0 +1,2 @@
1
+ import { SlotAttributePropagationController as e } from "./src/slot-attribute-propagation-controller.js";
2
+ export { e as SlotAttributePropagationController };
@@ -0,0 +1,65 @@
1
+ import { ReactiveController, ReactiveElement } from 'lit';
2
+ export interface SlotAttributePropagationControllerOptions {
3
+ /** The attribute name to propagate to assigned elements. */
4
+ attribute: string;
5
+ /**
6
+ * Returns the current value to propagate. Return `null` to remove the
7
+ * attribute from assigned elements, for attributes that are only
8
+ * sometimes present on the host.
9
+ */
10
+ getValue: () => string | null;
11
+ /** Named slot to target. Omit for the default (unnamed) slot. */
12
+ slotName?: string;
13
+ /**
14
+ * CSS selector used to filter assigned elements before propagating.
15
+ * Omit to propagate to all assigned elements.
16
+ */
17
+ selector?: string;
18
+ }
19
+ /**
20
+ * A Lit {@link ReactiveController} that propagates an attribute from the host
21
+ * element to elements assigned to one of its slots.
22
+ *
23
+ * The controller automatically re-propagates in `hostUpdated()` whenever the
24
+ * value returned by `getValue` changes. Call `propagate()` from the host's
25
+ * `slotchange` handler to cover elements inserted after the first render.
26
+ *
27
+ * `getValue` may return `null` for attributes that are only sometimes present
28
+ * on the host; the controller removes the attribute from assigned elements
29
+ * rather than setting it to an empty string.
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * class MyBase extends SpectrumElement {
34
+ * @property({ type: String, reflect: true })
35
+ * public size: MySize = 'm';
36
+ *
37
+ * private readonly _sizePropagation = new SlotAttributePropagationController(this, {
38
+ * attribute: 'size',
39
+ * getValue: () => this.size,
40
+ * slotName: 'actions',
41
+ * });
42
+ *
43
+ * protected handleActionsSlotChange(): void {
44
+ * this._sizePropagation.propagate();
45
+ * }
46
+ * }
47
+ * ```
48
+ */
49
+ export declare class SlotAttributePropagationController implements ReactiveController {
50
+ private readonly _host;
51
+ private readonly _options;
52
+ private _previousValue?;
53
+ constructor(host: ReactiveElement, options: SlotAttributePropagationControllerOptions);
54
+ hostDisconnected(): void;
55
+ hostUpdated(): void;
56
+ /**
57
+ * Propagates the current value to all matching assigned elements
58
+ * immediately, updating the value tracked for the `hostUpdated()` no-op
59
+ * guard so it isn't repeated once the pending update runs. Call this from
60
+ * the host's `slotchange` event handler.
61
+ */
62
+ propagate(): void;
63
+ private _propagateToSlot;
64
+ private _resolveSlot;
65
+ }
@@ -0,0 +1,33 @@
1
+ //#region controllers/slot-attribute-propagation-controller/src/slot-attribute-propagation-controller.ts
2
+ var e = class {
3
+ constructor(e, t) {
4
+ this._host = e, this._options = t, e.addController(this);
5
+ }
6
+ hostDisconnected() {
7
+ this._previousValue = void 0;
8
+ }
9
+ hostUpdated() {
10
+ let e = this._options.getValue();
11
+ e !== this._previousValue && this._propagateToSlot(e);
12
+ }
13
+ propagate() {
14
+ this._propagateToSlot(this._options.getValue());
15
+ }
16
+ _propagateToSlot(e) {
17
+ let t = this._resolveSlot();
18
+ if (!t) return;
19
+ this._previousValue = e;
20
+ let n = t.assignedElements({ flatten: !0 }), r = this._options.selector ? n.filter((e) => e.matches(this._options.selector)) : n;
21
+ for (let t of r) e === null ? t.removeAttribute(this._options.attribute) : t.setAttribute(this._options.attribute, e);
22
+ }
23
+ _resolveSlot() {
24
+ let e = this._host.shadowRoot;
25
+ if (!e) return null;
26
+ let { slotName: t } = this._options;
27
+ return t ? e.querySelector(`slot[name="${t}"]`) : e.querySelector("slot:not([name])");
28
+ }
29
+ };
30
+ //#endregion
31
+ export { e as SlotAttributePropagationController };
32
+
33
+ //# sourceMappingURL=slot-attribute-propagation-controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slot-attribute-propagation-controller.js","names":[],"sources":["../../../../controllers/slot-attribute-propagation-controller/src/slot-attribute-propagation-controller.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\n\n// ─────────────────────────\n// TYPES\n// ─────────────────────────\n\nexport interface SlotAttributePropagationControllerOptions {\n /** The attribute name to propagate to assigned elements. */\n attribute: string;\n\n /**\n * Returns the current value to propagate. Return `null` to remove the\n * attribute from assigned elements, for attributes that are only\n * sometimes present on the host.\n */\n getValue: () => string | null;\n /** Named slot to target. Omit for the default (unnamed) slot. */\n slotName?: string;\n\n /**\n * CSS selector used to filter assigned elements before propagating.\n * Omit to propagate to all assigned elements.\n */\n selector?: string;\n}\n\n// ─────────────────────────────────────────────────────────────────\n// CONTROLLER\n// ─────────────────────────────────────────────────────────────────\n\n/**\n * A Lit {@link ReactiveController} that propagates an attribute from the host\n * element to elements assigned to one of its slots.\n *\n * The controller automatically re-propagates in `hostUpdated()` whenever the\n * value returned by `getValue` changes. Call `propagate()` from the host's\n * `slotchange` handler to cover elements inserted after the first render.\n *\n * `getValue` may return `null` for attributes that are only sometimes present\n * on the host; the controller removes the attribute from assigned elements\n * rather than setting it to an empty string.\n *\n * @example\n * ```ts\n * class MyBase extends SpectrumElement {\n * @property({ type: String, reflect: true })\n * public size: MySize = 'm';\n *\n * private readonly _sizePropagation = new SlotAttributePropagationController(this, {\n * attribute: 'size',\n * getValue: () => this.size,\n * slotName: 'actions',\n * });\n *\n * protected handleActionsSlotChange(): void {\n * this._sizePropagation.propagate();\n * }\n * }\n * ```\n */\nexport class SlotAttributePropagationController implements ReactiveController {\n private readonly _host: ReactiveElement;\n private readonly _options: SlotAttributePropagationControllerOptions;\n private _previousValue?: string | null;\n\n constructor(\n host: ReactiveElement,\n options: SlotAttributePropagationControllerOptions\n ) {\n this._host = host;\n this._options = options;\n host.addController(this);\n }\n\n public hostDisconnected(): void {\n this._previousValue = undefined;\n }\n\n public hostUpdated(): void {\n const value = this._options.getValue();\n if (value !== this._previousValue) {\n this._propagateToSlot(value);\n }\n }\n\n /**\n * Propagates the current value to all matching assigned elements\n * immediately, updating the value tracked for the `hostUpdated()` no-op\n * guard so it isn't repeated once the pending update runs. Call this from\n * the host's `slotchange` event handler.\n */\n public propagate(): void {\n this._propagateToSlot(this._options.getValue());\n }\n\n private _propagateToSlot(value: string | null): void {\n const slot = this._resolveSlot();\n if (!slot) {\n return;\n }\n // Tracked here (not just in hostUpdated()) so a propagate() call from a\n // slotchange handler also updates the no-op guard; otherwise a\n // subsequently-scheduled hostUpdated() with the same value would repeat\n // the same setAttribute()/removeAttribute() sweep over every target. Set\n // only once the slot resolves: if a call (from either hostUpdated() or\n // propagate()) can't resolve the slot yet, the value must not be marked\n // as applied, or a slot that resolves later with an unchanged value\n // would be silently skipped forever.\n this._previousValue = value;\n const assigned = slot.assignedElements({ flatten: true });\n const targets = this._options.selector\n ? assigned.filter((el) => el.matches(this._options.selector!))\n : assigned;\n for (const el of targets) {\n if (value === null) {\n el.removeAttribute(this._options.attribute);\n } else {\n el.setAttribute(this._options.attribute, value);\n }\n }\n }\n\n private _resolveSlot(): HTMLSlotElement | null {\n const root = this._host.shadowRoot;\n if (!root) {\n return null;\n }\n const { slotName } = this._options;\n return slotName\n ? root.querySelector<HTMLSlotElement>(`slot[name=\"${slotName}\"]`)\n : root.querySelector<HTMLSlotElement>('slot:not([name])');\n }\n}\n"],"mappings":";AAwEA,IAAa,IAAb,MAA8E;CAK5E,YACE,GACA,GACA;AAGA,EAFA,KAAK,QAAQ,GACb,KAAK,WAAW,GAChB,EAAK,cAAc,KAAK;;CAG1B,mBAAgC;AAC9B,OAAK,iBAAiB,KAAA;;CAGxB,cAA2B;EACzB,IAAM,IAAQ,KAAK,SAAS,UAAU;AACtC,EAAI,MAAU,KAAK,kBACjB,KAAK,iBAAiB,EAAM;;CAUhC,YAAyB;AACvB,OAAK,iBAAiB,KAAK,SAAS,UAAU,CAAC;;CAGjD,iBAAyB,GAA4B;EACnD,IAAM,IAAO,KAAK,cAAc;AAChC,MAAI,CAAC,EACH;AAUF,OAAK,iBAAiB;EACtB,IAAM,IAAW,EAAK,iBAAiB,EAAE,SAAS,IAAM,CAAC,EACnD,IAAU,KAAK,SAAS,WAC1B,EAAS,QAAQ,MAAO,EAAG,QAAQ,KAAK,SAAS,SAAU,CAAC,GAC5D;AACJ,OAAK,IAAM,KAAM,EACf,CAAI,MAAU,OACZ,EAAG,gBAAgB,KAAK,SAAS,UAAU,GAE3C,EAAG,aAAa,KAAK,SAAS,WAAW,EAAM;;CAKrD,eAA+C;EAC7C,IAAM,IAAO,KAAK,MAAM;AACxB,MAAI,CAAC,EACH,QAAO;EAET,IAAM,EAAE,gBAAa,KAAK;AAC1B,SAAO,IACH,EAAK,cAA+B,cAAc,EAAS,IAAI,GAC/D,EAAK,cAA+B,mBAAmB"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright 2026 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ export { SlotPresenceController } from './src/slot-presence-controller.js';
@@ -0,0 +1,2 @@
1
+ import { SlotPresenceController as e } from "./src/slot-presence-controller.js";
2
+ export { e as SlotPresenceController };
@@ -0,0 +1,57 @@
1
+ import { ReactiveController, ReactiveElement } from 'lit';
2
+ /**
3
+ * A reactive controller that observes whether slotted content matching
4
+ * given CSS selectors is present in the host's light DOM.
5
+ *
6
+ * Replaces the `ObserveSlotPresence` mixin with a composition-based approach.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * class MyComponent extends SpectrumElement {
11
+ * private slotPresence = new SlotPresenceController(this, '[slot="icon"]');
12
+ *
13
+ * get hasIcon(): boolean {
14
+ * return this.slotPresence.isPresent;
15
+ * }
16
+ * }
17
+ * ```
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * // Observing multiple selectors
22
+ * class MyComponent extends SpectrumElement {
23
+ * private slotPresence = new SlotPresenceController(this, [
24
+ * '[slot="icon"]',
25
+ * '[slot="description"]',
26
+ * ]);
27
+ *
28
+ * get hasIcon(): boolean {
29
+ * return this.slotPresence.getPresence('[slot="icon"]');
30
+ * }
31
+ *
32
+ * get hasDescription(): boolean {
33
+ * return this.slotPresence.getPresence('[slot="description"]');
34
+ * }
35
+ * }
36
+ * ```
37
+ */
38
+ export declare class SlotPresenceController implements ReactiveController {
39
+ private host;
40
+ private selectors;
41
+ private presenceMap;
42
+ private observer;
43
+ constructor(host: ReactiveElement, selectors: string | string[]);
44
+ /**
45
+ * Whether slotted content is present. Use this when observing a single
46
+ * selector. Throws if multiple selectors were provided — use
47
+ * `getPresence(selector)` instead.
48
+ */
49
+ get isPresent(): boolean;
50
+ /**
51
+ * Returns whether content matching the given selector is present.
52
+ */
53
+ getPresence(selector: string): boolean;
54
+ private checkPresence;
55
+ hostConnected(): void;
56
+ hostDisconnected(): void;
57
+ }
@@ -0,0 +1,44 @@
1
+ //#region controllers/slot-presence-controller/src/slot-presence-controller.ts
2
+ var e = class {
3
+ constructor(e, t) {
4
+ this.presenceMap = /* @__PURE__ */ new Map(), this.host = e, this.selectors = Array.isArray(t) ? t : [t], this.host.addController(this), this.observer = new MutationObserver(() => {
5
+ this.checkPresence();
6
+ }), this.checkPresence();
7
+ }
8
+ get isPresent() {
9
+ if (this.selectors.length === 1) {
10
+ var e;
11
+ return (e = this.presenceMap.get(this.selectors[0])) == null ? !1 : e;
12
+ }
13
+ throw Error("Multiple selectors provided to SlotPresenceController — use getPresence(selector) instead.");
14
+ }
15
+ getPresence(e) {
16
+ if (this.presenceMap.has(e)) {
17
+ var t;
18
+ return (t = this.presenceMap.get(e)) == null ? !1 : t;
19
+ }
20
+ throw Error(`The provided selector \`${e}\` is not being observed.`);
21
+ }
22
+ checkPresence() {
23
+ let e = !1;
24
+ for (let n of this.selectors) {
25
+ var t;
26
+ let r = !!this.host.querySelector(`:scope > ${n}`);
27
+ ((t = this.presenceMap.get(n)) == null ? !1 : t) !== r && (e = !0), this.presenceMap.set(n, r);
28
+ }
29
+ e && this.host.requestUpdate();
30
+ }
31
+ hostConnected() {
32
+ this.observer.observe(this.host, {
33
+ childList: !0,
34
+ subtree: !0
35
+ }), this.checkPresence();
36
+ }
37
+ hostDisconnected() {
38
+ this.observer.disconnect();
39
+ }
40
+ };
41
+ //#endregion
42
+ export { e as SlotPresenceController };
43
+
44
+ //# sourceMappingURL=slot-presence-controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slot-presence-controller.js","names":[],"sources":["../../../../controllers/slot-presence-controller/src/slot-presence-controller.ts"],"sourcesContent":["/**\n * Copyright 2026 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type { ReactiveController, ReactiveElement } from 'lit';\n\n/**\n * A reactive controller that observes whether slotted content matching\n * given CSS selectors is present in the host's light DOM.\n *\n * Replaces the `ObserveSlotPresence` mixin with a composition-based approach.\n *\n * @example\n * ```typescript\n * class MyComponent extends SpectrumElement {\n * private slotPresence = new SlotPresenceController(this, '[slot=\"icon\"]');\n *\n * get hasIcon(): boolean {\n * return this.slotPresence.isPresent;\n * }\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Observing multiple selectors\n * class MyComponent extends SpectrumElement {\n * private slotPresence = new SlotPresenceController(this, [\n * '[slot=\"icon\"]',\n * '[slot=\"description\"]',\n * ]);\n *\n * get hasIcon(): boolean {\n * return this.slotPresence.getPresence('[slot=\"icon\"]');\n * }\n *\n * get hasDescription(): boolean {\n * return this.slotPresence.getPresence('[slot=\"description\"]');\n * }\n * }\n * ```\n */\nexport class SlotPresenceController implements ReactiveController {\n private host: ReactiveElement;\n private selectors: string[];\n private presenceMap = new Map<string, boolean>();\n private observer: MutationObserver;\n\n constructor(host: ReactiveElement, selectors: string | string[]) {\n this.host = host;\n this.selectors = Array.isArray(selectors) ? selectors : [selectors];\n this.host.addController(this);\n\n this.observer = new MutationObserver(() => {\n this.checkPresence();\n });\n\n // Check initial state synchronously\n this.checkPresence();\n }\n\n /**\n * Whether slotted content is present. Use this when observing a single\n * selector. Throws if multiple selectors were provided — use\n * `getPresence(selector)` instead.\n */\n get isPresent(): boolean {\n if (this.selectors.length === 1) {\n return this.presenceMap.get(this.selectors[0]) ?? false;\n }\n throw new Error(\n 'Multiple selectors provided to SlotPresenceController — use getPresence(selector) instead.'\n );\n }\n\n /**\n * Returns whether content matching the given selector is present.\n */\n getPresence(selector: string): boolean {\n if (this.presenceMap.has(selector)) {\n return this.presenceMap.get(selector) ?? false;\n }\n throw new Error(\n `The provided selector \\`${selector}\\` is not being observed.`\n );\n }\n\n private checkPresence(): void {\n let changed = false;\n for (const selector of this.selectors) {\n const nextValue = !!this.host.querySelector(`:scope > ${selector}`);\n const previousValue = this.presenceMap.get(selector) ?? false;\n if (previousValue !== nextValue) {\n changed = true;\n }\n this.presenceMap.set(selector, nextValue);\n }\n if (changed) {\n // The `ObserveSlotPresence` mixin this controller replaces deferred the\n // re-render with `this.updateComplete.then(() => this.requestUpdate())`.\n // The controller requests the update synchronously instead. This is\n // safe because `checkPresence` only runs from the constructor, the\n // `MutationObserver` callback, and `hostConnected` — never from inside\n // the host's own `update()`/`render()` — so there is no re-entrant\n // update. Lit batches `requestUpdate()` calls into the next microtask,\n // so multiple presence changes in one tick still coalesce into a single\n // render. See the controller stories for the behavioral test.\n this.host.requestUpdate();\n }\n }\n\n hostConnected(): void {\n this.observer.observe(this.host, {\n childList: true,\n subtree: true,\n });\n this.checkPresence();\n }\n\n hostDisconnected(): void {\n this.observer.disconnect();\n }\n}\n"],"mappings":";AAkDA,IAAa,IAAb,MAAkE;CAMhE,YAAY,GAAuB,GAA8B;AAU/D,qCAboB,IAAI,KAAsB,EAI9C,KAAK,OAAO,GACZ,KAAK,YAAY,MAAM,QAAQ,EAAU,GAAG,IAAY,CAAC,EAAU,EACnE,KAAK,KAAK,cAAc,KAAK,EAE7B,KAAK,WAAW,IAAI,uBAAuB;AACzC,QAAK,eAAe;IACpB,EAGF,KAAK,eAAe;;CAQtB,IAAI,YAAqB;AACvB,MAAI,KAAK,UAAU,WAAW,GAAG;;AAC/B,WAAA,IAAO,KAAK,YAAY,IAAI,KAAK,UAAU,GAAG,KAAA,OAAI,KAAJ;;AAEhD,QAAU,MACR,6FACD;;CAMH,YAAY,GAA2B;AACrC,MAAI,KAAK,YAAY,IAAI,EAAS,EAAE;;AAClC,WAAA,IAAO,KAAK,YAAY,IAAI,EAAS,KAAA,OAAI,KAAJ;;AAEvC,QAAU,MACR,2BAA2B,EAAS,2BACrC;;CAGH,gBAA8B;EAC5B,IAAI,IAAU;AACd,OAAK,IAAM,KAAY,KAAK,WAAW;;GACrC,IAAM,IAAY,CAAC,CAAC,KAAK,KAAK,cAAc,YAAY,IAAW;AAKnE,KAHA,IADsB,KAAK,YAAY,IAAI,EAAS,KAAA,OAAI,KAAJ,OAC9B,MACpB,IAAU,KAEZ,KAAK,YAAY,IAAI,GAAU,EAAU;;AAE3C,EAAI,KAUF,KAAK,KAAK,eAAe;;CAI7B,gBAAsB;AAKpB,EAJA,KAAK,SAAS,QAAQ,KAAK,MAAM;GAC/B,WAAW;GACX,SAAS;GACV,CAAC,EACF,KAAK,eAAe;;CAGtB,mBAAyB;AACvB,OAAK,SAAS,YAAY"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright 2026 Adobe. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+ export { SlotTextController, type SlotTextConfig, } from './src/slot-text-controller.js';
@@ -0,0 +1,2 @@
1
+ import { SlotTextController as e } from "./src/slot-text-controller.js";
2
+ export { e as SlotTextController };