@threadlabs/looma 0.14.8 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (336) hide show
  1. package/components/shared/icons.js +5 -0
  2. package/components/shared/menu-navigation.js +49 -0
  3. package/components/shared/overlay.js +33 -60
  4. package/components/ui-avatar/ui-avatar.html +19 -2
  5. package/components/ui-avatar/ui-avatar.js +7 -1
  6. package/components/ui-avatar-group/ui-avatar-group.html +8 -3
  7. package/components/ui-avatar-group/ui-avatar-group.js +6 -2
  8. package/components/ui-badge/ui-badge.html +70 -4
  9. package/components/ui-button/ui-button.html +21 -5
  10. package/components/ui-button/ui-button.js +10 -0
  11. package/components/ui-callout/ui-callout.html +13 -5
  12. package/components/ui-checkbox/ui-checkbox.html +11 -0
  13. package/components/ui-combobox/ui-combobox.html +46 -10
  14. package/components/ui-combobox/ui-combobox.js +5 -5
  15. package/components/ui-context-menu/ui-context-menu.html +33 -5
  16. package/components/ui-context-menu/ui-context-menu.js +26 -17
  17. package/components/ui-dialog/ui-dialog.html +51 -8
  18. package/components/ui-dialog/ui-dialog.js +28 -7
  19. package/components/ui-disclosure/ui-disclosure.html +14 -5
  20. package/components/ui-disclosure/ui-disclosure.js +51 -4
  21. package/components/ui-editable/ui-editable.html +17 -3
  22. package/components/ui-editable/ui-editable.js +7 -0
  23. package/components/ui-editor-insert-table-grid/ui-editor-insert-table-grid.html +48 -14
  24. package/components/ui-editor-insert-table-grid/ui-editor-insert-table-grid.js +40 -6
  25. package/components/ui-editor-mention-menu/ui-editor-mention-menu.html +22 -9
  26. package/components/ui-editor-mention-menu/ui-editor-mention-menu.js +33 -11
  27. package/components/ui-editor-mention-menu-item/ui-editor-mention-menu-item.html +67 -0
  28. package/components/ui-editor-slash-menu/ui-editor-slash-menu.html +33 -30
  29. package/components/ui-editor-slash-menu/ui-editor-slash-menu.js +42 -8
  30. package/components/ui-editor-slash-menu-group/ui-editor-slash-menu-group.html +31 -0
  31. package/components/ui-editor-slash-menu-item/ui-editor-slash-menu-item.html +75 -0
  32. package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.html +16 -5
  33. package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.js +10 -2
  34. package/components/ui-editor-table-overlay/ui-editor-table-overlay.html +5 -5
  35. package/components/ui-editor-table-overlay/ui-editor-table-overlay.js +5 -2
  36. package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.html +14 -4
  37. package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.js +2 -2
  38. package/components/ui-editor-toolbar/ui-editor-toolbar.html +1 -1
  39. package/components/ui-editor-toolbar/ui-editor-toolbar.js +46 -0
  40. package/components/ui-floating-action-button/ui-floating-action-button.html +1 -1
  41. package/components/ui-form-field/ui-form-field.html +16 -3
  42. package/components/ui-form-field/ui-form-field.js +1 -1
  43. package/components/ui-grid/ui-grid.html +17 -2
  44. package/components/ui-icon/ui-icon.html +5 -0
  45. package/components/ui-icon-button/ui-icon-button.html +25 -6
  46. package/components/ui-icon-button/ui-icon-button.js +11 -1
  47. package/components/ui-input/ui-input.html +3 -3
  48. package/components/ui-input-group/ui-input-group.html +18 -4
  49. package/components/ui-listbox/ui-listbox.html +81 -0
  50. package/components/ui-listbox/ui-listbox.js +27 -0
  51. package/components/ui-menu/ui-menu.html +33 -5
  52. package/components/ui-menu/ui-menu.js +18 -12
  53. package/components/ui-menu-group/ui-menu-group.html +27 -0
  54. package/components/ui-menu-item/ui-menu-item.html +80 -8
  55. package/components/ui-menu-item/ui-menu-item.js +47 -0
  56. package/components/ui-popover/ui-popover.html +33 -5
  57. package/components/ui-popover/ui-popover.js +9 -1
  58. package/components/ui-radio-group/ui-radio-group.html +13 -1
  59. package/components/ui-search-shell/ui-search-shell.html +6 -6
  60. package/components/ui-search-shell/ui-search-shell.js +21 -5
  61. package/components/ui-select/ui-select.html +14 -4
  62. package/components/ui-switch/ui-switch.html +2 -2
  63. package/components/ui-switcher/ui-switcher.html +8 -1
  64. package/components/ui-switcher/ui-switcher.js +15 -0
  65. package/components/ui-tabs/ui-tabs.html +17 -12
  66. package/components/ui-tabs/ui-tabs.js +43 -7
  67. package/components/ui-textarea/ui-textarea.html +28 -5
  68. package/components/ui-toast/ui-toast.html +88 -0
  69. package/components/ui-toast/ui-toast.js +68 -0
  70. package/components/ui-toast-region/ui-toast-region.html +102 -19
  71. package/components/ui-toast-region/ui-toast-region.js +10 -18
  72. package/components/ui-tooltip/ui-tooltip.html +51 -7
  73. package/components/ui-tooltip/ui-tooltip.js +29 -3
  74. package/components/ui-tree/ui-tree.html +12 -0
  75. package/components/ui-tree/ui-tree.js +191 -12
  76. package/components/ui-tree-item/ui-tree-item.html +87 -8
  77. package/components/ui-tree-item/ui-tree-item.js +3 -1
  78. package/dist/index.js +38 -32
  79. package/editor/chunks/extensions.js +82 -2
  80. package/editor/extensions/table-commands.d.ts +8 -0
  81. package/editor/icons.d.ts +5 -0
  82. package/editor/index.js +7 -2
  83. package/editor/insert-table-grid.d.ts +1 -1
  84. package/editor/mention-menu.d.ts +2 -0
  85. package/editor/slash-menu.d.ts +3 -0
  86. package/editor/table-context-menu.d.ts +1 -1
  87. package/editor/table-overlay.d.ts +2 -2
  88. package/package.json +1 -1
  89. package/styles/ui-avatar-group.css +1 -2
  90. package/styles/ui-avatar.css +11 -1
  91. package/styles/ui-badge.css +73 -1
  92. package/styles/ui-button.css +9 -1
  93. package/styles/ui-callout.css +1 -1
  94. package/styles/ui-checkbox.css +9 -0
  95. package/styles/ui-combobox.css +38 -7
  96. package/styles/ui-context-menu.css +32 -4
  97. package/styles/ui-dialog.css +42 -5
  98. package/styles/ui-editor-insert-table-grid.css +48 -11
  99. package/styles/ui-editor-mention-menu-item.css +57 -0
  100. package/styles/ui-editor-mention-menu.css +11 -1
  101. package/styles/ui-editor-slash-menu-group.css +21 -0
  102. package/styles/ui-editor-slash-menu-item.css +62 -0
  103. package/styles/ui-editor-slash-menu.css +10 -21
  104. package/styles/ui-editor-table-context-menu.css +1 -1
  105. package/styles/ui-floating-action-button.css +1 -1
  106. package/styles/ui-form-field.css +14 -1
  107. package/styles/ui-grid.css +14 -1
  108. package/styles/ui-icon-button.css +17 -5
  109. package/styles/ui-input-group.css +18 -4
  110. package/styles/ui-input.css +3 -3
  111. package/styles/ui-listbox.css +69 -0
  112. package/styles/ui-menu-group.css +19 -0
  113. package/styles/ui-menu-item.css +48 -9
  114. package/styles/ui-menu.css +32 -4
  115. package/styles/ui-popover.css +28 -4
  116. package/styles/ui-radio-group.css +9 -0
  117. package/styles/ui-search-shell.css +5 -5
  118. package/styles/ui-select.css +14 -4
  119. package/styles/ui-switch.css +2 -2
  120. package/styles/ui-switcher.css +4 -0
  121. package/styles/ui-textarea.css +27 -4
  122. package/styles/ui-toast-region.css +88 -4
  123. package/styles/ui-toast.css +74 -0
  124. package/styles/ui-tooltip.css +46 -6
  125. package/styles/ui-tree-item.css +72 -4
  126. package/styles/ui-tree.css +8 -0
  127. package/tokens.css +3 -0
  128. package/vanilla/UiAvatar.d.ts +2 -0
  129. package/vanilla/UiAvatar.js +8 -1
  130. package/vanilla/UiAvatarGroup.d.ts +2 -0
  131. package/vanilla/UiAvatarGroup.js +1 -1
  132. package/vanilla/UiBadge.d.ts +1 -1
  133. package/vanilla/UiBadge.js +1 -1
  134. package/vanilla/UiButton.d.ts +1 -0
  135. package/vanilla/UiButton.js +22 -6
  136. package/vanilla/UiCallout.d.ts +1 -1
  137. package/vanilla/UiCallout.js +1 -1
  138. package/vanilla/UiCheckbox.d.ts +1 -0
  139. package/vanilla/UiCheckbox.js +12 -9
  140. package/vanilla/UiCombobox.d.ts +3 -0
  141. package/vanilla/UiCombobox.js +30 -15
  142. package/vanilla/UiContextMenu.d.ts +1 -1
  143. package/vanilla/UiContextMenu.js +1 -1
  144. package/vanilla/UiDialog.d.ts +5 -2
  145. package/vanilla/UiDialog.js +1 -1
  146. package/vanilla/UiDisclosure.d.ts +2 -0
  147. package/vanilla/UiDisclosure.js +32 -18
  148. package/vanilla/UiEditable.d.ts +5 -0
  149. package/vanilla/UiEditable.js +7 -3
  150. package/vanilla/UiEditorInsertTableGrid.js +1 -6
  151. package/vanilla/UiEditorMentionMenu.d.ts +4 -2
  152. package/vanilla/UiEditorMentionMenu.js +49 -31
  153. package/vanilla/UiEditorMentionMenuItem.d.ts +16 -0
  154. package/vanilla/UiEditorMentionMenuItem.js +56 -0
  155. package/vanilla/UiEditorSlashMenu.d.ts +4 -3
  156. package/vanilla/UiEditorSlashMenu.js +59 -46
  157. package/vanilla/UiEditorSlashMenuGroup.d.ts +14 -0
  158. package/vanilla/UiEditorSlashMenuGroup.js +48 -0
  159. package/vanilla/UiEditorSlashMenuItem.d.ts +18 -0
  160. package/vanilla/UiEditorSlashMenuItem.js +57 -0
  161. package/vanilla/UiEditorTableContextMenu.d.ts +5 -2
  162. package/vanilla/UiEditorTableContextMenu.js +1 -2
  163. package/vanilla/UiEditorTableOverlay.d.ts +1 -1
  164. package/vanilla/UiEditorTableOverlay.js +5 -5
  165. package/vanilla/UiEditorTableToolbar.d.ts +4 -2
  166. package/vanilla/UiEditorTableToolbar.js +1 -2
  167. package/vanilla/UiEditorToolbar.js +2 -0
  168. package/vanilla/UiGrid.d.ts +1 -0
  169. package/vanilla/UiGrid.js +8 -7
  170. package/vanilla/UiIcon.js +1 -1
  171. package/vanilla/UiIconButton.d.ts +1 -0
  172. package/vanilla/UiIconButton.js +11 -2
  173. package/vanilla/UiListbox.d.ts +20 -0
  174. package/vanilla/UiListbox.js +45 -0
  175. package/vanilla/UiMenu.d.ts +1 -1
  176. package/vanilla/UiMenu.js +1 -1
  177. package/vanilla/UiMenuGroup.d.ts +14 -0
  178. package/vanilla/UiMenuGroup.js +35 -0
  179. package/vanilla/UiMenuItem.d.ts +5 -1
  180. package/vanilla/UiMenuItem.js +91 -30
  181. package/vanilla/UiPopover.d.ts +1 -1
  182. package/vanilla/UiPopover.js +1 -1
  183. package/vanilla/UiRadioGroup.d.ts +1 -0
  184. package/vanilla/UiRadioGroup.js +6 -3
  185. package/vanilla/UiSwitcher.d.ts +1 -0
  186. package/vanilla/UiSwitcher.js +7 -9
  187. package/vanilla/UiTabs.d.ts +1 -0
  188. package/vanilla/UiTabs.js +9 -1
  189. package/vanilla/UiTextarea.d.ts +1 -0
  190. package/vanilla/UiTextarea.js +4 -1
  191. package/vanilla/UiToast.d.ts +16 -0
  192. package/vanilla/UiToast.js +53 -0
  193. package/vanilla/UiToastRegion.d.ts +1 -4
  194. package/vanilla/UiToastRegion.js +3 -11
  195. package/vanilla/UiTooltip.d.ts +1 -1
  196. package/vanilla/UiTooltip.js +1 -1
  197. package/vanilla/UiTree.d.ts +2 -0
  198. package/vanilla/UiTree.js +1 -1
  199. package/vanilla/UiTreeItem.d.ts +1 -0
  200. package/vanilla/UiTreeItem.js +45 -31
  201. package/vanilla/index.js +6 -0
  202. package/vue/UiAvatar.d.ts +4 -0
  203. package/vue/UiAvatar.vue +23 -3
  204. package/vue/UiAvatarGroup.d.ts +3 -0
  205. package/vue/UiAvatarGroup.vue +7 -4
  206. package/vue/UiBadge.d.ts +2 -2
  207. package/vue/UiBadge.vue +74 -2
  208. package/vue/UiButton.d.ts +5 -3
  209. package/vue/UiButton.vue +41 -7
  210. package/vue/UiCallout.d.ts +2 -2
  211. package/vue/UiCallout.vue +3 -2
  212. package/vue/UiCheckbox.d.ts +2 -0
  213. package/vue/UiCheckbox.vue +16 -0
  214. package/vue/UiCombobox.d.ts +11 -3
  215. package/vue/UiCombobox.vue +60 -11
  216. package/vue/UiContextMenu.d.ts +2 -0
  217. package/vue/UiContextMenu.vue +47 -6
  218. package/vue/UiDialog.d.ts +18 -4
  219. package/vue/UiDialog.vue +86 -11
  220. package/vue/UiDisclosure.d.ts +8 -2
  221. package/vue/UiDisclosure.vue +38 -14
  222. package/vue/UiEditable.d.ts +10 -0
  223. package/vue/UiEditable.vue +14 -2
  224. package/vue/UiEditorInsertTableGrid.vue +52 -15
  225. package/vue/UiEditorMentionMenu.d.ts +24 -2
  226. package/vue/UiEditorMentionMenu.vue +27 -11
  227. package/vue/UiEditorMentionMenuItem.d.ts +24 -0
  228. package/vue/UiEditorMentionMenuItem.js +2 -0
  229. package/vue/UiEditorMentionMenuItem.vue +88 -0
  230. package/vue/UiEditorSlashMenu.d.ts +24 -1
  231. package/vue/UiEditorSlashMenu.vue +33 -33
  232. package/vue/UiEditorSlashMenuGroup.d.ts +18 -0
  233. package/vue/UiEditorSlashMenuGroup.js +2 -0
  234. package/vue/UiEditorSlashMenuGroup.vue +43 -0
  235. package/vue/UiEditorSlashMenuItem.d.ts +26 -0
  236. package/vue/UiEditorSlashMenuItem.js +2 -0
  237. package/vue/UiEditorSlashMenuItem.vue +101 -0
  238. package/vue/UiEditorTableContextMenu.d.ts +9 -3
  239. package/vue/UiEditorTableContextMenu.vue +53 -3
  240. package/vue/UiEditorTableOverlay.d.ts +2 -2
  241. package/vue/UiEditorTableOverlay.vue +8 -6
  242. package/vue/UiEditorTableToolbar.d.ts +7 -3
  243. package/vue/UiEditorTableToolbar.vue +50 -2
  244. package/vue/UiEditorToolbar.vue +14 -1
  245. package/vue/UiFloatingActionButton.vue +1 -1
  246. package/vue/UiFormField.vue +28 -3
  247. package/vue/UiGrid.d.ts +1 -0
  248. package/vue/UiGrid.vue +26 -2
  249. package/vue/UiIcon.vue +16 -0
  250. package/vue/UiIconButton.d.ts +5 -3
  251. package/vue/UiIconButton.vue +40 -6
  252. package/vue/UiInput.vue +10 -3
  253. package/vue/UiInputGroup.vue +32 -11
  254. package/vue/UiListbox.d.ts +33 -0
  255. package/vue/UiListbox.js +2 -0
  256. package/vue/UiListbox.vue +131 -0
  257. package/vue/UiMenu.d.ts +2 -0
  258. package/vue/UiMenu.vue +43 -6
  259. package/vue/UiMenuGroup.d.ts +18 -0
  260. package/vue/UiMenuGroup.js +2 -0
  261. package/vue/UiMenuGroup.vue +39 -0
  262. package/vue/UiMenuItem.d.ts +34 -2
  263. package/vue/UiMenuItem.vue +145 -9
  264. package/vue/UiPopover.d.ts +2 -2
  265. package/vue/UiPopover.vue +44 -5
  266. package/vue/UiRadioGroup.d.ts +2 -0
  267. package/vue/UiRadioGroup.vue +17 -0
  268. package/vue/UiSearchShell.vue +12 -5
  269. package/vue/UiSelect.vue +18 -4
  270. package/vue/UiSwitch.vue +2 -2
  271. package/vue/UiSwitcher.d.ts +1 -0
  272. package/vue/UiSwitcher.vue +22 -1
  273. package/vue/UiTabs.d.ts +6 -2
  274. package/vue/UiTabs.vue +14 -12
  275. package/vue/UiTextarea.d.ts +2 -0
  276. package/vue/UiTextarea.vue +32 -4
  277. package/vue/UiToast.d.ts +34 -0
  278. package/vue/UiToast.js +2 -0
  279. package/vue/UiToast.vue +173 -0
  280. package/vue/UiToastRegion.d.ts +2 -18
  281. package/vue/UiToastRegion.vue +123 -48
  282. package/vue/UiTooltip.d.ts +2 -2
  283. package/vue/UiTooltip.vue +67 -12
  284. package/vue/UiTree.d.ts +10 -0
  285. package/vue/UiTree.vue +27 -0
  286. package/vue/UiTreeItem.d.ts +2 -0
  287. package/vue/UiTreeItem.vue +96 -4
  288. package/vue/chunks/UiAvatar.js +19 -5
  289. package/vue/chunks/UiAvatarGroup.js +10 -4
  290. package/vue/chunks/UiBadge.js +1 -1
  291. package/vue/chunks/UiButton.js +58 -11
  292. package/vue/chunks/UiCallout.js +2 -2
  293. package/vue/chunks/UiCheckbox.js +12 -2
  294. package/vue/chunks/UiCombobox.js +29 -13
  295. package/vue/chunks/UiContextMenu.js +6 -2
  296. package/vue/chunks/UiDialog.js +25 -8
  297. package/vue/chunks/UiDisclosure.js +36 -12
  298. package/vue/chunks/UiEditable.js +22 -8
  299. package/vue/chunks/UiEditorInsertTableGrid.js +11 -14
  300. package/vue/chunks/UiEditorMentionMenu.js +30 -19
  301. package/vue/chunks/UiEditorMentionMenuItem.js +36 -0
  302. package/vue/chunks/UiEditorSlashMenu.js +33 -35
  303. package/vue/chunks/UiEditorSlashMenuGroup.js +26 -0
  304. package/vue/chunks/UiEditorSlashMenuItem.js +51 -0
  305. package/vue/chunks/UiEditorTableContextMenu.js +39 -5
  306. package/vue/chunks/UiEditorTableOverlay.js +6 -6
  307. package/vue/chunks/UiEditorTableToolbar.js +37 -4
  308. package/vue/chunks/UiEditorToolbar.js +18 -4
  309. package/vue/chunks/UiFloatingActionButton.js +1 -1
  310. package/vue/chunks/UiFormField.js +13 -9
  311. package/vue/chunks/UiGrid.js +6 -2
  312. package/vue/chunks/UiIcon.js +40 -2
  313. package/vue/chunks/UiIconButton.js +35 -4
  314. package/vue/chunks/UiInput.js +1 -1
  315. package/vue/chunks/UiInputGroup.js +1 -1
  316. package/vue/chunks/UiListbox.js +70 -0
  317. package/vue/chunks/UiMenu.js +6 -2
  318. package/vue/chunks/UiMenuGroup.js +25 -0
  319. package/vue/chunks/UiMenuItem.js +128 -7
  320. package/vue/chunks/UiPopover.js +1 -1
  321. package/vue/chunks/UiRadioGroup.js +8 -2
  322. package/vue/chunks/UiSearchShell.js +1 -1
  323. package/vue/chunks/UiSelect.js +1 -1
  324. package/vue/chunks/UiSwitch.js +1 -1
  325. package/vue/chunks/UiSwitcher.js +20 -3
  326. package/vue/chunks/UiTabs.js +4 -3
  327. package/vue/chunks/UiTextarea.js +7 -2
  328. package/vue/chunks/UiToast.js +81 -0
  329. package/vue/chunks/UiToastRegion.js +25 -49
  330. package/vue/chunks/UiTooltip.js +3 -7
  331. package/vue/chunks/UiTree.js +8 -4
  332. package/vue/chunks/UiTreeItem.js +28 -10
  333. package/vue/components.css +1840 -851
  334. package/vue/editor/index.js +263 -2
  335. package/vue/index.d.ts +6 -0
  336. package/vue/index.js +9 -3
