@nysds/nys-tooltip 1.5.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.
@@ -0,0 +1 @@
1
+ export * from "./nys-tooltip";
@@ -0,0 +1,39 @@
1
+ import { LitElement } from "lit";
2
+ export declare class NysTooltip extends LitElement {
3
+ id: string;
4
+ text: string;
5
+ inverted: boolean;
6
+ focusable: boolean;
7
+ private _active;
8
+ private _userHasSetPosition;
9
+ private _originalUserPosition;
10
+ private _internallyUpdatingPosition;
11
+ static styles: import("lit").CSSResult;
12
+ /********************* Position Logic *********************/
13
+ private _position;
14
+ get position(): "top" | "bottom" | "left" | "right" | null;
15
+ set position(value: "top" | "bottom" | "left" | "right" | null);
16
+ /**************** Lifecycle Methods ****************/
17
+ constructor();
18
+ connectedCallback(): void;
19
+ disconnectedCallback(): void;
20
+ private get _firstAssignedEl();
21
+ firstUpdated(): void;
22
+ updated(changedProps: Map<string, unknown>): void;
23
+ /******************** Event Handlers ********************/
24
+ private _handleTooltipEnter;
25
+ private _handleBlurOrMouseLeave;
26
+ private _addScrollListeners;
27
+ private _removeScrollListeners;
28
+ private _handleScrollOrResize;
29
+ private _handleEscapeKey;
30
+ /******************** Functions ********************/
31
+ private _passAria;
32
+ private _applyFocusBehavior;
33
+ private _doesPositionFit;
34
+ private autoPositionTooltip;
35
+ private _setInternalPosition;
36
+ private _shiftTooltipIntoViewport;
37
+ private _resetTooltipPositioningStyles;
38
+ render(): import("lit-html").TemplateResult<1>;
39
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,704 @@
1
+ import { css as O, LitElement as A, html as E } from "lit";
2
+ /*!
3
+ * ▒█▄░▒█ ▒█░░▒█ ▒█▀▀▀█ ▒█▀▀▄ ▒█▀▀▀█
4
+ * ▒█▒█▒█ ▒█▄▄▄█ ░▀▀▀▄▄ ▒█░▒█ ░▀▀▀▄▄
5
+ * ▒█░░▀█ ░░▒█░░ ▒█▄▄▄█ ▒█▄▄▀ ▒█▄▄▄█
6
+ *
7
+ * Tooltip Component
8
+ * Part of the New York State Design System
9
+ * Repository: https://github.com/its-hcd/nysds
10
+ * License: MIT
11
+ */
12
+ /**
13
+ * @license
14
+ * Copyright 2019 Google LLC
15
+ * SPDX-License-Identifier: BSD-3-Clause
16
+ */
17
+ const m = globalThis, b = m.ShadowRoot && (m.ShadyCSS === void 0 || m.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, R = Symbol(), $ = /* @__PURE__ */ new WeakMap();
18
+ let L = class {
19
+ constructor(t, e, i) {
20
+ if (this._$cssResult$ = !0, i !== R) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
21
+ this.cssText = t, this.t = e;
22
+ }
23
+ get styleSheet() {
24
+ let t = this.o;
25
+ const e = this.t;
26
+ if (b && t === void 0) {
27
+ const i = e !== void 0 && e.length === 1;
28
+ i && (t = $.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && $.set(e, t));
29
+ }
30
+ return t;
31
+ }
32
+ toString() {
33
+ return this.cssText;
34
+ }
35
+ };
36
+ const T = (s) => new L(typeof s == "string" ? s : s + "", void 0, R), k = (s, t) => {
37
+ if (b) s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
38
+ else for (const e of t) {
39
+ const i = document.createElement("style"), o = m.litNonce;
40
+ o !== void 0 && i.setAttribute("nonce", o), i.textContent = e.cssText, s.appendChild(i);
41
+ }
42
+ }, x = b ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
43
+ let e = "";
44
+ for (const i of t.cssRules) e += i.cssText;
45
+ return T(e);
46
+ })(s) : s;
47
+ /**
48
+ * @license
49
+ * Copyright 2017 Google LLC
50
+ * SPDX-License-Identifier: BSD-3-Clause
51
+ */
52
+ const { is: z, defineProperty: M, getOwnPropertyDescriptor: B, getOwnPropertyNames: q, getOwnPropertySymbols: I, getPrototypeOf: N } = Object, c = globalThis, U = c.trustedTypes, H = U ? U.emptyScript : "", v = c.reactiveElementPolyfillSupport, g = (s, t) => s, w = { toAttribute(s, t) {
53
+ switch (t) {
54
+ case Boolean:
55
+ s = s ? H : null;
56
+ break;
57
+ case Object:
58
+ case Array:
59
+ s = s == null ? s : JSON.stringify(s);
60
+ }
61
+ return s;
62
+ }, fromAttribute(s, t) {
63
+ let e = s;
64
+ switch (t) {
65
+ case Boolean:
66
+ e = s !== null;
67
+ break;
68
+ case Number:
69
+ e = s === null ? null : Number(s);
70
+ break;
71
+ case Object:
72
+ case Array:
73
+ try {
74
+ e = JSON.parse(s);
75
+ } catch {
76
+ e = null;
77
+ }
78
+ }
79
+ return e;
80
+ } }, S = (s, t) => !z(s, t), C = { attribute: !0, type: String, converter: w, reflect: !1, hasChanged: S };
81
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), c.litPropertyMetadata ?? (c.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
82
+ class y extends HTMLElement {
83
+ static addInitializer(t) {
84
+ this._$Ei(), (this.l ?? (this.l = [])).push(t);
85
+ }
86
+ static get observedAttributes() {
87
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
88
+ }
89
+ static createProperty(t, e = C) {
90
+ if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
91
+ const i = Symbol(), o = this.getPropertyDescriptor(t, i, e);
92
+ o !== void 0 && M(this.prototype, t, o);
93
+ }
94
+ }
95
+ static getPropertyDescriptor(t, e, i) {
96
+ const { get: o, set: n } = B(this.prototype, t) ?? { get() {
97
+ return this[e];
98
+ }, set(r) {
99
+ this[e] = r;
100
+ } };
101
+ return { get() {
102
+ return o == null ? void 0 : o.call(this);
103
+ }, set(r) {
104
+ const a = o == null ? void 0 : o.call(this);
105
+ n.call(this, r), this.requestUpdate(t, a, i);
106
+ }, configurable: !0, enumerable: !0 };
107
+ }
108
+ static getPropertyOptions(t) {
109
+ return this.elementProperties.get(t) ?? C;
110
+ }
111
+ static _$Ei() {
112
+ if (this.hasOwnProperty(g("elementProperties"))) return;
113
+ const t = N(this);
114
+ t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
115
+ }
116
+ static finalize() {
117
+ if (this.hasOwnProperty(g("finalized"))) return;
118
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(g("properties"))) {
119
+ const e = this.properties, i = [...q(e), ...I(e)];
120
+ for (const o of i) this.createProperty(o, e[o]);
121
+ }
122
+ const t = this[Symbol.metadata];
123
+ if (t !== null) {
124
+ const e = litPropertyMetadata.get(t);
125
+ if (e !== void 0) for (const [i, o] of e) this.elementProperties.set(i, o);
126
+ }
127
+ this._$Eh = /* @__PURE__ */ new Map();
128
+ for (const [e, i] of this.elementProperties) {
129
+ const o = this._$Eu(e, i);
130
+ o !== void 0 && this._$Eh.set(o, e);
131
+ }
132
+ this.elementStyles = this.finalizeStyles(this.styles);
133
+ }
134
+ static finalizeStyles(t) {
135
+ const e = [];
136
+ if (Array.isArray(t)) {
137
+ const i = new Set(t.flat(1 / 0).reverse());
138
+ for (const o of i) e.unshift(x(o));
139
+ } else t !== void 0 && e.push(x(t));
140
+ return e;
141
+ }
142
+ static _$Eu(t, e) {
143
+ const i = e.attribute;
144
+ return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0;
145
+ }
146
+ constructor() {
147
+ super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
148
+ }
149
+ _$Ev() {
150
+ var t;
151
+ this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
152
+ }
153
+ addController(t) {
154
+ var e;
155
+ (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
156
+ }
157
+ removeController(t) {
158
+ var e;
159
+ (e = this._$EO) == null || e.delete(t);
160
+ }
161
+ _$E_() {
162
+ const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
163
+ for (const i of e.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
164
+ t.size > 0 && (this._$Ep = t);
165
+ }
166
+ createRenderRoot() {
167
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
168
+ return k(t, this.constructor.elementStyles), t;
169
+ }
170
+ connectedCallback() {
171
+ var t;
172
+ this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
173
+ var i;
174
+ return (i = e.hostConnected) == null ? void 0 : i.call(e);
175
+ });
176
+ }
177
+ enableUpdating(t) {
178
+ }
179
+ disconnectedCallback() {
180
+ var t;
181
+ (t = this._$EO) == null || t.forEach((e) => {
182
+ var i;
183
+ return (i = e.hostDisconnected) == null ? void 0 : i.call(e);
184
+ });
185
+ }
186
+ attributeChangedCallback(t, e, i) {
187
+ this._$AK(t, i);
188
+ }
189
+ _$EC(t, e) {
190
+ var n;
191
+ const i = this.constructor.elementProperties.get(t), o = this.constructor._$Eu(t, i);
192
+ if (o !== void 0 && i.reflect === !0) {
193
+ const r = (((n = i.converter) == null ? void 0 : n.toAttribute) !== void 0 ? i.converter : w).toAttribute(e, i.type);
194
+ this._$Em = t, r == null ? this.removeAttribute(o) : this.setAttribute(o, r), this._$Em = null;
195
+ }
196
+ }
197
+ _$AK(t, e) {
198
+ var n;
199
+ const i = this.constructor, o = i._$Eh.get(t);
200
+ if (o !== void 0 && this._$Em !== o) {
201
+ const r = i.getPropertyOptions(o), a = typeof r.converter == "function" ? { fromAttribute: r.converter } : ((n = r.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? r.converter : w;
202
+ this._$Em = o, this[o] = a.fromAttribute(e, r.type), this._$Em = null;
203
+ }
204
+ }
205
+ requestUpdate(t, e, i) {
206
+ if (t !== void 0) {
207
+ if (i ?? (i = this.constructor.getPropertyOptions(t)), !(i.hasChanged ?? S)(this[t], e)) return;
208
+ this.P(t, e, i);
209
+ }
210
+ this.isUpdatePending === !1 && (this._$ES = this._$ET());
211
+ }
212
+ P(t, e, i) {
213
+ this._$AL.has(t) || this._$AL.set(t, e), i.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
214
+ }
215
+ async _$ET() {
216
+ this.isUpdatePending = !0;
217
+ try {
218
+ await this._$ES;
219
+ } catch (e) {
220
+ Promise.reject(e);
221
+ }
222
+ const t = this.scheduleUpdate();
223
+ return t != null && await t, !this.isUpdatePending;
224
+ }
225
+ scheduleUpdate() {
226
+ return this.performUpdate();
227
+ }
228
+ performUpdate() {
229
+ var i;
230
+ if (!this.isUpdatePending) return;
231
+ if (!this.hasUpdated) {
232
+ if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
233
+ for (const [n, r] of this._$Ep) this[n] = r;
234
+ this._$Ep = void 0;
235
+ }
236
+ const o = this.constructor.elementProperties;
237
+ if (o.size > 0) for (const [n, r] of o) r.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.P(n, this[n], r);
238
+ }
239
+ let t = !1;
240
+ const e = this._$AL;
241
+ try {
242
+ t = this.shouldUpdate(e), t ? (this.willUpdate(e), (i = this._$EO) == null || i.forEach((o) => {
243
+ var n;
244
+ return (n = o.hostUpdate) == null ? void 0 : n.call(o);
245
+ }), this.update(e)) : this._$EU();
246
+ } catch (o) {
247
+ throw t = !1, this._$EU(), o;
248
+ }
249
+ t && this._$AE(e);
250
+ }
251
+ willUpdate(t) {
252
+ }
253
+ _$AE(t) {
254
+ var e;
255
+ (e = this._$EO) == null || e.forEach((i) => {
256
+ var o;
257
+ return (o = i.hostUpdated) == null ? void 0 : o.call(i);
258
+ }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
259
+ }
260
+ _$EU() {
261
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
262
+ }
263
+ get updateComplete() {
264
+ return this.getUpdateComplete();
265
+ }
266
+ getUpdateComplete() {
267
+ return this._$ES;
268
+ }
269
+ shouldUpdate(t) {
270
+ return !0;
271
+ }
272
+ update(t) {
273
+ this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EC(e, this[e]))), this._$EU();
274
+ }
275
+ updated(t) {
276
+ }
277
+ firstUpdated(t) {
278
+ }
279
+ }
280
+ y.elementStyles = [], y.shadowRootOptions = { mode: "open" }, y[g("elementProperties")] = /* @__PURE__ */ new Map(), y[g("finalized")] = /* @__PURE__ */ new Map(), v == null || v({ ReactiveElement: y }), (c.reactiveElementVersions ?? (c.reactiveElementVersions = [])).push("2.0.4");
281
+ /**
282
+ * @license
283
+ * Copyright 2017 Google LLC
284
+ * SPDX-License-Identifier: BSD-3-Clause
285
+ */
286
+ const j = { attribute: !0, type: String, converter: w, reflect: !1, hasChanged: S }, D = (s = j, t, e) => {
287
+ const { kind: i, metadata: o } = e;
288
+ let n = globalThis.litPropertyMetadata.get(o);
289
+ if (n === void 0 && globalThis.litPropertyMetadata.set(o, n = /* @__PURE__ */ new Map()), n.set(e.name, s), i === "accessor") {
290
+ const { name: r } = e;
291
+ return { set(a) {
292
+ const h = t.get.call(this);
293
+ t.set.call(this, a), this.requestUpdate(r, h, s);
294
+ }, init(a) {
295
+ return a !== void 0 && this.P(r, void 0, s), a;
296
+ } };
297
+ }
298
+ if (i === "setter") {
299
+ const { name: r } = e;
300
+ return function(a) {
301
+ const h = this[r];
302
+ t.call(this, a), this.requestUpdate(r, h, s);
303
+ };
304
+ }
305
+ throw Error("Unsupported decorator location: " + i);
306
+ };
307
+ function u(s) {
308
+ return (t, e) => typeof e == "object" ? D(s, t, e) : ((i, o, n) => {
309
+ const r = o.hasOwnProperty(n);
310
+ return o.constructor.createProperty(n, r ? { ...i, wrapped: !0 } : i), r ? Object.getOwnPropertyDescriptor(o, n) : void 0;
311
+ })(s, t, e);
312
+ }
313
+ /**
314
+ * @license
315
+ * Copyright 2017 Google LLC
316
+ * SPDX-License-Identifier: BSD-3-Clause
317
+ */
318
+ function V(s) {
319
+ return u({ ...s, state: !0, attribute: !1 });
320
+ }
321
+ const F = O`
322
+ :host {
323
+ /* Global Tooltip Styles */
324
+ --_nys-tooltip-color: var(--nys-color-text-reverse, #ffffff);
325
+ --_nys-tooltip-background: var(--nys-color-ink, #1b1b1b);
326
+ --_nys-tooltip-border-radius: var(--nys-radius-md, 4px);
327
+ --_nys-tooltip-font-family: var(
328
+ --nys-font-family-ui,
329
+ var(
330
+ --nys-font-family-sans,
331
+ "Proxima Nova",
332
+ "Helvetica Neue",
333
+ "Helvetica",
334
+ "Arial",
335
+ sans-serif
336
+ )
337
+ );
338
+ --_nys-tooltip-font-size: var(--nys-type-size-ui-sm, 14px);
339
+ --_nys-tooltip-letterspacing: var(--nys-font-letterspacing-ui-sm, 0.044px);
340
+ --_nys-tooltip-lineheight: var(--nys-font-lineheight-ui-sm, 24px);
341
+ }
342
+
343
+ .nys-tooltip__main {
344
+ position: relative;
345
+ width: fit-content;
346
+ }
347
+
348
+ .nys-tooltip__wrapper {
349
+ width: fit-content;
350
+ display: flex;
351
+ cursor: pointer;
352
+ }
353
+
354
+ .nys-tooltip__trigger {
355
+ display: flex;
356
+ }
357
+
358
+ .nys-tooltip__content {
359
+ position: absolute;
360
+ display: none;
361
+ max-width: 400px;
362
+ width: max-content;
363
+ max-height: 120px;
364
+ padding: var(--nys-space-50, 4px) var(--nys-space-100, 8px);
365
+ background: var(--_nys-tooltip-background);
366
+ border-radius: var(--_nys-tooltip-border-radius);
367
+ cursor: auto;
368
+ z-index: 1;
369
+ }
370
+
371
+ .nys-tooltip__inner {
372
+ display: block;
373
+ color: var(--_nys-tooltip-color);
374
+ font-family: var(--_nys-tooltip-font-family);
375
+ font-size: var(--_nys-tooltip-font-size);
376
+ font-weight: 400;
377
+ line-height: var(--_nys-tooltip-lineheight);
378
+ letter-spacing: var(--_nys-tooltip-letterspacing);
379
+ white-space: normal;
380
+ word-break: break-word;
381
+ overflow: hidden;
382
+ text-overflow: ellipsis;
383
+ display: -webkit-box;
384
+ -webkit-line-clamp: 4;
385
+ -webkit-box-orient: vertical;
386
+ }
387
+
388
+ /* Tooltip Arrow (default) */
389
+ .nys-tooltip__arrow {
390
+ position: absolute;
391
+ width: 14px;
392
+ height: 6px;
393
+ background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="15" height="6" viewBox="0 0 15 6" fill="none"><path d="M8.15079 5.44218C7.7763 5.76317 7.2237 5.76317 6.84921 5.44218L0.5 0H14.5L8.15079 5.44218Z" fill="%231B1B1B"/></svg>')
394
+ no-repeat center;
395
+ }
396
+
397
+ .nys-tooltip__content[active] {
398
+ display: block;
399
+ }
400
+
401
+ /* ===================== POSITIONING ===================== */
402
+ /* Top */
403
+ :host([position="top"]) .nys-tooltip__content {
404
+ bottom: 100%;
405
+ left: 50%;
406
+ transform: translateX(-50%);
407
+ margin-bottom: 10px;
408
+ }
409
+
410
+ :host([position="top"]) .nys-tooltip__arrow {
411
+ top: 100%;
412
+ left: var(--arrow-offset-x, 50%);
413
+ transform: translateX(-50%);
414
+ }
415
+
416
+ /* Bottom */
417
+ :host([position="bottom"]) .nys-tooltip__content {
418
+ top: 100%;
419
+ left: 50%;
420
+ transform: translateX(-50%);
421
+ margin-top: 10px;
422
+ }
423
+
424
+ :host([position="bottom"]) .nys-tooltip__arrow {
425
+ bottom: 100%;
426
+ left: var(--arrow-offset-x, 50%);
427
+ transform: translateX(-50%) rotate(180deg);
428
+ }
429
+
430
+ /* Left */
431
+ :host([position="left"]) .nys-tooltip__content {
432
+ left: auto;
433
+ right: 100%;
434
+ top: 50%;
435
+ transform: translateY(-50%);
436
+ margin-right: 10px;
437
+ }
438
+
439
+ :host([position="left"]) .nys-tooltip__arrow {
440
+ left: 100%;
441
+ top: 50%;
442
+ transform: translateY(-50%) rotate(-90deg);
443
+ margin-left: -4px;
444
+ }
445
+ /* Right */
446
+ :host([position="right"]) .nys-tooltip__content {
447
+ left: 100%;
448
+ top: 50%;
449
+ transform: translateY(-50%);
450
+ margin-left: 10px;
451
+ }
452
+
453
+ :host([position="right"]) .nys-tooltip__arrow {
454
+ right: 100%;
455
+ top: 50%;
456
+ transform: translateY(-50%) rotate(90deg);
457
+ margin-right: -4px;
458
+ }
459
+
460
+ :host([inverted]) .nys-tooltip__content {
461
+ --_nys-tooltip-color: var(--nys-color-text, #1b1b1b);
462
+ --_nys-tooltip-background: var(--nys-color-ink-reverse, #fff);
463
+ }
464
+
465
+ :host([inverted]) .nys-tooltip__arrow {
466
+ background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="15" height="6" viewBox="0 0 15 6" fill="none"><path d="M8.15079 5.44218C7.7763 5.76317 7.2237 5.76317 6.84921 5.44218L0.5 0H14.5L8.15079 5.44218Z" fill="white"/></svg>')
467
+ no-repeat center;
468
+ }
469
+
470
+ @media (max-width: 400px) {
471
+ .nys-tooltip__content {
472
+ max-width: calc(
473
+ 100vw - 2rem
474
+ ); /* 2rem = 32px = 16px margin on each side */
475
+ }
476
+ }
477
+ `;
478
+ var W = Object.defineProperty, K = Object.getOwnPropertyDescriptor, _ = (s, t, e, i) => {
479
+ for (var o = i > 1 ? void 0 : i ? K(t, e) : t, n = s.length - 1, r; n >= 0; n--)
480
+ (r = s[n]) && (o = (i ? r(t, e, o) : r(o)) || o);
481
+ return i && o && W(t, e, o), o;
482
+ };
483
+ let X = 0;
484
+ const P = class P extends A {
485
+ /**************** Lifecycle Methods ****************/
486
+ constructor() {
487
+ super(), this.id = "", this.text = "", this.inverted = !1, this.focusable = !1, this._active = !1, this._userHasSetPosition = !1, this._originalUserPosition = null, this._internallyUpdatingPosition = !1, this._position = null, this._handleTooltipEnter = () => {
488
+ if (this._active = !0, this._addScrollListeners(), this._userHasSetPosition && this._originalUserPosition && this._doesPositionFit(this._originalUserPosition)) {
489
+ this.position = this._originalUserPosition, this.updateComplete.then(() => {
490
+ var e;
491
+ const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector(
492
+ ".nys-tooltip__content"
493
+ );
494
+ t && this._shiftTooltipIntoViewport(t);
495
+ });
496
+ return;
497
+ }
498
+ this.autoPositionTooltip();
499
+ }, this._handleBlurOrMouseLeave = () => {
500
+ var e;
501
+ this._active = !1, this._removeScrollListeners();
502
+ const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector(
503
+ ".nys-tooltip__content"
504
+ );
505
+ t && this._resetTooltipPositioningStyles(t);
506
+ }, this._handleScrollOrResize = () => {
507
+ this._active && (this._userHasSetPosition && this._originalUserPosition ? this._doesPositionFit(this._originalUserPosition) ? (this._setInternalPosition(this._originalUserPosition), this.updateComplete.then(() => {
508
+ var e;
509
+ const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector(
510
+ ".nys-tooltip__content"
511
+ );
512
+ t && this._shiftTooltipIntoViewport(t);
513
+ })) : this.autoPositionTooltip() : this.autoPositionTooltip());
514
+ }, this._handleEscapeKey = (t) => {
515
+ var e;
516
+ if (t.key === "Escape" && this._active) {
517
+ this._active = !1, this._removeScrollListeners();
518
+ const i = (e = this.shadowRoot) == null ? void 0 : e.querySelector(
519
+ ".nys-tooltip__content"
520
+ );
521
+ i && this._resetTooltipPositioningStyles(i);
522
+ }
523
+ };
524
+ }
525
+ get position() {
526
+ return this._position;
527
+ }
528
+ set position(t) {
529
+ const e = this._position;
530
+ this._position = t, this.requestUpdate("position", e), this._internallyUpdatingPosition || (this._userHasSetPosition = t !== null, this._originalUserPosition = t);
531
+ }
532
+ connectedCallback() {
533
+ super.connectedCallback(), this.id || (this.id = `nys-tooltip-${Date.now()}-${X++}`), window.addEventListener("keydown", this._handleEscapeKey);
534
+ }
535
+ disconnectedCallback() {
536
+ super.disconnectedCallback(), window.removeEventListener("keydown", this._handleEscapeKey);
537
+ }
538
+ get _firstAssignedEl() {
539
+ var e;
540
+ const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("slot");
541
+ return t == null ? void 0 : t.assignedElements({ flatten: !0 })[0];
542
+ }
543
+ firstUpdated() {
544
+ const t = this._firstAssignedEl;
545
+ t && this._applyFocusBehavior(t);
546
+ }
547
+ updated(t) {
548
+ super.updated(t);
549
+ const e = this._firstAssignedEl;
550
+ e && t.has("text") && this._passAria(e);
551
+ }
552
+ // Listen to window scroll so a focus tooltip can auto position even when user move across the page
553
+ _addScrollListeners() {
554
+ window.addEventListener("scroll", this._handleScrollOrResize, !0), window.addEventListener("resize", this._handleScrollOrResize);
555
+ }
556
+ _removeScrollListeners() {
557
+ window.removeEventListener("scroll", this._handleScrollOrResize, !0), window.removeEventListener("resize", this._handleScrollOrResize);
558
+ }
559
+ /******************** Functions ********************/
560
+ // We need to pass `ariaLabel` or `ariaDescription` to the nys-components so they can announce both their label and the tooltip's text
561
+ _passAria(t) {
562
+ const e = t.tagName.toLowerCase();
563
+ if (e.startsWith("nys-"))
564
+ if (e === "nys-icon") {
565
+ const i = t.getAttribute("ariaLabel") || "", o = i ? `${i}, ${this.text}` : this.text;
566
+ t.setAttribute("ariaLabel", o);
567
+ } else
568
+ t.setAttribute("ariaDescription", this.text);
569
+ }
570
+ async _applyFocusBehavior(t) {
571
+ var i;
572
+ if (!this.focusable) return;
573
+ if (t.tagName.toLowerCase() === "nys-icon") {
574
+ "updateComplete" in t && await t.updateComplete;
575
+ const o = (i = t.shadowRoot) == null ? void 0 : i.querySelector("svg");
576
+ o && o.setAttribute("tabindex", "0");
577
+ } else
578
+ t.setAttribute("tabindex", "0");
579
+ }
580
+ // Checks if user's set position fit with current viewport (Does not account for overflow texts at this moment)
581
+ _doesPositionFit(t) {
582
+ var d, f;
583
+ const e = (d = this.shadowRoot) == null ? void 0 : d.querySelector(".nys-tooltip__wrapper"), i = (f = this.shadowRoot) == null ? void 0 : f.querySelector(".nys-tooltip__content");
584
+ if (!e || !i || t == null) return;
585
+ const o = e.getBoundingClientRect(), n = i.getBoundingClientRect(), r = 8, a = {
586
+ top: o.top - r,
587
+ left: o.left - r,
588
+ bottom: window.innerHeight - o.bottom - r,
589
+ right: window.innerWidth - o.right - r
590
+ };
591
+ return {
592
+ top: a.top >= n.height,
593
+ bottom: a.bottom >= n.height,
594
+ left: a.left >= n.width,
595
+ right: a.right >= n.width
596
+ }[t];
597
+ }
598
+ // Calculates the best placement based on available space (flips placement if it doesn't fit)
599
+ async autoPositionTooltip() {
600
+ var d, f;
601
+ const t = (d = this.shadowRoot) == null ? void 0 : d.querySelector(
602
+ ".nys-tooltip__wrapper"
603
+ ), e = (f = this.shadowRoot) == null ? void 0 : f.querySelector(
604
+ ".nys-tooltip__content"
605
+ );
606
+ if (!t || !e) return;
607
+ const i = t.getBoundingClientRect(), o = 8, n = {
608
+ top: i.top - o,
609
+ left: i.left - o,
610
+ bottom: window.innerHeight - i.bottom - o,
611
+ right: window.innerWidth - i.right - o
612
+ };
613
+ let r = [
614
+ "top",
615
+ "bottom",
616
+ "right",
617
+ "left"
618
+ ];
619
+ if (this._userHasSetPosition && this._originalUserPosition) {
620
+ const l = this._originalUserPosition;
621
+ l === "left" ? r = ["left", "right", "top", "bottom"] : l === "right" ? r = ["right", "left", "top", "bottom"] : l === "top" ? r = ["top", "bottom", "right", "left"] : l === "bottom" && (r = ["bottom", "top", "right", "left"]);
622
+ }
623
+ for (const l of r)
624
+ if (this._doesPositionFit(l)) {
625
+ this._setInternalPosition(l), await this.updateComplete, this._shiftTooltipIntoViewport(e);
626
+ return;
627
+ }
628
+ let a = "top", h = n.top;
629
+ for (const l of r)
630
+ n[l] > h && (h = n[l], a = l);
631
+ this._setInternalPosition(a), await this.updateComplete, this._shiftTooltipIntoViewport(e);
632
+ }
633
+ // Sets flag to distinguish to position's setter that we are updating "position" prop internally
634
+ _setInternalPosition(t) {
635
+ this._internallyUpdatingPosition = !0, this.position = t, this._internallyUpdatingPosition = !1;
636
+ }
637
+ // Determines if text of tooltip over-extends outside of viewport edge and adjust tooltip for horizontal overflow
638
+ _shiftTooltipIntoViewport(t) {
639
+ var l;
640
+ const i = ((l = this.shadowRoot) == null ? void 0 : l.querySelector(
641
+ ".nys-tooltip__wrapper"
642
+ )).getBoundingClientRect(), o = t.getBoundingClientRect(), n = i.left + i.width / 2, r = o.left < 0, a = o.right > window.innerWidth;
643
+ this._resetTooltipPositioningStyles(t), r ? (t.style.left = "0px", t.style.transform = "none") : a && (t.style.right = "0px", t.style.left = "auto", t.style.transform = "none");
644
+ const h = t.getBoundingClientRect(), d = (n - h.left) / h.width, f = Math.max(0, Math.min(1, d)) * 100;
645
+ t.style.setProperty("--arrow-offset-x", `${f}%`);
646
+ }
647
+ // Reposition tooltip back to original set position (e.g. top, left, bottom, right) to avoid positioning issue base on last position
648
+ _resetTooltipPositioningStyles(t) {
649
+ t.style.left = "", t.style.right = "", t.style.transform = "";
650
+ }
651
+ render() {
652
+ var t;
653
+ return E`
654
+ <div class="nys-tooltip__main">
655
+ <div
656
+ class="nys-tooltip__wrapper"
657
+ @mouseenter=${this._handleTooltipEnter}
658
+ @mouseleave=${this._handleBlurOrMouseLeave}
659
+ @focusin=${this._handleTooltipEnter}
660
+ @focusout=${this._handleBlurOrMouseLeave}
661
+ >
662
+ <span class="nys-tooltip__trigger">
663
+ <slot></slot>
664
+ </span>
665
+ </div>
666
+ ${(t = this.text) != null && t.trim() ? E`<div
667
+ id=${this.id}
668
+ class="nys-tooltip__content"
669
+ role="tooltip"
670
+ aria-hidden=${!this._active}
671
+ ?active=${this._active}
672
+ >
673
+ <div class="nys-tooltip__inner">${this.text}</div>
674
+ <span class="nys-tooltip__arrow"></span>
675
+ </div>` : ""}
676
+ </div>
677
+ `;
678
+ }
679
+ };
680
+ P.styles = F;
681
+ let p = P;
682
+ _([
683
+ u({ type: String })
684
+ ], p.prototype, "id", 2);
685
+ _([
686
+ u({ type: String })
687
+ ], p.prototype, "text", 2);
688
+ _([
689
+ u({ type: Boolean, reflect: !0 })
690
+ ], p.prototype, "inverted", 2);
691
+ _([
692
+ u({ type: Boolean, reflect: !0 })
693
+ ], p.prototype, "focusable", 2);
694
+ _([
695
+ V()
696
+ ], p.prototype, "_active", 2);
697
+ _([
698
+ u({ type: String, reflect: !0 })
699
+ ], p.prototype, "position", 1);
700
+ customElements.get("nys-tooltip") || customElements.define("nys-tooltip", p);
701
+ export {
702
+ p as NysTooltip
703
+ };
704
+ //# sourceMappingURL=nys-tooltip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nys-tooltip.js","sources":["../../../node_modules/@lit/reactive-element/css-tag.js","../../../node_modules/@lit/reactive-element/reactive-element.js","../../../node_modules/@lit/reactive-element/decorators/property.js","../../../node_modules/@lit/reactive-element/decorators/state.js","../src/nys-tooltip.styles.ts","../src/nys-tooltip.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new n(\"string\"==typeof t?t:t+\"\",void 0,s),i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if(\"number\"==typeof t)return t;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+t+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(s)+t[o+1]),t[0]);return new n(o,t,s)},S=(s,o)=>{if(e)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement(\"style\"),n=t.litNonce;void 0!==n&&o.setAttribute(\"nonce\",n),o.textContent=e.cssText,s.appendChild(o)}},c=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e=\"\";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t;export{n as CSSResult,S as adoptStyles,i as css,c as getCompatibleStyle,e as supportsAdoptingStyleSheets,r as unsafeCSS};\n//# sourceMappingURL=css-tag.js.map\n","import{getCompatibleStyle as t,adoptStyles as s}from\"./css-tag.js\";export{CSSResult,adoptStyles,css,getCompatibleStyle,supportsAdoptingStyleSheets,unsafeCSS}from\"./css-tag.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{is:i,defineProperty:e,getOwnPropertyDescriptor:r,getOwnPropertyNames:h,getOwnPropertySymbols:o,getPrototypeOf:n}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:\"\",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},f=(t,s)=>!i(t,s),y={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:f};Symbol.metadata??=Symbol(\"metadata\"),a.litPropertyMetadata??=new WeakMap;class b extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=y){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,s);void 0!==r&&e(this.prototype,t,r)}}static getPropertyDescriptor(t,s,i){const{get:e,set:h}=r(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t}};return{get(){return e?.call(this)},set(s){const r=e?.call(this);h.call(this,s),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}static _$Ei(){if(this.hasOwnProperty(d(\"elementProperties\")))return;const t=n(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(d(\"finalized\")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d(\"properties\"))){const t=this.properties,s=[...h(t),...o(t)];for(const i of s)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(t(s))}else void 0!==s&&i.push(t(s));return i}static _$Eu(t,s){const i=s.attribute;return!1===i?void 0:\"string\"==typeof i?i:\"string\"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$EC(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==r?this.removeAttribute(e):this.setAttribute(e,r),this._$Em=null}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),r=\"function\"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e,this[e]=r.fromAttribute(s,t.type),this._$Em=null}}requestUpdate(t,s,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??f)(this[t],s))return;this.P(t,s,i)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,s,i){this._$AL.has(t)||this._$AL.set(t,s),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t)!0!==i.wrapped||this._$AL.has(s)||void 0===this[s]||this.P(s,this[s],i)}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}b.elementStyles=[],b.shadowRootOptions={mode:\"open\"},b[d(\"elementProperties\")]=new Map,b[d(\"finalized\")]=new Map,p?.({ReactiveElement:b}),(a.reactiveElementVersions??=[]).push(\"2.0.4\");export{b as ReactiveElement,u as defaultConverter,f as notEqual};\n//# sourceMappingURL=reactive-element.js.map\n","import{defaultConverter as t,notEqual as e}from\"../reactive-element.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o={attribute:!0,type:String,converter:t,reflect:!1,hasChanged:e},r=(t=o,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),s.set(r.name,t),\"accessor\"===n){const{name:o}=r;return{set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t)},init(e){return void 0!==e&&this.P(o,void 0,t),e}}}if(\"setter\"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t)}}throw Error(\"Unsupported decorator location: \"+n)};function n(t){return(e,o)=>\"object\"==typeof o?r(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,r?{...t,wrapped:!0}:t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}export{n as property,r as standardProperty};\n//# sourceMappingURL=property.js.map\n","import{property as t}from\"./property.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function r(r){return t({...r,state:!0,attribute:!1})}export{r as state};\n//# sourceMappingURL=state.js.map\n","import { css } from \"lit\";\n\nexport default css`\n :host {\n /* Global Tooltip Styles */\n --_nys-tooltip-color: var(--nys-color-text-reverse, #ffffff);\n --_nys-tooltip-background: var(--nys-color-ink, #1b1b1b);\n --_nys-tooltip-border-radius: var(--nys-radius-md, 4px);\n --_nys-tooltip-font-family: var(\n --nys-font-family-ui,\n var(\n --nys-font-family-sans,\n \"Proxima Nova\",\n \"Helvetica Neue\",\n \"Helvetica\",\n \"Arial\",\n sans-serif\n )\n );\n --_nys-tooltip-font-size: var(--nys-type-size-ui-sm, 14px);\n --_nys-tooltip-letterspacing: var(--nys-font-letterspacing-ui-sm, 0.044px);\n --_nys-tooltip-lineheight: var(--nys-font-lineheight-ui-sm, 24px);\n }\n\n .nys-tooltip__main {\n position: relative;\n width: fit-content;\n }\n\n .nys-tooltip__wrapper {\n width: fit-content;\n display: flex;\n cursor: pointer;\n }\n\n .nys-tooltip__trigger {\n display: flex;\n }\n\n .nys-tooltip__content {\n position: absolute;\n display: none;\n max-width: 400px;\n width: max-content;\n max-height: 120px;\n padding: var(--nys-space-50, 4px) var(--nys-space-100, 8px);\n background: var(--_nys-tooltip-background);\n border-radius: var(--_nys-tooltip-border-radius);\n cursor: auto;\n z-index: 1;\n }\n\n .nys-tooltip__inner {\n display: block;\n color: var(--_nys-tooltip-color);\n font-family: var(--_nys-tooltip-font-family);\n font-size: var(--_nys-tooltip-font-size);\n font-weight: 400;\n line-height: var(--_nys-tooltip-lineheight);\n letter-spacing: var(--_nys-tooltip-letterspacing);\n white-space: normal;\n word-break: break-word;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 4;\n -webkit-box-orient: vertical;\n }\n\n /* Tooltip Arrow (default) */\n .nys-tooltip__arrow {\n position: absolute;\n width: 14px;\n height: 6px;\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"6\" viewBox=\"0 0 15 6\" fill=\"none\"><path d=\"M8.15079 5.44218C7.7763 5.76317 7.2237 5.76317 6.84921 5.44218L0.5 0H14.5L8.15079 5.44218Z\" fill=\"%231B1B1B\"/></svg>')\n no-repeat center;\n }\n\n .nys-tooltip__content[active] {\n display: block;\n }\n\n /* ===================== POSITIONING ===================== */\n /* Top */\n :host([position=\"top\"]) .nys-tooltip__content {\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-bottom: 10px;\n }\n\n :host([position=\"top\"]) .nys-tooltip__arrow {\n top: 100%;\n left: var(--arrow-offset-x, 50%);\n transform: translateX(-50%);\n }\n\n /* Bottom */\n :host([position=\"bottom\"]) .nys-tooltip__content {\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-top: 10px;\n }\n\n :host([position=\"bottom\"]) .nys-tooltip__arrow {\n bottom: 100%;\n left: var(--arrow-offset-x, 50%);\n transform: translateX(-50%) rotate(180deg);\n }\n\n /* Left */\n :host([position=\"left\"]) .nys-tooltip__content {\n left: auto;\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-right: 10px;\n }\n\n :host([position=\"left\"]) .nys-tooltip__arrow {\n left: 100%;\n top: 50%;\n transform: translateY(-50%) rotate(-90deg);\n margin-left: -4px;\n }\n /* Right */\n :host([position=\"right\"]) .nys-tooltip__content {\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-left: 10px;\n }\n\n :host([position=\"right\"]) .nys-tooltip__arrow {\n right: 100%;\n top: 50%;\n transform: translateY(-50%) rotate(90deg);\n margin-right: -4px;\n }\n\n :host([inverted]) .nys-tooltip__content {\n --_nys-tooltip-color: var(--nys-color-text, #1b1b1b);\n --_nys-tooltip-background: var(--nys-color-ink-reverse, #fff);\n }\n\n :host([inverted]) .nys-tooltip__arrow {\n background: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"15\" height=\"6\" viewBox=\"0 0 15 6\" fill=\"none\"><path d=\"M8.15079 5.44218C7.7763 5.76317 7.2237 5.76317 6.84921 5.44218L0.5 0H14.5L8.15079 5.44218Z\" fill=\"white\"/></svg>')\n no-repeat center;\n }\n\n @media (max-width: 400px) {\n .nys-tooltip__content {\n max-width: calc(\n 100vw - 2rem\n ); /* 2rem = 32px = 16px margin on each side */\n }\n }\n`;\n","import { LitElement, html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport styles from \"./nys-tooltip.styles\";\n\nlet tooltipIdCounter = 0; // Counter for generating unique IDs\n\nexport class NysTooltip extends LitElement {\n @property({ type: String }) id = \"\";\n @property({ type: String }) text = \"\";\n @property({ type: Boolean, reflect: true }) inverted = false;\n @property({ type: Boolean, reflect: true }) focusable = false;\n\n // Track if tooltip is active (hovered or focused)\n @state()\n private _active = false;\n\n // Track if user set position is set explicitly\n private _userHasSetPosition = false;\n private _originalUserPosition: typeof this._position | null = null;\n // Internal flag to prevent dynamic positioning when not needed\n private _internallyUpdatingPosition = false;\n\n static styles = styles;\n\n /********************* Position Logic *********************/\n private _position: \"top\" | \"bottom\" | \"left\" | \"right\" | null = null;\n\n @property({ type: String, reflect: true })\n get position() {\n return this._position;\n }\n\n set position(value) {\n const oldVal = this._position;\n this._position = value;\n this.requestUpdate(\"position\", oldVal);\n\n // The \"_internallyUpdatingPosition\" flag allows user's set position to take preference\n if (!this._internallyUpdatingPosition) {\n this._userHasSetPosition = value !== null;\n this._originalUserPosition = value;\n }\n }\n\n /**************** Lifecycle Methods ****************/\n constructor() {\n super();\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n // Generate a unique ID if not provided\n if (!this.id) {\n this.id = `nys-tooltip-${Date.now()}-${tooltipIdCounter++}`;\n }\n\n window.addEventListener(\"keydown\", this._handleEscapeKey);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n window.removeEventListener(\"keydown\", this._handleEscapeKey);\n }\n\n private get _firstAssignedEl(): HTMLElement | undefined {\n const slot = this.shadowRoot?.querySelector(\"slot\");\n return slot?.assignedElements({ flatten: true })[0] as\n | HTMLElement\n | undefined;\n }\n\n firstUpdated() {\n const firstEl = this._firstAssignedEl;\n if (firstEl) {\n this._applyFocusBehavior(firstEl);\n }\n }\n\n updated(changedProps: Map<string, unknown>) {\n super.updated(changedProps);\n\n const firstEl = this._firstAssignedEl;\n if (!firstEl) return;\n\n // Accounts for tooltip's text change (for code editor changes & VO)\n if (changedProps.has(\"text\")) {\n this._passAria(firstEl);\n }\n }\n\n /******************** Event Handlers ********************/\n // When toggling tooltip, check if user has set position to give it preference it space allows. Otherwise dynamically position tooltip.\n private _handleTooltipEnter = () => {\n this._active = true;\n this._addScrollListeners();\n\n // Try to honor user's original preference first\n if (this._userHasSetPosition && this._originalUserPosition) {\n if (this._doesPositionFit(this._originalUserPosition)) {\n this.position = this._originalUserPosition;\n // Check if current tooltip position overflows to edge of screen\n this.updateComplete.then(() => {\n const tooltip = this.shadowRoot?.querySelector(\n \".nys-tooltip__content\",\n ) as HTMLElement;\n if (tooltip) this._shiftTooltipIntoViewport(tooltip);\n });\n return;\n }\n }\n\n // Otherwise fall back to auto logic\n this.autoPositionTooltip();\n };\n\n private _handleBlurOrMouseLeave = () => {\n this._active = false;\n this._removeScrollListeners();\n\n const tooltip = this.shadowRoot?.querySelector(\n \".nys-tooltip__content\",\n ) as HTMLElement;\n\n if (tooltip) {\n this._resetTooltipPositioningStyles(tooltip);\n }\n };\n\n // Listen to window scroll so a focus tooltip can auto position even when user move across the page\n private _addScrollListeners() {\n window.addEventListener(\"scroll\", this._handleScrollOrResize, true);\n window.addEventListener(\"resize\", this._handleScrollOrResize);\n }\n\n private _removeScrollListeners() {\n window.removeEventListener(\"scroll\", this._handleScrollOrResize, true);\n window.removeEventListener(\"resize\", this._handleScrollOrResize);\n }\n\n private _handleScrollOrResize = () => {\n if (!this._active) return;\n\n if (this._userHasSetPosition && this._originalUserPosition) {\n if (this._doesPositionFit(this._originalUserPosition)) {\n this._setInternalPosition(this._originalUserPosition);\n\n // Check if current tooltip position overflows to edge of screen\n this.updateComplete.then(() => {\n const tooltip = this.shadowRoot?.querySelector(\n \".nys-tooltip__content\",\n ) as HTMLElement;\n if (tooltip) this._shiftTooltipIntoViewport(tooltip);\n });\n } else {\n this.autoPositionTooltip();\n }\n } else {\n this.autoPositionTooltip();\n }\n };\n\n private _handleEscapeKey = (e: KeyboardEvent) => {\n if (e.key === \"Escape\" && this._active) {\n this._active = false;\n this._removeScrollListeners();\n\n const tooltip = this.shadowRoot?.querySelector(\n \".nys-tooltip__content\",\n ) as HTMLElement;\n if (tooltip) {\n this._resetTooltipPositioningStyles(tooltip);\n }\n }\n };\n\n /******************** Functions ********************/\n // We need to pass `ariaLabel` or `ariaDescription` to the nys-components so they can announce both their label and the tooltip's text\n private _passAria(el: HTMLElement) {\n const tagName = el.tagName.toLowerCase();\n\n if (tagName.startsWith(\"nys-\")) {\n if (tagName === \"nys-icon\") {\n // For nys-icon, use ariaLabel instead\n const existingLabel = el.getAttribute(\"ariaLabel\") || \"\";\n const mergedLabel = existingLabel\n ? `${existingLabel}, ${this.text}`\n : this.text;\n\n el.setAttribute(\"ariaLabel\", mergedLabel);\n } else {\n // For other components like nys-button, use ariaDescription\n el.setAttribute(\"ariaDescription\", this.text);\n }\n }\n }\n\n private async _applyFocusBehavior(el: HTMLElement) {\n if (!this.focusable) return;\n\n const tagName = el.tagName.toLowerCase();\n if (tagName === \"nys-icon\") {\n if (\"updateComplete\" in el) {\n await (el as any).updateComplete;\n }\n const svg = el.shadowRoot?.querySelector(\"svg\");\n if (svg) {\n svg.setAttribute(\"tabindex\", \"0\");\n }\n } else {\n el.setAttribute(\"tabindex\", \"0\");\n }\n }\n\n // Checks if user's set position fit with current viewport (Does not account for overflow texts at this moment)\n private _doesPositionFit(position: typeof this._position) {\n const wrapper = this.shadowRoot?.querySelector(\".nys-tooltip__wrapper\");\n const tooltip = this.shadowRoot?.querySelector(\".nys-tooltip__content\");\n\n if (!wrapper || !tooltip || position == null) return;\n\n const triggerRect = wrapper.getBoundingClientRect();\n const tooltipRect = tooltip.getBoundingClientRect();\n\n // Define some margin buffer between tooltip and trigger (to avoid touching the edges too tightly)\n const margin = 8;\n\n // Available space on each side relative to trigger rect and viewport\n const spaceAvailable = {\n top: triggerRect.top - margin,\n left: triggerRect.left - margin,\n bottom: window.innerHeight - triggerRect.bottom - margin,\n right: window.innerWidth - triggerRect.right - margin,\n };\n\n // Check if tooltip fits on each side (compare available space vs tooltip size)\n const fits = {\n top: spaceAvailable.top >= tooltipRect.height,\n bottom: spaceAvailable.bottom >= tooltipRect.height,\n left: spaceAvailable.left >= tooltipRect.width,\n right: spaceAvailable.right >= tooltipRect.width,\n };\n\n return fits[position];\n }\n\n // Calculates the best placement based on available space (flips placement if it doesn't fit)\n private async autoPositionTooltip() {\n const wrapper = this.shadowRoot?.querySelector(\n \".nys-tooltip__wrapper\",\n ) as HTMLElement;\n const tooltip = this.shadowRoot?.querySelector(\n \".nys-tooltip__content\",\n ) as HTMLElement;\n\n if (!wrapper || !tooltip) return;\n\n const triggerRect = wrapper.getBoundingClientRect();\n const margin = 8;\n\n const spaceAvailable = {\n top: triggerRect.top - margin,\n left: triggerRect.left - margin,\n bottom: window.innerHeight - triggerRect.bottom - margin,\n right: window.innerWidth - triggerRect.right - margin,\n };\n\n // Default tryOrder for auto mode\n let tryOrder: Array<keyof typeof spaceAvailable> = [\n \"top\",\n \"bottom\",\n \"right\",\n \"left\",\n ];\n\n // If user explicitly set a preferred position (even if it didn’t fit),\n // favor it first before trying others\n if (this._userHasSetPosition && this._originalUserPosition) {\n const userPosition = this._originalUserPosition;\n if (userPosition === \"left\") {\n tryOrder = [\"left\", \"right\", \"top\", \"bottom\"];\n } else if (userPosition === \"right\") {\n tryOrder = [\"right\", \"left\", \"top\", \"bottom\"];\n } else if (userPosition === \"top\") {\n tryOrder = [\"top\", \"bottom\", \"right\", \"left\"];\n } else if (userPosition === \"bottom\") {\n tryOrder = [\"bottom\", \"top\", \"right\", \"left\"];\n }\n }\n\n // 1) Try to find the first side that fits\n for (const pos of tryOrder) {\n if (this._doesPositionFit(pos)) {\n this._setInternalPosition(pos);\n await this.updateComplete;\n this._shiftTooltipIntoViewport(tooltip);\n return;\n }\n }\n\n // 2) Fallback: pick the side with the most space\n let bestPosition: keyof typeof spaceAvailable = \"top\";\n let maxSpace = spaceAvailable.top;\n\n for (const pos of tryOrder) {\n if (spaceAvailable[pos] > maxSpace) {\n maxSpace = spaceAvailable[pos];\n bestPosition = pos;\n }\n }\n this._setInternalPosition(bestPosition);\n await this.updateComplete;\n this._shiftTooltipIntoViewport(tooltip);\n }\n\n // Sets flag to distinguish to position's setter that we are updating \"position\" prop internally\n private _setInternalPosition(bestPosition: typeof this._position) {\n this._internallyUpdatingPosition = true;\n this.position = bestPosition;\n this._internallyUpdatingPosition = false;\n }\n\n // Determines if text of tooltip over-extends outside of viewport edge and adjust tooltip for horizontal overflow\n private _shiftTooltipIntoViewport(tooltip: HTMLElement) {\n const wrapper = this.shadowRoot?.querySelector(\n \".nys-tooltip__wrapper\",\n ) as HTMLElement;\n\n const wrapperRect = wrapper.getBoundingClientRect();\n const tooltipRect = tooltip.getBoundingClientRect();\n\n const wrapperCenter = wrapperRect.left + wrapperRect.width / 2;\n\n const overflowLeft = tooltipRect.left < 0;\n const overflowRight = tooltipRect.right > window.innerWidth;\n\n this._resetTooltipPositioningStyles(tooltip);\n\n // Tooltip is past the viewport edge, shift it inwards\n if (overflowLeft) {\n tooltip.style.left = \"0px\";\n tooltip.style.transform = \"none\";\n } else if (overflowRight) {\n tooltip.style.right = \"0px\";\n tooltip.style.left = \"auto\";\n tooltip.style.transform = \"none\";\n }\n\n // Recalculate tooltip rect after any shift\n const newTooltipRect = tooltip.getBoundingClientRect();\n\n // Arrow offset relative to tooltip width to maintain accuracy on zoom and out-of-bounds\n const arrowOffsetRatio =\n (wrapperCenter - newTooltipRect.left) / newTooltipRect.width;\n const arrowOffsetPercent = Math.max(0, Math.min(1, arrowOffsetRatio)) * 100;\n\n tooltip.style.setProperty(\"--arrow-offset-x\", `${arrowOffsetPercent}%`);\n }\n\n // Reposition tooltip back to original set position (e.g. top, left, bottom, right) to avoid positioning issue base on last position\n private _resetTooltipPositioningStyles(tooltip: HTMLElement) {\n tooltip.style.left = \"\";\n tooltip.style.right = \"\";\n tooltip.style.transform = \"\";\n }\n\n render() {\n return html`\n <div class=\"nys-tooltip__main\">\n <div\n class=\"nys-tooltip__wrapper\"\n @mouseenter=${this._handleTooltipEnter}\n @mouseleave=${this._handleBlurOrMouseLeave}\n @focusin=${this._handleTooltipEnter}\n @focusout=${this._handleBlurOrMouseLeave}\n >\n <span class=\"nys-tooltip__trigger\">\n <slot></slot>\n </span>\n </div>\n ${this.text?.trim()\n ? html`<div\n id=${this.id}\n class=\"nys-tooltip__content\"\n role=\"tooltip\"\n aria-hidden=${!this._active}\n ?active=${this._active}\n >\n <div class=\"nys-tooltip__inner\">${this.text}</div>\n <span class=\"nys-tooltip__arrow\"></span>\n </div>`\n : \"\"}\n </div>\n `;\n }\n}\n\nif (!customElements.get(\"nys-tooltip\")) {\n customElements.define(\"nys-tooltip\", NysTooltip);\n}\n"],"names":["t","e","s","o","n$2","r","n","S","c","i","h","a","l","p","d","u","f","y","b","_a","styles","css","tooltipIdCounter","_NysTooltip","LitElement","tooltip","value","oldVal","slot","firstEl","changedProps","el","tagName","existingLabel","mergedLabel","svg","position","wrapper","_b","triggerRect","tooltipRect","margin","spaceAvailable","tryOrder","userPosition","pos","bestPosition","maxSpace","wrapperRect","wrapperCenter","overflowLeft","overflowRight","newTooltipRect","arrowOffsetRatio","arrowOffsetPercent","html","NysTooltip","__decorateClass","property","state"],"mappings":";;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,MAAMA,IAAE,YAAWC,IAAED,EAAE,eAAsBA,EAAE,aAAX,UAAqBA,EAAE,SAAS,iBAAe,wBAAuB,SAAS,aAAW,aAAY,cAAc,WAAUE,IAAE,OAAM,GAAGC,IAAE,oBAAI;AAAO,IAAAC,IAAC,MAAO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GArB9BF,EAsBP,WAAA,YAAA,CAAA;AAiXD,eAAe,IAAI,aAAa,KACnC,eAAe,OAAO,eAAeA,CAAU;","x_google_ignoreList":[0,1,2,3]}
@@ -0,0 +1,2 @@
1
+ declare const _default: import("lit").CSSResult;
2
+ export default _default;
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@nysds/nys-tooltip",
3
+ "version": "1.5.0",
4
+ "description": "The Tooltip component from the NYS Design System.",
5
+ "module": "dist/nys-tooltip.js",
6
+ "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./dist/nys-tooltip.js",
10
+ "types": "./dist/index.d.ts"
11
+ }
12
+ },
13
+ "type": "module",
14
+ "files": [
15
+ "dist/"
16
+ ],
17
+ "scripts": {
18
+ "dev": "tsc --emitDeclarationOnly && vite",
19
+ "build": "tsc --emitDeclarationOnly && vite build",
20
+ "test": "vite build && wtr",
21
+ "build:watch": "tsc --emitDeclarationOnly && vite build --watch",
22
+ "test:watch": "vite build && wtr --watch"
23
+ },
24
+ "peerDependencies": {
25
+ "lit": "^3.2.1"
26
+ },
27
+ "dependencies": {
28
+ },
29
+ "devDependencies": {
30
+ "lit": "^3.2.1",
31
+ "typescript": "^5.7.2",
32
+ "vite": "^6.3.4"
33
+ },
34
+ "keywords": [
35
+ "new-york-state",
36
+ "design-system",
37
+ "web-components",
38
+ "lit",
39
+ "nys",
40
+ "tooltip",
41
+ "forms"
42
+ ],
43
+ "author": "New York State Design System Team",
44
+ "license": "MIT"
45
+ }
46
+