@y14e/disclosure-css 2.0.12 → 2.1.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/README.md CHANGED
@@ -13,11 +13,11 @@ npm i @y14e/disclosure-css
13
13
  import { Disclosure } from '@y14e/disclosure-css';
14
14
 
15
15
  // CDNs
16
- import { Disclosure } from 'https://esm.sh/@y14e/disclosure-css@2.0.12';
16
+ import { Disclosure } from 'https://esm.sh/@y14e/disclosure-css@2.1.1';
17
17
  // or
18
- import { Disclosure } from 'https://cdn.jsdelivr.net/npm/@y14e/disclosure-css@2.0.12/+esm';
18
+ import { Disclosure } from 'https://cdn.jsdelivr.net/npm/@y14e/disclosure-css@2.1.1/+esm';
19
19
  // or
20
- import { Disclosure } from 'https://esm.unpkg.com/@y14e/disclosure-css@2.0.12';
20
+ import { Disclosure } from 'https://esm.unpkg.com/@y14e/disclosure-css@2.1.1';
21
21
  ```
22
22
 
23
23
  ## Usage
@@ -207,31 +207,25 @@ function normalizeRadioGroup(elements) {
207
207
  map = /* @__PURE__ */ new Map();
208
208
  }
209
209
  const root = element.getRootNode();
210
- let groups = map.get(root);
210
+ const groups = map.get(root) ?? map.set(root, /* @__PURE__ */ new Map()).get(root);
211
211
  if (!groups) {
212
- groups = /* @__PURE__ */ new Map();
213
- map.set(root, groups);
214
- }
215
- let group = groups.get(element.form);
216
- if (!group) {
217
- group = /* @__PURE__ */ new Map();
218
- groups.set(element.form, group);
212
+ continue;
219
213
  }
220
- let radios = group.get(element.name);
214
+ const { form, name } = element;
215
+ const radios = groups.get(form) ?? groups.set(form, /* @__PURE__ */ new Map()).get(form);
221
216
  if (!radios) {
222
- radios = [];
223
- group.set(element.name, radios);
217
+ continue;
224
218
  }
225
- radios.push(element);
219
+ (radios.get(name) ?? radios.set(name, []).get(name))?.push(element);
226
220
  }
227
221
  if (!map) {
228
222
  return elements;
229
223
  }
230
224
  const placeholder = /* @__PURE__ */ new Set();
231
- for (const groups of map.values()) {
232
- for (const group of groups.values()) {
233
- for (const radios of group.values()) {
234
- const radio = radios.find((r) => r.checked) ?? radios[0];
225
+ for (const v of map.values()) {
226
+ for (const w of v.values()) {
227
+ for (const x of w.values()) {
228
+ const radio = x.find((r) => r.checked) ?? x[0];
235
229
  radio && placeholder.add(radio);
236
230
  }
237
231
  }
@@ -352,14 +346,15 @@ function resolveOptions2(options) {
352
346
  }
353
347
 
354
348
  // node_modules/@y14e/roving-tabindex/dist/index.js
349
+ var DIRECTIONS = ["both", "grid", "horizontal", "vertical"];
355
350
  function createRovingTabIndex(container, options = {}) {
356
351
  if (!(container instanceof Element)) {
357
352
  console.warn("Invalid container element");
358
353
  return () => {
359
354
  };
360
355
  }
361
- const roving = new RovingTabIndex(container, options);
362
- return () => roving.destroy();
356
+ const rovingTabIndex = new RovingTabIndex(container, options);
357
+ return () => rovingTabIndex.destroy();
363
358
  }
364
359
  var RovingTabIndex = class _RovingTabIndex {
365
360
  static #initialized = /* @__PURE__ */ new Set();
@@ -418,18 +413,19 @@ var RovingTabIndex = class _RovingTabIndex {
418
413
  if (!(event instanceof KeyboardEvent)) {
419
414
  return;
420
415
  }
416
+ const { direction, typeahead, wrap = false } = this.#settings;
417
+ const isGrid = direction === "grid";
421
418
  const { key, altKey, ctrlKey, metaKey, shiftKey } = event;
422
- if (altKey || ctrlKey || metaKey || shiftKey) {
419
+ if (!(isGrid && ["End", "Home"].includes(key)) && ctrlKey || altKey || metaKey || shiftKey) {
423
420
  return;
424
421
  }
425
- const { direction, typeahead, wrap } = this.#settings;
426
422
  const isBoth = direction === "both";
427
423
  const isHorizontal = direction === "horizontal";
428
424
  if (![
429
425
  "End",
430
426
  "Home",
431
- ...isBoth ? ["ArrowLeft", "ArrowUp"] : [`Arrow${isHorizontal ? "Left" : "Up"}`],
432
- ...isBoth ? ["ArrowRight", "ArrowDown"] : [`Arrow${isHorizontal ? "Right" : "Down"}`]
427
+ ...isGrid || isBoth ? ["ArrowLeft", "ArrowUp"] : [`Arrow${isHorizontal ? "Left" : "Up"}`],
428
+ ...isGrid || isBoth ? ["ArrowRight", "ArrowDown"] : [`Arrow${isHorizontal ? "Right" : "Down"}`]
433
429
  ].includes(key)) {
434
430
  if (!typeahead || !/^\S$/i.test(key) || !this.#focusablesByFirstChar.has(key.toUpperCase())) {
435
431
  return;
@@ -448,39 +444,48 @@ var RovingTabIndex = class _RovingTabIndex {
448
444
  event.preventDefault();
449
445
  let newIndex;
450
446
  const activeIndex = candidates.indexOf(active);
451
- let focusables = candidates;
447
+ let target = candidates;
452
448
  switch (key) {
453
449
  case "End":
454
- newIndex = -1;
455
- break;
456
- case "Home":
457
- newIndex = 0;
458
- break;
459
- case "ArrowLeft":
460
- case "ArrowUp": {
461
- const rawIndex = activeIndex - 1;
462
- newIndex = wrap ? rawIndex : Math.max(rawIndex, 0);
450
+ case "Home": {
451
+ const rawIndex = key === "End" ? -1 : 0;
452
+ if (isGrid && !ctrlKey) {
453
+ const cell = this.#getCellsOfActiveRow().at(rawIndex);
454
+ newIndex = cell ? candidates.indexOf(cell) : activeIndex;
455
+ } else {
456
+ newIndex = rawIndex;
457
+ }
463
458
  break;
464
459
  }
460
+ case "ArrowLeft":
461
+ case "ArrowUp":
465
462
  case "ArrowRight":
466
463
  case "ArrowDown": {
467
- const rawIndex = activeIndex + 1;
468
- const length = focusables.length;
469
- newIndex = wrap ? rawIndex % length : Math.min(rawIndex, length - 1);
464
+ if (["ArrowUp", "ArrowDown"].includes(key) && isGrid) {
465
+ const cell = this.#getNextCell(key, wrap);
466
+ newIndex = cell ? candidates.indexOf(cell) : activeIndex;
467
+ } else {
468
+ if (isGrid) {
469
+ target = this.#getCellsOfActiveRow();
470
+ }
471
+ const isPrevious = ["ArrowLeft", "ArrowUp"].includes(key);
472
+ const rawIndex = (isGrid ? target.indexOf(active) : activeIndex) + (isPrevious ? -1 : 1);
473
+ newIndex = isPrevious ? wrap ? rawIndex : Math.max(rawIndex, 0) : wrap ? rawIndex % target.length : Math.min(rawIndex, target.length - 1);
474
+ }
470
475
  break;
471
476
  }
472
477
  default: {
473
478
  const focusablesByFirstChar = new Set(
474
479
  this.#focusablesByFirstChar.get(key.toUpperCase()) ?? []
475
480
  );
476
- focusables = candidates.filter((c) => focusablesByFirstChar.has(c));
477
- const afterIndex = focusables.findIndex(
481
+ target = candidates.filter((c) => focusablesByFirstChar.has(c));
482
+ const afterIndex = target.findIndex(
478
483
  (f) => candidates.indexOf(f) > activeIndex
479
484
  );
480
485
  newIndex = afterIndex >= 0 ? afterIndex : 0;
481
486
  }
482
487
  }
483
- const focusable = focusables.at(newIndex);
488
+ const focusable = target.at(newIndex);
484
489
  focusable && focusElement(focusable);
485
490
  };
486
491
  #update(active) {
@@ -550,6 +555,24 @@ var RovingTabIndex = class _RovingTabIndex {
550
555
  const { selector } = this.#settings;
551
556
  return (element) => !selector || [...this.#container.querySelectorAll(selector)].includes(element);
552
557
  }
558
+ #getCellCoords(cell) {
559
+ const { height, left, top, width } = cell.getBoundingClientRect();
560
+ return {
561
+ x: left + width / 2,
562
+ y: top + height / 2
563
+ };
564
+ }
565
+ #getCellsOfActiveRow() {
566
+ const active = getActiveElement();
567
+ if (!(active instanceof Element)) {
568
+ return [];
569
+ }
570
+ const activeRect = active.getBoundingClientRect();
571
+ return this.#getFocusables().filter((cell) => {
572
+ const cellRect = cell.getBoundingClientRect();
573
+ return cellRect.top < activeRect.bottom && cellRect.bottom > activeRect.top;
574
+ });
575
+ }
553
576
  #getFocusables() {
554
577
  return getFocusables(this.#container, {
555
578
  composed: true,
@@ -558,6 +581,50 @@ var RovingTabIndex = class _RovingTabIndex {
558
581
  skipVisibilityCheck: true
559
582
  });
560
583
  }
584
+ #getNextCell(key, wrap) {
585
+ const cells = this.#getFocusables();
586
+ const active = getActiveElement();
587
+ if (!(active instanceof Element)) {
588
+ return null;
589
+ }
590
+ const activeCoords = this.#getCellCoords(active);
591
+ let min = Infinity;
592
+ let result = null;
593
+ for (const cell of cells) {
594
+ if (cell === active) {
595
+ continue;
596
+ }
597
+ const cellCoords = this.#getCellCoords(cell);
598
+ const distances = {
599
+ x: Math.abs(cellCoords.x - activeCoords.x),
600
+ y: Math.abs(cellCoords.y - activeCoords.y)
601
+ };
602
+ if (key === "ArrowUp" && cellCoords.y < activeCoords.y && distances.x < distances.y || key === "ArrowDown" && cellCoords.y > activeCoords.y && distances.x < distances.y) {
603
+ const distance = distances.x ** 2 + distances.y ** 2;
604
+ if (distance < min) {
605
+ min = distance;
606
+ result = cell;
607
+ }
608
+ }
609
+ }
610
+ if (!result && wrap) {
611
+ let max = -Infinity;
612
+ for (const cell of cells) {
613
+ if (cell === active) {
614
+ continue;
615
+ }
616
+ const cellCoords = this.#getCellCoords(cell);
617
+ if (Math.abs(cellCoords.x - activeCoords.x) < cell.getBoundingClientRect().width / 2) {
618
+ const distance = key === "ArrowUp" ? cellCoords.y - activeCoords.y : activeCoords.y - cellCoords.y;
619
+ if (distance > max) {
620
+ max = distance;
621
+ result = cell;
622
+ }
623
+ }
624
+ }
625
+ }
626
+ return result;
627
+ }
561
628
  #resolveOptions(options) {
562
629
  let {
563
630
  direction = "both",
@@ -569,7 +636,7 @@ var RovingTabIndex = class _RovingTabIndex {
569
636
  wrap = false
570
637
  } = options;
571
638
  direction = direction.toLowerCase();
572
- if (!["both", "horizontal", "vertical"].includes(direction)) {
639
+ if (!DIRECTIONS.includes(direction)) {
573
640
  console.warn("Invalid direction option. Fallback: 'both'.");
574
641
  direction = "both";
575
642
  }
@@ -780,7 +847,7 @@ var Disclosure = class _Disclosure {
780
847
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
781
848
  * Using the <details> and <summary> element.
782
849
  *
783
- * @version 2.0.11
850
+ * @version 2.1.1
784
851
  * @author Yusuke Kamiyamane
785
852
  * @license MIT
786
853
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -805,7 +872,7 @@ power-focusable/dist/index.js:
805
872
  * High-precision focus management utility with full composed tree support.
806
873
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
807
874
  *
808
- * @version 4.3.33
875
+ * @version 4.4.3
809
876
  * @author Yusuke Kamiyamane
810
877
  * @license MIT
811
878
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -818,7 +885,7 @@ power-focusable/dist/index.js:
818
885
  * Lightweight roving tabindex utility with fully focus management.
819
886
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
820
887
  *
821
- * @version 3.1.31
888
+ * @version 3.3.2
822
889
  * @author Yusuke Kamiyamane
823
890
  * @license MIT
824
891
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -205,31 +205,25 @@ function normalizeRadioGroup(elements) {
205
205
  map = /* @__PURE__ */ new Map();
206
206
  }
207
207
  const root = element.getRootNode();
208
- let groups = map.get(root);
208
+ const groups = map.get(root) ?? map.set(root, /* @__PURE__ */ new Map()).get(root);
209
209
  if (!groups) {
210
- groups = /* @__PURE__ */ new Map();
211
- map.set(root, groups);
212
- }
213
- let group = groups.get(element.form);
214
- if (!group) {
215
- group = /* @__PURE__ */ new Map();
216
- groups.set(element.form, group);
210
+ continue;
217
211
  }
218
- let radios = group.get(element.name);
212
+ const { form, name } = element;
213
+ const radios = groups.get(form) ?? groups.set(form, /* @__PURE__ */ new Map()).get(form);
219
214
  if (!radios) {
220
- radios = [];
221
- group.set(element.name, radios);
215
+ continue;
222
216
  }
223
- radios.push(element);
217
+ (radios.get(name) ?? radios.set(name, []).get(name))?.push(element);
224
218
  }
225
219
  if (!map) {
226
220
  return elements;
227
221
  }
228
222
  const placeholder = /* @__PURE__ */ new Set();
229
- for (const groups of map.values()) {
230
- for (const group of groups.values()) {
231
- for (const radios of group.values()) {
232
- const radio = radios.find((r) => r.checked) ?? radios[0];
223
+ for (const v of map.values()) {
224
+ for (const w of v.values()) {
225
+ for (const x of w.values()) {
226
+ const radio = x.find((r) => r.checked) ?? x[0];
233
227
  radio && placeholder.add(radio);
234
228
  }
235
229
  }
@@ -350,14 +344,15 @@ function resolveOptions2(options) {
350
344
  }
351
345
 
352
346
  // node_modules/@y14e/roving-tabindex/dist/index.js
347
+ var DIRECTIONS = ["both", "grid", "horizontal", "vertical"];
353
348
  function createRovingTabIndex(container, options = {}) {
354
349
  if (!(container instanceof Element)) {
355
350
  console.warn("Invalid container element");
356
351
  return () => {
357
352
  };
358
353
  }
359
- const roving = new RovingTabIndex(container, options);
360
- return () => roving.destroy();
354
+ const rovingTabIndex = new RovingTabIndex(container, options);
355
+ return () => rovingTabIndex.destroy();
361
356
  }
362
357
  var RovingTabIndex = class _RovingTabIndex {
363
358
  static #initialized = /* @__PURE__ */ new Set();
@@ -416,18 +411,19 @@ var RovingTabIndex = class _RovingTabIndex {
416
411
  if (!(event instanceof KeyboardEvent)) {
417
412
  return;
418
413
  }
414
+ const { direction, typeahead, wrap = false } = this.#settings;
415
+ const isGrid = direction === "grid";
419
416
  const { key, altKey, ctrlKey, metaKey, shiftKey } = event;
420
- if (altKey || ctrlKey || metaKey || shiftKey) {
417
+ if (!(isGrid && ["End", "Home"].includes(key)) && ctrlKey || altKey || metaKey || shiftKey) {
421
418
  return;
422
419
  }
423
- const { direction, typeahead, wrap } = this.#settings;
424
420
  const isBoth = direction === "both";
425
421
  const isHorizontal = direction === "horizontal";
426
422
  if (![
427
423
  "End",
428
424
  "Home",
429
- ...isBoth ? ["ArrowLeft", "ArrowUp"] : [`Arrow${isHorizontal ? "Left" : "Up"}`],
430
- ...isBoth ? ["ArrowRight", "ArrowDown"] : [`Arrow${isHorizontal ? "Right" : "Down"}`]
425
+ ...isGrid || isBoth ? ["ArrowLeft", "ArrowUp"] : [`Arrow${isHorizontal ? "Left" : "Up"}`],
426
+ ...isGrid || isBoth ? ["ArrowRight", "ArrowDown"] : [`Arrow${isHorizontal ? "Right" : "Down"}`]
431
427
  ].includes(key)) {
432
428
  if (!typeahead || !/^\S$/i.test(key) || !this.#focusablesByFirstChar.has(key.toUpperCase())) {
433
429
  return;
@@ -446,39 +442,48 @@ var RovingTabIndex = class _RovingTabIndex {
446
442
  event.preventDefault();
447
443
  let newIndex;
448
444
  const activeIndex = candidates.indexOf(active);
449
- let focusables = candidates;
445
+ let target = candidates;
450
446
  switch (key) {
451
447
  case "End":
452
- newIndex = -1;
453
- break;
454
- case "Home":
455
- newIndex = 0;
456
- break;
457
- case "ArrowLeft":
458
- case "ArrowUp": {
459
- const rawIndex = activeIndex - 1;
460
- newIndex = wrap ? rawIndex : Math.max(rawIndex, 0);
448
+ case "Home": {
449
+ const rawIndex = key === "End" ? -1 : 0;
450
+ if (isGrid && !ctrlKey) {
451
+ const cell = this.#getCellsOfActiveRow().at(rawIndex);
452
+ newIndex = cell ? candidates.indexOf(cell) : activeIndex;
453
+ } else {
454
+ newIndex = rawIndex;
455
+ }
461
456
  break;
462
457
  }
458
+ case "ArrowLeft":
459
+ case "ArrowUp":
463
460
  case "ArrowRight":
464
461
  case "ArrowDown": {
465
- const rawIndex = activeIndex + 1;
466
- const length = focusables.length;
467
- newIndex = wrap ? rawIndex % length : Math.min(rawIndex, length - 1);
462
+ if (["ArrowUp", "ArrowDown"].includes(key) && isGrid) {
463
+ const cell = this.#getNextCell(key, wrap);
464
+ newIndex = cell ? candidates.indexOf(cell) : activeIndex;
465
+ } else {
466
+ if (isGrid) {
467
+ target = this.#getCellsOfActiveRow();
468
+ }
469
+ const isPrevious = ["ArrowLeft", "ArrowUp"].includes(key);
470
+ const rawIndex = (isGrid ? target.indexOf(active) : activeIndex) + (isPrevious ? -1 : 1);
471
+ newIndex = isPrevious ? wrap ? rawIndex : Math.max(rawIndex, 0) : wrap ? rawIndex % target.length : Math.min(rawIndex, target.length - 1);
472
+ }
468
473
  break;
469
474
  }
470
475
  default: {
471
476
  const focusablesByFirstChar = new Set(
472
477
  this.#focusablesByFirstChar.get(key.toUpperCase()) ?? []
473
478
  );
474
- focusables = candidates.filter((c) => focusablesByFirstChar.has(c));
475
- const afterIndex = focusables.findIndex(
479
+ target = candidates.filter((c) => focusablesByFirstChar.has(c));
480
+ const afterIndex = target.findIndex(
476
481
  (f) => candidates.indexOf(f) > activeIndex
477
482
  );
478
483
  newIndex = afterIndex >= 0 ? afterIndex : 0;
479
484
  }
480
485
  }
481
- const focusable = focusables.at(newIndex);
486
+ const focusable = target.at(newIndex);
482
487
  focusable && focusElement(focusable);
483
488
  };
484
489
  #update(active) {
@@ -548,6 +553,24 @@ var RovingTabIndex = class _RovingTabIndex {
548
553
  const { selector } = this.#settings;
549
554
  return (element) => !selector || [...this.#container.querySelectorAll(selector)].includes(element);
550
555
  }
556
+ #getCellCoords(cell) {
557
+ const { height, left, top, width } = cell.getBoundingClientRect();
558
+ return {
559
+ x: left + width / 2,
560
+ y: top + height / 2
561
+ };
562
+ }
563
+ #getCellsOfActiveRow() {
564
+ const active = getActiveElement();
565
+ if (!(active instanceof Element)) {
566
+ return [];
567
+ }
568
+ const activeRect = active.getBoundingClientRect();
569
+ return this.#getFocusables().filter((cell) => {
570
+ const cellRect = cell.getBoundingClientRect();
571
+ return cellRect.top < activeRect.bottom && cellRect.bottom > activeRect.top;
572
+ });
573
+ }
551
574
  #getFocusables() {
552
575
  return getFocusables(this.#container, {
553
576
  composed: true,
@@ -556,6 +579,50 @@ var RovingTabIndex = class _RovingTabIndex {
556
579
  skipVisibilityCheck: true
557
580
  });
558
581
  }
582
+ #getNextCell(key, wrap) {
583
+ const cells = this.#getFocusables();
584
+ const active = getActiveElement();
585
+ if (!(active instanceof Element)) {
586
+ return null;
587
+ }
588
+ const activeCoords = this.#getCellCoords(active);
589
+ let min = Infinity;
590
+ let result = null;
591
+ for (const cell of cells) {
592
+ if (cell === active) {
593
+ continue;
594
+ }
595
+ const cellCoords = this.#getCellCoords(cell);
596
+ const distances = {
597
+ x: Math.abs(cellCoords.x - activeCoords.x),
598
+ y: Math.abs(cellCoords.y - activeCoords.y)
599
+ };
600
+ if (key === "ArrowUp" && cellCoords.y < activeCoords.y && distances.x < distances.y || key === "ArrowDown" && cellCoords.y > activeCoords.y && distances.x < distances.y) {
601
+ const distance = distances.x ** 2 + distances.y ** 2;
602
+ if (distance < min) {
603
+ min = distance;
604
+ result = cell;
605
+ }
606
+ }
607
+ }
608
+ if (!result && wrap) {
609
+ let max = -Infinity;
610
+ for (const cell of cells) {
611
+ if (cell === active) {
612
+ continue;
613
+ }
614
+ const cellCoords = this.#getCellCoords(cell);
615
+ if (Math.abs(cellCoords.x - activeCoords.x) < cell.getBoundingClientRect().width / 2) {
616
+ const distance = key === "ArrowUp" ? cellCoords.y - activeCoords.y : activeCoords.y - cellCoords.y;
617
+ if (distance > max) {
618
+ max = distance;
619
+ result = cell;
620
+ }
621
+ }
622
+ }
623
+ }
624
+ return result;
625
+ }
559
626
  #resolveOptions(options) {
560
627
  let {
561
628
  direction = "both",
@@ -567,7 +634,7 @@ var RovingTabIndex = class _RovingTabIndex {
567
634
  wrap = false
568
635
  } = options;
569
636
  direction = direction.toLowerCase();
570
- if (!["both", "horizontal", "vertical"].includes(direction)) {
637
+ if (!DIRECTIONS.includes(direction)) {
571
638
  console.warn("Invalid direction option. Fallback: 'both'.");
572
639
  direction = "both";
573
640
  }
@@ -778,7 +845,7 @@ var Disclosure = class _Disclosure {
778
845
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
779
846
  * Using the <details> and <summary> element.
780
847
  *
781
- * @version 2.0.11
848
+ * @version 2.1.1
782
849
  * @author Yusuke Kamiyamane
783
850
  * @license MIT
784
851
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -803,7 +870,7 @@ power-focusable/dist/index.js:
803
870
  * High-precision focus management utility with full composed tree support.
804
871
  * Handles complex focus rules including tabindex ordering, radio groups, inert.
805
872
  *
806
- * @version 4.3.33
873
+ * @version 4.4.3
807
874
  * @author Yusuke Kamiyamane
808
875
  * @license MIT
809
876
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -816,7 +883,7 @@ power-focusable/dist/index.js:
816
883
  * Lightweight roving tabindex utility with fully focus management.
817
884
  * Designed for accessible menus, tabs, toolbars, and composite widgets.
818
885
  *
819
- * @version 3.1.31
886
+ * @version 3.3.2
820
887
  * @author Yusuke Kamiyamane
821
888
  * @license MIT
822
889
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.cjs CHANGED
@@ -1,28 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var utils = require('@y14e/attribute-utils');
3
+ var attributeUtils = require('@y14e/attribute-utils');
4
4
  var rovingTabindex = require('@y14e/roving-tabindex');
5
5
 
6
- function _interopNamespace(e) {
7
- if (e && e.__esModule) return e;
8
- var n = Object.create(null);
9
- if (e) {
10
- Object.keys(e).forEach(function (k) {
11
- if (k !== 'default') {
12
- var d = Object.getOwnPropertyDescriptor(e, k);
13
- Object.defineProperty(n, k, d.get ? d : {
14
- enumerable: true,
15
- get: function () { return e[k]; }
16
- });
17
- }
18
- });
19
- }
20
- n.default = e;
21
- return Object.freeze(n);
22
- }
23
-
24
- var utils__namespace = /*#__PURE__*/_interopNamespace(utils);
25
-
26
6
  // src/index.ts
27
7
  var Disclosure = class _Disclosure {
28
8
  static defaults = {};
@@ -108,7 +88,7 @@ var Disclosure = class _Disclosure {
108
88
  this.#cleanupRovingTabIndex?.();
109
89
  this.#cleanupRovingTabIndex = null;
110
90
  this.#detailsElements.length = 0;
111
- utils__namespace.restoreAttributes(this.#summaryElements);
91
+ attributeUtils.restoreAttributes(this.#summaryElements);
112
92
  this.#summaryElements.length = 0;
113
93
  this.#contentElements.length = 0;
114
94
  this.#rootElement.removeAttribute("data-disclosure-initialized");
@@ -124,7 +104,7 @@ var Disclosure = class _Disclosure {
124
104
  this.#toggle(details, true);
125
105
  }
126
106
  #initialize() {
127
- utils__namespace.saveAttributes(this.#summaryElements, [
107
+ attributeUtils.saveAttributes(this.#summaryElements, [
128
108
  "aria-disabled",
129
109
  "style",
130
110
  "tabindex"
@@ -190,7 +170,7 @@ var Disclosure = class _Disclosure {
190
170
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
191
171
  * Using the <details> and <summary> element.
192
172
  *
193
- * @version 2.0.11
173
+ * @version 2.1.1
194
174
  * @author Yusuke Kamiyamane
195
175
  * @license MIT
196
176
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.cts CHANGED
@@ -3,7 +3,7 @@
3
3
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
4
4
  * Using the <details> and <summary> element.
5
5
  *
6
- * @version 2.0.11
6
+ * @version 2.1.1
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
4
4
  * Using the <details> and <summary> element.
5
5
  *
6
- * @version 2.0.11
6
+ * @version 2.1.1
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import * as utils from '@y14e/attribute-utils';
1
+ import { restoreAttributes, saveAttributes } from '@y14e/attribute-utils';
2
2
  import { createRovingTabIndex } from '@y14e/roving-tabindex';
3
3
 
4
4
  // src/index.ts
@@ -86,7 +86,7 @@ var Disclosure = class _Disclosure {
86
86
  this.#cleanupRovingTabIndex?.();
87
87
  this.#cleanupRovingTabIndex = null;
88
88
  this.#detailsElements.length = 0;
89
- utils.restoreAttributes(this.#summaryElements);
89
+ restoreAttributes(this.#summaryElements);
90
90
  this.#summaryElements.length = 0;
91
91
  this.#contentElements.length = 0;
92
92
  this.#rootElement.removeAttribute("data-disclosure-initialized");
@@ -102,7 +102,7 @@ var Disclosure = class _Disclosure {
102
102
  this.#toggle(details, true);
103
103
  }
104
104
  #initialize() {
105
- utils.saveAttributes(this.#summaryElements, [
105
+ saveAttributes(this.#summaryElements, [
106
106
  "aria-disabled",
107
107
  "style",
108
108
  "tabindex"
@@ -168,7 +168,7 @@ var Disclosure = class _Disclosure {
168
168
  * WAI-ARIA compliant disclosure pattern implementation in TypeScript.
169
169
  * Using the <details> and <summary> element.
170
170
  *
171
- * @version 2.0.11
171
+ * @version 2.1.1
172
172
  * @author Yusuke Kamiyamane
173
173
  * @license MIT
174
174
  * @copyright Copyright (c) Yusuke Kamiyamane
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@y14e/disclosure-css",
3
- "version": "2.0.12",
3
+ "version": "2.1.1",
4
4
  "description": "WAI-ARIA compliant disclosure pattern implementation in TypeScript",
5
5
  "keywords": [
6
6
  "a11y",
@@ -55,6 +55,6 @@
55
55
  },
56
56
  "dependencies": {
57
57
  "@y14e/attribute-utils": "^2.0.12",
58
- "@y14e/roving-tabindex": "^3.1.31"
58
+ "@y14e/roving-tabindex": "^3.3.2"
59
59
  }
60
60
  }