@dxos/react-ui-stack 0.8.1-main.ba2dec9 → 0.8.1-staging.31c3ee1

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.
@@ -96,6 +96,7 @@ const StackItemRoot = forwardRef<HTMLDivElement, StackItemRootProps>(
96
96
  if (!itemElement || !onRearrange || disableRearrange) {
97
97
  return;
98
98
  }
99
+
99
100
  return combine(
100
101
  draggable({
101
102
  element: itemElement,
@@ -146,14 +147,14 @@ const StackItemRoot = forwardRef<HTMLDivElement, StackItemRootProps>(
146
147
  );
147
148
  }, [orientation, item, onRearrange, selfDragHandleElement, itemElement]);
148
149
 
149
- const focusGroupAttrs = useFocusableGroup({ tabBehavior: 'limited' });
150
+ const focusableGroupAttrs = useFocusableGroup({ tabBehavior: 'limited' });
150
151
 
151
152
  return (
152
153
  <StackItemContext.Provider value={{ selfDragHandleRef, size, setSize }}>
153
154
  <Root
154
155
  {...props}
155
156
  tabIndex={0}
156
- {...focusGroupAttrs}
157
+ {...focusableGroupAttrs}
157
158
  className={mx(
158
159
  'group/stack-item grid relative',
159
160
  focusIndicatorVariant === 'over-all'
@@ -14,7 +14,7 @@ export type StackItemContentProps = ThemedClassName<ComponentPropsWithoutRef<'di
14
14
  * This flag is required in order to clarify a developer experience that seemed like it needed extra boilerplate
15
15
  * (`row-span-2`) or was buggy. See the description of the StackItem.Content component itself for more information.
16
16
  */
17
- toolbar: boolean;
17
+ toolbar?: boolean;
18
18
 
19
19
  /**
20
20
  * Whether to provide for the layout of a statusbar after the content.
@@ -16,6 +16,7 @@ export type StackItemHeadingProps = ThemedClassName<ComponentPropsWithoutRef<'di
16
16
  export const StackItemHeading = ({ children, classNames, ...props }: StackItemHeadingProps) => {
17
17
  const { orientation } = useStack();
18
18
  const focusableGroupAttrs = useFocusableGroup({ tabBehavior: 'limited' });
19
+
19
20
  return (
20
21
  <div
21
22
  role='heading'
@@ -38,6 +39,7 @@ export type StackItemHeadingLabelProps = ThemedClassName<ComponentPropsWithRef<'
38
39
  export const StackItemHeadingLabel = forwardRef<HTMLHeadingElement, StackItemHeadingLabelProps>(
39
40
  ({ attendableId, related, classNames, ...props }, forwardedRef) => {
40
41
  const { hasAttention, isAncestor, isRelated } = useAttention(attendableId);
42
+
41
43
  return (
42
44
  <h1
43
45
  {...props}
@@ -24,12 +24,17 @@ export type KeyBinding = {
24
24
 
25
25
  export type StackItemSigilAction = Pick<ActionLike, 'id' | 'properties' | 'data'>;
26
26
 
27
- export type StackItemSigilButtonProps = Omit<ButtonProps, 'variant'> & AttendableId & Related;
27
+ export type StackItemSigilButtonProps = Omit<ButtonProps, 'variant'> &
28
+ AttendableId &
29
+ Related & {
30
+ isMenu?: boolean;
31
+ };
28
32
 
29
33
  export const StackItemSigilButton = forwardRef<HTMLButtonElement, StackItemSigilButtonProps>(
30
- ({ attendableId, classNames, related, children, ...props }, forwardedRef) => {
34
+ ({ attendableId, classNames, related, isMenu = true, children, ...props }, forwardedRef) => {
31
35
  const { hasAttention, isAncestor, isRelated } = useAttention(attendableId);
32
36
  const variant = (related && isRelated) || hasAttention || isAncestor ? 'primary' : 'ghost';
37
+ // TODO(wittjosiah): Disable hover styles when isMenu is false.
33
38
  return (
34
39
  <Button
35
40
  {...props}
@@ -37,7 +42,7 @@ export const StackItemSigilButton = forwardRef<HTMLButtonElement, StackItemSigil
37
42
  classNames={['shrink-0 pli-0 min-bs-0 is-[--rail-action] bs-[--rail-action] relative app-no-drag', classNames]}
38
43
  ref={forwardedRef}
39
44
  >
40
- <MenuSignifierHorizontal />
45
+ {isMenu && <MenuSignifierHorizontal />}
41
46
  {children}
42
47
  </Button>
43
48
  );
@@ -67,6 +72,7 @@ export const StackItemSigil = forwardRef<HTMLButtonElement, StackItemSigilProps>
67
72
  <StackItemSigilButton
68
73
  attendableId={attendableId}
69
74
  related={related}
75
+ isMenu={hasActions}
70
76
  // TODO(wittjosiah): Better disabling of interactive styles when no action are available.
71
77
  // Remove underscore icon when no actions are available?
72
78
  classNames={!hasActions && 'cursor-default'}