@dxos/react-ui-stack 0.8.4-main.dedc0f3 → 0.8.4-main.dfabb4ec29

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 (122) hide show
  1. package/dist/lib/browser/index.mjs +704 -67
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/browser/playwright/index.mjs +10 -23
  5. package/dist/lib/browser/playwright/index.mjs.map +2 -2
  6. package/dist/lib/browser/translations.mjs +23 -0
  7. package/dist/lib/browser/translations.mjs.map +7 -0
  8. package/dist/lib/node-esm/index.mjs +705 -67
  9. package/dist/lib/node-esm/index.mjs.map +4 -4
  10. package/dist/lib/node-esm/meta.json +1 -1
  11. package/dist/lib/node-esm/playwright/index.mjs +10 -23
  12. package/dist/lib/node-esm/playwright/index.mjs.map +2 -2
  13. package/dist/lib/node-esm/translations.mjs +25 -0
  14. package/dist/lib/node-esm/translations.mjs.map +7 -0
  15. package/dist/types/src/components/Stack/Stack.d.ts +5 -9
  16. package/dist/types/src/components/Stack/Stack.d.ts.map +1 -1
  17. package/dist/types/src/components/Stack/Stack.stories.d.ts +1 -2
  18. package/dist/types/src/components/Stack/Stack.stories.d.ts.map +1 -1
  19. package/dist/types/src/components/StackContext.d.ts +1 -1
  20. package/dist/types/src/components/StackContext.d.ts.map +1 -1
  21. package/dist/types/src/components/StackItem/MenuSignifier.d.ts.map +1 -1
  22. package/dist/types/src/components/StackItem/StackItem.d.ts +12 -15
  23. package/dist/types/src/components/StackItem/StackItem.d.ts.map +1 -1
  24. package/dist/types/src/components/StackItem/StackItem.stories.d.ts +0 -1
  25. package/dist/types/src/components/StackItem/StackItem.stories.d.ts.map +1 -1
  26. package/dist/types/src/components/StackItem/StackItemContent.d.ts +4 -37
  27. package/dist/types/src/components/StackItem/StackItemContent.d.ts.map +1 -1
  28. package/dist/types/src/components/StackItem/StackItemDragHandle.d.ts.map +1 -1
  29. package/dist/types/src/components/StackItem/StackItemHeading.d.ts +1 -1
  30. package/dist/types/src/components/StackItem/StackItemHeading.d.ts.map +1 -1
  31. package/dist/types/src/components/StackItem/StackItemResizeHandle.d.ts +1 -1
  32. package/dist/types/src/components/StackItem/StackItemResizeHandle.d.ts.map +1 -1
  33. package/dist/types/src/components/StackItem/StackItemSigil.d.ts +2 -2
  34. package/dist/types/src/components/StackItem/StackItemSigil.d.ts.map +1 -1
  35. package/dist/types/src/components/index.d.ts +1 -2
  36. package/dist/types/src/components/index.d.ts.map +1 -1
  37. package/dist/types/src/components/{defs.d.ts → types.d.ts} +1 -1
  38. package/dist/types/src/components/types.d.ts.map +1 -0
  39. package/dist/types/src/hooks/useStackDropForElements.d.ts +8 -6
  40. package/dist/types/src/hooks/useStackDropForElements.d.ts.map +1 -1
  41. package/dist/types/src/index.d.ts +0 -2
  42. package/dist/types/src/index.d.ts.map +1 -1
  43. package/dist/types/src/playwright/playwright.config.d.ts.map +1 -1
  44. package/dist/types/src/playwright/stack-manager.d.ts.map +1 -1
  45. package/dist/types/src/translations.d.ts +10 -10
  46. package/dist/types/src/translations.d.ts.map +1 -1
  47. package/dist/types/tsconfig.tsbuildinfo +1 -1
  48. package/package.json +49 -47
  49. package/src/components/Stack/Stack.stories.tsx +10 -14
  50. package/src/components/Stack/Stack.tsx +216 -172
  51. package/src/components/StackContext.tsx +1 -1
  52. package/src/components/StackItem/MenuSignifier.tsx +2 -9
  53. package/src/components/StackItem/StackItem.stories.tsx +8 -8
  54. package/src/components/StackItem/StackItem.tsx +48 -31
  55. package/src/components/StackItem/StackItemContent.tsx +23 -44
  56. package/src/components/StackItem/StackItemDragHandle.tsx +4 -3
  57. package/src/components/StackItem/StackItemHeading.tsx +14 -21
  58. package/src/components/StackItem/StackItemResizeHandle.tsx +1 -2
  59. package/src/components/StackItem/StackItemSigil.tsx +10 -7
  60. package/src/components/index.ts +2 -2
  61. package/src/hooks/useStackDropForElements.ts +60 -46
  62. package/src/index.ts +0 -4
  63. package/src/playwright/playwright.config.ts +1 -1
  64. package/src/translations.ts +9 -9
  65. package/dist/lib/browser/chunk-3V2YUQK5.mjs +0 -1375
  66. package/dist/lib/browser/chunk-3V2YUQK5.mjs.map +0 -7
  67. package/dist/lib/browser/testing/index.mjs +0 -31
  68. package/dist/lib/browser/testing/index.mjs.map +0 -7
  69. package/dist/lib/node-esm/chunk-HE3BRF7A.mjs +0 -1377
  70. package/dist/lib/node-esm/chunk-HE3BRF7A.mjs.map +0 -7
  71. package/dist/lib/node-esm/testing/index.mjs +0 -32
  72. package/dist/lib/node-esm/testing/index.mjs.map +0 -7
  73. package/dist/types/src/components/Image/Image.d.ts +0 -11
  74. package/dist/types/src/components/Image/Image.d.ts.map +0 -1
  75. package/dist/types/src/components/Image/Image.stories.d.ts +0 -31
  76. package/dist/types/src/components/Image/Image.stories.d.ts.map +0 -1
  77. package/dist/types/src/components/Image/index.d.ts +0 -2
  78. package/dist/types/src/components/Image/index.d.ts.map +0 -1
  79. package/dist/types/src/components/defs.d.ts.map +0 -1
  80. package/dist/types/src/components/deprecated/LayoutControls.d.ts +0 -19
  81. package/dist/types/src/components/deprecated/LayoutControls.d.ts.map +0 -1
  82. package/dist/types/src/exemplars/Card/Card.d.ts +0 -58
  83. package/dist/types/src/exemplars/Card/Card.d.ts.map +0 -1
  84. package/dist/types/src/exemplars/Card/Card.stories.d.ts +0 -44
  85. package/dist/types/src/exemplars/Card/Card.stories.d.ts.map +0 -1
  86. package/dist/types/src/exemplars/Card/CardDragPreview.d.ts +0 -6
  87. package/dist/types/src/exemplars/Card/CardDragPreview.d.ts.map +0 -1
  88. package/dist/types/src/exemplars/Card/fragments.d.ts +0 -13
  89. package/dist/types/src/exemplars/Card/fragments.d.ts.map +0 -1
  90. package/dist/types/src/exemplars/Card/index.d.ts +0 -4
  91. package/dist/types/src/exemplars/Card/index.d.ts.map +0 -1
  92. package/dist/types/src/exemplars/CardStack/CardStack.d.ts +0 -40
  93. package/dist/types/src/exemplars/CardStack/CardStack.d.ts.map +0 -1
  94. package/dist/types/src/exemplars/CardStack/CardStack.stories.d.ts +0 -13
  95. package/dist/types/src/exemplars/CardStack/CardStack.stories.d.ts.map +0 -1
  96. package/dist/types/src/exemplars/CardStack/CardStackDragPreview.d.ts +0 -9
  97. package/dist/types/src/exemplars/CardStack/CardStackDragPreview.d.ts.map +0 -1
  98. package/dist/types/src/exemplars/CardStack/index.d.ts +0 -3
  99. package/dist/types/src/exemplars/CardStack/index.d.ts.map +0 -1
  100. package/dist/types/src/exemplars/index.d.ts +0 -3
  101. package/dist/types/src/exemplars/index.d.ts.map +0 -1
  102. package/dist/types/src/testing/CardContainer.d.ts +0 -6
  103. package/dist/types/src/testing/CardContainer.d.ts.map +0 -1
  104. package/dist/types/src/testing/index.d.ts +0 -2
  105. package/dist/types/src/testing/index.d.ts.map +0 -1
  106. package/src/components/Image/Image.stories.tsx +0 -58
  107. package/src/components/Image/Image.tsx +0 -137
  108. package/src/components/Image/index.ts +0 -5
  109. package/src/components/deprecated/LayoutControls.tsx +0 -109
  110. package/src/exemplars/Card/Card.stories.tsx +0 -88
  111. package/src/exemplars/Card/Card.tsx +0 -186
  112. package/src/exemplars/Card/CardDragPreview.tsx +0 -22
  113. package/src/exemplars/Card/fragments.ts +0 -24
  114. package/src/exemplars/Card/index.ts +0 -7
  115. package/src/exemplars/CardStack/CardStack.stories.tsx +0 -172
  116. package/src/exemplars/CardStack/CardStack.tsx +0 -136
  117. package/src/exemplars/CardStack/CardStackDragPreview.tsx +0 -61
  118. package/src/exemplars/CardStack/index.ts +0 -6
  119. package/src/exemplars/index.ts +0 -6
  120. package/src/testing/CardContainer.tsx +0 -37
  121. package/src/testing/index.ts +0 -5
  122. /package/src/components/{defs.ts → types.ts} +0 -0
