@dxos/react-ui 0.4.9 → 0.4.10-main.068c3d8

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.
@@ -81,16 +81,26 @@ const [OverlayLayoutProvider, useOverlayLayoutContext] = createContext<OverlayLa
81
81
  inOverlayLayout: false,
82
82
  });
83
83
 
84
- type DialogOverlayProps = ThemedClassName<DialogOverlayPrimitiveProps>;
84
+ type DialogOverlayProps = ThemedClassName<DialogOverlayPrimitiveProps> & { blockAlign?: 'center' | 'start' };
85
85
 
86
86
  const DialogOverlay: ForwardRefExoticComponent<DialogOverlayProps> = forwardRef<HTMLDivElement, DialogOverlayProps>(
87
- ({ classNames, children, ...props }, forwardedRef) => {
87
+ ({ classNames, children, blockAlign, ...props }, forwardedRef) => {
88
88
  const { tx } = useThemeContext();
89
+
89
90
  return (
90
91
  <DialogOverlayPrimitive
91
92
  {...props}
92
- className={tx('dialog.overlay', 'dialog__overlay', {}, classNames)}
93
+ className={tx(
94
+ 'dialog.overlay',
95
+ 'dialog__overlay',
96
+ {},
97
+ classNames,
98
+ 'data-[block-align=start]:justify-center',
99
+ 'data-[block-align=start]:items-start',
100
+ 'data-[block-align=center]:place-content-center',
101
+ )}
93
102
  ref={forwardedRef}
103
+ data-block-align={blockAlign}
94
104
  >
95
105
  <OverlayLayoutProvider inOverlayLayout>{children}</OverlayLayoutProvider>
96
106
  </DialogOverlayPrimitive>
@@ -106,6 +116,7 @@ const DialogContent: ForwardRefExoticComponent<DialogContentProps> = forwardRef<
106
116
  ({ classNames, children, ...props }, forwardedRef) => {
107
117
  const { tx } = useThemeContext();
108
118
  const { inOverlayLayout } = useOverlayLayoutContext(DIALOG_CONTENT_NAME);
119
+
109
120
  return (
110
121
  <DialogContentPrimitive
111
122
  {...props}
@@ -19,6 +19,8 @@ import React, { forwardRef } from 'react';
19
19
  import { useThemeContext } from '../../hooks';
20
20
  import { type ThemedClassName } from '../../util';
21
21
 
22
+ type ScrollAreaVariant = 'coarse' | 'fine';
23
+
22
24
  type ScrollAreaRootProps = ThemedClassName<ScrollAreaPrimitiveRootProps>;
23
25
 
24
26
  const ScrollAreaRoot = forwardRef<HTMLDivElement, ScrollAreaRootProps>(({ classNames, ...props }, forwardedRef) => {
@@ -47,13 +49,14 @@ const ScrollAreaViewport = forwardRef<HTMLDivElement, ScrollAreaViewportProps>(
47
49
  },
48
50
  );
49
51
 
50
- type ScrollAreaScrollbarProps = ThemedClassName<ScrollAreaPrimitiveScrollbarProps>;
52
+ type ScrollAreaScrollbarProps = ThemedClassName<ScrollAreaPrimitiveScrollbarProps> & { variant?: ScrollAreaVariant };
51
53
 
52
54
  const ScrollAreaScrollbar = forwardRef<HTMLDivElement, ScrollAreaScrollbarProps>(
53
- ({ classNames, ...props }, forwardedRef) => {
55
+ ({ classNames, variant = 'fine', ...props }, forwardedRef) => {
54
56
  const { tx } = useThemeContext();
55
57
  return (
56
58
  <ScrollAreaPrimitiveScrollbar
59
+ data-variant={variant}
57
60
  {...props}
58
61
  className={tx('scrollArea.scrollbar', 'scroll-area__scrollbar', {}, classNames)}
59
62
  ref={forwardedRef}