@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,6 +1,9 @@
1
1
  <template component="ui-affordance-scope" controller="./ui-affordance-scope.js">
2
2
  <defs>
3
3
  <prop name="nearRadius" type="number" default="16">How close, in pixels, the pointer must come to reveal an affordance.</prop>
4
+ <prop name="guide" type="dot | none" default="dot"
5
+ >What marks an anticipatory control at rest. dot shows a small guide dot where it will appear; none shows nothing until the pointer nears it, it is hovered,
6
+ or it takes focus. Every guide inside the scope follows it, including a sidebar's resize line and the editor table's handles.</prop>
4
7
  <state name="engaged" :value="false"></state>
5
8
  </defs>
6
9
  <span><slot></slot></span>
@@ -8,12 +11,18 @@
8
11
  :host {
9
12
  display: contents;
10
13
  --ui-affordance-scope-engaged: 0;
14
+ --ui-affordance-scope-guide: 1;
11
15
  }
12
16
 
13
17
  :host-state([engaged]) {
14
18
  --ui-affordance-scope-engaged: 1;
15
19
  }
16
20
 
21
+ /* Published to descendants: each guide multiplies its opacity by it, so none reaches them all. */
22
+ :host-state([guide="none"]) {
23
+ --ui-affordance-scope-guide: 0;
24
+ }
25
+
17
26
  /* A component that sets its display still honours the hidden attribute on its root. */
18
27
  :host[hidden] {
19
28
  display: none;
@@ -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>
@@ -265,7 +265,7 @@
265
265
  height: var(--ui-affordance-guide-size);
266
266
  border-radius: var(--ui-radius-round);
267
267
  background: var(--ui-affordance-guide-color, var(--ui-border-strong));
268
- opacity: var(--ui-affordance-guide-opacity);
268
+ opacity: calc(var(--ui-affordance-guide-opacity) * var(--ui-affordance-scope-guide, 1));
269
269
  transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease);
270
270
  }
271
271
 
@@ -354,7 +354,7 @@
354
354
  inset: 50% auto auto 50%;
355
355
  border-radius: var(--ui-radius-round);
356
356
  background: var(--ui-affordance-guide-color, var(--ui-border-strong));
357
- opacity: var(--ui-affordance-guide-opacity);
357
+ opacity: calc(var(--ui-affordance-guide-opacity) * var(--ui-affordance-scope-guide, 1));
358
358
  transform: translate(-50%, -50%);
359
359
  transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease);
360
360
  pointer-events: none;
@@ -112,7 +112,7 @@
112
112
  block-size: var(--ui-affordance-guide-size);
113
113
  border-radius: var(--ui-radius-round);
114
114
  background: var(--ui-affordance-guide-color, var(--ui-border-strong));
115
- opacity: var(--ui-affordance-guide-opacity);
115
+ opacity: calc(var(--ui-affordance-guide-opacity) * var(--ui-affordance-scope-guide, 1));
116
116
  transform: translate(-50%, -50%);
117
117
  transition: opacity var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease);
118
118
  pointer-events: none;
@@ -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 {
@@ -130,7 +130,7 @@
130
130
  inset-inline-start: 3px;
131
131
  inline-size: 2px;
132
132
  background: color-mix(in srgb, var(--ui-affordance-guide-color, var(--ui-border-strong)) 45%, transparent);
133
- opacity: var(--ui-affordance-guide-opacity);
133
+ opacity: calc(var(--ui-affordance-guide-opacity) * var(--ui-affordance-scope-guide, 1));
134
134
  transition:
135
135
  background-color var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease),
136
136
  opacity var(--ui-affordance-motion, var(--ui-motion-fast)) var(--ui-motion-ease);
@@ -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. */