@threadlabs/looma 0.13.1 → 0.13.2

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 (338) hide show
  1. package/components/ui-button/ui-button.html +18 -14
  2. package/components/ui-card/ui-card.html +8 -1
  3. package/components/ui-combobox/ui-combobox.html +1 -1
  4. package/components/ui-nav-item/ui-nav-item.html +28 -18
  5. package/components/ui-text/ui-text.html +11 -1
  6. package/dist/index.js +1 -1
  7. package/package.json +2 -2
  8. package/styles/ui-action-bar.css +1 -1
  9. package/styles/ui-affordance-scope.css +1 -1
  10. package/styles/ui-avatar-group.css +1 -1
  11. package/styles/ui-avatar.css +1 -1
  12. package/styles/ui-badge.css +1 -1
  13. package/styles/ui-breadcrumb-item.css +1 -1
  14. package/styles/ui-breadcrumbs.css +1 -1
  15. package/styles/ui-button.css +1 -1
  16. package/styles/ui-callout.css +1 -1
  17. package/styles/ui-card.css +1 -1
  18. package/styles/ui-checkbox.css +1 -1
  19. package/styles/ui-cluster.css +1 -1
  20. package/styles/ui-combobox.css +1 -1
  21. package/styles/ui-container.css +1 -1
  22. package/styles/ui-context-menu.css +1 -1
  23. package/styles/ui-cover.css +1 -1
  24. package/styles/ui-description-item.css +1 -1
  25. package/styles/ui-description-list.css +1 -1
  26. package/styles/ui-dialog.css +1 -1
  27. package/styles/ui-disclosure.css +1 -1
  28. package/styles/ui-editable.css +1 -1
  29. package/styles/ui-editor-insert-table-grid.css +1 -1
  30. package/styles/ui-editor-mention-menu.css +1 -1
  31. package/styles/ui-editor-slash-menu.css +1 -1
  32. package/styles/ui-editor-table-context-menu.css +1 -1
  33. package/styles/ui-editor-table-overlay.css +1 -1
  34. package/styles/ui-editor-table-toolbar.css +1 -1
  35. package/styles/ui-editor-toolbar.css +1 -1
  36. package/styles/ui-floating-action-button.css +1 -1
  37. package/styles/ui-form-field.css +1 -1
  38. package/styles/ui-grid.css +1 -1
  39. package/styles/ui-icon-button.css +1 -1
  40. package/styles/ui-icon.css +1 -1
  41. package/styles/ui-input-group.css +1 -1
  42. package/styles/ui-input.css +1 -1
  43. package/styles/ui-list-item.css +1 -1
  44. package/styles/ui-list.css +1 -1
  45. package/styles/ui-menu-item.css +1 -1
  46. package/styles/ui-menu.css +1 -1
  47. package/styles/ui-nav-item.css +1 -1
  48. package/styles/ui-page-header.css +1 -1
  49. package/styles/ui-popover.css +1 -1
  50. package/styles/ui-radio-group.css +1 -1
  51. package/styles/ui-radio.css +1 -1
  52. package/styles/ui-reel.css +1 -1
  53. package/styles/ui-scroll-area.css +1 -1
  54. package/styles/ui-search-result-row.css +1 -1
  55. package/styles/ui-search-shell.css +1 -1
  56. package/styles/ui-section.css +1 -1
  57. package/styles/ui-select.css +1 -1
  58. package/styles/ui-separator.css +1 -1
  59. package/styles/ui-sidebar.css +1 -1
  60. package/styles/ui-spinner.css +1 -1
  61. package/styles/ui-stack.css +1 -1
  62. package/styles/ui-status-message.css +1 -1
  63. package/styles/ui-switch.css +1 -1
  64. package/styles/ui-switcher.css +1 -1
  65. package/styles/ui-tabs.css +1 -1
  66. package/styles/ui-text.css +1 -1
  67. package/styles/ui-textarea.css +1 -1
  68. package/styles/ui-toast-region.css +1 -1
  69. package/styles/ui-tooltip.css +1 -1
  70. package/styles/ui-top-bar.css +1 -1
  71. package/styles/ui-tree-item.css +1 -1
  72. package/styles/ui-tree.css +1 -1
  73. package/vanilla/UiActionBar.d.ts +1 -1
  74. package/vanilla/UiActionBar.js +2 -2
  75. package/vanilla/UiAffordanceScope.d.ts +1 -1
  76. package/vanilla/UiAffordanceScope.js +2 -2
  77. package/vanilla/UiAvatar.d.ts +1 -1
  78. package/vanilla/UiAvatar.js +2 -2
  79. package/vanilla/UiAvatarGroup.d.ts +1 -1
  80. package/vanilla/UiAvatarGroup.js +2 -2
  81. package/vanilla/UiBadge.d.ts +1 -1
  82. package/vanilla/UiBadge.js +2 -2
  83. package/vanilla/UiBreadcrumbItem.d.ts +1 -1
  84. package/vanilla/UiBreadcrumbItem.js +2 -2
  85. package/vanilla/UiBreadcrumbs.d.ts +1 -1
  86. package/vanilla/UiBreadcrumbs.js +2 -2
  87. package/vanilla/UiButton.d.ts +3 -3
  88. package/vanilla/UiButton.js +46 -21
  89. package/vanilla/UiCallout.d.ts +1 -1
  90. package/vanilla/UiCallout.js +2 -2
  91. package/vanilla/UiCard.d.ts +3 -3
  92. package/vanilla/UiCard.js +67 -22
  93. package/vanilla/UiCheckbox.d.ts +1 -1
  94. package/vanilla/UiCheckbox.js +2 -2
  95. package/vanilla/UiCluster.d.ts +1 -1
  96. package/vanilla/UiCluster.js +2 -2
  97. package/vanilla/UiCombobox.d.ts +1 -1
  98. package/vanilla/UiCombobox.js +3 -3
  99. package/vanilla/UiContainer.d.ts +1 -1
  100. package/vanilla/UiContainer.js +2 -2
  101. package/vanilla/UiContextMenu.d.ts +1 -1
  102. package/vanilla/UiContextMenu.js +2 -2
  103. package/vanilla/UiCover.d.ts +1 -1
  104. package/vanilla/UiCover.js +2 -2
  105. package/vanilla/UiDescriptionItem.d.ts +1 -1
  106. package/vanilla/UiDescriptionItem.js +2 -2
  107. package/vanilla/UiDescriptionList.d.ts +1 -1
  108. package/vanilla/UiDescriptionList.js +2 -2
  109. package/vanilla/UiDialog.d.ts +1 -1
  110. package/vanilla/UiDialog.js +2 -2
  111. package/vanilla/UiDisclosure.d.ts +1 -1
  112. package/vanilla/UiDisclosure.js +2 -2
  113. package/vanilla/UiEditable.d.ts +1 -1
  114. package/vanilla/UiEditable.js +2 -2
  115. package/vanilla/UiEditorInsertTableGrid.d.ts +1 -1
  116. package/vanilla/UiEditorInsertTableGrid.js +2 -2
  117. package/vanilla/UiEditorMentionMenu.d.ts +1 -1
  118. package/vanilla/UiEditorMentionMenu.js +2 -2
  119. package/vanilla/UiEditorSlashMenu.d.ts +1 -1
  120. package/vanilla/UiEditorSlashMenu.js +2 -2
  121. package/vanilla/UiEditorTableContextMenu.d.ts +1 -1
  122. package/vanilla/UiEditorTableContextMenu.js +2 -2
  123. package/vanilla/UiEditorTableOverlay.d.ts +1 -1
  124. package/vanilla/UiEditorTableOverlay.js +2 -2
  125. package/vanilla/UiEditorTableToolbar.d.ts +1 -1
  126. package/vanilla/UiEditorTableToolbar.js +2 -2
  127. package/vanilla/UiEditorToolbar.d.ts +1 -1
  128. package/vanilla/UiEditorToolbar.js +2 -2
  129. package/vanilla/UiFloatingActionButton.d.ts +1 -1
  130. package/vanilla/UiFloatingActionButton.js +2 -2
  131. package/vanilla/UiFormField.d.ts +1 -1
  132. package/vanilla/UiFormField.js +2 -2
  133. package/vanilla/UiGrid.d.ts +1 -1
  134. package/vanilla/UiGrid.js +2 -2
  135. package/vanilla/UiIcon.d.ts +1 -1
  136. package/vanilla/UiIcon.js +2 -2
  137. package/vanilla/UiIconButton.d.ts +1 -1
  138. package/vanilla/UiIconButton.js +2 -2
  139. package/vanilla/UiInput.d.ts +1 -1
  140. package/vanilla/UiInput.js +2 -2
  141. package/vanilla/UiInputGroup.d.ts +1 -1
  142. package/vanilla/UiInputGroup.js +2 -2
  143. package/vanilla/UiList.d.ts +1 -1
  144. package/vanilla/UiList.js +2 -2
  145. package/vanilla/UiListItem.d.ts +1 -1
  146. package/vanilla/UiListItem.js +2 -2
  147. package/vanilla/UiMenu.d.ts +1 -1
  148. package/vanilla/UiMenu.js +2 -2
  149. package/vanilla/UiMenuItem.d.ts +1 -1
  150. package/vanilla/UiMenuItem.js +2 -2
  151. package/vanilla/UiNavItem.d.ts +3 -3
  152. package/vanilla/UiNavItem.js +106 -54
  153. package/vanilla/UiPageHeader.d.ts +1 -1
  154. package/vanilla/UiPageHeader.js +2 -2
  155. package/vanilla/UiPopover.d.ts +1 -1
  156. package/vanilla/UiPopover.js +2 -2
  157. package/vanilla/UiRadio.d.ts +1 -1
  158. package/vanilla/UiRadio.js +2 -2
  159. package/vanilla/UiRadioGroup.d.ts +1 -1
  160. package/vanilla/UiRadioGroup.js +2 -2
  161. package/vanilla/UiReel.d.ts +1 -1
  162. package/vanilla/UiReel.js +2 -2
  163. package/vanilla/UiScrollArea.d.ts +1 -1
  164. package/vanilla/UiScrollArea.js +2 -2
  165. package/vanilla/UiSearchResultRow.d.ts +1 -1
  166. package/vanilla/UiSearchResultRow.js +2 -2
  167. package/vanilla/UiSearchShell.d.ts +1 -1
  168. package/vanilla/UiSearchShell.js +2 -2
  169. package/vanilla/UiSection.d.ts +1 -1
  170. package/vanilla/UiSection.js +2 -2
  171. package/vanilla/UiSelect.d.ts +1 -1
  172. package/vanilla/UiSelect.js +2 -2
  173. package/vanilla/UiSeparator.d.ts +1 -1
  174. package/vanilla/UiSeparator.js +2 -2
  175. package/vanilla/UiSidebar.d.ts +1 -1
  176. package/vanilla/UiSidebar.js +2 -2
  177. package/vanilla/UiSpinner.d.ts +1 -1
  178. package/vanilla/UiSpinner.js +2 -2
  179. package/vanilla/UiStack.d.ts +1 -1
  180. package/vanilla/UiStack.js +2 -2
  181. package/vanilla/UiStatusMessage.d.ts +1 -1
  182. package/vanilla/UiStatusMessage.js +2 -2
  183. package/vanilla/UiSwitch.d.ts +1 -1
  184. package/vanilla/UiSwitch.js +2 -2
  185. package/vanilla/UiSwitcher.d.ts +1 -1
  186. package/vanilla/UiSwitcher.js +2 -2
  187. package/vanilla/UiTabs.d.ts +1 -1
  188. package/vanilla/UiTabs.js +2 -2
  189. package/vanilla/UiText.d.ts +3 -3
  190. package/vanilla/UiText.js +97 -28
  191. package/vanilla/UiTextarea.d.ts +1 -1
  192. package/vanilla/UiTextarea.js +2 -2
  193. package/vanilla/UiToastRegion.d.ts +1 -1
  194. package/vanilla/UiToastRegion.js +2 -2
  195. package/vanilla/UiTooltip.d.ts +1 -1
  196. package/vanilla/UiTooltip.js +2 -2
  197. package/vanilla/UiTopBar.d.ts +1 -1
  198. package/vanilla/UiTopBar.js +2 -2
  199. package/vanilla/UiTree.d.ts +1 -1
  200. package/vanilla/UiTree.js +2 -2
  201. package/vanilla/UiTreeItem.d.ts +1 -1
  202. package/vanilla/UiTreeItem.js +2 -2
  203. package/vue/UiActionBar.vue +1 -1
  204. package/vue/UiAffordanceScope.vue +1 -1
  205. package/vue/UiAvatar.vue +1 -1
  206. package/vue/UiAvatarGroup.vue +1 -1
  207. package/vue/UiBadge.vue +1 -1
  208. package/vue/UiBreadcrumbItem.vue +1 -1
  209. package/vue/UiBreadcrumbs.vue +1 -1
  210. package/vue/UiButton.d.ts +6 -4
  211. package/vue/UiButton.vue +14 -8
  212. package/vue/UiCallout.vue +1 -1
  213. package/vue/UiCard.d.ts +8 -2
  214. package/vue/UiCard.vue +27 -4
  215. package/vue/UiCheckbox.vue +1 -1
  216. package/vue/UiCluster.vue +1 -1
  217. package/vue/UiCombobox.vue +2 -2
  218. package/vue/UiContainer.vue +1 -1
  219. package/vue/UiContextMenu.vue +1 -1
  220. package/vue/UiCover.vue +1 -1
  221. package/vue/UiDescriptionItem.vue +1 -1
  222. package/vue/UiDescriptionList.vue +1 -1
  223. package/vue/UiDialog.vue +1 -1
  224. package/vue/UiDisclosure.vue +1 -1
  225. package/vue/UiEditable.vue +1 -1
  226. package/vue/UiEditorInsertTableGrid.vue +1 -1
  227. package/vue/UiEditorMentionMenu.vue +1 -1
  228. package/vue/UiEditorSlashMenu.vue +1 -1
  229. package/vue/UiEditorTableContextMenu.vue +1 -1
  230. package/vue/UiEditorTableOverlay.vue +1 -1
  231. package/vue/UiEditorTableToolbar.vue +1 -1
  232. package/vue/UiEditorToolbar.vue +1 -1
  233. package/vue/UiFloatingActionButton.vue +1 -1
  234. package/vue/UiFormField.vue +1 -1
  235. package/vue/UiGrid.vue +1 -1
  236. package/vue/UiIcon.vue +1 -1
  237. package/vue/UiIconButton.vue +1 -1
  238. package/vue/UiInput.vue +1 -1
  239. package/vue/UiInputGroup.vue +1 -1
  240. package/vue/UiList.vue +1 -1
  241. package/vue/UiListItem.vue +1 -1
  242. package/vue/UiMenu.vue +1 -1
  243. package/vue/UiMenuItem.vue +1 -1
  244. package/vue/UiNavItem.d.ts +10 -4
  245. package/vue/UiNavItem.vue +22 -5
  246. package/vue/UiPageHeader.vue +1 -1
  247. package/vue/UiPopover.vue +1 -1
  248. package/vue/UiRadio.vue +1 -1
  249. package/vue/UiRadioGroup.vue +1 -1
  250. package/vue/UiReel.vue +1 -1
  251. package/vue/UiScrollArea.vue +1 -1
  252. package/vue/UiSearchResultRow.vue +1 -1
  253. package/vue/UiSearchShell.vue +1 -1
  254. package/vue/UiSection.vue +1 -1
  255. package/vue/UiSelect.vue +1 -1
  256. package/vue/UiSeparator.vue +1 -1
  257. package/vue/UiSidebar.vue +1 -1
  258. package/vue/UiSpinner.vue +1 -1
  259. package/vue/UiStack.vue +1 -1
  260. package/vue/UiStatusMessage.vue +1 -1
  261. package/vue/UiSwitch.vue +1 -1
  262. package/vue/UiSwitcher.vue +1 -1
  263. package/vue/UiTabs.vue +1 -1
  264. package/vue/UiText.d.ts +14 -4
  265. package/vue/UiText.vue +37 -6
  266. package/vue/UiTextarea.vue +1 -1
  267. package/vue/UiToastRegion.vue +1 -1
  268. package/vue/UiTooltip.vue +1 -1
  269. package/vue/UiTopBar.vue +1 -1
  270. package/vue/UiTree.vue +1 -1
  271. package/vue/UiTreeItem.vue +1 -1
  272. package/vue/chunks/UiActionBar.js +1 -1
  273. package/vue/chunks/UiAffordanceScope.js +1 -1
  274. package/vue/chunks/UiAvatar.js +1 -1
  275. package/vue/chunks/UiAvatarGroup.js +1 -1
  276. package/vue/chunks/UiBadge.js +1 -1
  277. package/vue/chunks/UiBreadcrumbItem.js +1 -1
  278. package/vue/chunks/UiBreadcrumbs.js +1 -1
  279. package/vue/chunks/UiButton.js +28 -24
  280. package/vue/chunks/UiCallout.js +1 -1
  281. package/vue/chunks/UiCard.js +20 -6
  282. package/vue/chunks/UiCheckbox.js +1 -1
  283. package/vue/chunks/UiCluster.js +1 -1
  284. package/vue/chunks/UiCombobox.js +2 -2
  285. package/vue/chunks/UiContainer.js +1 -1
  286. package/vue/chunks/UiContextMenu.js +1 -1
  287. package/vue/chunks/UiCover.js +1 -1
  288. package/vue/chunks/UiDescriptionItem.js +1 -1
  289. package/vue/chunks/UiDescriptionList.js +1 -1
  290. package/vue/chunks/UiDialog.js +1 -1
  291. package/vue/chunks/UiDisclosure.js +1 -1
  292. package/vue/chunks/UiEditable.js +1 -1
  293. package/vue/chunks/UiEditorInsertTableGrid.js +1 -1
  294. package/vue/chunks/UiEditorMentionMenu.js +1 -1
  295. package/vue/chunks/UiEditorSlashMenu.js +1 -1
  296. package/vue/chunks/UiEditorTableContextMenu.js +1 -1
  297. package/vue/chunks/UiEditorTableOverlay.js +1 -1
  298. package/vue/chunks/UiEditorTableToolbar.js +1 -1
  299. package/vue/chunks/UiEditorToolbar.js +1 -1
  300. package/vue/chunks/UiFloatingActionButton.js +1 -1
  301. package/vue/chunks/UiFormField.js +1 -1
  302. package/vue/chunks/UiGrid.js +1 -1
  303. package/vue/chunks/UiIcon.js +1 -1
  304. package/vue/chunks/UiIconButton.js +1 -1
  305. package/vue/chunks/UiInput.js +1 -1
  306. package/vue/chunks/UiInputGroup.js +1 -1
  307. package/vue/chunks/UiList.js +1 -1
  308. package/vue/chunks/UiListItem.js +1 -1
  309. package/vue/chunks/UiMenu.js +1 -1
  310. package/vue/chunks/UiMenuItem.js +1 -1
  311. package/vue/chunks/UiNavItem.js +58 -28
  312. package/vue/chunks/UiPageHeader.js +1 -1
  313. package/vue/chunks/UiPopover.js +1 -1
  314. package/vue/chunks/UiRadio.js +1 -1
  315. package/vue/chunks/UiRadioGroup.js +1 -1
  316. package/vue/chunks/UiReel.js +1 -1
  317. package/vue/chunks/UiScrollArea.js +1 -1
  318. package/vue/chunks/UiSearchResultRow.js +1 -1
  319. package/vue/chunks/UiSearchShell.js +1 -1
  320. package/vue/chunks/UiSection.js +1 -1
  321. package/vue/chunks/UiSelect.js +1 -1
  322. package/vue/chunks/UiSeparator.js +1 -1
  323. package/vue/chunks/UiSidebar.js +1 -1
  324. package/vue/chunks/UiSpinner.js +1 -1
  325. package/vue/chunks/UiStack.js +1 -1
  326. package/vue/chunks/UiStatusMessage.js +1 -1
  327. package/vue/chunks/UiSwitch.js +1 -1
  328. package/vue/chunks/UiSwitcher.js +1 -1
  329. package/vue/chunks/UiTabs.js +1 -1
  330. package/vue/chunks/UiText.js +29 -7
  331. package/vue/chunks/UiTextarea.js +1 -1
  332. package/vue/chunks/UiToastRegion.js +1 -1
  333. package/vue/chunks/UiTooltip.js +1 -1
  334. package/vue/chunks/UiTopBar.js +1 -1
  335. package/vue/chunks/UiTree.js +1 -1
  336. package/vue/chunks/UiTreeItem.js +1 -1
  337. package/vue/components.css +908 -908
  338. package/vue/host.ts +1 -1
