@dxos/react-ui 0.1.20 → 0.1.22
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/README.md +13 -137
- package/dist/lib/browser/index.mjs +160 -2022
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/components/IdentityListItem/IdentityListItem.d.ts +6 -0
- package/dist/types/src/components/IdentityListItem/IdentityListItem.d.ts.map +1 -0
- package/dist/types/src/components/IdentityListItem/IdentityListItem.stories.d.ts +20 -0
- package/dist/types/src/components/IdentityListItem/IdentityListItem.stories.d.ts.map +1 -0
- package/dist/types/src/composites/IdentityPopover/IdentityPopover.d.ts +9 -0
- package/dist/types/src/composites/IdentityPopover/IdentityPopover.d.ts.map +1 -0
- package/dist/types/src/composites/IdentityPopover/index.d.ts +2 -0
- package/dist/types/src/composites/IdentityPopover/index.d.ts.map +1 -0
- package/dist/types/src/composites/index.d.ts +2 -0
- package/dist/types/src/composites/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +4 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/layouts/PanelPopover/PanelPopover.d.ts +11 -0
- package/dist/types/src/layouts/PanelPopover/PanelPopover.d.ts.map +1 -0
- package/dist/types/src/layouts/PanelPopover/index.d.ts +2 -0
- package/dist/types/src/layouts/PanelPopover/index.d.ts.map +1 -0
- package/dist/types/src/layouts/PanelSidebar/PanelSidebar.d.ts +20 -0
- package/dist/types/src/layouts/PanelSidebar/PanelSidebar.d.ts.map +1 -0
- package/dist/types/src/layouts/PanelSidebar/index.d.ts +2 -0
- package/dist/types/src/layouts/PanelSidebar/index.d.ts.map +1 -0
- package/dist/types/src/layouts/index.d.ts +3 -0
- package/dist/types/src/layouts/index.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts +6 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/index.d.ts +2 -0
- package/dist/types/src/panels/IdentityPanel/index.d.ts.map +1 -0
- package/dist/types/src/panels/index.d.ts +2 -0
- package/dist/types/src/panels/index.d.ts.map +1 -0
- package/dist/types/src/styles/index.d.ts +1 -11
- package/dist/types/src/styles/index.d.ts.map +1 -1
- package/dist/types/src/styles/panelStyles.d.ts +3 -0
- package/dist/types/src/styles/panelStyles.d.ts.map +1 -0
- package/dist/types/src/testing/ClientProvider.d.ts +3 -0
- package/dist/types/src/testing/ClientProvider.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +1 -1
- package/dist/types/src/testing/index.d.ts.map +1 -1
- 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/locales/en-US.d.ts +6 -0
- package/dist/types/src/translations/locales/en-US.d.ts.map +1 -0
- package/package.json +16 -32
- package/src/components/IdentityListItem/IdentityListItem.stories.tsx +23 -0
- package/src/components/IdentityListItem/IdentityListItem.tsx +32 -0
- package/src/composites/IdentityPopover/IdentityPopover.tsx +54 -0
- package/src/composites/IdentityPopover/index.ts +5 -0
- package/src/composites/index.ts +4 -0
- package/src/index.ts +4 -4
- package/src/layouts/PanelPopover/PanelPopover.tsx +40 -0
- package/src/layouts/PanelPopover/index.ts +5 -0
- package/src/layouts/PanelSidebar/PanelSidebar.tsx +126 -0
- package/src/layouts/PanelSidebar/index.ts +5 -0
- package/src/layouts/index.ts +6 -0
- package/src/panels/IdentityPanel/IdentityPanel.tsx +39 -0
- package/src/panels/IdentityPanel/index.ts +5 -0
- package/src/panels/index.ts +5 -0
- package/src/styles/index.ts +2 -12
- package/src/styles/panelStyles.ts +6 -0
- package/src/testing/ClientProvider.tsx +18 -0
- package/src/testing/index.ts +1 -1
- package/src/translations/index.ts +7 -0
- package/src/translations/locales/en-US.ts +9 -0
- package/dist/plugin/node/esbuild-plugin.cjs +0 -469
- package/dist/plugin/node/esbuild-plugin.cjs.map +0 -7
- package/dist/plugin/node/meta.json +0 -1
- package/dist/plugin/node/plugin.cjs +0 -460
- package/dist/plugin/node/plugin.cjs.map +0 -7
- package/dist/plugin/node/theme.css +0 -61
- package/dist/plugin/node/theme.css.map +0 -7
- package/dist/types/src/components/Alert/Alert.d.ts +0 -15
- package/dist/types/src/components/Alert/Alert.d.ts.map +0 -1
- package/dist/types/src/components/Alert/Alert.stories.d.ts +0 -9
- package/dist/types/src/components/Alert/Alert.stories.d.ts.map +0 -1
- package/dist/types/src/components/Alert/index.d.ts +0 -2
- package/dist/types/src/components/Alert/index.d.ts.map +0 -1
- package/dist/types/src/components/AlertDialog/AlertDialog.d.ts +0 -26
- package/dist/types/src/components/AlertDialog/AlertDialog.d.ts.map +0 -1
- package/dist/types/src/components/AlertDialog/AlertDialog.stories.d.ts +0 -9
- package/dist/types/src/components/AlertDialog/AlertDialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/AlertDialog/index.d.ts +0 -2
- package/dist/types/src/components/AlertDialog/index.d.ts.map +0 -1
- package/dist/types/src/components/Avatar/Avatar.d.ts +0 -22
- package/dist/types/src/components/Avatar/Avatar.d.ts.map +0 -1
- package/dist/types/src/components/Avatar/Avatar.stories.d.ts +0 -12
- package/dist/types/src/components/Avatar/Avatar.stories.d.ts.map +0 -1
- package/dist/types/src/components/Avatar/index.d.ts +0 -2
- package/dist/types/src/components/Avatar/index.d.ts.map +0 -1
- package/dist/types/src/components/Button/Button.d.ts +0 -4
- package/dist/types/src/components/Button/Button.d.ts.map +0 -1
- package/dist/types/src/components/Button/Button.stories.d.ts +0 -13
- package/dist/types/src/components/Button/Button.stories.d.ts.map +0 -1
- package/dist/types/src/components/Button/ButtonGroup.d.ts +0 -6
- package/dist/types/src/components/Button/ButtonGroup.d.ts.map +0 -1
- package/dist/types/src/components/Button/ButtonProps.d.ts +0 -7
- package/dist/types/src/components/Button/ButtonProps.d.ts.map +0 -1
- package/dist/types/src/components/Button/buttonStyles.d.ts +0 -6
- package/dist/types/src/components/Button/buttonStyles.d.ts.map +0 -1
- package/dist/types/src/components/Button/index.d.ts +0 -5
- package/dist/types/src/components/Button/index.d.ts.map +0 -1
- package/dist/types/src/components/CompoundButton/CompoundButton.d.ts +0 -10
- package/dist/types/src/components/CompoundButton/CompoundButton.d.ts.map +0 -1
- package/dist/types/src/components/CompoundButton/CompoundButton.stories.d.ts +0 -10
- package/dist/types/src/components/CompoundButton/CompoundButton.stories.d.ts.map +0 -1
- package/dist/types/src/components/CompoundButton/index.d.ts +0 -2
- package/dist/types/src/components/CompoundButton/index.d.ts.map +0 -1
- package/dist/types/src/components/Dialog/Dialog.d.ts +0 -26
- package/dist/types/src/components/Dialog/Dialog.d.ts.map +0 -1
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts +0 -9
- package/dist/types/src/components/Dialog/Dialog.stories.d.ts.map +0 -1
- package/dist/types/src/components/Dialog/index.d.ts +0 -2
- package/dist/types/src/components/Dialog/index.d.ts.map +0 -1
- package/dist/types/src/components/Group/Group.d.ts +0 -10
- package/dist/types/src/components/Group/Group.d.ts.map +0 -1
- package/dist/types/src/components/Group/Group.stories.d.ts +0 -9
- package/dist/types/src/components/Group/Group.stories.d.ts.map +0 -1
- package/dist/types/src/components/Group/index.d.ts +0 -2
- package/dist/types/src/components/Group/index.d.ts.map +0 -1
- package/dist/types/src/components/Heading/Heading.d.ts +0 -266
- package/dist/types/src/components/Heading/Heading.d.ts.map +0 -1
- package/dist/types/src/components/Heading/Heading.stories.d.ts +0 -274
- package/dist/types/src/components/Heading/Heading.stories.d.ts.map +0 -1
- package/dist/types/src/components/Heading/index.d.ts +0 -2
- package/dist/types/src/components/Heading/index.d.ts.map +0 -1
- package/dist/types/src/components/Input/BarePinInput.d.ts +0 -314
- package/dist/types/src/components/Input/BarePinInput.d.ts.map +0 -1
- package/dist/types/src/components/Input/BareTextInput.d.ts +0 -7
- package/dist/types/src/components/Input/BareTextInput.d.ts.map +0 -1
- package/dist/types/src/components/Input/BareTextareaInput.d.ts +0 -7
- package/dist/types/src/components/Input/BareTextareaInput.d.ts.map +0 -1
- package/dist/types/src/components/Input/Input.d.ts +0 -4
- package/dist/types/src/components/Input/Input.d.ts.map +0 -1
- package/dist/types/src/components/Input/Input.stories.d.ts +0 -27
- package/dist/types/src/components/Input/Input.stories.d.ts.map +0 -1
- package/dist/types/src/components/Input/InputProps.d.ts +0 -37
- package/dist/types/src/components/Input/InputProps.d.ts.map +0 -1
- package/dist/types/src/components/Input/index.d.ts +0 -2
- package/dist/types/src/components/Input/index.d.ts.map +0 -1
- package/dist/types/src/components/Loading/Loading.d.ts +0 -15
- package/dist/types/src/components/Loading/Loading.d.ts.map +0 -1
- package/dist/types/src/components/Loading/Loading.stories.d.ts +0 -23
- package/dist/types/src/components/Loading/Loading.stories.d.ts.map +0 -1
- package/dist/types/src/components/Loading/index.d.ts +0 -2
- package/dist/types/src/components/Loading/index.d.ts.map +0 -1
- package/dist/types/src/components/NavMenu/NavMenu.d.ts +0 -39
- package/dist/types/src/components/NavMenu/NavMenu.d.ts.map +0 -1
- package/dist/types/src/components/NavMenu/NavMenu.stories.d.ts +0 -9
- package/dist/types/src/components/NavMenu/NavMenu.stories.d.ts.map +0 -1
- package/dist/types/src/components/NavMenu/index.d.ts +0 -2
- package/dist/types/src/components/NavMenu/index.d.ts.map +0 -1
- package/dist/types/src/components/Popover/Popover.d.ts +0 -21
- package/dist/types/src/components/Popover/Popover.d.ts.map +0 -1
- package/dist/types/src/components/Popover/Popover.stories.d.ts +0 -10
- package/dist/types/src/components/Popover/Popover.stories.d.ts.map +0 -1
- package/dist/types/src/components/Popover/index.d.ts +0 -2
- package/dist/types/src/components/Popover/index.d.ts.map +0 -1
- package/dist/types/src/components/QrCode/QrCode.d.ts +0 -39
- package/dist/types/src/components/QrCode/QrCode.d.ts.map +0 -1
- package/dist/types/src/components/QrCode/QrCode.stories.d.ts +0 -10
- package/dist/types/src/components/QrCode/QrCode.stories.d.ts.map +0 -1
- package/dist/types/src/components/QrCode/index.d.ts +0 -2
- package/dist/types/src/components/QrCode/index.d.ts.map +0 -1
- package/dist/types/src/components/Tag/Tag.d.ts +0 -8
- package/dist/types/src/components/Tag/Tag.d.ts.map +0 -1
- package/dist/types/src/components/Tag/Tag.stories.d.ts +0 -10
- package/dist/types/src/components/Tag/Tag.stories.d.ts.map +0 -1
- package/dist/types/src/components/Tag/index.d.ts +0 -2
- package/dist/types/src/components/Tag/index.d.ts.map +0 -1
- package/dist/types/src/components/Toast/Toast.d.ts +0 -25
- package/dist/types/src/components/Toast/Toast.d.ts.map +0 -1
- package/dist/types/src/components/Toast/Toast.stories.d.ts +0 -9
- package/dist/types/src/components/Toast/Toast.stories.d.ts.map +0 -1
- package/dist/types/src/components/Toast/index.d.ts +0 -2
- package/dist/types/src/components/Toast/index.d.ts.map +0 -1
- package/dist/types/src/components/Tooltip/Tooltip.d.ts +0 -19
- package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +0 -1
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts +0 -9
- package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +0 -1
- package/dist/types/src/components/Tooltip/index.d.ts +0 -2
- package/dist/types/src/components/Tooltip/index.d.ts.map +0 -1
- package/dist/types/src/components/UiProvider/UiProvider.d.ts +0 -10
- package/dist/types/src/components/UiProvider/UiProvider.d.ts.map +0 -1
- package/dist/types/src/components/UiProvider/index.d.ts +0 -2
- package/dist/types/src/components/UiProvider/index.d.ts.map +0 -1
- package/dist/types/src/components/index.d.ts +0 -18
- package/dist/types/src/components/index.d.ts.map +0 -1
- package/dist/types/src/config/index.d.ts +0 -2
- package/dist/types/src/config/index.d.ts.map +0 -1
- package/dist/types/src/config/tailwind.d.ts +0 -7
- package/dist/types/src/config/tailwind.d.ts.map +0 -1
- package/dist/types/src/esbuild-plugin.d.ts +0 -6
- package/dist/types/src/esbuild-plugin.d.ts.map +0 -1
- package/dist/types/src/hooks/index.d.ts +0 -4
- package/dist/types/src/hooks/index.d.ts.map +0 -1
- package/dist/types/src/hooks/useForwardedRef.d.ts +0 -2
- package/dist/types/src/hooks/useForwardedRef.d.ts.map +0 -1
- package/dist/types/src/hooks/useId.d.ts +0 -3
- package/dist/types/src/hooks/useId.d.ts.map +0 -1
- package/dist/types/src/hooks/useIsFocused.d.ts +0 -3
- package/dist/types/src/hooks/useIsFocused.d.ts.map +0 -1
- package/dist/types/src/plugin.d.ts +0 -9
- package/dist/types/src/plugin.d.ts.map +0 -1
- package/dist/types/src/props/Elevation.d.ts +0 -2
- package/dist/types/src/props/Elevation.d.ts.map +0 -1
- package/dist/types/src/props/MessageValence.d.ts +0 -2
- package/dist/types/src/props/MessageValence.d.ts.map +0 -1
- package/dist/types/src/props/Size.d.ts +0 -2
- package/dist/types/src/props/Size.d.ts.map +0 -1
- package/dist/types/src/props/index.d.ts +0 -4
- package/dist/types/src/props/index.d.ts.map +0 -1
- package/dist/types/src/styles/active.d.ts +0 -2
- package/dist/types/src/styles/active.d.ts.map +0 -1
- package/dist/types/src/styles/disabled.d.ts +0 -2
- package/dist/types/src/styles/disabled.d.ts.map +0 -1
- package/dist/types/src/styles/focus.d.ts +0 -3
- package/dist/types/src/styles/focus.d.ts.map +0 -1
- package/dist/types/src/styles/group.d.ts +0 -7
- package/dist/types/src/styles/group.d.ts.map +0 -1
- package/dist/types/src/styles/hover.d.ts +0 -4
- package/dist/types/src/styles/hover.d.ts.map +0 -1
- package/dist/types/src/styles/input.d.ts +0 -11
- package/dist/types/src/styles/input.d.ts.map +0 -1
- package/dist/types/src/styles/ornament.d.ts +0 -3
- package/dist/types/src/styles/ornament.d.ts.map +0 -1
- package/dist/types/src/styles/shimmer.d.ts +0 -3
- package/dist/types/src/styles/shimmer.d.ts.map +0 -1
- package/dist/types/src/styles/size.d.ts +0 -7
- package/dist/types/src/styles/size.d.ts.map +0 -1
- package/dist/types/src/styles/text.d.ts +0 -5
- package/dist/types/src/styles/text.d.ts.map +0 -1
- package/dist/types/src/styles/valence.d.ts +0 -19
- package/dist/types/src/styles/valence.d.ts.map +0 -1
- package/dist/types/src/testing/templateForComponent.d.ts +0 -4
- package/dist/types/src/testing/templateForComponent.d.ts.map +0 -1
- package/dist/types/src/util/index.d.ts +0 -2
- package/dist/types/src/util/index.d.ts.map +0 -1
- package/dist/types/src/util/mx.d.ts +0 -2
- package/dist/types/src/util/mx.d.ts.map +0 -1
- package/dist/types/src/util/withLogical.d.ts +0 -3
- package/dist/types/src/util/withLogical.d.ts.map +0 -1
- package/plugin.d.ts +0 -5
- package/plugin.js +0 -8
- package/src/components/Alert/Alert.stories.tsx +0 -31
- package/src/components/Alert/Alert.tsx +0 -40
- package/src/components/Alert/index.ts +0 -5
- package/src/components/AlertDialog/AlertDialog.stories.tsx +0 -35
- package/src/components/AlertDialog/AlertDialog.tsx +0 -147
- package/src/components/AlertDialog/index.ts +0 -5
- package/src/components/Avatar/Avatar.stories.tsx +0 -29
- package/src/components/Avatar/Avatar.tsx +0 -104
- package/src/components/Avatar/index.ts +0 -5
- package/src/components/Button/Button.stories.tsx +0 -45
- package/src/components/Button/Button.tsx +0 -20
- package/src/components/Button/ButtonGroup.tsx +0 -23
- package/src/components/Button/ButtonProps.ts +0 -11
- package/src/components/Button/buttonStyles.ts +0 -35
- package/src/components/Button/index.ts +0 -8
- package/src/components/CompoundButton/CompoundButton.stories.tsx +0 -46
- package/src/components/CompoundButton/CompoundButton.tsx +0 -53
- package/src/components/CompoundButton/index.ts +0 -5
- package/src/components/Dialog/Dialog.stories.tsx +0 -37
- package/src/components/Dialog/Dialog.tsx +0 -157
- package/src/components/Dialog/index.ts +0 -5
- package/src/components/Group/Group.stories.tsx +0 -25
- package/src/components/Group/Group.tsx +0 -32
- package/src/components/Group/index.ts +0 -5
- package/src/components/Heading/Heading.stories.tsx +0 -29
- package/src/components/Heading/Heading.tsx +0 -29
- package/src/components/Heading/index.ts +0 -5
- package/src/components/Input/BarePinInput.tsx +0 -67
- package/src/components/Input/BareTextInput.tsx +0 -48
- package/src/components/Input/BareTextareaInput.tsx +0 -39
- package/src/components/Input/Input.stories.tsx +0 -108
- package/src/components/Input/Input.tsx +0 -115
- package/src/components/Input/InputProps.ts +0 -47
- package/src/components/Input/index.ts +0 -5
- package/src/components/Loading/Loading.stories.tsx +0 -34
- package/src/components/Loading/Loading.tsx +0 -69
- package/src/components/Loading/index.ts +0 -5
- package/src/components/NavMenu/NavMenu.stories.tsx +0 -54
- package/src/components/NavMenu/NavMenu.tsx +0 -203
- package/src/components/NavMenu/index.ts +0 -5
- package/src/components/Popover/Popover.stories.tsx +0 -49
- package/src/components/Popover/Popover.tsx +0 -110
- package/src/components/Popover/index.ts +0 -5
- package/src/components/QrCode/QrCode.stories.tsx +0 -42
- package/src/components/QrCode/QrCode.tsx +0 -165
- package/src/components/QrCode/index.ts +0 -5
- package/src/components/Tag/Tag.stories.tsx +0 -23
- package/src/components/Tag/Tag.tsx +0 -32
- package/src/components/Tag/index.ts +0 -5
- package/src/components/Toast/Toast.stories.tsx +0 -31
- package/src/components/Toast/Toast.tsx +0 -106
- package/src/components/Toast/index.ts +0 -5
- package/src/components/Tooltip/Tooltip.stories.tsx +0 -28
- package/src/components/Tooltip/Tooltip.tsx +0 -88
- package/src/components/Tooltip/index.ts +0 -5
- package/src/components/UiProvider/UiProvider.tsx +0 -44
- package/src/components/UiProvider/index.ts +0 -5
- package/src/components/index.ts +0 -21
- package/src/config/index.ts +0 -5
- package/src/config/tailwind.ts +0 -250
- package/src/esbuild-plugin.ts +0 -42
- package/src/hooks/index.ts +0 -7
- package/src/hooks/useForwardedRef.ts +0 -22
- package/src/hooks/useId.ts +0 -21
- package/src/hooks/useIsFocused.ts +0 -38
- package/src/plugin.ts +0 -44
- package/src/props/Elevation.ts +0 -5
- package/src/props/MessageValence.ts +0 -5
- package/src/props/Size.ts +0 -40
- package/src/props/index.ts +0 -7
- package/src/styles/active.ts +0 -11
- package/src/styles/disabled.ts +0 -5
- package/src/styles/focus.ts +0 -9
- package/src/styles/group.ts +0 -35
- package/src/styles/hover.ts +0 -10
- package/src/styles/input.ts +0 -46
- package/src/styles/ornament.ts +0 -6
- package/src/styles/shimmer.ts +0 -9
- package/src/styles/size.ts +0 -86
- package/src/styles/text.ts +0 -10
- package/src/styles/valence.ts +0 -71
- package/src/testing/templateForComponent.tsx +0 -16
- package/src/theme.css +0 -65
- package/src/typings.d.ts +0 -7
- package/src/util/index.ts +0 -5
- package/src/util/mx.ts +0 -28
- package/src/util/withLogical.ts +0 -103
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/PanelPopover/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { ComponentProps, Dispatch, Fragment, PropsWithChildren, SetStateAction } from 'react';
|
|
2
|
+
export declare type PanelSidebarState = 'show' | 'hide';
|
|
3
|
+
export declare const sidebarWidth = 272;
|
|
4
|
+
export interface PanelSidebarContextValue {
|
|
5
|
+
setDisplayState: Dispatch<SetStateAction<PanelSidebarState>>;
|
|
6
|
+
displayState: PanelSidebarState;
|
|
7
|
+
}
|
|
8
|
+
export declare const PanelSidebarContext: React.Context<PanelSidebarContextValue>;
|
|
9
|
+
export declare const useTogglePanelSidebar: () => () => void;
|
|
10
|
+
export interface PanelSidebarProviderSlots {
|
|
11
|
+
content?: ComponentProps<typeof Fragment>;
|
|
12
|
+
fixedBlockStart?: ComponentProps<'div'>;
|
|
13
|
+
fixedBlockEnd?: ComponentProps<'div'>;
|
|
14
|
+
}
|
|
15
|
+
export interface PanelSidebarProviderProps {
|
|
16
|
+
inlineStart?: boolean;
|
|
17
|
+
slots?: PanelSidebarProviderSlots;
|
|
18
|
+
}
|
|
19
|
+
export declare const PanelSidebarProvider: ({ children, slots }: PropsWithChildren<PanelSidebarProviderProps>) => JSX.Element;
|
|
20
|
+
//# sourceMappingURL=PanelSidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PanelSidebar.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/PanelSidebar/PanelSidebar.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,EACZ,cAAc,EAEd,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,cAAc,EAIf,MAAM,OAAO,CAAC;AAIf,oBAAY,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEhD,eAAO,MAAM,YAAY,MAAM,CAAC;AAEhC,MAAM,WAAW,wBAAwB;IACvC,eAAe,EAAE,QAAQ,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC7D,YAAY,EAAE,iBAAiB,CAAC;CACjC;AAED,eAAO,MAAM,mBAAmB,yCAG9B,CAAC;AAEH,eAAO,MAAM,qBAAqB,kBAKjC,CAAC;AAEF,MAAM,WAAW,yBAAyB;IACxC,OAAO,CAAC,EAAE,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC;IAC1C,eAAe,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC;IACxC,aAAa,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,yBAAyB;IACxC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,yBAAyB,CAAC;CACnC;AAED,eAAO,MAAM,oBAAoB,wBAAyB,kBAAkB,yBAAyB,CAAC,gBA0ErG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/PanelSidebar/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/layouts/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdentityPanel.d.ts","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/IdentityPanel.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAI5C,eAAO,MAAM,aAAa;cAId,OAAO;kCACY,IAAI;iBAwBlC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/panels/IdentityPanel/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/panels/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC"}
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './disabled';
|
|
3
|
-
export * from './focus';
|
|
4
|
-
export * from './group';
|
|
5
|
-
export * from './hover';
|
|
6
|
-
export * from './ornament';
|
|
7
|
-
export * from './shimmer';
|
|
8
|
-
export * from './size';
|
|
9
|
-
export * from './text';
|
|
10
|
-
export * from './valence';
|
|
11
|
-
export * from './input';
|
|
1
|
+
export * from './panelStyles';
|
|
12
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/styles/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/styles/index.ts"],"names":[],"mappings":"AAIA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panelStyles.d.ts","sourceRoot":"","sources":["../../../../src/styles/panelStyles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,uEAAuE,CAAC;AACjG,eAAO,MAAM,YAAY,sDAAsD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClientProvider.d.ts","sourceRoot":"","sources":["../../../../src/testing/ClientProvider.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAOjD,eAAO,MAAM,cAAc,iBAAkB,kBAAkB,EAAE,CAAC,gBAMjE,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './ClientProvider';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/testing/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/translations/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAExC,eAAO,MAAM,cAAc;;CAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"en-US.d.ts","sourceRoot":"","sources":["../../../../../src/translations/locales/en-US.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,EAAE;;;;CAId,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.22",
|
|
4
|
+
"description": "A React component library for DXOS’s OS experiences",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
7
|
"license": "MIT",
|
|
@@ -10,47 +10,31 @@
|
|
|
10
10
|
"types": "dist/types/src/index.d.ts",
|
|
11
11
|
"files": [
|
|
12
12
|
"dist",
|
|
13
|
-
"src"
|
|
14
|
-
"plugin.js",
|
|
15
|
-
"plugin.d.ts"
|
|
13
|
+
"src"
|
|
16
14
|
],
|
|
17
15
|
"dependencies": {
|
|
18
|
-
"@fontsource/fira-code": "^4.5.12",
|
|
19
|
-
"@fontsource/roboto-flex": "^4.5.2",
|
|
20
|
-
"@fontsource/space-grotesk": "^4.5.10",
|
|
21
|
-
"@headlessui/react": "^1.7.3",
|
|
22
|
-
"@radix-ui/react-alert-dialog": "^1.0.2",
|
|
23
|
-
"@radix-ui/react-avatar": "^1.0.1",
|
|
24
16
|
"@radix-ui/react-dialog": "^1.0.0",
|
|
25
|
-
"@
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"postcss": "^8.4.17",
|
|
36
|
-
"qrcode.react": "^3.1.0",
|
|
37
|
-
"rci": "^0.0.3",
|
|
38
|
-
"tailwind-merge": "^1.8.0",
|
|
39
|
-
"tailwindcss": "^3.1.8",
|
|
40
|
-
"tailwindcss-logical": "^3.0.0",
|
|
41
|
-
"tailwindcss-radix": "^2.6.0"
|
|
17
|
+
"@react-hook/async": "^3.1.1",
|
|
18
|
+
"debug": "^4.3.3",
|
|
19
|
+
"url-join": "^5.0.0",
|
|
20
|
+
"@dxos/client": "0.1.22",
|
|
21
|
+
"@dxos/config": "0.1.22",
|
|
22
|
+
"@dxos/debug": "0.1.22",
|
|
23
|
+
"@dxos/keys": "0.1.22",
|
|
24
|
+
"@dxos/react-client": "0.1.22",
|
|
25
|
+
"@dxos/react-components": "0.1.22",
|
|
26
|
+
"@dxos/util": "0.1.22"
|
|
42
27
|
},
|
|
43
28
|
"devDependencies": {
|
|
29
|
+
"@types/debug": "^4.1.7",
|
|
44
30
|
"@types/react": "^18.0.21",
|
|
45
31
|
"@types/react-dom": "^18.0.6",
|
|
46
|
-
"@vitejs/plugin-react": "^
|
|
47
|
-
"esbuild": "^0.15.1",
|
|
48
|
-
"esbuild-style-plugin": "^1.6.0",
|
|
32
|
+
"@vitejs/plugin-react": "^3.0.1",
|
|
49
33
|
"phosphor-react": "^1.4.1",
|
|
50
34
|
"react": "^18.2.0",
|
|
51
35
|
"react-dom": "^18.2.0",
|
|
52
36
|
"storybook-dark-mode": "^1.1.2",
|
|
53
|
-
"vite": "
|
|
37
|
+
"vite": "4.0.4"
|
|
54
38
|
},
|
|
55
39
|
"peerDependencies": {
|
|
56
40
|
"phosphor-react": "^1.4.1",
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxosTheme';
|
|
6
|
+
|
|
7
|
+
import { IdentityListItem } from './IdentityListItem';
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
component: IdentityListItem
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const Default = {
|
|
14
|
+
args: {
|
|
15
|
+
identity: {
|
|
16
|
+
identityKey: {
|
|
17
|
+
toHex: () => '888',
|
|
18
|
+
truncate: () => '888..888'
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
presence: 0
|
|
22
|
+
}
|
|
23
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import { Profile, SpaceMember } from '@dxos/client';
|
|
7
|
+
import { Avatar, useTranslation } from '@dxos/react-components';
|
|
8
|
+
|
|
9
|
+
export const IdentityListItem = ({ identity, presence }: { identity: Profile; presence?: SpaceMember['presence'] }) => {
|
|
10
|
+
const { t } = useTranslation('os');
|
|
11
|
+
return (
|
|
12
|
+
<li className='flex gap-2'>
|
|
13
|
+
<Avatar
|
|
14
|
+
{...{
|
|
15
|
+
size: 9,
|
|
16
|
+
fallbackValue: identity.identityKey.toHex(),
|
|
17
|
+
label: <p className='text-sm'>{identity.displayName ?? identity.identityKey.truncate()}</p>,
|
|
18
|
+
...(presence === SpaceMember.PresenceState.OFFLINE && {
|
|
19
|
+
status: 'inactive',
|
|
20
|
+
description: (
|
|
21
|
+
<p className='font-system-normal text-xs text-neutral-700 dark:text-neutral-300'>
|
|
22
|
+
{t('identity offline description')}
|
|
23
|
+
</p>
|
|
24
|
+
)
|
|
25
|
+
}),
|
|
26
|
+
...(presence === SpaceMember.PresenceState.ONLINE && { status: 'active' }),
|
|
27
|
+
slots: { labels: { className: 'block' } }
|
|
28
|
+
}}
|
|
29
|
+
/>
|
|
30
|
+
</li>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { ComponentProps } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Profile } from '@dxos/client';
|
|
8
|
+
import { Avatar, mx } from '@dxos/react-components';
|
|
9
|
+
|
|
10
|
+
import { PanelPopover } from '../../layouts';
|
|
11
|
+
import { IdentityPanel } from '../../panels';
|
|
12
|
+
|
|
13
|
+
export interface IdentityPopoverProps extends Partial<ComponentProps<typeof PanelPopover>> {
|
|
14
|
+
identity: Profile;
|
|
15
|
+
onClickManageProfile?: () => void;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const IdentityPopover = ({
|
|
19
|
+
identity,
|
|
20
|
+
openTrigger,
|
|
21
|
+
slots,
|
|
22
|
+
triggerIsInToolbar = true,
|
|
23
|
+
onClickManageProfile,
|
|
24
|
+
...popoverProps
|
|
25
|
+
}: IdentityPopoverProps) => {
|
|
26
|
+
return (
|
|
27
|
+
<PanelPopover
|
|
28
|
+
{...popoverProps}
|
|
29
|
+
openTrigger={
|
|
30
|
+
openTrigger ?? (
|
|
31
|
+
<Avatar
|
|
32
|
+
size={10}
|
|
33
|
+
variant='circle'
|
|
34
|
+
fallbackValue={identity.identityKey.toHex()}
|
|
35
|
+
label={identity.displayName ?? ''}
|
|
36
|
+
/>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
slots={{
|
|
40
|
+
...slots,
|
|
41
|
+
trigger: {
|
|
42
|
+
...slots?.trigger,
|
|
43
|
+
className: mx(
|
|
44
|
+
'flex justify-self-end pointer-events-auto bg-white dark:bg-neutral-700 p-0.5 button-elevation rounded-full',
|
|
45
|
+
slots?.trigger?.className
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
}}
|
|
49
|
+
triggerIsInToolbar={triggerIsInToolbar}
|
|
50
|
+
>
|
|
51
|
+
<IdentityPanel {...{ identity, onClickManageProfile }} />
|
|
52
|
+
</PanelPopover>
|
|
53
|
+
);
|
|
54
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Copyright 2022 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
5
|
+
export * from './composites';
|
|
6
|
+
export * from './layouts';
|
|
7
|
+
export * from './panels';
|
|
8
8
|
export * from './styles';
|
|
9
|
-
export * from './
|
|
9
|
+
export * from './translations';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { ComponentProps } from 'react';
|
|
6
|
+
|
|
7
|
+
import { mx, Popover } from '@dxos/react-components';
|
|
8
|
+
|
|
9
|
+
import { defaultPanel, defaultArrow } from '../../styles';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* This component essentially sets default styles for popovers which have panels as their content
|
|
13
|
+
* @param slots
|
|
14
|
+
* @param children
|
|
15
|
+
* @param popoverProps
|
|
16
|
+
* @constructor
|
|
17
|
+
*/
|
|
18
|
+
export const PanelPopover = ({ slots, children, ...popoverProps }: ComponentProps<typeof Popover>) => {
|
|
19
|
+
return (
|
|
20
|
+
<Popover
|
|
21
|
+
slots={{
|
|
22
|
+
arrow: { ...slots?.arrow, className: mx(defaultArrow, slots?.arrow?.className) },
|
|
23
|
+
content: {
|
|
24
|
+
collisionPadding: 8,
|
|
25
|
+
sideOffset: 4,
|
|
26
|
+
...slots?.content,
|
|
27
|
+
className: mx(defaultPanel, slots?.content?.className)
|
|
28
|
+
},
|
|
29
|
+
trigger: {
|
|
30
|
+
...slots?.trigger,
|
|
31
|
+
className: mx('', slots?.trigger?.className)
|
|
32
|
+
},
|
|
33
|
+
...slots
|
|
34
|
+
}}
|
|
35
|
+
{...popoverProps}
|
|
36
|
+
>
|
|
37
|
+
{children}
|
|
38
|
+
</Popover>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
6
|
+
import React, {
|
|
7
|
+
ComponentProps,
|
|
8
|
+
createContext,
|
|
9
|
+
Dispatch,
|
|
10
|
+
Fragment,
|
|
11
|
+
PropsWithChildren,
|
|
12
|
+
SetStateAction,
|
|
13
|
+
useCallback,
|
|
14
|
+
useContext,
|
|
15
|
+
useState
|
|
16
|
+
} from 'react';
|
|
17
|
+
|
|
18
|
+
import { defaultOverlay, mx, useMediaQuery, useTranslation } from '@dxos/react-components';
|
|
19
|
+
|
|
20
|
+
export type PanelSidebarState = 'show' | 'hide';
|
|
21
|
+
|
|
22
|
+
export const sidebarWidth = 272;
|
|
23
|
+
|
|
24
|
+
export interface PanelSidebarContextValue {
|
|
25
|
+
setDisplayState: Dispatch<SetStateAction<PanelSidebarState>>;
|
|
26
|
+
displayState: PanelSidebarState;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const PanelSidebarContext = createContext<PanelSidebarContextValue>({
|
|
30
|
+
displayState: 'hide',
|
|
31
|
+
setDisplayState: () => {}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export const useTogglePanelSidebar = () => {
|
|
35
|
+
const { displayState, setDisplayState } = useContext(PanelSidebarContext);
|
|
36
|
+
return useCallback(() => {
|
|
37
|
+
setDisplayState(displayState === 'hide' ? 'show' : 'hide');
|
|
38
|
+
}, [displayState]);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export interface PanelSidebarProviderSlots {
|
|
42
|
+
content?: ComponentProps<typeof Fragment>;
|
|
43
|
+
fixedBlockStart?: ComponentProps<'div'>;
|
|
44
|
+
fixedBlockEnd?: ComponentProps<'div'>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface PanelSidebarProviderProps {
|
|
48
|
+
inlineStart?: boolean;
|
|
49
|
+
slots?: PanelSidebarProviderSlots;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const PanelSidebarProvider = ({ children, slots }: PropsWithChildren<PanelSidebarProviderProps>) => {
|
|
53
|
+
const { t } = useTranslation('os');
|
|
54
|
+
const [displayState, setInternalDisplayState] = useState<PanelSidebarState>('hide');
|
|
55
|
+
const [transitionShow, setTransitionShow] = useState(false);
|
|
56
|
+
const isOpen = displayState === 'show';
|
|
57
|
+
|
|
58
|
+
const [isLg] = useMediaQuery('lg');
|
|
59
|
+
|
|
60
|
+
const internalHide = () => {
|
|
61
|
+
setTransitionShow(false);
|
|
62
|
+
setTimeout(() => {
|
|
63
|
+
setInternalDisplayState('hide');
|
|
64
|
+
}, 200);
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const internalShow = () => {
|
|
68
|
+
setInternalDisplayState('show');
|
|
69
|
+
setTimeout(() => {
|
|
70
|
+
setTransitionShow(true);
|
|
71
|
+
// todo (thure): this may be a race condition in certain situations
|
|
72
|
+
}, 0);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const setDisplayState = (displayState: SetStateAction<PanelSidebarState>) =>
|
|
76
|
+
displayState === 'show' ? internalShow() : internalHide();
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<PanelSidebarContext.Provider value={{ setDisplayState, displayState }}>
|
|
80
|
+
<DialogPrimitive.Root open={isOpen} modal={!isLg}>
|
|
81
|
+
<DialogPrimitive.Content
|
|
82
|
+
className={mx(
|
|
83
|
+
'fixed block-start-0 block-end-0 is-[272px] z-50 transition-[inset-inline-start,inset-inline-end] duration-200 ease-in-out',
|
|
84
|
+
'bg-neutral-50 dark:bg-neutral-950',
|
|
85
|
+
transitionShow ? 'inline-start-0' : `inline-start-[-${sidebarWidth}px]`
|
|
86
|
+
)}
|
|
87
|
+
>
|
|
88
|
+
<DialogPrimitive.Title className='sr-only'>{t('sidebar label')}</DialogPrimitive.Title>
|
|
89
|
+
<Fragment {...slots?.content} />
|
|
90
|
+
</DialogPrimitive.Content>
|
|
91
|
+
{slots?.fixedBlockStart && (
|
|
92
|
+
<div
|
|
93
|
+
role='none'
|
|
94
|
+
{...slots?.fixedBlockStart}
|
|
95
|
+
className={mx(
|
|
96
|
+
'fixed inline-end-0 block-start-0 z-[49] transition-[inset-inline-start,inset-inline-end] duration-200 ease-in-out',
|
|
97
|
+
transitionShow ? 'inline-start-[272px]' : 'inline-start-0',
|
|
98
|
+
slots?.fixedBlockStart?.className
|
|
99
|
+
)}
|
|
100
|
+
>
|
|
101
|
+
{slots?.fixedBlockStart?.children}
|
|
102
|
+
</div>
|
|
103
|
+
)}
|
|
104
|
+
{!isLg && (
|
|
105
|
+
<DialogPrimitive.Overlay
|
|
106
|
+
className={mx(
|
|
107
|
+
defaultOverlay,
|
|
108
|
+
'transition-opacity duration-200 ease-in-out',
|
|
109
|
+
transitionShow ? 'opacity-100' : 'opacity-0'
|
|
110
|
+
)}
|
|
111
|
+
onClick={internalHide}
|
|
112
|
+
/>
|
|
113
|
+
)}
|
|
114
|
+
<div
|
|
115
|
+
role='none'
|
|
116
|
+
className={mx(
|
|
117
|
+
'bs-full transition-[padding-inline-start] duration-200 ease-in-out',
|
|
118
|
+
isLg && isOpen ? 'pis-[272px]' : 'pis-0'
|
|
119
|
+
)}
|
|
120
|
+
>
|
|
121
|
+
{children}
|
|
122
|
+
</div>
|
|
123
|
+
</DialogPrimitive.Root>
|
|
124
|
+
</PanelSidebarContext.Provider>
|
|
125
|
+
);
|
|
126
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import type { Profile } from '@dxos/client';
|
|
7
|
+
import { useClient } from '@dxos/react-client';
|
|
8
|
+
import { Avatar, Button, ThemeContext, useTranslation } from '@dxos/react-components';
|
|
9
|
+
|
|
10
|
+
export const IdentityPanel = ({
|
|
11
|
+
identity,
|
|
12
|
+
onClickManageProfile
|
|
13
|
+
}: {
|
|
14
|
+
identity: Profile;
|
|
15
|
+
onClickManageProfile?: () => void;
|
|
16
|
+
}) => {
|
|
17
|
+
const { t } = useTranslation('os');
|
|
18
|
+
const client = useClient();
|
|
19
|
+
const defaultManageProfile = () => {
|
|
20
|
+
const remoteSource = new URL(client?.config.get('runtime.client.remoteSource') || 'https://halo.dxos.org');
|
|
21
|
+
const tab = window.open(remoteSource.origin, '_blank');
|
|
22
|
+
tab?.focus();
|
|
23
|
+
};
|
|
24
|
+
return (
|
|
25
|
+
<ThemeContext.Provider value={{ themeVariant: 'os' }}>
|
|
26
|
+
<div className='flex flex-col gap-2 justify-center items-center'>
|
|
27
|
+
<Avatar
|
|
28
|
+
size={16}
|
|
29
|
+
variant='circle'
|
|
30
|
+
fallbackValue={identity.identityKey.toHex()}
|
|
31
|
+
label={identity.displayName ?? ''}
|
|
32
|
+
/>
|
|
33
|
+
<Button compact onClick={onClickManageProfile ?? defaultManageProfile} className='is-full'>
|
|
34
|
+
{t('manage profile label')}
|
|
35
|
+
</Button>
|
|
36
|
+
</div>
|
|
37
|
+
</ThemeContext.Provider>
|
|
38
|
+
);
|
|
39
|
+
};
|
package/src/styles/index.ts
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
//
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './disabled';
|
|
7
|
-
export * from './focus';
|
|
8
|
-
export * from './group';
|
|
9
|
-
export * from './hover';
|
|
10
|
-
export * from './ornament';
|
|
11
|
-
export * from './shimmer';
|
|
12
|
-
export * from './size';
|
|
13
|
-
export * from './text';
|
|
14
|
-
export * from './valence';
|
|
15
|
-
export * from './input';
|
|
5
|
+
export * from './panelStyles';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2022 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { PropsWithChildren } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Config, Defaults, Dynamics } from '@dxos/config';
|
|
8
|
+
import { ClientProvider as NaturalClientProvider } from '@dxos/react-client';
|
|
9
|
+
|
|
10
|
+
const configProvider = async () => new Config(await Dynamics(), Defaults());
|
|
11
|
+
|
|
12
|
+
export const ClientProvider = ({ children }: PropsWithChildren<{}>) => {
|
|
13
|
+
return (
|
|
14
|
+
<NaturalClientProvider config={configProvider} fallback={<span>Starting client…</span>}>
|
|
15
|
+
{children}
|
|
16
|
+
</NaturalClientProvider>
|
|
17
|
+
);
|
|
18
|
+
};
|