@threadlabs/looma 0.1.23 → 0.1.24

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 (287) hide show
  1. package/dist/chunk-HNFCGIBP.js +8 -0
  2. package/dist/{chunk-GDMQKT5F.js → chunk-IMHSPETJ.js} +32 -30
  3. package/dist/chunk-NB6DBRXQ.js +323 -0
  4. package/dist/cjs/controlled-state-BFya8rAX.js +9 -0
  5. package/dist/cjs/icons-BAdjrnhS.js +680 -0
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/looma.cjs.js +1 -1
  8. package/dist/cjs/ui-affordance-scope.cjs.entry.js +1 -1
  9. package/dist/cjs/ui-avatar-group.cjs.entry.js +9 -17
  10. package/dist/cjs/ui-avatar.cjs.entry.js +2 -2
  11. package/dist/cjs/ui-badge.cjs.entry.js +2 -2
  12. package/dist/cjs/ui-button.cjs.entry.js +1 -1
  13. package/dist/cjs/ui-callout.cjs.entry.js +27 -0
  14. package/dist/cjs/ui-checkbox.cjs.entry.js +13 -7
  15. package/dist/cjs/ui-chip.cjs.entry.js +19 -0
  16. package/dist/cjs/ui-combobox.cjs.entry.js +3 -3
  17. package/dist/cjs/ui-context-menu.cjs.entry.js +1 -1
  18. package/dist/cjs/ui-dialog.cjs.entry.js +44 -8
  19. package/dist/cjs/ui-disclosure.cjs.entry.js +9 -6
  20. package/dist/cjs/ui-floating-action-button.cjs.entry.js +1 -1
  21. package/dist/cjs/ui-form-field.cjs.entry.js +59 -4
  22. package/dist/cjs/ui-icon-button.cjs.entry.js +1 -1
  23. package/dist/cjs/ui-input.cjs.entry.js +1 -1
  24. package/dist/cjs/ui-menu-item.cjs.entry.js +2 -2
  25. package/dist/cjs/ui-menu.cjs.entry.js +14 -9
  26. package/dist/cjs/ui-popover.cjs.entry.js +10 -7
  27. package/dist/cjs/ui-radio-group.cjs.entry.js +1 -1
  28. package/dist/cjs/ui-radio.cjs.entry.js +16 -7
  29. package/dist/cjs/ui-search-result-row.cjs.entry.js +1 -1
  30. package/dist/cjs/ui-search-shell.cjs.entry.js +1 -1
  31. package/dist/cjs/ui-select.cjs.entry.js +1 -1
  32. package/dist/cjs/ui-switch.cjs.entry.js +19 -10
  33. package/dist/cjs/ui-tabs.cjs.entry.js +10 -9
  34. package/dist/cjs/ui-textarea.cjs.entry.js +1 -1
  35. package/dist/cjs/ui-toast-region.cjs.entry.js +30 -19
  36. package/dist/cjs/ui-tooltip.cjs.entry.js +12 -8
  37. package/dist/cjs/ui-top-bar.cjs.entry.js +1 -1
  38. package/dist/cjs/ui-tree-item.cjs.entry.js +54 -617
  39. package/dist/cjs/ui-tree.cjs.entry.js +123 -11
  40. package/dist/collection/collection-manifest.json +2 -0
  41. package/dist/collection/components/ui-affordance-scope/ui-affordance-scope.js +1 -1
  42. package/dist/collection/components/ui-avatar/ui-avatar.css +4 -4
  43. package/dist/collection/components/ui-avatar/ui-avatar.js +1 -1
  44. package/dist/collection/components/ui-avatar-group/ui-avatar-group.css +2 -2
  45. package/dist/collection/components/ui-avatar-group/ui-avatar-group.js +8 -16
  46. package/dist/collection/components/ui-badge/ui-badge.css +64 -48
  47. package/dist/collection/components/ui-badge/ui-badge.js +1 -1
  48. package/dist/collection/components/ui-button/ui-button.js +1 -1
  49. package/dist/collection/components/ui-callout/ui-callout.css +74 -0
  50. package/dist/collection/components/ui-callout/ui-callout.js +59 -0
  51. package/dist/collection/components/ui-checkbox/ui-checkbox.js +16 -11
  52. package/dist/collection/components/ui-chip/ui-chip.css +43 -0
  53. package/dist/collection/components/ui-chip/ui-chip.js +45 -0
  54. package/dist/collection/components/ui-combobox/ui-combobox.js +3 -3
  55. package/dist/collection/components/ui-context-menu/ui-context-menu.js +1 -1
  56. package/dist/collection/components/ui-dialog/ui-dialog.js +49 -13
  57. package/dist/collection/components/ui-disclosure/ui-disclosure.js +12 -10
  58. package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.js +1 -1
  59. package/dist/collection/components/ui-form-field/ui-form-field.js +59 -4
  60. package/dist/collection/components/ui-icon-button/ui-icon-button.js +1 -1
  61. package/dist/collection/components/ui-input/ui-input.js +1 -1
  62. package/dist/collection/components/ui-menu/ui-menu.css +12 -23
  63. package/dist/collection/components/ui-menu/ui-menu.js +16 -12
  64. package/dist/collection/components/ui-menu-item/ui-menu-item.css +9 -3
  65. package/dist/collection/components/ui-menu-item/ui-menu-item.js +1 -1
  66. package/dist/collection/components/ui-popover/ui-popover.css +14 -5
  67. package/dist/collection/components/ui-popover/ui-popover.js +12 -10
  68. package/dist/collection/components/ui-radio/ui-radio.js +24 -11
  69. package/dist/collection/components/ui-radio-group/ui-radio-group.js +1 -1
  70. package/dist/collection/components/ui-search-result-row/ui-search-result-row.js +1 -1
  71. package/dist/collection/components/ui-search-shell/ui-search-shell.js +1 -1
  72. package/dist/collection/components/ui-select/ui-select.js +1 -1
  73. package/dist/collection/components/ui-switch/ui-switch.js +22 -14
  74. package/dist/collection/components/ui-tabs/ui-tabs.js +13 -13
  75. package/dist/collection/components/ui-textarea/ui-textarea.js +1 -1
  76. package/dist/collection/components/ui-toast-region/ui-toast-region.js +30 -19
  77. package/dist/collection/components/ui-tooltip/ui-tooltip.css +16 -7
  78. package/dist/collection/components/ui-tooltip/ui-tooltip.js +14 -11
  79. package/dist/collection/components/ui-top-bar/ui-top-bar.js +1 -1
  80. package/dist/collection/components/ui-tree/ui-tree.css +2 -1
  81. package/dist/collection/components/ui-tree/ui-tree.js +122 -10
  82. package/dist/collection/components/ui-tree-item/ui-tree-item.js +61 -44
  83. package/dist/collection/icons.js +6 -1
  84. package/dist/collection/utils/controlled-state.js +4 -0
  85. package/dist/components/index.d.ts +4 -0
  86. package/dist/components/index.js +1 -1
  87. package/dist/components/p-Bk55QiUK.js +1 -0
  88. package/dist/components/p-BnGhGgTH.js +1 -0
  89. package/dist/components/p-CoFximGM.js +13 -0
  90. package/dist/components/p-DIGcRYAW.js +1 -0
  91. package/dist/components/ui-affordance-scope.js +1 -1
  92. package/dist/components/ui-avatar-group.js +1 -1
  93. package/dist/components/ui-avatar.js +1 -1
  94. package/dist/components/ui-badge.js +1 -1
  95. package/dist/components/ui-button.js +1 -1
  96. package/dist/components/ui-callout.d.ts +11 -0
  97. package/dist/components/ui-callout.js +1 -0
  98. package/dist/components/ui-checkbox.js +1 -1
  99. package/dist/components/ui-chip.d.ts +11 -0
  100. package/dist/components/ui-chip.js +1 -0
  101. package/dist/components/ui-combobox.js +1 -1
  102. package/dist/components/ui-context-menu.js +1 -1
  103. package/dist/components/ui-dialog.js +1 -1
  104. package/dist/components/ui-disclosure.js +1 -1
  105. package/dist/components/ui-floating-action-button.js +1 -1
  106. package/dist/components/ui-form-field.js +1 -1
  107. package/dist/components/ui-icon-button.js +1 -1
  108. package/dist/components/ui-input.js +1 -1
  109. package/dist/components/ui-menu-item.js +1 -1
  110. package/dist/components/ui-menu.js +1 -1
  111. package/dist/components/ui-popover.js +1 -1
  112. package/dist/components/ui-radio-group.js +1 -1
  113. package/dist/components/ui-radio.js +1 -1
  114. package/dist/components/ui-search-result-row.js +1 -1
  115. package/dist/components/ui-search-shell.js +1 -1
  116. package/dist/components/ui-select.js +1 -1
  117. package/dist/components/ui-switch.js +1 -1
  118. package/dist/components/ui-tabs.js +1 -1
  119. package/dist/components/ui-textarea.js +1 -1
  120. package/dist/components/ui-toast-region.js +1 -1
  121. package/dist/components/ui-tooltip.js +1 -1
  122. package/dist/components/ui-top-bar.js +1 -1
  123. package/dist/components/ui-tree-item.js +1 -13
  124. package/dist/components/ui-tree.js +1 -1
  125. package/dist/esm/controlled-state-BnGhGgTH.js +6 -0
  126. package/dist/esm/icons-CoFximGM.js +678 -0
  127. package/dist/esm/loader.js +1 -1
  128. package/dist/esm/looma.js +1 -1
  129. package/dist/esm/ui-affordance-scope.entry.js +1 -1
  130. package/dist/esm/ui-avatar-group.entry.js +9 -17
  131. package/dist/esm/ui-avatar.entry.js +2 -2
  132. package/dist/esm/ui-badge.entry.js +2 -2
  133. package/dist/esm/ui-button.entry.js +1 -1
  134. package/dist/esm/ui-callout.entry.js +25 -0
  135. package/dist/esm/ui-checkbox.entry.js +13 -7
  136. package/dist/esm/ui-chip.entry.js +17 -0
  137. package/dist/esm/ui-combobox.entry.js +3 -3
  138. package/dist/esm/ui-context-menu.entry.js +1 -1
  139. package/dist/esm/ui-dialog.entry.js +44 -8
  140. package/dist/esm/ui-disclosure.entry.js +9 -6
  141. package/dist/esm/ui-floating-action-button.entry.js +1 -1
  142. package/dist/esm/ui-form-field.entry.js +59 -4
  143. package/dist/esm/ui-icon-button.entry.js +1 -1
  144. package/dist/esm/ui-input.entry.js +1 -1
  145. package/dist/esm/ui-menu-item.entry.js +2 -2
  146. package/dist/esm/ui-menu.entry.js +14 -9
  147. package/dist/esm/ui-popover.entry.js +10 -7
  148. package/dist/esm/ui-radio-group.entry.js +1 -1
  149. package/dist/esm/ui-radio.entry.js +16 -7
  150. package/dist/esm/ui-search-result-row.entry.js +1 -1
  151. package/dist/esm/ui-search-shell.entry.js +1 -1
  152. package/dist/esm/ui-select.entry.js +1 -1
  153. package/dist/esm/ui-switch.entry.js +19 -10
  154. package/dist/esm/ui-tabs.entry.js +10 -9
  155. package/dist/esm/ui-textarea.entry.js +1 -1
  156. package/dist/esm/ui-toast-region.entry.js +30 -19
  157. package/dist/esm/ui-tooltip.entry.js +12 -8
  158. package/dist/esm/ui-top-bar.entry.js +1 -1
  159. package/dist/esm/ui-tree-item.entry.js +54 -617
  160. package/dist/esm/ui-tree.entry.js +123 -11
  161. package/dist/index.cjs +1224 -842
  162. package/dist/index.d.cts +5 -0
  163. package/dist/index.d.ts +5 -0
  164. package/dist/index.js +12 -2
  165. package/dist/looma/looma.esm.js +1 -1
  166. package/dist/looma/p-03f44c45.entry.js +1 -0
  167. package/dist/looma/p-08f80207.entry.js +1 -0
  168. package/dist/looma/{p-f74e5546.entry.js → p-13f8195a.entry.js} +1 -1
  169. package/dist/looma/{p-5a87b59d.entry.js → p-25e18ad6.entry.js} +1 -1
  170. package/dist/looma/p-2c03fa73.entry.js +1 -0
  171. package/dist/looma/{p-ed368426.entry.js → p-314d5c7c.entry.js} +1 -1
  172. package/dist/looma/{p-5da09f47.entry.js → p-3ef2a21b.entry.js} +1 -1
  173. package/dist/looma/{p-f0487ff3.entry.js → p-5a900d89.entry.js} +1 -1
  174. package/dist/looma/p-5fdcee1d.entry.js +1 -0
  175. package/dist/looma/{p-13347631.entry.js → p-672e3d16.entry.js} +1 -1
  176. package/dist/looma/{p-582973b5.entry.js → p-68430534.entry.js} +1 -1
  177. package/dist/looma/{p-add36e74.entry.js → p-72338f53.entry.js} +1 -1
  178. package/dist/looma/{p-a90d2821.entry.js → p-7ab661ec.entry.js} +1 -1
  179. package/dist/looma/p-7c4a225f.entry.js +1 -0
  180. package/dist/looma/p-82f2fa3d.entry.js +1 -0
  181. package/dist/looma/p-839faf55.entry.js +1 -0
  182. package/dist/looma/{p-7e0bb7f6.entry.js → p-8e254bc4.entry.js} +1 -1
  183. package/dist/looma/p-8e6b1001.entry.js +1 -0
  184. package/dist/looma/p-920656cf.entry.js +1 -0
  185. package/dist/looma/{p-40fe7fee.entry.js → p-97e8cb0e.entry.js} +1 -1
  186. package/dist/looma/p-9d2662ca.entry.js +1 -0
  187. package/dist/looma/p-9e1c4020.entry.js +1 -0
  188. package/dist/looma/p-BnGhGgTH.js +1 -0
  189. package/dist/looma/p-CoFximGM.js +13 -0
  190. package/dist/looma/{p-8b8840b8.entry.js → p-a63e2561.entry.js} +1 -1
  191. package/dist/looma/p-add67e4c.entry.js +1 -0
  192. package/dist/looma/p-b63f6d4f.entry.js +1 -0
  193. package/dist/looma/p-bd00d4e8.entry.js +1 -0
  194. package/dist/looma/p-cc915913.entry.js +1 -0
  195. package/dist/looma/p-cfba8f7c.entry.js +1 -0
  196. package/dist/looma/p-d56571a2.entry.js +1 -0
  197. package/dist/looma/{p-69a5557b.entry.js → p-e0f241ab.entry.js} +1 -1
  198. package/dist/looma/p-f1750fd7.entry.js +1 -0
  199. package/dist/looma/p-fd1e4d22.entry.js +1 -0
  200. package/dist/types/components/ui-avatar-group/ui-avatar-group.d.ts +1 -2
  201. package/dist/types/components/ui-callout/ui-callout.d.ts +6 -0
  202. package/dist/types/components/ui-checkbox/ui-checkbox.d.ts +2 -1
  203. package/dist/types/components/ui-chip/ui-chip.d.ts +6 -0
  204. package/dist/types/components/ui-dialog/ui-dialog.d.ts +7 -1
  205. package/dist/types/components/ui-disclosure/ui-disclosure.d.ts +2 -1
  206. package/dist/types/components/ui-form-field/ui-form-field.d.ts +8 -0
  207. package/dist/types/components/ui-menu/ui-menu.d.ts +2 -1
  208. package/dist/types/components/ui-popover/ui-popover.d.ts +2 -1
  209. package/dist/types/components/ui-radio/ui-radio.d.ts +4 -1
  210. package/dist/types/components/ui-switch/ui-switch.d.ts +2 -1
  211. package/dist/types/components/ui-tabs/ui-tabs.d.ts +2 -1
  212. package/dist/types/components/ui-toast-region/ui-toast-region.d.ts +3 -1
  213. package/dist/types/components/ui-tooltip/ui-tooltip.d.ts +2 -1
  214. package/dist/types/components/ui-tree/ui-tree.d.ts +12 -0
  215. package/dist/types/components/ui-tree-item/ui-tree-item.d.ts +11 -7
  216. package/dist/types/components.d.ts +110 -47
  217. package/dist/types/icons.d.ts +5 -0
  218. package/dist/types/utils/controlled-state.d.ts +4 -0
  219. package/dist/{ui-affordance-scope.entry-VO4C2MZX.js → ui-affordance-scope.entry-3TUZ6GLW.js} +2 -2
  220. package/dist/ui-avatar-group.entry-XGJKN25W.js +51 -0
  221. package/dist/{ui-avatar.entry-T6FU6ZYM.js → ui-avatar.entry-SN3G44HW.js} +3 -3
  222. package/dist/ui-badge.entry-B6WDCWJX.js +22 -0
  223. package/dist/{ui-button.entry-7UXMUGHN.js → ui-button.entry-AZYUELLV.js} +2 -2
  224. package/dist/ui-callout.entry-QRPWRMPC.js +32 -0
  225. package/dist/{ui-checkbox.entry-DMZJB3RE.js → ui-checkbox.entry-OB6GFC4M.js} +17 -8
  226. package/dist/ui-chip.entry-XSNPJXX3.js +22 -0
  227. package/dist/{ui-combobox.entry-ZCTPXEES.js → ui-combobox.entry-IIMMUJF7.js} +5 -5
  228. package/dist/{ui-context-menu.entry-2WMCBGCP.js → ui-context-menu.entry-AIULIE5Y.js} +5 -5
  229. package/dist/{ui-dialog.entry-WO23XOSW.js → ui-dialog.entry-QSYWYHLY.js} +50 -12
  230. package/dist/{ui-disclosure.entry-USX7OUEW.js → ui-disclosure.entry-3BJEYU3U.js} +13 -7
  231. package/dist/{ui-floating-action-button.entry-MXDIN7MV.js → ui-floating-action-button.entry-JEVNV6FI.js} +2 -2
  232. package/dist/ui-form-field.entry-PKSY7UU4.js +120 -0
  233. package/dist/{ui-icon-button.entry-MJUNXHBU.js → ui-icon-button.entry-TPX7BE7R.js} +2 -2
  234. package/dist/{ui-input.entry-AWG63YIG.js → ui-input.entry-6NCLNW4E.js} +2 -2
  235. package/dist/ui-menu-item.entry-KA2K3PKV.js +22 -0
  236. package/dist/{ui-menu.entry-IT3GW5TL.js → ui-menu.entry-7GDO5L2T.js} +22 -14
  237. package/dist/{ui-popover.entry-ZQQB4N6E.js → ui-popover.entry-FR6YRNK6.js} +17 -11
  238. package/dist/{ui-radio-group.entry-V7PCTS7I.js → ui-radio-group.entry-7QHXQSNO.js} +2 -2
  239. package/dist/{ui-radio.entry-JYH6TQBI.js → ui-radio.entry-YNMXKLDW.js} +20 -8
  240. package/dist/{ui-search-result-row.entry-JBNYXXUN.js → ui-search-result-row.entry-AHVVAAIO.js} +2 -2
  241. package/dist/{ui-search-shell.entry-TEAWE76O.js → ui-search-shell.entry-CNBEAMEZ.js} +2 -2
  242. package/dist/{ui-select.entry-F3A6TE2U.js → ui-select.entry-TUY6TCTC.js} +2 -2
  243. package/dist/{ui-switch.entry-MJIICMP2.js → ui-switch.entry-26LFI7B5.js} +23 -11
  244. package/dist/{ui-tabs.entry-6REFIUHV.js → ui-tabs.entry-LXB62RJJ.js} +14 -10
  245. package/dist/{ui-textarea.entry-OJTXCED7.js → ui-textarea.entry-JYGMGPX2.js} +2 -2
  246. package/dist/{ui-toast-region.entry-NOFXLKPS.js → ui-toast-region.entry-TOW4KZLZ.js} +32 -23
  247. package/dist/{ui-tooltip.entry-COWTWVHX.js → ui-tooltip.entry-SKFNYXPH.js} +19 -12
  248. package/dist/{ui-top-bar.entry-PIAWXJNV.js → ui-top-bar.entry-S3YP52EA.js} +2 -2
  249. package/dist/ui-tree-item.entry-LWYIPYLC.js +145 -0
  250. package/dist/{ui-tree.entry-XYI3ZFAZ.js → ui-tree.entry-LXKUQFRU.js} +114 -12
  251. package/editor/{chunk-QCOYOVQL.js → chunk-B5WVJOPV.js} +113 -97
  252. package/editor/extensions/index.d.ts +14 -6
  253. package/editor/extensions/index.js +1 -1
  254. package/editor/index.js +1 -1
  255. package/editor.css +37 -20
  256. package/package.json +1 -1
  257. package/styles.css +10 -0
  258. package/tokens.css +3 -0
  259. package/vue/{chunk-JLW23USW.js → chunk-D4AJULDE.js} +28 -16
  260. package/vue/editor/index.d.ts +5 -15
  261. package/vue/editor/index.js +1 -1
  262. package/vue/index.d.ts +325 -115
  263. package/vue/index.js +5 -1
  264. package/dist/components/p-CaietZcq.js +0 -1
  265. package/dist/components/p-DHd18bK7.js +0 -1
  266. package/dist/looma/p-14c081cf.entry.js +0 -1
  267. package/dist/looma/p-25366205.entry.js +0 -1
  268. package/dist/looma/p-2e3aa869.entry.js +0 -1
  269. package/dist/looma/p-446cda76.entry.js +0 -1
  270. package/dist/looma/p-4fc1b005.entry.js +0 -13
  271. package/dist/looma/p-6a8a4736.entry.js +0 -1
  272. package/dist/looma/p-6bf4038b.entry.js +0 -1
  273. package/dist/looma/p-8204fee6.entry.js +0 -1
  274. package/dist/looma/p-8238e0dc.entry.js +0 -1
  275. package/dist/looma/p-99d88efb.entry.js +0 -1
  276. package/dist/looma/p-a27669b1.entry.js +0 -1
  277. package/dist/looma/p-a6ee76b7.entry.js +0 -1
  278. package/dist/looma/p-b6398a6b.entry.js +0 -1
  279. package/dist/looma/p-d50faaff.entry.js +0 -1
  280. package/dist/looma/p-d77278ce.entry.js +0 -1
  281. package/dist/looma/p-d9ec13b7.entry.js +0 -1
  282. package/dist/looma/p-ecf8005f.entry.js +0 -1
  283. package/dist/ui-avatar-group.entry-TAXJRIIU.js +0 -59
  284. package/dist/ui-badge.entry-MZFYNBMJ.js +0 -22
  285. package/dist/ui-form-field.entry-7ZCMEHPY.js +0 -67
  286. package/dist/ui-menu-item.entry-HFTWG62N.js +0 -22
  287. package/dist/ui-tree-item.entry-BSEWNL2O.js +0 -389
