@spectrum-web-components/overlay
Advanced tools
Comparing version 0.15.2 to 0.15.3-express.6
@@ -135,3 +135,3 @@ { | ||
"type": { | ||
"text": "{\n color?: Color;\n scale?: Scale;\n lang?: string;\n }" | ||
"text": "{\n color?: Color;\n scale?: Scale;\n lang?: string;\n theme?: ThemeVariant;\n }" | ||
}, | ||
@@ -180,3 +180,3 @@ "privacy": "public", | ||
"type": { | ||
"text": "void" | ||
"text": "Promise<void>" | ||
} | ||
@@ -1618,3 +1618,3 @@ } | ||
"type": { | ||
"text": "void" | ||
"text": "Promise<void>" | ||
} | ||
@@ -1886,3 +1886,3 @@ } | ||
"name": "styles", | ||
"default": "css`\n:host([disabled]) ::slotted([slot=trigger]){pointer-events:none}#overlay-content{display:none}\n`" | ||
"default": "css`\n:host([disabled]) ::slotted([slot=trigger]){pointer-events:none}#overlay-content slot{display:none}\n`" | ||
} | ||
@@ -1889,0 +1889,0 @@ ], |
{ | ||
"name": "@spectrum-web-components/overlay", | ||
"version": "0.15.2", | ||
"version": "0.15.3-express.6+374824f06", | ||
"publishConfig": { | ||
@@ -55,3 +55,3 @@ "access": "public" | ||
"@spectrum-web-components/shared": "^0.13.6", | ||
"@spectrum-web-components/theme": "^0.10.1", | ||
"@spectrum-web-components/theme": "^0.10.2-express.6+374824f06", | ||
"tslib": "^2.0.0" | ||
@@ -67,3 +67,3 @@ }, | ||
], | ||
"gitHead": "caf12727e7f91dcf961e1fadacc727eea9ece27b" | ||
"gitHead": "374824f06c36278e67f1616e9eae688b94a306a5" | ||
} |
import { CSSResultArray, PropertyValues, SpectrumElement, TemplateResult } from '@spectrum-web-components/base'; | ||
import type { Color, Scale } from '@spectrum-web-components/theme/src/Theme.js'; | ||
import type { Color, Scale, ThemeVariant } from '@spectrum-web-components/theme/src/Theme.js'; | ||
import { OverlayOpenDetail, Placement, TriggerInteractions } from './overlay-types.js'; | ||
@@ -35,2 +35,3 @@ import type { VirtualTrigger } from './VirtualTrigger.js'; | ||
lang?: string; | ||
theme?: ThemeVariant; | ||
}; | ||
@@ -41,3 +42,3 @@ receivesFocus?: 'auto'; | ||
private restoreContent?; | ||
focus(): void; | ||
focus(): Promise<void>; | ||
private get hasTheme(); | ||
@@ -44,0 +45,0 @@ offset: number; |
@@ -189,6 +189,13 @@ /* | ||
} | ||
focus() { | ||
async focus() { | ||
const firstFocusable = firstFocusableIn(this); | ||
if (firstFocusable) { | ||
firstFocusable.focus(); | ||
if (firstFocusable.updateComplete) { | ||
await firstFocusable.updateComplete; | ||
} | ||
const activeElement = this.getRootNode() | ||
.activeElement; | ||
if (activeElement === this || !this.contains(activeElement)) { | ||
firstFocusable.focus(); | ||
} | ||
/* c8 ignore next 3 */ | ||
@@ -274,3 +281,3 @@ } | ||
if (this.receivesFocus) { | ||
this.focus(); | ||
await this.focus(); | ||
} | ||
@@ -379,5 +386,6 @@ this.trigger.dispatchEvent(new CustomEvent('sp-opened', { | ||
renderTheme(content) { | ||
const { color, scale, lang } = this.theme; | ||
const { color, scale, lang, theme } = this.theme; | ||
return html ` | ||
<sp-theme | ||
theme=${ifDefined(theme)} | ||
color=${ifDefined(color)} | ||
@@ -384,0 +392,0 @@ scale=${ifDefined(scale)} |
@@ -359,3 +359,3 @@ /* | ||
} | ||
manageFocusAfterCloseWhenOverlaysRemain() { | ||
async manageFocusAfterCloseWhenOverlaysRemain() { | ||
const topOverlay = this.overlays[this.overlays.length - 1]; | ||
@@ -365,3 +365,3 @@ topOverlay.feature(); | ||
if (topOverlay.interaction === 'modal' || topOverlay.hasModalRoot) { | ||
topOverlay.focus(); | ||
await topOverlay.focus(); | ||
} | ||
@@ -430,3 +430,3 @@ else { | ||
if (this.overlays.length) { | ||
this.manageFocusAfterCloseWhenOverlaysRemain(); | ||
await this.manageFocusAfterCloseWhenOverlaysRemain(); | ||
} | ||
@@ -433,0 +433,0 @@ else { |
@@ -14,5 +14,5 @@ /* | ||
const styles = css ` | ||
:host([disabled]) ::slotted([slot=trigger]){pointer-events:none}#overlay-content{display:none} | ||
:host([disabled]) ::slotted([slot=trigger]){pointer-events:none}#overlay-content slot{display:none} | ||
`; | ||
export default styles; | ||
//# sourceMappingURL=overlay-trigger.css.js.map |
@@ -77,2 +77,3 @@ /* | ||
lang: undefined, | ||
theme: undefined, | ||
}; | ||
@@ -79,0 +80,0 @@ const queryThemeEvent = new CustomEvent('sp-query-theme', { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 2 instances in 1 package
745413
75
7916
11
1