@dxos/plugin-navtree 0.8.3-staging.0fa589b → 0.8.4-main.3f58842

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 (51) hide show
  1. package/dist/lib/browser/{app-graph-builder-P7AY3K72.mjs → app-graph-builder-5J4LRWDX.mjs} +3 -3
  2. package/dist/lib/browser/{chunk-IEW3JD5C.mjs → chunk-ERDGQTH5.mjs} +2 -2
  3. package/dist/lib/browser/{chunk-ZJPL4XJD.mjs → chunk-SICQTLXC.mjs} +63 -50
  4. package/dist/lib/browser/chunk-SICQTLXC.mjs.map +7 -0
  5. package/dist/lib/browser/{chunk-33VLL4IJ.mjs → chunk-WCARAZ7J.mjs} +3 -3
  6. package/dist/lib/browser/index.mjs +10 -10
  7. package/dist/lib/browser/index.mjs.map +3 -3
  8. package/dist/lib/browser/{intent-resolver-NAYKKAOP.mjs → intent-resolver-3XYN2CBU.mjs} +5 -5
  9. package/dist/lib/browser/{keyboard-DDFATRUG.mjs → keyboard-QRS6WOQH.mjs} +3 -3
  10. package/dist/lib/browser/meta.json +1 -1
  11. package/dist/lib/browser/{react-surface-H3JRTVNU.mjs → react-surface-WURHCBQQ.mjs} +5 -5
  12. package/dist/lib/browser/{state-J6AKZRB4.mjs → state-54DY3DOY.mjs} +4 -4
  13. package/dist/types/src/components/CommandsDialog/CommandsTrigger.d.ts.map +1 -1
  14. package/dist/types/src/components/NavTree/NavTree.stories.d.ts +1 -1
  15. package/dist/types/src/components/NavTree/NavTree.stories.d.ts.map +1 -1
  16. package/dist/types/src/components/NavTreeContainer.d.ts.map +1 -1
  17. package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts +1 -1
  18. package/dist/types/src/components/NavTreeItem/NavTreeItemAction.stories.d.ts.map +1 -1
  19. package/dist/types/src/components/Sidebar/L1Panel.d.ts.map +1 -1
  20. package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts +1 -1
  21. package/dist/types/src/components/UserAccountAvatar/UserAccountAvatar.stories.d.ts.map +1 -1
  22. package/dist/types/src/components/index.d.ts +1 -1
  23. package/dist/types/src/components/index.d.ts.map +1 -1
  24. package/dist/types/src/experimental/Tree.d.ts +5 -5
  25. package/dist/types/src/experimental/Tree.d.ts.map +1 -1
  26. package/dist/types/src/experimental/Tree.stories.d.ts +1 -1
  27. package/dist/types/src/experimental/Tree.stories.d.ts.map +1 -1
  28. package/dist/types/src/translations.d.ts +13 -13
  29. package/dist/types/src/translations.d.ts.map +1 -1
  30. package/dist/types/tsconfig.tsbuildinfo +1 -1
  31. package/package.json +40 -42
  32. package/src/NavTreePlugin.tsx +1 -1
  33. package/src/components/CommandsDialog/CommandsTrigger.tsx +2 -4
  34. package/src/components/NavTree/NavTree.stories.tsx +2 -2
  35. package/src/components/NavTreeContainer.tsx +3 -4
  36. package/src/components/NavTreeItem/NavTreeItemAction.stories.tsx +1 -1
  37. package/src/components/NavTreeItem/NavTreeItemAction.tsx +4 -4
  38. package/src/components/Sidebar/L1Panel.tsx +2 -3
  39. package/src/components/UserAccountAvatar/UserAccountAvatar.stories.tsx +1 -1
  40. package/src/components/index.ts +1 -1
  41. package/src/experimental/Tree.stories.tsx +9 -9
  42. package/src/experimental/Tree.tsx +15 -16
  43. package/src/translations.ts +6 -4
  44. package/dist/lib/browser/chunk-ZJPL4XJD.mjs.map +0 -7
  45. /package/dist/lib/browser/{app-graph-builder-P7AY3K72.mjs.map → app-graph-builder-5J4LRWDX.mjs.map} +0 -0
  46. /package/dist/lib/browser/{chunk-IEW3JD5C.mjs.map → chunk-ERDGQTH5.mjs.map} +0 -0
  47. /package/dist/lib/browser/{chunk-33VLL4IJ.mjs.map → chunk-WCARAZ7J.mjs.map} +0 -0
  48. /package/dist/lib/browser/{intent-resolver-NAYKKAOP.mjs.map → intent-resolver-3XYN2CBU.mjs.map} +0 -0
  49. /package/dist/lib/browser/{keyboard-DDFATRUG.mjs.map → keyboard-QRS6WOQH.mjs.map} +0 -0
  50. /package/dist/lib/browser/{react-surface-H3JRTVNU.mjs.map → react-surface-WURHCBQQ.mjs.map} +0 -0
  51. /package/dist/lib/browser/{state-J6AKZRB4.mjs.map → state-54DY3DOY.mjs.map} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-navtree",
