spell-ui 0.8.6 → 0.8.8

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 (722) hide show
  1. package/README-components.md +14 -6
  2. package/README-frameworks.md +22 -12
  3. package/README-migrating.md +7 -6
  4. package/README-runtime.md +14 -13
  5. package/README-site.md +11 -11
  6. package/README-themes.md +38 -11
  7. package/README.md +61 -73
  8. package/dist/Dragging-CMZoLEWQ.js +169 -0
  9. package/dist/Dragging-CMZoLEWQ.js.map +1 -0
  10. package/dist/{MarkdownEngine-CbuT9Mjc.js → MarkdownEngine-CW1WGqNp.js} +122 -100
  11. package/dist/MarkdownEngine-CW1WGqNp.js.map +1 -0
  12. package/dist/{PrefStore-CeaTtjTz.js → PrefStore-Qv0e5y04.js} +22 -22
  13. package/dist/PrefStore-Qv0e5y04.js.map +1 -0
  14. package/dist/ScrollingRow-7n7Z-HIE.js +88 -0
  15. package/dist/ScrollingRow-7n7Z-HIE.js.map +1 -0
  16. package/dist/SitePages-CciwREek.js +51 -0
  17. package/dist/SitePages-CciwREek.js.map +1 -0
  18. package/dist/{SlottedItems-Ch0tzzlL.js → SlottedItems-Du3aJwG1.js} +22 -22
  19. package/dist/{SlottedItems-Ch0tzzlL.js.map → SlottedItems-Du3aJwG1.js.map} +1 -1
  20. package/dist/ThemeDraft-B7NPif4d.js +805 -0
  21. package/dist/ThemeDraft-B7NPif4d.js.map +1 -0
  22. package/dist/TreeMeasure-BVJeGb1L.js +42 -0
  23. package/dist/TreeMeasure-BVJeGb1L.js.map +1 -0
  24. package/dist/UIButton-DFEds67r.js +6 -0
  25. package/dist/UIButton-DFEds67r.js.map +1 -0
  26. package/dist/UIInput-BodVbUoQ.js +6 -0
  27. package/dist/UIInput-BodVbUoQ.js.map +1 -0
  28. package/dist/{UIKeys-DJF2TIKE.js → UIKeys-Rh_gUZjP.js} +10 -9
  29. package/dist/UIKeys-Rh_gUZjP.js.map +1 -0
  30. package/dist/UILabel-DgJUBzB_.js +6 -0
  31. package/dist/UILabel-DgJUBzB_.js.map +1 -0
  32. package/dist/UIMenu-zdcAtwTa.js +42 -0
  33. package/dist/UIMenu-zdcAtwTa.js.map +1 -0
  34. package/dist/{UIRuntime-BBuehGly.js → UIRuntime-KH309p5B.js} +398 -207
  35. package/dist/UIRuntime-KH309p5B.js.map +1 -0
  36. package/dist/_spell-element/DOMElement.d.ts +62 -5
  37. package/dist/_spell-element/MoveAndResize.d.ts +75 -0
  38. package/dist/_spell-element/UIComponent.d.ts +42 -0
  39. package/dist/_spell-element/elements.types.d.ts +47 -0
  40. package/dist/_spell-element/index.d.ts +1 -0
  41. package/dist/_spell-element/vocabulary.types.d.ts +34 -2
  42. package/dist/{runtime → _util}/Api.d.ts +14 -4
  43. package/dist/_util/Dragging.d.ts +148 -0
  44. package/dist/_util/ListSelection.d.ts +46 -0
  45. package/dist/{util → _util}/LoadOnce.d.ts +9 -1
  46. package/dist/_util/ReconnectingSocket.d.ts +51 -0
  47. package/dist/_util/diagram/DiagramColumns.d.ts +14 -0
  48. package/dist/_util/diagram/DiagramLayout.d.ts +119 -0
  49. package/dist/_util/diagram/DiagramSVG.d.ts +17 -0
  50. package/dist/_util/dom.d.ts +10 -0
  51. package/dist/_util/fetching.d.ts +92 -0
  52. package/dist/_util/measures/Dimension.d.ts +63 -0
  53. package/dist/_util/measures/MeasureSystem.d.ts +66 -0
  54. package/dist/_util/measures/dimensions.generated.d.ts +16 -0
  55. package/dist/_util/persist/ColorScheme.d.ts +6 -0
  56. package/dist/_util/persist/ServerPlace.d.ts +42 -0
  57. package/dist/_util/persist/WaitedOnPlace.d.ts +27 -0
  58. package/dist/_util/persist/persist.types.d.ts +21 -2
  59. package/dist/_util/timing.d.ts +10 -1
  60. package/dist/api.js +8 -7
  61. package/dist/api.js.map +1 -1
  62. package/dist/components/ComponentDefinitions.d.ts +29 -0
  63. package/dist/components/components.es.d.ts +13 -0
  64. package/dist/components/components.types.d.ts +113 -8
  65. package/dist/components/ui-accordion/UIAccordion.d.ts +1 -0
  66. package/dist/components/ui-accordion/UIAccordion.en.d.ts +1 -0
  67. package/dist/components/ui-action/UIAction.en.d.ts +5 -1
  68. package/dist/components/ui-ad/UIAd.d.ts +1 -0
  69. package/dist/components/ui-ad/UIAd.en.d.ts +1 -0
  70. package/dist/components/ui-breadcrumbs/UIBreadcrumb.d.ts +1 -0
  71. package/dist/components/ui-breadcrumbs/UIBreadcrumb.en.d.ts +1 -0
  72. package/dist/components/ui-breadcrumbs/UIBreadcrumbs.d.ts +1 -0
  73. package/dist/components/ui-breadcrumbs/UIBreadcrumbs.en.d.ts +1 -0
  74. package/dist/components/ui-button/UIButton.d.ts +8 -3
  75. package/dist/components/ui-button/UIButton.en.d.ts +9 -4
  76. package/dist/components/ui-button/UIButton.es.d.ts +6 -0
  77. package/dist/components/ui-button/UIButton.fallback.d.ts +8 -3
  78. package/dist/components/ui-button/UIButtons.d.ts +1 -0
  79. package/dist/components/ui-button/UIButtons.en.d.ts +1 -0
  80. package/dist/components/ui-button/UIOr.d.ts +1 -0
  81. package/dist/components/ui-button/UIOr.en.d.ts +1 -0
  82. package/dist/components/ui-calendar/UICalendar.d.ts +6 -0
  83. package/dist/components/ui-calendar/UICalendar.en.d.ts +6 -0
  84. package/dist/components/ui-calendar/UICalendar.fallback.d.ts +6 -0
  85. package/dist/components/ui-card/CardClicks.d.ts +40 -0
  86. package/dist/components/ui-card/UICard.d.ts +41 -0
  87. package/dist/components/ui-card/UICard.en.d.ts +49 -0
  88. package/dist/components/ui-card/UICard.es.d.ts +1 -0
  89. package/dist/components/ui-card/UICards.d.ts +31 -0
  90. package/dist/components/ui-card/UICards.en.d.ts +31 -0
  91. package/dist/components/ui-card/UICards.es.d.ts +8 -0
  92. package/dist/components/ui-checkbox/CheckControl.d.ts +7 -0
  93. package/dist/components/ui-checkbox/UICheckbox.d.ts +7 -0
  94. package/dist/components/ui-checkbox/UICheckbox.en.d.ts +7 -0
  95. package/dist/components/ui-checkbox/UICheckbox.es.d.ts +1 -0
  96. package/dist/components/ui-checkbox/UICheckbox.fallback.d.ts +7 -0
  97. package/dist/components/ui-checkbox/UICheckbox.types.d.ts +5 -0
  98. package/dist/components/ui-checkbox/UIRadio.d.ts +8 -0
  99. package/dist/components/ui-checkbox/UIRadio.en.d.ts +6 -0
  100. package/dist/components/ui-code/UICode.en.d.ts +1 -0
  101. package/dist/components/ui-comment/UIComment.d.ts +1 -0
  102. package/dist/components/ui-comment/UIComment.en.d.ts +1 -0
  103. package/dist/components/ui-comment/UIComments.d.ts +1 -0
  104. package/dist/components/ui-comment/UIComments.en.d.ts +1 -0
  105. package/dist/components/ui-components/PackHotSwap.d.ts +13 -3
  106. package/dist/components/ui-components/UIComponents.d.ts +1 -0
  107. package/dist/components/ui-components/UIComponents.en.d.ts +1 -0
  108. package/dist/components/ui-container/UIContainer.d.ts +11 -0
  109. package/dist/components/ui-container/UIContainer.en.d.ts +7 -0
  110. package/dist/components/ui-container/UIContainer.es.d.ts +1 -0
  111. package/dist/components/ui-diagram/UIDiagram.d.ts +268 -0
  112. package/dist/components/ui-diagram/UIDiagram.en.d.ts +106 -0
  113. package/dist/components/ui-diagram/UIDiagram.es.d.ts +37 -0
  114. package/dist/components/ui-diagram/UIDiagramNode.d.ts +98 -0
  115. package/dist/components/ui-diagram/UIDiagramNode.en.d.ts +38 -0
  116. package/dist/components/ui-diagram/UIDiagramNode.es.d.ts +16 -0
  117. package/dist/components/ui-diagram/index.d.ts +8 -0
  118. package/dist/components/ui-dimension/UIDimension.d.ts +81 -0
  119. package/dist/components/ui-dimension/UIDimension.en.d.ts +54 -0
  120. package/dist/components/ui-dimension/UIDimension.es.d.ts +22 -0
  121. package/dist/components/ui-dimension/index.d.ts +2 -0
  122. package/dist/components/ui-dimmer/UIDimmer.d.ts +6 -1
  123. package/dist/components/ui-dimmer/UIDimmer.en.d.ts +1 -0
  124. package/dist/components/ui-dimmer/UIDimmer.es.d.ts +1 -1
  125. package/dist/components/ui-divider/UIDivider.d.ts +2 -0
  126. package/dist/components/ui-divider/UIDivider.en.d.ts +2 -0
  127. package/dist/components/ui-divider/UIDivider.es.d.ts +1 -0
  128. package/dist/components/ui-dropdown/UIDropdown.d.ts +6 -0
  129. package/dist/components/ui-dropdown/UIDropdown.en.d.ts +6 -0
  130. package/dist/components/ui-dropdown/UIDropdown.fallback.d.ts +6 -0
  131. package/dist/components/ui-embed/UIEmbed.d.ts +1 -0
  132. package/dist/components/ui-embed/UIEmbed.en.d.ts +1 -0
  133. package/dist/components/ui-emoji/UIEmoji.d.ts +1 -0
  134. package/dist/components/ui-emoji/UIEmoji.en.d.ts +1 -0
  135. package/dist/components/ui-example/UIExample.en.d.ts +4 -2
  136. package/dist/components/ui-example/UIExample.es.d.ts +3 -2
  137. package/dist/components/ui-feed/UIFeed.d.ts +1 -0
  138. package/dist/components/ui-feed/UIFeed.en.d.ts +1 -0
  139. package/dist/components/ui-feed/UIFeedEvent.d.ts +1 -0
  140. package/dist/components/ui-feed/UIFeedEvent.en.d.ts +1 -0
  141. package/dist/components/ui-flag/UIFlag.d.ts +1 -0
  142. package/dist/components/ui-flag/UIFlag.en.d.ts +1 -0
  143. package/dist/components/ui-flyout/UIFlyout.d.ts +1 -0
  144. package/dist/components/ui-flyout/UIFlyout.en.d.ts +1 -0
  145. package/dist/components/ui-form/FormBinding.d.ts +13 -1
  146. package/dist/components/ui-form/FormFields.d.ts +4 -4
  147. package/dist/components/ui-form/UIField.d.ts +30 -3
  148. package/dist/components/ui-form/UIField.en.d.ts +9 -0
  149. package/dist/components/ui-form/UIField.es.d.ts +6 -0
  150. package/dist/components/ui-form/UIFields.d.ts +1 -0
  151. package/dist/components/ui-form/UIFields.en.d.ts +1 -0
  152. package/dist/components/ui-form/UIForm.d.ts +15 -0
  153. package/dist/components/ui-form/UIForm.en.d.ts +6 -0
  154. package/dist/components/ui-form/UIRepeat.d.ts +1 -0
  155. package/dist/components/ui-form/UIRepeat.en.d.ts +1 -0
  156. package/dist/components/ui-form/index.d.ts +2 -1
  157. package/dist/components/ui-grid/UIColumn.d.ts +1 -0
  158. package/dist/components/ui-grid/UIColumn.en.d.ts +1 -0
  159. package/dist/components/ui-grid/UIGrid.d.ts +1 -0
  160. package/dist/components/ui-grid/UIGrid.en.d.ts +1 -0
  161. package/dist/components/ui-grid/UIRow.d.ts +1 -0
  162. package/dist/components/ui-grid/UIRow.en.d.ts +1 -0
  163. package/dist/components/ui-icon/UIIcon.d.ts +3 -2
  164. package/dist/components/ui-icon/UIIcon.en.d.ts +3 -2
  165. package/dist/components/ui-icon/UIIcons.d.ts +1 -0
  166. package/dist/components/ui-icon/UIIcons.en.d.ts +1 -0
  167. package/dist/components/ui-icon-picker/UIIconPicker.d.ts +6 -0
  168. package/dist/components/ui-icon-picker/UIIconPicker.en.d.ts +6 -0
  169. package/dist/components/ui-icon-picker/UIIconPicker.fallback.d.ts +6 -0
  170. package/dist/components/ui-image/UIImage.d.ts +34 -0
  171. package/dist/components/ui-image/UIImage.en.d.ts +23 -0
  172. package/dist/components/ui-image/UIImage.es.d.ts +2 -0
  173. package/dist/components/ui-image/UIImages.d.ts +1 -0
  174. package/dist/components/ui-image/UIImages.en.d.ts +1 -0
  175. package/dist/components/ui-include/UIInclude.d.ts +1 -0
  176. package/dist/components/ui-include/UIInclude.en.d.ts +1 -0
  177. package/dist/components/ui-input/TextControl.d.ts +7 -0
  178. package/dist/components/ui-input/UIInput.d.ts +22 -3
  179. package/dist/components/ui-input/UIInput.en.d.ts +9 -2
  180. package/dist/components/ui-input/UIInput.es.d.ts +2 -0
  181. package/dist/components/ui-input/UIInput.fallback.d.ts +9 -2
  182. package/dist/components/ui-input/UITextarea.d.ts +20 -0
  183. package/dist/components/ui-input/UITextarea.en.d.ts +15 -0
  184. package/dist/components/ui-input/UITextarea.es.d.ts +4 -0
  185. package/dist/components/ui-item/UIItem.d.ts +27 -4
  186. package/dist/components/ui-item/UIItem.en.d.ts +5 -1
  187. package/dist/components/ui-items/UIItems.d.ts +1 -0
  188. package/dist/components/ui-items/UIItems.en.d.ts +1 -0
  189. package/dist/components/ui-json/JsonChild.d.ts +30 -0
  190. package/dist/components/ui-json/UIJson.d.ts +128 -0
  191. package/dist/components/ui-json/UIJson.en.d.ts +71 -0
  192. package/dist/components/ui-json/UIJson.es.d.ts +12 -0
  193. package/dist/components/ui-json/index.d.ts +3 -0
  194. package/dist/components/ui-keys/UIKeys.d.ts +1 -0
  195. package/dist/components/ui-keys/UIKeys.en.d.ts +1 -0
  196. package/dist/components/ui-label/UILabel.d.ts +2 -0
  197. package/dist/components/ui-label/UILabel.en.d.ts +2 -0
  198. package/dist/components/ui-label/UILabel.es.d.ts +1 -0
  199. package/dist/components/ui-label/UILabels.d.ts +1 -0
  200. package/dist/components/ui-label/UILabels.en.d.ts +1 -0
  201. package/dist/components/ui-list/UIList.d.ts +2 -0
  202. package/dist/components/ui-list/UIList.en.d.ts +2 -0
  203. package/dist/components/ui-list/UIList.es.d.ts +1 -0
  204. package/dist/components/ui-loader/UILoader.d.ts +1 -0
  205. package/dist/components/ui-loader/UILoader.en.d.ts +1 -0
  206. package/dist/components/ui-markdown/MarkdownBox.d.ts +143 -0
  207. package/dist/components/ui-markdown/MarkdownEngine.d.ts +14 -2
  208. package/dist/components/ui-markdown/MarkdownFormats.d.ts +95 -0
  209. package/dist/components/ui-markdown/MarkdownSource.d.ts +57 -0
  210. package/dist/components/ui-markdown/UIMarkdown.d.ts +126 -6
  211. package/dist/components/ui-markdown/UIMarkdown.en.d.ts +111 -8
  212. package/dist/components/ui-markdown/UIMarkdown.es.d.ts +29 -1
  213. package/dist/components/ui-markdown/UIMarkdown.types.d.ts +26 -0
  214. package/dist/components/ui-menu/ScrollingRow.d.ts +79 -0
  215. package/dist/components/ui-menu/TitleFit.d.ts +3 -0
  216. package/dist/components/ui-menu/UIMenu.d.ts +97 -4
  217. package/dist/components/ui-menu/UIMenu.en.d.ts +50 -1
  218. package/dist/components/ui-menu/UIMenu.es.d.ts +4 -0
  219. package/dist/components/ui-message/UIMessage.d.ts +2 -0
  220. package/dist/components/ui-message/UIMessage.en.d.ts +2 -0
  221. package/dist/components/ui-message/UIMessage.es.d.ts +1 -0
  222. package/dist/components/ui-modal/UIModal.d.ts +1 -0
  223. package/dist/components/ui-modal/UIModal.en.d.ts +1 -0
  224. package/dist/components/ui-nag/UINag.d.ts +1 -0
  225. package/dist/components/ui-nag/UINag.en.d.ts +1 -0
  226. package/dist/components/ui-page/UIPage.d.ts +15 -0
  227. package/dist/components/ui-page/UIPage.en.d.ts +15 -0
  228. package/dist/components/ui-page/UIPage.es.d.ts +1 -0
  229. package/dist/components/ui-panel/UIPanel.d.ts +6 -0
  230. package/dist/components/ui-panel/UIPanel.en.d.ts +33 -20
  231. package/dist/components/ui-parts/UIActions.d.ts +1 -0
  232. package/dist/components/ui-parts/UIActions.en.d.ts +1 -0
  233. package/dist/components/ui-parts/UIAuthor.d.ts +1 -0
  234. package/dist/components/ui-parts/UIAuthor.en.d.ts +1 -0
  235. package/dist/components/ui-parts/UIAvatar.d.ts +1 -0
  236. package/dist/components/ui-parts/UIAvatar.en.d.ts +1 -0
  237. package/dist/components/ui-parts/UIContent.d.ts +1 -0
  238. package/dist/components/ui-parts/UIContent.en.d.ts +1 -0
  239. package/dist/components/ui-parts/UIDate.d.ts +1 -0
  240. package/dist/components/ui-parts/UIDate.en.d.ts +1 -0
  241. package/dist/components/ui-parts/UIDescription.d.ts +1 -0
  242. package/dist/components/ui-parts/UIDescription.en.d.ts +1 -0
  243. package/dist/components/ui-parts/UIDetail.d.ts +1 -0
  244. package/dist/components/ui-parts/UIDetail.en.d.ts +1 -0
  245. package/dist/components/ui-parts/UIExtra.d.ts +1 -0
  246. package/dist/components/ui-parts/UIExtra.en.d.ts +1 -0
  247. package/dist/components/ui-parts/UIHeader.d.ts +3 -1
  248. package/dist/components/ui-parts/UIHeader.en.d.ts +3 -1
  249. package/dist/components/ui-parts/UIMeta.d.ts +1 -0
  250. package/dist/components/ui-parts/UIMeta.en.d.ts +1 -0
  251. package/dist/components/ui-parts/UIParts.types.d.ts +15 -1
  252. package/dist/components/ui-parts/UISummary.d.ts +1 -0
  253. package/dist/components/ui-parts/UISummary.en.d.ts +1 -0
  254. package/dist/components/ui-parts/UITitle.d.ts +1 -0
  255. package/dist/components/ui-parts/UITitle.en.d.ts +1 -0
  256. package/dist/components/ui-parts/UIValue.d.ts +1 -0
  257. package/dist/components/ui-parts/UIValue.en.d.ts +1 -0
  258. package/dist/components/ui-placeholder/UIPlaceholder.d.ts +1 -0
  259. package/dist/components/ui-placeholder/UIPlaceholder.en.d.ts +1 -0
  260. package/dist/components/ui-placeholder/UIPlaceholderHeader.d.ts +1 -0
  261. package/dist/components/ui-placeholder/UIPlaceholderHeader.en.d.ts +1 -0
  262. package/dist/components/ui-placeholder/UIPlaceholderImage.d.ts +1 -0
  263. package/dist/components/ui-placeholder/UIPlaceholderImage.en.d.ts +1 -0
  264. package/dist/components/ui-placeholder/UIPlaceholderLine.d.ts +1 -0
  265. package/dist/components/ui-placeholder/UIPlaceholderLine.en.d.ts +1 -0
  266. package/dist/components/ui-placeholder/UIPlaceholderParagraph.d.ts +1 -0
  267. package/dist/components/ui-placeholder/UIPlaceholderParagraph.en.d.ts +1 -0
  268. package/dist/components/ui-popup/UIPopup.d.ts +30 -3
  269. package/dist/components/ui-popup/UIPopup.en.d.ts +7 -0
  270. package/dist/components/ui-popup/UIPopup.es.d.ts +1 -0
  271. package/dist/components/ui-progress/UIProgress.d.ts +2 -0
  272. package/dist/components/ui-progress/UIProgress.en.d.ts +2 -0
  273. package/dist/components/ui-progress/UIProgress.es.d.ts +1 -0
  274. package/dist/components/ui-property-editor/UIProperty.d.ts +132 -5
  275. package/dist/components/ui-property-editor/UIProperty.en.d.ts +11 -44
  276. package/dist/components/ui-property-editor/UIProperty.es.d.ts +4 -0
  277. package/dist/components/ui-property-editor/UIPropertyEditor.d.ts +38 -0
  278. package/dist/components/ui-property-editor/UIPropertyEditor.en.d.ts +1 -0
  279. package/dist/components/ui-property-editor/UIPropertyEditor.es.d.ts +4 -0
  280. package/dist/components/ui-property-editor/UIPropertyEditor.types.d.ts +33 -0
  281. package/dist/components/ui-property-editor/UIPropertyGroup.d.ts +12 -0
  282. package/dist/components/ui-property-editor/UIPropertyGroup.en.d.ts +2 -0
  283. package/dist/components/ui-property-editor/UIPropertyGroup.es.d.ts +9 -0
  284. package/dist/components/ui-property-editor/index.d.ts +1 -0
  285. package/dist/components/ui-quote/UIQuote.d.ts +1 -0
  286. package/dist/components/ui-quote/UIQuote.en.d.ts +1 -0
  287. package/dist/components/ui-rail/UIRail.d.ts +1 -0
  288. package/dist/components/ui-rail/UIRail.en.d.ts +1 -0
  289. package/dist/components/ui-rating/UIRating.d.ts +6 -0
  290. package/dist/components/ui-rating/UIRating.en.d.ts +6 -0
  291. package/dist/components/ui-rating/UIRating.fallback.d.ts +6 -0
  292. package/dist/components/ui-reveal/UIReveal.d.ts +1 -0
  293. package/dist/components/ui-reveal/UIReveal.en.d.ts +1 -0
  294. package/dist/components/ui-root/UIRoot.d.ts +18 -3
  295. package/dist/components/ui-root/UIRoot.en.d.ts +15 -0
  296. package/dist/components/ui-root/UIRoot.es.d.ts +1 -0
  297. package/dist/components/ui-search/UISearch.d.ts +48 -7
  298. package/dist/components/ui-search/UISearch.en.d.ts +13 -1
  299. package/dist/components/ui-search/UISearch.es.d.ts +1 -0
  300. package/dist/components/ui-search/UISearch.fallback.d.ts +13 -1
  301. package/dist/components/ui-section/UISection.d.ts +22 -1
  302. package/dist/components/ui-section/UISection.en.d.ts +10 -0
  303. package/dist/components/ui-section/UISection.es.d.ts +1 -0
  304. package/dist/components/ui-section/UISections.d.ts +1 -0
  305. package/dist/components/ui-section/UISections.en.d.ts +1 -0
  306. package/dist/components/ui-segment/UISegment.d.ts +2 -0
  307. package/dist/components/ui-segment/UISegment.en.d.ts +2 -0
  308. package/dist/components/ui-segment/UISegment.es.d.ts +1 -0
  309. package/dist/components/ui-segment/UISegments.d.ts +1 -0
  310. package/dist/components/ui-segment/UISegments.en.d.ts +1 -0
  311. package/dist/components/ui-select/UISelect.d.ts +6 -0
  312. package/dist/components/ui-select/UISelect.en.d.ts +6 -0
  313. package/dist/components/ui-select/UISelect.fallback.d.ts +6 -0
  314. package/dist/components/ui-shape/UIShape.d.ts +23 -2
  315. package/dist/components/ui-shape/UIShape.en.d.ts +8 -0
  316. package/dist/components/ui-shape/UIShape.es.d.ts +1 -0
  317. package/dist/components/ui-shape/UISide.d.ts +4 -0
  318. package/dist/components/ui-shape/UISide.en.d.ts +4 -0
  319. package/dist/components/ui-sidebar/UIPushable.d.ts +1 -0
  320. package/dist/components/ui-sidebar/UIPushable.en.d.ts +1 -0
  321. package/dist/components/ui-sidebar/UIPusher.d.ts +1 -0
  322. package/dist/components/ui-sidebar/UIPusher.en.d.ts +1 -0
  323. package/dist/components/ui-sidebar/UISidebar.d.ts +1 -0
  324. package/dist/components/ui-sidebar/UISidebar.en.d.ts +1 -0
  325. package/dist/components/ui-sides/UISides.d.ts +209 -0
  326. package/dist/components/ui-sides/UISides.en.d.ts +122 -0
  327. package/dist/components/ui-sides/UISides.es.d.ts +30 -0
  328. package/dist/components/ui-sides/UISides.fallback.d.ts +134 -0
  329. package/dist/components/ui-sides/index.d.ts +2 -0
  330. package/dist/components/ui-site-nav/SitePages.d.ts +53 -0
  331. package/dist/components/ui-site-nav/UISiteNav.d.ts +207 -0
  332. package/dist/components/ui-site-nav/UISiteNav.en.d.ts +87 -0
  333. package/dist/components/ui-site-nav/UISiteNav.es.d.ts +29 -0
  334. package/dist/components/ui-site-nav/index.d.ts +1 -0
  335. package/dist/components/ui-site-tabs/UISiteTabs.d.ts +126 -0
  336. package/dist/components/ui-site-tabs/UISiteTabs.en.d.ts +49 -0
  337. package/dist/components/ui-site-tabs/UISiteTabs.es.d.ts +18 -0
  338. package/dist/components/ui-site-tabs/index.d.ts +1 -0
  339. package/dist/components/ui-slider/UISlider.d.ts +7 -0
  340. package/dist/components/ui-slider/UISlider.en.d.ts +7 -0
  341. package/dist/components/ui-slider/UISlider.es.d.ts +1 -0
  342. package/dist/components/ui-slider/UISlider.fallback.d.ts +7 -0
  343. package/dist/components/ui-space/UISpace.d.ts +1 -0
  344. package/dist/components/ui-space/UISpace.en.d.ts +1 -0
  345. package/dist/components/ui-split-panel/UISplitPanel.d.ts +175 -0
  346. package/dist/components/ui-split-panel/UISplitPanel.en.d.ts +74 -0
  347. package/dist/components/ui-split-panel/UISplitPanel.es.d.ts +25 -0
  348. package/dist/components/ui-split-panel/index.d.ts +2 -0
  349. package/dist/components/ui-stack/UIStack.d.ts +31 -5
  350. package/dist/components/ui-stack/UIStack.en.d.ts +15 -3
  351. package/dist/components/ui-statistic/UIStatistic.d.ts +1 -0
  352. package/dist/components/ui-statistic/UIStatistic.en.d.ts +1 -0
  353. package/dist/components/ui-statistic/UIStatistics.d.ts +1 -0
  354. package/dist/components/ui-statistic/UIStatistics.en.d.ts +1 -0
  355. package/dist/components/ui-step/UIStep.d.ts +1 -0
  356. package/dist/components/ui-step/UIStep.en.d.ts +1 -0
  357. package/dist/components/ui-step/UISteps.d.ts +1 -0
  358. package/dist/components/ui-step/UISteps.en.d.ts +1 -0
  359. package/dist/components/ui-sticky/UISticky.d.ts +4 -0
  360. package/dist/components/ui-sticky/UISticky.en.d.ts +1 -0
  361. package/dist/components/ui-tab/UITab.d.ts +8 -0
  362. package/dist/components/ui-tab/UITab.en.d.ts +1 -0
  363. package/dist/components/ui-tab/UITabs.d.ts +107 -16
  364. package/dist/components/ui-tab/UITabs.en.d.ts +40 -1
  365. package/dist/components/ui-tab/UITabs.es.d.ts +4 -0
  366. package/dist/components/ui-table/TableEditing.d.ts +77 -0
  367. package/dist/components/ui-table/UICell.d.ts +1 -0
  368. package/dist/components/ui-table/UICell.en.d.ts +1 -0
  369. package/dist/components/ui-table/UITable.d.ts +145 -5
  370. package/dist/components/ui-table/UITable.en.d.ts +19 -0
  371. package/dist/components/ui-table/UITable.es.d.ts +3 -0
  372. package/dist/components/ui-terms/UITerm.d.ts +1 -0
  373. package/dist/components/ui-terms/UITerm.en.d.ts +1 -0
  374. package/dist/components/ui-terms/UITerms.d.ts +1 -0
  375. package/dist/components/ui-terms/UITerms.en.d.ts +1 -0
  376. package/dist/components/ui-text/UILink.d.ts +11 -0
  377. package/dist/components/ui-text/UILink.en.d.ts +4 -0
  378. package/dist/components/ui-text/UIText.d.ts +7 -0
  379. package/dist/components/ui-text/UIText.en.d.ts +7 -0
  380. package/dist/components/ui-text/UIText.es.d.ts +2 -0
  381. package/dist/components/ui-theme-editor/SavedTheme.d.ts +55 -43
  382. package/dist/components/ui-theme-editor/ThemeDraft.d.ts +15 -0
  383. package/dist/components/ui-theme-editor/UIColorChip.d.ts +1 -0
  384. package/dist/components/ui-theme-editor/UIColorChip.en.d.ts +1 -0
  385. package/dist/components/ui-theme-editor/UIThemeEditor.d.ts +157 -26
  386. package/dist/components/ui-theme-editor/UIThemeEditor.en.d.ts +79 -6
  387. package/dist/components/ui-theme-editor/UIThemeEditor.es.d.ts +20 -2
  388. package/dist/components/ui-theme-editor/UIThemeEditor.types.d.ts +0 -2
  389. package/dist/components/ui-theme-editor/UIThemeToken.d.ts +1 -0
  390. package/dist/components/ui-theme-editor/UIThemeToken.en.d.ts +1 -0
  391. package/dist/components/ui-theme-menu/HueDropdown.d.ts +47 -0
  392. package/dist/components/ui-theme-menu/ThemeMenu.d.ts +18 -7
  393. package/dist/components/ui-theme-menu/ThemePreference.d.ts +145 -36
  394. package/dist/components/ui-theme-menu/UIThemeMenu.d.ts +118 -7
  395. package/dist/components/ui-theme-menu/UIThemeMenu.en.d.ts +82 -2
  396. package/dist/components/ui-theme-menu/UIThemeMenu.es.d.ts +21 -1
  397. package/dist/components/ui-theme-menu/UIThemeMenu.types.d.ts +36 -8
  398. package/dist/components/ui-theme-menu/index.d.ts +2 -1
  399. package/dist/components/ui-toast/UIToast.d.ts +1 -0
  400. package/dist/components/ui-toast/UIToast.en.d.ts +1 -0
  401. package/dist/components/ui-toc/UIToc.d.ts +1 -0
  402. package/dist/components/ui-toc/UIToc.en.d.ts +1 -0
  403. package/dist/components/ui-toolbar/UIToolbar.d.ts +13 -10
  404. package/dist/components/ui-toolbar/UIToolbar.en.d.ts +138 -84
  405. package/dist/components/ui-toolbar/UIToolbar.es.d.ts +2 -0
  406. package/dist/components/ui-transition/UITransition.d.ts +1 -0
  407. package/dist/components/ui-transition/UITransition.en.d.ts +1 -0
  408. package/dist/components/ui-tree/UITree.d.ts +162 -0
  409. package/dist/components/ui-tree/UITree.en.d.ts +88 -0
  410. package/dist/components/ui-tree/UITree.es.d.ts +35 -0
  411. package/dist/components/ui-tree/UITreeItem.d.ts +204 -0
  412. package/dist/components/ui-tree/UITreeItem.en.d.ts +142 -0
  413. package/dist/components/ui-tree/UITreeItem.es.d.ts +32 -0
  414. package/dist/components/ui-tree/index.d.ts +3 -0
  415. package/dist/components/ui-tree-diagram/TreeData.d.ts +3 -12
  416. package/dist/components/ui-tree-diagram/TreeLayout.d.ts +54 -21
  417. package/dist/components/ui-tree-diagram/TreeMeasure.d.ts +36 -0
  418. package/dist/components/ui-tree-diagram/UITreeDiagram.d.ts +152 -27
  419. package/dist/components/ui-tree-diagram/UITreeDiagram.en.d.ts +47 -7
  420. package/dist/components/ui-tree-diagram/UITreeDiagram.es.d.ts +12 -1
  421. package/dist/components/ui-tree-diagram/UITreeDiagram.types.d.ts +66 -21
  422. package/dist/components/ui-tree-diagram/UITreeNode.d.ts +148 -0
  423. package/dist/components/ui-tree-diagram/UITreeNode.en.d.ts +69 -0
  424. package/dist/components/ui-tree-diagram/UITreeNode.es.d.ts +21 -0
  425. package/dist/components/ui-tree-diagram/index.d.ts +4 -2
  426. package/dist/components/ui-video/UIAudio.d.ts +1 -0
  427. package/dist/components/ui-video/UIAudio.en.d.ts +1 -0
  428. package/dist/components/ui-video/UIVideo.d.ts +1 -0
  429. package/dist/components/ui-video/UIVideo.en.d.ts +1 -0
  430. package/dist/components/ui-visibility/UIVisibility.d.ts +1 -0
  431. package/dist/components/ui-visibility/UIVisibility.en.d.ts +1 -0
  432. package/dist/components/ui-zoom/UIZoom.d.ts +1 -0
  433. package/dist/components/ui-zoom/UIZoom.en.d.ts +1 -0
  434. package/dist/{components.es-DmLzT-Bq.js → components.es-BOa_7gFF.js} +498 -109
  435. package/dist/components.es-BOa_7gFF.js.map +1 -0
  436. package/dist/core.d.ts +3 -1
  437. package/dist/core.js +1082 -511
  438. package/dist/core.js.map +1 -1
  439. package/dist/crisp-VfYZlTph.js +6 -0
  440. package/dist/{crisp-CoZRRDuQ.js.map → crisp-VfYZlTph.js.map} +1 -1
  441. package/dist/docs-components/index.d.ts +1 -0
  442. package/dist/docs-components/ui-docs-index/UIDocsIndex.d.ts +89 -0
  443. package/dist/docs-components/ui-docs-index/UIDocsIndex.en.d.ts +43 -0
  444. package/dist/docs-components/ui-docs-index/index.d.ts +2 -0
  445. package/dist/docs-components/ui-docs-nav/UIDocsNav.d.ts +54 -87
  446. package/dist/docs-components/ui-docs-nav/UIDocsNav.types.d.ts +2 -29
  447. package/dist/docs-components/ui-docs-search/SearchIndex.d.ts +8 -2
  448. package/dist/docs-components/ui-docs-search/UIDocsSearch.d.ts +10 -0
  449. package/dist/docs-components/ui-docs-search/UIDocsSearch.en.d.ts +5 -0
  450. package/dist/elements/AddressParameter.d.ts +87 -0
  451. package/dist/elements/DOMFormControl.d.ts +5 -0
  452. package/dist/elements/FormComponent.d.ts +32 -0
  453. package/dist/elements/LoadableBody.d.ts +6 -1
  454. package/dist/elements/LoadableComponent.d.ts +10 -1
  455. package/dist/elements/RootSettings.d.ts +43 -6
  456. package/dist/elements/SpellUISettings.d.ts +1 -0
  457. package/dist/elements/StickyWatch.d.ts +20 -0
  458. package/dist/elements/elements.types.d.ts +15 -0
  459. package/dist/elements/index.d.ts +2 -0
  460. package/dist/forms.js +93 -63
  461. package/dist/forms.js.map +1 -1
  462. package/dist/fruity-BRVlgJZd.js +6 -0
  463. package/dist/fruity-BRVlgJZd.js.map +1 -0
  464. package/dist/{fruity.theme-BJcMiPl1.js → fruity.theme-CbC7Jyvk.js} +2 -2
  465. package/dist/fruity.theme-CbC7Jyvk.js.map +1 -0
  466. package/dist/glass-x9tbbwVq.js +6 -0
  467. package/dist/glass-x9tbbwVq.js.map +1 -0
  468. package/dist/glass.theme-24wY2wH9.js +6 -0
  469. package/dist/glass.theme-24wY2wH9.js.map +1 -0
  470. package/dist/hot.js +530 -24
  471. package/dist/hot.js.map +1 -1
  472. package/dist/index.d.ts +8 -0
  473. package/dist/index.js +91 -81
  474. package/dist/jsx.d.ts +21149 -10377
  475. package/dist/matrix-QY2gWbJ0.js +6 -0
  476. package/dist/{matrix-CqA59hiF.js.map → matrix-QY2gWbJ0.js.map} +1 -1
  477. package/dist/{matrix.theme-jqQZjcq3.js → matrix.theme-_8xtwhDq.js} +2 -2
  478. package/dist/matrix.theme-_8xtwhDq.js.map +1 -0
  479. package/dist/midnight-BxlTQSfw.js +6 -0
  480. package/dist/{midnight-BnoVOrhC.js.map → midnight-BxlTQSfw.js.map} +1 -1
  481. package/dist/mockup-83ELBuVr.js +6 -0
  482. package/dist/mockup-83ELBuVr.js.map +1 -0
  483. package/dist/mockup.theme-DmpBgGBl.js +6 -0
  484. package/dist/mockup.theme-DmpBgGBl.js.map +1 -0
  485. package/dist/paper-M61nUilz.js +6 -0
  486. package/dist/{paper-CynH8ZuT.js.map → paper-M61nUilz.js.map} +1 -1
  487. package/dist/persist.types-D2m6wD-S.js +9 -0
  488. package/dist/persist.types-D2m6wD-S.js.map +1 -0
  489. package/dist/pop-CxXfytjk.js +6 -0
  490. package/dist/{pop-D2i9V_rG.js.map → pop-CxXfytjk.js.map} +1 -1
  491. package/dist/runtime/DataTooltips.d.ts +75 -0
  492. package/dist/runtime/PropertyControls.d.ts +15 -1
  493. package/dist/runtime/Sources.d.ts +16 -4
  494. package/dist/runtime/Styles.d.ts +11 -0
  495. package/dist/runtime/Themes.d.ts +10 -4
  496. package/dist/runtime/UIRuntime.d.ts +4 -1
  497. package/dist/runtime/index.d.ts +1 -1
  498. package/dist/runtime/runtime.types.d.ts +18 -85
  499. package/dist/spell-By5Y3jKP.js +6 -0
  500. package/dist/{spell-BFtLICm7.js.map → spell-By5Y3jKP.js.map} +1 -1
  501. package/dist/{spell.theme-B7AU7SQX.js → spell.theme-DxGj7qHx.js} +2 -2
  502. package/dist/spell.theme-DxGj7qHx.js.map +1 -0
  503. package/dist/styles/CodeThemeFile.d.ts +73 -0
  504. package/dist/styles/StyleGenerator.d.ts +6 -0
  505. package/dist/styles/styles.en.d.ts +141 -3
  506. package/dist/styles/styles.types.d.ts +2 -0
  507. package/dist/{styles.en-RLpYiO5_.js → styles.en-CUUxNwHo.js} +71 -14
  508. package/dist/styles.en-CUUxNwHo.js.map +1 -0
  509. package/dist/styles.js +13 -13
  510. package/dist/styles.js.map +1 -1
  511. package/dist/ui-accordion.js +54 -53
  512. package/dist/ui-accordion.js.map +1 -1
  513. package/dist/ui-action.js +20 -19
  514. package/dist/ui-action.js.map +1 -1
  515. package/dist/ui-ad.js +5 -4
  516. package/dist/ui-ad.js.map +1 -1
  517. package/dist/ui-breadcrumbs.js +15 -13
  518. package/dist/ui-breadcrumbs.js.map +1 -1
  519. package/dist/ui-button.js +132 -125
  520. package/dist/ui-button.js.map +1 -1
  521. package/dist/ui-calendar.js +208 -206
  522. package/dist/ui-calendar.js.map +1 -1
  523. package/dist/ui-card.js +260 -98
  524. package/dist/ui-card.js.map +1 -1
  525. package/dist/ui-checkbox.js +95 -81
  526. package/dist/ui-checkbox.js.map +1 -1
  527. package/dist/ui-code.js +25 -24
  528. package/dist/ui-code.js.map +1 -1
  529. package/dist/ui-comment.js +14 -12
  530. package/dist/ui-comment.js.map +1 -1
  531. package/dist/ui-components.js +7 -6
  532. package/dist/ui-components.js.map +1 -1
  533. package/dist/ui-container.js +24 -12
  534. package/dist/ui-container.js.map +1 -1
  535. package/dist/ui-diagram.js +1328 -0
  536. package/dist/ui-diagram.js.map +1 -0
  537. package/dist/ui-dimension.js +779 -0
  538. package/dist/ui-dimension.js.map +1 -0
  539. package/dist/ui-dimmer.js +36 -34
  540. package/dist/ui-dimmer.js.map +1 -1
  541. package/dist/ui-divider.js +7 -5
  542. package/dist/ui-divider.js.map +1 -1
  543. package/dist/ui-dropdown.js +107 -105
  544. package/dist/ui-dropdown.js.map +1 -1
  545. package/dist/ui-embed.js +36 -35
  546. package/dist/ui-embed.js.map +1 -1
  547. package/dist/ui-emoji.js +10 -9
  548. package/dist/ui-emoji.js.map +1 -1
  549. package/dist/ui-example.js +63 -61
  550. package/dist/ui-example.js.map +1 -1
  551. package/dist/ui-feed.js +12 -10
  552. package/dist/ui-feed.js.map +1 -1
  553. package/dist/ui-flag.js +10 -9
  554. package/dist/ui-flag.js.map +1 -1
  555. package/dist/ui-flyout.js +7 -6
  556. package/dist/ui-flyout.js.map +1 -1
  557. package/dist/ui-form.js +244 -162
  558. package/dist/ui-form.js.map +1 -1
  559. package/dist/ui-grid.js +21 -18
  560. package/dist/ui-grid.js.map +1 -1
  561. package/dist/ui-icon-picker.js +46 -44
  562. package/dist/ui-icon-picker.js.map +1 -1
  563. package/dist/ui-icon.js +17 -14
  564. package/dist/ui-icon.js.map +1 -1
  565. package/dist/ui-image.js +93 -55
  566. package/dist/ui-image.js.map +1 -1
  567. package/dist/ui-include.js +18 -17
  568. package/dist/ui-include.js.map +1 -1
  569. package/dist/ui-input.js +154 -112
  570. package/dist/ui-input.js.map +1 -1
  571. package/dist/ui-item.js +152 -102
  572. package/dist/ui-item.js.map +1 -1
  573. package/dist/ui-items.js +9 -8
  574. package/dist/ui-items.js.map +1 -1
  575. package/dist/ui-json.js +115 -0
  576. package/dist/ui-json.js.map +1 -0
  577. package/dist/ui-keys.js +1 -1
  578. package/dist/ui-label.js +18 -15
  579. package/dist/ui-label.js.map +1 -1
  580. package/dist/ui-list.js +7 -5
  581. package/dist/ui-list.js.map +1 -1
  582. package/dist/ui-loader.js +7 -6
  583. package/dist/ui-loader.js.map +1 -1
  584. package/dist/ui-markdown.js +975 -83
  585. package/dist/ui-markdown.js.map +1 -1
  586. package/dist/ui-menu.js +329 -196
  587. package/dist/ui-menu.js.map +1 -1
  588. package/dist/ui-message.js +20 -18
  589. package/dist/ui-message.js.map +1 -1
  590. package/dist/ui-modal.js +46 -45
  591. package/dist/ui-modal.js.map +1 -1
  592. package/dist/ui-nag.js +19 -18
  593. package/dist/ui-nag.js.map +1 -1
  594. package/dist/ui-page.js +8 -7
  595. package/dist/ui-page.js.map +1 -1
  596. package/dist/ui-panel.js +28 -17
  597. package/dist/ui-panel.js.map +1 -1
  598. package/dist/ui-parts.js +66 -52
  599. package/dist/ui-parts.js.map +1 -1
  600. package/dist/ui-placeholder.js +21 -16
  601. package/dist/ui-placeholder.js.map +1 -1
  602. package/dist/ui-popup.js +113 -84
  603. package/dist/ui-popup.js.map +1 -1
  604. package/dist/ui-progress.js +9 -7
  605. package/dist/ui-progress.js.map +1 -1
  606. package/dist/ui-property-editor.js +706 -203
  607. package/dist/ui-property-editor.js.map +1 -1
  608. package/dist/ui-quote.js +5 -4
  609. package/dist/ui-quote.js.map +1 -1
  610. package/dist/ui-rail.js +5 -4
  611. package/dist/ui-rail.js.map +1 -1
  612. package/dist/ui-rating.js +31 -29
  613. package/dist/ui-rating.js.map +1 -1
  614. package/dist/ui-reveal.js +7 -6
  615. package/dist/ui-reveal.js.map +1 -1
  616. package/dist/ui-root.js +324 -158
  617. package/dist/ui-root.js.map +1 -1
  618. package/dist/ui-search.js +210 -168
  619. package/dist/ui-search.js.map +1 -1
  620. package/dist/ui-section.js +124 -92
  621. package/dist/ui-section.js.map +1 -1
  622. package/dist/ui-segment.js +15 -12
  623. package/dist/ui-segment.js.map +1 -1
  624. package/dist/ui-select.js +83 -81
  625. package/dist/ui-select.js.map +1 -1
  626. package/dist/ui-shape.js +86 -58
  627. package/dist/ui-shape.js.map +1 -1
  628. package/dist/ui-sidebar.js +59 -56
  629. package/dist/ui-sidebar.js.map +1 -1
  630. package/dist/ui-sides.js +325 -0
  631. package/dist/ui-sides.js.map +1 -0
  632. package/dist/ui-site-nav.js +329 -0
  633. package/dist/ui-site-nav.js.map +1 -0
  634. package/dist/ui-site-tabs.js +177 -0
  635. package/dist/ui-site-tabs.js.map +1 -0
  636. package/dist/ui-slider.js +84 -81
  637. package/dist/ui-slider.js.map +1 -1
  638. package/dist/ui-space.js +7 -6
  639. package/dist/ui-space.js.map +1 -1
  640. package/dist/ui-split-panel.js +298 -0
  641. package/dist/ui-split-panel.js.map +1 -0
  642. package/dist/ui-stack.js +47 -23
  643. package/dist/ui-stack.js.map +1 -1
  644. package/dist/ui-statistic.js +15 -13
  645. package/dist/ui-statistic.js.map +1 -1
  646. package/dist/ui-step.js +31 -29
  647. package/dist/ui-step.js.map +1 -1
  648. package/dist/ui-sticky.js +7 -6
  649. package/dist/ui-sticky.js.map +1 -1
  650. package/dist/ui-tab.js +230 -138
  651. package/dist/ui-tab.js.map +1 -1
  652. package/dist/ui-table.js +724 -162
  653. package/dist/ui-table.js.map +1 -1
  654. package/dist/ui-terms.js +12 -10
  655. package/dist/ui-terms.js.map +1 -1
  656. package/dist/ui-text.js +53 -28
  657. package/dist/ui-text.js.map +1 -1
  658. package/dist/ui-theme-editor.js +1018 -1545
  659. package/dist/ui-theme-editor.js.map +1 -1
  660. package/dist/ui-theme-menu-CuIjr8Ou.js +1493 -0
  661. package/dist/ui-theme-menu-CuIjr8Ou.js.map +1 -0
  662. package/dist/ui-toast.js +45 -44
  663. package/dist/ui-toast.js.map +1 -1
  664. package/dist/ui-toc.js +75 -74
  665. package/dist/ui-toc.js.map +1 -1
  666. package/dist/ui-toolbar.js +51 -73
  667. package/dist/ui-toolbar.js.map +1 -1
  668. package/dist/ui-transition.js +12 -11
  669. package/dist/ui-transition.js.map +1 -1
  670. package/dist/ui-tree-diagram.js +676 -197
  671. package/dist/ui-tree-diagram.js.map +1 -1
  672. package/dist/ui-tree.js +625 -0
  673. package/dist/ui-tree.js.map +1 -0
  674. package/dist/ui-video.js +13 -11
  675. package/dist/ui-video.js.map +1 -1
  676. package/dist/ui-visibility.js +26 -25
  677. package/dist/ui-visibility.js.map +1 -1
  678. package/dist/ui-zoom.js +79 -78
  679. package/dist/ui-zoom.js.map +1 -1
  680. package/dist/util/TopLayerTip.d.ts +28 -0
  681. package/dist/util/index.d.ts +5 -2
  682. package/dist/vocabulary/DefaultValues.d.ts +34 -0
  683. package/dist/vocabulary/SharedVocabulary.d.ts +4 -0
  684. package/dist/vocabulary/SharedVocabulary.es.d.ts +7 -0
  685. package/dist/vocabulary/ValueSets.d.ts +18 -0
  686. package/dist/vocabulary/Vocabulary.d.ts +1 -0
  687. package/dist/vocabulary/defaults.generated.d.ts +6 -0
  688. package/dist/vocabulary/index.d.ts +1 -0
  689. package/package.json +1 -1
  690. package/dist/MarkdownEngine-CbuT9Mjc.js.map +0 -1
  691. package/dist/PrefStore-CeaTtjTz.js.map +0 -1
  692. package/dist/UIButton-XkfGqgh6.js +0 -6
  693. package/dist/UIButton-XkfGqgh6.js.map +0 -1
  694. package/dist/UIInput-BUudZstW.js +0 -6
  695. package/dist/UIInput-BUudZstW.js.map +0 -1
  696. package/dist/UIKeys-DJF2TIKE.js.map +0 -1
  697. package/dist/UILabel-C1jy3Yl8.js +0 -6
  698. package/dist/UILabel-C1jy3Yl8.js.map +0 -1
  699. package/dist/UIMenu-Btd-8V3A.js +0 -42
  700. package/dist/UIMenu-Btd-8V3A.js.map +0 -1
  701. package/dist/UIRuntime-BBuehGly.js.map +0 -1
  702. package/dist/components.es-DmLzT-Bq.js.map +0 -1
  703. package/dist/crisp-CoZRRDuQ.js +0 -6
  704. package/dist/fruity-CQFYeRlh.js +0 -6
  705. package/dist/fruity-CQFYeRlh.js.map +0 -1
  706. package/dist/fruity.theme-BJcMiPl1.js.map +0 -1
  707. package/dist/glass-CAfW11kL.js +0 -6
  708. package/dist/glass-CAfW11kL.js.map +0 -1
  709. package/dist/glass.theme-DQcBbtCW.js +0 -6
  710. package/dist/glass.theme-DQcBbtCW.js.map +0 -1
  711. package/dist/matrix-CqA59hiF.js +0 -6
  712. package/dist/matrix.theme-jqQZjcq3.js.map +0 -1
  713. package/dist/midnight-BnoVOrhC.js +0 -6
  714. package/dist/paper-CynH8ZuT.js +0 -6
  715. package/dist/persist.types-CsZxS8TG.js +0 -9
  716. package/dist/persist.types-CsZxS8TG.js.map +0 -1
  717. package/dist/pop-D2i9V_rG.js +0 -6
  718. package/dist/spell-BFtLICm7.js +0 -6
  719. package/dist/spell.theme-B7AU7SQX.js.map +0 -1
  720. package/dist/styles.en-RLpYiO5_.js.map +0 -1
  721. package/dist/ui-theme-menu-DyKZygpV.js +0 -921
  722. package/dist/ui-theme-menu-DyKZygpV.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ui-dropdown.js","names":["_vocabulary_dec","_a","_init","E.NativeFallback","E.proto","__name","this","<Show when={this.multiple}>\n <For each={this.chosenValues}>{(value) => this.chip(value)}</For>\n </Show>","<For each={this.chosenValues}>{(value) => this.chip(value)}</For>","<div class={this.rootClass} style={this.popover.anchorStyle} onClick={this.onRootClick}>\n <Show when={this.multiple}>\n <For each={this.chosenValues}>{(value) => this.chip(value)}</For>\n </Show>\n <Show when={this.search} fallback={this.trigger()}>\n {this.searchInput()}\n <Show when={this.multiple}>\n <span class={SIZER} aria-hidden=\"true\">\n {this.query}\n </span>\n </Show>\n </Show>\n <Show when={this.labeled && this.icon}>{this.labeledIcon()}</Show>\n <span\n id={this.ids.text}\n class={[UIT.TEXT, { [DEFAULT]: this.placeholderIsShowing, [FILTERED]: !!this.effectiveQuery }]}\n part={this.partForName(\"text\")}\n >\n <slot name={this.slotForName(\"trigger\")}>{this.displayText}</slot>\n </span>\n <Show when={this.clearable && this.chosenValues.length && !this.readonly}>\n <button\n type=\"button\"\n class={CLEAR_ICON}\n part={this.partForName(\"clear\")}\n aria-label={this.translationForKey(\"clear\")}\n onClick={this.onClear}\n />\n </Show>\n <span class={CARET_ICON} part={this.partForName(\"icon\")}>\n <Show when={this.slots.hasContent(this.slotForName(\"icon\"))}>\n <slot name={this.slotForName(\"icon\")} />\n </Show>\n </span>\n {this.listbox()}\n {isServer ? this.staticValues() : <slot hidden />}\n </div>","<Show when={this.search} fallback={this.trigger()}>\n {this.searchInput()}\n <Show when={this.multiple}>\n <span class={SIZER} aria-hidden=\"true\">\n {this.query}\n </span>\n </Show>\n </Show>","this.searchInput()","<Show when={this.multiple}>\n <span class={SIZER} aria-hidden=\"true\">\n {this.query}\n </span>\n </Show>","<span class={SIZER} aria-hidden=\"true\">\n {this.query}\n </span>","<Show when={this.labeled && this.icon}>{this.labeledIcon()}</Show>","this.labeled && this.icon","<Show when={this.clearable && this.chosenValues.length && !this.readonly}>\n <button\n type=\"button\"\n class={CLEAR_ICON}\n part={this.partForName(\"clear\")}\n aria-label={this.translationForKey(\"clear\")}\n onClick={this.onClear}\n />\n </Show>","this.clearable && this.chosenValues.length && !this.readonly","part={this.partForName(\"clear\")}","aria-label={this.translationForKey(\"clear\")}","<button\n type=\"button\"\n class={CLEAR_ICON}\n part={this.partForName(\"clear\")}\n aria-label={this.translationForKey(\"clear\")}\n onClick={this.onClear}\n />","<Show when={this.slots.hasContent(this.slotForName(\"icon\"))}>\n <slot name={this.slotForName(\"icon\")} />\n </Show>","<slot name={this.slotForName(\"icon\")} />","style={this.popover.anchorStyle}","id={this.ids.text}","class={[UIT.TEXT, { [DEFAULT]: this.placeholderIsShowing, [FILTERED]: !!this.effectiveQuery }]}","part={this.partForName(\"text\")}","name={this.slotForName(\"trigger\")}","class={CARET_ICON}","part={this.partForName(\"icon\")}","type=\"button\"","class={TRIGGER}","ref={(element) => this.combobox = element}","<button\n ref={(element) => this.combobox = element}\n type=\"button\"\n class={TRIGGER}\n part={this.partForName(\"trigger\")}\n disabled={this.isDisabled}\n {...this.comboboxAttributes}\n onClick={this.onTriggerClick}\n onKeyDown={this.onKeyDown}\n onBlur={this.onBlur}\n />","class={SEARCH}","autocomplete=\"off\"","<input\n ref={(element) => this.combobox = element}\n class={SEARCH}\n part={this.partForName(\"search\")}\n autocomplete=\"off\"\n aria-autocomplete=\"list\"\n disabled={this.isDisabled}\n readonly={this.readonly}\n value={this.query}\n {...this.comboboxAttributes}\n onInput={this.onInput}\n onClick={this.onTriggerClick}\n onKeyDown={this.onKeyDown}\n onBlur={this.onBlur}\n />","<span class={CHIP} part={this.partForName(\"label\")}>\n {this.textFor(value)}\n <Show when={!this.readonly && !this.isDisabled}>\n <button\n type=\"button\"\n class={DELETE_ICON}\n tabindex=\"-1\"\n aria-label={this.translationForKey(\"removeValue\", { value: this.textFor(value) })}\n onClick={(event) => this.remove(value, event)}\n />\n </Show>\n </span>","<Show when={!this.readonly && !this.isDisabled}>\n <button\n type=\"button\"\n class={DELETE_ICON}\n tabindex=\"-1\"\n aria-label={this.translationForKey(\"removeValue\", { value: this.textFor(value) })}\n onClick={(event) => this.remove(value, event)}\n />\n </Show>","!this.readonly && !this.isDisabled","aria-label={this.translationForKey(\"removeValue\", { value: this.textFor(value) })}","<button\n type=\"button\"\n class={DELETE_ICON}\n tabindex=\"-1\"\n aria-label={this.translationForKey(\"removeValue\", { value: this.textFor(value) })}\n onClick={(event) => this.remove(value, event)}\n />","part={this.partForName(\"label\")}","ref={(element) => void _UIDropdown.fillIcon(element, name)}","<span class={UIT.ICON} ref={(element) => void _UIDropdown.fillIcon(element, name)} />","<Show when={this.name}>\n {(name) => <For each={this.chosenValues}>\n {(value) => <input type=\"hidden\" name={name()} value={value} disabled={this.isDisabled} />}\n </For>}\n </Show>","<For each={this.chosenValues}>\n {(value) => <input type=\"hidden\" name={name()} value={value} disabled={this.isDisabled} />}\n </For>","disabled={this.isDisabled}","ref={(element) => this.menu = element}","<Show when={this.isOpen || this.isSimple || isServer}>\n <For each={this.menuRows}>{(row) => this.row(row)}</For>\n <Show when={!this.visibleOptions.length}>\n {\n /* an option (disabled) rather than a bare div: a listbox must own options (axe `aria-required-children`) */\n }\n <div class={UIT.MESSAGE} role=\"option\" aria-disabled=\"true\" aria-selected=\"false\">\n {this.noResultsText ?? this.translationForKey(\"noResults\")}\n </div>\n </Show>\n </Show>","<For each={this.menuRows}>{(row) => this.row(row)}</For>","<Show when={!this.visibleOptions.length}>\n {\n /* an option (disabled) rather than a bare div: a listbox must own options (axe `aria-required-children`) */\n }\n <div class={UIT.MESSAGE} role=\"option\" aria-disabled=\"true\" aria-selected=\"false\">\n {this.noResultsText ?? this.translationForKey(\"noResults\")}\n </div>\n </Show>","<div class={UIT.MESSAGE} role=\"option\" aria-disabled=\"true\" aria-selected=\"false\">\n {this.noResultsText ?? this.translationForKey(\"noResults\")}\n </div>","class={[MENU, { [UIT.LEFT]: this.opensLeft }]}","style={this.popover.panelStyle}","popover={this.isSimple || isServer && this.isOpen ? void 0 : \"manual\"}","part={this.partForName(\"menu\")}","aria-label={this.accessibleName}","aria-multiselectable={this.multiple ? \"true\" : void 0}","name={this.slotForName(\"header\")}","<div\n ref={(element) => this.menu = element}\n id={this.ids.menu}\n class={[MENU, { [UIT.LEFT]: this.opensLeft }]}\n style={this.popover.panelStyle}\n role=\"listbox\"\n popover={this.isSimple || isServer && this.isOpen ? void 0 : \"manual\"}\n part={this.partForName(\"menu\")}\n aria-label={this.accessibleName}\n aria-multiselectable={this.multiple ? \"true\" : void 0}\n onMouseDown={_UIDropdown.preventDefault}\n >\n <slot name={this.slotForName(\"header\")} />\n {\n /* a server render's rows: the text is in the page, the menu stays closed */\n }\n <Show when={this.isOpen || this.isSimple || isServer}>\n <For each={this.menuRows}>{(row) => this.row(row)}</For>\n <Show when={!this.visibleOptions.length}>\n {\n /* an option (disabled) rather than a bare div: a listbox must own options (axe `aria-required-children`) */\n }\n <div class={UIT.MESSAGE} role=\"option\" aria-disabled=\"true\" aria-selected=\"false\">\n {this.noResultsText ?? this.translationForKey(\"noResults\")}\n </div>\n </Show>\n </Show>\n </div>","<Show when={slot} fallback={this.optionContent(option)}>\n <slot name={slot} />\n </Show>","when={slot}","<slot name={slot} />","class={[\n UIT.ITEM,\n {\n [UIT.ACTIVE]: this.chosenValueSet.has(option.value),\n [UIT.SELECTED]: this.highlightedOption === option,\n [UIT.DISABLED]: !!option.disabled\n }\n ]}","part={this.partForName(\"item\")}","aria-selected={this.chosenValueSet.has(option.value) ? \"true\" : \"false\"}","aria-disabled={option.disabled ? \"true\" : void 0}","<div\n id={this.idFor(option)}\n class={[\n UIT.ITEM,\n {\n [UIT.ACTIVE]: this.chosenValueSet.has(option.value),\n [UIT.SELECTED]: this.highlightedOption === option,\n [UIT.DISABLED]: !!option.disabled\n }\n ]}\n role=\"option\"\n part={this.partForName(\"item\")}\n aria-selected={this.chosenValueSet.has(option.value) ? \"true\" : \"false\"}\n aria-disabled={option.disabled ? \"true\" : void 0}\n onPointerMove={() => this.highlighted.highlight(option)}\n onClick={(event) => this.select(option, event)}\n >\n <Show when={slot} fallback={this.optionContent(option)}>\n <slot name={slot} />\n </Show>\n </div>","<Show when={typeof option.icon === \"string\"}>{this.iconBox(option.icon)}</Show>","<Show when={typeof option.image === \"string\"}>\n <img class={AVATAR_IMAGE} src={option.image} alt=\"\" />\n </Show>","src={option.image}","<img class={AVATAR_IMAGE} src={option.image} alt=\"\" />","<Show when={typeof option.flag === \"string\"}>\n <span class={FLAG}>{UIT.Flags.emojiFor(option.flag) || option.flag}</span>\n </Show>","<span class={FLAG}>{UIT.Flags.emojiFor(option.flag) || option.flag}</span>","<Show when={option.description}>\n <span class={UIT.DESCRIPTION}>{option.description}</span>\n </Show>","<span class={UIT.DESCRIPTION}>{option.description}</span>","<div\n id={this.idFor(option)}\n class={[UIT.ITEM, ADDITION, { [UIT.SELECTED]: this.highlightedOption === option }]}\n role=\"option\"\n part={this.partForName(\"item\")}\n aria-selected=\"false\"\n onPointerMove={() => this.highlighted.highlight(option)}\n onClick={(event) => this.select(option, event)}\n >\n {before}\n <b>{option.text}</b>\n {after}\n </div>","class={[UIT.ITEM, ADDITION, { [UIT.SELECTED]: this.highlightedOption === option }]}","F.FormComponent","E.proto","E.protoMerged","E.state","E.derived","E.isSameList","E.controlled","E.untracked","E.onChange","E.cssState","E.on","E.SlotContent","F.HighlightedOption","E.PopoverPanel","E.after","F.MenuOptions","_$createComponent","_$memo","_$readShallow","_$getOwner","_$setAttribute","UIT.TEXT","E.WHITESPACE","UIT.LEFT","UIT.STATIC_CONTROL","E.IconGlyph","UIT.ICON","UIT.MESSAGE","UIT.ITEM","UIT.ACTIVE","UIT.SELECTED","UIT.DISABLED","UIT.DESCRIPTION","E.markedPieces","UIT.HEADER","__name","buttonCSS","dropdownCSS","_$delegateEvents","ICON","__publicField","FormControlAttributes","HEADER","Key","__decorateElement","__decoratorMetadata","LEFT","__decoratorStart","ITEM","STATIC_CONTROL","MESSAGE","__name$1","__runInitializers","SELECTED","TEXT","DISABLED","ToggleCommands","ACTIVE","DESCRIPTION","FormControlStates","Flags","__privateAdd","UIButton_default","SlottedItems","getOwner$1","dropdownVocabulary","_degraded_dec","_vocabulary_dec$1","_a$1","_init$1","_DropdownFallback","NativeFallback","proto","domElement","isMultiple","placeholder","select","SELECT_PART","chosen","entries","picked","entry","group","option","value","CHANGE_EVENT","event","DropdownFallback","UIDropdown_default","_tmpl$","_tmpl$2","_tmpl$3","_tmpl$4","_tmpl$5","_tmpl$6","_tmpl$7","_tmpl$8","_tmpl$9","_tmpl$10","_tmpl$11","_tmpl$12","_tmpl$13","_tmpl$14","_tmpl$15","_tmpl$16","_tmpl$17","_tmpl$18","_tmpl$19","_onKeyDown_dec","_onRootClick_dec","_onTriggerClick_dec","_onCommand_dec","_onOpenChanged_dec","_onOpenedOrClosed_dec","_isOpen_dec","_onHighlightChanged_dec","_menuRows_dec","_visibleOptions_dec","_typeAhead_dec","_query_dec","_remove_dec","_select_dec","_chosenValueSet_dec","_chosenValues_dec","_value_dec","_optionsByValue_dec","_allOptions_dec","_addedOptions_dec","_typeAheadDelay_dec","_pageSize_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_addedOptions","_value","_query","_isOpen","_UIDropdown","FormComponent","protoMerged","state","derived","isSameList","controlled","untracked","onChange","cssState","on","SlotContent","HighlightedOption","PopoverPanel","open","target","query","next","id","UI","isOpen","key","visible","values","options","max","isAddition","originalEvent","item","announce","after","index","MenuOptions","shown","rows","slotted","isConnected","isReady","name","ID_PREFIX","_self$","_el$","_el$2","_el$4","_el$5","_el$6","_el$8","_el$10","_el$11","addEvent","insert","createComponent","Show","For","memo","_el$3","effect","readShallow","SIZER","_v$","_$p","_el$7","CLEAR_ICON","className","_p$","t","setAttribute","a","_el$9","isServer","_el$12","DEFAULT","FILTERED","CARET_ICON","style","o","i","n","s","h","first","WHITESPACE","SIMPLE","highlighted","_self$2","_el$13","spread","TRIGGER","ref","element","_self$3","_el$14","SEARCH","_self$4","_el$15","_el$16","_el$18","_el$17","DELETE_ICON","CHIP","_self$5","_el$19","IconGlyph","_el$20","_self$6","_el$21","_self$7","_el$22","_el$23","row","_el$24","MENU","slot","_self$8","_el$25","_el$26","_self$9","_el$27","AVATAR_IMAGE","_el$28","FLAG","_el$29","_el$30","markedPieces","piece","_el$31","before","VALUE_PLACEHOLDER","_self$10","_el$32","_el$33","_el$34","ADDITION","DIVIDER","_el$35","_el$36","action","icons","template","UIDropdown","delegateEvents"],"sources":["../src/components/ui-dropdown/UIDropdown.en.ts","../src/components/ui-dropdown/UIDropdown.fallback.ts","../src/components/ui-dropdown/UIDropdown.css?inline","../src/components/ui-dropdown/UIDropdown.tsx","../src/components/ui-dropdown/index.ts"],"sourcesContent":["/**\n * Every name `<ui-dropdown>` uses: tag, attributes (kind + allowed values), events, slots,\n * parts, states, texts. Schema: `ComponentVocabulary` (`spell/ui/vocabulary`).\n * - Class words come out through `ClassBuilder`, in Fomantic's grammar:\n * `<ui-dropdown search selection pointing=\"top left\">` => `ui search selection top left pointing dropdown`.\n * `UIDropdown.css` keys on those words.\n * - Rich data is a PROPERTY (`options`, `kind: \"json\"`); first paint never needs it --\n * slotted `<ui-item>`s or the `value` / `text` attributes carry what SSR must show.\n */\n\nimport type { ComponentVocabulary } from \"spell/ui/vocabulary\"\nimport * as UIT from \"spell/ui/components/components.types\"\n\n/****************\n * ### `<ui-dropdown>`\n * A combobox + listbox: a `<button>` or `<input>` trigger and an anchor-positioned popover menu.\n ****************/\nexport const dropdownVocabulary = {\n tag: \"ui-dropdown\",\n formControl: true,\n topics: [\"forms\", \"inputs\", \"selection\", \"menus\", \"controls\", \"basic\", \"modules\"],\n aka: [\"select\", \"combobox\", \"picker\", \"autocomplete\", \"menu button\", \"multi select\"],\n skeleton: \"inline 14 x 2.5\",\n noun: \"dropdown\",\n description: \"A dropdown lets people choose a value from a series of options.\",\n attributes: [\n {\n name: \"size\",\n group: \"appearance\",\n kind: \"size\",\n description: \"Size, `mini` ... `massive`; `medium` is the default.\"\n },\n {\n name: \"color\",\n group: \"appearance\",\n kind: \"color\",\n description: \"Hue: fills a `button` dropdown; accents a selection's focus border and labels.\"\n },\n {\n name: \"state\",\n group: \"form\",\n kind: \"valueOnly\",\n values: [\"error\", \"info\", \"success\", \"warning\"],\n description: \"Form state, tinting the box, text and menu.\"\n },\n { name: \"selection\", group: \"appearance\", kind: \"keyOnly\", description: \"Looks like a form `<select>`.\" },\n {\n name: \"search\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"Filters the options by typing; the trigger is an `<input>`.\"\n },\n { name: \"multiple\", group: \"form\", kind: \"keyOnly\", description: \"Chooses several values, shown as labels.\" },\n { name: \"inline\", group: \"layout\", kind: \"keyOnly\", description: \"Sits inside running text.\" },\n {\n name: \"floating\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"The menu floats further away, with a stronger shadow.\"\n },\n { name: \"button\", group: \"appearance\", kind: \"keyOnly\", description: \"Looks like a button (`UIButton.css`).\" },\n {\n name: \"labeled\",\n group: \"appearance\",\n kind: \"keyOnly\",\n key: \"labeled icon\",\n description: \"A labeled icon button: the `icon` in its own block, no caret. Use with `button`.\"\n },\n {\n name: \"padding\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"compact\"],\n replaces: [{ from: \"compact\", value: \"compact\" }],\n description: \"`compact`: no minimum width; the menu sizes to its items. Old name: `compact`.\"\n },\n { name: \"fluid\", group: \"layout\", kind: \"keyOnly\", description: \"Takes the full width of its container.\" },\n { name: \"scrolling\", group: \"layout\", kind: \"keyOnly\", description: \"The menu scrolls after a fixed height.\" },\n {\n name: \"appearance\",\n group: \"appearance\",\n kind: \"multiple\",\n values: [\"simple\"],\n // each word is its own class (a `multiple` without `classes` would add its key: `simple appearance`)\n classes: {},\n replaces: [{ from: \"simple\", value: \"simple\" }],\n description: \"`simple`: opens on hover / focus, with no script and no popover. Old name: `simple`.\"\n },\n { name: \"clearable\", group: \"form\", kind: \"keyOnly\", description: \"Shows a clear button while there's a value.\" },\n { name: \"disabled\", group: \"states\", kind: \"keyOnly\", description: \"Can't be used; dimmed and inert.\" },\n {\n name: \"loading\",\n group: \"states\",\n kind: \"keyOnly\",\n description: \"Busy, e.g. fetching options; the caret spins.\"\n },\n UIT.FormControlAttributes.readonly,\n {\n name: \"inverted\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"For dark backgrounds: the dark scheme's colours.\"\n },\n {\n name: \"limit\",\n group: \"appearance\",\n kind: \"valueOnly\",\n values: [\"none\"],\n classes: { none: \"unlimited\" },\n replaces: [{ from: \"unlimited\", value: \"none\" }],\n description: \"`none`: a selection menu that never scrolls. Old name: `unlimited`.\"\n },\n {\n name: \"resizable\",\n group: \"behaviour\",\n kind: \"keyOnly\",\n description: \"A `scrolling` menu people can resize vertically.\"\n },\n {\n name: \"length\",\n group: \"appearance\",\n kind: \"valueOnly\",\n values: [\"very-short\", \"short\", \"long\", \"very-long\"],\n classes: { \"very-short\": \"very short\", \"very-long\": \"very long\" },\n replaces: [\n { from: \"short\", value: \"short\" },\n { from: \"very-short\", value: \"very-short\" },\n { from: \"long\", value: \"long\" },\n { from: \"very-long\", value: \"very-long\" }\n ],\n description:\n \"A selection menu's height: `very-short` (1/2), `short` (3/4), `long` (2x), `very-long` (3x). \" +\n \"Old names: `short`, `very-short`, `long`, `very-long`.\"\n },\n {\n name: \"open\",\n group: \"states\",\n kind: \"keyOnly\",\n key: \"active\",\n description: \"The menu is open. Controlled: set it to open / close; `ui-opening` / `ui-closing` can veto.\"\n },\n {\n name: \"pointing\",\n group: \"layout\",\n kind: \"keyOrValueAndKey\",\n values: [\"top\", \"top left\", \"top right\", \"left\", \"right\", \"bottom\", \"bottom left\", \"bottom right\"],\n description:\n \"An arrow on the menu pointing at the dropdown; the value says where the menu's arrow sits \" +\n \"(`top left` => below, arrow at its top left). Pointing menus never flip.\"\n },\n {\n name: \"columnar\",\n group: \"appearance\",\n kind: \"width\",\n widthClass: \"column\",\n values: [\"2\", \"3\", \"4\", \"5\"],\n description: 'Lays the menu items out in columns: `columnar=\"3\"` => `three column`.'\n },\n {\n name: \"direction\",\n group: \"layout\",\n kind: \"multiple\",\n values: [\"up\", \"left\", \"right\"],\n // `left` / `right` are the MENU's (`.left.menu`), not the dropdown's own classes\n classes: { up: \"upward\", left: \"\", right: \"\" },\n replaces: [{ from: \"upward\", value: \"up\" }],\n description:\n \"Which way the menu opens: `up` above the dropdown (it still flips when there's no room); `left` \" +\n \"extends it leftward from the dropdown's edge, `right` (the default) rightward; `up left` both. \" +\n \"Old name: `upward`.\"\n },\n { name: \"icon\", group: \"content\", kind: \"icon\", description: \"Icon name for a `labeled` dropdown's icon block.\" },\n { ...UIT.FormControlAttributes.placeholder, description: \"Text shown while nothing is chosen.\" },\n {\n name: \"value\",\n group: \"form\",\n kind: \"string\",\n description:\n \"Chosen value. Property: `string`, or `string[]` with `multiple`; attribute: a comma / space list.\"\n },\n {\n name: \"label\",\n group: \"name\",\n kind: \"string\",\n reflect: false,\n replaces: [\"text\"],\n description:\n \"Text shown for the current value, e.g. before `options` arrive. Property only by default. \" +\n \"Old name: `text`.\"\n },\n { ...UIT.FormControlAttributes.name, description: \"Form field name; `multiple` submits one entry per value.\" },\n UIT.FormControlAttributes.required,\n {\n name: \"allow-additions\",\n group: \"form\",\n kind: \"boolean\",\n description: \"`search`: offers the query as a new option.\"\n },\n {\n name: \"min-characters\",\n group: \"form\",\n kind: \"number\",\n default: 0,\n description: \"`search`: characters to type before the menu filters.\"\n },\n {\n name: \"max-selections\",\n group: \"form\",\n kind: \"number\",\n description: \"`multiple`: the most values that can be chosen.\"\n },\n {\n name: \"no-results-text\",\n group: \"content\",\n kind: \"string\",\n description: \"Message when nothing matches; default the translated `noResults` text.\"\n },\n {\n name: \"addition-text\",\n group: \"content\",\n kind: \"string\",\n description: \"Label of the add item, with `{value}`; default the translated `addItem` text.\"\n },\n {\n name: \"options\",\n group: \"form\",\n kind: \"json\",\n reflect: false,\n description: \"Options as a PROPERTY: `MenuOption[]` (`spell/ui/elements`); added after slotted `<ui-item>`s.\"\n }\n ],\n events: [\n {\n name: \"ui-changed\",\n detail: \"{ value: string | string[], originalEvent?: Event }\",\n description: \"Someone chose, added, removed or cleared a value.\"\n },\n {\n name: \"ui-opening\",\n detail: \"{ open: true, originalEvent?: Event }\",\n cancelable: true,\n description:\n \"The menu is about to open (a person's action, an invoker command too); `preventDefault()` keeps it closed.\"\n },\n {\n name: \"ui-closing\",\n detail: \"{ open: false, originalEvent?: Event }\",\n cancelable: true,\n description: \"The menu is about to close; `preventDefault()` keeps it open.\"\n },\n {\n name: \"ui-searched\",\n detail: \"{ query: string, originalEvent?: Event }\",\n description: \"`search`: the query changed.\"\n },\n {\n name: \"ui-added\",\n detail: \"{ value: string, originalEvent?: Event }\",\n description: \"`multiple`: a value was chosen, or `allow-additions` added a new one.\"\n },\n {\n name: \"ui-removed\",\n detail: \"{ value: string, originalEvent?: Event }\",\n description: \"`multiple`: a value was removed.\"\n }\n ],\n slots: [\n { name: \"\", description: \"`<ui-item>`s: the options, headers and dividers, in order.\" },\n { name: \"trigger\", description: \"Custom trigger content, e.g. an icon and a word, instead of the text.\" },\n { name: \"header\", description: \"Content at the top of the menu, e.g. a header or a search input.\" },\n { name: \"icon\", description: \"Replaces the caret, or the `labeled` icon.\" }\n ],\n parts: [\n { name: \"trigger\", description: \"The combobox `<button>` covering the dropdown (not `search`).\" },\n { name: \"text\", description: \"The current text, or the placeholder.\" },\n { name: \"icon\", description: \"The caret.\" },\n { name: \"menu\", description: \"The listbox popover.\" },\n { name: \"item\", description: \"Each option.\" },\n { name: \"label\", description: \"Each chosen value of a `multiple` dropdown.\" },\n { name: \"search\", description: \"The search `<input>`.\" },\n { name: \"clear\", description: \"The clear button of a `clearable` dropdown.\" }\n ],\n states: [\n { name: \"open\", description: \"The menu is open.\" },\n { name: \"disabled\", description: \"Can't be used.\" },\n { name: \"loading\", description: \"Busy.\" },\n { ...UIT.FormControlStates.invalid, description: \"Fails validation (`required` ...).\" },\n { name: \"fluid\", description: \"The host is block-level (`fluid`).\" }\n ],\n texts: [\n { key: \"noResults\", text: \"No results found.\", description: \"Message when nothing matches the search.\" },\n { key: \"addItem\", text: \"Add {value}\", description: \"The add item of `allow-additions`.\" },\n { key: \"clear\", text: \"Clear\", description: \"Accessible name of the clear button.\" },\n {\n key: \"removeValue\",\n text: \"Remove {value}\",\n description: \"Accessible name of a `multiple` label's delete button.\"\n }\n ]\n} as const satisfies ComponentVocabulary\n","import { E, UIT } from \"spell/ui/core\"\nimport { dropdownVocabulary } from \"./UIDropdown.en\"\nimport { SlottedItems } from \"./SlottedItems\"\n\n/****************\n * ### `DropdownFallback`\n * The native fallback of `<ui-dropdown>`: what it shows when its component breaks,\n * so the chosen value(s) are still submitted and validated with the form.\n *\n * - Its shadow DOM: a native `<select part=\"trigger select\" class=\"ui … dropdown\">`, `multiple` when `multiple`.\n * - The options come from the DOM element's light-DOM `<ui-item>`s (`header` => `<optgroup>`, `divider` skipped),\n * read as the component reads them (`SlottedItems`), then its `options` PROPERTY.\n * - The chosen values come from the `value` property, else the attribute (a comma / space list).\n * - A single select starts with an empty `<option>` (the `placeholder` text) when nothing is chosen,\n * so the browser doesn't silently choose the first option.\n * - On `change`: the form value follows (`FormData` for `multiple`), `domElement.value` is set,\n * and a composed `ui-changed` is sent.\n * The form value is also set on the first render, so the form submits without a change.\n * - Its accessible name is the DOM element's `aria-label`, else `placeholder`.\n ****************/\nexport class DropdownFallback extends E.NativeFallback<typeof dropdownVocabulary> {\n @E.proto static vocabulary = dropdownVocabulary\n @E.proto static degraded = [\n \"`search` (typing only jumps to a matching option)\",\n \"`allow-additions`, `clearable`, `max-selections`\",\n \"multiple-value labels (a native multi-select list)\",\n \"option `icon` / `image` / `flag` / `description`\",\n \"keyboard pattern: the native `<select>`'s, not the combobox listbox\",\n \"invoker commands, `ui-opening` / `ui-closing` / `ui-searched` / `ui-added` / `ui-removed`\",\n \"`readonly` is a disabled select (the value still submits)\"\n ]\n\n /** The native select, once built, for `sync()`. */\n private select: HTMLSelectElement | undefined\n\n protected override build() {\n const domElement = this.domElement as DropdownDOMElement\n const isMultiple = this.flag(\"multiple\")\n const placeholder = this.attr(\"placeholder\")\n const select = this.create(\"select\", {\n class: this.classes(),\n name: this.attr(\"name\"),\n multiple: isMultiple,\n required: this.flag(\"required\"),\n disabled: this.flag(\"disabled\") || this.flag(\"readonly\"),\n \"aria-readonly\": this.flag(\"readonly\") ? \"true\" : undefined\n })\n this.decorate(select, \"trigger\", SELECT_PART)\n this.nameFromPlaceholder(select)\n\n const chosen = new Set(SlottedItems.valuesIn(domElement.value ?? this.attr(\"value\"), isMultiple))\n const entries = [...SlottedItems.itemsOf(domElement).map(SlottedItems.entryOf), ...(domElement.options ?? [])]\n const picked = entries.filter(\n (entry): entry is E.MenuOption => !(\"type\" in entry) && (!!entry.selected || chosen.has(entry.value))\n )\n if (!isMultiple && !picked.length) {\n select.append(this.create(\"option\", { value: \"\", selected: true }, placeholder ?? \"\"))\n }\n\n let group: HTMLElement = select\n for (const entry of entries) {\n if (!(\"type\" in entry)) {\n const option = this.create(\"option\", { value: entry.value, disabled: entry.disabled }, entry.text)\n option.selected = picked.includes(entry) && (isMultiple || entry === picked[0])\n group.append(option)\n } else if (entry.type === UIT.HEADER) select.append((group = this.create(\"optgroup\", { label: entry.text })))\n }\n\n this.listen(select, \"change\", (event) => {\n this.sync()\n const value = this.chosenValue()\n domElement.value = value\n this.send(CHANGE_EVENT, { value, originalEvent: event })\n })\n this.select = select\n return [select]\n }\n\n /** The select's value, and its validity (`required`). */\n protected override sync() {\n const { select } = this\n if (select) this.syncForm({ value: this.chosenValue(), control: select })\n }\n\n /** What the select has chosen: a list when `multiple`, else one value (`\"\"` for none). */\n private chosenValue(): UIT.DropdownValue {\n const select = this.select!\n return select.multiple ? [...select.selectedOptions].map((option) => option.value) : select.value\n }\n}\n\n/** What the fallback reads and writes of the DOM element: all optional, the element may not have upgraded. */\ntype DropdownDOMElement = HTMLElement & {\n /** the chosen value(s), once set as a property */\n value?: UIT.DropdownValue\n /** the `options` property, once set */\n options?: readonly E.MenuOption[]\n}\n\n/** The select's second part name, beside the vocabulary's `trigger`: `::part(select)` styles the native one. */\nconst SELECT_PART = \"select\"\n\n/** The event the select's `change` becomes. */\nconst CHANGE_EVENT: E.EventName<typeof dropdownVocabulary> = \"ui-changed\"\n","/*\n * The style sheet of `<ui-dropdown>`: a port of Fomantic's `dropdown.less` + `dropdown.variables`,\n * with the multiple-selection labels (`.ui.multiple.dropdown > .label`, just enough of `label.less` to stand alone).\n * - Adopted after the foundation, AFTER `UIButton.css` (the `button` / `labeled icon` variants are buttons).\n * - The shadow markup it expects (class grammar on semantic elements), in this order inside the root:\n *\n * <div class=\"ui [size color state] [selection search multiple ...] dropdown [active] [disabled] [loading]\"\n * style=\"anchor-name: --ui-dropdown-7\">\n * <span class=\"ui label\" part=\"label\">Angular<button class=\"delete icon\" aria-label=\"...\"></button></span>\n * <input class=\"search\" part=\"search\" role=\"combobox\"> (search: the combobox)\n * <span class=\"sizer\" aria-hidden=\"true\">query</span> (multiple search: measures the input)\n * <button class=\"trigger\" part=\"trigger\" role=\"combobox\"> (otherwise: the combobox, covering the root)\n * <span class=\"[default] [filtered] text\" part=\"text\"><slot name=\"trigger\">...</slot></span>\n * <button class=\"remove icon\" part=\"clear\" aria-label=\"...\"> (clearable, when there's a value)\n * <span class=\"dropdown icon\" part=\"icon\"><slot name=\"icon\"></slot></span> (empty: a caret; or slot an svg)\n * <div class=\"[left] menu\" role=\"listbox\" popover part=\"menu\" style=\"position-anchor: --ui-dropdown-7\">\n * <div class=\"header\">, <hr class=\"divider\">, <div class=\"message\">,\n * <div class=\"[active] [selected] [disabled] [addition] item\" role=\"option\" part=\"item\">\n * <span class=\"icon\">, <img class=\"image\">, <span class=\"flag\">, <span class=\"description\">,\n * <span class=\"text\">, <mark> around matches\n * </div>\n * </div>\n *\n * - NOTE: `<slot>` breaks a CHILD (`>`) selector -- fallback content sits one level DEEPER,\n * as a descendant of its wrapper, not a direct child. So `.dropdown.icon` (wraps `<slot name=\"icon\">`) and `.text`\n * (wraps `<slot name=\"trigger\">`, the \"custom trigger content\" slot) size an inner icon with a DESCENDANT\n * selector (`.icon svg`, `.text .icon`) to reach fallback content through the `<slot>`,\n * plus `::slotted(svg)` / `::slotted(ui-icon)` for a real top-level slotted replacement --\n * NEVER `.icon > svg` or `.text > .icon`.\n * - Item classes are Fomantic's: `active` === the CHOSEN value (also `[aria-selected=\"true\"]`),\n * `selected` === the keyboard-highlighted option (the `aria-activedescendant` target).\n * NOTE: the vocabulary's `selected` (chosen) maps to `active` here.\n * - Open: the root is open when it has `active` OR its menu is `:popover-open`, so the CSS works whichever way\n * the component signals it. `visible` on the menu shows a NON-popover menu (static examples, `simple`).\n * - Positioning: POPOVER + ANCHOR, no JS.\n * - the anchor's name, and the menu hung from it: inline, per element (the component's `PopoverPanel`)\n * - root: `anchor-scope: all`\n * - `.menu[popover]`: `position-area` below\n * and flipping (`flip-block, flip-inline`); `upward` / `.left.menu` / `pointing=\"...\"` pick other areas\n * - a menu WITHOUT `popover` falls back to Fomantic's `top: 100%` positioning (static markup, `simple`)\n * - The `:state()`s the component sets: `:state(fluid)` (a block-level DOM element),\n * plus `open` / `disabled` / `loading` / `invalid` for PAGE styling only -- this sheet keys on the root's classes.\n * - Public tokens (`--ui-dropdown-*`, the theming surface) are NEVER declared here: the token block reads each\n * through a private alias, `--_ui-dropdown-radius: var(--ui-dropdown-radius, var(--ui-radius))`,\n * and every rule reads the alias. So a value set on `:root`, an ancestor, the DOM element or in the app stylesheet\n * reaches the box (`notes/theming.md` \"Component tokens\"). The root has no part name:\n * `::part(menu)` / `::part(item)` take plain properties. Variations (`floating`, `pointing`, form states,\n * `inverted`) write the aliases they swap.\n * - NOTE: left out, on purpose:\n * - sub-menus (`.menu .menu`, `.item > .dropdown.icon`): the combobox pattern is one listbox deep\n * - the \"connecting border\" (square corners where a selection menu meets its box): a flipped menu can't\n * tell CSS it flipped, so every menu floats a hair away with its own radius\n * - Fomantic's per-breakpoint menu heights: one `--ui-dropdown-menu-max-height`, and the menu never grows\n * past the space its `position-area` leaves\n * - `scrollhint` (a touch-only scroll animation), `label` dropdowns (`.ui.label.dropdown`),\n * `<select>` fallback styling (`select.ui.dropdown`), and coupling with `ui menu` / `labeled input`\n */\n\n@layer ui.components.dropdown.types, ui.components.dropdown.content, ui.components.dropdown.variations, ui.components.dropdown.states;\n\n/* Loader spin, shared by `loading` dropdowns. */\n@keyframes ui-dropdown-spin {\n to {\n rotate: 1turn;\n }\n}\n\n/*******************************\n Dropdown\n*******************************/\n\n@layer ui.components.dropdown.types {\n /* The DOM element: layout only; the look lives on the root inside. */\n :host {\n display: inline-block;\n vertical-align: baseline;\n }\n :host(:state(fluid)) {\n display: block;\n }\n /* `delegatesFocus`: the trigger / search input draws the ring, never the DOM element. */\n :host(:focus-visible) {\n outline: none;\n }\n\n /*\n * Tokens: one per `dropdown.variables` entry that still matters, from the global tokens -- each the private alias\n * of its public token (never declare the public one: it would block inherited values).\n */\n .ui.dropdown {\n --_ui-dropdown-radius: var(--ui-dropdown-radius, var(--ui-radius));\n /* `<ui-flag>`'s token: a page's flag font (its \"A flag font\") reaches menu flags too */\n --_ui-flag-font-family: var(--ui-flag-font-family, var(--ui-font-family-emoji), var(--ui-font-family));\n --_ui-dropdown-duration: var(--ui-dropdown-duration, var(--ui-duration-fast));\n --_ui-dropdown-color: var(--ui-dropdown-color, var(--ui-text-color));\n --_ui-dropdown-background: var(--ui-dropdown-background, var(--ui-surface));\n --_ui-dropdown-border-color: var(--ui-dropdown-border-color, var(--ui-border-color));\n --_ui-dropdown-border-color-hover: var(--ui-dropdown-border-color-hover, var(--ui-border-color-selected));\n --_ui-dropdown-border-color-focus: var(\n --ui-dropdown-border-color-focus,\n var(--ui-color-border, var(--ui-focus-border))\n );\n --_ui-dropdown-padding-block: var(--ui-dropdown-padding-block, var(--ui-space-s));\n --_ui-dropdown-padding-inline: var(--ui-dropdown-padding-inline, var(--ui-space-m));\n --_ui-dropdown-line-height: var(--ui-dropdown-line-height, 1.2);\n --_ui-dropdown-min-width: var(--ui-dropdown-min-width, 14em);\n --_ui-dropdown-min-height: var(\n --ui-dropdown-min-height,\n calc(var(--_ui-dropdown-line-height) * 1em + 2 * var(--_ui-dropdown-padding-block))\n );\n --_ui-dropdown-icon-size: var(--ui-dropdown-icon-size, 0.875em);\n --_ui-dropdown-icon-spacing: var(--ui-dropdown-icon-spacing, var(--ui-space-m));\n --_ui-dropdown-icon-distance: var(\n --ui-dropdown-icon-distance,\n calc(2 * var(--_ui-dropdown-padding-inline) + var(--_ui-dropdown-icon-size))\n );\n --_ui-dropdown-icon-opacity: var(--ui-dropdown-icon-opacity, 0.5);\n --_ui-dropdown-placeholder-color: var(--ui-dropdown-placeholder-color, var(--ui-text-light));\n --_ui-dropdown-placeholder-focus-color: var(--ui-dropdown-placeholder-focus-color, var(--ui-text-muted));\n --_ui-dropdown-menu-background: var(--ui-dropdown-menu-background, var(--ui-surface));\n --_ui-dropdown-menu-color: var(--ui-dropdown-menu-color, var(--ui-text-color));\n --_ui-dropdown-menu-border-color: var(--ui-dropdown-menu-border-color, var(--ui-border-color));\n --_ui-dropdown-menu-radius: var(--ui-dropdown-menu-radius, var(--ui-radius));\n --_ui-dropdown-menu-shadow: var(--ui-dropdown-menu-shadow, var(--ui-shadow-raised));\n --_ui-dropdown-menu-offset: var(--ui-dropdown-menu-offset, var(--ui-space-2xs));\n --_ui-dropdown-menu-max-height: var(--ui-dropdown-menu-max-height, 16em);\n --_ui-dropdown-menu-scrolling-max-height: var(--ui-dropdown-menu-scrolling-max-height, 20em);\n --_ui-dropdown-item-padding-block: var(--ui-dropdown-item-padding-block, var(--ui-space-s));\n --_ui-dropdown-item-padding-inline: var(--ui-dropdown-item-padding-inline, var(--ui-space-m));\n --_ui-dropdown-item-color: var(--ui-dropdown-item-color, var(--ui-text-color));\n --_ui-dropdown-item-color-hover: var(--ui-dropdown-item-color-hover, var(--ui-text-selected));\n --_ui-dropdown-item-background-hover: var(\n --ui-dropdown-item-background-hover,\n oklch(from var(--ui-ink) l c h / 0.05)\n );\n --_ui-dropdown-item-background-selected: var(\n --ui-dropdown-item-background-selected,\n oklch(from var(--ui-ink) l c h / 0.035)\n );\n --_ui-dropdown-item-font-weight-active: var(--ui-dropdown-item-font-weight-active, var(--ui-font-weight-bold));\n --_ui-dropdown-item-divider-color: var(--ui-dropdown-item-divider-color, var(--ui-border-color-internal));\n --_ui-dropdown-item-element-spacing: var(--ui-dropdown-item-element-spacing, var(--ui-space-s));\n --_ui-dropdown-header-color: var(--ui-dropdown-header-color, var(--ui-text-dark));\n --_ui-dropdown-header-font-size: var(--ui-dropdown-header-font-size, 0.8em);\n --_ui-dropdown-description-color: var(--ui-dropdown-description-color, var(--ui-text-light));\n --_ui-dropdown-message-color: var(--ui-dropdown-message-color, var(--ui-text-unselected));\n --_ui-dropdown-label-background: var(--ui-dropdown-label-background, oklch(from var(--ui-ink) l c h / 0.08));\n --_ui-dropdown-label-color: var(--ui-dropdown-label-color, var(--ui-text-muted));\n --_ui-dropdown-label-radius: var(--ui-dropdown-label-radius, var(--ui-radius-s));\n --_ui-dropdown-label-padding: var(--ui-dropdown-label-padding, 0.35em 0.75em);\n --_ui-dropdown-arrow-size: var(--ui-dropdown-arrow-size, 0.5em);\n --_ui-dropdown-pointing-offset: var(--ui-dropdown-pointing-offset, var(--ui-space-s));\n --_ui-dropdown-pointing-edge: var(--ui-dropdown-pointing-edge, var(--ui-space-m));\n --_ui-dropdown-floating-offset: var(--ui-dropdown-floating-offset, var(--ui-space-xs));\n --_ui-dropdown-floating-shadow: var(--ui-dropdown-floating-shadow, var(--ui-shadow-floating));\n --_ui-dropdown-disabled-opacity: var(--ui-dropdown-disabled-opacity, var(--ui-disabled-opacity));\n --_ui-dropdown-loader-width: var(--ui-dropdown-loader-width, 0.2em);\n --_ui-dropdown-loader-speed: var(--ui-dropdown-loader-speed, 0.6s);\n /* Derived: the search input's padding keeps its text on the same baseline as `.text`. */\n --_dropdown-search-padding-block: calc(\n var(--_ui-dropdown-padding-block) - (var(--_ui-dropdown-line-height) * 1em - 1em) / 2\n );\n\n position: relative;\n box-sizing: border-box;\n display: inline-block;\n anchor-scope: all;\n font-family: var(--ui-font-family);\n font-size: calc(var(--ui-font-size) * var(--ui-scale, 1));\n text-align: start;\n cursor: pointer;\n outline: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n transition-property: box-shadow, border-color, width;\n transition-duration: var(--_ui-dropdown-duration);\n transition-timing-function: var(--ui-ease);\n }\n\n /* Trigger: a real `<button>` covering the root, so the whole box is one focusable combobox. */\n .ui.dropdown > .trigger {\n position: absolute;\n inset: 0;\n z-index: 1;\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: inherit;\n background: none;\n color: inherit;\n font: inherit;\n cursor: inherit;\n appearance: none;\n }\n\n /* Menu: hidden until open; a popover in the top layer, anchored to the root. */\n .ui.dropdown > .menu {\n position: absolute;\n top: 100%;\n inset-inline-start: 0;\n z-index: var(--ui-z-dropdown);\n box-sizing: border-box;\n display: none;\n min-width: max-content;\n margin: 0;\n padding: 0;\n overflow: visible;\n border: var(--ui-border-width) solid var(--_ui-dropdown-menu-border-color);\n border-radius: var(--_ui-dropdown-menu-radius);\n outline: none;\n background: var(--_ui-dropdown-menu-background);\n box-shadow: var(--_ui-dropdown-menu-shadow);\n color: var(--_ui-dropdown-menu-color);\n font-size: 1em;\n font-weight: var(--ui-font-weight-normal);\n line-height: normal;\n text-align: start;\n text-shadow: none;\n cursor: auto;\n }\n /*\n * `fixed` (the popover default), NOT `absolute`: webkit measures an absolute popover's `position-area` against the\n * origin screenful of the page, so a dropdown anywhere below it flipped upwards although room remained.\n */\n .ui.dropdown > .menu[popover] {\n position: fixed;\n position-area: block-end span-inline-end;\n position-try-fallbacks: flip-block, flip-inline;\n /* below or above, whichever has more room: capped to it (`max-height`), the menu always fits */\n position-try-order: most-block-size;\n inset: auto;\n min-width: anchor-size(width);\n margin: var(--_ui-dropdown-menu-offset) 0;\n /*\n * Never taller than the room beside its root: `100%` is that room (its `position-area`), less its offset from\n * the root and as much again from the window's edge; a longer list scrolls. No sub-menus to clip (above).\n */\n max-height: calc(100% - 2 * var(--_ui-dropdown-menu-offset));\n overflow-y: auto;\n overscroll-behavior: contain;\n opacity: 0;\n transition-property: opacity, display, overlay;\n transition-duration: var(--_ui-dropdown-duration);\n transition-timing-function: var(--ui-ease);\n transition-behavior: allow-discrete;\n }\n /* more below: the menu's colour fading up over its last 8px, not a hard edge (Owen); all in view, it sits\n over the menu's own bottom edge */\n .ui.dropdown > .menu[popover]::after {\n content: \"\";\n position: sticky;\n inset-block-end: 0;\n display: block;\n height: 8px;\n margin-block-start: -8px;\n pointer-events: none;\n background: linear-gradient(to top, var(--_ui-dropdown-menu-background), transparent);\n }\n .ui.dropdown > .menu > * {\n white-space: nowrap;\n }\n\n /* Dropdown icon: an empty one draws a caret, so no icon data is needed. */\n .ui.dropdown > .dropdown.icon {\n position: relative;\n box-sizing: content-box;\n display: inline-block;\n width: var(--_ui-dropdown-icon-size);\n height: var(--_ui-dropdown-icon-size);\n margin-inline-start: var(--_ui-dropdown-icon-spacing);\n fill: currentColor;\n vertical-align: -0.1em;\n pointer-events: none;\n }\n .ui.dropdown > :is(.dropdown, .remove).icon:empty::before,\n .ui.dropdown > .label > .delete.icon:empty::before {\n content: \"\";\n display: block;\n width: 100%;\n height: 100%;\n background: currentColor;\n }\n .ui.dropdown > .dropdown.icon:empty::before {\n clip-path: polygon(15% 35%, 85% 35%, 50% 75%);\n }\n .ui.dropdown > .remove.icon:empty::before,\n .ui.dropdown > .label > .delete.icon:empty::before {\n clip-path: polygon(\n 20% 10%,\n 50% 40%,\n 80% 10%,\n 90% 20%,\n 60% 50%,\n 90% 80%,\n 80% 90%,\n 50% 60%,\n 20% 90%,\n 10% 80%,\n 40% 50%,\n 10% 20%\n );\n }\n .ui.dropdown .icon svg,\n .ui.dropdown .icon ::slotted(svg),\n .ui.dropdown .icon ::slotted(ui-icon) {\n display: block;\n width: 100%;\n height: 100%;\n fill: currentColor;\n }\n\n /* Remove (clear): a small button beside the caret. */\n .ui.dropdown > .remove.icon {\n position: absolute;\n top: 50%;\n inset-inline-end: 2em;\n z-index: 3;\n box-sizing: content-box;\n width: var(--_ui-dropdown-icon-size);\n height: var(--_ui-dropdown-icon-size);\n margin: 0;\n padding: 0.25em;\n border: 0;\n background: none;\n color: inherit;\n cursor: pointer;\n translate: 0 -50%;\n opacity: 0.5;\n transition: opacity var(--_ui-dropdown-duration) var(--ui-ease);\n appearance: none;\n }\n .ui.selection.dropdown > .remove.icon {\n top: calc(var(--_ui-dropdown-min-height) / 2 - var(--ui-border-width));\n inset-inline-end: calc(var(--_ui-dropdown-padding-inline) + var(--_ui-dropdown-icon-size) + 0.5em);\n }\n .ui.inline.dropdown > .remove.icon {\n inset-inline-end: 2.2em;\n }\n .ui.clearable.dropdown > .text:not(.default),\n .ui.clearable.dropdown:not(.search) > .label:last-of-type {\n margin-inline-end: 1.5em;\n }\n\n /* Text: the current value, or the placeholder (`default`). */\n .ui.dropdown > .text {\n display: inline-block;\n }\n .ui.dropdown:not(.button) > .default.text {\n color: var(--_ui-dropdown-placeholder-color);\n }\n .ui.dropdown:not(.button) > input:focus ~ .default.text {\n color: var(--_ui-dropdown-placeholder-focus-color);\n }\n .ui.dropdown > .filtered.text {\n visibility: hidden;\n }\n .ui.dropdown > .text > .description {\n float: inline-end;\n margin-inline-start: 1em;\n color: var(--_ui-dropdown-description-color);\n }\n\n /* Selection: looks like a select box. */\n .ui.selection.dropdown {\n display: inline-block;\n min-width: var(--_ui-dropdown-min-width);\n min-height: var(--_ui-dropdown-min-height);\n padding-block: var(--_ui-dropdown-padding-block);\n padding-inline: var(--_ui-dropdown-padding-inline) var(--_ui-dropdown-icon-distance);\n border: var(--ui-border-width) solid var(--_ui-dropdown-border-color);\n border-radius: var(--_ui-dropdown-radius);\n background: var(--_ui-dropdown-background);\n color: var(--_ui-dropdown-color);\n line-height: 1em;\n white-space: normal;\n overflow-wrap: break-word;\n box-shadow: none;\n }\n .ui.selection.dropdown > :is(.dropdown, .search).icon {\n position: absolute;\n top: calc(var(--_ui-dropdown-min-height) / 2 - var(--ui-border-width));\n inset-inline-end: var(--_ui-dropdown-padding-inline);\n z-index: 3;\n margin: 0;\n translate: 0 -50%;\n opacity: var(--_ui-dropdown-icon-opacity);\n transition: opacity var(--_ui-dropdown-duration) var(--ui-ease);\n }\n\n /* Search: the input overlays the current text, which shows through until typing starts. */\n .ui.search.dropdown > input.search {\n position: absolute;\n top: 0;\n inset-inline-start: 1px;\n z-index: 2;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: inherit;\n border: none;\n background: none transparent;\n box-shadow: none;\n color: inherit;\n font: inherit;\n cursor: text;\n outline: none;\n -webkit-tap-highlight-color: transparent;\n }\n .ui.search.dropdown > .text {\n position: relative;\n inset-inline-start: 1px;\n z-index: auto;\n cursor: text;\n }\n .ui.search.selection.dropdown > input.search,\n .ui.search.selection.dropdown > .sizer {\n padding-block: var(--_dropdown-search-padding-block);\n padding-inline: var(--_ui-dropdown-padding-inline) var(--_ui-dropdown-icon-distance);\n line-height: var(--_ui-dropdown-line-height);\n }\n /* Sizer: laid out but invisible, so the element can read its width. */\n .ui.dropdown > .sizer {\n position: absolute;\n top: 0;\n inset-inline-start: 0;\n height: 0;\n overflow: hidden;\n white-space: pre;\n visibility: hidden;\n }\n\n /* Multiple: chosen values as labels, the padding split between the box and its children. */\n .ui.multiple.dropdown {\n padding-block: calc(var(--_dropdown-search-padding-block) / 3);\n padding-inline: calc(var(--_ui-dropdown-padding-inline) / 3) var(--_ui-dropdown-icon-distance);\n }\n .ui.multiple.dropdown > .text {\n position: static;\n max-width: 100%;\n margin-block: calc(var(--_dropdown-search-padding-block) * 2 / 3);\n margin-inline: calc(var(--_ui-dropdown-padding-inline) * 2 / 3) 0;\n padding: 0;\n line-height: var(--_ui-dropdown-line-height);\n }\n .ui.multiple.dropdown > .default.text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .ui.multiple.dropdown > .label ~ .text {\n display: none;\n }\n .ui.multiple.search.dropdown,\n .ui.multiple.search.dropdown > input.search {\n cursor: text;\n }\n /* Its own stacking context, so the placeholder's `z-index: -1` (below the search input) stays ABOVE the box's\n background; without it the placeholder sank under the white box whenever an ancestor made the context. */\n .ui.multiple.search.dropdown {\n isolation: isolate;\n }\n .ui.multiple.search.dropdown > .text {\n position: absolute;\n top: 0;\n inset-inline-start: 0;\n display: inline-block;\n padding: inherit;\n }\n .ui.multiple.search.dropdown > .default.text {\n z-index: -1;\n }\n /* The text (the placeholder) gives way to the chips: `.search > .text` (above) would otherwise draw it over them. */\n .ui.multiple.search.dropdown > .label ~ .text {\n display: none;\n }\n .ui.multiple.search.dropdown > input.search {\n position: static;\n width: auto;\n min-width: 2.2em;\n max-width: 100%;\n height: auto;\n margin-block: calc(var(--_dropdown-search-padding-block) * 2 / 3);\n margin-inline: calc(var(--_ui-dropdown-padding-inline) * 2 / 3) 0;\n padding: 0;\n line-height: var(--_ui-dropdown-line-height);\n field-sizing: content;\n }\n .ui.multiple.dropdown > .label ~ input.search {\n margin-inline-start: 0.15em;\n }\n\n /* Inline: a bold word inside running text. */\n .ui.inline.dropdown {\n display: inline-block;\n color: inherit;\n cursor: pointer;\n }\n .ui.inline.dropdown > .text {\n font-weight: var(--ui-font-weight-bold);\n }\n .ui.inline.dropdown > .dropdown.icon {\n margin: 0 0.2em;\n vertical-align: baseline;\n }\n .ui.inline.dropdown > .menu {\n --_ui-dropdown-menu-offset: 0.2em;\n }\n\n /* Button: `.ui.dropdown.button` is styled by `UIButton.css`; only overflow and the icon need adjusting. */\n .ui.dropdown.button {\n overflow: visible;\n }\n .ui.dropdown.icon.button > .dropdown.icon {\n margin: 0;\n }\n\n /* Labeled icon: the icon block comes from `UIButton.css`; no caret. */\n .ui.labeled.icon.dropdown > .dropdown.icon {\n display: none;\n }\n}\n\n/*******************************\n Content\n*******************************/\n\n@layer ui.components.dropdown.content {\n /* Labels (multiple): chips for the chosen values, tinted by the dropdown's colour or state. */\n .ui.multiple.dropdown > .label {\n position: relative;\n z-index: 2;\n display: inline-block;\n box-sizing: border-box;\n margin-block: 0.125em;\n margin-inline: 0 0.25em;\n padding: var(--_ui-dropdown-label-padding);\n border-radius: var(--_ui-dropdown-label-radius);\n background-color: var(--ui-color-background, var(--_ui-dropdown-label-background));\n box-shadow: inset 0 0 0 var(--ui-border-width) var(--ui-color-border, var(--ui-border-color));\n color: var(--ui-color-text, var(--_ui-dropdown-label-color));\n font-size: 0.875em;\n font-weight: var(--ui-font-weight-semibold);\n line-height: 1;\n vertical-align: baseline;\n white-space: normal;\n cursor: default;\n }\n .ui.multiple.dropdown > .label > .delete.icon {\n box-sizing: content-box;\n display: inline-block;\n width: 0.75em;\n height: 0.75em;\n margin: 0 0 0 0.5em;\n padding: 0;\n border: 0;\n background: none;\n color: inherit;\n font-size: 1em;\n opacity: 0.5;\n vertical-align: -0.05em;\n cursor: pointer;\n transition: opacity var(--_ui-dropdown-duration) var(--ui-ease);\n appearance: none;\n }\n .ui.multiple.dropdown > .label > :is(img, .image) {\n height: 1.4em;\n margin-block: -0.2em;\n margin-inline: -0.4em 0.4em;\n border-radius: var(--_ui-dropdown-label-radius);\n vertical-align: top;\n }\n\n /* Items */\n .ui.dropdown .menu > .item {\n position: relative;\n box-sizing: border-box;\n display: block;\n height: auto;\n padding: var(--_ui-dropdown-item-padding-block) var(--_ui-dropdown-item-padding-inline);\n border: none;\n color: var(--_ui-dropdown-item-color);\n font-size: 1em;\n font-weight: var(--ui-font-weight-normal);\n line-height: 1em;\n text-align: start;\n text-transform: none;\n box-shadow: none;\n cursor: pointer;\n -webkit-touch-callout: none;\n }\n .ui.dropdown .menu > .item.vertical {\n display: flex;\n flex-direction: column-reverse;\n }\n .ui.dropdown .menu > .item.vertical > .text {\n margin-bottom: 0.25em;\n }\n .ui.dropdown .menu > .item > .description {\n float: inline-end;\n margin-inline-start: 1em;\n color: var(--_ui-dropdown-description-color);\n }\n .ui.dropdown .menu > .item.vertical > .description {\n margin: 0;\n }\n .ui.dropdown .menu > .item mark {\n background: var(--ui-highlight);\n color: inherit;\n }\n\n /* Item sub-elements: icon, image, flag, label, before the text. */\n .ui.dropdown > .text :is(.icon, .icons, .label, .flag, .image, img),\n .ui.dropdown > .text ::slotted(:is(.icon, .icons, .label, .flag, .image, img, ui-icon)),\n .ui.dropdown .menu > :is(.item, .header) > :is(.icon, .icons, .label, .flag, .image, img) {\n float: none;\n margin-block: 0;\n margin-inline: 0 var(--_ui-dropdown-item-element-spacing);\n }\n .ui.dropdown > .text .icon,\n .ui.dropdown > .text ::slotted(svg),\n .ui.dropdown > .text ::slotted(ui-icon),\n .ui.dropdown .menu > :is(.item, .header) > .icon {\n box-sizing: border-box;\n display: inline-block;\n width: 1.18em;\n height: 1em;\n fill: currentColor;\n vertical-align: -0.125em;\n }\n .ui.dropdown > .text :is(img, .image:not(.icon)),\n .ui.dropdown > .text ::slotted(:is(img, .image:not(.icon))),\n .ui.dropdown .menu > :is(.item, .header) > :is(img, .image:not(.icon)) {\n display: inline-block;\n width: auto;\n max-height: 2em;\n margin-block: -0.5em;\n vertical-align: top;\n }\n .ui.dropdown > .text .flag,\n .ui.dropdown > .text ::slotted(.flag),\n .ui.dropdown .menu > :is(.item, .header) > .flag {\n display: inline-block;\n font-family: var(--_ui-flag-font-family);\n line-height: 1;\n }\n .ui.dropdown > .text [class*=\"right floated\"],\n .ui.dropdown > .text ::slotted([class*=\"right floated\"]),\n .ui.dropdown .menu > :is(.item, .header) > [class*=\"right floated\"] {\n float: inline-end;\n margin-inline: 1em 0;\n }\n .ui.dropdown > .text [class*=\"left floated\"],\n .ui.dropdown > .text ::slotted([class*=\"left floated\"]),\n .ui.dropdown .menu > :is(.item, .header) > [class*=\"left floated\"] {\n float: inline-start;\n margin-inline: 0 1em;\n }\n\n /* Header, divider, message */\n .ui.dropdown .menu > .header {\n margin: 1.25em 0 0.75em;\n padding: 0 calc(var(--_ui-dropdown-item-padding-inline) / 0.8);\n color: var(--_ui-dropdown-header-color);\n font-size: var(--_ui-dropdown-header-font-size);\n font-weight: var(--ui-font-weight-bold);\n text-transform: uppercase;\n }\n .ui.dropdown .menu > .divider {\n height: 0;\n margin: 0.5em 0;\n border: 0;\n border-top: var(--ui-border-width) solid var(--_ui-dropdown-item-divider-color);\n }\n .ui.dropdown .menu > .message {\n padding: var(--_ui-dropdown-item-padding-block) var(--_ui-dropdown-item-padding-inline);\n color: var(--_ui-dropdown-message-color);\n font-weight: var(--ui-font-weight-normal);\n cursor: default;\n }\n\n /* Input inside the menu (search in menu). */\n .ui.dropdown .menu > .input {\n display: flex;\n min-width: 10em;\n margin: 1em 0.75em;\n }\n .ui.dropdown .menu > .header + .input {\n margin-top: 0;\n }\n .ui.dropdown .menu > .input > input {\n flex: 1 1 auto;\n min-width: 0;\n padding: 0.5em 1em;\n border: var(--ui-border-width) solid var(--_ui-dropdown-border-color);\n border-radius: var(--_ui-dropdown-radius);\n background: var(--_ui-dropdown-background);\n color: var(--_ui-dropdown-color);\n font: inherit;\n }\n\n /* Scrolling section inside a menu. */\n .ui.dropdown .menu > .scrolling.menu {\n position: static;\n display: block;\n max-height: var(--_ui-dropdown-menu-scrolling-max-height);\n margin: 0;\n overflow: hidden auto;\n overscroll-behavior: contain;\n border: none;\n border-top: var(--ui-border-width) solid var(--_ui-dropdown-menu-border-color);\n border-radius: 0 0 var(--_ui-dropdown-menu-radius) var(--_ui-dropdown-menu-radius);\n box-shadow: none;\n }\n\n /* Addition: the synthesized \"Add ...\" item. */\n .ui.dropdown .menu > .hidden.addition.item {\n display: none;\n }\n .ui.dropdown .menu > .stuck.addition.item:first-child {\n position: sticky;\n top: 0;\n z-index: 14;\n background: var(--_ui-dropdown-menu-background);\n box-shadow: var(--_ui-dropdown-menu-shadow);\n }\n}\n\n/*******************************\n Variations\n*******************************/\n\n@layer ui.components.dropdown.variations {\n /* Selection / search menus: scroll after about six items; items wrap and are divided. */\n .ui:is(.selection, .search).dropdown:not(.unlimited) > .menu {\n max-height: var(--_ui-dropdown-menu-max-height);\n overflow: hidden auto;\n overscroll-behavior: contain;\n }\n .ui.selection.dropdown > .menu[popover] {\n width: anchor-size(width);\n }\n .ui.selection.dropdown > .menu:not([popover]) {\n width: calc(100% + 2 * var(--ui-border-width));\n margin-inline: calc(var(--ui-border-width) * -1);\n }\n .ui.selection.dropdown .menu > .item {\n padding: var(--_ui-dropdown-item-padding-block) var(--_ui-dropdown-item-padding-inline);\n border-top: var(--ui-border-width) solid var(--_ui-dropdown-item-divider-color);\n white-space: normal;\n overflow-wrap: normal;\n }\n .ui.selection.dropdown .menu > .item:first-child,\n .ui.selection:is(.pointing, .floating).dropdown .menu > .item:first-child {\n border-top: none;\n }\n\n /* Short / long / unlimited / resizable menus. */\n .ui.selection.short.dropdown > .menu {\n max-height: calc(var(--_ui-dropdown-menu-max-height) * 0.75);\n }\n .ui.selection[class*=\"very short\"].dropdown > .menu {\n max-height: calc(var(--_ui-dropdown-menu-max-height) * 0.5);\n }\n .ui.selection.long.dropdown > .menu {\n max-height: calc(var(--_ui-dropdown-menu-max-height) * 2);\n }\n .ui.selection[class*=\"very long\"].dropdown > .menu {\n max-height: calc(var(--_ui-dropdown-menu-max-height) * 3);\n }\n\n /* Scrolling: any dropdown's menu scrolls. */\n .ui.scrolling.dropdown > .menu {\n max-height: var(--_ui-dropdown-menu-scrolling-max-height);\n overflow: hidden auto;\n overscroll-behavior: contain;\n }\n .ui.scrolling.dropdown .menu > .item {\n border-top: none;\n }\n .ui.scrolling.resizable.dropdown > .menu,\n .ui.dropdown .menu > .scrolling.resizable.menu {\n height: var(--_ui-dropdown-menu-scrolling-max-height);\n max-height: none;\n resize: vertical;\n }\n\n /* Compact: no minimum width; the menu sizes to its items. */\n .ui.compact.dropdown {\n min-width: 0;\n }\n .ui.compact.dropdown > .menu[popover],\n .ui.compact.dropdown > .menu {\n width: max-content;\n }\n .ui.compact.dropdown .menu > .item {\n white-space: normal;\n }\n\n /* Fluid: full width. */\n .ui.fluid.dropdown {\n display: block;\n width: 100%;\n min-width: 0;\n }\n .ui.fluid.dropdown > .dropdown.icon {\n float: inline-end;\n }\n\n /* Columnar: `columnar=\"3\"` => `three column`, items in a grid. */\n .ui.column.dropdown > .menu {\n flex-wrap: wrap;\n }\n .ui[class*=\"two column\"].dropdown .menu > .item {\n width: 50%;\n }\n .ui[class*=\"three column\"].dropdown .menu > .item {\n width: 33.333%;\n }\n .ui[class*=\"four column\"].dropdown .menu > .item {\n width: 25%;\n }\n .ui[class*=\"five column\"].dropdown .menu > .item {\n width: 20%;\n }\n\n /* Upward: opens above. */\n .ui.upward.dropdown > .menu:not([popover]) {\n top: auto;\n bottom: 100%;\n }\n .ui.upward.dropdown > .menu[popover] {\n position-area: block-start span-inline-end;\n }\n\n /* Direction: `.left.menu` opens toward the inline start (right-aligned). */\n .ui.dropdown > .left.menu:not([popover]) {\n inset-inline: auto 0;\n }\n .ui.dropdown > .left.menu[popover] {\n position-area: block-end span-inline-start;\n }\n .ui.upward.dropdown > .left.menu[popover] {\n position-area: block-start span-inline-start;\n }\n\n /* Floating: further away, with a floating shadow. */\n .ui.floating.dropdown {\n --_ui-dropdown-menu-offset: var(--_ui-dropdown-floating-offset);\n --_ui-dropdown-menu-shadow: var(--_ui-dropdown-floating-shadow);\n }\n .ui.floating.dropdown > .menu:not([popover]) {\n margin-top: var(--_ui-dropdown-menu-offset);\n }\n .ui.upward.floating.dropdown > .menu:not([popover]) {\n margin-top: 0;\n margin-bottom: var(--_ui-dropdown-menu-offset);\n }\n .ui:is(.floating, .pointing).dropdown .menu > .item:first-child {\n border-start-start-radius: var(--_ui-dropdown-menu-radius);\n border-start-end-radius: var(--_ui-dropdown-menu-radius);\n }\n .ui:is(.floating, .pointing).dropdown .menu > .item:last-child {\n border-end-start-radius: var(--_ui-dropdown-menu-radius);\n border-end-end-radius: var(--_ui-dropdown-menu-radius);\n }\n\n /*\n * Pointing: an arrow on the menu, pointing at the root. Never flips -- the arrow would point away.\n * - `pointing` / `top pointing`: below, centred; `bottom pointing`: above, centred\n * - `top left` / `top right`: below, aligned to that edge; `bottom left` / `bottom right`: above\n * - `left pointing`: to the inline end (arrow on the menu's left); `right pointing`: to the start\n */\n .ui.pointing.dropdown {\n --_ui-dropdown-menu-offset: var(--_ui-dropdown-pointing-offset);\n }\n .ui.pointing.dropdown > .menu[popover] {\n position-area: block-end center;\n position-try-fallbacks: none;\n }\n .ui.pointing.dropdown > .menu:not([popover]) {\n margin-top: var(--_ui-dropdown-menu-offset);\n }\n .ui.pointing.dropdown > .menu::after {\n content: \"\";\n position: absolute;\n top: calc(var(--_ui-dropdown-arrow-size) / -2);\n left: 50%;\n z-index: 2;\n display: block;\n width: var(--_ui-dropdown-arrow-size);\n height: var(--_ui-dropdown-arrow-size);\n margin: 0 0 0 calc(var(--_ui-dropdown-arrow-size) / -2);\n background: var(--_ui-dropdown-menu-background);\n box-shadow: calc(var(--ui-border-width) * -1) calc(var(--ui-border-width) * -1) 0 0\n var(--_ui-dropdown-menu-border-color);\n rotate: 45deg;\n pointer-events: none;\n }\n .ui.pointing.dropdown > .menu:has(> .item:first-child:hover)::after {\n background: color-mix(in oklab, var(--_ui-dropdown-menu-background), var(--_ui-dropdown-item-background-hover));\n }\n /* top left */\n .ui[class*=\"top left pointing\"].dropdown > .menu[popover] {\n position-area: block-end span-inline-end;\n }\n .ui[class*=\"top left pointing\"].dropdown > .menu::after {\n left: var(--_ui-dropdown-pointing-edge);\n margin: 0;\n }\n /* top right */\n .ui[class*=\"top right pointing\"].dropdown > .menu[popover] {\n position-area: block-end span-inline-start;\n }\n .ui[class*=\"top right pointing\"].dropdown > .menu:not([popover]) {\n inset-inline: auto 0;\n }\n .ui[class*=\"top right pointing\"].dropdown > .menu::after {\n left: auto;\n right: var(--_ui-dropdown-pointing-edge);\n margin: 0;\n }\n /* left / right: beside the root, top edges aligned. */\n .ui[class*=\"left pointing\"]:not([class*=\"top left\"], [class*=\"bottom left\"]).dropdown > .menu[popover] {\n position-area: inline-end span-block-end;\n margin: 0 0 0 var(--_ui-dropdown-pointing-edge);\n }\n .ui[class*=\"right pointing\"]:not([class*=\"top right\"], [class*=\"bottom right\"]).dropdown > .menu[popover] {\n position-area: inline-start span-block-end;\n margin: 0 var(--_ui-dropdown-pointing-edge) 0 0;\n }\n .ui[class*=\"left pointing\"]:not([class*=\"top left\"], [class*=\"bottom left\"]).dropdown > .menu:not([popover]) {\n top: 0;\n left: 100%;\n right: auto;\n margin: 0 0 0 var(--_ui-dropdown-pointing-edge);\n }\n .ui[class*=\"right pointing\"]:not([class*=\"top right\"], [class*=\"bottom right\"]).dropdown > .menu:not([popover]) {\n top: 0;\n left: auto;\n right: 100%;\n margin: 0 var(--_ui-dropdown-pointing-edge) 0 0;\n }\n .ui[class*=\"left pointing\"]:not([class*=\"top left\"], [class*=\"bottom left\"]).dropdown > .menu::after {\n top: 1em;\n left: calc(var(--_ui-dropdown-arrow-size) / -2);\n margin: 0;\n rotate: -45deg;\n }\n .ui[class*=\"right pointing\"]:not([class*=\"top right\"], [class*=\"bottom right\"]).dropdown > .menu::after {\n top: 1em;\n left: auto;\n right: calc(var(--_ui-dropdown-arrow-size) / -2);\n margin: 0;\n rotate: 135deg;\n }\n /* bottom (and upward pointing): above the root. */\n .ui:is(\n [class*=\"bottom pointing\"],\n [class*=\"bottom left pointing\"],\n [class*=\"bottom right pointing\"],\n .pointing.upward\n ).dropdown\n > .menu:not([popover]) {\n top: auto;\n bottom: 100%;\n margin: 0 0 var(--_ui-dropdown-menu-offset);\n }\n .ui:is([class*=\"bottom pointing\"], .pointing.upward).dropdown > .menu[popover] {\n position-area: block-start center;\n }\n .ui[class*=\"bottom left pointing\"].dropdown > .menu[popover] {\n position-area: block-start span-inline-end;\n }\n .ui[class*=\"bottom right pointing\"].dropdown > .menu[popover] {\n position-area: block-start span-inline-start;\n }\n .ui:is(\n [class*=\"bottom pointing\"],\n [class*=\"bottom left pointing\"],\n [class*=\"bottom right pointing\"],\n .pointing.upward\n ).dropdown\n > .menu::after {\n top: auto;\n bottom: calc(var(--_ui-dropdown-arrow-size) / -2);\n rotate: -135deg;\n }\n .ui[class*=\"bottom left pointing\"].dropdown > .menu::after {\n left: var(--_ui-dropdown-pointing-edge);\n margin: 0;\n }\n .ui[class*=\"bottom right pointing\"].dropdown > .menu::after {\n left: auto;\n right: var(--_ui-dropdown-pointing-edge);\n margin: 0;\n }\n\n /* Simple: opens on hover / focus with no script; the menu is NOT a popover. */\n .ui.simple.dropdown > .menu {\n display: block;\n visibility: hidden;\n opacity: 0;\n transition:\n opacity var(--_ui-dropdown-duration) var(--ui-ease),\n visibility 0s var(--_ui-dropdown-duration);\n }\n\n /* Form states: `state=\"error\"` ... tint the box, text, menu border and items. */\n .ui.dropdown:is(.error, .info, .success, .warning),\n .ui.dropdown:is(.error, .info, .success, .warning) > .text {\n color: var(--ui-color-text);\n }\n .ui.selection.dropdown:is(.error, .info, .success, .warning) {\n --_ui-dropdown-border-color: var(--ui-color-border);\n --_ui-dropdown-border-color-hover: var(--ui-color-border);\n --_ui-dropdown-border-color-focus: var(--ui-color-border);\n background: var(--ui-color-background);\n }\n .ui.dropdown:is(.error, .info, .success, .warning) > .menu {\n --_ui-dropdown-menu-border-color: var(--ui-color-border);\n --_ui-dropdown-item-color: var(--ui-color-text);\n --_ui-dropdown-item-background-hover: var(--ui-color-background);\n --_ui-dropdown-item-background-selected: var(--ui-color-background);\n }\n .ui.dropdown:is(.error, .info, .success, .warning) > .default.text {\n color: color-mix(in oklab, var(--ui-color-text) 60%, transparent);\n }\n\n /* Inverted: for dark surfaces -- the dark scheme's tokens, whatever the page scheme. */\n .ui.inverted.dropdown {\n color-scheme: dark;\n }\n .ui.inverted.selection.dropdown {\n --_ui-dropdown-border-color: oklch(from var(--ui-ink-on-dark) l c h / 0.15);\n --_ui-dropdown-border-color-hover: oklch(from var(--ui-ink-on-dark) l c h / 0.25);\n }\n}\n\n/*******************************\n States\n*******************************/\n\n@layer ui.components.dropdown.states {\n /* Hover / focus / open: the selection box's border. */\n .ui.selection.dropdown:hover {\n border-color: var(--_ui-dropdown-border-color-hover);\n }\n .ui.selection.dropdown:is(:focus-within, .active, :has(> .menu:popover-open)) {\n border-color: var(--_ui-dropdown-border-color-focus);\n }\n .ui.selection.dropdown:is(:focus-within, .active, :has(> .menu:popover-open)) > :is(.dropdown, .search).icon {\n opacity: 1;\n }\n .ui.selection.dropdown:is(.active, :has(> .menu:popover-open)) {\n z-index: 10;\n }\n .ui.selection.dropdown:is(.active, :has(> .menu:popover-open)) > .text:not(.default) {\n color: var(--ui-text-hovered);\n }\n /* The search input shows its ring on the root, around the whole box. */\n .ui.dropdown:has(> input.search:focus-visible) {\n outline: var(--ui-focus-width, 2px) solid var(--ui-focus-color, Highlight);\n outline-offset: var(--ui-focus-offset, 2px);\n }\n\n /* Searching: the old text dims under the query; clicks go to the input. */\n .ui.search.dropdown:is(.active, :has(> .menu:popover-open)) > input.search {\n cursor: auto;\n }\n .ui.search.dropdown:is(.active, :has(> .menu:popover-open)) > .text {\n pointer-events: none;\n }\n .ui.search.dropdown > input.search:focus + .text {\n color: var(--_ui-dropdown-placeholder-focus-color);\n }\n .ui.search.dropdown > input.search:focus + .text > :is(.icon, .flag) {\n opacity: var(--ui-disabled-opacity);\n }\n\n /* Open: a popover menu while `:popover-open`; a plain one while the root is `active` or it's `visible`. */\n .ui.dropdown > .menu[popover]:popover-open,\n .ui.active.dropdown > .menu:not([popover]),\n .ui.dropdown > .visible.menu:not([popover]) {\n display: block;\n opacity: 1;\n }\n .ui.column.dropdown > .menu[popover]:popover-open,\n .ui.column.active.dropdown > .menu:not([popover]),\n .ui.column.dropdown > .visible.menu:not([popover]) {\n display: flex;\n }\n @starting-style {\n .ui.dropdown > .menu[popover]:popover-open {\n opacity: 0;\n }\n }\n .ui.simple.dropdown:is(:hover, :focus-within, .active) > .menu {\n visibility: visible;\n opacity: 1;\n transition-delay: 0s;\n }\n\n /* Items: hover, keyboard highlight (`selected`), chosen (`active`), disabled, filtered out. */\n .ui.dropdown .menu > .item:hover {\n z-index: 13;\n background: var(--_ui-dropdown-item-background-hover);\n color: var(--_ui-dropdown-item-color-hover);\n }\n .ui.dropdown .menu > .selected.item {\n background: var(--_ui-dropdown-item-background-selected);\n color: var(--_ui-dropdown-item-color-hover);\n }\n .ui.dropdown .menu > :is(.active, [aria-selected=\"true\"]).item {\n z-index: 12;\n color: var(--_ui-dropdown-item-color-hover);\n font-weight: var(--_ui-dropdown-item-font-weight-active);\n }\n .ui.dropdown .menu > :is(.disabled, [aria-disabled=\"true\"]).item {\n cursor: default;\n opacity: var(--_ui-dropdown-disabled-opacity);\n pointer-events: none;\n }\n .ui.dropdown .menu > .filtered.item {\n display: none;\n }\n\n /* Remove / delete icons brighten on hover. */\n .ui.dropdown > .remove.icon:hover,\n .ui.multiple.dropdown > .label > .delete.icon:hover {\n opacity: 1;\n }\n\n /* Loading: the caret becomes a spinner; no clearing while loading. */\n .ui.loading.dropdown > .dropdown.icon::before,\n .ui.loading.dropdown > .dropdown.icon::after {\n content: \"\";\n position: absolute;\n top: 50%;\n left: 50%;\n box-sizing: border-box;\n width: 1.1em;\n height: 1.1em;\n margin: -0.55em 0 0 -0.55em;\n border: var(--_ui-dropdown-loader-width) solid transparent;\n border-radius: var(--ui-radius-circle);\n background: none;\n clip-path: none;\n }\n .ui.loading.dropdown > .dropdown.icon::before {\n border-color: color-mix(in oklab, currentColor 20%, transparent);\n }\n .ui.loading.dropdown > .dropdown.icon::after {\n border-top-color: currentColor;\n animation: ui-dropdown-spin var(--_ui-dropdown-loader-speed) linear infinite;\n }\n .ui.loading.dropdown > .dropdown.icon > * {\n visibility: hidden;\n }\n .ui.loading.dropdown > .remove.icon {\n display: none;\n }\n\n /* Disabled / read-only: inert, and nothing to clear or delete. */\n .ui.disabled.dropdown {\n cursor: default;\n opacity: var(--_ui-dropdown-disabled-opacity);\n pointer-events: none;\n }\n .ui.read-only.dropdown {\n cursor: default;\n pointer-events: none;\n }\n .ui:is(.disabled, .read-only).dropdown > .remove.icon,\n .ui:is(.disabled, .read-only).dropdown > .label > .delete.icon {\n display: none;\n }\n}\n","import { For, Show } from \"solid-js\"\nimport { isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UI, UIT } from \"spell/ui/core\"\nimport { F } from \"spell/ui/forms\"\nimport { dropdownVocabulary } from \"./UIDropdown.en\"\nimport { DropdownFallback } from \"./UIDropdown.fallback\"\nimport { SlottedItems } from \"./SlottedItems\"\n\nimport buttonCSS from \"spell/ui/components/ui-button/UIButton.css?inline\"\nimport dropdownCSS from \"./UIDropdown.css?inline\"\n\n/****************\n * ### `UIDropdown`\n * The component behind `<ui-dropdown>`: a combobox and its listbox, to choose one value or several.\n *\n * - Its shadow DOM: a `<button>` combobox (with `search`, an `<input>`),\n * and an anchor-positioned popover menu.\n *\n * - Its options (`MenuOptions`):\n * the slotted `<ui-item>`s (`SlottedItems`), then the `options` property, then additions.\n * `@derived` members work out the visible list on each key\n * (leaving out chosen ones, filtering, adding the addition).\n *\n * - `value` and `open` are controlled (`@controlled`): the events go first, and a handler may cancel or override.\n * - Invoker commands (`<button commandfor=\"id\" command=\"--toggle\">`, `ToggleCommands`) open and close the menu,\n * as a person's action; a disabled or read-only dropdown ignores them.\n * - The menu's rows render only while it's open (`<For>`, keyed by option);\n * `aria-activedescendant` points at the highlighted row.\n * - Escape and outside clicks come from `UI.overlays`.\n * - A form control: `multiple` submits one `FormData` entry per value; `required` => `valueMissing`.\n * Named by `label`, else by the DOM element's `<label for>` / `aria-label` (`ControlLabels`).\n * - An option's `flag` draws through `UIT.Flags`, the rule `<ui-flag>` draws with.\n * Fomantic's country names (`france`) are `<ui-flag>`'s alone, so a flag that isn't a code shows as its text.\n *\n * - In a static server render (`spell/ui/static`):\n * - the menu is closed, with its rows rendered (their text is in the page)\n * - the `<ui-item>`s are dropped\n * - the value goes in hidden inputs, so a static form submits it\n * - choosing needs script\n ****************/\nexport class UIDropdown extends F.FormComponent<typeof dropdownVocabulary> {\n /**\n * Rows PageUp / PageDown move.\n * - `@proto`: a subclass or an instance may set its own.\n */\n declare pageSize: number\n\n /**\n * How long type-ahead keeps what was typed, in ms: a key after a longer pause starts a new search.\n * - `@proto`: a subclass or an instance may set its own (a test, a shorter one).\n */\n declare typeAheadDelay: number\n\n @E.proto static vocabulary = dropdownVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { button: buttonCSS, dropdown: dropdownCSS },\n cssStates: [\"fluid\"],\n Fallback: DropdownFallback,\n // `loading`: a spinner in place of its dropdown icon\n loading: \"its own\"\n } satisfies Partial<E.ElementSetup>\n\n /** Default: 10 rows. */\n @E.proto static pageSize = 10\n\n /** Default: 500 ms. */\n @E.proto static typeAheadDelay = 500\n\n ////////////////\n // ## Options\n ////////////////\n\n /** Options from slotted `<ui-item>`s. */\n readonly items = new SlottedItems(this.domElement)\n\n /** Which slots have light-DOM children (`icon`, `trigger`, `header`). */\n readonly slots = new E.SlotContent(this.domElement)\n\n /** Values added with `allow-additions`, as options. */\n @E.state accessor addedOptions: readonly E.MenuOption[] = []\n\n /** `options` property, validated to an array. */\n get propertyOptions(): UIT.DropdownOptions {\n const options = this.options\n return Array.isArray(options) ? (options as UIT.DropdownOptions) : []\n }\n\n /** Every option: slotted, then `options`, then additions; the same list while equal. */\n @E.derived({ equals: E.isSameList })\n get allOptions(): readonly E.MenuOption[] {\n return [...this.items.entries.filter(UIDropdown.isOption), ...this.propertyOptions, ...this.addedOptions]\n }\n\n /** Option by value, for texts of chosen values. */\n @E.derived\n get optionsByValue(): ReadonlyMap<string, E.MenuOption> {\n return new Map(this.allOptions.map((option) => [option.value, option]))\n }\n\n /** Search-key cache shared by every `MenuOptions` this element derives. */\n private readonly keys = new WeakMap() as NonNullable<F.MenuOptionsProps[\"keys\"]>\n\n ////////////////\n // ## Value\n ////////////////\n\n /** `value`: set by the page, or chosen; starts from the `selected` items (so it's below `items`). */\n @E.controlled(\"value\")\n accessor value = this.items.selectedValue(!!this.multiple)\n\n /** The page's value to restore on a form reset (`undefined`: back to the `selected` items). */\n private readonly initialValue = this.isControlledByPage(\"value\") ? this.value : undefined\n\n /** Chosen values, always as an array; the same list while equal. */\n @E.derived({ equals: E.isSameList })\n get chosenValues(): readonly string[] {\n return SlottedItems.valuesIn(this.value, !!this.multiple)\n }\n\n /** Chosen values as a set, for row state. */\n @E.derived\n get chosenValueSet(): ReadonlySet<string> {\n return new Set(this.chosenValues)\n }\n\n /** Text of `value`: its option's, else `text` (single), else the value itself. */\n private textFor(value: string): string {\n return this.optionsByValue.get(value)?.text ?? (this.multiple ? undefined : this.label) ?? value\n }\n\n /** Room for another value (`max-selections`)? */\n private get hasRoomForMore(): boolean {\n const max = this.maxSelections\n return !this.multiple || max === undefined || this.chosenValues.length < max\n }\n\n /** Choose `option` (or add the addition), as the person did with `originalEvent`. */\n @E.untracked\n select(option: E.MenuOption, originalEvent?: Event) {\n if (option.disabled || this.readonly) return\n const values = this.chosenValues\n const isAddition = \"addition\" in option\n if (this.multiple) {\n if (!this.hasRoomForMore) return\n const next = [...values, option.value]\n this.commit(next, originalEvent, () => this.send(\"ui-added\", { value: option.value, originalEvent }))\n this.query = \"\"\n this.highlighted.index = 0\n } else {\n this.commit([option.value], originalEvent, () => {\n if (isAddition) this.send(\"ui-added\", { value: option.value, originalEvent })\n })\n this.requestOpen(false, originalEvent)\n }\n if (isAddition) this.addedOptions = [...this.addedOptions, { value: option.value, text: option.text }]\n }\n\n /** Remove one chosen value (multiple). */\n @E.untracked\n remove(value: string, originalEvent?: Event) {\n if (this.readonly || this.isDisabled) return\n const next = this.chosenValues.filter((item) => item !== value)\n this.commit(next, originalEvent, () => this.send(\"ui-removed\", { value, originalEvent }))\n }\n\n /**\n * Change the value to `next` through `requestChange()`: `announce()` (ui-added / ui-removed) and `ui-changed` first.\n * - Returns true when applied.\n */\n private commit(next: readonly string[], originalEvent: Event | undefined, announce?: () => void): boolean {\n const value = this.multiple ? [...next] : (next[0] ?? \"\")\n return this.requestChange(\"value\", value, () => {\n announce?.()\n this.send(\"ui-changed\", { value, originalEvent })\n return true\n })\n }\n\n ////////////////\n // ## The form\n ////////////////\n\n get formValue(): E.FieldValue {\n const values = this.chosenValues\n return this.multiple ? values : (values[0] ?? null)\n }\n\n /** Back to the starting value; clears the query. */\n onFormReset() {\n this.value = this.initialValue\n this.query = \"\"\n }\n\n protected get validationLabel(): string | undefined {\n return this.accessibleName\n }\n\n protected get validationAnchor(): HTMLElement | undefined {\n return this.combobox\n }\n\n ////////////////\n // ## Search\n ////////////////\n\n /** Search query. */\n @E.state accessor query = \"\"\n\n /** The effective query: only with `search`. */\n get effectiveQuery(): string {\n return this.search ? this.query : \"\"\n }\n\n /** Type-ahead buffer: what was typed since the last pause. */\n private typedSoFar = \"\"\n\n /** Clears `typedSoFar` after `typeAheadDelay`. */\n private typeAheadTimer?: E.CancelablePromise<unknown>\n\n /** Type-ahead: extend the buffer, highlight the next match (opening first if needed). */\n @E.untracked\n private typeAhead(key: string, event: KeyboardEvent) {\n this.typeAheadTimer?.cancel()\n this.typedSoFar += key\n this.typeAheadTimer = E.after(this.typeAheadDelay / 1000, () => (this.typedSoFar = \"\"))\n if (!this.isOpen) this.requestOpen(true, event)\n const options = this.visibleOptions\n const index = options.selectionForKey(this.typedSoFar, this.highlighted.index)\n if (index >= 0) this.highlighted.index = index\n }\n\n ////////////////\n // ## The menu rows\n ////////////////\n\n /** Options offered now: minus chosen (multiple), filtered, plus the addition. */\n @E.derived\n get visibleOptions(): F.MenuOptions {\n const query = this.effectiveQuery\n return new F.MenuOptions({ options: this.allOptions, keys: this.keys })\n .excludeSelected(this.multiple ? this.chosenValues : [])\n .filter(query, { minCharacters: this.minCharacters ?? 0 })\n .withAdditions(query, { allowAdditions: this.allowAdditions && this.hasRoomForMore })\n }\n\n /** Menu rows: separators in place unless searching, else the visible options; the same list while equal. */\n @E.derived({ equals: E.isSameList })\n get menuRows(): readonly (E.MenuEntry | E.MenuAddition)[] {\n const visible = this.visibleOptions\n const entries = this.items.entries\n if (this.effectiveQuery || !entries.some((entry) => \"type\" in entry)) return visible.options\n const shown = new Set<E.MenuOption>(visible.options)\n const rows: (E.MenuEntry | E.MenuAddition)[] = entries.filter((entry) => \"type\" in entry || shown.has(entry))\n const slotted = new Set<E.MenuEntry>(entries)\n for (const option of visible.options) if (!slotted.has(option)) rows.push(option)\n return rows\n }\n\n /**\n * The highlighted row of `visibleOptions.options`.\n * - Fomantic's `selected` class marks it; its `active` is the CHOSEN option.\n */\n readonly highlighted = new F.HighlightedOption(() => this.visibleOptions.options)\n\n /** Highlighted option. */\n get highlightedOption(): E.MenuOption | undefined {\n return this.highlighted.option as E.MenuOption | undefined\n }\n\n /** Open: keep the highlighted row in view. */\n @E.onChange(\"isOpen\", \"highlightedOption\")\n protected onHighlightChanged(isOpen: boolean, option: E.MenuOption | undefined) {\n // `menu`: rendered, so `idFor()` has the menu's id to build on\n if (!isOpen || !option || !this.menu) return\n this.domElement.renderRoot.getElementById(this.idFor(option))?.scrollIntoView({ block: \"nearest\" })\n }\n\n /** Stable DOM id of `option`'s row, made on first ask. */\n private idFor(option: E.MenuOption): string {\n let id = this.optionIds.get(option)\n if (!id) this.optionIds.set(option, (id = `${this.ids.menu}-${++UIDropdown.optionCounter}`))\n return id\n }\n\n /** Stable DOM id per option. */\n private readonly optionIds = new WeakMap<E.MenuOption, string>()\n\n ////////////////\n // ## Open\n ////////////////\n\n /** `open`: set by the page, or opened and closed by a person; `:state(open)`. */\n @E.cssState(\"open\")\n @E.controlled(\"open\")\n accessor isOpen = false\n\n /**\n * The menu, a popover panel on `isOpen`: `ui-opening` / `ui-closing`, the overlay entry, the anchor.\n * - Never opens while disabled or readonly.\n * - Opening highlights the chosen option, else the first enabled one; closing clears the query.\n */\n readonly popover = new E.PopoverPanel({\n component: this,\n member: \"isOpen\",\n restoreFocus: false,\n canChange: (open) => !open || !(this.isDisabled || this.readonly),\n onChange: (open) => this.onOpenedOrClosed(open)\n })\n\n /** Open or close as a person would (`popover.request()`); true when it changed. */\n requestOpen(open: boolean, originalEvent?: Event): boolean {\n return this.popover.request(open, originalEvent)\n }\n\n /** Opened: highlight the chosen option, else the first enabled one; closed: clear the query. */\n @E.untracked\n private onOpenedOrClosed(open: boolean) {\n if (!open) {\n this.query = \"\"\n return\n }\n const options = this.visibleOptions\n const chosen = options.options.findIndex((option) => this.chosenValueSet.has(option.value))\n if (chosen >= 0) this.highlighted.index = chosen\n else this.highlighted.moveTo(\"first\")\n }\n\n /**\n * The menu shows while open AND connected, once rendered (`PopoverPanel.follow()`).\n * - `isConnected`: `keepAlive` keeps an open dropdown's state when it's removed,\n * but the page must not keep its overlay entry (Escape / outside clicks) for an element that isn't there;\n * reconnecting re-registers.\n * - `isReady`: the menu renders only then; an element opened before shows it as it arrives.\n */\n @E.onChange(\"isOpen\", \"isConnected\", \"isReady\")\n protected onOpenChanged(isOpen: boolean, isConnected: boolean, isReady: boolean) {\n return this.popover.follow(this.menu, isOpen && isConnected && isReady)\n }\n\n ////////////////\n // ## Name and classes\n ////////////////\n\n /**\n * Name of the combobox and its listbox:\n * `label`, else what names the DOM element (`labels`: `<label for>`, `aria-label` ...).\n */\n private get accessibleName(): string | undefined {\n return this.fallbackName || this.labels.accessibleName\n }\n\n protected classValue(name: E.AttributeName<typeof dropdownVocabulary>): unknown {\n if (name === \"open\") return this.isOpen\n return super.classValue(name)\n }\n\n ////////////////\n // ## Rendering\n ////////////////\n\n /** Ids, from `UI.ids` once rendering. */\n private ids = { menu: \"\", text: \"\" }\n\n /** The combobox: the trigger button, or the search input. */\n private combobox?: HTMLElement\n\n /** The listbox popover. */\n private menu?: HTMLElement\n\n render(): JSX.Element {\n this.ids = { menu: UI.ids.next(ID_PREFIX), text: UI.ids.next(ID_PREFIX) }\n return (\n <div class={this.rootClass} style={this.popover.anchorStyle} onClick={this.onRootClick}>\n <Show when={this.multiple}>\n <For each={this.chosenValues}>{(value) => this.chip(value)}</For>\n </Show>\n <Show when={this.search} fallback={this.trigger()}>\n {this.searchInput()}\n <Show when={this.multiple}>\n <span class={SIZER} aria-hidden=\"true\">\n {this.query}\n </span>\n </Show>\n </Show>\n <Show when={this.labeled && this.icon}>{this.labeledIcon()}</Show>\n <span\n id={this.ids.text}\n class={[UIT.TEXT, { [DEFAULT]: this.placeholderIsShowing, [FILTERED]: !!this.effectiveQuery }]}\n part={this.partForName(\"text\")}\n >\n <slot name={this.slotForName(\"trigger\")}>{this.displayText}</slot>\n </span>\n <Show when={this.clearable && this.chosenValues.length && !this.readonly}>\n <button\n type=\"button\"\n class={CLEAR_ICON}\n part={this.partForName(\"clear\")}\n aria-label={this.translationForKey(\"clear\")}\n onClick={this.onClear}\n />\n </Show>\n <span class={CARET_ICON} part={this.partForName(\"icon\")}>\n <Show when={this.slots.hasContent(this.slotForName(\"icon\"))}>\n <slot name={this.slotForName(\"icon\")} />\n </Show>\n </span>\n {this.listbox()}\n {isServer ? this.staticValues() : <slot hidden />}\n </div>\n )\n }\n\n /** Name for the combobox and listbox when nothing else names it: `placeholder`, else `label`, else `name`. */\n private get fallbackName(): string {\n return this.placeholder ?? this.label ?? this.name ?? \"\"\n }\n\n /** Text shown in `.text`: chosen text (single), else `label` (a menu's fixed label), else the placeholder. */\n private get displayText(): string {\n const [first] = this.chosenValues\n if (first !== undefined && !this.multiple) return this.textFor(first)\n return this.label ?? this.placeholder ?? \"\"\n }\n\n /** Showing the placeholder (grey `default` text)? */\n private get placeholderIsShowing(): boolean {\n return !this.chosenValues.length && this.label === undefined\n }\n\n /** `direction` holds `left`: the menu extends leftward (`.left.menu`). */\n private get opensLeft(): boolean {\n return String(this.direction ?? \"\")\n .split(E.WHITESPACE)\n .includes(UIT.LEFT)\n }\n\n /** `appearance=\"simple\"`: opens on hover / focus, with no script and no popover. */\n private get isSimple(): boolean {\n return String(this.appearance ?? \"\")\n .split(E.WHITESPACE)\n .includes(SIMPLE)\n }\n\n /** Combobox role and ARIA, shared by the trigger and the search input; the static render's control mark. */\n private get comboboxAttributes() {\n const highlighted = this.highlightedOption\n return {\n role: \"combobox\",\n \"aria-expanded\": this.popover.ariaExpanded,\n \"aria-controls\": this.ids.menu,\n \"aria-haspopup\": \"listbox\",\n \"aria-activedescendant\": this.isOpen && highlighted ? this.idFor(highlighted) : undefined,\n \"aria-label\": this.accessibleName,\n \"aria-describedby\": this.ids.text,\n \"aria-busy\": this.loading ? \"true\" : undefined,\n \"aria-readonly\": this.readonly ? \"true\" : undefined,\n \"aria-required\": this.required ? \"true\" : undefined,\n \"aria-invalid\": this.validation.valid ? undefined : \"true\",\n [UIT.STATIC_CONTROL]: isServer ? \"\" : undefined\n } as const\n }\n\n /** The covering `<button>` combobox. */\n private trigger(): JSX.Element {\n return (\n <button\n ref={(element) => (this.combobox = element)}\n type=\"button\"\n class={TRIGGER}\n part={this.partForName(\"trigger\")}\n disabled={this.isDisabled}\n {...this.comboboxAttributes}\n onClick={this.onTriggerClick}\n onKeyDown={this.onKeyDown}\n onBlur={this.onBlur}\n />\n )\n }\n\n /** The search `<input>` combobox. */\n private searchInput(): JSX.Element {\n return (\n <input\n ref={(element) => (this.combobox = element)}\n class={SEARCH}\n part={this.partForName(\"search\")}\n autocomplete=\"off\"\n aria-autocomplete=\"list\"\n disabled={this.isDisabled}\n readonly={this.readonly}\n value={this.query}\n {...this.comboboxAttributes}\n onInput={this.onInput}\n onClick={this.onTriggerClick}\n onKeyDown={this.onKeyDown}\n onBlur={this.onBlur}\n />\n )\n }\n\n /** A chosen value's label, with its delete button (multiple). */\n private chip(value: string): JSX.Element {\n return (\n <span class={CHIP} part={this.partForName(\"label\")}>\n {this.textFor(value)}\n <Show when={!this.readonly && !this.isDisabled}>\n <button\n type=\"button\"\n class={DELETE_ICON}\n tabindex=\"-1\"\n aria-label={this.translationForKey(\"removeValue\", { value: this.textFor(value) })}\n onClick={(event) => this.remove(value, event)}\n />\n </Show>\n </span>\n )\n }\n\n /** The icon block of a `labeled` (icon) dropdown button. */\n private labeledIcon(): JSX.Element {\n return this.iconBox(this.icon)\n }\n\n /** An icon box drawing `name`: once loaded in a browser, at once on a server. */\n private iconBox(name: string | undefined): JSX.Element {\n if (isServer) return <span class={UIT.ICON}>{new E.IconGlyph({ owner: this, name: () => name }).svg}</span>\n return <span class={UIT.ICON} ref={(element) => void UIDropdown.fillIcon(element, name)} />\n }\n\n /**\n * Server render only: the value as hidden inputs (one per value), so a static form submits it without JS.\n * - Why not the combobox: a `<button>` submits nothing, and a search input holds the query.\n */\n private staticValues(): JSX.Element {\n return (\n <Show when={this.name}>\n {(name) => (\n <For each={this.chosenValues}>\n {(value) => <input type=\"hidden\" name={name()} value={value} disabled={this.isDisabled} />}\n </For>\n )}\n </Show>\n )\n }\n\n /** The listbox popover. */\n private listbox(): JSX.Element {\n return (\n <div\n ref={(element) => (this.menu = element)}\n id={this.ids.menu}\n class={[MENU, { [UIT.LEFT]: this.opensLeft }]}\n style={this.popover.panelStyle}\n role=\"listbox\"\n // a server render can't show a popover: an open menu is a plain one, shown by the root's `active`\n popover={this.isSimple || (isServer && this.isOpen) ? undefined : \"manual\"}\n part={this.partForName(\"menu\")}\n aria-label={this.accessibleName}\n aria-multiselectable={this.multiple ? \"true\" : undefined}\n onMouseDown={UIDropdown.preventDefault}\n >\n <slot name={this.slotForName(\"header\")} />\n {/* a server render's rows: the text is in the page, the menu stays closed */}\n <Show when={this.isOpen || this.isSimple || isServer}>\n <For each={this.menuRows}>{(row) => this.row(row)}</For>\n <Show when={!this.visibleOptions.length}>\n {/* an option (disabled) rather than a bare div: a listbox must own options (axe `aria-required-children`) */}\n <div class={UIT.MESSAGE} role=\"option\" aria-disabled=\"true\" aria-selected=\"false\">\n {this.noResultsText ?? this.translationForKey(\"noResults\")}\n </div>\n </Show>\n </Show>\n </div>\n )\n }\n\n /** One menu row. */\n private row(row: E.MenuEntry | E.MenuAddition): JSX.Element {\n if (\"type\" in row) return this.separator(row)\n if (\"addition\" in row) return this.addition(row)\n const option = row\n const slot = this.items.slots.get(option)\n return (\n <div\n id={this.idFor(option)}\n class={[\n UIT.ITEM,\n {\n [UIT.ACTIVE]: this.chosenValueSet.has(option.value),\n [UIT.SELECTED]: this.highlightedOption === option,\n [UIT.DISABLED]: !!option.disabled\n }\n ]}\n role=\"option\"\n part={this.partForName(\"item\")}\n aria-selected={this.chosenValueSet.has(option.value) ? \"true\" : \"false\"}\n aria-disabled={option.disabled ? \"true\" : undefined}\n onPointerMove={() => this.highlighted.highlight(option)}\n onClick={(event) => this.select(option, event)}\n >\n <Show when={slot} fallback={this.optionContent(option)}>\n <slot name={slot} />\n </Show>\n </div>\n )\n }\n\n /** Icon / image / flag, text with `<mark>`ed matches, description. */\n private optionContent(option: E.MenuOption): JSX.Element {\n return (\n <>\n <Show when={typeof option.icon === \"string\"}>{this.iconBox(option.icon as string)}</Show>\n <Show when={typeof option.image === \"string\"}>\n <img class={AVATAR_IMAGE} src={option.image as string} alt=\"\" />\n </Show>\n <Show when={typeof option.flag === \"string\"}>\n <span class={FLAG}>{UIT.Flags.emojiFor(option.flag as string) || (option.flag as string)}</span>\n </Show>\n <Show when={option.description}>\n <span class={UIT.DESCRIPTION}>{option.description}</span>\n </Show>\n <span class={UIT.TEXT}>{this.markedText(option)}</span>\n </>\n )\n }\n\n /** `option.text` with the query's matches in `<mark>`. */\n private markedText(option: E.MenuOption): JSX.Element {\n const query = this.effectiveQuery\n if (!query) return option.text\n return E.markedPieces(option.text, this.visibleOptions.highlights(option, query)).map((piece) =>\n piece.isMarked ? <mark>{piece.text}</mark> : piece.text\n )\n }\n\n /** The \"Add …\" row of `allow-additions`. */\n private addition(option: E.MenuAddition): JSX.Element {\n const template = this.additionText ?? this.translationForKey(\"addItem\")\n const [before = \"\", after = \"\"] = template.split(VALUE_PLACEHOLDER)\n return (\n <div\n id={this.idFor(option)}\n class={[UIT.ITEM, ADDITION, { [UIT.SELECTED]: this.highlightedOption === option }]}\n role=\"option\"\n part={this.partForName(\"item\")}\n aria-selected=\"false\"\n onPointerMove={() => this.highlighted.highlight(option)}\n onClick={(event) => this.select(option, event)}\n >\n {before}\n <b>{option.text}</b>\n {after}\n </div>\n )\n }\n\n /** Header or divider row. */\n private separator(entry: E.MenuSeparator): JSX.Element {\n return entry.type === DIVIDER ? (\n <hr class={DIVIDER} role=\"presentation\" />\n ) : (\n <div class={UIT.HEADER} role=\"presentation\">\n {entry.text}\n </div>\n )\n }\n\n ////////////////\n // ## Handlers\n ////////////////\n\n /**\n * An invoker command aimed at the DOM element (`ToggleCommands`):\n * a person's action, ignored when disabled or read-only.\n * - Opening focuses the combobox, as opening it by keyboard leaves it (the keys need it).\n */\n @E.on(\"command\")\n protected onCommand(event: Event) {\n if (this.isDisabled || this.readonly) return\n const action = UIT.ToggleCommands.action(event, this.isOpen)\n if (action === \"show\") {\n this.combobox?.focus({ preventScroll: true })\n this.requestOpen(true, event)\n } else if (action === \"close\") this.requestOpen(false, event)\n }\n\n /** Trigger / input click: toggle (the input only opens). */\n @E.untracked\n private readonly onTriggerClick = (event: MouseEvent) => {\n // Safari doesn't focus a <button> on a mouse click, and the keys (arrows, Enter, Escape) need focus here\n // (`detail` is 0 for a keyboard or scripted click, which has the focus it needs, or none to give)\n if (event.detail > 0) this.combobox?.focus({ preventScroll: true })\n if (this.search && this.isOpen) return\n this.requestOpen(!this.isOpen, event)\n }\n\n /** Click on the root outside the combobox (caret, text of a search dropdown): focus + toggle. */\n @E.untracked\n private readonly onRootClick = (event: MouseEvent) => {\n const target = event.composedPath()[0]\n if (!this.search || target === this.combobox || this.menu?.contains(target as Node)) return\n if ((target as Element).closest?.(\"button\")) return\n this.combobox?.focus()\n this.requestOpen(!this.isOpen, event)\n }\n\n /** Clear button. */\n private readonly onClear = (event: MouseEvent) => {\n event.stopPropagation()\n this.commit([], event)\n }\n\n /** Search typing: filter, open, highlight the first match, `ui-searched`. */\n private readonly onInput = (event: InputEvent) => {\n const query = (event.currentTarget as HTMLInputElement).value\n this.query = query\n this.requestOpen(true, event)\n this.highlighted.index = 0\n this.send(\"ui-searched\", { query, originalEvent: event })\n }\n\n /**\n * Leaving the combobox closes the menu, unless focus stays inside,\n * or moves to (or is lost by a press on) one of this dropdown's invoker buttons.\n * - That button's `command` decides,\n * so `--toggle` closes an open menu instead of closing it here and reopening it.\n */\n private readonly onBlur = (event: FocusEvent) => {\n const next = event.relatedTarget as Node | null\n if (next && (this.domElement.contains(next) || this.domElement.renderRoot.contains(next))) return\n const id = this.domElement.id\n if (id && (next as Element | null)?.closest?.(`[commandfor=\"${CSS.escape(id)}\"]`)) return\n if (this.isReady && UI.overlays.pressedInvokerOf(this.domElement)) return\n this.requestOpen(false, event)\n }\n\n /** Combobox keyboard pattern (APG), plus type-ahead and Backspace-removes-last. */\n @E.untracked\n private readonly onKeyDown = (event: KeyboardEvent) => {\n if (this.isDisabled || event.defaultPrevented) return\n const isOpen = this.isOpen\n const { key } = event\n switch (key) {\n case UIT.Key.arrowDown:\n case UIT.Key.arrowUp:\n event.preventDefault()\n if (!isOpen) this.requestOpen(true, event)\n else this.highlighted.move(key === UIT.Key.arrowDown ? 1 : -1)\n return\n case UIT.Key.home:\n case UIT.Key.end:\n if (!isOpen) return\n event.preventDefault()\n this.highlighted.moveTo(key === UIT.Key.home ? \"first\" : \"last\")\n return\n case UIT.Key.pageDown:\n case UIT.Key.pageUp:\n if (!isOpen) return\n event.preventDefault()\n this.highlighted.move(key === UIT.Key.pageDown ? this.pageSize : -this.pageSize)\n return\n case UIT.Key.enter: {\n if (!isOpen) {\n if (this.search) this.requestOpen(true, event)\n return\n }\n event.preventDefault()\n const visible = this.visibleOptions\n const option = this.highlightedOption ?? visible.addition\n if (option) this.select(option, event)\n return\n }\n case UIT.Key.space: {\n if (this.search || !isOpen) return\n event.preventDefault()\n const option = this.highlightedOption\n if (option) this.select(option, event)\n return\n }\n case UIT.Key.tab:\n if (isOpen) this.requestOpen(false, event)\n return\n case UIT.Key.backspace: {\n const values = this.chosenValues\n if (this.search && this.multiple && !this.query && values.length) {\n this.remove(values.at(-1)!, event)\n }\n return\n }\n }\n if (!this.search && key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {\n event.preventDefault()\n this.typeAhead(key, event)\n }\n }\n\n ////////////////\n // ## Statics\n ////////////////\n\n /**\n * Counter behind option ids.\n * - STATIC: page-wide, so two dropdowns never share an id.\n */\n private static optionCounter = 0\n\n /**\n * Is `entry` an option (not a separator)?\n * - STATIC: pure, a `filter()` predicate.\n */\n private static isOption(entry: E.MenuEntry): entry is E.MenuOption {\n return !(\"type\" in entry)\n }\n\n /**\n * `preventDefault()`: menu presses must not take focus from the combobox.\n * - STATIC: one handler for every instance.\n */\n private static preventDefault(event: Event) {\n event.preventDefault()\n }\n\n /**\n * Draw icon `name` from the packs `element` sees (its `<ui-root icons>`, else `UI.icons`) into it, once loaded.\n * - Plain DOM, no signal: rows are many and their icons never change.\n * - NEVER rejects (fire-and-forget), as `IconGlyph` does:\n * a runtime chunk or icon that won't load draws no icon, not a page error.\n * - STATIC: needs no instance, only the element.\n */\n private static async fillIcon(element: HTMLElement, name: string | undefined) {\n if (!name) return\n try {\n const icons = E.IconGlyph.packsFor(element, (await UI.load()).icons)\n const template = icons.peek(name) ?? (await icons.get(name))\n if (template) element.replaceChildren(E.IconGlyph.draw(template))\n } catch {\n // no icon\n }\n }\n}\n\n/**\n * The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`).\n * - Minus `value`: the `@controlled` member of that name wins over its getter, and holds a `string[]` too.\n */\nexport interface UIDropdown extends Omit<E.AttributeValues<typeof dropdownVocabulary>, \"value\"> {}\n\n////////////////\n// ## Constants\n////////////////\n\n/** `UI.ids` prefix. */\nconst ID_PREFIX = \"ui-dropdown\"\n\n/** Placeholder in the `addItem` text. */\nconst VALUE_PLACEHOLDER = \"{value}\"\n\n/**\n * Class words of the markup contract (`UIDropdown.css`) -- grammar, not attributes, so not in the vocabulary.\n * - NOTE: `active` === chosen, `selected` === highlighted: Fomantic's meanings.\n */\nconst DEFAULT = \"default\"\n\n/** Class word of the text while a search filters. */\nconst FILTERED = \"filtered\"\n\n/** Class word of the listbox. */\nconst MENU = \"menu\"\n\n/** Class word of the \"Add …\" row. */\nconst ADDITION = \"addition\"\n\n/** Class words of a divider row; also `<ui-item kind=\"divider\">`. */\nconst DIVIDER = \"divider\"\n\n/** Class word of the covering trigger button. */\nconst TRIGGER = \"trigger\"\n\n/** Class word of the search input. */\nconst SEARCH = \"search\"\n\n/** Class word of the hidden span that sizes a `multiple` search input to its query. */\nconst SIZER = \"sizer\"\n\n/** The `appearance` word of a dropdown that opens on hover, with no popover. */\nconst SIMPLE = \"simple\"\n\n/** Class words of the clear button. */\nconst CLEAR_ICON = \"remove icon\"\n\n/** Class words of the caret. */\nconst CARET_ICON = \"dropdown icon\"\n\n/** Class words of a chosen value's label (`multiple`). */\nconst CHIP = \"ui label\"\n\n/** Class words of a chip's delete button. */\nconst DELETE_ICON = \"delete icon\"\n\n/** Class words of an option's `image`. */\nconst AVATAR_IMAGE = \"ui avatar image\"\n\n/** Class word of an option's `flag`. */\nconst FLAG = \"flag\"\n","/**\n * The dropdown family: defines `<ui-dropdown>`, and exports its component.\n * - Also the `dropdown` lib entry (`spell/ui/ui-dropdown`), measured in `notes/report.md`.\n * - SIDE EFFECT: importing it defines `<ui-item>` (through `spell/ui/components/ui-item`, first,\n * so the dropdown can read upgraded items), then `<ui-dropdown>`.\n * - `UIItem` belongs to the `item` family (`spell/ui/ui-item`, shared with list and menu):\n * it isn't exported here.\n */\n\nimport { UIDropdown } from \"./UIDropdown\"\n\nimport \"spell/ui/components/ui-item\"\n\nUIDropdown.define()\n\nexport { UIDropdown }\n"],"mappings":";;;;;;;;;AAiBA,IAAagJ,IAAqB;CAChC,KAAK;CACL,aAAa;CACb,QAAQ;EAAC;EAAS;EAAU;EAAa;EAAS;EAAY;EAAS;CAAS;CAChF,KAAK;EAAC;EAAU;EAAY;EAAU;EAAgB;EAAe;CAAc;CACnF,UAAU;CACV,MAAM;CACN,aAAa;CACb,YAAY;EACV;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,QAAQ;IAAC;IAAS;IAAQ;IAAW;GAAS;GAC9C,aAAa;EACf;EACA;GAAE,MAAM;GAAa,OAAO;GAAc,MAAM;GAAW,aAAa;EAAgC;EACxG;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GAAE,MAAM;GAAY,OAAO;GAAQ,MAAM;GAAW,aAAa;EAA2C;EAC5G;GAAE,MAAM;GAAU,OAAO;GAAU,MAAM;GAAW,aAAa;EAA4B;EAC7F;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GAAE,MAAM;GAAU,OAAO;GAAc,MAAM;GAAW,aAAa;EAAwC;EAC7G;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,KAAK;GACL,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,QAAQ,CAAC,SAAS;GAClB,UAAU,CAAC;IA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WAGVC,KAAW,YAGXuC,KAAO,QAGPqB,KAAW,YAGXC,KAAU,WAGV9C,KAAU,WAGVK,KAAS,UAGTlC,KAAQ,SAGRwB,KAAS,UAGTpB,KAAa,eAGbW,KAAa,iBAGb0B,KAAO,YAGPD,KAAc,eAGdoB,KAAe,mBAGfE,KAAO;;;;;;;IC33BbmB,GAAW,OAAO"}