@@ -22,21 +22,25 @@
22
22
  aria-disabled="true", so it cannot be followed.</prop>
23
23
  <prop name="target" type="string">Where a link opens, as on a native link. Only meaningful with as="a".</prop>
24
24
  <prop name="rel" type="string">The link's relationship to its destination, as on a native link. Only meaningful with as="a".</prop>
25
- <!-- One root, a button or a link (as="a"). The language has no conditional expression, so a table keyed
26
- by a boolean's text picks each value, and null leaves the attribute off: a link never carries type or
27
- disabled, and a disabled link loses its href and states aria-disabled instead. -->
25
+ <prop name="as" type="button | a" default="button">The native element the button renders: a button, or a link (a) that navigates to href.</prop>
26
+ <!-- Each root carries only its own attributes: a link has no type or disabled, and a disabled link
27
+ loses its href and states aria-disabled instead. The language has no conditional expression, so a
28
+ table keyed by a boolean's text picks each value, and null leaves the attribute off. -->
28
29
  </defs>
29
- <button
30
- as="button|a"
31
- :type="{ true: type, false: null }[format('%s', not href)]"
32
- :disabled="{ true: true, false: null }[format('%s', disabled and not href)]"
33
- :href="{ true: null, false: href }[format('%s', disabled)]"
34
- :target="target"
35
- :rel="rel"
36
- :aria-disabled="{ true: 'true', false: null }[format('%s', disabled and href)]"
37
- >
38
- <slot></slot>
39
- </button>
30
+ <template $match>
31
+ <a
32
+ $when="as = 'a'"
33
+ :href="{ true: null, false: href }[format('%s', disabled)]"
34
+ :target="target"
35
+ :rel="rel"
36
+ :aria-disabled="{ true: 'true', false: null }[format('%s', disabled and href)]"
37
+ >
38
+ <slot></slot>
39
+ </a>
40
+ <button $else :type="type" :disabled="disabled">
41
+ <slot></slot>
42
+ </button>
43
+ </template>
40
44
  <style>
