inclusive-elements 0.2.1 → 0.3.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.
@@ -1,25 +1,57 @@
1
1
  var T = Object.defineProperty;
2
- var C = (a, o, t) => o in a ? T(a, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[o] = t;
3
- var s = (a, o, t) => (C(a, typeof o != "symbol" ? o + "" : o, t), t);
4
- import { move as E, hello as l, goodbye as u, cancel as k } from "hello-goodbye";
5
- import { isFocusable as D, focusable as g } from "tabbable";
6
- import { createFocusTrap as H } from "focus-trap";
7
- import { autoUpdate as M, computePosition as A, shift as L, flip as x, size as O } from "@floating-ui/dom";
8
- const v = class extends HTMLElement {
2
+ var D = (o, r, t) => r in o ? T(o, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[r] = t;
3
+ var s = (o, r, t) => (D(o, typeof r != "symbol" ? r + "" : r, t), t);
4
+ import { move as k, hello as h, goodbye as d, cancel as v } from "hello-goodbye";
5
+ import { isFocusable as H, focusable as A } from "tabbable";
6
+ import { createFocusTrap as O } from "focus-trap";
7
+ import { autoUpdate as M, computePosition as g, shift as L, flip as x, size as K } from "@floating-ui/dom";
8
+ class I extends HTMLElement {
9
9
  constructor() {
10
10
  super(...arguments);
11
+ s(this, "onOpen", (t) => {
12
+ this.querySelectorAll(
13
+ ":scope > ui-disclosure"
14
+ ).forEach((e) => {
15
+ e.open = e === t.target, this.required && e.toggleAttribute("disabled", e === t.target);
16
+ });
17
+ });
18
+ }
19
+ connectedCallback() {
20
+ this.addEventListener("open", this.onOpen, { capture: !0 });
21
+ }
22
+ disconnectedCallback() {
23
+ this.removeEventListener("open", this.onOpen, { capture: !0 });
24
+ }
25
+ get required() {
26
+ return this.hasAttribute("required");
27
+ }
28
+ }
29
+ const w = class extends HTMLElement {
30
+ constructor() {
31
+ super();
11
32
  s(this, "timeouts", /* @__PURE__ */ new Map());
12
33
  s(this, "index", 0);
34
+ new MutationObserver((e) => {
35
+ e.forEach((i) => {
36
+ i.addedNodes.forEach((n) => {
37
+ n instanceof HTMLElement && this.show(n);
38
+ });
39
+ });
40
+ }).observe(this, { childList: !0 });
13
41
  }
14
42
  connectedCallback() {
15
43
  this.hasAttribute("role") || this.setAttribute("role", "status"), this.hasAttribute("aria-live") || this.setAttribute("aria-live", "polite"), this.hasAttribute("aria-relevant") || this.setAttribute("aria-relevant", "additions");
44
+ for (const t of this.children)
45
+ this.show(t, { animate: !1 });
16
46
  }
17
47
  show(t, e = {}) {
18
- const i = e.key || String(this.index++);
19
- this.dismiss(i), t.dataset.key = i, E(this.children, () => {
20
- this.append(t), l(t);
48
+ const i = e.key || t.dataset.key || String(this.index++);
49
+ t.dataset.key = i, this.contains(t) ? h(t) : e.animate === !1 ? this.append(t) : k(this.children, () => {
50
+ this.append(t), h(t);
21
51
  });
22
- const n = typeof e.duration < "u" ? Number(e.duration) : v.duration;
52
+ const n = Number(
53
+ e.duration !== void 0 ? e.duration : t.dataset.duration || w.duration
54
+ );
23
55
  return n > 0 && (this.startTimeout(t, n), t.addEventListener("mouseenter", this.clearTimeout.bind(this, t)), t.addEventListener("focusin", this.clearTimeout.bind(this, t)), t.addEventListener(
24
56
  "mouseleave",
25
57
  this.startTimeout.bind(this, t, n)
@@ -37,8 +69,8 @@ const v = class extends HTMLElement {
37
69
  });
38
70
  return;
39
71
  }
40
- E(this.children, () => {
41
- u(t, {
72
+ k(this.children, () => {
73
+ d(t, {
42
74
  finish: () => this.removeChild(t)
43
75
  });
44
76
  }), this.clearTimeout(t);
@@ -72,9 +104,55 @@ const v = class extends HTMLElement {
72
104
  this.timeouts.has(t) && clearTimeout(this.timeouts.get(t));
73
105
  }
74
106
  };
75
- let f = v;
76
- s(f, "duration", 1e4);
77
- const w = class extends HTMLElement {
107
+ let b = w;
108
+ s(b, "duration", 1e4);
109
+ function C(o) {
110
+ return o.altKey || o.ctrlKey || o.metaKey || o.shiftKey || o.button !== void 0 && o.button !== 0;
111
+ }
112
+ class $ extends HTMLElement {
113
+ constructor() {
114
+ super(...arguments);
115
+ s(this, "onButtonClick", (t) => {
116
+ !C(t) && !this.disabled && (this.open = !this.open, t.preventDefault());
117
+ });
118
+ }
119
+ static get observedAttributes() {
120
+ return ["open"];
121
+ }
122
+ connectedCallback() {
123
+ this.content.hidden = !this.open, this.button.setAttribute("aria-expanded", String(this.open)), this.button.addEventListener("click", this.onButtonClick);
124
+ }
125
+ disconnectedCallback() {
126
+ v(this.content), this.button.removeAttribute("aria-expanded"), this.button.removeEventListener("click", this.onButtonClick);
127
+ }
128
+ get open() {
129
+ return this.hasAttribute("open");
130
+ }
131
+ set open(t) {
132
+ t ? this.setAttribute("open", "") : this.removeAttribute("open");
133
+ }
134
+ get disabled() {
135
+ return this.hasAttribute("disabled");
136
+ }
137
+ attributeChangedCallback(t, e, i) {
138
+ t === "open" && (i !== null ? this.wasOpened() : this.wasClosed());
139
+ }
140
+ wasOpened() {
141
+ this.content.hidden && (this.content.hidden = !1, h(this.content), this.button.setAttribute("aria-expanded", "true"), this.dispatchEvent(new Event("open")));
142
+ }
143
+ wasClosed() {
144
+ this.content.hidden || (this.button.setAttribute("aria-expanded", "false"), d(this.content, {
145
+ finish: () => this.content.hidden = !0
146
+ }), this.dispatchEvent(new Event("close")));
147
+ }
148
+ get button() {
149
+ return this.querySelector("button, [role=button]");
150
+ }
151
+ get content() {
152
+ return this.children[1];
153
+ }
154
+ }
155
+ const y = class extends HTMLElement {
78
156
  constructor() {
79
157
  super(...arguments);
80
158
  s(this, "search", "");
@@ -91,7 +169,7 @@ const w = class extends HTMLElement {
91
169
  }
92
170
  t.key.length > 1 || t.ctrlKey || t.metaKey || t.altKey || (this.search += t.key.toLowerCase(), t.preventDefault(), clearTimeout(this.searchTimeout), this.searchTimeout = window.setTimeout(() => {
93
171
  this.search = "";
94
- }, w.searchDelay), this.items.some((e) => {
172
+ }, y.searchDelay), this.items.some((e) => {
95
173
  var i;
96
174
  return ((i = e.textContent) == null ? void 0 : i.trim().toLowerCase().indexOf(this.search)) === 0 ? (e.focus(), !0) : !1;
97
175
  }));
@@ -109,7 +187,7 @@ const w = class extends HTMLElement {
109
187
  get items() {
110
188
  return Array.from(
111
189
  this.querySelectorAll("[role^=menuitem]")
112
- ).filter((t) => D(t));
190
+ ).filter((t) => H(t));
113
191
  }
114
192
  navigate(t) {
115
193
  var n;
@@ -118,9 +196,9 @@ const w = class extends HTMLElement {
118
196
  i < 0 && (i = e.length - 1), i >= e.length && (i = 0), (n = e[i]) == null || n.focus();
119
197
  }
120
198
  };
121
- let m = w;
122
- s(m, "searchDelay", 800);
123
- const d = class extends HTMLElement {
199
+ let f = y;
200
+ s(f, "searchDelay", 800);
201
+ const u = class extends HTMLElement {
124
202
  constructor() {
125
203
  super();
126
204
  s(this, "focusTrap");
@@ -133,18 +211,19 @@ const d = class extends HTMLElement {
133
211
  const e = this.attachShadow({ mode: "open" });
134
212
  e.appendChild(t.content.cloneNode(!0)), this.backdrop.addEventListener("click", () => {
135
213
  var i;
136
- this.hasAttribute("static") ? (i = d.attention) == null || i.call(d, e.children[1]) : this.close();
137
- }), this.focusTrap = H(this, {
214
+ this.hasAttribute("static") ? (i = u.attention) == null || i.call(u, e.children[1]) : this.close();
215
+ }), this.focusTrap = O(this, {
138
216
  escapeDeactivates: !1,
139
- allowOutsideClick: !0
217
+ allowOutsideClick: !0,
218
+ preventScroll: !0
140
219
  });
141
220
  }
142
221
  static get observedAttributes() {
143
222
  return ["open"];
144
223
  }
145
224
  connectedCallback() {
146
- var t, e, i, n, r, y;
147
- this.connected = !0, (t = this.content) != null && t.hasAttribute("role") || (e = this.content) == null || e.setAttribute("role", "dialog"), (i = this.content) != null && i.hasAttribute("aria-modal") || (n = this.content) == null || n.setAttribute("aria-modal", "true"), (r = this.content) != null && r.hasAttribute("tabindex") || (y = this.content) == null || y.setAttribute("tabindex", "-1"), this.addEventListener("keydown", (p) => {
225
+ var t, e, i, n, a, E;
226
+ this.connected = !0, (t = this.content) != null && t.hasAttribute("role") || (e = this.content) == null || e.setAttribute("role", "dialog"), (i = this.content) != null && i.hasAttribute("aria-modal") || (n = this.content) == null || n.setAttribute("aria-modal", "true"), (a = this.content) != null && a.hasAttribute("tabindex") || (E = this.content) == null || E.setAttribute("tabindex", "-1"), this.addEventListener("keydown", (p) => {
148
227
  p.key === "Escape" && this.open && (p.preventDefault(), p.stopPropagation(), this.close());
149
228
  }), this.open && this.wasOpened();
150
229
  }
@@ -168,11 +247,11 @@ const d = class extends HTMLElement {
168
247
  }
169
248
  wasOpened() {
170
249
  var t, e;
171
- this.hidden = !1, l(this), (t = this.focusTrap) == null || t.activate(), (e = this.querySelector("[autofocus]")) == null || e.focus(), this.dispatchEvent(new Event("open"));
250
+ this.hidden = !1, h(this), (t = this.focusTrap) == null || t.activate(), (e = this.querySelector("[autofocus]")) == null || e.focus(), this.dispatchEvent(new Event("open"));
172
251
  }
173
252
  wasClosed() {
174
253
  var t;
175
- (t = this.focusTrap) == null || t.deactivate(), u(this, {
254
+ (t = this.focusTrap) == null || t.deactivate(), d(this, {
176
255
  finish: () => this.hidden = !0
177
256
  }), this.dispatchEvent(new Event("close"));
178
257
  }
@@ -184,8 +263,8 @@ const d = class extends HTMLElement {
184
263
  return this.firstElementChild;
185
264
  }
186
265
  };
187
- let b = d;
188
- s(b, "attention", (t) => t.animate(
266
+ let m = u;
267
+ s(m, "attention", (t) => t.animate(
189
268
  [
190
269
  { transform: "scale(1)" },
191
270
  { transform: "scale(1.1)" },
@@ -193,10 +272,26 @@ s(b, "attention", (t) => t.animate(
193
272
  ],
194
273
  300
195
274
  ));
196
- class F extends HTMLElement {
275
+ class P extends HTMLElement {
197
276
  constructor() {
198
277
  super();
199
278
  s(this, "cleanup");
279
+ s(this, "onButtonClick", (t) => {
280
+ !C(t) && !this.disabled && (this.open = !this.open, t.preventDefault());
281
+ });
282
+ s(this, "onButtonKeyDown", (t) => {
283
+ var e;
284
+ t.key === "ArrowDown" && !this.disabled && (t.preventDefault(), this.open = !0, (e = A(this.content)[0]) == null || e.focus());
285
+ });
286
+ s(this, "onKeyDown", (t) => {
287
+ t.key === "Escape" && this.open && (t.preventDefault(), t.stopPropagation(), this.open = !1, this.button.focus());
288
+ });
289
+ s(this, "onFocusOut", (t) => {
290
+ (!(t.relatedTarget instanceof Node) || !this.contains(t.relatedTarget)) && (this.open = !1);
291
+ });
292
+ s(this, "onContentClick", (t) => {
293
+ t.target instanceof Element && t.target.closest("[role=menuitem], [role=menuitemradio]") && (this.open = !1, this.button.focus());
294
+ });
200
295
  const t = document.createElement("template");
201
296
  t.innerHTML = `
202
297
  <div part="backdrop" hidden style="position: fixed; top: 0; left: 0; right: 0; bottom: 0"></div>
@@ -209,21 +304,10 @@ class F extends HTMLElement {
209
304
  connectedCallback() {
210
305
  this.backdrop.hidden = !0, this.content.hidden = !0, this.open = !1, this.button.setAttribute("aria-expanded", "false"), setTimeout(() => {
211
306
  this.content.getAttribute("role") === "menu" && this.button.setAttribute("aria-haspopup", "true");
212
- }), this.button.addEventListener("click", () => {
213
- this.open = !this.open;
214
- }), this.button.addEventListener("keydown", (t) => {
215
- var e;
216
- t.key === "ArrowDown" && (t.preventDefault(), this.open = !0, (e = g(this.content)[0]) == null || e.focus());
217
- }), this.addEventListener("keydown", (t) => {
218
- t.key === "Escape" && this.open && (t.preventDefault(), t.stopPropagation(), this.open = !1, this.button.focus());
219
- }), this.addEventListener("focusout", (t) => {
220
- (!(t.relatedTarget instanceof Node) || !this.contains(t.relatedTarget)) && (this.open = !1);
221
- }), this.content.addEventListener("click", (t) => {
222
- t.target instanceof Element && t.target.closest("[role=menuitem], [role=menuitemradio]") && (this.open = !1, this.button.focus());
223
- });
307
+ }), this.button.addEventListener("click", this.onButtonClick), this.button.addEventListener("keydown", this.onButtonKeyDown), this.addEventListener("keydown", this.onKeyDown), this.addEventListener("focusout", this.onFocusOut), this.content.addEventListener("click", this.onContentClick);
224
308
  }
225
309
  disconnectedCallback() {
226
- k(this.backdrop), k(this.content);
310
+ v(this.backdrop), v(this.content), this.button.removeAttribute("aria-expanded"), this.button.removeAttribute("aria-haspopup"), this.button.removeEventListener("click", this.onButtonClick), this.button.removeEventListener("keydown", this.onButtonKeyDown), this.removeEventListener("keydown", this.onKeyDown), this.removeEventListener("focusout", this.onFocusOut), this.content.removeEventListener("click", this.onContentClick);
227
311
  }
228
312
  get open() {
229
313
  return this.hasAttribute("open");
@@ -231,22 +315,25 @@ class F extends HTMLElement {
231
315
  set open(t) {
232
316
  t ? this.setAttribute("open", "") : this.removeAttribute("open");
233
317
  }
318
+ get disabled() {
319
+ return this.hasAttribute("disabled");
320
+ }
234
321
  attributeChangedCallback(t, e, i) {
235
322
  t === "open" && (i !== null ? this.wasOpened() : this.wasClosed());
236
323
  }
237
324
  wasOpened() {
238
325
  if (!this.content.hidden)
239
326
  return;
240
- this.content.hidden = !1, this.backdrop.hidden = !1, l(this.content), l(this.backdrop), this.button.setAttribute("aria-expanded", "true"), this.content.style.position = "absolute", this.cleanup = M(
327
+ this.content.hidden = !1, this.backdrop.hidden = !1, h(this.content), h(this.backdrop), this.button.setAttribute("aria-expanded", "true"), this.content.style.position = "absolute", this.cleanup = M(
241
328
  this.button,
242
329
  this.content,
243
330
  () => {
244
- A(this.button, this.content, {
331
+ g(this.button, this.content, {
245
332
  placement: this.getAttribute("placement") || "bottom",
246
333
  middleware: [
247
334
  L(),
248
335
  x(),
249
- O({
336
+ K({
250
337
  apply: ({ availableWidth: e, availableHeight: i }) => {
251
338
  Object.assign(this.content.style, {
252
339
  maxWidth: "",
@@ -271,9 +358,9 @@ class F extends HTMLElement {
271
358
  }
272
359
  wasClosed() {
273
360
  var t;
274
- this.content.hidden || (this.button.setAttribute("aria-expanded", "false"), (t = this.cleanup) == null || t.call(this), u(this.backdrop, {
361
+ this.content.hidden || (this.button.setAttribute("aria-expanded", "false"), (t = this.cleanup) == null || t.call(this), d(this.backdrop, {
275
362
  finish: () => this.backdrop.hidden = !0
276
- }), u(this.content, {
363
+ }), d(this.content, {
277
364
  finish: () => this.content.hidden = !0
278
365
  }), this.dispatchEvent(new Event("close")));
279
366
  }
@@ -282,13 +369,13 @@ class F extends HTMLElement {
282
369
  return (t = this.shadowRoot) == null ? void 0 : t.firstElementChild;
283
370
  }
284
371
  get button() {
285
- return this.children[0];
372
+ return this.querySelector("button, [role=button]");
286
373
  }
287
374
  get content() {
288
375
  return this.children[1];
289
376
  }
290
377
  }
291
- class $ extends HTMLElement {
378
+ class j extends HTMLElement {
292
379
  constructor() {
293
380
  super(...arguments);
294
381
  s(this, "onInitialFocus", () => {
@@ -300,8 +387,8 @@ class $ extends HTMLElement {
300
387
  const e = this.controls, i = this.controls.length, n = e.indexOf(t.target);
301
388
  if (n === -1)
302
389
  return;
303
- let r = 0;
304
- t.key === "ArrowLeft" && (r = n - 1), t.key === "ArrowRight" && (r = n + 1), t.key === "End" && (r = i - 1), r < 0 && (r = i - 1), r > i - 1 && (r = 0), this.focusControlAtIndex(r), t.preventDefault();
390
+ let a = 0;
391
+ t.key === "ArrowLeft" && (a = n - 1), t.key === "ArrowRight" && (a = n + 1), t.key === "End" && (a = i - 1), a < 0 && (a = i - 1), a > i - 1 && (a = 0), this.focusControlAtIndex(a), t.preventDefault();
305
392
  });
306
393
  }
307
394
  connectedCallback() {
@@ -316,10 +403,10 @@ class $ extends HTMLElement {
316
403
  });
317
404
  }
318
405
  get controls() {
319
- return g(this);
406
+ return A(this);
320
407
  }
321
408
  }
322
- const c = class extends HTMLElement {
409
+ const l = class extends HTMLElement {
323
410
  constructor() {
324
411
  super(...arguments);
325
412
  s(this, "parent");
@@ -356,8 +443,8 @@ const c = class extends HTMLElement {
356
443
  if (this.disabled)
357
444
  return;
358
445
  const t = this.createTooltip();
359
- clearTimeout(this.timeout), this.showing || (t.hidden = !1, l(t), this.showing = !0), t.innerHTML !== this.innerHTML && (t.innerHTML = this.innerHTML), t.style.position = "absolute", A(this.parent, t, {
360
- placement: this.getAttribute("placement") || c.placement,
446
+ clearTimeout(this.timeout), this.showing || (t.hidden = !1, h(t), this.showing = !0), t.innerHTML !== this.innerHTML && (t.innerHTML = this.innerHTML), t.style.position = "absolute", g(this.parent, t, {
447
+ placement: this.getAttribute("placement") || l.placement,
361
448
  middleware: [L(), x()]
362
449
  }).then(({ x: e, y: i, placement: n }) => {
363
450
  Object.assign(t.style, {
@@ -367,7 +454,7 @@ const c = class extends HTMLElement {
367
454
  });
368
455
  }
369
456
  hide() {
370
- clearTimeout(this.timeout), this.showing && (this.showing = !1, u(this.tooltip, {
457
+ clearTimeout(this.timeout), this.showing && (this.showing = !1, d(this.tooltip, {
371
458
  finish: () => {
372
459
  this.tooltip && (this.tooltip.hidden = !0);
373
460
  }
@@ -378,23 +465,25 @@ const c = class extends HTMLElement {
378
465
  const e = parseInt(this.getAttribute("delay") || "");
379
466
  this.timeout = window.setTimeout(
380
467
  t.bind(this),
381
- isNaN(e) ? c.delay : e
468
+ isNaN(e) ? l.delay : e
382
469
  );
383
470
  }
384
471
  createTooltip() {
385
- return this.tooltip || (this.tooltip = document.createElement("div"), this.tooltip.className = this.getAttribute("tooltip-class") || c.tooltipClass, this.tooltip.hidden = !0, this.tooltip.addEventListener("mouseenter", this.show.bind(this)), this.tooltip.addEventListener(
472
+ return this.tooltip || (this.tooltip = document.createElement("div"), this.tooltip.className = this.getAttribute("tooltip-class") || l.tooltipClass, this.tooltip.hidden = !0, this.tooltip.addEventListener("mouseenter", this.show.bind(this)), this.tooltip.addEventListener(
386
473
  "mouseleave",
387
474
  this.afterDelay.bind(this, this.hide)
388
475
  ), document.body.appendChild(this.tooltip)), this.tooltip;
389
476
  }
390
477
  };
391
- let h = c;
392
- s(h, "delay", 100), s(h, "placement", "top"), s(h, "tooltipClass", "tooltip");
478
+ let c = l;
479
+ s(c, "delay", 100), s(c, "placement", "top"), s(c, "tooltipClass", "tooltip");
393
480
  export {
394
- f as AlertsElement,
395
- m as MenuElement,
396
- b as ModalElement,
397
- F as PopupElement,
398
- $ as ToolbarElement,
399
- h as TooltipElement
481
+ I as AccordionElement,
482
+ b as AlertsElement,
483
+ $ as DisclosureElement,
484
+ f as MenuElement,
485
+ m as ModalElement,
486
+ P as PopupElement,
487
+ j as ToolbarElement,
488
+ c as TooltipElement
400
489
  };
@@ -0,0 +1,6 @@
1
+ export default class AccordionElement extends HTMLElement {
2
+ connectedCallback(): void;
3
+ disconnectedCallback(): void;
4
+ private onOpen;
5
+ get required(): boolean;
6
+ }
@@ -1,11 +1,13 @@
1
- export declare type AlertOptions = {
1
+ export type AlertOptions = {
2
2
  key?: string;
3
3
  duration?: number;
4
+ animate?: boolean;
4
5
  };
5
6
  export default class AlertsElement extends HTMLElement {
6
7
  static duration: number;
7
8
  private timeouts;
8
9
  private index;
10
+ constructor();
9
11
  connectedCallback(): void;
10
12
  show(el: HTMLElement, options?: AlertOptions): string;
11
13
  dismiss(el: HTMLElement): void;
@@ -0,0 +1,14 @@
1
+ export default class DisclosureElement extends HTMLElement {
2
+ static get observedAttributes(): string[];
3
+ connectedCallback(): void;
4
+ disconnectedCallback(): void;
5
+ private onButtonClick;
6
+ get open(): boolean;
7
+ set open(val: boolean);
8
+ get disabled(): boolean;
9
+ attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
10
+ private wasOpened;
11
+ private wasClosed;
12
+ private get button();
13
+ private get content();
14
+ }
@@ -1,4 +1,6 @@
1
+ export { default as AccordionElement } from './accordion/accordion';
1
2
  export { default as AlertsElement } from './alerts/alerts';
3
+ export { default as DisclosureElement } from './disclosure/disclosure';
2
4
  export { default as MenuElement } from './menu/menu';
3
5
  export { default as ModalElement } from './modal/modal';
4
6
  export { default as PopupElement } from './popup/popup';
@@ -4,8 +4,14 @@ export default class PopupElement extends HTMLElement {
4
4
  constructor();
5
5
  connectedCallback(): void;
6
6
  disconnectedCallback(): void;
7
+ private onButtonClick;
8
+ private onButtonKeyDown;
9
+ private onKeyDown;
10
+ private onFocusOut;
11
+ private onContentClick;
7
12
  get open(): boolean;
8
13
  set open(val: boolean);
14
+ get disabled(): boolean;
9
15
  attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
10
16
  private wasOpened;
11
17
  private wasClosed;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Determine whether the user is trying to open a link in a new tab.
3
+ */
4
+ export declare function shouldOpenInNewTab(e: MouseEvent): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inclusive-elements",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Accessible, lightweight, unstyled implementations of common UI controls.",
5
5
  "module": "dist/inclusive-elements.js",
6
6
  "type": "module",
@@ -15,30 +15,35 @@
15
15
  "dev": "vite",
16
16
  "build": "tsc --noEmit && vite build && tsc --emitDeclarationOnly",
17
17
  "preview": "vite preview",
18
- "release": "release-it --npm.tag=latest"
18
+ "release": "release-it"
19
19
  },
20
20
  "dependencies": {
21
- "@floating-ui/dom": "^1.0.0",
22
- "focus-trap": "^6.7.2",
23
- "hello-goodbye": "^0.1.0-beta.5",
24
- "tabbable": "^5.2.1"
21
+ "@floating-ui/dom": "^1.2.4",
22
+ "focus-trap": "^6.9.4",
23
+ "hello-goodbye": "^0.1.1",
24
+ "tabbable": "^5.3.3"
25
25
  },
26
26
  "devDependencies": {
27
- "@release-it/keep-a-changelog": "^2.3.0",
28
- "prettier": "^2.6.2",
29
- "release-it": "^14.12.4",
30
- "typescript": "^4.5.5",
31
- "vite": "^3.0.4"
27
+ "@release-it/conventional-changelog": "^5.1.1",
28
+ "prettier": "^2.8.4",
29
+ "release-it": "^15.9.0",
30
+ "typescript": "^5.0.2",
31
+ "vite": "^4.2.0"
32
32
  },
33
33
  "release-it": {
34
+ "git": {
35
+ "commitMessage": "release: v${version}",
36
+ "tagName": "v${version}"
37
+ },
34
38
  "github": {
35
- "release": true
39
+ "release": true,
40
+ "releaseName": "v${version}"
36
41
  },
37
42
  "plugins": {
38
- "@release-it/keep-a-changelog": {
39
- "filename": "CHANGELOG.md",
40
- "addUnreleased": true,
41
- "addVersionUrl": true
43
+ "@release-it/conventional-changelog": {
44
+ "preset": "conventionalcommits",
45
+ "infile": "CHANGELOG.md",
46
+ "header": "# Changelog"
42
47
  }
43
48
  },
44
49
  "hooks": {