@dxos/plugin-status-bar 0.8.4-main.fffef41 → 0.8.4-staging.60fe92afc8

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 (118) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +1 -1
  3. package/dist/lib/neutral/StatusBarActions-ZW4NBUYE.mjs +8 -0
  4. package/dist/lib/neutral/StatusBarActions-ZW4NBUYE.mjs.map +7 -0
  5. package/dist/lib/neutral/StatusBarPanel-4VTSCYUZ.mjs +20 -0
  6. package/dist/lib/neutral/StatusBarPanel-4VTSCYUZ.mjs.map +7 -0
  7. package/dist/lib/neutral/StatusBarPlugin.mjs +17 -0
  8. package/dist/lib/neutral/StatusBarPlugin.mjs.map +7 -0
  9. package/dist/lib/neutral/VersionNumber-KFAOZTYT.mjs +7 -0
  10. package/dist/lib/neutral/VersionNumber-KFAOZTYT.mjs.map +7 -0
  11. package/dist/lib/neutral/capabilities/index.mjs +7 -0
  12. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  13. package/dist/lib/neutral/chunk-JK45L5QY.mjs +42 -0
  14. package/dist/lib/neutral/chunk-JK45L5QY.mjs.map +7 -0
  15. package/dist/lib/neutral/chunk-ME6QGIWK.mjs +22 -0
  16. package/dist/lib/neutral/chunk-ME6QGIWK.mjs.map +7 -0
  17. package/dist/lib/neutral/chunk-R4HDO3RK.mjs +18 -0
  18. package/dist/lib/neutral/chunk-R4HDO3RK.mjs.map +7 -0
  19. package/dist/lib/neutral/components/index.mjs +48 -0
  20. package/dist/lib/neutral/components/index.mjs.map +7 -0
  21. package/dist/lib/neutral/containers/index.mjs +11 -0
  22. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  23. package/dist/lib/neutral/index.mjs +7 -0
  24. package/dist/lib/neutral/index.mjs.map +7 -0
  25. package/dist/lib/neutral/meta.json +1 -0
  26. package/dist/lib/neutral/meta.mjs +7 -0
  27. package/dist/lib/neutral/meta.mjs.map +7 -0
  28. package/dist/lib/neutral/plugin.mjs +11 -0
  29. package/dist/lib/neutral/plugin.mjs.map +7 -0
  30. package/dist/lib/neutral/react-surface-QZCA6YHG.mjs +27 -0
  31. package/dist/lib/neutral/react-surface-QZCA6YHG.mjs.map +7 -0
  32. package/dist/lib/neutral/translations.mjs +16 -0
  33. package/dist/lib/neutral/translations.mjs.map +7 -0
  34. package/dist/types/src/StatusBarPlugin.d.ts +3 -1
  35. package/dist/types/src/StatusBarPlugin.d.ts.map +1 -1
  36. package/dist/types/src/StatusBarPlugin.test.d.ts +2 -0
  37. package/dist/types/src/StatusBarPlugin.test.d.ts.map +1 -0
  38. package/dist/types/src/capabilities/index.d.ts +2 -1
  39. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  40. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  41. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  42. package/dist/types/src/components/{StatusBar.d.ts → StatusBar/StatusBar.d.ts} +9 -7
  43. package/dist/types/src/components/StatusBar/StatusBar.d.ts.map +1 -0
  44. package/dist/types/src/components/{StatusBar.stories.d.ts → StatusBar/StatusBar.stories.d.ts} +3 -1
  45. package/dist/types/src/components/StatusBar/StatusBar.stories.d.ts.map +1 -0
  46. package/dist/types/src/components/StatusBar/index.d.ts +2 -0
  47. package/dist/types/src/components/StatusBar/index.d.ts.map +1 -0
  48. package/dist/types/src/components/index.d.ts +0 -2
  49. package/dist/types/src/components/index.d.ts.map +1 -1
  50. package/dist/types/src/containers/StatusBarActions/StatusBarActions.d.ts +4 -0
  51. package/dist/types/src/containers/StatusBarActions/StatusBarActions.d.ts.map +1 -0
  52. package/dist/types/src/containers/StatusBarActions/StatusBarActions.stories.d.ts +7 -0
  53. package/dist/types/src/containers/StatusBarActions/StatusBarActions.stories.d.ts.map +1 -0
  54. package/dist/types/src/containers/StatusBarActions/index.d.ts +2 -0
  55. package/dist/types/src/containers/StatusBarActions/index.d.ts.map +1 -0
  56. package/dist/types/src/containers/StatusBarPanel/StatusBarPanel.d.ts +4 -0
  57. package/dist/types/src/containers/StatusBarPanel/StatusBarPanel.d.ts.map +1 -0
  58. package/dist/types/src/containers/StatusBarPanel/index.d.ts +2 -0
  59. package/dist/types/src/containers/StatusBarPanel/index.d.ts.map +1 -0
  60. package/dist/types/src/containers/VersionNumber/VersionNumber.d.ts +4 -0
  61. package/dist/types/src/containers/VersionNumber/VersionNumber.d.ts.map +1 -0
  62. package/dist/types/src/containers/VersionNumber/index.d.ts +2 -0
  63. package/dist/types/src/containers/VersionNumber/index.d.ts.map +1 -0
  64. package/dist/types/src/containers/index.d.ts +5 -0
  65. package/dist/types/src/containers/index.d.ts.map +1 -0
  66. package/dist/types/src/index.d.ts +0 -2
  67. package/dist/types/src/index.d.ts.map +1 -1
  68. package/dist/types/src/meta.d.ts +2 -2
  69. package/dist/types/src/meta.d.ts.map +1 -1
  70. package/dist/types/src/plugin.d.ts +3 -0
  71. package/dist/types/src/plugin.d.ts.map +1 -0
  72. package/dist/types/src/translations.d.ts +3 -12
  73. package/dist/types/src/translations.d.ts.map +1 -1
  74. package/dist/types/tsconfig.tsbuildinfo +1 -1
  75. package/package.json +79 -34
  76. package/src/StatusBarPlugin.test.ts +23 -0
  77. package/src/StatusBarPlugin.ts +12 -16
  78. package/src/capabilities/index.ts +2 -2
  79. package/src/capabilities/react-surface.tsx +25 -27
  80. package/src/components/StatusBar/StatusBar.stories.tsx +45 -0
  81. package/src/components/{StatusBar.tsx → StatusBar/StatusBar.tsx} +44 -22
  82. package/src/components/StatusBar/index.ts +5 -0
  83. package/src/components/index.ts +0 -2
  84. package/src/containers/StatusBarActions/StatusBarActions.stories.tsx +62 -0
  85. package/src/containers/StatusBarActions/StatusBarActions.tsx +19 -0
  86. package/src/containers/StatusBarActions/index.ts +5 -0
  87. package/src/containers/StatusBarPanel/StatusBarPanel.tsx +21 -0
  88. package/src/containers/StatusBarPanel/index.ts +5 -0
  89. package/src/containers/VersionNumber/VersionNumber.tsx +46 -0
  90. package/src/containers/VersionNumber/index.ts +5 -0
  91. package/src/containers/index.ts +9 -0
  92. package/src/index.ts +1 -2
  93. package/src/meta.ts +7 -4
  94. package/src/plugin.ts +9 -0
  95. package/src/translations.ts +3 -11
  96. package/dist/lib/browser/chunk-EY5IFRNW.mjs +0 -251
  97. package/dist/lib/browser/chunk-EY5IFRNW.mjs.map +0 -7
  98. package/dist/lib/browser/index.mjs +0 -57
  99. package/dist/lib/browser/index.mjs.map +0 -7
  100. package/dist/lib/browser/meta.json +0 -1
  101. package/dist/lib/browser/react-surface-JLUMVT7Q.mjs +0 -39
  102. package/dist/lib/browser/react-surface-JLUMVT7Q.mjs.map +0 -7
  103. package/dist/lib/node-esm/chunk-X4F44ADI.mjs +0 -253
  104. package/dist/lib/node-esm/chunk-X4F44ADI.mjs.map +0 -7
  105. package/dist/lib/node-esm/index.mjs +0 -58
  106. package/dist/lib/node-esm/index.mjs.map +0 -7
  107. package/dist/lib/node-esm/meta.json +0 -1
  108. package/dist/lib/node-esm/react-surface-O34EDFRO.mjs +0 -40
  109. package/dist/lib/node-esm/react-surface-O34EDFRO.mjs.map +0 -7
  110. package/dist/types/src/components/StatusBar.d.ts.map +0 -1
  111. package/dist/types/src/components/StatusBar.stories.d.ts.map +0 -1
  112. package/dist/types/src/components/StatusBarPanel.d.ts +0 -4
  113. package/dist/types/src/components/StatusBarPanel.d.ts.map +0 -1
  114. package/dist/types/src/components/VersionNumber.d.ts +0 -3
  115. package/dist/types/src/components/VersionNumber.d.ts.map +0 -1
  116. package/src/components/StatusBar.stories.tsx +0 -45
  117. package/src/components/StatusBarPanel.tsx +0 -76
  118. package/src/components/VersionNumber.tsx +0 -85
