@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,541 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-BHG9Rpil.js');
4
+ var positioning = require('./positioning-i0WrCAdF.js');
5
+ var manager = require('./manager-Ce25WRtl.js');
6
+
7
+ /** Formatting is additive: every original character must survive in order.
8
+ * Normalization belongs to submitted output, never the visible editing buffer. */
9
+ function formatEditingValue(raw, selection, format) {
10
+ const unchanged = { display: raw, selection };
11
+ if (!format)
12
+ return unchanged;
13
+ let result;
14
+ try {
15
+ result = format(raw, selection);
16
+ }
17
+ catch {
18
+ return unchanged;
19
+ }
20
+ if (!result)
21
+ return unchanged;
22
+ const characters = Array.from(raw);
23
+ let cursor = 0;
24
+ for (const character of result.display)
25
+ if (character === characters[cursor])
26
+ cursor += 1;
27
+ if (!Number.isInteger(result.selection.start) || !Number.isInteger(result.selection.end) || cursor !== characters.length || result.selection.start < 0 || result.selection.end < result.selection.start
28
+ || result.selection.end > result.display.length)
29
+ return unchanged;
30
+ return result;
31
+ }
32
+ async function validateField(request, config) {
33
+ let output = request.raw;
34
+ let issues = [];
35
+ const check = () => request.signal.throwIfAborted();
36
+ try {
37
+ check();
38
+ if (config.parse)
39
+ output = await config.parse(request.raw, request);
40
+ check();
41
+ if (config.schema) {
42
+ const result = await config.schema['~standard'].validate(output);
43
+ check();
44
+ if (result.issues)
45
+ issues = result.issues;
46
+ else if ('value' in result)
47
+ output = result.value;
48
+ }
49
+ if (!issues.some(issue => issue.severity !== 'warning')) {
50
+ if (config.normalize)
51
+ output = await config.normalize(output, request);
52
+ check();
53
+ if (config.validator) {
54
+ const result = await config.validator(output, request);
55
+ check();
56
+ issues = [...issues, ...(result.issues ?? [])];
57
+ if ('output' in result)
58
+ output = result.output;
59
+ }
60
+ }
61
+ }
62
+ catch (error) {
63
+ check();
64
+ issues = [{ message: error instanceof Error ? error.message : 'Unable to validate this value.' }];
65
+ }
66
+ issues = [...issues, ...(config.issues ?? [])];
67
+ return { output: issues.some(issue => issue.severity !== 'warning') ? undefined : output, issues };
68
+ }
69
+
70
+ 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}}`;
71
+
72
+ const UICombobox = class {
73
+ constructor(hostRef) {
74
+ index.registerInstance(this, hostRef);
75
+ this.queryChange = index.createEvent(this, "query-change");
76
+ this.valueChange = index.createEvent(this, "value-change");
77
+ this.freeEntry = index.createEvent(this, "free-entry");
78
+ this.createEntry = index.createEvent(this, "create-entry");
79
+ this.dependencyInvalidate = index.createEvent(this, "dependency-invalidate");
80
+ this.validationChange = index.createEvent(this, "validation-change");
81
+ this.optionsChange = index.createEvent(this, "options-change");
82
+ }
83
+ get host() { return index.getElement(this); }
84
+ /** Accessible visible label, associated with the native text input. */
85
+ label = '';
86
+ placeholder = '';
87
+ name = '';
88
+ /** Controlled canonical value. Undefined selects uncontrolled mode; null means no selection. */
89
+ value;
90
+ defaultValue;
91
+ /** Controlled raw editing text; independent of canonical selection. */
92
+ query;
93
+ defaultQuery = '';
94
+ /** Immutable configuration; replace the object/context when dependencies change. */
95
+ config = {};
96
+ disabled = false;
97
+ readOnly = false;
98
+ required = false;
99
+ size = 'md';
100
+ disclosure = false;
101
+ clearable = false;
102
+ /** Optional description shown by the connected question-mark button. */
103
+ help = '';
104
+ queryChange;
105
+ valueChange;
106
+ freeEntry;
107
+ createEntry;
108
+ dependencyInvalidate;
109
+ validationChange;
110
+ /** Supplies the current result rows for framework-owned rich slots. */
111
+ optionsChange;
112
+ raw = '';
113
+ display = '';
114
+ selected = null;
115
+ expanded = false;
116
+ rows = [];
117
+ active = -1;
118
+ loading = false;
119
+ helpOpen = false;
120
+ lookupError = '';
121
+ validation = { status: 'pristine', touched: false, dirty: false, issues: [] };
122
+ input;
123
+ popup;
124
+ field;
125
+ surface;
126
+ lookup;
127
+ validationRun;
128
+ lookupTimer;
129
+ composing = false;
130
+ initialRaw = '';
131
+ overlayId = `ui-combobox-${Math.random().toString(36).slice(2)}`;
132
+ alive = false;
133
+ fullSet = false;
134
+ knownOptions = new Map();
135
+ awaitingLabel = null;
136
+ proposedChange;
137
+ formattedRaw;
138
+ formattedWith;
139
+ componentWillLoad() {
140
+ this.selected = this.value !== undefined ? this.value : this.defaultValue ?? null;
141
+ this.raw = this.query ?? this.defaultQuery;
142
+ if (this.query === undefined && !this.raw && this.selected !== null) {
143
+ this.raw = this.config.options?.find(row => row.value === this.selected)?.label ?? this.selected;
144
+ }
145
+ if (this.query === undefined && this.selected !== null && this.raw === this.selected)
146
+ this.awaitingLabel = this.selected;
147
+ this.display = this.raw;
148
+ this.initialRaw = this.raw;
149
+ this.applyServerIssues();
150
+ }
151
+ connectedCallback() { this.alive = true; this.setupSurface(); }
152
+ componentDidLoad() { this.setupSurface(); }
153
+ componentDidUpdate() {
154
+ if (this.input && !this.composing && this.input.value !== this.display)
155
+ this.input.value = this.display;
156
+ if (this.expanded)
157
+ this.surface?.refresh();
158
+ }
159
+ disconnectedCallback() {
160
+ this.alive = false;
161
+ this.close();
162
+ this.validationRun?.abort();
163
+ this.surface?.destroy();
164
+ this.surface = undefined;
165
+ }
166
+ setupSurface() {
167
+ if (!this.surface && this.popup && this.field)
168
+ this.surface = positioning.createAnchoredSurface(this.popup, { anchor: this.field, placement: 'bottom-start' });
169
+ }
170
+ syncValue() {
171
+ if (this.value === undefined)
172
+ return;
173
+ this.selected = this.value;
174
+ if (this.query === undefined) {
175
+ const proposal = this.proposedChange;
176
+ const option = this.config.options?.find(row => row.value === this.selected)
177
+ ?? (this.selected === null ? undefined : this.knownOptions.get(this.selected));
178
+ const nextRaw = proposal?.value === this.selected ? proposal.query : option?.label ?? this.selected ?? '';
179
+ if (proposal?.value !== this.selected || nextRaw !== this.raw) {
180
+ this.raw = nextRaw;
181
+ this.display = this.raw;
182
+ this.formattedRaw = undefined;
183
+ }
184
+ this.awaitingLabel = !option && this.selected !== null ? this.selected : null;
185
+ }
186
+ this.resetValidation();
187
+ }
188
+ syncQuery() {
189
+ if (this.query === undefined || this.query === this.raw)
190
+ return;
191
+ // Only a selection proposal's query echo retains an uncontrolled identity.
192
+ // Other owner text replacements are edits, just like native input.
193
+ if (this.value === undefined && this.proposedChange?.query !== this.query)
194
+ this.selected = null;
195
+ this.awaitingLabel = null;
196
+ this.formattedRaw = undefined;
197
+ this.raw = this.query;
198
+ this.display = this.raw;
199
+ this.resetValidation();
200
+ if (this.expanded)
201
+ this.search('input');
202
+ }
203
+ syncDisabled() {
204
+ if (this.disabled || this.readOnly) {
205
+ this.close();
206
+ this.resetValidation();
207
+ }
208
+ }
209
+ syncConfig(next, previous) {
210
+ this.validationRun?.abort();
211
+ if (next.provider !== previous?.provider || next.context !== previous?.context)
212
+ this.knownOptions.clear();
213
+ if (next.context !== previous?.context) {
214
+ this.close();
215
+ const policy = next.invalidation ?? 'retain-query';
216
+ const value = policy === 'retain' ? this.selected : null;
217
+ const query = policy === 'clear' ? '' : this.raw;
218
+ this.commit(value, query, null, 'invalidation', 'programmatic');
219
+ this.validation = { status: 'pristine', touched: false, dirty: this.raw !== this.initialRaw, issues: [] };
220
+ }
221
+ this.applyServerIssues();
222
+ if (this.expanded)
223
+ this.search('context');
224
+ }
225
+ applyServerIssues() {
226
+ const issues = this.config.issues ?? [];
227
+ if (issues.length)
228
+ this.setValidation({ issues }, this.validation.touched);
229
+ else
230
+ this.resetValidation();
231
+ }
232
+ resetValidation() {
233
+ this.validationRun?.abort();
234
+ this.validation = { status: 'pristine', touched: this.validation.touched, dirty: this.raw !== this.initialRaw, issues: [] };
235
+ this.validationChange?.emit(this.validation);
236
+ }
237
+ cancelLookup() {
238
+ clearTimeout(this.lookupTimer);
239
+ this.lookup?.abort();
240
+ this.lookup = undefined;
241
+ this.loading = false;
242
+ }
243
+ close() {
244
+ this.expanded = false;
245
+ this.active = -1;
246
+ this.cancelLookup();
247
+ this.surface?.hide();
248
+ manager.closeOverlay(this.overlayId);
249
+ }
250
+ open(reason = 'input') {
251
+ if (this.disabled || this.readOnly)
252
+ return;
253
+ this.expanded = true;
254
+ if (this.popup && this.field)
255
+ this.popup.style.minWidth = `${this.field.getBoundingClientRect().width}px`;
256
+ this.surface?.show();
257
+ manager.openOverlay({ id: this.overlayId, element: this.popup, relatedElements: [this.host], modal: false,
258
+ requestClose: () => this.close() });
259
+ this.search(reason);
260
+ }
261
+ search(reason) {
262
+ this.cancelLookup();
263
+ this.fullSet = reason === 'disclosure';
264
+ this.active = -1;
265
+ this.lookupError = '';
266
+ const config = this.config;
267
+ const query = this.fullSet ? '' : this.raw;
268
+ const controller = new AbortController();
269
+ this.lookup = controller;
270
+ const apply = (options) => {
271
+ if (controller.signal.aborted || !this.alive)
272
+ return;
273
+ for (const option of options)
274
+ this.knownOptions.set(option.value, option);
275
+ const selectedOption = this.selected === null ? undefined : this.knownOptions.get(this.selected);
276
+ if (this.query === undefined && this.awaitingLabel === this.selected && selectedOption) {
277
+ this.raw = selectedOption.label;
278
+ this.display = this.raw;
279
+ this.awaitingLabel = null;
280
+ this.formattedRaw = undefined;
281
+ this.resetValidation();
282
+ }
283
+ const ids = new Set();
284
+ this.rows = options.filter(option => {
285
+ if (ids.has(option.id))
286
+ return false;
287
+ ids.add(option.id);
288
+ return this.fullSet || (config.filter ? config.filter(option, query, config.context)
289
+ : config.provider ? true : option.label.toLocaleLowerCase().includes(query.toLocaleLowerCase()));
290
+ });
291
+ const groups = new Map();
292
+ for (const row of this.rows) {
293
+ const group = row.group ?? '';
294
+ if (!groups.has(group))
295
+ groups.set(group, []);
296
+ groups.get(group).push(row);
297
+ }
298
+ this.rows = [...groups.values()].flat();
299
+ this.loading = false;
300
+ this.optionsChange.emit(this.rows);
301
+ };
302
+ if (!config.provider) {
303
+ apply(config.options ?? []);
304
+ return;
305
+ }
306
+ this.rows = [];
307
+ this.loading = true;
308
+ this.lookupTimer = setTimeout(async () => {
309
+ try {
310
+ apply(await config.provider({ query, context: config.context, signal: controller.signal, reason }));
311
+ }
312
+ catch (error) {
313
+ if (controller.signal.aborted || !this.alive)
314
+ return;
315
+ this.loading = false;
316
+ this.lookupError = error instanceof Error ? error.message : 'Unable to load suggestions.';
317
+ }
318
+ }, reason === 'disclosure' ? 0 : Math.max(0, config.debounce ?? 200));
319
+ }
320
+ get canCreate() {
321
+ return Boolean(this.config.allowCreate && this.raw.trim() && !this.loading && !this.lookupError
322
+ && !this.rows.some(row => row.label.toLocaleLowerCase() === this.raw.toLocaleLowerCase()));
323
+ }
324
+ format(timing) {
325
+ if ((this.config.formatOn ?? 'blur') !== timing || !this.input)
326
+ return;
327
+ // Selection is now in display coordinates; do not map it as raw a second time.
328
+ if (this.formattedRaw === this.raw && this.formattedWith === this.config.format)
329
+ return;
330
+ const result = formatEditingValue(this.raw, {
331
+ start: this.input.selectionStart ?? this.raw.length, end: this.input.selectionEnd ?? this.raw.length,
332
+ direction: this.input.selectionDirection ?? 'none',
333
+ }, this.config.format);
334
+ this.formattedRaw = this.raw;
335
+ this.formattedWith = this.config.format;
336
+ this.display = result.display;
337
+ if (this.input.value !== result.display) {
338
+ this.input.value = result.display;
339
+ this.input.setSelectionRange(result.selection.start, result.selection.end, result.selection.direction);
340
+ }
341
+ }
342
+ onInput = (event) => {
343
+ // Composition updates remain entirely native until compositionend.
344
+ if (this.composing || event.isComposing)
345
+ return;
346
+ this.awaitingLabel = null;
347
+ this.formattedRaw = undefined;
348
+ this.raw = this.input.value;
349
+ this.display = this.raw;
350
+ this.resetValidation();
351
+ this.format('input');
352
+ this.queryChange.emit({ query: this.raw, display: this.display, trigger: 'keyboard' });
353
+ if (this.selected !== null)
354
+ this.commit(null, this.raw, null, 'clear', 'keyboard');
355
+ this.open();
356
+ if (this.config.validateOn === 'input')
357
+ void this.validate();
358
+ queueMicrotask(() => {
359
+ if (this.query !== undefined && this.query !== this.raw)
360
+ this.syncQuery();
361
+ });
362
+ };
363
+ commit(value, query, option, kind, trigger) {
364
+ this.awaitingLabel = null;
365
+ const queryChanged = query !== this.raw;
366
+ if (this.value === undefined)
367
+ this.selected = value;
368
+ if (this.query === undefined && queryChanged) {
369
+ this.raw = query;
370
+ this.display = query;
371
+ this.formattedRaw = undefined;
372
+ }
373
+ this.resetValidation();
374
+ const detail = { value, query, option, kind, trigger };
375
+ const proposal = { value, query };
376
+ this.proposedChange = proposal;
377
+ this.valueChange.emit(detail);
378
+ if (queryChanged)
379
+ this.queryChange.emit({ query, display: query, trigger });
380
+ if (kind === 'create')
381
+ this.createEntry.emit(detail);
382
+ if (kind === 'free-entry')
383
+ this.freeEntry.emit(detail);
384
+ if (kind === 'invalidation')
385
+ this.dependencyInvalidate.emit(detail);
386
+ // Settle after all owner notifications (including Vue's queued update).
387
+ // A retained prop does not fire a Stencil watcher, so rejection must be
388
+ // reconciled explicitly while the proposal still identifies an edit echo.
389
+ queueMicrotask(() => {
390
+ if (this.proposedChange !== proposal)
391
+ return;
392
+ if (this.value !== undefined && this.value !== proposal.value)
393
+ this.syncValue();
394
+ if (this.query !== undefined && this.query !== proposal.query) {
395
+ if (this.value === undefined) {
396
+ this.selected = null;
397
+ this.resetValidation();
398
+ }
399
+ this.syncQuery();
400
+ }
401
+ this.proposedChange = undefined;
402
+ });
403
+ }
404
+ choose(index, trigger) {
405
+ const option = this.rows[index];
406
+ if (option?.disabled)
407
+ return;
408
+ if (option)
409
+ this.commit(option.value, option.label, option, 'selection', trigger);
410
+ else if (this.canCreate && index === this.rows.length)
411
+ this.commit(null, this.raw, null, 'create', trigger);
412
+ else
413
+ return;
414
+ this.close();
415
+ this.input?.focus();
416
+ if (this.config.validateOn !== 'submit')
417
+ queueMicrotask(() => void this.validate());
418
+ }
419
+ move(key) {
420
+ const indices = this.rows.flatMap((row, index) => row.disabled ? [] : [index]);
421
+ if (this.canCreate)
422
+ indices.push(this.rows.length);
423
+ if (!indices.length)
424
+ return;
425
+ const current = indices.indexOf(this.active);
426
+ const next = key === 'Home' ? 0 : key === 'End' ? indices.length - 1
427
+ : key === 'ArrowDown' ? Math.min(current + 1, indices.length - 1)
428
+ : current < 0 ? indices.length - 1 : Math.max(0, current - 1);
429
+ this.active = indices[next];
430
+ requestAnimationFrame(() => this.host.shadowRoot?.getElementById(`option-${this.active}`)?.scrollIntoView({ block: 'nearest' }));
431
+ }
432
+ onKeydown = (event) => {
433
+ if (this.composing || event.isComposing || this.disabled || this.readOnly)
434
+ return;
435
+ if (event.key === 'Escape' && this.expanded) {
436
+ event.preventDefault();
437
+ event.stopPropagation();
438
+ this.close();
439
+ return;
440
+ }
441
+ if (event.key === 'Tab') {
442
+ this.close();
443
+ return;
444
+ }
445
+ if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey)
446
+ return;
447
+ if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
448
+ event.preventDefault();
449
+ if (!this.expanded)
450
+ this.open('disclosure');
451
+ this.move(event.key);
452
+ }
453
+ else if ((event.key === 'Home' || event.key === 'End') && this.expanded && this.active >= 0) {
454
+ event.preventDefault();
455
+ this.move(event.key);
456
+ }
457
+ else if (event.key === 'Enter' && this.expanded) {
458
+ if (this.active >= 0) {
459
+ event.preventDefault();
460
+ this.choose(this.active, 'keyboard');
461
+ }
462
+ else if (this.config.allowFreeText) {
463
+ event.preventDefault();
464
+ this.commit(null, this.raw, null, 'free-entry', 'keyboard');
465
+ this.close();
466
+ }
467
+ }
468
+ };
469
+ onFocusOut = (event) => {
470
+ if (event.relatedTarget instanceof Node && this.host.shadowRoot?.contains(event.relatedTarget))
471
+ return;
472
+ this.close();
473
+ this.format('blur');
474
+ this.validation = { ...this.validation, touched: true };
475
+ if (this.config.allowFreeText && this.selected === null)
476
+ this.commit(null, this.raw, null, 'free-entry', 'keyboard');
477
+ if ((this.config.validateOn ?? 'blur') === 'blur')
478
+ void this.validate();
479
+ };
480
+ setValidation(result, touched = this.validation.touched) {
481
+ const blocking = result.issues.some(issue => issue.severity !== 'warning');
482
+ this.validation = { status: blocking ? 'error' : result.issues.length ? 'warning' : 'valid',
483
+ touched, dirty: this.raw !== this.initialRaw, ...result };
484
+ this.validationChange?.emit(this.validation);
485
+ }
486
+ /** Validate for submission. Caller submits only non-pending, non-error output. */
487
+ async validate() {
488
+ this.validationRun?.abort();
489
+ const run = new AbortController();
490
+ this.validationRun = run;
491
+ this.validation = { ...this.validation, status: 'pending', output: undefined };
492
+ this.validationChange.emit(this.validation);
493
+ try {
494
+ const result = await validateField({ raw: this.raw, value: this.selected, context: this.config.context, signal: run.signal }, this.config);
495
+ if (this.required && !this.raw.trim())
496
+ result.issues = [...result.issues, { message: 'A value is required.' }];
497
+ else if (this.raw && this.selected === null && !this.config.allowFreeText && !this.config.allowCreate)
498
+ result.issues = [...result.issues, { message: 'Choose a suggestion.' }];
499
+ if (result.issues.some(issue => issue.severity !== 'warning'))
500
+ result.output = undefined;
501
+ if (!run.signal.aborted && this.alive)
502
+ this.setValidation(result);
503
+ }
504
+ catch { /* Aborted work never becomes current field state. */ }
505
+ return this.validation;
506
+ }
507
+ render() {
508
+ const description = [this.helpOpen ? 'help-text' : '', this.validation.issues.length ? 'validation' : ''].filter(Boolean).join(' ') || undefined;
509
+ const status = this.loading ? 'Loading suggestions…' : this.lookupError || (this.expanded ? `${this.rows.length} suggestions available.` : '');
510
+ const groups = [...new Set(this.rows.map(row => row.group ?? ''))];
511
+ return index.h(index.Host, { key: '2378bfd8473852642fef21898f4a756eb3b092ba', "data-size": this.size, "data-validation": this.validation.status, onFocusout: this.onFocusOut }, index.h("label", { key: '7aba65aeb336d490ddeaf5db9bba9db8ab8b9dbb', htmlFor: "input", part: "label" }, this.label, this.required ? ' *' : ''), index.h("div", { key: 'ee87156259d0fe1e2e56c4b36667e8daf5e1e2c1', class: "field", part: "field", ref: element => this.field = element }, index.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 && index.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 && index.h("button", { key: 'c870ced139fb22baa50a1795ab78f14c38647d34', id: "help", type: "button", part: "affordance", "aria-label": `Help for ${this.label}`, disabled: this.disabled }, index.h("span", { key: 'ba3dc5128c1941b21b53a5ba78a27017b3df5ec8', "aria-hidden": "true" }, "?")), this.disclosure && index.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: () => {
512
+ if (this.expanded)
513
+ this.close();
514
+ else
515
+ this.open('disclosure');
516
+ this.input?.focus();
517
+ } }, index.h("span", { key: '7cb9f7f2bb15246dcdd2348ea0ca656d1d0c8c33', "aria-hidden": "true" }, "\u2304"))), this.help && index.h("ui-tooltip", { key: 'b1b5d42ca457f9b951758bb5e816c8dbbcd1087d', id: "help-text", for: "help", toggleOnClick: true, onOpen: () => this.helpOpen = true, onClose: () => this.helpOpen = false }, this.help), index.h("div", { key: '9eca2df66c72917e6bfda21205c2a4ef97dd91d5', class: "popup", part: "popup", hidden: !this.expanded, ref: element => this.popup = element }, index.h("div", { key: '641e1f137c9cfef5d08ec99f6178e59487a20bf1', id: "listbox", role: "listbox", "aria-label": `${this.label} suggestions`, "aria-busy": String(this.loading) }, groups.map(group => index.h("div", { role: group ? 'group' : 'presentation', "aria-label": group || undefined }, group && index.h("div", { class: "group", part: "group" }, group), this.rows.map((row, index$1) => (row.group ?? '') !== group ? null : index.h("div", { id: `option-${index$1}`, role: "option", "aria-selected": String(this.selected === row.value), "aria-disabled": String(Boolean(row.disabled)), "data-active": this.active === index$1 ? '' : undefined, part: "option", class: "option", onPointerDown: event => event.preventDefault(), onClick: () => this.choose(index$1, 'pointer') }, index.h("slot", { name: `option-${row.id}` }, index.h("span", { class: "primary", part: "option-primary" }, row.label), row.description && index.h("span", { class: "secondary", part: "option-secondary" }, row.description)))))), this.canCreate && index.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') }, index.h("slot", { key: 'dd3e895ef363f6d30a0c25e4b5092a8feacc63e5', name: "create" }, "Create \u201C", this.raw, "\u201D"))), this.loading ? index.h("div", { class: "message" }, index.h("slot", { name: "loading" }, "Loading suggestions\u2026"))
518
+ : this.lookupError ? index.h("div", { class: "message" }, index.h("slot", { name: "error" }, this.lookupError))
519
+ : !this.rows.length && !this.canCreate ? index.h("div", { class: "message" }, index.h("slot", { name: "empty" }, "No suggestions.")) : null), index.h("div", { key: '9cf12a8fde7d9cfb9e2d2a77669ac4708c7fded6', id: "validation", class: "message", part: "validation", hidden: !this.validation.issues.length }, this.validation.issues.map(issue => index.h("div", null, issue.message))), index.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(' ')));
520
+ }
521
+ static get watchers() { return {
522
+ "value": [{
523
+ "syncValue": 0
524
+ }],
525
+ "query": [{
526
+ "syncQuery": 0
527
+ }],
528
+ "disabled": [{
529
+ "syncDisabled": 0
530
+ }],
531
+ "readOnly": [{
532
+ "syncDisabled": 0
533
+ }],
534
+ "config": [{
535
+ "syncConfig": 0
536
+ }]
537
+ }; }
538
+ };
539
+ UICombobox.style = uiComboboxCss();
540
+
541
+ exports.ui_combobox = UICombobox;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-D07f6BOw.js');
4
- var manager = require('./manager-C9j3HZay.js');
3
+ var index = require('./index-BHG9Rpil.js');
4
+ var manager = require('./manager-Ce25WRtl.js');
5
5
  var events = require('./events-TcQIzpNv.js');
6
6
  var positioning = require('./positioning-i0WrCAdF.js');
7
7
 
@@ -220,7 +220,7 @@ const UIContextMenu = class {
220
220
  this.closeMenu('action', 'pointer');
221
221
  };
222
222
  render() {
223
- return (index.h(index.Host, { key: '4db0d5b55ead41925aa682b1e383b5735b49bf56', "data-open": this.internalOpen ? '' : undefined, "data-focus-trigger": this.internalOpen ? this.focusTrigger : undefined, onKeyDown: this.onKeydown, onClick: this.onItemClick }, index.h("slot", { key: '462925d53db169c13e485789ae91e28b0abd3e40', name: "trigger" }), index.h("div", { key: 'cac8f3b11c4872d38e976f210ce9a43fd854b335', class: "menu", "data-open": this.internalOpen ? '' : undefined }, index.h("ui-menu", { key: 'ba50f74e11466da2240f7568479d5d10a614b394', open: this.internalOpen }, index.h("slot", { key: '1fcb45bf124e2377ac6c7fc236d2babf0d9e3bae' })))));
223
+ return (index.h(index.Host, { key: '641dd3aba6120cf4187f4503c64029eaf307dc4f', "data-open": this.internalOpen ? '' : undefined, "data-focus-trigger": this.internalOpen ? this.focusTrigger : undefined, onKeyDown: this.onKeydown, onClick: this.onItemClick }, index.h("slot", { key: '3f550349f9537b951b50a8c291f1951dd5a3b723', name: "trigger" }), index.h("div", { key: 'a612523f054986122638722340d8135c44a85399', class: "menu", "data-open": this.internalOpen ? '' : undefined }, index.h("ui-menu", { key: '0711879d09900183e938d8942abb8b9032812a5f', open: this.internalOpen }, index.h("slot", { key: '8e088dd20a48d8fb81126f2dd020abb886e86e22' })))));
224
224
  }
225
225
  static get watchers() { return {
226
226
  "open": [{
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-D07f6BOw.js');
4
- var manager = require('./manager-C9j3HZay.js');
3
+ var index = require('./index-BHG9Rpil.js');
4
+ var manager = require('./manager-Ce25WRtl.js');
5
5
  var events = require('./events-TcQIzpNv.js');
6
6
 
7
7
  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}}`;
