@dxos/react-ui-stack 0.8.4-main.5acf9ea → 0.8.4-main.5ea62a8

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.
Files changed (63) hide show
  1. package/dist/lib/browser/{chunk-P3TQV4BA.mjs → chunk-WMYFUTSX.mjs} +9 -7
  2. package/dist/lib/browser/chunk-WMYFUTSX.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +3 -1
  4. package/dist/lib/browser/meta.json +1 -1
  5. package/dist/lib/browser/playwright/index.mjs +23 -6
  6. package/dist/lib/browser/playwright/index.mjs.map +2 -2
  7. package/dist/lib/browser/testing/index.mjs +3 -3
  8. package/dist/lib/browser/testing/index.mjs.map +3 -3
  9. package/dist/lib/node-esm/{chunk-3WVEPAJ4.mjs → chunk-JIJOVBWB.mjs} +9 -7
  10. package/dist/lib/node-esm/chunk-JIJOVBWB.mjs.map +7 -0
  11. package/dist/lib/node-esm/index.mjs +3 -1
  12. package/dist/lib/node-esm/meta.json +1 -1
  13. package/dist/lib/node-esm/playwright/index.mjs +23 -6
  14. package/dist/lib/node-esm/playwright/index.mjs.map +2 -2
  15. package/dist/lib/node-esm/testing/index.mjs +3 -3
  16. package/dist/lib/node-esm/testing/index.mjs.map +3 -3
  17. package/dist/types/src/components/Stack/Stack.d.ts +1 -1
  18. package/dist/types/src/components/Stack/Stack.d.ts.map +1 -1
  19. package/dist/types/src/components/Stack/Stack.stories.d.ts +12 -2
  20. package/dist/types/src/components/Stack/Stack.stories.d.ts.map +1 -1
  21. package/dist/types/src/components/StackContext.d.ts +1 -1
  22. package/dist/types/src/components/StackContext.d.ts.map +1 -1
  23. package/dist/types/src/components/StackItem/StackItem.d.ts +3 -3
  24. package/dist/types/src/components/StackItem/StackItem.d.ts.map +1 -1
  25. package/dist/types/src/components/StackItem/StackItem.stories.d.ts +13 -4
  26. package/dist/types/src/components/StackItem/StackItem.stories.d.ts.map +1 -1
  27. package/dist/types/src/components/StackItem/StackItemContent.d.ts.map +1 -1
  28. package/dist/types/src/components/StackItem/StackItemHeading.d.ts +1 -1
  29. package/dist/types/src/components/StackItem/StackItemHeading.d.ts.map +1 -1
  30. package/dist/types/src/components/StackItem/StackItemResizeHandle.d.ts.map +1 -1
  31. package/dist/types/src/components/StackItem/StackItemSigil.d.ts.map +1 -1
  32. package/dist/types/src/exemplars/Card/Card.d.ts +2 -2
  33. package/dist/types/src/exemplars/Card/Card.d.ts.map +1 -1
  34. package/dist/types/src/exemplars/Card/Card.stories.d.ts +31 -3
  35. package/dist/types/src/exemplars/Card/Card.stories.d.ts.map +1 -1
  36. package/dist/types/src/exemplars/Card/fragments.d.ts +2 -1
  37. package/dist/types/src/exemplars/Card/fragments.d.ts.map +1 -1
  38. package/dist/types/src/exemplars/CardStack/CardStack.d.ts.map +1 -1
  39. package/dist/types/src/exemplars/CardStack/CardStack.stories.d.ts +6 -2
  40. package/dist/types/src/exemplars/CardStack/CardStack.stories.d.ts.map +1 -1
  41. package/dist/types/src/hooks/useStackDropForElements.d.ts +1 -1
  42. package/dist/types/src/hooks/useStackDropForElements.d.ts.map +1 -1
  43. package/dist/types/src/testing/CardContainer.d.ts.map +1 -1
  44. package/dist/types/tsconfig.tsbuildinfo +1 -1
  45. package/package.json +21 -21
  46. package/src/components/Stack/Stack.stories.tsx +6 -5
  47. package/src/components/Stack/Stack.tsx +6 -6
  48. package/src/components/StackContext.tsx +1 -1
  49. package/src/components/StackItem/StackItem.stories.tsx +14 -10
  50. package/src/components/StackItem/StackItem.tsx +12 -11
  51. package/src/components/StackItem/StackItemContent.tsx +1 -0
  52. package/src/components/StackItem/StackItemHeading.tsx +3 -3
  53. package/src/components/StackItem/StackItemResizeHandle.tsx +2 -1
  54. package/src/components/StackItem/StackItemSigil.tsx +2 -1
  55. package/src/exemplars/Card/Card.stories.tsx +27 -22
  56. package/src/exemplars/Card/Card.tsx +7 -6
  57. package/src/exemplars/Card/fragments.ts +2 -1
  58. package/src/exemplars/CardStack/CardStack.stories.tsx +6 -6
  59. package/src/exemplars/CardStack/CardStack.tsx +1 -1
  60. package/src/hooks/useStackDropForElements.ts +1 -1
  61. package/src/testing/CardContainer.tsx +9 -6
  62. package/dist/lib/browser/chunk-P3TQV4BA.mjs.map +0 -7
  63. package/dist/lib/node-esm/chunk-3WVEPAJ4.mjs.map +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-stack",