package/package.json CHANGED
@@ -1,62 +1,107 @@
1
1
  {
2
2
  "name": "@dxos/plugin-status-bar",
3
- "version": "0.8.4-main.fffef41",
3
+ "version": "0.8.4-staging.60fe92afc8",
4
4
  "description": "Status bar plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
7
- "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/dxos/dxos"
10
+ },
11
+ "license": "FSL-1.1-Apache-2.0",
8
12
  "author": "DXOS.org",
9
13
  "sideEffects": true,
10
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
+ },
11
47
  "exports": {
12
48
  ".": {
13
49
  "source": "./src/index.ts",
14
50
  "types": "./dist/types/src/index.d.ts",
15
- "browser": "./dist/lib/browser/index.mjs",
16
- "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"
17
67
  }
18
68
  },
19
69
  "types": "dist/types/src/index.d.ts",
20
- "typesVersions": {
21
- "*": {}
22
- },
23
70
  "files": [
24
71
  "dist",
25
72
  "src"
26
73
  ],
27
74
  "dependencies": {
28
- "@fluentui/react-tabster": "^9.24.2",
29
- "@preact-signals/safe-react": "^0.9.0",
30
- "@preact/signals-core": "^1.12.1",
31
75
  "@radix-ui/react-slot": "1.1.2",
32
- "date-fns": "^3.3.1",
33
- "effect": "3.18.3",
34
- "react-resize-detector": "^11.0.1",
35
- "@dxos/app-framework": "0.8.4-main.fffef41",
36
- "@dxos/echo": "0.8.4-main.fffef41",
37
- "@dxos/async": "0.8.4-main.fffef41",
38
- "@dxos/plugin-observability": "0.8.4-main.fffef41",
39
- "@dxos/react-client": "0.8.4-main.fffef41",
40
- "@dxos/schema": "0.8.4-main.fffef41",
41
- "@dxos/react-ui-form": "0.8.4-main.fffef41",
42
- "@dxos/util": "0.8.4-main.fffef41"
76
+ "date-fns": "^3.6.0",
77
+ "effect": "3.21.3",
78
+ "@dxos/app-framework": "0.8.4-staging.60fe92afc8",
79
+ "@dxos/app-toolkit": "0.8.4-staging.60fe92afc8",
80
+ "@dxos/async": "0.8.4-staging.60fe92afc8",
81
+ "@dxos/operation": "0.8.4-staging.60fe92afc8",
82
+ "@dxos/echo": "0.8.4-staging.60fe92afc8",
83
+ "@dxos/keys": "0.8.4-staging.60fe92afc8",
84
+ "@dxos/plugin-observability": "0.8.4-staging.60fe92afc8",
85
+ "@dxos/util": "0.8.4-staging.60fe92afc8",
86
+ "@dxos/react-client": "0.8.4-staging.60fe92afc8"
43
87
  },
