@threadlabs/looma 0.1.0

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 (318) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +21 -0
  3. package/dist/chunk-G53JEAQK.js +94 -0
  4. package/dist/chunk-OF57X5AR.js +10 -0
  5. package/dist/chunk-UL7UIUJZ.js +20 -0
  6. package/dist/chunk-YK4MTZGJ.js +1580 -0
  7. package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
  8. package/dist/cjs/events-TcQIzpNv.js +19 -0
  9. package/dist/cjs/id-CYbKpaYr.js +9 -0
  10. package/dist/cjs/index-D07f6BOw.js +1569 -0
  11. package/dist/cjs/index.cjs.js +2 -0
  12. package/dist/cjs/loader.cjs.js +13 -0
  13. package/dist/cjs/looma.cjs.js +25 -0
  14. package/dist/cjs/manager-BOpVXb92.js +93 -0
  15. package/dist/cjs/ui-avatar-group.cjs.entry.js +51 -0
  16. package/dist/cjs/ui-avatar.cjs.entry.js +50 -0
  17. package/dist/cjs/ui-badge.cjs.entry.js +19 -0
  18. package/dist/cjs/ui-button.cjs.entry.js +62 -0
  19. package/dist/cjs/ui-checkbox.cjs.entry.js +91 -0
  20. package/dist/cjs/ui-context-menu.cjs.entry.js +201 -0
  21. package/dist/cjs/ui-dialog.cjs.entry.js +93 -0
  22. package/dist/cjs/ui-disclosure.cjs.entry.js +109 -0
  23. package/dist/cjs/ui-floating-action-button.cjs.entry.js +20 -0
  24. package/dist/cjs/ui-form-field.cjs.entry.js +59 -0
  25. package/dist/cjs/ui-icon-button.cjs.entry.js +21 -0
  26. package/dist/cjs/ui-input.cjs.entry.js +101 -0
  27. package/dist/cjs/ui-menu-item.cjs.entry.js +19 -0
  28. package/dist/cjs/ui-menu.cjs.entry.js +96 -0
  29. package/dist/cjs/ui-popover.cjs.entry.js +92 -0
  30. package/dist/cjs/ui-radio-group.cjs.entry.js +134 -0
  31. package/dist/cjs/ui-radio.cjs.entry.js +85 -0
  32. package/dist/cjs/ui-search-result-row.cjs.entry.js +47 -0
  33. package/dist/cjs/ui-search-shell.cjs.entry.js +39 -0
  34. package/dist/cjs/ui-select.cjs.entry.js +100 -0
  35. package/dist/cjs/ui-switch.cjs.entry.js +65 -0
  36. package/dist/cjs/ui-tabs.cjs.entry.js +117 -0
  37. package/dist/cjs/ui-textarea.cjs.entry.js +106 -0
  38. package/dist/cjs/ui-toast-region.cjs.entry.js +67 -0
  39. package/dist/cjs/ui-tooltip.cjs.entry.js +133 -0
  40. package/dist/cjs/ui-top-bar.cjs.entry.js +43 -0
  41. package/dist/collection/collection-manifest.json +38 -0
  42. package/dist/collection/components/ui-avatar/ui-avatar.css +35 -0
  43. package/dist/collection/components/ui-avatar/ui-avatar.js +130 -0
  44. package/dist/collection/components/ui-avatar-group/ui-avatar-group.css +32 -0
  45. package/dist/collection/components/ui-avatar-group/ui-avatar-group.js +103 -0
  46. package/dist/collection/components/ui-badge/ui-badge.css +74 -0
  47. package/dist/collection/components/ui-badge/ui-badge.js +62 -0
  48. package/dist/collection/components/ui-button/ui-button.css +101 -0
  49. package/dist/collection/components/ui-button/ui-button.js +127 -0
  50. package/dist/collection/components/ui-checkbox/ui-checkbox.css +24 -0
  51. package/dist/collection/components/ui-checkbox/ui-checkbox.js +223 -0
  52. package/dist/collection/components/ui-context-menu/ui-context-menu.css +17 -0
  53. package/dist/collection/components/ui-context-menu/ui-context-menu.js +272 -0
  54. package/dist/collection/components/ui-dialog/ui-dialog.css +65 -0
  55. package/dist/collection/components/ui-dialog/ui-dialog.js +185 -0
  56. package/dist/collection/components/ui-disclosure/ui-disclosure.css +7 -0
  57. package/dist/collection/components/ui-disclosure/ui-disclosure.js +182 -0
  58. package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.css +70 -0
  59. package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.js +85 -0
  60. package/dist/collection/components/ui-form-field/ui-form-field.css +21 -0
  61. package/dist/collection/components/ui-form-field/ui-form-field.js +125 -0
  62. package/dist/collection/components/ui-icon-button/ui-icon-button.css +92 -0
  63. package/dist/collection/components/ui-icon-button/ui-icon-button.js +106 -0
  64. package/dist/collection/components/ui-input/ui-input.css +46 -0
  65. package/dist/collection/components/ui-input/ui-input.js +213 -0
  66. package/dist/collection/components/ui-menu/ui-menu.css +37 -0
  67. package/dist/collection/components/ui-menu/ui-menu.js +149 -0
  68. package/dist/collection/components/ui-menu-item/ui-menu-item.css +26 -0
  69. package/dist/collection/components/ui-menu-item/ui-menu-item.js +64 -0
  70. package/dist/collection/components/ui-popover/ui-popover.css +8 -0
  71. package/dist/collection/components/ui-popover/ui-popover.js +144 -0
  72. package/dist/collection/components/ui-radio/ui-radio.css +22 -0
  73. package/dist/collection/components/ui-radio/ui-radio.js +213 -0
  74. package/dist/collection/components/ui-radio-group/ui-radio-group.css +10 -0
  75. package/dist/collection/components/ui-radio-group/ui-radio-group.js +247 -0
  76. package/dist/collection/components/ui-search-result-row/ui-search-result-row.css +80 -0
  77. package/dist/collection/components/ui-search-result-row/ui-search-result-row.js +100 -0
  78. package/dist/collection/components/ui-search-shell/ui-search-shell.css +61 -0
  79. package/dist/collection/components/ui-search-shell/ui-search-shell.js +46 -0
  80. package/dist/collection/components/ui-select/ui-select.css +62 -0
  81. package/dist/collection/components/ui-select/ui-select.js +212 -0
  82. package/dist/collection/components/ui-switch/ui-switch.css +63 -0
  83. package/dist/collection/components/ui-switch/ui-switch.js +177 -0
  84. package/dist/collection/components/ui-tabs/ui-tabs.css +65 -0
  85. package/dist/collection/components/ui-tabs/ui-tabs.js +190 -0
  86. package/dist/collection/components/ui-textarea/ui-textarea.css +48 -0
  87. package/dist/collection/components/ui-textarea/ui-textarea.js +238 -0
  88. package/dist/collection/components/ui-toast-region/ui-toast-region.css +52 -0
  89. package/dist/collection/components/ui-toast-region/ui-toast-region.js +100 -0
  90. package/dist/collection/components/ui-tooltip/ui-tooltip.css +14 -0
  91. package/dist/collection/components/ui-tooltip/ui-tooltip.js +205 -0
  92. package/dist/collection/components/ui-top-bar/ui-top-bar.css +43 -0
  93. package/dist/collection/components/ui-top-bar/ui-top-bar.js +52 -0
  94. package/dist/collection/overlay/manager.js +90 -0
  95. package/dist/collection/utils/events.js +13 -0
  96. package/dist/collection/utils/id.js +5 -0
  97. package/dist/collection/utils/initials.js +11 -0
  98. package/dist/components/index.d.ts +88 -0
  99. package/dist/components/index.js +1 -0
  100. package/dist/components/p-CIA4RyEp.js +1 -0
  101. package/dist/components/p-CR7f2MQC.js +1 -0
  102. package/dist/components/p-JwSoedEO.js +1 -0
  103. package/dist/components/p-WvL4iAhX.js +1 -0
  104. package/dist/components/p-hgBUJRDa.js +1 -0
  105. package/dist/components/ui-avatar-group.d.ts +11 -0
  106. package/dist/components/ui-avatar-group.js +1 -0
  107. package/dist/components/ui-avatar.d.ts +11 -0
  108. package/dist/components/ui-avatar.js +1 -0
  109. package/dist/components/ui-badge.d.ts +11 -0
  110. package/dist/components/ui-badge.js +1 -0
  111. package/dist/components/ui-button.d.ts +11 -0
  112. package/dist/components/ui-button.js +1 -0
  113. package/dist/components/ui-checkbox.d.ts +11 -0
  114. package/dist/components/ui-checkbox.js +1 -0
  115. package/dist/components/ui-context-menu.d.ts +11 -0
  116. package/dist/components/ui-context-menu.js +1 -0
  117. package/dist/components/ui-dialog.d.ts +11 -0
  118. package/dist/components/ui-dialog.js +1 -0
  119. package/dist/components/ui-disclosure.d.ts +11 -0
  120. package/dist/components/ui-disclosure.js +1 -0
  121. package/dist/components/ui-floating-action-button.d.ts +11 -0
  122. package/dist/components/ui-floating-action-button.js +1 -0
  123. package/dist/components/ui-form-field.d.ts +11 -0
  124. package/dist/components/ui-form-field.js +1 -0
  125. package/dist/components/ui-icon-button.d.ts +11 -0
  126. package/dist/components/ui-icon-button.js +1 -0
  127. package/dist/components/ui-input.d.ts +11 -0
  128. package/dist/components/ui-input.js +1 -0
  129. package/dist/components/ui-menu-item.d.ts +11 -0
  130. package/dist/components/ui-menu-item.js +1 -0
  131. package/dist/components/ui-menu.d.ts +11 -0
  132. package/dist/components/ui-menu.js +1 -0
  133. package/dist/components/ui-popover.d.ts +11 -0
  134. package/dist/components/ui-popover.js +1 -0
  135. package/dist/components/ui-radio-group.d.ts +11 -0
  136. package/dist/components/ui-radio-group.js +1 -0
  137. package/dist/components/ui-radio.d.ts +11 -0
  138. package/dist/components/ui-radio.js +1 -0
  139. package/dist/components/ui-search-result-row.d.ts +11 -0
  140. package/dist/components/ui-search-result-row.js +1 -0
  141. package/dist/components/ui-search-shell.d.ts +11 -0
  142. package/dist/components/ui-search-shell.js +1 -0
  143. package/dist/components/ui-select.d.ts +11 -0
  144. package/dist/components/ui-select.js +1 -0
  145. package/dist/components/ui-switch.d.ts +11 -0
  146. package/dist/components/ui-switch.js +1 -0
  147. package/dist/components/ui-tabs.d.ts +11 -0
  148. package/dist/components/ui-tabs.js +1 -0
  149. package/dist/components/ui-textarea.d.ts +11 -0
  150. package/dist/components/ui-textarea.js +1 -0
  151. package/dist/components/ui-toast-region.d.ts +11 -0
  152. package/dist/components/ui-toast-region.js +1 -0
  153. package/dist/components/ui-tooltip.d.ts +11 -0
  154. package/dist/components/ui-tooltip.js +1 -0
  155. package/dist/components/ui-top-bar.d.ts +11 -0
  156. package/dist/components/ui-top-bar.js +1 -0
  157. package/dist/esm/app-globals-DQuL1Twl.js +3 -0
  158. package/dist/esm/events-JwSoedEO.js +15 -0
  159. package/dist/esm/id-hgBUJRDa.js +7 -0
  160. package/dist/esm/index-CEeiinfk.js +1561 -0
  161. package/dist/esm/index.js +1 -0
  162. package/dist/esm/loader.js +11 -0
  163. package/dist/esm/looma.js +21 -0
  164. package/dist/esm/manager-CR7f2MQC.js +89 -0
  165. package/dist/esm/ui-avatar-group.entry.js +49 -0
  166. package/dist/esm/ui-avatar.entry.js +48 -0
  167. package/dist/esm/ui-badge.entry.js +17 -0
  168. package/dist/esm/ui-button.entry.js +60 -0
  169. package/dist/esm/ui-checkbox.entry.js +89 -0
  170. package/dist/esm/ui-context-menu.entry.js +199 -0
  171. package/dist/esm/ui-dialog.entry.js +91 -0
  172. package/dist/esm/ui-disclosure.entry.js +107 -0
  173. package/dist/esm/ui-floating-action-button.entry.js +18 -0
  174. package/dist/esm/ui-form-field.entry.js +57 -0
  175. package/dist/esm/ui-icon-button.entry.js +19 -0
  176. package/dist/esm/ui-input.entry.js +99 -0
  177. package/dist/esm/ui-menu-item.entry.js +17 -0
  178. package/dist/esm/ui-menu.entry.js +94 -0
  179. package/dist/esm/ui-popover.entry.js +90 -0
  180. package/dist/esm/ui-radio-group.entry.js +132 -0
  181. package/dist/esm/ui-radio.entry.js +83 -0
  182. package/dist/esm/ui-search-result-row.entry.js +45 -0
  183. package/dist/esm/ui-search-shell.entry.js +37 -0
  184. package/dist/esm/ui-select.entry.js +98 -0
  185. package/dist/esm/ui-switch.entry.js +63 -0
  186. package/dist/esm/ui-tabs.entry.js +115 -0
  187. package/dist/esm/ui-textarea.entry.js +104 -0
  188. package/dist/esm/ui-toast-region.entry.js +65 -0
  189. package/dist/esm/ui-tooltip.entry.js +131 -0
  190. package/dist/esm/ui-top-bar.entry.js +41 -0
  191. package/dist/index.cjs +4062 -0
  192. package/dist/index.cjs.js +1 -0
  193. package/dist/index.d.cts +16 -0
  194. package/dist/index.d.ts +16 -0
  195. package/dist/index.js +129 -0
  196. package/dist/looma/index.esm.js +0 -0
  197. package/dist/looma/looma.esm.js +1 -0
  198. package/dist/looma/p-03f0594b.entry.js +1 -0
  199. package/dist/looma/p-15e619fd.entry.js +1 -0
  200. package/dist/looma/p-201243dc.entry.js +1 -0
  201. package/dist/looma/p-24d7aa5b.entry.js +1 -0
  202. package/dist/looma/p-341ba64a.entry.js +1 -0
  203. package/dist/looma/p-41d62a83.entry.js +1 -0
  204. package/dist/looma/p-4742e6b4.entry.js +1 -0
  205. package/dist/looma/p-4c54d489.entry.js +1 -0
  206. package/dist/looma/p-52c537fa.entry.js +1 -0
  207. package/dist/looma/p-5a645647.entry.js +1 -0
  208. package/dist/looma/p-610b2eca.entry.js +1 -0
  209. package/dist/looma/p-649dad92.entry.js +1 -0
  210. package/dist/looma/p-66a203a1.entry.js +1 -0
  211. package/dist/looma/p-754cfff3.entry.js +1 -0
  212. package/dist/looma/p-93ce1c62.entry.js +1 -0
  213. package/dist/looma/p-955fb814.entry.js +1 -0
  214. package/dist/looma/p-96de71ad.entry.js +1 -0
  215. package/dist/looma/p-CEeiinfk.js +2 -0
  216. package/dist/looma/p-CR7f2MQC.js +1 -0
  217. package/dist/looma/p-DQuL1Twl.js +1 -0
  218. package/dist/looma/p-JwSoedEO.js +1 -0
  219. package/dist/looma/p-ab4151d5.entry.js +1 -0
  220. package/dist/looma/p-c14233bc.entry.js +1 -0
  221. package/dist/looma/p-dc857ed4.entry.js +1 -0
  222. package/dist/looma/p-dfcb2cca.entry.js +1 -0
  223. package/dist/looma/p-dff144bd.entry.js +1 -0
  224. package/dist/looma/p-ebb74106.entry.js +1 -0
  225. package/dist/looma/p-ecb5739b.entry.js +1 -0
  226. package/dist/looma/p-ee31c7b4.entry.js +1 -0
  227. package/dist/looma/p-fa4659c4.entry.js +1 -0
  228. package/dist/looma/p-hgBUJRDa.js +1 -0
  229. package/dist/types/components/ui-avatar/ui-avatar.d.ts +11 -0
  230. package/dist/types/components/ui-avatar-group/ui-avatar-group.d.ts +12 -0
  231. package/dist/types/components/ui-badge/ui-badge.d.ts +5 -0
  232. package/dist/types/components/ui-button/ui-button.d.ts +13 -0
  233. package/dist/types/components/ui-checkbox/ui-checkbox.d.ts +19 -0
  234. package/dist/types/components/ui-context-menu/ui-context-menu.d.ts +37 -0
  235. package/dist/types/components/ui-dialog/ui-dialog.d.ts +19 -0
  236. package/dist/types/components/ui-disclosure/ui-disclosure.d.ts +20 -0
  237. package/dist/types/components/ui-floating-action-button/ui-floating-action-button.d.ts +6 -0
  238. package/dist/types/components/ui-form-field/ui-form-field.d.ts +10 -0
  239. package/dist/types/components/ui-icon-button/ui-icon-button.d.ts +7 -0
  240. package/dist/types/components/ui-input/ui-input.d.ts +19 -0
  241. package/dist/types/components/ui-menu/ui-menu.d.ts +14 -0
  242. package/dist/types/components/ui-menu-item/ui-menu-item.d.ts +5 -0
  243. package/dist/types/components/ui-popover/ui-popover.d.ts +16 -0
  244. package/dist/types/components/ui-radio/ui-radio.d.ts +17 -0
  245. package/dist/types/components/ui-radio-group/ui-radio-group.d.ts +21 -0
  246. package/dist/types/components/ui-search-result-row/ui-search-result-row.d.ts +15 -0
  247. package/dist/types/components/ui-search-shell/ui-search-shell.d.ts +9 -0
  248. package/dist/types/components/ui-select/ui-select.d.ts +19 -0
  249. package/dist/types/components/ui-switch/ui-switch.d.ts +15 -0
  250. package/dist/types/components/ui-tabs/ui-tabs.d.ts +17 -0
  251. package/dist/types/components/ui-textarea/ui-textarea.d.ts +20 -0
  252. package/dist/types/components/ui-toast-region/ui-toast-region.d.ts +12 -0
  253. package/dist/types/components/ui-tooltip/ui-tooltip.d.ts +24 -0
  254. package/dist/types/components/ui-top-bar/ui-top-bar.d.ts +12 -0
  255. package/dist/types/components.d.ts +1148 -0
  256. package/dist/types/overlay/manager.d.ts +14 -0
  257. package/dist/types/stencil-public-runtime.d.ts +1860 -0
  258. package/dist/types/utils/events.d.ts +4 -0
  259. package/dist/types/utils/id.d.ts +1 -0
  260. package/dist/types/utils/initials.d.ts +1 -0
  261. package/dist/ui-avatar-group.entry-BZGXBOSE.js +59 -0
  262. package/dist/ui-avatar.entry-S2O2W5SA.js +51 -0
  263. package/dist/ui-badge.entry-CVJDISCR.js +22 -0
  264. package/dist/ui-button.entry-LNJBEJFE.js +72 -0
  265. package/dist/ui-checkbox.entry-5RA2CB43.js +102 -0
  266. package/dist/ui-context-menu.entry-UUOCT75F.js +211 -0
  267. package/dist/ui-dialog.entry-OEPJTEES.js +106 -0
  268. package/dist/ui-disclosure.entry-LRRISGUD.js +120 -0
  269. package/dist/ui-floating-action-button.entry-7TSAZRXP.js +23 -0
  270. package/dist/ui-form-field.entry-73YOVICF.js +67 -0
  271. package/dist/ui-icon-button.entry-MNXGPG36.js +24 -0
  272. package/dist/ui-input.entry-UWRVAOSW.js +112 -0
  273. package/dist/ui-menu-item.entry-5AOJO5MP.js +22 -0
  274. package/dist/ui-menu.entry-YDS6UMB5.js +98 -0
  275. package/dist/ui-popover.entry-PGWDCQIX.js +104 -0
  276. package/dist/ui-radio-group.entry-RHP5GNWU.js +142 -0
  277. package/dist/ui-radio.entry-5WRWPSTK.js +96 -0
  278. package/dist/ui-search-result-row.entry-IKJB2SJJ.js +50 -0
  279. package/dist/ui-search-shell.entry-ZIWF4ZHH.js +41 -0
  280. package/dist/ui-select.entry-N5TIKHR7.js +111 -0
  281. package/dist/ui-switch.entry-WUSZTXIR.js +75 -0
  282. package/dist/ui-tabs.entry-UFAVAQIF.js +124 -0
  283. package/dist/ui-textarea.entry-BYT47RAQ.js +117 -0
  284. package/dist/ui-toast-region.entry-6UYR3ZU2.js +78 -0
  285. package/dist/ui-tooltip.entry-YS7UX4FS.js +145 -0
  286. package/dist/ui-top-bar.entry-V27H6NFO.js +49 -0
  287. package/editor/chunk-JKRA4D4W.js +435 -0
  288. package/editor/chunk-NOOV344H.js +783 -0
  289. package/editor/extensions/index.d.ts +78 -0
  290. package/editor/extensions/index.js +28 -0
  291. package/editor/index.d.ts +7 -0
  292. package/editor/index.js +29 -0
  293. package/editor/table-overlay-DTr3KC9e.d.ts +12 -0
  294. package/editor/ui.d.ts +48 -0
  295. package/editor/ui.js +1 -0
  296. package/editor.css +662 -0
  297. package/layout/index.cjs +207 -0
  298. package/layout/index.css +166 -0
  299. package/layout/index.d.cts +3 -0
  300. package/layout/index.d.ts +3 -0
  301. package/layout/index.js +182 -0
  302. package/layout.css +124 -0
  303. package/loader/cdn.js +1 -0
  304. package/loader/index.cjs.js +1 -0
  305. package/loader/index.d.ts +24 -0
  306. package/loader/index.es2017.js +1 -0
  307. package/loader/index.js +2 -0
  308. package/package.json +244 -0
  309. package/styles.css +899 -0
  310. package/theme-dark.css +59 -0
  311. package/theme-high-contrast.css +21 -0
  312. package/theme-light.css +30 -0
  313. package/tokens.css +148 -0
  314. package/vue/chunk-J4UBEIIL.js +83 -0
  315. package/vue/editor/index.d.ts +89 -0
  316. package/vue/editor/index.js +125 -0
  317. package/vue/index.d.ts +167 -0
  318. package/vue/index.js +113 -0
