@threadlabs/looma 0.1.22 → 0.1.23

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 (248) hide show
  1. package/dist/{chunk-NIPNHZ5W.js → chunk-GDMQKT5F.js} +63 -31
  2. package/dist/{chunk-SZJQ3NPX.js → chunk-TL4FIE7X.js} +4 -8
  3. package/dist/cjs/{index-D07f6BOw.js → index-BHG9Rpil.js} +33 -0
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/looma.cjs.js +2 -2
  6. package/dist/cjs/{manager-C9j3HZay.js → manager-Ce25WRtl.js} +6 -7
  7. package/dist/cjs/ui-affordance-scope.cjs.entry.js +1 -1
  8. package/dist/cjs/ui-avatar-group.cjs.entry.js +1 -1
  9. package/dist/cjs/ui-avatar.cjs.entry.js +1 -1
  10. package/dist/cjs/ui-badge.cjs.entry.js +1 -1
  11. package/dist/cjs/ui-button.cjs.entry.js +16 -5
  12. package/dist/cjs/ui-checkbox.cjs.entry.js +1 -1
  13. package/dist/cjs/ui-combobox.cjs.entry.js +541 -0
  14. package/dist/cjs/ui-context-menu.cjs.entry.js +3 -3
  15. package/dist/cjs/ui-dialog.cjs.entry.js +3 -3
  16. package/dist/cjs/ui-disclosure.cjs.entry.js +2 -2
  17. package/dist/cjs/ui-floating-action-button.cjs.entry.js +2 -2
  18. package/dist/cjs/ui-form-field.cjs.entry.js +3 -3
  19. package/dist/cjs/ui-icon-button.cjs.entry.js +2 -2
  20. package/dist/cjs/ui-input.cjs.entry.js +11 -6
  21. package/dist/cjs/ui-menu-item.cjs.entry.js +2 -2
  22. package/dist/cjs/ui-menu.cjs.entry.js +3 -3
  23. package/dist/cjs/ui-popover.cjs.entry.js +3 -3
  24. package/dist/cjs/ui-radio-group.cjs.entry.js +2 -2
  25. package/dist/cjs/ui-radio.cjs.entry.js +3 -3
  26. package/dist/cjs/ui-search-result-row.cjs.entry.js +2 -2
  27. package/dist/cjs/ui-search-shell.cjs.entry.js +2 -2
  28. package/dist/cjs/ui-select.cjs.entry.js +15 -7
  29. package/dist/cjs/ui-switch.cjs.entry.js +3 -3
  30. package/dist/cjs/ui-tabs.cjs.entry.js +2 -2
  31. package/dist/cjs/ui-textarea.cjs.entry.js +10 -6
  32. package/dist/cjs/ui-toast-region.cjs.entry.js +2 -2
  33. package/dist/cjs/ui-tooltip.cjs.entry.js +52 -16
  34. package/dist/cjs/ui-top-bar.cjs.entry.js +2 -2
  35. package/dist/cjs/ui-tree-item.cjs.entry.js +7 -3
  36. package/dist/cjs/ui-tree.cjs.entry.js +81 -9
  37. package/dist/collection/collection-manifest.json +1 -0
  38. package/dist/collection/components/ui-button/ui-button.css +36 -26
  39. package/dist/collection/components/ui-button/ui-button.js +14 -3
  40. package/dist/collection/components/ui-combobox/ui-combobox.css +24 -0
  41. package/dist/collection/components/ui-combobox/ui-combobox.js +973 -0
  42. package/dist/collection/components/ui-context-menu/ui-context-menu.js +1 -1
  43. package/dist/collection/components/ui-dialog/ui-dialog.js +1 -1
  44. package/dist/collection/components/ui-disclosure/ui-disclosure.js +1 -1
  45. package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.js +1 -1
  46. package/dist/collection/components/ui-form-field/ui-form-field.css +4 -0
  47. package/dist/collection/components/ui-form-field/ui-form-field.js +1 -1
  48. package/dist/collection/components/ui-icon-button/ui-icon-button.js +1 -1
  49. package/dist/collection/components/ui-input/ui-input.css +8 -6
  50. package/dist/collection/components/ui-input/ui-input.js +11 -7
  51. package/dist/collection/components/ui-menu/ui-menu.js +1 -1
  52. package/dist/collection/components/ui-menu-item/ui-menu-item.js +1 -1
  53. package/dist/collection/components/ui-popover/ui-popover.js +1 -1
  54. package/dist/collection/components/ui-radio/ui-radio.js +2 -2
  55. package/dist/collection/components/ui-radio-group/ui-radio-group.js +1 -1
  56. package/dist/collection/components/ui-search-result-row/ui-search-result-row.js +1 -1
  57. package/dist/collection/components/ui-search-shell/ui-search-shell.js +1 -1
  58. package/dist/collection/components/ui-select/ui-select.css +8 -6
  59. package/dist/collection/components/ui-select/ui-select.js +17 -11
  60. package/dist/collection/components/ui-switch/ui-switch.js +2 -2
  61. package/dist/collection/components/ui-tabs/ui-tabs.js +1 -1
  62. package/dist/collection/components/ui-textarea/ui-textarea.css +7 -6
  63. package/dist/collection/components/ui-textarea/ui-textarea.js +10 -7
  64. package/dist/collection/components/ui-toast-region/ui-toast-region.js +1 -1
  65. package/dist/collection/components/ui-tooltip/ui-tooltip.js +102 -15
  66. package/dist/collection/components/ui-top-bar/ui-top-bar.js +1 -1
  67. package/dist/collection/components/ui-tree/ui-tree.js +100 -8
  68. package/dist/collection/components/ui-tree-item/ui-tree-item.js +44 -2
  69. package/dist/collection/field/combobox.js +4 -0
  70. package/dist/collection/field/valibot.js +5 -0
  71. package/dist/collection/field/validation.js +62 -0
  72. package/dist/collection/overlay/manager.js +6 -7
  73. package/dist/components/index.d.ts +2 -0
  74. package/dist/components/index.js +1 -1
  75. package/dist/components/p-Bh_1GxOD.js +1 -0
  76. package/dist/components/p-C-0syqXZ.js +1 -0
  77. package/dist/components/p-CaietZcq.js +1 -0
  78. package/dist/components/p-DHd18bK7.js +1 -0
  79. package/dist/components/ui-affordance-scope.js +1 -1
  80. package/dist/components/ui-avatar-group.js +1 -1
  81. package/dist/components/ui-avatar.js +1 -1
  82. package/dist/components/ui-badge.js +1 -1
  83. package/dist/components/ui-button.js +1 -1
  84. package/dist/components/ui-checkbox.js +1 -1
  85. package/dist/components/ui-combobox.d.ts +11 -0
  86. package/dist/components/ui-combobox.js +1 -0
  87. package/dist/components/ui-context-menu.js +1 -1
  88. package/dist/components/ui-dialog.js +1 -1
  89. package/dist/components/ui-disclosure.js +1 -1
  90. package/dist/components/ui-floating-action-button.js +1 -1
  91. package/dist/components/ui-form-field.js +1 -1
  92. package/dist/components/ui-icon-button.js +1 -1
  93. package/dist/components/ui-input.js +1 -1
  94. package/dist/components/ui-menu-item.js +1 -1
  95. package/dist/components/ui-menu.js +1 -1
  96. package/dist/components/ui-popover.js +1 -1
  97. package/dist/components/ui-radio-group.js +1 -1
  98. package/dist/components/ui-radio.js +1 -1
  99. package/dist/components/ui-search-result-row.js +1 -1
  100. package/dist/components/ui-search-shell.js +1 -1
  101. package/dist/components/ui-select.js +1 -1
  102. package/dist/components/ui-switch.js +1 -1
  103. package/dist/components/ui-tabs.js +1 -1
  104. package/dist/components/ui-textarea.js +1 -1
  105. package/dist/components/ui-toast-region.js +1 -1
  106. package/dist/components/ui-tooltip.js +1 -1
  107. package/dist/components/ui-top-bar.js +1 -1
  108. package/dist/components/ui-tree-item.js +2 -2
  109. package/dist/components/ui-tree.js +1 -1
  110. package/dist/esm/{index-CEeiinfk.js → index-8BGiMGQ0.js} +33 -1
  111. package/dist/esm/loader.js +3 -3
  112. package/dist/esm/looma.js +3 -3
  113. package/dist/esm/{manager-PM9a74r7.js → manager-C-0syqXZ.js} +6 -7
  114. package/dist/esm/ui-affordance-scope.entry.js +1 -1
  115. package/dist/esm/ui-avatar-group.entry.js +1 -1
  116. package/dist/esm/ui-avatar.entry.js +1 -1
  117. package/dist/esm/ui-badge.entry.js +1 -1
  118. package/dist/esm/ui-button.entry.js +16 -5
  119. package/dist/esm/ui-checkbox.entry.js +1 -1
  120. package/dist/esm/ui-combobox.entry.js +539 -0
  121. package/dist/esm/ui-context-menu.entry.js +3 -3
  122. package/dist/esm/ui-dialog.entry.js +3 -3
  123. package/dist/esm/ui-disclosure.entry.js +2 -2
  124. package/dist/esm/ui-floating-action-button.entry.js +2 -2
  125. package/dist/esm/ui-form-field.entry.js +3 -3
  126. package/dist/esm/ui-icon-button.entry.js +2 -2
  127. package/dist/esm/ui-input.entry.js +11 -6
  128. package/dist/esm/ui-menu-item.entry.js +2 -2
  129. package/dist/esm/ui-menu.entry.js +3 -3
  130. package/dist/esm/ui-popover.entry.js +3 -3
  131. package/dist/esm/ui-radio-group.entry.js +2 -2
  132. package/dist/esm/ui-radio.entry.js +3 -3
  133. package/dist/esm/ui-search-result-row.entry.js +2 -2
  134. package/dist/esm/ui-search-shell.entry.js +2 -2
  135. package/dist/esm/ui-select.entry.js +15 -7
  136. package/dist/esm/ui-switch.entry.js +3 -3
  137. package/dist/esm/ui-tabs.entry.js +2 -2
  138. package/dist/esm/ui-textarea.entry.js +10 -6
  139. package/dist/esm/ui-toast-region.entry.js +2 -2
  140. package/dist/esm/ui-tooltip.entry.js +52 -16
  141. package/dist/esm/ui-top-bar.entry.js +2 -2
  142. package/dist/esm/ui-tree-item.entry.js +7 -3
  143. package/dist/esm/ui-tree.entry.js +81 -9
  144. package/dist/index.cjs +883 -123
  145. package/dist/index.d.cts +104 -1
  146. package/dist/index.d.ts +104 -1
  147. package/dist/index.js +62 -8
  148. package/dist/looma/looma.esm.js +1 -1
  149. package/dist/looma/{p-0198bb21.entry.js → p-13347631.entry.js} +1 -1
  150. package/dist/looma/p-14c081cf.entry.js +1 -0
  151. package/dist/looma/{p-0f45c5f0.entry.js → p-25366205.entry.js} +1 -1
  152. package/dist/looma/{p-a9f46811.entry.js → p-2e3aa869.entry.js} +1 -1
  153. package/dist/looma/p-40fe7fee.entry.js +1 -0
  154. package/dist/looma/p-446cda76.entry.js +1 -0
  155. package/dist/looma/p-4fc1b005.entry.js +13 -0
  156. package/dist/looma/p-582973b5.entry.js +1 -0
  157. package/dist/looma/{p-d273b857.entry.js → p-5a87b59d.entry.js} +1 -1
  158. package/dist/looma/{p-2ed7e241.entry.js → p-5da09f47.entry.js} +1 -1
  159. package/dist/looma/{p-7e94d90d.entry.js → p-69a5557b.entry.js} +1 -1
  160. package/dist/looma/p-6a8a4736.entry.js +1 -0
  161. package/dist/looma/{p-caa8fc7b.entry.js → p-6bf4038b.entry.js} +1 -1
  162. package/dist/looma/p-7e0bb7f6.entry.js +1 -0
  163. package/dist/looma/{p-ed5abf6d.entry.js → p-8204fee6.entry.js} +1 -1
  164. package/dist/looma/{p-5ba9d496.entry.js → p-8238e0dc.entry.js} +1 -1
  165. package/dist/looma/p-8BGiMGQ0.js +2 -0
  166. package/dist/looma/{p-051f578c.entry.js → p-8b8840b8.entry.js} +1 -1
  167. package/dist/looma/{p-1674cda4.entry.js → p-99d88efb.entry.js} +1 -1
  168. package/dist/looma/p-C-0syqXZ.js +1 -0
  169. package/dist/looma/p-a27669b1.entry.js +1 -0
  170. package/dist/looma/{p-11083743.entry.js → p-a6ee76b7.entry.js} +1 -1
  171. package/dist/looma/p-a90d2821.entry.js +1 -0
  172. package/dist/looma/{p-2e6f791e.entry.js → p-add36e74.entry.js} +1 -1
  173. package/dist/looma/{p-0584a051.entry.js → p-b6398a6b.entry.js} +1 -1
  174. package/dist/looma/{p-078f9fb8.entry.js → p-d50faaff.entry.js} +1 -1
  175. package/dist/looma/{p-b7aa4488.entry.js → p-d77278ce.entry.js} +1 -1
  176. package/dist/looma/p-d9ec13b7.entry.js +1 -0
  177. package/dist/looma/{p-1681b218.entry.js → p-ecf8005f.entry.js} +1 -1
  178. package/dist/looma/p-ed368426.entry.js +1 -0
  179. package/dist/looma/{p-063f5a89.entry.js → p-f0487ff3.entry.js} +1 -1
  180. package/dist/looma/p-f74e5546.entry.js +1 -0
  181. package/dist/types/components/ui-combobox/ui-combobox.d.ts +93 -0
  182. package/dist/types/components/ui-input/ui-input.d.ts +1 -1
  183. package/dist/types/components/ui-select/ui-select.d.ts +3 -2
  184. package/dist/types/components/ui-textarea/ui-textarea.d.ts +1 -1
  185. package/dist/types/components/ui-tooltip/ui-tooltip.d.ts +18 -1
  186. package/dist/types/components/ui-tree/ui-tree.d.ts +9 -1
  187. package/dist/types/components/ui-tree-item/ui-tree-item.d.ts +4 -0
  188. package/dist/types/components.d.ts +260 -28
  189. package/dist/types/field/combobox.d.ts +46 -0
  190. package/dist/types/field/valibot.d.ts +7 -0
  191. package/dist/types/field/validation.d.ts +56 -0
  192. package/dist/{ui-affordance-scope.entry-L533MECG.js → ui-affordance-scope.entry-VO4C2MZX.js} +1 -1
  193. package/dist/{ui-avatar-group.entry-BWS7E2CM.js → ui-avatar-group.entry-TAXJRIIU.js} +1 -1
  194. package/dist/{ui-avatar.entry-3INAY3XP.js → ui-avatar.entry-T6FU6ZYM.js} +1 -1
  195. package/dist/{ui-badge.entry-2WOBVOYP.js → ui-badge.entry-MZFYNBMJ.js} +1 -1
  196. package/dist/ui-button.entry-7UXMUGHN.js +80 -0
  197. package/dist/{ui-checkbox.entry-2PTBHSCQ.js → ui-checkbox.entry-DMZJB3RE.js} +1 -1
  198. package/dist/ui-combobox.entry-ZCTPXEES.js +553 -0
  199. package/dist/{ui-context-menu.entry-AYDDCIZS.js → ui-context-menu.entry-2WMCBGCP.js} +6 -6
  200. package/dist/{ui-dialog.entry-I2XI3ZTZ.js → ui-dialog.entry-WO23XOSW.js} +6 -6
  201. package/dist/{ui-disclosure.entry-5LY2BT7B.js → ui-disclosure.entry-USX7OUEW.js} +2 -2
  202. package/dist/{ui-floating-action-button.entry-EJAMR5AM.js → ui-floating-action-button.entry-MXDIN7MV.js} +2 -2
  203. package/dist/{ui-form-field.entry-SJ6NNFXB.js → ui-form-field.entry-7ZCMEHPY.js} +3 -3
  204. package/dist/{ui-icon-button.entry-7SD2LVXE.js → ui-icon-button.entry-MJUNXHBU.js} +2 -2
  205. package/dist/{ui-input.entry-7MM7GEQW.js → ui-input.entry-AWG63YIG.js} +8 -6
  206. package/dist/{ui-menu-item.entry-V3HIMR75.js → ui-menu-item.entry-HFTWG62N.js} +2 -2
  207. package/dist/{ui-menu.entry-R4WK5QSX.js → ui-menu.entry-IT3GW5TL.js} +7 -7
  208. package/dist/{ui-popover.entry-ZRJRTXA7.js → ui-popover.entry-ZQQB4N6E.js} +6 -6
  209. package/dist/{ui-radio-group.entry-S6RXHFSN.js → ui-radio-group.entry-V7PCTS7I.js} +2 -2
  210. package/dist/{ui-radio.entry-B73QZK2M.js → ui-radio.entry-JYH6TQBI.js} +3 -3
  211. package/dist/{ui-search-result-row.entry-DR2Y5S7P.js → ui-search-result-row.entry-JBNYXXUN.js} +2 -2
  212. package/dist/{ui-search-shell.entry-ST5IKJBC.js → ui-search-shell.entry-TEAWE76O.js} +2 -2
  213. package/dist/{ui-select.entry-7GPRFV67.js → ui-select.entry-F3A6TE2U.js} +13 -7
  214. package/dist/{ui-switch.entry-XQ5IRJRH.js → ui-switch.entry-MJIICMP2.js} +3 -3
  215. package/dist/{ui-tabs.entry-HPW5L5CY.js → ui-tabs.entry-6REFIUHV.js} +2 -2
  216. package/dist/{ui-textarea.entry-W2PSRYVS.js → ui-textarea.entry-OJTXCED7.js} +8 -6
  217. package/dist/{ui-toast-region.entry-FJUHFXKZ.js → ui-toast-region.entry-NOFXLKPS.js} +5 -5
  218. package/dist/{ui-tooltip.entry-G5WHQW7K.js → ui-tooltip.entry-COWTWVHX.js} +57 -21
  219. package/dist/{ui-top-bar.entry-3NCHFC4Y.js → ui-top-bar.entry-PIAWXJNV.js} +2 -2
  220. package/dist/{ui-tree-item.entry-45RR3CMP.js → ui-tree-item.entry-BSEWNL2O.js} +7 -3
  221. package/dist/{ui-tree.entry-SZW4Q5PY.js → ui-tree.entry-XYI3ZFAZ.js} +77 -8
  222. package/dist/valibot.d.ts +52 -0
  223. package/dist/valibot.js +7 -0
  224. package/package.json +11 -3
  225. package/styles.css +36 -20
  226. package/theme-high-contrast.css +12 -0
  227. package/tokens.css +23 -0
  228. package/vue/{chunk-5KWCMTXB.js → chunk-JLW23USW.js} +88 -1
  229. package/vue/editor/index.js +1 -1
  230. package/vue/index.d.ts +123 -1
  231. package/vue/index.js +3 -1
  232. package/dist/components/p-CEYIKqYc.js +0 -1
  233. package/dist/components/p-CIA4RyEp.js +0 -1
  234. package/dist/components/p-PM9a74r7.js +0 -1
  235. package/dist/looma/p-34417499.entry.js +0 -1
  236. package/dist/looma/p-4b422d40.entry.js +0 -1
  237. package/dist/looma/p-54722713.entry.js +0 -13
  238. package/dist/looma/p-54c41576.entry.js +0 -1
  239. package/dist/looma/p-5d4713a6.entry.js +0 -1
  240. package/dist/looma/p-624ba086.entry.js +0 -1
  241. package/dist/looma/p-8d5adb17.entry.js +0 -1
  242. package/dist/looma/p-9194a99d.entry.js +0 -1
  243. package/dist/looma/p-CEeiinfk.js +0 -2
  244. package/dist/looma/p-PM9a74r7.js +0 -1
  245. package/dist/looma/p-a33522a2.entry.js +0 -1
  246. package/dist/looma/p-a5127c7d.entry.js +0 -1
  247. package/dist/looma/p-e3f99a24.entry.js +0 -1
  248. package/dist/ui-button.entry-VCGSEONK.js +0 -71
