@dxos/plugin-status-bar 0.8.4-main.d05673bc65 → 0.8.4-main.dfabb4ec29

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 (112) hide show
  1. package/dist/lib/neutral/StatusBarActions-GYLT4QVU.mjs +8 -0
  2. package/dist/lib/neutral/StatusBarPanel-UTQAZ7VT.mjs +20 -0
  3. package/dist/lib/{browser/StatusBarPanel-KWQL4TTQ.mjs.map → neutral/StatusBarPanel-UTQAZ7VT.mjs.map} +4 -4
  4. package/dist/lib/neutral/StatusBarPlugin.mjs +17 -0
  5. package/dist/lib/neutral/StatusBarPlugin.mjs.map +7 -0
  6. package/dist/lib/neutral/VersionNumber-E7DDIVTB.mjs +7 -0
  7. package/dist/lib/neutral/capabilities/index.mjs +7 -0
  8. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  9. package/dist/lib/{browser/chunk-DJN2GTOY.mjs → neutral/chunk-BHLVVHW4.mjs} +6 -3
  10. package/dist/lib/neutral/chunk-BHLVVHW4.mjs.map +7 -0
  11. package/dist/lib/{browser/chunk-WUIMMP5N.mjs → neutral/chunk-DV7SD4RL.mjs} +21 -27
  12. package/dist/lib/neutral/chunk-DV7SD4RL.mjs.map +7 -0
  13. package/dist/lib/{browser/chunk-MAM2WQN4.mjs → neutral/chunk-PQSD2QVZ.mjs} +15 -20
  14. package/dist/lib/neutral/chunk-PQSD2QVZ.mjs.map +7 -0
  15. package/dist/lib/{browser/chunk-CBR3FWPA.mjs → neutral/components/index.mjs} +10 -11
  16. package/dist/lib/neutral/components/index.mjs.map +7 -0
  17. package/dist/lib/neutral/containers/index.mjs +11 -0
  18. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  19. package/dist/lib/neutral/index.mjs +7 -0
  20. package/dist/lib/neutral/meta.json +1 -0
  21. package/dist/lib/neutral/meta.mjs +7 -0
  22. package/dist/lib/neutral/plugin.mjs +11 -0
  23. package/dist/lib/neutral/plugin.mjs.map +7 -0
  24. package/dist/lib/neutral/react-surface-LRBTL7UM.mjs +27 -0
  25. package/dist/lib/neutral/react-surface-LRBTL7UM.mjs.map +7 -0
  26. package/dist/lib/neutral/translations.mjs +24 -0
  27. package/dist/lib/neutral/translations.mjs.map +7 -0
  28. package/dist/types/src/StatusBarPlugin.d.ts +1 -0
  29. package/dist/types/src/StatusBarPlugin.d.ts.map +1 -1
  30. package/dist/types/src/StatusBarPlugin.test.d.ts +2 -0
  31. package/dist/types/src/StatusBarPlugin.test.d.ts.map +1 -0
  32. package/dist/types/src/capabilities/index.d.ts +2 -1
  33. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  34. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  35. package/dist/types/src/components/StatusBar/StatusBar.d.ts +6 -4
  36. package/dist/types/src/components/StatusBar/StatusBar.d.ts.map +1 -1
  37. package/dist/types/src/components/StatusBar/StatusBar.stories.d.ts +3 -1
  38. package/dist/types/src/components/StatusBar/StatusBar.stories.d.ts.map +1 -1
  39. package/dist/types/src/containers/StatusBarActions/StatusBarActions.d.ts.map +1 -1
  40. package/dist/types/src/containers/StatusBarActions/StatusBarActions.stories.d.ts +7 -0
  41. package/dist/types/src/containers/StatusBarActions/StatusBarActions.stories.d.ts.map +1 -0
  42. package/dist/types/src/containers/StatusBarActions/index.d.ts +1 -2
  43. package/dist/types/src/containers/StatusBarActions/index.d.ts.map +1 -1
  44. package/dist/types/src/containers/StatusBarPanel/StatusBarPanel.d.ts.map +1 -1
  45. package/dist/types/src/containers/StatusBarPanel/index.d.ts +1 -2
  46. package/dist/types/src/containers/StatusBarPanel/index.d.ts.map +1 -1
  47. package/dist/types/src/containers/VersionNumber/VersionNumber.d.ts.map +1 -1
  48. package/dist/types/src/containers/VersionNumber/index.d.ts +1 -2
  49. package/dist/types/src/containers/VersionNumber/index.d.ts.map +1 -1
  50. package/dist/types/src/index.d.ts +0 -2
  51. package/dist/types/src/index.d.ts.map +1 -1
  52. package/dist/types/src/meta.d.ts.map +1 -1
  53. package/dist/types/src/plugin.d.ts +3 -0
  54. package/dist/types/src/plugin.d.ts.map +1 -0
  55. package/dist/types/src/translations.d.ts +11 -12
  56. package/dist/types/src/translations.d.ts.map +1 -1
  57. package/dist/types/tsconfig.tsbuildinfo +1 -1
  58. package/package.json +69 -25
  59. package/src/StatusBarPlugin.test.ts +23 -0
  60. package/src/StatusBarPlugin.ts +5 -3
  61. package/src/capabilities/index.ts +3 -1
  62. package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +5 -11
  63. package/src/components/StatusBar/StatusBar.stories.tsx +18 -18
  64. package/src/components/StatusBar/StatusBar.tsx +41 -19
  65. package/src/containers/StatusBarActions/StatusBarActions.stories.tsx +62 -0
  66. package/src/containers/StatusBarActions/StatusBarActions.tsx +20 -16
  67. package/src/containers/StatusBarActions/index.ts +1 -3
  68. package/src/containers/StatusBarPanel/index.ts +1 -3
  69. package/src/containers/VersionNumber/VersionNumber.tsx +43 -32
  70. package/src/containers/VersionNumber/index.ts +1 -3
  71. package/src/index.ts +1 -2
  72. package/src/meta.ts +2 -1
  73. package/src/plugin.ts +9 -0
  74. package/src/translations.ts +11 -11
  75. package/dist/lib/browser/StatusBarActions-63FMNXUX.mjs +0 -10
  76. package/dist/lib/browser/StatusBarPanel-KWQL4TTQ.mjs +0 -25
  77. package/dist/lib/browser/VersionNumber-NSVK34RP.mjs +0 -9
  78. package/dist/lib/browser/chunk-CBR3FWPA.mjs.map +0 -7
  79. package/dist/lib/browser/chunk-DJN2GTOY.mjs.map +0 -7
  80. package/dist/lib/browser/chunk-MAM2WQN4.mjs.map +0 -7
  81. package/dist/lib/browser/chunk-WUIMMP5N.mjs.map +0 -7
  82. package/dist/lib/browser/index.mjs +0 -47
  83. package/dist/lib/browser/index.mjs.map +0 -7
  84. package/dist/lib/browser/meta.json +0 -1
  85. package/dist/lib/browser/react-surface-ZVKPLSAI.mjs +0 -45
  86. package/dist/lib/browser/react-surface-ZVKPLSAI.mjs.map +0 -7
  87. package/dist/lib/node-esm/StatusBarActions-LI4FUZ4F.mjs +0 -11
  88. package/dist/lib/node-esm/StatusBarPanel-O22JVKD4.mjs +0 -26
  89. package/dist/lib/node-esm/StatusBarPanel-O22JVKD4.mjs.map +0 -7
  90. package/dist/lib/node-esm/VersionNumber-6PD7SUMF.mjs +0 -10
  91. package/dist/lib/node-esm/chunk-5H2TCCFW.mjs +0 -18
  92. package/dist/lib/node-esm/chunk-5H2TCCFW.mjs.map +0 -7
  93. package/dist/lib/node-esm/chunk-7KTRYBWS.mjs +0 -78
  94. package/dist/lib/node-esm/chunk-7KTRYBWS.mjs.map +0 -7
  95. package/dist/lib/node-esm/chunk-B4UMHTV6.mjs +0 -51
  96. package/dist/lib/node-esm/chunk-B4UMHTV6.mjs.map +0 -7
  97. package/dist/lib/node-esm/chunk-YVIPBYHG.mjs +0 -76
  98. package/dist/lib/node-esm/chunk-YVIPBYHG.mjs.map +0 -7
  99. package/dist/lib/node-esm/index.mjs +0 -48
  100. package/dist/lib/node-esm/index.mjs.map +0 -7
  101. package/dist/lib/node-esm/meta.json +0 -1
  102. package/dist/lib/node-esm/react-surface-QSB537IH.mjs +0 -46
  103. package/dist/lib/node-esm/react-surface-QSB537IH.mjs.map +0 -7
  104. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  105. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  106. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  107. package/src/capabilities/react-surface/index.ts +0 -7
  108. /package/dist/lib/{browser/StatusBarActions-63FMNXUX.mjs.map → neutral/StatusBarActions-GYLT4QVU.mjs.map} +0 -0
  109. /package/dist/lib/{browser/VersionNumber-NSVK34RP.mjs.map → neutral/VersionNumber-E7DDIVTB.mjs.map} +0 -0
  110. /package/dist/lib/{node-esm/StatusBarActions-LI4FUZ4F.mjs.map → neutral/index.mjs.map} +0 -0
  111. /package/dist/lib/{node-esm/VersionNumber-6PD7SUMF.mjs.map → neutral/meta.mjs.map} +0 -0
  112. /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-status-bar",
