@dxos/shell 0.3.11-main.1caa3af
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +8 -0
- package/README.md +21 -0
- package/dist/lib/browser/chunk-ZSTKOCBT.mjs +10 -0
- package/dist/lib/browser/chunk-ZSTKOCBT.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/lib/browser/react.mjs +3617 -0
- package/dist/lib/browser/react.mjs.map +7 -0
- package/dist/lib/browser/testing/index.mjs +179 -0
- package/dist/lib/browser/testing/index.mjs.map +7 -0
- package/dist/types/src/components/AuthCode.d.ts +8 -0
- package/dist/types/src/components/AuthCode.d.ts.map +1 -0
- package/dist/types/src/components/AuthCode.js +26 -0
- package/dist/types/src/components/AuthCode.js.map +1 -0
- package/dist/types/src/components/Clipboard/ClipboardProvider.d.ts +9 -0
- package/dist/types/src/components/Clipboard/ClipboardProvider.d.ts.map +1 -0
- package/dist/types/src/components/Clipboard/ClipboardProvider.js +46 -0
- package/dist/types/src/components/Clipboard/ClipboardProvider.js.map +1 -0
- package/dist/types/src/components/Clipboard/CopyButton.d.ts +9 -0
- package/dist/types/src/components/Clipboard/CopyButton.d.ts.map +1 -0
- package/dist/types/src/components/Clipboard/CopyButton.js +65 -0
- package/dist/types/src/components/Clipboard/CopyButton.js.map +1 -0
- package/dist/types/src/components/Clipboard/index.d.ts +3 -0
- package/dist/types/src/components/Clipboard/index.d.ts.map +1 -0
- package/dist/types/src/components/Clipboard/index.js +22 -0
- package/dist/types/src/components/Clipboard/index.js.map +1 -0
- package/dist/types/src/components/CompoundButton/CompoundButton.d.ts +17 -0
- package/dist/types/src/components/CompoundButton/CompoundButton.d.ts.map +1 -0
- package/dist/types/src/components/CompoundButton/CompoundButton.js +29 -0
- package/dist/types/src/components/CompoundButton/CompoundButton.js.map +1 -0
- package/dist/types/src/components/CompoundButton/CompoundButton.stories.d.ts +35 -0
- package/dist/types/src/components/CompoundButton/CompoundButton.stories.d.ts.map +1 -0
- package/dist/types/src/components/CompoundButton/CompoundButton.stories.js +45 -0
- package/dist/types/src/components/CompoundButton/CompoundButton.stories.js.map +1 -0
- package/dist/types/src/components/CompoundButton/index.d.ts +2 -0
- package/dist/types/src/components/CompoundButton/index.d.ts.map +1 -0
- package/dist/types/src/components/CompoundButton/index.js +21 -0
- package/dist/types/src/components/CompoundButton/index.js.map +1 -0
- package/dist/types/src/components/IdentityList/DeviceList.d.ts +7 -0
- package/dist/types/src/components/IdentityList/DeviceList.d.ts.map +1 -0
- package/dist/types/src/components/IdentityList/DeviceList.js +29 -0
- package/dist/types/src/components/IdentityList/DeviceList.js.map +1 -0
- package/dist/types/src/components/IdentityList/IdentityListItem.d.ts +11 -0
- package/dist/types/src/components/IdentityList/IdentityListItem.d.ts.map +1 -0
- package/dist/types/src/components/IdentityList/IdentityListItem.js +47 -0
- package/dist/types/src/components/IdentityList/IdentityListItem.js.map +1 -0
- package/dist/types/src/components/IdentityList/SpaceMemberList.d.ts +13 -0
- package/dist/types/src/components/IdentityList/SpaceMemberList.d.ts.map +1 -0
- package/dist/types/src/components/IdentityList/SpaceMemberList.js +54 -0
- package/dist/types/src/components/IdentityList/SpaceMemberList.js.map +1 -0
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.d.ts +17 -0
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.d.ts.map +1 -0
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.js +26 -0
- package/dist/types/src/components/IdentityList/SpaceMemberList.stories.js.map +1 -0
- package/dist/types/src/components/IdentityList/index.d.ts +4 -0
- package/dist/types/src/components/IdentityList/index.d.ts.map +1 -0
- package/dist/types/src/components/IdentityList/index.js +23 -0
- package/dist/types/src/components/IdentityList/index.js.map +1 -0
- package/dist/types/src/components/InvitationList/InvitationList.d.ts +11 -0
- package/dist/types/src/components/InvitationList/InvitationList.d.ts.map +1 -0
- package/dist/types/src/components/InvitationList/InvitationList.js +22 -0
- package/dist/types/src/components/InvitationList/InvitationList.js.map +1 -0
- package/dist/types/src/components/InvitationList/InvitationList.stories.d.ts +17 -0
- package/dist/types/src/components/InvitationList/InvitationList.stories.d.ts.map +1 -0
- package/dist/types/src/components/InvitationList/InvitationList.stories.js +39 -0
- package/dist/types/src/components/InvitationList/InvitationList.stories.js.map +1 -0
- package/dist/types/src/components/InvitationList/InvitationListContainer.d.ts +7 -0
- package/dist/types/src/components/InvitationList/InvitationListContainer.d.ts.map +1 -0
- package/dist/types/src/components/InvitationList/InvitationListContainer.js +42 -0
- package/dist/types/src/components/InvitationList/InvitationListContainer.js.map +1 -0
- package/dist/types/src/components/InvitationList/InvitationListItem.d.ts +12 -0
- package/dist/types/src/components/InvitationList/InvitationListItem.d.ts.map +1 -0
- package/dist/types/src/components/InvitationList/InvitationListItem.js +103 -0
- package/dist/types/src/components/InvitationList/InvitationListItem.js.map +1 -0
- package/dist/types/src/components/InvitationList/InvitationListProps.d.ts +9 -0
- package/dist/types/src/components/InvitationList/InvitationListProps.d.ts.map +1 -0
- package/dist/types/src/components/InvitationList/InvitationListProps.js +3 -0
- package/dist/types/src/components/InvitationList/InvitationListProps.js.map +1 -0
- package/dist/types/src/components/InvitationList/index.d.ts +4 -0
- package/dist/types/src/components/InvitationList/index.d.ts.map +1 -0
- package/dist/types/src/components/InvitationList/index.js +23 -0
- package/dist/types/src/components/InvitationList/index.js.map +1 -0
- package/dist/types/src/components/Panel/Action.d.ts +20 -0
- package/dist/types/src/components/Panel/Action.d.ts.map +1 -0
- package/dist/types/src/components/Panel/Action.js +93 -0
- package/dist/types/src/components/Panel/Action.js.map +1 -0
- package/dist/types/src/components/Panel/Actions.d.ts +11 -0
- package/dist/types/src/components/Panel/Actions.d.ts.map +1 -0
- package/dist/types/src/components/Panel/Actions.js +36 -0
- package/dist/types/src/components/Panel/Actions.js.map +1 -0
- package/dist/types/src/components/Panel/CloseButton.d.ts +5 -0
- package/dist/types/src/components/Panel/CloseButton.d.ts.map +1 -0
- package/dist/types/src/components/Panel/CloseButton.js +21 -0
- package/dist/types/src/components/Panel/CloseButton.js.map +1 -0
- package/dist/types/src/components/Panel/Emoji.d.ts +7 -0
- package/dist/types/src/components/Panel/Emoji.d.ts.map +1 -0
- package/dist/types/src/components/Panel/Emoji.js +24 -0
- package/dist/types/src/components/Panel/Emoji.js.map +1 -0
- package/dist/types/src/components/Panel/Heading.d.ts +16 -0
- package/dist/types/src/components/Panel/Heading.d.ts.map +1 -0
- package/dist/types/src/components/Panel/Heading.js +39 -0
- package/dist/types/src/components/Panel/Heading.js.map +1 -0
- package/dist/types/src/components/Panel/Input.d.ts +11 -0
- package/dist/types/src/components/Panel/Input.d.ts.map +1 -0
- package/dist/types/src/components/Panel/Input.js +19 -0
- package/dist/types/src/components/Panel/Input.js.map +1 -0
- package/dist/types/src/components/Panel/Label.d.ts +4 -0
- package/dist/types/src/components/Panel/Label.d.ts.map +1 -0
- package/dist/types/src/components/Panel/Label.js +17 -0
- package/dist/types/src/components/Panel/Label.js.map +1 -0
- package/dist/types/src/components/Panel/Panel.stories.d.ts +13 -0
- package/dist/types/src/components/Panel/Panel.stories.d.ts.map +1 -0
- package/dist/types/src/components/Panel/Panel.stories.js +44 -0
- package/dist/types/src/components/Panel/Panel.stories.js.map +1 -0
- package/dist/types/src/components/Panel/StepHeading.d.ts +5 -0
- package/dist/types/src/components/Panel/StepHeading.d.ts.map +1 -0
- package/dist/types/src/components/Panel/StepHeading.js +35 -0
- package/dist/types/src/components/Panel/StepHeading.js.map +1 -0
- package/dist/types/src/components/Panel/index.d.ts +9 -0
- package/dist/types/src/components/Panel/index.d.ts.map +1 -0
- package/dist/types/src/components/Panel/index.js +28 -0
- package/dist/types/src/components/Panel/index.js.map +1 -0
- package/dist/types/src/components/SpaceListItem.d.ts +7 -0
- package/dist/types/src/components/SpaceListItem.d.ts.map +1 -0
- package/dist/types/src/components/SpaceListItem.js +46 -0
- package/dist/types/src/components/SpaceListItem.js.map +1 -0
- package/dist/types/src/components/StorybookDialog.d.ts +6 -0
- package/dist/types/src/components/StorybookDialog.d.ts.map +1 -0
- package/dist/types/src/components/StorybookDialog.js +23 -0
- package/dist/types/src/components/StorybookDialog.js.map +1 -0
- package/dist/types/src/components/Viewport/Viewport.d.ts +39 -0
- package/dist/types/src/components/Viewport/Viewport.d.ts.map +1 -0
- package/dist/types/src/components/Viewport/Viewport.js +73 -0
- package/dist/types/src/components/Viewport/Viewport.js.map +1 -0
- package/dist/types/src/components/Viewport/Viewport.stories.d.ts +17 -0
- package/dist/types/src/components/Viewport/Viewport.stories.d.ts.map +1 -0
- package/dist/types/src/components/Viewport/Viewport.stories.js +51 -0
- package/dist/types/src/components/Viewport/Viewport.stories.js.map +1 -0
- package/dist/types/src/components/Viewport/index.d.ts +2 -0
- package/dist/types/src/components/Viewport/index.d.ts.map +1 -0
- package/dist/types/src/components/Viewport/index.js +21 -0
- package/dist/types/src/components/Viewport/index.js.map +1 -0
- package/dist/types/src/components/index.d.ts +9 -0
- package/dist/types/src/components/index.d.ts.map +1 -0
- package/dist/types/src/components/index.js +28 -0
- package/dist/types/src/components/index.js.map +1 -0
- package/dist/types/src/composites/IdentityDialog/IdentityDialog.d.ts +7 -0
- package/dist/types/src/composites/IdentityDialog/IdentityDialog.d.ts.map +1 -0
- package/dist/types/src/composites/IdentityDialog/IdentityDialog.js +26 -0
- package/dist/types/src/composites/IdentityDialog/IdentityDialog.js.map +1 -0
- package/dist/types/src/composites/IdentityDialog/index.d.ts +2 -0
- package/dist/types/src/composites/IdentityDialog/index.d.ts.map +1 -0
- package/dist/types/src/composites/IdentityDialog/index.js +21 -0
- package/dist/types/src/composites/IdentityDialog/index.js.map +1 -0
- package/dist/types/src/composites/JoinDialog/JoinDialog.d.ts +6 -0
- package/dist/types/src/composites/JoinDialog/JoinDialog.d.ts.map +1 -0
- package/dist/types/src/composites/JoinDialog/JoinDialog.js +27 -0
- package/dist/types/src/composites/JoinDialog/JoinDialog.js.map +1 -0
- package/dist/types/src/composites/JoinDialog/index.d.ts +2 -0
- package/dist/types/src/composites/JoinDialog/index.d.ts.map +1 -0
- package/dist/types/src/composites/JoinDialog/index.js +21 -0
- package/dist/types/src/composites/JoinDialog/index.js.map +1 -0
- package/dist/types/src/composites/Shell/Shell.d.ts +6 -0
- package/dist/types/src/composites/Shell/Shell.d.ts.map +1 -0
- package/dist/types/src/composites/Shell/Shell.js +90 -0
- package/dist/types/src/composites/Shell/Shell.js.map +1 -0
- package/dist/types/src/composites/Shell/ShellContext.d.ts +30 -0
- package/dist/types/src/composites/Shell/ShellContext.d.ts.map +1 -0
- package/dist/types/src/composites/Shell/ShellContext.js +129 -0
- package/dist/types/src/composites/Shell/ShellContext.js.map +1 -0
- package/dist/types/src/composites/Shell/index.d.ts +4 -0
- package/dist/types/src/composites/Shell/index.d.ts.map +1 -0
- package/dist/types/src/composites/Shell/index.js +23 -0
- package/dist/types/src/composites/Shell/index.js.map +1 -0
- package/dist/types/src/composites/Shell/memory-shell-runtime.d.ts +16 -0
- package/dist/types/src/composites/Shell/memory-shell-runtime.d.ts.map +1 -0
- package/dist/types/src/composites/Shell/memory-shell-runtime.js +38 -0
- package/dist/types/src/composites/Shell/memory-shell-runtime.js.map +1 -0
- package/dist/types/src/composites/Shell/run-shell.d.ts +3 -0
- package/dist/types/src/composites/Shell/run-shell.d.ts.map +1 -0
- package/dist/types/src/composites/Shell/run-shell.js +54 -0
- package/dist/types/src/composites/Shell/run-shell.js.map +1 -0
- package/dist/types/src/composites/SpaceDialog/SpaceDialog.d.ts +6 -0
- package/dist/types/src/composites/SpaceDialog/SpaceDialog.d.ts.map +1 -0
- package/dist/types/src/composites/SpaceDialog/SpaceDialog.js +26 -0
- package/dist/types/src/composites/SpaceDialog/SpaceDialog.js.map +1 -0
- package/dist/types/src/composites/SpaceDialog/index.d.ts +2 -0
- package/dist/types/src/composites/SpaceDialog/index.d.ts.map +1 -0
- package/dist/types/src/composites/SpaceDialog/index.js +21 -0
- package/dist/types/src/composites/SpaceDialog/index.js.map +1 -0
- package/dist/types/src/composites/index.d.ts +5 -0
- package/dist/types/src/composites/index.d.ts.map +1 -0
- package/dist/types/src/composites/index.js +24 -0
- package/dist/types/src/composites/index.js.map +1 -0
- package/dist/types/src/index.d.ts +3 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/index.js +10 -0
- package/dist/types/src/index.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts +4 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js +124 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.d.ts +22 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js +86 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts +27 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.js +6 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/identityMachine.d.ts +46 -0
- package/dist/types/src/panels/IdentityPanel/identityMachine.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/identityMachine.js +79 -0
- package/dist/types/src/panels/IdentityPanel/identityMachine.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/index.d.ts +3 -0
- package/dist/types/src/panels/IdentityPanel/index.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/index.js +22 -0
- package/dist/types/src/panels/IdentityPanel/index.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts +9 -0
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js +85 -0
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.d.ts +15 -0
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js +62 -0
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/index.d.ts +3 -0
- package/dist/types/src/panels/IdentityPanel/steps/index.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/index.js +22 -0
- package/dist/types/src/panels/IdentityPanel/steps/index.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/JoinHeading.d.ts +10 -0
- package/dist/types/src/panels/JoinPanel/JoinHeading.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/JoinHeading.js +45 -0
- package/dist/types/src/panels/JoinPanel/JoinHeading.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/JoinPanel.d.ts +4 -0
- package/dist/types/src/panels/JoinPanel/JoinPanel.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/JoinPanel.js +293 -0
- package/dist/types/src/panels/JoinPanel/JoinPanel.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.d.ts +92 -0
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.js +74 -0
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts +91 -0
- package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/JoinPanelProps.js +6 -0
- package/dist/types/src/panels/JoinPanel/JoinPanelProps.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/index.d.ts +3 -0
- package/dist/types/src/panels/JoinPanel/index.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/index.js +22 -0
- package/dist/types/src/panels/JoinPanel/index.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/joinMachine.d.ts +87 -0
- package/dist/types/src/panels/JoinPanel/joinMachine.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/joinMachine.js +402 -0
- package/dist/types/src/panels/JoinPanel/joinMachine.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/AdditionMethodChooser.d.ts +4 -0
- package/dist/types/src/panels/JoinPanel/steps/AdditionMethodChooser.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/AdditionMethodChooser.js +34 -0
- package/dist/types/src/panels/JoinPanel/steps/AdditionMethodChooser.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.d.ts +8 -0
- package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.js +56 -0
- package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.d.ts +12 -0
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.js +67 -0
- package/dist/types/src/panels/JoinPanel/steps/IdentityInput.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationAccepted.d.ts +9 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationAccepted.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationAccepted.js +44 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationAccepted.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.d.ts +11 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.js +72 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.d.ts +8 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.js +68 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationInput.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationRescuer.d.ts +11 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationRescuer.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationRescuer.js +49 -0
- package/dist/types/src/panels/JoinPanel/steps/InvitationRescuer.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.d.ts +12 -0
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.js +63 -0
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.js.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/index.d.ts +9 -0
- package/dist/types/src/panels/JoinPanel/steps/index.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/steps/index.js +28 -0
- package/dist/types/src/panels/JoinPanel/steps/index.js.map +1 -0
- package/dist/types/src/panels/Panels.stories.d.ts +22 -0
- package/dist/types/src/panels/Panels.stories.d.ts.map +1 -0
- package/dist/types/src/panels/Panels.stories.js +71 -0
- package/dist/types/src/panels/Panels.stories.js.map +1 -0
- package/dist/types/src/panels/SpacePanel/SpacePanel.d.ts +4 -0
- package/dist/types/src/panels/SpacePanel/SpacePanel.d.ts.map +1 -0
- package/dist/types/src/panels/SpacePanel/SpacePanel.js +93 -0
- package/dist/types/src/panels/SpacePanel/SpacePanel.js.map +1 -0
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.d.ts +30 -0
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.d.ts.map +1 -0
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.js +183 -0
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.js.map +1 -0
- package/dist/types/src/panels/SpacePanel/SpacePanelProps.d.ts +30 -0
- package/dist/types/src/panels/SpacePanel/SpacePanelProps.d.ts.map +1 -0
- package/dist/types/src/panels/SpacePanel/SpacePanelProps.js +6 -0
- package/dist/types/src/panels/SpacePanel/SpacePanelProps.js.map +1 -0
- package/dist/types/src/panels/SpacePanel/index.d.ts +3 -0
- package/dist/types/src/panels/SpacePanel/index.d.ts.map +1 -0
- package/dist/types/src/panels/SpacePanel/index.js +22 -0
- package/dist/types/src/panels/SpacePanel/index.js.map +1 -0
- package/dist/types/src/panels/SpacePanel/spaceMachine.d.ts +35 -0
- package/dist/types/src/panels/SpacePanel/spaceMachine.d.ts.map +1 -0
- package/dist/types/src/panels/SpacePanel/spaceMachine.js +46 -0
- package/dist/types/src/panels/SpacePanel/spaceMachine.js.map +1 -0
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.d.ts +15 -0
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.d.ts.map +1 -0
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js +120 -0
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js.map +1 -0
- package/dist/types/src/panels/SpacePanel/steps/index.d.ts +2 -0
- package/dist/types/src/panels/SpacePanel/steps/index.d.ts.map +1 -0
- package/dist/types/src/panels/SpacePanel/steps/index.js +21 -0
- package/dist/types/src/panels/SpacePanel/steps/index.js.map +1 -0
- package/dist/types/src/panels/index.d.ts +4 -0
- package/dist/types/src/panels/index.d.ts.map +1 -0
- package/dist/types/src/panels/index.js +23 -0
- package/dist/types/src/panels/index.js.map +1 -0
- package/dist/types/src/playwright/invitations-manager.d.ts +26 -0
- package/dist/types/src/playwright/invitations-manager.d.ts.map +1 -0
- package/dist/types/src/playwright/invitations-manager.js +142 -0
- package/dist/types/src/playwright/invitations-manager.js.map +1 -0
- package/dist/types/src/playwright/invitations.spec.d.ts +2 -0
- package/dist/types/src/playwright/invitations.spec.d.ts.map +1 -0
- package/dist/types/src/playwright/invitations.spec.js +298 -0
- package/dist/types/src/playwright/invitations.spec.js.map +1 -0
- package/dist/types/src/playwright/playwright.config.d.ts +3 -0
- package/dist/types/src/playwright/playwright.config.d.ts.map +1 -0
- package/dist/types/src/playwright/playwright.config.js +8 -0
- package/dist/types/src/playwright/playwright.config.js.map +1 -0
- package/dist/types/src/react.d.ts +6 -0
- package/dist/types/src/react.d.ts.map +1 -0
- package/dist/types/src/react.js +25 -0
- package/dist/types/src/react.js.map +1 -0
- package/dist/types/src/steps/InvitationManager.d.ts +7 -0
- package/dist/types/src/steps/InvitationManager.d.ts.map +1 -0
- package/dist/types/src/steps/InvitationManager.js +80 -0
- package/dist/types/src/steps/InvitationManager.js.map +1 -0
- package/dist/types/src/steps/StepProps.d.ts +14 -0
- package/dist/types/src/steps/StepProps.d.ts.map +1 -0
- package/dist/types/src/steps/StepProps.js +6 -0
- package/dist/types/src/steps/StepProps.js.map +1 -0
- package/dist/types/src/steps/index.d.ts +3 -0
- package/dist/types/src/steps/index.d.ts.map +1 -0
- package/dist/types/src/steps/index.js +22 -0
- package/dist/types/src/steps/index.js.map +1 -0
- package/dist/types/src/stories/Invitations.e2e-stories.d.ts +22 -0
- package/dist/types/src/stories/Invitations.e2e-stories.d.ts.map +1 -0
- package/dist/types/src/stories/Invitations.e2e-stories.js +146 -0
- package/dist/types/src/stories/Invitations.e2e-stories.js.map +1 -0
- package/dist/types/src/styles/index.d.ts +3 -0
- package/dist/types/src/styles/index.d.ts.map +1 -0
- package/dist/types/src/styles/index.js +22 -0
- package/dist/types/src/styles/index.js.map +1 -0
- package/dist/types/src/styles/invitationStatusStyles.d.ts +20 -0
- package/dist/types/src/styles/invitationStatusStyles.d.ts.map +1 -0
- package/dist/types/src/styles/invitationStatusStyles.js +41 -0
- package/dist/types/src/styles/invitationStatusStyles.js.map +1 -0
- package/dist/types/src/styles/panelStyles.d.ts +2 -0
- package/dist/types/src/styles/panelStyles.d.ts.map +1 -0
- package/dist/types/src/styles/panelStyles.js +8 -0
- package/dist/types/src/styles/panelStyles.js.map +1 -0
- package/dist/types/src/testing/fixtures/identities.d.ts +3 -0
- package/dist/types/src/testing/fixtures/identities.d.ts.map +1 -0
- package/dist/types/src/testing/fixtures/identities.js +18 -0
- package/dist/types/src/testing/fixtures/identities.js.map +1 -0
- package/dist/types/src/testing/fixtures/index.d.ts +3 -0
- package/dist/types/src/testing/fixtures/index.d.ts.map +1 -0
- package/dist/types/src/testing/fixtures/index.js +22 -0
- package/dist/types/src/testing/fixtures/index.js.map +1 -0
- package/dist/types/src/testing/fixtures/invitations.d.ts +3 -0
- package/dist/types/src/testing/fixtures/invitations.d.ts.map +1 -0
- package/dist/types/src/testing/fixtures/invitations.js +25 -0
- package/dist/types/src/testing/fixtures/invitations.js.map +1 -0
- package/dist/types/src/testing/index.d.ts +4 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/index.js +23 -0
- package/dist/types/src/testing/index.js.map +1 -0
- package/dist/types/src/testing/scoped-shell-manager.d.ts +17 -0
- package/dist/types/src/testing/scoped-shell-manager.d.ts.map +1 -0
- package/dist/types/src/testing/scoped-shell-manager.js +71 -0
- package/dist/types/src/testing/scoped-shell-manager.js.map +1 -0
- package/dist/types/src/testing/shell-manager.d.ts +24 -0
- package/dist/types/src/testing/shell-manager.d.ts.map +1 -0
- package/dist/types/src/testing/shell-manager.js +85 -0
- package/dist/types/src/testing/shell-manager.js.map +1 -0
- package/dist/types/src/translations/index.d.ts +5 -0
- package/dist/types/src/translations/index.d.ts.map +1 -0
- package/dist/types/src/translations/index.js +32 -0
- package/dist/types/src/translations/index.js.map +1 -0
- package/dist/types/src/translations/locales/en-US.d.ts +97 -0
- package/dist/types/src/translations/locales/en-US.d.ts.map +1 -0
- package/dist/types/src/translations/locales/en-US.js +103 -0
- package/dist/types/src/translations/locales/en-US.js.map +1 -0
- package/dist/types/src/types/FailReason.d.ts +2 -0
- package/dist/types/src/types/FailReason.d.ts.map +1 -0
- package/dist/types/src/types/FailReason.js +6 -0
- package/dist/types/src/types/FailReason.js.map +1 -0
- package/dist/types/src/types/IInvitation.d.ts +7 -0
- package/dist/types/src/types/IInvitation.d.ts.map +1 -0
- package/dist/types/src/types/IInvitation.js +6 -0
- package/dist/types/src/types/IInvitation.js.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/types/index.js +22 -0
- package/dist/types/src/types/index.js.map +1 -0
- package/dist/types/src/util/index.d.ts +3 -0
- package/dist/types/src/util/index.d.ts.map +1 -0
- package/dist/types/src/util/index.js +22 -0
- package/dist/types/src/util/index.js.map +1 -0
- package/dist/types/src/util/invitationStatusValue.d.ts +8 -0
- package/dist/types/src/util/invitationStatusValue.d.ts.map +1 -0
- package/dist/types/src/util/invitationStatusValue.js +24 -0
- package/dist/types/src/util/invitationStatusValue.js.map +1 -0
- package/dist/types/src/util/toEmoji.d.ts +2 -0
- package/dist/types/src/util/toEmoji.d.ts.map +1 -0
- package/dist/types/src/util/toEmoji.js +26 -0
- package/dist/types/src/util/toEmoji.js.map +1 -0
- package/package.json +79 -0
- package/src/components/AuthCode.tsx +36 -0
- package/src/components/Clipboard/ClipboardProvider.tsx +26 -0
- package/src/components/Clipboard/CopyButton.tsx +70 -0
- package/src/components/Clipboard/index.ts +6 -0
- package/src/components/CompoundButton/CompoundButton.stories.tsx +49 -0
- package/src/components/CompoundButton/CompoundButton.tsx +89 -0
- package/src/components/CompoundButton/index.ts +5 -0
- package/src/components/IdentityList/DeviceList.tsx +45 -0
- package/src/components/IdentityList/IdentityListItem.tsx +42 -0
- package/src/components/IdentityList/SpaceMemberList.stories.tsx +24 -0
- package/src/components/IdentityList/SpaceMemberList.tsx +65 -0
- package/src/components/IdentityList/index.ts +7 -0
- package/src/components/InvitationList/InvitationList.stories.tsx +44 -0
- package/src/components/InvitationList/InvitationList.tsx +31 -0
- package/src/components/InvitationList/InvitationListContainer.tsx +27 -0
- package/src/components/InvitationList/InvitationListItem.tsx +183 -0
- package/src/components/InvitationList/InvitationListProps.ts +9 -0
- package/src/components/InvitationList/index.ts +7 -0
- package/src/components/Panel/Action.tsx +142 -0
- package/src/components/Panel/Actions.tsx +31 -0
- package/src/components/Panel/CloseButton.tsx +24 -0
- package/src/components/Panel/Emoji.tsx +36 -0
- package/src/components/Panel/Heading.tsx +32 -0
- package/src/components/Panel/Input.tsx +27 -0
- package/src/components/Panel/Label.tsx +14 -0
- package/src/components/Panel/Panel.stories.tsx +52 -0
- package/src/components/Panel/StepHeading.tsx +17 -0
- package/src/components/Panel/index.ts +12 -0
- package/src/components/SpaceListItem.tsx +35 -0
- package/src/components/StorybookDialog.tsx +33 -0
- package/src/components/Viewport/Viewport.stories.tsx +66 -0
- package/src/components/Viewport/Viewport.tsx +120 -0
- package/src/components/Viewport/index.tsx +5 -0
- package/src/components/index.ts +12 -0
- package/src/composites/IdentityDialog/IdentityDialog.tsx +39 -0
- package/src/composites/IdentityDialog/index.ts +5 -0
- package/src/composites/JoinDialog/JoinDialog.tsx +40 -0
- package/src/composites/JoinDialog/index.ts +5 -0
- package/src/composites/Shell/Shell.tsx +98 -0
- package/src/composites/Shell/ShellContext.tsx +163 -0
- package/src/composites/Shell/index.ts +7 -0
- package/src/composites/Shell/memory-shell-runtime.ts +50 -0
- package/src/composites/Shell/run-shell.tsx +38 -0
- package/src/composites/SpaceDialog/SpaceDialog.tsx +37 -0
- package/src/composites/SpaceDialog/index.ts +5 -0
- package/src/composites/index.ts +8 -0
- package/src/index.ts +7 -0
- package/src/panels/IdentityPanel/IdentityPanel.stories.tsx +113 -0
- package/src/panels/IdentityPanel/IdentityPanel.tsx +158 -0
- package/src/panels/IdentityPanel/IdentityPanelProps.ts +36 -0
- package/src/panels/IdentityPanel/identityMachine.ts +131 -0
- package/src/panels/IdentityPanel/index.ts +6 -0
- package/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx +96 -0
- package/src/panels/IdentityPanel/steps/ProfileForm.tsx +79 -0
- package/src/panels/IdentityPanel/steps/index.ts +6 -0
- package/src/panels/JoinPanel/JoinHeading.tsx +49 -0
- package/src/panels/JoinPanel/JoinPanel.stories.tsx +91 -0
- package/src/panels/JoinPanel/JoinPanel.tsx +415 -0
- package/src/panels/JoinPanel/JoinPanelProps.ts +132 -0
- package/src/panels/JoinPanel/index.ts +6 -0
- package/src/panels/JoinPanel/joinMachine.ts +536 -0
- package/src/panels/JoinPanel/steps/AdditionMethodChooser.tsx +65 -0
- package/src/panels/JoinPanel/steps/IdentityAdded.tsx +75 -0
- package/src/panels/JoinPanel/steps/IdentityInput.tsx +86 -0
- package/src/panels/JoinPanel/steps/InvitationAccepted.tsx +43 -0
- package/src/panels/JoinPanel/steps/InvitationAuthenticator.tsx +99 -0
- package/src/panels/JoinPanel/steps/InvitationInput.tsx +102 -0
- package/src/panels/JoinPanel/steps/InvitationRescuer.tsx +102 -0
- package/src/panels/JoinPanel/steps/ResetIdentity.tsx +71 -0
- package/src/panels/JoinPanel/steps/index.ts +12 -0
- package/src/panels/Panels.stories.tsx +61 -0
- package/src/panels/SpacePanel/SpacePanel.stories.tsx +328 -0
- package/src/panels/SpacePanel/SpacePanel.tsx +122 -0
- package/src/panels/SpacePanel/SpacePanelProps.ts +40 -0
- package/src/panels/SpacePanel/index.ts +6 -0
- package/src/panels/SpacePanel/spaceMachine.ts +72 -0
- package/src/panels/SpacePanel/steps/SpaceManager.tsx +157 -0
- package/src/panels/SpacePanel/steps/index.ts +5 -0
- package/src/panels/index.ts +7 -0
- package/src/playwright/invitations-manager.ts +168 -0
- package/src/playwright/invitations.spec.ts +364 -0
- package/src/playwright/playwright.config.ts +7 -0
- package/src/react.ts +9 -0
- package/src/steps/InvitationManager.tsx +116 -0
- package/src/steps/StepProps.ts +17 -0
- package/src/steps/index.ts +6 -0
- package/src/stories/Invitations.e2e-stories.tsx +231 -0
- package/src/styles/index.ts +6 -0
- package/src/styles/invitationStatusStyles.ts +42 -0
- package/src/styles/panelStyles.ts +5 -0
- package/src/testing/fixtures/identities.ts +16 -0
- package/src/testing/fixtures/index.ts +6 -0
- package/src/testing/fixtures/invitations.ts +23 -0
- package/src/testing/index.ts +7 -0
- package/src/testing/scoped-shell-manager.ts +79 -0
- package/src/testing/shell-manager.ts +102 -0
- package/src/translations/index.ts +7 -0
- package/src/translations/locales/en-US.ts +101 -0
- package/src/types/FailReason.ts +5 -0
- package/src/types/IInvitation.ts +14 -0
- package/src/types/index.ts +6 -0
- package/src/util/index.ts +6 -0
- package/src/util/invitationStatusValue.ts +22 -0
- package/src/util/toEmoji.ts +22 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
import { X } from '@phosphor-icons/react';
|
|
5
|
+
import React, { useCallback } from 'react';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
type CancellableInvitationObservable,
|
|
9
|
+
Invitation,
|
|
10
|
+
type InvitationStatus,
|
|
11
|
+
useInvitationStatus,
|
|
12
|
+
} from '@dxos/react-client/invitations';
|
|
13
|
+
import {
|
|
14
|
+
Button,
|
|
15
|
+
ListItem,
|
|
16
|
+
useTranslation,
|
|
17
|
+
Avatar,
|
|
18
|
+
useThemeContext,
|
|
19
|
+
type AvatarRootProps,
|
|
20
|
+
Tooltip,
|
|
21
|
+
} from '@dxos/react-ui';
|
|
22
|
+
import { focusRing, getSize, mx } from '@dxos/react-ui-theme';
|
|
23
|
+
|
|
24
|
+
import { type SharedInvitationListProps } from './InvitationListProps';
|
|
25
|
+
import { toEmoji } from '../../util';
|
|
26
|
+
import { AuthCode } from '../AuthCode';
|
|
27
|
+
import { CopyButtonIconOnly } from '../Clipboard';
|
|
28
|
+
|
|
29
|
+
export interface InvitationListItemProps extends SharedInvitationListProps {
|
|
30
|
+
invitation: CancellableInvitationObservable;
|
|
31
|
+
onClickRemove?: (invitation: CancellableInvitationObservable) => void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface InvitationListItemImplProps extends InvitationListItemProps {
|
|
35
|
+
invitationStatus: InvitationStatus;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const InvitationListItem = (props: InvitationListItemProps) => {
|
|
39
|
+
const { invitation } = props;
|
|
40
|
+
const invitationStatus = useInvitationStatus(invitation);
|
|
41
|
+
return <InvitationListItemImpl {...props} invitationStatus={invitationStatus} />;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const avatarProps: Pick<AvatarRootProps, 'size' | 'variant'> = { size: 10, variant: 'circle' };
|
|
45
|
+
|
|
46
|
+
const AvatarStackEffect = ({ animation, status }: Pick<AvatarRootProps, 'status' | 'animation'>) => {
|
|
47
|
+
const { tx } = useThemeContext();
|
|
48
|
+
return (
|
|
49
|
+
<>
|
|
50
|
+
<span
|
|
51
|
+
role='none'
|
|
52
|
+
className={mx('absolute inline-start-1 inline-end-auto opacity-20', getSize(avatarProps.size!))}
|
|
53
|
+
>
|
|
54
|
+
<span
|
|
55
|
+
role='none'
|
|
56
|
+
className={tx('avatar.ring', 'avatar__ring', { ...avatarProps, status, animation })}
|
|
57
|
+
style={{ animationDelay: '400ms' }}
|
|
58
|
+
/>
|
|
59
|
+
</span>
|
|
60
|
+
<span
|
|
61
|
+
role='none'
|
|
62
|
+
className={mx('absolute inline-start-2 inline-end-auto opacity-50', getSize(avatarProps.size!))}
|
|
63
|
+
>
|
|
64
|
+
<span
|
|
65
|
+
role='none'
|
|
66
|
+
className={tx('avatar.ring', 'avatar__ring', { ...avatarProps, status, animation })}
|
|
67
|
+
style={{ animationDelay: '200ms' }}
|
|
68
|
+
/>
|
|
69
|
+
</span>
|
|
70
|
+
</>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export const InvitationListItemImpl = ({
|
|
75
|
+
invitation,
|
|
76
|
+
invitationStatus: propsInvitationStatus,
|
|
77
|
+
send,
|
|
78
|
+
onClickRemove,
|
|
79
|
+
createInvitationUrl,
|
|
80
|
+
}: InvitationListItemImplProps) => {
|
|
81
|
+
const { t } = useTranslation('os');
|
|
82
|
+
const { cancel, status: invitationStatus, invitationCode, authCode, type } = propsInvitationStatus;
|
|
83
|
+
|
|
84
|
+
const isCancellable = !(
|
|
85
|
+
[Invitation.State.ERROR, Invitation.State.TIMEOUT, Invitation.State.CANCELLED].indexOf(invitationStatus) >= 0
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
const showShare =
|
|
89
|
+
type === Invitation.Type.MULTIUSE ||
|
|
90
|
+
[Invitation.State.INIT, Invitation.State.CONNECTING, Invitation.State.CONNECTED].indexOf(invitationStatus) >= 0;
|
|
91
|
+
|
|
92
|
+
const showAuthCode = invitationStatus === Invitation.State.READY_FOR_AUTHENTICATION;
|
|
93
|
+
|
|
94
|
+
const handleClickRemove = useCallback(() => onClickRemove?.(invitation), [invitation, onClickRemove]);
|
|
95
|
+
|
|
96
|
+
const invitationUrl = invitationCode && createInvitationUrl(invitationCode);
|
|
97
|
+
const invitationId = invitation?.get().invitationId;
|
|
98
|
+
|
|
99
|
+
const avatarAnimation = [
|
|
100
|
+
Invitation.State.INIT,
|
|
101
|
+
Invitation.State.CONNECTING,
|
|
102
|
+
Invitation.State.CONNECTED,
|
|
103
|
+
Invitation.State.READY_FOR_AUTHENTICATION,
|
|
104
|
+
Invitation.State.AUTHENTICATING,
|
|
105
|
+
].includes(invitationStatus)
|
|
106
|
+
? 'pulse'
|
|
107
|
+
: 'none';
|
|
108
|
+
|
|
109
|
+
const avatarError = [Invitation.State.ERROR, Invitation.State.TIMEOUT, Invitation.State.CANCELLED].includes(
|
|
110
|
+
invitationStatus,
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
const avatarGreen = [
|
|
114
|
+
Invitation.State.CONNECTED,
|
|
115
|
+
Invitation.State.READY_FOR_AUTHENTICATION,
|
|
116
|
+
Invitation.State.AUTHENTICATING,
|
|
117
|
+
Invitation.State.SUCCESS,
|
|
118
|
+
].includes(invitationStatus);
|
|
119
|
+
|
|
120
|
+
const avatarStatus = avatarError ? 'error' : avatarGreen ? 'active' : 'inactive';
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<ListItem.Root id={invitationCode} classNames='flex gap-2 pis-3 pie-1 items-center relative'>
|
|
124
|
+
<ListItem.Heading classNames='sr-only'>
|
|
125
|
+
{t(type === Invitation.Type.MULTIUSE ? 'invite many list item label' : 'invite one list item label')}
|
|
126
|
+
</ListItem.Heading>
|
|
127
|
+
{type === Invitation.Type.MULTIUSE && <AvatarStackEffect status={avatarStatus} animation={avatarAnimation} />}
|
|
128
|
+
<Tooltip.Root>
|
|
129
|
+
<Avatar.Root {...avatarProps} animation={avatarAnimation} status={avatarStatus}>
|
|
130
|
+
<Tooltip.Trigger asChild>
|
|
131
|
+
<Avatar.Frame tabIndex={0} classNames={[focusRing, 'relative rounded-full']}>
|
|
132
|
+
<Avatar.Fallback text={toEmoji(invitationId)} />
|
|
133
|
+
</Avatar.Frame>
|
|
134
|
+
</Tooltip.Trigger>
|
|
135
|
+
</Avatar.Root>
|
|
136
|
+
<Tooltip.Portal>
|
|
137
|
+
<Tooltip.Content side='left' classNames='z-[70]'>
|
|
138
|
+
{t(type === Invitation.Type.MULTIUSE ? 'invite many qr label' : 'invite one qr label')}
|
|
139
|
+
<Tooltip.Arrow />
|
|
140
|
+
</Tooltip.Content>
|
|
141
|
+
</Tooltip.Portal>
|
|
142
|
+
</Tooltip.Root>
|
|
143
|
+
{showShare && invitationUrl ? (
|
|
144
|
+
<>
|
|
145
|
+
<Button
|
|
146
|
+
variant='ghost'
|
|
147
|
+
classNames='grow justify-start font-medium'
|
|
148
|
+
onClick={() => send({ type: 'selectInvitation', invitation })}
|
|
149
|
+
data-testid='show-qrcode'
|
|
150
|
+
>
|
|
151
|
+
<span>{t('open share panel label')}</span>
|
|
152
|
+
</Button>
|
|
153
|
+
<CopyButtonIconOnly variant='ghost' value={invitationUrl} />
|
|
154
|
+
</>
|
|
155
|
+
) : showAuthCode ? (
|
|
156
|
+
<AuthCode code={authCode} classNames='grow' />
|
|
157
|
+
) : invitationStatus === Invitation.State.CONNECTING ? (
|
|
158
|
+
<span className='pli-2 grow text-neutral-500'>Connecting...</span>
|
|
159
|
+
) : invitationStatus === Invitation.State.AUTHENTICATING ? (
|
|
160
|
+
<span className='pli-2 grow text-neutral-500'>Authenticating...</span>
|
|
161
|
+
) : invitationStatus === Invitation.State.ERROR || invitationStatus === Invitation.State.TIMEOUT ? (
|
|
162
|
+
<span className='pli-2 grow text-neutral-500'>Failed</span>
|
|
163
|
+
) : invitationStatus === Invitation.State.CANCELLED ? (
|
|
164
|
+
<span className='pli-2 grow text-neutral-500'>Cancelled</span>
|
|
165
|
+
) : invitationStatus === Invitation.State.SUCCESS ? (
|
|
166
|
+
<span className='pli-2 grow truncate'>User joined</span>
|
|
167
|
+
) : (
|
|
168
|
+
<span className='grow'> </span>
|
|
169
|
+
)}
|
|
170
|
+
{isCancellable ? (
|
|
171
|
+
<Button variant='ghost' classNames='flex gap-1' onClick={cancel} data-testid='cancel-invitation'>
|
|
172
|
+
<span className='sr-only'>{t('cancel invitation label')}</span>
|
|
173
|
+
<X className={getSize(5)} weight='bold' />
|
|
174
|
+
</Button>
|
|
175
|
+
) : (
|
|
176
|
+
<Button variant='ghost' classNames='flex gap-1' onClick={handleClickRemove} data-testid='remove-invitation'>
|
|
177
|
+
<span className='sr-only'>{t('remove invitation label')}</span>
|
|
178
|
+
<X className={getSize(5)} weight='bold' />
|
|
179
|
+
</Button>
|
|
180
|
+
)}
|
|
181
|
+
</ListItem.Root>
|
|
182
|
+
);
|
|
183
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
import { type CancellableInvitationObservable } from '@dxos/react-client/invitations';
|
|
5
|
+
|
|
6
|
+
export interface SharedInvitationListProps {
|
|
7
|
+
createInvitationUrl: (invitationCode: string) => string;
|
|
8
|
+
send: (event: { type: 'selectInvitation'; invitation: CancellableInvitationObservable }) => void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { CaretDown, Check, type IconProps, Placeholder } from '@phosphor-icons/react';
|
|
6
|
+
import { useControllableState } from '@radix-ui/react-use-controllable-state';
|
|
7
|
+
import React, { type Dispatch, type FC, forwardRef, type SetStateAction } from 'react';
|
|
8
|
+
|
|
9
|
+
import { type ButtonProps, Button, type ComponentFragment, DropdownMenu, useTranslation } from '@dxos/react-ui';
|
|
10
|
+
import { descriptionText, getSize, mx } from '@dxos/react-ui-theme';
|
|
11
|
+
|
|
12
|
+
export type LargeButtonProps = ButtonProps & {
|
|
13
|
+
isFull?: boolean;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type ActionMenuItem = {
|
|
17
|
+
label: string;
|
|
18
|
+
description: string;
|
|
19
|
+
icon: FC<IconProps>;
|
|
20
|
+
} & Pick<ButtonProps, 'onClick'>;
|
|
21
|
+
|
|
22
|
+
export type BifurcatedActionProps = {
|
|
23
|
+
actions: Record<string, ActionMenuItem>;
|
|
24
|
+
activeAction?: string;
|
|
25
|
+
onChangeActiveAction?: Dispatch<SetStateAction<string>>;
|
|
26
|
+
defaultActiveAction?: string;
|
|
27
|
+
} & Omit<LargeButtonProps, 'children' | 'onClick'>;
|
|
28
|
+
|
|
29
|
+
const buttonColorFragment: ComponentFragment<LargeButtonProps> = (props: LargeButtonProps) => {
|
|
30
|
+
const resolvedVariant = props.variant ?? 'default';
|
|
31
|
+
return [
|
|
32
|
+
!props.disabled
|
|
33
|
+
? resolvedVariant === 'default'
|
|
34
|
+
? 'bg-neutral-25 hover:bg-white hover:text-primary-500 active:bg-neutral-25 dark:active:bg-neutral-800'
|
|
35
|
+
: resolvedVariant === 'ghost'
|
|
36
|
+
? 'active:bg-neutral-125 dark:active:bg-neutral-800'
|
|
37
|
+
: resolvedVariant === 'primary'
|
|
38
|
+
? 'active:bg-primary-700 dark:active:bg-primary-500'
|
|
39
|
+
: ''
|
|
40
|
+
: '',
|
|
41
|
+
];
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const defaultActions = {
|
|
45
|
+
noopAction: {
|
|
46
|
+
label: 'No-op',
|
|
47
|
+
description: '',
|
|
48
|
+
icon: Placeholder,
|
|
49
|
+
onClick: () => {},
|
|
50
|
+
},
|
|
51
|
+
} as Record<string, ActionMenuItem>;
|
|
52
|
+
|
|
53
|
+
export const BifurcatedAction = forwardRef<HTMLButtonElement, BifurcatedActionProps>((props, forwardedRef) => {
|
|
54
|
+
const {
|
|
55
|
+
classNames,
|
|
56
|
+
variant,
|
|
57
|
+
isFull = true,
|
|
58
|
+
actions = defaultActions,
|
|
59
|
+
activeAction: propsActiveAction,
|
|
60
|
+
onChangeActiveAction,
|
|
61
|
+
defaultActiveAction,
|
|
62
|
+
...rest
|
|
63
|
+
} = props;
|
|
64
|
+
|
|
65
|
+
const [activeActionKey = Object.keys(actions)[0], setActiveAction] = useControllableState({
|
|
66
|
+
prop: propsActiveAction,
|
|
67
|
+
onChange: onChangeActiveAction,
|
|
68
|
+
defaultProp: defaultActiveAction,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const activeAction = actions[activeActionKey as string] ?? {};
|
|
72
|
+
|
|
73
|
+
const { t } = useTranslation('os');
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<div role='none' className={mx('mbs-2 flex gap-px items-center', isFull && 'is-full')}>
|
|
77
|
+
<Button
|
|
78
|
+
{...rest}
|
|
79
|
+
classNames={['bs-11 flex-1 min-is-0 flex gap-2 rounded-ie-none', classNames, ...buttonColorFragment(props)]}
|
|
80
|
+
ref={forwardedRef}
|
|
81
|
+
variant={variant}
|
|
82
|
+
onClick={activeAction.onClick}
|
|
83
|
+
>
|
|
84
|
+
{activeAction.icon && <activeAction.icon />}
|
|
85
|
+
<span>{activeAction.label}</span>
|
|
86
|
+
</Button>
|
|
87
|
+
<DropdownMenu.Root>
|
|
88
|
+
<DropdownMenu.Trigger asChild>
|
|
89
|
+
<Button classNames={['bs-11 flex-none rounded-is-none', classNames, ...buttonColorFragment(props)]}>
|
|
90
|
+
<span className='sr-only'>{t('invite options label')}</span>
|
|
91
|
+
<CaretDown />
|
|
92
|
+
</Button>
|
|
93
|
+
</DropdownMenu.Trigger>
|
|
94
|
+
{/* TODO(thure): Putting `DropdownMenu.Portal` here breaks highlighting and focus. Why? */}
|
|
95
|
+
<DropdownMenu.Content>
|
|
96
|
+
<DropdownMenu.Viewport>
|
|
97
|
+
{Object.entries(actions).map(([id, action]) => {
|
|
98
|
+
return (
|
|
99
|
+
<DropdownMenu.CheckboxItem
|
|
100
|
+
key={id}
|
|
101
|
+
aria-labelledby={`${id}__label`}
|
|
102
|
+
aria-describedby={`${id}__description`}
|
|
103
|
+
checked={activeActionKey === id}
|
|
104
|
+
onCheckedChange={(checked) => checked && setActiveAction(id)}
|
|
105
|
+
classNames='gap-2'
|
|
106
|
+
>
|
|
107
|
+
{action.icon && <action.icon className={getSize(5)} />}
|
|
108
|
+
<div role='none' className='flex-1 min-is-0 space-b-1'>
|
|
109
|
+
<p id={`${id}__label`}>{action.label}</p>
|
|
110
|
+
{action.description && (
|
|
111
|
+
<p id={`${id}__description`} className={descriptionText}>
|
|
112
|
+
{action.description}
|
|
113
|
+
</p>
|
|
114
|
+
)}
|
|
115
|
+
</div>
|
|
116
|
+
<DropdownMenu.ItemIndicator asChild>
|
|
117
|
+
<Check />
|
|
118
|
+
</DropdownMenu.ItemIndicator>
|
|
119
|
+
</DropdownMenu.CheckboxItem>
|
|
120
|
+
);
|
|
121
|
+
})}
|
|
122
|
+
</DropdownMenu.Viewport>
|
|
123
|
+
<DropdownMenu.Arrow />
|
|
124
|
+
</DropdownMenu.Content>
|
|
125
|
+
</DropdownMenu.Root>
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
export const Action = forwardRef<HTMLButtonElement, LargeButtonProps>((props, forwardedRef) => {
|
|
131
|
+
const { children, classNames, variant, isFull = true, ...rest } = props;
|
|
132
|
+
return (
|
|
133
|
+
<Button
|
|
134
|
+
{...rest}
|
|
135
|
+
classNames={[isFull && 'is-full', 'bs-11 flex gap-2 mbs-2', classNames, ...buttonColorFragment(props)]}
|
|
136
|
+
ref={forwardedRef}
|
|
137
|
+
variant={variant}
|
|
138
|
+
>
|
|
139
|
+
{children}
|
|
140
|
+
</Button>
|
|
141
|
+
);
|
|
142
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type ComponentPropsWithoutRef, forwardRef, type ReactNode } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type ThemedClassName } from '@dxos/react-ui';
|
|
8
|
+
import { mx } from '@dxos/react-ui-theme';
|
|
9
|
+
|
|
10
|
+
type ActionsProps = Omit<ThemedClassName<ComponentPropsWithoutRef<'div'>>, 'children'> & {
|
|
11
|
+
children: ReactNode | ReactNode[];
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const Actions = forwardRef<HTMLDivElement, ActionsProps>(({ classNames, children, ...props }, forwardedRef) => {
|
|
15
|
+
return (
|
|
16
|
+
<div
|
|
17
|
+
{...props}
|
|
18
|
+
className={mx(
|
|
19
|
+
'flex flex-col gap-2 mbs-2',
|
|
20
|
+
Array.isArray(children) && children.length > 1 ? 'justify-between' : 'justify-center',
|
|
21
|
+
classNames,
|
|
22
|
+
)}
|
|
23
|
+
ref={forwardedRef}
|
|
24
|
+
>
|
|
25
|
+
{children}
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export { Actions };
|
|
31
|
+
export type { ActionsProps };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { X } from '@phosphor-icons/react';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Button, type ButtonProps, useTranslation } from '@dxos/react-ui';
|
|
9
|
+
import { getSize, mx } from '@dxos/react-ui-theme';
|
|
10
|
+
|
|
11
|
+
export const CloseButton = ({ onDone, ...props }: Omit<ButtonProps, 'onClick'> & { onDone?: () => void }) => {
|
|
12
|
+
const { t } = useTranslation('os');
|
|
13
|
+
return (
|
|
14
|
+
<Button
|
|
15
|
+
variant='ghost'
|
|
16
|
+
classNames={mx('plb-0 pli-2 absolute block-start-0 inline-end-0 z-[1]')}
|
|
17
|
+
onClick={() => onDone?.()}
|
|
18
|
+
{...props}
|
|
19
|
+
>
|
|
20
|
+
<X weight='bold' className={getSize(4)} />
|
|
21
|
+
<span className='sr-only'>{t('exit label')}</span>
|
|
22
|
+
</Button>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type PropsWithChildren } from 'react';
|
|
6
|
+
|
|
7
|
+
import { mx, getSize } from '@dxos/react-ui-theme';
|
|
8
|
+
|
|
9
|
+
export const Emoji = ({ text, className }: { text?: string; className?: string }) => {
|
|
10
|
+
const size = 14;
|
|
11
|
+
return (
|
|
12
|
+
<div role='none' className={mx(getSize(size), 'rounded relative pointer-events-none', className)}>
|
|
13
|
+
<svg viewBox={`0 0 ${size * 4} ${size * 4}`} width={size * 4} height={size * 4}>
|
|
14
|
+
<text
|
|
15
|
+
x='50%'
|
|
16
|
+
y='50%'
|
|
17
|
+
textAnchor='middle'
|
|
18
|
+
dominantBaseline='middle'
|
|
19
|
+
baselineShift={'-0.25rem'}
|
|
20
|
+
fontSize={'2.25rem'}
|
|
21
|
+
>
|
|
22
|
+
{text}
|
|
23
|
+
</text>
|
|
24
|
+
</svg>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const Centered = (props: PropsWithChildren) => {
|
|
30
|
+
const { children } = props;
|
|
31
|
+
return (
|
|
32
|
+
<div role='none' className='absolute inset-0 flex items-center justify-center'>
|
|
33
|
+
{children}
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { forwardRef, type PropsWithChildren, type ReactNode } from 'react';
|
|
6
|
+
|
|
7
|
+
import { descriptionText, mx } from '@dxos/react-ui-theme';
|
|
8
|
+
|
|
9
|
+
export type PanelHeadingProps = PropsWithChildren<{
|
|
10
|
+
titleId: string;
|
|
11
|
+
title: string;
|
|
12
|
+
titleSrOnly?: boolean;
|
|
13
|
+
corner?: ReactNode;
|
|
14
|
+
}>;
|
|
15
|
+
|
|
16
|
+
export const Heading = forwardRef<HTMLDivElement, PanelHeadingProps>(
|
|
17
|
+
({ titleId, title, titleSrOnly, children, corner }, forwardedRef) => {
|
|
18
|
+
return (
|
|
19
|
+
<div role='none' className='pbe-2 relative' ref={forwardedRef}>
|
|
20
|
+
{corner}
|
|
21
|
+
<h1
|
|
22
|
+
{...(!titleSrOnly && { id: titleId })}
|
|
23
|
+
className={mx(descriptionText, 'text-center mlb-2', titleSrOnly && 'invisible')}
|
|
24
|
+
>
|
|
25
|
+
{title}
|
|
26
|
+
</h1>
|
|
27
|
+
{titleSrOnly && <span id={titleId}>{title}</span>}
|
|
28
|
+
{children}
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
},
|
|
32
|
+
);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type ReactNode } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Input as UiInput, type TextInputProps } from '@dxos/react-ui';
|
|
8
|
+
|
|
9
|
+
export type LargeInputProps = TextInputProps & {
|
|
10
|
+
validationMessage?: string;
|
|
11
|
+
label?: ReactNode;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const Input = ({ validationMessage, label, ...props }: LargeInputProps) => {
|
|
18
|
+
return (
|
|
19
|
+
<UiInput.Root>
|
|
20
|
+
<UiInput.Label>{label}</UiInput.Label>
|
|
21
|
+
<UiInput.TextInput {...props} classNames='plb-3 mbs-2 text-center' />
|
|
22
|
+
<UiInput.DescriptionAndValidation>
|
|
23
|
+
{validationMessage && <UiInput.Validation>{validationMessage}</UiInput.Validation>}
|
|
24
|
+
</UiInput.DescriptionAndValidation>
|
|
25
|
+
</UiInput.Root>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type PropsWithChildren } from 'react';
|
|
6
|
+
|
|
7
|
+
import { descriptionText, mx } from '@dxos/react-ui-theme';
|
|
8
|
+
|
|
9
|
+
export type LabelProps = PropsWithChildren<{}>;
|
|
10
|
+
|
|
11
|
+
export const Label = (props: LabelProps) => {
|
|
12
|
+
const { children } = props;
|
|
13
|
+
return <span className={mx(descriptionText, 'text-center mli-6 whitespace-normal')}>{children}</span>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxosTheme';
|
|
6
|
+
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
import { withTheme } from '@dxos/storybook-utils';
|
|
10
|
+
|
|
11
|
+
import { Action } from './Action';
|
|
12
|
+
import { Actions } from './Actions';
|
|
13
|
+
import { Heading } from './Heading';
|
|
14
|
+
import { Label } from './Label';
|
|
15
|
+
import { StorybookDialog } from '../StorybookDialog';
|
|
16
|
+
|
|
17
|
+
export default {
|
|
18
|
+
title: 'react-shell/StorybookDialog',
|
|
19
|
+
component: StorybookDialog,
|
|
20
|
+
actions: { argTypesRegex: '^on.*' },
|
|
21
|
+
decorators: [withTheme],
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const Normal = (props: any) => {
|
|
25
|
+
return (
|
|
26
|
+
<StorybookDialog {...props}>
|
|
27
|
+
<Heading title='Panel heading' titleId='panel-heading'></Heading>
|
|
28
|
+
<div className='p-3 text-center'>
|
|
29
|
+
<Label>Lorem ipsum</Label>
|
|
30
|
+
<Actions>
|
|
31
|
+
<Action variant='ghost'>Ghost</Action>
|
|
32
|
+
<Action>Normal</Action>
|
|
33
|
+
</Actions>
|
|
34
|
+
</div>
|
|
35
|
+
</StorybookDialog>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const Primary = (props: any) => {
|
|
40
|
+
return (
|
|
41
|
+
<StorybookDialog {...props}>
|
|
42
|
+
<Heading title='Panel heading' titleId='panel-heading'></Heading>
|
|
43
|
+
<div className='p-3 text-center'>
|
|
44
|
+
<Label>Lorem ipsum</Label>
|
|
45
|
+
<Actions>
|
|
46
|
+
<Action variant='ghost'>Ghost</Action>
|
|
47
|
+
<Action variant='primary'>Primary</Action>
|
|
48
|
+
</Actions>
|
|
49
|
+
</div>
|
|
50
|
+
</StorybookDialog>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type ComponentPropsWithRef, forwardRef } from 'react';
|
|
6
|
+
|
|
7
|
+
import { mx } from '@dxos/react-ui-theme';
|
|
8
|
+
|
|
9
|
+
export const StepHeading = forwardRef<HTMLHeadingElement, ComponentPropsWithRef<'h2'>>(
|
|
10
|
+
({ children, className, ...props }, forwardedRef) => {
|
|
11
|
+
return (
|
|
12
|
+
<h2 {...props} className={mx('font-normal text-sm mbe-4 mli-1 text-center', className)} ref={forwardedRef}>
|
|
13
|
+
{children}
|
|
14
|
+
</h2>
|
|
15
|
+
);
|
|
16
|
+
},
|
|
17
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
export * from './Action';
|
|
6
|
+
export * from './Actions';
|
|
7
|
+
export * from './CloseButton';
|
|
8
|
+
export * from './Emoji';
|
|
9
|
+
export * from './Heading';
|
|
10
|
+
export * from './Label';
|
|
11
|
+
export * from './Input';
|
|
12
|
+
export * from './StepHeading';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type ForwardedRef, forwardRef } from 'react';
|
|
6
|
+
|
|
7
|
+
import type { Space } from '@dxos/react-client/echo';
|
|
8
|
+
import { Avatar, useId, useJdenticonHref } from '@dxos/react-ui';
|
|
9
|
+
import { mx } from '@dxos/react-ui-theme';
|
|
10
|
+
import { humanize } from '@dxos/util';
|
|
11
|
+
|
|
12
|
+
export const SpaceListItem = forwardRef(
|
|
13
|
+
({ space, onClick }: { space: Space; onClick?: () => void }, ref: ForwardedRef<HTMLLIElement>) => {
|
|
14
|
+
const fallbackValue = space.key.toHex();
|
|
15
|
+
const labelId = useId('identityListItem__label');
|
|
16
|
+
const jdenticon = useJdenticonHref(fallbackValue ?? '', 12);
|
|
17
|
+
const displayName = space.properties.name ?? humanize(space.key.toHex());
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<li
|
|
21
|
+
className={mx('flex gap-2 items-center mbe-2', onClick && 'cursor-pointer')}
|
|
22
|
+
onClick={() => onClick?.()}
|
|
23
|
+
ref={ref}
|
|
24
|
+
data-testid='space-list-item'
|
|
25
|
+
>
|
|
26
|
+
<Avatar.Root labelId={labelId}>
|
|
27
|
+
<Avatar.Frame>
|
|
28
|
+
<Avatar.Fallback href={jdenticon} />
|
|
29
|
+
</Avatar.Frame>
|
|
30
|
+
<Avatar.Label classNames='text-sm truncate'>{displayName}</Avatar.Label>
|
|
31
|
+
</Avatar.Root>
|
|
32
|
+
</li>
|
|
33
|
+
);
|
|
34
|
+
},
|
|
35
|
+
);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type PropsWithChildren } from 'react';
|
|
6
|
+
|
|
7
|
+
import { ElevationProvider, Tooltip, useThemeContext } from '@dxos/react-ui';
|
|
8
|
+
|
|
9
|
+
import { ClipboardProvider } from './Clipboard';
|
|
10
|
+
|
|
11
|
+
export type StorybookDialogProps = PropsWithChildren & {
|
|
12
|
+
inOverlayLayout?: boolean;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
// TODO(burdon): Move out of components.
|
|
16
|
+
export const StorybookDialog = (props: StorybookDialogProps) => {
|
|
17
|
+
const { inOverlayLayout = false } = props;
|
|
18
|
+
const { tx } = useThemeContext();
|
|
19
|
+
return (
|
|
20
|
+
<Tooltip.Provider>
|
|
21
|
+
<ElevationProvider elevation='chrome'>
|
|
22
|
+
<ClipboardProvider>
|
|
23
|
+
<div
|
|
24
|
+
role='group'
|
|
25
|
+
className={tx('dialog.content', 'dialog', { inOverlayLayout }, 'p-1', inOverlayLayout ? 'm-4' : '')}
|
|
26
|
+
>
|
|
27
|
+
{props.children}
|
|
28
|
+
</div>
|
|
29
|
+
</ClipboardProvider>
|
|
30
|
+
</ElevationProvider>
|
|
31
|
+
</Tooltip.Provider>
|
|
32
|
+
);
|
|
33
|
+
};
|