@dxos/react-ui 0.1.24-next.6b1f434 → 0.1.24

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 (132) hide show
  1. package/dist/lib/browser/index.mjs +452 -1084
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/types/src/components/IdentityList/IdentityListItem.d.ts +1 -2
  5. package/dist/types/src/components/IdentityList/IdentityListItem.d.ts.map +1 -1
  6. package/dist/types/src/components/IdentityList/IdentityListItem.stories.d.ts +1 -2
  7. package/dist/types/src/components/IdentityList/IdentityListItem.stories.d.ts.map +1 -1
  8. package/dist/types/src/components/IdentityList/SpaceMemberList.d.ts +2 -3
  9. package/dist/types/src/components/IdentityList/SpaceMemberList.d.ts.map +1 -1
  10. package/dist/types/src/components/IdentityList/SpaceMemberListContainer.d.ts +1 -3
  11. package/dist/types/src/components/IdentityList/SpaceMemberListContainer.d.ts.map +1 -1
  12. package/dist/types/src/components/IdentityList/index.d.ts +0 -1
  13. package/dist/types/src/components/IdentityList/index.d.ts.map +1 -1
  14. package/dist/types/src/components/InvitationList/InvitationList.d.ts.map +1 -1
  15. package/dist/types/src/components/InvitationList/InvitationListItem.d.ts.map +1 -1
  16. package/dist/types/src/components/InvitationList/InvitationStatusAvatar.d.ts +1 -6
  17. package/dist/types/src/components/InvitationList/InvitationStatusAvatar.d.ts.map +1 -1
  18. package/dist/types/src/components/InvitationList/InvitationStatusAvatar.stories.d.ts +1 -1
  19. package/dist/types/src/components/index.d.ts +0 -1
  20. package/dist/types/src/components/index.d.ts.map +1 -1
  21. package/dist/types/src/composites/JoinDialog/JoinDialog.d.ts +1 -1
  22. package/dist/types/src/composites/JoinDialog/JoinDialog.d.ts.map +1 -1
  23. package/dist/types/src/composites/JoinDialog/JoinDialog.stories.d.ts +2 -2
  24. package/dist/types/src/composites/JoinDialog/JoinDialog.stories.d.ts.map +1 -1
  25. package/dist/types/src/composites/index.d.ts +0 -2
  26. package/dist/types/src/composites/index.d.ts.map +1 -1
  27. package/dist/types/src/layouts/PanelAlertDialog/PanelAlertDialog.d.ts.map +1 -1
  28. package/dist/types/src/layouts/index.d.ts +0 -1
  29. package/dist/types/src/layouts/index.d.ts.map +1 -1
  30. package/dist/types/src/panels/JoinPanel/JoinHeading.d.ts +0 -3
  31. package/dist/types/src/panels/JoinPanel/JoinHeading.d.ts.map +1 -1
  32. package/dist/types/src/panels/JoinPanel/JoinPanel.d.ts +1 -1
  33. package/dist/types/src/panels/JoinPanel/JoinPanel.d.ts.map +1 -1
  34. package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts +3 -4
  35. package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts.map +1 -1
  36. package/dist/types/src/panels/JoinPanel/view-states/AdditionMethodSelector.d.ts +1 -1
  37. package/dist/types/src/panels/JoinPanel/view-states/AdditionMethodSelector.d.ts.map +1 -1
  38. package/dist/types/src/panels/JoinPanel/view-states/IdentityAdded.d.ts +2 -10
  39. package/dist/types/src/panels/JoinPanel/view-states/IdentityAdded.d.ts.map +1 -1
  40. package/dist/types/src/panels/JoinPanel/view-states/IdentityInput.d.ts.map +1 -1
  41. package/dist/types/src/panels/JoinPanel/view-states/IdentitySelector.d.ts +1 -1
  42. package/dist/types/src/panels/JoinPanel/view-states/IdentitySelector.d.ts.map +1 -1
  43. package/dist/types/src/panels/JoinPanel/view-states/InvitationAccepted.d.ts.map +1 -1
  44. package/dist/types/src/panels/JoinPanel/view-states/InvitationAuthenticator.d.ts.map +1 -1
  45. package/dist/types/src/panels/JoinPanel/view-states/InvitationInput.d.ts.map +1 -1
  46. package/dist/types/src/panels/JoinPanel/view-states/InvitationRescuer.d.ts.map +1 -1
  47. package/dist/types/src/panels/index.d.ts +0 -2
  48. package/dist/types/src/panels/index.d.ts.map +1 -1
  49. package/dist/types/src/styles/index.d.ts +0 -1
  50. package/dist/types/src/styles/index.d.ts.map +1 -1
  51. package/dist/types/src/translations/locales/en-US.d.ts +1 -12
  52. package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
  53. package/package.json +11 -12
  54. package/src/components/IdentityList/IdentityListItem.tsx +3 -15
  55. package/src/components/IdentityList/SpaceMemberList.tsx +8 -10
  56. package/src/components/IdentityList/SpaceMemberListContainer.tsx +4 -5
  57. package/src/components/IdentityList/index.ts +0 -1
  58. package/src/components/InvitationList/InvitationList.tsx +2 -6
  59. package/src/components/InvitationList/InvitationListItem.tsx +25 -36
  60. package/src/components/InvitationList/InvitationStatusAvatar.tsx +5 -10
  61. package/src/components/index.ts +0 -1
  62. package/src/composites/JoinDialog/JoinDialog.stories.tsx +58 -59
  63. package/src/composites/JoinDialog/JoinDialog.tsx +1 -3
  64. package/src/composites/index.ts +0 -3
  65. package/src/layouts/PanelAlertDialog/PanelAlertDialog.tsx +8 -4
  66. package/src/layouts/PanelSidebar/PanelSidebar.tsx +1 -1
  67. package/src/layouts/index.ts +0 -1
  68. package/src/panels/JoinPanel/JoinHeading.tsx +16 -44
  69. package/src/panels/JoinPanel/JoinPanel.tsx +9 -25
  70. package/src/panels/JoinPanel/JoinPanelProps.ts +8 -4
  71. package/src/panels/JoinPanel/view-states/AdditionMethodSelector.tsx +1 -5
  72. package/src/panels/JoinPanel/view-states/IdentityAdded.tsx +24 -63
  73. package/src/panels/JoinPanel/view-states/IdentityInput.tsx +1 -8
  74. package/src/panels/JoinPanel/view-states/IdentitySelector.tsx +1 -4
  75. package/src/panels/JoinPanel/view-states/InvitationAccepted.tsx +0 -1
  76. package/src/panels/JoinPanel/view-states/InvitationAuthenticator.tsx +1 -4
  77. package/src/panels/JoinPanel/view-states/InvitationInput.tsx +1 -8
  78. package/src/panels/JoinPanel/view-states/InvitationRescuer.tsx +1 -4
  79. package/src/panels/index.ts +0 -2
  80. package/src/styles/index.ts +0 -1
  81. package/src/translations/locales/en-US.ts +3 -14
  82. package/dist/types/src/components/IdentityList/DeviceList.d.ts +0 -7
  83. package/dist/types/src/components/IdentityList/DeviceList.d.ts.map +0 -1
  84. package/dist/types/src/components/SpaceList/SpaceListItem.d.ts +0 -7
  85. package/dist/types/src/components/SpaceList/SpaceListItem.d.ts.map +0 -1
  86. package/dist/types/src/components/SpaceList/index.d.ts +0 -2
  87. package/dist/types/src/components/SpaceList/index.d.ts.map +0 -1
  88. package/dist/types/src/composites/DevicesDialog/DevicesDialog.d.ts +0 -6
  89. package/dist/types/src/composites/DevicesDialog/DevicesDialog.d.ts.map +0 -1
  90. package/dist/types/src/composites/DevicesDialog/index.d.ts +0 -2
  91. package/dist/types/src/composites/DevicesDialog/index.d.ts.map +0 -1
  92. package/dist/types/src/composites/Shell/Shell.d.ts +0 -6
  93. package/dist/types/src/composites/Shell/Shell.d.ts.map +0 -1
  94. package/dist/types/src/composites/Shell/index.d.ts +0 -2
  95. package/dist/types/src/composites/Shell/index.d.ts.map +0 -1
  96. package/dist/types/src/composites/SpaceDialog/SpaceDialog.d.ts +0 -6
  97. package/dist/types/src/composites/SpaceDialog/SpaceDialog.d.ts.map +0 -1
  98. package/dist/types/src/composites/SpaceDialog/index.d.ts +0 -2
  99. package/dist/types/src/composites/SpaceDialog/index.d.ts.map +0 -1
  100. package/dist/types/src/layouts/PanelDialog/PanelDialog.d.ts +0 -14
  101. package/dist/types/src/layouts/PanelDialog/PanelDialog.d.ts.map +0 -1
  102. package/dist/types/src/layouts/PanelDialog/index.d.ts +0 -2
  103. package/dist/types/src/layouts/PanelDialog/index.d.ts.map +0 -1
  104. package/dist/types/src/panels/DevicesPanel/DevicesPanel.d.ts +0 -10
  105. package/dist/types/src/panels/DevicesPanel/DevicesPanel.d.ts.map +0 -1
  106. package/dist/types/src/panels/DevicesPanel/index.d.ts +0 -2
  107. package/dist/types/src/panels/DevicesPanel/index.d.ts.map +0 -1
  108. package/dist/types/src/panels/SpacePanel/SpacePanel.d.ts +0 -18
  109. package/dist/types/src/panels/SpacePanel/SpacePanel.d.ts.map +0 -1
  110. package/dist/types/src/panels/SpacePanel/SpacePanel.stories.d.ts +0 -9
  111. package/dist/types/src/panels/SpacePanel/SpacePanel.stories.d.ts.map +0 -1
  112. package/dist/types/src/panels/SpacePanel/index.d.ts +0 -2
  113. package/dist/types/src/panels/SpacePanel/index.d.ts.map +0 -1
  114. package/dist/types/src/styles/dialogStyles.d.ts +0 -3
  115. package/dist/types/src/styles/dialogStyles.d.ts.map +0 -1
  116. package/src/components/IdentityList/DeviceList.tsx +0 -31
  117. package/src/components/SpaceList/SpaceListItem.tsx +0 -32
  118. package/src/components/SpaceList/index.ts +0 -5
  119. package/src/composites/DevicesDialog/DevicesDialog.tsx +0 -38
  120. package/src/composites/DevicesDialog/index.ts +0 -5
  121. package/src/composites/Shell/Shell.tsx +0 -92
  122. package/src/composites/Shell/index.ts +0 -5
  123. package/src/composites/SpaceDialog/SpaceDialog.tsx +0 -38
  124. package/src/composites/SpaceDialog/index.ts +0 -5
  125. package/src/layouts/PanelDialog/PanelDialog.tsx +0 -39
  126. package/src/layouts/PanelDialog/index.ts +0 -5
  127. package/src/panels/DevicesPanel/DevicesPanel.tsx +0 -98
  128. package/src/panels/DevicesPanel/index.ts +0 -5
  129. package/src/panels/SpacePanel/SpacePanel.stories.tsx +0 -53
  130. package/src/panels/SpacePanel/SpacePanel.tsx +0 -174
  131. package/src/panels/SpacePanel/index.ts +0 -5
  132. package/src/styles/dialogStyles.ts +0 -8
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import type { Space } from '@dxos/client';
3
- export declare const SpaceListItem: React.ForwardRefExoticComponent<{
4
- space: Space;
5
- onClick?: (() => void) | undefined;
6
- } & React.RefAttributes<HTMLLIElement>>;
7
- //# sourceMappingURL=SpaceListItem.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpaceListItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/SpaceList/SpaceListItem.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmC,MAAM,OAAO,CAAC;AAExD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAI1C,eAAO,MAAM,aAAa;WACM,KAAK;qBAAkB,IAAI;uCAoB1D,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './SpaceListItem';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/SpaceList/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC"}
@@ -1,6 +0,0 @@
1
- import { PanelDialogProps } from '../../layouts';
2
- import { DevicesPanelProps } from '../../panels';
3
- export interface DevicesDialogProps extends Omit<PanelDialogProps, 'titleId' | 'children'>, Omit<DevicesPanelProps, 'doneActionParent'> {
4
- }
5
- export declare const DevicesDialog: ({ slots, ...devicesDialogProps }: DevicesDialogProps) => JSX.Element;
6
- //# sourceMappingURL=DevicesDialog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DevicesDialog.d.ts","sourceRoot":"","sources":["../../../../../src/composites/DevicesDialog/DevicesDialog.tsx"],"names":[],"mappings":"AASA,OAAO,EAAe,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAgB,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAE/D,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,UAAU,CAAC,EACpD,IAAI,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;CAAG;AAElD,eAAO,MAAM,aAAa,qCAAsC,kBAAkB,gBAqBjF,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './DevicesDialog';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/composites/DevicesDialog/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC"}
@@ -1,6 +0,0 @@
1
- import { ShellRuntime } from '@dxos/client';
2
- export declare const Shell: ({ runtime, origin }: {
3
- runtime: ShellRuntime;
4
- origin: string;
5
- }) => JSX.Element | null;
6
- //# sourceMappingURL=Shell.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Shell.d.ts","sourceRoot":"","sources":["../../../../../src/composites/Shell/Shell.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAQ5C,eAAO,MAAM,KAAK;aAAoC,YAAY;YAAU,MAAM;wBA6EjF,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './Shell';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/composites/Shell/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC"}
@@ -1,6 +0,0 @@
1
- import { PanelDialogProps } from '../../layouts';
2
- import { SpacePanelProps } from '../../panels';
3
- export interface SpaceDialogProps extends Omit<PanelDialogProps, 'titleId' | 'children'>, Omit<SpacePanelProps, 'doneActionParent'> {
4
- }
5
- export declare const SpaceDialog: ({ slots, ...spacePanelProps }: SpaceDialogProps) => JSX.Element;
6
- //# sourceMappingURL=SpaceDialog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpaceDialog.d.ts","sourceRoot":"","sources":["../../../../../src/composites/SpaceDialog/SpaceDialog.tsx"],"names":[],"mappings":"AASA,OAAO,EAAe,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;AAE3D,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,UAAU,CAAC,EACpD,IAAI,CAAC,eAAe,EAAE,kBAAkB,CAAC;CAAG;AAEhD,eAAO,MAAM,WAAW,kCAAmC,gBAAgB,gBAqB1E,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './SpaceDialog';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/composites/SpaceDialog/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC"}
@@ -1,14 +0,0 @@
1
- import * as Dialog from '@radix-ui/react-dialog';
2
- import { ComponentPropsWithoutRef, PropsWithChildren } from 'react';
3
- export interface PanelDialogSlots {
4
- root: ComponentPropsWithoutRef<typeof Dialog.Root>;
5
- overlay: ComponentPropsWithoutRef<typeof Dialog.Overlay>;
6
- content: ComponentPropsWithoutRef<typeof Dialog.Content>;
7
- trigger: ComponentPropsWithoutRef<typeof Dialog.Trigger>;
8
- }
9
- export declare type PanelDialogProps = PropsWithChildren<{
10
- titleId: string;
11
- slots?: Partial<PanelDialogSlots>;
12
- }>;
13
- export declare const PanelDialog: ({ titleId, slots, children }: PanelDialogProps) => JSX.Element;
14
- //# sourceMappingURL=PanelDialog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PanelDialog.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/PanelDialog/PanelDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AACjD,OAAc,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAM3E,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,wBAAwB,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;IACnD,OAAO,EAAE,wBAAwB,CAAC,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC;IACzD,OAAO,EAAE,wBAAwB,CAAC,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC;IACzD,OAAO,EAAE,wBAAwB,CAAC,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC;CAC1D;AAED,oBAAY,gBAAgB,GAAG,iBAAiB,CAAC;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACnC,CAAC,CAAC;AAEH,eAAO,MAAM,WAAW,iCAAuC,gBAAgB,gBAe9E,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './PanelDialog';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/PanelDialog/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC"}
@@ -1,10 +0,0 @@
1
- import { cloneElement } from 'react';
2
- export declare type DevicesPanelProps = {
3
- titleId?: string;
4
- createInvitationUrl: (invitationCode: string) => string;
5
- doneActionParent?: Parameters<typeof cloneElement>[0];
6
- onDone?: () => void;
7
- };
8
- export declare type DevicesView = 'device list';
9
- export declare const DevicesPanel: (props: DevicesPanelProps) => JSX.Element;
10
- //# sourceMappingURL=DevicesPanel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DevicesPanel.d.ts","sourceRoot":"","sources":["../../../../../src/panels/DevicesPanel/DevicesPanel.tsx"],"names":[],"mappings":"AAKA,OAAc,EAAE,YAAY,EAAc,MAAM,OAAO,CAAC;AAQxD,oBAAY,iBAAiB,GAAG;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mBAAmB,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,MAAM,CAAC;IACxD,gBAAgB,CAAC,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,oBAAY,WAAW,GAAG,aAAa,CAAC;AA8DxC,eAAO,MAAM,YAAY,UAAW,iBAAiB,gBAepD,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './DevicesPanel';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/panels/DevicesPanel/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC"}
@@ -1,18 +0,0 @@
1
- import { cloneElement } from 'react';
2
- import { Space, SpaceMember } from '@dxos/client';
3
- export declare type SpacePanelProps = {
4
- titleId?: string;
5
- space?: Space;
6
- initialState?: SpaceView;
7
- createInvitationUrl: (invitationCode: string) => string;
8
- onClickJoinSpace?: () => void;
9
- onClickMember?: (member: SpaceMember) => void;
10
- doneActionParent?: Parameters<typeof cloneElement>[0];
11
- onDone?: (result: Space | null) => void;
12
- };
13
- export declare type SpaceView = 'current space' | 'space list';
14
- export declare type SpaceState = {
15
- activeView: SpaceView;
16
- };
17
- export declare const SpacePanel: (props: SpacePanelProps) => JSX.Element;
18
- //# sourceMappingURL=SpacePanel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpacePanel.d.ts","sourceRoot":"","sources":["../../../../../src/panels/SpacePanel/SpacePanel.tsx"],"names":[],"mappings":"AAKA,OAAc,EAAE,YAAY,EAAc,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAOlD,oBAAY,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,mBAAmB,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,MAAM,CAAC;IACxD,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IAC9C,gBAAgB,CAAC,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IACtD,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,CAAC;CACzC,CAAC;AAEF,oBAAY,SAAS,GAAG,eAAe,GAAG,YAAY,CAAC;AAEvD,oBAAY,UAAU,GAAG;IACvB,UAAU,EAAE,SAAS,CAAC;CACvB,CAAC;AAoHF,eAAO,MAAM,UAAU,UAAW,eAAe,gBA4BhD,CAAC"}
@@ -1,9 +0,0 @@
1
- import { StoryContext, StoryFn } from '@storybook/react';
2
- declare const _default: {
3
- component: (props: import("./SpacePanel").SpacePanelProps) => JSX.Element;
4
- };
5
- export default _default;
6
- export declare const Default: {
7
- decorators: ((Story: StoryFn, { args }: StoryContext) => JSX.Element)[];
8
- };
9
- //# sourceMappingURL=SpacePanel.stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpacePanel.stories.d.ts","sourceRoot":"","sources":["../../../../../src/panels/SpacePanel/SpacePanel.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;;;;AAUzD,wBAEE;AAkCF,eAAO,MAAM,OAAO;yBAhCW,OAAO,YAAY,YAAY;CAkC7D,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './SpacePanel';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/panels/SpacePanel/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC"}
@@ -1,3 +0,0 @@
1
- export declare const defaultOverlay = "fixed inset-0 backdrop-blur z-50 overflow-auto grid place-items-center p-2 md:p-4 lg:p-8";
2
- export declare const defaultDialogContent = "is-full min-is-[260px] max-is-[320px] rounded-md shadow-md backdrop-blur-md";
3
- //# sourceMappingURL=dialogStyles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dialogStyles.d.ts","sourceRoot":"","sources":["../../../../src/styles/dialogStyles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,6FACiE,CAAC;AAE7F,eAAO,MAAM,oBAAoB,gFAAgF,CAAC"}
@@ -1,31 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React from 'react';
6
-
7
- import { DeviceInfo } from '@dxos/protocols/proto/dxos/halo/credentials/identity';
8
-
9
- import { IdentityListItem } from './IdentityListItem';
10
-
11
- export interface DeviceListProps {
12
- devices: DeviceInfo[];
13
- onSelect?: (device: DeviceInfo) => void;
14
- }
15
-
16
- export const DeviceList = ({ devices, onSelect }: DeviceListProps) => {
17
- return (
18
- <ul className='flex flex-col gap-2'>
19
- {devices.map((device) => {
20
- const identity = { identityKey: device.publicKey, displayName: device.displayName };
21
- return (
22
- <IdentityListItem
23
- key={device.publicKey.toHex()}
24
- identity={identity}
25
- onClick={onSelect && (() => onSelect(device))}
26
- />
27
- );
28
- })}
29
- </ul>
30
- );
31
- };
@@ -1,32 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React, { ForwardedRef, forwardRef } from 'react';
6
-
7
- import type { Space } from '@dxos/client';
8
- import { Avatar, mx } from '@dxos/react-components';
9
- import { humanize } from '@dxos/util';
10
-
11
- export const SpaceListItem = forwardRef(
12
- ({ space, onClick }: { space: Space; onClick?: () => void }, ref: ForwardedRef<HTMLLIElement>) => {
13
- return (
14
- <li
15
- className={mx('flex gap-2 items-center', onClick && 'cursor-pointer')}
16
- onClick={() => onClick?.()}
17
- ref={ref}
18
- data-testid='space-list-item'
19
- >
20
- <Avatar
21
- {...{
22
- variant: 'circle',
23
- size: 9,
24
- fallbackValue: space.key.toHex(),
25
- label: <p className='text-sm truncate'>{space.properties.name ?? humanize(space.key)}</p>,
26
- slots: { labels: { className: 'block shrink overflow-hidden' }, root: { className: 'shrink-0' } }
27
- }}
28
- />
29
- </li>
30
- );
31
- }
32
- );
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- export * from './SpaceListItem';
@@ -1,38 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import { Close } from '@radix-ui/react-dialog';
6
- import React from 'react';
7
-
8
- import { ThemeContext, useId } from '@dxos/react-components';
9
-
10
- import { PanelDialog, PanelDialogProps } from '../../layouts';
11
- import { DevicesPanel, DevicesPanelProps } from '../../panels';
12
-
13
- export interface DevicesDialogProps
14
- extends Omit<PanelDialogProps, 'titleId' | 'children'>,
15
- Omit<DevicesPanelProps, 'doneActionParent'> {}
16
-
17
- export const DevicesDialog = ({ slots, ...devicesDialogProps }: DevicesDialogProps) => {
18
- const titleId = useId('spaceDialog__title');
19
-
20
- return (
21
- <PanelDialog
22
- {...{
23
- slots: { ...slots, root: { onOpenChange: (open) => open || devicesDialogProps.onDone?.(), ...slots?.root } },
24
- titleId
25
- }}
26
- >
27
- <ThemeContext.Provider value={{ themeVariant: 'os' }}>
28
- <DevicesPanel
29
- {...{
30
- ...devicesDialogProps,
31
- titleId,
32
- doneActionParent: <Close asChild />
33
- }}
34
- />
35
- </ThemeContext.Provider>
36
- </PanelDialog>
37
- );
38
- };
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- export * from './DevicesDialog';
@@ -1,92 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React, { useEffect, useState } from 'react';
6
-
7
- import { ShellRuntime } from '@dxos/client';
8
- import { LayoutRequest, ShellDisplay, ShellLayout } from '@dxos/protocols/proto/dxos/iframe';
9
- import { useClient, useSpace, useSpaces } from '@dxos/react-client';
10
-
11
- import { DevicesDialog } from '../DevicesDialog';
12
- import { JoinDialog } from '../JoinDialog';
13
- import { SpaceDialog } from '../SpaceDialog';
14
-
15
- export const Shell = ({ runtime, origin }: { runtime: ShellRuntime; origin: string }) => {
16
- const client = useClient();
17
- const spaces = useSpaces();
18
-
19
- const [{ layout, invitationCode, spaceKey }, setLayout] = useState<LayoutRequest>({
20
- layout: runtime.layout,
21
- invitationCode: runtime.invitationCode,
22
- spaceKey: runtime.spaceKey
23
- });
24
- const space = useSpace(spaceKey);
25
-
26
- useEffect(() => {
27
- return runtime.layoutUpdate.on((request) => setLayout(request));
28
- }, []);
29
-
30
- switch (layout) {
31
- case ShellLayout.AUTH:
32
- return (
33
- <JoinDialog
34
- mode='halo-only'
35
- initialInvitationCode={invitationCode}
36
- onDone={async () => {
37
- // TODO(wittjosiah): Is this app-specific?
38
- const space = spaces[0] ?? (await client.echo.createSpace());
39
- await runtime.setAppContext({ display: ShellDisplay.NONE, spaceKey: space.key });
40
- runtime.setLayout(ShellLayout.DEFAULT);
41
- }}
42
- />
43
- );
44
-
45
- case ShellLayout.CURRENT_SPACE:
46
- case ShellLayout.SPACE_LIST:
47
- return (
48
- <SpaceDialog
49
- space={space}
50
- initialState={layout === ShellLayout.SPACE_LIST ? 'space list' : 'current space'}
51
- createInvitationUrl={(invitationCode) => `${origin}?spaceInvitationCode=${invitationCode}`}
52
- onClickJoinSpace={() => runtime.setLayout(ShellLayout.JOIN_SPACE, { spaceKey: space?.key })}
53
- onClickMember={() => runtime.setLayout(ShellLayout.DEVICES_LIST, { spaceKey: space?.key })}
54
- onDone={async (space) => {
55
- // TODO(wittjosiah): If space is newly created the app won't yet know about it.
56
- // This is a bug that needs to be fixed when upgrading the space service.
57
- await runtime.setAppContext({ display: ShellDisplay.NONE, spaceKey: space ? space.key : spaceKey });
58
- runtime.setLayout(ShellLayout.DEFAULT);
59
- }}
60
- />
61
- );
62
-
63
- case ShellLayout.JOIN_SPACE:
64
- return (
65
- <JoinDialog
66
- initialInvitationCode={invitationCode}
67
- onDone={async (result) => {
68
- await runtime.setAppContext({ display: ShellDisplay.NONE, spaceKey: result?.spaceKey ?? undefined });
69
- runtime.setLayout(ShellLayout.DEFAULT);
70
- }}
71
- onExit={async () => {
72
- await runtime.setAppContext({ display: ShellDisplay.NONE, spaceKey: runtime.spaceKey });
73
- runtime.setLayout(ShellLayout.DEFAULT);
74
- }}
75
- />
76
- );
77
-
78
- case ShellLayout.DEVICES_LIST:
79
- return (
80
- <DevicesDialog
81
- createInvitationUrl={(invitationCode) => `${origin}?haloInvitationCode=${invitationCode}`}
82
- onDone={async () => {
83
- await runtime.setAppContext({ display: ShellDisplay.NONE, spaceKey: runtime.spaceKey });
84
- runtime.setLayout(ShellLayout.DEFAULT);
85
- }}
86
- />
87
- );
88
-
89
- default:
90
- return null;
91
- }
92
- };
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- export * from './Shell';
@@ -1,38 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import { Close } from '@radix-ui/react-dialog';
6
- import React from 'react';
7
-
8
- import { ThemeContext, useId } from '@dxos/react-components';
9
-
10
- import { PanelDialog, PanelDialogProps } from '../../layouts';
11
- import { SpacePanel, SpacePanelProps } from '../../panels';
12
-
13
- export interface SpaceDialogProps
14
- extends Omit<PanelDialogProps, 'titleId' | 'children'>,
15
- Omit<SpacePanelProps, 'doneActionParent'> {}
16
-
17
- export const SpaceDialog = ({ slots, ...spacePanelProps }: SpaceDialogProps) => {
18
- const titleId = useId('spaceDialog__title');
19
-
20
- return (
21
- <PanelDialog
22
- {...{
23
- slots: { ...slots, root: { onOpenChange: (open) => open || spacePanelProps.onDone?.(null), ...slots?.root } },
24
- titleId
25
- }}
26
- >
27
- <ThemeContext.Provider value={{ themeVariant: 'os' }}>
28
- <SpacePanel
29
- {...{
30
- ...spacePanelProps,
31
- titleId,
32
- doneActionParent: <Close asChild />
33
- }}
34
- />
35
- </ThemeContext.Provider>
36
- </PanelDialog>
37
- );
38
- };
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- export * from './SpaceDialog';
@@ -1,39 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import * as Dialog from '@radix-ui/react-dialog';
6
- import React, { ComponentPropsWithoutRef, PropsWithChildren } from 'react';
7
-
8
- import { mx } from '@dxos/react-components';
9
-
10
- import { defaultDialogContent, defaultOverlay } from '../../styles';
11
-
12
- export interface PanelDialogSlots {
13
- root: ComponentPropsWithoutRef<typeof Dialog.Root>;
14
- overlay: ComponentPropsWithoutRef<typeof Dialog.Overlay>;
15
- content: ComponentPropsWithoutRef<typeof Dialog.Content>;
16
- trigger: ComponentPropsWithoutRef<typeof Dialog.Trigger>;
17
- }
18
-
19
- export type PanelDialogProps = PropsWithChildren<{
20
- titleId: string;
21
- slots?: Partial<PanelDialogSlots>;
22
- }>;
23
-
24
- export const PanelDialog = ({ titleId, slots = {}, children }: PanelDialogProps) => {
25
- return (
26
- <Dialog.Root defaultOpen {...slots.root}>
27
- {slots.trigger && <Dialog.Trigger {...slots.trigger} />}
28
- <Dialog.Overlay {...slots.overlay} className={mx(defaultOverlay, 'z-40', slots.overlay?.className)}>
29
- <Dialog.Content
30
- {...slots.content}
31
- aria-labelledby={titleId}
32
- className={mx(defaultDialogContent, slots.content?.className)}
33
- >
34
- {children}
35
- </Dialog.Content>
36
- </Dialog.Overlay>
37
- </Dialog.Root>
38
- );
39
- };
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- export * from './PanelDialog';
@@ -1,98 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import { UserPlus, X } from 'phosphor-react';
6
- import React, { cloneElement, useReducer } from 'react';
7
-
8
- import { useClient, useDevices, useHaloInvitations, useIdentity } from '@dxos/react-client';
9
- import { Button, getSize, mx, Tooltip, useTranslation } from '@dxos/react-components';
10
-
11
- import { DeviceList, InvitationList, PanelSeparator } from '../../components';
12
- import { defaultSurface, subduedSurface } from '../../styles';
13
-
14
- export type DevicesPanelProps = {
15
- titleId?: string;
16
- createInvitationUrl: (invitationCode: string) => string;
17
- doneActionParent?: Parameters<typeof cloneElement>[0];
18
- onDone?: () => void;
19
- };
20
-
21
- export type DevicesView = 'device list';
22
-
23
- const DeviceListView = ({ createInvitationUrl, titleId, onDone, doneActionParent }: DevicesPanelProps) => {
24
- const { t } = useTranslation('os');
25
- const client = useClient();
26
- const identity = useIdentity();
27
- const devices = useDevices();
28
- const invitations = useHaloInvitations();
29
- const displayName = identity?.displayName;
30
-
31
- if (!identity) {
32
- return null;
33
- }
34
-
35
- const doneButton = (
36
- <Button compact variant='ghost' onClick={() => onDone?.()} data-testid='show-all-spaces'>
37
- <X className={getSize(4)} weight='bold' />
38
- </Button>
39
- );
40
-
41
- return (
42
- <div role='none' className='flex flex-col'>
43
- <div role='none' className={mx(subduedSurface, 'rounded-bs-md flex items-center p-2 gap-2')}>
44
- {/* TODO(wittjosiah): Label this as the identity panel. */}
45
- <h2 id={titleId} className={mx('grow font-system-medium', !displayName && 'font-mono')}>
46
- {displayName ?? identity.identityKey.truncate()}
47
- </h2>
48
- <Tooltip content={t('close label')} zIndex='z-50'>
49
- {doneActionParent ? cloneElement(doneActionParent, {}, doneButton) : doneButton}
50
- </Tooltip>
51
- </div>
52
- <div role='region' className={mx(defaultSurface, 'rounded-be-md p-2')}>
53
- <InvitationList
54
- invitations={invitations}
55
- onClickRemove={({ invitation }) => invitation && client.halo.removeInvitation(invitation.invitationId!)}
56
- createInvitationUrl={createInvitationUrl}
57
- />
58
- <Button
59
- className='is-full flex gap-2 mbs-2'
60
- compact
61
- onClick={() => client.halo.createInvitation()}
62
- data-testid='create-space-invitation'
63
- >
64
- <span>{t('create space invitation label')}</span>
65
- <UserPlus className={getSize(4)} weight='bold' />
66
- </Button>
67
- <PanelSeparator />
68
- <DeviceList devices={devices} />
69
- </div>
70
- </div>
71
- );
72
- };
73
-
74
- type DevicesPanelState = {
75
- activeView: DevicesView;
76
- };
77
-
78
- type DevicesPanelAction = {
79
- type: null;
80
- };
81
-
82
- // TODO(wittjosiah): Rename identity panel and include other views?
83
- export const DevicesPanel = (props: DevicesPanelProps) => {
84
- const reducer = (state: DevicesPanelState, action: DevicesPanelAction) => {
85
- const nextState = { ...state };
86
- switch (action.type) {
87
- case null:
88
- }
89
- return nextState;
90
- };
91
-
92
- const [panelState] = useReducer(reducer, {
93
- activeView: 'device list'
94
- });
95
-
96
- // TODO(wittjosiah): Use ViewState or similar.
97
- return <>{panelState.activeView === 'device list' ? <DeviceListView {...props} /> : null}</>;
98
- };
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- export * from './DevicesPanel';