41
45
  /* This component's hooks style the element they are set on, and never a nested one. */
42
46
  @property --ui-button-active-surface {
@@ -6,8 +6,15 @@
6
6
  <prop name="padding" type="sm | md | lg" default="md"
7
7
  >The space inside the card: sm is snug (0.75rem), md is the default (1.5rem), and lg is roomy (2rem).</prop>
8
8
  <prop name="tone" type="neutral | danger" default="neutral">danger draws an outlined card's border in the danger colour.</prop>
9
+ <prop name="as" type="div | section | article | aside" default="div"
10
+ >The native element the card renders. Choose the one that names the content: a section of a page, a self-contained article, or an aside.</prop>
9
11
  </defs>
10
- <div as="div|section|article|aside"><slot></slot></div>
12
+ <template $match>
13
+ <section $when="as = 'section'"><slot></slot></section>
14
+ <article $when="as = 'article'"><slot></slot></article>
15
+ <aside $when="as = 'aside'"><slot></slot></aside>
16
+ <div $else><slot></slot></div>
17
+ </template>
11
18
  <style>
12
19
  /* A surface that groups content. Its children stack with even space between them, so a card
13
20
  needs no layout of its own. */
@@ -232,7 +232,7 @@
232
232
  </div>
233
233
  <slot name="footer"></slot>
234
234
  </div>
235
- <div class="message" :id="format('%s-validation', uid)" :hidden="not validation.issues[0]">
235
+ <div class="message" :id="format('%s-validation', uid)" :hidden="not validation.issues.length">
236
236
  <div $each="issue of validation.issues" $value="issue.message"></div>
237
237
  </div>
238
238
  <div class="sr-only" role="status" aria-live="polite" aria-atomic="true" $value="statusText"></div>
@@ -9,25 +9,35 @@
9
9
  item is a button, for switching views inside the app.</prop>
10
10
  <prop name="target" type="string">Where a link opens, as on a native link. Only meaningful with as="a".</prop>
11
11
  <prop name="rel" type="string">The link's relationship to its destination, as on a native link. Only meaningful with as="a".</prop>
12
- <!-- One root, a button or a link (as="a"), as Button does. A button never submits a form; a link
13
- carries no type. The language has no conditional expression, so a table keyed by a value's
14
- text picks each attribute, and null leaves it off. -->
12
+ <prop name="as" type="button | a" default="button">The native element the item renders: a button, or a link (a) that navigates to href.</prop>
13
+ <!-- A button or a link, as Button does. A button never submits a form; a link carries no type. The
14
+ language has no conditional expression, so a table keyed by a value's text picks each attribute,
15
+ and null leaves it off. -->
15
16
  </defs>
16
- <button
17
- as="button|a"
18
- :type="{ true: 'button', false: null }[format('%s', not href)]"
19
- :href="href"
20
- :target="target"
21
- :rel="rel"
22
- :aria-current="{ true: 'page', false: null, page: 'page', step: 'step', location: 'location' }[format('%s', current)]"
23
- >
24
- <span class="indicator" aria-hidden="true"></span>
25
- <span class="leading"><slot name="leading"></slot></span>
26
- <span class="content">
27
- <span class="label"><slot></slot></span>
28
- <span class="description"><slot name="description"></slot></span>
29
- </span>
30
- </button>
17
+ <template $match>
18
+ <a
19
+ $when="as = 'a'"
20
+ :href="href"
21
+ :target="target"
22
+ :rel="rel"
23
+ :aria-current="{ true: 'page', false: null, page: 'page', step: 'step', location: 'location' }[format('%s', current)]"
24
+ >
25
+ <span class="indicator" aria-hidden="true"></span>
26
+ <span class="leading"><slot name="leading"></slot></span>
27
+ <span class="content">
28
+ <span class="label"><slot></slot></span>
29
+ <span class="description"><slot name="description"></slot></span>
30
+ </span>
31
+ </a>
32
+ <button $else type="button" :aria-current="{ true: 'page', false: null, page: 'page', step: 'step', location: 'location' }[format('%s', current)]">
33
+ <span class="indicator" aria-hidden="true"></span>
34
+ <span class="leading"><slot name="leading"></slot></span>
35
+ <span class="content">
36
+ <span class="label"><slot></slot></span>
37
+ <span class="description"><slot name="description"></slot></span>
38
+ </span>
39
+ </button>
40
+ </template>
31
41
  <style>
32
42
  /* This component's hooks style the element they are set on, and never a nested one. */
33
43
  @property --ui-nav-item-current-surface {
@@ -13,8 +13,18 @@
13
13
  exactly, such as an address, in the monospace face.</prop>
14
14
  <prop name="truncate" type="boolean" default="false">Keeps the text on one line, ending in an ellipsis when it does not fit.</prop>
15
15
  <prop name="align" type="start | center" default="start">Aligns the text within its line.</prop>
16
+ <prop name="as" type="p | span | div | small | strong | label" default="p"
17
+ >The native element the text renders: a paragraph by default, inline span, small, or strong within a line, a div for a block, or a label for a
18
+ control.</prop>
16
19
  </defs>
17
- <p as="p|span|div|small|strong|label"><slot></slot></p>
20
+ <template $match>
21
+ <span $when="as = 'span'"><slot></slot></span>
22
+ <div $when="as = 'div'"><slot></slot></div>
23
+ <small $when="as = 'small'"><slot></slot></small>
24
+ <strong $when="as = 'strong'"><slot></slot></strong>
25
+ <label $when="as = 'label'"><slot></slot></label>
26
+ <p $else><slot></slot></p>
27
+ </template>
18
28
  <style>
19
29
  /* Running text, set on the type scale and in a tone that says what it is, so a view never styles
20
30
  text of its own. The root is a paragraph unless as= names a span, div, small, strong, or label. */