@nysds/nys-tooltip 1.15.0 → 1.16.0-alpha4
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/nys-tooltip.js +1 -1
- package/package.json +2 -2
- package/dist/index.d.ts +0 -1
- package/dist/nys-tooltip.d.ts +0 -92
- package/dist/nys-tooltip.figma.d.ts +0 -1
package/dist/nys-tooltip.js
CHANGED
|
@@ -5,7 +5,7 @@ import { property as c, state as g } from "lit/decorators.js";
|
|
|
5
5
|
* █ █ █ █▄▄▄█ ▀▀▀▄▄ █ █ ▀▀▀▄▄
|
|
6
6
|
* █ ▀█ █ █▄▄▄█ █▄▄▀ █▄▄▄█
|
|
7
7
|
*
|
|
8
|
-
* Tooltip Component
|
|
8
|
+
* Tooltip Component v1.16.0-alpha4
|
|
9
9
|
* Part of the New York State Design System
|
|
10
10
|
* Repository: https://github.com/its-hcd/nysds
|
|
11
11
|
* License: MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nysds/nys-tooltip",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0-alpha4",
|
|
4
4
|
"description": "The Tooltip component from the NYS Design System.",
|
|
5
5
|
"module": "dist/nys-tooltip.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
18
18
|
"dev": "tsc --emitDeclarationOnly && vite",
|
|
19
|
-
"build": "
|
|
19
|
+
"build": "vite build",
|
|
20
20
|
"test": "vite build && wtr",
|
|
21
21
|
"build:watch": "tsc --emitDeclarationOnly && vite build --watch",
|
|
22
22
|
"test:watch": "vite build && wtr --watch",
|
package/dist/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./nys-tooltip";
|
package/dist/nys-tooltip.d.ts
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { LitElement } from "lit";
|
|
2
|
-
/**
|
|
3
|
-
* Shows contextual help text on hover/focus. Auto-positions to stay within viewport and supports keyboard dismiss.
|
|
4
|
-
*
|
|
5
|
-
* Link to a trigger element via `for` attribute matching the trigger's `id`. Tooltip appears on hover or focus
|
|
6
|
-
* and dismisses on blur, mouse leave, or Escape key. Use for supplementary info only—not critical content.
|
|
7
|
-
*
|
|
8
|
-
* @summary Contextual tooltip with auto-positioning, keyboard support, and screen reader integration.
|
|
9
|
-
* @element nys-tooltip
|
|
10
|
-
*
|
|
11
|
-
* @example Tooltip for button
|
|
12
|
-
* ```html
|
|
13
|
-
* <nys-button id="help-btn" label="Help" circle icon="help"></nys-button>
|
|
14
|
-
* <nys-tooltip for="help-btn" text="Click for assistance"></nys-tooltip>
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @example Positioned tooltip
|
|
18
|
-
* ```html
|
|
19
|
-
* <nys-icon id="info-icon" name="info"></nys-icon>
|
|
20
|
-
* <nys-tooltip for="info-icon" text="Additional details" position="right"></nys-tooltip>
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export declare class NysTooltip extends LitElement {
|
|
24
|
-
static styles: import("lit").CSSResult;
|
|
25
|
-
/** Unique identifier. Auto-generated if not provided. */
|
|
26
|
-
id: string;
|
|
27
|
-
/** Tooltip content text. Required. */
|
|
28
|
-
text: string;
|
|
29
|
-
/** Adjusts colors for dark backgrounds. */
|
|
30
|
-
inverted: boolean;
|
|
31
|
-
/** ID of the trigger element to attach this tooltip to. Required. */
|
|
32
|
-
for: string;
|
|
33
|
-
private _active;
|
|
34
|
-
private _userHasSetPosition;
|
|
35
|
-
private _originalUserPosition;
|
|
36
|
-
private _internallyUpdatingPosition;
|
|
37
|
-
private _hideTimeout;
|
|
38
|
-
private _position;
|
|
39
|
-
/**
|
|
40
|
-
* Preferred position relative to trigger. Auto-adjusts if space is insufficient.
|
|
41
|
-
* @default null (auto-positioned based on available space)
|
|
42
|
-
*/
|
|
43
|
-
get position(): "top" | "bottom" | "left" | "right" | null;
|
|
44
|
-
set position(value: "top" | "bottom" | "left" | "right" | null);
|
|
45
|
-
/**
|
|
46
|
-
* Lifecycle Methods
|
|
47
|
-
* --------------------------------------------------------------------------
|
|
48
|
-
*/
|
|
49
|
-
constructor();
|
|
50
|
-
connectedCallback(): void;
|
|
51
|
-
disconnectedCallback(): void;
|
|
52
|
-
firstUpdated(): Promise<void>;
|
|
53
|
-
updated(changedProps: Map<string, unknown>): void;
|
|
54
|
-
/**
|
|
55
|
-
* Event Handlers
|
|
56
|
-
* --------------------------------------------------------------------------
|
|
57
|
-
*/
|
|
58
|
-
private _showTooltip;
|
|
59
|
-
private _handleBlurOrMouseLeave;
|
|
60
|
-
private _triggerFadeOut;
|
|
61
|
-
private _cancelFadeOut;
|
|
62
|
-
private _addScrollListeners;
|
|
63
|
-
private _removeScrollListeners;
|
|
64
|
-
private _handleScrollOrResize;
|
|
65
|
-
private _handleEscapeKey;
|
|
66
|
-
/**
|
|
67
|
-
* Functions
|
|
68
|
-
* --------------------------------------------------------------------------
|
|
69
|
-
*/
|
|
70
|
-
private _getReferenceElement;
|
|
71
|
-
private _passAria;
|
|
72
|
-
/**
|
|
73
|
-
* In React, the reference element found is often the native HTML element within the nys-component.
|
|
74
|
-
* Therefore, this function accounts for the closest NYS component ancestor that supports a tooltip prop.
|
|
75
|
-
*/
|
|
76
|
-
private _applyTooltipPropToFormComponent;
|
|
77
|
-
private _applyFocusBehavior;
|
|
78
|
-
/**
|
|
79
|
-
* Checks if the tooltip fits inside the viewport on the given side of the trigger.
|
|
80
|
-
* Used for auto-positioning. Ignores text overflow for now.
|
|
81
|
-
*/
|
|
82
|
-
private _doesPositionFit;
|
|
83
|
-
private _userPositionTooltip;
|
|
84
|
-
private _autoPositionTooltip;
|
|
85
|
-
private _positionStartingBase;
|
|
86
|
-
private _positionTooltipElement;
|
|
87
|
-
private applyInverseTransform;
|
|
88
|
-
private _setInternalPosition;
|
|
89
|
-
private _shiftTooltipIntoViewport;
|
|
90
|
-
private _resetTooltipPositioningStyles;
|
|
91
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
92
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|