3
- "version": "0.8.4-main.5acf9ea",
3
+ "version": "0.8.4-main.5ea62a8",
4
4
  "description": "A stack component.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -54,36 +54,36 @@
54
54
  "@radix-ui/react-slot": "1.1.2",
55
55
  "@radix-ui/react-use-controllable-state": "1.1.0",
56
56
  "react-resize-detector": "^11.0.1",
57
- "@dxos/echo-schema": "0.8.4-main.5acf9ea",
58
- "@dxos/keyboard": "0.8.4-main.5acf9ea",
59
- "@dxos/live-object": "0.8.4-main.5acf9ea",
60
- "@dxos/react-ui-attention": "0.8.4-main.5acf9ea",
61
- "@dxos/util": "0.8.4-main.5acf9ea",
62
- "@dxos/react-ui-dnd": "0.8.4-main.5acf9ea",
63
- "@dxos/storybook-utils": "0.8.4-main.5acf9ea"
57
+ "@dxos/echo-schema": "0.8.4-main.5ea62a8",
58
+ "@dxos/keyboard": "0.8.4-main.5ea62a8",
59
+ "@dxos/live-object": "0.8.4-main.5ea62a8",
60
+ "@dxos/storybook-utils": "0.8.4-main.5ea62a8",
61
+ "@dxos/util": "0.8.4-main.5ea62a8",
62
+ "@dxos/react-ui-dnd": "0.8.4-main.5ea62a8",
63
+ "@dxos/react-ui-attention": "0.8.4-main.5ea62a8"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@types/react": "~18.2.0",
67
67
  "@types/react-dom": "~18.2.0",
68
68
  "react": "~18.2.0",
69
69
  "react-dom": "~18.2.0",
70
- "vite": "5.4.7",
71
- "@dxos/client": "0.8.4-main.5acf9ea",
72
- "@dxos/app-graph": "0.8.4-main.5acf9ea",
73
- "@dxos/echo-schema": "0.8.4-main.5acf9ea",
74
- "@dxos/random": "0.8.4-main.5acf9ea",
75
- "@dxos/react-ui": "0.8.4-main.5acf9ea",
76
- "@dxos/storybook-utils": "0.8.4-main.5acf9ea",
77
- "@dxos/test-utils": "0.8.4-main.5acf9ea",
78
- "@dxos/react-ui-theme": "0.8.4-main.5acf9ea"
70
+ "vite": "7.1.1",
71
+ "@dxos/app-graph": "0.8.4-main.5ea62a8",
72
+ "@dxos/client": "0.8.4-main.5ea62a8",
73
+ "@dxos/echo-schema": "0.8.4-main.5ea62a8",
74
+ "@dxos/random": "0.8.4-main.5ea62a8",
75
+ "@dxos/react-ui-theme": "0.8.4-main.5ea62a8",
76
+ "@dxos/storybook-utils": "0.8.4-main.5ea62a8",
77
+ "@dxos/test-utils": "0.8.4-main.5ea62a8",
78
+ "@dxos/react-ui": "0.8.4-main.5ea62a8"
79
79
  },