44
88
  "devDependencies": {
45
- "@types/react": "~19.2.2",
46
- "@types/react-dom": "~19.2.2",
47
- "react": "~19.2.0",
48
- "react-dom": "~19.2.0",
49
- "vite": "7.1.9",
50
- "@dxos/react-ui": "0.8.4-main.fffef41",
51
- "@dxos/react-ui-theme": "0.8.4-main.fffef41",
52
- "@dxos/storybook-utils": "0.8.4-main.fffef41"
89
+ "@types/react": "~19.2.7",
90
+ "@types/react-dom": "~19.2.3",
91
+ "react": "~19.2.3",
92
+ "react-dom": "~19.2.3",
93
+ "vite": "^8.0.16",
94
+ "@dxos/plugin-testing": "0.8.4-staging.60fe92afc8",
95
+ "@dxos/react-ui": "0.8.4-staging.60fe92afc8",
96
+ "@dxos/storybook-utils": "0.8.4-staging.60fe92afc8",
97
+ "@dxos/ui-theme": "0.8.4-staging.60fe92afc8"
53
98
  },
54
99
  "peerDependencies": {
55
- "effect": "^3.13.3",
56
- "react": "^19.0.0",
57
- "react-dom": "^19.0.0",
58
- "@dxos/react-ui": "0.8.4-main.fffef41",
59
- "@dxos/react-ui-theme": "0.8.4-main.fffef41"
100
+ "effect": "3.21.3",
101
+ "react": "~19.2.3",
102
+ "react-dom": "~19.2.3",
103
+ "@dxos/ui-theme": "0.8.4-staging.60fe92afc8",
104
+ "@dxos/react-ui": "0.8.4-staging.60fe92afc8"
60
105
  },
