@threadlabs/looma 0.14.8 → 0.15.1
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.
- package/components/shared/icons.js +5 -0
- package/components/shared/menu-navigation.js +49 -0
- package/components/shared/overlay.js +33 -60
- package/components/ui-avatar/ui-avatar.html +19 -2
- package/components/ui-avatar/ui-avatar.js +7 -1
- package/components/ui-avatar-group/ui-avatar-group.html +8 -3
- package/components/ui-avatar-group/ui-avatar-group.js +6 -2
- package/components/ui-badge/ui-badge.html +70 -4
- package/components/ui-button/ui-button.html +21 -5
- package/components/ui-button/ui-button.js +10 -0
- package/components/ui-callout/ui-callout.html +13 -5
- package/components/ui-checkbox/ui-checkbox.html +11 -0
- package/components/ui-cluster/ui-cluster.html +7 -0
- package/components/ui-combobox/ui-combobox.html +46 -10
- package/components/ui-combobox/ui-combobox.js +5 -5
- package/components/ui-context-menu/ui-context-menu.html +33 -5
- package/components/ui-context-menu/ui-context-menu.js +26 -17
- package/components/ui-dialog/ui-dialog.html +51 -8
- package/components/ui-dialog/ui-dialog.js +28 -7
- package/components/ui-disclosure/ui-disclosure.html +14 -5
- package/components/ui-disclosure/ui-disclosure.js +51 -4
- package/components/ui-editable/ui-editable.html +17 -3
- package/components/ui-editable/ui-editable.js +7 -0
- package/components/ui-editor-insert-table-grid/ui-editor-insert-table-grid.html +48 -14
- package/components/ui-editor-insert-table-grid/ui-editor-insert-table-grid.js +40 -6
- package/components/ui-editor-mention-menu/ui-editor-mention-menu.html +22 -9
- package/components/ui-editor-mention-menu/ui-editor-mention-menu.js +33 -11
- package/components/ui-editor-mention-menu-item/ui-editor-mention-menu-item.html +67 -0
- package/components/ui-editor-slash-menu/ui-editor-slash-menu.html +33 -30
- package/components/ui-editor-slash-menu/ui-editor-slash-menu.js +42 -8
- package/components/ui-editor-slash-menu-group/ui-editor-slash-menu-group.html +31 -0
- package/components/ui-editor-slash-menu-item/ui-editor-slash-menu-item.html +75 -0
- package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.html +16 -5
- package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.js +10 -2
- package/components/ui-editor-table-overlay/ui-editor-table-overlay.html +5 -5
- package/components/ui-editor-table-overlay/ui-editor-table-overlay.js +5 -2
- package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.html +14 -4
- package/components/ui-editor-table-toolbar/ui-editor-table-toolbar.js +2 -2
- package/components/ui-editor-toolbar/ui-editor-toolbar.html +1 -1
- package/components/ui-editor-toolbar/ui-editor-toolbar.js +46 -0
- package/components/ui-floating-action-button/ui-floating-action-button.html +1 -1
- package/components/ui-form-field/ui-form-field.html +16 -3
- package/components/ui-form-field/ui-form-field.js +1 -1
- package/components/ui-grid/ui-grid.html +17 -2
- package/components/ui-icon/ui-icon.html +5 -0
- package/components/ui-icon-button/ui-icon-button.html +25 -6
- package/components/ui-icon-button/ui-icon-button.js +11 -1
- package/components/ui-input/ui-input.html +3 -3
- package/components/ui-input-group/ui-input-group.html +18 -4
- package/components/ui-listbox/ui-listbox.html +81 -0
- package/components/ui-listbox/ui-listbox.js +27 -0
- package/components/ui-menu/ui-menu.html +33 -5
- package/components/ui-menu/ui-menu.js +18 -12
- package/components/ui-menu-group/ui-menu-group.html +27 -0
- package/components/ui-menu-item/ui-menu-item.html +80 -8
- package/components/ui-menu-item/ui-menu-item.js +47 -0
- package/components/ui-popover/ui-popover.html +33 -5
- package/components/ui-popover/ui-popover.js +9 -1
- package/components/ui-radio-group/ui-radio-group.html +13 -1
- package/components/ui-search-shell/ui-search-shell.html +6 -6
- package/components/ui-search-shell/ui-search-shell.js +21 -5
- package/components/ui-select/ui-select.html +14 -4
- package/components/ui-switch/ui-switch.html +2 -2
- package/components/ui-switcher/ui-switcher.html +8 -1
- package/components/ui-switcher/ui-switcher.js +15 -0
- package/components/ui-tabs/ui-tabs.html +17 -12
- package/components/ui-tabs/ui-tabs.js +43 -7
- package/components/ui-textarea/ui-textarea.html +28 -5
- package/components/ui-toast/ui-toast.html +88 -0
- package/components/ui-toast/ui-toast.js +68 -0
- package/components/ui-toast-region/ui-toast-region.html +102 -19
- package/components/ui-toast-region/ui-toast-region.js +10 -18
- package/components/ui-tooltip/ui-tooltip.html +51 -7
- package/components/ui-tooltip/ui-tooltip.js +29 -3
- package/components/ui-tree/ui-tree.html +12 -0
- package/components/ui-tree/ui-tree.js +191 -12
- package/components/ui-tree-item/ui-tree-item.html +87 -8
- package/components/ui-tree-item/ui-tree-item.js +3 -1
- package/dist/index.js +38 -32
- package/editor/chunks/extensions.js +82 -2
- package/editor/extensions/table-commands.d.ts +8 -0
- package/editor/icons.d.ts +5 -0
- package/editor/index.js +7 -2
- package/editor/insert-table-grid.d.ts +1 -1
- package/editor/mention-menu.d.ts +2 -0
- package/editor/slash-menu.d.ts +3 -0
- package/editor/table-context-menu.d.ts +1 -1
- package/editor/table-overlay.d.ts +2 -2
- package/package.json +1 -1
- package/styles/ui-avatar-group.css +1 -2
- package/styles/ui-avatar.css +11 -1
- package/styles/ui-badge.css +73 -1
- package/styles/ui-button.css +9 -1
- package/styles/ui-callout.css +1 -1
- package/styles/ui-checkbox.css +9 -0
- package/styles/ui-cluster.css +3 -0
- package/styles/ui-combobox.css +38 -7
- package/styles/ui-context-menu.css +32 -4
- package/styles/ui-dialog.css +42 -5
- package/styles/ui-editor-insert-table-grid.css +48 -11
- package/styles/ui-editor-mention-menu-item.css +57 -0
- package/styles/ui-editor-mention-menu.css +11 -1
- package/styles/ui-editor-slash-menu-group.css +21 -0
- package/styles/ui-editor-slash-menu-item.css +62 -0
- package/styles/ui-editor-slash-menu.css +10 -21
- package/styles/ui-editor-table-context-menu.css +1 -1
- package/styles/ui-floating-action-button.css +1 -1
- package/styles/ui-form-field.css +14 -1
- package/styles/ui-grid.css +14 -1
- package/styles/ui-icon-button.css +17 -5
- package/styles/ui-input-group.css +18 -4
- package/styles/ui-input.css +3 -3
- package/styles/ui-listbox.css +69 -0
- package/styles/ui-menu-group.css +19 -0
- package/styles/ui-menu-item.css +48 -9
- package/styles/ui-menu.css +32 -4
- package/styles/ui-popover.css +28 -4
- package/styles/ui-radio-group.css +9 -0
- package/styles/ui-search-shell.css +5 -5
- package/styles/ui-select.css +14 -4
- package/styles/ui-switch.css +2 -2
- package/styles/ui-switcher.css +4 -0
- package/styles/ui-textarea.css +27 -4
- package/styles/ui-toast-region.css +88 -4
- package/styles/ui-toast.css +74 -0
- package/styles/ui-tooltip.css +46 -6
- package/styles/ui-tree-item.css +72 -4
- package/styles/ui-tree.css +8 -0
- package/tokens.css +3 -0
- package/vanilla/UiAvatar.d.ts +2 -0
- package/vanilla/UiAvatar.js +8 -1
- package/vanilla/UiAvatarGroup.d.ts +2 -0
- package/vanilla/UiAvatarGroup.js +1 -1
- package/vanilla/UiBadge.d.ts +1 -1
- package/vanilla/UiBadge.js +1 -1
- package/vanilla/UiButton.d.ts +1 -0
- package/vanilla/UiButton.js +22 -6
- package/vanilla/UiCallout.d.ts +1 -1
- package/vanilla/UiCallout.js +1 -1
- package/vanilla/UiCheckbox.d.ts +1 -0
- package/vanilla/UiCheckbox.js +12 -9
- package/vanilla/UiCluster.d.ts +1 -0
- package/vanilla/UiCluster.js +2 -0
- package/vanilla/UiCombobox.d.ts +3 -0
- package/vanilla/UiCombobox.js +30 -15
- package/vanilla/UiContextMenu.d.ts +1 -1
- package/vanilla/UiContextMenu.js +1 -1
- package/vanilla/UiDialog.d.ts +5 -2
- package/vanilla/UiDialog.js +1 -1
- package/vanilla/UiDisclosure.d.ts +2 -0
- package/vanilla/UiDisclosure.js +32 -18
- package/vanilla/UiEditable.d.ts +5 -0
- package/vanilla/UiEditable.js +7 -3
- package/vanilla/UiEditorInsertTableGrid.js +1 -6
- package/vanilla/UiEditorMentionMenu.d.ts +4 -2
- package/vanilla/UiEditorMentionMenu.js +49 -31
- package/vanilla/UiEditorMentionMenuItem.d.ts +16 -0
- package/vanilla/UiEditorMentionMenuItem.js +56 -0
- package/vanilla/UiEditorSlashMenu.d.ts +4 -3
- package/vanilla/UiEditorSlashMenu.js +59 -46
- package/vanilla/UiEditorSlashMenuGroup.d.ts +14 -0
- package/vanilla/UiEditorSlashMenuGroup.js +48 -0
- package/vanilla/UiEditorSlashMenuItem.d.ts +18 -0
- package/vanilla/UiEditorSlashMenuItem.js +57 -0
- package/vanilla/UiEditorTableContextMenu.d.ts +5 -2
- package/vanilla/UiEditorTableContextMenu.js +1 -2
- package/vanilla/UiEditorTableOverlay.d.ts +1 -1
- package/vanilla/UiEditorTableOverlay.js +5 -5
- package/vanilla/UiEditorTableToolbar.d.ts +4 -2
- package/vanilla/UiEditorTableToolbar.js +1 -2
- package/vanilla/UiEditorToolbar.js +2 -0
- package/vanilla/UiGrid.d.ts +1 -0
- package/vanilla/UiGrid.js +8 -7
- package/vanilla/UiIcon.js +1 -1
- package/vanilla/UiIconButton.d.ts +1 -0
- package/vanilla/UiIconButton.js +11 -2
- package/vanilla/UiListbox.d.ts +20 -0
- package/vanilla/UiListbox.js +45 -0
- package/vanilla/UiMenu.d.ts +1 -1
- package/vanilla/UiMenu.js +1 -1
- package/vanilla/UiMenuGroup.d.ts +14 -0
- package/vanilla/UiMenuGroup.js +35 -0
- package/vanilla/UiMenuItem.d.ts +5 -1
- package/vanilla/UiMenuItem.js +91 -30
- package/vanilla/UiPopover.d.ts +1 -1
- package/vanilla/UiPopover.js +1 -1
- package/vanilla/UiRadioGroup.d.ts +1 -0
- package/vanilla/UiRadioGroup.js +6 -3
- package/vanilla/UiSwitcher.d.ts +1 -0
- package/vanilla/UiSwitcher.js +7 -9
- package/vanilla/UiTabs.d.ts +1 -0
- package/vanilla/UiTabs.js +9 -1
- package/vanilla/UiTextarea.d.ts +1 -0
- package/vanilla/UiTextarea.js +4 -1
- package/vanilla/UiToast.d.ts +16 -0
- package/vanilla/UiToast.js +53 -0
- package/vanilla/UiToastRegion.d.ts +1 -4
- package/vanilla/UiToastRegion.js +3 -11
- package/vanilla/UiTooltip.d.ts +1 -1
- package/vanilla/UiTooltip.js +1 -1
- package/vanilla/UiTree.d.ts +2 -0
- package/vanilla/UiTree.js +1 -1
- package/vanilla/UiTreeItem.d.ts +1 -0
- package/vanilla/UiTreeItem.js +45 -31
- package/vanilla/index.js +6 -0
- package/vue/UiAvatar.d.ts +4 -0
- package/vue/UiAvatar.vue +23 -3
- package/vue/UiAvatarGroup.d.ts +3 -0
- package/vue/UiAvatarGroup.vue +7 -4
- package/vue/UiBadge.d.ts +2 -2
- package/vue/UiBadge.vue +74 -2
- package/vue/UiButton.d.ts +5 -3
- package/vue/UiButton.vue +41 -7
- package/vue/UiCallout.d.ts +2 -2
- package/vue/UiCallout.vue +3 -2
- package/vue/UiCheckbox.d.ts +2 -0
- package/vue/UiCheckbox.vue +16 -0
- package/vue/UiCluster.d.ts +1 -0
- package/vue/UiCluster.vue +5 -0
- package/vue/UiCombobox.d.ts +11 -3
- package/vue/UiCombobox.vue +60 -11
- package/vue/UiContextMenu.d.ts +2 -0
- package/vue/UiContextMenu.vue +47 -6
- package/vue/UiDialog.d.ts +18 -4
- package/vue/UiDialog.vue +86 -11
- package/vue/UiDisclosure.d.ts +8 -2
- package/vue/UiDisclosure.vue +38 -14
- package/vue/UiEditable.d.ts +10 -0
- package/vue/UiEditable.vue +14 -2
- package/vue/UiEditorInsertTableGrid.vue +52 -15
- package/vue/UiEditorMentionMenu.d.ts +24 -2
- package/vue/UiEditorMentionMenu.vue +27 -11
- package/vue/UiEditorMentionMenuItem.d.ts +24 -0
- package/vue/UiEditorMentionMenuItem.js +2 -0
- package/vue/UiEditorMentionMenuItem.vue +88 -0
- package/vue/UiEditorSlashMenu.d.ts +24 -1
- package/vue/UiEditorSlashMenu.vue +33 -33
- package/vue/UiEditorSlashMenuGroup.d.ts +18 -0
- package/vue/UiEditorSlashMenuGroup.js +2 -0
- package/vue/UiEditorSlashMenuGroup.vue +43 -0
- package/vue/UiEditorSlashMenuItem.d.ts +26 -0
- package/vue/UiEditorSlashMenuItem.js +2 -0
- package/vue/UiEditorSlashMenuItem.vue +101 -0
- package/vue/UiEditorTableContextMenu.d.ts +9 -3
- package/vue/UiEditorTableContextMenu.vue +53 -3
- package/vue/UiEditorTableOverlay.d.ts +2 -2
- package/vue/UiEditorTableOverlay.vue +8 -6
- package/vue/UiEditorTableToolbar.d.ts +7 -3
- package/vue/UiEditorTableToolbar.vue +50 -2
- package/vue/UiEditorToolbar.vue +14 -1
- package/vue/UiFloatingActionButton.vue +1 -1
- package/vue/UiFormField.vue +28 -3
- package/vue/UiGrid.d.ts +1 -0
- package/vue/UiGrid.vue +26 -2
- package/vue/UiIcon.vue +16 -0
- package/vue/UiIconButton.d.ts +5 -3
- package/vue/UiIconButton.vue +40 -6
- package/vue/UiInput.vue +10 -3
- package/vue/UiInputGroup.vue +32 -11
- package/vue/UiListbox.d.ts +33 -0
- package/vue/UiListbox.js +2 -0
- package/vue/UiListbox.vue +131 -0
- package/vue/UiMenu.d.ts +2 -0
- package/vue/UiMenu.vue +43 -6
- package/vue/UiMenuGroup.d.ts +18 -0
- package/vue/UiMenuGroup.js +2 -0
- package/vue/UiMenuGroup.vue +39 -0
- package/vue/UiMenuItem.d.ts +34 -2
- package/vue/UiMenuItem.vue +145 -9
- package/vue/UiPopover.d.ts +2 -2
- package/vue/UiPopover.vue +44 -5
- package/vue/UiRadioGroup.d.ts +2 -0
- package/vue/UiRadioGroup.vue +17 -0
- package/vue/UiSearchShell.vue +12 -5
- package/vue/UiSelect.vue +18 -4
- package/vue/UiSwitch.vue +2 -2
- package/vue/UiSwitcher.d.ts +1 -0
- package/vue/UiSwitcher.vue +22 -1
- package/vue/UiTabs.d.ts +6 -2
- package/vue/UiTabs.vue +14 -12
- package/vue/UiTextarea.d.ts +2 -0
- package/vue/UiTextarea.vue +32 -4
- package/vue/UiToast.d.ts +34 -0
- package/vue/UiToast.js +2 -0
- package/vue/UiToast.vue +173 -0
- package/vue/UiToastRegion.d.ts +2 -18
- package/vue/UiToastRegion.vue +123 -48
- package/vue/UiTooltip.d.ts +2 -2
- package/vue/UiTooltip.vue +67 -12
- package/vue/UiTree.d.ts +10 -0
- package/vue/UiTree.vue +27 -0
- package/vue/UiTreeItem.d.ts +2 -0
- package/vue/UiTreeItem.vue +96 -4
- package/vue/chunks/UiAvatar.js +19 -5
- package/vue/chunks/UiAvatarGroup.js +10 -4
- package/vue/chunks/UiBadge.js +1 -1
- package/vue/chunks/UiButton.js +58 -11
- package/vue/chunks/UiCallout.js +2 -2
- package/vue/chunks/UiCheckbox.js +12 -2
- package/vue/chunks/UiCluster.js +5 -3
- package/vue/chunks/UiCombobox.js +29 -13
- package/vue/chunks/UiContextMenu.js +6 -2
- package/vue/chunks/UiDialog.js +25 -8
- package/vue/chunks/UiDisclosure.js +36 -12
- package/vue/chunks/UiEditable.js +22 -8
- package/vue/chunks/UiEditorInsertTableGrid.js +11 -14
- package/vue/chunks/UiEditorMentionMenu.js +30 -19
- package/vue/chunks/UiEditorMentionMenuItem.js +36 -0
- package/vue/chunks/UiEditorSlashMenu.js +33 -35
- package/vue/chunks/UiEditorSlashMenuGroup.js +26 -0
- package/vue/chunks/UiEditorSlashMenuItem.js +51 -0
- package/vue/chunks/UiEditorTableContextMenu.js +39 -5
- package/vue/chunks/UiEditorTableOverlay.js +6 -6
- package/vue/chunks/UiEditorTableToolbar.js +37 -4
- package/vue/chunks/UiEditorToolbar.js +18 -4
- package/vue/chunks/UiFloatingActionButton.js +1 -1
- package/vue/chunks/UiFormField.js +13 -9
- package/vue/chunks/UiGrid.js +6 -2
- package/vue/chunks/UiIcon.js +40 -2
- package/vue/chunks/UiIconButton.js +35 -4
- package/vue/chunks/UiInput.js +1 -1
- package/vue/chunks/UiInputGroup.js +1 -1
- package/vue/chunks/UiListbox.js +70 -0
- package/vue/chunks/UiMenu.js +6 -2
- package/vue/chunks/UiMenuGroup.js +25 -0
- package/vue/chunks/UiMenuItem.js +128 -7
- package/vue/chunks/UiPopover.js +1 -1
- package/vue/chunks/UiRadioGroup.js +8 -2
- package/vue/chunks/UiSearchShell.js +1 -1
- package/vue/chunks/UiSelect.js +1 -1
- package/vue/chunks/UiSwitch.js +1 -1
- package/vue/chunks/UiSwitcher.js +20 -3
- package/vue/chunks/UiTabs.js +4 -3
- package/vue/chunks/UiTextarea.js +7 -2
- package/vue/chunks/UiToast.js +81 -0
- package/vue/chunks/UiToastRegion.js +25 -49
- package/vue/chunks/UiTooltip.js +3 -7
- package/vue/chunks/UiTree.js +8 -4
- package/vue/chunks/UiTreeItem.js +28 -10
- package/vue/components.css +1856 -864
- package/vue/editor/index.js +263 -2
- package/vue/index.d.ts +6 -0
- package/vue/index.js +9 -3
package/vue/UiGrid.d.ts
CHANGED
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
|
|
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(
|
|
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;
|
package/vue/UiIcon.vue
CHANGED
|
@@ -55,6 +55,7 @@ const shapes = computed(() =>
|
|
|
55
55
|
{ tag: 'path', d: 'M12 18h.01' },
|
|
56
56
|
{ tag: 'path', d: 'M8 18h.01' },
|
|
57
57
|
],
|
|
58
|
+
check: [{ tag: 'path', d: 'M20 6 9 17l-5-5' }],
|
|
58
59
|
'chevron-down': [{ tag: 'path', d: 'm6 9 6 6 6-6' }],
|
|
59
60
|
'chevron-left': [{ tag: 'path', d: 'm15 18-6-6 6-6' }],
|
|
60
61
|
'chevron-right': [{ tag: 'path', d: 'm9 18 6-6-6-6' }],
|
|
@@ -62,6 +63,12 @@ const shapes = computed(() =>
|
|
|
62
63
|
tag: 'path',
|
|
63
64
|
d: 'm9 12 2 2 4-4',
|
|
64
65
|
}],
|
|
66
|
+
'circle-dot': [{ tag: 'circle', cx: '12', cy: '12', r: '10' }, {
|
|
67
|
+
tag: 'circle',
|
|
68
|
+
cx: '12',
|
|
69
|
+
cy: '12',
|
|
70
|
+
r: '1',
|
|
71
|
+
}],
|
|
65
72
|
'circle-x': [{ tag: 'circle', cx: '12', cy: '12', r: '10' }, { tag: 'path', d: 'm15 9-6 6' }, {
|
|
66
73
|
tag: 'path',
|
|
67
74
|
d: 'm9 9 6 6',
|
|
@@ -167,6 +174,10 @@ const shapes = computed(() =>
|
|
|
167
174
|
{ tag: 'rect', width: '7', height: '9', x: '14', y: '12', rx: '1' },
|
|
168
175
|
{ tag: 'rect', width: '7', height: '5', x: '3', y: '16', rx: '1' },
|
|
169
176
|
],
|
|
177
|
+
link: [{ tag: 'path', d: 'M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71' }, {
|
|
178
|
+
tag: 'path',
|
|
179
|
+
d: 'M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71',
|
|
180
|
+
}],
|
|
170
181
|
list: [
|
|
171
182
|
{ tag: 'path', d: 'M3 5h.01' },
|
|
172
183
|
{ tag: 'path', d: 'M3 12h.01' },
|
|
@@ -306,12 +317,17 @@ const shapes = computed(() =>
|
|
|
306
317
|
tag: 'path',
|
|
307
318
|
d: 'M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11',
|
|
308
319
|
}],
|
|
320
|
+
'user-round': [{ tag: 'circle', cx: '12', cy: '8', r: '5' }, {
|
|
321
|
+
tag: 'path',
|
|
322
|
+
d: 'M20 21a8 8 0 0 0-16 0',
|
|
323
|
+
}],
|
|
309
324
|
users: [
|
|
310
325
|
{ tag: 'path', d: 'M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2' },
|
|
311
326
|
{ tag: 'path', d: 'M16 3.128a4 4 0 0 1 0 7.744' },
|
|
312
327
|
{ tag: 'path', d: 'M22 21v-2a4 4 0 0 0-3-3.87' },
|
|
313
328
|
{ tag: 'circle', cx: '9', cy: '7', r: '4' },
|
|
314
329
|
],
|
|
330
|
+
x: [{ tag: 'path', d: 'M18 6 6 18' }, { tag: 'path', d: 'm6 6 12 12' }],
|
|
315
331
|
})[props.name]
|
|
316
332
|
)
|
|
317
333
|
|
package/vue/UiIconButton.d.ts
CHANGED
|
@@ -2,19 +2,21 @@ type __VLS_Props = {
|
|
|
2
2
|
anticipatory?: boolean;
|
|
3
3
|
disabled?: boolean;
|
|
4
4
|
label?: string;
|
|
5
|
+
pending?: boolean;
|
|
5
6
|
round?: boolean;
|
|
6
7
|
size?: 'sm' | 'md' | 'lg';
|
|
7
8
|
variant?: 'ghost' | 'outline' | 'solid';
|
|
8
9
|
};
|
|
9
|
-
declare var
|
|
10
|
+
declare var __VLS_6: {};
|
|
10
11
|
type __VLS_Slots = {} & {
|
|
11
|
-
default?: (props: typeof
|
|
12
|
+
default?: (props: typeof __VLS_6) => any;
|
|
12
13
|
};
|
|
13
14
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
15
|
+
round: boolean;
|
|
14
16
|
size: "sm" | "md" | "lg";
|
|
15
17
|
variant: "ghost" | "outline" | "solid";
|
|
16
|
-
round: boolean;
|
|
17
18
|
disabled: boolean;
|
|
19
|
+
pending: boolean;
|
|
18
20
|
anticipatory: boolean;
|
|
19
21
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
22
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
package/vue/UiIconButton.vue
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { computed, ref } from 'vue'
|
|
4
4
|
import * as controllerModule from '../components/ui-icon-button/ui-icon-button.js'
|
|
5
5
|
import { createDispatch, useComponentHost } from './host'
|
|
6
|
+
import UiSpinner from './UiSpinner.vue'
|
|
6
7
|
|
|
7
8
|
defineOptions({ inheritAttrs: false })
|
|
8
9
|
|
|
@@ -11,6 +12,7 @@ const props = withDefaults(
|
|
|
11
12
|
anticipatory?: boolean
|
|
12
13
|
disabled?: boolean
|
|
13
14
|
label?: string
|
|
15
|
+
pending?: boolean
|
|
14
16
|
round?: boolean
|
|
15
17
|
size?: 'sm' | 'md' | 'lg'
|
|
16
18
|
variant?: 'ghost' | 'outline' | 'solid'
|
|
@@ -18,6 +20,7 @@ const props = withDefaults(
|
|
|
18
20
|
{
|
|
19
21
|
anticipatory: false,
|
|
20
22
|
disabled: false,
|
|
23
|
+
pending: false,
|
|
21
24
|
round: false,
|
|
22
25
|
size: 'md',
|
|
23
26
|
variant: 'ghost',
|
|
@@ -33,6 +36,7 @@ const hostState = computed(() =>
|
|
|
33
36
|
props.variant && `variant variant=${props.variant}`,
|
|
34
37
|
props.size && `size size=${props.size}`,
|
|
35
38
|
props.round && 'round',
|
|
39
|
+
props.pending && 'pending',
|
|
36
40
|
].filter(Boolean).join(' ')
|
|
37
41
|
)
|
|
38
42
|
|
|
@@ -43,6 +47,19 @@ useComponentHost(controllerModule.default, {
|
|
|
43
47
|
dispatch,
|
|
44
48
|
props,
|
|
45
49
|
})
|
|
50
|
+
|
|
51
|
+
function text(value: unknown): string {
|
|
52
|
+
if (Array.isArray(value)) return value.map(text).join(' ')
|
|
53
|
+
return value === null || value === undefined || typeof value === 'object' ? '' : String(value)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function attribute(value: unknown): any {
|
|
57
|
+
if (
|
|
58
|
+
value === null || value === undefined || value === false
|
|
59
|
+
|| (typeof value === 'object' && !Array.isArray(value))
|
|
60
|
+
) return undefined
|
|
61
|
+
return value === true ? '' : text(value)
|
|
62
|
+
}
|
|
46
63
|
</script>
|
|
47
64
|
|
|
48
65
|
<template>
|
|
@@ -52,10 +69,15 @@ useComponentHost(controllerModule.default, {
|
|
|
52
69
|
v-bind="$attrs"
|
|
53
70
|
:disabled="disabled"
|
|
54
71
|
:aria-label="label"
|
|
72
|
+
:aria-disabled="typeof (({ true: 'true', false: null })[`${pending}`]) === 'boolean'
|
|
73
|
+
? String(({ true: 'true', false: null })[`${pending}`])
|
|
74
|
+
: attribute(({ true: 'true', false: null })[`${pending}`])"
|
|
75
|
+
:aria-busy="pending"
|
|
55
76
|
:data-ui-icon-button-state="hostState || undefined"
|
|
56
77
|
ref="root"
|
|
57
78
|
>
|
|
58
|
-
<
|
|
79
|
+
<UiSpinner v-if="pending" size="sm" />
|
|
80
|
+
<span class="content"><slot /></span>
|
|
59
81
|
</button>
|
|
60
82
|
</template>
|
|
61
83
|
|
|
@@ -189,7 +211,7 @@ useComponentHost(controllerModule.default, {
|
|
|
189
211
|
padding: 0;
|
|
190
212
|
margin: 0;
|
|
191
213
|
border: 1px solid transparent;
|
|
192
|
-
border-radius: var(--ui-icon-button-radius, var(--ui-radius-md));
|
|
214
|
+
border-radius: var(--ui-icon-button-radius, var(--ui-action-radius, var(--ui-radius-md)));
|
|
193
215
|
background: var(--ui-icon-button-surface, transparent);
|
|
194
216
|
color: inherit;
|
|
195
217
|
display: inline-flex;
|
|
@@ -275,24 +297,36 @@ html[data-ui-input-modality="touch"] [data-component~="ui-icon-button"]::after {
|
|
|
275
297
|
);
|
|
276
298
|
}
|
|
277
299
|
|
|
278
|
-
[data-component~="ui-icon-button"]:hover:enabled {
|
|
300
|
+
[data-component~="ui-icon-button"]:hover:enabled:not([aria-disabled="true"]) {
|
|
279
301
|
/* Derived from the text colour so the ghost hover shows on any background. */
|
|
280
302
|
background: var(--ui-icon-button-hover-surface, color-mix(in srgb, currentColor 8%, transparent));
|
|
281
303
|
color: var(--ui-icon-button-hover-text, var(--ui-text-primary));
|
|
282
304
|
}
|
|
283
305
|
|
|
284
|
-
[data-component~="ui-icon-button"][data-ui-icon-button-state~="variant=outline"]:hover:enabled {
|
|
306
|
+
[data-component~="ui-icon-button"][data-ui-icon-button-state~="variant=outline"]:hover:enabled:not([aria-disabled="true"]) {
|
|
285
307
|
border-color: var(--ui-icon-button-hover-border, var(--ui-border-strong));
|
|
286
308
|
}
|
|
287
309
|
|
|
288
|
-
[data-component~="ui-icon-button"][data-ui-icon-button-state~="variant=solid"]:hover:enabled {
|
|
310
|
+
[data-component~="ui-icon-button"][data-ui-icon-button-state~="variant=solid"]:hover:enabled:not([aria-disabled="true"]) {
|
|
289
311
|
background: var(--ui-icon-button-solid-hover-surface, var(--ui-accent-hover));
|
|
290
312
|
}
|
|
291
313
|
|
|
292
|
-
[data-component~="ui-icon-button"]:active:enabled {
|
|
314
|
+
[data-component~="ui-icon-button"]:active:enabled:not([aria-disabled="true"]) {
|
|
293
315
|
transform: scale(var(--ui-icon-button-active-scale, 0.96));
|
|
294
316
|
}
|
|
295
317
|
|
|
318
|
+
[data-component~="ui-icon-button"][data-ui-icon-button-state~="pending"] {
|
|
319
|
+
cursor: progress;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.content {
|
|
323
|
+
display: contents;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
[data-component~="ui-icon-button"][data-ui-icon-button-state~="pending"] .content {
|
|
327
|
+
display: none;
|
|
328
|
+
}
|
|
329
|
+
|
|
296
330
|
[data-component~="ui-icon-button"]:focus-visible {
|
|
297
331
|
outline: none;
|
|
298
332
|
box-shadow: var(--ui-focus-halo);
|
package/vue/UiInput.vue
CHANGED
|
@@ -133,7 +133,10 @@ useComponentHost(controllerModule.default, {
|
|
|
133
133
|
--ui-input-border,
|
|
134
134
|
var(--_ui-default-input-border, var(--ui-control-border, var(--ui-border-strong)))
|
|
135
135
|
);
|
|
136
|
-
border-radius: var(
|
|
136
|
+
border-radius: var(
|
|
137
|
+
--ui-input-radius,
|
|
138
|
+
var(--_ui-default-input-radius, var(--ui-field-radius, var(--ui-radius-md)))
|
|
139
|
+
);
|
|
137
140
|
background: var(
|
|
138
141
|
--ui-input-surface,
|
|
139
142
|
var(--_ui-default-input-surface, var(--ui-control-surface, var(--ui-surface-elevated)))
|
|
@@ -218,7 +221,7 @@ useComponentHost(controllerModule.default, {
|
|
|
218
221
|
[data-component~="ui-input"]:is(:user-invalid, [data-user-invalid]) {
|
|
219
222
|
border-color: var(
|
|
220
223
|
--ui-input-invalid-border,
|
|
221
|
-
var(--_ui-default-input-invalid-border, var(--ui-danger-solid))
|
|
224
|
+
var(--_ui-default-input-invalid-border, var(--ui-field-danger, var(--ui-danger-solid)))
|
|
222
225
|
);
|
|
223
226
|
}
|
|
224
227
|
|
|
@@ -228,7 +231,11 @@ useComponentHost(controllerModule.default, {
|
|
|
228
231
|
var(
|
|
229
232
|
--_ui-default-input-invalid-focus-shadow,
|
|
230
233
|
var(--ui-control-inset),
|
|
231
|
-
0 0 0 3px color-mix(
|
|
234
|
+
0 0 0 3px color-mix(
|
|
235
|
+
in srgb,
|
|
236
|
+
var(--ui-input-invalid-border, var(--ui-field-danger, var(--ui-danger-solid))) 22%,
|
|
237
|
+
transparent
|
|
238
|
+
)
|
|
232
239
|
)
|
|
233
240
|
);
|
|
234
241
|
}
|
package/vue/UiInputGroup.vue
CHANGED
|
@@ -48,14 +48,26 @@ useComponentHost(controllerModule.default, {
|
|
|
48
48
|
</template>
|
|
49
49
|
|
|
50
50
|
<style scoped>
|
|
51
|
+
@property --ui-input-group-radius {
|
|
52
|
+
syntax: "*";
|
|
53
|
+
inherits: false;
|
|
54
|
+
}
|
|
55
|
+
@property --ui-input-group-invalid-border {
|
|
56
|
+
syntax: "*";
|
|
57
|
+
inherits: false;
|
|
58
|
+
}
|
|
59
|
+
@property --ui-input-group-invalid-focus-shadow {
|
|
60
|
+
syntax: "*";
|
|
61
|
+
inherits: false;
|
|
62
|
+
}
|
|
51
63
|
/* An input with fixed text before or after it, such as a domain after a site's name
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
64
|
+
("acme" + ".example.com") or slashes around a path. The group draws the field's border and
|
|
65
|
+
focus ring around the input and its affixes together; the input inside drops its own through
|
|
66
|
+
its custom properties, so it is still the one ui-input, with its form behaviour intact. The
|
|
67
|
+
affixes are plain text beside the input, so name the input with a label that says what the
|
|
68
|
+
whole value is. The action slot takes one button at the end, inside the border, for the one
|
|
69
|
+
thing the field is for ("Continue" after a site's address), so it reads as the field's action
|
|
70
|
+
and not the form's. */
|
|
59
71
|
[data-component~="ui-input-group"] {
|
|
60
72
|
/* The group's own border and height stand for the input's, so the group is a lone Input's height.
|
|
61
73
|
Hooks do not inherit, so these are defaults for the input; its own hooks still win. */
|
|
@@ -80,7 +92,7 @@ useComponentHost(controllerModule.default, {
|
|
|
80
92
|
min-block-size: var(--ui-control-size-md);
|
|
81
93
|
/* The frame reads the shared control tokens with a lone Input's fallbacks, so the two match. */
|
|
82
94
|
border: 1px solid var(--ui-control-border, var(--ui-border-strong));
|
|
83
|
-
border-radius: var(--ui-radius-md);
|
|
95
|
+
border-radius: var(--ui-input-group-radius, var(--ui-field-radius, var(--ui-radius-md)));
|
|
84
96
|
background: var(--ui-control-surface, var(--ui-surface-elevated));
|
|
85
97
|
box-shadow: var(--ui-control-inset);
|
|
86
98
|
overflow: hidden;
|
|
@@ -120,13 +132,22 @@ useComponentHost(controllerModule.default, {
|
|
|
120
132
|
}
|
|
121
133
|
|
|
122
134
|
[data-component~="ui-input-group"]:has([aria-invalid="true"], :is(:user-invalid, [data-user-invalid])) {
|
|
123
|
-
border-color: var(
|
|
135
|
+
border-color: var(
|
|
136
|
+
--ui-input-group-invalid-border,
|
|
137
|
+
var(--ui-field-danger, var(--ui-danger-solid))
|
|
138
|
+
);
|
|
124
139
|
}
|
|
125
140
|
|
|
126
141
|
[data-component~="ui-input-group"]:has(input:is([aria-invalid="true"], :is(:user-invalid, [data-user-invalid])):focus-visible) {
|
|
127
|
-
box-shadow:
|
|
142
|
+
box-shadow: var(
|
|
143
|
+
--ui-input-group-invalid-focus-shadow,
|
|
128
144
|
var(--ui-control-inset),
|
|
129
|
-
0 0 0 3px color-mix(
|
|
145
|
+
0 0 0 3px color-mix(
|
|
146
|
+
in srgb,
|
|
147
|
+
var(--ui-input-group-invalid-border, var(--ui-field-danger, var(--ui-danger-solid))) 22%,
|
|
148
|
+
transparent
|
|
149
|
+
)
|
|
150
|
+
);
|
|
130
151
|
}
|
|
131
152
|
|
|
132
153
|
/* Forced colors drop box shadows, so the focus ring becomes an outline. */
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
disabled?: boolean;
|
|
3
|
+
invalid?: boolean;
|
|
4
|
+
multiple?: boolean;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
rows?: number;
|
|
7
|
+
value?: string;
|
|
8
|
+
values?: readonly (string)[];
|
|
9
|
+
modelValue?: string | null;
|
|
10
|
+
};
|
|
11
|
+
declare var __VLS_1: {};
|
|
12
|
+
type __VLS_Slots = {} & {
|
|
13
|
+
default?: (props: typeof __VLS_1) => any;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
|
+
"update:modelValue": (value: string) => any;
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
18
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
19
|
+
}>, {
|
|
20
|
+
invalid: boolean;
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
required: boolean;
|
|
23
|
+
multiple: boolean;
|
|
24
|
+
rows: number;
|
|
25
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|
package/vue/UiListbox.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<!-- Generated by HTML Next 1.0.0-alpha.7 for Vue 3.5. Do not edit. -->
|
|
2
|
+
<script setup lang="ts">
|
|
3
|
+
import { computed, ref } from 'vue'
|
|
4
|
+
import * as controllerModule from '../components/ui-listbox/ui-listbox.js'
|
|
5
|
+
import { createDispatch, useComponentHost } from './host'
|
|
6
|
+
|
|
7
|
+
defineOptions({ inheritAttrs: false })
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(
|
|
10
|
+
defineProps<{
|
|
11
|
+
disabled?: boolean
|
|
12
|
+
invalid?: boolean
|
|
13
|
+
multiple?: boolean
|
|
14
|
+
required?: boolean
|
|
15
|
+
rows?: number
|
|
16
|
+
value?: string
|
|
17
|
+
values?: readonly (string)[]
|
|
18
|
+
modelValue?: string | null
|
|
19
|
+
}>(),
|
|
20
|
+
{
|
|
21
|
+
disabled: false,
|
|
22
|
+
invalid: false,
|
|
23
|
+
multiple: false,
|
|
24
|
+
required: false,
|
|
25
|
+
rows: 5,
|
|
26
|
+
},
|
|
27
|
+
)
|
|
28
|
+
const emit = defineEmits<{
|
|
29
|
+
'update:modelValue': [value: string]
|
|
30
|
+
}>()
|
|
31
|
+
const model = computed({
|
|
32
|
+
get: () => props.modelValue ?? props.value ?? undefined,
|
|
33
|
+
set: (value) => emit('update:modelValue', value as string),
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const root = ref<HTMLElement | null>(null)
|
|
37
|
+
|
|
38
|
+
const dispatch = createDispatch(root)
|
|
39
|
+
|
|
40
|
+
useComponentHost(controllerModule.default, {
|
|
41
|
+
root,
|
|
42
|
+
dispatch,
|
|
43
|
+
props,
|
|
44
|
+
})
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<template>
|
|
48
|
+
<select
|
|
49
|
+
data-component="ui-listbox"
|
|
50
|
+
v-bind="$attrs"
|
|
51
|
+
:size="rows"
|
|
52
|
+
:multiple="multiple"
|
|
53
|
+
:disabled="disabled"
|
|
54
|
+
:required="required"
|
|
55
|
+
:aria-invalid="invalid"
|
|
56
|
+
v-model="model"
|
|
57
|
+
ref="root"
|
|
58
|
+
>
|
|
59
|
+
<slot />
|
|
60
|
+
</select>
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
|
+
<style scoped>
|
|
64
|
+
@property --ui-listbox-radius {
|
|
65
|
+
syntax: "*";
|
|
66
|
+
inherits: false;
|
|
67
|
+
}
|
|
68
|
+
@property --ui-listbox-border {
|
|
69
|
+
syntax: "*";
|
|
70
|
+
inherits: false;
|
|
71
|
+
}
|
|
72
|
+
@property --ui-listbox-surface {
|
|
73
|
+
syntax: "*";
|
|
74
|
+
inherits: false;
|
|
75
|
+
}
|
|
76
|
+
@property --ui-listbox-focus-shadow {
|
|
77
|
+
syntax: "*";
|
|
78
|
+
inherits: false;
|
|
79
|
+
}
|
|
80
|
+
@property --ui-listbox-invalid-border {
|
|
81
|
+
syntax: "*";
|
|
82
|
+
inherits: false;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
[data-component~="ui-listbox"] {
|
|
86
|
+
box-sizing: border-box;
|
|
87
|
+
display: block;
|
|
88
|
+
inline-size: 100%;
|
|
89
|
+
min-inline-size: 0;
|
|
90
|
+
min-block-size: var(--ui-control-min-block-size);
|
|
91
|
+
margin: 0;
|
|
92
|
+
padding: var(--ui-space-1);
|
|
93
|
+
border: 1px solid var(--ui-listbox-border, var(--ui-control-border));
|
|
94
|
+
border-radius: var(--ui-listbox-radius, var(--ui-field-radius, var(--ui-radius-md)));
|
|
95
|
+
background: var(--ui-listbox-surface, var(--ui-control-surface));
|
|
96
|
+
color: var(--ui-text-primary);
|
|
97
|
+
color-scheme: light dark;
|
|
98
|
+
font: inherit;
|
|
99
|
+
line-height: var(--ui-line-height-md);
|
|
100
|
+
box-shadow: var(--ui-control-inset);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
[data-component~="ui-listbox"] option,
|
|
104
|
+
[data-component~="ui-listbox"] optgroup {
|
|
105
|
+
padding: var(--ui-space-2);
|
|
106
|
+
font: inherit;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
[data-component~="ui-listbox"]:focus-visible {
|
|
110
|
+
border-color: var(--ui-control-focus);
|
|
111
|
+
outline: 2px solid var(--ui-focus-ring);
|
|
112
|
+
outline-offset: 2px;
|
|
113
|
+
box-shadow: var(--ui-listbox-focus-shadow, var(--ui-focus-halo));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
[data-component~="ui-listbox"][aria-invalid="true"],
|
|
117
|
+
[data-component~="ui-listbox"]:is(:user-invalid, [data-user-invalid]) {
|
|
118
|
+
border-color: var(--ui-listbox-invalid-border, var(--ui-field-danger, var(--ui-danger)));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
[data-component~="ui-listbox"]:disabled {
|
|
122
|
+
background: var(--ui-control-surface-disabled);
|
|
123
|
+
color: var(--ui-disabled-text);
|
|
124
|
+
box-shadow: none;
|
|
125
|
+
cursor: not-allowed;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
[data-component~="ui-listbox"][hidden] {
|
|
129
|
+
display: none;
|
|
130
|
+
}
|
|
131
|
+
</style>
|
package/vue/UiMenu.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ type __VLS_Slots = {} & {
|
|
|
11
11
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
12
|
select: (detail: {
|
|
13
13
|
readonly value: string;
|
|
14
|
+
readonly checked?: boolean;
|
|
14
15
|
readonly trigger: "keyboard" | "pointer" | "programmatic";
|
|
15
16
|
}) => any;
|
|
16
17
|
close: (detail: {
|
|
@@ -27,6 +28,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
27
28
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
28
29
|
onSelect?: ((detail: {
|
|
29
30
|
readonly value: string;
|
|
31
|
+
readonly checked?: boolean;
|
|
30
32
|
readonly trigger: "keyboard" | "pointer" | "programmatic";
|
|
31
33
|
}) => any) | undefined;
|
|
32
34
|
onClose?: ((detail: {
|
package/vue/UiMenu.vue
CHANGED
|
@@ -23,7 +23,11 @@ const props = withDefaults(
|
|
|
23
23
|
const emit = defineEmits<{
|
|
24
24
|
'update:open': [value: boolean]
|
|
25
25
|
select: [
|
|
26
|
-
detail: {
|
|
26
|
+
detail: {
|
|
27
|
+
readonly value: string
|
|
28
|
+
readonly checked?: boolean
|
|
29
|
+
readonly trigger: 'keyboard' | 'pointer' | 'programmatic'
|
|
30
|
+
},
|
|
27
31
|
]
|
|
28
32
|
open: [
|
|
29
33
|
detail: {
|
|
@@ -55,10 +59,12 @@ const hostState = computed(() =>
|
|
|
55
59
|
const isSelectDetail = (detail: unknown): boolean =>
|
|
56
60
|
detail !== null && typeof detail === 'object' && !Array.isArray(detail)
|
|
57
61
|
&& typeof (detail as Record<string, unknown>)['value'] === 'string'
|
|
62
|
+
&& ((detail as Record<string, unknown>)['checked'] === undefined
|
|
63
|
+
|| typeof (detail as Record<string, unknown>)['checked'] === 'boolean')
|
|
58
64
|
&& ((detail as Record<string, unknown>)['trigger'] === 'keyboard'
|
|
59
65
|
|| (detail as Record<string, unknown>)['trigger'] === 'pointer'
|
|
60
66
|
|| (detail as Record<string, unknown>)['trigger'] === 'programmatic')
|
|
61
|
-
&& Object.keys(detail as object).every((key) => ['value', 'trigger'].includes(key))
|
|
67
|
+
&& Object.keys(detail as object).every((key) => ['value', 'checked', 'trigger'].includes(key))
|
|
62
68
|
const isOpenDetail = (detail: unknown): boolean =>
|
|
63
69
|
detail !== null && typeof detail === 'object' && !Array.isArray(detail)
|
|
64
70
|
&& typeof (detail as Record<string, unknown>)['open'] === 'boolean'
|
|
@@ -111,6 +117,22 @@ useComponentHost(controllerModule.default, {
|
|
|
111
117
|
|
|
112
118
|
<style scoped>
|
|
113
119
|
/* This component's hooks style the element they are set on, and never a nested one. */
|
|
120
|
+
@property --ui-menu-surface {
|
|
121
|
+
syntax: "*";
|
|
122
|
+
inherits: false;
|
|
123
|
+
}
|
|
124
|
+
@property --ui-menu-border {
|
|
125
|
+
syntax: "*";
|
|
126
|
+
inherits: false;
|
|
127
|
+
}
|
|
128
|
+
@property --ui-menu-radius {
|
|
129
|
+
syntax: "*";
|
|
130
|
+
inherits: false;
|
|
131
|
+
}
|
|
132
|
+
@property --ui-menu-shadow {
|
|
133
|
+
syntax: "*";
|
|
134
|
+
inherits: false;
|
|
135
|
+
}
|
|
114
136
|
@property --ui-menu-viewport-gap {
|
|
115
137
|
syntax: "*";
|
|
116
138
|
inherits: false;
|
|
@@ -128,6 +150,10 @@ useComponentHost(controllerModule.default, {
|
|
|
128
150
|
}
|
|
129
151
|
|
|
130
152
|
[data-component~="ui-menu"] {
|
|
153
|
+
--_ui-menu-surface: var(--ui-menu-surface);
|
|
154
|
+
--_ui-menu-border: var(--ui-menu-border);
|
|
155
|
+
--_ui-menu-radius: var(--ui-menu-radius);
|
|
156
|
+
--_ui-menu-shadow: var(--ui-menu-shadow);
|
|
131
157
|
/* A menu nested in a compact one starts again from its own density. */
|
|
132
158
|
--_ui-default-menu-item-padding-block: initial;
|
|
133
159
|
--_ui-default-menu-item-padding-inline: initial;
|
|
@@ -154,14 +180,25 @@ useComponentHost(controllerModule.default, {
|
|
|
154
180
|
box-sizing: border-box;
|
|
155
181
|
max-inline-size: inherit;
|
|
156
182
|
padding: var(--ui-space-1);
|
|
157
|
-
background: var(--ui-surface-elevated);
|
|
158
|
-
border: 1px solid var(--ui-border-default);
|
|
159
|
-
border-radius: var(--ui-radius-lg);
|
|
160
|
-
box-shadow: var(
|
|
183
|
+
background: var(--_ui-menu-surface, var(--ui-overlay-surface, var(--ui-surface-elevated)));
|
|
184
|
+
border: 1px solid var(--_ui-menu-border, var(--ui-overlay-border, var(--ui-border-default)));
|
|
185
|
+
border-radius: var(--_ui-menu-radius, var(--ui-overlay-radius, var(--ui-radius-lg)));
|
|
186
|
+
box-shadow: var(
|
|
187
|
+
--_ui-menu-shadow,
|
|
188
|
+
var(--ui-overlay-shadow, var(--ui-elevation-overlay, var(--ui-shadow-lg)))
|
|
189
|
+
);
|
|
161
190
|
max-block-size: inherit;
|
|
162
191
|
overflow: auto;
|
|
163
192
|
}
|
|
164
193
|
|
|
194
|
+
.surface hr {
|
|
195
|
+
align-self: stretch;
|
|
196
|
+
block-size: 0;
|
|
197
|
+
margin: var(--ui-space-1) 0;
|
|
198
|
+
border: 0;
|
|
199
|
+
border-block-start: 1px solid var(--ui-border-default);
|
|
200
|
+
}
|
|
201
|
+
|
|
165
202
|
[data-component~="ui-menu"]:not([data-component~="ui-menu"][data-ui-menu-state~="internalOpen"]) {
|
|
166
203
|
display: none;
|
|
167
204
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label?: string;
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_1: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
default?: (props: typeof __VLS_1) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
|
+
label: string;
|
|
10
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|