3
- "version": "0.8.4-main.d05673bc65",
3
+ "version": "0.8.4-main.dfabb4ec29",
4
4
  "description": "Status bar plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -12,18 +12,61 @@
12
12
  "author": "DXOS.org",
13
13
  "sideEffects": true,
14
14
  "type": "module",
15
+ "imports": {
16
+ "#capabilities": {
17
+ "source": "./src/capabilities/index.ts",
18
+ "types": "./dist/types/src/capabilities/index.d.ts",
19
+ "default": "./dist/lib/neutral/capabilities/index.mjs"
20
+ },
21
+ "#components": {
22
+ "source": "./src/components/index.ts",
23
+ "types": "./dist/types/src/components/index.d.ts",
24
+ "default": "./dist/lib/neutral/components/index.mjs"
25
+ },
26
+ "#containers": {
27
+ "source": "./src/containers/index.ts",
28
+ "types": "./dist/types/src/containers/index.d.ts",
29
+ "default": "./dist/lib/neutral/containers/index.mjs"
30
+ },
31
+ "#meta": {
32
+ "source": "./src/meta.ts",
33
+ "types": "./dist/types/src/meta.d.ts",
34
+ "default": "./dist/lib/neutral/meta.mjs"
35
+ },
36
+ "#plugin": {
37
+ "source": "./src/StatusBarPlugin.ts",
38
+ "types": "./dist/types/src/StatusBarPlugin.d.ts",
39
+ "default": "./dist/lib/neutral/StatusBarPlugin.mjs"
40
+ },
41
+ "#translations": {
42
+ "source": "./src/translations.ts",
43
+ "types": "./dist/types/src/translations.d.ts",
44
+ "default": "./dist/lib/neutral/translations.mjs"
45
+ }
46
+ },
15
47
  "exports": {
16
48
  ".": {
17
49
  "source": "./src/index.ts",
18
50
  "types": "./dist/types/src/index.d.ts",
19
- "browser": "./dist/lib/browser/index.mjs",
20
- "node": "./dist/lib/node-esm/index.mjs"
51
+ "default": "./dist/lib/neutral/index.mjs"
52
+ },
53
+ "./components": {
54
+ "source": "./src/components/index.ts",
55
+ "types": "./dist/types/src/components/index.d.ts",
56
+ "default": "./dist/lib/neutral/components/index.mjs"
57
+ },
58
+ "./plugin": {
59
+ "source": "./src/plugin.ts",
60
+ "types": "./dist/types/src/plugin.d.ts",
61
+ "default": "./dist/lib/neutral/plugin.mjs"
62
+ },
63
+ "./translations": {
64
+ "source": "./src/translations.ts",
65
+ "types": "./dist/types/src/translations.d.ts",
66
+ "default": "./dist/lib/neutral/translations.mjs"
21
67
  }
22
68
  },