@@ -55,7 +55,7 @@ function createHoverIntent(delay, onIntent) {
55
55
  };
56
56
  }
57
57
 
58
- const uiTreeCss = () => `:host{--ui-tree-indent:16px;display:block;min-inline-size:0;padding-inline-start:var(--ui-tree-gutter, 22px)}::slotted(ui-tree-item){--ui-tree-indent:inherit}`;
58
+ const uiTreeCss = () => `:host{--ui-tree-indent:16px;--ui-tree-gutter:0px;display:block;min-inline-size:0;padding-inline-start:var(--ui-tree-gutter)}::slotted(ui-tree-item){--ui-tree-indent:inherit}`;
59
59
 
60
60
  const UITree = class {
61
61
  constructor(hostRef) {
@@ -73,6 +73,8 @@ const UITree = class {
73
73
  rejectedPosition = null;
74
74
  rejection = null;
75
75
  hoverIntent = null;
76
+ structureObserver = null;
77
+ tabStop = null;
76
78
  componentDidLoad() {
77
79
  this.hoverIntent = createHoverIntent(this.hoverExpandDelay, this.expandTarget);
78
80
  this.host.addEventListener('dragstart', this.onDragStart);
@@ -83,6 +85,11 @@ const UITree = class {
83
85
  this.host.addEventListener('drop', this.onDrop);
84
86
  this.host.addEventListener('dragend', this.onDragEnd);
85
87
  this.host.addEventListener('keydown', this.onKeyDown);
88
+ this.host.addEventListener('focusin', this.onFocusIn);
89
+ this.host.addEventListener('ui-tree-expansion-change', this.onExpansionChange);
90
+ this.syncStructuralLevels();
91
+ this.structureObserver = new MutationObserver(this.syncStructuralLevels);
92
+ this.structureObserver.observe(this.host, { childList: true, subtree: true });
86
93
  }
87
94
  disconnectedCallback() {
88
95
  this.hoverIntent?.destroy();
@@ -94,10 +101,44 @@ const UITree = class {
94
101
  this.host.removeEventListener('drop', this.onDrop);
95
102
  this.host.removeEventListener('dragend', this.onDragEnd);
96
103
  this.host.removeEventListener('keydown', this.onKeyDown);
104
+ this.host.removeEventListener('focusin', this.onFocusIn);
105
+ this.host.removeEventListener('ui-tree-expansion-change', this.onExpansionChange);
106
+ this.structureObserver?.disconnect();
107
+ this.structureObserver = null;
108
+ }
109
+ syncStructuralLevels = () => {
110
+ for (const item of Array.from(this.host.querySelectorAll('ui-tree-item'))) {
111
+ item.dispatchEvent(new CustomEvent('ui-tree-structure-sync'));
112
+ }
113
+ this.syncTabStop();
114
+ };
115
+ syncTabStop(preferred) {
116
+ const items = this.visibleItems();
117
+ const next = preferred && items.includes(preferred)
118
+ ? preferred
119
+ : this.tabStop && items.includes(this.tabStop)
120
+ ? this.tabStop
121
+ : items[0] ?? null;
122
+ this.tabStop = next;
123
+ for (const item of items) {
124
+ item.dispatchEvent(new CustomEvent('ui-tree-roving-tab-stop', {
125
+ detail: { active: item === next },
126
+ }));
127
+ }
97
128
  }
98
129
  itemFromEvent(event) {
99
130
  return event.composedPath().find(node => (node instanceof HTMLElement && node.localName === 'ui-tree-item')) ?? null;
100
131
  }
132
+ eventTargetsInteractiveContent(event) {
133
+ for (const node of event.composedPath()) {
134
+ if (node instanceof HTMLElement && node.localName === 'ui-tree-item')
135
+ break;
136
+ if (node instanceof HTMLElement && node.matches('a, button, input, select, textarea, [role="button"], [role="link"]')) {
137
+ return true;
138
+ }
139
+ }
140
+ return false;
141
+ }
101
142
  itemId(item) {
102
143
  return item.itemId || item.getAttribute('item-id') || '';
103
144
  }
@@ -145,9 +186,23 @@ const UITree = class {
145
186
  const dropDepth = item.getAttribute('drop-depth');
146
187
  if (dropDepth !== null)
147
188
  return Number(dropDepth);
148
- if (item.depth !== undefined)
149
- return item.depth;
150
- return Number(item.getAttribute('depth')) || 1;
189
+ return Number(item.getAttribute('aria-level')) || 1;
190
+ }
191
+ subtreeDepth(item) {
192
+ if (item.subtreeDepth !== undefined)
193
+ return Math.max(0, Math.floor(item.subtreeDepth));
194
+ const override = item.getAttribute('subtree-depth');
195
+ if (override !== null)
196
+ return Math.max(0, Math.floor(Number(override)));
197
+ return Array.from(item.querySelectorAll('ui-tree-item')).reduce((deepest, descendant) => {
198
+ let nesting = 0;
199
+ let ancestor = descendant.parentElement?.closest('ui-tree-item') ?? null;
200
+ while (ancestor && ancestor !== item) {
201
+ nesting += 1;
202
+ ancestor = ancestor.parentElement?.closest('ui-tree-item') ?? null;
203
+ }
204
+ return ancestor === item ? Math.max(deepest, nesting + 1) : deepest;
205
+ }, 0);
151
206
  }
152
207
  dropRejection(source, target, position) {
153
208
  // A tree item can never move into (or beside) one of its own descendants.
@@ -167,9 +222,9 @@ const UITree = class {
167
222
  return { reason: 'incompatible' };
168
223
  }
169
224
  const maxDepth = Math.max(0, Math.floor(this.maxDepth));
170
- if (maxDepth > 0 && source.subtreeDepth !== undefined) {
225
+ if (maxDepth > 0) {
171
226
  const targetDepth = Math.max(0, Math.floor(this.constraintDepth(target)));
172
- const subtreeDepth = Math.max(0, Math.floor(source.subtreeDepth));
227
+ const subtreeDepth = this.subtreeDepth(source);
173
228
  const resultingDepth = targetDepth + (position === 'inside' ? 1 : 0) + subtreeDepth;
174
229
  if (resultingDepth > maxDepth)
175
230
  return { reason: 'max-depth', maxDepth, resultingDepth };
@@ -365,7 +420,35 @@ const UITree = class {
365
420
  return Array.from(this.host.querySelectorAll('ui-tree-item'))
366
421
  .filter(item => item.getClientRects().length > 0 && !item.hasAttribute('disabled'));
367
422
  }
423
+ parentItem(item) {
424
+ const parent = item.parentElement?.closest('ui-tree-item') ?? null;
425
+ return parent && this.host.contains(parent) ? parent : null;
426
+ }
427
+ firstVisibleChild(item, items) {
428
+ return items.find(candidate => this.parentItem(candidate) === item) ?? null;
429
+ }
430
+ focusItem(item) {
431
+ this.syncTabStop(item);
432
+ item.focus();
433
+ }
434
+ requestExpansion(item, expanded) {
435
+ item.dispatchEvent(new CustomEvent('ui-tree-request-expanded', {
436
+ detail: { expanded, trigger: 'keyboard' },
437
+ }));
438
+ }
439
+ onFocusIn = (event) => {
440
+ if (this.eventTargetsInteractiveContent(event))
441
+ return;
442
+ const item = this.itemFromEvent(event);
443
+ if (item)
444
+ this.syncTabStop(item);
445
+ };
446
+ onExpansionChange = () => {
447
+ requestAnimationFrame(() => this.syncTabStop());
448
+ };
368
449
  onKeyDown = (event) => {
450
+ if (this.eventTargetsInteractiveContent(event))
451
+ return;
369
452
  const current = this.itemFromEvent(event);
370
453
  if (!current)
371
454
  return;
@@ -373,14 +456,43 @@ const UITree = class {
373
456
  const index = items.indexOf(current);
374
457
  if (index < 0)
375
458
  return;
376
- const next = event.key === 'ArrowDown' ? items[index + 1] : event.key === 'ArrowUp' ? items[index - 1] : null;
377
- if (!next)
459
+ const next = event.key === 'ArrowDown' ? items[index + 1]
460
+ : event.key === 'ArrowUp' ? items[index - 1]
461
+ : event.key === 'Home' ? items[0]
462
+ : event.key === 'End' ? items.at(-1)
463
+ : null;
464
+ if (next) {
465
+ event.preventDefault();
466
+ this.focusItem(next);
378
467
  return;
379
- event.preventDefault();
380
- next.focus();
468
+ }
469
+ if (event.key === 'ArrowLeft') {
470
+ if (current.getAttribute('aria-expanded') === 'true') {
471
+ event.preventDefault();
472
+ this.requestExpansion(current, false);
473
+ }
474
+ else if (this.parentItem(current)) {
475
+ event.preventDefault();
476
+ this.focusItem(this.parentItem(current));
477
+ }
478
+ return;
479
+ }
480
+ if (event.key === 'ArrowRight') {
481
+ if (current.getAttribute('aria-expanded') === 'false') {
482
+ event.preventDefault();
483
+ this.requestExpansion(current, true);
484
+ }
485
+ else if (current.getAttribute('aria-expanded') === 'true') {
486
+ const child = this.firstVisibleChild(current, items);
487
+ if (child) {
488
+ event.preventDefault();
489
+ this.focusItem(child);
490
+ }
491
+ }
492
+ }
381
493
  };
382
494
  render() {
383
- return (index.h(index.Host, { key: '474c2154d2abe3c76eee9c36bf552390089df6e8', role: "tree", "aria-label": this.label || 'Tree' }, index.h("slot", { key: '93aedd02f984dd33b5efc811fef417d1199917bd' })));
495
+ return (index.h(index.Host, { key: '549c09abc67dc60b16bf2d6b7d6346f214e9d6ae', role: "tree", "aria-label": this.label || 'Tree' }, index.h("slot", { key: 'fea59bde97611bf384e32ce4fb2b3eec9aca784f' })));
384
496
  }
385
497
  };
386
498
  UITree.style = uiTreeCss();
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "entries": [
3
+ "components/ui-callout/ui-callout.js",
3
4
  "components/ui-affordance-scope/ui-affordance-scope.js",
4
5
  "components/ui-avatar/ui-avatar.js",
5
6
  "components/ui-avatar-group/ui-avatar-group.js",
6
7
  "components/ui-badge/ui-badge.js",
7
8
  "components/ui-button/ui-button.js",
8
9
  "components/ui-checkbox/ui-checkbox.js",
10
+ "components/ui-chip/ui-chip.js",
9
11
  "components/ui-combobox/ui-combobox.js",
10
12
  "components/ui-context-menu/ui-context-menu.js",
11
13
  "components/ui-dialog/ui-dialog.js",
@@ -22,7 +22,7 @@ export class UIAffordanceScope {
22
22
  this.coordinator?.refresh();
23
23
  };
24
24
  render() {
25
- return (h(Host, { key: '184b0a908494d480ed23aa14b75d4f7b94e5275b' }, h("slot", { key: '570e810db588c1514c6fd85985c9bc4532993a2b', onSlotchange: this.onSlotChange })));
25
+ return (h(Host, { key: 'f500fa48554ed6224efd2dbe9632880bf0a15a19' }, h("slot", { key: '37c5c5b7925b260ff8f9edd411ee6c90a12a4909', onSlotchange: this.onSlotChange })));
26
26
  }
27
27
  static get is() { return "ui-affordance-scope"; }
28
28
  static get encapsulation() { return "shadow"; }
@@ -1,4 +1,8 @@
1
1
  :host {
2
+ display: inline-flex;
3
+ }
4
+
5
+ .avatar {
2
6
  display: inline-grid;
3
7
  place-items: center;
4
8
  overflow: hidden;
@@ -14,10 +18,6 @@
14
18
  text-transform: uppercase;
15
19
  }
16
20
 
17
- .avatar {
18
- display: contents;
19
- }
20
-
21
21
  .avatar img {
22
22
  grid-area: 1 / 1;
23
23
  inline-size: 100%;
@@ -18,7 +18,7 @@ export class UIAvatar {
18
18
  render() {
19
19
  const fallbackText = this.fallback || toInitials(this.name || this.alt);
20
20
  const label = this.alt || this.name || 'Avatar';
21
- return (h(Host, { key: '18214960ad2f1a0370907c0281102af924739de9', role: "img", "aria-label": label, "data-has-image": this.hasImage ? '' : undefined }, h("div", { key: 'c6d0a00de56b756f0e24fdc4b306d89cdae2a44f', class: "avatar" }, h("img", { key: 'c5bfecb9d18797bc934ff087ce7ed8a4616ab347', src: this.src, alt: label, onLoad: this.onImageLoad, onError: this.onImageError, hidden: !this.hasImage, "aria-hidden": this.hasImage ? 'false' : 'true' }), h("span", { key: '1875a45a9c21de3e3a52924ef25b3f8429a788c4', class: "fallback", hidden: this.hasImage, "aria-hidden": this.hasImage ? 'true' : 'false' }, fallbackText))));
21
+ return (h(Host, { key: 'bbe6c3a775702022a19d819a6cc9d81d798cb3e1', role: "img", "aria-label": label, "data-has-image": this.hasImage ? '' : undefined }, h("div", { key: '63402327ba5bde122bf5deaea09baf965ee9b047', class: "avatar" }, h("img", { key: 'e52b86773684b80d76efa459cb03ae40881f959b', src: this.src, alt: label, onLoad: this.onImageLoad, onError: this.onImageError, hidden: !this.hasImage, "aria-hidden": this.hasImage ? 'false' : 'true' }), h("span", { key: '82a6d8f0d0c69ca52f81d092a2292fc80238265b', class: "fallback", hidden: this.hasImage, "aria-hidden": this.hasImage ? 'true' : 'false' }, fallbackText))));
22
22
  }
23
23
  static get is() { return "ui-avatar"; }
24
24
  static get encapsulation() { return "shadow"; }
@@ -5,12 +5,12 @@
5
5
  gap: 0;
6
6
  }
7
7
 
8
- ::slotted(*:not([data-ui-avatar-group-overflow])) {
8
+ ::slotted(*) {
9
9
  margin-inline-end: -0.5rem;
10
10
  flex-shrink: 0;
11
11
  }
12
12
 
13
- ::slotted(*:last-of-type:not([data-ui-avatar-group-overflow])) {
13
+ ::slotted(*:last-of-type) {
14
14
  margin-inline-end: 0;
15
15
  }
16
16
 
@@ -1,36 +1,28 @@
1
1
  import { Host, h } from "@stencil/core";
2
- const OVERFLOW_ATTR = 'data-ui-avatar-group-overflow';
3
2
  export class UIAvatarGroup {
4
3
  host;
5
4
  max = 5;
6
5
  label = 'People';
7
6
  overflowCount = 0;
8
- slotRef;
9
7
  syncOverflow() {
10
8
  this.updateOverflow();
11
9
  }
12
10
  componentDidLoad() {
13
- this.slotRef?.addEventListener('slotchange', () => this.updateOverflow());
14
11
  this.updateOverflow();
15
12
  }
16
- componentDidUpdate() {
17
- this.updateOverflow();
13
+ visibleLimit() {
14
+ return Number.isFinite(this.max) ? Math.max(0, Math.floor(this.max)) : 0;
18
15
  }
19
16
  updateOverflow() {
20
- const slot = this.host.shadowRoot?.querySelector('slot');
21
- const nodes = slot?.assignedElements() ?? Array.from(this.host.children);
22
- const children = nodes.filter((el) => !el.hasAttribute(OVERFLOW_ATTR));
17
+ const children = Array.from(this.host.children);
23
18
  const total = children.length;
24
- const visibleCount = Math.min(this.max, total);
25
- const overflowCount = total > this.max ? total - this.max : 0;
26
- children.forEach((el, i) => {
27
- el.hidden = i >= visibleCount;
28
- el.setAttribute('aria-hidden', String(i >= visibleCount));
29
- });
30
- this.overflowCount = overflowCount;
19
+ const visibleLimit = this.visibleLimit();
20
+ const overflowCount = total > visibleLimit ? total - visibleLimit : 0;
21
+ if (this.overflowCount !== overflowCount)
22
+ this.overflowCount = overflowCount;
31
23
  }
32
24
  render() {
33
- return (h(Host, { key: 'bef6efd3c80d29e47742412a497893789ea8790b', role: "list", "aria-label": this.label || undefined }, h("slot", { key: '21585b11dcde36868c3e3bc7fbd0c216be6f011b' }), this.overflowCount > 0 && (h("span", { key: 'ede3b71945d379fe78d522a3346aa29c02d74b15', class: "overflow", role: "listitem", "aria-label": `${this.overflowCount} more`, "data-ui-avatar-group-overflow": true }, "+", this.overflowCount))));
25
+ return (h(Host, { key: '9ba6693cabc379bbbe6f5698160481f27fe02f31', role: "group", "aria-label": this.label || undefined }, h("style", { key: 'ed231fe96c16a3cdd5a66d4828664c75c6959a9e' }, `::slotted(:nth-child(n + ${this.visibleLimit() + 1})) { display: none !important; }`), h("slot", { key: '463005a7f3c498c80c768151ab32c873ff1abf86', onSlotchange: () => this.updateOverflow() }), this.overflowCount > 0 && (h("span", { key: 'dc1ba88fd97ca461e6518d223f00a93416e6d0f0', class: "overflow", role: "img", "aria-label": `${this.overflowCount} more ${this.overflowCount === 1 ? 'person' : 'people'}`, "data-ui-avatar-group-overflow": true }, "+", this.overflowCount))));
34
26
  }
35
27
  static get is() { return "ui-avatar-group"; }
36
28
  static get encapsulation() { return "shadow"; }
@@ -1,74 +1,90 @@
1
1
  :host {
2
+ --ui-badge-surface: var(--ui-surface-muted);
3
+ --ui-badge-text: var(--ui-text-secondary);
4
+ --ui-badge-border: var(--ui-border-default);
5
+ --ui-badge-font-size: var(--ui-font-size-xs);
6
+ --ui-badge-font-weight: var(--ui-font-normal);
7
+ --ui-badge-line-height: var(--ui-line-height-tight);
8
+ --ui-badge-padding-block: var(--ui-space-0-5);
9
+ --ui-badge-padding-inline: var(--ui-space-2);
10
+
11
+ display: inline-flex;
12
+ max-width: 100%;
13
+ }
14
+
15
+ .badge__surface {
2
16
  display: inline-flex;
3
17
  align-items: center;
4
18
  justify-content: center;
5
- border: 1px solid var(--ui-border-default);
6
- border-radius: 999px;
7
- background: var(--ui-surface-muted);
8
- color: var(--ui-text-secondary);
9
- font: inherit;
10
- font-size: 0.75rem;
11
- line-height: 1;
12
- padding: 0.25em 0.6em;
19
+ max-width: 100%;
20
+ padding: var(--ui-badge-padding-block) var(--ui-badge-padding-inline);
21
+ border: 1px solid var(--ui-badge-border);
22
+ border-radius: var(--ui-radius-round);
23
+ background: var(--ui-badge-surface);
24
+ color: var(--ui-badge-text);
25
+ font-family: var(--ui-font-family-sans);
26
+ font-size: var(--ui-badge-font-size);
27
+ font-weight: var(--ui-badge-font-weight);
28
+ line-height: var(--ui-badge-line-height);
13
29
  white-space: nowrap;
14
30
  }
15
31
 
16
- :host([data-tone='accent']) {
17
- background: var(--ui-accent-solid);
18
- border-color: var(--ui-accent-solid);
19
- color: var(--ui-text-on-accent);
32
+ :host([data-tone='accent']) .badge__surface {
33
+ --ui-badge-surface: var(--ui-accent-solid);
34
+ --ui-badge-border: var(--ui-accent-solid);
35
+ --ui-badge-text: var(--ui-text-on-accent);
20
36
  }
21
37
 
22
- :host([data-tone='danger']) {
23
- background: var(--ui-danger-solid);
24
- border-color: var(--ui-danger-solid);
25
- color: var(--ui-text-on-accent);
38
+ :host([data-tone='danger']) .badge__surface {
39
+ --ui-badge-surface: var(--ui-danger-solid);
40
+ --ui-badge-border: var(--ui-danger-solid);
41
+ --ui-badge-text: var(--ui-text-on-accent);
26
42
  }
27
43
 
28
- :host([data-tone='success']) {
29
- background: var(--ui-success-solid);
30
- border-color: var(--ui-success-solid);
31
- color: var(--ui-text-on-accent);
44
+ :host([data-tone='success']) .badge__surface {
45
+ --ui-badge-surface: var(--ui-success-solid);
46
+ --ui-badge-border: var(--ui-success-solid);
47
+ --ui-badge-text: var(--ui-text-on-accent);
32
48
  }
33
49
 
34
- :host([data-tone='warning']) {
35
- background: var(--ui-warning-solid);
36
- border-color: var(--ui-warning-solid);
37
- color: var(--ui-text-primary);
50
+ :host([data-tone='warning']) .badge__surface {
51
+ --ui-badge-surface: var(--ui-warning-solid);
52
+ --ui-badge-border: var(--ui-warning-solid);
53
+ --ui-badge-text: var(--ui-text-primary);
38
54
  }
39
55
 
40
- :host([data-tone='info']) {
41
- background: var(--ui-info-solid);
42
- border-color: var(--ui-info-solid);
43
- color: var(--ui-text-on-accent);
56
+ :host([data-tone='info']) .badge__surface {
57
+ --ui-badge-surface: var(--ui-info-solid);
58
+ --ui-badge-border: var(--ui-info-solid);
59
+ --ui-badge-text: var(--ui-text-on-accent);
44
60
  }
45
61
 
46
- :host([data-variant='subtle'][data-tone='accent']) {
47
- background: var(--ui-accent-soft);
48
- border-color: var(--ui-accent-soft);
49
- color: var(--ui-accent-solid);
62
+ :host([data-variant='subtle'][data-tone='accent']) .badge__surface {
63
+ --ui-badge-surface: var(--ui-accent-soft);
64
+ --ui-badge-border: var(--ui-accent-soft);
65
+ --ui-badge-text: var(--ui-accent-solid);
50
66
  }
51
67
 
52
- :host([data-variant='subtle'][data-tone='danger']) {
53
- background: var(--ui-danger-soft);
54
- border-color: var(--ui-danger-soft);
55
- color: var(--ui-danger-solid);
68
+ :host([data-variant='subtle'][data-tone='danger']) .badge__surface {
69
+ --ui-badge-surface: var(--ui-danger-soft);
70
+ --ui-badge-border: var(--ui-danger-soft);
71
+ --ui-badge-text: var(--ui-danger-solid);
56
72
  }
57
73
 
58
- :host([data-variant='subtle'][data-tone='success']) {
59
- background: var(--ui-success-soft);
60
- border-color: var(--ui-success-soft);
61
- color: var(--ui-success-solid);
74
+ :host([data-variant='subtle'][data-tone='success']) .badge__surface {
75
+ --ui-badge-surface: var(--ui-success-soft);
76
+ --ui-badge-border: var(--ui-success-soft);
77
+ --ui-badge-text: var(--ui-success-solid);
62
78
  }
63
79
 
64
- :host([data-variant='subtle'][data-tone='warning']) {
65
- background: var(--ui-warning-soft);
66
- border-color: var(--ui-warning-soft);
67
- color: var(--ui-warning-solid);
80
+ :host([data-variant='subtle'][data-tone='warning']) .badge__surface {
81
+ --ui-badge-surface: var(--ui-warning-soft);
82
+ --ui-badge-border: var(--ui-warning-soft);
83
+ --ui-badge-text: var(--ui-warning-solid);
68
84
  }
69
85
 
70
- :host([data-variant='subtle'][data-tone='info']) {
71
- background: var(--ui-info-soft);
72
- border-color: var(--ui-info-soft);
73
- color: var(--ui-info-solid);
86
+ :host([data-variant='subtle'][data-tone='info']) .badge__surface {
87
+ --ui-badge-surface: var(--ui-info-soft);
88
+ --ui-badge-border: var(--ui-info-soft);
89
+ --ui-badge-text: var(--ui-info-solid);
74
90
  }
@@ -3,7 +3,7 @@ export class UIBadge {
3
3
  variant;
4
4
  tone;
5
5
  render() {
6
- return (h(Host, { key: '8766c0331ac7fbd6409b604578e159ae093c844b', "data-variant": this.variant || undefined, "data-tone": this.tone || undefined }, h("slot", { key: '65016ab530b850c82261e2da718622ff72567634' })));
6
+ return (h(Host, { key: 'ba96ade6d037a7ed9958e7eed540e62782f846f0', "data-variant": this.variant || undefined, "data-tone": this.tone || undefined }, h("span", { key: 'a1e9587f59de479c19b9ea7aec8c8e932b998369', class: "badge__surface" }, h("slot", { key: '5835ddcea5cda472e700557528fd3cbc9d572616' }))));
7
7
  }
8
8
  static get is() { return "ui-badge"; }
9
9
  static get encapsulation() { return "shadow"; }
@@ -45,7 +45,7 @@ export class UIButton {
45
45
  this.host.click();
46
46
  };
47
47
  render() {
48
- return (h(Host, { key: '9c8d479fe7f1873a447048944513648bac132d52', "data-size": this.size || undefined, "data-variant": this.variant, "data-disabled": this.disabled ? 'true' : undefined, onKeyDown: this.onKeydown }, h("slot", { key: '741f48e7efd42262834992c07c4685d3e929d91c', ref: (el) => (this.slotRef = el) })));
48
+ return (h(Host, { key: '58a90293e2ac169c8bc3c6cb3d15428cc73629b7', "data-size": this.size || undefined, "data-variant": this.variant, "data-disabled": this.disabled ? 'true' : undefined, onKeyDown: this.onKeydown }, h("slot", { key: '05439bdc2af81bcabe9da11b4baf13f880e0a75f', ref: (el) => (this.slotRef = el) })));
49
49
  }
50
50
  static get is() { return "ui-button"; }
51
51
  static get encapsulation() { return "shadow"; }
@@ -0,0 +1,74 @@
1
+ :host {
2
+ --ui-callout-surface: var(--ui-info-soft);
3
+ --ui-callout-text: var(--ui-text-primary);
4
+ --ui-callout-border: var(--ui-info-solid);
5
+ --ui-callout-icon: var(--ui-info-solid);
6
+ --ui-callout-padding-block: var(--ui-space-2);
7
+ --ui-callout-padding-inline: var(--ui-space-3);
8
+ --ui-callout-icon-column: 1rem;
9
+ --ui-callout-gap: var(--ui-space-2);
10
+ --ui-callout-icon-size: 1rem;
11
+ --ui-callout-border-width: 1px;
12
+ --ui-callout-leading-border-width: 4px;
13
+
14
+ display: block;
15
+ max-width: 100%;
16
+ }
17
+
18
+ .callout__surface {
19
+ display: grid;
20
+ grid-template-columns: var(--ui-callout-icon-column) minmax(0, 1fr);
21
+ gap: var(--ui-callout-gap);
22
+ align-items: start;
23
+ padding: var(--ui-callout-padding-block) var(--ui-callout-padding-inline);
24
+ border: var(--ui-callout-border-width) solid color-mix(in srgb, var(--ui-callout-border) 35%, transparent);
25
+ border-inline-start: var(--ui-callout-leading-border-width) solid var(--ui-callout-border);
26
+ border-radius: var(--ui-radius-2);
27
+ background: var(--ui-callout-surface);
28
+ color: var(--ui-callout-text);
29
+ font-family: var(--ui-font-family-sans);
30
+ font-size: var(--ui-font-size-sm);
31
+ font-weight: var(--ui-font-normal);
32
+ line-height: var(--ui-line-height-md);
33
+ }
34
+
35
+ .icon {
36
+ display: grid;
37
+ place-items: center;
38
+ inline-size: var(--ui-callout-icon-column);
39
+ block-size: var(--ui-callout-icon-column);
40
+ color: var(--ui-callout-icon);
41
+ }
42
+
43
+ .icon svg {
44
+ inline-size: var(--ui-callout-icon-size);
45
+ block-size: var(--ui-callout-icon-size);
46
+ }
47
+
48
+ .content {
49
+ min-inline-size: 0;
50
+ }
51
+
52
+ :host([data-tone='note']) {
53
+ --ui-callout-surface: var(--ui-surface-muted);
54
+ --ui-callout-border: var(--ui-border-strong);
55
+ --ui-callout-icon: var(--ui-text-secondary);
56
+ }
57
+
58
+ :host([data-tone='warning']) {
59
+ --ui-callout-surface: var(--ui-warning-soft);
60
+ --ui-callout-border: var(--ui-warning-solid);
61
+ --ui-callout-icon: var(--ui-warning-solid);
62
+ }
63
+
64
+ :host([data-tone='success']) {
65
+ --ui-callout-surface: var(--ui-success-soft);
66
+ --ui-callout-border: var(--ui-success-solid);
67
+ --ui-callout-icon: var(--ui-success-solid);
68
+ }
69
+
70
+ :host([data-tone='error']) {
71
+ --ui-callout-surface: var(--ui-danger-soft);
72
+ --ui-callout-border: var(--ui-danger-solid);
73
+ --ui-callout-icon: var(--ui-danger-solid);
74
+ }
@@ -0,0 +1,59 @@
1
+ import { Host, h } from "@stencil/core";
2
+ import { loomaIconMarkup } from "../../icons";
3
+ const toneIcons = {
4
+ info: 'info',
5
+ note: 'notebook-pen',
6
+ warning: 'triangle-alert',
7
+ success: 'circle-check',
8
+ error: 'circle-x',
9
+ };
10
+ /** A static semantic message with a tone-specific icon. */
11
+ export class UICallout {
12
+ tone = 'info';
13
+ render() {
14
+ const icon = toneIcons[this.tone] ?? toneIcons.info;
15
+ return (h(Host, { key: '94bae6fbb688e5c8da979a3bebc12c51b8689c8a', role: "note", "data-tone": this.tone }, h("div", { key: '8fe1a3dae5b7cd3679d187cef018fa0cd810fb76', class: "callout__surface" }, h("span", { key: 'ed62ad8e29c30489e075631d83f1732d7a53a378', class: "icon", "aria-hidden": "true", innerHTML: loomaIconMarkup(icon) }), h("div", { key: '97638d28e3979f71913c17b2501a90e3a9251f0f', class: "content" }, h("slot", { key: '6a91a0d3f189eae28aabbe278924ba7f89015f34' })))));
16
+ }
17
+ static get is() { return "ui-callout"; }
18
+ static get encapsulation() { return "shadow"; }
19
+ static get originalStyleUrls() {
20
+ return {
21
+ "$": ["ui-callout.css"]
22
+ };
23
+ }
24
+ static get styleUrls() {
25
+ return {
26
+ "$": ["ui-callout.css"]
27
+ };
28
+ }
29
+ static get properties() {
30
+ return {
31
+ "tone": {
32
+ "type": "string",
33
+ "mutable": false,
34
+ "complexType": {
35
+ "original": "CalloutTone",
36
+ "resolved": "\"error\" | \"info\" | \"note\" | \"success\" | \"warning\"",
37
+ "references": {
38
+ "CalloutTone": {
39
+ "location": "local",
40
+ "path": "/home/runner/work/looma/looma/packages/core/src/components/ui-callout/ui-callout.tsx",
41
+ "id": "src/components/ui-callout/ui-callout.tsx::CalloutTone"
42
+ }
43
+ }
44
+ },
45
+ "required": false,
46
+ "optional": false,
47
+ "docs": {
48
+ "tags": [],
49
+ "text": ""
50
+ },
51
+ "getter": false,
52
+ "setter": false,
53
+ "reflect": false,
54
+ "attribute": "tone",
55
+ "defaultValue": "'info'"
56
+ }
57
+ };
58
+ }
59
+ }