1
+ {"version":3,"file":"ui-dropdown.js","names":["_vocabulary_dec","_a","_init","E.NativeFallback","E.proto","__name","this","<Show when={this.multiple}>\n <For each={this.chosenValues}>{(value) => this.chip(value)}</For>\n </Show>","<For each={this.chosenValues}>{(value) => this.chip(value)}</For>","<div class={this.rootClass} style={this.popover.anchorStyle} onClick={this.onRootClick}>\n <Show when={this.multiple}>\n <For each={this.chosenValues}>{(value) => this.chip(value)}</For>\n </Show>\n <Show when={this.search} fallback={this.trigger()}>\n {this.searchInput()}\n <Show when={this.multiple}>\n <span class={SIZER} aria-hidden=\"true\">\n {this.query}\n </span>\n </Show>\n </Show>\n <Show when={this.labeled && this.icon}>{this.labeledIcon()}</Show>\n <span\n id={this.ids.text}\n class={[UIT.TEXT, { [DEFAULT]: this.placeholderIsShowing, [FILTERED]: !!this.effectiveQuery }]}\n part={this.partForName(\"text\")}\n >\n <slot name={this.slotForName(\"trigger\")}>{this.displayText}</slot>\n </span>\n <Show when={this.clearable && this.chosenValues.length && !this.readonly}>\n <button\n type=\"button\"\n class={CLEAR_ICON}\n part={this.partForName(\"clear\")}\n aria-label={this.translationForKey(\"clear\")}\n onClick={this.onClear}\n />\n </Show>\n <span class={CARET_ICON} part={this.partForName(\"icon\")}>\n <Show when={this.slots.hasContent(this.slotForName(\"icon\"))}>\n <slot name={this.slotForName(\"icon\")} />\n </Show>\n </span>\n {this.listbox()}\n {isServer ? this.staticValues() : <slot hidden />}\n </div>","<Show when={this.search} fallback={this.trigger()}>\n {this.searchInput()}\n <Show when={this.multiple}>\n <span class={SIZER} aria-hidden=\"true\">\n {this.query}\n </span>\n </Show>\n </Show>","this.searchInput()","<Show when={this.multiple}>\n <span class={SIZER} aria-hidden=\"true\">\n {this.query}\n </span>\n </Show>","<span class={SIZER} aria-hidden=\"true\">\n {this.query}\n </span>","<Show when={this.labeled && this.icon}>{this.labeledIcon()}</Show>","this.labeled && this.icon","<Show when={this.clearable && this.chosenValues.length && !this.readonly}>\n <button\n type=\"button\"\n class={CLEAR_ICON}\n part={this.partForName(\"clear\")}\n aria-label={this.translationForKey(\"clear\")}\n onClick={this.onClear}\n />\n </Show>","this.clearable && this.chosenValues.length && !this.readonly","part={this.partForName(\"clear\")}","aria-label={this.translationForKey(\"clear\")}","<button\n type=\"button\"\n class={CLEAR_ICON}\n part={this.partForName(\"clear\")}\n aria-label={this.translationForKey(\"clear\")}\n onClick={this.onClear}\n />","<Show when={this.slots.hasContent(this.slotForName(\"icon\"))}>\n <slot name={this.slotForName(\"icon\")} />\n </Show>","<slot name={this.slotForName(\"icon\")} />","style={this.popover.anchorStyle}","id={this.ids.text}","class={[UIT.TEXT, { [DEFAULT]: this.placeholderIsShowing, [FILTERED]: !!this.effectiveQuery }]}","part={this.partForName(\"text\")}","name={this.slotForName(\"trigger\")}","class={CARET_ICON}","part={this.partForName(\"icon\")}","type=\"button\"","class={TRIGGER}","ref={(element) => this.combobox = element}","<button\n ref={(element) => this.combobox = element}\n type=\"button\"\n class={TRIGGER}\n part={this.partForName(\"trigger\")}\n disabled={this.isDisabled}\n {...this.comboboxAttributes}\n onClick={this.onTriggerClick}\n onKeyDown={this.onKeyDown}\n onBlur={this.onBlur}\n />","class={SEARCH}","autocomplete=\"off\"","<input\n ref={(element) => this.combobox = element}\n class={SEARCH}\n part={this.partForName(\"search\")}\n autocomplete=\"off\"\n aria-autocomplete=\"list\"\n disabled={this.isDisabled}\n readonly={this.readonly}\n value={this.query}\n {...this.comboboxAttributes}\n onInput={this.onInput}\n onClick={this.onTriggerClick}\n onKeyDown={this.onKeyDown}\n onBlur={this.onBlur}\n />","<span class={CHIP} part={this.partForName(\"label\")}>\n {this.textFor(value)}\n <Show when={!this.readonly && !this.isDisabled}>\n <button\n type=\"button\"\n class={DELETE_ICON}\n tabindex=\"-1\"\n aria-label={this.translationForKey(\"removeValue\", { value: this.textFor(value) })}\n onClick={(event) => this.remove(value, event)}\n />\n </Show>\n </span>","<Show when={!this.readonly && !this.isDisabled}>\n <button\n type=\"button\"\n class={DELETE_ICON}\n tabindex=\"-1\"\n aria-label={this.translationForKey(\"removeValue\", { value: this.textFor(value) })}\n onClick={(event) => this.remove(value, event)}\n />\n </Show>","!this.readonly && !this.isDisabled","aria-label={this.translationForKey(\"removeValue\", { value: this.textFor(value) })}","<button\n type=\"button\"\n class={DELETE_ICON}\n tabindex=\"-1\"\n aria-label={this.translationForKey(\"removeValue\", { value: this.textFor(value) })}\n onClick={(event) => this.remove(value, event)}\n />","part={this.partForName(\"label\")}","ref={(element) => void _UIDropdown.fillIcon(element, name)}","<span class={UIT.ICON} ref={(element) => void _UIDropdown.fillIcon(element, name)} />","<Show when={this.name}>\n {(name) => <For each={this.chosenValues}>\n {(value) => <input type=\"hidden\" name={name()} value={value} disabled={this.isDisabled} />}\n </For>}\n </Show>","<For each={this.chosenValues}>\n {(value) => <input type=\"hidden\" name={name()} value={value} disabled={this.isDisabled} />}\n </For>","disabled={this.isDisabled}","ref={(element) => this.menu = element}","<Show when={this.isOpen || this.isSimple || isServer}>\n <For each={this.menuRows}>{(row) => this.row(row)}</For>\n <Show when={!this.visibleOptions.length}>\n {\n /* an option (disabled) rather than a bare div: a listbox must own options (axe `aria-required-children`) */\n }\n <div class={UIT.MESSAGE} role=\"option\" aria-disabled=\"true\" aria-selected=\"false\">\n {this.noResultsText ?? this.translationForKey(\"noResults\")}\n </div>\n </Show>\n </Show>","<For each={this.menuRows}>{(row) => this.row(row)}</For>","<Show when={!this.visibleOptions.length}>\n {\n /* an option (disabled) rather than a bare div: a listbox must own options (axe `aria-required-children`) */\n }\n <div class={UIT.MESSAGE} role=\"option\" aria-disabled=\"true\" aria-selected=\"false\">\n {this.noResultsText ?? this.translationForKey(\"noResults\")}\n </div>\n </Show>","<div class={UIT.MESSAGE} role=\"option\" aria-disabled=\"true\" aria-selected=\"false\">\n {this.noResultsText ?? this.translationForKey(\"noResults\")}\n </div>","class={[MENU, { [UIT.LEFT]: this.opensLeft }]}","style={this.popover.panelStyle}","popover={this.isSimple || isServer && this.isOpen ? void 0 : \"manual\"}","part={this.partForName(\"menu\")}","aria-label={this.accessibleName}","aria-multiselectable={this.multiple ? \"true\" : void 0}","name={this.slotForName(\"header\")}","<div\n ref={(element) => this.menu = element}\n id={this.ids.menu}\n class={[MENU, { [UIT.LEFT]: this.opensLeft }]}\n style={this.popover.panelStyle}\n role=\"listbox\"\n popover={this.isSimple || isServer && this.isOpen ? void 0 : \"manual\"}\n part={this.partForName(\"menu\")}\n aria-label={this.accessibleName}\n aria-multiselectable={this.multiple ? \"true\" : void 0}\n onMouseDown={_UIDropdown.preventDefault}\n >\n <slot name={this.slotForName(\"header\")} />\n {\n /* a server render's rows: the text is in the page, the menu stays closed */\n }\n <Show when={this.isOpen || this.isSimple || isServer}>\n <For each={this.menuRows}>{(row) => this.row(row)}</For>\n <Show when={!this.visibleOptions.length}>\n {\n /* an option (disabled) rather than a bare div: a listbox must own options (axe `aria-required-children`) */\n }\n <div class={UIT.MESSAGE} role=\"option\" aria-disabled=\"true\" aria-selected=\"false\">\n {this.noResultsText ?? this.translationForKey(\"noResults\")}\n </div>\n </Show>\n </Show>\n </div>","<Show when={slot} fallback={this.optionContent(option)}>\n <slot name={slot} />\n </Show>","when={slot}","<slot name={slot} />","class={[\n UIT.ITEM,\n {\n [UIT.ACTIVE]: this.chosenValueSet.has(option.value),\n [UIT.SELECTED]: this.highlightedOption === option,\n [UIT.DISABLED]: !!option.disabled\n }\n ]}","part={this.partForName(\"item\")}","aria-selected={this.chosenValueSet.has(option.value) ? \"true\" : \"false\"}","aria-disabled={option.disabled ? \"true\" : void 0}","<div\n id={this.idFor(option)}\n class={[\n UIT.ITEM,\n {\n [UIT.ACTIVE]: this.chosenValueSet.has(option.value),\n [UIT.SELECTED]: this.highlightedOption === option,\n [UIT.DISABLED]: !!option.disabled\n }\n ]}\n role=\"option\"\n part={this.partForName(\"item\")}\n aria-selected={this.chosenValueSet.has(option.value) ? \"true\" : \"false\"}\n aria-disabled={option.disabled ? \"true\" : void 0}\n onPointerMove={() => this.highlighted.highlight(option)}\n onClick={(event) => this.select(option, event)}\n >\n <Show when={slot} fallback={this.optionContent(option)}>\n <slot name={slot} />\n </Show>\n </div>","<Show when={typeof option.icon === \"string\"}>{this.iconBox(option.icon)}</Show>","<Show when={typeof option.image === \"string\"}>\n <img class={AVATAR_IMAGE} src={option.image} alt=\"\" />\n </Show>","src={option.image}","<img class={AVATAR_IMAGE} src={option.image} alt=\"\" />","<Show when={typeof option.flag === \"string\"}>\n <span class={FLAG}>{UIT.Flags.emojiFor(option.flag) || option.flag}</span>\n </Show>","<span class={FLAG}>{UIT.Flags.emojiFor(option.flag) || option.flag}</span>","<Show when={option.description}>\n <span class={UIT.DESCRIPTION}>{option.description}</span>\n </Show>","<span class={UIT.DESCRIPTION}>{option.description}</span>","<div\n id={this.idFor(option)}\n class={[UIT.ITEM, ADDITION, { [UIT.SELECTED]: this.highlightedOption === option }]}\n role=\"option\"\n part={this.partForName(\"item\")}\n aria-selected=\"false\"\n onPointerMove={() => this.highlighted.highlight(option)}\n onClick={(event) => this.select(option, event)}\n >\n {before}\n <b>{option.text}</b>\n {after}\n </div>","class={[UIT.ITEM, ADDITION, { [UIT.SELECTED]: this.highlightedOption === option }]}","F.FormComponent","E.proto","E.protoMerged","E.state","E.derived","E.isSameList","E.controlled","E.untracked","E.onChange","E.cssState","E.on","E.SlotContent","F.HighlightedOption","E.PopoverPanel","E.after","F.MenuOptions","_$createComponent","_$memo","_$readShallow","_$getOwner","_$setAttribute","UIT.TEXT","E.WHITESPACE","UIT.LEFT","UIT.STATIC_CONTROL","E.IconGlyph","UIT.ICON","UIT.MESSAGE","UIT.ITEM","UIT.ACTIVE","UIT.SELECTED","UIT.DISABLED","UIT.DESCRIPTION","E.markedPieces","UIT.HEADER","__name","buttonCSS","dropdownCSS","_$delegateEvents","STATIC_CONTROL","ICON","__name$1","FormControlAttributes","HEADER","Key","__publicField","LEFT","__decorateElement","ITEM","MESSAGE","__decoratorMetadata","__runInitializers","__privateAdd","SELECTED","DISABLED","ToggleCommands","ACTIVE","DESCRIPTION","FormControlStates","TEXT","Flags","__decoratorStart","UIButton_default","SlottedItems","getOwner$1","dropdownVocabulary","_degraded_dec","_vocabulary_dec$1","_a$1","_init$1","_DropdownFallback","NativeFallback","proto","domElement","isMultiple","placeholder","select","SELECT_PART","chosen","entries","picked","entry","group","option","value","CHANGE_EVENT","event","DropdownFallback","UIDropdown_default","_tmpl$","_tmpl$2","_tmpl$3","_tmpl$4","_tmpl$5","_tmpl$6","_tmpl$7","_tmpl$8","_tmpl$9","_tmpl$10","_tmpl$11","_tmpl$12","_tmpl$13","_tmpl$14","_tmpl$15","_tmpl$16","_tmpl$17","_tmpl$18","_tmpl$19","_onKeyDown_dec","_onRootClick_dec","_onTriggerClick_dec","_onCommand_dec","_onOpenChanged_dec","_onOpenedOrClosed_dec","_isOpen_dec","_onHighlightChanged_dec","_menuRows_dec","_visibleOptions_dec","_typeAhead_dec","_query_dec","_remove_dec","_select_dec","_chosenValueSet_dec","_chosenValues_dec","_value_dec","_optionsByValue_dec","_allOptions_dec","_addedOptions_dec","_typeAheadDelay_dec","_pageSize_dec","_elementSetup_dec","_vocabulary_dec","_a","_init","_addedOptions","_value","_query","_isOpen","_UIDropdown","FormComponent","protoMerged","state","derived","isSameList","controlled","untracked","onChange","cssState","on","SlotContent","HighlightedOption","PopoverPanel","open","target","query","next","id","UI","isOpen","key","visible","values","options","max","isAddition","originalEvent","item","announce","after","index","MenuOptions","shown","rows","slotted","isConnected","isReady","name","ID_PREFIX","_self$","_el$","_el$2","_el$4","_el$5","_el$6","_el$8","_el$10","_el$11","addEvent","insert","createComponent","Show","For","memo","_el$3","effect","readShallow","SIZER","_v$","_$p","_el$7","CLEAR_ICON","className","_p$","t","setAttribute","a","_el$9","isServer","_el$12","DEFAULT","FILTERED","CARET_ICON","style","o","i","n","s","h","first","WHITESPACE","SIMPLE","highlighted","_self$2","_el$13","spread","TRIGGER","ref","element","_self$3","_el$14","SEARCH","_self$4","_el$15","_el$16","_el$18","_el$17","DELETE_ICON","CHIP","_self$5","_el$19","IconGlyph","_el$20","_self$6","_el$21","_self$7","_el$22","_el$23","row","_el$24","MENU","slot","_self$8","_el$25","_el$26","_self$9","_el$27","AVATAR_IMAGE","_el$28","FLAG","_el$29","_el$30","markedPieces","piece","_el$31","before","VALUE_PLACEHOLDER","_self$10","_el$32","_el$33","_el$34","ADDITION","DIVIDER","_el$35","_el$36","action","icons","template","UIDropdown","delegateEvents"],"sources":["../src/components/ui-dropdown/UIDropdown.en.ts","../src/components/ui-dropdown/UIDropdown.fallback.ts","../src/components/ui-dropdown/UIDropdown.css?inline","../src/components/ui-dropdown/UIDropdown.tsx","../src/components/ui-dropdown/index.ts"],"sourcesContent":["/**\n * Every name `<ui-dropdown>` uses: tag, attributes (kind + allowed values), events, slots,\n * parts, states, texts. Schema: `ComponentVocabulary` (`spell/ui/vocabulary`).\n * - Class words come out through `ClassBuilder`, in Fomantic's grammar:\n * `<ui-dropdown search selection pointing=\"top left\">` => `ui search selection top left pointing dropdown`.\n * `UIDropdown.css` keys on those words.\n * - Rich data is a PROPERTY (`options`, `kind: \"json\"`); first paint never needs it --\n * slotted `<ui-item>`s or the `value` / `text` attributes carry what SSR must show.\n */\n\nimport type { ComponentVocabulary } from \"spell/ui/vocabulary\"\nimport * as UIT from \"spell/ui/components/components.types\"\n\n/****************\n * ### `<ui-dropdown>`\n * A combobox + listbox: a `<button>` or `<input>` trigger and an anchor-positioned popover menu.\n ****************/\nexport const dropdownVocabulary = {\n tag: \"ui-dropdown\",\n icon: \"caret square down outline\",\n formControl: true,\n topics: [\"forms\", \"inputs\", \"selection\", \"menus\", \"controls\", \"basic\", \"modules\"],\n aka: [\"select\", \"combobox\", \"picker\", \"autocomplete\", \"menu button\", \"multi select\"],\n skeleton: \"inline 14 x 2.5\",\n noun: \"dropdown\",\n description: \"A dropdown lets people choose a value from a series of options.\",\n attributes: [\n {\n name: \"size\",\n group: \"appearance\",\n kind: \"size\",\n description: \"Size, `mini` ... `massive`; `medium` is the default.\"\n },\n {\n name: \"color\",\n group: \"appearance\",\n kind: \"color\",\n description: \"Hue: fills a `button` dropdown; accents a selection's focus border and labels.\"\n },\n {\n name: \"state\",\n group: \"form\",\n kind: \"valueOnly\",\n values: [\"error\", \"info\", \"success\", \"warning\"],\n description: \"Form state, tinting the box, text and menu.\"\n },\n { name: \"selection\", group: \"appearance\", kind: \"keyOnly\", description: \"Looks like a form `<select>`.\" },\n {\n name: \"search\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"Filters the options by typing; the trigger is an `<input>`.\"\n },\n { name: \"multiple\", group: \"form\", kind: \"keyOnly\", description: \"Chooses several values, shown as labels.\" },\n { name: \"inline\", group: \"layout\", kind: \"keyOnly\", description: \"Sits inside running text.\" },\n {\n name: \"floating\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"The menu floats further away, with a stronger shadow.\"\n },\n { name: \"button\", group: \"appearance\", kind: \"keyOnly\", description: \"Looks like a button (`UIButton.css`).\" },\n {\n name: \"labeled\",\n group: \"appearance\",\n kind: \"keyOnly\",\n key: \"labeled icon\",\n description: \"A labeled icon button: the `icon` in its own block, no caret. Use with `button`.\"\n },\n {\n name: \"padding\",\n group: \"layout\",\n kind: \"valueOnly\",\n values: [\"compact\"],\n replaces: [{ from: \"compact\", value: \"compact\" }],\n description: \"`compact`: no minimum width; the menu sizes to its items. Old name: `compact`.\"\n },\n { name: \"fluid\", group: \"layout\", kind: \"keyOnly\", description: \"Takes the full width of its container.\" },\n { name: \"scrolling\", group: \"layout\", kind: \"keyOnly\", description: \"The menu scrolls after a fixed height.\" },\n {\n name: \"appearance\",\n group: \"appearance\",\n kind: \"multiple\",\n values: [\"simple\"],\n // each word is its own class (a `multiple` without `classes` would add its key: `simple appearance`)\n classes: {},\n replaces: [{ from: \"simple\", value: \"simple\" }],\n description: \"`simple`: opens on hover / focus, with no script and no popover. Old name: `simple`.\"\n },\n { name: \"clearable\", group: \"form\", kind: \"keyOnly\", description: \"Shows a clear button while there's a value.\" },\n { name: \"disabled\", group: \"states\", kind: \"keyOnly\", description: \"Can't be used; dimmed and inert.\" },\n {\n name: \"loading\",\n group: \"states\",\n kind: \"keyOnly\",\n description: \"Busy, e.g. fetching options; the caret spins.\"\n },\n UIT.FormControlAttributes.readonly,\n {\n name: \"inverted\",\n group: \"appearance\",\n kind: \"keyOnly\",\n description: \"For dark backgrounds: the dark scheme's colours.\"\n },\n {\n name: \"limit\",\n group: \"appearance\",\n kind: \"valueOnly\",\n values: [\"none\"],\n classes: { none: \"unlimited\" },\n replaces: [{ from: \"unlimited\", value: \"none\" }],\n description: \"`none`: a selection menu that never scrolls. Old name: `unlimited`.\"\n },\n {\n name: \"resizable\",\n group: \"behaviour\",\n kind: \"keyOnly\",\n description: \"A `scrolling` menu people can resize vertically.\"\n },\n {\n name: \"length\",\n group: \"appearance\",\n kind: \"valueOnly\",\n values: [\"very-short\", \"short\", \"long\", \"very-long\"],\n classes: { \"very-short\": \"very short\", \"very-long\": \"very long\" },\n replaces: [\n { from: \"short\", value: \"short\" },\n { from: \"very-short\", value: \"very-short\" },\n { from: \"long\", value: \"long\" },\n { from: \"very-long\", value: \"very-long\" }\n ],\n description:\n \"A selection menu's height: `very-short` (1/2), `short` (3/4), `long` (2x), `very-long` (3x). \" +\n \"Old names: `short`, `very-short`, `long`, `very-long`.\"\n },\n {\n name: \"open\",\n group: \"states\",\n kind: \"keyOnly\",\n key: \"active\",\n description: \"The menu is open. Controlled: set it to open / close; `ui-opening` / `ui-closing` can veto.\"\n },\n {\n name: \"pointing\",\n group: \"layout\",\n kind: \"keyOrValueAndKey\",\n values: [\"top\", \"top left\", \"top right\", \"left\", \"right\", \"bottom\", \"bottom left\", \"bottom right\"],\n description:\n \"An arrow on the menu pointing at the dropdown; the value says where the menu's arrow sits \" +\n \"(`top left` => below, arrow at its top left). Pointing menus never flip.\"\n },\n {\n name: \"columnar\",\n group: \"appearance\",\n kind: \"width\",\n widthClass: \"column\",\n values: [\"2\", \"3\", \"4\", \"5\"],\n description: 'Lays the menu items out in columns: `columnar=\"3\"` => `three column`.'\n },\n {\n name: \"direction\",\n group: \"layout\",\n kind: \"multiple\",\n values: [\"up\", \"left\", \"right\"],\n // `left` / `right` are the MENU's (`.left.menu`), not the dropdown's own classes\n classes: { up: \"upward\", left: \"\", right: \"\" },\n replaces: [{ from: \"upward\", value: \"up\" }],\n description:\n \"Which way the menu opens: `up` above the dropdown (it still flips when there's no room); `left` \" +\n \"extends it leftward from the dropdown's edge, `right` (the default) rightward; `up left` both. \" +\n \"Old name: `upward`.\"\n },\n { name: \"icon\", group: \"content\", kind: \"icon\", description: \"Icon name for a `labeled` dropdown's icon block.\" },\n { ...UIT.FormControlAttributes.placeholder, description: \"Text shown while nothing is chosen.\" },\n {\n name: \"value\",\n group: \"form\",\n kind: \"string\",\n description:\n \"Chosen value. Property: `string`, or `string[]` with `multiple`; attribute: a comma / space list.\"\n },\n {\n name: \"label\",\n group: \"name\",\n kind: \"string\",\n reflect: false,\n replaces: [\"text\"],\n description:\n \"Text shown for the current value, e.g. before `options` arrive. Property only by default. \" +\n \"Old name: `text`.\"\n },\n { ...UIT.FormControlAttributes.name, description: \"Form field name; `multiple` submits one entry per value.\" },\n UIT.FormControlAttributes.parameter,\n UIT.FormControlAttributes.required,\n {\n name: \"allow-additions\",\n group: \"form\",\n kind: \"boolean\",\n description: \"`search`: offers the query as a new option.\"\n },\n {\n name: \"min-characters\",\n group: \"form\",\n kind: \"number\",\n default: 0,\n description: \"`search`: characters to type before the menu filters.\"\n },\n {\n name: \"max-selections\",\n group: \"form\",\n kind: \"number\",\n description: \"`multiple`: the most values that can be chosen.\"\n },\n {\n name: \"no-results-text\",\n group: \"content\",\n kind: \"string\",\n description: \"Message when nothing matches; default the translated `noResults` text.\"\n },\n {\n name: \"addition-text\",\n group: \"content\",\n kind: \"string\",\n description: \"Label of the add item, with `{value}`; default the translated `addItem` text.\"\n },\n {\n name: \"options\",\n group: \"form\",\n kind: \"json\",\n reflect: false,\n description: \"Options as a PROPERTY: `MenuOption[]` (`spell/ui/elements`); added after slotted `<ui-item>`s.\"\n }\n ],\n events: [\n {\n name: \"ui-changed\",\n detail: \"{ value: string | string[], originalEvent?: Event }\",\n description: \"Someone chose, added, removed or cleared a value.\"\n },\n {\n name: \"ui-opening\",\n detail: \"{ open: true, originalEvent?: Event }\",\n cancelable: true,\n description:\n \"The menu is about to open (a person's action, an invoker command too); `preventDefault()` keeps it closed.\"\n },\n {\n name: \"ui-closing\",\n detail: \"{ open: false, originalEvent?: Event }\",\n cancelable: true,\n description: \"The menu is about to close; `preventDefault()` keeps it open.\"\n },\n {\n name: \"ui-searched\",\n detail: \"{ query: string, originalEvent?: Event }\",\n description: \"`search`: the query changed.\"\n },\n {\n name: \"ui-added\",\n detail: \"{ value: string, originalEvent?: Event }\",\n description: \"`multiple`: a value was chosen, or `allow-additions` added a new one.\"\n },\n {\n name: \"ui-removed\",\n detail: \"{ value: string, originalEvent?: Event }\",\n description: \"`multiple`: a value was removed.\"\n }\n ],\n slots: [\n { name: \"\", description: \"`<ui-item>`s: the options, headers and dividers, in order.\" },\n { name: \"trigger\", description: \"Custom trigger content, e.g. an icon and a word, instead of the text.\" },\n { name: \"header\", description: \"Content at the top of the menu, e.g. a header or a search input.\" },\n { name: \"icon\", description: \"Replaces the caret, or the `labeled` icon.\" }\n ],\n parts: [\n { name: \"trigger\", description: \"The combobox `<button>` covering the dropdown (not `search`).\" },\n { name: \"text\", description: \"The current text, or the placeholder.\" },\n { name: \"icon\", description: \"The caret.\" },\n { name: \"menu\", description: \"The listbox popover.\" },\n { name: \"item\", description: \"Each option.\" },\n { name: \"label\", description: \"Each chosen value of a `multiple` dropdown.\" },\n { name: \"search\", description: \"The search `<input>`.\" },\n { name: \"clear\", description: \"The clear button of a `clearable` dropdown.\" }\n ],\n states: [\n { name: \"open\", description: \"The menu is open.\" },\n { name: \"disabled\", description: \"Can't be used.\" },\n { name: \"loading\", description: \"Busy.\" },\n { ...UIT.FormControlStates.invalid, description: \"Fails validation (`required` ...).\" },\n { name: \"fluid\", description: \"The host is block-level (`fluid`).\" }\n ],\n texts: [\n { key: \"noResults\", text: \"No results found.\", description: \"Message when nothing matches the search.\" },\n { key: \"addItem\", text: \"Add {value}\", description: \"The add item of `allow-additions`.\" },\n { key: \"clear\", text: \"Clear\", description: \"Accessible name of the clear button.\" },\n {\n key: \"removeValue\",\n text: \"Remove {value}\",\n description: \"Accessible name of a `multiple` label's delete button.\"\n }\n ]\n} as const satisfies ComponentVocabulary\n","import { E, UIT } from \"spell/ui/core\"\nimport { dropdownVocabulary } from \"./UIDropdown.en\"\nimport { SlottedItems } from \"./SlottedItems\"\n\n/****************\n * ### `DropdownFallback`\n * The native fallback of `<ui-dropdown>`: what it shows when its component breaks,\n * so the chosen value(s) are still submitted and validated with the form.\n *\n * - Its shadow DOM: a native `<select part=\"trigger select\" class=\"ui … dropdown\">`, `multiple` when `multiple`.\n * - The options come from the DOM element's light-DOM `<ui-item>`s (`header` => `<optgroup>`, `divider` skipped),\n * read as the component reads them (`SlottedItems`), then its `options` PROPERTY.\n * - The chosen values come from the `value` property, else the attribute (a comma / space list).\n * - A single select starts with an empty `<option>` (the `placeholder` text) when nothing is chosen,\n * so the browser doesn't silently choose the first option.\n * - On `change`: the form value follows (`FormData` for `multiple`), `domElement.value` is set,\n * and a composed `ui-changed` is sent.\n * The form value is also set on the first render, so the form submits without a change.\n * - Its accessible name is the DOM element's `aria-label`, else `placeholder`.\n ****************/\nexport class DropdownFallback extends E.NativeFallback<typeof dropdownVocabulary> {\n @E.proto static vocabulary = dropdownVocabulary\n @E.proto static degraded = [\n \"`search` (typing only jumps to a matching option)\",\n \"`allow-additions`, `clearable`, `max-selections`\",\n \"multiple-value labels (a native multi-select list)\",\n \"option `icon` / `image` / `flag` / `description`\",\n \"keyboard pattern: the native `<select>`'s, not the combobox listbox\",\n \"invoker commands, `ui-opening` / `ui-closing` / `ui-searched` / `ui-added` / `ui-removed`\",\n \"`readonly` is a disabled select (the value still submits)\"\n ]\n\n /** The native select, once built, for `sync()`. */\n private select: HTMLSelectElement | undefined\n\n protected override build() {\n const domElement = this.domElement as DropdownDOMElement\n const isMultiple = this.flag(\"multiple\")\n const placeholder = this.attr(\"placeholder\")\n const select = this.create(\"select\", {\n class: this.classes(),\n name: this.attr(\"name\"),\n multiple: isMultiple,\n required: this.flag(\"required\"),\n disabled: this.flag(\"disabled\") || this.flag(\"readonly\"),\n \"aria-readonly\": this.flag(\"readonly\") ? \"true\" : undefined\n })\n this.decorate(select, \"trigger\", SELECT_PART)\n this.nameFromPlaceholder(select)\n\n const chosen = new Set(SlottedItems.valuesIn(domElement.value ?? this.attr(\"value\"), isMultiple))\n const entries = [...SlottedItems.itemsOf(domElement).map(SlottedItems.entryOf), ...(domElement.options ?? [])]\n const picked = entries.filter(\n (entry): entry is E.MenuOption => !(\"type\" in entry) && (!!entry.selected || chosen.has(entry.value))\n )\n if (!isMultiple && !picked.length) {\n select.append(this.create(\"option\", { value: \"\", selected: true }, placeholder ?? \"\"))\n }\n\n let group: HTMLElement = select\n for (const entry of entries) {\n if (!(\"type\" in entry)) {\n const option = this.create(\"option\", { value: entry.value, disabled: entry.disabled }, entry.text)\n option.selected = picked.includes(entry) && (isMultiple || entry === picked[0])\n group.append(option)\n } else if (entry.type === UIT.HEADER) select.append((group = this.create(\"optgroup\", { label: entry.text })))\n }\n\n this.listen(select, \"change\", (event) => {\n this.sync()\n const value = this.chosenValue()\n domElement.value = value\n this.send(CHANGE_EVENT, { value, originalEvent: event })\n })\n this.select = select\n return [select]\n }\n\n /** The select's value, and its validity (`required`). */\n protected override sync() {\n const { select } = this\n if (select) this.syncForm({ value: this.chosenValue(), control: select })\n }\n\n /** What the select has chosen: a list when `multiple`, else one value (`\"\"` for none). */\n private chosenValue(): UIT.DropdownValue {\n const select = this.select!\n return select.multiple ? [...select.selectedOptions].map((option) => option.value) : select.value\n }\n}\n\n/** What the fallback reads and writes of the DOM element: all optional, the element may not have upgraded. */\ntype DropdownDOMElement = HTMLElement & {\n /** the chosen value(s), once set as a property */\n value?: UIT.DropdownValue\n /** the `options` property, once set */\n options?: readonly E.MenuOption[]\n}\n\n/** The select's second part name, beside the vocabulary's `trigger`: `::part(select)` styles the native one. */\nconst SELECT_PART = \"select\"\n\n/** The event the select's `change` becomes. */\nconst CHANGE_EVENT: E.EventName<typeof dropdownVocabulary> = \"ui-changed\"\n","/*\n * The style sheet of `<ui-dropdown>`: a port of Fomantic's `dropdown.less` + `dropdown.variables`,\n * with the multiple-selection labels (`.ui.multiple.dropdown > .label`, just enough of `label.less` to stand alone).\n * - Adopted after the foundation, AFTER `UIButton.css` (the `button` / `labeled icon` variants are buttons).\n * - The shadow markup it expects (class grammar on semantic elements), in this order inside the root:\n *\n * <div class=\"ui [size color state] [selection search multiple ...] dropdown [active] [disabled] [loading]\"\n * style=\"anchor-name: --ui-dropdown-7\">\n * <span class=\"ui label\" part=\"label\">Angular<button class=\"delete icon\" aria-label=\"...\"></button></span>\n * <input class=\"search\" part=\"search\" role=\"combobox\"> (search: the combobox)\n * <span class=\"sizer\" aria-hidden=\"true\">query</span> (multiple search: measures the input)\n * <button class=\"trigger\" part=\"trigger\" role=\"combobox\"> (otherwise: the combobox, covering the root)\n * <span class=\"[default] [filtered] text\" part=\"text\"><slot name=\"trigger\">...</slot></span>\n * <button class=\"remove icon\" part=\"clear\" aria-label=\"...\"> (clearable, when there's a value)\n * <span class=\"dropdown icon\" part=\"icon\"><slot name=\"icon\"></slot></span> (empty: a caret; or slot an svg)\n * <div class=\"[left] menu\" role=\"listbox\" popover part=\"menu\" style=\"position-anchor: --ui-dropdown-7\">\n * <div class=\"header\">, <hr class=\"divider\">, <div class=\"message\">,\n * <div class=\"[active] [selected] [disabled] [addition] item\" role=\"option\" part=\"item\">\n * <span class=\"icon\">, <img class=\"image\">, <span class=\"flag\">, <span class=\"description\">,\n * <span class=\"text\">, <mark> around matches\n * </div>\n * </div>\n *\n * - NOTE: `<slot>` breaks a CHILD (`>`) selector -- fallback content sits one level DEEPER,\n * as a descendant of its wrapper, not a direct child. So `.dropdown.icon` (wraps `<slot name=\"icon\">`) and `.text`\n * (wraps `<slot name=\"trigger\">`, the \"custom trigger content\" slot) size an inner icon with a DESCENDANT\n * selector (`.icon svg`, `.text .icon`) to reach fallback content through the `<slot>`,\n * plus `::slotted(svg)` / `::slotted(ui-icon)` for a real top-level slotted replacement --\n * NEVER `.icon > svg` or `.text > .icon`.\n * - Item classes are Fomantic's: `active` === the CHOSEN value (also `[aria-selected=\"true\"]`),\n * `selected` === the keyboard-highlighted option (the `aria-activedescendant` target).\n * NOTE: the vocabulary's `selected` (chosen) maps to `active` here.\n * - Open: the root is open when it has `active` OR its menu is `:popover-open`, so the CSS works whichever way\n * the component signals it. `visible` on the menu shows a NON-popover menu (static examples, `simple`).\n * - Positioning: POPOVER + ANCHOR, no JS.\n * - the anchor's name, and the menu hung from it: inline, per element (the component's `PopoverPanel`)\n * - root: `anchor-scope: all`\n * - `.menu[popover]`: `position-area` below\n * and flipping (`flip-block, flip-inline`); `upward` / `.left.menu` / `pointing=\"...\"` pick other areas\n * - a menu WITHOUT `popover` falls back to Fomantic's `top: 100%` positioning (static markup, `simple`)\n * - The `:state()`s the component sets: `:state(fluid)` (a block-level DOM element),\n * plus `open` / `disabled` / `loading` / `invalid` for PAGE styling only -- this sheet keys on the root's classes.\n * - Public tokens (`--ui-dropdown-*`, the theming surface) are NEVER declared here: the token block reads each\n * through a private alias, `--_ui-dropdown-radius: var(--ui-dropdown-radius, var(--ui-radius))`,\n * and every rule reads the alias. So a value set on `:root`, an ancestor, the DOM element or in the app stylesheet\n * reaches the box (`notes/theming.md` \"Component tokens\"). The root has no part name:\n * `::part(menu)` / `::part(item)` take plain properties. Variations (`floating`, `pointing`, form states,\n * `inverted`) write the aliases they swap.\n * - NOTE: left out, on purpose:\n * - sub-menus (`.menu .menu`, `.item > .dropdown.icon`): the combobox pattern is one listbox deep\n * - the \"connecting border\" (square corners where a selection menu meets its box): a flipped menu can't\n * tell CSS it flipped, so every menu floats a hair away with its own radius\n * - Fomantic's per-breakpoint menu heights: one `--ui-dropdown-menu-max-height`, and the menu never grows\n * past the space its `position-area` leaves\n * - `scrollhint` (a touch-only scroll animation), `label` dropdowns (`.ui.label.dropdown`),\n * `<select>` fallback styling (`select.ui.dropdown`), and coupling with `ui menu` / `labeled input`\n */\n\n@layer ui.components.dropdown.types, ui.components.dropdown.content, ui.components.dropdown.variations, ui.components.dropdown.states;\n\n/* Loader spin, shared by `loading` dropdowns. */\n@keyframes ui-dropdown-spin {\n to {\n rotate: 1turn;\n }\n}\n\n/*******************************\n Dropdown\n*******************************/\n\n@layer ui.components.dropdown.types {\n /* The DOM element: layout only; the look lives on the root inside. */\n :host {\n display: inline-block;\n vertical-align: baseline;\n }\n :host(:state(fluid)) {\n display: block;\n }\n /* `delegatesFocus`: the trigger / search input draws the ring, never the DOM element. */\n :host(:focus-visible) {\n outline: none;\n }\n\n /*\n * Tokens: one per `dropdown.variables` entry that still matters, from the global tokens -- each the private alias\n * of its public token (never declare the public one: it would block inherited values).\n */\n .ui.dropdown {\n --_ui-dropdown-radius: var(--ui-dropdown-radius, var(--ui-radius));\n /* `<ui-flag>`'s token: a page's flag font (its \"A flag font\") reaches menu flags too */\n --_ui-flag-font-family: var(--ui-flag-font-family, var(--ui-font-family-emoji), var(--ui-font-family));\n --_ui-dropdown-duration: var(--ui-dropdown-duration, var(--ui-duration-fast));\n --_ui-dropdown-color: var(--ui-dropdown-color, var(--ui-text-color));\n --_ui-dropdown-background: var(--ui-dropdown-background, var(--ui-surface));\n --_ui-dropdown-border-color: var(--ui-dropdown-border-color, var(--ui-border-color));\n --_ui-dropdown-border-color-hover: var(--ui-dropdown-border-color-hover, var(--ui-border-color-selected));\n --_ui-dropdown-border-color-focus: var(\n --ui-dropdown-border-color-focus,\n var(--ui-color-border, var(--ui-focus-border))\n );\n --_ui-dropdown-padding-block: var(--ui-dropdown-padding-block, var(--ui-space-s));\n --_ui-dropdown-padding-inline: var(--ui-dropdown-padding-inline, var(--ui-space-m));\n --_ui-dropdown-line-height: var(--ui-dropdown-line-height, 1.2);\n --_ui-dropdown-min-width: var(--ui-dropdown-min-width, 14em);\n --_ui-dropdown-min-height: var(\n --ui-dropdown-min-height,\n max(\n var(--ui-control-height, 0px) * var(--ui-scale, 1),\n calc(var(--_ui-dropdown-line-height) * 1em + 2 * var(--_ui-dropdown-padding-block))\n )\n );\n --_ui-dropdown-icon-size: var(--ui-dropdown-icon-size, 0.875em);\n --_ui-dropdown-icon-spacing: var(--ui-dropdown-icon-spacing, var(--ui-space-m));\n --_ui-dropdown-icon-distance: var(\n --ui-dropdown-icon-distance,\n calc(2 * var(--_ui-dropdown-padding-inline) + var(--_ui-dropdown-icon-size))\n );\n --_ui-dropdown-icon-opacity: var(--ui-dropdown-icon-opacity, 0.5);\n --_ui-dropdown-placeholder-color: var(--ui-dropdown-placeholder-color, var(--ui-text-light));\n --_ui-dropdown-placeholder-focus-color: var(--ui-dropdown-placeholder-focus-color, var(--ui-text-muted));\n --_ui-dropdown-menu-background: var(--ui-dropdown-menu-background, var(--ui-surface));\n --_ui-dropdown-menu-color: var(--ui-dropdown-menu-color, var(--ui-text-color));\n --_ui-dropdown-menu-border-color: var(--ui-dropdown-menu-border-color, var(--ui-border-color));\n --_ui-dropdown-menu-radius: var(--ui-dropdown-menu-radius, var(--ui-radius));\n --_ui-dropdown-menu-shadow: var(--ui-dropdown-menu-shadow, var(--ui-shadow-raised));\n --_ui-dropdown-menu-offset: var(--ui-dropdown-menu-offset, var(--ui-space-2xs));\n --_ui-dropdown-menu-max-height: var(--ui-dropdown-menu-max-height, 16em);\n --_ui-dropdown-menu-scrolling-max-height: var(--ui-dropdown-menu-scrolling-max-height, 20em);\n --_ui-dropdown-item-padding-block: var(--ui-dropdown-item-padding-block, var(--ui-space-s));\n --_ui-dropdown-item-padding-inline: var(--ui-dropdown-item-padding-inline, var(--ui-space-m));\n --_ui-dropdown-item-color: var(--ui-dropdown-item-color, var(--ui-text-color));\n --_ui-dropdown-item-color-hover: var(--ui-dropdown-item-color-hover, var(--ui-text-selected));\n --_ui-dropdown-item-background-hover: var(\n --ui-dropdown-item-background-hover,\n oklch(from var(--ui-ink) l c h / 0.05)\n );\n --_ui-dropdown-item-background-selected: var(\n --ui-dropdown-item-background-selected,\n oklch(from var(--ui-ink) l c h / 0.035)\n );\n --_ui-dropdown-item-font-weight-active: var(--ui-dropdown-item-font-weight-active, var(--ui-font-weight-bold));\n --_ui-dropdown-item-divider-color: var(--ui-dropdown-item-divider-color, var(--ui-border-color-internal));\n --_ui-dropdown-item-element-spacing: var(--ui-dropdown-item-element-spacing, var(--ui-space-s));\n /* 1: every row keeps an icon's room before its words, whether it has one or not (a menu of ticks, as an app's\n menus are); 0: only when another row has an icon */\n --_ui-dropdown-icon-column: var(--ui-dropdown-icon-column, 0);\n --_ui-dropdown-header-color: var(--ui-dropdown-header-color, var(--ui-text-dark));\n --_ui-dropdown-header-font-size: var(--ui-dropdown-header-font-size, 0.8em);\n --_ui-dropdown-description-color: var(--ui-dropdown-description-color, var(--ui-text-light));\n --_ui-dropdown-message-color: var(--ui-dropdown-message-color, var(--ui-text-unselected));\n --_ui-dropdown-label-background: var(--ui-dropdown-label-background, oklch(from var(--ui-ink) l c h / 0.08));\n --_ui-dropdown-label-color: var(--ui-dropdown-label-color, var(--ui-text-muted));\n --_ui-dropdown-label-radius: var(--ui-dropdown-label-radius, var(--ui-radius-s));\n --_ui-dropdown-label-padding: var(--ui-dropdown-label-padding, 0.35em 0.75em);\n --_ui-dropdown-arrow-size: var(--ui-dropdown-arrow-size, 0.5em);\n --_ui-dropdown-pointing-offset: var(--ui-dropdown-pointing-offset, var(--ui-space-s));\n --_ui-dropdown-pointing-edge: var(--ui-dropdown-pointing-edge, var(--ui-space-m));\n --_ui-dropdown-floating-offset: var(--ui-dropdown-floating-offset, var(--ui-space-xs));\n --_ui-dropdown-floating-shadow: var(--ui-dropdown-floating-shadow, var(--ui-shadow-floating));\n --_ui-dropdown-disabled-opacity: var(--ui-dropdown-disabled-opacity, var(--ui-disabled-opacity));\n --_ui-dropdown-loader-width: var(--ui-dropdown-loader-width, 0.2em);\n --_ui-dropdown-loader-speed: var(--ui-dropdown-loader-speed, 0.6s);\n /* Derived: the search input's padding keeps its text on the same baseline as `.text`. */\n --_dropdown-search-padding-block: calc(\n var(--_ui-dropdown-padding-block) - (var(--_ui-dropdown-line-height) * 1em - 1em) / 2\n );\n\n position: relative;\n box-sizing: border-box;\n display: inline-block;\n anchor-scope: all;\n font-family: var(--ui-font-family);\n font-size: calc(var(--ui-font-size) * var(--ui-scale, 1));\n text-align: start;\n cursor: var(--ui-control-cursor);\n outline: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n transition-property: box-shadow, border-color, width;\n transition-duration: var(--_ui-dropdown-duration);\n transition-timing-function: var(--ui-ease);\n }\n\n /* Trigger: a real `<button>` covering the root, so the whole box is one focusable combobox. */\n .ui.dropdown > .trigger {\n position: absolute;\n inset: 0;\n z-index: 1;\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0;\n border-radius: inherit;\n background: none;\n color: inherit;\n font: inherit;\n cursor: inherit;\n appearance: none;\n }\n\n /* Menu: hidden until open; a popover in the top layer, anchored to the root. */\n .ui.dropdown > .menu {\n position: absolute;\n top: 100%;\n inset-inline-start: 0;\n z-index: var(--ui-z-dropdown);\n box-sizing: border-box;\n display: none;\n min-width: max-content;\n margin: 0;\n padding: 0;\n overflow: visible;\n border: var(--ui-border-width) solid var(--_ui-dropdown-menu-border-color);\n border-radius: var(--_ui-dropdown-menu-radius);\n outline: none;\n background: var(--_ui-dropdown-menu-background);\n box-shadow: var(--_ui-dropdown-menu-shadow);\n color: var(--_ui-dropdown-menu-color);\n font-size: 1em;\n font-weight: var(--ui-font-weight-normal);\n line-height: normal;\n text-align: start;\n text-shadow: none;\n cursor: auto;\n }\n /*\n * `fixed` (the popover default), NOT `absolute`: webkit measures an absolute popover's `position-area` against the\n * origin screenful of the page, so a dropdown anywhere below it flipped upwards although room remained.\n */\n .ui.dropdown > .menu[popover] {\n position: fixed;\n position-area: block-end span-inline-end;\n position-try-fallbacks: flip-block, flip-inline;\n /* below or above, whichever has more room: capped to it (`max-height`), the menu always fits */\n position-try-order: most-block-size;\n inset: auto;\n min-width: anchor-size(width);\n margin: var(--_ui-dropdown-menu-offset) 0;\n /*\n * Never taller than the room beside its root: `100%` is that room (its `position-area`), less its offset from\n * the root and as much again from the window's edge; a longer list scrolls. No sub-menus to clip (above).\n */\n max-height: calc(100% - 2 * var(--_ui-dropdown-menu-offset));\n overflow-y: auto;\n overscroll-behavior: contain;\n opacity: 0;\n transition-property: opacity, display, overlay;\n transition-duration: var(--_ui-dropdown-duration);\n transition-timing-function: var(--ui-ease);\n transition-behavior: allow-discrete;\n }\n /* more below: the menu's colour fading up over its last 8px, not a hard edge (Owen); all in view, it sits\n over the menu's own bottom edge */\n .ui.dropdown > .menu[popover]::after {\n content: \"\";\n position: sticky;\n inset-block-end: 0;\n display: block;\n height: 8px;\n margin-block-start: -8px;\n pointer-events: none;\n background: linear-gradient(to top, var(--_ui-dropdown-menu-background), transparent);\n }\n .ui.dropdown > .menu > * {\n white-space: nowrap;\n }\n\n /* Dropdown icon: an empty one draws a caret, so no icon data is needed. */\n .ui.dropdown > .dropdown.icon {\n position: relative;\n box-sizing: content-box;\n display: inline-block;\n width: var(--_ui-dropdown-icon-size);\n height: var(--_ui-dropdown-icon-size);\n margin-inline-start: var(--_ui-dropdown-icon-spacing);\n fill: currentColor;\n vertical-align: -0.1em;\n pointer-events: none;\n }\n .ui.dropdown > :is(.dropdown, .remove).icon:empty::before,\n .ui.dropdown > .label > .delete.icon:empty::before {\n content: \"\";\n display: block;\n width: 100%;\n height: 100%;\n background: currentColor;\n }\n .ui.dropdown > .dropdown.icon:empty::before {\n clip-path: polygon(15% 35%, 85% 35%, 50% 75%);\n }\n .ui.dropdown > .remove.icon:empty::before,\n .ui.dropdown > .label > .delete.icon:empty::before {\n clip-path: polygon(\n 20% 10%,\n 50% 40%,\n 80% 10%,\n 90% 20%,\n 60% 50%,\n 90% 80%,\n 80% 90%,\n 50% 60%,\n 20% 90%,\n 10% 80%,\n 40% 50%,\n 10% 20%\n );\n }\n .ui.dropdown .icon svg,\n .ui.dropdown .icon ::slotted(svg),\n .ui.dropdown .icon ::slotted(ui-icon) {\n display: block;\n width: 100%;\n height: 100%;\n fill: currentColor;\n }\n\n /* Remove (clear): a small button beside the caret. */\n .ui.dropdown > .remove.icon {\n position: absolute;\n top: 50%;\n inset-inline-end: 2em;\n z-index: 3;\n box-sizing: content-box;\n width: var(--_ui-dropdown-icon-size);\n height: var(--_ui-dropdown-icon-size);\n margin: 0;\n padding: 0.25em;\n border: 0;\n background: none;\n color: inherit;\n cursor: var(--ui-control-cursor);\n translate: 0 -50%;\n opacity: 0.5;\n transition: opacity var(--_ui-dropdown-duration) var(--ui-ease);\n appearance: none;\n }\n .ui.selection.dropdown > .remove.icon {\n top: calc(var(--_ui-dropdown-min-height) / 2 - var(--ui-border-width));\n inset-inline-end: calc(var(--_ui-dropdown-padding-inline) + var(--_ui-dropdown-icon-size) + 0.5em);\n }\n .ui.inline.dropdown > .remove.icon {\n inset-inline-end: 2.2em;\n }\n .ui.clearable.dropdown > .text:not(.default),\n .ui.clearable.dropdown:not(.search) > .label:last-of-type {\n margin-inline-end: 1.5em;\n }\n\n /* Text: the current value, or the placeholder (`default`). */\n .ui.dropdown > .text {\n display: inline-block;\n /* its owner's weight (a property editor's `show-defaults` bolds a changed value) */\n font-weight: var(--_ui-input-owner-weight, inherit);\n }\n .ui.dropdown:not(.button) > .default.text {\n color: var(--_ui-dropdown-placeholder-color);\n }\n .ui.dropdown:not(.button) > input:focus ~ .default.text {\n color: var(--_ui-dropdown-placeholder-focus-color);\n }\n .ui.dropdown > .filtered.text {\n visibility: hidden;\n }\n .ui.dropdown > .text > .description {\n float: inline-end;\n margin-inline-start: 1em;\n color: var(--_ui-dropdown-description-color);\n }\n\n /* Selection: looks like a select box. */\n .ui.selection.dropdown {\n display: inline-block;\n min-width: var(--_ui-dropdown-min-width);\n min-height: var(--_ui-dropdown-min-height);\n padding-block: var(--_ui-dropdown-padding-block);\n padding-inline: var(--_ui-dropdown-padding-inline) var(--_ui-dropdown-icon-distance);\n border: var(--ui-border-width) solid var(--_ui-dropdown-border-color);\n border-radius: var(--_ui-dropdown-radius);\n background: var(--_ui-dropdown-background);\n color: var(--_ui-dropdown-color);\n line-height: 1em;\n white-space: normal;\n overflow-wrap: break-word;\n box-shadow: none;\n }\n .ui.selection.dropdown > :is(.dropdown, .search).icon {\n position: absolute;\n top: calc(var(--_ui-dropdown-min-height) / 2 - var(--ui-border-width));\n inset-inline-end: var(--_ui-dropdown-padding-inline);\n z-index: 3;\n margin: 0;\n translate: 0 -50%;\n opacity: var(--_ui-dropdown-icon-opacity);\n transition: opacity var(--_ui-dropdown-duration) var(--ui-ease);\n }\n\n /* Search: the input overlays the current text, which shows through until typing starts. */\n .ui.search.dropdown > input.search {\n position: absolute;\n top: 0;\n inset-inline-start: 1px;\n z-index: 2;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n margin: 0;\n padding: inherit;\n border: none;\n background: none transparent;\n box-shadow: none;\n color: inherit;\n font: inherit;\n cursor: text;\n outline: none;\n -webkit-tap-highlight-color: transparent;\n }\n .ui.search.dropdown > .text {\n position: relative;\n inset-inline-start: 1px;\n z-index: auto;\n cursor: text;\n }\n .ui.search.selection.dropdown > input.search,\n .ui.search.selection.dropdown > .sizer {\n padding-block: var(--_dropdown-search-padding-block);\n padding-inline: var(--_ui-dropdown-padding-inline) var(--_ui-dropdown-icon-distance);\n line-height: var(--_ui-dropdown-line-height);\n }\n /* Sizer: laid out but invisible, so the element can read its width. */\n .ui.dropdown > .sizer {\n position: absolute;\n top: 0;\n inset-inline-start: 0;\n height: 0;\n overflow: hidden;\n white-space: pre;\n visibility: hidden;\n }\n\n /* Multiple: chosen values as labels, the padding split between the box and its children. */\n .ui.multiple.dropdown {\n padding-block: calc(var(--_dropdown-search-padding-block) / 3);\n padding-inline: calc(var(--_ui-dropdown-padding-inline) / 3) var(--_ui-dropdown-icon-distance);\n }\n .ui.multiple.dropdown > .text {\n position: static;\n max-width: 100%;\n margin-block: calc(var(--_dropdown-search-padding-block) * 2 / 3);\n margin-inline: calc(var(--_ui-dropdown-padding-inline) * 2 / 3) 0;\n padding: 0;\n line-height: var(--_ui-dropdown-line-height);\n }\n .ui.multiple.dropdown > .default.text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .ui.multiple.dropdown > .label ~ .text {\n display: none;\n }\n .ui.multiple.search.dropdown,\n .ui.multiple.search.dropdown > input.search {\n cursor: text;\n }\n /* Its own stacking context, so the placeholder's `z-index: -1` (below the search input) stays ABOVE the box's\n background; without it the placeholder sank under the white box whenever an ancestor made the context. */\n .ui.multiple.search.dropdown {\n isolation: isolate;\n }\n .ui.multiple.search.dropdown > .text {\n position: absolute;\n top: 0;\n inset-inline-start: 0;\n display: inline-block;\n padding: inherit;\n }\n .ui.multiple.search.dropdown > .default.text {\n z-index: -1;\n }\n /* The text (the placeholder) gives way to the chips: `.search > .text` (above) would otherwise draw it over them. */\n .ui.multiple.search.dropdown > .label ~ .text {\n display: none;\n }\n .ui.multiple.search.dropdown > input.search {\n position: static;\n width: auto;\n min-width: 2.2em;\n max-width: 100%;\n height: auto;\n margin-block: calc(var(--_dropdown-search-padding-block) * 2 / 3);\n margin-inline: calc(var(--_ui-dropdown-padding-inline) * 2 / 3) 0;\n padding: 0;\n line-height: var(--_ui-dropdown-line-height);\n field-sizing: content;\n }\n .ui.multiple.dropdown > .label ~ input.search {\n margin-inline-start: 0.15em;\n }\n\n /* Inline: a bold word inside running text. */\n .ui.inline.dropdown {\n display: inline-block;\n color: inherit;\n cursor: var(--ui-control-cursor);\n }\n .ui.inline.dropdown > .text {\n font-weight: var(--ui-font-weight-bold);\n }\n .ui.inline.dropdown > .dropdown.icon {\n margin: 0 0.2em;\n vertical-align: baseline;\n }\n .ui.inline.dropdown > .menu {\n --_ui-dropdown-menu-offset: 0.2em;\n }\n\n /* Button: `.ui.dropdown.button` is styled by `UIButton.css`; only overflow and the icon need adjusting. */\n .ui.dropdown.button {\n overflow: visible;\n }\n .ui.dropdown.icon.button > .dropdown.icon {\n margin: 0;\n }\n\n /* Labeled icon: the icon block comes from `UIButton.css`; no caret. */\n .ui.labeled.icon.dropdown > .dropdown.icon {\n display: none;\n }\n}\n\n/*******************************\n Content\n*******************************/\n\n@layer ui.components.dropdown.content {\n /* Labels (multiple): chips for the chosen values, tinted by the dropdown's colour or state. */\n .ui.multiple.dropdown > .label {\n position: relative;\n z-index: 2;\n display: inline-block;\n box-sizing: border-box;\n margin-block: 0.125em;\n margin-inline: 0 0.25em;\n padding: var(--_ui-dropdown-label-padding);\n border-radius: var(--_ui-dropdown-label-radius);\n background-color: var(--ui-color-background, var(--_ui-dropdown-label-background));\n box-shadow: inset 0 0 0 var(--ui-border-width) var(--ui-color-border, var(--ui-border-color));\n color: var(--ui-color-text, var(--_ui-dropdown-label-color));\n font-size: 0.875em;\n font-weight: var(--ui-font-weight-semibold);\n line-height: 1;\n vertical-align: baseline;\n white-space: normal;\n cursor: default;\n }\n .ui.multiple.dropdown > .label > .delete.icon {\n box-sizing: content-box;\n display: inline-block;\n width: 0.75em;\n height: 0.75em;\n margin: 0 0 0 0.5em;\n padding: 0;\n border: 0;\n background: none;\n color: inherit;\n font-size: 1em;\n opacity: 0.5;\n vertical-align: -0.05em;\n cursor: var(--ui-control-cursor);\n transition: opacity var(--_ui-dropdown-duration) var(--ui-ease);\n appearance: none;\n }\n .ui.multiple.dropdown > .label > :is(img, .image) {\n height: 1.4em;\n margin-block: -0.2em;\n margin-inline: -0.4em 0.4em;\n border-radius: var(--_ui-dropdown-label-radius);\n vertical-align: top;\n }\n\n /* Items */\n .ui.dropdown .menu > .item {\n position: relative;\n box-sizing: border-box;\n display: block;\n height: auto;\n padding: var(--_ui-dropdown-item-padding-block) var(--_ui-dropdown-item-padding-inline);\n border: none;\n color: var(--_ui-dropdown-item-color);\n font-size: 1em;\n font-weight: var(--ui-font-weight-normal);\n line-height: 1em;\n text-align: start;\n text-transform: none;\n box-shadow: none;\n cursor: var(--ui-control-cursor);\n -webkit-touch-callout: none;\n }\n .ui.dropdown .menu > .item.vertical {\n display: flex;\n flex-direction: column-reverse;\n }\n .ui.dropdown .menu > .item.vertical > .text {\n margin-bottom: 0.25em;\n }\n .ui.dropdown .menu > .item > .description {\n float: inline-end;\n margin-inline-start: 1em;\n color: var(--_ui-dropdown-description-color);\n }\n .ui.dropdown .menu > .item.vertical > .description {\n margin: 0;\n }\n .ui.dropdown .menu > .item mark {\n background: var(--ui-highlight);\n color: inherit;\n }\n\n /* Item sub-elements: icon, image, flag, label, before the text. */\n .ui.dropdown > .text :is(.icon, .icons, .label, .flag, .image, img),\n .ui.dropdown > .text ::slotted(:is(.icon, .icons, .label, .flag, .image, img, ui-icon)),\n .ui.dropdown .menu > :is(.item, .header) > :is(.icon, .icons, .label, .flag, .image, img) {\n float: none;\n margin-block: 0;\n margin-inline: 0 var(--_ui-dropdown-item-element-spacing);\n }\n .ui.dropdown > .text .icon,\n .ui.dropdown > .text ::slotted(svg),\n .ui.dropdown > .text ::slotted(ui-icon),\n .ui.dropdown .menu > :is(.item, .header) > .icon {\n box-sizing: border-box;\n display: inline-block;\n width: 1.18em;\n height: 1em;\n fill: currentColor;\n vertical-align: -0.125em;\n }\n /*\n * a row with no icon keeps an icon's room before its words (Owen, 2026-10-29, a menu of ticks: \"Menu should have\n * space in the left where the check should go, even if nothing checked\"):\n * - in a menu whose other rows have one: its words start where theirs do\n * - in every menu that asks, `--ui-dropdown-icon-column: 1`: even with no row ticked\n */\n .ui.dropdown .menu:has(> .item > .icon) {\n --_ui-dropdown-icon-column: 1;\n }\n .ui.dropdown .menu > .item:not(:has(> :is(.icon, .icons, .flag, .image, img))) {\n padding-inline-start: calc(\n var(--_ui-dropdown-item-padding-inline) + var(--_ui-dropdown-icon-column) *\n (1.18em + var(--_ui-dropdown-item-element-spacing))\n );\n }\n .ui.dropdown > .text :is(img, .image:not(.icon)),\n .ui.dropdown > .text ::slotted(:is(img, .image:not(.icon))),\n .ui.dropdown .menu > :is(.item, .header) > :is(img, .image:not(.icon)) {\n display: inline-block;\n width: auto;\n max-height: 2em;\n margin-block: -0.5em;\n vertical-align: top;\n }\n .ui.dropdown > .text .flag,\n .ui.dropdown > .text ::slotted(.flag),\n .ui.dropdown .menu > :is(.item, .header) > .flag {\n display: inline-block;\n font-family: var(--_ui-flag-font-family);\n line-height: 1;\n }\n .ui.dropdown > .text [class*=\"right floated\"],\n .ui.dropdown > .text ::slotted([class*=\"right floated\"]),\n .ui.dropdown .menu > :is(.item, .header) > [class*=\"right floated\"] {\n float: inline-end;\n margin-inline: 1em 0;\n }\n .ui.dropdown > .text [class*=\"left floated\"],\n .ui.dropdown > .text ::slotted([class*=\"left floated\"]),\n .ui.dropdown .menu > :is(.item, .header) > [class*=\"left floated\"] {\n float: inline-start;\n margin-inline: 0 1em;\n }\n\n /* Header, divider, message */\n .ui.dropdown .menu > .header {\n margin: 1.25em 0 0.75em;\n padding: 0 calc(var(--_ui-dropdown-item-padding-inline) / 0.8);\n color: var(--_ui-dropdown-header-color);\n font-size: var(--_ui-dropdown-header-font-size);\n font-weight: var(--ui-font-weight-bold);\n text-transform: uppercase;\n }\n .ui.dropdown .menu > .divider {\n height: 0;\n margin: 0.5em 0;\n border: 0;\n border-top: var(--ui-border-width) solid var(--_ui-dropdown-item-divider-color);\n }\n .ui.dropdown .menu > .message {\n padding: var(--_ui-dropdown-item-padding-block) var(--_ui-dropdown-item-padding-inline);\n color: var(--_ui-dropdown-message-color);\n font-weight: var(--ui-font-weight-normal);\n cursor: default;\n }\n\n /* Input inside the menu (search in menu). */\n .ui.dropdown .menu > .input {\n display: flex;\n min-width: 10em;\n margin: 1em 0.75em;\n }\n .ui.dropdown .menu > .header + .input {\n margin-top: 0;\n }\n .ui.dropdown .menu > .input > input {\n flex: 1 1 auto;\n min-width: 0;\n padding: 0.5em 1em;\n border: var(--ui-border-width) solid var(--_ui-dropdown-border-color);\n border-radius: var(--_ui-dropdown-radius);\n background: var(--_ui-dropdown-background);\n color: var(--_ui-dropdown-color);\n font: inherit;\n }\n\n /* Scrolling section inside a menu. */\n .ui.dropdown .menu > .scrolling.menu {\n position: static;\n display: block;\n max-height: var(--_ui-dropdown-menu-scrolling-max-height);\n margin: 0;\n overflow: hidden auto;\n overscroll-behavior: contain;\n border: none;\n border-top: var(--ui-border-width) solid var(--_ui-dropdown-menu-border-color);\n border-radius: 0 0 var(--_ui-dropdown-menu-radius) var(--_ui-dropdown-menu-radius);\n box-shadow: none;\n }\n\n /* Addition: the synthesized \"Add ...\" item. */\n .ui.dropdown .menu > .hidden.addition.item {\n display: none;\n }\n .ui.dropdown .menu > .stuck.addition.item:first-child {\n position: sticky;\n top: 0;\n z-index: 14;\n background: var(--_ui-dropdown-menu-background);\n box-shadow: var(--_ui-dropdown-menu-shadow);\n }\n}\n\n/*******************************\n Variations\n*******************************/\n\n@layer ui.components.dropdown.variations {\n /* Selection / search menus: scroll after about six items; items wrap and are divided. */\n .ui:is(.selection, .search).dropdown:not(.unlimited) > .menu {\n max-height: var(--_ui-dropdown-menu-max-height);\n overflow: hidden auto;\n overscroll-behavior: contain;\n }\n .ui.selection.dropdown > .menu[popover] {\n width: anchor-size(width);\n }\n .ui.selection.dropdown > .menu:not([popover]) {\n width: calc(100% + 2 * var(--ui-border-width));\n margin-inline: calc(var(--ui-border-width) * -1);\n }\n .ui.selection.dropdown .menu > .item {\n padding: var(--_ui-dropdown-item-padding-block) var(--_ui-dropdown-item-padding-inline);\n border-top: var(--ui-border-width) solid var(--_ui-dropdown-item-divider-color);\n white-space: normal;\n overflow-wrap: normal;\n }\n .ui.selection.dropdown .menu > .item:first-child,\n .ui.selection:is(.pointing, .floating).dropdown .menu > .item:first-child {\n border-top: none;\n }\n\n /* Short / long / unlimited / resizable menus. */\n .ui.selection.short.dropdown > .menu {\n max-height: calc(var(--_ui-dropdown-menu-max-height) * 0.75);\n }\n .ui.selection[class*=\"very short\"].dropdown > .menu {\n max-height: calc(var(--_ui-dropdown-menu-max-height) * 0.5);\n }\n .ui.selection.long.dropdown > .menu {\n max-height: calc(var(--_ui-dropdown-menu-max-height) * 2);\n }\n .ui.selection[class*=\"very long\"].dropdown > .menu {\n max-height: calc(var(--_ui-dropdown-menu-max-height) * 3);\n }\n\n /* Scrolling: any dropdown's menu scrolls. */\n .ui.scrolling.dropdown > .menu {\n max-height: var(--_ui-dropdown-menu-scrolling-max-height);\n overflow: hidden auto;\n overscroll-behavior: contain;\n }\n .ui.scrolling.dropdown .menu > .item {\n border-top: none;\n }\n .ui.scrolling.resizable.dropdown > .menu,\n .ui.dropdown .menu > .scrolling.resizable.menu {\n height: var(--_ui-dropdown-menu-scrolling-max-height);\n max-height: none;\n resize: vertical;\n }\n\n /* Compact: no minimum width; the menu sizes to its items. */\n .ui.compact.dropdown {\n min-width: 0;\n }\n .ui.compact.dropdown > .menu[popover],\n .ui.compact.dropdown > .menu {\n width: max-content;\n }\n .ui.compact.dropdown .menu > .item {\n white-space: normal;\n }\n\n /* Fluid: full width. */\n .ui.fluid.dropdown {\n display: block;\n width: 100%;\n min-width: 0;\n }\n .ui.fluid.dropdown > .dropdown.icon {\n float: inline-end;\n }\n\n /* Columnar: `columnar=\"3\"` => `three column`, items in a grid. */\n .ui.column.dropdown > .menu {\n flex-wrap: wrap;\n }\n .ui[class*=\"two column\"].dropdown .menu > .item {\n width: 50%;\n }\n .ui[class*=\"three column\"].dropdown .menu > .item {\n width: 33.333%;\n }\n .ui[class*=\"four column\"].dropdown .menu > .item {\n width: 25%;\n }\n .ui[class*=\"five column\"].dropdown .menu > .item {\n width: 20%;\n }\n\n /* Upward: opens above. */\n .ui.upward.dropdown > .menu:not([popover]) {\n top: auto;\n bottom: 100%;\n }\n .ui.upward.dropdown > .menu[popover] {\n position-area: block-start span-inline-end;\n }\n\n /* Direction: `.left.menu` opens toward the inline start (right-aligned). */\n .ui.dropdown > .left.menu:not([popover]) {\n inset-inline: auto 0;\n }\n .ui.dropdown > .left.menu[popover] {\n position-area: block-end span-inline-start;\n }\n .ui.upward.dropdown > .left.menu[popover] {\n position-area: block-start span-inline-start;\n }\n\n /* Floating: further away, with a floating shadow. */\n .ui.floating.dropdown {\n --_ui-dropdown-menu-offset: var(--_ui-dropdown-floating-offset);\n --_ui-dropdown-menu-shadow: var(--_ui-dropdown-floating-shadow);\n }\n .ui.floating.dropdown > .menu:not([popover]) {\n margin-top: var(--_ui-dropdown-menu-offset);\n }\n .ui.upward.floating.dropdown > .menu:not([popover]) {\n margin-top: 0;\n margin-bottom: var(--_ui-dropdown-menu-offset);\n }\n .ui:is(.floating, .pointing).dropdown .menu > .item:first-child {\n border-start-start-radius: var(--_ui-dropdown-menu-radius);\n border-start-end-radius: var(--_ui-dropdown-menu-radius);\n }\n .ui:is(.floating, .pointing).dropdown .menu > .item:last-child {\n border-end-start-radius: var(--_ui-dropdown-menu-radius);\n border-end-end-radius: var(--_ui-dropdown-menu-radius);\n }\n\n /*\n * Pointing: an arrow on the menu, pointing at the root. Never flips -- the arrow would point away.\n * - `pointing` / `top pointing`: below, centred; `bottom pointing`: above, centred\n * - `top left` / `top right`: below, aligned to that edge; `bottom left` / `bottom right`: above\n * - `left pointing`: to the inline end (arrow on the menu's left); `right pointing`: to the start\n */\n .ui.pointing.dropdown {\n --_ui-dropdown-menu-offset: var(--_ui-dropdown-pointing-offset);\n }\n .ui.pointing.dropdown > .menu[popover] {\n position-area: block-end center;\n position-try-fallbacks: none;\n }\n .ui.pointing.dropdown > .menu:not([popover]) {\n margin-top: var(--_ui-dropdown-menu-offset);\n }\n .ui.pointing.dropdown > .menu::after {\n content: \"\";\n position: absolute;\n top: calc(var(--_ui-dropdown-arrow-size) / -2);\n left: 50%;\n z-index: 2;\n display: block;\n width: var(--_ui-dropdown-arrow-size);\n height: var(--_ui-dropdown-arrow-size);\n margin: 0 0 0 calc(var(--_ui-dropdown-arrow-size) / -2);\n background: var(--_ui-dropdown-menu-background);\n box-shadow: calc(var(--ui-border-width) * -1) calc(var(--ui-border-width) * -1) 0 0\n var(--_ui-dropdown-menu-border-color);\n rotate: 45deg;\n pointer-events: none;\n }\n .ui.pointing.dropdown > .menu:has(> .item:first-child:hover)::after {\n background: color-mix(in oklab, var(--_ui-dropdown-menu-background), var(--_ui-dropdown-item-background-hover));\n }\n /* top left */\n .ui[class*=\"top left pointing\"].dropdown > .menu[popover] {\n position-area: block-end span-inline-end;\n }\n .ui[class*=\"top left pointing\"].dropdown > .menu::after {\n left: var(--_ui-dropdown-pointing-edge);\n margin: 0;\n }\n /* top right */\n .ui[class*=\"top right pointing\"].dropdown > .menu[popover] {\n position-area: block-end span-inline-start;\n }\n .ui[class*=\"top right pointing\"].dropdown > .menu:not([popover]) {\n inset-inline: auto 0;\n }\n .ui[class*=\"top right pointing\"].dropdown > .menu::after {\n left: auto;\n right: var(--_ui-dropdown-pointing-edge);\n margin: 0;\n }\n /* left / right: beside the root, top edges aligned. */\n .ui[class*=\"left pointing\"]:not([class*=\"top left\"], [class*=\"bottom left\"]).dropdown > .menu[popover] {\n position-area: inline-end span-block-end;\n margin: 0 0 0 var(--_ui-dropdown-pointing-edge);\n }\n .ui[class*=\"right pointing\"]:not([class*=\"top right\"], [class*=\"bottom right\"]).dropdown > .menu[popover] {\n position-area: inline-start span-block-end;\n margin: 0 var(--_ui-dropdown-pointing-edge) 0 0;\n }\n .ui[class*=\"left pointing\"]:not([class*=\"top left\"], [class*=\"bottom left\"]).dropdown > .menu:not([popover]) {\n top: 0;\n left: 100%;\n right: auto;\n margin: 0 0 0 var(--_ui-dropdown-pointing-edge);\n }\n .ui[class*=\"right pointing\"]:not([class*=\"top right\"], [class*=\"bottom right\"]).dropdown > .menu:not([popover]) {\n top: 0;\n left: auto;\n right: 100%;\n margin: 0 var(--_ui-dropdown-pointing-edge) 0 0;\n }\n .ui[class*=\"left pointing\"]:not([class*=\"top left\"], [class*=\"bottom left\"]).dropdown > .menu::after {\n top: 1em;\n left: calc(var(--_ui-dropdown-arrow-size) / -2);\n margin: 0;\n rotate: -45deg;\n }\n .ui[class*=\"right pointing\"]:not([class*=\"top right\"], [class*=\"bottom right\"]).dropdown > .menu::after {\n top: 1em;\n left: auto;\n right: calc(var(--_ui-dropdown-arrow-size) / -2);\n margin: 0;\n rotate: 135deg;\n }\n /* bottom (and upward pointing): above the root. */\n .ui:is(\n [class*=\"bottom pointing\"],\n [class*=\"bottom left pointing\"],\n [class*=\"bottom right pointing\"],\n .pointing.upward\n ).dropdown\n > .menu:not([popover]) {\n top: auto;\n bottom: 100%;\n margin: 0 0 var(--_ui-dropdown-menu-offset);\n }\n .ui:is([class*=\"bottom pointing\"], .pointing.upward).dropdown > .menu[popover] {\n position-area: block-start center;\n }\n .ui[class*=\"bottom left pointing\"].dropdown > .menu[popover] {\n position-area: block-start span-inline-end;\n }\n .ui[class*=\"bottom right pointing\"].dropdown > .menu[popover] {\n position-area: block-start span-inline-start;\n }\n .ui:is(\n [class*=\"bottom pointing\"],\n [class*=\"bottom left pointing\"],\n [class*=\"bottom right pointing\"],\n .pointing.upward\n ).dropdown\n > .menu::after {\n top: auto;\n bottom: calc(var(--_ui-dropdown-arrow-size) / -2);\n rotate: -135deg;\n }\n .ui[class*=\"bottom left pointing\"].dropdown > .menu::after {\n left: var(--_ui-dropdown-pointing-edge);\n margin: 0;\n }\n .ui[class*=\"bottom right pointing\"].dropdown > .menu::after {\n left: auto;\n right: var(--_ui-dropdown-pointing-edge);\n margin: 0;\n }\n\n /* Simple: opens on hover / focus with no script; the menu is NOT a popover. */\n .ui.simple.dropdown > .menu {\n display: block;\n visibility: hidden;\n opacity: 0;\n transition:\n opacity var(--_ui-dropdown-duration) var(--ui-ease),\n visibility 0s var(--_ui-dropdown-duration);\n }\n\n /* Form states: `state=\"error\"` ... tint the box, text, menu border and items. */\n .ui.dropdown:is(.error, .info, .success, .warning),\n .ui.dropdown:is(.error, .info, .success, .warning) > .text {\n color: var(--ui-color-text);\n }\n .ui.selection.dropdown:is(.error, .info, .success, .warning) {\n --_ui-dropdown-border-color: var(--ui-color-border);\n --_ui-dropdown-border-color-hover: var(--ui-color-border);\n --_ui-dropdown-border-color-focus: var(--ui-color-border);\n background: var(--ui-color-background);\n }\n .ui.dropdown:is(.error, .info, .success, .warning) > .menu {\n --_ui-dropdown-menu-border-color: var(--ui-color-border);\n --_ui-dropdown-item-color: var(--ui-color-text);\n --_ui-dropdown-item-background-hover: var(--ui-color-background);\n --_ui-dropdown-item-background-selected: var(--ui-color-background);\n }\n .ui.dropdown:is(.error, .info, .success, .warning) > .default.text {\n color: color-mix(in oklab, var(--ui-color-text) 60%, transparent);\n }\n\n /* Inverted: for dark surfaces -- the dark scheme's tokens, whatever the page scheme. */\n .ui.inverted.dropdown {\n color-scheme: dark;\n }\n .ui.inverted.selection.dropdown {\n --_ui-dropdown-border-color: oklch(from var(--ui-ink-on-dark) l c h / 0.15);\n --_ui-dropdown-border-color-hover: oklch(from var(--ui-ink-on-dark) l c h / 0.25);\n }\n}\n\n/*******************************\n States\n*******************************/\n\n@layer ui.components.dropdown.states {\n /* Hover / focus / open: the selection box's border. */\n .ui.selection.dropdown:hover {\n border-color: var(--_ui-dropdown-border-color-hover);\n }\n .ui.selection.dropdown:is(:focus-within, .active, :has(> .menu:popover-open)) {\n border-color: var(--_ui-dropdown-border-color-focus);\n }\n .ui.selection.dropdown:is(:focus-within, .active, :has(> .menu:popover-open)) > :is(.dropdown, .search).icon {\n opacity: 1;\n }\n .ui.selection.dropdown:is(.active, :has(> .menu:popover-open)) {\n z-index: 10;\n }\n .ui.selection.dropdown:is(.active, :has(> .menu:popover-open)) > .text:not(.default) {\n color: var(--ui-text-hovered);\n }\n /* The search input shows its ring on the root, around the whole box. */\n .ui.dropdown:has(> input.search:focus-visible) {\n outline: var(--ui-focus-width, 2px) solid var(--ui-focus-color, Highlight);\n outline-offset: var(--ui-focus-offset, 2px);\n }\n\n /* Searching: the old text dims under the query; clicks go to the input. */\n .ui.search.dropdown:is(.active, :has(> .menu:popover-open)) > input.search {\n cursor: auto;\n }\n .ui.search.dropdown:is(.active, :has(> .menu:popover-open)) > .text {\n pointer-events: none;\n }\n .ui.search.dropdown > input.search:focus + .text {\n color: var(--_ui-dropdown-placeholder-focus-color);\n }\n .ui.search.dropdown > input.search:focus + .text > :is(.icon, .flag) {\n opacity: var(--ui-disabled-opacity);\n }\n\n /* Open: a popover menu while `:popover-open`; a plain one while the root is `active` or it's `visible`. */\n .ui.dropdown > .menu[popover]:popover-open,\n .ui.active.dropdown > .menu:not([popover]),\n .ui.dropdown > .visible.menu:not([popover]) {\n display: block;\n opacity: 1;\n }\n .ui.column.dropdown > .menu[popover]:popover-open,\n .ui.column.active.dropdown > .menu:not([popover]),\n .ui.column.dropdown > .visible.menu:not([popover]) {\n display: flex;\n }\n @starting-style {\n .ui.dropdown > .menu[popover]:popover-open {\n opacity: 0;\n }\n }\n .ui.simple.dropdown:is(:hover, :focus-within, .active) > .menu {\n visibility: visible;\n opacity: 1;\n transition-delay: 0s;\n }\n\n /* Items: hover, keyboard highlight (`selected`), chosen (`active`), disabled, filtered out. */\n .ui.dropdown .menu > .item:hover {\n z-index: 13;\n background: var(--_ui-dropdown-item-background-hover);\n color: var(--_ui-dropdown-item-color-hover);\n }\n .ui.dropdown .menu > .selected.item {\n background: var(--_ui-dropdown-item-background-selected);\n color: var(--_ui-dropdown-item-color-hover);\n }\n .ui.dropdown .menu > :is(.active, [aria-selected=\"true\"]).item {\n z-index: 12;\n color: var(--_ui-dropdown-item-color-hover);\n font-weight: var(--_ui-dropdown-item-font-weight-active);\n }\n .ui.dropdown .menu > :is(.disabled, [aria-disabled=\"true\"]).item {\n cursor: default;\n opacity: var(--_ui-dropdown-disabled-opacity);\n pointer-events: none;\n }\n .ui.dropdown .menu > .filtered.item {\n display: none;\n }\n\n /* Remove / delete icons brighten on hover. */\n .ui.dropdown > .remove.icon:hover,\n .ui.multiple.dropdown > .label > .delete.icon:hover {\n opacity: 1;\n }\n\n /* Loading: the caret becomes a spinner; no clearing while loading. */\n .ui.loading.dropdown > .dropdown.icon::before,\n .ui.loading.dropdown > .dropdown.icon::after {\n content: \"\";\n position: absolute;\n top: 50%;\n left: 50%;\n box-sizing: border-box;\n width: 1.1em;\n height: 1.1em;\n margin: -0.55em 0 0 -0.55em;\n border: var(--_ui-dropdown-loader-width) solid transparent;\n border-radius: var(--ui-radius-circle);\n background: none;\n clip-path: none;\n }\n .ui.loading.dropdown > .dropdown.icon::before {\n border-color: color-mix(in oklab, currentColor 20%, transparent);\n }\n .ui.loading.dropdown > .dropdown.icon::after {\n border-top-color: currentColor;\n animation: ui-dropdown-spin var(--_ui-dropdown-loader-speed) linear infinite;\n }\n .ui.loading.dropdown > .dropdown.icon > * {\n visibility: hidden;\n }\n .ui.loading.dropdown > .remove.icon {\n display: none;\n }\n\n /* Disabled / read-only: inert, and nothing to clear or delete. */\n .ui.disabled.dropdown {\n cursor: default;\n opacity: var(--_ui-dropdown-disabled-opacity);\n pointer-events: none;\n }\n .ui.read-only.dropdown {\n cursor: default;\n pointer-events: none;\n }\n .ui:is(.disabled, .read-only).dropdown > .remove.icon,\n .ui:is(.disabled, .read-only).dropdown > .label > .delete.icon {\n display: none;\n }\n}\n","import { For, Show } from \"solid-js\"\nimport { isServer, type JSX } from \"@solidjs/web\"\n\nimport { E, UI, UIT } from \"spell/ui/core\"\nimport { F } from \"spell/ui/forms\"\nimport { dropdownVocabulary } from \"./UIDropdown.en\"\nimport { DropdownFallback } from \"./UIDropdown.fallback\"\nimport { SlottedItems } from \"./SlottedItems\"\n\nimport buttonCSS from \"spell/ui/components/ui-button/UIButton.css?inline\"\nimport dropdownCSS from \"./UIDropdown.css?inline\"\n\n/****************\n * ### `UIDropdown`\n * The component behind `<ui-dropdown>`: a combobox and its listbox, to choose one value or several.\n *\n * - Its shadow DOM: a `<button>` combobox (with `search`, an `<input>`),\n * and an anchor-positioned popover menu.\n *\n * - Its options (`MenuOptions`):\n * the slotted `<ui-item>`s (`SlottedItems`), then the `options` property, then additions.\n * `@derived` members work out the visible list on each key\n * (leaving out chosen ones, filtering, adding the addition).\n *\n * - `value` and `open` are controlled (`@controlled`): the events go first, and a handler may cancel or override.\n * - Invoker commands (`<button commandfor=\"id\" command=\"--toggle\">`, `ToggleCommands`) open and close the menu,\n * as a person's action; a disabled or read-only dropdown ignores them.\n * - The menu's rows render only while it's open (`<For>`, keyed by option);\n * `aria-activedescendant` points at the highlighted row.\n * - Escape and outside clicks come from `UI.overlays`.\n * - A form control: `multiple` submits one `FormData` entry per value; `required` => `valueMissing`.\n * Named by `label`, else by the DOM element's `<label for>` / `aria-label` (`ControlLabels`).\n * - An option's `flag` draws through `UIT.Flags`, the rule `<ui-flag>` draws with.\n * Fomantic's country names (`france`) are `<ui-flag>`'s alone, so a flag that isn't a code shows as its text.\n *\n * - In a static server render (`spell/ui/static`):\n * - the menu is closed, with its rows rendered (their text is in the page)\n * - the `<ui-item>`s are dropped\n * - the value goes in hidden inputs, so a static form submits it\n * - choosing needs script\n ****************/\nexport class UIDropdown extends F.FormComponent<typeof dropdownVocabulary> {\n /**\n * Rows PageUp / PageDown move.\n * - `@proto`: a subclass or an instance may set its own.\n */\n declare pageSize: number\n\n /**\n * How long type-ahead keeps what was typed, in ms: a key after a longer pause starts a new search.\n * - `@proto`: a subclass or an instance may set its own (a test, a shorter one).\n */\n declare typeAheadDelay: number\n\n @E.proto static vocabulary = dropdownVocabulary\n @E.protoMerged static elementSetup = {\n styleSheets: { button: buttonCSS, dropdown: dropdownCSS },\n cssStates: [\"fluid\"],\n Fallback: DropdownFallback,\n // `loading`: a spinner in place of its dropdown icon\n loading: \"its own\"\n } satisfies Partial<E.ElementSetup>\n\n /** Default: 10 rows. */\n @E.proto static pageSize = 10\n\n /** Default: 500 ms. */\n @E.proto static typeAheadDelay = 500\n\n ////////////////\n // ## Options\n ////////////////\n\n /** Options from slotted `<ui-item>`s. */\n readonly items = new SlottedItems(this.domElement)\n\n /** Which slots have light-DOM children (`icon`, `trigger`, `header`). */\n readonly slots = new E.SlotContent(this.domElement)\n\n /** Values added with `allow-additions`, as options. */\n @E.state accessor addedOptions: readonly E.MenuOption[] = []\n\n /** `options` property, validated to an array. */\n get propertyOptions(): UIT.DropdownOptions {\n const options = this.options\n return Array.isArray(options) ? (options as UIT.DropdownOptions) : []\n }\n\n /** Every option: slotted, then `options`, then additions; the same list while equal. */\n @E.derived({ equals: E.isSameList })\n get allOptions(): readonly E.MenuOption[] {\n return [...this.items.entries.filter(UIDropdown.isOption), ...this.propertyOptions, ...this.addedOptions]\n }\n\n /** Option by value, for texts of chosen values. */\n @E.derived\n get optionsByValue(): ReadonlyMap<string, E.MenuOption> {\n return new Map(this.allOptions.map((option) => [option.value, option]))\n }\n\n /** Search-key cache shared by every `MenuOptions` this element derives. */\n private readonly keys = new WeakMap() as NonNullable<F.MenuOptionsProps[\"keys\"]>\n\n ////////////////\n // ## Value\n ////////////////\n\n /** `value`: set by the page, or chosen; starts from the `selected` items (so it's below `items`). */\n @E.controlled(\"value\")\n accessor value = this.items.selectedValue(!!this.multiple)\n\n /** The page's value to restore on a form reset (`undefined`: back to the `selected` items). */\n private readonly initialValue = this.isControlledByPage(\"value\") ? this.value : undefined\n\n /** Chosen values, always as an array; the same list while equal. */\n @E.derived({ equals: E.isSameList })\n get chosenValues(): readonly string[] {\n return SlottedItems.valuesIn(this.value, !!this.multiple)\n }\n\n /** Chosen values as a set, for row state. */\n @E.derived\n get chosenValueSet(): ReadonlySet<string> {\n return new Set(this.chosenValues)\n }\n\n /** Text of `value`: its option's, else `text` (single), else the value itself. */\n private textFor(value: string): string {\n return this.optionsByValue.get(value)?.text ?? (this.multiple ? undefined : this.label) ?? value\n }\n\n /** Room for another value (`max-selections`)? */\n private get hasRoomForMore(): boolean {\n const max = this.maxSelections\n return !this.multiple || max === undefined || this.chosenValues.length < max\n }\n\n /** Choose `option` (or add the addition), as the person did with `originalEvent`. */\n @E.untracked\n select(option: E.MenuOption, originalEvent?: Event) {\n if (option.disabled || this.readonly) return\n const values = this.chosenValues\n const isAddition = \"addition\" in option\n if (this.multiple) {\n if (!this.hasRoomForMore) return\n const next = [...values, option.value]\n this.commit(next, originalEvent, () => this.send(\"ui-added\", { value: option.value, originalEvent }))\n this.query = \"\"\n this.highlighted.index = 0\n } else {\n this.commit([option.value], originalEvent, () => {\n if (isAddition) this.send(\"ui-added\", { value: option.value, originalEvent })\n })\n this.requestOpen(false, originalEvent)\n }\n if (isAddition) this.addedOptions = [...this.addedOptions, { value: option.value, text: option.text }]\n }\n\n /** Remove one chosen value (multiple). */\n @E.untracked\n remove(value: string, originalEvent?: Event) {\n if (this.readonly || this.isDisabled) return\n const next = this.chosenValues.filter((item) => item !== value)\n this.commit(next, originalEvent, () => this.send(\"ui-removed\", { value, originalEvent }))\n }\n\n /**\n * Change the value to `next` through `requestChange()`: `announce()` (ui-added / ui-removed) and `ui-changed` first.\n * - Returns true when applied.\n */\n private commit(next: readonly string[], originalEvent: Event | undefined, announce?: () => void): boolean {\n const value = this.multiple ? [...next] : (next[0] ?? \"\")\n return this.requestChange(\"value\", value, () => {\n announce?.()\n this.send(\"ui-changed\", { value, originalEvent })\n return true\n })\n }\n\n ////////////////\n // ## The form\n ////////////////\n\n get formValue(): E.FieldValue {\n const values = this.chosenValues\n return this.multiple ? values : (values[0] ?? null)\n }\n\n /** Back to the starting value; clears the query. */\n onFormReset() {\n this.value = this.initialValue\n this.query = \"\"\n }\n\n protected get validationLabel(): string | undefined {\n return this.accessibleName\n }\n\n protected get validationAnchor(): HTMLElement | undefined {\n return this.combobox\n }\n\n ////////////////\n // ## Search\n ////////////////\n\n /** Search query. */\n @E.state accessor query = \"\"\n\n /** The effective query: only with `search`. */\n get effectiveQuery(): string {\n return this.search ? this.query : \"\"\n }\n\n /** Type-ahead buffer: what was typed since the last pause. */\n private typedSoFar = \"\"\n\n /** Clears `typedSoFar` after `typeAheadDelay`. */\n private typeAheadTimer?: E.CancelablePromise<unknown>\n\n /** Type-ahead: extend the buffer, highlight the next match (opening first if needed). */\n @E.untracked\n private typeAhead(key: string, event: KeyboardEvent) {\n this.typeAheadTimer?.cancel()\n this.typedSoFar += key\n this.typeAheadTimer = E.after(this.typeAheadDelay / 1000, () => (this.typedSoFar = \"\"))\n if (!this.isOpen) this.requestOpen(true, event)\n const options = this.visibleOptions\n const index = options.selectionForKey(this.typedSoFar, this.highlighted.index)\n if (index >= 0) this.highlighted.index = index\n }\n\n ////////////////\n // ## The menu rows\n ////////////////\n\n /** Options offered now: minus chosen (multiple), filtered, plus the addition. */\n @E.derived\n get visibleOptions(): F.MenuOptions {\n const query = this.effectiveQuery\n return new F.MenuOptions({ options: this.allOptions, keys: this.keys })\n .excludeSelected(this.multiple ? this.chosenValues : [])\n .filter(query, { minCharacters: this.minCharacters ?? 0 })\n .withAdditions(query, { allowAdditions: this.allowAdditions && this.hasRoomForMore })\n }\n\n /** Menu rows: separators in place unless searching, else the visible options; the same list while equal. */\n @E.derived({ equals: E.isSameList })\n get menuRows(): readonly (E.MenuEntry | E.MenuAddition)[] {\n const visible = this.visibleOptions\n const entries = this.items.entries\n if (this.effectiveQuery || !entries.some((entry) => \"type\" in entry)) return visible.options\n const shown = new Set<E.MenuOption>(visible.options)\n const rows: (E.MenuEntry | E.MenuAddition)[] = entries.filter((entry) => \"type\" in entry || shown.has(entry))\n const slotted = new Set<E.MenuEntry>(entries)\n for (const option of visible.options) if (!slotted.has(option)) rows.push(option)\n return rows\n }\n\n /**\n * The highlighted row of `visibleOptions.options`.\n * - Fomantic's `selected` class marks it; its `active` is the CHOSEN option.\n */\n readonly highlighted = new F.HighlightedOption(() => this.visibleOptions.options)\n\n /** Highlighted option. */\n get highlightedOption(): E.MenuOption | undefined {\n return this.highlighted.option as E.MenuOption | undefined\n }\n\n /** Open: keep the highlighted row in view. */\n @E.onChange(\"isOpen\", \"highlightedOption\")\n protected onHighlightChanged(isOpen: boolean, option: E.MenuOption | undefined) {\n // `menu`: rendered, so `idFor()` has the menu's id to build on\n if (!isOpen || !option || !this.menu) return\n this.domElement.renderRoot.getElementById(this.idFor(option))?.scrollIntoView({ block: \"nearest\" })\n }\n\n /** Stable DOM id of `option`'s row, made on first ask. */\n private idFor(option: E.MenuOption): string {\n let id = this.optionIds.get(option)\n if (!id) this.optionIds.set(option, (id = `${this.ids.menu}-${++UIDropdown.optionCounter}`))\n return id\n }\n\n /** Stable DOM id per option. */\n private readonly optionIds = new WeakMap<E.MenuOption, string>()\n\n ////////////////\n // ## Open\n ////////////////\n\n /** `open`: set by the page, or opened and closed by a person; `:state(open)`. */\n @E.cssState(\"open\")\n @E.controlled(\"open\")\n accessor isOpen = false\n\n /**\n * The menu, a popover panel on `isOpen`: `ui-opening` / `ui-closing`, the overlay entry, the anchor.\n * - Never opens while disabled or readonly.\n * - Opening highlights the chosen option, else the first enabled one; closing clears the query.\n */\n readonly popover = new E.PopoverPanel({\n component: this,\n member: \"isOpen\",\n restoreFocus: false,\n canChange: (open) => !open || !(this.isDisabled || this.readonly),\n onChange: (open) => this.onOpenedOrClosed(open)\n })\n\n /** Open or close as a person would (`popover.request()`); true when it changed. */\n requestOpen(open: boolean, originalEvent?: Event): boolean {\n return this.popover.request(open, originalEvent)\n }\n\n /** Opened: highlight the chosen option, else the first enabled one; closed: clear the query. */\n @E.untracked\n private onOpenedOrClosed(open: boolean) {\n if (!open) {\n this.query = \"\"\n return\n }\n const options = this.visibleOptions\n const chosen = options.options.findIndex((option) => this.chosenValueSet.has(option.value))\n if (chosen >= 0) this.highlighted.index = chosen\n else this.highlighted.moveTo(\"first\")\n }\n\n /**\n * The menu shows while open AND connected, once rendered (`PopoverPanel.follow()`).\n * - `isConnected`: `keepAlive` keeps an open dropdown's state when it's removed,\n * but the page must not keep its overlay entry (Escape / outside clicks) for an element that isn't there;\n * reconnecting re-registers.\n * - `isReady`: the menu renders only then; an element opened before shows it as it arrives.\n */\n @E.onChange(\"isOpen\", \"isConnected\", \"isReady\")\n protected onOpenChanged(isOpen: boolean, isConnected: boolean, isReady: boolean) {\n return this.popover.follow(this.menu, isOpen && isConnected && isReady)\n }\n\n ////////////////\n // ## Name and classes\n ////////////////\n\n /**\n * Name of the combobox and its listbox:\n * `label`, else what names the DOM element (`labels`: `<label for>`, `aria-label` ...).\n */\n private get accessibleName(): string | undefined {\n return this.fallbackName || this.labels.accessibleName\n }\n\n protected classValue(name: E.AttributeName<typeof dropdownVocabulary>): unknown {\n if (name === \"open\") return this.isOpen\n return super.classValue(name)\n }\n\n ////////////////\n // ## Rendering\n ////////////////\n\n /** Ids, from `UI.ids` once rendering. */\n private ids = { menu: \"\", text: \"\" }\n\n /** The combobox: the trigger button, or the search input. */\n private combobox?: HTMLElement\n\n /** The listbox popover. */\n private menu?: HTMLElement\n\n render(): JSX.Element {\n this.ids = { menu: UI.ids.next(ID_PREFIX), text: UI.ids.next(ID_PREFIX) }\n return (\n <div class={this.rootClass} style={this.popover.anchorStyle} onClick={this.onRootClick}>\n <Show when={this.multiple}>\n <For each={this.chosenValues}>{(value) => this.chip(value)}</For>\n </Show>\n <Show when={this.search} fallback={this.trigger()}>\n {this.searchInput()}\n <Show when={this.multiple}>\n <span class={SIZER} aria-hidden=\"true\">\n {this.query}\n </span>\n </Show>\n </Show>\n <Show when={this.labeled && this.icon}>{this.labeledIcon()}</Show>\n <span\n id={this.ids.text}\n class={[UIT.TEXT, { [DEFAULT]: this.placeholderIsShowing, [FILTERED]: !!this.effectiveQuery }]}\n part={this.partForName(\"text\")}\n >\n <slot name={this.slotForName(\"trigger\")}>{this.displayText}</slot>\n </span>\n <Show when={this.clearable && this.chosenValues.length && !this.readonly}>\n <button\n type=\"button\"\n class={CLEAR_ICON}\n part={this.partForName(\"clear\")}\n aria-label={this.translationForKey(\"clear\")}\n onClick={this.onClear}\n />\n </Show>\n <span class={CARET_ICON} part={this.partForName(\"icon\")}>\n <Show when={this.slots.hasContent(this.slotForName(\"icon\"))}>\n <slot name={this.slotForName(\"icon\")} />\n </Show>\n </span>\n {this.listbox()}\n {isServer ? this.staticValues() : <slot hidden />}\n </div>\n )\n }\n\n /** Name for the combobox and listbox when nothing else names it: `placeholder`, else `label`, else `name`. */\n private get fallbackName(): string {\n return this.placeholder ?? this.label ?? this.name ?? \"\"\n }\n\n /** Text shown in `.text`: chosen text (single), else `label` (a menu's fixed label), else the placeholder. */\n private get displayText(): string {\n const [first] = this.chosenValues\n if (first !== undefined && !this.multiple) return this.textFor(first)\n return this.label ?? this.placeholder ?? \"\"\n }\n\n /** Showing the placeholder (grey `default` text)? */\n private get placeholderIsShowing(): boolean {\n return !this.chosenValues.length && this.label === undefined\n }\n\n /** `direction` holds `left`: the menu extends leftward (`.left.menu`). */\n private get opensLeft(): boolean {\n return String(this.direction ?? \"\")\n .split(E.WHITESPACE)\n .includes(UIT.LEFT)\n }\n\n /** `appearance=\"simple\"`: opens on hover / focus, with no script and no popover. */\n private get isSimple(): boolean {\n return String(this.appearance ?? \"\")\n .split(E.WHITESPACE)\n .includes(SIMPLE)\n }\n\n /** Combobox role and ARIA, shared by the trigger and the search input; the static render's control mark. */\n private get comboboxAttributes() {\n const highlighted = this.highlightedOption\n return {\n role: \"combobox\",\n \"aria-expanded\": this.popover.ariaExpanded,\n \"aria-controls\": this.ids.menu,\n \"aria-haspopup\": \"listbox\",\n \"aria-activedescendant\": this.isOpen && highlighted ? this.idFor(highlighted) : undefined,\n \"aria-label\": this.accessibleName,\n \"aria-describedby\": this.ids.text,\n \"aria-busy\": this.loading ? \"true\" : undefined,\n \"aria-readonly\": this.readonly ? \"true\" : undefined,\n \"aria-required\": this.required ? \"true\" : undefined,\n \"aria-invalid\": this.validation.valid ? undefined : \"true\",\n [UIT.STATIC_CONTROL]: isServer ? \"\" : undefined\n } as const\n }\n\n /** The covering `<button>` combobox. */\n private trigger(): JSX.Element {\n return (\n <button\n ref={(element) => (this.combobox = element)}\n type=\"button\"\n class={TRIGGER}\n part={this.partForName(\"trigger\")}\n disabled={this.isDisabled}\n {...this.comboboxAttributes}\n onClick={this.onTriggerClick}\n onKeyDown={this.onKeyDown}\n onBlur={this.onBlur}\n />\n )\n }\n\n /** The search `<input>` combobox. */\n private searchInput(): JSX.Element {\n return (\n <input\n ref={(element) => (this.combobox = element)}\n class={SEARCH}\n part={this.partForName(\"search\")}\n autocomplete=\"off\"\n aria-autocomplete=\"list\"\n disabled={this.isDisabled}\n readonly={this.readonly}\n value={this.query}\n {...this.comboboxAttributes}\n onInput={this.onInput}\n onClick={this.onTriggerClick}\n onKeyDown={this.onKeyDown}\n onBlur={this.onBlur}\n />\n )\n }\n\n /** A chosen value's label, with its delete button (multiple). */\n private chip(value: string): JSX.Element {\n return (\n <span class={CHIP} part={this.partForName(\"label\")}>\n {this.textFor(value)}\n <Show when={!this.readonly && !this.isDisabled}>\n <button\n type=\"button\"\n class={DELETE_ICON}\n tabindex=\"-1\"\n aria-label={this.translationForKey(\"removeValue\", { value: this.textFor(value) })}\n onClick={(event) => this.remove(value, event)}\n />\n </Show>\n </span>\n )\n }\n\n /** The icon block of a `labeled` (icon) dropdown button. */\n private labeledIcon(): JSX.Element {\n return this.iconBox(this.icon)\n }\n\n /** An icon box drawing `name`: once loaded in a browser, at once on a server. */\n private iconBox(name: string | undefined): JSX.Element {\n if (isServer) return <span class={UIT.ICON}>{new E.IconGlyph({ owner: this, name: () => name }).svg}</span>\n return <span class={UIT.ICON} ref={(element) => void UIDropdown.fillIcon(element, name)} />\n }\n\n /**\n * Server render only: the value as hidden inputs (one per value), so a static form submits it without JS.\n * - Why not the combobox: a `<button>` submits nothing, and a search input holds the query.\n */\n private staticValues(): JSX.Element {\n return (\n <Show when={this.name}>\n {(name) => (\n <For each={this.chosenValues}>\n {(value) => <input type=\"hidden\" name={name()} value={value} disabled={this.isDisabled} />}\n </For>\n )}\n </Show>\n )\n }\n\n /** The listbox popover. */\n private listbox(): JSX.Element {\n return (\n <div\n ref={(element) => (this.menu = element)}\n id={this.ids.menu}\n class={[MENU, { [UIT.LEFT]: this.opensLeft }]}\n style={this.popover.panelStyle}\n role=\"listbox\"\n // a server render can't show a popover: an open menu is a plain one, shown by the root's `active`\n popover={this.isSimple || (isServer && this.isOpen) ? undefined : \"manual\"}\n part={this.partForName(\"menu\")}\n aria-label={this.accessibleName}\n aria-multiselectable={this.multiple ? \"true\" : undefined}\n onMouseDown={UIDropdown.preventDefault}\n >\n <slot name={this.slotForName(\"header\")} />\n {/* a server render's rows: the text is in the page, the menu stays closed */}\n <Show when={this.isOpen || this.isSimple || isServer}>\n <For each={this.menuRows}>{(row) => this.row(row)}</For>\n <Show when={!this.visibleOptions.length}>\n {/* an option (disabled) rather than a bare div: a listbox must own options (axe `aria-required-children`) */}\n <div class={UIT.MESSAGE} role=\"option\" aria-disabled=\"true\" aria-selected=\"false\">\n {this.noResultsText ?? this.translationForKey(\"noResults\")}\n </div>\n </Show>\n </Show>\n </div>\n )\n }\n\n /** One menu row. */\n private row(row: E.MenuEntry | E.MenuAddition): JSX.Element {\n if (\"type\" in row) return this.separator(row)\n if (\"addition\" in row) return this.addition(row)\n const option = row\n const slot = this.items.slots.get(option)\n return (\n <div\n id={this.idFor(option)}\n class={[\n UIT.ITEM,\n {\n [UIT.ACTIVE]: this.chosenValueSet.has(option.value),\n [UIT.SELECTED]: this.highlightedOption === option,\n [UIT.DISABLED]: !!option.disabled\n }\n ]}\n role=\"option\"\n part={this.partForName(\"item\")}\n aria-selected={this.chosenValueSet.has(option.value) ? \"true\" : \"false\"}\n aria-disabled={option.disabled ? \"true\" : undefined}\n onPointerMove={() => this.highlighted.highlight(option)}\n onClick={(event) => this.select(option, event)}\n >\n <Show when={slot} fallback={this.optionContent(option)}>\n <slot name={slot} />\n </Show>\n </div>\n )\n }\n\n /** Icon / image / flag, text with `<mark>`ed matches, description. */\n private optionContent(option: E.MenuOption): JSX.Element {\n return (\n <>\n <Show when={typeof option.icon === \"string\"}>{this.iconBox(option.icon as string)}</Show>\n <Show when={typeof option.image === \"string\"}>\n <img class={AVATAR_IMAGE} src={option.image as string} alt=\"\" />\n </Show>\n <Show when={typeof option.flag === \"string\"}>\n <span class={FLAG}>{UIT.Flags.emojiFor(option.flag as string) || (option.flag as string)}</span>\n </Show>\n <Show when={option.description}>\n <span class={UIT.DESCRIPTION}>{option.description}</span>\n </Show>\n <span class={UIT.TEXT}>{this.markedText(option)}</span>\n </>\n )\n }\n\n /** `option.text` with the query's matches in `<mark>`. */\n private markedText(option: E.MenuOption): JSX.Element {\n const query = this.effectiveQuery\n if (!query) return option.text\n return E.markedPieces(option.text, this.visibleOptions.highlights(option, query)).map((piece) =>\n piece.isMarked ? <mark>{piece.text}</mark> : piece.text\n )\n }\n\n /** The \"Add …\" row of `allow-additions`. */\n private addition(option: E.MenuAddition): JSX.Element {\n const template = this.additionText ?? this.translationForKey(\"addItem\")\n const [before = \"\", after = \"\"] = template.split(VALUE_PLACEHOLDER)\n return (\n <div\n id={this.idFor(option)}\n class={[UIT.ITEM, ADDITION, { [UIT.SELECTED]: this.highlightedOption === option }]}\n role=\"option\"\n part={this.partForName(\"item\")}\n aria-selected=\"false\"\n onPointerMove={() => this.highlighted.highlight(option)}\n onClick={(event) => this.select(option, event)}\n >\n {before}\n <b>{option.text}</b>\n {after}\n </div>\n )\n }\n\n /** Header or divider row. */\n private separator(entry: E.MenuSeparator): JSX.Element {\n return entry.type === DIVIDER ? (\n <hr class={DIVIDER} role=\"presentation\" />\n ) : (\n <div class={UIT.HEADER} role=\"presentation\">\n {entry.text}\n </div>\n )\n }\n\n ////////////////\n // ## Handlers\n ////////////////\n\n /**\n * An invoker command aimed at the DOM element (`ToggleCommands`):\n * a person's action, ignored when disabled or read-only.\n * - Opening focuses the combobox, as opening it by keyboard leaves it (the keys need it).\n */\n @E.on(\"command\")\n protected onCommand(event: Event) {\n if (this.isDisabled || this.readonly) return\n const action = UIT.ToggleCommands.action(event, this.isOpen)\n if (action === \"show\") {\n this.combobox?.focus({ preventScroll: true })\n this.requestOpen(true, event)\n } else if (action === \"close\") this.requestOpen(false, event)\n }\n\n /** Trigger / input click: toggle (the input only opens). */\n @E.untracked\n private readonly onTriggerClick = (event: MouseEvent) => {\n // Safari doesn't focus a <button> on a mouse click, and the keys (arrows, Enter, Escape) need focus here\n // (`detail` is 0 for a keyboard or scripted click, which has the focus it needs, or none to give)\n if (event.detail > 0) this.combobox?.focus({ preventScroll: true })\n if (this.search && this.isOpen) return\n this.requestOpen(!this.isOpen, event)\n }\n\n /** Click on the root outside the combobox (caret, text of a search dropdown): focus + toggle. */\n @E.untracked\n private readonly onRootClick = (event: MouseEvent) => {\n const target = event.composedPath()[0]\n if (!this.search || target === this.combobox || this.menu?.contains(target as Node)) return\n if ((target as Element).closest?.(\"button\")) return\n this.combobox?.focus()\n this.requestOpen(!this.isOpen, event)\n }\n\n /** Clear button. */\n private readonly onClear = (event: MouseEvent) => {\n event.stopPropagation()\n this.commit([], event)\n }\n\n /** Search typing: filter, open, highlight the first match, `ui-searched`. */\n private readonly onInput = (event: InputEvent) => {\n const query = (event.currentTarget as HTMLInputElement).value\n this.query = query\n this.requestOpen(true, event)\n this.highlighted.index = 0\n this.send(\"ui-searched\", { query, originalEvent: event })\n }\n\n /**\n * Leaving the combobox closes the menu, unless focus stays inside,\n * or moves to (or is lost by a press on) one of this dropdown's invoker buttons.\n * - That button's `command` decides,\n * so `--toggle` closes an open menu instead of closing it here and reopening it.\n */\n private readonly onBlur = (event: FocusEvent) => {\n const next = event.relatedTarget as Node | null\n if (next && (this.domElement.contains(next) || this.domElement.renderRoot.contains(next))) return\n const id = this.domElement.id\n if (id && (next as Element | null)?.closest?.(`[commandfor=\"${CSS.escape(id)}\"]`)) return\n if (this.isReady && UI.overlays.pressedInvokerOf(this.domElement)) return\n this.requestOpen(false, event)\n }\n\n /** Combobox keyboard pattern (APG), plus type-ahead and Backspace-removes-last. */\n @E.untracked\n private readonly onKeyDown = (event: KeyboardEvent) => {\n if (this.isDisabled || event.defaultPrevented) return\n const isOpen = this.isOpen\n const { key } = event\n switch (key) {\n case UIT.Key.arrowDown:\n case UIT.Key.arrowUp:\n event.preventDefault()\n if (!isOpen) this.requestOpen(true, event)\n else this.highlighted.move(key === UIT.Key.arrowDown ? 1 : -1)\n return\n case UIT.Key.home:\n case UIT.Key.end:\n if (!isOpen) return\n event.preventDefault()\n this.highlighted.moveTo(key === UIT.Key.home ? \"first\" : \"last\")\n return\n case UIT.Key.pageDown:\n case UIT.Key.pageUp:\n if (!isOpen) return\n event.preventDefault()\n this.highlighted.move(key === UIT.Key.pageDown ? this.pageSize : -this.pageSize)\n return\n case UIT.Key.enter: {\n if (!isOpen) {\n if (this.search) this.requestOpen(true, event)\n return\n }\n event.preventDefault()\n const visible = this.visibleOptions\n const option = this.highlightedOption ?? visible.addition\n if (option) this.select(option, event)\n return\n }\n case UIT.Key.space: {\n if (this.search || !isOpen) return\n event.preventDefault()\n const option = this.highlightedOption\n if (option) this.select(option, event)\n return\n }\n case UIT.Key.tab:\n if (isOpen) this.requestOpen(false, event)\n return\n case UIT.Key.backspace: {\n const values = this.chosenValues\n if (this.search && this.multiple && !this.query && values.length) {\n this.remove(values.at(-1)!, event)\n }\n return\n }\n }\n if (!this.search && key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey) {\n event.preventDefault()\n this.typeAhead(key, event)\n }\n }\n\n ////////////////\n // ## Statics\n ////////////////\n\n /**\n * Counter behind option ids.\n * - STATIC: page-wide, so two dropdowns never share an id.\n */\n private static optionCounter = 0\n\n /**\n * Is `entry` an option (not a separator)?\n * - STATIC: pure, a `filter()` predicate.\n */\n private static isOption(entry: E.MenuEntry): entry is E.MenuOption {\n return !(\"type\" in entry)\n }\n\n /**\n * `preventDefault()`: menu presses must not take focus from the combobox.\n * - STATIC: one handler for every instance.\n */\n private static preventDefault(event: Event) {\n event.preventDefault()\n }\n\n /**\n * Draw icon `name` from the packs `element` sees (its `<ui-root icons>`, else `UI.icons`) into it, once loaded.\n * - Plain DOM, no signal: rows are many and their icons never change.\n * - NEVER rejects (fire-and-forget), as `IconGlyph` does:\n * a runtime chunk or icon that won't load draws no icon, not a page error.\n * - STATIC: needs no instance, only the element.\n */\n private static async fillIcon(element: HTMLElement, name: string | undefined) {\n if (!name) return\n try {\n const icons = E.IconGlyph.packsFor(element, (await UI.load()).icons)\n const template = icons.peek(name) ?? (await icons.get(name))\n if (template) element.replaceChildren(E.IconGlyph.draw(template))\n } catch {\n // no icon\n }\n }\n}\n\n/**\n * The vocabulary's attribute getters, typed (see \"Attributes\" in `UIComponent`).\n * - Minus `value`: the `@controlled` member of that name wins over its getter, and holds a `string[]` too.\n */\nexport interface UIDropdown extends Omit<E.AttributeValues<typeof dropdownVocabulary>, \"value\"> {}\n\n////////////////\n// ## Constants\n////////////////\n\n/** `UI.ids` prefix. */\nconst ID_PREFIX = \"ui-dropdown\"\n\n/** Placeholder in the `addItem` text. */\nconst VALUE_PLACEHOLDER = \"{value}\"\n\n/**\n * Class words of the markup contract (`UIDropdown.css`) -- grammar, not attributes, so not in the vocabulary.\n * - NOTE: `active` === chosen, `selected` === highlighted: Fomantic's meanings.\n */\nconst DEFAULT = \"default\"\n\n/** Class word of the text while a search filters. */\nconst FILTERED = \"filtered\"\n\n/** Class word of the listbox. */\nconst MENU = \"menu\"\n\n/** Class word of the \"Add …\" row. */\nconst ADDITION = \"addition\"\n\n/** Class words of a divider row; also `<ui-item kind=\"divider\">`. */\nconst DIVIDER = \"divider\"\n\n/** Class word of the covering trigger button. */\nconst TRIGGER = \"trigger\"\n\n/** Class word of the search input. */\nconst SEARCH = \"search\"\n\n/** Class word of the hidden span that sizes a `multiple` search input to its query. */\nconst SIZER = \"sizer\"\n\n/** The `appearance` word of a dropdown that opens on hover, with no popover. */\nconst SIMPLE = \"simple\"\n\n/** Class words of the clear button. */\nconst CLEAR_ICON = \"remove icon\"\n\n/** Class words of the caret. */\nconst CARET_ICON = \"dropdown icon\"\n\n/** Class words of a chosen value's label (`multiple`). */\nconst CHIP = \"ui label\"\n\n/** Class words of a chip's delete button. */\nconst DELETE_ICON = \"delete icon\"\n\n/** Class words of an option's `image`. */\nconst AVATAR_IMAGE = \"ui avatar image\"\n\n/** Class word of an option's `flag`. */\nconst FLAG = \"flag\"\n","/**\n * The dropdown family: defines `<ui-dropdown>`, and exports its component.\n * - Also the `dropdown` lib entry (`spell/ui/ui-dropdown`), measured in `notes/report.md`.\n * - SIDE EFFECT: importing it defines `<ui-item>` (through `spell/ui/components/ui-item`, first,\n * so the dropdown can read upgraded items), then `<ui-dropdown>`.\n * - `UIItem` belongs to the `item` family (`spell/ui/ui-item`, shared with list and menu):\n * it isn't exported here.\n */\n\nimport { UIDropdown } from \"./UIDropdown\"\n\nimport \"spell/ui/components/ui-item\"\n\nUIDropdown.define()\n\nexport { UIDropdown }\n"],"mappings":";;;;;;;;;AAiBA,IAAagJ,IAAqB;CAChC,KAAK;CACL,MAAM;CACN,aAAa;CACb,QAAQ;EAAC;EAAS;EAAU;EAAa;EAAS;EAAY;EAAS;CAAS;CAChF,KAAK;EAAC;EAAU;EAAY;EAAU;EAAgB;EAAe;CAAc;CACnF,UAAU;CACV,MAAM;CACN,aAAa;CACb,YAAY;EACV;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,aAAa;EACf;EACA;GACE,MAAM;GACN,OAAO;GACP,MAAM;GACN,QAAQ;IAAC;IAAS;IAAQ;IAAW;GAAS;GAC9C,aAAa;EACf;EACA;GAAE,MAAM;GAAa,OAAO;GAAc,MAAM;GAAW,a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