@@ -0,0 +1,101 @@
1
+ <!-- Generated by HTML Next 1.0.0-alpha.7 for Vue 3.5. Do not edit. -->
2
+ <script setup lang="ts">
3
+ import UiIcon from './UiIcon.vue'
4
+
5
+ defineOptions({ inheritAttrs: false })
6
+
7
+ withDefaults(
8
+ defineProps<{
9
+ description?: string
10
+ disabled?: boolean
11
+ icon?: string
12
+ keywords?: string
13
+ value?: string
14
+ }>(),
15
+ {
16
+ description: '',
17
+ disabled: false,
18
+ icon: '',
19
+ keywords: '',
20
+ value: '',
21
+ },
22
+ )
23
+ </script>
24
+
25
+ <template>
26
+ <li
27
+ data-component="ui-editor-slash-menu-item"
28
+ role="option"
29
+ tabindex="-1"
30
+ v-bind="$attrs"
31
+ :aria-disabled="disabled"
32
+ :data-value="value"
33
+ :data-keywords="keywords"
34
+ >
35
+ <span v-if="icon" class="icon" aria-hidden="true"><UiIcon :name="icon" /></span>
36
+ <span class="body"><span class="title"><slot /></span>
37
+ <span v-if="description" class="description">{{ description }}</span></span>
38
+ </li>
39
+ </template>
40
+
41
+ <style scoped>
42
+ [data-component~="ui-editor-slash-menu-item"] {
43
+ display: flex;
44
+ align-items: center;
45
+ gap: var(--ui-space-3);
46
+ min-block-size: 44px;
47
+ padding: var(--ui-space-2) var(--ui-space-3);
48
+ cursor: pointer;
49
+ list-style: none;
50
+ }
51
+
52
+ [data-component~="ui-editor-slash-menu-item"][aria-selected="true"] {
53
+ background: var(--ui-accent-subtle);
54
+ }
55
+ [data-component~="ui-editor-slash-menu-item"][aria-disabled="true"] {
56
+ opacity: 0.6;
57
+ cursor: not-allowed;
58
+ }
59
+
60
+ .icon {
61
+ display: flex;
62
+ align-items: center;
63
+ justify-content: center;
64
+ inline-size: 32px;
65
+ block-size: 32px;
66
+ flex: 0 0 auto;
67
+ color: var(--ui-text-secondary);
68
+ background: var(--ui-surface-hover);
69
+ border: 1px solid var(--ui-border);
70
+ border-radius: var(--ui-radius-md);
71
+ }
72
+
73
+ .icon {
74
+ --_ui-default-icon-size: 1rem;
75
+ }
76
+
77
+ .body {
78
+ display: flex;
79
+ min-inline-size: 0;
80
+ flex-direction: column;
81
+ gap: 1px;
82
+ }
83
+ .title, .description {
84
+ overflow: hidden;
85
+ text-overflow: ellipsis;
86
+ white-space: nowrap;
87
+ }
88
+ .title {
89
+ color: var(--ui-text-primary);
90
+ font-size: var(--ui-font-size-sm);
91
+ font-weight: var(--ui-font-medium);
92
+ }
93
+ .description {
94
+ color: var(--ui-text-muted);
95
+ font-size: var(--ui-font-size-xs);
96
+ }
97
+
98
+ [data-component~="ui-editor-slash-menu-item"][hidden] {
99
+ display: none;
100
+ }
101
+ </style>
@@ -1,19 +1,25 @@
1
1
  type __VLS_Props = {
2
- actions?: readonly ('align-left' | 'align-center' | 'align-right' | 'background-none' | 'background-gray' | 'background-yellow' | 'background-blue' | 'background-green' | 'background-red' | 'add-row-before' | 'add-row-after' | 'add-column-before' | 'add-column-after' | 'clear-cells' | 'merge-cells' | 'split-cell' | 'delete-row' | 'delete-column' | 'delete-table')[];
2
+ actions?: readonly ('align-left' | 'align-center' | 'align-right' | 'background-none' | 'background-gray' | 'background-yellow' | 'background-blue' | 'background-green' | 'background-red' | 'add-row-before' | 'add-row-after' | 'add-column-before' | 'add-column-after' | 'toggle-header-row' | 'toggle-header-column' | 'move-row-up' | 'move-row-down' | 'move-column-left' | 'move-column-right' | 'clear-cells' | 'merge-cells' | 'split-cell' | 'delete-row' | 'delete-column' | 'delete-table')[];
3
3
  cellBackground?: string;
4
+ headerColumn?: boolean;
5
+ headerRow?: boolean;
4
6
  open?: boolean;
7
+ scope?: 'cell' | 'row' | 'column';
5
8
  };
