@dxos/react-ui 0.7.5-labs.071a3e2 → 0.7.5-labs.401163d
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/dist/lib/browser/index.mjs +6 -10
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +6 -10
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +6 -10
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Avatars/Avatar.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/CopyButton.d.ts +5 -1
- package/dist/types/src/components/Clipboard/CopyButton.d.ts.map +1 -1
- package/dist/types/src/components/Clipboard/index.d.ts +6 -1
- package/dist/types/src/components/Clipboard/index.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/AlertDialog.d.ts +1 -1
- package/dist/types/src/components/Dialogs/AlertDialog.d.ts.map +1 -1
- package/dist/types/src/components/Dialogs/Dialog.d.ts +4 -2
- package/dist/types/src/components/Dialogs/Dialog.d.ts.map +1 -1
- package/dist/types/src/components/Tag/Tag.stories.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/components/Avatars/Avatar.tsx +2 -7
- package/src/components/Clipboard/CopyButton.tsx +6 -2
- package/src/components/Dialogs/AlertDialog.tsx +3 -1
- package/src/components/Dialogs/Dialog.stories.tsx +1 -1
- package/src/components/Dialogs/Dialog.tsx +9 -4
- package/src/components/Tag/Tag.stories.tsx +2 -5
|
@@ -44,11 +44,15 @@ export const CopyButton = ({ value, classNames, iconProps, ...props }: CopyButto
|
|
|
44
44
|
);
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
type CopyButtonIconOnlyProps = CopyButtonProps & {
|
|
48
|
+
label?: string;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const CopyButtonIconOnly = ({ value, classNames, iconProps, variant, ...props }: CopyButtonIconOnlyProps) => {
|
|
48
52
|
const { t } = useTranslation('os');
|
|
49
53
|
const { textValue, setTextValue } = useClipboard();
|
|
50
54
|
const isCopied = textValue === value;
|
|
51
|
-
const label = isCopied ? t('copy success label') : t('copy label');
|
|
55
|
+
const label = isCopied ? t('copy success label') : props.label ?? t('copy label');
|
|
52
56
|
const [open, setOpen] = useState(false);
|
|
53
57
|
return (
|
|
54
58
|
<Tooltip.Root delayDuration={1500} open={open} onOpenChange={setOpen}>
|
|
@@ -95,7 +95,9 @@ const [OverlayLayoutProvider, useOverlayLayoutContext] = createContext<OverlayLa
|
|
|
95
95
|
},
|
|
96
96
|
);
|
|
97
97
|
|
|
98
|
-
type AlertDialogOverlayProps = ThemedClassName<AlertDialogOverlayPrimitiveProps> & {
|
|
98
|
+
type AlertDialogOverlayProps = ThemedClassName<AlertDialogOverlayPrimitiveProps> & {
|
|
99
|
+
blockAlign?: 'center' | 'start' | 'end';
|
|
100
|
+
};
|
|
99
101
|
|
|
100
102
|
const AlertDialogOverlay: ForwardRefExoticComponent<AlertDialogOverlayProps> = forwardRef<
|
|
101
103
|
HTMLDivElement,
|
|
@@ -85,7 +85,7 @@ const [OverlayLayoutProvider, useOverlayLayoutContext] = createContext<OverlayLa
|
|
|
85
85
|
inOverlayLayout: false,
|
|
86
86
|
});
|
|
87
87
|
|
|
88
|
-
type DialogOverlayProps = ThemedClassName<DialogOverlayPrimitiveProps> & { blockAlign?: 'center' | 'start' };
|
|
88
|
+
type DialogOverlayProps = ThemedClassName<DialogOverlayPrimitiveProps> & { blockAlign?: 'center' | 'start' | 'end' };
|
|
89
89
|
|
|
90
90
|
const DialogOverlay: ForwardRefExoticComponent<DialogOverlayProps> = forwardRef<HTMLDivElement, DialogOverlayProps>(
|
|
91
91
|
({ classNames, children, blockAlign, ...props }, forwardedRef) => {
|
|
@@ -106,17 +106,22 @@ const DialogOverlay: ForwardRefExoticComponent<DialogOverlayProps> = forwardRef<
|
|
|
106
106
|
|
|
107
107
|
DialogOverlay.displayName = DIALOG_OVERLAY_NAME;
|
|
108
108
|
|
|
109
|
-
type DialogContentProps = ThemedClassName<DialogContentPrimitiveProps
|
|
109
|
+
type DialogContentProps = ThemedClassName<DialogContentPrimitiveProps> & { inOverlayLayout?: boolean };
|
|
110
110
|
|
|
111
111
|
const DialogContent: ForwardRefExoticComponent<DialogContentProps> = forwardRef<HTMLDivElement, DialogContentProps>(
|
|
112
|
-
({ classNames, children, ...props }, forwardedRef) => {
|
|
112
|
+
({ classNames, children, inOverlayLayout: propsInOverlayLayout, ...props }, forwardedRef) => {
|
|
113
113
|
const { tx } = useThemeContext();
|
|
114
114
|
const { inOverlayLayout } = useOverlayLayoutContext(DIALOG_CONTENT_NAME);
|
|
115
115
|
|
|
116
116
|
return (
|
|
117
117
|
<DialogContentPrimitive
|
|
118
118
|
{...props}
|
|
119
|
-
className={tx(
|
|
119
|
+
className={tx(
|
|
120
|
+
'dialog.content',
|
|
121
|
+
'dialog',
|
|
122
|
+
{ inOverlayLayout: propsInOverlayLayout || inOverlayLayout },
|
|
123
|
+
classNames,
|
|
124
|
+
)}
|
|
120
125
|
ref={forwardedRef}
|
|
121
126
|
>
|
|
122
127
|
{children}
|
|
@@ -3,17 +3,14 @@
|
|
|
3
3
|
//
|
|
4
4
|
import React from 'react';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { hues } from '@dxos/react-ui-theme';
|
|
7
7
|
import '@dxos-theme';
|
|
8
8
|
import { type ChromaticPalette, type MessageValence } from '@dxos/react-ui-types';
|
|
9
9
|
|
|
10
10
|
import { Tag } from './Tag';
|
|
11
11
|
import { withTheme } from '../../testing';
|
|
12
12
|
|
|
13
|
-
const palettes = ['neutral', 'success', 'info', 'warning', 'error', ...
|
|
14
|
-
| ChromaticPalette
|
|
15
|
-
| MessageValence
|
|
16
|
-
)[];
|
|
13
|
+
const palettes = ['neutral', 'success', 'info', 'warning', 'error', ...hues] as (ChromaticPalette | MessageValence)[];
|
|
17
14
|
|
|
18
15
|
export default {
|
|
19
16
|
title: 'ui/react-ui-core/Tag',
|