@dxos/react-list 0.8.4-main.f9ba587 → 0.8.4-main.fcfe5033a5
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.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -12
- package/src/List.tsx +2 -1
- package/src/ListItem.tsx +7 -7
package/package.json
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-list",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.fcfe5033a5",
|
|
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
|
+
"source": "./src/index.ts",
|
|
13
18
|
"types": "./dist/types/src/index.d.ts",
|
|
14
19
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
20
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
@@ -24,26 +29,23 @@
|
|
|
24
29
|
"src"
|
|
25
30
|
],
|
|
26
31
|
"dependencies": {
|
|
27
|
-
"@preact-signals/safe-react": "^0.9.0",
|
|
28
32
|
"@radix-ui/react-collapsible": "1.1.3",
|
|
29
33
|
"@radix-ui/react-context": "1.1.1",
|
|
30
34
|
"@radix-ui/react-primitive": "2.0.2",
|
|
31
35
|
"@radix-ui/react-slot": "1.1.2",
|
|
32
36
|
"@radix-ui/react-use-controllable-state": "1.1.0",
|
|
33
|
-
"
|
|
34
|
-
"@dxos/react-hooks": "0.8.4-main.f9ba587"
|
|
37
|
+
"@dxos/react-hooks": "0.8.4-main.fcfe5033a5"
|
|
35
38
|
},
|
|
36
39
|
"devDependencies": {
|
|
37
40
|
"@radix-ui/react-checkbox": "1.1.4",
|
|
38
|
-
"@types/
|
|
39
|
-
"@types/react": "~
|
|
40
|
-
"
|
|
41
|
-
"react": "~
|
|
42
|
-
"react-dom": "~18.2.0"
|
|
41
|
+
"@types/react": "~19.2.7",
|
|
42
|
+
"@types/react-dom": "~19.2.3",
|
|
43
|
+
"react": "~19.2.3",
|
|
44
|
+
"react-dom": "~19.2.3"
|
|
43
45
|
},
|
|
44
46
|
"peerDependencies": {
|
|
45
|
-
"react": "~
|
|
46
|
-
"react-dom": "~
|
|
47
|
+
"react": "~19.2.3",
|
|
48
|
+
"react-dom": "~19.2.3"
|
|
47
49
|
},
|
|
48
50
|
"publishConfig": {
|
|
49
51
|
"access": "public"
|
package/src/List.tsx
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
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
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import type { CheckboxProps } from '@radix-ui/react-checkbox';
|
|
6
6
|
import { type CollapsibleContentProps, type CollapsibleTriggerProps } from '@radix-ui/react-collapsible';
|
|
7
7
|
import * as Collapsible from '@radix-ui/react-collapsible';
|
|
8
|
-
import {
|
|
8
|
+
import { type Scope, createContextScope } from '@radix-ui/react-context';
|
|
9
9
|
import { Primitive } from '@radix-ui/react-primitive';
|
|
10
10
|
import { Slot } from '@radix-ui/react-slot';
|
|
11
11
|
import { useControllableState } from '@radix-ui/react-use-controllable-state';
|
|
@@ -13,11 +13,11 @@ import React, {
|
|
|
13
13
|
type ComponentProps,
|
|
14
14
|
type ComponentPropsWithoutRef,
|
|
15
15
|
type Dispatch,
|
|
16
|
-
type
|
|
17
|
-
forwardRef,
|
|
16
|
+
type ComponentRef,
|
|
18
17
|
type ForwardRefExoticComponent,
|
|
19
18
|
type RefAttributes,
|
|
20
19
|
type SetStateAction,
|
|
20
|
+
forwardRef,
|
|
21
21
|
} from 'react';
|
|
22
22
|
|
|
23
23
|
import { useId } from '@dxos/react-hooks';
|
|
@@ -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
|
);
|