@threadlabs/looma 0.13.1 → 0.13.3

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 (343) hide show
  1. package/components/ui-affordance-scope/ui-affordance-scope.html +9 -0
  2. package/components/ui-button/ui-button.html +18 -14
  3. package/components/ui-card/ui-card.html +8 -1
  4. package/components/ui-combobox/ui-combobox.html +1 -1
  5. package/components/ui-editor-table-overlay/ui-editor-table-overlay.html +2 -2
  6. package/components/ui-icon-button/ui-icon-button.html +1 -1
  7. package/components/ui-nav-item/ui-nav-item.html +28 -18
  8. package/components/ui-sidebar/ui-sidebar.html +1 -1
  9. package/components/ui-text/ui-text.html +11 -1
  10. package/dist/index.js +1 -1
  11. package/package.json +2 -2
  12. package/styles/ui-action-bar.css +1 -1
  13. package/styles/ui-affordance-scope.css +10 -2
  14. package/styles/ui-avatar-group.css +1 -1
  15. package/styles/ui-avatar.css +1 -1
  16. package/styles/ui-badge.css +1 -1
  17. package/styles/ui-breadcrumb-item.css +1 -1
  18. package/styles/ui-breadcrumbs.css +1 -1
  19. package/styles/ui-button.css +1 -1
  20. package/styles/ui-callout.css +1 -1
  21. package/styles/ui-card.css +1 -1
  22. package/styles/ui-checkbox.css +1 -1
  23. package/styles/ui-cluster.css +1 -1
  24. package/styles/ui-combobox.css +1 -1
  25. package/styles/ui-container.css +1 -1
  26. package/styles/ui-context-menu.css +1 -1
  27. package/styles/ui-cover.css +1 -1
  28. package/styles/ui-description-item.css +1 -1
  29. package/styles/ui-description-list.css +1 -1
  30. package/styles/ui-dialog.css +1 -1
  31. package/styles/ui-disclosure.css +1 -1
  32. package/styles/ui-editable.css +1 -1
  33. package/styles/ui-editor-insert-table-grid.css +1 -1
  34. package/styles/ui-editor-mention-menu.css +1 -1
  35. package/styles/ui-editor-slash-menu.css +1 -1
  36. package/styles/ui-editor-table-context-menu.css +1 -1
  37. package/styles/ui-editor-table-overlay.css +3 -3
  38. package/styles/ui-editor-table-toolbar.css +1 -1
  39. package/styles/ui-editor-toolbar.css +1 -1
  40. package/styles/ui-floating-action-button.css +1 -1
  41. package/styles/ui-form-field.css +1 -1
  42. package/styles/ui-grid.css +1 -1
  43. package/styles/ui-icon-button.css +2 -2
  44. package/styles/ui-icon.css +1 -1
  45. package/styles/ui-input-group.css +1 -1
  46. package/styles/ui-input.css +1 -1
  47. package/styles/ui-list-item.css +1 -1
  48. package/styles/ui-list.css +1 -1
  49. package/styles/ui-menu-item.css +1 -1
  50. package/styles/ui-menu.css +1 -1
  51. package/styles/ui-nav-item.css +1 -1
  52. package/styles/ui-page-header.css +1 -1
  53. package/styles/ui-popover.css +1 -1
  54. package/styles/ui-radio-group.css +1 -1
  55. package/styles/ui-radio.css +1 -1
  56. package/styles/ui-reel.css +1 -1
  57. package/styles/ui-scroll-area.css +1 -1
  58. package/styles/ui-search-result-row.css +1 -1
  59. package/styles/ui-search-shell.css +1 -1
  60. package/styles/ui-section.css +1 -1
  61. package/styles/ui-select.css +1 -1
  62. package/styles/ui-separator.css +1 -1
  63. package/styles/ui-sidebar.css +2 -2
  64. package/styles/ui-spinner.css +1 -1
  65. package/styles/ui-stack.css +1 -1
  66. package/styles/ui-status-message.css +1 -1
  67. package/styles/ui-switch.css +1 -1
  68. package/styles/ui-switcher.css +1 -1
  69. package/styles/ui-tabs.css +1 -1
  70. package/styles/ui-text.css +1 -1
  71. package/styles/ui-textarea.css +1 -1
  72. package/styles/ui-toast-region.css +1 -1
  73. package/styles/ui-tooltip.css +1 -1
  74. package/styles/ui-top-bar.css +1 -1
  75. package/styles/ui-tree-item.css +1 -1
  76. package/styles/ui-tree.css +1 -1
  77. package/vanilla/UiActionBar.d.ts +1 -1
  78. package/vanilla/UiActionBar.js +2 -2
  79. package/vanilla/UiAffordanceScope.d.ts +2 -1
  80. package/vanilla/UiAffordanceScope.js +3 -3
  81. package/vanilla/UiAvatar.d.ts +1 -1
  82. package/vanilla/UiAvatar.js +2 -2
  83. package/vanilla/UiAvatarGroup.d.ts +1 -1
  84. package/vanilla/UiAvatarGroup.js +2 -2
  85. package/vanilla/UiBadge.d.ts +1 -1
  86. package/vanilla/UiBadge.js +2 -2
  87. package/vanilla/UiBreadcrumbItem.d.ts +1 -1
  88. package/vanilla/UiBreadcrumbItem.js +2 -2
  89. package/vanilla/UiBreadcrumbs.d.ts +1 -1
  90. package/vanilla/UiBreadcrumbs.js +2 -2
  91. package/vanilla/UiButton.d.ts +3 -3
  92. package/vanilla/UiButton.js +46 -21
  93. package/vanilla/UiCallout.d.ts +1 -1
  94. package/vanilla/UiCallout.js +2 -2
  95. package/vanilla/UiCard.d.ts +3 -3
  96. package/vanilla/UiCard.js +67 -22
  97. package/vanilla/UiCheckbox.d.ts +1 -1
  98. package/vanilla/UiCheckbox.js +2 -2
  99. package/vanilla/UiCluster.d.ts +1 -1
  100. package/vanilla/UiCluster.js +2 -2
  101. package/vanilla/UiCombobox.d.ts +1 -1
  102. package/vanilla/UiCombobox.js +3 -3
  103. package/vanilla/UiContainer.d.ts +1 -1
  104. package/vanilla/UiContainer.js +2 -2
  105. package/vanilla/UiContextMenu.d.ts +1 -1
  106. package/vanilla/UiContextMenu.js +2 -2
  107. package/vanilla/UiCover.d.ts +1 -1
  108. package/vanilla/UiCover.js +2 -2
  109. package/vanilla/UiDescriptionItem.d.ts +1 -1
  110. package/vanilla/UiDescriptionItem.js +2 -2
  111. package/vanilla/UiDescriptionList.d.ts +1 -1
  112. package/vanilla/UiDescriptionList.js +2 -2
  113. package/vanilla/UiDialog.d.ts +1 -1
  114. package/vanilla/UiDialog.js +2 -2
  115. package/vanilla/UiDisclosure.d.ts +1 -1
  116. package/vanilla/UiDisclosure.js +2 -2
  117. package/vanilla/UiEditable.d.ts +1 -1
  118. package/vanilla/UiEditable.js +2 -2
  119. package/vanilla/UiEditorInsertTableGrid.d.ts +1 -1
  120. package/vanilla/UiEditorInsertTableGrid.js +2 -2
  121. package/vanilla/UiEditorMentionMenu.d.ts +1 -1
  122. package/vanilla/UiEditorMentionMenu.js +2 -2
  123. package/vanilla/UiEditorSlashMenu.d.ts +1 -1
  124. package/vanilla/UiEditorSlashMenu.js +2 -2
  125. package/vanilla/UiEditorTableContextMenu.d.ts +1 -1
  126. package/vanilla/UiEditorTableContextMenu.js +2 -2
  127. package/vanilla/UiEditorTableOverlay.d.ts +1 -1
  128. package/vanilla/UiEditorTableOverlay.js +2 -2
  129. package/vanilla/UiEditorTableToolbar.d.ts +1 -1
  130. package/vanilla/UiEditorTableToolbar.js +2 -2
  131. package/vanilla/UiEditorToolbar.d.ts +1 -1
  132. package/vanilla/UiEditorToolbar.js +2 -2
  133. package/vanilla/UiFloatingActionButton.d.ts +1 -1
  134. package/vanilla/UiFloatingActionButton.js +2 -2
  135. package/vanilla/UiFormField.d.ts +1 -1
  136. package/vanilla/UiFormField.js +2 -2
  137. package/vanilla/UiGrid.d.ts +1 -1
  138. package/vanilla/UiGrid.js +2 -2
  139. package/vanilla/UiIcon.d.ts +1 -1
  140. package/vanilla/UiIcon.js +2 -2
  141. package/vanilla/UiIconButton.d.ts +1 -1
  142. package/vanilla/UiIconButton.js +2 -2
  143. package/vanilla/UiInput.d.ts +1 -1
  144. package/vanilla/UiInput.js +2 -2
  145. package/vanilla/UiInputGroup.d.ts +1 -1
  146. package/vanilla/UiInputGroup.js +2 -2
  147. package/vanilla/UiList.d.ts +1 -1
  148. package/vanilla/UiList.js +2 -2
  149. package/vanilla/UiListItem.d.ts +1 -1
  150. package/vanilla/UiListItem.js +2 -2
  151. package/vanilla/UiMenu.d.ts +1 -1
  152. package/vanilla/UiMenu.js +2 -2
  153. package/vanilla/UiMenuItem.d.ts +1 -1
  154. package/vanilla/UiMenuItem.js +2 -2
  155. package/vanilla/UiNavItem.d.ts +3 -3
  156. package/vanilla/UiNavItem.js +106 -54
  157. package/vanilla/UiPageHeader.d.ts +1 -1
  158. package/vanilla/UiPageHeader.js +2 -2
  159. package/vanilla/UiPopover.d.ts +1 -1
  160. package/vanilla/UiPopover.js +2 -2
  161. package/vanilla/UiRadio.d.ts +1 -1
  162. package/vanilla/UiRadio.js +2 -2
  163. package/vanilla/UiRadioGroup.d.ts +1 -1
  164. package/vanilla/UiRadioGroup.js +2 -2
  165. package/vanilla/UiReel.d.ts +1 -1
  166. package/vanilla/UiReel.js +2 -2
  167. package/vanilla/UiScrollArea.d.ts +1 -1
  168. package/vanilla/UiScrollArea.js +2 -2
  169. package/vanilla/UiSearchResultRow.d.ts +1 -1
  170. package/vanilla/UiSearchResultRow.js +2 -2
  171. package/vanilla/UiSearchShell.d.ts +1 -1
  172. package/vanilla/UiSearchShell.js +2 -2
  173. package/vanilla/UiSection.d.ts +1 -1
  174. package/vanilla/UiSection.js +2 -2
  175. package/vanilla/UiSelect.d.ts +1 -1
  176. package/vanilla/UiSelect.js +2 -2
  177. package/vanilla/UiSeparator.d.ts +1 -1
  178. package/vanilla/UiSeparator.js +2 -2
  179. package/vanilla/UiSidebar.d.ts +1 -1
  180. package/vanilla/UiSidebar.js +2 -2
  181. package/vanilla/UiSpinner.d.ts +1 -1
  182. package/vanilla/UiSpinner.js +2 -2
  183. package/vanilla/UiStack.d.ts +1 -1
  184. package/vanilla/UiStack.js +2 -2
  185. package/vanilla/UiStatusMessage.d.ts +1 -1
  186. package/vanilla/UiStatusMessage.js +2 -2
  187. package/vanilla/UiSwitch.d.ts +1 -1
  188. package/vanilla/UiSwitch.js +2 -2
  189. package/vanilla/UiSwitcher.d.ts +1 -1
  190. package/vanilla/UiSwitcher.js +2 -2
  191. package/vanilla/UiTabs.d.ts +1 -1
  192. package/vanilla/UiTabs.js +2 -2
  193. package/vanilla/UiText.d.ts +3 -3
  194. package/vanilla/UiText.js +97 -28
  195. package/vanilla/UiTextarea.d.ts +1 -1
  196. package/vanilla/UiTextarea.js +2 -2
  197. package/vanilla/UiToastRegion.d.ts +1 -1
  198. package/vanilla/UiToastRegion.js +2 -2
  199. package/vanilla/UiTooltip.d.ts +1 -1
  200. package/vanilla/UiTooltip.js +2 -2
  201. package/vanilla/UiTopBar.d.ts +1 -1
  202. package/vanilla/UiTopBar.js +2 -2
  203. package/vanilla/UiTree.d.ts +1 -1
  204. package/vanilla/UiTree.js +2 -2
  205. package/vanilla/UiTreeItem.d.ts +1 -1
  206. package/vanilla/UiTreeItem.js +2 -2
  207. package/vue/UiActionBar.vue +1 -1
  208. package/vue/UiAffordanceScope.d.ts +2 -0
  209. package/vue/UiAffordanceScope.vue +10 -1
  210. package/vue/UiAvatar.vue +1 -1
  211. package/vue/UiAvatarGroup.vue +1 -1
  212. package/vue/UiBadge.vue +1 -1
  213. package/vue/UiBreadcrumbItem.vue +1 -1
  214. package/vue/UiBreadcrumbs.vue +1 -1
  215. package/vue/UiButton.d.ts +6 -4
  216. package/vue/UiButton.vue +14 -8
  217. package/vue/UiCallout.vue +1 -1
  218. package/vue/UiCard.d.ts +8 -2
  219. package/vue/UiCard.vue +27 -4
  220. package/vue/UiCheckbox.vue +1 -1
  221. package/vue/UiCluster.vue +1 -1
  222. package/vue/UiCombobox.vue +2 -2
  223. package/vue/UiContainer.vue +1 -1
  224. package/vue/UiContextMenu.vue +1 -1
  225. package/vue/UiCover.vue +1 -1
  226. package/vue/UiDescriptionItem.vue +1 -1
  227. package/vue/UiDescriptionList.vue +1 -1
  228. package/vue/UiDialog.vue +1 -1
  229. package/vue/UiDisclosure.vue +1 -1
  230. package/vue/UiEditable.vue +1 -1
  231. package/vue/UiEditorInsertTableGrid.vue +1 -1
  232. package/vue/UiEditorMentionMenu.vue +1 -1
  233. package/vue/UiEditorSlashMenu.vue +1 -1
  234. package/vue/UiEditorTableContextMenu.vue +1 -1
  235. package/vue/UiEditorTableOverlay.vue +3 -3
  236. package/vue/UiEditorTableToolbar.vue +1 -1
  237. package/vue/UiEditorToolbar.vue +1 -1
  238. package/vue/UiFloatingActionButton.vue +1 -1
  239. package/vue/UiFormField.vue +1 -1
  240. package/vue/UiGrid.vue +1 -1
  241. package/vue/UiIcon.vue +1 -1
  242. package/vue/UiIconButton.vue +2 -2
  243. package/vue/UiInput.vue +1 -1
  244. package/vue/UiInputGroup.vue +1 -1
  245. package/vue/UiList.vue +1 -1
  246. package/vue/UiListItem.vue +1 -1
  247. package/vue/UiMenu.vue +1 -1
  248. package/vue/UiMenuItem.vue +1 -1
  249. package/vue/UiNavItem.d.ts +10 -4
  250. package/vue/UiNavItem.vue +22 -5
  251. package/vue/UiPageHeader.vue +1 -1
  252. package/vue/UiPopover.vue +1 -1
  253. package/vue/UiRadio.vue +1 -1
  254. package/vue/UiRadioGroup.vue +1 -1
  255. package/vue/UiReel.vue +1 -1
  256. package/vue/UiScrollArea.vue +1 -1
  257. package/vue/UiSearchResultRow.vue +1 -1
  258. package/vue/UiSearchShell.vue +1 -1
  259. package/vue/UiSection.vue +1 -1
  260. package/vue/UiSelect.vue +1 -1
  261. package/vue/UiSeparator.vue +1 -1
  262. package/vue/UiSidebar.vue +2 -2
  263. package/vue/UiSpinner.vue +1 -1
  264. package/vue/UiStack.vue +1 -1
  265. package/vue/UiStatusMessage.vue +1 -1
  266. package/vue/UiSwitch.vue +1 -1
  267. package/vue/UiSwitcher.vue +1 -1
  268. package/vue/UiTabs.vue +1 -1
  269. package/vue/UiText.d.ts +14 -4
  270. package/vue/UiText.vue +37 -6
  271. package/vue/UiTextarea.vue +1 -1
  272. package/vue/UiToastRegion.vue +1 -1
  273. package/vue/UiTooltip.vue +1 -1
  274. package/vue/UiTopBar.vue +1 -1
  275. package/vue/UiTree.vue +1 -1
  276. package/vue/UiTreeItem.vue +1 -1
  277. package/vue/chunks/UiActionBar.js +1 -1
  278. package/vue/chunks/UiAffordanceScope.js +6 -3
  279. package/vue/chunks/UiAvatar.js +1 -1
  280. package/vue/chunks/UiAvatarGroup.js +1 -1
  281. package/vue/chunks/UiBadge.js +1 -1
  282. package/vue/chunks/UiBreadcrumbItem.js +1 -1
  283. package/vue/chunks/UiBreadcrumbs.js +1 -1
  284. package/vue/chunks/UiButton.js +28 -24
  285. package/vue/chunks/UiCallout.js +1 -1
  286. package/vue/chunks/UiCard.js +20 -6
  287. package/vue/chunks/UiCheckbox.js +1 -1
  288. package/vue/chunks/UiCluster.js +1 -1
  289. package/vue/chunks/UiCombobox.js +2 -2
  290. package/vue/chunks/UiContainer.js +1 -1
  291. package/vue/chunks/UiContextMenu.js +1 -1
  292. package/vue/chunks/UiCover.js +1 -1
  293. package/vue/chunks/UiDescriptionItem.js +1 -1
  294. package/vue/chunks/UiDescriptionList.js +1 -1
  295. package/vue/chunks/UiDialog.js +1 -1
  296. package/vue/chunks/UiDisclosure.js +1 -1
  297. package/vue/chunks/UiEditable.js +1 -1
  298. package/vue/chunks/UiEditorInsertTableGrid.js +1 -1
  299. package/vue/chunks/UiEditorMentionMenu.js +1 -1
  300. package/vue/chunks/UiEditorSlashMenu.js +1 -1
  301. package/vue/chunks/UiEditorTableContextMenu.js +1 -1
  302. package/vue/chunks/UiEditorTableOverlay.js +1 -1
  303. package/vue/chunks/UiEditorTableToolbar.js +1 -1
  304. package/vue/chunks/UiEditorToolbar.js +1 -1
  305. package/vue/chunks/UiFloatingActionButton.js +1 -1
  306. package/vue/chunks/UiFormField.js +1 -1
  307. package/vue/chunks/UiGrid.js +1 -1
  308. package/vue/chunks/UiIcon.js +1 -1
  309. package/vue/chunks/UiIconButton.js +1 -1
  310. package/vue/chunks/UiInput.js +1 -1
  311. package/vue/chunks/UiInputGroup.js +1 -1
  312. package/vue/chunks/UiList.js +1 -1
  313. package/vue/chunks/UiListItem.js +1 -1
  314. package/vue/chunks/UiMenu.js +1 -1
  315. package/vue/chunks/UiMenuItem.js +1 -1
  316. package/vue/chunks/UiNavItem.js +58 -28
  317. package/vue/chunks/UiPageHeader.js +1 -1
  318. package/vue/chunks/UiPopover.js +1 -1
  319. package/vue/chunks/UiRadio.js +1 -1
  320. package/vue/chunks/UiRadioGroup.js +1 -1
  321. package/vue/chunks/UiReel.js +1 -1
  322. package/vue/chunks/UiScrollArea.js +1 -1
  323. package/vue/chunks/UiSearchResultRow.js +1 -1
  324. package/vue/chunks/UiSearchShell.js +1 -1
  325. package/vue/chunks/UiSection.js +1 -1
  326. package/vue/chunks/UiSelect.js +1 -1
  327. package/vue/chunks/UiSeparator.js +1 -1
  328. package/vue/chunks/UiSidebar.js +1 -1
  329. package/vue/chunks/UiSpinner.js +1 -1
  330. package/vue/chunks/UiStack.js +1 -1
  331. package/vue/chunks/UiStatusMessage.js +1 -1
  332. package/vue/chunks/UiSwitch.js +1 -1
  333. package/vue/chunks/UiSwitcher.js +1 -1
  334. package/vue/chunks/UiTabs.js +1 -1
  335. package/vue/chunks/UiText.js +29 -7
  336. package/vue/chunks/UiTextarea.js +1 -1
  337. package/vue/chunks/UiToastRegion.js +1 -1
  338. package/vue/chunks/UiTooltip.js +1 -1
  339. package/vue/chunks/UiTopBar.js +1 -1
  340. package/vue/chunks/UiTree.js +1 -1
  341. package/vue/chunks/UiTreeItem.js +1 -1
  342. package/vue/components.css +918 -912
  343. package/vue/host.ts +1 -1