@@ -79,7 +79,7 @@ const UIDialog = class {
79
79
  }
80
80
  };
81
81
  render() {
82
- return (index.h(index.Host, { key: 'c10f9063a1c2677caff3b8d1f26b37bf25978a77', "data-open": this.internalOpen ? '' : undefined, onKeyDown: this.onKeydown }, index.h("dialog", { key: 'a7111bd363cab94f394cca526bf34ea8081e5228', ref: (el) => (this.dialogRef = el), open: this.internalOpen, "aria-label": this.label }, index.h("slot", { key: 'b0a9699fe0be09e331cfea81b6bbeaec11d48956' }))));
82
+ return (index.h(index.Host, { key: '6e88afd3a595ab0eed3d82a046ffb15e1e167cdb', "data-open": this.internalOpen ? '' : undefined, onKeyDown: this.onKeydown }, index.h("dialog", { key: '420e4d8de66245a5818a1284adb23a536ebcd907', ref: (el) => (this.dialogRef = el), open: this.internalOpen, "aria-label": this.label }, index.h("slot", { key: '10604688504f013f79b7a6ed5f9ed36bc9c6b48b' }))));
83
83
  }
84
84
  static get watchers() { return {
85
85
  "open": [{
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-D07f6BOw.js');
3
+ var index = require('./index-BHG9Rpil.js');
4
4
  var id = require('./id-CYbKpaYr.js');
5
5
  var events = require('./events-TcQIzpNv.js');
6
6
 
@@ -93,7 +93,7 @@ const UIDisclosure = class {
93
93
  this.setOpen(!this.internalOpen, { reason: 'action', trigger: 'keyboard' });
94
94
  };
95
95
  render() {
96
- return (index.h(index.Host, { key: '7fbc83614f8e988a43d1baac0379a6dc8826b1d5' }, index.h("slot", { key: '6ef33ca7bce5c4d83ab65642f52a9d17febb794d' })));
96
+ return (index.h(index.Host, { key: '3905d2d78a2d3d4ef36b582ba0f426be8e5e0f5e' }, index.h("slot", { key: '18547ff56457b73319264bba981f994fb947dffb' })));
97
97
  }
98
98
  static get watchers() { return {
99
99
  "open": [{
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-D07f6BOw.js');
3
+ var index = require('./index-BHG9Rpil.js');
4
4
 
5
5
  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}}`;
6
6
 
@@ -12,7 +12,7 @@ const UIFloatingActionButton = class {
12
12
  mobileOnly = false;
13
13
  label = '';
14
14
  render() {
15
- return (index.h(index.Host, { key: '6f67f3967cf8883005f6c56747db515db5ebe1d0', "data-disabled": this.disabled ? '' : undefined }, index.h("button", { key: 'deebb9261221c144b30bc3e41790158fc339cd14', type: "button", "aria-label": this.label || undefined, disabled: this.disabled }, index.h("slot", { key: '3b045b69a4508c84dd5b7c8b3df0e6f3eded1c13' }))));
15
+ return (index.h(index.Host, { key: 'c9a7d8c9b6d6608566b21621a73d939f372c830d', "data-disabled": this.disabled ? '' : undefined }, index.h("button", { key: '8eddccaf6be2f028bc02df967038843120045b84', type: "button", "aria-label": this.label || undefined, disabled: this.disabled }, index.h("slot", { key: '0ea12efb9cb8ecec06238066827a734fb3b01e1e' }))));
16
16
  }
17
17
  };
18
18
  UIFloatingActionButton.style = uiFloatingActionButtonCss();
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-D07f6BOw.js');
3
+ var index = require('./index-BHG9Rpil.js');
4
4
  var id = require('./id-CYbKpaYr.js');
5
5
 
6
- 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}`;
6
+ 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}`;
7
7
 
8
8
  const UIFormField = class {
9
9
  constructor(hostRef) {
@@ -51,7 +51,7 @@ const UIFormField = class {
51
51
  input.setAttribute('aria-invalid', this.invalid ? 'true' : 'false');
52
52
  }
53
53
  render() {
54
- return (index.h(index.Host, { key: 'c0a01ac28a7dd0e0b285e4b9f9763ef536a83a2e', "data-invalid": this.invalid ? '' : undefined, "data-disabled": this.disabled ? '' : undefined, "data-required": this.required ? '' : undefined }, index.h("slot", { key: 'b09be4482299d866a0651393e269299dedb0cbf4' })));
54
+ return (index.h(index.Host, { key: 'cdd06c6b16ac56f3547e64e7888d8766243392db', "data-invalid": this.invalid ? '' : undefined, "data-disabled": this.disabled ? '' : undefined, "data-required": this.required ? '' : undefined }, index.h("slot", { key: '7d545673a3485f8beee01b13ab56185b98ba8856' })));
55
55
  }
56
56
  };
57
57
  UIFormField.style = uiFormFieldCss();