6
9
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
10
  action: (detail: {
8
- readonly action: "align-left" | "align-center" | "align-right" | "background-none" | "background-gray" | "background-yellow" | "background-blue" | "background-green" | "background-red" | "add-row-before" | "add-row-after" | "add-column-before" | "add-column-after" | "clear-cells" | "merge-cells" | "split-cell" | "delete-row" | "delete-column" | "delete-table";
11
+ readonly action: "align-left" | "align-center" | "align-right" | "background-none" | "background-gray" | "background-yellow" | "background-blue" | "background-green" | "background-red" | "add-row-before" | "add-row-after" | "add-column-before" | "add-column-after" | "toggle-header-row" | "toggle-header-column" | "move-row-up" | "move-row-down" | "move-column-left" | "move-column-right" | "clear-cells" | "merge-cells" | "split-cell" | "delete-row" | "delete-column" | "delete-table";
9
12
  }) => any;
10
13
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
11
14
  onAction?: ((detail: {
12
- readonly action: "align-left" | "align-center" | "align-right" | "background-none" | "background-gray" | "background-yellow" | "background-blue" | "background-green" | "background-red" | "add-row-before" | "add-row-after" | "add-column-before" | "add-column-after" | "clear-cells" | "merge-cells" | "split-cell" | "delete-row" | "delete-column" | "delete-table";
15
+ readonly action: "align-left" | "align-center" | "align-right" | "background-none" | "background-gray" | "background-yellow" | "background-blue" | "background-green" | "background-red" | "add-row-before" | "add-row-after" | "add-column-before" | "add-column-after" | "toggle-header-row" | "toggle-header-column" | "move-row-up" | "move-row-down" | "move-column-left" | "move-column-right" | "clear-cells" | "merge-cells" | "split-cell" | "delete-row" | "delete-column" | "delete-table";
13
16
  }) => any) | undefined;