@@ -1,4 +1,4 @@
1
- // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
1
+ // Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
2
2
  import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
3
3
  import * as controller from "../components/ui-avatar/ui-avatar.js";
4
4
  import "../styles/ui-avatar.css";
@@ -6,7 +6,7 @@ import "../styles/ui-avatar.css";
6
6
  const definition = {...{"contract":{"tag":"ui-avatar","props":{"active":{"type":"boolean","required":false,"target":{"attribute":"active"},"default":false},"alt":{"type":"string","required":false,"target":{"attribute":"alt"},"default":""},"fallback":{"type":"string","required":false,"target":{"attribute":"fallback"},"default":""},"name":{"type":"string","required":false,"target":{"attribute":"name"},"default":""},"size":{"type":{"enum":["sm","md"]},"required":false,"target":{"attribute":"size"},"default":"md"},"src":{"type":"string","required":false,"target":{"attribute":"src"}}}},"template":{"kind":"element","name":"span","attributes":[],"children":[{"kind":"slot"},{"kind":"element","name":"img","attributes":[{"kind":"literal","name":"class","value":"image"},{"kind":"attribute","name":"src","expression":"src","expressionPlan":{"source":"src","ast":{"kind":"id","name":"src"},"dependencies":["src"]}},{"kind":"literal","name":"alt","value":""},{"kind":"literal","name":"aria-hidden","value":"true"},{"kind":"attribute","name":"hidden","expression":"hasAuthoredImage or not hasImage","expressionPlan":{"source":"hasAuthoredImage or not hasImage","ast":{"kind":"binary","op":"or","left":{"kind":"id","name":"hasAuthoredImage"},"right":{"kind":"unary","op":"not","operand":{"kind":"id","name":"hasImage"}}},"dependencies":["hasAuthoredImage","hasImage"]}}],"children":[],"ref":"image"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"fallback"},{"kind":"attribute","name":"aria-hidden","expression":"hasImage","expressionPlan":{"source":"hasImage","ast":{"kind":"id","name":"hasImage"},"dependencies":["hasImage"]}},{"kind":"attribute","name":"hidden","expression":"hasImage","expressionPlan":{"source":"hasImage","ast":{"kind":"id","name":"hasImage"},"dependencies":["hasImage"]}},{"kind":"directive","name":"value","expression":"initials","expressionPlan":{"source":"initials","ast":{"kind":"id","name":"initials"},"dependencies":["initials"]}}],"children":[]}]},"declarations":[{"kind":"state","name":"hasImage","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"state","name":"hasAuthoredImage","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"state","name":"initials","expression":{"source":"'?'","ast":{"kind":"literal","value":"?"},"dependencies":[]}}],"root":{"kind":"native","element":"span","choices":["span"]}},source:{file:import.meta.url},css:""};