3
- "version": "0.8.3-staging.0fa589b",
3
+ "version": "0.8.4-main.3f58842",
4
4
  "description": "DXOS Surface plugin for a tree view visualization of the graph.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -30,60 +30,58 @@
30
30
  "@radix-ui/react-dismissable-layer": "1.1.5",
31
31
  "@radix-ui/react-use-controllable-state": "1.1.0",
32
32
  "date-fns": "^3.3.1",
33
- "effect": "^3.13.3",
34
- "@dxos/app-framework": "0.8.3-staging.0fa589b",
35
- "@dxos/app-graph": "0.8.3-staging.0fa589b",
36
- "@dxos/async": "0.8.3-staging.0fa589b",
37
- "@dxos/debug": "0.8.3-staging.0fa589b",
38
- "@dxos/echo-schema": "0.8.3-staging.0fa589b",
39
- "@dxos/invariant": "0.8.3-staging.0fa589b",
40
- "@dxos/echo": "0.8.3-staging.0fa589b",
41
- "@dxos/keyboard": "0.8.3-staging.0fa589b",
42
- "@dxos/live-object": "0.8.3-staging.0fa589b",
43
- "@dxos/local-storage": "0.8.3-staging.0fa589b",
44
- "@dxos/log": "0.8.3-staging.0fa589b",
45
- "@dxos/plugin-graph": "0.8.3-staging.0fa589b",
46
- "@dxos/plugin-deck": "0.8.3-staging.0fa589b",
47
- "@dxos/plugin-observability": "0.8.3-staging.0fa589b",
48
- "@dxos/protocols": "0.8.3-staging.0fa589b",
49
- "@dxos/react-client": "0.8.3-staging.0fa589b",
50
- "@dxos/react-ui-attention": "0.8.3-staging.0fa589b",
51
- "@dxos/react-ui-list": "0.8.3-staging.0fa589b",
52
- "@dxos/react-ui-menu": "0.8.3-staging.0fa589b",
53
- "@dxos/react-ui-searchlist": "0.8.3-staging.0fa589b",
54
- "@dxos/react-ui-stack": "0.8.3-staging.0fa589b",
55
- "@dxos/react-ui-tabs": "0.8.3-staging.0fa589b",
56
- "@dxos/util": "0.8.3-staging.0fa589b"
33
+ "effect": "3.17.0",
34
+ "@dxos/app-graph": "0.8.4-main.3f58842",
35
+ "@dxos/app-framework": "0.8.4-main.3f58842",
36
+ "@dxos/async": "0.8.4-main.3f58842",
37
+ "@dxos/debug": "0.8.4-main.3f58842",
38
+ "@dxos/echo": "0.8.4-main.3f58842",
39
+ "@dxos/invariant": "0.8.4-main.3f58842",
40
+ "@dxos/echo-schema": "0.8.4-main.3f58842",
41
+ "@dxos/keyboard": "0.8.4-main.3f58842",
42
+ "@dxos/live-object": "0.8.4-main.3f58842",
43
+ "@dxos/local-storage": "0.8.4-main.3f58842",
44
+ "@dxos/log": "0.8.4-main.3f58842",
45
+ "@dxos/plugin-deck": "0.8.4-main.3f58842",
46
+ "@dxos/plugin-graph": "0.8.4-main.3f58842",
47
+ "@dxos/plugin-observability": "0.8.4-main.3f58842",
48
+ "@dxos/protocols": "0.8.4-main.3f58842",
49
+ "@dxos/react-client": "0.8.4-main.3f58842",
50
+ "@dxos/react-ui-attention": "0.8.4-main.3f58842",
51
+ "@dxos/react-ui-list": "0.8.4-main.3f58842",
52
+ "@dxos/react-ui-menu": "0.8.4-main.3f58842",
53
+ "@dxos/react-ui-searchlist": "0.8.4-main.3f58842",
54
+ "@dxos/react-ui-stack": "0.8.4-main.3f58842",
55
+ "@dxos/util": "0.8.4-main.3f58842",
56
+ "@dxos/react-ui-tabs": "0.8.4-main.3f58842"
57
57
  },
