@agnos-ui/core 0.7.0-next.0 → 0.7.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,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const slider = require("../../slider-DlOAawbZ.cjs");
3
+ const slider = require("../../slider-1OSwok7u.cjs");
4
4
  exports.createSlider = slider.createSlider;
5
5
  exports.getSliderDefaultConfig = slider.getSliderDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { c, g } from "../../slider-DYrwS7Mv.js";
1
+ import { c, g } from "../../slider-6LI4-f5s.js";
2
2
  export {
3
3
  c as createSlider,
4
4
  g as getSliderDefaultConfig
@@ -25,9 +25,13 @@ export interface ProgressDisplayOptions {
25
25
  */
26
26
  width: number;
27
27
  /**
28
- * Height of hte progress in %
28
+ * Height of the progress in %
29
29
  */
30
30
  height: number;
31
+ /**
32
+ * Id of the progress
33
+ */
34
+ id: number;
31
35
  }
32
36
  /**
33
37
  * Options for displaying a handle in a slider component.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const tree = require("../../tree-Bh1WO63V.cjs");
3
+ const tree = require("../../tree-Bb5KFqXp.cjs");
4
4
  exports.createTree = tree.createTree;
5
5
  exports.getTreeDefaultConfig = tree.getTreeDefaultConfig;
@@ -1,4 +1,4 @@
1
- import { c, g } from "../../tree-C4v9rTQl.js";
1
+ import { c, g } from "../../tree-B2Mr8b31.js";
2
2
  export {
3
3
  c as createTree,
4
4
  g as getTreeDefaultConfig
@@ -78,7 +78,7 @@ export interface TreeProps extends TreeCommonPropsAndState {
78
78
  * (node: HTMLElement) => node.querySelectorAll('button')
79
79
  * ```
80
80
  */
81
- navSelector(node: HTMLElement): NodeListOf<HTMLButtonElement>;
81
+ navSelector(node: HTMLElement): NodeListOf<HTMLElement>;
82
82
  /**
83
83
  * Return the value for the 'aria-label' attribute of the toggle
84
84
  * @param label - tree item label
package/index.cjs CHANGED
@@ -8,9 +8,9 @@ const pagination = require("./pagination-CBysiPUs.cjs");
8
8
  const progressbar = require("./progressbar-DghzCJ6_.cjs");
9
9
  const rating = require("./rating-DlfOuwuX.cjs");
10
10
  const select = require("./select-LBVhNdrd.cjs");
11
- const slider = require("./slider-DlOAawbZ.cjs");
11
+ const slider = require("./slider-1OSwok7u.cjs");
12
12
  const toast = require("./toast-D_uSrRZL.cjs");
13
- const tree = require("./tree-Bh1WO63V.cjs");
13
+ const tree = require("./tree-Bb5KFqXp.cjs");
14
14
  const config = require("./config.cjs");
15
15
  const services_extendWidget = require("./services/extendWidget.cjs");
16
16
  const services_floatingUI = require("./services/floatingUI.cjs");
package/index.js CHANGED
@@ -6,9 +6,9 @@ import { c as c4, g as g4 } from "./pagination-DwDRot6q.js";
6
6
  import { c as c5, g as g5 } from "./progressbar-CGmNq0cS.js";
7
7
  import { c as c6, g as g6 } from "./rating-Da38uaZz.js";
8
8
  import { c as c7, g as g7 } from "./select-CAEPqdz1.js";
9
- import { c as c8, g as g8 } from "./slider-DYrwS7Mv.js";
9
+ import { c as c8, g as g8 } from "./slider-6LI4-f5s.js";
10
10
  import { c as c9, g as g9 } from "./toast-CpvsibAI.js";
11
- import { c as c10, g as g10 } from "./tree-C4v9rTQl.js";
11
+ import { c as c10, g as g10 } from "./tree-B2Mr8b31.js";
12
12
  import { createWidgetsConfig, mergeInto } from "./config.js";
13
13
  import { extendWidgetProps } from "./services/extendWidget.js";
14
14
  import { createFloatingUI } from "./services/floatingUI.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agnos-ui/core",
3
3
  "description": "Framework-agnostic headless component library.",
4
- "version": "0.7.0-next.0",
4
+ "version": "0.7.0",
5
5
  "type": "module",
6
6
  "main": "./index.cjs",
7
7
  "module": "./index.js",
@@ -43,15 +43,15 @@ export type NavManager<T> = {
43
43
  */
44
44
  focusIndex: (index: number, moveDirection: -1 | 0 | 1) => HTMLElement | null;
45
45
  /**
46
- * Focus the previous element, respecting the anscestor direction.
46
+ * Focus the previous element, respecting the ancestor direction.
47
47
  */
48
48
  focusPrevious: FocusNeighbour;
49
49
  /**
50
- * Focus the next element, respecting the anscestor direction.
50
+ * Focus the next element, respecting the ancestor direction.
51
51
  */
52
52
  focusNext: FocusNeighbour;
53
53
  /**
54
- * Focus the first element, respecting the anscestor direction.
54
+ * Focus the first element, respecting the ancestor direction.
55
55
  */
56
56
  focusFirst: FocusEnd;
57
57
  /**
@@ -63,7 +63,7 @@ export type NavManager<T> = {
63
63
  */
64
64
  focusFirstRight: FocusEnd;
65
65
  /**
66
- * Focus the last element, respecting the anscestor direction.
66
+ * Focus the last element, respecting the ancestor direction.
67
67
  */
68
68
  focusLast: FocusEnd;
69
69
  /**
@@ -243,7 +243,8 @@ function createSlider(config) {
243
243
  bottom: vertical ? rtl ? null : 0 : null,
244
244
  top: vertical ? rtl ? 0 : null : null,
245
245
  width: vertical ? 100 : sortedValuesPercent[0],
246
- height: vertical ? sortedValuesPercent[0] : 100
246
+ height: vertical ? sortedValuesPercent[0] : 100,
247
+ id: 0
247
248
  }
248
249
  ];
249
250
  } else {
@@ -254,7 +255,8 @@ function createSlider(config) {
254
255
  bottom: vertical ? rtl ? null : svp : null,
255
256
  top: vertical ? rtl ? array[index] : null : null,
256
257
  width: vertical ? 100 : index === array.length - 1 ? svp : array[index + 1] - svp,
257
- height: vertical ? index === array.length - 1 ? svp : array[index + 1] - svp : 100
258
+ height: vertical ? index === array.length - 1 ? svp : array[index + 1] - svp : 100,
259
+ id: index
258
260
  };
259
261
  }).slice(0, sortedValuesPercent.length - 1);
260
262
  }
@@ -242,7 +242,8 @@ function createSlider(config) {
242
242
  bottom: vertical ? rtl ? null : 0 : null,
243
243
  top: vertical ? rtl ? 0 : null : null,
244
244
  width: vertical ? 100 : sortedValuesPercent[0],
245
- height: vertical ? sortedValuesPercent[0] : 100
245
+ height: vertical ? sortedValuesPercent[0] : 100,
246
+ id: 0
246
247
  }
247
248
  ];
248
249
  } else {
@@ -253,7 +254,8 @@ function createSlider(config) {
253
254
  bottom: vertical ? rtl ? null : svp : null,
254
255
  top: vertical ? rtl ? array[index] : null : null,
255
256
  width: vertical ? 100 : index === array.length - 1 ? svp : array[index + 1] - svp,
256
- height: vertical ? index === array.length - 1 ? svp : array[index + 1] - svp : 100
257
+ height: vertical ? index === array.length - 1 ? svp : array[index + 1] - svp : 100,
258
+ id: index
257
259
  };
258
260
  }).slice(0, sortedValuesPercent.length - 1);
259
261
  }
@@ -81,7 +81,7 @@ function createTree(config) {
81
81
  treeMap.clear();
82
82
  return nodes$().map((node) => traverseTree(node, 0, void 0));
83
83
  });
84
- const _lastFocusedTreeItem$ = writable(normalizedNodes$()[0]);
84
+ const _lastFocusedTreeItem$ = writable(normalizedNodes$().find((node) => node.isExpanded !== void 0));
85
85
  const getTreeItemInfo = (item) => {
86
86
  const treeItem = treeMap.get(item);
87
87
  if (!treeItem) {
@@ -142,6 +142,10 @@ function createTree(config) {
142
142
  const isExpanded = item.isExpanded;
143
143
  refreshElements();
144
144
  switch (key) {
145
+ case "Enter":
146
+ case " ":
147
+ toggleExpanded(item);
148
+ break;
145
149
  case "ArrowLeft":
146
150
  if (isExpanded) {
147
151
  toggleExpanded(item);
@@ -82,7 +82,7 @@ function createTree(config) {
82
82
  treeMap.clear();
83
83
  return nodes$().map((node) => traverseTree(node, 0, void 0));
84
84
  });
85
- const _lastFocusedTreeItem$ = tansu.writable(normalizedNodes$()[0]);
85
+ const _lastFocusedTreeItem$ = tansu.writable(normalizedNodes$().find((node) => node.isExpanded !== void 0));
86
86
  const getTreeItemInfo = (item) => {
87
87
  const treeItem = treeMap.get(item);
88
88
  if (!treeItem) {
@@ -143,6 +143,10 @@ function createTree(config) {
143
143
  const isExpanded = item.isExpanded;
144
144
  refreshElements();
145
145
  switch (key) {
146
+ case "Enter":
147
+ case " ":
148
+ toggleExpanded(item);
149
+ break;
146
150
  case "ArrowLeft":
147
151
  if (isExpanded) {
148
152
  toggleExpanded(item);