61
106
  "publishConfig": {
62
107
  "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
+ });
@@ -2,21 +2,17 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Capabilities, Events, contributes, defineModule, definePlugin } from '@dxos/app-framework';
5
+ import { Plugin } from '@dxos/app-framework';
6
+ import { AppPlugin } from '@dxos/app-toolkit';
6
7
 
7
- import { ReactSurface } from './capabilities';
8
- import { meta } from './meta';
9
- import { translations } from './translations';
8
+ import { ReactSurface } from '#capabilities';
9
+ import { meta } from '#meta';
10
+ import { translations } from '#translations';
10
11
 
11
- export const StatusBarPlugin = definePlugin(meta, () => [
12
- defineModule({
13
- id: `${meta.id}/module/translations`,
14
- activatesOn: Events.SetupTranslations,
15
- activate: () => contributes(Capabilities.Translations, translations),
16
- }),
17
- defineModule({
18
- id: `${meta.id}/module/react-surface`,
19
- activatesOn: Events.SetupReactSurface,
20
- activate: ReactSurface,
21
- }),
22
- ]);
12
+ export const StatusBarPlugin = Plugin.define(meta).pipe(
13
+ AppPlugin.addSurfaceModule({ activate: ReactSurface }),
14
+ AppPlugin.addTranslationsModule({ translations }),
15
+ Plugin.make,
16
+ );
17
+
18
+ export default StatusBarPlugin;
@@ -2,6 +2,6 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { lazy } from '@dxos/app-framework';
5
+ import { Capability } from '@dxos/app-framework';
6
6
 
7
- export const ReactSurface = lazy(() => import('./react-surface'));
7
+ export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
@@ -2,34 +2,32 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import * as Effect from 'effect/Effect';
5
6
  import React from 'react';
6
7
 
7
- import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
8
- import { Surface } from '@dxos/app-framework/react';
8
+ import { Capabilities, Capability } from '@dxos/app-framework';
9
+ import { Surface } from '@dxos/app-framework/ui';
9
10
 
10
- import { StatusBarActions, StatusBarPanel, VersionNumber } from '../components';
11
- import { meta } from '../meta';
11
+ import { StatusBarActions, StatusBarPanel, VersionNumber } from '#containers';
12
12
 