@@ -0,0 +1,539 @@
1
+ import { r as registerInstance, c as createEvent, g as getElement, h, H as Host } from './index-8BGiMGQ0.js';
2
+ import { a as createAnchoredSurface } from './positioning-Bu0dmLBE.js';
3
+ import { c as closeOverlay, o as openOverlay } from './manager-C-0syqXZ.js';
4
+
5
+ /** Formatting is additive: every original character must survive in order.
6
+ * Normalization belongs to submitted output, never the visible editing buffer. */
7
+ function formatEditingValue(raw, selection, format) {
8
+ const unchanged = { display: raw, selection };
9
+ if (!format)
10
+ return unchanged;
11
+ let result;
12
+ try {
13
+ result = format(raw, selection);
14
+ }
15
+ catch {
16
+ return unchanged;
17
+ }
18
+ if (!result)
19
+ return unchanged;
20
+ const characters = Array.from(raw);
21
+ let cursor = 0;
22
+ for (const character of result.display)
23
+ if (character === characters[cursor])
24
+ cursor += 1;
25
+ if (!Number.isInteger(result.selection.start) || !Number.isInteger(result.selection.end) || cursor !== characters.length || result.selection.start < 0 || result.selection.end < result.selection.start
26
+ || result.selection.end > result.display.length)
27
+ return unchanged;
28
+ return result;
29
+ }
30
+ async function validateField(request, config) {
31
+ let output = request.raw;
32
+ let issues = [];
33
+ const check = () => request.signal.throwIfAborted();
34
+ try {
35
+ check();
36
+ if (config.parse)
37
+ output = await config.parse(request.raw, request);
38
+ check();
39
+ if (config.schema) {
40
+ const result = await config.schema['~standard'].validate(output);
41
+ check();
42
+ if (result.issues)
43
+ issues = result.issues;
44
+ else if ('value' in result)
45
+ output = result.value;
46
+ }
47
+ if (!issues.some(issue => issue.severity !== 'warning')) {
48
+ if (config.normalize)
49
+ output = await config.normalize(output, request);
50
+ check();
51
+ if (config.validator) {
52
+ const result = await config.validator(output, request);
53
+ check();
54
+ issues = [...issues, ...(result.issues ?? [])];
55
+ if ('output' in result)
56
+ output = result.output;
57
+ }
58
+ }
59
+ }
60
+ catch (error) {
61
+ check();
62
+ issues = [{ message: error instanceof Error ? error.message : 'Unable to validate this value.' }];
63
+ }
64
+ issues = [...issues, ...(config.issues ?? [])];
65
+ return { output: issues.some(issue => issue.severity !== 'warning') ? undefined : output, issues };
66
+ }
67
+
68
+ const uiComboboxCss = () => `:host{display:grid;gap:var(--ui-space-1);min-inline-size:0;color:var(--ui-text-primary);font:inherit}label{color:var(--ui-field-label-color, var(--ui-text-primary));font-size:var(--ui-field-label-size, 0.875rem);font-weight:var(--ui-field-label-weight, 500)}.field{display:flex;min-inline-size:0;border:1px solid var(--ui-control-border, var(--ui-border-default));border-radius:var(--ui-radius-2);background:var(--ui-control-surface, var(--ui-surface-default))}.field:focus-within{border-color:var(--ui-control-focus, var(--ui-focus-ring));outline:2px solid var(--ui-control-focus, var(--ui-focus-ring));outline-offset:1px}input{appearance:none;width:100%;min-inline-size:0;min-block-size:var(--ui-control-min-block-size, 2.75rem);box-sizing:border-box;border:0;border-radius:inherit;background:transparent;color:inherit;font:inherit;line-height:var(--ui-line-height-md);padding:var(--ui-space-2) var(--ui-space-3);margin:0;outline:none}:host([data-size='sm']) input{min-block-size:var(--ui-field-compact-size, 2rem);padding:var(--ui-space-1) var(--ui-space-2)}button{appearance:none;border:0;border-radius:var(--ui-radius-2);background:transparent;color:var(--ui-field-affordance-color, var(--ui-text-secondary));font:inherit;font-weight:var(--ui-field-affordance-weight, 400);min-inline-size:2rem;padding:var(--ui-space-1);cursor:pointer}button:hover:enabled{background:var(--ui-surface-muted);color:var(--ui-text-primary)}button:focus-visible{outline:2px solid var(--ui-focus-ring);outline-offset:-3px}input:disabled,button:disabled{color:var(--ui-text-muted);cursor:not-allowed}.field:has(input:disabled){background:var(--ui-control-surface-disabled, var(--ui-surface-muted))}:host([data-validation='error']) .field{border-color:var(--ui-danger-solid, var(--ui-accent-active))}.popup{box-sizing:border-box;min-inline-size:12rem;max-inline-size:calc(100vw - 1rem);max-block-size:var(--ui-combobox-max-block-size, 18rem);overflow:auto;margin:0;padding:var(--ui-space-1);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-2);background:var(--ui-surface-elevated);color:var(--ui-text-primary);box-shadow:var(--ui-shadow-md)}[hidden]{display:none !important}.option{padding:var(--ui-space-2) var(--ui-space-3);border-radius:var(--ui-radius-1);cursor:pointer;overflow-wrap:anywhere}.option:hover,.option[data-active]{background:var(--ui-surface-muted);outline:1px solid var(--ui-focus-ring);outline-offset:-1px}.option[aria-disabled='true']{color:var(--ui-text-muted);cursor:not-allowed}.primary{display:block;color:var(--ui-option-primary-color, var(--ui-text-primary));font-weight:var(--ui-option-primary-weight, 500)}.secondary{display:block;color:var(--ui-option-secondary-color, var(--ui-text-secondary));font-weight:var(--ui-option-secondary-weight, 400);font-size:var(--ui-font-size-sm)}.message,.group{color:var(--ui-field-message-color, var(--ui-text-secondary));font-weight:var(--ui-field-message-weight, 400);font-size:var(--ui-font-size-sm);line-height:var(--ui-line-height-md);overflow-wrap:anywhere}.group,.popup .message{padding:var(--ui-space-2) var(--ui-space-3)}.sr-only{position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media (pointer: coarse){button{min-inline-size:2.75rem;min-block-size:2.75rem}}@media (forced-colors: active){.field,.popup{border-color:CanvasText}.option[data-active]{outline-color:Highlight}}`;
69
+
70
+ const UICombobox = class {
71
+ constructor(hostRef) {
72
+ registerInstance(this, hostRef);
73
+ this.queryChange = createEvent(this, "query-change");
74
+ this.valueChange = createEvent(this, "value-change");
75
+ this.freeEntry = createEvent(this, "free-entry");
76
+ this.createEntry = createEvent(this, "create-entry");
77
+ this.dependencyInvalidate = createEvent(this, "dependency-invalidate");
78
+ this.validationChange = createEvent(this, "validation-change");
79
+ this.optionsChange = createEvent(this, "options-change");
80
+ }
81
+ get host() { return getElement(this); }
82
+ /** Accessible visible label, associated with the native text input. */
83
+ label = '';
84
+ placeholder = '';
85
+ name = '';
86
+ /** Controlled canonical value. Undefined selects uncontrolled mode; null means no selection. */
87
+ value;
88
+ defaultValue;
89
+ /** Controlled raw editing text; independent of canonical selection. */
90
+ query;
91
+ defaultQuery = '';
92
+ /** Immutable configuration; replace the object/context when dependencies change. */
93
+ config = {};
94
+ disabled = false;
95
+ readOnly = false;
96
+ required = false;
97
+ size = 'md';
98
+ disclosure = false;
99
+ clearable = false;
100
+ /** Optional description shown by the connected question-mark button. */
101
+ help = '';
102
+ queryChange;
103
+ valueChange;
104
+ freeEntry;
105
+ createEntry;
106
+ dependencyInvalidate;
107
+ validationChange;
108
+ /** Supplies the current result rows for framework-owned rich slots. */
109
+ optionsChange;
110
+ raw = '';
111
+ display = '';
112
+ selected = null;
113
+ expanded = false;
114
+ rows = [];
115
+ active = -1;
116
+ loading = false;
117
+ helpOpen = false;
118
+ lookupError = '';
119
+ validation = { status: 'pristine', touched: false, dirty: false, issues: [] };
120
+ input;
121
+ popup;
122
+ field;
123
+ surface;
124
+ lookup;
125
+ validationRun;
126
+ lookupTimer;
127
+ composing = false;
128
+ initialRaw = '';
129
+ overlayId = `ui-combobox-${Math.random().toString(36).slice(2)}`;
130
+ alive = false;
131
+ fullSet = false;
132
+ knownOptions = new Map();
133
+ awaitingLabel = null;
134
+ proposedChange;
135
+ formattedRaw;
136
+ formattedWith;
137
+ componentWillLoad() {
138
+ this.selected = this.value !== undefined ? this.value : this.defaultValue ?? null;
139
+ this.raw = this.query ?? this.defaultQuery;
140
+ if (this.query === undefined && !this.raw && this.selected !== null) {
141
+ this.raw = this.config.options?.find(row => row.value === this.selected)?.label ?? this.selected;
142
+ }
143
+ if (this.query === undefined && this.selected !== null && this.raw === this.selected)
144
+ this.awaitingLabel = this.selected;
145
+ this.display = this.raw;
146
+ this.initialRaw = this.raw;
147
+ this.applyServerIssues();
148
+ }
149
+ connectedCallback() { this.alive = true; this.setupSurface(); }
150
+ componentDidLoad() { this.setupSurface(); }
151
+ componentDidUpdate() {
152
+ if (this.input && !this.composing && this.input.value !== this.display)
153
+ this.input.value = this.display;
154
+ if (this.expanded)
155
+ this.surface?.refresh();
156
+ }
157
+ disconnectedCallback() {
158
+ this.alive = false;
159
+ this.close();
160
+ this.validationRun?.abort();
161
+ this.surface?.destroy();
162
+ this.surface = undefined;
163
+ }
164
+ setupSurface() {
165
+ if (!this.surface && this.popup && this.field)
166
+ this.surface = createAnchoredSurface(this.popup, { anchor: this.field, placement: 'bottom-start' });
167
+ }
168
+ syncValue() {
169
+ if (this.value === undefined)
170
+ return;
171
+ this.selected = this.value;
172
+ if (this.query === undefined) {
173
+ const proposal = this.proposedChange;
174
+ const option = this.config.options?.find(row => row.value === this.selected)
175
+ ?? (this.selected === null ? undefined : this.knownOptions.get(this.selected));
176
+ const nextRaw = proposal?.value === this.selected ? proposal.query : option?.label ?? this.selected ?? '';
177
+ if (proposal?.value !== this.selected || nextRaw !== this.raw) {
178
+ this.raw = nextRaw;
179
+ this.display = this.raw;
180
+ this.formattedRaw = undefined;
181
+ }
182
+ this.awaitingLabel = !option && this.selected !== null ? this.selected : null;
183
+ }
184
+ this.resetValidation();
185
+ }
186
+ syncQuery() {
187
+ if (this.query === undefined || this.query === this.raw)
188
+ return;
189
+ // Only a selection proposal's query echo retains an uncontrolled identity.
190
+ // Other owner text replacements are edits, just like native input.
191
+ if (this.value === undefined && this.proposedChange?.query !== this.query)
192
+ this.selected = null;
193
+ this.awaitingLabel = null;
194
+ this.formattedRaw = undefined;
195
+ this.raw = this.query;
196
+ this.display = this.raw;
197
+ this.resetValidation();
198
+ if (this.expanded)
199
+ this.search('input');
200
+ }
201
+ syncDisabled() {
202
+ if (this.disabled || this.readOnly) {
203
+ this.close();
204
+ this.resetValidation();
205
+ }
206
+ }
207
+ syncConfig(next, previous) {
208
+ this.validationRun?.abort();
209
+ if (next.provider !== previous?.provider || next.context !== previous?.context)
210
+ this.knownOptions.clear();
211
+ if (next.context !== previous?.context) {
212
+ this.close();
213
+ const policy = next.invalidation ?? 'retain-query';
214
+ const value = policy === 'retain' ? this.selected : null;
215
+ const query = policy === 'clear' ? '' : this.raw;
216
+ this.commit(value, query, null, 'invalidation', 'programmatic');
217
+ this.validation = { status: 'pristine', touched: false, dirty: this.raw !== this.initialRaw, issues: [] };
218
+ }
219
+ this.applyServerIssues();
220
+ if (this.expanded)
221
+ this.search('context');
222
+ }
223
+ applyServerIssues() {
224
+ const issues = this.config.issues ?? [];
225
+ if (issues.length)
226
+ this.setValidation({ issues }, this.validation.touched);
227
+ else
228
+ this.resetValidation();
229
+ }
230
+ resetValidation() {
231
+ this.validationRun?.abort();
232
+ this.validation = { status: 'pristine', touched: this.validation.touched, dirty: this.raw !== this.initialRaw, issues: [] };
233
+ this.validationChange?.emit(this.validation);
234
+ }
235
+ cancelLookup() {
236
+ clearTimeout(this.lookupTimer);
237
+ this.lookup?.abort();
238
+ this.lookup = undefined;
239
+ this.loading = false;
240
+ }
241
+ close() {
242
+ this.expanded = false;
243
+ this.active = -1;
244
+ this.cancelLookup();
245
+ this.surface?.hide();
246
+ closeOverlay(this.overlayId);
247
+ }
248
+ open(reason = 'input') {
249
+ if (this.disabled || this.readOnly)
250
+ return;
251
+ this.expanded = true;
252
+ if (this.popup && this.field)
253
+ this.popup.style.minWidth = `${this.field.getBoundingClientRect().width}px`;
254
+ this.surface?.show();
255
+ openOverlay({ id: this.overlayId, element: this.popup, relatedElements: [this.host], modal: false,
256
+ requestClose: () => this.close() });
257
+ this.search(reason);
258
+ }
259
+ search(reason) {
260
+ this.cancelLookup();
261
+ this.fullSet = reason === 'disclosure';
262
+ this.active = -1;
263
+ this.lookupError = '';
264
+ const config = this.config;
265
+ const query = this.fullSet ? '' : this.raw;
266
+ const controller = new AbortController();
267
+ this.lookup = controller;
268
+ const apply = (options) => {
269
+ if (controller.signal.aborted || !this.alive)
270
+ return;
271
+ for (const option of options)
272
+ this.knownOptions.set(option.value, option);
273
+ const selectedOption = this.selected === null ? undefined : this.knownOptions.get(this.selected);
274
+ if (this.query === undefined && this.awaitingLabel === this.selected && selectedOption) {
275
+ this.raw = selectedOption.label;
276
+ this.display = this.raw;
277
+ this.awaitingLabel = null;
278
+ this.formattedRaw = undefined;
279
+ this.resetValidation();
280
+ }
281
+ const ids = new Set();
282
+ this.rows = options.filter(option => {
283
+ if (ids.has(option.id))
284
+ return false;
285
+ ids.add(option.id);
286
+ return this.fullSet || (config.filter ? config.filter(option, query, config.context)
287
+ : config.provider ? true : option.label.toLocaleLowerCase().includes(query.toLocaleLowerCase()));
288
+ });
289
+ const groups = new Map();
290
+ for (const row of this.rows) {
291
+ const group = row.group ?? '';
292
+ if (!groups.has(group))
293
+ groups.set(group, []);
294
+ groups.get(group).push(row);
295
+ }
296
+ this.rows = [...groups.values()].flat();
297
+ this.loading = false;
298
+ this.optionsChange.emit(this.rows);
299
+ };
300
+ if (!config.provider) {
301
+ apply(config.options ?? []);
302
+ return;
303
+ }
304
+ this.rows = [];
305
+ this.loading = true;
306
+ this.lookupTimer = setTimeout(async () => {
307
+ try {
308
+ apply(await config.provider({ query, context: config.context, signal: controller.signal, reason }));
309
+ }
310
+ catch (error) {
311
+ if (controller.signal.aborted || !this.alive)
312
+ return;
313
+ this.loading = false;
314
+ this.lookupError = error instanceof Error ? error.message : 'Unable to load suggestions.';
315
+ }
316
+ }, reason === 'disclosure' ? 0 : Math.max(0, config.debounce ?? 200));
317
+ }
318
+ get canCreate() {
319
+ return Boolean(this.config.allowCreate && this.raw.trim() && !this.loading && !this.lookupError
320
+ && !this.rows.some(row => row.label.toLocaleLowerCase() === this.raw.toLocaleLowerCase()));
321
+ }
322
+ format(timing) {
323
+ if ((this.config.formatOn ?? 'blur') !== timing || !this.input)
324
+ return;
325
+ // Selection is now in display coordinates; do not map it as raw a second time.
326
+ if (this.formattedRaw === this.raw && this.formattedWith === this.config.format)
327
+ return;
328
+ const result = formatEditingValue(this.raw, {
329
+ start: this.input.selectionStart ?? this.raw.length, end: this.input.selectionEnd ?? this.raw.length,
330
+ direction: this.input.selectionDirection ?? 'none',
331
+ }, this.config.format);
332
+ this.formattedRaw = this.raw;
333
+ this.formattedWith = this.config.format;
334
+ this.display = result.display;
335
+ if (this.input.value !== result.display) {
336
+ this.input.value = result.display;
337
+ this.input.setSelectionRange(result.selection.start, result.selection.end, result.selection.direction);
338
+ }
339
+ }
340
+ onInput = (event) => {
341
+ // Composition updates remain entirely native until compositionend.
342
+ if (this.composing || event.isComposing)
343
+ return;
344
+ this.awaitingLabel = null;
345
+ this.formattedRaw = undefined;
346
+ this.raw = this.input.value;
347
+ this.display = this.raw;
348
+ this.resetValidation();
349
+ this.format('input');
350
+ this.queryChange.emit({ query: this.raw, display: this.display, trigger: 'keyboard' });
351
+ if (this.selected !== null)
352
+ this.commit(null, this.raw, null, 'clear', 'keyboard');
353
+ this.open();
354
+ if (this.config.validateOn === 'input')
355
+ void this.validate();
356
+ queueMicrotask(() => {
357
+ if (this.query !== undefined && this.query !== this.raw)
358
+ this.syncQuery();
359
+ });
360
+ };
361
+ commit(value, query, option, kind, trigger) {
362
+ this.awaitingLabel = null;
363
+ const queryChanged = query !== this.raw;
364
+ if (this.value === undefined)
365
+ this.selected = value;
366
+ if (this.query === undefined && queryChanged) {
367
+ this.raw = query;
368
+ this.display = query;
369
+ this.formattedRaw = undefined;
370
+ }
371
+ this.resetValidation();
372
+ const detail = { value, query, option, kind, trigger };
373
+ const proposal = { value, query };
374
+ this.proposedChange = proposal;
375
+ this.valueChange.emit(detail);
376
+ if (queryChanged)
377
+ this.queryChange.emit({ query, display: query, trigger });
378
+ if (kind === 'create')
379
+ this.createEntry.emit(detail);
380
+ if (kind === 'free-entry')
381
+ this.freeEntry.emit(detail);
382
+ if (kind === 'invalidation')
383
+ this.dependencyInvalidate.emit(detail);
384
+ // Settle after all owner notifications (including Vue's queued update).
385
+ // A retained prop does not fire a Stencil watcher, so rejection must be
386
+ // reconciled explicitly while the proposal still identifies an edit echo.
387
+ queueMicrotask(() => {
388
+ if (this.proposedChange !== proposal)
389
+ return;
390
+ if (this.value !== undefined && this.value !== proposal.value)
391
+ this.syncValue();
392
+ if (this.query !== undefined && this.query !== proposal.query) {
393
+ if (this.value === undefined) {
394
+ this.selected = null;
395
+ this.resetValidation();
396
+ }
397
+ this.syncQuery();
398
+ }
399
+ this.proposedChange = undefined;
400
+ });
401
+ }
402
+ choose(index, trigger) {
403
+ const option = this.rows[index];
404
+ if (option?.disabled)
405
+ return;
406
+ if (option)
407
+ this.commit(option.value, option.label, option, 'selection', trigger);
408
+ else if (this.canCreate && index === this.rows.length)
409
+ this.commit(null, this.raw, null, 'create', trigger);
410
+ else
411
+ return;
412
+ this.close();
413
+ this.input?.focus();
414
+ if (this.config.validateOn !== 'submit')
415
+ queueMicrotask(() => void this.validate());
416
+ }
417
+ move(key) {
418
+ const indices = this.rows.flatMap((row, index) => row.disabled ? [] : [index]);
419
+ if (this.canCreate)
420
+ indices.push(this.rows.length);
421
+ if (!indices.length)
422
+ return;
423
+ const current = indices.indexOf(this.active);
424
+ const next = key === 'Home' ? 0 : key === 'End' ? indices.length - 1
425
+ : key === 'ArrowDown' ? Math.min(current + 1, indices.length - 1)
426
+ : current < 0 ? indices.length - 1 : Math.max(0, current - 1);
427
+ this.active = indices[next];
428
+ requestAnimationFrame(() => this.host.shadowRoot?.getElementById(`option-${this.active}`)?.scrollIntoView({ block: 'nearest' }));
429
+ }
430
+ onKeydown = (event) => {
431
+ if (this.composing || event.isComposing || this.disabled || this.readOnly)
432
+ return;
433
+ if (event.key === 'Escape' && this.expanded) {
434
+ event.preventDefault();
435
+ event.stopPropagation();
436
+ this.close();
437
+ return;
438
+ }
439
+ if (event.key === 'Tab') {
440
+ this.close();
441
+ return;
442
+ }
443
+ if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
444
+ return;
445
+ if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
446
+ event.preventDefault();
447
+ if (!this.expanded)
448
+ this.open('disclosure');
449
+ this.move(event.key);
450
+ }
451
+ else if ((event.key === 'Home' || event.key === 'End') && this.expanded && this.active >= 0) {
452
+ event.preventDefault();
453
+ this.move(event.key);
454
+ }
455
+ else if (event.key === 'Enter' && this.expanded) {
456
+ if (this.active >= 0) {
457
+ event.preventDefault();
458
+ this.choose(this.active, 'keyboard');
459
+ }
460
+ else if (this.config.allowFreeText) {
461
+ event.preventDefault();
462
+ this.commit(null, this.raw, null, 'free-entry', 'keyboard');
463
+ this.close();
464
+ }
465
+ }
466
+ };
467
+ onFocusOut = (event) => {
468
+ if (event.relatedTarget instanceof Node && this.host.shadowRoot?.contains(event.relatedTarget))
469
+ return;
470
+ this.close();
471
+ this.format('blur');
472
+ this.validation = { ...this.validation, touched: true };
473
+ if (this.config.allowFreeText && this.selected === null)
474
+ this.commit(null, this.raw, null, 'free-entry', 'keyboard');
475
+ if ((this.config.validateOn ?? 'blur') === 'blur')
476
+ void this.validate();
477
+ };
478
+ setValidation(result, touched = this.validation.touched) {
479
+ const blocking = result.issues.some(issue => issue.severity !== 'warning');
480
+ this.validation = { status: blocking ? 'error' : result.issues.length ? 'warning' : 'valid',
481
+ touched, dirty: this.raw !== this.initialRaw, ...result };
482
+ this.validationChange?.emit(this.validation);
483
+ }
484
+ /** Validate for submission. Caller submits only non-pending, non-error output. */
485
+ async validate() {
486
+ this.validationRun?.abort();
487
+ const run = new AbortController();
488
+ this.validationRun = run;
489
+ this.validation = { ...this.validation, status: 'pending', output: undefined };
490
+ this.validationChange.emit(this.validation);
491
+ try {
492
+ const result = await validateField({ raw: this.raw, value: this.selected, context: this.config.context, signal: run.signal }, this.config);
493
+ if (this.required && !this.raw.trim())
494
+ result.issues = [...result.issues, { message: 'A value is required.' }];
495
+ else if (this.raw && this.selected === null && !this.config.allowFreeText && !this.config.allowCreate)
496
+ result.issues = [...result.issues, { message: 'Choose a suggestion.' }];
497
+ if (result.issues.some(issue => issue.severity !== 'warning'))
498
+ result.output = undefined;
499
+ if (!run.signal.aborted && this.alive)
500
+ this.setValidation(result);
501
+ }
502
+ catch { /* Aborted work never becomes current field state. */ }
503
+ return this.validation;
504
+ }
505
+ render() {
506
+ const description = [this.helpOpen ? 'help-text' : '', this.validation.issues.length ? 'validation' : ''].filter(Boolean).join(' ') || undefined;
507
+ const status = this.loading ? 'Loading suggestions…' : this.lookupError || (this.expanded ? `${this.rows.length} suggestions available.` : '');
508
+ const groups = [...new Set(this.rows.map(row => row.group ?? ''))];
509
+ return h(Host, { key: '2378bfd8473852642fef21898f4a756eb3b092ba', "data-size": this.size, "data-validation": this.validation.status, onFocusout: this.onFocusOut }, h("label", { key: '7aba65aeb336d490ddeaf5db9bba9db8ab8b9dbb', htmlFor: "input", part: "label" }, this.label, this.required ? ' *' : ''), h("div", { key: 'ee87156259d0fe1e2e56c4b36667e8daf5e1e2c1', class: "field", part: "field", ref: element => this.field = element }, h("input", { key: '35c5b85ff9a4bcba9bddaf85ff1f118a94aa077b', id: "input", ref: element => this.input = element, role: "combobox", "aria-autocomplete": "list", "aria-expanded": String(this.expanded), "aria-controls": "listbox", "aria-activedescendant": this.expanded && this.active >= 0 ? `option-${this.active}` : undefined, "aria-describedby": description, "aria-invalid": String(this.validation.status === 'error'), "aria-busy": String(this.validation.status === 'pending'), value: this.display, placeholder: this.placeholder, name: this.name || undefined, disabled: this.disabled, readOnly: this.readOnly, required: this.required, autoComplete: "off", part: "input", onInput: this.onInput, onKeyDown: this.onKeydown, onCompositionstart: () => this.composing = true, onCompositionend: () => { this.composing = false; this.onInput(new InputEvent('input')); } }), this.clearable && h("button", { key: '74e4f44836b751ab5e9f794a39b480602e0c106d', type: "button", part: "affordance", "aria-label": `Clear ${this.label}`, disabled: this.disabled || this.readOnly, onClick: () => { this.commit(null, '', null, 'clear', 'pointer'); this.close(); this.input?.focus(); } }, "\u00D7"), this.help && h("button", { key: 'c870ced139fb22baa50a1795ab78f14c38647d34', id: "help", type: "button", part: "affordance", "aria-label": `Help for ${this.label}`, disabled: this.disabled }, h("span", { key: 'ba3dc5128c1941b21b53a5ba78a27017b3df5ec8', "aria-hidden": "true" }, "?")), this.disclosure && h("button", { key: 'eced588e3fa7958dd6185173faaef01219c30243', type: "button", part: "affordance", "aria-label": `Suggestions for ${this.label}`, "aria-controls": "listbox", "aria-expanded": String(this.expanded), disabled: this.disabled || this.readOnly, onClick: () => {
510
+ if (this.expanded)
511
+ this.close();
512
+ else
513
+ this.open('disclosure');
514
+ this.input?.focus();
515
+ } }, h("span", { key: '7cb9f7f2bb15246dcdd2348ea0ca656d1d0c8c33', "aria-hidden": "true" }, "\u2304"))), this.help && h("ui-tooltip", { key: 'b1b5d42ca457f9b951758bb5e816c8dbbcd1087d', id: "help-text", for: "help", toggleOnClick: true, onOpen: () => this.helpOpen = true, onClose: () => this.helpOpen = false }, this.help), h("div", { key: '9eca2df66c72917e6bfda21205c2a4ef97dd91d5', class: "popup", part: "popup", hidden: !this.expanded, ref: element => this.popup = element }, h("div", { key: '641e1f137c9cfef5d08ec99f6178e59487a20bf1', id: "listbox", role: "listbox", "aria-label": `${this.label} suggestions`, "aria-busy": String(this.loading) }, groups.map(group => h("div", { role: group ? 'group' : 'presentation', "aria-label": group || undefined }, group && h("div", { class: "group", part: "group" }, group), this.rows.map((row, index) => (row.group ?? '') !== group ? null : h("div", { id: `option-${index}`, role: "option", "aria-selected": String(this.selected === row.value), "aria-disabled": String(Boolean(row.disabled)), "data-active": this.active === index ? '' : undefined, part: "option", class: "option", onPointerDown: event => event.preventDefault(), onClick: () => this.choose(index, 'pointer') }, h("slot", { name: `option-${row.id}` }, h("span", { class: "primary", part: "option-primary" }, row.label), row.description && h("span", { class: "secondary", part: "option-secondary" }, row.description)))))), this.canCreate && h("div", { key: '38a3aa6b2ffae30e6f81e1f89d10c9966dd31b10', id: `option-${this.rows.length}`, role: "option", "aria-selected": "false", class: "option", part: "option", "data-active": this.active === this.rows.length ? '' : undefined, onPointerDown: event => event.preventDefault(), onClick: () => this.choose(this.rows.length, 'pointer') }, h("slot", { key: 'dd3e895ef363f6d30a0c25e4b5092a8feacc63e5', name: "create" }, "Create \u201C", this.raw, "\u201D"))), this.loading ? h("div", { class: "message" }, h("slot", { name: "loading" }, "Loading suggestions\u2026"))
516
+ : this.lookupError ? h("div", { class: "message" }, h("slot", { name: "error" }, this.lookupError))
517
+ : !this.rows.length && !this.canCreate ? h("div", { class: "message" }, h("slot", { name: "empty" }, "No suggestions.")) : null), h("div", { key: '9cf12a8fde7d9cfb9e2d2a77669ac4708c7fded6', id: "validation", class: "message", part: "validation", hidden: !this.validation.issues.length }, this.validation.issues.map(issue => h("div", null, issue.message))), h("div", { key: '1c7b1d3f658e500cbf5f5004a76a39511cc79c49', class: "sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true" }, status, " ", this.validation.status === 'pending' ? 'Checking value…' : this.validation.issues.map(issue => issue.message).join(' ')));
518
+ }
519
+ static get watchers() { return {
520
+ "value": [{
521
+ "syncValue": 0
522
+ }],
523
+ "query": [{
524
+ "syncQuery": 0
525
+ }],
526
+ "disabled": [{
527
+ "syncDisabled": 0
528
+ }],
529
+ "readOnly": [{
530
+ "syncDisabled": 0
531
+ }],
532
+ "config": [{
533
+ "syncConfig": 0
534
+ }]
535
+ }; }
536
+ };
537
+ UICombobox.style = uiComboboxCss();
538
+
539
+ export { UICombobox as ui_combobox };
@@ -1,5 +1,5 @@
1
- import { r as registerInstance, g as getElement, h, H as Host } from './index-CEeiinfk.js';
2
- import { o as openOverlay, c as closeOverlay, r as requestTopOverlayClose } from './manager-PM9a74r7.js';
1
+ import { r as registerInstance, g as getElement, h, H as Host } from './index-8BGiMGQ0.js';
2
+ import { o as openOverlay, c as closeOverlay, r as requestTopOverlayClose } from './manager-C-0syqXZ.js';
3
3
  import { d as dispatchDetail } from './events-JwSoedEO.js';