7
7
 
8
8
  export function createUiAvatar(options = {}) {
9
- const { attributes = {}, children = [], slots = {}, as, ...componentProps } = options;
9
+ const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
10
10
  const projected = [];
11
11
  const element = document.createElement("span");
12
12
  for (const [name, value] of Object.entries(attributes)) {
@@ -1,4 +1,4 @@
1
- // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
1
+ // Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
2
2
  export interface UiAvatarGroupEventMap {
3
3
  }
4
4
  export interface UiAvatarGroupElement extends HTMLDivElement {
@@ -1,4 +1,4 @@
1
- // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
1
+ // Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
2
2
  import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
3
3
  import * as controller from "../components/ui-avatar-group/ui-avatar-group.js";
4
4
  import "../styles/ui-avatar-group.css";
@@ -6,7 +6,7 @@ import "../styles/ui-avatar-group.css";
6
6
  const definition = {...{"contract":{"tag":"ui-avatar-group","props":{"label":{"type":"string","required":false,"target":{"attribute":"aria-label"},"default":"People"},"max":{"type":"number","required":false,"target":{"attribute":"max"},"default":5},"size":{"type":{"enum":["sm","md"]},"required":false,"target":{"attribute":"size"},"default":"md"}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"role","value":"group"},{"kind":"attribute","name":"aria-label","expression":"label","expressionPlan":{"source":"label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}}],"children":[{"kind":"slot"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"overflow"},{"kind":"literal","name":"role","value":"img"},{"kind":"attribute","name":"hidden","expression":"not overflowCount","expressionPlan":{"source":"not overflowCount","ast":{"kind":"unary","op":"not","operand":{"kind":"id","name":"overflowCount"}},"dependencies":["overflowCount"]}},{"kind":"attribute","name":"aria-label","expression":"format('%s more', overflowCount)","expressionPlan":{"source":"format('%s more', overflowCount)","ast":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"%s more"},{"kind":"id","name":"overflowCount"}]},"dependencies":["overflowCount"]}}],"children":[{"kind":"element","name":"template","attributes":[{"kind":"directive","name":"value","expression":"format('+%s', overflowCount)","expressionPlan":{"source":"format('+%s', overflowCount)","ast":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"+%s"},{"kind":"id","name":"overflowCount"}]},"dependencies":["overflowCount"]}}],"children":[]}],"ref":"overflow"}]},"declarations":[{"kind":"state","name":"overflowCount","expression":{"source":"0","ast":{"kind":"literal","value":0},"dependencies":[]}}],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
7
7
 
8
8
  export function createUiAvatarGroup(options = {}) {
9
- const { attributes = {}, children = [], slots = {}, as, ...componentProps } = options;
9
+ const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
10
10
  const projected = [];
11
11
  const element = document.createElement("div");
12
12
  for (const [name, value] of Object.entries(attributes)) {
@@ -1,4 +1,4 @@
1
- // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
1
+ // Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
2
2
  export interface UiBadgeEventMap {
3
3
  }
4
4
  export interface UiBadgeElement extends HTMLSpanElement {
@@ -1,9 +1,9 @@
1
- // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
1
+ // Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
2
2
  import { manageGeneratedProps } from "@nextwebwg/html-next/generated-runtime";
3
3
  import "../styles/ui-badge.css";
4
4
 
5
5
  export function createUiBadge(options = {}) {
6
- const { attributes = {}, children = [], slots = {}, as, ...componentProps } = options;
6
+ const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
7
7
  const projected = [];
8
8
  const prop0 = componentProps["shape"] === undefined ? "pill" : componentProps["shape"];
9
9
  const prop1 = componentProps["tone"] === undefined ? "neutral" : componentProps["tone"];
@@ -1,4 +1,4 @@
1
- // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
1
+ // Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
2
2
  export interface UiBreadcrumbItemEventMap {
3
3
  }
4
4
  export interface UiBreadcrumbItemElement extends HTMLLIElement {
@@ -1,11 +1,11 @@
1
- // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
1
+ // Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
2
2
  import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
3
3
  import "../styles/ui-breadcrumb-item.css";
4
4
 
5
5
  const definition = {...{"contract":{"tag":"ui-breadcrumb-item","props":{"current":{"type":"boolean","required":false,"target":{"attribute":"current"},"default":false}}},"template":{"kind":"element","name":"li","attributes":[{"kind":"attribute","name":"aria-current","expression":"{ true: 'page', false: null }[format('%s', current)]","expressionPlan":{"source":"{ true: 'page', false: null }[format('%s', current)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":"page"}},{"key":"false","value":{"kind":"literal","value":null}}]},"index":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"%s"},{"kind":"id","name":"current"}]}},"dependencies":["current"]}}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"separator"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[{"kind":"element","name":"ui-icon","attributes":[{"kind":"literal","name":"name","value":"chevron-right"}],"children":[]}]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"content"}],"children":[{"kind":"slot"}]}]},"declarations":[],"root":{"kind":"native","element":"li","choices":["li"]}},source:{file:import.meta.url},css:""};
6
6
 
7
7
  export function createUiBreadcrumbItem(options = {}) {
8
- const { attributes = {}, children = [], slots = {}, as, ...componentProps } = options;
8
+ const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
9
9
  const projected = [];
10
10
  const element = document.createElement("li");
11
11
  for (const [name, value] of Object.entries(attributes)) {
@@ -1,4 +1,4 @@
1
- // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
1
+ // Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
2
2
  export interface UiBreadcrumbsEventMap {
3
3
  }
4
4
  export interface UiBreadcrumbsElement extends HTMLElement {
@@ -1,9 +1,9 @@
1
- // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
1
+ // Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
2
2
  import { manageGeneratedProps } from "@nextwebwg/html-next/generated-runtime";
3
3
  import "../styles/ui-breadcrumbs.css";
4
4
 
5
5
  export function createUiBreadcrumbs(options = {}) {
6
- const { attributes = {}, children = [], slots = {}, as, ...componentProps } = options;
6
+ const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
7
7
  const projected = [];
8
8
  const prop0 = componentProps["label"] === undefined ? "Breadcrumb" : componentProps["label"];
9
9
  const element = document.createElement("nav");
@@ -1,12 +1,13 @@
1
- // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
1
+ // Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
2
2
  export interface UiButtonEventMap {
3
3
  }
4
- export interface UiButtonElement extends HTMLButtonElement {
4
+ export interface UiButtonElement extends HTMLElement {
5
5
  addEventListener<K extends keyof UiButtonEventMap>(type: K, listener: (this: UiButtonElement, event: UiButtonEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
6
6
  removeEventListener<K extends keyof UiButtonEventMap>(type: K, listener: (this: UiButtonElement, event: UiButtonEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
7
7
  }
8
8
  export interface UiButtonProps {
9
9
  align?: "center" | "start" | null;
10
+ as?: "button" | "a" | null;
10
11
  disabled?: boolean | null;
11
12
  href?: string | null;
12
13
  rel?: string | null;
@@ -19,6 +20,5 @@ export interface UiButtonProps {
19
20
  attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
20
21
  children?: readonly (string | Node)[];
21
22
  slots?: Readonly<Record<string, readonly (string | Node)[]>>;
22
- as?: "button" | "a";
23
23
  }
24
24
  export declare function createUiButton(props?: UiButtonProps): UiButtonElement;
@@ -1,31 +1,56 @@
1
- // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
2
- import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
1
+ // Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
2
+ import { componentRootIndex, manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
3
3
  import "../styles/ui-button.css";
4
4
 
5
- const definition = {...{"contract":{"tag":"ui-button","props":{"align":{"type":{"enum":["center","start"]},"required":false,"target":{"attribute":"align"},"default":"center"},"disabled":{"type":"boolean","required":false,"target":{"attribute":"disabled"},"default":false},"href":{"type":"string","required":false,"target":{"attribute":"href"}},"rel":{"type":"string","required":false,"target":{"attribute":"rel"}},"size":{"type":{"enum":["sm","md","lg"]},"required":false,"target":{"attribute":"size"},"default":"md"},"stretch":{"type":"boolean","required":false,"target":{"attribute":"stretch"},"default":false},"target":{"type":"string","required":false,"target":{"attribute":"target"}},"tone":{"type":{"enum":["accent","neutral","danger","success","warning","info"]},"required":false,"target":{"attribute":"tone"},"default":"accent"},"type":{"type":{"enum":["button","submit","reset"]},"required":false,"target":{"attribute":"type"},"default":"button"},"variant":{"type":{"enum":["outline","solid","danger","ghost","link"]},"required":false,"target":{"attribute":"variant"},"default":"outline"}}},"template":{"kind":"element","name":"button","attributes":[{"kind":"attribute","name":"type","expression":"{ true: type, false: null }[format('%s', not href)]","expressionPlan":{"source":"{ true: type, false: null }[format('%s', not href)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"id","name":"type"}},{"key":"false","value":{"kind":"literal","value":null}}]},"index":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"%s"},{"kind":"unary","op":"not","operand":{"kind":"id","name":"href"}}]}},"dependencies":["href","type"]}},{"kind":"attribute","name":"disabled","expression":"{ true: true, false: null }[format('%s', disabled and not href)]","expressionPlan":{"source":"{ true: true, false: null }[format('%s', disabled and not href)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":true}},{"key":"false","value":{"kind":"literal","value":null}}]},"index":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"%s"},{"kind":"binary","op":"and","left":{"kind":"id","name":"disabled"},"right":{"kind":"unary","op":"not","operand":{"kind":"id","name":"href"}}}]}},"dependencies":["disabled","href"]}},{"kind":"attribute","name":"href","expression":"{ true: null, false: href }[format('%s', disabled)]","expressionPlan":{"source":"{ true: null, false: href }[format('%s', disabled)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":null}},{"key":"false","value":{"kind":"id","name":"href"}}]},"index":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"%s"},{"kind":"id","name":"disabled"}]}},"dependencies":["disabled","href"]}},{"kind":"attribute","name":"target","expression":"target","expressionPlan":{"source":"target","ast":{"kind":"id","name":"target"},"dependencies":["target"]}},{"kind":"attribute","name":"rel","expression":"rel","expressionPlan":{"source":"rel","ast":{"kind":"id","name":"rel"},"dependencies":["rel"]}},{"kind":"attribute","name":"aria-disabled","expression":"{ true: 'true', false: null }[format('%s', disabled and href)]","expressionPlan":{"source":"{ true: 'true', false: null }[format('%s', disabled and href)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":"true"}},{"key":"false","value":{"kind":"literal","value":null}}]},"index":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"%s"},{"kind":"binary","op":"and","left":{"kind":"id","name":"disabled"},"right":{"kind":"id","name":"href"}}]}},"dependencies":["disabled","href"]}}],"children":[{"kind":"slot"}]},"declarations":[],"root":{"kind":"native","element":"button","choices":["button","a"]}},source:{file:import.meta.url},css:""};
5
+ const definition = {...{"contract":{"tag":"ui-button","props":{"align":{"type":{"enum":["center","start"]},"required":false,"target":{"attribute":"align"},"default":"center"},"as":{"type":{"enum":["button","a"]},"required":false,"target":{"attribute":"as"},"default":"button"},"disabled":{"type":"boolean","required":false,"target":{"attribute":"disabled"},"default":false},"href":{"type":"string","required":false,"target":{"attribute":"href"}},"rel":{"type":"string","required":false,"target":{"attribute":"rel"}},"size":{"type":{"enum":["sm","md","lg"]},"required":false,"target":{"attribute":"size"},"default":"md"},"stretch":{"type":"boolean","required":false,"target":{"attribute":"stretch"},"default":false},"target":{"type":"string","required":false,"target":{"attribute":"target"}},"tone":{"type":{"enum":["accent","neutral","danger","success","warning","info"]},"required":false,"target":{"attribute":"tone"},"default":"accent"},"type":{"type":{"enum":["button","submit","reset"]},"required":false,"target":{"attribute":"type"},"default":"button"},"variant":{"type":{"enum":["outline","solid","danger","ghost","link"]},"required":false,"target":{"attribute":"variant"},"default":"outline"}}},"template":{"kind":"element","name":"template","attributes":[],"children":[{"kind":"element","name":"a","attributes":[{"kind":"attribute","name":"href","expression":"{ true: null, false: href }[format('%s', disabled)]","expressionPlan":{"source":"{ true: null, false: href }[format('%s', disabled)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":null}},{"key":"false","value":{"kind":"id","name":"href"}}]},"index":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"%s"},{"kind":"id","name":"disabled"}]}},"dependencies":["disabled","href"]}},{"kind":"attribute","name":"target","expression":"target","expressionPlan":{"source":"target","ast":{"kind":"id","name":"target"},"dependencies":["target"]}},{"kind":"attribute","name":"rel","expression":"rel","expressionPlan":{"source":"rel","ast":{"kind":"id","name":"rel"},"dependencies":["rel"]}},{"kind":"attribute","name":"aria-disabled","expression":"{ true: 'true', false: null }[format('%s', disabled and href)]","expressionPlan":{"source":"{ true: 'true', false: null }[format('%s', disabled and href)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":"true"}},{"key":"false","value":{"kind":"literal","value":null}}]},"index":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"%s"},{"kind":"binary","op":"and","left":{"kind":"id","name":"disabled"},"right":{"kind":"id","name":"href"}}]}},"dependencies":["disabled","href"]}}],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'a'","testPlan":{"source":"as = 'a'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"a"}},"dependencies":["as"]}}},{"kind":"element","name":"button","attributes":[{"kind":"attribute","name":"type","expression":"type","expressionPlan":{"source":"type","ast":{"kind":"id","name":"type"},"dependencies":["type"]}},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}}],"children":[{"kind":"slot"}],"flow":{"kind":"else"}}],"flow":{"kind":"match"}},"declarations":[],"root":{"kind":"native","element":"button","choices":["a","button"]}},source:{file:import.meta.url},css:""};
6
6
 
