@dxos/react-ui-stack 0.8.4-main.84f28bd → 0.8.4-main.b97322e

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 (43) hide show
  1. package/dist/lib/browser/chunk-P3TQV4BA.mjs +1198 -0
  2. package/dist/lib/browser/chunk-P3TQV4BA.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +37 -1158
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/playwright/index.mjs +57 -0
  7. package/dist/lib/browser/playwright/index.mjs.map +7 -0
  8. package/dist/lib/browser/testing/index.mjs +25 -51
  9. package/dist/lib/browser/testing/index.mjs.map +4 -4
  10. package/dist/lib/node-esm/chunk-3WVEPAJ4.mjs +1200 -0
  11. package/dist/lib/node-esm/chunk-3WVEPAJ4.mjs.map +7 -0
  12. package/dist/lib/node-esm/index.mjs +37 -1159
  13. package/dist/lib/node-esm/index.mjs.map +4 -4
  14. package/dist/lib/node-esm/meta.json +1 -1
  15. package/dist/lib/node-esm/playwright/index.mjs +59 -0
  16. package/dist/lib/node-esm/playwright/index.mjs.map +7 -0
  17. package/dist/lib/node-esm/testing/index.mjs +24 -51
  18. package/dist/lib/node-esm/testing/index.mjs.map +4 -4
  19. package/dist/types/src/components/StackItem/StackItem.d.ts +1 -1
  20. package/dist/types/src/components/StackItem/StackItemContent.d.ts +2 -2
  21. package/dist/types/src/components/StackItem/StackItemContent.d.ts.map +1 -1
  22. package/dist/types/src/components/index.d.ts +1 -1
  23. package/dist/types/src/components/index.d.ts.map +1 -1
  24. package/dist/types/src/exemplars/Card/Card.d.ts +3 -2
  25. package/dist/types/src/exemplars/Card/Card.d.ts.map +1 -1
  26. package/dist/types/src/playwright/index.d.ts +2 -0
  27. package/dist/types/src/playwright/index.d.ts.map +1 -0
  28. package/dist/types/src/playwright/stack-manager.d.ts.map +1 -0
  29. package/dist/types/src/testing/CardContainer.d.ts +6 -0
  30. package/dist/types/src/testing/CardContainer.d.ts.map +1 -0
  31. package/dist/types/src/testing/index.d.ts +1 -1
  32. package/dist/types/tsconfig.tsbuildinfo +1 -1
  33. package/package.json +29 -23
  34. package/src/components/StackItem/StackItemContent.tsx +3 -3
  35. package/src/components/index.ts +1 -1
  36. package/src/exemplars/Card/Card.tsx +23 -4
  37. package/src/playwright/index.ts +5 -0
  38. package/src/playwright/smoke.spec.ts +1 -1
  39. package/src/testing/CardContainer.tsx +34 -0
  40. package/src/testing/index.ts +1 -1
  41. package/dist/types/src/testing/stack-manager.d.ts.map +0 -1
  42. /package/dist/types/src/{testing → playwright}/stack-manager.d.ts +0 -0
  43. /package/src/{testing → playwright}/stack-manager.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-stack",
3
- "version": "0.8.4-main.84f28bd",
3
+ "version": "0.8.4-main.b97322e",
4
4
  "description": "A stack component.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -14,18 +14,23 @@
14
14
  "browser": "./dist/lib/browser/index.mjs",
15
15
  "node": "./dist/lib/node-esm/index.mjs"
16
16
  },
17
+ "./playwright": {
18
+ "types": "./dist/types/src/playwright/index.d.ts",
19
+ "browser": "./dist/lib/browser/playwright/index.mjs",
20
+ "node": "./dist/lib/node-esm/playwright/index.mjs"
21
+ },
17
22
  "./testing": {
18
23
  "types": "./dist/types/src/testing/index.d.ts",
19
24
  "browser": "./dist/lib/browser/testing/index.mjs",
20
- "node": {
21
- "require": "./dist/lib/node/testing/index.cjs",
22
- "default": "./dist/lib/node-esm/testing/index.mjs"
23
- }
25
+ "node": "./dist/lib/node-esm/testing/index.mjs"
24
26
  }
25
27
  },
26
28
  "types": "dist/types/src/index.d.ts",