@@ -0,0 +1,142 @@
1
+ import {
2
+ dispatchDetail,
3
+ eventToTrigger
4
+ } from "./chunk-UL7UIUJZ.js";
5
+ import {
6
+ Host,
7
+ getElement,
8
+ h,
9
+ registerInstance
10
+ } from "./chunk-YK4MTZGJ.js";
11
+
12
+ // dist/esm/ui-radio-group.entry.js
13
+ var uiRadioGroupCss = () => `:host{display:inline-flex;align-items:center;gap:var(--ui-space-2)}:host([data-orientation='vertical']){display:inline-grid;justify-items:start}`;
14
+ var UIRadioGroup = class {
15
+ constructor(hostRef) {
16
+ registerInstance(this, hostRef);
17
+ }
18
+ get host() {
19
+ return getElement(this);
20
+ }
21
+ value = "";
22
+ name = "";
23
+ orientation = "horizontal";
24
+ disabled = false;
25
+ required = false;
26
+ internalValue = "";
27
+ syncFromProp() {
28
+ this.internalValue = this.value;
29
+ }
30
+ syncToRadios() {
31
+ const radios = this.getRadios();
32
+ radios.forEach((radio) => {
33
+ radio.checked = (radio.getAttribute("value") ?? "") === this.internalValue;
34
+ radio.name = this.name || this.groupId;
35
+ if (this.disabled) {
36
+ radio.setAttribute("aria-disabled", "true");
37
+ radio.setAttribute("data-disabled", "true");
38
+ } else {
39
+ radio.removeAttribute("aria-disabled");
40
+ radio.removeAttribute("data-disabled");
41
+ }
42
+ });
43
+ this.updateRovingTabindex();
44
+ }
45
+ groupId = `ui-radio-group-${Math.random().toString(36).slice(2, 9)}`;
46
+ componentDidLoad() {
47
+ this.syncFromProp();
48
+ this.syncToRadios();
49
+ this.host.addEventListener("change", this.onRadioChange);
50
+ this.host.addEventListener("keydown", this.onKeydown);
51
+ }
52
+ disconnectedCallback() {
53
+ this.host.removeEventListener("change", this.onRadioChange);
54
+ this.host.removeEventListener("keydown", this.onKeydown);
55
+ }
56
+ componentDidUpdate() {
57
+ this.syncToRadios();
58
+ }
59
+ getRadios() {
60
+ return Array.from(this.host.querySelectorAll("ui-radio"));
61
+ }
62
+ updateRovingTabindex() {
63
+ const radios = this.getRadios();
64
+ const currentIndex = radios.findIndex((r) => (r.getAttribute("value") ?? "") === this.internalValue);
65
+ radios.forEach((r, i) => {
66
+ const input = r.querySelector('input[type="radio"]');
67
+ if (input) {
68
+ input.tabIndex = i === (currentIndex >= 0 ? currentIndex : 0) ? 0 : -1;
69
+ }
70
+ });
71
+ }
72
+ setValue(newValue, trigger) {
73
+ const prev = this.internalValue;
74
+ this.internalValue = newValue;
75
+ this.syncToRadios();
76
+ dispatchDetail(this.host, "select", { value: newValue, previousValue: prev, trigger });
77
+ dispatchDetail(this.host, "change", {
78
+ checked: true,
79
+ value: newValue,
80
+ trigger
81
+ });
82
+ }
83
+ onRadioChange = (e) => {
84
+ const target = e.target.closest?.("ui-radio");
85
+ if (!target || target.getRootNode() !== this.host.getRootNode())
86
+ return;
87
+ const value = target.getAttribute("value") ?? "";
88
+ if (value && value !== this.internalValue) {
89
+ this.setValue(value, eventToTrigger(e));
90
+ }
91
+ };
92
+ onKeydown = (e) => {
93
+ const radios = this.getRadios();
94
+ if (radios.length === 0)
95
+ return;
96
+ const currentIndex = radios.findIndex((r) => (r.getAttribute("value") ?? "") === this.internalValue);
97
+ const axis = this.orientation === "vertical" ? "vertical" : "horizontal";
98
+ const isPrev = axis === "horizontal" ? e.key === "ArrowLeft" : e.key === "ArrowUp";
99
+ const isNext = axis === "horizontal" ? e.key === "ArrowRight" : e.key === "ArrowDown";
100
+ if (!isPrev && !isNext)
101
+ return;
102
+ e.preventDefault();
103
+ let nextIndex;
104
+ if (isNext) {
105
+ nextIndex = currentIndex < 0 ? 0 : Math.min(currentIndex + 1, radios.length - 1);
106
+ } else {
107
+ nextIndex = currentIndex <= 0 ? radios.length - 1 : currentIndex - 1;
108
+ }
109
+ const nextRadio = radios[nextIndex];
110
+ const nextValue = nextRadio?.getAttribute("value") ?? "";
111
+ if (nextValue) {
112
+ this.setValue(nextValue, "keyboard");
113
+ nextRadio?.querySelector('input[type="radio"]')?.focus();
114
+ }
115
+ };
116
+ render() {
117
+ return h(Host, { key: "5182efff607bcf9add3f0981ce2af3a42bd356b8", role: "radiogroup", "aria-orientation": this.orientation, "data-orientation": this.orientation, "data-disabled": this.disabled ? "" : void 0 }, h("slot", { key: "2889bc2abecddf3e7cf81cd54053bdd608559dfc" }));
118
+ }
119
+ static get watchers() {
120
+ return {
121
+ "value": [{
122
+ "syncFromProp": 0
123
+ }],
124
+ "internalValue": [{
125
+ "syncToRadios": 0
126
+ }],
127
+ "name": [{
128
+ "syncToRadios": 0
129
+ }],
130
+ "orientation": [{
131
+ "syncToRadios": 0
132
+ }],
133
+ "disabled": [{
134
+ "syncToRadios": 0
135
+ }]
136
+ };
137
+ }
138
+ };
139
+ UIRadioGroup.style = uiRadioGroupCss();
140
+ export {
141
+ UIRadioGroup as ui_radio_group
142
+ };
@@ -0,0 +1,96 @@
1
+ import {
2
+ dispatchDetail,
3
+ eventToTrigger
4
+ } from "./chunk-UL7UIUJZ.js";
5
+ import {
6
+ Host,
7
+ getElement,
8
+ h,
9
+ registerInstance
10
+ } from "./chunk-YK4MTZGJ.js";
11
+
12
+ // dist/esm/ui-radio.entry.js
13
+ var uiRadioCss = () => `:host{display:inline-flex;align-items:center;gap:var(--ui-space-2);color:var(--ui-text-primary)}:host([data-disabled='true']),:host([aria-disabled='true']){opacity:0.6;cursor:not-allowed}::slotted(input[type='radio']){accent-color:var(--ui-accent-solid);cursor:pointer}::slotted(input[type='radio']:focus-visible){outline:2px solid var(--ui-accent-solid);outline-offset:2px}`;
14
+ var UIRadio = class {
15
+ constructor(hostRef) {
16
+ registerInstance(this, hostRef);
17
+ }
18
+ get host() {
19
+ return getElement(this);
20
+ }
21
+ checked = false;
22
+ defaultChecked = false;
23
+ disabled = false;
24
+ name = "";
25
+ required = false;
26
+ value = "on";
27
+ slotRef;
28
+ syncToInput() {
29
+ const input = this.getInput();
30
+ if (!input)
31
+ return;
32
+ this.host.dataset.disabled = this.disabled ? "true" : "";
33
+ input.checked = this.checked;
34
+ input.disabled = this.disabled;
35
+ input.name = this.name;
36
+ input.required = this.required;
37
+ input.value = this.value;
38
+ }
39
+ componentDidLoad() {
40
+ if (!this.checked && this.defaultChecked) {
41
+ this.checked = true;
42
+ }
43
+ this.slotRef?.addEventListener("slotchange", () => this.syncToInput());
44
+ this.syncToInput();
45
+ const input = this.getInput();
46
+ input?.addEventListener("change", this.onInputChange);
47
+ }
48
+ disconnectedCallback() {
49
+ const input = this.getInput();
50
+ input?.removeEventListener("change", this.onInputChange);
51
+ }
52
+ componentDidUpdate() {
53
+ this.syncToInput();
54
+ }
55
+ getInput() {
56
+ const slot = this.host.shadowRoot?.querySelector("slot");
57
+ const nodes = slot?.assignedElements() ?? Array.from(this.host.children);
58
+ return nodes.find((el) => el instanceof HTMLInputElement && el.type === "radio") ?? null;
59
+ }
60
+ onInputChange = (e) => {
61
+ const input = e.target;
62
+ if (!input || !input.checked)
63
+ return;
64
+ dispatchDetail(this.host, "change", {
65
+ checked: true,
66
+ value: this.value,
67
+ trigger: eventToTrigger(e)
68
+ });
69
+ };
70
+ render() {
71
+ return h(Host, { key: "85a3e7f7903c910f6ccbc324ab38bf94ebaf93e0", role: "radio", "aria-checked": String(this.checked), "aria-disabled": String(this.disabled), "data-disabled": this.disabled ? "" : void 0 }, h("slot", { key: "9117391004b9ed10cb4e819a629f66d32661d7d3", ref: (el) => this.slotRef = el }));
72
+ }
73
+ static get watchers() {
74
+ return {
75
+ "checked": [{
76
+ "syncToInput": 0
77
+ }],
78
+ "disabled": [{
79
+ "syncToInput": 0
80
+ }],
81
+ "name": [{
82
+ "syncToInput": 0
83
+ }],
84
+ "required": [{
85
+ "syncToInput": 0
86
+ }],
87
+ "value": [{
88
+ "syncToInput": 0
89
+ }]
90
+ };
91
+ }
92
+ };
93
+ UIRadio.style = uiRadioCss();
94
+ export {
95
+ UIRadio as ui_radio
96
+ };
@@ -0,0 +1,50 @@
1
+ import {
2
+ Host,
3
+ h,
4
+ registerInstance
5
+ } from "./chunk-YK4MTZGJ.js";
6
+
7
+ // dist/esm/ui-search-result-row.entry.js
8
+ var uiSearchResultRowCss = () => `:host{display:block}.search-result-row{appearance:none;inline-size:100%;min-block-size:var(--ui-search-result-row-min-height, 56px);margin:0;padding-block:var(--ui-search-result-row-padding-block, var(--ui-space-3, 0.75rem));padding-inline:var(--ui-search-result-row-padding-inline, var(--ui-space-4, 1rem));display:flex;align-items:flex-start;gap:var(--ui-search-result-row-gap, var(--ui-space-3, 0.75rem));background:var(--ui-search-result-row-bg, transparent);border:none;border-block-end:1px solid var(--ui-search-result-row-border, var(--ui-border, #e5e7eb));color:inherit;cursor:pointer;text-align:left;transition:background-color var(--ui-motion-fast, 160ms) var(--ui-motion-ease, ease)}:host(:last-child) .search-result-row{border-block-end:none}.search-result-row:hover:enabled{background:var(--ui-search-result-row-hover-bg, color-mix(in srgb, var(--ui-surface, #ffffff) 85%, black 3%))}:host([selected]) .search-result-row{background:var( --ui-search-result-row-selected-bg, var(--ui-search-result-row-hover-bg, color-mix(in srgb, var(--ui-surface, #ffffff) 85%, black 3%)) )}.search-result-row:focus-visible{outline:2px solid var(--ui-focus-ring, #2563eb);outline-offset:-2px}.search-result-row:disabled,:host([disabled]) .search-result-row{opacity:0.6;cursor:not-allowed}.search-result-row__leading,.search-result-row__trailing{display:inline-flex;align-items:flex-start;flex-shrink:0}.search-result-row__content{min-inline-size:0;flex:1;display:flex;flex-direction:column}.search-result-row__title,.search-result-row__meta,.search-result-row__excerpt{display:block;min-inline-size:0}[hidden]{display:none}::slotted([slot='title']),::slotted([slot='meta']),::slotted([slot='excerpt']){display:block;margin:0}`;
9
+ function slotHasContent(slot) {
10
+ if (!slot) {
11
+ return false;
12
+ }
13
+ return slot.assignedNodes({ flatten: true }).some((node) => {
14
+ if (node.nodeType === Node.TEXT_NODE) {
15
+ return Boolean(node.textContent?.trim());
16
+ }
17
+ return true;
18
+ });
19
+ }
20
+ var UISearchResultRow = class {
21
+ constructor(hostRef) {
22
+ registerInstance(this, hostRef);
23
+ }
24
+ disabled = false;
25
+ selected = false;
26
+ hasLeading = false;
27
+ hasMeta = false;
28
+ hasExcerpt = false;
29
+ hasTrailing = false;
30
+ leadingSlot;
31
+ metaSlot;
32
+ excerptSlot;
33
+ trailingSlot;
34
+ componentDidLoad() {
35
+ this.syncSlots();
36
+ }
37
+ syncSlots = () => {
38
+ this.hasLeading = slotHasContent(this.leadingSlot);
39
+ this.hasMeta = slotHasContent(this.metaSlot);
40
+ this.hasExcerpt = slotHasContent(this.excerptSlot);
41
+ this.hasTrailing = slotHasContent(this.trailingSlot);
42
+ };
43
+ render() {
44
+ return h(Host, { key: "abd055ed3b7a9140f024181377fd6c0e9b270578" }, h("button", { key: "af6758ec890a63d11e11180f3cccfd94112b9804", class: "search-result-row", type: "button", disabled: this.disabled, part: "button" }, h("span", { key: "e7321d522ac45566e836382d525463825c855afc", class: "search-result-row__leading", part: "leading", hidden: !this.hasLeading }, h("slot", { key: "90f578306f8b9c321128f705369531b64d54cca2", name: "leading", ref: (el) => this.leadingSlot = el, onSlotchange: this.syncSlots })), h("span", { key: "37a8ab0b4b19215d1a4c79d92646b18e010be8a0", class: "search-result-row__content", part: "content" }, h("span", { key: "1728598d9e9578cf6f04f13c1691e333b7d5ca25", class: "search-result-row__title", part: "title" }, h("slot", { key: "556b9da285b7e64298527870a970ef8c02e71988", name: "title" })), h("span", { key: "ed47e52ad83968ca763e01ae7d9d3d66d444145a", class: "search-result-row__meta", part: "meta", hidden: !this.hasMeta }, h("slot", { key: "c374d6328951530227892eec688edd60514e7e04", name: "meta", ref: (el) => this.metaSlot = el, onSlotchange: this.syncSlots })), h("span", { key: "17965c7934d9256ce243a1d3a3e880716fcd42e1", class: "search-result-row__excerpt", part: "excerpt", hidden: !this.hasExcerpt }, h("slot", { key: "67cad2d2ea2310944cdf5a7685a1f4e3f537e683", name: "excerpt", ref: (el) => this.excerptSlot = el, onSlotchange: this.syncSlots }))), h("span", { key: "43cb13c90187851fc30cc0c29847658f9f4cb069", class: "search-result-row__trailing", part: "trailing", hidden: !this.hasTrailing }, h("slot", { key: "2b262ad21cb605daea5e4ade8c377a60820a1f11", name: "trailing", ref: (el) => this.trailingSlot = el, onSlotchange: this.syncSlots }))));
45
+ }
46
+ };
47
+ UISearchResultRow.style = uiSearchResultRowCss();
48
+ export {
49
+ UISearchResultRow as ui_search_result_row
50
+ };
@@ -0,0 +1,41 @@
1
+ import {
2
+ h,
3
+ registerInstance
4
+ } from "./chunk-YK4MTZGJ.js";
5
+
6
+ // dist/esm/ui-search-shell.entry.js
7
+ var uiSearchShellCss = () => `:host{position:fixed;inset:0;z-index:var(--ui-search-shell-z-index, 400);display:block}.search-shell{position:absolute;inset:0;display:flex;align-items:flex-start;justify-content:center;padding-block-start:var(--ui-search-shell-padding-top, 10vh)}.search-shell__panel{position:relative;inline-size:min( calc(100% - (var(--ui-search-shell-margin-inline, var(--ui-space-4, 1rem)) * 2)), var(--ui-search-shell-max-width, 640px) );max-block-size:var(--ui-search-shell-max-height, 80vh);display:flex;flex-direction:column;overflow:hidden;background:var(--ui-search-shell-bg, var(--ui-surface, #ffffff));border:1px solid var(--ui-search-shell-border, var(--ui-border, #e5e7eb));border-radius:var(--ui-search-shell-radius, var(--ui-radius-xl, 1rem));box-shadow:var(--ui-search-shell-shadow, var(--ui-shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.12)))}.search-shell__search,.search-shell__status,.search-shell__footer{flex-shrink:0}.search-shell__body{flex:1;min-block-size:0}[hidden]{display:none}@media (max-width: 767px){.search-shell{padding-block-start:0;align-items:stretch}.search-shell__panel{inline-size:100%;max-block-size:100dvh;border-radius:0;border-inline:none;border-block-start:none}}`;
8
+ function slotHasContent(slot) {
9
+ if (!slot) {
10
+ return false;
11
+ }
12
+ return slot.assignedNodes({ flatten: true }).some((node) => {
13
+ if (node.nodeType === Node.TEXT_NODE) {
14
+ return Boolean(node.textContent?.trim());
15
+ }
16
+ return true;
17
+ });
18
+ }
19
+ var UISearchShell = class {
20
+ constructor(hostRef) {
21
+ registerInstance(this, hostRef);
22
+ }
23
+ hasStatus = false;
24
+ hasFooter = false;
25
+ statusSlot;
26
+ footerSlot;
27
+ componentDidLoad() {
28
+ this.syncSlots();
29
+ }
30
+ syncSlots = () => {
31
+ this.hasStatus = slotHasContent(this.statusSlot);
32
+ this.hasFooter = slotHasContent(this.footerSlot);
33
+ };
34
+ render() {
35
+ return h("div", { key: "3e8fb4f419a588c441abd5bd137093ba2f730b76", class: "search-shell", part: "base" }, h("slot", { key: "4772932f9e077b0e4f68c50657945f3ea30afb8d", name: "backdrop" }), h("div", { key: "c7877bb3ade588797d8419b3c7efc0680ac32b78", class: "search-shell__panel", part: "panel" }, h("div", { key: "d1e7c16a031896187550181be63a1ca14a04b127", class: "search-shell__search", part: "search" }, h("slot", { key: "b61475159d7e18a623246a2872d4897e1ff8388a", name: "search" })), h("div", { key: "877a9847bb453d026b5e6c117ffa8ad44562195a", class: "search-shell__status", part: "status", hidden: !this.hasStatus }, h("slot", { key: "6b46e668586fa97a30e2d02fc7d46d53483ecdb5", name: "status", ref: (el) => this.statusSlot = el, onSlotchange: this.syncSlots })), h("div", { key: "41622e5fe3b02d8c842a6d07b66119ac68f22bc0", class: "search-shell__body", part: "body" }, h("slot", { key: "f36dc433657d95bb7afa1191351bbbbeaed4f6ed", name: "body" })), h("div", { key: "bcbf35d5e37c0fe48b29dde935745ea792722646", class: "search-shell__footer", part: "footer", hidden: !this.hasFooter }, h("slot", { key: "02f99e3442476dbefc57b3a38dc5a4ad0f3e9f00", name: "footer", ref: (el) => this.footerSlot = el, onSlotchange: this.syncSlots }))));
36
+ }
37
+ };
38
+ UISearchShell.style = uiSearchShellCss();
39
+ export {
40
+ UISearchShell as ui_search_shell
41
+ };
@@ -0,0 +1,111 @@
1
+ import {
2
+ dispatchDetail,
3
+ eventToTrigger
4
+ } from "./chunk-UL7UIUJZ.js";
5
+ import {
6
+ Host,
7
+ getElement,
8
+ h,
9
+ registerInstance
10
+ } from "./chunk-YK4MTZGJ.js";
11
+
12
+ // dist/esm/ui-select.entry.js
13
+ var uiSelectCss = () => `:host{display:inline-flex;color:var(--ui-text-primary)}::slotted(select){width:100%;appearance:none;border:1px solid var(--ui-border-default);border-radius:var(--ui-radius-2);background-color:var(--ui-surface-default);color:inherit;font:inherit;line-height:var(--ui-line-height-md);padding-block:var(--ui-select-padding-block, var(--ui-space-2));padding-inline-start:var(--ui-select-padding-inline-start, var(--ui-space-3));padding-inline-end:var(--ui-select-padding-inline-end, calc(var(--ui-space-6) + var(--ui-space-3)));margin:0;background-image:linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);background-position:calc(100% - 1rem) calc(50% - 2px), calc(100% - 0.7rem) calc(50% - 2px);background-size:0.35rem 0.35rem, 0.35rem 0.35rem;background-repeat:no-repeat;transition:border-color var(--ui-motion-fast) var(--ui-motion-ease), box-shadow var(--ui-motion-fast) var(--ui-motion-ease), background-color var(--ui-motion-fast) var(--ui-motion-ease)}::slotted(select:hover:not(:focus):not(:disabled)){border-color:var(--ui-border-strong)}::slotted(select:focus){border-color:var(--ui-focus-ring);box-shadow:0 0 0 3px var(--ui-accent-soft)}:host([data-invalid='true'])::slotted(select),::slotted(select[aria-invalid='true']){border-color:var(--ui-accent-active)}::slotted(select:disabled){background-color:var(--ui-surface-muted);color:var(--ui-text-muted);cursor:not-allowed}::slotted(select:focus-visible){outline:2px solid var(--ui-focus-ring);outline-offset:2px}::slotted(select[multiple]),::slotted(select[size]:not([size='1'])){background-image:none;padding-inline-end:var(--ui-select-padding-inline-start, var(--ui-space-3))}`;
14
+ var UISelect = class {
15
+ constructor(hostRef) {
16
+ registerInstance(this, hostRef);
17
+ }
18
+ get host() {
19
+ return getElement(this);
20
+ }
21
+ value = "";
22
+ defaultValue = "";
23
+ disabled = false;
24
+ invalid = false;
25
+ required = false;
26
+ internalValue = "";
27
+ slotRef;
28
+ syncFromProp() {
29
+ this.internalValue = this.value;
30
+ }
31
+ syncToSelect() {
32
+ const select = this.getSelect();
33
+ if (!select)
34
+ return;
35
+ this.host.dataset.invalid = this.invalid ? "true" : "";
36
+ select.value = this.internalValue || this.defaultValue;
37
+ select.disabled = this.disabled;
38
+ select.required = this.required;
39
+ select.setAttribute("aria-invalid", this.invalid ? "true" : "false");
40
+ }
41
+ componentDidLoad() {
42
+ this.syncFromProp();
43
+ this.slotRef?.addEventListener("slotchange", () => this.syncToSelect());
44
+ this.syncToSelect();
45
+ const select = this.getSelect();
46
+ select?.addEventListener("input", this.onInput);
47
+ select?.addEventListener("change", this.onChange);
48
+ }
49
+ disconnectedCallback() {
50
+ const select = this.getSelect();
51
+ select?.removeEventListener("input", this.onInput);
52
+ select?.removeEventListener("change", this.onChange);
53
+ }
54
+ componentDidUpdate() {
55
+ this.syncToSelect();
56
+ }
57
+ getSelect() {
58
+ const slot = this.host.shadowRoot?.querySelector("slot");
59
+ const nodes = slot?.assignedElements() ?? Array.from(this.host.children);
60
+ return nodes.find((el) => el.tagName === "SELECT") ?? null;
61
+ }
62
+ onInput = (e) => {
63
+ const select = e.target;
64
+ if (!select)
65
+ return;
66
+ this.internalValue = select.value;
67
+ dispatchDetail(this.host, "input", {
68
+ value: this.internalValue,
69
+ trigger: eventToTrigger(e)
70
+ });
71
+ };
72
+ onChange = (e) => {
73
+ const select = this.getSelect();
74
+ if (!select)
75
+ return;
76
+ this.internalValue = select.value;
77
+ dispatchDetail(this.host, "change", {
78
+ value: this.internalValue,
79
+ trigger: eventToTrigger(e)
80
+ });
81
+ };
82
+ render() {
83
+ return h(Host, { key: "eebea3f7fafafba901e5bd33cbd711565feb251e", "data-invalid": this.invalid ? "" : void 0 }, h("slot", { key: "bbb49202d8298fac0912accb3848c8450cab00c9", ref: (el) => this.slotRef = el }));
84
+ }
85
+ static get watchers() {
86
+ return {
87
+ "value": [{
88
+ "syncFromProp": 0
89
+ }],
90
+ "internalValue": [{
91
+ "syncToSelect": 0
92
+ }],
93
+ "defaultValue": [{
94
+ "syncToSelect": 0
95
+ }],
96
+ "disabled": [{
97
+ "syncToSelect": 0
98
+ }],
99
+ "invalid": [{
100
+ "syncToSelect": 0
101
+ }],
102
+ "required": [{
103
+ "syncToSelect": 0
104
+ }]
105
+ };
106
+ }
107
+ };
108
+ UISelect.style = uiSelectCss();
109
+ export {
110
+ UISelect as ui_select
111
+ };
@@ -0,0 +1,75 @@
1
+ import {
2
+ dispatchDetail
3
+ } from "./chunk-UL7UIUJZ.js";
4
+ import {
5
+ Host,
6
+ getElement,
7
+ h,
8
+ registerInstance
9
+ } from "./chunk-YK4MTZGJ.js";
10
+
11
+ // dist/esm/ui-switch.entry.js
12
+ var uiSwitchCss = () => `:host{display:inline-flex;align-items:center;gap:var(--ui-space-2);color:var(--ui-text-primary)}:host([aria-disabled='true']),:host([data-disabled='true']){opacity:0.6;cursor:not-allowed}:host([role='switch']){cursor:pointer}:host input[type='checkbox']{appearance:none;-webkit-appearance:none;display:block;position:relative;width:2.25rem;height:1.25rem;padding:0;border:1px solid var(--ui-border-default);border-radius:999px;background:var(--ui-surface-muted);cursor:pointer;transition:background-color var(--ui-motion-fast) var(--ui-motion-ease), border-color var(--ui-motion-fast) var(--ui-motion-ease);margin:0}:host input[type='checkbox']::after{content:'';position:absolute;top:2px;left:2px;width:0.875rem;height:0.875rem;border-radius:999px;background:var(--ui-surface-default);border:1px solid var(--ui-border-default);transition:transform var(--ui-motion-fast) var(--ui-motion-ease)}:host input[type='checkbox']:checked{background:var(--ui-accent-solid);border-color:var(--ui-accent-solid)}:host input[type='checkbox']:checked::after{transform:translateX(calc(2.25rem - 0.875rem - 4px));background:var(--ui-text-on-accent);border-color:var(--ui-text-on-accent)}:host input[type='checkbox']:focus-visible{outline:2px solid var(--ui-accent-solid);outline-offset:2px}`;
13
+ var UISwitch = class {
14
+ constructor(hostRef) {
15
+ registerInstance(this, hostRef);
16
+ }
17
+ get host() {
18
+ return getElement(this);
19
+ }
20
+ checked = false;
21
+ defaultChecked = false;
22
+ disabled = false;
23
+ required = false;
24
+ value = "on";
25
+ internalChecked = false;
26
+ syncFromProp() {
27
+ this.internalChecked = this.checked;
28
+ }
29
+ componentDidLoad() {
30
+ this.syncFromProp();
31
+ this.internalChecked = this.internalChecked || this.defaultChecked;
32
+ }
33
+ toggle = (trigger) => {
34
+ if (this.disabled)
35
+ return;
36
+ this.internalChecked = !this.internalChecked;
37
+ dispatchDetail(this.host, "change", {
38
+ checked: this.internalChecked,
39
+ value: this.value,
40
+ trigger
41
+ });
42
+ };
43
+ onKeydown = (e) => {
44
+ if (e.key !== " " || this.disabled)
45
+ return;
46
+ e.preventDefault();
47
+ this.toggle("keyboard");
48
+ };
49
+ onClick = (e) => {
50
+ if (e.target === this.host?.shadowRoot?.querySelector("input"))
51
+ return;
52
+ this.toggle("pointer");
53
+ };
54
+ render() {
55
+ return h(Host, { key: "d4e39c8865afa98414dbedcbbff5bdeeef7f4478", role: "switch", "aria-checked": String(this.internalChecked), "aria-disabled": String(this.disabled), "data-disabled": this.disabled ? "" : void 0, tabIndex: this.disabled ? -1 : 0, onKeyDown: this.onKeydown, onClick: this.onClick }, h("input", { key: "498774428224b9d09a8657924d4d8b6a2196fddf", type: "checkbox", checked: this.internalChecked, disabled: this.disabled, required: this.required, value: this.value, "aria-hidden": "true", tabIndex: -1, onChange: (e) => {
56
+ this.internalChecked = e.target.checked;
57
+ dispatchDetail(this.host, "change", {
58
+ checked: this.internalChecked,
59
+ value: this.value,
60
+ trigger: "pointer"
61
+ });
62
+ } }), h("slot", { key: "b8f8c3947a9dd058e12270b9afdfe2a654164987" }));
63
+ }
64
+ static get watchers() {
65
+ return {
66
+ "checked": [{
67
+ "syncFromProp": 0
68
+ }]
69
+ };
70
+ }
71
+ };
72
+ UISwitch.style = uiSwitchCss();
73
+ export {
74
+ UISwitch as ui_switch
75
+ };
@@ -0,0 +1,124 @@
1
+ import {
2
+ dispatchDetail,
3
+ eventToTrigger
4
+ } from "./chunk-UL7UIUJZ.js";
5
+ import {
6
+ Host,
7
+ getElement,
8
+ h,
9
+ registerInstance
10
+ } from "./chunk-YK4MTZGJ.js";
11
+
12
+ // dist/esm/ui-tabs.entry.js
13
+ var uiTabsCss = () => `:host{display:flex;flex-direction:column;gap:0}:host([data-orientation='vertical']){flex-direction:row}::slotted([role='tablist']){display:flex;gap:0;border-bottom:1px solid var(--ui-border-default)}:host([data-orientation='vertical']) ::slotted([role='tablist']){flex-direction:column;border-bottom:none;border-inline-end:1px solid var(--ui-border-default)}::slotted(button[role='tab']),::slotted([role='tab']),::slotted(ui-button) button[role='tab']{padding:var(--ui-space-2) var(--ui-space-3);font-size:var(--ui-font-size-sm);font-weight:var(--ui-font-medium, 500);color:var(--ui-text-secondary);background:none;border:none;border-bottom:2px solid transparent;margin-bottom:-1px;cursor:pointer;transition:color var(--ui-motion-fast) var(--ui-motion-ease);box-shadow:none}::slotted(button[role='tab']:hover),::slotted([role='tab']:hover){color:var(--ui-text-primary)}::slotted(button[role='tab'][aria-selected='true']),::slotted([role='tab'][aria-selected='true']){color:var(--ui-accent-solid);border-bottom-color:var(--ui-accent-solid)}:host([data-orientation='vertical']) ::slotted(button[role='tab']),:host([data-orientation='vertical']) ::slotted([role='tab']){border-bottom:none;border-inline-end:2px solid transparent;margin-bottom:0;margin-inline-end:-1px}:host([data-orientation='vertical']) ::slotted(button[role='tab'][aria-selected='true']),:host([data-orientation='vertical']) ::slotted([role='tab'][aria-selected='true']){border-inline-end-color:var(--ui-accent-solid)}::slotted([role='tabpanel']){padding:var(--ui-space-4)}`;
14
+ var UITabs = class {
15
+ constructor(hostRef) {
16
+ registerInstance(this, hostRef);
17
+ }
18
+ get host() {
19
+ return getElement(this);
20
+ }
21
+ value = "";
22
+ defaultValue = "";
23
+ orientation = "horizontal";
24
+ internalValue = "";
25
+ syncFromProp() {
26
+ this.internalValue = this.value;
27
+ }
28
+ syncState() {
29
+ const tabs = this.getTabs();
30
+ if (tabs.length === 0)
31
+ return;
32
+ tabs.forEach((tab) => {
33
+ const tabId = tab.id ?? tab.getAttribute("aria-controls") ?? "";
34
+ const isSelected = tabId === this.internalValue;
35
+ tab.setAttribute("aria-selected", String(isSelected));
36
+ tab.tabIndex = isSelected ? 0 : -1;
37
+ const controlsId = tab.getAttribute("aria-controls");
38
+ if (controlsId) {
39
+ const panel = this.host.querySelector(`#${CSS.escape(controlsId)}`) ?? document.getElementById(controlsId);
40
+ if (panel) {
41
+ panel.hidden = !isSelected;
42
+ }
43
+ }
44
+ });
45
+ }
46
+ componentDidLoad() {
47
+ this.syncFromProp();
48
+ if (!this.internalValue && this.defaultValue) {
49
+ this.internalValue = this.defaultValue;
50
+ }
51
+ if (!this.internalValue) {
52
+ const tabs = this.getTabs();
53
+ if (tabs.length > 0) {
54
+ this.internalValue = tabs[0]?.id ?? tabs[0]?.getAttribute("aria-controls") ?? "";
55
+ }
56
+ }
57
+ this.syncState();
58
+ this.host.addEventListener("keydown", this.onKeydown);
59
+ this.host.addEventListener("click", this.onClick);
60
+ }
61
+ disconnectedCallback() {
62
+ this.host.removeEventListener("keydown", this.onKeydown);
63
+ this.host.removeEventListener("click", this.onClick);
64
+ }
65
+ componentDidUpdate() {
66
+ this.syncState();
67
+ }
68
+ getTabs() {
69
+ return Array.from(this.host.querySelectorAll('[role="tab"]'));
70
+ }
71
+ setValueFromTab(tab, trigger) {
72
+ const newValue = tab.id ?? tab.getAttribute("aria-controls") ?? "";
73
+ if (!newValue)
74
+ return;
75
+ const prev = this.internalValue;
76
+ this.internalValue = newValue;
77
+ this.syncState();
78
+ dispatchDetail(this.host, "select", { value: newValue, previousValue: prev || void 0, trigger });
79
+ }
80
+ onClick = (e) => {
81
+ const tab = e.target.closest?.('[role="tab"]');
82
+ if (!tab || !this.host.contains(tab))
83
+ return;
84
+ this.setValueFromTab(tab, eventToTrigger(e));
85
+ };
86
+ onKeydown = (e) => {
87
+ const tab = e.target.closest?.('[role="tab"]');
88
+ if (!tab || !this.host.contains(tab))
89
+ return;
90
+ const tabs = this.getTabs();
91
+ if (tabs.length === 0)
92
+ return;
93
+ const currentIndex = tabs.indexOf(tab);
94
+ const isVertical = this.orientation === "vertical";
95
+ const prevKey = isVertical ? "ArrowUp" : "ArrowLeft";
96
+ const nextKey = isVertical ? "ArrowDown" : "ArrowRight";
97
+ if (e.key === nextKey || e.key === prevKey) {
98
+ e.preventDefault();
99
+ const nextIndex = e.key === nextKey ? Math.min(currentIndex + 1, tabs.length - 1) : currentIndex <= 0 ? tabs.length - 1 : currentIndex - 1;
100
+ this.setValueFromTab(tabs[nextIndex], "keyboard");
101
+ tabs[nextIndex].focus();
102
+ }
103
+ };
104
+ render() {
105
+ return h(Host, { key: "d73e97facf3ffa020f349642bc6c0136f39fc463", orientation: this.orientation, "data-orientation": this.orientation }, h("slot", { key: "a7bd47a4b48780ddf1f21a917fd1cb747376640b" }));
106
+ }
107
+ static get watchers() {
108
+ return {
109
+ "value": [{
110
+ "syncFromProp": 0
111
+ }],
112
+ "internalValue": [{
113
+ "syncState": 0
114
+ }],
115
+ "orientation": [{
116
+ "syncState": 0
117
+ }]
118
+ };
119
+ }
120
+ };
121
+ UITabs.style = uiTabsCss();
122
+ export {
123
+ UITabs as ui_tabs
124
+ };