4
4
  import { a as createAnchoredSurface } from './positioning-Bu0dmLBE.js';
5
5
 
@@ -218,7 +218,7 @@ const UIContextMenu = class {
218
218
  this.closeMenu('action', 'pointer');
219
219
  };
220
220
  render() {
221
- return (h(Host, { key: '4db0d5b55ead41925aa682b1e383b5735b49bf56', "data-open": this.internalOpen ? '' : undefined, "data-focus-trigger": this.internalOpen ? this.focusTrigger : undefined, onKeyDown: this.onKeydown, onClick: this.onItemClick }, h("slot", { key: '462925d53db169c13e485789ae91e28b0abd3e40', name: "trigger" }), h("div", { key: 'cac8f3b11c4872d38e976f210ce9a43fd854b335', class: "menu", "data-open": this.internalOpen ? '' : undefined }, h("ui-menu", { key: 'ba50f74e11466da2240f7568479d5d10a614b394', open: this.internalOpen }, h("slot", { key: '1fcb45bf124e2377ac6c7fc236d2babf0d9e3bae' })))));
221
+ return (h(Host, { key: '641dd3aba6120cf4187f4503c64029eaf307dc4f', "data-open": this.internalOpen ? '' : undefined, "data-focus-trigger": this.internalOpen ? this.focusTrigger : undefined, onKeyDown: this.onKeydown, onClick: this.onItemClick }, h("slot", { key: '3f550349f9537b951b50a8c291f1951dd5a3b723', name: "trigger" }), h("div", { key: 'a612523f054986122638722340d8135c44a85399', class: "menu", "data-open": this.internalOpen ? '' : undefined }, h("ui-menu", { key: '0711879d09900183e938d8942abb8b9032812a5f', open: this.internalOpen }, h("slot", { key: '8e088dd20a48d8fb81126f2dd020abb886e86e22' })))));
222
222
  }
