@spectrum-web-components/overlay 0.34.1-rc.0 → 0.35.1-rc.15
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 +17 -8
- package/custom-elements.json +492 -305
- package/package.json +14 -13
- package/src/AbstractOverlay.d.ts +54 -0
- package/src/AbstractOverlay.dev.js +192 -0
- package/src/AbstractOverlay.dev.js.map +7 -0
- package/src/AbstractOverlay.js +2 -0
- package/src/AbstractOverlay.js.map +7 -0
- package/src/Overlay.d.ts +135 -19
- package/src/Overlay.dev.js +714 -69
- package/src/Overlay.dev.js.map +3 -3
- package/src/Overlay.js +30 -1
- package/src/Overlay.js.map +3 -3
- package/src/OverlayDialog.d.ts +3 -7
- package/src/OverlayDialog.dev.js +6 -34
- package/src/OverlayDialog.dev.js.map +2 -2
- package/src/OverlayDialog.js +1 -1
- package/src/OverlayDialog.js.map +3 -3
- package/src/OverlayNoPopover.d.ts +3 -7
- package/src/OverlayNoPopover.dev.js +7 -46
- package/src/OverlayNoPopover.dev.js.map +2 -2
- package/src/OverlayNoPopover.js +1 -1
- package/src/OverlayNoPopover.js.map +3 -3
- package/src/OverlayPopover.d.ts +3 -7
- package/src/OverlayPopover.dev.js +18 -49
- package/src/OverlayPopover.dev.js.map +2 -2
- package/src/OverlayPopover.js +1 -1
- package/src/OverlayPopover.js.map +3 -3
- package/src/OverlayStack.d.ts +9 -2
- package/src/OverlayStack.dev.js +16 -3
- package/src/OverlayStack.dev.js.map +2 -2
- package/src/OverlayStack.js +1 -1
- package/src/OverlayStack.js.map +3 -3
- package/src/OverlayTrigger.d.ts +6 -14
- package/src/OverlayTrigger.dev.js +0 -47
- package/src/OverlayTrigger.dev.js.map +2 -2
- package/src/OverlayTrigger.js +2 -2
- package/src/OverlayTrigger.js.map +3 -3
- package/src/PlacementController.d.ts +3 -1
- package/src/PlacementController.dev.js +10 -2
- package/src/PlacementController.dev.js.map +2 -2
- package/src/PlacementController.js +1 -1
- package/src/PlacementController.js.map +2 -2
- package/src/VirtualTrigger.dev.js +3 -0
- package/src/VirtualTrigger.dev.js.map +2 -2
- package/src/VirtualTrigger.js +1 -1
- package/src/VirtualTrigger.js.map +3 -3
- package/src/fullSizePlugin.dev.js.map +2 -2
- package/src/fullSizePlugin.js.map +2 -2
- package/src/loader.d.ts +1 -2
- package/src/overlay-timer.dev.js.map +2 -2
- package/src/overlay-timer.js.map +2 -2
- package/src/overlay-types.d.ts +18 -27
- package/src/overlay-types.dev.js.map +2 -2
- package/src/overlay-types.js.map +2 -2
- package/src/overlay.css.dev.js +9 -0
- package/src/overlay.css.dev.js.map +7 -0
- package/src/overlay.css.js +6 -0
- package/src/overlay.css.js.map +7 -0
- package/src/topLayerOverTransforms.d.ts +2 -23
- package/src/topLayerOverTransforms.dev.js +7 -91
- package/src/topLayerOverTransforms.dev.js.map +2 -2
- package/src/topLayerOverTransforms.js +1 -1
- package/src/topLayerOverTransforms.js.map +3 -3
- package/stories/overlay-element.stories.js +2 -6
- package/stories/overlay-element.stories.js.map +2 -2
- package/stories/overlay.stories.js +46 -15
- package/stories/overlay.stories.js.map +2 -2
- package/test/index.js +1 -1
- package/test/index.js.map +1 -1
- package/test/overlay-element.test.js +1 -2
- package/test/overlay-element.test.js.map +2 -2
- package/test/overlay-trigger-hover-click.test.js +1 -1
- package/test/overlay-trigger-hover-click.test.js.map +2 -2
- package/test/overlay-trigger-hover.test.js +1 -1
- package/test/overlay-trigger-hover.test.js.map +2 -2
- package/test/overlay-v1.test.js +2 -11
- package/test/overlay-v1.test.js.map +2 -2
- package/test/{overlay-v2.test.js → overlay.test.js} +42 -8
- package/test/overlay.test.js.map +7 -0
- package/src/OverlayBase.d.ts +0 -124
- package/src/OverlayBase.dev.js +0 -744
- package/src/OverlayBase.dev.js.map +0 -7
- package/src/OverlayBase.js +0 -31
- package/src/OverlayBase.js.map +0 -7
- package/src/overlay-base.css.dev.js +0 -9
- package/src/overlay-base.css.dev.js.map +0 -7
- package/src/overlay-base.css.js +0 -6
- package/src/overlay-base.css.js.map +0 -7
- package/test/overlay-v2.test.js.map +0 -7
- /package/src/{overlay-base.css.d.ts → overlay.css.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
|
|
28
28
|
## Example
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
By leveraging the `trigger` attribute to pass an ID reference to another element with in the same DOM tree, your overlay will be positioned in relation to this element. When the ID reference is followed by an `@` symbol and interaction type, like `click`, `hover`, or `longpress`, the overlay will bind itself to the referenced element via the DOM events associated with that interaction. For example, the `<sp-button>` below has an id of `trigger`, and the `<sp-overlay>` is provided the `trigger` attribute with the value `trigger@click`. This creates an association between the overlay and the `<sp-button>` that opens the overlay when the button is clicked.
|
|
31
31
|
|
|
32
32
|
```html
|
|
33
33
|
<sp-button id="trigger">Overlay Trigger</sp-button>
|
|
@@ -142,7 +142,7 @@ Leveraging the `trigger` attribut to pass an ID reference to another element wit
|
|
|
142
142
|
|
|
143
143
|
## API
|
|
144
144
|
|
|
145
|
-
```
|
|
145
|
+
```ts
|
|
146
146
|
<sp-overlay
|
|
147
147
|
?open=${boolean}
|
|
148
148
|
?delayed=${boolean}
|
|
@@ -156,9 +156,18 @@ Leveraging the `trigger` attribut to pass an ID reference to another element wit
|
|
|
156
156
|
></sp-overlay>
|
|
157
157
|
```
|
|
158
158
|
|
|
159
|
+
# Events
|
|
160
|
+
|
|
161
|
+
When fully open the `<sp-overlay>` element will dispatch the `sp-opened` event, and when fully closed the `sp-closed` event will be dispatched. "Fully" in this context means that all CSS transitions that have dispatched `transitionrun` events on the direct children of the `<sp-overlay>` element have successfully dispatched their `transitionend` event. Keep in mind the following:
|
|
162
|
+
|
|
163
|
+
- `transition*` events bubble; this means that while transition events on light DOM content of those direct children will be heard, those events will not be taken into account
|
|
164
|
+
- `transition*` events are not composed; this means that transition events on shadow DOM content of the direct children will not propagate to a level in the DOM where they can be heard
|
|
165
|
+
|
|
166
|
+
This means that in both cases, if the transition is meant to be a part of the opening or closing of the overlay in question you will need to redispatch the `transitionrun` and `transitionend` events from that transition from the closest direct child of the `<sp-overlay>`.
|
|
167
|
+
|
|
159
168
|
## Styling
|
|
160
169
|
|
|
161
|
-
`<sp-overlay>` element will use the `<dialog>` element or `popover` attribute to project your content onto the top-layer of the browser,
|
|
170
|
+
`<sp-overlay>` element will use the `<dialog>` element or `popover` attribute to project your content onto the top-layer of the browser, without being moved in the DOM tree. That means that you can style your overlay content with whatever techniques you are already leveraging to style the content that doesn't get overlaid. This means standard CSS selectors, CSS Custom Properties, and CSS Parts applied in your parent context will always apply to your overlaid content.
|
|
162
171
|
|
|
163
172
|
## Fallback support
|
|
164
173
|
|
|
@@ -166,7 +175,7 @@ While the [`<dialog>` element](https://developer.mozilla.org/en-US/docs/Web/HTML
|
|
|
166
175
|
|
|
167
176
|
### Complex layered
|
|
168
177
|
|
|
169
|
-
When an overlay is placed within a page with complex layering, the content therein can fall behind other content in the `z-index` stack. The following example is somewhat contrived but, imagine a toolbar next to a properties panel. If the toolbar has a lower `z-index`
|
|
178
|
+
When an overlay is placed within a page with complex layering, the content therein can fall behind other content in the `z-index` stack. The following example is somewhat contrived but, imagine a toolbar next to a properties panel. If the toolbar has a lower `z-index` than the properties panel, any overlaid content (tooltips, etc.) within that toolbar will display underneath any content in the properties panel with which it may share pixels.
|
|
170
179
|
|
|
171
180
|
```html
|
|
172
181
|
<div class="complex-layered-demo">
|
|
@@ -198,11 +207,11 @@ When an overlay is placed within a page with complex layering, the content there
|
|
|
198
207
|
</style>
|
|
199
208
|
```
|
|
200
209
|
|
|
201
|
-
Properly managed `z-index` values will support working around this issue while browsers work to adopt the `popover` attribute. In this demo, you can
|
|
210
|
+
Properly managed `z-index` values will support working around this issue while browsers work to adopt the `popover` attribute. In this demo, you can achieve the same output by sharing one `z-index` between the various pieces of content, removing `z-index` values altogether, or raising the `.complex-layered-holder` element to a higher `z-index` than the `.complex-layered-blocker` element.
|
|
202
211
|
|
|
203
212
|
### Contained
|
|
204
213
|
|
|
205
|
-
[CSS Containment](https://developer.mozilla.org/en-US/docs/Web/CSS/contain)
|
|
214
|
+
[CSS Containment](https://developer.mozilla.org/en-US/docs/Web/CSS/contain) gives a developer direct control over how the internals of one element affect the paint and layout of the internals of other elements on the same page. While leveraging some of its values can offer performance gains, they can interrupt the delivery of your overlaid content.
|
|
206
215
|
|
|
207
216
|
```html
|
|
208
217
|
<div class="contained-demo">
|
|
@@ -220,7 +229,7 @@ Properly managed `z-index` values will support working around this issue while b
|
|
|
220
229
|
</style>
|
|
221
230
|
```
|
|
222
231
|
|
|
223
|
-
You could just _remove_ the `contain` rule. But, if you are not OK with simply removing the `contain` value, you still have options.
|
|
232
|
+
You could just _remove_ the `contain` rule. But, if you are not OK with simply removing the `contain` value, you still have options. If you would like to continue to leverage `contain`, you can place your "contained" content separately from your overlaid content, like so:
|
|
224
233
|
|
|
225
234
|
```html
|
|
226
235
|
<div class="contained-demo">
|
|
@@ -240,7 +249,7 @@ You could just _remove_ the `contain` rule. But, if you are not OK with simply r
|
|
|
240
249
|
|
|
241
250
|
### Clip pathed
|
|
242
251
|
|
|
243
|
-
|
|
252
|
+
`clip-path` can also restrict how content in an element is surfaced at paint time. When overlaid content should display outside of the `clip-path`, without the `popover` attribute, that content could be _clipped_.
|
|
244
253
|
|
|
245
254
|
```html
|
|
246
255
|
<div class="clip-pathed-demo">
|