14
17
  }>, {
15
18
  open: boolean;
19
+ headerRow: boolean;
16
20
  cellBackground: string;
21
+ headerColumn: boolean;
22
+ scope: "cell" | "row" | "column";
17
23
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
24
  declare const _default: typeof __VLS_export;
19
25
  export default _default;
@@ -24,6 +24,12 @@ const props = withDefaults(
24
24
  | 'add-row-after'
25
25
  | 'add-column-before'
26
26
  | 'add-column-after'
27
+ | 'toggle-header-row'
28
+ | 'toggle-header-column'
29
+ | 'move-row-up'
30
+ | 'move-row-down'
31
+ | 'move-column-left'
32
+ | 'move-column-right'
27
33
  | 'clear-cells'
28
34
  | 'merge-cells'
29
35
  | 'split-cell'
@@ -32,11 +38,17 @@ const props = withDefaults(
32
38
  | 'delete-table'
33
39
  )[]
34
40
  cellBackground?: string
41
+ headerColumn?: boolean
42
+ headerRow?: boolean
35
43
  open?: boolean
44
+ scope?: 'cell' | 'row' | 'column'
36
45
  }>(),
37
46
  {
38
47
  cellBackground: '',
48
+ headerColumn: false,
49
+ headerRow: false,
39
50
  open: false,
51
+ scope: 'cell',
40
52
  },
41
53
  )