27
29
  "typesVersions": {
28
30
  "*": {
31
+ "playwright": [
32
+ "dist/types/src/playwright/index.d.ts"
33
+ ],
29
34
  "testing": [
30
35
  "dist/types/src/testing/index.d.ts"
31
36
  ]
@@ -49,12 +54,13 @@
49
54
  "@radix-ui/react-slot": "1.1.2",
50
55
  "@radix-ui/react-use-controllable-state": "1.1.0",
51
56
  "react-resize-detector": "^11.0.1",
52
- "@dxos/echo-schema": "0.8.4-main.84f28bd",
53
- "@dxos/keyboard": "0.8.4-main.84f28bd",
54
- "@dxos/react-ui-attention": "0.8.4-main.84f28bd",
55
- "@dxos/util": "0.8.4-main.84f28bd",
56
- "@dxos/live-object": "0.8.4-main.84f28bd",
57
- "@dxos/react-ui-dnd": "0.8.4-main.84f28bd"
57
+ "@dxos/echo-schema": "0.8.4-main.b97322e",
58
+ "@dxos/keyboard": "0.8.4-main.b97322e",
59
+ "@dxos/live-object": "0.8.4-main.b97322e",
60
+ "@dxos/storybook-utils": "0.8.4-main.b97322e",
61
+ "@dxos/react-ui-dnd": "0.8.4-main.b97322e",
62
+ "@dxos/util": "0.8.4-main.b97322e",
63
+ "@dxos/react-ui-attention": "0.8.4-main.b97322e"
58
64
  },
59
65
  "devDependencies": {
60
66
  "@types/react": "~18.2.0",
@@ -62,22 +68,22 @@
62
68
  "react": "~18.2.0",
63
69
  "react-dom": "~18.2.0",
64
70
  "vite": "5.4.7",
65
- "@dxos/echo-schema": "0.8.4-main.84f28bd",
66
- "@dxos/client": "0.8.4-main.84f28bd",
67
- "@dxos/app-graph": "0.8.4-main.84f28bd",
68
- "@dxos/random": "0.8.4-main.84f28bd",
69
- "@dxos/react-ui": "0.8.4-main.84f28bd",
70
- "@dxos/react-ui-theme": "0.8.4-main.84f28bd",
71
- "@dxos/storybook-utils": "0.8.4-main.84f28bd",
72
- "@dxos/test-utils": "0.8.4-main.84f28bd"
71
+ "@dxos/app-graph": "0.8.4-main.b97322e",
72
+ "@dxos/client": "0.8.4-main.b97322e",
73
+ "@dxos/echo-schema": "0.8.4-main.b97322e",
74
+ "@dxos/random": "0.8.4-main.b97322e",
75
+ "@dxos/react-ui": "0.8.4-main.b97322e",
76
+ "@dxos/storybook-utils": "0.8.4-main.b97322e",
77
+ "@dxos/react-ui-theme": "0.8.4-main.b97322e",
78
+ "@dxos/test-utils": "0.8.4-main.b97322e"
73
79
  },
74
80
  "peerDependencies": {
75
81
  "react": "~18.2.0",
76
82
  "react-dom": "~18.2.0",
77
- "@dxos/client": "0.8.4-main.84f28bd",
78
- "@dxos/random": "0.8.4-main.84f28bd",
79
- "@dxos/react-ui": "0.8.4-main.84f28bd",
80
- "@dxos/react-ui-theme": "0.8.4-main.84f28bd"
83
+ "@dxos/client": "0.8.4-main.b97322e",
84
+ "@dxos/random": "0.8.4-main.b97322e",
85
+ "@dxos/react-ui": "0.8.4-main.b97322e",
86
+ "@dxos/react-ui-theme": "0.8.4-main.b97322e"
81
87
  },
82
88
  "publishConfig": {
83
89
  "access": "public"
@@ -9,7 +9,7 @@ import { mx } from '@dxos/react-ui-theme';
9
9
 
10
10
  import { useStack, useStackItem } from '../StackContext';
11
11
 
12
- export type StackItemContentProps = ThemedClassName<ComponentPropsWithoutRef<'div'>> & {
12
+ export type StackItemContentProps = ThemedClassName<Omit<ComponentPropsWithoutRef<'div'>, 'role'>> & {
13
13
  /**
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.
@@ -59,10 +59,10 @@ export const StackItemContent = forwardRef<HTMLDivElement, StackItemContentProps
59
59
  role='none'
60
60
  {...props}
61
61
  className={mx(
62
- 'group grid grid-cols-[100%]',
62
+ 'group grid grid-cols-[100%] density-coarse',
63
63
  stackItemSize === 'contain' && 'min-bs-0 overflow-hidden',
64
64
  size === 'video' ? 'aspect-video' : size === 'square' && 'aspect-square',
65
- toolbar && '[&_.dx-toolbar]:relative [&_.dx-toolbar]:border-be [&_.dx-toolbar]:border-subduedSeparator',
65
+ toolbar && '[&>.dx-toolbar]:relative [&>.dx-toolbar]:border-be [&>.dx-toolbar]:border-subduedSeparator',
66
66
  role === 'section' &&
67
67
  toolbar &&
68
68
  '[&_.dx-toolbar]:sticky [&_.dx-toolbar]:z-[1] [&_.dx-toolbar]:block-start-0 [&_.dx-toolbar]:-mbe-px [&_.dx-toolbar]:min-is-0',
@@ -2,7 +2,7 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- export * from './defs';
5
+ export type * from './defs';
6
6
 
7
7
  export * from './Stack';
8
8
  export * from './StackItem';
@@ -38,16 +38,35 @@ const CardStaticRoot = forwardRef<HTMLDivElement, SharedCardProps>(
38
38
  * in a Popover) and knows this based on the `role` it receives. This will render a `Card.StaticRoot` by default, otherwise
39
39
  * it will render a `div` primitive with the appropriate styling for specific handled situations.
40
40
  */
41
- const CardSurfaceRoot = ({ role = 'never', children }: PropsWithChildren<{ role?: string }>) => {
42
- if (['popover', 'card--kanban'].includes(role)) {
41
+ const CardSurfaceRoot = ({
42
+ role = 'never',
43
+ children,
44
+ classNames,
45
+ }: ThemedClassName<PropsWithChildren<{ role?: string }>>) => {
46
+ if (['card--popover', 'card--intrinsic', 'card--extrinsic'].includes(role)) {
43
47
  return (
44
- <div className={role === 'popover' ? 'popover-card-width' : role === 'card--kanban' ? 'contents' : ''}>
48
+ <div
49
+ className={mx(
50
+ role === 'card--popover'
51
+ ? 'popover-card-width'
52
+ : ['card--intrinsic', 'card--extrinsic'].includes(role)
53
+ ? 'contents'
54
+ : '',
55
+ classNames,
56
+ )}
57
+ >
45
58
  {children}
46
59
  </div>
47
60
  );
48
61
  } else {
49
62
  return (
50
- <CardStaticRoot {...(role === 'card--document' && { classNames: ['mlb-[1em]', hoverableControls] })}>
63
+ <CardStaticRoot
64
+ classNames={[
65
+ role === 'card--transclusion' && 'mlb-[1em]',
66
+ role === 'card--transclusion' && hoverableControls,
67
+ classNames,
68
+ ]}
69
+ >
51
70
  {children}
52
71
  </CardStaticRoot>
53
72
  );
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * from './stack-manager';
@@ -6,7 +6,7 @@ import { expect, test } from '@playwright/test';
6
6
 
7
7
  import { setupPage, storybookUrl } from '@dxos/test-utils/playwright';
8
8
 
9
- import { StackManager } from '../testing';
9
+ import { StackManager } from './stack-manager';
10
10
 
11
11
  const PORT = 9003;
12
12
 
@@ -0,0 +1,34 @@
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
+ case 'card--intrinsic':
20
+ return (
21
+ <IntrinsicCardContainer>
22
+ <Card.StaticRoot>{children}</Card.StaticRoot>
23
+ </IntrinsicCardContainer>
24
+ );
25
+ case 'card--extrinsic':
26
+ return (
27
+ <ExtrinsicCardContainer>
28
+ <Card.StaticRoot>{children}</Card.StaticRoot>
29
+ </ExtrinsicCardContainer>
30
+ );
31
+ default:
32
+ return <Card.StaticRoot>{children}</Card.StaticRoot>;
33
+ }
34
+ };
@@ -2,4 +2,4 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- export * from './stack-manager';
5
+ export * from './CardContainer';
@@ -1 +0,0 @@
1
- {"version":3,"file":"stack-manager.d.ts","sourceRoot":"","sources":["../../../../src/testing/stack-manager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAQ,MAAM,kBAAkB,CAAC;AAEtD,qBAAa,YAAY;IAGX,QAAQ,CAAC,OAAO,EAAE,OAAO;IAFrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAO;gBAER,OAAO,EAAE,OAAO;IAIrC,QAAQ,IAAI,OAAO;IAInB,KAAK;IAIL,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc;CAGvC;AAED,qBAAa,cAAc;IAGb,QAAQ,CAAC,OAAO,EAAE,OAAO;IAFrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAO;gBAER,OAAO,EAAE,OAAO;IAI/B,EAAE,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAI5B,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAKvB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAK3B,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,GAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;CAehG"}
File without changes