7
7
  export function createUiButton(options = {}) {
8
- const { attributes = {}, children = [], slots = {}, as, ...componentProps } = options;
8
+ const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
9
9
  const projected = [];
10
- const element = document.createElement(as ?? "button");
11
- for (const [name, value] of Object.entries(attributes)) {
12
- if (value === null || value === undefined || value === false) continue;
13
- element.setAttribute(name, value === true ? "" : String(value));
14
- }
15
- const value0 = componentProps["target"] === undefined ? undefined : componentProps["target"];
16
- if (value0 === null || value0 === undefined) element.removeAttribute("target");
17
- else element.setAttribute("target", String(value0));
18
- const value1 = componentProps["rel"] === undefined ? undefined : componentProps["rel"];
19
- if (value1 === null || value1 === undefined) element.removeAttribute("rel");
20
- else element.setAttribute("rel", String(value1));
21
- element.setAttribute("data-component", "ui-button");
22
- if (children.length > 0) {
23
- for (const child of children) {
24
- const node = typeof child === "string" ? document.createTextNode(child) : child;
25
- projected.push([node, ""]);
26
- element.append(node);
10
+ const root = componentRootIndex(definition, componentProps);
11
+ let element;
12
+ if (root === 0) {
13
+ element = document.createElement("a");
14
+ for (const [name, value] of Object.entries(attributes)) {
15
+ if (value === null || value === undefined || value === false) continue;
16
+ element.setAttribute(name, value === true ? "" : String(value));
17
+ }
18
+ const value0 = componentProps["target"] === undefined ? undefined : componentProps["target"];
19
+ if (value0 === null || value0 === undefined) element.removeAttribute("target");
20
+ else element.setAttribute("target", String(value0));
21
+ const value1 = componentProps["rel"] === undefined ? undefined : componentProps["rel"];
22
+ if (value1 === null || value1 === undefined) element.removeAttribute("rel");
23
+ else element.setAttribute("rel", String(value1));
24
+ element.setAttribute("data-component", "ui-button");
25
+ if (children.length > 0) {
26
+ for (const child of children) {
27
+ const node = typeof child === "string" ? document.createTextNode(child) : child;
28
+ projected.push([node, ""]);
29
+ element.append(node);
30
+ }
31
+ } else {
27
32
  }
28
33
  } else {
34
+ element = document.createElement("button");
35
+ for (const [name, value] of Object.entries(attributes)) {
36
+ if (value === null || value === undefined || value === false) continue;
37
+ element.setAttribute(name, value === true ? "" : String(value));
38
+ }
39
+ const value2 = componentProps["type"] === undefined ? "button" : componentProps["type"];
40
+ if (value2 === null || value2 === undefined) element.removeAttribute("type");
41
+ else element.setAttribute("type", String(value2));
42
+ const value3 = componentProps["disabled"] === undefined ? false : componentProps["disabled"];
43
+ if (value3 === true) element.setAttribute("disabled", "");
44
+ else element.removeAttribute("disabled");
45
+ element.setAttribute("data-component", "ui-button");
46
+ if (children.length > 0) {
47
+ for (const child of children) {
48
+ const node = typeof child === "string" ? document.createTextNode(child) : child;
49
+ projected.push([node, ""]);
50
+ element.append(node);
51
+ }
52
+ } else {
53
+ }
29
54
  }
30
55
  manageComponentLifecycle(element, definition, { props: componentProps, projected,
31
56
  });
@@ -1,4 +1,4 @@
1
- // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
1
+ // Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
2
2
  export interface UiCalloutEventMap {
3
3
  }
4
4
  export interface UiCalloutElement extends HTMLDivElement {
@@ -1,11 +1,11 @@
1
- // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
1
+ // Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
2
2
  import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
3
3
  import "../styles/ui-callout.css";
4
4
 
5
5
  const definition = {...{"contract":{"tag":"ui-callout","props":{"tone":{"type":{"enum":["info","note","warning","success","danger"]},"required":false,"target":{"attribute":"tone"},"default":"info"}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"role","value":"note"}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"icon"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[{"kind":"element","name":"svg","attributes":[{"kind":"literal","name":"viewBox","value":"0 0 24 24"},{"kind":"literal","name":"fill","value":"none"},{"kind":"literal","name":"stroke","value":"currentColor"},{"kind":"literal","name":"stroke-width","value":"2"},{"kind":"literal","name":"stroke-linecap","value":"round"},{"kind":"literal","name":"stroke-linejoin","value":"round"}],"children":[{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"12"},{"kind":"literal","name":"cy","value":"12"},{"kind":"literal","name":"r","value":"10"}],"children":[]},{"kind":"element","name":"path","attributes":[{"kind":"literal","name":"d","value":"M12 16v-4"}],"children":[]},{"kind":"element","name":"path","attributes":[{"kind":"literal","name":"d","value":"M12 8h.01"}],"children":[]}],"flow":{"kind":"if","test":"tone = 'info'","testPlan":{"source":"tone = 'info'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"tone"},"right":{"kind":"literal","value":"info"}},"dependencies":["tone"]}}},{"kind":"element","name":"svg","attributes":[{"kind":"literal","name":"viewBox","value":"0 0 24 24"},{"kind":"literal","name":"fill","value":"none"},{"kind":"literal","name":"stroke","value":"currentColor"},{"kind":"literal","name":"stroke-width","value":"2"},{"kind":"literal","name":"stroke-linecap","value":"round"},{"kind":"literal","name":"stroke-linejoin","value":"round"}],"children":[{"kind":"element","name":"path","attributes":[{"kind":"literal","name":"d","value":"M13.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.5L13.5 2Z"}],"children":[]},{"kind":"element","name":"path","attributes":[{"kind":"literal","name":"d","value":"M13 2v7h7"}],"children":[]},{"kind":"element","name":"path","attributes":[{"kind":"literal","name":"d","value":"m9.5 17.5 4-4 2 2-4 4H9.5v-2Z"}],"children":[]}],"flow":{"kind":"if","test":"tone = 'note'","testPlan":{"source":"tone = 'note'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"tone"},"right":{"kind":"literal","value":"note"}},"dependencies":["tone"]}}},{"kind":"element","name":"svg","attributes":[{"kind":"literal","name":"viewBox","value":"0 0 24 24"},{"kind":"literal","name":"fill","value":"none"},{"kind":"literal","name":"stroke","value":"currentColor"},{"kind":"literal","name":"stroke-width","value":"2"},{"kind":"literal","name":"stroke-linecap","value":"round"},{"kind":"literal","name":"stroke-linejoin","value":"round"}],"children":[{"kind":"element","name":"path","attributes":[{"kind":"literal","name":"d","value":"m21.73 18-8-14a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}],"children":[]},{"kind":"element","name":"path","attributes":[{"kind":"literal","name":"d","value":"M12 9v4"}],"children":[]},{"kind":"element","name":"path","attributes":[{"kind":"literal","name":"d","value":"M12 17h.01"}],"children":[]}],"flow":{"kind":"if","test":"tone = 'warning'","testPlan":{"source":"tone = 'warning'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"tone"},"right":{"kind":"literal","value":"warning"}},"dependencies":["tone"]}}},{"kind":"element","name":"svg","attributes":[{"kind":"literal","name":"viewBox","value":"0 0 24 24"},{"kind":"literal","name":"fill","value":"none"},{"kind":"literal","name":"stroke","value":"currentColor"},{"kind":"literal","name":"stroke-width","value":"2"},{"kind":"literal","name":"stroke-linecap","value":"round"},{"kind":"literal","name":"stroke-linejoin","value":"round"}],"children":[{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"12"},{"kind":"literal","name":"cy","value":"12"},{"kind":"literal","name":"r","value":"10"}],"children":[]},{"kind":"element","name":"path","attributes":[{"kind":"literal","name":"d","value":"m9 12 2 2 4-4"}],"children":[]}],"flow":{"kind":"if","test":"tone = 'success'","testPlan":{"source":"tone = 'success'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"tone"},"right":{"kind":"literal","value":"success"}},"dependencies":["tone"]}}},{"kind":"element","name":"svg","attributes":[{"kind":"literal","name":"viewBox","value":"0 0 24 24"},{"kind":"literal","name":"fill","value":"none"},{"kind":"literal","name":"stroke","value":"currentColor"},{"kind":"literal","name":"stroke-width","value":"2"},{"kind":"literal","name":"stroke-linecap","value":"round"},{"kind":"literal","name":"stroke-linejoin","value":"round"}],"children":[{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"12"},{"kind":"literal","name":"cy","value":"12"},{"kind":"literal","name":"r","value":"10"}],"children":[]},{"kind":"element","name":"path","attributes":[{"kind":"literal","name":"d","value":"m15 9-6 6"}],"children":[]},{"kind":"element","name":"path","attributes":[{"kind":"literal","name":"d","value":"m9 9 6 6"}],"children":[]}],"flow":{"kind":"if","test":"tone = 'danger'","testPlan":{"source":"tone = 'danger'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"tone"},"right":{"kind":"literal","value":"danger"}},"dependencies":["tone"]}}}]},{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"content"}],"children":[{"kind":"slot"}]}]},"declarations":[],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
