@dxos/react-list 0.1.23 → 0.1.45-next.45667d4

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.
Files changed (47) hide show
  1. package/README.md +1 -22
  2. package/dist/lib/browser/index.mjs +147 -493
  3. package/dist/lib/browser/index.mjs.map +4 -4
  4. package/dist/lib/browser/meta.json +1 -1
  5. package/dist/lib/node/index.cjs +229 -0
  6. package/dist/lib/node/index.cjs.map +7 -0
  7. package/dist/lib/node/meta.json +1 -0
  8. package/dist/types/src/List.d.ts +42 -0
  9. package/dist/types/src/List.d.ts.map +1 -0
  10. package/dist/types/src/ListItem.d.ts +56 -0
  11. package/dist/types/src/ListItem.d.ts.map +1 -0
  12. package/dist/types/src/index.d.ts +2 -2
  13. package/dist/types/src/index.d.ts.map +1 -1
  14. package/package.json +24 -18
  15. package/src/List.tsx +87 -0
  16. package/src/ListItem.tsx +228 -0
  17. package/src/index.ts +2 -2
  18. package/dist/types/src/components/List/List.d.ts +0 -8
  19. package/dist/types/src/components/List/List.d.ts.map +0 -1
  20. package/dist/types/src/components/List/List.stories.d.ts +0 -17
  21. package/dist/types/src/components/List/List.stories.d.ts.map +0 -1
  22. package/dist/types/src/components/List/index.d.ts +0 -2
  23. package/dist/types/src/components/List/index.d.ts.map +0 -1
  24. package/dist/types/src/components/ListPrimitive/ListPrimitive.d.ts +0 -55
  25. package/dist/types/src/components/ListPrimitive/ListPrimitive.d.ts.map +0 -1
  26. package/dist/types/src/components/ListPrimitive/ListPrimitive.stories.d.ts +0 -31
  27. package/dist/types/src/components/ListPrimitive/ListPrimitive.stories.d.ts.map +0 -1
  28. package/dist/types/src/components/ListPrimitive/index.d.ts +0 -2
  29. package/dist/types/src/components/ListPrimitive/index.d.ts.map +0 -1
  30. package/dist/types/src/components/index.d.ts +0 -2
  31. package/dist/types/src/components/index.d.ts.map +0 -1
  32. package/dist/types/src/hooks/index.d.ts +0 -2
  33. package/dist/types/src/hooks/index.d.ts.map +0 -1
  34. package/dist/types/src/hooks/usePropStatefully.d.ts +0 -6
  35. package/dist/types/src/hooks/usePropStatefully.d.ts.map +0 -1
  36. package/dist/types/src/model.d.ts +0 -3
  37. package/dist/types/src/model.d.ts.map +0 -1
  38. package/src/components/List/List.stories.tsx +0 -123
  39. package/src/components/List/List.tsx +0 -111
  40. package/src/components/List/index.ts +0 -5
  41. package/src/components/ListPrimitive/ListPrimitive.stories.tsx +0 -41
  42. package/src/components/ListPrimitive/ListPrimitive.tsx +0 -474
  43. package/src/components/ListPrimitive/index.ts +0 -5
  44. package/src/components/index.ts +0 -5
  45. package/src/hooks/index.ts +0 -5
  46. package/src/hooks/usePropStatefully.ts +0 -33
  47. package/src/model.ts +0 -6
