@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.
- 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-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-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/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/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/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 +1840 -851
- package/vue/editor/index.js +263 -2
- package/vue/index.d.ts +6 -0
- package/vue/index.js +9 -3
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
|
|
2
|
+
import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
3
|
+
import * as controller from "../components/ui-toast/ui-toast.js";
|
|
4
|
+
import "../styles/ui-toast.css";
|
|
5
|
+
|
|
6
|
+
const definition = {...{"contract":{"tag":"ui-toast","props":{"duration":{"type":"number","required":false,"target":{"attribute":"duration"},"default":0},"tone":{"type":{"enum":["neutral","info","success","warning","danger"]},"required":false,"target":{"attribute":"tone"},"default":"neutral"}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"attribute","name":"role","expression":"{ neutral: 'status', info: 'status', success: 'status', warning: 'status', danger: 'alert' }[tone]","expressionPlan":{"source":"{ neutral: 'status', info: 'status', success: 'status', warning: 'status', danger: 'alert' }[tone]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"neutral","value":{"kind":"literal","value":"status"}},{"key":"info","value":{"kind":"literal","value":"status"}},{"key":"success","value":{"kind":"literal","value":"status"}},{"key":"warning","value":{"kind":"literal","value":"status"}},{"key":"danger","value":{"kind":"literal","value":"alert"}}]},"index":{"kind":"id","name":"tone"}},"dependencies":["tone"]}}],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"message"}],"children":[{"kind":"slot"}]},{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"action"}],"children":[{"kind":"slot","fallback":[],"name":"action"}],"ref":"action"},{"kind":"element","name":"ui-icon-button","attributes":[{"kind":"literal","name":"class","value":"dismiss"},{"kind":"literal","name":"size","value":"sm"},{"kind":"literal","name":"variant","value":"ghost"},{"kind":"attribute","name":"round","expression":"true","expressionPlan":{"source":"true","ast":{"kind":"literal","value":true},"dependencies":[]}},{"kind":"literal","name":"label","value":"Dismiss notification"}],"children":[{"kind":"element","name":"ui-icon","attributes":[{"kind":"literal","name":"name","value":"x"}],"children":[]}]}]},"declarations":[{"kind":"event","name":"dismiss","type":"object({ id: string, reason: action | timeout, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
|
|
7
|
+
|
|
8
|
+
export function createUiToast(options = {}) {
|
|
9
|
+
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
10
|
+
const projected = [];
|
|
11
|
+
const element = document.createElement("div");
|
|
12
|
+
for (const [name, value] of Object.entries(attributes)) {
|
|
13
|
+
if (value === null || value === undefined || value === false) continue;
|
|
14
|
+
element.setAttribute(name, value === true ? "" : String(value));
|
|
15
|
+
}
|
|
16
|
+
element.setAttribute("data-component", "ui-toast");
|
|
17
|
+
const element0 = document.createElement("div");
|
|
18
|
+
element0.setAttribute("class", "message");
|
|
19
|
+
if (children.length > 0) {
|
|
20
|
+
for (const child of children) {
|
|
21
|
+
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
22
|
+
projected.push([node, ""]);
|
|
23
|
+
element0.append(node);
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
}
|
|
27
|
+
element.append(element0);
|
|
28
|
+
const element1 = document.createElement("div");
|
|
29
|
+
element1.setAttribute("class", "action");
|
|
30
|
+
if (slots["action"] ?? [].length > 0) {
|
|
31
|
+
for (const child of slots["action"] ?? []) {
|
|
32
|
+
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
33
|
+
projected.push([node, "action"]);
|
|
34
|
+
element1.append(node);
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
}
|
|
38
|
+
element.append(element1);
|
|
39
|
+
const element2 = document.createElement("ui-icon-button");
|
|
40
|
+
element2.setAttribute("class", "dismiss");
|
|
41
|
+
element2.setAttribute("size", "sm");
|
|
42
|
+
element2.setAttribute("variant", "ghost");
|
|
43
|
+
element2.setAttribute("label", "Dismiss notification");
|
|
44
|
+
const element3 = document.createElement("ui-icon");
|
|
45
|
+
element3.setAttribute("name", "x");
|
|
46
|
+
element2.append(element3);
|
|
47
|
+
element.append(element2);
|
|
48
|
+
manageComponentLifecycle(element, definition, { props: componentProps, projected,
|
|
49
|
+
controller,
|
|
50
|
+
});
|
|
51
|
+
return element;
|
|
52
|
+
}
|
|
53
|
+
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// Generated by HTML Next 1.0.0-alpha.7 for Vanilla DOM. Do not edit.
|
|
2
2
|
export interface UiToastRegionEventMap {
|
|
3
|
-
close: CustomEvent<{ readonly open: boolean; readonly reason: "action" | "timeout" | "programmatic" | "light-dismiss" | "escape"; readonly trigger: "keyboard" | "pointer" | "programmatic" }>;
|
|
4
3
|
dismiss: CustomEvent<{ readonly id: string; readonly reason: "action" | "timeout"; readonly trigger: "keyboard" | "pointer" | "programmatic" }>;
|
|
5
4
|
}
|
|
6
5
|
export interface UiToastRegionElement extends HTMLDivElement {
|
|
@@ -9,10 +8,8 @@ export interface UiToastRegionElement extends HTMLDivElement {
|
|
|
9
8
|
removeEventListener<K extends keyof UiToastRegionEventMap>(type: K, listener: (this: UiToastRegionElement, event: UiToastRegionEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
10
9
|
}
|
|
11
10
|
export interface UiToastRegionProps {
|
|
12
|
-
auto?: boolean | null;
|
|
13
11
|
duration?: number | null;
|
|
14
|
-
|
|
15
|
-
open?: boolean | null;
|
|
12
|
+
placement?: "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | null;
|
|
16
13
|
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
17
14
|
children?: readonly (string | Node)[];
|
|
18
15
|
slots?: Readonly<Record<string, readonly (string | Node)[]>>;
|
package/vanilla/UiToastRegion.js
CHANGED
|
@@ -3,7 +3,7 @@ import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
|
3
3
|
import * as controller from "../components/ui-toast-region/ui-toast-region.js";
|
|
4
4
|
import "../styles/ui-toast-region.css";
|
|
5
5
|
|
|
6
|
-
const definition = {...{"contract":{"tag":"ui-toast-region","props":{"
|
|
6
|
+
const definition = {...{"contract":{"tag":"ui-toast-region","props":{"duration":{"type":"number","required":false,"target":{"attribute":"duration"},"default":0},"placement":{"type":{"enum":["top","top-start","top-end","bottom","bottom-start","bottom-end"]},"required":false,"target":{"attribute":"placement"},"default":"top"}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"role","value":"region"},{"kind":"literal","name":"aria-label","value":"Notifications"},{"kind":"literal","name":"aria-live","value":"polite"},{"kind":"literal","name":"popover","value":"manual"}],"children":[{"kind":"slot"},{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"toast"},{"kind":"attribute","name":"closing","expression":"toast.closing","expressionPlan":{"source":"toast.closing","ast":{"kind":"member","object":{"kind":"id","name":"toast"},"key":"closing"},"dependencies":["toast.closing"]},"target":"class"},{"kind":"attribute","name":"id","expression":"toast.id","expressionPlan":{"source":"toast.id","ast":{"kind":"member","object":{"kind":"id","name":"toast"},"key":"id"},"dependencies":["toast.id"]}},{"kind":"attribute","name":"role","expression":"toast.role","expressionPlan":{"source":"toast.role","ast":{"kind":"member","object":{"kind":"id","name":"toast"},"key":"role"},"dependencies":["toast.role"]}},{"kind":"attribute","name":"data-tone","expression":"toast.tone","expressionPlan":{"source":"toast.tone","ast":{"kind":"member","object":{"kind":"id","name":"toast"},"key":"tone"},"dependencies":["toast.tone"]}}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"message"},{"kind":"directive","name":"value","expression":"toast.message","expressionPlan":{"source":"toast.message","ast":{"kind":"member","object":{"kind":"id","name":"toast"},"key":"message"},"dependencies":["toast.message"]}}],"children":[]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"dismiss"},{"kind":"attribute","name":"data-toast","expression":"toast.id","expressionPlan":{"source":"toast.id","ast":{"kind":"member","object":{"kind":"id","name":"toast"},"key":"id"},"dependencies":["toast.id"]}}],"children":[{"kind":"element","name":"ui-icon-button","attributes":[{"kind":"literal","name":"size","value":"sm"},{"kind":"literal","name":"variant","value":"ghost"},{"kind":"attribute","name":"round","expression":"true","expressionPlan":{"source":"true","ast":{"kind":"literal","value":true},"dependencies":[]}},{"kind":"attribute","name":"label","expression":"format('Dismiss %s', toast.message)","expressionPlan":{"source":"format('Dismiss %s', toast.message)","ast":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"Dismiss %s"},{"kind":"member","object":{"kind":"id","name":"toast"},"key":"message"}]},"dependencies":["toast.message"]}}],"children":[{"kind":"element","name":"ui-icon","attributes":[{"kind":"literal","name":"name","value":"x"}],"children":[]}]}]}],"flow":{"kind":"each","item":"toast","list":"toasts","listPlan":{"source":"toasts","ast":{"kind":"id","name":"toasts"},"dependencies":["toasts"]},"key":"toast.id","keyPlan":{"source":"toast.id","ast":{"kind":"member","object":{"kind":"id","name":"toast"},"key":"id"},"dependencies":["toast.id"]}}}]},"declarations":[{"kind":"state","name":"toasts","type":"list(object({ id: string, message: string, tone: neutral | info | success | warning | danger, role: alert | status, closing: boolean }))","expression":{"source":"[]","ast":{"kind":"array","items":[]},"dependencies":[]}},{"kind":"event","name":"dismiss","type":"object({ id: string, reason: action | timeout, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false},{"kind":"method","name":"show","exportName":"show","returns":"promise(string)"}],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
|
|
7
7
|
|
|
8
8
|
export function createUiToastRegion(options = {}) {
|
|
9
9
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
@@ -36,16 +36,8 @@ export function createUiToastRegion(options = {}) {
|
|
|
36
36
|
const element3 = document.createElement("ui-icon-button");
|
|
37
37
|
element3.setAttribute("size", "sm");
|
|
38
38
|
element3.setAttribute("variant", "ghost");
|
|
39
|
-
const element4 = document.
|
|
40
|
-
element4.setAttribute("
|
|
41
|
-
element4.setAttribute("fill", "none");
|
|
42
|
-
element4.setAttribute("stroke", "currentColor");
|
|
43
|
-
element4.setAttribute("stroke-width", "2");
|
|
44
|
-
element4.setAttribute("stroke-linecap", "round");
|
|
45
|
-
element4.setAttribute("aria-hidden", "true");
|
|
46
|
-
const element5 = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
47
|
-
element5.setAttribute("d", "M18 6 6 18M6 6l12 12");
|
|
48
|
-
element4.append(element5);
|
|
39
|
+
const element4 = document.createElement("ui-icon");
|
|
40
|
+
element4.setAttribute("name", "x");
|
|
49
41
|
element3.append(element4);
|
|
50
42
|
element2.append(element3);
|
|
51
43
|
element0.append(element2);
|
package/vanilla/UiTooltip.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface UiTooltipProps {
|
|
|
12
12
|
hideDelay?: number | null;
|
|
13
13
|
inverse?: boolean | null;
|
|
14
14
|
open?: boolean | null;
|
|
15
|
-
placement?:
|
|
15
|
+
placement?: "top" | "top-start" | "top-end" | "bottom" | "bottom-start" | "bottom-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end" | null;
|
|
16
16
|
showDelay?: number | null;
|
|
17
17
|
trigger?: "hover" | "click" | "focus" | null;
|
|
18
18
|
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
package/vanilla/UiTooltip.js
CHANGED
|
@@ -3,7 +3,7 @@ import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
|
3
3
|
import * as controller from "../components/ui-tooltip/ui-tooltip.js";
|
|
4
4
|
import "../styles/ui-tooltip.css";
|
|
5
5
|
|
|
6
|
-
const definition = {...{"contract":{"tag":"ui-tooltip","props":{"for":{"type":"string","required":false,"target":{"attribute":"for"},"default":""},"hideDelay":{"type":"number","required":false,"target":{"attribute":"hidedelay"},"default":100},"inverse":{"type":"boolean","required":false,"target":{"attribute":"inverse"},"default":false},"open":{"type":"boolean","required":false,"target":{"attribute":"open"},"default":false},"placement":{"type":"
|
|
6
|
+
const definition = {...{"contract":{"tag":"ui-tooltip","props":{"for":{"type":"string","required":false,"target":{"attribute":"for"},"default":""},"hideDelay":{"type":"number","required":false,"target":{"attribute":"hidedelay"},"default":100},"inverse":{"type":"boolean","required":false,"target":{"attribute":"inverse"},"default":false},"open":{"type":"boolean","required":false,"target":{"attribute":"open"},"default":false},"placement":{"type":{"enum":["top","top-start","top-end","bottom","bottom-start","bottom-end","left","left-start","left-end","right","right-start","right-end"]},"required":false,"target":{"attribute":"placement"},"default":"top"},"showDelay":{"type":"number","required":false,"target":{"attribute":"showdelay"},"default":500},"trigger":{"type":{"enum":["hover","click","focus"]},"required":false,"target":{"attribute":"trigger"},"default":"hover"}}},"template":{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"role","value":"tooltip"},{"kind":"attribute","name":"hidden","expression":"not internalOpen","expressionPlan":{"source":"not internalOpen","ast":{"kind":"unary","op":"not","operand":{"kind":"id","name":"internalOpen"}},"dependencies":["internalOpen"]}}],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"surface"}],"children":[{"kind":"slot"}]}]},"declarations":[{"kind":"state","name":"internalOpen","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"event","name":"open","type":"object({ open: boolean, reason: action | programmatic | light-dismiss | escape, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false},{"kind":"event","name":"close","type":"object({ open: boolean, reason: action | programmatic | light-dismiss | escape, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"span","choices":["span"]}},source:{file:import.meta.url},css:""};
|
|
7
7
|
|
|
8
8
|
export function createUiTooltip(options = {}) {
|
|
9
9
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
package/vanilla/UiTree.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export interface UiTreeEventMap {
|
|
3
3
|
reorder: CustomEvent<{ readonly sourceId: string; readonly targetId: string; readonly position: "before" | "inside" | "after"; readonly sourceType: string; readonly targetType: string; readonly sourceScope: string; readonly targetScope: string; readonly trigger: "keyboard" | "pointer" | "programmatic" }>;
|
|
4
4
|
"reorder-rejected": CustomEvent<{ readonly sourceId: string; readonly targetId: string; readonly position: "before" | "inside" | "after"; readonly reason: "max-depth"; readonly maxDepth: number; readonly resultingDepth: number; readonly trigger: "keyboard" | "pointer" | "programmatic" }>;
|
|
5
|
+
select: CustomEvent<{ readonly ids: readonly (string)[]; readonly trigger: "keyboard" | "pointer" | "programmatic" }>;
|
|
5
6
|
}
|
|
6
7
|
export interface UiTreeElement extends HTMLDivElement {
|
|
7
8
|
addEventListener<K extends keyof UiTreeEventMap>(type: K, listener: (this: UiTreeElement, event: UiTreeEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -13,6 +14,7 @@ export interface UiTreeProps {
|
|
|
13
14
|
label?: string | null;
|
|
14
15
|
marquee?: boolean | null;
|
|
15
16
|
maxDepth?: number | null;
|
|
17
|
+
selection?: "none" | "single" | "multiple" | null;
|
|
16
18
|
attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
|
|
17
19
|
children?: readonly (string | Node)[];
|
|
18
20
|
slots?: Readonly<Record<string, readonly (string | Node)[]>>;
|
package/vanilla/UiTree.js
CHANGED
|
@@ -3,7 +3,7 @@ import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
|
3
3
|
import * as controller from "../components/ui-tree/ui-tree.js";
|
|
4
4
|
import "../styles/ui-tree.css";
|
|
5
5
|
|
|
6
|
-
const definition = {...{"contract":{"tag":"ui-tree","props":{"density":{"type":{"enum":["comfortable","compact"]},"required":false,"target":{"attribute":"density"},"default":"comfortable"},"hoverExpandDelay":{"type":"number","required":false,"target":{"attribute":"hoverexpanddelay"},"default":700},"label":{"type":"string","required":false,"target":{"attribute":"label"},"default":"Tree"},"marquee":{"type":"boolean","required":false,"target":{"attribute":"marquee"},"default":false},"maxDepth":{"type":"number","required":false,"target":{"attribute":"maxdepth"},"default":0}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"role","value":"tree"}],"children":[{"kind":"slot"}]},"declarations":[{"kind":"event","name":"reorder","type":"object({ sourceId: string, targetId: string, position: before | inside | after, sourceType: string, targetType: string, sourceScope: string, targetScope: string, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false},{"kind":"event","name":"reorder-rejected","type":"object({ sourceId: string, targetId: string, position: before | inside | after, reason: max-depth, maxDepth: integer, resultingDepth: integer, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
|
|
6
|
+
const definition = {...{"contract":{"tag":"ui-tree","props":{"density":{"type":{"enum":["comfortable","compact"]},"required":false,"target":{"attribute":"density"},"default":"comfortable"},"hoverExpandDelay":{"type":"number","required":false,"target":{"attribute":"hoverexpanddelay"},"default":700},"label":{"type":"string","required":false,"target":{"attribute":"label"},"default":"Tree"},"marquee":{"type":"boolean","required":false,"target":{"attribute":"marquee"},"default":false},"maxDepth":{"type":"number","required":false,"target":{"attribute":"maxdepth"},"default":0},"selection":{"type":{"enum":["none","single","multiple"]},"required":false,"target":{"attribute":"selection"},"default":"none"}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"role","value":"tree"}],"children":[{"kind":"slot"}]},"declarations":[{"kind":"event","name":"reorder","type":"object({ sourceId: string, targetId: string, position: before | inside | after, sourceType: string, targetType: string, sourceScope: string, targetScope: string, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false},{"kind":"event","name":"reorder-rejected","type":"object({ sourceId: string, targetId: string, position: before | inside | after, reason: max-depth, maxDepth: integer, resultingDepth: integer, trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false},{"kind":"event","name":"select","type":"object({ ids: list(string), trigger: keyboard | pointer | programmatic })","bubbles":true,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
|
|
7
7
|
|
|
8
8
|
export function createUiTree(options = {}) {
|
|
9
9
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
package/vanilla/UiTreeItem.d.ts
CHANGED
package/vanilla/UiTreeItem.js
CHANGED
|
@@ -3,7 +3,7 @@ import { manageComponentLifecycle } from "@nextwebwg/html-next/runtime";
|
|
|
3
3
|
import * as controller from "../components/ui-tree-item/ui-tree-item.js";
|
|
4
4
|
import "../styles/ui-tree-item.css";
|
|
5
5
|
|
|
6
|
-
const definition = {...{"contract":{"tag":"ui-tree-item","props":{"accepts":{"type":"string","required":false,"target":{"attribute":"data-accepts"},"default":""},"container":{"type":"boolean","required":false,"target":{"attribute":"container"},"default":false},"disabled":{"type":"boolean","required":false,"target":{"attribute":"aria-disabled"},"default":false},"dragType":{"type":"string","required":false,"target":{"attribute":"data-drag-type"},"default":"item"},"dropDepth":{"type":"number","required":false,"target":{"attribute":"data-drop-depth"}},"dropScope":{"type":"string","required":false,"target":{"attribute":"data-drop-scope"},"default":""},"expanded":{"type":"boolean","required":false,"target":{"attribute":"expanded"},"default":false},"itemId":{"type":"string","required":false,"target":{"attribute":"data-item-id"},"default":""},"label":{"type":"string","required":false,"target":{"attribute":"aria-label"},"default":""},"marquee":{"type":"boolean","required":false,"target":{"attribute":"marquee"},"default":false},"selected":{"type":"boolean","required":false,"target":{"attribute":"aria-selected"},"default":false},"sortable":{"type":"boolean","required":false,"target":{"attribute":"sortable"},"default":false},"subtreeDepth":{"type":"number","required":false,"target":{"attribute":"data-subtree-depth"}}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"role","value":"treeitem"},{"kind":"attribute","name":"aria-label","expression":"label","expressionPlan":{"source":"label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}},{"kind":"attribute","name":"aria-level","expression":"structuralLevel","expressionPlan":{"source":"structuralLevel","ast":{"kind":"id","name":"structuralLevel"},"dependencies":["structuralLevel"]}},{"kind":"attribute","name":"aria-selected","expression":"selected","expressionPlan":{"source":"selected","ast":{"kind":"id","name":"selected"},"dependencies":["selected"]}},{"kind":"attribute","name":"aria-disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"data-item-id","expression":"itemId","expressionPlan":{"source":"itemId","ast":{"kind":"id","name":"itemId"},"dependencies":["itemId"]}},{"kind":"attribute","name":"data-drag-type","expression":"dragType","expressionPlan":{"source":"dragType","ast":{"kind":"id","name":"dragType"},"dependencies":["dragType"]}},{"kind":"attribute","name":"data-drop-scope","expression":"dropScope","expressionPlan":{"source":"dropScope","ast":{"kind":"id","name":"dropScope"},"dependencies":["dropScope"]}},{"kind":"attribute","name":"data-accepts","expression":"accepts","expressionPlan":{"source":"accepts","ast":{"kind":"id","name":"accepts"},"dependencies":["accepts"]}},{"kind":"attribute","name":"data-drop-depth","expression":"dropDepth","expressionPlan":{"source":"dropDepth","ast":{"kind":"id","name":"dropDepth"},"dependencies":["dropDepth"]}},{"kind":"attribute","name":"data-subtree-depth","expression":"subtreeDepth","expressionPlan":{"source":"subtreeDepth","ast":{"kind":"id","name":"subtreeDepth"},"dependencies":["subtreeDepth"]}}],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"row"}],"children":[{"kind":"element","name":"button","attributes":[{"kind":"literal","name":"class","value":"drag-handle"},{"kind":"literal","name":"type","value":"button"},{"kind":"literal","name":"draggable","value":"true"},{"kind":"attribute","name":"aria-label","expression":"format('Drag %s to reorder', label)","expressionPlan":{"source":"format('Drag %s to reorder', label)","ast":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"Drag %s to reorder"},{"kind":"id","name":"label"}]},"dependencies":["label"]}}],"children":[{"kind":"element","name":"svg","attributes":[{"kind":"literal","name":"aria-hidden","value":"true"},{"kind":"literal","name":"focusable","value":"false"},{"kind":"literal","name":"viewBox","value":"0 0 24 24"},{"kind":"literal","name":"fill","value":"none"},{"kind":"literal","name":"stroke","value":"currentColor"},{"kind":"literal","name":"stroke-width","value":"2"},{"kind":"literal","name":"stroke-linecap","value":"round"},{"kind":"literal","name":"stroke-linejoin","value":"round"}],"children":[{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"9"},{"kind":"literal","name":"cy","value":"12"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"9"},{"kind":"literal","name":"cy","value":"5"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"9"},{"kind":"literal","name":"cy","value":"19"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"15"},{"kind":"literal","name":"cy","value":"12"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"15"},{"kind":"literal","name":"cy","value":"5"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"15"},{"kind":"literal","name":"cy","value":"19"},{"kind":"literal","name":"r","value":"1"}],"children":[]}]}],"flow":{"kind":"if","test":"sortable and not disabled","testPlan":{"source":"sortable and not disabled","ast":{"kind":"binary","op":"and","left":{"kind":"id","name":"sortable"},"right":{"kind":"unary","op":"not","operand":{"kind":"id","name":"disabled"}}},"dependencies":["disabled","sortable"]}},"ref":"dragHandle"},{"kind":"element","name":"button","attributes":[{"kind":"literal","name":"class","value":"disclosure"},{"kind":"literal","name":"type","value":"button"},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"hidden","expression":"not isContainer","expressionPlan":{"source":"not isContainer","ast":{"kind":"unary","op":"not","operand":{"kind":"id","name":"isContainer"}},"dependencies":["isContainer"]}}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"disclosure-icon"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}],"ref":"disclosure"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"leading"}],"children":[{"kind":"slot","fallback":[],"name":"leading"}],"ref":"leading"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"label"}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"label-text"}],"children":[{"kind":"slot","fallback":[{"kind":"element","name":"template","attributes":[{"kind":"directive","name":"value","expression":"label","expressionPlan":{"source":"label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}}],"children":[]}],"name":"label"}],"ref":"labelText"}],"ref":"label"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"actions"}],"children":[{"kind":"slot","fallback":[],"name":"actions"}],"ref":"actions"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"drop-indicator row-drop-indicator"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}],"ref":"row"},{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"children"},{"kind":"literal","name":"role","value":"group"},{"kind":"attribute","name":"hidden","expression":"not (isContainer and internalExpanded)","expressionPlan":{"source":"not (isContainer and internalExpanded)","ast":{"kind":"unary","op":"not","operand":{"kind":"binary","op":"and","left":{"kind":"id","name":"isContainer"},"right":{"kind":"id","name":"internalExpanded"}}},"dependencies":["internalExpanded","isContainer"]}}],"children":[{"kind":"slot"}],"ref":"children"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"drop-indicator subtree-drop-indicator"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}]},"declarations":[{"kind":"state","name":"internalExpanded","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"state","name":"structuralLevel","expression":{"source":"1","ast":{"kind":"literal","value":1},"dependencies":[]}},{"kind":"state","name":"tabStop","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"state","name":"isContainer","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"event","name":"expand","type":"object({ id: string, expanded: boolean, trigger: keyboard | pointer | programmatic })","bubbles":false,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
|
|
6
|
+
const definition = {...{"contract":{"tag":"ui-tree-item","props":{"accepts":{"type":"string","required":false,"target":{"attribute":"data-accepts"},"default":""},"container":{"type":"boolean","required":false,"target":{"attribute":"container"},"default":false},"disabled":{"type":"boolean","required":false,"target":{"attribute":"aria-disabled"},"default":false},"dragType":{"type":"string","required":false,"target":{"attribute":"data-drag-type"},"default":"item"},"dropDepth":{"type":"number","required":false,"target":{"attribute":"data-drop-depth"}},"dropScope":{"type":"string","required":false,"target":{"attribute":"data-drop-scope"},"default":""},"expanded":{"type":"boolean","required":false,"target":{"attribute":"expanded"},"default":false},"itemId":{"type":"string","required":false,"target":{"attribute":"data-item-id"},"default":""},"label":{"type":"string","required":false,"target":{"attribute":"aria-label"},"default":""},"lazy":{"type":"boolean","required":false,"target":{"attribute":"lazy"},"default":false},"marquee":{"type":"boolean","required":false,"target":{"attribute":"marquee"},"default":false},"selected":{"type":"boolean","required":false,"target":{"attribute":"aria-selected"},"default":false},"sortable":{"type":"boolean","required":false,"target":{"attribute":"sortable"},"default":false},"subtreeDepth":{"type":"number","required":false,"target":{"attribute":"data-subtree-depth"}}}},"template":{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"role","value":"treeitem"},{"kind":"attribute","name":"aria-label","expression":"label","expressionPlan":{"source":"label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}},{"kind":"attribute","name":"aria-level","expression":"structuralLevel","expressionPlan":{"source":"structuralLevel","ast":{"kind":"id","name":"structuralLevel"},"dependencies":["structuralLevel"]}},{"kind":"attribute","name":"aria-selected","expression":"selected","expressionPlan":{"source":"selected","ast":{"kind":"id","name":"selected"},"dependencies":["selected"]}},{"kind":"attribute","name":"aria-disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"data-item-id","expression":"itemId","expressionPlan":{"source":"itemId","ast":{"kind":"id","name":"itemId"},"dependencies":["itemId"]}},{"kind":"attribute","name":"data-drag-type","expression":"dragType","expressionPlan":{"source":"dragType","ast":{"kind":"id","name":"dragType"},"dependencies":["dragType"]}},{"kind":"attribute","name":"data-drop-scope","expression":"dropScope","expressionPlan":{"source":"dropScope","ast":{"kind":"id","name":"dropScope"},"dependencies":["dropScope"]}},{"kind":"attribute","name":"data-accepts","expression":"accepts","expressionPlan":{"source":"accepts","ast":{"kind":"id","name":"accepts"},"dependencies":["accepts"]}},{"kind":"attribute","name":"data-drop-depth","expression":"dropDepth","expressionPlan":{"source":"dropDepth","ast":{"kind":"id","name":"dropDepth"},"dependencies":["dropDepth"]}},{"kind":"attribute","name":"data-subtree-depth","expression":"subtreeDepth","expressionPlan":{"source":"subtreeDepth","ast":{"kind":"id","name":"subtreeDepth"},"dependencies":["subtreeDepth"]}}],"children":[{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"row"}],"children":[{"kind":"element","name":"button","attributes":[{"kind":"literal","name":"class","value":"drag-handle"},{"kind":"literal","name":"type","value":"button"},{"kind":"literal","name":"draggable","value":"true"},{"kind":"attribute","name":"aria-label","expression":"format('Drag %s to reorder', label)","expressionPlan":{"source":"format('Drag %s to reorder', label)","ast":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"Drag %s to reorder"},{"kind":"id","name":"label"}]},"dependencies":["label"]}}],"children":[{"kind":"element","name":"svg","attributes":[{"kind":"literal","name":"aria-hidden","value":"true"},{"kind":"literal","name":"focusable","value":"false"},{"kind":"literal","name":"viewBox","value":"0 0 24 24"},{"kind":"literal","name":"fill","value":"none"},{"kind":"literal","name":"stroke","value":"currentColor"},{"kind":"literal","name":"stroke-width","value":"2"},{"kind":"literal","name":"stroke-linecap","value":"round"},{"kind":"literal","name":"stroke-linejoin","value":"round"}],"children":[{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"9"},{"kind":"literal","name":"cy","value":"12"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"9"},{"kind":"literal","name":"cy","value":"5"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"9"},{"kind":"literal","name":"cy","value":"19"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"15"},{"kind":"literal","name":"cy","value":"12"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"15"},{"kind":"literal","name":"cy","value":"5"},{"kind":"literal","name":"r","value":"1"}],"children":[]},{"kind":"element","name":"circle","attributes":[{"kind":"literal","name":"cx","value":"15"},{"kind":"literal","name":"cy","value":"19"},{"kind":"literal","name":"r","value":"1"}],"children":[]}]}],"flow":{"kind":"if","test":"sortable and not disabled","testPlan":{"source":"sortable and not disabled","ast":{"kind":"binary","op":"and","left":{"kind":"id","name":"sortable"},"right":{"kind":"unary","op":"not","operand":{"kind":"id","name":"disabled"}}},"dependencies":["disabled","sortable"]}},"ref":"dragHandle"},{"kind":"element","name":"button","attributes":[{"kind":"literal","name":"class","value":"disclosure"},{"kind":"literal","name":"type","value":"button"},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"hidden","expression":"not isContainer","expressionPlan":{"source":"not isContainer","ast":{"kind":"unary","op":"not","operand":{"kind":"id","name":"isContainer"}},"dependencies":["isContainer"]}}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"disclosure-icon"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}],"ref":"disclosure"},{"kind":"element","name":"label","attributes":[{"kind":"literal","name":"class","value":"selection-hit"}],"children":[{"kind":"element","name":"input","attributes":[{"kind":"literal","name":"class","value":"selection-checkbox"},{"kind":"literal","name":"type","value":"checkbox"},{"kind":"literal","name":"tabindex","value":"-1"},{"kind":"attribute","name":"checked","expression":"selected","expressionPlan":{"source":"selected","ast":{"kind":"id","name":"selected"},"dependencies":["selected"]}},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"aria-label","expression":"format('Select %s', label)","expressionPlan":{"source":"format('Select %s', label)","ast":{"kind":"call","fn":"format","args":[{"kind":"literal","value":"Select %s"},{"kind":"id","name":"label"}]},"dependencies":["label"]}}],"children":[]}]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"leading"}],"children":[{"kind":"slot","fallback":[],"name":"leading"}],"ref":"leading"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"label"}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"label-text"}],"children":[{"kind":"slot","fallback":[{"kind":"element","name":"template","attributes":[{"kind":"directive","name":"value","expression":"label","expressionPlan":{"source":"label","ast":{"kind":"id","name":"label"},"dependencies":["label"]}}],"children":[]}],"name":"label"}],"ref":"labelText"}],"ref":"label"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"actions"}],"children":[{"kind":"slot","fallback":[],"name":"actions"}],"ref":"actions"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"drop-indicator row-drop-indicator"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}],"ref":"row"},{"kind":"element","name":"div","attributes":[{"kind":"literal","name":"class","value":"children"},{"kind":"literal","name":"role","value":"group"},{"kind":"attribute","name":"hidden","expression":"not (isContainer and internalExpanded)","expressionPlan":{"source":"not (isContainer and internalExpanded)","ast":{"kind":"unary","op":"not","operand":{"kind":"binary","op":"and","left":{"kind":"id","name":"isContainer"},"right":{"kind":"id","name":"internalExpanded"}}},"dependencies":["internalExpanded","isContainer"]}}],"children":[{"kind":"slot"}],"ref":"children"},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"drop-indicator subtree-drop-indicator"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}]},"declarations":[{"kind":"state","name":"internalExpanded","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"state","name":"structuralLevel","expression":{"source":"1","ast":{"kind":"literal","value":1},"dependencies":[]}},{"kind":"state","name":"tabStop","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"state","name":"isContainer","expression":{"source":"false","ast":{"kind":"literal","value":false},"dependencies":[]}},{"kind":"event","name":"expand","type":"object({ id: string, expanded: boolean, trigger: keyboard | pointer | programmatic })","bubbles":false,"composed":true,"cancelable":false}],"root":{"kind":"native","element":"div","choices":["div"]}},source:{file:import.meta.url},css:""};
|
|
7
7
|
|
|
8
8
|
export function createUiTreeItem(options = {}) {
|
|
9
9
|
const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
|
|
@@ -100,65 +100,79 @@ export function createUiTreeItem(options = {}) {
|
|
|
100
100
|
element10.setAttribute("aria-hidden", "true");
|
|
101
101
|
element9.append(element10);
|
|
102
102
|
element0.append(element9);
|
|
103
|
-
const element11 = document.createElement("
|
|
104
|
-
element11.setAttribute("class", "
|
|
103
|
+
const element11 = document.createElement("label");
|
|
104
|
+
element11.setAttribute("class", "selection-hit");
|
|
105
|
+
const element12 = document.createElement("input");
|
|
106
|
+
element12.setAttribute("class", "selection-checkbox");
|
|
107
|
+
element12.setAttribute("type", "checkbox");
|
|
108
|
+
element12.setAttribute("tabindex", "-1");
|
|
109
|
+
const value10 = componentProps["selected"] === undefined ? false : componentProps["selected"];
|
|
110
|
+
if (value10 === true) element12.setAttribute("checked", "");
|
|
111
|
+
else element12.removeAttribute("checked");
|
|
112
|
+
const value11 = componentProps["disabled"] === undefined ? false : componentProps["disabled"];
|
|
113
|
+
if (value11 === true) element12.setAttribute("disabled", "");
|
|
114
|
+
else element12.removeAttribute("disabled");
|
|
115
|
+
element11.append(element12);
|
|
116
|
+
element0.append(element11);
|
|
117
|
+
const element13 = document.createElement("span");
|
|
118
|
+
element13.setAttribute("class", "leading");
|
|
105
119
|
if (slots["leading"] ?? [].length > 0) {
|
|
106
120
|
for (const child of slots["leading"] ?? []) {
|
|
107
121
|
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
108
122
|
projected.push([node, "leading"]);
|
|
109
|
-
|
|
123
|
+
element13.append(node);
|
|
110
124
|
}
|
|
111
125
|
} else {
|
|
112
126
|
}
|
|
113
|
-
element0.append(
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
|
|
127
|
+
element0.append(element13);
|
|
128
|
+
const element14 = document.createElement("span");
|
|
129
|
+
element14.setAttribute("class", "label");
|
|
130
|
+
const element15 = document.createElement("span");
|
|
131
|
+
element15.setAttribute("class", "label-text");
|
|
118
132
|
if (slots["label"] ?? [].length > 0) {
|
|
119
133
|
for (const child of slots["label"] ?? []) {
|
|
120
134
|
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
121
135
|
projected.push([node, "label"]);
|
|
122
|
-
|
|
136
|
+
element15.append(node);
|
|
123
137
|
}
|
|
124
138
|
} else {
|
|
125
|
-
const
|
|
126
|
-
|
|
139
|
+
const element16 = document.createElement("template");
|
|
140
|
+
element15.append(element16);
|
|
127
141
|
}
|
|
128
|
-
|
|
129
|
-
element0.append(
|
|
130
|
-
const
|
|
131
|
-
|
|
142
|
+
element14.append(element15);
|
|
143
|
+
element0.append(element14);
|
|
144
|
+
const element17 = document.createElement("span");
|
|
145
|
+
element17.setAttribute("class", "actions");
|
|
132
146
|
if (slots["actions"] ?? [].length > 0) {
|
|
133
147
|
for (const child of slots["actions"] ?? []) {
|
|
134
148
|
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
135
149
|
projected.push([node, "actions"]);
|
|
136
|
-
|
|
150
|
+
element17.append(node);
|
|
137
151
|
}
|
|
138
152
|
} else {
|
|
139
153
|
}
|
|
140
|
-
element0.append(
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
element0.append(
|
|
154
|
+
element0.append(element17);
|
|
155
|
+
const element18 = document.createElement("span");
|
|
156
|
+
element18.setAttribute("class", "drop-indicator row-drop-indicator");
|
|
157
|
+
element18.setAttribute("aria-hidden", "true");
|
|
158
|
+
element0.append(element18);
|
|
145
159
|
element.append(element0);
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
160
|
+
const element19 = document.createElement("div");
|
|
161
|
+
element19.setAttribute("class", "children");
|
|
162
|
+
element19.setAttribute("role", "group");
|
|
149
163
|
if (children.length > 0) {
|
|
150
164
|
for (const child of children) {
|
|
151
165
|
const node = typeof child === "string" ? document.createTextNode(child) : child;
|
|
152
166
|
projected.push([node, ""]);
|
|
153
|
-
|
|
167
|
+
element19.append(node);
|
|
154
168
|
}
|
|
155
169
|
} else {
|
|
156
170
|
}
|
|
157
|
-
element.append(
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
element.append(
|
|
171
|
+
element.append(element19);
|
|
172
|
+
const element20 = document.createElement("span");
|
|
173
|
+
element20.setAttribute("class", "drop-indicator subtree-drop-indicator");
|
|
174
|
+
element20.setAttribute("aria-hidden", "true");
|
|
175
|
+
element.append(element20);
|
|
162
176
|
manageComponentLifecycle(element, definition, { props: componentProps, projected,
|
|
163
177
|
controller,
|
|
164
178
|
});
|
package/vanilla/index.js
CHANGED
|
@@ -21,7 +21,10 @@ export * from "./UiDisclosure.js";
|
|
|
21
21
|
export * from "./UiEditable.js";
|
|
22
22
|
export * from "./UiEditorInsertTableGrid.js";
|
|
23
23
|
export * from "./UiEditorMentionMenu.js";
|
|
24
|
+
export * from "./UiEditorMentionMenuItem.js";
|
|
24
25
|
export * from "./UiEditorSlashMenu.js";
|
|
26
|
+
export * from "./UiEditorSlashMenuGroup.js";
|
|
27
|
+
export * from "./UiEditorSlashMenuItem.js";
|
|
25
28
|
export * from "./UiEditorTableContextMenu.js";
|
|
26
29
|
export * from "./UiEditorTableOverlay.js";
|
|
27
30
|
export * from "./UiEditorTableToolbar.js";
|
|
@@ -34,8 +37,10 @@ export * from "./UiIconButton.js";
|
|
|
34
37
|
export * from "./UiInput.js";
|
|
35
38
|
export * from "./UiInputGroup.js";
|
|
36
39
|
export * from "./UiList.js";
|
|
40
|
+
export * from "./UiListbox.js";
|
|
37
41
|
export * from "./UiListItem.js";
|
|
38
42
|
export * from "./UiMenu.js";
|
|
43
|
+
export * from "./UiMenuGroup.js";
|
|
39
44
|
export * from "./UiMenuItem.js";
|
|
40
45
|
export * from "./UiMeter.js";
|
|
41
46
|
export * from "./UiNavItem.js";
|
|
@@ -60,6 +65,7 @@ export * from "./UiTable.js";
|
|
|
60
65
|
export * from "./UiTabs.js";
|
|
61
66
|
export * from "./UiText.js";
|
|
62
67
|
export * from "./UiTextarea.js";
|
|
68
|
+
export * from "./UiToast.js";
|
|
63
69
|
export * from "./UiToastRegion.js";
|
|
64
70
|
export * from "./UiTooltip.js";
|
|
65
71
|
export * from "./UiTopBar.js";
|
package/vue/UiAvatar.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
active?: boolean;
|
|
3
3
|
alt?: string;
|
|
4
|
+
decorative?: boolean;
|
|
4
5
|
fallback?: string;
|
|
5
6
|
name?: string;
|
|
7
|
+
shape?: 'circle' | 'square';
|
|
6
8
|
size?: 'sm' | 'md';
|
|
7
9
|
src?: string;
|
|
8
10
|
};
|
|
@@ -12,8 +14,10 @@ type __VLS_Slots = {} & {
|
|
|
12
14
|
};
|
|
13
15
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
14
16
|
name: string;
|
|
17
|
+
shape: "circle" | "square";
|
|
15
18
|
active: boolean;
|
|
16
19
|
alt: string;
|
|
20
|
+
decorative: boolean;
|
|
17
21
|
fallback: string;
|
|
18
22
|
size: "sm" | "md";
|
|
19
23
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
package/vue/UiAvatar.vue
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { computed, ref, useTemplateRef } from 'vue'
|
|
4
4
|
import * as controllerModule from '../components/ui-avatar/ui-avatar.js'
|
|
5
5
|
import { createDispatch, useComponentHost } from './host'
|
|
6
|
+
import UiIcon from './UiIcon.vue'
|
|
6
7
|
|
|
7
8
|
defineOptions({ inheritAttrs: false })
|
|
8
9
|
|
|
@@ -10,16 +11,20 @@ const props = withDefaults(
|
|
|
10
11
|
defineProps<{
|
|
11
12
|
active?: boolean
|
|
12
13
|
alt?: string
|
|
14
|
+
decorative?: boolean
|
|
13
15
|
fallback?: string
|
|
14
16
|
name?: string
|
|
17
|
+
shape?: 'circle' | 'square'
|
|
15
18
|
size?: 'sm' | 'md'
|
|
16
19
|
src?: string
|
|
17
20
|
}>(),
|
|
18
21
|
{
|
|
19
22
|
active: false,
|
|
20
23
|
alt: '',
|
|
24
|
+
decorative: false,
|
|
21
25
|
fallback: '',
|
|
22
26
|
name: '',
|
|
27
|
+
shape: 'circle',
|
|
23
28
|
size: 'md',
|
|
24
29
|
},
|
|
25
30
|
)
|
|
@@ -29,11 +34,13 @@ const imageElement = useTemplateRef<HTMLElement>('image')
|
|
|
29
34
|
const hasImage = ref(false)
|
|
30
35
|
const hasAuthoredImage = ref(false)
|
|
31
36
|
const initials = ref('?')
|
|
37
|
+
const showGlyph = ref(false)
|
|
32
38
|
|
|
33
39
|
/** The values the styles' :host-state() rules test. */
|
|
34
40
|
const hostState = computed(() =>
|
|
35
41
|
[
|
|
36
42
|
props.size && `size size=${props.size}`,
|
|
43
|
+
props.shape && `shape shape=${props.shape}`,
|
|
37
44
|
props.active && 'active',
|
|
38
45
|
].filter(Boolean).join(' ')
|
|
39
46
|
)
|
|
@@ -45,7 +52,7 @@ useComponentHost(controllerModule.default, {
|
|
|
45
52
|
dispatch,
|
|
46
53
|
props,
|
|
47
54
|
refs: { image: imageElement },
|
|
48
|
-
state: { hasImage, hasAuthoredImage, initials },
|
|
55
|
+
state: { hasImage, hasAuthoredImage, initials, showGlyph },
|
|
49
56
|
})
|
|
50
57
|
</script>
|
|
51
58
|
|
|
@@ -64,7 +71,10 @@ useComponentHost(controllerModule.default, {
|
|
|
64
71
|
:hidden="hasAuthoredImage || !hasImage"
|
|
65
72
|
ref="image"
|
|
66
73
|
>
|
|
67
|
-
<span class="fallback" :aria-hidden="hasImage" :hidden="hasImage">{{
|
|
74
|
+
<span class="fallback" :aria-hidden="hasImage" :hidden="hasImage"><span :hidden="showGlyph">{{
|
|
75
|
+
initials
|
|
76
|
+
}}</span>
|
|
77
|
+
<span :hidden="!showGlyph"><UiIcon name="user-round" /></span></span></span>
|
|
68
78
|
</template>
|
|
69
79
|
|
|
70
80
|
<style scoped>
|
|
@@ -73,6 +83,10 @@ useComponentHost(controllerModule.default, {
|
|
|
73
83
|
syntax: "*";
|
|
74
84
|
inherits: false;
|
|
75
85
|
}
|
|
86
|
+
@property --ui-avatar-radius {
|
|
87
|
+
syntax: "*";
|
|
88
|
+
inherits: false;
|
|
89
|
+
}
|
|
76
90
|
@property --ui-avatar-surface {
|
|
77
91
|
syntax: "*";
|
|
78
92
|
inherits: false;
|
|
@@ -87,12 +101,13 @@ useComponentHost(controllerModule.default, {
|
|
|
87
101
|
}
|
|
88
102
|
|
|
89
103
|
[data-component~="ui-avatar"] {
|
|
104
|
+
--_ui-default-icon-size: 1.25rem;
|
|
90
105
|
display: inline-grid;
|
|
91
106
|
place-items: center;
|
|
92
107
|
overflow: hidden;
|
|
93
108
|
inline-size: 2.5rem;
|
|
94
109
|
block-size: 2.5rem;
|
|
95
|
-
border-radius:
|
|
110
|
+
border-radius: var(--ui-avatar-radius, var(--ui-radius-round));
|
|
96
111
|
border: 1px solid var(--ui-avatar-border, var(--ui-border-strong));
|
|
97
112
|
background: var(--ui-avatar-surface, var(--ui-accent-soft));
|
|
98
113
|
color: var(--ui-avatar-text, var(--ui-accent-subtle-text, var(--ui-accent-solid)));
|
|
@@ -103,11 +118,16 @@ useComponentHost(controllerModule.default, {
|
|
|
103
118
|
}
|
|
104
119
|
|
|
105
120
|
[data-component~="ui-avatar"][data-ui-avatar-state~="size=sm"] {
|
|
121
|
+
--_ui-default-icon-size: 1rem;
|
|
106
122
|
inline-size: 1.75rem;
|
|
107
123
|
block-size: 1.75rem;
|
|
108
124
|
font-size: var(--ui-font-size-xs);
|
|
109
125
|
}
|
|
110
126
|
|
|
127
|
+
[data-component~="ui-avatar"][data-ui-avatar-state~="shape=square"] {
|
|
128
|
+
border-radius: var(--ui-avatar-radius, var(--ui-radius-md));
|
|
129
|
+
}
|
|
130
|
+
|
|
111
131
|
/* An outline, not a dot: the avatar clips its content to the circle, and an outline is drawn
|
|
112
132
|
outside the box, so the ring survives the clip and the overlap in an Avatar Group. */
|
|
113
133
|
[data-component~="ui-avatar"][data-ui-avatar-state~="active"] {
|
package/vue/UiAvatarGroup.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
label?: string;
|
|
3
3
|
max?: number;
|
|
4
|
+
overflowLabel?: string;
|
|
4
5
|
size?: 'sm' | 'md';
|
|
6
|
+
total?: number;
|
|
5
7
|
};
|
|
6
8
|
declare var __VLS_1: {};
|
|
7
9
|
type __VLS_Slots = {} & {
|
|
@@ -11,6 +13,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
11
13
|
label: string;
|
|
12
14
|
size: "sm" | "md";
|
|
13
15
|
max: number;
|
|
16
|
+
overflowLabel: string;
|
|
14
17
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
18
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
16
19
|
declare const _default: typeof __VLS_export;
|