@dxos/react-ui-list 0.8.4-main.a4bbb77 → 0.8.4-main.abd8ff62ef
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 +1349 -718
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +1349 -718
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Accordion/Accordion.d.ts +1 -1
- package/dist/types/src/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/types/src/components/Accordion/Accordion.stories.d.ts +0 -3
- package/dist/types/src/components/Accordion/Accordion.stories.d.ts.map +1 -1
- package/dist/types/src/components/Accordion/AccordionItem.d.ts.map +1 -1
- package/dist/types/src/components/Accordion/AccordionRoot.d.ts +1 -1
- package/dist/types/src/components/Accordion/AccordionRoot.d.ts.map +1 -1
- package/dist/types/src/components/Combobox/Combobox.d.ts +105 -0
- package/dist/types/src/components/Combobox/Combobox.d.ts.map +1 -0
- package/dist/types/src/components/Combobox/Combobox.stories.d.ts +12 -0
- package/dist/types/src/components/Combobox/Combobox.stories.d.ts.map +1 -0
- package/dist/types/src/components/Combobox/index.d.ts +2 -0
- package/dist/types/src/components/Combobox/index.d.ts.map +1 -0
- package/dist/types/src/components/List/List.d.ts +19 -8
- package/dist/types/src/components/List/List.d.ts.map +1 -1
- package/dist/types/src/components/List/List.stories.d.ts +2 -2
- package/dist/types/src/components/List/List.stories.d.ts.map +1 -1
- package/dist/types/src/components/List/ListItem.d.ts +10 -8
- package/dist/types/src/components/List/ListItem.d.ts.map +1 -1
- package/dist/types/src/components/List/ListRoot.d.ts +2 -2
- package/dist/types/src/components/List/ListRoot.d.ts.map +1 -1
- package/dist/types/src/components/List/testing.d.ts +1 -1
- package/dist/types/src/components/List/testing.d.ts.map +1 -1
- package/dist/types/src/components/Listbox/Listbox.d.ts +27 -0
- package/dist/types/src/components/Listbox/Listbox.d.ts.map +1 -0
- package/dist/types/src/components/Listbox/Listbox.stories.d.ts +12 -0
- package/dist/types/src/components/Listbox/Listbox.stories.d.ts.map +1 -0
- package/dist/types/src/components/Listbox/index.d.ts +2 -0
- package/dist/types/src/components/Listbox/index.d.ts.map +1 -0
- package/dist/types/src/components/Picker/Picker.d.ts +49 -0
- package/dist/types/src/components/Picker/Picker.d.ts.map +1 -0
- package/dist/types/src/components/Picker/Picker.stories.d.ts +28 -0
- package/dist/types/src/components/Picker/Picker.stories.d.ts.map +1 -0
- package/dist/types/src/components/Picker/context.d.ts +29 -0
- package/dist/types/src/components/Picker/context.d.ts.map +1 -0
- package/dist/types/src/components/Picker/index.d.ts +3 -0
- package/dist/types/src/components/Picker/index.d.ts.map +1 -0
- package/dist/types/src/components/RowList/RowList.d.ts +61 -0
- package/dist/types/src/components/RowList/RowList.d.ts.map +1 -0
- package/dist/types/src/components/RowList/RowList.stories.d.ts +35 -0
- package/dist/types/src/components/RowList/RowList.stories.d.ts.map +1 -0
- package/dist/types/src/components/RowList/index.d.ts +3 -0
- package/dist/types/src/components/RowList/index.d.ts.map +1 -0
- package/dist/types/src/components/Tree/Tree.d.ts +10 -6
- package/dist/types/src/components/Tree/Tree.d.ts.map +1 -1
- package/dist/types/src/components/Tree/Tree.stories.d.ts +9 -28
- package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tree/TreeContext.d.ts +24 -10
- package/dist/types/src/components/Tree/TreeContext.d.ts.map +1 -1
- package/dist/types/src/components/Tree/TreeItem.d.ts +25 -4
- package/dist/types/src/components/Tree/TreeItem.d.ts.map +1 -1
- package/dist/types/src/components/Tree/TreeItemHeading.d.ts +4 -3
- package/dist/types/src/components/Tree/TreeItemHeading.d.ts.map +1 -1
- package/dist/types/src/components/Tree/TreeItemToggle.d.ts +3 -3
- package/dist/types/src/components/Tree/TreeItemToggle.d.ts.map +1 -1
- package/dist/types/src/components/Tree/helpers.d.ts.map +1 -1
- package/dist/types/src/components/Tree/index.d.ts +2 -0
- package/dist/types/src/components/Tree/index.d.ts.map +1 -1
- package/dist/types/src/components/Tree/testing.d.ts +3 -3
- package/dist/types/src/components/Tree/testing.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +4 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/util/path.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +34 -31
- package/src/components/Accordion/Accordion.stories.tsx +5 -8
- package/src/components/Accordion/AccordionItem.tsx +3 -4
- package/src/components/Accordion/AccordionRoot.tsx +1 -1
- package/src/components/Combobox/Combobox.stories.tsx +60 -0
- package/src/components/Combobox/Combobox.tsx +387 -0
- package/src/components/Combobox/index.ts +5 -0
- package/src/components/List/List.stories.tsx +34 -22
- package/src/components/List/List.tsx +14 -10
- package/src/components/List/ListItem.tsx +60 -40
- package/src/components/List/ListRoot.tsx +3 -3
- package/src/components/List/testing.ts +7 -7
- package/src/components/Listbox/Listbox.stories.tsx +48 -0
- package/src/components/Listbox/Listbox.tsx +201 -0
- package/src/components/Listbox/index.ts +5 -0
- package/src/components/Picker/Picker.stories.tsx +131 -0
- package/src/components/Picker/Picker.tsx +439 -0
- package/src/components/Picker/context.ts +43 -0
- package/src/components/Picker/index.ts +6 -0
- package/src/components/RowList/RowList.stories.tsx +163 -0
- package/src/components/RowList/RowList.tsx +353 -0
- package/src/components/RowList/index.ts +6 -0
- package/src/components/Tree/Tree.stories.tsx +153 -64
- package/src/components/Tree/Tree.tsx +43 -40
- package/src/components/Tree/TreeContext.tsx +21 -9
- package/src/components/Tree/TreeItem.tsx +214 -127
- package/src/components/Tree/TreeItemHeading.tsx +10 -8
- package/src/components/Tree/TreeItemToggle.tsx +29 -18
- package/src/components/Tree/index.ts +2 -0
- package/src/components/Tree/testing.ts +10 -9
- package/src/components/index.ts +4 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React, { type ComponentPropsWithRef, type PropsWithChildren, type ReactNode } from 'react';
|
|
2
|
+
import { type Density, type Elevation, type ThemedClassName } from '@dxos/react-ui';
|
|
3
|
+
type PickerRootProps = PropsWithChildren<{}>;
|
|
4
|
+
declare function PickerRoot({ children }: PickerRootProps): React.JSX.Element;
|
|
5
|
+
declare namespace PickerRoot {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
8
|
+
type InputVariant = 'default' | 'subdued';
|
|
9
|
+
type PickerInputProps = ThemedClassName<Omit<ComponentPropsWithRef<'input'>, 'value'> & {
|
|
10
|
+
/** Controlled input value. Caller owns this — e.g. binds to query state. */
|
|
11
|
+
value?: string;
|
|
12
|
+
/** Called on every keystroke with the new input string. */
|
|
13
|
+
onValueChange?: (value: string) => void;
|
|
14
|
+
density?: Density;
|
|
15
|
+
elevation?: Elevation;
|
|
16
|
+
variant?: InputVariant;
|
|
17
|
+
}>;
|
|
18
|
+
type PickerItemProps = ThemedClassName<{
|
|
19
|
+
/** Unique identifier; used by the registry and DOM-order traversal. */
|
|
20
|
+
value: string;
|
|
21
|
+
/** Callback when the item is committed (click, or Enter while highlighted). */
|
|
22
|
+
onSelect?: () => void;
|
|
23
|
+
/** Disable the item — registry-visible but not focusable, not navigable, not clickable. */
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
asChild?: boolean;
|
|
26
|
+
children?: ReactNode;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const Picker: {
|
|
29
|
+
Root: {
|
|
30
|
+
({ children }: PickerRootProps): React.JSX.Element;
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
33
|
+
Input: React.ForwardRefExoticComponent<Omit<PickerInputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
34
|
+
Item: React.ForwardRefExoticComponent<Omit<{
|
|
35
|
+
/** Unique identifier; used by the registry and DOM-order traversal. */
|
|
36
|
+
value: string;
|
|
37
|
+
/** Callback when the item is committed (click, or Enter while highlighted). */
|
|
38
|
+
onSelect?: () => void;
|
|
39
|
+
/** Disable the item — registry-visible but not focusable, not navigable, not clickable. */
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
asChild?: boolean;
|
|
42
|
+
children?: ReactNode;
|
|
43
|
+
}, "className"> & {
|
|
44
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
45
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
46
|
+
};
|
|
47
|
+
export type { PickerRootProps, PickerInputProps, PickerItemProps };
|
|
48
|
+
export { usePickerInputContext, usePickerItemContext } from './context';
|
|
49
|
+
//# sourceMappingURL=Picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/Picker/Picker.tsx"],"names":[],"mappings":"AA4CA,OAAO,KAAK,EAAE,EAEZ,KAAK,qBAAqB,EAG1B,KAAK,iBAAiB,EACtB,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,SAAS,EAAS,KAAK,eAAe,EAAmB,MAAM,gBAAgB,CAAC;AAwB5G,KAAK,eAAe,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAC;4BAEzB,EAAE,QAAQ,EAAE,EAAE,eAAe;;;;AA0GjD,KAAK,YAAY,GAAG,SAAS,GAAG,SAAS,CAAC;AAE1C,KAAK,gBAAgB,GAAG,eAAe,CACrC,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,GAAG;IAC9C,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB,CACF,CAAC;AAoHF,KAAK,eAAe,GAAG,eAAe,CAAC;IACrC,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC,CAAC;AAmGH,eAAO,MAAM,MAAM;IACjB,IAAI;uBAvV4B,eAAe;;;IAwV/C,KAAK;IACL,IAAI;QA9GJ,uEAAuE;eAChE,MAAM;QACb,+EAA+E;mBACpE,MAAM,IAAI;QACrB,2FAA2F;mBAChF,OAAO;kBACR,OAAO;mBACN,SAAS;;;;CAwGrB,CAAC;AAEF,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAC;AAKnE,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
type StoryItem = {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
};
|
|
7
|
+
type StoryArgs = {
|
|
8
|
+
/** Items to render. Defaults to the full 24-item catalog. */
|
|
9
|
+
items?: StoryItem[];
|
|
10
|
+
/** When true, the input is controlled and filters the rendered set. */
|
|
11
|
+
controlled?: boolean;
|
|
12
|
+
/** Indices into `items` that should render disabled. */
|
|
13
|
+
disabledIndices?: number[];
|
|
14
|
+
};
|
|
15
|
+
declare const meta: {
|
|
16
|
+
title: string;
|
|
17
|
+
render: (args: StoryArgs) => React.JSX.Element;
|
|
18
|
+
decorators: import("@storybook/react").Decorator[];
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export default meta;
|
|
24
|
+
type Story = StoryObj<StoryArgs>;
|
|
25
|
+
export declare const Default: Story;
|
|
26
|
+
export declare const Filtering: Story;
|
|
27
|
+
export declare const WithDisabled: Story;
|
|
28
|
+
//# sourceMappingURL=Picker.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Picker.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Picker/Picker.stories.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAA4B,MAAM,OAAO,CAAC;AAUjD,KAAK,SAAS,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAclD,KAAK,SAAS,GAAG;IACf,6DAA6D;IAC7D,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;IACpB,uEAAuE;IACvE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,wDAAwD;IACxD,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AA2DF,QAAA,MAAM,IAAI;;;;;QAKN,MAAM;;CAEiB,CAAC;eAEb,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;AAEjC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,SAAS,EAAE,KAIvB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAK1B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Stable: items subscribe to selection, registry. Doesn't change on query. */
|
|
2
|
+
export type PickerItemContextValue = {
|
|
3
|
+
/** Currently highlighted item value (virtual; not browser focus). */
|
|
4
|
+
selectedValue: string | undefined;
|
|
5
|
+
/** Update the highlighted value (e.g. arrow keys, hover). */
|
|
6
|
+
onSelectedValueChange: (value: string | undefined) => void;
|
|
7
|
+
/** Register an item for keyboard nav + DOM-order traversal. */
|
|
8
|
+
registerItem: (value: string, element: HTMLElement | null, onSelect: (() => void) | undefined, disabled?: boolean) => void;
|
|
9
|
+
/** Unregister an item. */
|
|
10
|
+
unregisterItem: (value: string) => void;
|
|
11
|
+
};
|
|
12
|
+
/** Volatile: input subscribes to selection + the input keyboard helpers. */
|
|
13
|
+
export type PickerInputContextValue = {
|
|
14
|
+
/** Currently highlighted item value. */
|
|
15
|
+
selectedValue: string | undefined;
|
|
16
|
+
/** Update the highlighted value. */
|
|
17
|
+
onSelectedValueChange: (value: string | undefined) => void;
|
|
18
|
+
/** Get registered item values in DOM order (excludes disabled). */
|
|
19
|
+
getItemValues: () => string[];
|
|
20
|
+
/** Trigger the highlighted item's `onSelect`. */
|
|
21
|
+
triggerSelect: () => void;
|
|
22
|
+
};
|
|
23
|
+
export declare const PickerItemContextProvider: import("react").FC<PickerItemContextValue & {
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
}>, usePickerItemContext: (consumerName: string) => PickerItemContextValue;
|
|
26
|
+
export declare const PickerInputContextProvider: import("react").FC<PickerInputContextValue & {
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
}>, usePickerInputContext: (consumerName: string) => PickerInputContextValue;
|
|
29
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../../src/components/Picker/context.ts"],"names":[],"mappings":"AAUA,+EAA+E;AAC/E,MAAM,MAAM,sBAAsB,GAAG;IACnC,qEAAqE;IACrE,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,6DAA6D;IAC7D,qBAAqB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC3D,+DAA+D;IAC/D,YAAY,EAAE,CACZ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,WAAW,GAAG,IAAI,EAC3B,QAAQ,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,EAClC,QAAQ,CAAC,EAAE,OAAO,KACf,IAAI,CAAC;IACV,0BAA0B;IAC1B,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,4EAA4E;AAC5E,MAAM,MAAM,uBAAuB,GAAG;IACpC,wCAAwC;IACxC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,oCAAoC;IACpC,qBAAqB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAC3D,mEAAmE;IACnE,aAAa,EAAE,MAAM,MAAM,EAAE,CAAC;IAC9B,iDAAiD;IACjD,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAO,yBAAyB;;IAAE,oBAAoB,kDAAuD,CAAC;AAErH,eAAO,MAAO,0BAA0B;;IAAE,qBAAqB,mDACR,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Picker/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAC/E,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React, { type FocusEvent, type MouseEvent, type PropsWithChildren } from 'react';
|
|
2
|
+
import { type ScrollAreaRootProps } from '@dxos/react-ui';
|
|
3
|
+
declare const createRowListScope: import("@radix-ui/react-context").CreateScope;
|
|
4
|
+
type RootProps = PropsWithChildren<{
|
|
5
|
+
/** Currently-selected option id (controlled). */
|
|
6
|
+
selectedId?: string;
|
|
7
|
+
/** Initial selected option for uncontrolled mode. */
|
|
8
|
+
defaultSelectedId?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Called when the user picks a different option (click, arrow keys,
|
|
11
|
+
* focus). Receives the option's `id` prop.
|
|
12
|
+
*/
|
|
13
|
+
onSelectChange?: (id: string) => void;
|
|
14
|
+
}>;
|
|
15
|
+
declare function Root({ selectedId, defaultSelectedId, onSelectChange, children }: RootProps): React.JSX.Element;
|
|
16
|
+
declare namespace Root {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
type ViewportProps = Pick<ScrollAreaRootProps, 'thin' | 'padding' | 'centered'>;
|
|
20
|
+
type ContentProps = {
|
|
21
|
+
/**
|
|
22
|
+
* Accessible label for the listbox. Strongly recommended; assistive
|
|
23
|
+
* tech announces this when focus enters the list.
|
|
24
|
+
*/
|
|
25
|
+
'aria-label'?: string;
|
|
26
|
+
};
|
|
27
|
+
type RowProps = PropsWithChildren<{
|
|
28
|
+
/** Stable identifier; matched against the parent's `selectedId`. */
|
|
29
|
+
id: string;
|
|
30
|
+
/** Disable the row — focusable but doesn't update selection, dimmed. */
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
/** Optional click handler in addition to selection. */
|
|
33
|
+
onClick?: (event: MouseEvent<HTMLLIElement>) => void;
|
|
34
|
+
/** Optional focus handler in addition to selection-follows-focus. */
|
|
35
|
+
onFocus?: (event: FocusEvent<HTMLLIElement>) => void;
|
|
36
|
+
}>;
|
|
37
|
+
declare const Row: React.ForwardRefExoticComponent<Omit<RowProps, "className"> & {
|
|
38
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
39
|
+
} & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLLIElement>>;
|
|
40
|
+
/**
|
|
41
|
+
* Read selection state for a single id, from inside any descendant of
|
|
42
|
+
* `<RowList.Root>`. Returns `true` when the row is currently selected.
|
|
43
|
+
* Lets composing components (e.g. `Listbox.OptionIndicator`) react to
|
|
44
|
+
* selection without re-rendering on unrelated changes.
|
|
45
|
+
*/
|
|
46
|
+
declare const useRowListSelection: (id: string) => boolean;
|
|
47
|
+
declare const RowList: {
|
|
48
|
+
Root: {
|
|
49
|
+
({ selectedId, defaultSelectedId, onSelectChange, children }: RootProps): React.JSX.Element;
|
|
50
|
+
displayName: string;
|
|
51
|
+
};
|
|
52
|
+
Viewport: React.ForwardRefExoticComponent<Omit<ViewportProps, "className"> & {
|
|
53
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
54
|
+
} & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLDivElement>>;
|
|
55
|
+
Content: React.ForwardRefExoticComponent<Omit<ContentProps, "className"> & {
|
|
56
|
+
classNames?: import("@dxos/ui-types").ClassNameValue;
|
|
57
|
+
} & Pick<React.HTMLAttributes<Element>, "children" | "className" | "role" | "style"> & React.RefAttributes<HTMLUListElement>>;
|
|
58
|
+
};
|
|
59
|
+
export { RowList, Row, createRowListScope, useRowListSelection };
|
|
60
|
+
export type { RootProps as RowListRootProps, ViewportProps as RowListViewportProps, ContentProps as RowListContentProps, RowProps, };
|
|
61
|
+
//# sourceMappingURL=RowList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RowList.d.ts","sourceRoot":"","sources":["../../../../../src/components/RowList/RowList.tsx"],"names":[],"mappings":"AA6EA,OAAO,KAAK,EAAE,EAAE,KAAK,UAAU,EAAqB,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAAe,MAAM,OAAO,CAAC;AAGxH,OAAO,EAAc,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAsBtE,QAAA,MAA6B,kBAAkB,+CAAyC,CAAC;AAOzF,KAAK,SAAS,GAAG,iBAAiB,CAAC;IACjC,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,CAAC,CAAC;sBAEW,EAAE,UAAU,EAAE,iBAAiB,EAAE,cAAc,EAAE,QAAQ,EAAE,EAAE,SAAS;;;;AAqCpF,KAAK,aAAa,GAAG,IAAI,CAAC,mBAAmB,EAAE,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC;AA2BhF,KAAK,YAAY,GAAG;IAClB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAgEF,KAAK,QAAQ,GAAG,iBAAiB,CAAC;IAChC,oEAAoE;IACpE,EAAE,EAAE,MAAM,CAAC;IACX,wEAAwE;IACxE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uDAAuD;IACvD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;IACrD,qEAAqE;IACrE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;CACtD,CAAC,CAAC;AAMH,QAAA,MAAM,GAAG;;0HAmDP,CAAC;AAIH;;;;;GAKG;AACH,QAAA,MAAM,mBAAmB,OAAQ,MAAM,KAAG,OAGzC,CAAC;AAMF,QAAA,MAAM,OAAO;;sEA3N8D,SAAS;;;;;;;;;CA+NnF,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,CAAC;AACjE,YAAY,EACV,SAAS,IAAI,gBAAgB,EAC7B,aAAa,IAAI,oBAAoB,EACrC,YAAY,IAAI,mBAAmB,EACnC,QAAQ,GACT,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
type TestItem = {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
};
|
|
8
|
+
type StoryArgs = {
|
|
9
|
+
/** Items to render. Defaults to the full 24-item catalog. */
|
|
10
|
+
items?: TestItem[];
|
|
11
|
+
/** Forwards to `RowList.Viewport thin`. */
|
|
12
|
+
thin?: boolean;
|
|
13
|
+
/** Forwards to `RowList.Viewport padding`. */
|
|
14
|
+
padding?: boolean;
|
|
15
|
+
/** Index into `items` that should render disabled. */
|
|
16
|
+
disabledIndex?: number;
|
|
17
|
+
/** Render the description line under each row's name. */
|
|
18
|
+
showDescription?: boolean;
|
|
19
|
+
};
|
|
20
|
+
declare const meta: {
|
|
21
|
+
title: string;
|
|
22
|
+
render: (args: StoryArgs) => React.JSX.Element;
|
|
23
|
+
decorators: import("@storybook/react").Decorator[];
|
|
24
|
+
parameters: {
|
|
25
|
+
layout: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export default meta;
|
|
29
|
+
type Story = StoryObj<StoryArgs>;
|
|
30
|
+
export declare const Default: Story;
|
|
31
|
+
export declare const Thin: Story;
|
|
32
|
+
export declare const WithDisabled: Story;
|
|
33
|
+
export declare const MasterDetail: Story;
|
|
34
|
+
export declare const WithToolbar: Story;
|
|
35
|
+
//# sourceMappingURL=RowList.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RowList.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/RowList/RowList.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAmB,MAAM,OAAO,CAAC;AAUxC,KAAK,QAAQ,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAAC;AAelE,KAAK,SAAS,GAAG;IACf,6DAA6D;IAC7D,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;IACnB,2CAA2C;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,8CAA8C;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sDAAsD;IACtD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAwGF,QAAA,MAAM,IAAI;;;;;QAKN,MAAM;;CAEiB,CAAC;eAEb,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;AAEjC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AACjC,eAAO,MAAM,IAAI,EAAE,KAAuE,CAAC;AAC3F,eAAO,MAAM,YAAY,EAAE,KAAmE,CAAC;AAC/F,eAAO,MAAM,YAAY,EAAE,KAA+C,CAAC;AAC3E,eAAO,MAAM,WAAW,EAAE,KAA8C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/RowList/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAClF,YAAY,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type HasId } from '@dxos/echo-schema';
|
|
3
2
|
import { type TreegridRootProps } from '@dxos/react-ui';
|
|
4
|
-
import { type
|
|
3
|
+
import { type TreeModel } from './TreeContext';
|
|
5
4
|
import { type TreeItemProps } from './TreeItem';
|
|
6
|
-
export type TreeProps<T extends
|
|
7
|
-
|
|
5
|
+
export type TreeProps<T extends {
|
|
6
|
+
id: string;
|
|
7
|
+
} = any> = {
|
|
8
|
+
model: TreeModel<T>;
|
|
9
|
+
rootId?: string;
|
|
8
10
|
path?: string[];
|
|
9
11
|
id: string;
|
|
10
|
-
} &
|
|
11
|
-
export declare const Tree: <T extends
|
|
12
|
+
} & Partial<Pick<TreegridRootProps, 'gridTemplateColumns' | 'classNames'>> & Pick<TreeItemProps<T>, 'draggable' | 'renderColumns' | 'blockInstruction' | 'canDrop' | 'canSelect' | 'onOpenChange' | 'onSelect' | 'onItemHover' | 'levelOffset'>;
|
|
13
|
+
export declare const Tree: <T extends {
|
|
14
|
+
id: string;
|
|
15
|
+
} = any>({ model, rootId, path, id, draggable, gridTemplateColumns, classNames, levelOffset, renderColumns, blockInstruction, canDrop, canSelect, onOpenChange, onSelect, onItemHover, }: TreeProps<T>) => React.JSX.Element;
|
|
12
16
|
//# sourceMappingURL=Tree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tree.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/Tree.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,
|
|
1
|
+
{"version":3,"file":"Tree.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/Tree.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAY,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,EAAE,KAAK,SAAS,EAAgB,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAwC,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAEtF,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,GAAG,IAAI;IACtD,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,qBAAqB,GAAG,YAAY,CAAC,CAAC,GACxE,IAAI,CACF,aAAa,CAAC,CAAC,CAAC,EACd,WAAW,GACX,eAAe,GACf,kBAAkB,GAClB,SAAS,GACT,WAAW,GACX,cAAc,GACd,UAAU,GACV,aAAa,GACb,aAAa,CAChB,CAAC;AAEJ,eAAO,MAAM,IAAI,GAAI,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,GAAG,mLAgBhD,SAAS,CAAC,CAAC,CAAC,sBA0Bd,CAAC"}
|
|
@@ -1,39 +1,20 @@
|
|
|
1
1
|
import { type StoryObj } from '@storybook/react-vite';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
declare const DefaultStory: ({ draggable }: {
|
|
4
|
+
draggable?: boolean;
|
|
5
|
+
}) => React.JSX.Element;
|
|
5
6
|
declare const meta: {
|
|
6
7
|
title: string;
|
|
7
8
|
decorators: import("@storybook/react").Decorator[];
|
|
8
|
-
component: <T extends
|
|
9
|
-
render: (props: TreeProps) => React.JSX.Element;
|
|
10
|
-
args: {
|
|
9
|
+
component: <T extends {
|
|
11
10
|
id: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
label: string;
|
|
17
|
-
icon: string | undefined;
|
|
18
|
-
};
|
|
19
|
-
isOpen: (_path: string[]) => boolean;
|
|
20
|
-
isCurrent: (_path: string[]) => boolean;
|
|
21
|
-
renderColumns: () => React.JSX.Element;
|
|
22
|
-
onOpenChange: ({ path: _path, open }: {
|
|
23
|
-
item: TestItem;
|
|
24
|
-
path: string[];
|
|
25
|
-
open: boolean;
|
|
26
|
-
}) => void;
|
|
27
|
-
onSelect: ({ path: _path, current }: {
|
|
28
|
-
item: TestItem;
|
|
29
|
-
path: string[];
|
|
30
|
-
current: boolean;
|
|
31
|
-
option: boolean;
|
|
32
|
-
}) => void;
|
|
33
|
-
};
|
|
11
|
+
} = any>({ model, rootId, path, id, draggable, gridTemplateColumns, classNames, levelOffset, renderColumns, blockInstruction, canDrop, canSelect, onOpenChange, onSelect, onItemHover, }: import("./Tree").TreeProps<T>) => React.JSX.Element;
|
|
12
|
+
render: ({ draggable }: {
|
|
13
|
+
draggable?: boolean;
|
|
14
|
+
}) => React.JSX.Element;
|
|
34
15
|
};
|
|
35
16
|
export default meta;
|
|
36
|
-
type Story = StoryObj<typeof
|
|
17
|
+
type Story = StoryObj<typeof DefaultStory>;
|
|
37
18
|
export declare const Default: Story;
|
|
38
19
|
export declare const Draggable: Story;
|
|
39
20
|
//# sourceMappingURL=Tree.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tree.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/Tree.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tree.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/Tree.stories.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAA8D,MAAM,OAAO,CAAC;AAiBnF,QAAA,MAAM,YAAY,kBAAmB;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,sBAmK3D,CAAC;AAEF,QAAA,MAAM,IAAI;;;;;;4BArK2B;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE;CA2KrB,CAAC;eAEzB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,YAAY,CAAC,CAAC;AAE3C,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,SAAS,EAAE,KAIvB,CAAC"}
|
|
@@ -1,20 +1,34 @@
|
|
|
1
|
+
import { type Atom } from '@effect-atom/atom-react';
|
|
1
2
|
import { type Label } from '@dxos/react-ui';
|
|
2
3
|
export type TreeItemDataProps = {
|
|
3
4
|
id: string;
|
|
4
5
|
label: Label;
|
|
5
6
|
parentOf?: string[];
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
/** When `false`, the item cannot be dragged (overrides tree-level `draggable`). */
|
|
8
|
+
draggable?: boolean;
|
|
9
|
+
/** When `false`, the item does not participate as a drop target. */
|
|
10
|
+
droppable?: boolean;
|
|
8
11
|
className?: string;
|
|
9
12
|
headingClassName?: string;
|
|
13
|
+
icon?: string;
|
|
14
|
+
iconHue?: string;
|
|
15
|
+
disabled?: boolean;
|
|
10
16
|
testId?: string;
|
|
11
17
|
};
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
export interface TreeModel<T extends {
|
|
19
|
+
id: string;
|
|
20
|
+
} = any> {
|
|
21
|
+
/** Atom family: resolve item by ID (content). */
|
|
22
|
+
item: (id: string) => Atom.Atom<T | undefined>;
|
|
23
|
+
/** Atom family: open state keyed by path. */
|
|
24
|
+
itemOpen: (path: string[]) => Atom.Atom<boolean>;
|
|
25
|
+
/** Atom family: current (selected) state keyed by path. */
|
|
26
|
+
itemCurrent: (path: string[]) => Atom.Atom<boolean>;
|
|
27
|
+
/** Atom family: display props for an item at a given path (path includes item's own ID at end). */
|
|
28
|
+
itemProps: (path: string[]) => Atom.Atom<TreeItemDataProps>;
|
|
29
|
+
/** Atom family: outbound child IDs for a parent ID (topology). Undefined = root. */
|
|
30
|
+
childIds: (parentId?: string) => Atom.Atom<string[]>;
|
|
31
|
+
}
|
|
32
|
+
export declare const TreeProvider: import("react").Provider<TreeModel<any> | null>;
|
|
33
|
+
export declare const useTree: () => TreeModel<any>;
|
|
20
34
|
//# sourceMappingURL=TreeContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeContext.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/TreeContext.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TreeContext.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/TreeContext.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAIpD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,mFAAmF;IACnF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oEAAoE;IACpE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,GAAG;IACvD,iDAAiD;IACjD,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAC/C,6CAA6C;IAC7C,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjD,2DAA2D;IAC3D,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACpD,mGAAmG;IACnG,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAC5D,oFAAoF;IACpF,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;CACtD;AAID,eAAO,MAAM,YAAY,iDAAuB,CAAC;AAEjD,eAAO,MAAM,OAAO,sBAA6E,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';
|
|
2
|
+
import * as Schema from 'effect/Schema';
|
|
2
3
|
import { type FC } from 'react';
|
|
3
|
-
import { type HasId } from '@dxos/echo-schema';
|
|
4
4
|
export declare const TreeDataSchema: Schema.Struct<{
|
|
5
5
|
id: typeof Schema.String;
|
|
6
6
|
path: Schema.Array$<typeof Schema.String>;
|
|
@@ -8,24 +8,37 @@ export declare const TreeDataSchema: Schema.Struct<{
|
|
|
8
8
|
}>;
|
|
9
9
|
export type TreeData = Schema.Schema.Type<typeof TreeDataSchema>;
|
|
10
10
|
export declare const isTreeData: (data: unknown) => data is TreeData;
|
|
11
|
-
export type ColumnRenderer<T extends
|
|
11
|
+
export type ColumnRenderer<T extends {
|
|
12
|
+
id: string;
|
|
13
|
+
} = any> = FC<{
|
|
12
14
|
item: T;
|
|
13
15
|
path: string[];
|
|
14
16
|
open: boolean;
|
|
15
17
|
menuOpen: boolean;
|
|
16
18
|
setMenuOpen: (open: boolean) => void;
|
|
17
19
|
}>;
|
|
18
|
-
export type TreeItemProps<T extends
|
|
20
|
+
export type TreeItemProps<T extends {
|
|
21
|
+
id: string;
|
|
22
|
+
} = any> = {
|
|
19
23
|
item: T;
|
|
20
24
|
path: string[];
|
|
21
25
|
levelOffset?: number;
|
|
22
26
|
last: boolean;
|
|
23
27
|
draggable?: boolean;
|
|
24
28
|
renderColumns?: ColumnRenderer<T>;
|
|
29
|
+
blockInstruction?: (params: {
|
|
30
|
+
instruction: Instruction;
|
|
31
|
+
source: TreeData;
|
|
32
|
+
target: TreeData;
|
|
33
|
+
}) => boolean;
|
|
25
34
|
canDrop?: (params: {
|
|
26
35
|
source: TreeData;
|
|
27
36
|
target: TreeData;
|
|
28
37
|
}) => boolean;
|
|
38
|
+
canSelect?: (params: {
|
|
39
|
+
item: T;
|
|
40
|
+
path: string[];
|
|
41
|
+
}) => boolean;
|
|
29
42
|
onOpenChange?: (params: {
|
|
30
43
|
item: T;
|
|
31
44
|
path: string[];
|
|
@@ -37,6 +50,14 @@ export type TreeItemProps<T extends HasId = any> = {
|
|
|
37
50
|
current: boolean;
|
|
38
51
|
option: boolean;
|
|
39
52
|
}) => void;
|
|
53
|
+
onItemHover?: (params: {
|
|
54
|
+
item: T;
|
|
55
|
+
}) => void;
|
|
40
56
|
};
|
|
41
57
|
export declare const TreeItem: FC<TreeItemProps>;
|
|
58
|
+
/** Resolves a child ID to an item via the `item` atom and renders a TreeItem. */
|
|
59
|
+
export type TreeItemByIdProps = Omit<TreeItemProps, 'item'> & {
|
|
60
|
+
id: string;
|
|
61
|
+
};
|
|
62
|
+
export declare const TreeItemById: FC<TreeItemByIdProps>;
|
|
42
63
|
//# sourceMappingURL=TreeItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/TreeItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TreeItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/TreeItem.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,KAAK,WAAW,EAIjB,MAAM,oDAAoD,CAAC;AAI5D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAc,EACZ,KAAK,EAAE,EASR,MAAM,OAAO,CAAC;AAuBf,eAAO,MAAM,cAAc;;;;EAIzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,cAAc,CAAC,CAAC;AACjE,eAAO,MAAM,UAAU,SAAU,OAAO,KAAG,IAAI,IAAI,QAA2C,CAAC;AAE/F,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,GAAG,IAAI,EAAE,CAAC;IAC9D,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACtC,CAAC,CAAC;AAEH,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,GAAG,IAAI;IAC1D,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IAClC,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,WAAW,EAAE,WAAW,CAAC;QAAC,MAAM,EAAE,QAAQ,CAAC;QAAC,MAAM,EAAE,QAAQ,CAAA;KAAE,KAAK,OAAO,CAAC;IACzG,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,QAAQ,CAAC;QAAC,MAAM,EAAE,QAAQ,CAAA;KAAE,KAAK,OAAO,CAAC;IACtE,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,KAAK,OAAO,CAAC;IAC7D,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAC5E,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IAC5F,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,CAAC,CAAA;KAAE,KAAK,IAAI,CAAC;CAC7C,CAAC;AAyRF,eAAO,MAAM,QAAQ,EAAwB,EAAE,CAAC,aAAa,CAAC,CAAC;AAE/D,iFAAiF;AACjF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAW7E,eAAO,MAAM,YAAY,EAA4B,EAAE,CAAC,iBAAiB,CAAC,CAAC"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type Label } from '@dxos/react-ui';
|
|
3
|
-
export type
|
|
3
|
+
export type TreeItemHeadingProps = {
|
|
4
4
|
label: Label;
|
|
5
|
-
icon?: string;
|
|
6
5
|
className?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
iconHue?: string;
|
|
7
8
|
disabled?: boolean;
|
|
8
9
|
current?: boolean;
|
|
9
10
|
onSelect?: (option: boolean) => void;
|
|
10
11
|
};
|
|
11
|
-
export declare const TreeItemHeading: React.NamedExoticComponent<
|
|
12
|
+
export declare const TreeItemHeading: React.NamedExoticComponent<TreeItemHeadingProps & React.RefAttributes<HTMLButtonElement>>;
|
|
12
13
|
//# sourceMappingURL=TreeItemHeading.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeItemHeading.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/TreeItemHeading.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA6E,MAAM,OAAO,CAAC;AAElG,OAAO,EAAgB,KAAK,KAAK,EAAqC,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"TreeItemHeading.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/TreeItemHeading.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA6E,MAAM,OAAO,CAAC;AAElG,OAAO,EAAgB,KAAK,KAAK,EAAqC,MAAM,gBAAgB,CAAC;AAM7F,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,eAAe,2FAuD3B,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import { type IconButtonProps } from '@dxos/react-ui';
|
|
3
|
+
export type TreeItemToggleProps = Omit<IconButtonProps, 'icon' | 'size' | 'label'> & {
|
|
3
4
|
open?: boolean;
|
|
4
5
|
isBranch?: boolean;
|
|
5
|
-
onToggle?: () => void;
|
|
6
6
|
hidden?: boolean;
|
|
7
7
|
};
|
|
8
|
-
export declare const TreeItemToggle: React.NamedExoticComponent<TreeItemToggleProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
export declare const TreeItemToggle: React.NamedExoticComponent<Omit<TreeItemToggleProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
9
9
|
//# sourceMappingURL=TreeItemToggle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeItemToggle.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/TreeItemToggle.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA2B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TreeItemToggle.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/TreeItemToggle.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAElE,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAAG;IACnF,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,cAAc,uGA4B1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/helpers.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/helpers.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,eAAO,MAAM,kBAAkB,UAAW,MAAM;IAC9C,kBAAkB;CAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';
|
|
2
|
-
import
|
|
3
|
-
import { type HasId } from '@dxos/echo-schema';
|
|
2
|
+
import * as Schema from 'effect/Schema';
|
|
4
3
|
import { type TreeData } from './TreeItem';
|
|
5
|
-
export type TestItem =
|
|
4
|
+
export type TestItem = {
|
|
5
|
+
id: string;
|
|
6
6
|
name: string;
|
|
7
7
|
icon?: string;
|
|
8
8
|
items: TestItem[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/testing.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,oDAAoD,CAAC;AACtF,OAAO,
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../../src/components/Tree/testing.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,oDAAoD,CAAC;AACtF,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAMxC,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;EAKzB,CAAC;AAEH,eAAO,MAAM,UAAU,8BAAmB,QAaxC,CAAC;AAmBH,eAAO,MAAM,WAAW,4CAKrB;IACD,KAAK,EAAE,QAAQ,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,QAAQ,CAAC;IACjB,MAAM,EAAE,QAAQ,CAAC;CAClB,SAgCA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../../src/util/path.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,IAAI;
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../../src/util/path.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,IAAI;IACf,MAAM,YAAY,MAAM,EAAE;IAE1B,KAAK,SAAS,MAAM;IACpB,MAAM,SAAS,MAAM;IACrB,KAAK,SAAS,MAAM;IACpB,IAAI,SAAS,MAAM;IACnB,MAAM,SAAS,MAAM;IAErB,OAAO,SAAS,MAAM,MAAM,MAAM;IAClC,QAAQ,SAAS,MAAM,WAAW,MAAM;IACxC,aAAa,SAAS,MAAM,WAAW,MAAM;IAC7C,QAAQ,SAAS,MAAM,WAAW,MAAM;IACxC,MAAM,SAAS,MAAM,MAAM,MAAM;CAClC,CAAC"}
|