13
- export default () =>
14
- contributes(Capabilities.ReactSurface, [
15
- createSurface({
16
- id: `${meta.id}/status-bar`,
17
- role: 'status-bar',
18
- component: () => <StatusBarPanel />,
19
- }),
20
- createSurface({
21
- id: `${meta.id}/status-bar--r0-footer`,
22
- role: 'status-bar--r0-footer',
23
- component: () => <Surface role='status' />,
24
- }),
25
- createSurface({
26
- id: `${meta.id}/status-bar--r1-footer`,
27
- role: 'status-bar--r1-footer',
28
- component: () => <StatusBarActions />,
29
- }),
30
- createSurface({
31
- id: `${meta.id}/header-end`,
32
- role: 'header-end',
33
- component: () => <VersionNumber />,
34
- }),
35
- ]);
13
+ export default Capability.makeModule(() =>
14
+ Effect.succeed(
15
+ Capability.contributes(Capabilities.ReactSurface, [
16
+ Surface.create({
17
+ id: 'statusBar',
18
+ role: 'status-bar',
19
+ component: () => <StatusBarPanel />,
20
+ }),
21
+ Surface.create({
22
+ id: 'statusBarFooter',
23
+ role: 'status-bar--r1-footer',
24
+ component: () => <StatusBarActions />,
25
+ }),
26
+ Surface.create({
27
+ id: 'versionInfo',
28
+ role: 'version-info',
29
+ component: () => <VersionNumber />,
30
+ }),
31
+ ]),
32
+ ),
33
+ );
@@ -0,0 +1,45 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
+ import React from 'react';
7
+
8
+ import { Icon, IconButton } from '@dxos/react-ui';
9
+ import { withTheme } from '@dxos/react-ui/testing';
10
+
11
+ import { StatusBar } from './index';
12
+
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'>
20
+ <StatusBar.Button>
21
+ <Icon icon='ph--discord-logo--regular' />
22
+ <StatusBar.Text>Join us on Discord</StatusBar.Text>
23
+ </StatusBar.Button>
24
+ </a>
25
+ <StatusBar.Item>
26
+ <IconButton variant='ghost' icon='ph--lightning--regular' iconOnly label='Online' />
27
+ </StatusBar.Item>
28
+ </StatusBar.EndContent>
29
+ );
30
+
31
+ const meta = {
32
+ title: 'plugins/plugin-status-bar/components/StatusBar',
33
+ component: StatusBar as any,
34
+ render: DefaultStory,
35
+ decorators: [withTheme()],
36
+ parameters: {
37
+ layout: 'centered',
38
+ },
39
+ } satisfies Meta<typeof StatusBar>;
40
+
41
+ export default meta;
42
+
43
+ type Story = StoryObj<typeof meta>;
44
+
45
+ export const Default: Story = {};
@@ -6,7 +6,27 @@ import { Slot } from '@radix-ui/react-slot';
6
6
  import React, { type ComponentPropsWithRef, type PropsWithChildren, type ReactNode, forwardRef } from 'react';
7
7
 
8
8
  import { type ThemedClassName } from '@dxos/react-ui';
9
- import { mx } from '@dxos/react-ui-theme';
9
+ import { mx } from '@dxos/ui-theme';
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
+ //
10
30
 
11
31
  type StatusBarTextProps = ThemedClassName<{ children: ReactNode }>;
12
32
 
@@ -16,14 +36,21 @@ 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(
24
- 'flex items-center justify-center gap-2 p-1 pli-2 rounded-sm',
51
+ 'flex items-center justify-center gap-2 p-1 px-2 rounded-xs',
25
52
  'select-none cursor-pointer dx-focus-ring text-description text-xs',
26
- 'hover:bg-neutral-75 active:bg-neutral-150 dark:hover:bg-neutral-750 dark:active:bg-neutral-700',
53
+ 'hover:bg-neutral-100 active:bg-neutral-200 dark:hover:bg-neutral-700 dark:active:bg-neutral-600',
27
54
  classNames,
28
55
  );
29
56
 
@@ -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 pli-2 rounded-sm 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,5 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ export * from './StatusBar';
@@ -3,5 +3,3 @@
3
3
  //
4
4
 
5
5
  export * from './StatusBar';