223
223
  static get watchers() { return {
224
224
  "open": [{
@@ -1,5 +1,5 @@
1
- import { r as registerInstance, g as getElement, h, H as Host } from './index-CEeiinfk.js';
2
- import { o as openOverlay, c as closeOverlay, r as requestTopOverlayClose } from './manager-PM9a74r7.js';
1
+ import { r as registerInstance, g as getElement, h, H as Host } from './index-8BGiMGQ0.js';
2
+ import { o as openOverlay, c as closeOverlay, r as requestTopOverlayClose } from './manager-C-0syqXZ.js';
3
3
  import { d as dispatchDetail } from './events-JwSoedEO.js';
4
4
 
5
5
  const uiDialogCss = () => `:host{display:block}:host:not([data-open]){display:none}:host dialog{--ui-dialog-duration:var(--ui-motion-base);--ui-dialog-viewport-gap:var(--ui-space-4, 1rem);position:fixed;inset:0;inline-size:min( calc(100% - (var(--ui-dialog-viewport-gap) * 2)), var(--ui-dialog-max-width, 440px) );max-inline-size:none;max-block-size:calc(100dvh - (var(--ui-dialog-viewport-gap) * 2));margin:auto;padding:var(--ui-space-4);overflow:auto;background:var(--ui-surface-elevated);border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-dialog);box-shadow:var(--ui-shadow-dialog);visibility:hidden;pointer-events:none;opacity:0;transform:scale(0.96);transition:opacity var(--ui-dialog-duration) var(--ui-motion-ease), transform var(--ui-dialog-duration) var(--ui-motion-ease), visibility var(--ui-dialog-duration), display var(--ui-dialog-duration) var(--ui-motion-ease) allow-discrete, overlay var(--ui-dialog-duration) var(--ui-motion-ease) allow-discrete}:host dialog[open]{visibility:visible;pointer-events:auto;opacity:1;transform:scale(1);animation:ui-dialog-enter var(--ui-dialog-duration) var(--ui-motion-ease)}@keyframes ui-dialog-enter{from{opacity:0;transform:scale(0.96)}}:host dialog::backdrop{background-color:transparent;transition:background-color var(--ui-dialog-duration) var(--ui-motion-ease), display var(--ui-dialog-duration) var(--ui-motion-ease) allow-discrete, overlay var(--ui-dialog-duration) var(--ui-motion-ease) allow-discrete}:host dialog[open]::backdrop{background-color:var(--ui-overlay-backdrop);animation:ui-dialog-backdrop-enter var(--ui-dialog-duration) var(--ui-motion-ease)}@keyframes ui-dialog-backdrop-enter{from{background-color:transparent}}`;
@@ -77,7 +77,7 @@ const UIDialog = class {
77
77
  }
78
78
  };
79
79
  render() {
80
- return (h(Host, { key: 'c10f9063a1c2677caff3b8d1f26b37bf25978a77', "data-open": this.internalOpen ? '' : undefined, onKeyDown: this.onKeydown }, h("dialog", { key: 'a7111bd363cab94f394cca526bf34ea8081e5228', ref: (el) => (this.dialogRef = el), open: this.internalOpen, "aria-label": this.label }, h("slot", { key: 'b0a9699fe0be09e331cfea81b6bbeaec11d48956' }))));
80
+ return (h(Host, { key: '6e88afd3a595ab0eed3d82a046ffb15e1e167cdb', "data-open": this.internalOpen ? '' : undefined, onKeyDown: this.onKeydown }, h("dialog", { key: '420e4d8de66245a5818a1284adb23a536ebcd907', ref: (el) => (this.dialogRef = el), open: this.internalOpen, "aria-label": this.label }, h("slot", { key: '10604688504f013f79b7a6ed5f9ed36bc9c6b48b' }))));
81
81
  }
82
82
  static get watchers() { return {
83
83
  "open": [{
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, g as getElement, h, H as Host } from './index-CEeiinfk.js';
1
+ import { r as registerInstance, g as getElement, h, H as Host } from './index-8BGiMGQ0.js';
2
2
  import { c as createId } from './id-hgBUJRDa.js';
3
3
  import { d as dispatchDetail, e as eventToTrigger, i as isActivationKey } from './events-JwSoedEO.js';
4
4
 
@@ -91,7 +91,7 @@ const UIDisclosure = class {
91
91
  this.setOpen(!this.internalOpen, { reason: 'action', trigger: 'keyboard' });
92
92
  };
93
93
  render() {
94
- return (h(Host, { key: '7fbc83614f8e988a43d1baac0379a6dc8826b1d5' }, h("slot", { key: '6ef33ca7bce5c4d83ab65642f52a9d17febb794d' })));
94
+ return (h(Host, { key: '3905d2d78a2d3d4ef36b582ba0f426be8e5e0f5e' }, h("slot", { key: '18547ff56457b73319264bba981f994fb947dffb' })));
95
95
  }
96
96
  static get watchers() { return {
97
97
  "open": [{
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host } from './index-CEeiinfk.js';
1
+ import { r as registerInstance, h, H as Host } from './index-8BGiMGQ0.js';
2
2
 
3
3
  const uiFloatingActionButtonCss = () => `:host{position:fixed;inset-block-end:calc( var(--ui-floating-action-button-bottom, var(--ui-space-6, 1.5rem)) + env(safe-area-inset-bottom) );inset-inline-end:max( var(--ui-floating-action-button-inline-end, var(--ui-space-5, 1.25rem)), env(safe-area-inset-right) );inline-size:var(--ui-floating-action-button-size, 56px);block-size:var(--ui-floating-action-button-size, 56px);display:inline-flex;z-index:var(--ui-floating-action-button-z-index, 100)}button{appearance:none;inline-size:100%;block-size:100%;border:none;border-radius:999px;margin:0;padding:0;display:inline-flex;align-items:center;justify-content:center;background:var(--ui-floating-action-button-bg, var(--ui-accent-solid));color:var(--ui-floating-action-button-color, var(--ui-text-on-accent));box-shadow:var( --ui-floating-action-button-shadow, 0 4px 12px color-mix(in srgb, var(--ui-accent-solid) 40%, transparent) );cursor:pointer;transition:background-color var(--ui-motion-fast, 160ms) var(--ui-motion-ease, ease), transform var(--ui-motion-fast, 160ms) var(--ui-motion-ease, ease), box-shadow var(--ui-motion-fast, 160ms) var(--ui-motion-ease, ease)}button:hover:enabled{background:var(--ui-floating-action-button-hover-bg, var(--ui-accent-hover));box-shadow:var( --ui-floating-action-button-hover-shadow, 0 6px 16px color-mix(in srgb, var(--ui-accent-solid) 50%, transparent) )}button:active:enabled{transform:scale(var(--ui-floating-action-button-active-scale, 0.94))}button:focus-visible{outline:2px solid var(--ui-focus-ring);outline-offset:2px}button:disabled,:host([disabled]){opacity:0.6;cursor:not-allowed}::slotted(svg){inline-size:var(--ui-floating-action-button-icon-size, 24px);block-size:var(--ui-floating-action-button-icon-size, 24px);flex-shrink:0}@media (min-width: 768px){:host([mobile-only]){display:none}}`;
4
4
 
@@ -10,7 +10,7 @@ const UIFloatingActionButton = class {
10
10
  mobileOnly = false;
11
11
  label = '';
12
12
  render() {
13
- return (h(Host, { key: '6f67f3967cf8883005f6c56747db515db5ebe1d0', "data-disabled": this.disabled ? '' : undefined }, h("button", { key: 'deebb9261221c144b30bc3e41790158fc339cd14', type: "button", "aria-label": this.label || undefined, disabled: this.disabled }, h("slot", { key: '3b045b69a4508c84dd5b7c8b3df0e6f3eded1c13' }))));
13
+ return (h(Host, { key: 'c9a7d8c9b6d6608566b21621a73d939f372c830d', "data-disabled": this.disabled ? '' : undefined }, h("button", { key: '8eddccaf6be2f028bc02df967038843120045b84', type: "button", "aria-label": this.label || undefined, disabled: this.disabled }, h("slot", { key: '0ea12efb9cb8ecec06238066827a734fb3b01e1e' }))));
14
14
  }
15
15
  };
16
16
  UIFloatingActionButton.style = uiFloatingActionButtonCss();
@@ -1,7 +1,7 @@
1
- import { r as registerInstance, g as getElement, h, H as Host } from './index-CEeiinfk.js';
1
+ import { r as registerInstance, g as getElement, h, H as Host } from './index-8BGiMGQ0.js';
2
2
  import { c as createId } from './id-hgBUJRDa.js';
3
3
 
4
- const uiFormFieldCss = () => `:host{display:grid;gap:var(--ui-space-2);color:var(--ui-text-primary)}::slotted(label){color:var(--ui-text-secondary);font-size:0.95rem}::slotted([data-slot='help']){color:var(--ui-text-muted);font-size:0.875rem}::slotted([data-slot='error']),::slotted([role='alert']){color:var(--ui-accent-active);font-size:0.875rem}`;
4
+ const uiFormFieldCss = () => `:host{display:grid;gap:var(--ui-space-2);min-inline-size:0;align-content:start;color:var(--ui-text-primary)}::slotted(label){color:var(--ui-text-secondary);font-size:0.95rem}::slotted([data-slot='help']){min-block-size:var(--ui-form-field-help-min-block-size, 0);color:var(--ui-text-muted);font-size:0.875rem;line-height:var(--ui-line-height-md)}::slotted([data-slot='error']),::slotted([role='alert']){color:var(--ui-accent-active);font-size:0.875rem}`;
5
5
 
6
6
  const UIFormField = class {
7
7
  constructor(hostRef) {
@@ -49,7 +49,7 @@ const UIFormField = class {
49
49
  input.setAttribute('aria-invalid', this.invalid ? 'true' : 'false');
50
50
  }
51
51
  render() {
52
- return (h(Host, { key: 'c0a01ac28a7dd0e0b285e4b9f9763ef536a83a2e', "data-invalid": this.invalid ? '' : undefined, "data-disabled": this.disabled ? '' : undefined, "data-required": this.required ? '' : undefined }, h("slot", { key: 'b09be4482299d866a0651393e269299dedb0cbf4' })));
52
+ return (h(Host, { key: 'cdd06c6b16ac56f3547e64e7888d8766243392db', "data-invalid": this.invalid ? '' : undefined, "data-disabled": this.disabled ? '' : undefined, "data-required": this.required ? '' : undefined }, h("slot", { key: '7d545673a3485f8beee01b13ab56185b98ba8856' })));
53
53
  }
54
54
  };
55
55
  UIFormField.style = uiFormFieldCss();