@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.
@@ -44,11 +44,15 @@ export const CopyButton = ({ value, classNames, iconProps, ...props }: CopyButto
44
44
  );
45
45
  };
46
46
 
47
- export const CopyButtonIconOnly = ({ value, classNames, iconProps, variant, ...props }: CopyButtonProps) => {
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> & { blockAlign?: 'center' | 'start' };
98
+ type AlertDialogOverlayProps = ThemedClassName<AlertDialogOverlayPrimitiveProps> & {
99
+ blockAlign?: 'center' | 'start' | 'end';
100
+ };
99
101
 
100
102
  const AlertDialogOverlay: ForwardRefExoticComponent<AlertDialogOverlayProps> = forwardRef<
101
103
  HTMLDivElement,
@@ -59,7 +59,7 @@ export const Default = {
59
59
  argTypes: {
60
60
  blockAlign: {
61
61
  type: 'select',
62
- options: ['center', 'start'],
62
+ options: ['center', 'start', 'end'],
63
63
  },
64
64
  },
65
65
  };
@@ -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('dialog.content', 'dialog', { inOverlayLayout }, classNames)}
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 { hueTokenThemes } from '@dxos/react-ui-theme';
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', ...Object.keys(hueTokenThemes)] as (
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',