@allxsmith/bestax-bulma 5.46.0 → 5.47.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.
- package/dist/esm/components/TreeView.js +5 -2
- package/dist/esm/components/TreeView.js.map +1 -1
- package/dist/esm/helpers/useTreeView.js +64 -9
- package/dist/esm/helpers/useTreeView.js.map +1 -1
- package/dist/index.cjs +68 -10
- package/dist/index.cjs.map +1 -1
- package/dist/types/components/TreeView.d.ts +2 -0
- package/dist/types/helpers/useTreeView.d.ts +19 -3
- package/dist/types-cjs/components/TreeView.d.ts +2 -0
- package/dist/types-cjs/helpers/useTreeView.d.ts +19 -3
- package/package.json +2 -1
|
@@ -86,6 +86,8 @@ export interface TreeViewProps extends Omit<React.HTMLAttributes<HTMLUListElemen
|
|
|
86
86
|
* Props for TreeView.Item, one row and, nested in it, its children. The other
|
|
87
87
|
* attributes and the `ref` land on its `<li role="treeitem">`.
|
|
88
88
|
*
|
|
89
|
+
* @extraProp {number} [aria-posinset] - The item's number among the items beside it. The tree declares it, and `aria-setsize`, from the items on the page once it mounts. When the page holds only part of a set, such as the first page of a long folder, pass both on every item of that set: yours win, and the tree's own stay on any item without them.
|
|
90
|
+
* @extraProp {number} [aria-setsize] - How many items sit beside it, itself included. Declared by the tree like `aria-posinset`, and `-1` says the count isn't known.
|
|
89
91
|
* @extraProp {React.Ref<HTMLLIElement>} [ref] - Ref forwarded to the `<li>`.
|
|
90
92
|
*/
|
|
91
93
|
export interface TreeViewItemProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, 'role' | 'value' | 'onSelect' | 'children'> {
|
|
@@ -20,6 +20,14 @@ export interface TreeViewItemInfo extends TreeViewItemRecord {
|
|
|
20
20
|
}
|
|
21
21
|
/** A box's state: checked, unchecked or mixed. */
|
|
22
22
|
export type TreeViewCheckState = boolean | 'mixed';
|
|
23
|
+
/**
|
|
24
|
+
* Where an item sits among the items beside it, for its `aria-posinset` and
|
|
25
|
+
* `aria-setsize`: its number, from 1, and how many there are.
|
|
26
|
+
*/
|
|
27
|
+
export interface TreeViewPosition {
|
|
28
|
+
posinset: number;
|
|
29
|
+
setsize: number;
|
|
30
|
+
}
|
|
23
31
|
/**
|
|
24
32
|
* What an item shows of the selection: `selected` in a `single` tree,
|
|
25
33
|
* `checked` in a `checkbox` tree, and neither with `none`.
|
|
@@ -59,6 +67,12 @@ export interface TreeViewEngine {
|
|
|
59
67
|
* the server.
|
|
60
68
|
*/
|
|
61
69
|
stateOf: (value: string, path: string[], disabled: boolean) => TreeViewItemState;
|
|
70
|
+
/**
|
|
71
|
+
* Where the item with this key sits among the items beside it, read off
|
|
72
|
+
* the page after each render and whenever items move. Nothing until the
|
|
73
|
+
* tree has mounted, as on the server.
|
|
74
|
+
*/
|
|
75
|
+
positionOf: (key: string) => TreeViewPosition | undefined;
|
|
62
76
|
/** Records an item from its layout effect. Returns the function that forgets it. */
|
|
63
77
|
register: (value: string, record: TreeViewItemRecord) => () => void;
|
|
64
78
|
/** For each item's `<li>` ref: records it, and notices focus leaving with it. */
|
|
@@ -76,9 +90,11 @@ export interface TreeViewEngine {
|
|
|
76
90
|
onClick: (element: HTMLLIElement, item: TreeViewItemInfo, onToggle: boolean) => void;
|
|
77
91
|
}
|
|
78
92
|
/**
|
|
79
|
-
* The open state, the selection, the keys, the tab stop
|
|
80
|
-
* a TreeView (#1096). Focus moves for real, with a roving
|
|
81
|
-
* than through `aria-activedescendant`.
|
|
93
|
+
* The open state, the selection, the keys, the tab stop, the positions and
|
|
94
|
+
* the registry of a TreeView (#1096). Focus moves for real, with a roving
|
|
95
|
+
* tabindex, rather than through `aria-activedescendant`. Each item's
|
|
96
|
+
* position among the items beside it is declared rather than left to the
|
|
97
|
+
* browser (#1171), read off the page once the tree has mounted.
|
|
82
98
|
*
|
|
83
99
|
* Every item registers its value, its parent and whether it's disabled from
|
|
84
100
|
* a layout effect. In a checkbox tree a closed item's children still render
|
|
@@ -86,6 +86,8 @@ export interface TreeViewProps extends Omit<React.HTMLAttributes<HTMLUListElemen
|
|
|
86
86
|
* Props for TreeView.Item, one row and, nested in it, its children. The other
|
|
87
87
|
* attributes and the `ref` land on its `<li role="treeitem">`.
|
|
88
88
|
*
|
|
89
|
+
* @extraProp {number} [aria-posinset] - The item's number among the items beside it. The tree declares it, and `aria-setsize`, from the items on the page once it mounts. When the page holds only part of a set, such as the first page of a long folder, pass both on every item of that set: yours win, and the tree's own stay on any item without them.
|
|
90
|
+
* @extraProp {number} [aria-setsize] - How many items sit beside it, itself included. Declared by the tree like `aria-posinset`, and `-1` says the count isn't known.
|
|
89
91
|
* @extraProp {React.Ref<HTMLLIElement>} [ref] - Ref forwarded to the `<li>`.
|
|
90
92
|
*/
|
|
91
93
|
export interface TreeViewItemProps extends Omit<React.LiHTMLAttributes<HTMLLIElement>, 'role' | 'value' | 'onSelect' | 'children'> {
|
|
@@ -20,6 +20,14 @@ export interface TreeViewItemInfo extends TreeViewItemRecord {
|
|
|
20
20
|
}
|
|
21
21
|
/** A box's state: checked, unchecked or mixed. */
|
|
22
22
|
export type TreeViewCheckState = boolean | 'mixed';
|
|
23
|
+
/**
|
|
24
|
+
* Where an item sits among the items beside it, for its `aria-posinset` and
|
|
25
|
+
* `aria-setsize`: its number, from 1, and how many there are.
|
|
26
|
+
*/
|
|
27
|
+
export interface TreeViewPosition {
|
|
28
|
+
posinset: number;
|
|
29
|
+
setsize: number;
|
|
30
|
+
}
|
|
23
31
|
/**
|
|
24
32
|
* What an item shows of the selection: `selected` in a `single` tree,
|
|
25
33
|
* `checked` in a `checkbox` tree, and neither with `none`.
|
|
@@ -59,6 +67,12 @@ export interface TreeViewEngine {
|
|
|
59
67
|
* the server.
|
|
60
68
|
*/
|
|
61
69
|
stateOf: (value: string, path: string[], disabled: boolean) => TreeViewItemState;
|
|
70
|
+
/**
|
|
71
|
+
* Where the item with this key sits among the items beside it, read off
|
|
72
|
+
* the page after each render and whenever items move. Nothing until the
|
|
73
|
+
* tree has mounted, as on the server.
|
|
74
|
+
*/
|
|
75
|
+
positionOf: (key: string) => TreeViewPosition | undefined;
|
|
62
76
|
/** Records an item from its layout effect. Returns the function that forgets it. */
|
|
63
77
|
register: (value: string, record: TreeViewItemRecord) => () => void;
|
|
64
78
|
/** For each item's `<li>` ref: records it, and notices focus leaving with it. */
|
|
@@ -76,9 +90,11 @@ export interface TreeViewEngine {
|
|
|
76
90
|
onClick: (element: HTMLLIElement, item: TreeViewItemInfo, onToggle: boolean) => void;
|
|
77
91
|
}
|
|
78
92
|
/**
|
|
79
|
-
* The open state, the selection, the keys, the tab stop
|
|
80
|
-
* a TreeView (#1096). Focus moves for real, with a roving
|
|
81
|
-
* than through `aria-activedescendant`.
|
|
93
|
+
* The open state, the selection, the keys, the tab stop, the positions and
|
|
94
|
+
* the registry of a TreeView (#1096). Focus moves for real, with a roving
|
|
95
|
+
* tabindex, rather than through `aria-activedescendant`. Each item's
|
|
96
|
+
* position among the items beside it is declared rather than left to the
|
|
97
|
+
* browser (#1171), read off the page once the tree has mounted.
|
|
82
98
|
*
|
|
83
99
|
* Every item registers its value, its parent and whether it's disabled from
|
|
84
100
|
* a layout effect. In a checkbox tree a closed item's children still render
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allxsmith/bestax-bulma",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.47.0",
|
|
4
4
|
"description": "A fully-typed React component library for the Bulma CSS framework. Build modern UIs quickly with reusable, accessible, and customizable Bulma-based React components.",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@faker-js/faker": "^10.6.0",
|
|
24
24
|
"@fortawesome/fontawesome-free": "^7.3.1",
|
|
25
|
+
"@guidepup/virtual-screen-reader": "0.33.0",
|
|
25
26
|
"@mdi/font": "^7.4.47",
|
|
26
27
|
"@rollup/plugin-commonjs": "^29.0.3",
|
|
27
28
|
"@rollup/plugin-node-resolve": "^16.0.1",
|