6
6
 
7
7
  export function createUiCallout(options = {}) {
8
- const { attributes = {}, children = [], slots = {}, as, ...componentProps } = options;
8
+ const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
9
9
  const projected = [];
10
10
  const element = document.createElement("div");
11
11
  for (const [name, value] of Object.entries(attributes)) {
@@ -1,17 +1,17 @@
1
- // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
1
+ // Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
2
2
  export interface UiCardEventMap {
3
3
  }
4
- export interface UiCardElement extends HTMLDivElement {
4
+ export interface UiCardElement extends HTMLElement {
5
5
  addEventListener<K extends keyof UiCardEventMap>(type: K, listener: (this: UiCardElement, event: UiCardEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
6
6
  removeEventListener<K extends keyof UiCardEventMap>(type: K, listener: (this: UiCardElement, event: UiCardEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
7
7
  }
8
8
  export interface UiCardProps {
9
+ as?: "div" | "section" | "article" | "aside" | null;
9
10
  padding?: "sm" | "md" | "lg" | null;
10
11
  tone?: "neutral" | "danger" | null;
11
12
  variant?: "outlined" | "subtle" | "elevated" | null;
12
13
  attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
13
14
  children?: readonly (string | Node)[];
14
15
  slots?: Readonly<Record<string, readonly (string | Node)[]>>;
15
- as?: "div" | "section" | "article" | "aside";
16
16
  }
17
17
  export declare function createUiCard(props?: UiCardProps): UiCardElement;
package/vanilla/UiCard.js CHANGED
@@ -1,32 +1,77 @@
1
- // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
2
- import { manageGeneratedProps } from "@nextwebwg/html-next/generated-runtime";
1
+ // Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
2
+ import { componentRootIndex, manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
3
3
  import "../styles/ui-card.css";
4
4
 
5
+ const definition = {...{"contract":{"tag":"ui-card","props":{"as":{"type":{"enum":["div","section","article","aside"]},"required":false,"target":{"attribute":"as"},"default":"div"},"padding":{"type":{"enum":["sm","md","lg"]},"required":false,"target":{"attribute":"padding"},"default":"md"},"tone":{"type":{"enum":["neutral","danger"]},"required":false,"target":{"attribute":"tone"},"default":"neutral"},"variant":{"type":{"enum":["outlined","subtle","elevated"]},"required":false,"target":{"attribute":"variant"},"default":"outlined"}}},"template":{"kind":"element","name":"template","attributes":[],"children":[{"kind":"element","name":"section","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'section'","testPlan":{"source":"as = 'section'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"section"}},"dependencies":["as"]}}},{"kind":"element","name":"article","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'article'","testPlan":{"source":"as = 'article'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"article"}},"dependencies":["as"]}}},{"kind":"element","name":"aside","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'aside'","testPlan":{"source":"as = 'aside'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"aside"}},"dependencies":["as"]}}},{"kind":"element","name":"div","attributes":[],"children":[{"kind":"slot"}],"flow":{"kind":"else"}}],"flow":{"kind":"match"}},"declarations":[],"root":{"kind":"native","element":"div","choices":["section","article","aside","div"]}},source:{file:import.meta.url},css:""};
6
+
5
7
  export function createUiCard(options = {}) {
6
- const { attributes = {}, children = [], slots = {}, as, ...componentProps } = options;
8
+ const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
7
9
  const projected = [];
8
- const prop0 = componentProps["padding"] === undefined ? "md" : componentProps["padding"];
9
- const prop1 = componentProps["tone"] === undefined ? "neutral" : componentProps["tone"];
10
- const prop2 = componentProps["variant"] === undefined ? "outlined" : componentProps["variant"];
11
- const element = document.createElement(as ?? "div");
12
- for (const [name, value] of Object.entries(attributes)) {
13
- if (value === null || value === undefined || value === false) continue;
14
- element.setAttribute(name, value === true ? "" : String(value));
15
- }
16
- element.setAttribute("data-component", "ui-card");
17
- if (children.length > 0) {
18
- for (const child of children) {
19
- const node = typeof child === "string" ? document.createTextNode(child) : child;
20
- projected.push([node, ""]);
21
- element.append(node);
10
+ const root = componentRootIndex(definition, componentProps);
11
+ let element;
12
+ if (root === 0) {
13
+ element = document.createElement("section");
14
+ for (const [name, value] of Object.entries(attributes)) {
15
+ if (value === null || value === undefined || value === false) continue;
16
+ element.setAttribute(name, value === true ? "" : String(value));
17
+ }
18
+ element.setAttribute("data-component", "ui-card");
19
+ if (children.length > 0) {
20
+ for (const child of children) {
21
+ const node = typeof child === "string" ? document.createTextNode(child) : child;
22
+ projected.push([node, ""]);
23
+ element.append(node);
24
+ }
25
+ } else {
26
+ }
27
+ } else if (root === 1) {
28
+ element = document.createElement("article");
29
+ for (const [name, value] of Object.entries(attributes)) {
30
+ if (value === null || value === undefined || value === false) continue;
31
+ element.setAttribute(name, value === true ? "" : String(value));
32
+ }
33
+ element.setAttribute("data-component", "ui-card");
34
+ if (children.length > 0) {
35
+ for (const child of children) {
36
+ const node = typeof child === "string" ? document.createTextNode(child) : child;
37
+ projected.push([node, ""]);
38
+ element.append(node);
39
+ }
40
+ } else {
41
+ }
42
+ } else if (root === 2) {
43
+ element = document.createElement("aside");
44
+ for (const [name, value] of Object.entries(attributes)) {
45
+ if (value === null || value === undefined || value === false) continue;
46
+ element.setAttribute(name, value === true ? "" : String(value));
47
+ }
48
+ element.setAttribute("data-component", "ui-card");
49
+ if (children.length > 0) {
50
+ for (const child of children) {
51
+ const node = typeof child === "string" ? document.createTextNode(child) : child;
52
+ projected.push([node, ""]);
53
+ element.append(node);
54
+ }
55
+ } else {
22
56
  }
23
57
  } else {
58
+ element = document.createElement("div");
59
+ for (const [name, value] of Object.entries(attributes)) {
60
+ if (value === null || value === undefined || value === false) continue;
61
+ element.setAttribute(name, value === true ? "" : String(value));
62
+ }
63
+ element.setAttribute("data-component", "ui-card");
64
+ if (children.length > 0) {
65
+ for (const child of children) {
66
+ const node = typeof child === "string" ? document.createTextNode(child) : child;
67
+ projected.push([node, ""]);
68
+ element.append(node);
69
+ }
70
+ } else {
71
+ }
24
72
  }
25
- manageGeneratedProps(element, [
26
- { name: "padding", attribute: "data-padding", value: componentProps["padding"], default: "md", type: ["sm","md","lg"], required: false },
27
- { name: "tone", attribute: "data-tone", value: componentProps["tone"], default: "neutral", type: ["neutral","danger"], required: false },
28
- { name: "variant", attribute: "data-variant", value: componentProps["variant"], default: "outlined", type: ["outlined","subtle","elevated"], required: false },
29
- ]);
73
+ manageComponentLifecycle(element, definition, { props: componentProps, projected,
74
+ });
30
75
  return element;
31
76
  }
32
77
 
@@ -1,4 +1,4 @@
1
- // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
1
+ // Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
2
2
  export interface UiCheckboxEventMap {
3
3
  change: CustomEvent<{ readonly checked: boolean; readonly value: string; readonly trigger: "keyboard" | "pointer" | "programmatic" }>;
4
4
  }
@@ -1,4 +1,4 @@
1
- // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
1
+ // Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
2
2
  import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
3
3
  import * as controller from "../components/ui-checkbox/ui-checkbox.js";
4
4
  import "../styles/ui-checkbox.css";
@@ -6,7 +6,7 @@ import "../styles/ui-checkbox.css";
6
6
  const definition = {...{"contract":{"tag":"ui-checkbox","props":{"checked":{"type":"boolean","required":false,"target":{"attribute":"checked"},"default":false},"disabled":{"type":"boolean","required":false,"target":{"attribute":"disabled"},"default":false},"indeterminate":{"type":"boolean","required":false,"target":{"property":"indeterminate"},"default":false},"name":{"type":"string","required":false,"target":{"attribute":"name"},"default":""},"required":{"type":"boolean","required":false,"target":{"attribute":"required"},"default":false},"value":{"type":"string","required":false,"target":{"attribute":"value"},"default":"on"}}},"template":{"kind":"element","name":"label","attributes":[],"children":[{"kind":"element","name":"input","attributes":[{"kind":"literal","name":"type","value":"checkbox"},{"kind":"property","key":"checked","name":"checked","expression":"internalChecked","expressionPlan":{"source":"internalChecked","ast":{"kind":"id","name":"internalChecked"},"dependencies":["internalChecked"]}},{"kind":"property","key":"indeterminate","name":"indeterminate","expression":"indeterminate","expressionPlan":{"source":"indeterminate","ast":{"kind":"id","name":"indeterminate"},"dependencies":["indeterminate"]}},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"required","expression":"required","expressionPlan":{"source":"required","ast":{"kind":"id","name":"required"},"dependencies":["required"]}},{"kind":"attribute","name":"name","expression":"name","expressionPlan":{"source":"name","ast":{"kind":"id","name":"name"},"dependencies":["name"]}},{"kind":"attribute","name":"value","expression":"value","expressionPlan":{"source":"value","ast":{"kind":"id","name":"value"},"dependencies":["value"]}}],"children":[],"ref":"input"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"text"}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"label"}],"children":[{"kind":"slot"}]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"description"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[{"kind":"slot","fallback":[],"name":"description"}],"ref":"description"}]}]},"declarations":[{"kind":"state","name":"internalChecked","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"event","name":"change","type":"object({ checked: boolean, value: string, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"label","choices":["label"]}},source:{file:import.meta.url},css:""};
7
7
 
8
8
  export function createUiCheckbox(options = {}) {
9
- const { attributes = {}, children = [], slots = {}, as, ...componentProps } = options;
9
+ const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
10
10
  const projected = [];
11
11
  const element = document.createElement("label");
12
12
  for (const [name, value] of Object.entries(attributes)) {
@@ -1,4 +1,4 @@
1
- // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
1
+ // Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
2
2
  export interface UiClusterEventMap {
3
3
  }
4
4
  export interface UiClusterElement extends HTMLDivElement {
@@ -1,9 +1,9 @@
1
- // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
1
+ // Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
2
2
  import { manageGeneratedProps } from "@nextwebwg/html-next/generated-runtime";
3
3
  import "../styles/ui-cluster.css";
4
4
 
5
5
  export function createUiCluster(options = {}) {
6
- const { attributes = {}, children = [], slots = {}, as, ...componentProps } = options;
6
+ const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
7
7
  const projected = [];
8
8
  const prop0 = componentProps["align"] === undefined ? undefined : componentProps["align"];
9
9
  const prop1 = componentProps["gap"] === undefined ? undefined : componentProps["gap"];
@@ -1,4 +1,4 @@
1
- // Generated by HTML Next 1.0.0-alpha.5 for Vanilla DOM. Do not edit.
1
+ // Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
2
2
  export interface UiComboboxEventMap {
3
3
  "query-change": CustomEvent<{ readonly query: string; readonly display: string; readonly trigger: "keyboard" | "pointer" | "programmatic" }>;
4
4
  "value-change": CustomEvent<{ readonly value: string | null; readonly query: string; readonly option: { readonly id: string; readonly value: string; readonly label: string; readonly group?: string; readonly disabled?: boolean } | null; readonly kind: "selection" | "clear" | "free-entry" | "create"; readonly trigger: "keyboard" | "pointer" | "programmatic" } | readonly ({ readonly id: string; readonly value: string; readonly label: string; readonly group?: string; readonly disabled?: boolean })[]>;