@dxos/react-list 0.8.4-main.dedc0f3 → 0.8.4-main.e00bdcdb52
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/lib/browser/index.mjs +60 -77
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +60 -77
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/List.d.ts.map +1 -1
- package/dist/types/src/ListItem.d.ts +4 -4
- package/dist/types/src/ListItem.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -15
- package/src/List.tsx +1 -0
- package/src/ListItem.tsx +5 -5
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-list",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.e00bdcdb52",
|
|
4
4
|
"description": "List primitive components for React.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
|
-
"sideEffects":
|
|
13
|
+
"sideEffects": false,
|
|
10
14
|
"type": "module",
|
|
11
15
|
"exports": {
|
|
12
16
|
".": {
|
|
@@ -17,34 +21,28 @@
|
|
|
17
21
|
}
|
|
18
22
|
},
|
|
19
23
|
"types": "dist/types/src/index.d.ts",
|
|
20
|
-
"typesVersions": {
|
|
21
|
-
"*": {}
|
|
22
|
-
},
|
|
23
24
|
"files": [
|
|
24
25
|
"dist",
|
|
25
26
|
"src"
|
|
26
27
|
],
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@preact-signals/safe-react": "^0.9.0",
|
|
29
29
|
"@radix-ui/react-collapsible": "1.1.3",
|
|
30
30
|
"@radix-ui/react-context": "1.1.1",
|
|
31
31
|
"@radix-ui/react-primitive": "2.0.2",
|
|
32
32
|
"@radix-ui/react-slot": "1.1.2",
|
|
33
33
|
"@radix-ui/react-use-controllable-state": "1.1.0",
|
|
34
|
-
"
|
|
35
|
-
"@dxos/react-hooks": "0.8.4-main.dedc0f3"
|
|
34
|
+
"@dxos/react-hooks": "0.8.4-main.e00bdcdb52"
|
|
36
35
|
},
|
|
37
36
|
"devDependencies": {
|
|
38
37
|
"@radix-ui/react-checkbox": "1.1.4",
|
|
39
|
-
"@types/
|
|
40
|
-
"@types/react": "~
|
|
41
|
-
"
|
|
42
|
-
"react": "~
|
|
43
|
-
"react-dom": "~18.2.0"
|
|
38
|
+
"@types/react": "~19.2.7",
|
|
39
|
+
"@types/react-dom": "~19.2.3",
|
|
40
|
+
"react": "~19.2.3",
|
|
41
|
+
"react-dom": "~19.2.3"
|
|
44
42
|
},
|
|
45
43
|
"peerDependencies": {
|
|
46
|
-
"react": "~
|
|
47
|
-
"react-dom": "~
|
|
44
|
+
"react": "~19.2.3",
|
|
45
|
+
"react-dom": "~19.2.3"
|
|
48
46
|
},
|
|
49
47
|
"publishConfig": {
|
|
50
48
|
"access": "public"
|
package/src/List.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import { type Scope, createContextScope } from '@radix-ui/react-context';
|
|
|
6
6
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
7
7
|
import React, { type ComponentPropsWithRef, forwardRef } from 'react';
|
|
8
8
|
|
|
9
|
+
// TODO(burdon): Reconcile with react-ui-list.
|
|
9
10
|
// TODO(thure): A lot of the accessible affordances for this kind of thing need to be implemented per https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/listbox_role
|
|
10
11
|
|
|
11
12
|
const LIST_NAME = 'List';
|
package/src/ListItem.tsx
CHANGED
|
@@ -13,7 +13,7 @@ import React, {
|
|
|
13
13
|
type ComponentProps,
|
|
14
14
|
type ComponentPropsWithoutRef,
|
|
15
15
|
type Dispatch,
|
|
16
|
-
type
|
|
16
|
+
type ComponentRef,
|
|
17
17
|
type ForwardRefExoticComponent,
|
|
18
18
|
type RefAttributes,
|
|
19
19
|
type SetStateAction,
|
|
@@ -44,7 +44,7 @@ type ListItemProps = Omit<ListItemData, 'id'> & { collapsible?: boolean } & RefA
|
|
|
44
44
|
defaultSelected?: CheckboxProps['defaultChecked'];
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
type ListItemElement =
|
|
47
|
+
type ListItemElement = ComponentRef<'li'>;
|
|
48
48
|
|
|
49
49
|
const [createListItemContext, createListItemScope] = createContextScope(LIST_ITEM_NAME, []);
|
|
50
50
|
|
|
@@ -65,11 +65,11 @@ type ListItemHeadingProps = ListItemScopedProps<Omit<ComponentPropsWithoutRef<'p
|
|
|
65
65
|
const ListItemHeading = forwardRef<HTMLDivElement, ListItemHeadingProps>(
|
|
66
66
|
({ children, asChild, __listItemScope, ...props }, forwardedRef) => {
|
|
67
67
|
const { headingId } = useListItemContext(LIST_ITEM_NAME, __listItemScope);
|
|
68
|
-
const
|
|
68
|
+
const Comp = asChild ? Slot : Primitive.div;
|
|
69
69
|
return (
|
|
70
|
-
<
|
|
70
|
+
<Comp {...props} id={headingId} ref={forwardedRef}>
|
|
71
71
|
{children}
|
|
72
|
-
</
|
|
72
|
+
</Comp>
|
|
73
73
|
);
|
|
74
74
|
},
|
|
75
75
|
);
|