6
- export * from './StatusBarPanel';
7
- export * from './VersionNumber';
@@ -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 = {};
@@ -0,0 +1,19 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import VersionNumber from '../VersionNumber';
8
+
9
+ export type StatusBarActionsProps = {};
10
+
11
+ export const StatusBarActions = (_props: StatusBarActionsProps) => {
12
+ return (
13
+ <div className='h-full flex items-center px-2 gap-2'>
14
+ <VersionNumber />
15
+ <div className='grow' />
16
+ {/* TODO(burdon): Show EDGE service status? */}
17
+ </div>
18
+ );
19
+ };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ export { StatusBarActions as default } from './StatusBarActions';
@@ -0,0 +1,21 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { Surface } from '@dxos/app-framework/ui';
8
+
9
+ import StatusBarActionsDefault from '../StatusBarActions';
10
+
11
+ export type StatusBarPanelProps = {};
12
+
13
+ export const StatusBarPanel = (_props: StatusBarPanelProps) => {
14
+ return (
15
+ <>
16
+ <StatusBarActionsDefault />
17
+ <span role='separator' className='grow' />
18
+ <Surface.Surface role='status' />
19
+ </>
20
+ );
21
+ };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ export { StatusBarPanel as default } from './StatusBarPanel';
@@ -0,0 +1,46 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import { formatDistance, isValid } from 'date-fns';
6
+ import React from 'react';
7
+
8
+ import { useConfig } from '@dxos/react-client';
9
+ import { Tooltip, useTranslation } from '@dxos/react-ui';
10
+
11
+ import { StatusBar } from '#components';
12
+ import { meta } from '#meta';
13
+
14
+ export type VersionNumberProps = {};
15
+
16
+ const VERSION_REGEX = /([\d.]+)/;
17
+
18
+ export const VersionNumber = (_props: VersionNumberProps) => {
19
+ const { t } = useTranslation(meta.id);
20
+ const config = useConfig();
21
+ const { version, timestamp } = config.values.runtime?.app?.build ?? {};
22
+ const [_, short] = version?.match(VERSION_REGEX) ?? [];
23
+
24
+ if (!short) {
25
+ return null;
26
+ }
27
+
28
+ const releasedAt = timestamp ? new Date(timestamp) : undefined;
29
+ const released =
30
+ releasedAt && isValid(releasedAt)
31
+ ? t('released.message', { released: formatDistance(releasedAt, new Date(), { addSuffix: true }) })
32
+ : undefined;
33
+
34
+ const content = (
35
+ <div className='flex flex-col items-start gap-0.5'>
36
+ <span className='font-mono'>{version}</span>
37
+ {released && <span className='text-xs'>{released}</span>}
38
+ </div>
39
+ );
40
+
41
+ return (
42
+ <Tooltip.Trigger asChild content={content} side='top'>
43
+ <StatusBar.Button classNames='h-full text-xs'>{short}</StatusBar.Button>
44
+ </Tooltip.Trigger>
45
+ );
46
+ };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ export { VersionNumber as default } from './VersionNumber';
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import { type ComponentType, lazy } from 'react';
6
+
7
+ export const StatusBarActions: ComponentType<any> = lazy(() => import('./StatusBarActions'));
8
+ export const StatusBarPanel: ComponentType<any> = lazy(() => import('./StatusBarPanel'));
9
+ export const VersionNumber: ComponentType<any> = lazy(() => import('./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
@@ -2,15 +2,18 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { type PluginMeta } from '@dxos/app-framework';
5
+ import { Plugin } from '@dxos/app-framework';
6
+ import { DXN } from '@dxos/keys';
6
7
  import { trim } from '@dxos/util';
7
8
 
8
- export const meta: PluginMeta = {
9
- id: 'dxos.org/plugin/status-bar',
9
+ export const meta = Plugin.makeMeta({
10
+ key: DXN.make('org.dxos.plugin.statusBar'),
10
11
  name: 'Status Bar',
12
+ author: 'DXOS',
11
13
  description: trim`
12
14
  Persistent bottom bar displaying workspace status information and quick actions.
13
15
  Access connection state, notifications, and common commands without leaving your current context.
14
16
  `,
15
17
  icon: 'ph--info--regular',
16
- };
18
+ tags: ['system'],
19
+ });