@threadlabs/looma 0.51.6 → 0.52.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/README.md +4 -4
- package/components/shared/overlay.js +7 -2
- package/components/ui-breadcrumb-item/ui-breadcrumb-item.html +1 -0
- package/components/ui-calendar/ui-calendar.js +11 -7
- package/components/ui-date-field/ui-date-field.js +0 -5
- package/components/ui-disclosure/ui-disclosure.js +19 -4
- package/components/ui-editor-link-form/ui-editor-link-form.js +5 -0
- package/components/ui-editor-mention-menu-item/ui-editor-mention-menu-item.html +2 -3
- package/components/ui-editor-table-context-menu/ui-editor-table-context-menu.html +10 -1
- package/components/ui-file-input/ui-file-input.js +0 -2
- package/components/ui-status-message/ui-status-message.html +1 -0
- package/components/ui-tabs/ui-tabs.html +1 -0
- package/components/ui-tooltip/ui-tooltip.html +11 -32
- package/dist/index.js +14 -8
- package/docs/catalog.json +565 -131
- package/editor/components.css +530 -551
- package/editor/index.js +72 -47
- package/package.json +30 -35
- package/styles/ui-action-bar.css +8 -8
- package/styles/ui-affordance-scope.css +10 -10
- package/styles/ui-avatar-group.css +11 -11
- package/styles/ui-avatar.css +14 -14
- package/styles/ui-badge.css +67 -67
- package/styles/ui-breadcrumb-item.css +10 -10
- package/styles/ui-breadcrumbs.css +8 -8
- package/styles/ui-button.css +99 -99
- package/styles/ui-calendar.css +1 -1
- package/styles/ui-callout.css +14 -14
- package/styles/ui-card-group.css +11 -11
- package/styles/ui-card.css +36 -36
- package/styles/ui-checkbox.css +28 -28
- package/styles/ui-cluster.css +30 -30
- package/styles/ui-color-picker.css +16 -16
- package/styles/ui-combobox.css +50 -50
- package/styles/ui-compact-content.css +1 -1
- package/styles/ui-compact-editor.css +1 -1
- package/styles/ui-compact-mark.css +1 -1
- package/styles/ui-compact-node.css +1 -1
- package/styles/ui-container.css +14 -14
- package/styles/ui-context-menu.css +8 -8
- package/styles/ui-cover.css +9 -9
- package/styles/ui-curve-editor.css +9 -9
- package/styles/ui-cycle-button.css +10 -10
- package/styles/ui-date-field.css +1 -1
- package/styles/ui-date-picker.css +1 -1
- package/styles/ui-date-range-picker.css +1 -1
- package/styles/ui-description-item.css +8 -8
- package/styles/ui-description-list.css +18 -18
- package/styles/ui-dialog.css +37 -37
- package/styles/ui-disclosure.css +26 -26
- package/styles/ui-editable.css +13 -13
- package/styles/ui-editor-block-actions.css +1 -1
- package/styles/ui-editor-chip-editor.css +1 -1
- package/styles/ui-editor-code-language.css +1 -1
- package/styles/ui-editor-footnote-editor.css +1 -1
- package/styles/ui-editor-formatting-tools.css +1 -1
- package/styles/ui-editor-image-toolbar.css +1 -1
- package/styles/ui-editor-insert-table-grid.css +9 -9
- package/styles/ui-editor-link-card.css +1 -1
- package/styles/ui-editor-link-form.css +1 -1
- package/styles/ui-editor-mention-menu-item.css +13 -15
- package/styles/ui-editor-mention-menu.css +12 -12
- package/styles/ui-editor-slash-menu-group.css +7 -7
- package/styles/ui-editor-slash-menu-item.css +12 -12
- package/styles/ui-editor-slash-menu.css +13 -13
- package/styles/ui-editor-surface.css +8 -8
- package/styles/ui-editor-table-context-menu.css +19 -15
- package/styles/ui-editor-table-overlay.css +15 -15
- package/styles/ui-editor-table-toolbar.css +19 -19
- package/styles/ui-editor-toolbar.css +16 -16
- package/styles/ui-editor.css +1 -1
- package/styles/ui-file-input.css +1 -1
- package/styles/ui-floating-action-button.css +14 -14
- package/styles/ui-form-field.css +9 -9
- package/styles/ui-grid.css +19 -19
- package/styles/ui-icon-button.css +73 -73
- package/styles/ui-icon.css +11 -11
- package/styles/ui-image.css +23 -23
- package/styles/ui-input-group.css +26 -26
- package/styles/ui-input.css +23 -23
- package/styles/ui-light-editor.css +15 -15
- package/styles/ui-list-item.css +25 -25
- package/styles/ui-list.css +16 -16
- package/styles/ui-listbox.css +22 -22
- package/styles/ui-menu-group.css +7 -7
- package/styles/ui-menu-item.css +20 -20
- package/styles/ui-menu.css +20 -20
- package/styles/ui-meter.css +32 -32
- package/styles/ui-nav-item.css +18 -18
- package/styles/ui-number-input.css +12 -12
- package/styles/ui-page-header.css +10 -10
- package/styles/ui-pagination.css +1 -1
- package/styles/ui-popover.css +17 -17
- package/styles/ui-radio-group.css +10 -10
- package/styles/ui-radio.css +25 -25
- package/styles/ui-reel.css +21 -21
- package/styles/ui-scroll-area.css +20 -20
- package/styles/ui-search-result-row.css +16 -16
- package/styles/ui-search-shell.css +10 -10
- package/styles/ui-section.css +18 -18
- package/styles/ui-select.css +22 -22
- package/styles/ui-separator.css +12 -12
- package/styles/ui-sidebar.css +26 -26
- package/styles/ui-site-header.css +65 -65
- package/styles/ui-skeleton.css +18 -18
- package/styles/ui-slider.css +11 -11
- package/styles/ui-spinner.css +9 -9
- package/styles/ui-stack.css +22 -22
- package/styles/ui-status-message.css +12 -12
- package/styles/ui-swatch.css +14 -14
- package/styles/ui-switch.css +23 -23
- package/styles/ui-switcher.css +20 -20
- package/styles/ui-table.css +12 -12
- package/styles/ui-tabs.css +18 -17
- package/styles/ui-text.css +40 -40
- package/styles/ui-textarea.css +21 -21
- package/styles/ui-time-field.css +1 -1
- package/styles/ui-time-picker.css +1 -1
- package/styles/ui-toast-region.css +29 -29
- package/styles/ui-toast.css +19 -19
- package/styles/ui-tooltip.css +37 -58
- package/styles/ui-top-bar.css +8 -8
- package/styles/ui-tree-item.css +112 -112
- package/styles/ui-tree.css +11 -11
- package/vanilla/UiActionBar.d.ts +1 -1
- package/vanilla/UiActionBar.js +2 -2
- package/vanilla/UiAffordanceScope.d.ts +1 -1
- package/vanilla/UiAffordanceScope.js +2 -2
- package/vanilla/UiAvatar.d.ts +1 -1
- package/vanilla/UiAvatar.js +2 -2
- package/vanilla/UiAvatarGroup.d.ts +1 -1
- package/vanilla/UiAvatarGroup.js +2 -2
- package/vanilla/UiBadge.d.ts +1 -1
- package/vanilla/UiBadge.js +2 -2
- package/vanilla/UiBreadcrumbItem.d.ts +1 -1
- package/vanilla/UiBreadcrumbItem.js +2 -2
- package/vanilla/UiBreadcrumbs.d.ts +1 -1
- package/vanilla/UiBreadcrumbs.js +2 -2
- package/vanilla/UiButton.d.ts +1 -1
- package/vanilla/UiButton.js +5 -5
- package/vanilla/UiCalendar.d.ts +1 -1
- package/vanilla/UiCalendar.js +10 -10
- package/vanilla/UiCallout.d.ts +1 -1
- package/vanilla/UiCallout.js +2 -2
- package/vanilla/UiCard.d.ts +1 -1
- package/vanilla/UiCard.js +5 -5
- package/vanilla/UiCardGroup.d.ts +1 -1
- package/vanilla/UiCardGroup.js +2 -2
- package/vanilla/UiCheckbox.d.ts +1 -1
- package/vanilla/UiCheckbox.js +2 -2
- package/vanilla/UiCluster.d.ts +1 -1
- package/vanilla/UiCluster.js +2 -2
- package/vanilla/UiColorPicker.d.ts +1 -1
- package/vanilla/UiColorPicker.js +2 -2
- package/vanilla/UiCombobox.d.ts +1 -1
- package/vanilla/UiCombobox.js +8 -8
- package/vanilla/UiCompactContent.d.ts +1 -1
- package/vanilla/UiCompactContent.js +4 -4
- package/vanilla/UiCompactEditor.d.ts +1 -1
- package/vanilla/UiCompactEditor.js +2 -2
- package/vanilla/UiCompactMark.d.ts +1 -1
- package/vanilla/UiCompactMark.js +5 -5
- package/vanilla/UiCompactNode.d.ts +1 -1
- package/vanilla/UiCompactNode.js +8 -8
- package/vanilla/UiContainer.d.ts +1 -1
- package/vanilla/UiContainer.js +2 -2
- package/vanilla/UiContextMenu.d.ts +1 -1
- package/vanilla/UiContextMenu.js +2 -2
- package/vanilla/UiCover.d.ts +1 -1
- package/vanilla/UiCover.js +2 -2
- package/vanilla/UiCurveEditor.d.ts +1 -1
- package/vanilla/UiCurveEditor.js +2 -2
- package/vanilla/UiCycleButton.d.ts +1 -1
- package/vanilla/UiCycleButton.js +2 -2
- package/vanilla/UiDateField.d.ts +1 -1
- package/vanilla/UiDateField.js +2 -2
- package/vanilla/UiDatePicker.d.ts +1 -1
- package/vanilla/UiDatePicker.js +2 -2
- package/vanilla/UiDateRangePicker.d.ts +1 -1
- package/vanilla/UiDateRangePicker.js +4 -4
- package/vanilla/UiDescriptionItem.d.ts +1 -1
- package/vanilla/UiDescriptionItem.js +2 -2
- package/vanilla/UiDescriptionList.d.ts +1 -1
- package/vanilla/UiDescriptionList.js +2 -2
- package/vanilla/UiDialog.d.ts +1 -1
- package/vanilla/UiDialog.js +2 -2
- package/vanilla/UiDisclosure.d.ts +1 -1
- package/vanilla/UiDisclosure.js +2 -2
- package/vanilla/UiEditable.d.ts +1 -1
- package/vanilla/UiEditable.js +2 -2
- package/vanilla/UiEditor.d.ts +1 -1
- package/vanilla/UiEditor.js +6 -6
- package/vanilla/UiEditorBlockActions.d.ts +1 -1
- package/vanilla/UiEditorBlockActions.js +2 -2
- package/vanilla/UiEditorChipEditor.d.ts +1 -1
- package/vanilla/UiEditorChipEditor.js +2 -2
- package/vanilla/UiEditorCodeLanguage.d.ts +1 -1
- package/vanilla/UiEditorCodeLanguage.js +4 -4
- package/vanilla/UiEditorFootnoteEditor.d.ts +1 -1
- package/vanilla/UiEditorFootnoteEditor.js +2 -2
- package/vanilla/UiEditorFormattingTools.d.ts +1 -1
- package/vanilla/UiEditorFormattingTools.js +4 -4
- package/vanilla/UiEditorImageToolbar.d.ts +1 -1
- package/vanilla/UiEditorImageToolbar.js +2 -2
- package/vanilla/UiEditorInsertTableGrid.d.ts +1 -1
- package/vanilla/UiEditorInsertTableGrid.js +4 -4
- package/vanilla/UiEditorLinkCard.d.ts +1 -1
- package/vanilla/UiEditorLinkCard.js +2 -2
- package/vanilla/UiEditorLinkForm.d.ts +1 -1
- package/vanilla/UiEditorLinkForm.js +4 -4
- package/vanilla/UiEditorMentionMenu.d.ts +1 -1
- package/vanilla/UiEditorMentionMenu.js +4 -4
- package/vanilla/UiEditorMentionMenuItem.d.ts +1 -1
- package/vanilla/UiEditorMentionMenuItem.js +2 -2
- package/vanilla/UiEditorSlashMenu.d.ts +1 -1
- package/vanilla/UiEditorSlashMenu.js +4 -4
- package/vanilla/UiEditorSlashMenuGroup.d.ts +1 -1
- package/vanilla/UiEditorSlashMenuGroup.js +2 -2
- package/vanilla/UiEditorSlashMenuItem.d.ts +1 -1
- package/vanilla/UiEditorSlashMenuItem.js +2 -2
- package/vanilla/UiEditorSurface.d.ts +1 -1
- package/vanilla/UiEditorSurface.js +2 -2
- package/vanilla/UiEditorTableContextMenu.d.ts +1 -1
- package/vanilla/UiEditorTableContextMenu.js +7 -6
- package/vanilla/UiEditorTableOverlay.d.ts +1 -1
- package/vanilla/UiEditorTableOverlay.js +5 -5
- package/vanilla/UiEditorTableToolbar.d.ts +1 -1
- package/vanilla/UiEditorTableToolbar.js +8 -8
- package/vanilla/UiEditorToolbar.d.ts +1 -1
- package/vanilla/UiEditorToolbar.js +2 -2
- package/vanilla/UiFileInput.d.ts +1 -1
- package/vanilla/UiFileInput.js +4 -4
- package/vanilla/UiFloatingActionButton.d.ts +1 -1
- package/vanilla/UiFloatingActionButton.js +2 -2
- package/vanilla/UiFormField.d.ts +1 -1
- package/vanilla/UiFormField.js +2 -2
- package/vanilla/UiGrid.d.ts +1 -1
- package/vanilla/UiGrid.js +4 -4
- package/vanilla/UiIcon.d.ts +1 -1
- package/vanilla/UiIcon.js +4 -4
- package/vanilla/UiIconButton.d.ts +1 -1
- package/vanilla/UiIconButton.js +2 -2
- package/vanilla/UiImage.d.ts +1 -1
- package/vanilla/UiImage.js +2 -2
- package/vanilla/UiInput.d.ts +1 -1
- package/vanilla/UiInput.js +2 -2
- package/vanilla/UiInputGroup.d.ts +1 -1
- package/vanilla/UiInputGroup.js +2 -2
- package/vanilla/UiLightEditor.d.ts +1 -1
- package/vanilla/UiLightEditor.js +2 -2
- package/vanilla/UiList.d.ts +1 -1
- package/vanilla/UiList.js +3 -3
- package/vanilla/UiListItem.d.ts +1 -1
- package/vanilla/UiListItem.js +2 -2
- package/vanilla/UiListbox.d.ts +1 -1
- package/vanilla/UiListbox.js +5 -5
- package/vanilla/UiMenu.d.ts +1 -1
- package/vanilla/UiMenu.js +2 -2
- package/vanilla/UiMenuGroup.d.ts +1 -1
- package/vanilla/UiMenuGroup.js +2 -2
- package/vanilla/UiMenuItem.d.ts +1 -1
- package/vanilla/UiMenuItem.js +3 -3
- package/vanilla/UiMeter.d.ts +1 -1
- package/vanilla/UiMeter.js +4 -4
- package/vanilla/UiNavItem.d.ts +1 -1
- package/vanilla/UiNavItem.js +3 -3
- package/vanilla/UiNumberInput.d.ts +1 -1
- package/vanilla/UiNumberInput.js +2 -2
- package/vanilla/UiPageHeader.d.ts +1 -1
- package/vanilla/UiPageHeader.js +2 -2
- package/vanilla/UiPagination.d.ts +1 -1
- package/vanilla/UiPagination.js +4 -4
- package/vanilla/UiPopover.d.ts +1 -1
- package/vanilla/UiPopover.js +2 -2
- package/vanilla/UiRadio.d.ts +1 -1
- package/vanilla/UiRadio.js +2 -2
- package/vanilla/UiRadioGroup.d.ts +1 -1
- package/vanilla/UiRadioGroup.js +2 -2
- package/vanilla/UiReel.d.ts +1 -1
- package/vanilla/UiReel.js +2 -2
- package/vanilla/UiScrollArea.d.ts +1 -1
- package/vanilla/UiScrollArea.js +2 -2
- package/vanilla/UiSearchResultRow.d.ts +1 -1
- package/vanilla/UiSearchResultRow.js +2 -2
- package/vanilla/UiSearchShell.d.ts +1 -1
- package/vanilla/UiSearchShell.js +2 -2
- package/vanilla/UiSection.d.ts +1 -1
- package/vanilla/UiSection.js +3 -3
- package/vanilla/UiSelect.d.ts +1 -1
- package/vanilla/UiSelect.js +2 -2
- package/vanilla/UiSeparator.d.ts +1 -1
- package/vanilla/UiSeparator.js +2 -2
- package/vanilla/UiSidebar.d.ts +1 -1
- package/vanilla/UiSidebar.js +2 -2
- package/vanilla/UiSiteHeader.d.ts +1 -1
- package/vanilla/UiSiteHeader.js +2 -2
- package/vanilla/UiSkeleton.d.ts +1 -1
- package/vanilla/UiSkeleton.js +2 -2
- package/vanilla/UiSlider.d.ts +1 -1
- package/vanilla/UiSlider.js +2 -2
- package/vanilla/UiSpinner.d.ts +1 -1
- package/vanilla/UiSpinner.js +2 -2
- package/vanilla/UiStack.d.ts +1 -1
- package/vanilla/UiStack.js +2 -2
- package/vanilla/UiStatusMessage.d.ts +1 -1
- package/vanilla/UiStatusMessage.js +2 -2
- package/vanilla/UiSwatch.d.ts +1 -1
- package/vanilla/UiSwatch.js +2 -2
- package/vanilla/UiSwitch.d.ts +1 -1
- package/vanilla/UiSwitch.js +2 -2
- package/vanilla/UiSwitcher.d.ts +1 -1
- package/vanilla/UiSwitcher.js +2 -2
- package/vanilla/UiTable.d.ts +1 -1
- package/vanilla/UiTable.js +2 -2
- package/vanilla/UiTabs.d.ts +1 -1
- package/vanilla/UiTabs.js +4 -4
- package/vanilla/UiText.d.ts +1 -1
- package/vanilla/UiText.js +13 -13
- package/vanilla/UiTextarea.d.ts +1 -1
- package/vanilla/UiTextarea.js +2 -2
- package/vanilla/UiTimeField.d.ts +1 -1
- package/vanilla/UiTimeField.js +2 -2
- package/vanilla/UiTimePicker.d.ts +1 -1
- package/vanilla/UiTimePicker.js +6 -6
- package/vanilla/UiToast.d.ts +1 -1
- package/vanilla/UiToast.js +2 -2
- package/vanilla/UiToastRegion.d.ts +1 -1
- package/vanilla/UiToastRegion.js +4 -4
- package/vanilla/UiTooltip.d.ts +1 -1
- package/vanilla/UiTooltip.js +2 -2
- package/vanilla/UiTopBar.d.ts +1 -1
- package/vanilla/UiTopBar.js +2 -2
- package/vanilla/UiTree.d.ts +1 -1
- package/vanilla/UiTree.js +2 -2
- package/vanilla/UiTreeItem.d.ts +1 -1
- package/vanilla/UiTreeItem.js +2 -2
- package/bin/looma-docs.mjs +0 -3
- package/docs/README.md +0 -323
- package/docs/card.html +0 -79
- package/docs/card.js +0 -18
- package/docs/catalog-view.js +0 -24
- package/docs/catalog-view.mjs +0 -13
- package/docs/catalog.mjs +0 -131
- package/docs/cli.mjs +0 -26
- package/docs/commands.mjs +0 -94
- package/docs/customizer-render.mjs +0 -157
- package/docs/customizer.js +0 -494
- package/docs/documentation.css +0 -14
- package/docs/example-invocations.mjs +0 -63
- package/docs/fonts.mjs +0 -73
- package/docs/framework-examples.d.mts +0 -9
- package/docs/framework-examples.mjs +0 -195
- package/docs/index.d.ts +0 -59
- package/docs/index.mjs +0 -4
- package/docs/local-server.mjs +0 -65
- package/docs/navigation.mjs +0 -26
- package/docs/palette.mjs +0 -68
- package/docs/pastoral.svg +0 -54
- package/docs/portrait.svg +0 -15
- package/docs/reference.html +0 -1
- package/docs/reference.js +0 -36
- package/docs/render.mjs +0 -97
- package/docs/site.mjs +0 -237
- package/docs/store.mjs +0 -92
- package/docs/theme-session.mjs +0 -72
- package/docs/theme.mjs +0 -669
- package/docs/value-editors.mjs +0 -37
- package/docs/workspace.mjs +0 -32
package/README.md
CHANGED
|
@@ -116,14 +116,14 @@ Components read design tokens (`--ui-*` custom properties) from `tokens.css` and
|
|
|
116
116
|
|
|
117
117
|
## Weave your design system
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
`@threadlabs/looma-docs` supplies the documentation generator and theme customizer used by Looma's public site. Browse real component cards, generate a theme from shared semantic decisions, and document your own HTML Next components beside Looma's.
|
|
120
120
|
|
|
121
|
-
Install the
|
|
121
|
+
Install the documentation package as a development dependency, then initialize your project:
|
|
122
122
|
|
|
123
123
|
```sh
|
|
124
|
-
pnpm add -D
|
|
124
|
+
pnpm add -D @threadlabs/looma-docs
|
|
125
125
|
pnpm exec looma-docs init
|
|
126
126
|
pnpm exec looma-docs dev
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
-
The local editor saves `looma.theme.json` and generated `looma.theme.css`; import that CSS in your application. Static builds offer CSS and recipe downloads. See the [design-system guide](https://threadlabs.studio/looma/design-system/) for configuration, discovery, saving and recovery. Programmatic tooling is available through `@threadlabs/looma
|
|
129
|
+
The local editor saves `looma.theme.json` and generated `looma.theme.css`; import that CSS in your application. Static builds offer CSS and recipe downloads. See the [design-system guide](https://threadlabs.studio/looma/design-system/) for configuration, discovery, saving and recovery. Programmatic tooling is available through `@threadlabs/looma-docs`.
|
|
@@ -355,6 +355,7 @@ export function createViewportSurface(surface, options = {}) {
|
|
|
355
355
|
let sizeObserver = null;
|
|
356
356
|
let frame = null;
|
|
357
357
|
const position = () => {
|
|
358
|
+
if (frame !== null) owner.cancelAnimationFrame(frame);
|
|
358
359
|
frame = null;
|
|
359
360
|
if (stop) {
|
|
360
361
|
if (options.materialRole) updateSurfaceMaterial(surface, options.materialRole);
|
|
@@ -396,7 +397,8 @@ export function createViewportSurface(surface, options = {}) {
|
|
|
396
397
|
stop ??= observeOverlayViewport(surface.ownerDocument, position);
|
|
397
398
|
options.position?.();
|
|
398
399
|
if (!sizeObserver && owner.ResizeObserver) {
|
|
399
|
-
|
|
400
|
+
// ResizeObserver runs before paint. Another frame would expose the new size at the old position.
|
|
401
|
+
sizeObserver = new owner.ResizeObserver(position);
|
|
400
402
|
sizeObserver.observe(surface);
|
|
401
403
|
}
|
|
402
404
|
},
|
|
@@ -431,7 +433,10 @@ export function createAnchoredSurface(surface, options = {}) {
|
|
|
431
433
|
return;
|
|
432
434
|
}
|
|
433
435
|
const rect = point ? { left: point.x, right: point.x, top: point.y, bottom: point.y, width: 0, height: 0 } : anchorRect();
|
|
434
|
-
if (!rect)
|
|
436
|
+
if (!rect) {
|
|
437
|
+
if (!lastAnchorRect) hide(surface);
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
435
440
|
// A disappearing trigger has no usable position. Keep the last valid position, or wait before first opening.
|
|
436
441
|
if (!point && typeof anchor !== "function" && (anchor.isConnected === false || rect.width === 0 && rect.height === 0
|
|
437
442
|
|| anchor instanceof owner.Element && owner.getComputedStyle(anchor).visibility !== "visible")) {
|
|
@@ -3,6 +3,7 @@ import { componentInputs } from "@nextwebwg/html-next/inputs";
|
|
|
3
3
|
import { Temporal, asciiDigits, canonicalValue, compileDateRules, isDateAllowed } from "../shared/date-time.js";
|
|
4
4
|
import { availableDate } from "../shared/date-navigation.js";
|
|
5
5
|
import { createCalendarBindings } from "./calendar-source.js";
|
|
6
|
+
import { externalValueTracker } from "../shared/external-value.js";
|
|
6
7
|
|
|
7
8
|
const constraintNames = ["min", "max", "allowedDates", "allowedRanges", "disabledDates", "disabledRanges", "disabledWeekdays"];
|
|
8
9
|
|
|
@@ -15,8 +16,12 @@ function interactions(host) {
|
|
|
15
16
|
const model = () => host.props.model.value;
|
|
16
17
|
const blocked = () => host.props.disabled.value;
|
|
17
18
|
const settings = () => Object.fromEntries(constraintNames.map(key => [key, host.props[key].value]));
|
|
18
|
-
const focus = selector => {
|
|
19
|
+
const focus = (selector, immediate = false) => {
|
|
19
20
|
cancelAnimationFrame(frame);
|
|
21
|
+
if (immediate) {
|
|
22
|
+
const target = element.querySelector(selector);
|
|
23
|
+
if (target && !target.closest("[hidden]")) target.focus();
|
|
24
|
+
}
|
|
20
25
|
frame = requestAnimationFrame(() => {
|
|
21
26
|
if (!connected) return;
|
|
22
27
|
const target = element.querySelector(selector) ?? element.querySelector(host.state.mode === "days" ? '[data-calendar-days][tabindex="0"]' : "[data-calendar-year-toggle]");
|
|
@@ -65,7 +70,7 @@ function interactions(host) {
|
|
|
65
70
|
if (!date) return;
|
|
66
71
|
host.state.focusedDate = date;
|
|
67
72
|
showMonth(date.slice(0, 7), "keyboard");
|
|
68
|
-
focus(`[data-calendar-day="${date}"]
|
|
73
|
+
focus(`[data-calendar-day="${date}"]`, true);
|
|
69
74
|
};
|
|
70
75
|
const navigate = (direction, trigger) => {
|
|
71
76
|
const current = model(); if (!current) return;
|
|
@@ -158,19 +163,18 @@ function interactions(host) {
|
|
|
158
163
|
element.addEventListener("keydown", keydown);
|
|
159
164
|
element.addEventListener("focusin", focusin);
|
|
160
165
|
element.addEventListener("focus-date", request);
|
|
161
|
-
|
|
162
|
-
|
|
166
|
+
const externalValueChanged = externalValueTracker(host.props.value);
|
|
167
|
+
const externalMonthChanged = externalValueTracker(host.props.month);
|
|
163
168
|
const stop = host.effect(() => {
|
|
164
169
|
const value = host.props.value.value;
|
|
165
170
|
const month = host.props.month.value;
|
|
166
|
-
if (value
|
|
167
|
-
externalValue = value;
|
|
171
|
+
if (externalValueChanged(value)) {
|
|
168
172
|
if (host.state.current !== value) {
|
|
169
173
|
host.state.current = value;
|
|
170
174
|
if (!month && value) host.state.visibleMonth = value.slice(0, 7);
|
|
171
175
|
}
|
|
172
176
|
}
|
|
173
|
-
if (month
|
|
177
|
+
if (externalMonthChanged(month)) host.state.visibleMonth = month;
|
|
174
178
|
});
|
|
175
179
|
return () => {
|
|
176
180
|
connected = false; cancelAnimationFrame(frame); stop();
|
|
@@ -22,7 +22,6 @@ export function connect(host) {
|
|
|
22
22
|
let signature;
|
|
23
23
|
const externalChanged = externalValueTracker(host.element);
|
|
24
24
|
let lastValidation;
|
|
25
|
-
let validityMessage = "";
|
|
26
25
|
let trigger = "programmatic";
|
|
27
26
|
const blocked = () => editor.matches(":disabled") || editor.readOnly;
|
|
28
27
|
const write = text => { if (editor.value !== text) editor.value = text; };
|
|
@@ -35,12 +34,8 @@ export function connect(host) {
|
|
|
35
34
|
}
|
|
36
35
|
catch { write(current); }
|
|
37
36
|
};
|
|
38
|
-
// Input's generated prop checks refresh native validity during rendering. Reapply
|
|
39
|
-
// the domain error after that flush as well as immediately for synchronous submit.
|
|
40
37
|
const setValidity = message => {
|
|
41
|
-
validityMessage = message;
|
|
42
38
|
editor.setCustomValidity(message);
|
|
43
|
-
queueMicrotask(() => { if (connected) editor.setCustomValidity(validityMessage); });
|
|
44
39
|
};
|
|
45
40
|
const validate = (value, announce = false) => {
|
|
46
41
|
let message = "";
|
|
@@ -17,10 +17,18 @@ function ensureOpen(members) {
|
|
|
17
17
|
pendingGroups.add(members);
|
|
18
18
|
queueMicrotask(() => {
|
|
19
19
|
pendingGroups.delete(members);
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
// Connection can finish out of order. Native document order owns the automatic choice;
|
|
21
|
+
// an authored or user-selected open member keeps ownership when another member connects.
|
|
22
|
+
const current = [...members].sort((a, b) => {
|
|
23
|
+
const position = a.element.compareDocumentPosition(b.element);
|
|
24
|
+
if (position & a.element.DOCUMENT_POSITION_DISCONNECTED) return 0;
|
|
25
|
+
return position & a.element.DOCUMENT_POSITION_FOLLOWING ? -1 : position & a.element.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
26
|
+
});
|
|
27
|
+
if (!current.some(member => member.required()) || current.some(member => member.isOpen() && !member.automatic)) return;
|
|
22
28
|
const candidate = current.find(member => !member.disabled()) || current[0];
|
|
23
|
-
candidate?.
|
|
29
|
+
if (candidate?.isOpen()) return;
|
|
30
|
+
for (const member of current) if (member.isOpen()) member.close("programmatic", "programmatic");
|
|
31
|
+
candidate?.open(true);
|
|
24
32
|
});
|
|
25
33
|
}
|
|
26
34
|
|
|
@@ -75,11 +83,14 @@ export function connect(host) {
|
|
|
75
83
|
});
|
|
76
84
|
};
|
|
77
85
|
const member = {
|
|
86
|
+
element: host.element,
|
|
87
|
+
automatic: false,
|
|
78
88
|
isOpen: () => Boolean(host.state.internalOpen),
|
|
79
89
|
required: () => Boolean(host.props.requiredOpen.value),
|
|
80
90
|
disabled: () => Boolean(host.props.disabled.value),
|
|
81
|
-
open() {
|
|
91
|
+
open(automatic = false) {
|
|
82
92
|
if (disposed || host.state.internalOpen) return;
|
|
93
|
+
member.automatic = automatic;
|
|
83
94
|
animateFillTakeover();
|
|
84
95
|
host.state.internalOpen = true;
|
|
85
96
|
syncGroup("programmatic", "programmatic");
|
|
@@ -87,6 +98,7 @@ export function connect(host) {
|
|
|
87
98
|
},
|
|
88
99
|
close(reason, how) {
|
|
89
100
|
if (!host.state.internalOpen) return;
|
|
101
|
+
member.automatic = false;
|
|
90
102
|
animateFillTakeover();
|
|
91
103
|
host.state.internalOpen = false;
|
|
92
104
|
host.dispatch("close", { open: false, reason, trigger: how });
|
|
@@ -111,6 +123,7 @@ export function connect(host) {
|
|
|
111
123
|
};
|
|
112
124
|
const stop = host.effect(() => {
|
|
113
125
|
if (host.props.open.value !== external) {
|
|
126
|
+
member.automatic = false;
|
|
114
127
|
external = host.props.open.value;
|
|
115
128
|
if (external || mayClose()) {
|
|
116
129
|
animateFillTakeover();
|
|
@@ -126,6 +139,7 @@ export function connect(host) {
|
|
|
126
139
|
});
|
|
127
140
|
const onClick = () => {
|
|
128
141
|
if (host.props.disabled.value) return;
|
|
142
|
+
member.automatic = false;
|
|
129
143
|
const open = !host.state.internalOpen;
|
|
130
144
|
if (!open && !mayClose()) return;
|
|
131
145
|
const how = trigger();
|
|
@@ -136,6 +150,7 @@ export function connect(host) {
|
|
|
136
150
|
};
|
|
137
151
|
const onBeforematch = () => queueMicrotask(() => {
|
|
138
152
|
if (disposed || host.state.internalOpen) return;
|
|
153
|
+
member.automatic = false;
|
|
139
154
|
animateFillTakeover();
|
|
140
155
|
host.state.internalOpen = true;
|
|
141
156
|
syncGroup("programmatic", "programmatic");
|
|
@@ -63,6 +63,11 @@ export function connect(host) {
|
|
|
63
63
|
element.addEventListener("click", onClick);
|
|
64
64
|
element.addEventListener("keydown", onKeyDown);
|
|
65
65
|
element.addEventListener("submit", onSubmit);
|
|
66
|
+
// Native fields retain edits made while the component's controller module was loading.
|
|
67
|
+
const destination = element.querySelector("[data-link-destination]")?.value;
|
|
68
|
+
const text = element.querySelector("[data-link-text]")?.value;
|
|
69
|
+
if (destination !== undefined && destination !== String(host.props.value.value ?? "")) host.dispatch("destination", { value: destination });
|
|
70
|
+
if (text !== undefined && text !== String(host.props.text.value ?? "")) host.dispatch("text", { text });
|
|
66
71
|
return () => {
|
|
67
72
|
element.removeEventListener("command", onCommand);
|
|
68
73
|
cancelActiveItemReveal(element);
|
|
@@ -30,9 +30,8 @@
|
|
|
30
30
|
box-shadow: inset 0 0 0 1px var(--ui-accent-soft);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
/* A slotted Avatar
|
|
34
|
-
|
|
35
|
-
:host .avatar:has(> :is([data-component~="ui-avatar"], .ui-avatar)) {
|
|
33
|
+
/* A slotted Avatar supplies its own circle. */
|
|
34
|
+
:host .avatar:has(> [component~="ui-avatar"]) {
|
|
36
35
|
background: none;
|
|
37
36
|
box-shadow: none;
|
|
38
37
|
}
|
|
@@ -41,7 +41,12 @@
|
|
|
41
41
|
></prop>
|
|
42
42
|
</event>
|
|
43
43
|
</defs>
|
|
44
|
-
<div
|
|
44
|
+
<div
|
|
45
|
+
role="menu"
|
|
46
|
+
popover="manual"
|
|
47
|
+
from:aria-label="$scope = 'column' ? 'Column actions' : $scope = 'row' ? 'Row actions' : 'Cell actions'"
|
|
48
|
+
from:hidden="not $open"
|
|
49
|
+
>
|
|
45
50
|
<div $if="$swatches" class="section" role="none">
|
|
46
51
|
<div class="heading" role="presentation">Cell background</div>
|
|
47
52
|
<div class="swatches" role="group" aria-label="Cell background">
|
|
@@ -80,6 +85,10 @@
|
|
|
80
85
|
</template>
|
|
81
86
|
</div>
|
|
82
87
|
<style>
|
|
88
|
+
:host[popover]:not(:popover-open) {
|
|
89
|
+
display: none !important;
|
|
90
|
+
}
|
|
91
|
+
|
|
83
92
|
:host[popover] {
|
|
84
93
|
position: fixed;
|
|
85
94
|
inset: auto;
|
|
@@ -23,7 +23,6 @@ export function connect(host) {
|
|
|
23
23
|
validity = message;
|
|
24
24
|
host.state.invalidSelection = Boolean(message);
|
|
25
25
|
input.setCustomValidity(message);
|
|
26
|
-
queueMicrotask(() => { if (connected) input.setCustomValidity(validity); });
|
|
27
26
|
};
|
|
28
27
|
const validate = (announce = false) => {
|
|
29
28
|
const previous = validity;
|
|
@@ -45,7 +44,6 @@ export function connect(host) {
|
|
|
45
44
|
writeFiles(selected);
|
|
46
45
|
host.state.error = message;
|
|
47
46
|
input.setCustomValidity(validity);
|
|
48
|
-
queueMicrotask(() => { if (connected) input.setCustomValidity(validity); });
|
|
49
47
|
host.dispatch("reject", { files, message });
|
|
50
48
|
return;
|
|
51
49
|
}
|
|
@@ -136,6 +136,7 @@
|
|
|
136
136
|
}
|
|
137
137
|
.list button[aria-selected="true"],
|
|
138
138
|
.list > :slotted(button[slot="tab"][aria-selected="true"]) {
|
|
139
|
+
background: var(--ui-accent-subtle);
|
|
139
140
|
color: var(--ui-accent-subtle-text);
|
|
140
141
|
border-block-end-color: var(--ui-accent-subtle-text);
|
|
141
142
|
}
|
|
@@ -74,56 +74,35 @@
|
|
|
74
74
|
|
|
75
75
|
/* The label and the shortcut sit side by side, a gap apart, with the label wrapping on its own. */
|
|
76
76
|
.surface {
|
|
77
|
-
--_tooltip-line: var(--_ui-tooltip-border, var(--ui-overlay-border, var(--ui-border
|
|
77
|
+
--_tooltip-line: var(--_ui-tooltip-border, var(--ui-overlay-border, var(--ui-border)));
|
|
78
78
|
position: relative;
|
|
79
79
|
display: flex !important;
|
|
80
80
|
align-items: baseline !important;
|
|
81
|
-
gap: var(--ui-space-
|
|
81
|
+
gap: var(--ui-space-1) !important;
|
|
82
82
|
box-sizing: border-box !important;
|
|
83
83
|
max-inline-size: var(--_ui-tooltip-max-inline-size, 18rem);
|
|
84
84
|
border: var(--ui-border-width) solid var(--_tooltip-line);
|
|
85
|
-
border-radius: var(--_ui-tooltip-radius, var(--ui-overlay-radius, var(--ui-radius-
|
|
85
|
+
border-radius: var(--_ui-tooltip-radius, var(--ui-overlay-radius, var(--ui-radius-sm)));
|
|
86
86
|
background: var(--_ui-tooltip-surface, var(--ui-overlay-surface, var(--ui-surface-elevated)));
|
|
87
87
|
color: var(--_ui-tooltip-text, var(--ui-text-primary));
|
|
88
|
-
padding: var(--ui-space-
|
|
88
|
+
padding: var(--ui-space-1) var(--ui-space-2) !important;
|
|
89
89
|
font-family: var(--ui-font-family-sans);
|
|
90
|
-
font-size: var(--ui-font-size-
|
|
90
|
+
font-size: var(--ui-font-size-xs);
|
|
91
91
|
line-height: var(--ui-line-height-tight);
|
|
92
|
-
box-shadow: var(--_ui-tooltip-shadow, var(--ui-overlay-shadow, var(--ui-elevation-tooltip, var(--ui-shadow-
|
|
92
|
+
box-shadow: var(--_ui-tooltip-shadow, var(--ui-overlay-shadow, var(--ui-elevation-tooltip, var(--ui-shadow-sm))));
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
/*
|
|
96
|
-
|
|
95
|
+
/* A hint keeps one edge and a quiet lift. The shared palette supplies its tint;
|
|
96
|
+
the nearly opaque label plane and matching arrow remain readable over content. */
|
|
97
97
|
.surface {
|
|
98
98
|
--_ui-material-glassiness: clamp(0, var(--ui-glassiness, 0), 1);
|
|
99
|
-
--_ui-material-separation: clamp(0, var(--ui-surface-separation, 0), 1);
|
|
100
|
-
--_ui-material-active: clamp(0, calc(var(--_ui-material-separation) * 100000), 1);
|
|
101
|
-
--_ui-material-rim: calc(var(--_ui-material-separation) * var(--_ui-material-scale, 0.08) * 8px);
|
|
102
99
|
--_ui-material-content-color: var(
|
|
103
100
|
--_ui-tooltip-surface,
|
|
104
|
-
var(--
|
|
101
|
+
var(--ui-material-content, var(--ui-overlay-surface, var(--ui-surface-elevated)))
|
|
105
102
|
);
|
|
106
|
-
--_ui-material-rim-color: color-mix(in srgb, var(--ui-material-glass, var(--ui-surface-elevated)) calc(var(--_ui-material-active) * 100%), transparent);
|
|
107
103
|
background:
|
|
108
|
-
var(--ui-material-highlight, var(--ui-surface-highlight, linear-gradient(transparent, transparent))) padding-box,
|
|
109
104
|
linear-gradient(var(--_ui-material-content-color), var(--_ui-material-content-color)) padding-box,
|
|
110
|
-
linear-gradient(
|
|
111
|
-
border-width: calc(var(--ui-border-width) + var(--_ui-material-rim));
|
|
112
|
-
border-color: var(
|
|
113
|
-
--_ui-tooltip-border,
|
|
114
|
-
color-mix(in oklab, var(--ui-overlay-border, var(--ui-border-strong)) calc((1 - var(--_ui-material-active)) * 100%), transparent)
|
|
115
|
-
);
|
|
116
|
-
box-shadow: var(
|
|
117
|
-
--_ui-tooltip-shadow,
|
|
118
|
-
var(
|
|
119
|
-
--ui-overlay-shadow,
|
|
120
|
-
0 calc(var(--_ui-material-separation) * var(--_ui-material-scale, 0.08) * 8px) calc(
|
|
121
|
-
var(--_ui-material-separation) * var(--_ui-material-scale, 0.08) * 24px
|
|
122
|
-
) color-mix(in oklab, var(--ui-text-primary) 15%, transparent),
|
|
123
|
-
inset 0 0 0 calc(var(--_ui-material-active) * var(--ui-border-width)) var(--ui-material-edge, var(--ui-border-strong)),
|
|
124
|
-
var(--ui-elevation-tooltip, var(--ui-shadow-md))
|
|
125
|
-
)
|
|
126
|
-
);
|
|
105
|
+
linear-gradient(transparent, transparent) border-box;
|
|
127
106
|
-webkit-backdrop-filter: blur(calc(var(--_ui-material-glassiness) * var(--_ui-material-scale, 0.08) * 32px));
|
|
128
107
|
backdrop-filter: blur(calc(var(--_ui-material-glassiness) * var(--_ui-material-scale, 0.08) * 32px));
|
|
129
108
|
}
|
|
@@ -160,7 +139,7 @@
|
|
|
160
139
|
padding-inline-start: var(--ui-space-2) !important;
|
|
161
140
|
border-inline-start: 1px solid color-mix(in oklab, currentColor 28%, transparent);
|
|
162
141
|
color: color-mix(in oklab, currentColor 72%, transparent);
|
|
163
|
-
font-size: var(--ui-font-size-
|
|
142
|
+
font-size: var(--ui-font-size-2xs);
|
|
164
143
|
font-weight: var(--ui-font-normal);
|
|
165
144
|
white-space: nowrap;
|
|
166
145
|
vertical-align: baseline;
|