42
54
  const emit = defineEmits<{
@@ -56,6 +68,12 @@ const emit = defineEmits<{
56
68
  | 'add-row-after'
57
69
  | 'add-column-before'
58
70
  | 'add-column-after'
71
+ | 'toggle-header-row'
72
+ | 'toggle-header-column'
73
+ | 'move-row-up'
74
+ | 'move-row-down'
75
+ | 'move-column-left'
76
+ | 'move-column-right'
59
77
  | 'clear-cells'
60
78
  | 'merge-cells'
61
79
  | 'split-cell'
@@ -71,7 +89,17 @@ const swatches = ref<{ action: string; label: string; color: string; selected: b
71
89
  [],
72
90
  )
73
91
  const sections = ref<
74
- { heading: string; items: { action: string; label: string; icon: string; danger: boolean }[] }[]
92
+ {
93
+ heading: string
94
+ items: {
95
+ action: string
96
+ label: string
97
+ icon: string
98
+ danger: boolean
99
+ checkable: boolean
100
+ checked: boolean
101
+ }[]
102
+ }[]
75
103
  >([])
76
104
 
77
105
  const isActionDetail = (detail: unknown): boolean =>
@@ -89,6 +117,12 @@ const isActionDetail = (detail: unknown): boolean =>
89
117
  || (detail as Record<string, unknown>)['action'] === 'add-row-after'
90
118
  || (detail as Record<string, unknown>)['action'] === 'add-column-before'
91
119
  || (detail as Record<string, unknown>)['action'] === 'add-column-after'
120
+ || (detail as Record<string, unknown>)['action'] === 'toggle-header-row'
121
+ || (detail as Record<string, unknown>)['action'] === 'toggle-header-column'
122
+ || (detail as Record<string, unknown>)['action'] === 'move-row-up'
123
+ || (detail as Record<string, unknown>)['action'] === 'move-row-down'
124
+ || (detail as Record<string, unknown>)['action'] === 'move-column-left'
125
+ || (detail as Record<string, unknown>)['action'] === 'move-column-right'
92
126
  || (detail as Record<string, unknown>)['action'] === 'clear-cells'
93
127
  || (detail as Record<string, unknown>)['action'] === 'merge-cells'
94
128
  || (detail as Record<string, unknown>)['action'] === 'split-cell'
@@ -108,6 +142,19 @@ useComponentHost(controllerModule.default, {
108
142
  props,
109
143
  state: { swatches, sections },
110
144
  })
145
+
146
+ function text(value: unknown): string {
147
+ if (Array.isArray(value)) return value.map(text).join(' ')
148
+ return value === null || value === undefined || typeof value === 'object' ? '' : String(value)
149
+ }
150
+
151
+ function attribute(value: unknown): any {
152
+ if (
153
+ value === null || value === undefined || value === false
154
+ || (typeof value === 'object' && !Array.isArray(value))
155
+ ) return undefined
156
+ return value === true ? '' : text(value)
157
+ }
111
158
  </script>
112
159
 
113
160
  <template>
@@ -147,7 +194,10 @@ useComponentHost(controllerModule.default, {
147
194
  v-for="item in section.items"
148
195
  :key="item.action"
149
196
  type="button"
150
- role="menuitem"
197
+ :role="attribute(({ true: 'menuitemcheckbox', false: 'menuitem' })[`${item.checkable}`])"
198
+ :aria-checked="typeof (({ true: item.checked, false: null })[`${item.checkable}`]) === 'boolean'
199
+ ? String(({ true: item.checked, false: null })[`${item.checkable}`])
200
+ : attribute(({ true: item.checked, false: null })[`${item.checkable}`])"
151
201
  :data-action="item.action"
152
202
  :class="{ danger: item.danger }"
153
203
  >
@@ -233,7 +283,7 @@ useComponentHost(controllerModule.default, {
233
283
  display: inline-flex;
234
284
  width: 1rem;
235
285
  height: 1rem;
236
- border-radius: 999px;
286
+ border-radius: var(--ui-radius-round);
237
287
  border: 1px solid var(--ui-border);
238
288
  background: var(--_swatch, #fff);
239
289
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.35);
@@ -30,7 +30,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
30
30
  readonly rowIndex: number;
31
31
  readonly columnIndex: number;
32
32
  } | {
33
- readonly action: "open-cell-menu";
33
+ readonly action: "open-cell-menu" | "open-row-menu" | "open-column-menu";
34
34
  readonly rowIndex: number;
35
35
  readonly columnIndex: number;
36
36
  readonly anchor: {
@@ -49,7 +49,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
49
49
  readonly rowIndex: number;
50
50
  readonly columnIndex: number;
51
51
  } | {
52
- readonly action: "open-cell-menu";
52
+ readonly action: "open-cell-menu" | "open-row-menu" | "open-column-menu";
53
53
  readonly rowIndex: number;
54
54
  readonly columnIndex: number;
55
55
  readonly anchor: {
@@ -45,7 +45,7 @@ const emit = defineEmits<{
45
45
  readonly rowIndex: number
46
46
  readonly columnIndex: number
47
47
  } | {
48
- readonly action: 'open-cell-menu'
48
+ readonly action: 'open-cell-menu' | 'open-row-menu' | 'open-column-menu'
49
49
  readonly rowIndex: number
50
50
  readonly columnIndex: number
51
51
  readonly anchor: {
@@ -122,7 +122,9 @@ const isActionDetail = (detail: unknown): boolean =>
122
122
  ['action', 'rowIndex', 'columnIndex'].includes(key)
123
123
  ))
124
124
  || (detail !== null && typeof detail === 'object' && !Array.isArray(detail)
125
- && (detail as Record<string, unknown>)['action'] === 'open-cell-menu'
125
+ && ((detail as Record<string, unknown>)['action'] === 'open-cell-menu'
126
+ || (detail as Record<string, unknown>)['action'] === 'open-row-menu'
127
+ || (detail as Record<string, unknown>)['action'] === 'open-column-menu')
126
128
  && Number.isInteger((detail as Record<string, unknown>)['rowIndex'])
127
129
  && Number.isInteger((detail as Record<string, unknown>)['columnIndex'])
128
130
  && ((detail as Record<string, unknown>)['anchor'] !== null
@@ -229,8 +231,8 @@ useComponentHost(controllerModule.default, {
229
231
  type="button"
230
232
  class="selector row"
231
233
  data-action="select-row"
232
- title="Select row"
233
- aria-label="Select row"
234
+ title="Row actions"
235
+ aria-label="Row actions"
234
236
  :data-row-index="hovered?.rowIndex"
235
237
  :data-column-index="hovered?.columnIndex"
236
238
  :style="{ top: hovered?.rowOffset }"
@@ -241,8 +243,8 @@ useComponentHost(controllerModule.default, {
241
243
  type="button"
242
244
  class="selector column"
243
245
  data-action="select-column"
244
- title="Select column"
245
- aria-label="Select column"
246
+ title="Column actions"
247
+ aria-label="Column actions"
246
248
  :data-row-index="hovered?.rowIndex"
247
249
  :data-column-index="hovered?.columnIndex"
248
250
  :style="{ left: hovered?.columnOffset }"
@@ -1,20 +1,24 @@
1
1
  type __VLS_Props = {
2
- actions?: readonly ('align-left' | 'align-center' | 'align-right' | 'background-none' | 'background-gray' | 'background-yellow' | 'background-blue' | 'background-green' | 'background-red' | 'add-row-before' | 'add-row-after' | 'add-column-before' | 'add-column-after' | 'clear-cells' | 'merge-cells' | 'split-cell' | 'delete-row' | 'delete-column' | 'delete-table')[];
2
+ actions?: readonly ('align-left' | 'align-center' | 'align-right' | 'background-none' | 'background-gray' | 'background-yellow' | 'background-blue' | 'background-green' | 'background-red' | 'add-row-before' | 'add-row-after' | 'add-column-before' | 'add-column-after' | 'toggle-header-row' | 'toggle-header-column' | 'move-row-up' | 'move-row-down' | 'move-column-left' | 'move-column-right' | 'clear-cells' | 'merge-cells' | 'split-cell' | 'delete-row' | 'delete-column' | 'delete-table')[];
3
3
  cellAlignment?: 'left' | 'center' | 'right';
4
4
  cellBackground?: string;
5
+ headerColumn?: boolean;
6
+ headerRow?: boolean;
5
7
  open?: boolean;
6
8
  };
7
9
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
10
  action: (detail: {
9
- readonly action: "align-left" | "align-center" | "align-right" | "background-none" | "background-gray" | "background-yellow" | "background-blue" | "background-green" | "background-red" | "add-row-before" | "add-row-after" | "add-column-before" | "add-column-after" | "clear-cells" | "merge-cells" | "split-cell" | "delete-row" | "delete-column" | "delete-table";
11
+ readonly action: "align-left" | "align-center" | "align-right" | "background-none" | "background-gray" | "background-yellow" | "background-blue" | "background-green" | "background-red" | "add-row-before" | "add-row-after" | "add-column-before" | "add-column-after" | "toggle-header-row" | "toggle-header-column" | "move-row-up" | "move-row-down" | "move-column-left" | "move-column-right" | "clear-cells" | "merge-cells" | "split-cell" | "delete-row" | "delete-column" | "delete-table";
10
12
  }) => any;
11
13
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
14
  onAction?: ((detail: {
13
- readonly action: "align-left" | "align-center" | "align-right" | "background-none" | "background-gray" | "background-yellow" | "background-blue" | "background-green" | "background-red" | "add-row-before" | "add-row-after" | "add-column-before" | "add-column-after" | "clear-cells" | "merge-cells" | "split-cell" | "delete-row" | "delete-column" | "delete-table";
15
+ readonly action: "align-left" | "align-center" | "align-right" | "background-none" | "background-gray" | "background-yellow" | "background-blue" | "background-green" | "background-red" | "add-row-before" | "add-row-after" | "add-column-before" | "add-column-after" | "toggle-header-row" | "toggle-header-column" | "move-row-up" | "move-row-down" | "move-column-left" | "move-column-right" | "clear-cells" | "merge-cells" | "split-cell" | "delete-row" | "delete-column" | "delete-table";
14
16
  }) => any) | undefined;
15
17
  }>, {
16
18
  open: boolean;
19
+ headerRow: boolean;
17
20
  cellBackground: string;
21
+ headerColumn: boolean;
18
22
  cellAlignment: "left" | "center" | "right";
19
23
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
24
  declare const _default: typeof __VLS_export;
@@ -24,6 +24,12 @@ const props = withDefaults(
24
24
  | 'add-row-after'
25
25
  | 'add-column-before'
26
26
  | 'add-column-after'
27
+ | 'toggle-header-row'
28
+ | 'toggle-header-column'
29
+ | 'move-row-up'
30
+ | 'move-row-down'
31
+ | 'move-column-left'
32
+ | 'move-column-right'
27
33
  | 'clear-cells'
28
34
  | 'merge-cells'
29
35
  | 'split-cell'
@@ -33,11 +39,15 @@ const props = withDefaults(
33
39
  )[]
34
40
  cellAlignment?: 'left' | 'center' | 'right'
35
41
  cellBackground?: string
42
+ headerColumn?: boolean
43
+ headerRow?: boolean
36
44
  open?: boolean
37
45
  }>(),
38
46
  {
39
47
  cellAlignment: 'left',
40
48
  cellBackground: '',
49
+ headerColumn: false,
50
+ headerRow: false,
41
51
  open: false,
42
52
  },
43
53
  )
@@ -58,6 +68,12 @@ const emit = defineEmits<{
58
68
  | 'add-row-after'
59
69
  | 'add-column-before'
60
70
  | 'add-column-after'
71
+ | 'toggle-header-row'
72
+ | 'toggle-header-column'
73
+ | 'move-row-up'
74
+ | 'move-row-down'
75
+ | 'move-column-left'
76
+ | 'move-column-right'
61
77
  | 'clear-cells'
62
78
  | 'merge-cells'
63
79
  | 'split-cell'
@@ -77,7 +93,17 @@ const structure = ref<
77
93
  >([])
78
94
  const swatches = ref<{ action: string; label: string; color: string; selected: boolean }[]>([])
79
95
  const sections = ref<
80
- { heading: string; items: { action: string; label: string; icon: string; danger: boolean }[] }[]
96
+ {
97
+ heading: string
98
+ items: {
99
+ action: string
100
+ label: string
101
+ icon: string
102
+ danger: boolean
103
+ checkable: boolean
104
+ checked: boolean
105
+ }[]
106
+ }[]
81
107
  >([])
82
108
  const hasOverflow = ref(false)
83
109
  const overflowOpen = ref(false)
@@ -97,6 +123,12 @@ const isActionDetail = (detail: unknown): boolean =>
97
123
  || (detail as Record<string, unknown>)['action'] === 'add-row-after'
98
124
  || (detail as Record<string, unknown>)['action'] === 'add-column-before'
99
125
  || (detail as Record<string, unknown>)['action'] === 'add-column-after'
126
+ || (detail as Record<string, unknown>)['action'] === 'toggle-header-row'
127
+ || (detail as Record<string, unknown>)['action'] === 'toggle-header-column'
128
+ || (detail as Record<string, unknown>)['action'] === 'move-row-up'
129
+ || (detail as Record<string, unknown>)['action'] === 'move-row-down'
130
+ || (detail as Record<string, unknown>)['action'] === 'move-column-left'
131
+ || (detail as Record<string, unknown>)['action'] === 'move-column-right'
100
132
  || (detail as Record<string, unknown>)['action'] === 'clear-cells'
101
133
  || (detail as Record<string, unknown>)['action'] === 'merge-cells'
102
134
  || (detail as Record<string, unknown>)['action'] === 'split-cell'
@@ -116,6 +148,19 @@ useComponentHost(controllerModule.default, {
116
148
  props,
117
149
  state: { alignments, structure, swatches, sections, hasOverflow, overflowOpen },
118
150
  })
151
+
152
+ function text(value: unknown): string {
153
+ if (Array.isArray(value)) return value.map(text).join(' ')
154
+ return value === null || value === undefined || typeof value === 'object' ? '' : String(value)
155
+ }
156
+
157
+ function attribute(value: unknown): any {
158
+ if (
159
+ value === null || value === undefined || value === false
160
+ || (typeof value === 'object' && !Array.isArray(value))
161
+ ) return undefined
162
+ return value === true ? '' : text(value)
163
+ }
119
164
  </script>
120
165
 
121
166
  <template>
@@ -201,7 +246,10 @@ useComponentHost(controllerModule.default, {
201
246
  v-for="item in section.items"
202
247
  :key="item.action"
203
248
  type="button"
204
- role="menuitem"
249
+ :role="attribute(({ true: 'menuitemcheckbox', false: 'menuitem' })[`${item.checkable}`])"
250
+ :aria-checked="typeof (({ true: item.checked, false: null })[`${item.checkable}`]) === 'boolean'
251
+ ? String(({ true: item.checked, false: null })[`${item.checkable}`])
252
+ : attribute(({ true: item.checked, false: null })[`${item.checkable}`])"
205
253
  :data-action="item.action"
206
254
  :class="{ danger: item.danger }"
207
255
  >
@@ -1,6 +1,8 @@
1
1
  <!-- Generated by HTML Next 1.0.0-alpha.7 for Vue 3.5. Do not edit. -->
2
2
  <script setup lang="ts">
3
- import { computed, useTemplateRef } from 'vue'
3
+ import { computed, ref, useTemplateRef } from 'vue'
4
+ import * as controllerModule from '../components/ui-editor-toolbar/ui-editor-toolbar.js'
5
+ import { createDispatch, useComponentHost } from './host'
4
6
 
5
7
  defineOptions({ inheritAttrs: false })
6
8
 
@@ -13,6 +15,7 @@ const props = withDefaults(
13
15
  },
14
16
  )
15
17
 
18
+ const root = ref<HTMLElement | null>(null)
16
19
  const stripElement = useTemplateRef<HTMLElement>('strip')
17
20
 
18
21
  /** The values the styles' :host-state() rules test. */
@@ -21,6 +24,15 @@ const hostState = computed(() =>
21
24
  props.floating && 'floating',
22
25
  ].filter(Boolean).join(' ')
23
26
  )
27
+
28
+ const dispatch = createDispatch(root)
29
+
30
+ useComponentHost(controllerModule.default, {
31
+ root,
32
+ dispatch,
33
+ props,
34
+ refs: { strip: stripElement },
35
+ })
24
36
  </script>
25
37
 
26
38
  <template>
@@ -30,6 +42,7 @@ const hostState = computed(() =>
30
42
  aria-label="Editor toolbar"
31
43
  v-bind="$attrs"
32
44
  :data-ui-editor-toolbar-state="hostState || undefined"
45
+ ref="root"
33
46
  >
34
47
  <div class="strip" ref="strip"><slot /></div>
35
48
  </div>
@@ -72,7 +72,7 @@ const hostState = computed(() =>
72
72
  [data-component~="ui-floating-action-button"] {
73
73
  appearance: none;
74
74
  border: none;
75
- border-radius: 999px;
75
+ border-radius: var(--ui-radius-round);
76
76
  margin: 0;
77
77
  padding: 0;
78
78
  display: inline-flex;
@@ -1,6 +1,6 @@
1
1
  <!-- Generated by HTML Next 1.0.0-alpha.7 for Vue 3.5. Do not edit. -->
2
2
  <script setup lang="ts">
3
- import { ref } from 'vue'
3
+ import { computed, ref } from 'vue'
4
4
  import * as controllerModule from '../components/ui-form-field/ui-form-field.js'
5
5
  import { createDispatch, useComponentHost } from './host'
6
6
 
@@ -21,6 +21,13 @@ const props = withDefaults(
21
21
 
22
22
  const root = ref<HTMLElement | null>(null)
23
23
 
24
+ /** The values the styles' :host-state() rules test. */
25
+ const hostState = computed(() =>
26
+ [
27
+ props.invalid && 'invalid',
28
+ ].filter(Boolean).join(' ')
29
+ )
30
+
24
31
  const dispatch = createDispatch(root)
25
32
 
26
33
  useComponentHost(controllerModule.default, {
@@ -31,7 +38,12 @@ useComponentHost(controllerModule.default, {
31
38
  </script>
32
39
 
33
40
  <template>
34
- <div data-component="ui-form-field" v-bind="$attrs" ref="root">
41
+ <div
42
+ data-component="ui-form-field"
43
+ v-bind="$attrs"
44
+ :data-ui-form-field-state="hostState || undefined"
45
+ ref="root"
46
+ >
35
47
  <div class="label"><slot name="label" /></div>
36
48
  <slot />
37
49
  <div class="help"><slot name="help" /></div>
@@ -41,6 +53,10 @@ useComponentHost(controllerModule.default, {
41
53
 
42
54
  <style scoped>
43
55
  /* This component's hooks style the element they are set on, and never a nested one. */
56
+ @property --ui-form-field-danger {
57
+ syntax: "*";
58
+ inherits: false;
59
+ }
44
60
  @property --ui-form-field-help-min-block-size {
45
61
  syntax: "*";
46
62
  inherits: false;
@@ -48,6 +64,7 @@ useComponentHost(controllerModule.default, {
48
64
 
49
65
  [data-component~="ui-form-field"] {
50
66
  /* Hooks do not inherit, so the parts below read them from the root. */
67
+ --_ui-form-field-danger: var(--ui-form-field-danger);
51
68
  --_ui-form-field-help-min-block-size: var(--ui-form-field-help-min-block-size);
52
69
 
53
70
  display: grid;
@@ -80,10 +97,18 @@ useComponentHost(controllerModule.default, {
80
97
  min-block-size: var(--_ui-form-field-help-min-block-size, 0);
81
98
  }
82
99
 
100
+ .error {
101
+ display: none;
102
+ }
103
+
104
+ [data-component~="ui-form-field"][data-ui-form-field-state~="invalid"] .error {
105
+ display: contents;
106
+ }
107
+
83
108
  /* An error reads in the danger colour, the one the invalid control's border takes. */
84
109
  .error,
85
110
  :slotted([role="alert"]) {
86
- color: var(--ui-danger);
111
+ color: var(--_ui-form-field-danger, var(--ui-field-danger, var(--ui-danger)));
87
112
  font-size: var(--ui-font-size-sm);
88
113
  }
89
114
 
package/vue/UiGrid.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  type __VLS_Props = {
2
+ columns?: number;
2
3
  gap?: 'xs' | 's' | 'm' | 'l' | 'xl';
3
4
  min?: 'sm' | 'md' | 'lg';
4
5
  };
package/vue/UiGrid.vue CHANGED
@@ -5,6 +5,7 @@ import { computed } from 'vue'
5
5
  defineOptions({ inheritAttrs: false })
6
6
 
7
7
  const props = defineProps<{
8
+ columns?: number
8
9
  gap?: 'xs' | 's' | 'm' | 'l' | 'xl'
9
10
  min?: 'sm' | 'md' | 'lg'
10
11
  }>()
@@ -19,7 +20,12 @@ const hostState = computed(() =>
19
20
  </script>
20
21
 
21
22
  <template>
22
- <div data-component="ui-grid" v-bind="$attrs" :data-ui-grid-state="hostState || undefined">
23
+ <div
24
+ data-component="ui-grid"
25
+ v-bind="$attrs"
26
+ :style="{ '--_grid-column-cap': columns }"
27
+ :data-ui-grid-state="hostState || undefined"
28
+ >
23
29
  <slot />
24
30
  </div>
25
31
  </template>
@@ -41,7 +47,25 @@ const hostState = computed(() =>
41
47
  display: grid;
42
48
  gap: var(--ui-grid-gap, var(--_grid-gap));
43
49
  grid-template-columns:
44
- repeat(auto-fit, minmax(min(var(--ui-grid-min, var(--_grid-min)), 100%), 1fr));
50
+ repeat(
51
+ auto-fit,
52
+ minmax(
53
+ min(
54
+ max(
55
+ var(--ui-grid-min, var(--_grid-min)),
56
+ calc(
57
+ (
58
+ 100% -
59
+ (max(1, var(--_grid-column-cap, 9999)) - 1) * var(--ui-grid-gap, var(--_grid-gap))
60
+ ) /
61
+ max(1, var(--_grid-column-cap, 9999))
62
+ )
63
+ ),
64
+ 100%
65
+ ),
66
+ 1fr
67
+ )
68
+ );
45
69
  min-inline-size: 0;
46
70
  max-inline-size: 100%;
47
71
  margin: 0;