@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/UiTabs.vue
CHANGED
|
@@ -8,6 +8,7 @@ defineOptions({ inheritAttrs: false })
|
|
|
8
8
|
|
|
9
9
|
const props = withDefaults(
|
|
10
10
|
defineProps<{
|
|
11
|
+
activation?: 'auto' | 'manual'
|
|
11
12
|
density?: 'comfortable' | 'compact'
|
|
12
13
|
label?: string
|
|
13
14
|
orientation?: 'horizontal' | 'vertical'
|
|
@@ -15,6 +16,7 @@ const props = withDefaults(
|
|
|
15
16
|
value?: string
|
|
16
17
|
}>(),
|
|
17
18
|
{
|
|
19
|
+
activation: 'auto',
|
|
18
20
|
density: 'comfortable',
|
|
19
21
|
label: 'Tabs',
|
|
20
22
|
orientation: 'horizontal',
|
|
@@ -82,18 +84,18 @@ useComponentHost(controllerModule.default, {
|
|
|
82
84
|
ref="root"
|
|
83
85
|
>
|
|
84
86
|
<div class="list" role="tablist" :aria-label="label" :aria-orientation="orientation" ref="list">
|
|
85
|
-
<button
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
87
|
+
<slot name="tab"><button
|
|
88
|
+
v-for="tab in tabs"
|
|
89
|
+
:key="tab.id"
|
|
90
|
+
type="button"
|
|
91
|
+
role="tab"
|
|
92
|
+
:id="`${tab.id}-tab`"
|
|
93
|
+
:value="tab.id"
|
|
94
|
+
:aria-controls="tab.id"
|
|
95
|
+
:aria-selected="tab.id === internalValue"
|
|
96
|
+
>
|
|
97
|
+
{{ tab.label }}
|
|
98
|
+
</button></slot>
|
|
97
99
|
</div>
|
|
98
100
|
<div class="panels" ref="panels"><slot /></div>
|
|
99
101
|
</div>
|
package/vue/UiTextarea.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
|
+
autosize?: boolean;
|
|
2
3
|
disabled?: boolean;
|
|
3
4
|
invalid?: boolean;
|
|
4
5
|
readonly?: boolean;
|
|
@@ -19,6 +20,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
19
20
|
required: boolean;
|
|
20
21
|
readonly: boolean;
|
|
21
22
|
rows: number;
|
|
23
|
+
autosize: boolean;
|
|
22
24
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
25
|
declare const _default: typeof __VLS_export;
|
|
24
26
|
export default _default;
|
package/vue/UiTextarea.vue
CHANGED
|
@@ -8,6 +8,7 @@ defineOptions({ inheritAttrs: false })
|
|
|
8
8
|
|
|
9
9
|
const props = withDefaults(
|
|
10
10
|
defineProps<{
|
|
11
|
+
autosize?: boolean
|
|
11
12
|
disabled?: boolean
|
|
12
13
|
invalid?: boolean
|
|
13
14
|
readonly?: boolean
|
|
@@ -18,6 +19,7 @@ const props = withDefaults(
|
|
|
18
19
|
modelValue?: string | null
|
|
19
20
|
}>(),
|
|
20
21
|
{
|
|
22
|
+
autosize: false,
|
|
21
23
|
disabled: false,
|
|
22
24
|
invalid: false,
|
|
23
25
|
readonly: false,
|
|
@@ -40,6 +42,7 @@ const root = ref<HTMLElement | null>(null)
|
|
|
40
42
|
const hostState = computed(() =>
|
|
41
43
|
[
|
|
42
44
|
props.size && `size size=${props.size}`,
|
|
45
|
+
props.autosize && 'autosize',
|
|
43
46
|
].filter(Boolean).join(' ')
|
|
44
47
|
)
|
|
45
48
|
|
|
@@ -61,6 +64,7 @@ useComponentHost(controllerModule.default, {
|
|
|
61
64
|
:required="required"
|
|
62
65
|
:aria-invalid="invalid"
|
|
63
66
|
:rows="rows"
|
|
67
|
+
:style="{ '--_rows': rows }"
|
|
64
68
|
v-model="model"
|
|
65
69
|
:data-ui-textarea-state="hostState || undefined"
|
|
66
70
|
ref="root"
|
|
@@ -73,6 +77,14 @@ useComponentHost(controllerModule.default, {
|
|
|
73
77
|
syntax: "*";
|
|
74
78
|
inherits: false;
|
|
75
79
|
}
|
|
80
|
+
@property --ui-textarea-invalid-border {
|
|
81
|
+
syntax: "*";
|
|
82
|
+
inherits: false;
|
|
83
|
+
}
|
|
84
|
+
@property --ui-textarea-invalid-focus-shadow {
|
|
85
|
+
syntax: "*";
|
|
86
|
+
inherits: false;
|
|
87
|
+
}
|
|
76
88
|
@property --ui-textarea-radius {
|
|
77
89
|
syntax: "*";
|
|
78
90
|
inherits: false;
|
|
@@ -89,11 +101,12 @@ useComponentHost(controllerModule.default, {
|
|
|
89
101
|
min-inline-size: 0;
|
|
90
102
|
min-block-size: calc(3rem * 2);
|
|
91
103
|
margin: 0;
|
|
104
|
+
--_padding-block: var(--ui-space-2);
|
|
92
105
|
padding: var(--ui-space-2) var(--ui-space-3);
|
|
93
106
|
appearance: none;
|
|
94
107
|
resize: vertical;
|
|
95
108
|
border: 1px solid var(--ui-control-border, var(--ui-border-strong));
|
|
96
|
-
border-radius: var(--ui-textarea-radius, var(--ui-radius-md));
|
|
109
|
+
border-radius: var(--ui-textarea-radius, var(--ui-field-radius, var(--ui-radius-md)));
|
|
97
110
|
background: var(--ui-control-surface, var(--ui-surface-elevated));
|
|
98
111
|
color: var(--ui-text-primary);
|
|
99
112
|
font: inherit;
|
|
@@ -133,13 +146,19 @@ useComponentHost(controllerModule.default, {
|
|
|
133
146
|
/* The app's invalid flag, or the browser's own verdict once the user has left an invalid field. */
|
|
134
147
|
[data-component~="ui-textarea"][aria-invalid="true"],
|
|
135
148
|
[data-component~="ui-textarea"]:is(:user-invalid, [data-user-invalid]) {
|
|
136
|
-
border-color: var(--ui-danger-solid);
|
|
149
|
+
border-color: var(--ui-textarea-invalid-border, var(--ui-field-danger, var(--ui-danger-solid)));
|
|
137
150
|
}
|
|
138
151
|
|
|
139
152
|
[data-component~="ui-textarea"]:is([aria-invalid="true"], :is(:user-invalid, [data-user-invalid])):focus-visible {
|
|
140
|
-
box-shadow:
|
|
153
|
+
box-shadow: var(
|
|
154
|
+
--ui-textarea-invalid-focus-shadow,
|
|
141
155
|
var(--ui-control-inset),
|
|
142
|
-
0 0 0 3px color-mix(
|
|
156
|
+
0 0 0 3px color-mix(
|
|
157
|
+
in srgb,
|
|
158
|
+
var(--ui-textarea-invalid-border, var(--ui-field-danger, var(--ui-danger-solid))) 22%,
|
|
159
|
+
transparent
|
|
160
|
+
)
|
|
161
|
+
);
|
|
143
162
|
}
|
|
144
163
|
|
|
145
164
|
[data-component~="ui-textarea"]:disabled {
|
|
@@ -150,15 +169,24 @@ useComponentHost(controllerModule.default, {
|
|
|
150
169
|
}
|
|
151
170
|
|
|
152
171
|
[data-component~="ui-textarea"][data-ui-textarea-state~="size=sm"] {
|
|
172
|
+
--_padding-block: var(--ui-space-1);
|
|
153
173
|
padding: var(--ui-space-1) var(--ui-space-2);
|
|
154
174
|
font-size: var(--ui-font-size-sm);
|
|
155
175
|
}
|
|
156
176
|
|
|
157
177
|
[data-component~="ui-textarea"][data-ui-textarea-state~="size=lg"] {
|
|
178
|
+
--_padding-block: var(--ui-space-3);
|
|
158
179
|
padding: var(--ui-space-3) var(--ui-space-4);
|
|
159
180
|
font-size: var(--ui-font-size-md);
|
|
160
181
|
}
|
|
161
182
|
|
|
183
|
+
@supports (field-sizing: content) {
|
|
184
|
+
[data-component~="ui-textarea"][data-ui-textarea-state~="autosize"] {
|
|
185
|
+
field-sizing: content;
|
|
186
|
+
min-block-size: calc(var(--_rows) * 1lh + var(--_padding-block) + var(--_padding-block) + 2px);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
162
190
|
/* Below 16px, iOS zooms the page into the focused field, so touch keeps body-size text. */
|
|
163
191
|
@media (pointer: coarse) {
|
|
164
192
|
[data-component~="ui-textarea"][data-ui-textarea-state~="size=sm"] {
|
package/vue/UiToast.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
duration?: number;
|
|
3
|
+
tone?: 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_1: {}, __VLS_3: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_1) => any;
|
|
8
|
+
} & {
|
|
9
|
+
action?: (props: typeof __VLS_3) => any;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
dismiss: (detail: {
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly reason: "action" | "timeout";
|
|
15
|
+
readonly trigger: "keyboard" | "pointer" | "programmatic";
|
|
16
|
+
}) => any;
|
|
17
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
18
|
+
onDismiss?: ((detail: {
|
|
19
|
+
readonly id: string;
|
|
20
|
+
readonly reason: "action" | "timeout";
|
|
21
|
+
readonly trigger: "keyboard" | "pointer" | "programmatic";
|
|
22
|
+
}) => any) | undefined;
|
|
23
|
+
}>, {
|
|
24
|
+
tone: "neutral" | "info" | "success" | "warning" | "danger";
|
|
25
|
+
duration: number;
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
export default _default;
|
|
30
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
31
|
+
new (): {
|
|
32
|
+
$slots: S;
|
|
33
|
+
};
|
|
34
|
+
};
|
package/vue/UiToast.js
ADDED
package/vue/UiToast.vue
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
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, useTemplateRef } from 'vue'
|
|
4
|
+
import * as controllerModule from '../components/ui-toast/ui-toast.js'
|
|
5
|
+
import { createDispatch, useComponentHost } from './host'
|
|
6
|
+
import UiIcon from './UiIcon.vue'
|
|
7
|
+
import UiIconButton from './UiIconButton.vue'
|
|
8
|
+
|
|
9
|
+
defineOptions({ inheritAttrs: false })
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(
|
|
12
|
+
defineProps<{
|
|
13
|
+
duration?: number
|
|
14
|
+
tone?: 'neutral' | 'info' | 'success' | 'warning' | 'danger'
|
|
15
|
+
}>(),
|
|
16
|
+
{
|
|
17
|
+
duration: 0,
|
|
18
|
+
tone: 'neutral',
|
|
19
|
+
},
|
|
20
|
+
)
|
|
21
|
+
const emit = defineEmits<{
|
|
22
|
+
dismiss: [
|
|
23
|
+
detail: {
|
|
24
|
+
readonly id: string
|
|
25
|
+
readonly reason: 'action' | 'timeout'
|
|
26
|
+
readonly trigger: 'keyboard' | 'pointer' | 'programmatic'
|
|
27
|
+
},
|
|
28
|
+
]
|
|
29
|
+
}>()
|
|
30
|
+
|
|
31
|
+
const root = ref<HTMLElement | null>(null)
|
|
32
|
+
const actionElement = useTemplateRef<HTMLElement>('action')
|
|
33
|
+
|
|
34
|
+
/** The values the styles' :host-state() rules test. */
|
|
35
|
+
const hostState = computed(() =>
|
|
36
|
+
[
|
|
37
|
+
props.tone && `tone tone=${props.tone}`,
|
|
38
|
+
].filter(Boolean).join(' ')
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
const isDismissDetail = (detail: unknown): boolean =>
|
|
42
|
+
detail !== null && typeof detail === 'object' && !Array.isArray(detail)
|
|
43
|
+
&& typeof (detail as Record<string, unknown>)['id'] === 'string'
|
|
44
|
+
&& ((detail as Record<string, unknown>)['reason'] === 'action'
|
|
45
|
+
|| (detail as Record<string, unknown>)['reason'] === 'timeout')
|
|
46
|
+
&& ((detail as Record<string, unknown>)['trigger'] === 'keyboard'
|
|
47
|
+
|| (detail as Record<string, unknown>)['trigger'] === 'pointer'
|
|
48
|
+
|| (detail as Record<string, unknown>)['trigger'] === 'programmatic')
|
|
49
|
+
&& Object.keys(detail as object).every((key) => ['id', 'reason', 'trigger'].includes(key))
|
|
50
|
+
const dispatch = createDispatch(root, emit as (name: string, detail: unknown) => void, {
|
|
51
|
+
checks: {
|
|
52
|
+
dismiss: isDismissDetail,
|
|
53
|
+
},
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
useComponentHost(controllerModule.default, {
|
|
57
|
+
root,
|
|
58
|
+
dispatch,
|
|
59
|
+
props,
|
|
60
|
+
refs: { action: actionElement },
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
function text(value: unknown): string {
|
|
64
|
+
if (Array.isArray(value)) return value.map(text).join(' ')
|
|
65
|
+
return value === null || value === undefined || typeof value === 'object' ? '' : String(value)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function attribute(value: unknown): any {
|
|
69
|
+
if (
|
|
70
|
+
value === null || value === undefined || value === false
|
|
71
|
+
|| (typeof value === 'object' && !Array.isArray(value))
|
|
72
|
+
) return undefined
|
|
73
|
+
return value === true ? '' : text(value)
|
|
74
|
+
}
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<template>
|
|
78
|
+
<div
|
|
79
|
+
data-component="ui-toast"
|
|
80
|
+
v-bind="$attrs"
|
|
81
|
+
:role="attribute(
|
|
82
|
+
({ neutral: 'status', info: 'status', success: 'status', warning: 'status', danger: 'alert' })[
|
|
83
|
+
tone
|
|
84
|
+
],
|
|
85
|
+
)"
|
|
86
|
+
:data-ui-toast-state="hostState || undefined"
|
|
87
|
+
ref="root"
|
|
88
|
+
>
|
|
89
|
+
<div class="message"><slot /></div>
|
|
90
|
+
<div class="action" ref="action"><slot name="action" /></div>
|
|
91
|
+
<UiIconButton
|
|
92
|
+
class="dismiss"
|
|
93
|
+
size="sm"
|
|
94
|
+
variant="ghost"
|
|
95
|
+
label="Dismiss notification"
|
|
96
|
+
:round="true"
|
|
97
|
+
><UiIcon name="x" /></UiIconButton>
|
|
98
|
+
</div>
|
|
99
|
+
</template>
|
|
100
|
+
|
|
101
|
+
<style scoped>
|
|
102
|
+
/* Component hooks stay on this toast; group overlay values may inherit from the region. */
|
|
103
|
+
@property --ui-toast-surface {
|
|
104
|
+
syntax: "*";
|
|
105
|
+
inherits: false;
|
|
106
|
+
}
|
|
107
|
+
@property --ui-toast-border {
|
|
108
|
+
syntax: "*";
|
|
109
|
+
inherits: false;
|
|
110
|
+
}
|
|
111
|
+
@property --ui-toast-radius {
|
|
112
|
+
syntax: "*";
|
|
113
|
+
inherits: false;
|
|
114
|
+
}
|
|
115
|
+
@property --ui-toast-shadow {
|
|
116
|
+
syntax: "*";
|
|
117
|
+
inherits: false;
|
|
118
|
+
}
|
|
119
|
+
@property --ui-toast-accent {
|
|
120
|
+
syntax: "*";
|
|
121
|
+
inherits: false;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
[data-component~="ui-toast"] {
|
|
125
|
+
--_ui-toast-accent: var(--ui-border-strong);
|
|
126
|
+
|
|
127
|
+
display: flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
gap: var(--ui-space-2);
|
|
130
|
+
box-sizing: border-box;
|
|
131
|
+
inline-size: 100%;
|
|
132
|
+
margin: 0;
|
|
133
|
+
padding: var(--ui-space-3) var(--ui-space-4);
|
|
134
|
+
border: 1px solid var(--ui-toast-border, var(--ui-overlay-border, var(--ui-border-default)));
|
|
135
|
+
border-inline-start: 3px solid var(--ui-toast-accent, var(--_ui-toast-accent));
|
|
136
|
+
border-radius: var(--ui-toast-radius, var(--ui-overlay-radius, var(--ui-radius-lg)));
|
|
137
|
+
background: var(--ui-toast-surface, var(--ui-overlay-surface, var(--ui-surface-elevated)));
|
|
138
|
+
color: var(--ui-text-primary);
|
|
139
|
+
box-shadow: var(
|
|
140
|
+
--ui-toast-shadow,
|
|
141
|
+
var(--ui-overlay-shadow, var(--ui-elevation-overlay, var(--ui-shadow-lg)))
|
|
142
|
+
);
|
|
143
|
+
pointer-events: auto;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
[data-component~="ui-toast"][data-ui-toast-state~="tone=info"] {
|
|
147
|
+
--_ui-toast-accent: var(--ui-info-solid);
|
|
148
|
+
}
|
|
149
|
+
[data-component~="ui-toast"][data-ui-toast-state~="tone=success"] {
|
|
150
|
+
--_ui-toast-accent: var(--ui-success-solid);
|
|
151
|
+
}
|
|
152
|
+
[data-component~="ui-toast"][data-ui-toast-state~="tone=warning"] {
|
|
153
|
+
--_ui-toast-accent: var(--ui-warning-solid);
|
|
154
|
+
}
|
|
155
|
+
[data-component~="ui-toast"][data-ui-toast-state~="tone=danger"] {
|
|
156
|
+
--_ui-toast-accent: var(--ui-danger-solid);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.message {
|
|
160
|
+
min-inline-size: 0;
|
|
161
|
+
flex: 1;
|
|
162
|
+
}
|
|
163
|
+
.action:not(:has(> *)) {
|
|
164
|
+
display: none;
|
|
165
|
+
}
|
|
166
|
+
.dismiss {
|
|
167
|
+
margin-inline-end: calc(var(--ui-space-2) * -1);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
[data-component~="ui-toast"][hidden] {
|
|
171
|
+
display: none;
|
|
172
|
+
}
|
|
173
|
+
</style>
|
package/vue/UiToastRegion.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
|
-
auto?: boolean;
|
|
3
2
|
duration?: number;
|
|
4
|
-
|
|
5
|
-
open?: boolean;
|
|
3
|
+
placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end';
|
|
6
4
|
};
|
|
7
5
|
declare var __VLS_1: {};
|
|
8
6
|
type __VLS_Slots = {} & {
|
|
@@ -11,33 +9,19 @@ type __VLS_Slots = {} & {
|
|
|
11
9
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
12
10
|
show: (...args: unknown[]) => Promise<unknown>;
|
|
13
11
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
-
close: (detail: {
|
|
15
|
-
readonly open: boolean;
|
|
16
|
-
readonly reason: "action" | "timeout" | "programmatic" | "light-dismiss" | "escape";
|
|
17
|
-
readonly trigger: "keyboard" | "pointer" | "programmatic";
|
|
18
|
-
}) => any;
|
|
19
|
-
"update:open": (value: boolean) => any;
|
|
20
12
|
dismiss: (detail: {
|
|
21
13
|
readonly id: string;
|
|
22
14
|
readonly reason: "action" | "timeout";
|
|
23
15
|
readonly trigger: "keyboard" | "pointer" | "programmatic";
|
|
24
16
|
}) => any;
|
|
25
17
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
26
|
-
onClose?: ((detail: {
|
|
27
|
-
readonly open: boolean;
|
|
28
|
-
readonly reason: "action" | "timeout" | "programmatic" | "light-dismiss" | "escape";
|
|
29
|
-
readonly trigger: "keyboard" | "pointer" | "programmatic";
|
|
30
|
-
}) => any) | undefined;
|
|
31
|
-
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
32
18
|
onDismiss?: ((detail: {
|
|
33
19
|
readonly id: string;
|
|
34
20
|
readonly reason: "action" | "timeout";
|
|
35
21
|
readonly trigger: "keyboard" | "pointer" | "programmatic";
|
|
36
22
|
}) => any) | undefined;
|
|
37
23
|
}>, {
|
|
38
|
-
|
|
39
|
-
message: string;
|
|
40
|
-
auto: boolean;
|
|
24
|
+
placement: "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end";
|
|
41
25
|
duration: number;
|
|
42
26
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
43
27
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|