@@ -0,0 +1,56 @@
1
+ import { DraggableAttributes } from '@dnd-kit/core';
2
+ import { useSortable } from '@dnd-kit/sortable';
3
+ import type { CheckboxProps } from '@radix-ui/react-checkbox';
4
+ import { CollapsibleTriggerProps } from '@radix-ui/react-collapsible';
5
+ import * as Collapsible from '@radix-ui/react-collapsible';
6
+ import { Scope } from '@radix-ui/react-context';
7
+ import { Primitive } from '@radix-ui/react-primitive';
8
+ import React, { ComponentProps, ComponentPropsWithRef, Dispatch, SetStateAction } from 'react';
9
+ declare const LIST_ITEM_NAME = "ListItem";
10
+ type ListItemScopedProps<P> = P & {
11
+ __listItemScope?: Scope;
12
+ };
13
+ interface ListItemData {
14
+ id: string;
15
+ selected?: CheckboxProps['checked'];
16
+ open?: boolean;
17
+ }
18
+ type ListItemProps = Omit<ListItemData, 'id'> & {
19
+ collapsible?: boolean;
20
+ } & ComponentPropsWithRef<typeof Primitive.li> & {
21
+ defaultOpen?: boolean;
22
+ onOpenChange?: (nextOpen: boolean) => void;
23
+ } & {
24
+ onSelectedChange?: CheckboxProps['onCheckedChange'];
25
+ defaultSelected?: CheckboxProps['defaultChecked'];
26
+ };
27
+ declare const createListItemScope: import("@radix-ui/react-context").CreateScope;
28
+ type DraggableListItemContextValue = {
29
+ draggableAttributes: DraggableAttributes;
30
+ draggableListeners: ReturnType<typeof useSortable>['listeners'];
31
+ };
32
+ type ListItemContextValue = {
33
+ headingId: string;
34
+ open: boolean;
35
+ selected: CheckboxProps['checked'];
36
+ setSelected: Dispatch<SetStateAction<CheckboxProps['checked']>>;
37
+ } & Partial<DraggableListItemContextValue>;
38
+ declare const useListItemContext: (consumerName: string, scope: Scope<ListItemContextValue | undefined>) => ListItemContextValue;
39
+ type ListItemHeadingProps = ListItemScopedProps<Omit<ComponentPropsWithRef<typeof Primitive.p>, 'id'>> & {
40
+ asChild?: boolean;
41
+ };
42
+ declare const ListItemHeading: React.ForwardRefExoticComponent<Pick<ListItemHeadingProps, "key" | "onDragEnd" | "slot" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "asChild" | "__listItemScope"> & React.RefAttributes<HTMLParagraphElement>>;
43
+ type ListItemDragHandleProps = ComponentPropsWithRef<typeof Primitive.div>;
44
+ declare const ListItemDragHandle: React.ForwardRefExoticComponent<Pick<ListItemScopedProps<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
45
+ ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
46
+ } & {
47
+ asChild?: boolean | undefined;
48
+ }>, "key" | "asChild" | "__listItemScope" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>>;
49
+ type ListItemOpenTriggerProps = ListItemScopedProps<CollapsibleTriggerProps>;
50
+ declare const ListItemOpenTrigger: React.ForwardRefExoticComponent<CollapsibleTriggerProps & React.RefAttributes<HTMLButtonElement>>;
51
+ type ListItemCollapsibleContentProps = ComponentProps<typeof Collapsible.Content>;
52
+ declare const ListItemCollapsibleContent: React.ForwardRefExoticComponent<Collapsible.CollapsibleContentProps & React.RefAttributes<HTMLDivElement>>;
53
+ declare const ListItem: React.ForwardRefExoticComponent<Pick<ListItemProps, "key" | "asChild" | "selected" | "open" | keyof React.LiHTMLAttributes<HTMLLIElement> | "collapsible" | "defaultOpen" | "onOpenChange" | "onSelectedChange" | "defaultSelected"> & React.RefAttributes<HTMLLIElement>>;
54
+ export { ListItem, ListItemHeading, ListItemCollapsibleContent, ListItemDragHandle, ListItemOpenTrigger, createListItemScope, useListItemContext, LIST_ITEM_NAME, };
55
+ export type { ListItemProps, ListItemHeadingProps, ListItemCollapsibleContentProps, ListItemDragHandleProps, ListItemOpenTriggerProps, ListItemScopedProps, };
56
+ //# sourceMappingURL=ListItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/ListItem.tsx"],"names":[],"mappings":"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"}
@@ -1,3 +1,3 @@
1
- export * from './components';
2
- export * from './model';
1
+ export * from './List';
2
+ export * from './ListItem';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,39 +1,45 @@
1
1
  {
2
2
  "name": "@dxos/react-list",
3
- "version": "0.1.23",
4
- "description": "A list editing experience component for DXOS.",
3
+ "version": "0.1.45-next.45667d4",
4
+ "description": "List primitive components for React.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
7
7
  "license": "MIT",
8
8
  "author": "DXOS.org",
9
- "main": "dist/lib/browser/index.mjs",
9
+ "main": "dist/lib/node/index.cjs",
10
+ "browser": {
11
+ "./dist/lib/node/index.cjs": "./dist/lib/browser/index.mjs"
12
+ },
10
13
  "types": "dist/types/src/index.d.ts",
11
14
  "files": [
12
15
  "dist",
13
16
  "src"
14
17
  ],
15
18
  "dependencies": {
16
- "lodash.debounce": "^4.0.8",
17
- "react": "^18.2.0",
18
- "react-dom": "^18.2.0",
19
- "@dxos/client": "0.1.23",
20
- "@dxos/config": "0.1.23",
21
- "@dxos/object-model": "0.1.23",
22
- "@dxos/react-appkit": "0.1.23",
23
- "@dxos/react-async": "0.1.23",
24
- "@dxos/react-client": "0.1.23",
25
- "@dxos/react-components": "0.1.23"
19
+ "@dnd-kit/core": "^6.0.5",
20
+ "@dnd-kit/modifiers": "^6.0.0",
21
+ "@dnd-kit/sortable": "^7.0.1",
22
+ "@dnd-kit/utilities": "^3.2.0",
23
+ "@radix-ui/react-collapsible": "^1.0.2",
24
+ "@radix-ui/react-compose-refs": "^1.0.0",
25
+ "@radix-ui/react-context": "^1.0.0",
26
+ "@radix-ui/react-primitive": "^1.0.2",
27
+ "@radix-ui/react-slot": "^1.0.1",
28
+ "@radix-ui/react-use-controllable-state": "^1.0.0",
29
+ "lodash.omit": "^4.5.0",
30
+ "@dxos/react-hooks": "0.1.45-next.45667d4"
26
31
  },
27
32
  "devDependencies": {
28
- "@types/lodash.debounce": "^4.0.7",
33
+ "@radix-ui/react-checkbox": "^1.0.3",
34
+ "@types/lodash.omit": "^4.5.7",
29
35
  "@types/react": "^18.0.21",
30
36
  "@types/react-dom": "^18.0.6",
31
- "phosphor-react": "^1.4.1",
32
- "@dxos/async": "0.1.23",
33
- "@dxos/debug": "0.1.23"
37
+ "react": "^18.2.0",
38
+ "react-dom": "^18.2.0"
34
39
  },
35
40
  "peerDependencies": {
36
- "phosphor-react": "^1.4.1"
41
+ "react": "^18.2.0",
42
+ "react-dom": "^18.2.0"
37
43
  },
38
44
  "publishConfig": {
39
45
  "access": "public"
package/src/List.tsx ADDED
@@ -0,0 +1,87 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { DndContext, DragEndEvent } from '@dnd-kit/core';
6
+ import { restrictToVerticalAxis } from '@dnd-kit/modifiers';
7
+ import { SortableContext, arrayMove } from '@dnd-kit/sortable';
8
+ import { createContextScope, Scope } from '@radix-ui/react-context';
9
+ import { Primitive } from '@radix-ui/react-primitive';
10
+ import omit from 'lodash.omit';
11
+ import React, { ComponentPropsWithRef, forwardRef, ReactHTMLElement } from 'react';
12
+
13
+ // 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
14
+
15
+ const LIST_NAME = 'List';
16
+
17
+ type ListScopedProps<P> = P & { __listScope?: Scope };
18
+
19
+ type ListVariant = 'ordered' | 'unordered' | 'ordered-draggable';
20
+
21
+ type SharedListProps = {
22
+ selectable?: boolean;
23
+ variant?: ListVariant;
24
+ onDragEnd?: (event: DragEndEvent) => void;
25
+ listItemIds?: string[];
26
+ toggleOpenLabel?: string | Omit<ReactHTMLElement<HTMLElement>, 'ref'>;
27
+ };
28
+
29
+ type DraggableListProps = Omit<SharedListProps, 'slots'> & {
30
+ onDragEnd: Exclude<SharedListProps['onDragEnd'], undefined>;
31
+ listItemIds: Exclude<SharedListProps['listItemIds'], undefined>;
32
+ variant: 'ordered-draggable';
33
+ };
34
+
35
+ type ListProps =
36
+ | (Omit<ComponentPropsWithRef<typeof Primitive.ol>, 'onDragEnd'> & SharedListProps)
37
+ | (Omit<ComponentPropsWithRef<typeof Primitive.ol>, 'onDragEnd'> & DraggableListProps);
38
+
39
+ // LIST
40
+
41
+ const [createListContext, createListScope] = createContextScope(LIST_NAME, []);
42
+
43
+ type ListContextValue = Pick<ListProps, 'selectable' | 'variant' | 'toggleOpenLabel'>;
44
+
45
+ const [ListProvider, useListContext] = createListContext<ListContextValue>(LIST_NAME);
46
+
47
+ const List = forwardRef<HTMLOListElement, ListProps>((props: ListScopedProps<ListProps>, forwardedRef) => {
48
+ const {
49
+ __listScope,
50
+ variant = 'ordered',
51
+ selectable = false,
52
+ toggleOpenLabel = 'Expand/collapse item',
53
+ children,
54
+ ...rootProps
55
+ } = props;
56
+ const ListRoot = variant === 'ordered' || variant === 'ordered-draggable' ? Primitive.ol : Primitive.ul;
57
+ return (
58
+ <ListRoot
59
+ {...(selectable && { role: 'listbox', 'aria-multiselectable': true })}
60
+ {...omit(rootProps, 'onDragEnd', 'listItemIds')}
61
+ ref={forwardedRef}
62
+ >
63
+ <ListProvider
64
+ {...{
65
+ scope: __listScope,
66
+ variant,
67
+ selectable,
68
+ toggleOpenLabel,
69
+ }}
70
+ >
71
+ {variant === 'ordered-draggable' ? (
72
+ <DndContext onDragEnd={(props as DraggableListProps).onDragEnd} modifiers={[restrictToVerticalAxis]}>
73
+ <SortableContext items={(props as DraggableListProps).listItemIds}>{children}</SortableContext>
74
+ </DndContext>
75
+ ) : (
76
+ <>{children}</>
77
+ )}
78
+ </ListProvider>
79
+ </ListRoot>
80
+ );
81
+ });
82
+
83
+ List.displayName = LIST_NAME;
84
+
85
+ export { List, createListScope, useListContext, LIST_NAME, arrayMove };
86
+
87
+ export type { ListProps, ListVariant, ListScopedProps, DragEndEvent };
@@ -0,0 +1,228 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { DraggableAttributes } from '@dnd-kit/core';
6
+ import { useSortable } from '@dnd-kit/sortable';
7
+ import { CSS } from '@dnd-kit/utilities';
8
+ import type { CheckboxProps } from '@radix-ui/react-checkbox';
9
+ import { CollapsibleTriggerProps } from '@radix-ui/react-collapsible';
10
+ import * as Collapsible from '@radix-ui/react-collapsible';
11
+ import { useComposedRefs } from '@radix-ui/react-compose-refs';
12
+ import { createContextScope, Scope } from '@radix-ui/react-context';
13
+ import { Primitive } from '@radix-ui/react-primitive';
14
+ import { Slot } from '@radix-ui/react-slot';
15
+ import { useControllableState } from '@radix-ui/react-use-controllable-state';
16
+ import React, { ComponentProps, ComponentPropsWithRef, Dispatch, forwardRef, SetStateAction } from 'react';
17
+
18
+ import { useId } from '@dxos/react-hooks';
19
+
20
+ import { LIST_NAME, ListScopedProps, useListContext } from './List';
21
+
22
+ const LIST_ITEM_NAME = 'ListItem';
23
+
24
+ type ListItemScopedProps<P> = P & { __listItemScope?: Scope };
25
+
26
+ interface ListItemData {
27
+ id: string;
28
+ selected?: CheckboxProps['checked'];
29
+ open?: boolean;
30
+ }
31
+
32
+ type ListItemProps = Omit<ListItemData, 'id'> & { collapsible?: boolean } & ComponentPropsWithRef<
33
+ typeof Primitive.li
34
+ > & {
35
+ defaultOpen?: boolean;
36
+ onOpenChange?: (nextOpen: boolean) => void;
37
+ } & {
38
+ onSelectedChange?: CheckboxProps['onCheckedChange'];
39
+ defaultSelected?: CheckboxProps['defaultChecked'];
40
+ };
41
+
42
+ type ListItemElement = React.ElementRef<typeof Primitive.li>;
43
+
44
+ const [createListItemContext, createListItemScope] = createContextScope(LIST_ITEM_NAME, []);
45
+
46
+ type DraggableListItemContextValue = {
47
+ draggableAttributes: DraggableAttributes;
48
+ draggableListeners: ReturnType<typeof useSortable>['listeners'];
49
+ };
50
+
51
+ type ListItemContextValue = {
52
+ headingId: string;
53
+ open: boolean;
54
+ selected: CheckboxProps['checked'];
55
+ setSelected: Dispatch<SetStateAction<CheckboxProps['checked']>>;
56
+ } & Partial<DraggableListItemContextValue>;
57
+
58
+ const [ListItemProvider, useListItemContext] = createListItemContext<ListItemContextValue>(LIST_ITEM_NAME);
59
+
60
+ type ListItemHeadingProps = ListItemScopedProps<Omit<ComponentPropsWithRef<typeof Primitive.p>, 'id'>> & {
61
+ asChild?: boolean;
62
+ };
63
+
64
+ const ListItemHeading = forwardRef<HTMLParagraphElement, ListItemHeadingProps>(
65
+ ({ children, asChild, __listItemScope, ...props }, forwardedRef) => {
66
+ const { headingId } = useListItemContext(LIST_ITEM_NAME, __listItemScope);
67
+ const Root = asChild ? Slot : Primitive.p;
68
+ return (
69
+ <Root {...props} id={headingId} ref={forwardedRef}>
70
+ {children}
71
+ </Root>
72
+ );
73
+ },
74
+ );
75
+
76
+ type ListItemDragHandleProps = ComponentPropsWithRef<typeof Primitive.div>;
77
+
78
+ const ListItemDragHandle = forwardRef<HTMLDivElement, ListItemScopedProps<ListItemDragHandleProps>>(
79
+ ({ __listItemScope, children, ...props }, forwardedRef) => {
80
+ const { draggableAttributes, draggableListeners } = useListItemContext(LIST_ITEM_NAME, __listItemScope);
81
+ return (
82
+ <div role='button' ref={forwardedRef} {...props} {...draggableAttributes} {...draggableListeners}>
83
+ {children}
84
+ </div>
85
+ );
86
+ },
87
+ );
88
+
89
+ type ListItemOpenTriggerProps = ListItemScopedProps<CollapsibleTriggerProps>;
90
+
91
+ const ListItemOpenTrigger = Collapsible.Trigger;
92
+
93
+ type ListItemCollapsibleContentProps = ComponentProps<typeof Collapsible.Content>;
94
+
95
+ const ListItemCollapsibleContent = Collapsible.Content;
96
+
97
+ const PureListItem = forwardRef<
98
+ ListItemElement,
99
+ ListItemProps & { id: string } & Partial<DraggableListItemContextValue>
100
+ >(
101
+ (
102
+ props: ListItemScopedProps<
103
+ ListScopedProps<ListItemProps & { id: string } & Partial<DraggableListItemContextValue>>
104
+ >,
105
+ forwardedRef,
106
+ ) => {
107
+ const {
108
+ __listScope,
109
+ __listItemScope,
110
+ children,
111
+ selected: propsSelected,
112
+ defaultSelected,
113
+ onSelectedChange,
114
+ open: propsOpen,
115
+ defaultOpen,
116
+ onOpenChange,
117
+ collapsible,
118
+ id,
119
+ draggableAttributes,
120
+ draggableListeners,
121
+ ...listItemProps
122
+ } = props;
123
+ const { selectable } = useListContext(LIST_NAME, __listScope);
124
+
125
+ const [selected = false, setSelected] = useControllableState({
126
+ prop: propsSelected,
127
+ defaultProp: defaultSelected,
128
+ onChange: onSelectedChange,
129
+ });
130
+
131
+ const [open = false, setOpen] = useControllableState({
132
+ prop: propsOpen,
133
+ defaultProp: defaultOpen,
134
+ onChange: onOpenChange,
135
+ });
136
+
137
+ const headingId = useId('listItem__heading');
138
+
139
+ const listItem = (
140
+ <Primitive.li
141
+ {...listItemProps}
142
+ id={id}
143
+ ref={forwardedRef}
144
+ aria-labelledby={headingId}
145
+ {...(selectable && { role: 'option', 'aria-selected': !!selected })}
146
+ >
147
+ {children}
148
+ </Primitive.li>
149
+ );
150
+
151
+ return (
152
+ <ListItemProvider
153
+ scope={__listItemScope}
154
+ headingId={headingId}
155
+ open={open}
156
+ selected={selected}
157
+ setSelected={setSelected}
158
+ {...{ draggableAttributes, draggableListeners }}
159
+ >
160
+ {collapsible ? (
161
+ <Collapsible.Root asChild open={open} onOpenChange={setOpen}>
162
+ {listItem}
163
+ </Collapsible.Root>
164
+ ) : (
165
+ listItem
166
+ )}
167
+ </ListItemProvider>
168
+ );
169
+ },
170
+ );
171
+
172
+ const DraggableListItem = forwardRef<ListItemElement, ListItemProps & { id: string }>(
173
+ (props: ListItemScopedProps<ListItemProps & { id: string }>, forwardedRef) => {
174
+ const { attributes, listeners, setNodeRef, transform, transition } = useSortable({
175
+ id: props.id,
176
+ });
177
+ const ref = useComposedRefs(forwardedRef, setNodeRef) as ComponentPropsWithRef<typeof Primitive.li>['ref'];
178
+
179
+ return (
180
+ <PureListItem
181
+ {...props}
182
+ style={{
183
+ ...props.style,
184
+ transform: CSS.Transform.toString(transform),
185
+ transition,
186
+ }}
187
+ ref={ref}
188
+ {...{
189
+ draggableAttributes: attributes,
190
+ draggableListeners: listeners,
191
+ }}
192
+ />
193
+ );
194
+ },
195
+ );
196
+
197
+ const ListItem = forwardRef<ListItemElement, ListItemProps>((props: ListScopedProps<ListItemProps>, forwardedRef) => {
198
+ const { variant } = useListContext(LIST_NAME, props.__listScope);
199
+ const listItemId = useId('listItem', props.id);
200
+
201
+ if (variant === 'ordered-draggable') {
202
+ return <DraggableListItem {...props} ref={forwardedRef} id={listItemId} />;
203
+ } else {
204
+ return <PureListItem {...props} ref={forwardedRef} id={listItemId} />;
205
+ }
206
+ });
207
+
208
+ ListItem.displayName = LIST_ITEM_NAME;
209
+
210
+ export {
211
+ ListItem,
212
+ ListItemHeading,
213
+ ListItemCollapsibleContent,
214
+ ListItemDragHandle,
215
+ ListItemOpenTrigger,
216
+ createListItemScope,
217
+ useListItemContext,
218
+ LIST_ITEM_NAME,
219
+ };
220
+
221
+ export type {
222
+ ListItemProps,
223
+ ListItemHeadingProps,
224
+ ListItemCollapsibleContentProps,
225
+ ListItemDragHandleProps,
226
+ ListItemOpenTriggerProps,
227
+ ListItemScopedProps,
228
+ };
package/src/index.ts CHANGED
@@ -2,5 +2,5 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- export * from './components';
6
- export * from './model';
5
+ export * from './List';
6
+ export * from './ListItem';
@@ -1,8 +0,0 @@
1
- import { Item, PublicKey } from '@dxos/client';
2
- import { ObjectModel } from '@dxos/object-model';
3
- export interface ListProps {
4
- spaceKey: PublicKey;
5
- itemId: Item<ObjectModel>['id'];
6
- }
7
- export declare const List: ({ spaceKey, itemId }: ListProps) => JSX.Element;
8
- //# sourceMappingURL=List.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/List.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAS,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAsBjD,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC;CACjC;AAiED,eAAO,MAAM,IAAI,yBAA0B,SAAS,gBAanD,CAAC"}
@@ -1,17 +0,0 @@
1
- import '@dxosTheme';
2
- import type { StoryFn } from '@storybook/react';
3
- import { PublicKey } from '@dxos/client';
4
- import { ListProps } from './List';
5
- declare const _default: {
6
- component: ({ spaceKey, itemId }: ListProps) => JSX.Element;
7
- argTypes: {};
8
- };
9
- export default _default;
10
- export declare const Default: {
11
- render: (args: Omit<ListProps, 'itemId' | 'spaceKey'> & {
12
- spaceKey?: PublicKey;
13
- id?: number;
14
- }) => JSX.Element;
15
- decorators: ((Story: StoryFn) => JSX.Element)[];
16
- };
17
- //# sourceMappingURL=List.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"List.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/List.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAIhD,OAAO,EAAsB,SAAS,EAAE,MAAM,cAAc,CAAC;AAS7D,OAAO,EAAQ,SAAS,EAAE,MAAM,QAAQ,CAAC;;;;;AAKzC,wBAGE;AAEF,eAAO,MAAM,OAAO;mBACH,KAAK,SAAS,EAAE,QAAQ,GAAG,UAAU,CAAC,GAAG;QAAE,QAAQ,CAAC,EAAE,SAAS,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE;yBAqBnF,OAAO;CAwElB,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './List';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC"}
@@ -1,55 +0,0 @@
1
- import { ComponentProps } from 'react';
2
- declare type ListId = string;
3
- declare type ListItemId = string;
4
- export interface ListItemProps {
5
- id: ListItemId;
6
- title?: string;
7
- description?: string;
8
- annotations?: Record<string, string | boolean>;
9
- }
10
- export declare type ListItems = Record<ListItemId, Omit<ListItemProps, 'id'>>;
11
- interface SharedListActionProps {
12
- listId: ListId;
13
- }
14
- interface SharedListItemActionProps extends SharedListActionProps {
15
- listItemId: ListItemId;
16
- }
17
- export interface ListItemChangedAction extends SharedListItemActionProps {
18
- next: Partial<ListItemProps>;
19
- }
20
- export interface ListChangedAction extends SharedListActionProps {
21
- next: Partial<ListPrimitiveProps>;
22
- }
23
- export interface ListItemCreatedAction extends SharedListActionProps {
24
- created: Pick<ListItemProps, 'id'> & Partial<Omit<ListItemProps, 'id'>>;
25
- }
26
- export interface ListItemDeletedAction extends SharedListActionProps {
27
- deleted: Pick<ListItemProps, 'id'> & Partial<Omit<ListItemProps, 'id'>>;
28
- }
29
- export declare type ListAction = ListItemChangedAction | ListChangedAction | ListItemCreatedAction | ListItemDeletedAction;
30
- export declare const isListItemChangedAction: (o: any) => o is ListItemChangedAction;
31
- export declare const isListItemCreatedAction: (o: any) => o is ListItemCreatedAction;
32
- export declare const isListItemDeletedAction: (o: any) => o is ListItemDeletedAction;
33
- export interface ListPrimitiveProps {
34
- id: ListId;
35
- title?: string;
36
- description?: string;
37
- }
38
- export interface ListPrimitiveComponentProps extends ListPrimitiveProps, Omit<ComponentProps<'div'>, 'id'> {
39
- items: ListItems;
40
- onAction?: (action: ListAction) => void;
41
- createListItemId?: () => Promise<ListItemId>;
42
- onChangePeriod?: number;
43
- }
44
- export interface ListItemPrimitiveComponentProps extends ListItemProps, Omit<ComponentProps<'li'>, 'id' | 'title'> {
45
- updateItem: (item: ListItemProps) => void;
46
- updateOrder: (id: ListItemId, delta: number) => void;
47
- deleteItem: (id: ListItemId) => void;
48
- createItem: () => void;
49
- orderIndex: number;
50
- isLast?: boolean;
51
- autoFocus?: boolean;
52
- }
53
- export declare const ListPrimitive: ({ id: listId, title: propsTitle, description: propsDescription, items: propsItems, onAction, createListItemId, onChangePeriod, ...divProps }: ListPrimitiveComponentProps) => JSX.Element;
54
- export {};
55
- //# sourceMappingURL=ListPrimitive.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListPrimitive.d.ts","sourceRoot":"","sources":["../../../../../src/components/ListPrimitive/ListPrimitive.tsx"],"names":[],"mappings":"AAMA,OAAc,EAAE,cAAc,EAAiD,MAAM,OAAO,CAAC;AAgB7F,aAAK,MAAM,GAAG,MAAM,CAAC;AACrB,aAAK,UAAU,GAAG,MAAM,CAAC;AAEzB,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,UAAU,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;CAChD;AAED,oBAAY,SAAS,GAAG,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC;AAEtE,UAAU,qBAAqB;IAC7B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,yBAA0B,SAAQ,qBAAqB;IAC/D,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,MAAM,WAAW,qBAAsB,SAAQ,yBAAyB;IACtE,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,iBAAkB,SAAQ,qBAAqB;IAC9D,IAAI,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB;IAClE,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC;CACzE;AAED,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB;IAClE,OAAO,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC;CACzE;AAED,oBAAY,UAAU,GAAG,qBAAqB,GAAG,iBAAiB,GAAG,qBAAqB,GAAG,qBAAqB,CAAC;AAEnH,eAAO,MAAM,uBAAuB,MAAO,GAAG,+BAAkD,CAAC;AACjG,eAAO,MAAM,uBAAuB,MAAO,GAAG,+BAA+C,CAAC;AAC9F,eAAO,MAAM,uBAAuB,MAAO,GAAG,+BAA+C,CAAC;AAE9F,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,2BAA4B,SAAQ,kBAAkB,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC;IACxG,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACxC,gBAAgB,CAAC,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,+BAAgC,SAAQ,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC;IAChH,UAAU,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IAC1C,WAAW,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD,UAAU,EAAE,CAAC,EAAE,EAAE,UAAU,KAAK,IAAI,CAAC;IACrC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AA4LD,eAAO,MAAM,aAAa,iJASvB,2BAA2B,gBA+L7B,CAAC"}
@@ -1,31 +0,0 @@
1
- import '@dxosTheme';
2
- import { ListPrimitiveComponentProps } from './ListPrimitive';
3
- declare const _default: {
4
- component: ({ id: listId, title: propsTitle, description: propsDescription, items: propsItems, onAction, createListItemId, onChangePeriod, ...divProps }: ListPrimitiveComponentProps) => JSX.Element;
5
- argTypes: {};
6
- };
7
- export default _default;
8
- export declare const Default: {
9
- render: (args: Omit<ListPrimitiveComponentProps, 'item'>) => JSX.Element;
10
- args: {
11
- id: string;
12
- items: {
13
- x234567: {
14
- title: string;
15
- };
16
- x345678: {
17
- title: string;
18
- annotations: {
19
- state: string;
20
- };
21
- };
22
- x456789: {
23
- title: string;
24
- };
25
- x567890: {
26
- title: string;
27
- };
28
- };
29
- };
30
- };
31
- //# sourceMappingURL=ListPrimitive.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListPrimitive.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/ListPrimitive/ListPrimitive.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAGpB,OAAO,EAAiB,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;;;;;AAE7E,wBAGE;AAEF,eAAO,MAAM,OAAO;mBACH,KAAK,2BAA2B,EAAE,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;CAyBzD,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './ListPrimitive';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/ListPrimitive/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './List';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './usePropStatefully';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,qBAAqB,CAAC"}
@@ -1,6 +0,0 @@
1
- import { Dispatch, SetStateAction } from 'react';
2
- /**
3
- * @deprecated
4
- */
5
- export declare const usePropStatefully: <T>(propsValue: T, equivalentPredicate?: ((a: T, b: T) => boolean) | undefined) => [T, Dispatch<SetStateAction<T>>, string];
6
- //# sourceMappingURL=usePropStatefully.d.ts.map