58
58
  "devDependencies": {
59
- "@effect-rx/rx-react": "^0.34.1",
60
- "@effect/platform": "0.80.12",
61
- "@phosphor-icons/react": "^2.1.5",
59
+ "@effect-rx/rx-react": "0.38.0",
60
+ "@effect/platform": "0.89.0",
62
61
  "@types/react": "~18.2.0",
63
62
  "@types/react-dom": "~18.2.0",
64
63
  "react": "~18.2.0",
65
64
  "react-dom": "~18.2.0",
66
65
  "vite": "5.4.7",
67
- "@dxos/echo-signals": "0.8.3-staging.0fa589b",
68
- "@dxos/plugin-attention": "0.8.3-staging.0fa589b",
69
- "@dxos/plugin-client": "0.8.3-staging.0fa589b",
70
- "@dxos/plugin-space": "0.8.3-staging.0fa589b",
71
- "@dxos/plugin-storybook-layout": "0.8.3-staging.0fa589b",
72
- "@dxos/plugin-theme": "0.8.3-staging.0fa589b",
73
- "@dxos/random": "0.8.3-staging.0fa589b",
74
- "@dxos/react-ui": "0.8.3-staging.0fa589b",
75
- "@dxos/react-ui-theme": "0.8.3-staging.0fa589b",
76
- "@dxos/storybook-utils": "0.8.3-staging.0fa589b"
66
+ "@dxos/echo-signals": "0.8.4-main.3f58842",
67
+ "@dxos/plugin-attention": "0.8.4-main.3f58842",
68
+ "@dxos/plugin-client": "0.8.4-main.3f58842",
69
+ "@dxos/plugin-space": "0.8.4-main.3f58842",
70
+ "@dxos/plugin-storybook-layout": "0.8.4-main.3f58842",
71
+ "@dxos/plugin-theme": "0.8.4-main.3f58842",
72
+ "@dxos/random": "0.8.4-main.3f58842",
73
+ "@dxos/react-ui": "0.8.4-main.3f58842",
74
+ "@dxos/react-ui-theme": "0.8.4-main.3f58842",
75
+ "@dxos/storybook-utils": "0.8.4-main.3f58842"
77
76
  },
78
77
  "peerDependencies": {
79
78
  "@effect-rx/rx-react": "^0.34.1",
80
- "@effect/platform": "0.80.12",
81
- "@phosphor-icons/react": "^2.1.5",
79
+ "@effect/platform": "^0.80.12",
82
80
  "effect": "^3.13.3",
83
81
  "react": "~18.2.0",
84
82
  "react-dom": "~18.2.0",
85
- "@dxos/react-ui": "0.8.3-staging.0fa589b",
86
- "@dxos/react-ui-theme": "0.8.3-staging.0fa589b"
83
+ "@dxos/react-ui-theme": "0.8.4-main.3f58842",
84
+ "@dxos/react-ui": "0.8.4-main.3f58842"
87
85
  },
