@threadlabs/looma 0.21.4 → 0.21.6
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/ui-avatar-group/ui-avatar-group.html +12 -2
- package/components/ui-avatar-group/ui-avatar-group.js +1 -1
- package/components/ui-button/ui-button.html +26 -8
- package/components/ui-menu/ui-menu.html +18 -0
- package/components/ui-menu-item/ui-menu-item.html +8 -17
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/styles/ui-action-bar.css +1 -1
- package/styles/ui-affordance-scope.css +1 -1
- package/styles/ui-avatar-group.css +10 -1
- package/styles/ui-avatar.css +1 -1
- package/styles/ui-badge.css +1 -1
- package/styles/ui-breadcrumb-item.css +1 -1
- package/styles/ui-breadcrumbs.css +1 -1
- package/styles/ui-button.css +26 -7
- package/styles/ui-callout.css +1 -1
- package/styles/ui-card.css +1 -1
- package/styles/ui-checkbox.css +1 -1
- package/styles/ui-cluster.css +1 -1
- package/styles/ui-combobox.css +1 -1
- package/styles/ui-container.css +1 -1
- package/styles/ui-context-menu.css +1 -1
- package/styles/ui-cover.css +1 -1
- package/styles/ui-description-item.css +1 -1
- package/styles/ui-description-list.css +1 -1
- package/styles/ui-dialog.css +1 -1
- package/styles/ui-disclosure.css +1 -1
- package/styles/ui-editable.css +1 -1
- package/styles/ui-editor-insert-table-grid.css +1 -1
- package/styles/ui-editor-mention-menu-item.css +1 -1
- package/styles/ui-editor-mention-menu.css +1 -1
- package/styles/ui-editor-slash-menu-group.css +1 -1
- package/styles/ui-editor-slash-menu-item.css +1 -1
- package/styles/ui-editor-slash-menu.css +1 -1
- package/styles/ui-editor-table-context-menu.css +1 -1
- package/styles/ui-editor-table-overlay.css +1 -1
- package/styles/ui-editor-table-toolbar.css +1 -1
- package/styles/ui-editor-toolbar.css +1 -1
- package/styles/ui-floating-action-button.css +1 -1
- package/styles/ui-form-field.css +1 -1
- package/styles/ui-grid.css +1 -1
- package/styles/ui-icon-button.css +1 -1
- package/styles/ui-icon.css +1 -1
- package/styles/ui-input-group.css +1 -1
- package/styles/ui-input.css +1 -1
- package/styles/ui-list-item.css +1 -1
- package/styles/ui-list.css +1 -1
- package/styles/ui-listbox.css +1 -1
- package/styles/ui-menu-group.css +1 -1
- package/styles/ui-menu-item.css +11 -17
- package/styles/ui-menu.css +18 -1
- package/styles/ui-meter.css +1 -1
- package/styles/ui-nav-item.css +1 -1
- package/styles/ui-page-header.css +1 -1
- package/styles/ui-popover.css +1 -1
- package/styles/ui-radio-group.css +1 -1
- package/styles/ui-radio.css +1 -1
- package/styles/ui-reel.css +1 -1
- package/styles/ui-scroll-area.css +1 -1
- package/styles/ui-search-result-row.css +1 -1
- package/styles/ui-search-shell.css +1 -1
- package/styles/ui-section.css +1 -1
- package/styles/ui-select.css +1 -1
- package/styles/ui-separator.css +1 -1
- package/styles/ui-sidebar.css +1 -1
- package/styles/ui-spinner.css +1 -1
- package/styles/ui-stack.css +1 -1
- package/styles/ui-status-message.css +1 -1
- package/styles/ui-switch.css +1 -1
- package/styles/ui-switcher.css +1 -1
- package/styles/ui-table.css +1 -1
- package/styles/ui-tabs.css +1 -1
- package/styles/ui-text.css +1 -1
- package/styles/ui-textarea.css +1 -1
- package/styles/ui-toast-region.css +1 -1
- package/styles/ui-toast.css +1 -1
- package/styles/ui-tooltip.css +1 -1
- package/styles/ui-top-bar.css +1 -1
- package/styles/ui-tree-item.css +1 -1
- package/styles/ui-tree.css +1 -1
- package/vanilla/UiActionBar.d.ts +1 -1
- package/vanilla/UiActionBar.js +1 -1
- package/vanilla/UiAffordanceScope.d.ts +1 -1
- package/vanilla/UiAffordanceScope.js +1 -1
- package/vanilla/UiAvatar.d.ts +1 -1
- package/vanilla/UiAvatar.js +1 -1
- package/vanilla/UiAvatarGroup.d.ts +2 -2
- package/vanilla/UiAvatarGroup.js +2 -2
- package/vanilla/UiBadge.d.ts +1 -1
- package/vanilla/UiBadge.js +1 -1
- package/vanilla/UiBreadcrumbItem.d.ts +1 -1
- package/vanilla/UiBreadcrumbItem.js +1 -1
- package/vanilla/UiBreadcrumbs.d.ts +1 -1
- package/vanilla/UiBreadcrumbs.js +1 -1
- package/vanilla/UiButton.d.ts +3 -2
- package/vanilla/UiButton.js +2 -2
- package/vanilla/UiCallout.d.ts +1 -1
- package/vanilla/UiCallout.js +1 -1
- package/vanilla/UiCard.d.ts +1 -1
- package/vanilla/UiCard.js +1 -1
- package/vanilla/UiCheckbox.d.ts +1 -1
- package/vanilla/UiCheckbox.js +1 -1
- package/vanilla/UiCluster.d.ts +1 -1
- package/vanilla/UiCluster.js +1 -1
- package/vanilla/UiCombobox.d.ts +1 -1
- package/vanilla/UiCombobox.js +1 -1
- package/vanilla/UiContainer.d.ts +1 -1
- package/vanilla/UiContainer.js +1 -1
- package/vanilla/UiContextMenu.d.ts +1 -1
- package/vanilla/UiContextMenu.js +1 -1
- package/vanilla/UiCover.d.ts +1 -1
- package/vanilla/UiCover.js +1 -1
- package/vanilla/UiDescriptionItem.d.ts +1 -1
- package/vanilla/UiDescriptionItem.js +1 -1
- package/vanilla/UiDescriptionList.d.ts +1 -1
- package/vanilla/UiDescriptionList.js +1 -1
- package/vanilla/UiDialog.d.ts +1 -1
- package/vanilla/UiDialog.js +1 -1
- package/vanilla/UiDisclosure.d.ts +1 -1
- package/vanilla/UiDisclosure.js +1 -1
- package/vanilla/UiEditable.d.ts +1 -1
- package/vanilla/UiEditable.js +1 -1
- package/vanilla/UiEditorInsertTableGrid.d.ts +1 -1
- package/vanilla/UiEditorInsertTableGrid.js +1 -1
- package/vanilla/UiEditorMentionMenu.d.ts +1 -1
- package/vanilla/UiEditorMentionMenu.js +1 -1
- package/vanilla/UiEditorMentionMenuItem.d.ts +1 -1
- package/vanilla/UiEditorMentionMenuItem.js +1 -1
- package/vanilla/UiEditorSlashMenu.d.ts +1 -1
- package/vanilla/UiEditorSlashMenu.js +1 -1
- package/vanilla/UiEditorSlashMenuGroup.d.ts +1 -1
- package/vanilla/UiEditorSlashMenuGroup.js +1 -1
- package/vanilla/UiEditorSlashMenuItem.d.ts +1 -1
- package/vanilla/UiEditorSlashMenuItem.js +1 -1
- package/vanilla/UiEditorTableContextMenu.d.ts +1 -1
- package/vanilla/UiEditorTableContextMenu.js +1 -1
- package/vanilla/UiEditorTableOverlay.d.ts +1 -1
- package/vanilla/UiEditorTableOverlay.js +1 -1
- package/vanilla/UiEditorTableToolbar.d.ts +1 -1
- package/vanilla/UiEditorTableToolbar.js +1 -1
- package/vanilla/UiEditorToolbar.d.ts +1 -1
- package/vanilla/UiEditorToolbar.js +1 -1
- package/vanilla/UiFloatingActionButton.d.ts +1 -1
- package/vanilla/UiFloatingActionButton.js +1 -1
- package/vanilla/UiFormField.d.ts +1 -1
- package/vanilla/UiFormField.js +1 -1
- package/vanilla/UiGrid.d.ts +1 -1
- package/vanilla/UiGrid.js +1 -1
- package/vanilla/UiIcon.d.ts +1 -1
- package/vanilla/UiIcon.js +1 -1
- package/vanilla/UiIconButton.d.ts +1 -1
- package/vanilla/UiIconButton.js +1 -1
- package/vanilla/UiInput.d.ts +1 -1
- package/vanilla/UiInput.js +1 -1
- package/vanilla/UiInputGroup.d.ts +1 -1
- package/vanilla/UiInputGroup.js +1 -1
- package/vanilla/UiList.d.ts +1 -1
- package/vanilla/UiList.js +1 -1
- package/vanilla/UiListItem.d.ts +1 -1
- package/vanilla/UiListItem.js +1 -1
- package/vanilla/UiListbox.d.ts +1 -1
- package/vanilla/UiListbox.js +1 -1
- package/vanilla/UiMenu.d.ts +2 -1
- package/vanilla/UiMenu.js +2 -2
- package/vanilla/UiMenuGroup.d.ts +1 -1
- package/vanilla/UiMenuGroup.js +1 -1
- package/vanilla/UiMenuItem.d.ts +1 -1
- package/vanilla/UiMenuItem.js +2 -2
- package/vanilla/UiMeter.d.ts +1 -1
- package/vanilla/UiMeter.js +1 -1
- package/vanilla/UiNavItem.d.ts +1 -1
- package/vanilla/UiNavItem.js +1 -1
- package/vanilla/UiPageHeader.d.ts +1 -1
- package/vanilla/UiPageHeader.js +1 -1
- package/vanilla/UiPopover.d.ts +1 -1
- package/vanilla/UiPopover.js +1 -1
- package/vanilla/UiRadio.d.ts +1 -1
- package/vanilla/UiRadio.js +1 -1
- package/vanilla/UiRadioGroup.d.ts +1 -1
- package/vanilla/UiRadioGroup.js +1 -1
- package/vanilla/UiReel.d.ts +1 -1
- package/vanilla/UiReel.js +1 -1
- package/vanilla/UiScrollArea.d.ts +1 -1
- package/vanilla/UiScrollArea.js +1 -1
- package/vanilla/UiSearchResultRow.d.ts +1 -1
- package/vanilla/UiSearchResultRow.js +1 -1
- package/vanilla/UiSearchShell.d.ts +1 -1
- package/vanilla/UiSearchShell.js +1 -1
- package/vanilla/UiSection.d.ts +1 -1
- package/vanilla/UiSection.js +1 -1
- package/vanilla/UiSelect.d.ts +1 -1
- package/vanilla/UiSelect.js +1 -1
- package/vanilla/UiSeparator.d.ts +1 -1
- package/vanilla/UiSeparator.js +1 -1
- package/vanilla/UiSidebar.d.ts +1 -1
- package/vanilla/UiSidebar.js +1 -1
- package/vanilla/UiSpinner.d.ts +1 -1
- package/vanilla/UiSpinner.js +1 -1
- package/vanilla/UiStack.d.ts +1 -1
- package/vanilla/UiStack.js +1 -1
- package/vanilla/UiStatusMessage.d.ts +1 -1
- package/vanilla/UiStatusMessage.js +1 -1
- package/vanilla/UiSwitch.d.ts +1 -1
- package/vanilla/UiSwitch.js +1 -1
- package/vanilla/UiSwitcher.d.ts +1 -1
- package/vanilla/UiSwitcher.js +1 -1
- package/vanilla/UiTable.d.ts +1 -1
- package/vanilla/UiTable.js +1 -1
- package/vanilla/UiTabs.d.ts +1 -1
- package/vanilla/UiTabs.js +1 -1
- package/vanilla/UiText.d.ts +1 -1
- package/vanilla/UiText.js +1 -1
- package/vanilla/UiTextarea.d.ts +1 -1
- package/vanilla/UiTextarea.js +1 -1
- package/vanilla/UiToast.d.ts +1 -1
- package/vanilla/UiToast.js +1 -1
- package/vanilla/UiToastRegion.d.ts +1 -1
- package/vanilla/UiToastRegion.js +1 -1
- package/vanilla/UiTooltip.d.ts +1 -1
- package/vanilla/UiTooltip.js +1 -1
- package/vanilla/UiTopBar.d.ts +1 -1
- package/vanilla/UiTopBar.js +1 -1
- package/vanilla/UiTree.d.ts +1 -1
- package/vanilla/UiTree.js +1 -1
- package/vanilla/UiTreeItem.d.ts +1 -1
- package/vanilla/UiTreeItem.js +1 -1
- package/vue/UiActionBar.vue +1 -1
- package/vue/UiAffordanceScope.vue +1 -1
- package/vue/UiAvatar.vue +1 -1
- package/vue/UiAvatarGroup.d.ts +3 -3
- package/vue/UiAvatarGroup.vue +14 -5
- package/vue/UiBadge.vue +1 -1
- package/vue/UiBreadcrumbItem.vue +1 -1
- package/vue/UiBreadcrumbs.vue +1 -1
- package/vue/UiButton.d.ts +12 -3
- package/vue/UiButton.vue +45 -10
- package/vue/UiCallout.vue +1 -1
- package/vue/UiCard.vue +1 -1
- package/vue/UiCheckbox.vue +1 -1
- package/vue/UiCluster.vue +1 -1
- package/vue/UiCombobox.vue +1 -1
- package/vue/UiContainer.vue +1 -1
- package/vue/UiContextMenu.vue +1 -1
- package/vue/UiCover.vue +1 -1
- package/vue/UiDescriptionItem.vue +1 -1
- package/vue/UiDescriptionList.vue +1 -1
- package/vue/UiDialog.vue +1 -1
- package/vue/UiDisclosure.vue +1 -1
- package/vue/UiEditable.vue +1 -1
- package/vue/UiEditorInsertTableGrid.vue +1 -1
- package/vue/UiEditorMentionMenu.vue +1 -1
- package/vue/UiEditorMentionMenuItem.vue +1 -1
- package/vue/UiEditorSlashMenu.vue +1 -1
- package/vue/UiEditorSlashMenuGroup.vue +1 -1
- package/vue/UiEditorSlashMenuItem.vue +1 -1
- package/vue/UiEditorTableContextMenu.vue +1 -1
- package/vue/UiEditorTableOverlay.vue +1 -1
- package/vue/UiEditorTableToolbar.vue +1 -1
- package/vue/UiEditorToolbar.vue +1 -1
- package/vue/UiFloatingActionButton.vue +1 -1
- package/vue/UiFormField.vue +1 -1
- package/vue/UiGrid.vue +1 -1
- package/vue/UiIcon.vue +1 -1
- package/vue/UiIconButton.vue +1 -1
- package/vue/UiInput.vue +1 -1
- package/vue/UiInputGroup.vue +1 -1
- package/vue/UiList.vue +1 -1
- package/vue/UiListItem.vue +1 -1
- package/vue/UiListbox.vue +1 -1
- package/vue/UiMenu.d.ts +9 -0
- package/vue/UiMenu.vue +28 -1
- package/vue/UiMenuGroup.vue +1 -1
- package/vue/UiMenuItem.vue +12 -20
- package/vue/UiMeter.vue +1 -1
- package/vue/UiNavItem.vue +1 -1
- package/vue/UiPageHeader.vue +1 -1
- package/vue/UiPopover.vue +1 -1
- package/vue/UiRadio.vue +1 -1
- package/vue/UiRadioGroup.vue +1 -1
- package/vue/UiReel.vue +1 -1
- package/vue/UiScrollArea.vue +1 -1
- package/vue/UiSearchResultRow.vue +1 -1
- package/vue/UiSearchShell.vue +1 -1
- package/vue/UiSection.vue +1 -1
- package/vue/UiSelect.vue +1 -1
- package/vue/UiSeparator.vue +1 -1
- package/vue/UiSidebar.vue +1 -1
- package/vue/UiSpinner.vue +1 -1
- package/vue/UiStack.vue +1 -1
- package/vue/UiStatusMessage.vue +1 -1
- package/vue/UiSwitch.vue +1 -1
- package/vue/UiSwitcher.vue +1 -1
- package/vue/UiTable.vue +1 -1
- package/vue/UiTabs.vue +1 -1
- package/vue/UiText.vue +1 -1
- package/vue/UiTextarea.vue +1 -1
- package/vue/UiToast.vue +1 -1
- package/vue/UiToastRegion.vue +1 -1
- package/vue/UiTooltip.vue +1 -1
- package/vue/UiTopBar.vue +1 -1
- package/vue/UiTree.vue +1 -1
- package/vue/UiTreeItem.vue +1 -1
- package/vue/chunks/UiActionBar.js +1 -1
- package/vue/chunks/UiAffordanceScope.js +1 -1
- package/vue/chunks/UiAvatar.js +1 -1
- package/vue/chunks/UiAvatarGroup.js +6 -2
- package/vue/chunks/UiBadge.js +1 -1
- package/vue/chunks/UiBreadcrumbItem.js +1 -1
- package/vue/chunks/UiBreadcrumbs.js +1 -1
- package/vue/chunks/UiButton.js +16 -1
- package/vue/chunks/UiCallout.js +1 -1
- package/vue/chunks/UiCard.js +1 -1
- package/vue/chunks/UiCheckbox.js +1 -1
- package/vue/chunks/UiCluster.js +1 -1
- package/vue/chunks/UiCombobox.js +1 -1
- package/vue/chunks/UiContainer.js +1 -1
- package/vue/chunks/UiContextMenu.js +1 -1
- package/vue/chunks/UiCover.js +1 -1
- package/vue/chunks/UiDescriptionItem.js +1 -1
- package/vue/chunks/UiDescriptionList.js +1 -1
- package/vue/chunks/UiDialog.js +1 -1
- package/vue/chunks/UiDisclosure.js +1 -1
- package/vue/chunks/UiEditable.js +1 -1
- package/vue/chunks/UiEditorInsertTableGrid.js +1 -1
- package/vue/chunks/UiEditorMentionMenu.js +1 -1
- package/vue/chunks/UiEditorMentionMenuItem.js +1 -1
- package/vue/chunks/UiEditorSlashMenu.js +1 -1
- package/vue/chunks/UiEditorSlashMenuGroup.js +1 -1
- package/vue/chunks/UiEditorSlashMenuItem.js +1 -1
- package/vue/chunks/UiEditorTableContextMenu.js +1 -1
- package/vue/chunks/UiEditorTableOverlay.js +1 -1
- package/vue/chunks/UiEditorTableToolbar.js +1 -1
- package/vue/chunks/UiEditorToolbar.js +1 -1
- package/vue/chunks/UiFloatingActionButton.js +1 -1
- package/vue/chunks/UiFormField.js +1 -1
- package/vue/chunks/UiGrid.js +1 -1
- package/vue/chunks/UiIcon.js +1 -1
- package/vue/chunks/UiIconButton.js +1 -1
- package/vue/chunks/UiInput.js +1 -1
- package/vue/chunks/UiInputGroup.js +1 -1
- package/vue/chunks/UiList.js +1 -1
- package/vue/chunks/UiListItem.js +1 -1
- package/vue/chunks/UiListbox.js +1 -1
- package/vue/chunks/UiMenu.js +14 -2
- package/vue/chunks/UiMenuGroup.js +1 -1
- package/vue/chunks/UiMenuItem.js +2 -2
- package/vue/chunks/UiMeter.js +1 -1
- package/vue/chunks/UiNavItem.js +1 -1
- package/vue/chunks/UiPageHeader.js +1 -1
- package/vue/chunks/UiPopover.js +1 -1
- package/vue/chunks/UiRadio.js +1 -1
- package/vue/chunks/UiRadioGroup.js +1 -1
- package/vue/chunks/UiReel.js +1 -1
- package/vue/chunks/UiScrollArea.js +1 -1
- package/vue/chunks/UiSearchResultRow.js +1 -1
- package/vue/chunks/UiSearchShell.js +1 -1
- package/vue/chunks/UiSection.js +1 -1
- package/vue/chunks/UiSelect.js +1 -1
- package/vue/chunks/UiSeparator.js +1 -1
- package/vue/chunks/UiSidebar.js +1 -1
- package/vue/chunks/UiSpinner.js +1 -1
- package/vue/chunks/UiStack.js +1 -1
- package/vue/chunks/UiStatusMessage.js +1 -1
- package/vue/chunks/UiSwitch.js +1 -1
- package/vue/chunks/UiSwitcher.js +1 -1
- package/vue/chunks/UiTable.js +1 -1
- package/vue/chunks/UiTabs.js +1 -1
- package/vue/chunks/UiText.js +1 -1
- package/vue/chunks/UiTextarea.js +1 -1
- package/vue/chunks/UiToast.js +1 -1
- package/vue/chunks/UiToastRegion.js +1 -1
- package/vue/chunks/UiTooltip.js +1 -1
- package/vue/chunks/UiTopBar.js +1 -1
- package/vue/chunks/UiTree.js +1 -1
- package/vue/chunks/UiTreeItem.js +1 -1
- package/vue/chunks/props.js +1 -0
- package/vue/components.css +1249 -1210
- package/vue/host.ts +1 -1
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
>Accessible label for the overflow badge. Replace {count} with the number of people beyond the visible avatars.</prop>
|
|
11
11
|
<prop name="label" type="string" default="People"
|
|
12
12
|
>The group's accessible name, announced for the set of avatars as a whole. Name who they are rather than repeating the default.</prop>
|
|
13
|
-
<prop name="size" type="keyword" values="sm, md" default="md"
|
|
14
|
-
>The size of the avatars inside, matched by the +N badge and the overlap. Give each Avatar the same size
|
|
13
|
+
<prop name="size" type="keyword" values="xs, sm, md" default="md"
|
|
14
|
+
>The size of the avatars inside, matched by the +N badge and the overlap. Give each Avatar the same size. xs suits a group inside a line of small text, such
|
|
15
|
+
as the people listed under a title.</prop>
|
|
15
16
|
<state name="overflowCount" :value="0"></state>
|
|
16
17
|
<state name="overflowAnnouncement" :value="''"></state>
|
|
17
18
|
</defs>
|
|
@@ -88,6 +89,15 @@
|
|
|
88
89
|
block-size: 1.75rem;
|
|
89
90
|
}
|
|
90
91
|
|
|
92
|
+
:host-state([size="xs"]) .overflow {
|
|
93
|
+
margin-inline-start: -0.1875rem;
|
|
94
|
+
inline-size: 1.25rem;
|
|
95
|
+
block-size: 1.25rem;
|
|
96
|
+
/* Matches the xs Avatar's initials. */
|
|
97
|
+
font-size: calc(var(--ui-font-size) * 0.5625);
|
|
98
|
+
line-height: 1;
|
|
99
|
+
}
|
|
100
|
+
|
|
91
101
|
.overflow[hidden] {
|
|
92
102
|
display: none;
|
|
93
103
|
}
|
|
@@ -7,7 +7,7 @@ export default function controller(host) {
|
|
|
7
7
|
const visible = Number.isFinite(max) ? Math.max(0, Math.floor(max)) : 0;
|
|
8
8
|
const avatars = Array.from(element.children).filter((child) => child !== host.refs.overflow);
|
|
9
9
|
// Small avatars overlap less, so their initials stay clear of the next one.
|
|
10
|
-
const overlap =
|
|
10
|
+
const overlap = { xs: "-0.1875rem", sm: "-0.25rem" }[host.state.size] ?? "-0.5rem";
|
|
11
11
|
avatars.forEach((avatar, index) => {
|
|
12
12
|
avatar.style.display = index >= visible ? "none" : "";
|
|
13
13
|
avatar.style.marginInlineStart = index === 0 ? "0px" : overlap;
|
|
@@ -4,9 +4,12 @@
|
|
|
4
4
|
<prop name="variant" type="keyword" values="outline, solid, danger, ghost, link" default="outline"
|
|
5
5
|
>Emphasis: how loudly the button asks. solid fills with its tone, outline draws its tone at the edge over a wash of it, ghost carries only text until it is
|
|
6
6
|
hovered, and link is an inline text action that reads as a link. danger is solid in the danger tone, kept for the call sites that name it.</prop>
|
|
7
|
-
<prop name="size" type="keyword" values="sm, md, lg" default="md"
|
|
8
|
-
>Height, padding, and type size.
|
|
9
|
-
(2.5rem), and lg is taller (3rem) with roomier padding
|
|
7
|
+
<prop name="size" type="keyword" values="xs, sm, md, lg" default="md"
|
|
8
|
+
>Height, padding, and type size. xs is 1.5rem with the smallest text, for a control inside a line of small text; sm is the small control height (2rem by
|
|
9
|
+
default) with tighter padding and smaller text, md is the standard control height (2.5rem), and lg is taller (3rem) with roomier padding. Under touch, sm
|
|
10
|
+
grows to the touch minimum, while xs keeps its size inside its line and gains an invisible touch-sized hit area.</prop>
|
|
11
|
+
<prop name="shape" type="keyword" values="rounded, pill" default="rounded"
|
|
12
|
+
>rounded uses the theme's action radius; pill rounds the ends fully, for a compact choice such as a status or a person.</prop>
|
|
10
13
|
<prop name="tone" type="keyword" values="accent, neutral, danger, success, warning, info" default="accent"
|
|
11
14
|
>Which colour the button speaks in. It applies to every variant, so an outline, a ghost, and a solid in the same tone are the same action at three volumes:
|
|
12
15
|
tone="danger" variant="outline" is a destructive secondary action. neutral is the quiet one, for a button that should not claim a colour.</prop>
|
|
@@ -208,6 +211,16 @@
|
|
|
208
211
|
}
|
|
209
212
|
}
|
|
210
213
|
|
|
214
|
+
:host-state([size="xs"]) {
|
|
215
|
+
min-block-size: 1.5rem;
|
|
216
|
+
padding: calc(var(--ui-space-0-5) * 1.5) calc(var(--ui-space-1) * 1.25);
|
|
217
|
+
font-size: var(--ui-font-size-xs);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
:host-state([shape="pill"]) {
|
|
221
|
+
border-radius: var(--ui-button-radius, var(--ui-radius-round));
|
|
222
|
+
}
|
|
223
|
+
|
|
211
224
|
:host-state([size="sm"]) {
|
|
212
225
|
min-block-size: var(--ui-control-size-sm);
|
|
213
226
|
padding: var(--ui-space-1) var(--ui-space-2);
|
|
@@ -308,10 +321,12 @@
|
|
|
308
321
|
border-color: transparent;
|
|
309
322
|
}
|
|
310
323
|
|
|
324
|
+
/* Pressed, or holding its menu open, a ghost button sinks slightly: a light surface with a faint
|
|
325
|
+
edge and a soft inner shadow. Lighter than hover, so an open menu's trigger never reads as heavy. */
|
|
311
326
|
:host-state([variant="ghost"]):is(:active, [aria-expanded="true"]):not(:disabled, [aria-disabled="true"]) {
|
|
312
|
-
background-color: var(--ui-button-ghost-active-surface, oklch(
|
|
327
|
+
background-color: var(--ui-button-ghost-active-surface, color-mix(in oklch, var(--ui-surface), var(--_tone) 3%));
|
|
313
328
|
border-color: transparent;
|
|
314
|
-
box-shadow: var(--
|
|
329
|
+
box-shadow: inset 0 0 0 1px oklch(from var(--_tone) l c h / 10%), inset 0 1px 2px oklch(from var(--_tone) l c h / 8%);
|
|
315
330
|
}
|
|
316
331
|
|
|
317
332
|
/* A soft halo that transitions in with the other box-shadow changes, layered on the raised shadow. */
|
|
@@ -361,12 +376,15 @@
|
|
|
361
376
|
/* Under touch, a link-style button's press lands within the control minimum: an invisible hit
|
|
362
377
|
area, centred on it, like IconButton's. A boxed button grows to the minimum itself (below);
|
|
363
378
|
a link-style one keeps its text size, so a standalone one ("See all" under a list) needs the
|
|
364
|
-
area.
|
|
365
|
-
|
|
379
|
+
area. xs sits inside a line of text the same way, so it keeps its size and gains the area too.
|
|
380
|
+
Only these need it: a hit area on every button would reach over its neighbours. */
|
|
381
|
+
html[data-ui-input-modality="touch"] :host-state([variant="link"]),
|
|
382
|
+
html[data-ui-input-modality="touch"] :host-state([size="xs"]) {
|
|
366
383
|
position: relative;
|
|
367
384
|
}
|
|
368
385
|
|
|
369
|
-
html[data-ui-input-modality="touch"] :host-state([variant="link"])::after
|
|
386
|
+
html[data-ui-input-modality="touch"] :host-state([variant="link"])::after,
|
|
387
|
+
html[data-ui-input-modality="touch"] :host-state([size="xs"])::after {
|
|
370
388
|
position: absolute;
|
|
371
389
|
inset: 50% auto auto 50%;
|
|
372
390
|
inline-size: max(100%, var(--ui-control-min-block-size));
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
<defs>
|
|
3
3
|
<prop name="density" type="keyword" values="comfortable, compact" default="comfortable"
|
|
4
4
|
>Compact trades padding and type size for rows that fit more on screen.</prop>
|
|
5
|
+
<prop name="size" type="keyword" values="sm, md" default="md"
|
|
6
|
+
>sm sizes the menu to a small trigger, such as an xs or sm button: smallest text, short rows, a small check, and a narrower minimum width. md is the
|
|
7
|
+
standard size.</prop>
|
|
5
8
|
<prop name="open" type="boolean" default="false">Whether the menu is open initially or when set externally.</prop>
|
|
6
9
|
<prop name="inline" type="boolean" default="false">Displays the menu in the page flow without an overlay or trigger, for an embedded list of actions.</prop>
|
|
7
10
|
<prop name="for" type="string" default="">ID of the control that toggles and anchors the menu.</prop>
|
|
@@ -61,6 +64,19 @@
|
|
|
61
64
|
gap: 0;
|
|
62
65
|
}
|
|
63
66
|
|
|
67
|
+
/* Small follows its trigger down: an item's own hooks still win. */
|
|
68
|
+
:host-state([size="sm"]) {
|
|
69
|
+
--_ui-default-menu-item-padding-block: var(--ui-space-0-5);
|
|
70
|
+
--_ui-default-menu-item-padding-inline: var(--ui-space-2);
|
|
71
|
+
--_ui-default-menu-item-font-size: var(--ui-font-size-xs);
|
|
72
|
+
--_ui-default-menu-item-radius: var(--ui-radius-sm);
|
|
73
|
+
--_ui-default-menu-item-min-block-size: 1.5rem;
|
|
74
|
+
--_ui-default-menu-indicator-size: 0.75rem;
|
|
75
|
+
min-inline-size: min(8rem, calc(100vw - var(--ui-menu-viewport-gap, var(--ui-space-2)) * 2));
|
|
76
|
+
padding: var(--ui-space-1);
|
|
77
|
+
gap: 0;
|
|
78
|
+
}
|
|
79
|
+
|
|
64
80
|
:host {
|
|
65
81
|
--_ui-menu-surface: var(--ui-menu-surface);
|
|
66
82
|
--_ui-menu-border: var(--ui-menu-border);
|
|
@@ -71,6 +87,8 @@
|
|
|
71
87
|
--_ui-default-menu-item-padding-inline: initial;
|
|
72
88
|
--_ui-default-menu-item-font-size: initial;
|
|
73
89
|
--_ui-default-menu-item-radius: initial;
|
|
90
|
+
--_ui-default-menu-item-min-block-size: initial;
|
|
91
|
+
--_ui-default-menu-indicator-size: initial;
|
|
74
92
|
display: flex;
|
|
75
93
|
flex-direction: column;
|
|
76
94
|
box-sizing: border-box;
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
from:data-value="value"
|
|
40
40
|
>
|
|
41
41
|
<span class="indicator" aria-hidden="true">
|
|
42
|
-
<ui-icon $if="type = 'checkbox' and internalChecked" name="check"></ui-icon>
|
|
42
|
+
<ui-icon $if="(type = 'checkbox' or type = 'radio') and internalChecked" name="check"></ui-icon>
|
|
43
43
|
</span>
|
|
44
44
|
<span class="label"><slot></slot></span>
|
|
45
45
|
<span class="shortcut" aria-hidden="true"><slot name="shortcut"></slot></span>
|
|
@@ -105,8 +105,8 @@
|
|
|
105
105
|
justify-content: center;
|
|
106
106
|
flex: none;
|
|
107
107
|
box-sizing: border-box;
|
|
108
|
-
inline-size: var(--ui-icon-size-sm);
|
|
109
|
-
block-size: var(--ui-icon-size-sm);
|
|
108
|
+
inline-size: var(--_ui-default-menu-indicator-size, var(--ui-icon-size-sm));
|
|
109
|
+
block-size: var(--_ui-default-menu-indicator-size, var(--ui-icon-size-sm));
|
|
110
110
|
border: 1.5px solid var(--ui-control-border);
|
|
111
111
|
border-radius: var(--ui-radius-sm);
|
|
112
112
|
color: var(--ui-surface);
|
|
@@ -122,20 +122,11 @@
|
|
|
122
122
|
background: var(--ui-accent);
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
/* A menu marks its chosen item with a check, as menus conventionally do; a radio circle reads
|
|
126
|
+
as a form control. The empty slot keeps unchosen labels aligned with the chosen one. */
|
|
125
127
|
:host-state([type="radio"]) .indicator {
|
|
126
|
-
border-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
:host-state([type="radio"])[aria-checked="true"] .indicator {
|
|
130
|
-
border-color: var(--ui-accent);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
:host-state([type="radio"])[aria-checked="true"] .indicator::after {
|
|
134
|
-
content: "";
|
|
135
|
-
inline-size: 0.375rem;
|
|
136
|
-
block-size: 0.375rem;
|
|
137
|
-
border-radius: var(--ui-radius-round);
|
|
138
|
-
background: var(--ui-accent);
|
|
128
|
+
border-color: transparent;
|
|
129
|
+
color: var(--ui-text-secondary);
|
|
139
130
|
}
|
|
140
131
|
|
|
141
132
|
.shortcut {
|
|
@@ -152,7 +143,7 @@
|
|
|
152
143
|
/* Keep the text row at the shared control height where cap trimming is available. */
|
|
153
144
|
@supports (text-box-trim: trim-both) {
|
|
154
145
|
:host {
|
|
155
|
-
min-block-size: var(--ui-menu-item-min-block-size, var(--ui-control-size-md, 2.5rem));
|
|
146
|
+
min-block-size: var(--ui-menu-item-min-block-size, var(--_ui-default-menu-item-min-block-size, var(--ui-control-size-md, 2.5rem)));
|
|
156
147
|
text-box-trim: trim-both;
|
|
157
148
|
text-box-edge: cap alphabetic;
|
|
158
149
|
}
|