@@ -1,24 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- export const cardRoot =
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
-
8
- export const cardSpacing = 'pli-cardSpacingInline mlb-cardSpacingBlock';
9
- export const cardNoSpacing = 'pli-0 mlb-0';
10
- export const labelSpacing = 'mbs-inputSpacingBlock mbe-labelSpacingBlock';
11
-
12
- export const cardDialogContent = 'p-0 bs-content min-bs-[8rem] max-bs-full md:max-is-[32rem] overflow-hidden';
13
- export const cardDialogHeader = 'pli-cardSpacingInline mbs-cardSpacingBlock flex justify-between';
14
- export const cardDialogOverflow = 'overflow-y-auto min-bs-0 flex-1';
15
- export const cardDialogPaddedOverflow = `${cardDialogOverflow} plb-cardSpacingBlock`;
16
- export const cardDialogSearchListRoot =
17
- 'pli-cardSpacingInline pbs-cardSpacingBlock [&>input]:mbe-0 min-bs-0 flex-1 flex flex-col';
18
-
19
- export const cardText = cardSpacing;
20
-
21
- export const cardHeading = 'text-lg font-medium line-clamp-2 grow';
22
-
23
- export const cardChrome =
24
- 'pli-[--dx-cardSpacingChrome] mlb-[--dx-cardSpacingChrome] [&_.dx-button]:text-start [&_.dx-button]:is-full';
@@ -1,7 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- export * from './Card';
6
- export * from './CardDragPreview';
7
- export * from './fragments';
@@ -1,172 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import '@dxos-theme';
6
-
7
- import { type Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';
8
- import { type Meta, type StoryObj } from '@storybook/react-vite';
9
- import React, { useCallback, useState } from 'react';
10
-
11
- import { faker } from '@dxos/random';
12
- import { IconButton } from '@dxos/react-ui';
13
- import { withLayout, withTheme } from '@dxos/storybook-utils';
14
-
15
- import { StackItem } from '../../components';
16
- import { Card, CardDragPreview } from '../Card';
17
-
18
- import { CardStack } from './CardStack';
19
-
20
- faker.seed(0);
21
-
22
- type CardItem = {
23
- id: string;
24
- title: string;
25
- description: string;
26
- image: string;
27
- };
28
-
29
- type StackItemData = {
30
- id: string;
31
- type?: 'column' | 'card';
32
- };
33
-
34
- const CardStackStory = () => {
35
- const [column, setColumn] = useState<CardItem[]>(
36
- faker.helpers.multiple(
37
- () => ({
38
- id: faker.string.uuid(),
39
- title: faker.commerce.productName(),
40
- description: faker.lorem.paragraph(),
41
- image: faker.image.url(),
42
- }),
43
- { count: 12 },
44
- ),
45
- );
46
-
47
- const handleRearrange = useCallback((source: StackItemData, target: StackItemData, closestEdge: Edge | null) => {
48
- setColumn((prevColumn) => {
49
- const newColumns = [...prevColumn];
50
- // Reordering cards within a column
51
- const sourceCardIndex = prevColumn.findIndex((card) => card.id === source.id);
52
- const targetCardIndex = prevColumn.findIndex((card) => card.id === target.id);
53
-
54
- if (typeof sourceCardIndex === 'number' && typeof targetCardIndex === 'number') {
55
- const [movedCard] = newColumns.splice(sourceCardIndex, 1);
56
-
57
- let insertIndex;
58
- if (sourceCardIndex < targetCardIndex) {
59
- insertIndex = closestEdge === 'bottom' ? targetCardIndex : targetCardIndex - 1;
60
- } else {
61
- insertIndex = closestEdge === 'bottom' ? targetCardIndex + 1 : targetCardIndex;
62
- }
63
- newColumns.splice(insertIndex, 0, movedCard);
64
- }
65
- return newColumns;
66
- });
67
- }, []);
68
-
69
- const handleAddCard = useCallback(() => {
70
- setColumn((prevColumn) => {
71
- const newColumn = [...prevColumn];
72
- const newCard = {
73
- id: faker.string.uuid(),
74
- title: faker.commerce.productName(),
75
- description: faker.lorem.paragraph(),
76
- image: faker.image.url(),
77
- } satisfies CardItem;
78
- newColumn.push(newCard);
79
- console.log('[add card]', prevColumn.length, newColumn.length);
80
- return newColumn;
81
- });
82
- }, []);
83
-
84
- const handleRemoveCard = useCallback((cardId: string) => {
85
- setColumn((prevColumn) => {
86
- const newColumn = [...prevColumn];
87
-
88
- const cardIndex = prevColumn.findIndex((card) => card.id === cardId);
89
- if (cardIndex !== -1) {
90
- newColumn.splice(cardIndex, 1);
91
- }
92
-
93
- return newColumn;
94
- });
95
- }, []);
96
-
97
- return (
98
- <CardStack.Root classNames='is-96'>
99
- <CardStack.Content>
100
- <CardStack.Stack id='story column' onRearrange={handleRearrange} itemsCount={column.length}>
101
- {column.map((card, cardIndex, cardsArray) => {
102
- const cardItem = { id: card.id, type: 'card' as const };
103
- const prevCardId = cardIndex > 0 ? cardsArray[cardIndex - 1].id : undefined;
104
- const nextCardId = cardIndex < cardsArray.length - 1 ? cardsArray[cardIndex + 1].id : undefined;
105
-
106
- return (
107
- <CardStack.Item asChild key={card.id}>
108
- <StackItem.Root
109
- item={cardItem}
110
- focusIndicatorVariant='group'
111
- prevSiblingId={prevCardId}
112
- nextSiblingId={nextCardId}
113
- >
114
- <Card.StaticRoot>
115
- <Card.Toolbar>
116
- <StackItem.DragHandle asChild>
117
- <Card.DragHandle toolbarItem />
118
- </StackItem.DragHandle>
119
- <Card.ToolbarSeparator variant='gap' />
120
- <Card.ToolbarIconButton
121
- iconOnly
122
- variant='ghost'
123
- icon='ph--x--regular'
124
- label='Remove card'
125
- onClick={() => handleRemoveCard(card.id)}
126
- />
127
- </Card.Toolbar>
128
- <Card.Poster alt={card.title} image={card.image} />
129
- <Card.Heading>{card.title}</Card.Heading>
130
- <Card.Text classNames='line-clamp-2'>{card.description}</Card.Text>
131
- </Card.StaticRoot>
132
- <StackItem.DragPreview>
133
- {() => (
134
- <CardDragPreview.Root>
135
- <CardDragPreview.Content>
136
- <Card.Toolbar>
137
- <Card.DragHandle toolbarItem />
138
- </Card.Toolbar>
139
- <Card.Poster alt={card.title} image={card.image} />
140
- <Card.Heading>{card.title}</Card.Heading>
141
- <Card.Text classNames='line-clamp-2'>{card.description}</Card.Text>
142
- </CardDragPreview.Content>
143
- </CardDragPreview.Root>
144
- )}
145
- </StackItem.DragPreview>
146
- </StackItem.Root>
147
- </CardStack.Item>
148
- );
149
- })}
150
- </CardStack.Stack>
151
-
152
- <CardStack.Footer>
153
- <IconButton icon='ph--plus--regular' label='Add card' onClick={handleAddCard} classNames='is-full' />
154
- </CardStack.Footer>
155
-
156
- <CardStack.Heading>{faker.company.name()}</CardStack.Heading>
157
- </CardStack.Content>
158
- </CardStack.Root>
159
- );
160
- };
161
-
162
- const meta = {
163
- title: 'ui/react-ui-stack/CardStack',
164
- component: CardStackStory,
165
- decorators: [withTheme, withLayout({ fullscreen: true })],
166
- } satisfies Meta<typeof CardStackStory>;
167
-
168
- export default meta;
169
-
170
- type Story = StoryObj<typeof CardStackStory>;
171
-
172
- export const Default: Story = {};
@@ -1,136 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Slot } from '@radix-ui/react-slot';
6
- import React, { type ComponentPropsWithoutRef, forwardRef } from 'react';
7
-
8
- import type { ThemedClassName } from '@dxos/react-ui';
9
- import { mx } from '@dxos/react-ui-theme';
10
-
11
- import { Stack, type StackProps, railGridHorizontalContainFitContent } from '../../components';
12
- import { Card } from '../Card';
13
-
14
- type SharedCardStackProps = ThemedClassName<ComponentPropsWithoutRef<'div'>> & { asChild?: boolean };
15
-
16
- const CardStackStack = forwardRef<
17
- HTMLDivElement,
18
- Omit<StackProps, 'orientation' | 'size' | 'rail' | 'separatorOnScroll'>
19
- >(({ children, classNames, itemsCount = 0, ...props }, forwardedRef) => {
20
- return (
21
- <Stack
22
- orientation='vertical'
23
- size='contain'
24
- rail={false}
25
- classNames={
26
- /* NOTE(thure): Do not let this element have zero intrinsic size, otherwise the drop indicator will not display. See #9035. */
27
- ['plb-1', itemsCount > 0 && 'plb-2', classNames]
28
- }
29
- itemsCount={itemsCount}
30
- separatorOnScroll={9}
31
- data-density='fine'
32
- {...props}
33
- ref={forwardedRef}
34
- >
35
- {children}
36
- </Stack>
37
- );
38
- });
39
-
40
- const CardStackDragHandle = Card.DragHandle;
41
-
42
- const cardStackHeading = 'mli-2 order-first bg-transparent rounded-bs-md flex items-center';
43
-
44
- const CardStackHeading = forwardRef<HTMLDivElement, SharedCardStackProps>(
45
- ({ children, classNames, asChild, role = 'heading', ...props }, forwardedRef) => {
46
- const Root = asChild ? Slot : 'div';
47
- const rootProps = asChild
48
- ? { classNames: [cardStackHeading, classNames] }
49
- : { className: mx(cardStackHeading, classNames), role };
50
- return (
51
- <Root {...props} {...rootProps} ref={forwardedRef}>
52
- {children}
53
- </Root>
54
- );
55
- },
56
- );
57
-
58
- const cardStackFooter =
59
- 'plb-2 mli-2 border-bs border-transparent [[data-scroll-separator-end="true"]_&]:border-subduedSeparator';
60
-
61
- const CardStackFooter = forwardRef<HTMLDivElement, SharedCardStackProps>(
62
- ({ children, classNames, asChild, role = 'none', ...props }, forwardedRef) => {
63
- const Root = asChild ? Slot : 'div';
64
- const rootProps = asChild
65
- ? { classNames: [cardStackFooter, classNames] }
66
- : { className: mx(cardStackFooter, classNames), role };
67
- return (
68
- <Root {...props} {...rootProps} ref={forwardedRef}>
69
- {children}
70
- </Root>
71
- );
72
- },
73
- );
74
-
75
- const cardStackContent = [
76
- 'shrink min-bs-0 bg-baseSurface border border-separator rounded-md grid dx-focus-ring-group-x-indicator kanban-drop',
77
- railGridHorizontalContainFitContent,
78
- ];
79
-
80
- const CardStackContent = forwardRef<HTMLDivElement, SharedCardStackProps>(
81
- ({ children, classNames, asChild, role = 'none', ...props }, forwardedRef) => {
82
- const Root = asChild ? Slot : 'div';
83
- const rootProps = asChild
84
- ? { classNames: [...cardStackContent, classNames] }
85
- : { className: mx(...cardStackContent, classNames), role };
86
- return (
87
- <Root {...props} {...rootProps} data-scroll-separator='false' ref={forwardedRef}>
88
- {children}
89
- </Root>
90
- );
91
- },
92
- );
93
-
94
- const cardStackRoot = 'flex flex-col pli-2 plb-2';
95
-
96
- const CardStackRoot = forwardRef<HTMLDivElement, SharedCardStackProps>(
97
- ({ children, classNames, asChild, role = 'none', ...props }, forwardedRef) => {
98
- const Root = asChild ? Slot : 'div';
99
- const rootProps = asChild
100
- ? { classNames: [cardStackRoot, classNames] }
101
- : { className: mx(cardStackRoot, classNames), role };
102
- return (
103
- <Root {...props} {...rootProps} ref={forwardedRef}>
104
- {children}
105
- </Root>
106
- );
107
- },
108
- );
109
-
110
- const cardStackItem = 'contain-layout pli-2 plb-1 first-of-type:pbs-0 last-of-type:pbe-0';
111
-
112
- const CardStackItem = forwardRef<HTMLDivElement, SharedCardStackProps>(
113
- ({ children, classNames, asChild, role = 'none', ...props }, forwardedRef) => {
114
- const Root = asChild ? Slot : 'div';
115
- const rootProps = asChild
116
- ? { classNames: [cardStackItem, classNames] }
117
- : { className: mx(cardStackItem, classNames), role };
118
- return (
119
- <Root {...props} {...rootProps} ref={forwardedRef}>
120
- {children}
121
- </Root>
122
- );
123
- },
124
- );
125
-
126
- export const CardStack = {
127
- Root: CardStackRoot,
128
- Content: CardStackContent,
129
- Stack: CardStackStack,
130
- Heading: CardStackHeading,
131
- Footer: CardStackFooter,
132
- DragHandle: CardStackDragHandle,
133
- Item: CardStackItem,
134
- };
135
-
136
- export { cardStackRoot, cardStackFooter, cardStackHeading, cardStackContent, cardStackItem };
@@ -1,61 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import React, { type PropsWithChildren } from 'react';
6
-
7
- import { IconButton, useTranslation } from '@dxos/react-ui';
8
- import { mx } from '@dxos/react-ui-theme';
9
-
10
- import { type StackProps } from '../../components';
11
- import { translationKey } from '../../translations';
12
-
13
- const CardStackDragPreviewRoot = ({ children }: PropsWithChildren<{}>) => {
14
- return (
15
- <div className='p-2'>
16
- <div className='rounded-md max-bs-[calc(100dvh-1rem)] overflow-hidden bg-baseSurface border border-separator ring-focusLine ring-neutralFocusIndicator flex flex-col'>
17
- {children}
18
- </div>
19
- </div>
20
- );
21
- };
22
-
23
- const CardStackDragPreviewHeading = ({ children }: PropsWithChildren<{}>) => {
24
- const { t } = useTranslation(translationKey);
25
- return (
26
- <div className='flex items-center p-2'>
27
- <IconButton
28
- iconOnly
29
- icon='ph--dots-six-vertical--regular'
30
- variant='ghost'
31
- label={t('column drag handle label')}
32
- classNames='pli-2'
33
- />
34
- {children}
35
- </div>
36
- );
37
- };
38
-
39
- const CardStackDragPreviewContent = ({
40
- children,
41
- itemsCount = 0,
42
- }: PropsWithChildren<Pick<StackProps, 'itemsCount'>>) => {
43
- return (
44
- <div
45
- className={mx('overflow-y-auto flex-1 pli-2 flex flex-col gap-2', 'plb-1', itemsCount > 0 ? 'plb-2' : 'plb-1')}
46
- >
47
- {children}
48
- </div>
49
- );
50
- };
51
-
52
- const CardStackDragPreviewFooter = ({ children }: PropsWithChildren<{}>) => {
53
- return <div className='p-2 border-t border-separator'>{children}</div>;
54
- };
55
-
56
- export const CardStackDragPreview = {
57
- Root: CardStackDragPreviewRoot,
58
- Heading: CardStackDragPreviewHeading,
59
- Content: CardStackDragPreviewContent,
60
- Footer: CardStackDragPreviewFooter,
61
- };
@@ -1,6 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- export * from './CardStack';
6
- export * from './CardStackDragPreview';
@@ -1,6 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- export * from './Card';
6
- export * from './CardStack';
@@ -1,37 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import React, { type PropsWithChildren } from 'react';
6
-
7
- import { ExtrinsicCardContainer, IntrinsicCardContainer, PopoverCardContainer } from '@dxos/storybook-utils';
8
-
9
- import { Card } from '../exemplars';
10
-
11
- export const CardContainer = ({
12
- children,
13
- icon = 'ph--placeholder--regular',
14
- role,
15
- }: PropsWithChildren<{ icon?: string; role?: string }>) => {
16
- switch (role) {
17
- case 'card--popover':
18
- return <PopoverCardContainer icon={icon}>{children}</PopoverCardContainer>;
19
-
20
- case 'card--extrinsic':
21
- return (
22
- <ExtrinsicCardContainer>
23
- <Card.StaticRoot>{children}</Card.StaticRoot>
24
- </ExtrinsicCardContainer>
25
- );
26
-
27
- case 'card--intrinsic':
28
- return (
29
- <IntrinsicCardContainer>
30
- <Card.StaticRoot>{children}</Card.StaticRoot>
31
- </IntrinsicCardContainer>
32
- );
33
-
34
- default:
35
- return <Card.StaticRoot>{children}</Card.StaticRoot>;
36
- }
37
- };
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- export * from './CardContainer';
File without changes