88
86
  "publishConfig": {
89
87
  "access": "public"
@@ -18,7 +18,7 @@ import { AppGraphBuilder, IntentResolver, Keyboard, ReactSurface, State } from '
18
18
  import { NODE_TYPE } from './components';
19
19
  import { NavTreeEvents } from './events';
20
20
  import { meta } from './meta';
21
- import translations from './translations';
21
+ import { translations } from './translations';
22
22
 
23
23
  export const NavTreePlugin = () =>
24
24
  definePlugin(meta, [
@@ -2,12 +2,10 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { MagnifyingGlass } from '@phosphor-icons/react';
6
5
  import React from 'react';
7
6
 
8
7
  import { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';
9
- import { Button, useTranslation } from '@dxos/react-ui';
10
- import { getSize } from '@dxos/react-ui-theme';
8
+ import { Button, Icon, useTranslation } from '@dxos/react-ui';
11
9
 
12
10
  import { COMMANDS_DIALOG, NAVTREE_PLUGIN } from '../../meta';
13
11
 
@@ -31,7 +29,7 @@ export const CommandsTrigger = () => {
31
29
  }
32
30
  >
33
31
  <span className='text-description font-normal grow text-start'>{t('command list input placeholder')}</span>
34
- <MagnifyingGlass className={getSize(5)} />
32
+ <Icon icon='ph--magnifying-glass--regular' size={5} />
35
33
  </Button>
36
34
  );
37
35
  };
@@ -4,7 +4,7 @@
4
4
 
5
5
  import '@dxos-theme';
6
6
 
7
- import { type StoryObj, type Meta } from '@storybook/react';
7
+ import { type StoryObj, type Meta } from '@storybook/react-vite';
8
8
  import { Schema } from 'effect';
9
9
  import React from 'react';
10
10
 
@@ -35,7 +35,7 @@ import { withLayout } from '@dxos/storybook-utils';
35
35
 
36
36
  import { NavTreePlugin } from '../../NavTreePlugin';
37
37
  import { storybookGraphBuilders } from '../../testing';
38
- import translations from '../../translations';
38
+ import { translations } from '../../translations';
39
39
  import { NavTreeContainer } from '../NavTreeContainer';
40
40
 
41
41
  faker.seed(1234);
@@ -59,10 +59,9 @@ const getItems = (graph: ReadableGraph, node?: Node, disposition?: string) => {
59
59
 
60
60
  const useItems = (node?: Node, options?: { disposition?: string; sort?: boolean }) => {
61
61
  const { graph } = useAppGraph();
62
- const connections = useConnections(graph, node?.id ?? ROOT_ID).filter((node) =>
63
- filterItems(node, options?.disposition),
64
- );
65
- return options?.sort ? connections.toSorted((a, b) => byPosition(a.properties, b.properties)) : connections;
62
+ const connections = useConnections(graph, node?.id ?? ROOT_ID);
63
+ const filtered = connections.filter((node) => filterItems(node, options?.disposition));
64
+ return options?.sort ? filtered.toSorted((a, b) => byPosition(a.properties, b.properties)) : filtered;
66
65
  };
67
66
 
68
67
  export type NavTreeContainerProps = {
@@ -4,7 +4,7 @@
4
4
 
5
5
  import '@dxos-theme';
6
6
 
7
- import { type Meta, type StoryObj } from '@storybook/react';
7
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
8
8
 
9
9
  import { type NodeArg } from '@dxos/app-graph';
10
10
  import { faker } from '@dxos/random';
@@ -7,7 +7,7 @@ import React from 'react';
7
7
  import { type Action, type Node } from '@dxos/app-graph';
8
8
  import { useTranslation, toLocalizedString, IconButton, useDensityContext } from '@dxos/react-ui';
9
9
  import { DropdownMenu, MenuProvider, type MenuItem } from '@dxos/react-ui-menu';
10
- import { hoverableControlItem, hoverableOpenControlItem, mx } from '@dxos/react-ui-theme';
10
+ import { hoverableControlItem, hoverableOpenControlItem } from '@dxos/react-ui-theme';
11
11
 
12
12
  import { NAVTREE_PLUGIN } from '../../meta';
13
13
  import { type ActionProperties } from '../../types';
@@ -46,7 +46,7 @@ export const NavTreeItemActionDropdownMenu = ({
46
46
  <DropdownMenu.Trigger asChild>
47
47
  <IconButton
48
48
  {...(density === 'coarse' ? coarseActionButtonProps : fineActionButtonProps)}
49
- classNames={mx('shrink-0 pli-2 pointer-fine:pli-1', hoverableControlItem, hoverableOpenControlItem)}
49
+ classNames={['shrink-0 pli-2 pointer-fine:pli-1', hoverableControlItem, hoverableOpenControlItem]}
50
50
  variant='ghost'
51
51
  icon={icon ?? fallbackIcon}
52
52
  iconOnly
@@ -70,12 +70,12 @@ export const NavTreeItemMonolithicAction = ({
70
70
  <IconButton
71
71
  {...(density === 'coarse' ? coarseActionButtonProps : fineActionButtonProps)}
72
72
  variant={variant}
73
- classNames={mx(
73
+ classNames={[
74
74
  'shrink-0',
75
75
  hoverableControlItem,
76
76
  hoverableOpenControlItem,
77
77
  iconOnly ? 'pli-2 pointer-fine:pli-1' : 'p-2 pointer-fine:p-2 mie-1',
78
- )}
78
+ ]}
79
79
  icon={icon ?? fallbackIcon}
80
80
  iconOnly={iconOnly}
81
81
  label={baseLabel}
@@ -83,7 +83,7 @@ const L1Panel = ({ open, item, path, currentItemId, onBack }: L1PanelProps) => {
83
83
  >
84
84
  {item.id === currentItemId && (
85
85
  <>
86
- <h2 className='flex items-center border-be border-subduedSeparator app-drag pli-1'>
86
+ <h2 className='flex items-center border-be border-subduedSeparator app-drag pli-1 density-coarse'>
87
87
  {backCapable ? (
88
88
  <TitleButton title={title} onClick={handleBack} />
89
89
  ) : (
@@ -92,10 +92,9 @@ const L1Panel = ({ open, item, path, currentItemId, onBack }: L1PanelProps) => {
92
92
  {alternateTree && !isAlternate && (
93
93
  <IconButton
94
94
  variant='ghost'
95
- classNames={mx('shrink-0', hoverableControlItem, hoverableOpenControlItem, 'pli-2 pointer-fine:pli-1')}
95
+ classNames={['shrink-0', hoverableControlItem, hoverableOpenControlItem, 'pli-2 pointer-fine:pli-1']}
96
96
  iconOnly
97
97
  size={5}
98
- density='coarse'
99
98
  icon={alternateTree.properties.icon ?? 'ph--placeholder--regular'}
100
99
  label={toLocalizedString(alternateTree.properties.label ?? alternateTree.id, t)}
101
100
  data-testid='treeView.alternateTreeButton'
@@ -4,7 +4,7 @@
4
4
 
5
5
  import '@dxos-theme';
6
6
 
7
- import { type Meta } from '@storybook/react';
7
+ import { type Meta } from '@storybook/react-vite';
8
8
 
9
9
  import { withTheme } from '@dxos/storybook-utils';
10
10
 
@@ -7,4 +7,4 @@ export * from './NavTree';
7
7
  export * from './NavTreeContainer';
8
8
  export * from './NavTreeContext';
9
9
  export * from './NavTreeDocumentTitle';
10
- export * from './types';
10
+ export type * from './types';
@@ -4,11 +4,11 @@
4
4
 
5
5
  import '@dxos-theme';
6
6
 
7
- import { House, List, Planet, PlusCircle, Sailboat } from '@phosphor-icons/react';
8
- import { type Meta } from '@storybook/react';
7
+ import { type Meta } from '@storybook/react-vite';
9
8
  import React, { type JSX, type PropsWithChildren, useEffect, useState } from 'react';
10
9
 
11
10
  import { faker } from '@dxos/random';
11
+ import { Icon, IconButton } from '@dxos/react-ui';
12
12
  import { modalSurface, mx } from '@dxos/react-ui-theme';
13
13
  import { withLayout, withTheme } from '@dxos/storybook-utils';
14
14
 
@@ -48,7 +48,7 @@ const data: TreeNodeData[] = [
48
48
  id: faker.string.uuid(),
49
49
  title: 'plugins/Personal Space',
50
50
  color: 'text-green-400',
51
- Icon: House,
51
+ iconName: 'ph--house--regular',
52
52
  children: [
53
53
  {
54
54
  id: faker.string.uuid(),
@@ -83,7 +83,7 @@ const data: TreeNodeData[] = [
83
83
  {
84
84
  id: faker.string.uuid(),
85
85
  title: faker.commerce.productName(),
86
- Icon: Planet,
86
+ iconName: 'ph--planet--regular',
87
87
  children: [
88
88
  {
89
89
  id: faker.string.uuid(),
@@ -94,12 +94,12 @@ const data: TreeNodeData[] = [
94
94
  {
95
95
  id: faker.string.uuid(),
96
96
  title: faker.commerce.productName(),
97
- Icon: Sailboat,
97
+ iconName: 'ph--sailboat--regular',
98
98
  },
99
99
  {
100
100
  id: faker.string.uuid(),
101
101
  title: faker.commerce.productName(),
102
- Icon: Planet,
102
+ iconName: 'ph--planet--regular',
103
103
  },
104
104
  ],
105
105
  },
@@ -181,7 +181,7 @@ const Sidebar = ({ mutate }: { mutate?: boolean }) => {
181
181
  setItems((items) => {
182
182
  items[0].children?.push({
183
183
  id: faker.string.uuid(),
184
- Icon: Planet,
184
+ iconName: 'ph--planet--regular',
185
185
  title: faker.commerce.productName(),
186
186
  });
187
187
 
@@ -213,11 +213,11 @@ const Sidebar = ({ mutate }: { mutate?: boolean }) => {
213
213
  </div>
214
214
 
215
215
  <div className='flex items-center my-2 px-2 gap-2'>
216
- <PlusCircle onClick={handleCreateSpace} />
216
+ <IconButton icon='ph--plus-circle--regular' iconOnly label='Create space' onClick={handleCreateSpace} />
217
217
  <span className='grow text-sm' onClick={handleCreateSpace}>
218
218
  New space
219
219
  </span>
220
- <List />
220
+ <Icon icon='ph--list--regular' />
221
221
  </div>
222
222
  </div>
223
223
  );
@@ -2,11 +2,10 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { CaretRight, Circle, File, Folder, type Icon, type IconProps, Plus, UserCircle } from '@phosphor-icons/react';
6
5
  import React, { type HTMLAttributes, type PropsWithChildren } from 'react';
7
6
 
8
- import { type ClassNameValue, type Size } from '@dxos/react-ui';
9
- import { getSize, mx } from '@dxos/react-ui-theme';
7
+ import { type ClassNameValue, Icon, type Size } from '@dxos/react-ui';
8
+ import { mx } from '@dxos/react-ui-theme';
10
9
 
11
10
  // TODO(burdon): Rounded border if first/last.
12
11
  const styles = {
@@ -15,21 +14,21 @@ const styles = {
15
14
  };
16
15
 
17
16
  export const IconButton = ({
18
- Icon,
17
+ iconName,
19
18
  classNames,
20
19
  size = 4,
21
20
  onClick,
22
- ...props
21
+ weight = 'regular',
23
22
  }: {
24
- Icon: Icon;
23
+ iconName: string;
25
24
  classNames?: ClassNameValue;
26
25
  size?: Size;
27
- } & Pick<IconProps, 'weight'> &
28
- Pick<HTMLAttributes<HTMLDivElement>, 'onClick'>) => {
26
+ weight?: 'regular' | 'duotone' | 'fill';
27
+ } & Pick<HTMLAttributes<HTMLDivElement>, 'onClick'>) => {
29
28
  // TODO(burdon): Density aware.
30
29
  return (
31
30
  <div className={mx('flex w-6 h-6 items-center justify-center select-none', classNames)} onClick={onClick}>
32
- <Icon className={mx('cursor-pointer', getSize(size))} {...props} />
31
+ <Icon icon={iconName} classNames='cursor-pointer' size={size} />
33
32
  </div>
34
33
  );
35
34
  };
@@ -37,7 +36,7 @@ export const IconButton = ({
37
36
  export type TreeNodeData = {
38
37
  id: string;
39
38
  title: string;
40
- Icon?: Icon;
39
+ iconName?: string;
41
40
  color?: string;
42
41
  children?: TreeNodeData[];
43
42
  };
@@ -123,7 +122,7 @@ const StateIcon = ({ node, open, selected, active }: TreeNodeProps) => {
123
122
  // TODO(burdon): No animation if opening/closing folder.
124
123
  return (
125
124
  <IconButton
126
- Icon={isActive ? UserCircle : Circle}
125
+ iconName={isActive ? 'ph--user-circle--regular' : 'ph--circle--regular'}
127
126
  size={4}
128
127
  weight={selected?.[id] ? 'fill' : 'duotone'}
129
128
  classNames={mx(
@@ -143,7 +142,7 @@ const OpenIcon = ({
143
142
  return (
144
143
  (children?.length && open && (
145
144
  <IconButton
146
- Icon={CaretRight}
145
+ iconName='ph--caret-right--regular'
147
146
  size={3}
148
147
  classNames={mx('transition duration-200', open?.[id] ? 'rotate-90' : 'transform-none')}
149
148
  onClick={(ev) => {
@@ -157,12 +156,12 @@ const OpenIcon = ({
157
156
 
158
157
  // TODO(burdon): Drag handle,
159
158
  const ItemIcon = ({
160
- node: { children, Icon = children?.length ? Folder : File, color },
159
+ node: { children, iconName = children?.length ? 'ph--folder--regular' : 'ph--file--regular', color },
161
160
  }: Pick<TreeNodeProps, 'node'>) => {
162
161
  return (
163
- (Icon && (
162
+ (iconName && (
164
163
  <IconButton
165
- Icon={Icon}
164
+ iconName={iconName}
166
165
  classNames={color ?? 'text-neutral-700 dark:text-neutral-300'}
167
166
  weight={color ? 'duotone' : 'regular'}
168
167
  />
@@ -173,7 +172,7 @@ const ItemIcon = ({
173
172
  const MenuItem = ({ node: { id }, onMenuAction }: Pick<TreeNodeProps, 'node' | 'onMenuAction'>) => {
174
173
  return (
175
174
  <IconButton
176
- Icon={Plus}
175
+ iconName='ph--plus--regular'
177
176
  classNames='invisible group-hover:visible'
178
177
  onClick={(ev) => {
179
178
  ev.stopPropagation();
@@ -2,12 +2,14 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { NAVTREE_PLUGIN } from './meta';
5
+ import { type Resource } from '@dxos/react-ui';
6
6
 
7
- export default [
7
+ import { meta } from './meta';
8
+
9
+ export const translations = [
8
10
  {
9
11
  'en-US': {
10
- [NAVTREE_PLUGIN]: {
12
+ [meta.id]: {
11
13
  'app menu label': 'App menu',
12
14
  'open settings label': 'Settings',
13
15
  'open commands label': 'Search commands',
@@ -19,4 +21,4 @@ export default [
19
21
  },
20
22
  },
21
23
  },
22
- ];
24
+ ] as const satisfies Resource[];