80
80
  "peerDependencies": {
81
81
  "react": "~18.2.0",
82
82
  "react-dom": "~18.2.0",
83
- "@dxos/client": "0.8.4-main.5acf9ea",
84
- "@dxos/random": "0.8.4-main.5acf9ea",
85
- "@dxos/react-ui": "0.8.4-main.5acf9ea",
86
- "@dxos/react-ui-theme": "0.8.4-main.5acf9ea"
83
+ "@dxos/client": "0.8.4-main.5ea62a8",
84
+ "@dxos/react-ui": "0.8.4-main.5ea62a8",
85
+ "@dxos/random": "0.8.4-main.5ea62a8",
86
+ "@dxos/react-ui-theme": "0.8.4-main.5ea62a8"
87
87
  },
88
88
  "publishConfig": {
89
89
  "access": "public"
@@ -6,14 +6,15 @@ import '@dxos-theme';
6
6
 
7
7
  import { type Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
8
8
  import { type Meta, type StoryObj } from '@storybook/react-vite';
9
- import React, { useState, useCallback } from 'react';
9
+ import React, { useCallback, useState } from 'react';
10
10
 
11
11
  import { faker } from '@dxos/random';
12
12
  import { withTheme } from '@dxos/storybook-utils';
13
13
 
14
- import { Stack } from './Stack';
15
- import { StackItem } from '../StackItem';
16
14
  import { type StackItemData } from '../defs';
15
+ import { StackItem } from '../StackItem';
16
+
17
+ import { Stack } from './Stack';
17
18
 
18
19
  type StoryStackItem = {
19
20
  id: string;
@@ -129,12 +130,12 @@ const DefaultStory = () => {
129
130
  );
130
131
  };
131
132
 
132
- const meta: Meta<typeof DefaultStory> = {
133
+ const meta = {
133
134
  title: 'ui/react-ui-stack/Stack',
134
135
  component: DefaultStory,
135
136
  decorators: [withTheme],
136
137
  argTypes: { orientation: { control: 'radio', options: ['horizontal', 'vertical'] } },
137
- };
138
+ } satisfies Meta<typeof DefaultStory>;
138
139
 
139
140
  export default meta;
140
141
 
@@ -5,22 +5,22 @@
5
5
  import { useArrowNavigationGroup } from '@fluentui/react-tabster';
6
6
  import { composeRefs } from '@radix-ui/react-compose-refs';
7
7
  import React, {
8
- Children,
9
8
  type CSSProperties,
9
+ Children,
10
10
  type ComponentPropsWithRef,
11
11
  forwardRef,
12
- useState,
13
- useMemo,
14
12
  useCallback,
15
13
  useEffect,
14
+ useMemo,
15
+ useState,
16
16
  } from 'react';
17
17
 
18
- import { type ThemedClassName, ListItem } from '@dxos/react-ui';
18
+ import { ListItem, type ThemedClassName } from '@dxos/react-ui';
19
19
  import { mx } from '@dxos/react-ui-theme';
20
20
 
21
21
  import { useStackDropForElements } from '../../hooks';
22
- import { StackContext } from '../StackContext';
23
22
  import { type StackContextValue } from '../defs';
23
+ import { StackContext } from '../StackContext';
24
24
 
25
25
  export type Orientation = 'horizontal' | 'vertical';
26
26
  export type Size = 'intrinsic' | 'contain' | 'contain-fit-content';
@@ -134,7 +134,7 @@ export const Stack = forwardRef<HTMLDivElement, StackProps>(
134
134
  gridClasses,
135
135
  (size === 'contain' || size === 'contain-fit-content') &&
136
136
  (orientation === 'horizontal'
137
- ? 'overflow-x-auto min-bs-0 max-bs-full bs-full'
137
+ ? 'overflow-x-auto overscroll-x-contain min-bs-0 max-bs-full bs-full'
138
138
  : 'overflow-y-auto min-is-0 max-is-full is-full'),
139
139
  classNames,
140
140
  )}
@@ -4,8 +4,8 @@
4
4
 
5
5
  import { createContext, useContext } from 'react';
6
6
 
7
+ import { type StackItemRearrangeHandler, type StackItemSize } from './defs';
7
8
  import { type Orientation, type Size } from './Stack';
8
- import { type StackItemSize, type StackItemRearrangeHandler } from './defs';
9
9
 
10
10
  export type StackContextValue = {
11
11
  orientation: Orientation;
@@ -7,16 +7,14 @@ import '@dxos-theme';
7
7
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
8
  import React from 'react';
9
9
 
10
- import { Icon, DropdownMenu } from '@dxos/react-ui';
10
+ import { DropdownMenu, Icon } from '@dxos/react-ui';
11
11
  import { withTheme } from '@dxos/storybook-utils';
12
12
 
13
- import { StackItem } from './StackItem';
13
+ import { StackItem, type StackItemRootProps } from './StackItem';
14
14
 
15
- const meta: Meta<typeof StackItem.Root> = {
16
- title: 'ui/react-ui-stack/StackItem',
17
- component: StackItem.Root,
18
- render: (args) => (
19
- <StackItem.Root role='section' {...args} classNames='w-[20rem] border border-separator'>
15
+ const DefaultStory = (props: StackItemRootProps) => {
16
+ return (
17
+ <StackItem.Root role='section' {...props} classNames='w-[20rem] border border-separator'>
20
18
  <StackItem.Heading>
21
19
  <span className='sr-only'>Title</span>
22
20
  <div role='none' className='sticky -block-start-px bg-[--sticky-bg] p-1 is-full'>
@@ -31,16 +29,22 @@ const meta: Meta<typeof StackItem.Root> = {
31
29
  </StackItem.Heading>
32
30
  <StackItem.Content classNames='p-2'>Content</StackItem.Content>
33
31
  </StackItem.Root>
34
- ),
32
+ );
33
+ };
34
+
35
+ const meta = {
36
+ title: 'ui/react-ui-stack/StackItem',
37
+ component: StackItem.Root as any,
38
+ render: DefaultStory,
35
39
  decorators: [withTheme],
36
40
  parameters: {
37
41
  layout: 'centered',
38
42
  },
39
- };
43
+ } satisfies Meta<typeof DefaultStory>;
40
44
 
41
45
  export default meta;
42
46
 
43
- type Story = StoryObj<typeof StackItem.Root>;
47
+ type Story = StoryObj<typeof meta>;
44
48
 
45
49
  export const Default: Story = {
46
50
  args: {
@@ -7,46 +7,47 @@ import { draggable, dropTargetForElements } from '@atlaskit/pragmatic-drag-and-d
7
7
  import { preserveOffsetOnSource } from '@atlaskit/pragmatic-drag-and-drop/element/preserve-offset-on-source';
8
8
  import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';
9
9
  import {
10
+ type Edge,
10
11
  attachClosestEdge,
11
12
  extractClosestEdge,
12
- type Edge,
13
13
  } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
14
14
  import { useFocusableGroup } from '@fluentui/react-tabster';
15
15
  import { composeRefs } from '@radix-ui/react-compose-refs';
16
16
  import React, {
17
- forwardRef,
18
- useLayoutEffect,
19
- useState,
20
17
  type ComponentPropsWithRef,
21
- useCallback,
22
18
  type ReactNode,
19
+ forwardRef,
20
+ useCallback,
21
+ useLayoutEffect,
23
22
  useMemo,
23
+ useState,
24
24
  } from 'react';
25
25
  import { createPortal } from 'react-dom';
26
26
 
27
- import { type ThemedClassName, ListItem } from '@dxos/react-ui';
27
+ import { ListItem, type ThemedClassName } from '@dxos/react-ui';
28
28
  import { resizeAttributes, sizeStyle } from '@dxos/react-ui-dnd';
29
29
  import { mx } from '@dxos/react-ui-theme';
30
30
 
31
+ import { type StackItemData, type StackItemSize } from '../defs';
32
+ import { type ItemDragState, StackItemContext, idle, useStack, useStackItem } from '../StackContext';
33
+
31
34
  import { StackItemContent, type StackItemContentProps } from './StackItemContent';
32
35
  import { StackItemDragHandle, type StackItemDragHandleProps } from './StackItemDragHandle';
33
36
  import {
34
37
  StackItemHeading,
35
38
  StackItemHeadingLabel,
36
- type StackItemHeadingProps,
37
39
  type StackItemHeadingLabelProps,
40
+ type StackItemHeadingProps,
38
41
  StackItemHeadingStickyContent,
39
42
  } from './StackItemHeading';
40
43
  import { StackItemResizeHandle, type StackItemResizeHandleProps } from './StackItemResizeHandle';
41
44
  import {
42
45
  StackItemSigil,
43
- type StackItemSigilProps,
44
46
  type StackItemSigilAction,
45
- type StackItemSigilButtonProps,
46
47
  StackItemSigilButton,
48
+ type StackItemSigilButtonProps,
49
+ type StackItemSigilProps,
47
50
  } from './StackItemSigil';
48
- import { useStack, StackItemContext, idle, type ItemDragState, useStackItem } from '../StackContext';
49
- import { type StackItemSize, type StackItemData } from '../defs';
50
51
 
51
52
  // NOTE: 48rem fills the screen on a MacbookPro with the sidebars closed.
52
53
  export const DEFAULT_HORIZONTAL_SIZE = 48 satisfies StackItemSize;
@@ -54,6 +54,7 @@ export const StackItemContent = forwardRef<HTMLDivElement, StackItemContentProps
54
54
  },
55
55
  [toolbar, statusbar, layoutManaged],
56
56
  );
57
+
57
58
  return (
58
59
  <div
59
60
  role='none'
@@ -5,14 +5,14 @@
5
5
  import { useFocusableGroup } from '@fluentui/react-tabster';
6
6
  import { Slot } from '@radix-ui/react-slot';
7
7
  import React, {
8
- type ComponentPropsWithoutRef,
9
8
  type ComponentPropsWithRef,
10
- forwardRef,
9
+ type ComponentPropsWithoutRef,
11
10
  type PropsWithChildren,
11
+ forwardRef,
12
12
  } from 'react';
13
13
 
14
14
  import { type ThemedClassName } from '@dxos/react-ui';
15
- import { useAttention, type AttendableId, type Related } from '@dxos/react-ui-attention';
15
+ import { type AttendableId, type Related, useAttention } from '@dxos/react-ui-attention';
16
16
  import { mx } from '@dxos/react-ui-theme';
17
17
 
18
18
  import { useStack } from '../StackContext';
@@ -6,9 +6,10 @@ import React from 'react';
6
6
 
7
7
  import { ResizeHandle } from '@dxos/react-ui-dnd';
8
8
 
9
- import { DEFAULT_EXTRINSIC_SIZE } from './StackItem';
10
9
  import { useStack, useStackItem } from '../StackContext';
11
10
 
11
+ import { DEFAULT_EXTRINSIC_SIZE } from './StackItem';
12
+
12
13
  const MIN_WIDTH = 20;
13
14
  const MIN_HEIGHT = 3;
14
15
 
@@ -11,9 +11,10 @@ import { type AttendableId, type Related, useAttention } from '@dxos/react-ui-at
11
11
  import { descriptionText, mx } from '@dxos/react-ui-theme';
12
12
  import { getHostPlatform } from '@dxos/util';
13
13
 
14
- import { MenuSignifierHorizontal } from './MenuSignifier';
15
14
  import { translationKey } from '../../translations';
16
15
 
16
+ import { MenuSignifierHorizontal } from './MenuSignifier';
17
+
17
18
  export type KeyBinding = {
18
19
  windows?: string;
19
20
  macos?: string;
@@ -12,7 +12,6 @@ import { withTheme } from '@dxos/storybook-utils';
12
12
 
13
13
  import { Card } from './Card';
14
14
 
15
- // Set a seed for reproducible random values
16
15
  faker.seed(0);
17
16
 
18
17
  type CardStoryProps = {
@@ -23,8 +22,27 @@ type CardStoryProps = {
23
22
  showIcon: boolean;
24
23
  };
25
24
 
26
- const meta: Meta<CardStoryProps> = {
25
+ const DefaultStory = ({ title, description, image, showImage, showIcon }: CardStoryProps) => {
26
+ return (
27
+ <div className='max-is-md'>
28
+ <Card.StaticRoot>
29
+ <Card.Toolbar>
30
+ <Card.DragHandle toolbarItem />
31
+ <Card.ToolbarSeparator variant='gap' />
32
+ <Card.ToolbarIconButton iconOnly variant='ghost' icon='ph--x--regular' label={'remove card label'} />
33
+ </Card.Toolbar>
34
+ {showImage && <Card.Poster alt={title} image={image} />}
35
+ {!showImage && showIcon && <Card.Poster alt={title} icon='ph--building-office--regular' />}
36
+ <Card.Heading>{title}</Card.Heading>
37
+ {description && <Card.Text classNames='line-clamp-2'>{description}</Card.Text>}
38
+ </Card.StaticRoot>
39
+ </div>
40
+ );
41
+ };
42
+
43
+ const meta = {
27
44
  title: 'ui/react-ui-stack/Card',
45
+ render: DefaultStory,
28
46
  decorators: [withTheme],
29
47
  argTypes: {
30
48
  title: {
@@ -48,6 +66,13 @@ const meta: Meta<CardStoryProps> = {
48
66
  description: 'Whether to show an icon (when image is not shown)',
49
67
  },
50
68
  },
69
+ } satisfies Meta<typeof DefaultStory>;
70
+
71
+ export default meta;
72
+
73
+ type Story = StoryObj<typeof meta>;
74
+
75
+ export const Default: Story = {
51
76
  args: {
52
77
  title: faker.commerce.productName(),
53
78
  description: faker.lorem.paragraph(),
@@ -56,23 +81,3 @@ const meta: Meta<CardStoryProps> = {
56
81
  showIcon: true,
57
82
  },
58
83
  };
59
-
60
- export default meta;
61
-
62
- export const Default: StoryObj<CardStoryProps> = {
63
- render: ({ title, description, image, showImage, showIcon }: CardStoryProps) => (
64
- <div className='max-is-md'>
65
- <Card.StaticRoot>
66
- <Card.Toolbar>
67
- <Card.DragHandle toolbarItem />
68
- <Card.ToolbarSeparator variant='gap' />
69
- <Card.ToolbarIconButton iconOnly variant='ghost' icon='ph--x--regular' label={'remove card label'} />
70
- </Card.Toolbar>
71
- {showImage && <Card.Poster alt={title} image={image} />}
72
- {!showImage && showIcon && <Card.Poster alt={title} icon='ph--building-office--regular' />}
73
- <Card.Heading>{title}</Card.Heading>
74
- {description && <Card.Text classNames='line-clamp-2'>{description}</Card.Text>}
75
- </Card.StaticRoot>
76
- </div>
77
- ),
78
- };
@@ -5,20 +5,21 @@
5
5
  import { Primitive } from '@radix-ui/react-primitive';
6
6
  import { Slot } from '@radix-ui/react-slot';
7
7
  import React, {
8
- type ComponentPropsWithoutRef,
9
8
  type ComponentPropsWithRef,
9
+ type ComponentPropsWithoutRef,
10
10
  type FC,
11
- forwardRef,
12
11
  type PropsWithChildren,
12
+ forwardRef,
13
13
  } from 'react';
14
14
 
15
15
  import { Icon, IconButton, type ThemedClassName, Toolbar, type ToolbarRootProps, useTranslation } from '@dxos/react-ui';
16
16
  import { hoverableControls, mx } from '@dxos/react-ui-theme';
17
17
 
18
- import { cardChrome, cardRoot, cardHeading, cardText, cardSpacing } from './fragments';
19
18
  import { StackItem } from '../../components';
20
19
  import { translationKey } from '../../translations';
21
20
 
21
+ import { cardChrome, cardHeading, cardRoot, cardSpacing, cardText } from './fragments';
22
+
22
23
  type SharedCardProps = ThemedClassName<ComponentPropsWithoutRef<'div'>> & { asChild?: boolean };
23
24
 
24
25
  const CardStaticRoot = forwardRef<HTMLDivElement, SharedCardProps>(
@@ -62,7 +63,7 @@ const CardSurfaceRoot = ({
62
63
  return (
63
64
  <CardStaticRoot
64
65
  classNames={[
65
- role === 'card--transclusion' && 'mlb-[1em]',
66
+ role === 'card--transclusion' && 'mlb-1',
66
67
  role === 'card--transclusion' && hoverableControls,
67
68
  classNames,
68
69
  ]}
@@ -156,9 +157,9 @@ const CardChrome = forwardRef<HTMLDivElement, SharedCardProps>(
156
157
  },
157
158
  );
158
159
 
159
- const CardText = forwardRef<HTMLParagraphElement, SharedCardProps>(
160
+ const CardText = forwardRef<HTMLDivElement, SharedCardProps>(
160
161
  ({ children, classNames, asChild, role = 'none', ...props }, forwardedRef) => {
161
- const Root = asChild ? Slot : 'p';
162
+ const Root = asChild ? Slot : 'div';
162
163
  const rootProps = asChild ? { classNames: [cardText, classNames] } : { className: mx(cardText, classNames), role };
163
164
  return (
164
165
  <Root {...props} {...rootProps} ref={forwardedRef}>
@@ -6,6 +6,7 @@ export const cardRoot =
6
6
  'rounded overflow-hidden bg-cardSurface border border-separator dark:border-subduedSeparator dx-focus-ring-group-y-indicator relative min-bs-[--rail-item] group/card';
7
7
 
8
8
  export const cardSpacing = 'pli-cardSpacingInline mlb-cardSpacingBlock';
9
+ export const cardNoSpacing = 'pli-0 mlb-0';
9
10
  export const labelSpacing = 'mbs-inputSpacingBlock mbe-labelSpacingBlock';
10
11
 
11
12
  export const cardDialogContent = 'p-0 bs-content min-bs-[8rem] max-bs-full md:max-is-[32rem] overflow-hidden';
@@ -17,7 +18,7 @@ export const cardDialogSearchListRoot =
17
18
 
18
19
  export const cardText = cardSpacing;
19
20
 
20
- export const cardHeading = 'text-lg font-medium line-clamp-2';
21
+ export const cardHeading = 'text-lg font-medium line-clamp-2 grow';
21
22
 
22
23
  export const cardChrome =
23
24
  'pli-[--dx-cardSpacingChrome] mlb-[--dx-cardSpacingChrome] [&_.dx-button]:text-start [&_.dx-button]:is-full';
@@ -6,17 +6,17 @@ import '@dxos-theme';
6
6
 
7
7
  import { type Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
8
8
  import { type Meta, type StoryObj } from '@storybook/react-vite';
9
- import React, { useState, useCallback } from 'react';
9
+ import React, { useCallback, useState } from 'react';
10
10
 
11
11
  import { faker } from '@dxos/random';
12
12
  import { IconButton } from '@dxos/react-ui';
13
13
  import { withLayout, withTheme } from '@dxos/storybook-utils';
14
14
 
15
- import { CardStack } from './CardStack';
16
15
  import { StackItem } from '../../components';
17
16
  import { Card, CardDragPreview } from '../Card';
18
17
 
19
- // Set a seed for reproducible random values
18
+ import { CardStack } from './CardStack';
19
+
20
20
  faker.seed(0);
21
21
 
22
22
  type CardItem = {
@@ -130,7 +130,7 @@ const CardStackStory = () => {
130
130
  <Card.Text classNames='line-clamp-2'>{card.description}</Card.Text>
131
131
  </Card.StaticRoot>
132
132
  <StackItem.DragPreview>
133
- {({ item }) => (
133
+ {() => (
134
134
  <CardDragPreview.Root>
135
135
  <CardDragPreview.Content>
136
136
  <Card.Toolbar>
@@ -159,11 +159,11 @@ const CardStackStory = () => {
159
159
  );
160
160
  };
161
161
 
162
- const meta: Meta<typeof CardStackStory> = {
162
+ const meta = {
163
163
  title: 'ui/react-ui-stack/CardStack',
164
164
  component: CardStackStory,
165
165
  decorators: [withTheme, withLayout({ fullscreen: true })],
166
- };
166
+ } satisfies Meta<typeof CardStackStory>;
167
167
 
168
168
  export default meta;
169
169
 
@@ -8,7 +8,7 @@ import React, { type ComponentPropsWithoutRef, forwardRef } from 'react';
8
8
  import type { ThemedClassName } from '@dxos/react-ui';
9
9
  import { mx } from '@dxos/react-ui-theme';
10
10
 
11
- import { railGridHorizontalContainFitContent, Stack, type StackProps } from '../../components';
11
+ import { Stack, type StackProps, railGridHorizontalContainFitContent } from '../../components';
12
12
  import { Card } from '../Card';
13
13
 
14
14
  type SharedCardStackProps = ThemedClassName<ComponentPropsWithoutRef<'div'>> & { asChild?: boolean };
@@ -8,7 +8,7 @@ import { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-sc
8
8
  import { attachClosestEdge, extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
9
9
  import { useLayoutEffect, useState } from 'react';
10
10
 
11
- import { type StackItemRearrangeHandler, type StackItemData, type Orientation } from '../components';
11
+ import { type Orientation, type StackItemData, type StackItemRearrangeHandler } from '../components';
12
12
 
13
13
  /**
14
14
  * Hook to handle drag and drop functionality for Stack components.
@@ -16,18 +16,21 @@ export const CardContainer = ({
16
16
  switch (role) {
17
17
  case 'card--popover':
18
18
  return <PopoverCardContainer icon={icon}>{children}</PopoverCardContainer>;
19
- case 'card--intrinsic':
20
- return (
21
- <IntrinsicCardContainer>
22
- <Card.StaticRoot>{children}</Card.StaticRoot>
23
- </IntrinsicCardContainer>
24
- );
19
+
25
20
  case 'card--extrinsic':
26
21
  return (
27
22
  <ExtrinsicCardContainer>
28
23
  <Card.StaticRoot>{children}</Card.StaticRoot>
29
24
  </ExtrinsicCardContainer>
30
25
  );
26
+
27
+ case 'card--intrinsic':
28
+ return (
29
+ <IntrinsicCardContainer>
30
+ <Card.StaticRoot>{children}</Card.StaticRoot>
31
+ </IntrinsicCardContainer>
32
+ );
33
+
31
34
  default:
32
35
  return <Card.StaticRoot>{children}</Card.StaticRoot>;
33
36
  }