23
69
  "types": "dist/types/src/index.d.ts",
24
- "typesVersions": {
25
- "*": {}
26
- },
27
70
  "files": [
28
71
  "dist",
29
72
  "src"
@@ -31,36 +74,37 @@
31
74
  "dependencies": {
32
75
  "@fluentui/react-tabster": "9.26.11",
33
76
  "@radix-ui/react-slot": "1.1.2",
34
- "date-fns": "^3.3.1",
35
- "effect": "3.19.16",
77
+ "date-fns": "^3.6.0",
78
+ "effect": "3.20.0",
36
79
  "react-resize-detector": "^11.0.1",
37
- "@dxos/app-framework": "0.8.4-main.d05673bc65",
38
- "@dxos/async": "0.8.4-main.d05673bc65",
39
- "@dxos/app-toolkit": "0.8.4-main.d05673bc65",
40
- "@dxos/operation": "0.8.4-main.d05673bc65",
41
- "@dxos/react-client": "0.8.4-main.d05673bc65",
42
- "@dxos/plugin-observability": "0.8.4-main.d05673bc65",
43
- "@dxos/schema": "0.8.4-main.d05673bc65",
44
- "@dxos/util": "0.8.4-main.d05673bc65",
45
- "@dxos/react-ui-form": "0.8.4-main.d05673bc65",
46
- "@dxos/echo": "0.8.4-main.d05673bc65"
80
+ "@dxos/app-toolkit": "0.8.4-main.dfabb4ec29",
81
+ "@dxos/async": "0.8.4-main.dfabb4ec29",
82
+ "@dxos/app-framework": "0.8.4-main.dfabb4ec29",
83
+ "@dxos/operation": "0.8.4-main.dfabb4ec29",
84
+ "@dxos/echo": "0.8.4-main.dfabb4ec29",
85
+ "@dxos/plugin-observability": "0.8.4-main.dfabb4ec29",
86
+ "@dxos/react-client": "0.8.4-main.dfabb4ec29",
87
+ "@dxos/react-ui-form": "0.8.4-main.dfabb4ec29",
88
+ "@dxos/util": "0.8.4-main.dfabb4ec29",
89
+ "@dxos/schema": "0.8.4-main.dfabb4ec29"
47
90
  },
48
91
  "devDependencies": {
49
92
  "@types/react": "~19.2.7",
50
93
  "@types/react-dom": "~19.2.3",
51
94
  "react": "~19.2.3",
52
95
  "react-dom": "~19.2.3",
53
- "vite": "^7.1.11",
54
- "@dxos/react-ui": "0.8.4-main.d05673bc65",
55
- "@dxos/ui-theme": "0.8.4-main.d05673bc65",
56
- "@dxos/storybook-utils": "0.8.4-main.d05673bc65"
96
+ "vite": "^8.0.10",
97
+ "@dxos/plugin-testing": "0.8.4-main.dfabb4ec29",
98
+ "@dxos/react-ui": "0.8.4-main.dfabb4ec29",
99
+ "@dxos/ui-theme": "0.8.4-main.dfabb4ec29",
100
+ "@dxos/storybook-utils": "0.8.4-main.dfabb4ec29"
57
101
  },
58
102
  "peerDependencies": {
59
- "effect": "3.19.16",
103
+ "effect": "3.20.0",
60
104
  "react": "~19.2.3",
61
105
  "react-dom": "~19.2.3",
62
- "@dxos/ui-theme": "0.8.4-main.d05673bc65",
63
- "@dxos/react-ui": "0.8.4-main.d05673bc65"
106
+ "@dxos/ui-theme": "0.8.4-main.dfabb4ec29",
107
+ "@dxos/react-ui": "0.8.4-main.dfabb4ec29"
64
108
  },
65
109
  "publishConfig": {
66
110
  "access": "public"
@@ -0,0 +1,23 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { describe, test } from 'vitest';
6
+
7
+ import { createComposerTestApp } from '@dxos/plugin-testing/harness';
8
+
9
+ import { StatusBarPlugin } from '#plugin';
10
+
11
+ import { meta } from './meta';
12
+
13
+ const moduleId = (name: string) => `${meta.id}.module.${name}`;
14
+
15
+ describe('StatusBarPlugin', () => {
16
+ test('modules activate on the expected events', async ({ expect }) => {
17
+ await using harness = await createComposerTestApp({
18
+ plugins: [StatusBarPlugin()],
19
+ });
20
+
21
+ expect(harness.manager.getActive()).toContain(moduleId('ReactSurface'));
22
+ });
23
+ });
@@ -5,12 +5,14 @@
5
5
  import { Plugin } from '@dxos/app-framework';
6
6
  import { AppPlugin } from '@dxos/app-toolkit';
7
7
 
8
- import { ReactSurface } from './capabilities';
9
- import { meta } from './meta';
10
- import { translations } from './translations';
8
+ import { ReactSurface } from '#capabilities';
9
+ import { meta } from '#meta';
10
+ import { translations } from '#translations';
11
11
 
12
12
  export const StatusBarPlugin = Plugin.define(meta).pipe(
13
13
  AppPlugin.addSurfaceModule({ activate: ReactSurface }),
14
14
  AppPlugin.addTranslationsModule({ translations }),
15
15
  Plugin.make,
16
16
  );
17
+
18
+ export default StatusBarPlugin;
@@ -2,4 +2,6 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export * from './react-surface';
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
@@ -8,30 +8,24 @@ import React from 'react';
8
8
  import { Capabilities, Capability } from '@dxos/app-framework';
9
9
  import { Surface } from '@dxos/app-framework/ui';
10
10
 
11
- import { StatusBarActions, StatusBarPanel, VersionNumber } from '../../containers';
12
- import { meta } from '../../meta';
11
+ import { StatusBarActions, StatusBarPanel, VersionNumber } from '#containers';
13
12
 
14
13
  export default Capability.makeModule(() =>
15
14
  Effect.succeed(
16
15
  Capability.contributes(Capabilities.ReactSurface, [
17
16
  Surface.create({
18
- id: `${meta.id}.status-bar`,
17
+ id: 'status-bar',
19
18
  role: 'status-bar',
20
19
  component: () => <StatusBarPanel />,
21
20
  }),
22
21
  Surface.create({
23
- id: `${meta.id}.status-bar--r0-footer`,
24
- role: 'status-bar--r0-footer',
25
- component: () => <Surface.Surface role='status' />,
26
- }),
27
- Surface.create({
28
- id: `${meta.id}.status-bar--r1-footer`,
22
+ id: 'status-bar--r1-footer',
29
23
  role: 'status-bar--r1-footer',
30
24
  component: () => <StatusBarActions />,
31
25
  }),
32
26
  Surface.create({
33
- id: `${meta.id}.header-end`,
34
- role: 'header-end',
27
+ id: 'version-info',
28
+ role: 'version-info',
35
29
  component: () => <VersionNumber />,
36
30
  }),
37
31
  ]),
@@ -5,30 +5,27 @@
5
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import React from 'react';
7
7
 
8
- import { Icon } from '@dxos/react-ui';
8
+ import { Icon, IconButton } from '@dxos/react-ui';
9
9
  import { withTheme } from '@dxos/react-ui/testing';
10
10
 
11
11
  import { StatusBar } from './index';
12
12
 
13
- export const DefaultStory = () => (
14
- <div>
15
- <StatusBar.EndContent>
13
+ const DefaultStory = () => (
14
+ <StatusBar.EndContent>
15
+ <StatusBar.Button>
16
+ <Icon icon='ph--mailbox--regular' />
17
+ <StatusBar.Text>Quick feedback</StatusBar.Text>
18
+ </StatusBar.Button>
19
+ <a href='https://dxos.org/discord' target='_blank' rel='noopener noreferrer'>
16
20
  <StatusBar.Button>
17
- <Icon icon='ph--mailbox--regular' size={4} />
18
- <StatusBar.Text>Quick feedback</StatusBar.Text>
21
+ <Icon icon='ph--discord-logo--regular' />
22
+ <StatusBar.Text>Join us on Discord</StatusBar.Text>
19
23
  </StatusBar.Button>
20
- <a href='https://dxos.org/discord' target='_blank' rel='noopener noreferrer'>
21
- <StatusBar.Button>
22
- <Icon icon='ph--discord-logo--regular' size={4} />
23
- <StatusBar.Text>Join us on Discord</StatusBar.Text>
24
- </StatusBar.Button>
25
- </a>
26
- <StatusBar.Item>
27
- <Icon icon='ph--lightning--regular' size={4} />
28
- <StatusBar.Text>Online</StatusBar.Text>
29
- </StatusBar.Item>
30
- </StatusBar.EndContent>
31
- </div>
24
+ </a>
25
+ <StatusBar.Item>
26
+ <IconButton variant='ghost' icon='ph--lightning--regular' iconOnly label='Online' />
27
+ </StatusBar.Item>
28
+ </StatusBar.EndContent>
32
29
  );
33
30
 
34
31
  const meta = {
@@ -36,6 +33,9 @@ const meta = {
36
33
  component: StatusBar as any,
37
34
  render: DefaultStory,
38
35
  decorators: [withTheme()],
36
+ parameters: {
37
+ layout: 'centered',
38
+ },
39
39
  } satisfies Meta<typeof StatusBar>;
40
40
 
41
41
  export default meta;
@@ -8,6 +8,26 @@ import React, { type ComponentPropsWithRef, type PropsWithChildren, type ReactNo
8
8
  import { type ThemedClassName } from '@dxos/react-ui';
9
9
  import { mx } from '@dxos/ui-theme';
10
10
 
11
+ //
12
+ // Item
13
+ //
14
+
15
+ type StatusBarItemProps = ThemedClassName<PropsWithChildren>;
16
+
17
+ const StatusBarItem = forwardRef<HTMLDivElement, StatusBarItemProps>(
18
+ ({ classNames, children, ...props }, forwardedRef) => {
19
+ return (
20
+ <div {...props} role='status' className={mx('grid place-items-center', classNames)} ref={forwardedRef}>
21
+ {children}
22
+ </div>
23
+ );
24
+ },
25
+ );
26
+
27
+ //
28
+ // Text
29
+ //
30
+
11
31
  type StatusBarTextProps = ThemedClassName<{ children: ReactNode }>;
12
32
 
13
33
  const StatusBarText = forwardRef<HTMLSpanElement, StatusBarTextProps>(({ classNames, children }, forwardedRef) => (
@@ -16,8 +36,15 @@ const StatusBarText = forwardRef<HTMLSpanElement, StatusBarTextProps>(({ classNa
16
36
  </span>
17
37
  ));
18
38
 
39
+ //
40
+ // Button
41
+ //
42
+
19
43
  type StatusBarButtonProps = ThemedClassName<ComponentPropsWithRef<'button'> & { asChild?: boolean }>;
20
44
 
45
+ /**
46
+ * @deprecated
47
+ */
21
48
  const StatusBarButton = forwardRef<HTMLButtonElement, StatusBarButtonProps>(
22
49
  ({ classNames, children, asChild, ...props }, forwardedRef) => {
23
50
  const classes = mx(
@@ -39,42 +66,37 @@ const StatusBarButton = forwardRef<HTMLButtonElement, StatusBarButtonProps>(
39
66
  },
40
67
  );
41
68
 
42
- export default StatusBarButton;
43
-
44
- type StatusBarItemProps = ThemedClassName<ComponentPropsWithRef<'div'>>;
45
-
46
- const StatusBarItem = forwardRef<HTMLDivElement, StatusBarItemProps>(
47
- ({ classNames, children, ...props }, forwardedRef) => (
48
- <div
49
- role='menuitem'
50
- className={mx('flex items-center justify-center gap-2 p-1 px-2 rounded-xs select-none', classNames)}
51
- ref={forwardedRef}
52
- {...props}
53
- >
54
- {children}
55
- </div>
56
- ),
57
- );
69
+ //
70
+ // Content
71
+ //
58
72
 
59
73
  type StartContentProps = ThemedClassName<PropsWithChildren<{}>>;
60
74
 
61
75
  const StartContent = forwardRef<HTMLDivElement, StartContentProps>(({ classNames, children }, forwardedRef) => (
62
- <div role='none' className={mx('flex-grow flex items-center space-x-2', classNames)} ref={forwardedRef}>
76
+ <div className={mx('flex-grow flex items-center space-x-2', classNames)} ref={forwardedRef}>
63
77
  {children}
64
78
  </div>
65
79
  ));
66
80
 
81
+ //
82
+ // EndContent
83
+ //
84
+
67
85
  type EndContentProps = ThemedClassName<PropsWithChildren<{}>>;
68
86
 
69
87
  const EndContent = forwardRef<HTMLDivElement, EndContentProps>(({ classNames, children }, forwardedRef) => (
70
- <div role='none' className={mx('flex-grow flex items-center justify-end', classNames)} ref={forwardedRef}>
88
+ <div className={mx('flex-grow flex items-center justify-end', classNames)} ref={forwardedRef}>
71
89
  {children}
72
90
  </div>
73
91
  ));
74
92
 
93
+ //
94
+ // StatusBar
95
+ //
96
+
75
97
  export const StatusBar = {
76
- Text: StatusBarText,
77
98
  Item: StatusBarItem,
99
+ Text: StatusBarText,
78
100
  Button: StatusBarButton,
79
101
  StartContent,
80
102
  EndContent,
@@ -0,0 +1,62 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
+
7
+ import { Config } from '@dxos/react-client';
8
+ import { withClientProvider } from '@dxos/react-client/testing';
9
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
10
+
11
+ import { translations } from '#translations';
12
+
13
+ import { StatusBarActions } from './StatusBarActions';
14
+
15
+ const meta: Meta<typeof StatusBarActions> = {
16
+ title: 'plugins/plugin-status-bar/containers/StatusBarActions',
17
+ component: StatusBarActions,
18
+ decorators: [
19
+ withTheme(),
20
+ withLayout({
21
+ layout: 'centered',
22
+ classNames: 'w-[calc(var(--dx-complementary-sidebar-size)_-_var(--dx-rail-content))]',
23
+ }),
24
+ withClientProvider({
25
+ config: new Config({
26
+ version: 1,
27
+ runtime: {
28
+ client: {
29
+ storage: {
30
+ persistent: false,
31
+ },
32
+ },
33
+ app: {
34
+ build: {
35
+ version: '0.8.3-beta.b78990fdd5',
36
+ timestamp: '2024-06-01T12:00:00.000Z',
37
+ commitHash: 'b78990fdd5',
38
+ },
39
+ env: {
40
+ DX_ENVIRONMENT: 'development',
41
+ },
42
+ },
43
+ services: {
44
+ edge: {
45
+ url: 'https://edge-dev.dxos.org',
46
+ },
47
+ },
48
+ },
49
+ }),
50
+ }),
51
+ ],
52
+ parameters: {
53
+ layout: 'centered',
54
+ translations,
55
+ },
56
+ };
57
+
58
+ export default meta;
59
+
60
+ type Story = StoryObj<typeof meta>;
61
+
62
+ export const Default: Story = {};
@@ -7,8 +7,9 @@ import React, { useState } from 'react';
7
7
  import { useConfig } from '@dxos/react-client';
8
8
  import { Icon, Popover, useTranslation } from '@dxos/react-ui';
9
9
 
10
- import { StatusBar } from '../../components';
11
- import { meta } from '../../meta';
10
+ import { StatusBar } from '#components';
11
+ import { meta } from '#meta';
12
+
12
13
  import VersionNumber from '../VersionNumber';
13
14
 
14
15
  export type StatusBarActionsProps = {};
@@ -19,20 +20,23 @@ export const StatusBarActions = (_props: StatusBarActionsProps) => {
19
20
 
20
21
  return (
21
22
  <Popover.Root open={open} onOpenChange={setOpen}>
22
- <EnvironmentLabel />
23
- <VersionNumber />
24
- <StatusBar.Button asChild>
25
- <a href='https://dxos.org/discord' target='_blank' rel='noopener noreferrer'>
26
- <Icon icon='ph--discord-logo--regular' size={4} />
27
- <StatusBar.Text classNames='hidden sm:block'>{t('discord label')}</StatusBar.Text>
28
- </a>
29
- </StatusBar.Button>
30
- <StatusBar.Button asChild>
31
- <a href='https://github.com/dxos/dxos' target='_blank' rel='noopener noreferrer'>
32
- <Icon icon='ph--github-logo--regular' size={4} />
33
- <StatusBar.Text classNames='hidden sm:block'>{t('github label')}</StatusBar.Text>
34
- </a>
35
- </StatusBar.Button>
23
+ <div className='h-full flex items-center px-2 gap-2'>
24
+ <EnvironmentLabel />
25
+ <VersionNumber />
26
+ <div className='grow' />
27
+ <StatusBar.Button asChild>
28
+ <a href='https://dxos.org/discord' target='_blank' rel='noopener noreferrer'>
29
+ <Icon icon='ph--discord-logo--regular' />
30
+ <StatusBar.Text classNames='hidden sm:block'>{t('discord.label')}</StatusBar.Text>
31
+ </a>
32
+ </StatusBar.Button>
33
+ <StatusBar.Button asChild>
34
+ <a href='https://github.com/dxos/dxos' target='_blank' rel='noopener noreferrer'>
35
+ <Icon icon='ph--github-logo--regular' />
36
+ <StatusBar.Text classNames='hidden sm:block'>{t('github.label')}</StatusBar.Text>
37
+ </a>
38
+ </StatusBar.Button>
39
+ </div>
36
40
  </Popover.Root>
37
41
  );
38
42
  };
@@ -2,6 +2,4 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { StatusBarActions } from './StatusBarActions';
6
-
7
- export default StatusBarActions;
5
+ export { StatusBarActions as default } from './StatusBarActions';
@@ -2,6 +2,4 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { StatusBarPanel } from './StatusBarPanel';
6
-
7
- export default StatusBarPanel;
5
+ export { StatusBarPanel as default } from './StatusBarPanel';
@@ -8,8 +8,8 @@ import React from 'react';
8
8
  import { useConfig } from '@dxos/react-client';
9
9
  import { Icon, Link, Message, Popover, Trans, useTranslation } from '@dxos/react-ui';
10
10
 
11
- import { StatusBar } from '../../components';
12
- import { meta } from '../../meta';
11
+ import { StatusBar } from '#components';
12
+ import { meta } from '#meta';
13
13
 
14
14
  export type VersionNumberProps = {};
15
15
 
@@ -22,7 +22,6 @@ export const VersionNumber = (_props: VersionNumberProps) => {
22
22
  const config = useConfig();
23
23
  const { version, timestamp, commitHash } = config.values.runtime?.app?.build ?? {};
24
24
  const [_, v] = version?.match(VERSION_REGEX) ?? [];
25
- const isLabs = config.values.runtime?.app?.env?.DX_LABS;
26
25
 
27
26
  const releaseUrl =
28
27
  config.values.runtime?.app?.env?.DX_ENVIRONMENT === 'production'
@@ -34,49 +33,61 @@ export const VersionNumber = (_props: VersionNumberProps) => {
34
33
  return (
35
34
  <Popover.Root>
36
35
  <Popover.Trigger asChild>
37
- <StatusBar.Button classNames='text-xs'>{isLabs ? version : v}</StatusBar.Button>
36
+ <StatusBar.Button classNames='h-full text-xs'>{v}</StatusBar.Button>
38
37
  </Popover.Trigger>
39
38
  <Popover.Portal>
40
- <Popover.Content
41
- side='top'
42
- role='message'
43
- classNames='z-[12] bg-warning-500 max-w-[min(calc(100vw-16px),40ch)]'
44
- >
45
- <Message.Root valence='warning' classNames='rounded-b-none p-5'>
46
- <Message.Title>{t('warning title')}</Message.Title>
39
+ <Popover.Content side='top' role='message' classNames='z-[12] max-w-[min(calc(100vw-16px),40ch)]'>
40
+ <Message.Root valence='info' classNames='p-2 rounded-b-none'>
41
+ <Message.Title>{t('warning.title')}</Message.Title>
47
42
  <Message.Content>
48
- {t('technology preview message')}
43
+ {t('technology-preview.message')}
49
44
  <br />
50
45
  <Link href={previewUrl} target='_blank' rel='noreferrer' variant='neutral'>
51
- {t('learn more label')}
46
+ {t('learn-more.label')}
52
47
  <Icon icon='ph--arrow-square-out--bold' classNames='dx-icon-inline ms-1' />
53
48
  </Link>
54
49
  </Message.Content>
55
50
  </Message.Root>
56
- <div role='none' className='py-4 px-5 space-b-2 text-base-surface-text'>
51
+ <div className='flex flex-col ps-10 pe-4 py-2 gap-1 space-b-2 text-base-surface-text'>
57
52
  {timestamp && (
53
+ <div>
54
+ <p>
55
+ {t('released.message', {
56
+ released: formatDistance(new Date(timestamp), new Date(), { addSuffix: true }),
57
+ })}
58
+ </p>
59
+ <div>
60
+ <span className='dx-tag dx-tag--neutral -ml-1'>{version}</span>
61
+ </div>
62
+ </div>
63
+ )}
64
+ <div>
58
65
  <p>
59
- {t('released message', {
60
- released: formatDistance(new Date(timestamp), new Date(), { addSuffix: true }),
61
- })}
62
- <br />
63
66
  <Link href={releaseUrl} target='_blank' rel='noreferrer' variant='neutral'>
64
- {t('see release label')}
65
- <Icon icon='ph--arrow-square-out--bold' classNames='dx-icon-inline ms-1' />
67
+ {t('see-release.label')}
68
+ <Icon icon='ph--arrow-square-out--bold' size={4} classNames='dx-icon-inline ms-1' />
66
69
  </Link>
67
70
  </p>
68
- )}
69
- <p>
70
- <Trans
71
- {...{
72
- t,
73
- i18nKey: 'powered by dxos message',
74
- components: {
75
- dxos: <Link href='https://dxos.org' target='_blank' rel='noreferrer' variant='neutral' />,
76
- },
77
- }}
78
- />
79
- </p>
71
+ <p>
72
+ <Trans
73
+ {...{
74
+ t,
75
+ i18nKey: 'powered-by-dxos.message',
76
+ components: {
77
+ dxos: (
78
+ <Link
79
+ classNames='text-green-500'
80
+ href='https://dxos.org'
81
+ target='_blank'
82
+ rel='noreferrer'
83
+ variant='neutral'
84
+ />
85
+ ),
86
+ },
87
+ }}
88
+ />
89
+ </p>
90
+ </div>
80
91
  </div>
81
92
  <Popover.Arrow />
82
93
  </Popover.Content>
@@ -2,6 +2,4 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { VersionNumber } from './VersionNumber';
6
-
7
- export default VersionNumber;
5
+ export { VersionNumber as default } from './VersionNumber';
package/src/index.ts CHANGED
@@ -2,6 +2,5 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- export * from './components';
5
+ // TODO(wittjosiah): StatusBar should be factored out of plugin-status-bar into a shared UI package.
6
6
  export * from './meta';
7
- export * from './StatusBarPlugin';
package/src/meta.ts CHANGED
@@ -6,11 +6,12 @@ import { type Plugin } from '@dxos/app-framework';
6
6
  import { trim } from '@dxos/util';
7
7
 
8
8
  export const meta: Plugin.Meta = {
9
- id: 'org.dxos.plugin.status-bar',
9
+ id: 'org.dxos.plugin.statusBar',
10
10
  name: 'Status Bar',
11
11
  description: trim`
12
12
  Persistent bottom bar displaying workspace status information and quick actions.
13
13
  Access connection state, notifications, and common commands without leaving your current context.
14
14
  `,
15
15
  icon: 'ph--info--regular',
16
+ tags: ['system'],
16
17
  };