@warp-ds/elements 2.11.0-next.1 → 2.12.0-next.1
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/dist/custom-elements.json +326 -0
- package/dist/docs/index.md +1 -0
- package/dist/docs/modal/modal.md +1 -0
- package/dist/docs/modal/styling.md +1 -0
- package/dist/docs/textfield/api.md +12 -0
- package/dist/docs/textfield/textfield.md +12 -0
- package/dist/docs/tooltip/accessibility.md +9 -0
- package/dist/docs/tooltip/api.md +87 -0
- package/dist/docs/tooltip/examples.md +32 -0
- package/dist/docs/tooltip/styling.md +47 -0
- package/dist/docs/tooltip/tooltip.md +197 -0
- package/dist/docs/tooltip/usage.md +10 -0
- package/dist/entrypoint-react.d.ts +1 -0
- package/dist/entrypoint-react.js +1 -0
- package/dist/index.d.ts +163 -0
- package/dist/packages/affix/affix.js +3 -3
- package/dist/packages/affix/affix.js.map +2 -2
- package/dist/packages/affix/styles.js +1 -1
- package/dist/packages/attention/attention.stories.js +5 -1
- package/dist/packages/modal/modal.d.ts +1 -0
- package/dist/packages/modal/modal.js +5 -1
- package/dist/packages/modal/modal.js.map +2 -2
- package/dist/packages/modal/modal.react.stories.d.ts +1 -1
- package/dist/packages/modal/react.d.ts +13 -5
- package/dist/packages/modal/react.js +10 -4
- package/dist/packages/modal/styles.js +5 -1
- package/dist/packages/modal-footer/react.d.ts +2 -1
- package/dist/packages/modal-footer/react.js +11 -5
- package/dist/packages/modal-header/react.js +1 -0
- package/dist/packages/select/select.js +1 -1
- package/dist/packages/select/select.js.map +2 -2
- package/dist/packages/select/styles.js +1 -1
- package/dist/packages/tab/react.d.ts +1 -0
- package/dist/packages/tab/react.js +2 -1
- package/dist/packages/tabs/tabs.js +4 -4
- package/dist/packages/tabs/tabs.js.map +3 -3
- package/dist/packages/tabs/tabs.react.stories.js +5 -5
- package/dist/packages/textarea/styles.js +1 -1
- package/dist/packages/textarea/textarea.js +6 -6
- package/dist/packages/textarea/textarea.js.map +2 -2
- package/dist/packages/textfield/input-styles.js +1 -1
- package/dist/packages/textfield/react.d.ts +1 -1
- package/dist/packages/textfield/styles.js +1 -1
- package/dist/packages/textfield/textfield.d.ts +8 -0
- package/dist/packages/textfield/textfield.js +32 -15
- package/dist/packages/textfield/textfield.js.map +3 -3
- package/dist/packages/textfield/textfield.react.stories.d.ts +2 -2
- package/dist/packages/tooltip/locales/da/messages.d.mts +1 -0
- package/dist/packages/tooltip/locales/da/messages.mjs +1 -0
- package/dist/packages/tooltip/locales/en/messages.d.mts +1 -0
- package/dist/packages/tooltip/locales/en/messages.mjs +1 -0
- package/dist/packages/tooltip/locales/fi/messages.d.mts +1 -0
- package/dist/packages/tooltip/locales/fi/messages.mjs +1 -0
- package/dist/packages/tooltip/locales/nb/messages.d.mts +1 -0
- package/dist/packages/tooltip/locales/nb/messages.mjs +1 -0
- package/dist/packages/tooltip/locales/sv/messages.d.mts +1 -0
- package/dist/packages/tooltip/locales/sv/messages.mjs +1 -0
- package/dist/packages/tooltip/react.d.ts +16 -0
- package/dist/packages/tooltip/react.js +28 -0
- package/dist/packages/tooltip/styles.d.ts +1 -0
- package/dist/packages/tooltip/styles.js +66 -0
- package/dist/packages/tooltip/tooltip.d.ts +72 -0
- package/dist/packages/tooltip/tooltip.hydration.test.d.ts +1 -0
- package/dist/packages/tooltip/tooltip.hydration.test.js +13 -0
- package/dist/packages/tooltip/tooltip.js +2528 -0
- package/dist/packages/tooltip/tooltip.js.map +7 -0
- package/dist/packages/tooltip/tooltip.react.stories.d.ts +12 -0
- package/dist/packages/tooltip/tooltip.react.stories.js +12 -0
- package/dist/packages/tooltip/tooltip.stories.d.ts +17 -0
- package/dist/packages/tooltip/tooltip.stories.js +115 -0
- package/dist/packages/tooltip/tooltip.test.d.ts +2 -0
- package/dist/packages/tooltip/tooltip.test.js +130 -0
- package/dist/web-types.json +89 -2
- package/eik/index.js +19 -19
- package/package.json +2 -1
|
@@ -3,7 +3,7 @@ import React from "react";
|
|
|
3
3
|
import { TextField } from "./react";
|
|
4
4
|
declare const _default: {
|
|
5
5
|
title: string;
|
|
6
|
-
render(args: Omit<Omit<Omit<React.HTMLAttributes<import("./textfield").WarpTextField>, "autocomplete" | "name" | "type" | "disabled" | "invalid" | "label" | "helpText" | "optional" | "size" | "max" | "min" | "minLength" | "minlength" | "maxLength" | "maxlength" | "pattern" | "placeholder" | "readOnly" | "readonly" | "required" | "value" | "step" | "formatter" | "mask" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "onblur" | "onchange" | "onfocus" | "oninput" | "_hasPrefix" | "_hasSuffix" | "updated" | "firstUpdated" | "resetFormControl" | "_inputstyles" | "_helptextstyles" | "_label" | "_helpId" | "_id" | "_error" | "handler" | "prefixSlotChange" | "suffixSlotChange" | "render" | "validationTarget" | "form" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "renderOptions" | "onFocus" | "onBlur" | "onChange" | "onInput"> & {
|
|
6
|
+
render(args: Omit<Omit<Omit<React.HTMLAttributes<import("./textfield").WarpTextField>, "autocomplete" | "name" | "type" | "disabled" | "invalid" | "label" | "helpText" | "optional" | "size" | "max" | "min" | "minLength" | "minlength" | "maxLength" | "maxlength" | "pattern" | "placeholder" | "readOnly" | "readonly" | "required" | "value" | "step" | "tooltip" | "formatter" | "mask" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "onblur" | "onchange" | "onfocus" | "oninput" | "_hasPrefix" | "_hasSuffix" | "updated" | "firstUpdated" | "resetFormControl" | "_inputstyles" | "_helptextstyles" | "_label" | "_helpId" | "_id" | "_error" | "handler" | "prefixSlotChange" | "suffixSlotChange" | "render" | "validationTarget" | "form" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "renderOptions" | "onFocus" | "onBlur" | "onChange" | "onInput"> & {
|
|
7
7
|
onBlur?: ((e: FocusEvent) => void) | undefined;
|
|
8
8
|
onblur?: ((e: FocusEvent) => void) | undefined;
|
|
9
9
|
onChange?: ((e: import("../types").ChangeEventWithTarget<HTMLInputElement>) => void) | undefined;
|
|
@@ -18,7 +18,7 @@ declare const _default: {
|
|
|
18
18
|
maxLength?: number;
|
|
19
19
|
readOnly?: boolean;
|
|
20
20
|
} & React.RefAttributes<import("./textfield").WarpTextField>): React.JSX.Element;
|
|
21
|
-
component: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.HTMLAttributes<import("./textfield").WarpTextField>, "autocomplete" | "name" | "type" | "disabled" | "invalid" | "label" | "helpText" | "optional" | "size" | "max" | "min" | "minLength" | "minlength" | "maxLength" | "maxlength" | "pattern" | "placeholder" | "readOnly" | "readonly" | "required" | "value" | "step" | "formatter" | "mask" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "onblur" | "onchange" | "onfocus" | "oninput" | "_hasPrefix" | "_hasSuffix" | "updated" | "firstUpdated" | "resetFormControl" | "_inputstyles" | "_helptextstyles" | "_label" | "_helpId" | "_id" | "_error" | "handler" | "prefixSlotChange" | "suffixSlotChange" | "render" | "validationTarget" | "form" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "renderOptions" | "onFocus" | "onBlur" | "onChange" | "onInput"> & {
|
|
21
|
+
component: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.HTMLAttributes<import("./textfield").WarpTextField>, "autocomplete" | "name" | "type" | "disabled" | "invalid" | "label" | "helpText" | "optional" | "size" | "max" | "min" | "minLength" | "minlength" | "maxLength" | "maxlength" | "pattern" | "placeholder" | "readOnly" | "readonly" | "required" | "value" | "step" | "tooltip" | "formatter" | "mask" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "onblur" | "onchange" | "onfocus" | "oninput" | "_hasPrefix" | "_hasSuffix" | "updated" | "firstUpdated" | "resetFormControl" | "_inputstyles" | "_helptextstyles" | "_label" | "_helpId" | "_id" | "_error" | "handler" | "prefixSlotChange" | "suffixSlotChange" | "render" | "validationTarget" | "form" | "internals" | "showError" | "validationMessage" | "validity" | "validationComplete" | "checkValidity" | "formResetCallback" | "valueChangedCallback" | "validityCallback" | "validationMessageCallback" | "setValue" | "shouldFormValueUpdate" | "renderOptions" | "onFocus" | "onBlur" | "onChange" | "onInput"> & {
|
|
22
22
|
onBlur?: ((e: FocusEvent) => void) | undefined;
|
|
23
23
|
onblur?: ((e: FocusEvent) => void) | undefined;
|
|
24
24
|
onChange?: ((e: import("../types").ChangeEventWithTarget<HTMLInputElement>) => void) | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const messages: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*eslint-disable*/ export const messages = JSON.parse("{\"tooltip.aria.description\":[\"En sort taleboble med flere oplysninger\"],\"tooltip.aria.pointingDown\":[\"peger nedad\"],\"tooltip.aria.pointingLeft\":[\"peger til venstre\"],\"tooltip.aria.pointingRight\":[\"peger til højre\"],\"tooltip.aria.pointingUp\":[\"peger opad\"]}");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const messages: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*eslint-disable*/ export const messages = JSON.parse("{\"tooltip.aria.description\":[\"A black speech bubble providing complementary information\"],\"tooltip.aria.pointingDown\":[\"pointing down\"],\"tooltip.aria.pointingLeft\":[\"pointing left\"],\"tooltip.aria.pointingRight\":[\"pointing right\"],\"tooltip.aria.pointingUp\":[\"pointing up\"]}");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const messages: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*eslint-disable*/ export const messages = JSON.parse("{\"tooltip.aria.description\":[\"Musta puhekupla, joka tarjoaa täydentävää tietoa\"],\"tooltip.aria.pointingDown\":[\"osoittaa alas\"],\"tooltip.aria.pointingLeft\":[\"osoittaa vasemmalle\"],\"tooltip.aria.pointingRight\":[\"osoittaa oikealle\"],\"tooltip.aria.pointingUp\":[\"osoittaa ylös\"]}");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const messages: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*eslint-disable*/ export const messages = JSON.parse("{\"tooltip.aria.description\":[\"En svart taleboble som forklarer konteksten\"],\"tooltip.aria.pointingDown\":[\"peker ned\"],\"tooltip.aria.pointingLeft\":[\"peker til venstre\"],\"tooltip.aria.pointingRight\":[\"peker til høyre\"],\"tooltip.aria.pointingUp\":[\"peker opp\"]}");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const messages: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*eslint-disable*/ export const messages = JSON.parse("{\"tooltip.aria.description\":[\"En svart pratbubbla som ger kompletterande information\"],\"tooltip.aria.pointingDown\":[\"pekar ned\"],\"tooltip.aria.pointingLeft\":[\"pekar vänster\"],\"tooltip.aria.pointingRight\":[\"pekar höger\"],\"tooltip.aria.pointingUp\":[\"pekar upp\"]}");
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { WarpTooltip } from "./tooltip.js";
|
|
3
|
+
/**
|
|
4
|
+
* A tooltip is a message box that is displayed when a user hovers over or gives focus to a UI element.
|
|
5
|
+
*
|
|
6
|
+
* Tooltips should be used sparingly and contain succinct, supplementary information.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```html
|
|
10
|
+
* <Button id="my-button" aria-labelledby="my-tooltip">Hover over me</Button>
|
|
11
|
+
* <Tooltip id="my-tooltip" htmlFor="my-button">I am a tooltip</Tooltip>
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const Tooltip: React.ForwardRefExoticComponent<Omit<Omit<React.HTMLAttributes<WarpTooltip>, "open" | "renderRoot" | "isUpdatePending" | "hasUpdated" | "addController" | "removeController" | "connectedCallback" | "disconnectedCallback" | "attributeChangedCallback" | "requestUpdate" | "updateComplete" | "firstUpdated" | "render" | "renderOptions" | "show" | "hide" | "placement" | "noArrow" | "for" | "showDelay" | "hideDelay"> & {} & Partial<Omit<WarpTooltip, keyof HTMLElement>> & React.RefAttributes<WarpTooltip>, "ref"> & {
|
|
15
|
+
htmlFor?: string;
|
|
16
|
+
} & React.RefAttributes<WarpTooltip>>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createComponent } from "@lit/react";
|
|
2
|
+
import { LitElement } from "lit";
|
|
3
|
+
import React from "react";
|
|
4
|
+
// decouple from CDN by providing a dummy class
|
|
5
|
+
class Component extends LitElement {
|
|
6
|
+
}
|
|
7
|
+
const BaseTooltip = createComponent({
|
|
8
|
+
tagName: "w-tooltip",
|
|
9
|
+
elementClass: Component,
|
|
10
|
+
react: React,
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* A tooltip is a message box that is displayed when a user hovers over or gives focus to a UI element.
|
|
14
|
+
*
|
|
15
|
+
* Tooltips should be used sparingly and contain succinct, supplementary information.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```html
|
|
19
|
+
* <Button id="my-button" aria-labelledby="my-tooltip">Hover over me</Button>
|
|
20
|
+
* <Tooltip id="my-tooltip" htmlFor="my-button">I am a tooltip</Tooltip>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export const Tooltip = React.forwardRef(({ htmlFor, ...props }, ref) => React.createElement(BaseTooltip, {
|
|
24
|
+
for: htmlFor,
|
|
25
|
+
...props,
|
|
26
|
+
ref,
|
|
27
|
+
}));
|
|
28
|
+
Tooltip.displayName = "Tooltip";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
--_background-color: var(
|
|
5
|
+
--w-c-tooltip-bg,
|
|
6
|
+
var(--w-color-tooltip-background-static)
|
|
7
|
+
);
|
|
8
|
+
--_box-shadow: var(--w-c-tooltip-box-shadow, var(--w-shadow-m));
|
|
9
|
+
--_color: var(--w-c-tooltip-color, var(--w-s-color-text-inverted-static));
|
|
10
|
+
--_z-index: var(--w-c-tooltip-z-index, 30);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
[part="tooltip"] {
|
|
14
|
+
box-shadow: var(--_box-shadow);
|
|
15
|
+
width: max-content;
|
|
16
|
+
position: absolute;
|
|
17
|
+
top: 0;
|
|
18
|
+
left: 0;
|
|
19
|
+
background: var(--_background-color);
|
|
20
|
+
color: var(--_color);
|
|
21
|
+
padding: 6px 8px;
|
|
22
|
+
border-radius: 4px;
|
|
23
|
+
font-size: var(--w-font-size-s);
|
|
24
|
+
font-weight: 400;
|
|
25
|
+
line-height: var(--w-line-height-s);
|
|
26
|
+
z-index: var(--_z-index);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[part="arrow"] {
|
|
30
|
+
position: absolute;
|
|
31
|
+
width: 23px; /* square box for floating-ui arrow plugin, width of the "beak" */
|
|
32
|
+
height: 23px;
|
|
33
|
+
z-index: -1; /* within part="tooltip"'s stacking context */
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
[part="beak"] {
|
|
37
|
+
position: absolute;
|
|
38
|
+
background: var(--_background-color);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
[part="hover-bridge"] {
|
|
42
|
+
position: fixed;
|
|
43
|
+
z-index: calc(var(--_z-index) + 1);
|
|
44
|
+
inset: 0px;
|
|
45
|
+
clip-path: polygon(
|
|
46
|
+
var(--_hover-bridge-top-left-x, 0) var(--_hover-bridge-top-left-y, 0),
|
|
47
|
+
var(--_hover-bridge-top-right-x, 0) var(--_hover-bridge-top-right-y, 0),
|
|
48
|
+
var(--_hover-bridge-bottom-right-x, 0)
|
|
49
|
+
var(--_hover-bridge-bottom-right-y, 0),
|
|
50
|
+
var(--_hover-bridge-bottom-left-x, 0)
|
|
51
|
+
var(--_hover-bridge-bottom-left-y, 0)
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.sr-only {
|
|
56
|
+
position: absolute;
|
|
57
|
+
width: 1px;
|
|
58
|
+
height: 1px;
|
|
59
|
+
padding: 0;
|
|
60
|
+
margin: -1px;
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
clip: rect(0, 0, 0, 0);
|
|
63
|
+
white-space: nowrap;
|
|
64
|
+
border-width: 0;
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { LitElement, PropertyValues } from "lit";
|
|
2
|
+
export type TooltipPlacement = "top" | "bottom" | "left" | "right";
|
|
3
|
+
/**
|
|
4
|
+
* A tooltip is a message box that is displayed when a user hovers over or gives focus to a UI element.
|
|
5
|
+
*
|
|
6
|
+
* Tooltips should be used sparingly and contain succinct, supplementary information.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```html
|
|
10
|
+
* <w-button id="my-button" aria-labelledby="my-tooltip">Hover over me</w-button>
|
|
11
|
+
* <w-tooltip id="my-tooltip" for="my-button">I am a tooltip</w-tooltip>
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare class WarpTooltip extends LitElement {
|
|
15
|
+
#private;
|
|
16
|
+
static styles: import("lit").CSSResult[];
|
|
17
|
+
/**
|
|
18
|
+
* ID of the element that triggers the tooltip on hover or focus.
|
|
19
|
+
*/
|
|
20
|
+
for: string;
|
|
21
|
+
/**
|
|
22
|
+
* Hide the arrow pointing toward the tooltip target.
|
|
23
|
+
*/
|
|
24
|
+
noArrow: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Indicates whether the tooltip is visible or not.
|
|
27
|
+
*/
|
|
28
|
+
open: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Sets the placement of the tooltip relative to its target.
|
|
31
|
+
*
|
|
32
|
+
* The tooltip will try to position itself at the given placement. If there is no room it will flip to the opposite side automatically.
|
|
33
|
+
*
|
|
34
|
+
* @default "top"
|
|
35
|
+
*/
|
|
36
|
+
placement: TooltipPlacement;
|
|
37
|
+
/**
|
|
38
|
+
* Milliseconds to wait before showing the tooltip on hover.
|
|
39
|
+
*
|
|
40
|
+
* Keep at a non-zero value to avoid flickering the tooltip on and off when cursors move quickly past the target element.
|
|
41
|
+
*
|
|
42
|
+
* Focusing the target element shows the tooltip immediately.
|
|
43
|
+
*/
|
|
44
|
+
showDelay: number;
|
|
45
|
+
/**
|
|
46
|
+
* Milliseconds to wait before hiding the tooltip on mouseout.
|
|
47
|
+
*/
|
|
48
|
+
hideDelay: number;
|
|
49
|
+
private target;
|
|
50
|
+
private tooltip;
|
|
51
|
+
private hoverBridge;
|
|
52
|
+
private arrow;
|
|
53
|
+
private beak;
|
|
54
|
+
constructor();
|
|
55
|
+
connectedCallback(): void;
|
|
56
|
+
disconnectedCallback(): void;
|
|
57
|
+
protected updated(_changedProperties: PropertyValues): void;
|
|
58
|
+
firstUpdated(): void;
|
|
59
|
+
private handleBlur;
|
|
60
|
+
private handleFocus;
|
|
61
|
+
private handleMouseOver;
|
|
62
|
+
private handleKeydown;
|
|
63
|
+
private handleMouseOut;
|
|
64
|
+
hide(): Promise<void>;
|
|
65
|
+
show(): Promise<void>;
|
|
66
|
+
render(): import("lit").TemplateResult<1>;
|
|
67
|
+
}
|
|
68
|
+
declare global {
|
|
69
|
+
interface HTMLElementTagNameMap {
|
|
70
|
+
"w-tooltip": WarpTooltip;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./tooltip.js";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
|
2
|
+
import { setupHydrationWarningCapture, testHydration, } from "../../tests/react-hydration.js";
|
|
3
|
+
import "./tooltip.js";
|
|
4
|
+
describe("w-tooltip React SSR hydration", () => {
|
|
5
|
+
beforeEach(() => setupHydrationWarningCapture());
|
|
6
|
+
afterEach(() => {
|
|
7
|
+
window.__HYDRATION_WARNINGS__ = [];
|
|
8
|
+
});
|
|
9
|
+
test("default (no attributes) hydrates without warnings", async () => {
|
|
10
|
+
const warnings = await testHydration("w-tooltip", {});
|
|
11
|
+
expect(warnings).toEqual([]);
|
|
12
|
+
});
|
|
13
|
+
});
|