@dxos/react-ui 0.8.4-main.e098934 → 0.8.4-main.ead640a

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 (153) hide show
  1. package/dist/lib/browser/{chunk-Y4PW3CX2.mjs → chunk-24AWTFTZ.mjs} +219 -100
  2. package/dist/lib/browser/chunk-24AWTFTZ.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +5 -1
  4. package/dist/lib/browser/index.mjs.map +1 -1
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/browser/testing/index.mjs +54 -26
  7. package/dist/lib/browser/testing/index.mjs.map +4 -4
  8. package/dist/lib/node-esm/{chunk-L6LIOSFT.mjs → chunk-MPRFBTTQ.mjs} +219 -100
  9. package/dist/lib/node-esm/chunk-MPRFBTTQ.mjs.map +7 -0
  10. package/dist/lib/node-esm/index.mjs +5 -1
  11. package/dist/lib/node-esm/index.mjs.map +1 -1
  12. package/dist/lib/node-esm/meta.json +1 -1
  13. package/dist/lib/node-esm/testing/index.mjs +54 -26
  14. package/dist/lib/node-esm/testing/index.mjs.map +4 -4
  15. package/dist/types/src/components/Avatars/Avatar.stories.d.ts +0 -6
  16. package/dist/types/src/components/Avatars/Avatar.stories.d.ts.map +1 -1
  17. package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts +0 -6
  18. package/dist/types/src/components/Avatars/AvatarGroup.stories.d.ts.map +1 -1
  19. package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts +0 -6
  20. package/dist/types/src/components/Breadcrumb/Breadcrumb.stories.d.ts.map +1 -1
  21. package/dist/types/src/components/Buttons/Button.d.ts +1 -1
  22. package/dist/types/src/components/Buttons/Button.d.ts.map +1 -1
  23. package/dist/types/src/components/Buttons/Button.stories.d.ts +1 -7
  24. package/dist/types/src/components/Buttons/Button.stories.d.ts.map +1 -1
  25. package/dist/types/src/components/Buttons/IconButton.stories.d.ts +0 -6
  26. package/dist/types/src/components/Buttons/IconButton.stories.d.ts.map +1 -1
  27. package/dist/types/src/components/Buttons/Toggle.stories.d.ts +0 -6
  28. package/dist/types/src/components/Buttons/Toggle.stories.d.ts.map +1 -1
  29. package/dist/types/src/components/Buttons/ToggleGroup.d.ts +2 -6
  30. package/dist/types/src/components/Buttons/ToggleGroup.d.ts.map +1 -1
  31. package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts +2 -12
  32. package/dist/types/src/components/Buttons/ToggleGroup.stories.d.ts.map +1 -1
  33. package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts +0 -6
  34. package/dist/types/src/components/Dialogs/AlertDialog.stories.d.ts.map +1 -1
  35. package/dist/types/src/components/Dialogs/Dialog.stories.d.ts +0 -1
  36. package/dist/types/src/components/Dialogs/Dialog.stories.d.ts.map +1 -1
  37. package/dist/types/src/components/Icon/Icon.d.ts +1 -1
  38. package/dist/types/src/components/Icon/Icon.d.ts.map +1 -1
  39. package/dist/types/src/components/Input/Input.d.ts +0 -2
  40. package/dist/types/src/components/Input/Input.d.ts.map +1 -1
  41. package/dist/types/src/components/Input/Input.stories.d.ts +0 -6
  42. package/dist/types/src/components/Input/Input.stories.d.ts.map +1 -1
  43. package/dist/types/src/components/Link/Link.stories.d.ts +0 -6
  44. package/dist/types/src/components/Link/Link.stories.d.ts.map +1 -1
  45. package/dist/types/src/components/Lists/List.stories.d.ts +0 -6
  46. package/dist/types/src/components/Lists/List.stories.d.ts.map +1 -1
  47. package/dist/types/src/components/Lists/Tree.stories.d.ts +0 -6
  48. package/dist/types/src/components/Lists/Tree.stories.d.ts.map +1 -1
  49. package/dist/types/src/components/Lists/Treegrid.d.ts.map +1 -1
  50. package/dist/types/src/components/Main/Main.d.ts +1 -10
  51. package/dist/types/src/components/Main/Main.d.ts.map +1 -1
  52. package/dist/types/src/components/Main/Main.stories.d.ts +1 -2
  53. package/dist/types/src/components/Main/Main.stories.d.ts.map +1 -1
  54. package/dist/types/src/components/Menus/ContextMenu.stories.d.ts +0 -6
  55. package/dist/types/src/components/Menus/ContextMenu.stories.d.ts.map +1 -1
  56. package/dist/types/src/components/Menus/DropdownMenu.d.ts +1 -1
  57. package/dist/types/src/components/Menus/DropdownMenu.d.ts.map +1 -1
  58. package/dist/types/src/components/Menus/DropdownMenu.stories.d.ts +0 -6
  59. package/dist/types/src/components/Menus/DropdownMenu.stories.d.ts.map +1 -1
  60. package/dist/types/src/components/Message/Message.stories.d.ts +0 -1
  61. package/dist/types/src/components/Message/Message.stories.d.ts.map +1 -1
  62. package/dist/types/src/components/Popover/Popover.d.ts +1 -1
  63. package/dist/types/src/components/Popover/Popover.d.ts.map +1 -1
  64. package/dist/types/src/components/Popover/Popover.stories.d.ts +0 -6
  65. package/dist/types/src/components/Popover/Popover.stories.d.ts.map +1 -1
  66. package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts +0 -6
  67. package/dist/types/src/components/ScrollArea/ScrollArea.stories.d.ts.map +1 -1
  68. package/dist/types/src/components/Select/Select.stories.d.ts +0 -6
  69. package/dist/types/src/components/Select/Select.stories.d.ts.map +1 -1
  70. package/dist/types/src/components/Status/Status.stories.d.ts +0 -6
  71. package/dist/types/src/components/Status/Status.stories.d.ts.map +1 -1
  72. package/dist/types/src/components/Tag/Tag.stories.d.ts +8 -8
  73. package/dist/types/src/components/Tag/Tag.stories.d.ts.map +1 -1
  74. package/dist/types/src/components/Toast/Toast.stories.d.ts +0 -6
  75. package/dist/types/src/components/Toast/Toast.stories.d.ts.map +1 -1
  76. package/dist/types/src/components/Toolbar/Toolbar.d.ts +9 -11
  77. package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
  78. package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts +0 -6
  79. package/dist/types/src/components/Toolbar/Toolbar.stories.d.ts.map +1 -1
  80. package/dist/types/src/components/Tooltip/Tooltip.d.ts +1 -3
  81. package/dist/types/src/components/Tooltip/Tooltip.d.ts.map +1 -1
  82. package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts +0 -6
  83. package/dist/types/src/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
  84. package/dist/types/src/hooks/useSafeArea.d.ts.map +1 -1
  85. package/dist/types/src/hooks/useVisualViewport.d.ts +2 -2
  86. package/dist/types/src/hooks/useVisualViewport.d.ts.map +1 -1
  87. package/dist/types/src/playground/Controls.stories.d.ts +0 -6
  88. package/dist/types/src/playground/Controls.stories.d.ts.map +1 -1
  89. package/dist/types/src/playground/Custom.stories.d.ts +1 -2
  90. package/dist/types/src/playground/Custom.stories.d.ts.map +1 -1
  91. package/dist/types/src/playground/Typography.stories.d.ts +0 -6
  92. package/dist/types/src/playground/Typography.stories.d.ts.map +1 -1
  93. package/dist/types/src/testing/decorators/index.d.ts +2 -1
  94. package/dist/types/src/testing/decorators/index.d.ts.map +1 -1
  95. package/dist/types/src/testing/decorators/withLayout.d.ts +15 -0
  96. package/dist/types/src/testing/decorators/withLayout.d.ts.map +1 -0
  97. package/dist/types/src/testing/decorators/withTheme.d.ts +3 -0
  98. package/dist/types/src/testing/decorators/withTheme.d.ts.map +1 -1
  99. package/dist/types/src/util/domino.d.ts +18 -0
  100. package/dist/types/src/util/domino.d.ts.map +1 -0
  101. package/dist/types/src/util/index.d.ts +2 -0
  102. package/dist/types/src/util/index.d.ts.map +1 -1
  103. package/dist/types/src/util/usePx.d.ts +8 -0
  104. package/dist/types/src/util/usePx.d.ts.map +1 -0
  105. package/dist/types/tsconfig.tsbuildinfo +1 -1
  106. package/package.json +20 -22
  107. package/src/components/Avatars/Avatar.stories.tsx +0 -2
  108. package/src/components/Avatars/AvatarGroup.stories.tsx +0 -3
  109. package/src/components/Breadcrumb/Breadcrumb.stories.tsx +0 -3
  110. package/src/components/Buttons/Button.stories.tsx +3 -5
  111. package/src/components/Buttons/IconButton.stories.tsx +0 -3
  112. package/src/components/Buttons/Toggle.stories.tsx +0 -3
  113. package/src/components/Buttons/ToggleGroup.stories.tsx +0 -3
  114. package/src/components/Dialogs/AlertDialog.stories.tsx +0 -3
  115. package/src/components/Dialogs/Dialog.stories.tsx +5 -3
  116. package/src/components/Icon/Icon.tsx +1 -1
  117. package/src/components/Input/Input.stories.tsx +0 -3
  118. package/src/components/Input/Input.tsx +3 -3
  119. package/src/components/Link/Link.stories.tsx +0 -3
  120. package/src/components/Lists/List.stories.tsx +2 -6
  121. package/src/components/Lists/Tree.stories.tsx +0 -3
  122. package/src/components/Lists/Treegrid.tsx +57 -16
  123. package/src/components/Main/Main.stories.tsx +3 -3
  124. package/src/components/Main/Main.tsx +17 -8
  125. package/src/components/Menus/ContextMenu.stories.tsx +0 -3
  126. package/src/components/Menus/DropdownMenu.stories.tsx +0 -3
  127. package/src/components/Menus/DropdownMenu.tsx +2 -2
  128. package/src/components/Message/Message.stories.tsx +0 -2
  129. package/src/components/Popover/Popover.stories.tsx +0 -3
  130. package/src/components/Popover/Popover.tsx +5 -5
  131. package/src/components/ScrollArea/ScrollArea.stories.tsx +0 -3
  132. package/src/components/Select/Select.stories.tsx +3 -5
  133. package/src/components/Status/Status.stories.tsx +0 -3
  134. package/src/components/Tag/Tag.stories.tsx +8 -7
  135. package/src/components/Toast/Toast.stories.tsx +0 -3
  136. package/src/components/Toolbar/Toolbar.stories.tsx +0 -3
  137. package/src/components/Toolbar/Toolbar.tsx +14 -4
  138. package/src/components/Tooltip/Tooltip.stories.tsx +0 -3
  139. package/src/components/Tooltip/Tooltip.tsx +2 -1
  140. package/src/hooks/useSafeArea.ts +3 -2
  141. package/src/hooks/useVisualViewport.ts +4 -4
  142. package/src/playground/Controls.stories.tsx +3 -5
  143. package/src/playground/Custom.stories.tsx +3 -12
  144. package/src/playground/Typography.stories.tsx +0 -3
  145. package/src/testing/decorators/index.ts +2 -1
  146. package/src/testing/decorators/withLayout.tsx +56 -0
  147. package/src/testing/decorators/withTheme.tsx +31 -0
  148. package/src/util/domino.ts +53 -0
  149. package/src/util/index.ts +2 -0
  150. package/src/util/usePx.ts +61 -0
  151. package/dist/lib/browser/chunk-Y4PW3CX2.mjs.map +0 -7
  152. package/dist/lib/node-esm/chunk-L6LIOSFT.mjs.map +0 -7
  153. package/src/testing/decorators/withTheme.ts +0 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui",
3
- "version": "0.8.4-main.e098934",
3
+ "version": "0.8.4-main.ead640a",
4
4
  "description": "Low-level React components for DXOS, applying a theme to a core group of primitives",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -37,7 +37,6 @@
37
37
  "dependencies": {
38
38
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.3",
39
39
  "@fluentui/react-tabster": "^9.24.2",
40
- "@phosphor-icons/react": "^2.1.5",
41
40
  "@preact-signals/safe-react": "^0.9.0",
42
41
  "@radix-ui/primitive": "1.1.1",
43
42
  "@radix-ui/react-alert-dialog": "1.1.6",
@@ -75,33 +74,32 @@
75
74
  "keyborg": "^2.5.0",
76
75
  "react-i18next": "^11.18.6",
77
76
  "react-remove-scroll": "^2.6.0",
78
- "@dxos/lit-ui": "0.8.4-main.e098934",
79
- "@dxos/log": "0.8.4-main.e098934",
80
- "@dxos/react-hooks": "0.8.4-main.e098934",
81
- "@dxos/react-input": "0.8.4-main.e098934",
82
- "@dxos/react-list": "0.8.4-main.e098934",
83
- "@dxos/react-ui-types": "0.8.4-main.e098934",
84
- "@dxos/util": "0.8.4-main.e098934",
85
- "@dxos/debug": "0.8.4-main.e098934"
77
+ "@dxos/debug": "0.8.4-main.ead640a",
78
+ "@dxos/react-hooks": "0.8.4-main.ead640a",
79
+ "@dxos/lit-ui": "0.8.4-main.ead640a",
80
+ "@dxos/react-input": "0.8.4-main.ead640a",
81
+ "@dxos/react-list": "0.8.4-main.ead640a",
82
+ "@dxos/util": "0.8.4-main.ead640a",
83
+ "@dxos/react-ui-types": "0.8.4-main.ead640a",
84
+ "@dxos/log": "0.8.4-main.ead640a"
86
85
  },
87
86
  "devDependencies": {
88
87
  "@dnd-kit/core": "^6.0.5",
89
88
  "@dnd-kit/sortable": "^7.0.1",
90
89
  "@dnd-kit/utilities": "^3.2.0",
91
- "@types/react": "~18.2.0",
92
- "@types/react-dom": "~18.2.0",
93
- "react": "~18.2.0",
94
- "react-dom": "~18.2.0",
95
- "vite": "7.1.1",
96
- "@dxos/random": "0.8.4-main.e098934",
97
- "@dxos/react-ui-theme": "0.8.4-main.e098934",
98
- "@dxos/util": "0.8.4-main.e098934"
90
+ "@types/react": "~19.2.2",
91
+ "@types/react-dom": "~19.2.1",
92
+ "react": "~19.2.0",
93
+ "react-dom": "~19.2.0",
94
+ "vite": "7.1.9",
95
+ "@dxos/random": "0.8.4-main.ead640a",
96
+ "@dxos/util": "0.8.4-main.ead640a",
97
+ "@dxos/react-ui-theme": "0.8.4-main.ead640a"
99
98
  },
100
99
  "peerDependencies": {
101
- "@phosphor-icons/react": "^2.1.5",
102
- "react": "~18.2.0",
103
- "react-dom": "~18.2.0",
104
- "@dxos/react-ui-theme": "0.8.4-main.e098934"
100
+ "react": "^19.0.0",
101
+ "react-dom": "^19.0.0",
102
+ "@dxos/react-ui-theme": "0.8.4-main.ead640a"
105
103
  },
106
104
  "publishConfig": {
107
105
  "access": "public"
@@ -2,7 +2,6 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
5
  import { type Meta } from '@storybook/react-vite';
7
6
  import React, { type PropsWithChildren } from 'react';
8
7
 
@@ -61,7 +60,6 @@ const meta = {
61
60
  title: 'ui/react-ui-core/Avatar',
62
61
  component: Avatar.Root,
63
62
  decorators: [withTheme],
64
- parameters: { chromatic: { disableSnapshot: false } },
65
63
  } satisfies Meta<typeof Avatar.Root>;
66
64
 
67
65
  export default meta;
@@ -2,8 +2,6 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React from 'react';
9
7
 
@@ -43,7 +41,6 @@ const meta = {
43
41
  title: 'ui/react-ui-core/AvatarGroup',
44
42
  render: DefaultStory,
45
43
  decorators: [withTheme],
46
- parameters: { chromatic: { disableSnapshot: false } },
47
44
  } satisfies Meta<typeof DefaultStory>;
48
45
 
49
46
  export default meta;
@@ -2,8 +2,6 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React from 'react';
9
7
 
@@ -45,7 +43,6 @@ const meta = {
45
43
  component: Breadcrumb.Root as any,
46
44
  render: DefaultStory,
47
45
  decorators: [withTheme],
48
- parameters: { chromatic: { disableSnapshot: false } },
49
46
  } satisfies Meta<typeof DefaultStory>;
50
47
 
51
48
  export default meta;
@@ -2,12 +2,11 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React from 'react';
9
7
 
10
- import { withSurfaceVariantsLayout, withTheme } from '../../testing';
8
+ import { withTheme } from '../../testing';
9
+ import { withSurfaceVariantsLayout } from '../../testing';
11
10
  import { Icon } from '../Icon';
12
11
 
13
12
  import { Button, ButtonGroup, type ButtonProps } from './Button';
@@ -37,8 +36,7 @@ const meta = {
37
36
  title: 'ui/react-ui-core/Button',
38
37
  component: Button,
39
38
  render: DefaultStory,
40
- decorators: [withSurfaceVariantsLayout(), withTheme],
41
- parameters: { chromatic: { disableSnapshot: false } },
39
+ decorators: [withTheme, withSurfaceVariantsLayout()],
42
40
  } satisfies Meta<typeof Button>;
43
41
 
44
42
  export default meta;
@@ -2,8 +2,6 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React from 'react';
9
7
 
@@ -30,7 +28,6 @@ const meta = {
30
28
  component: IconButton,
31
29
  render: DefaultStory as any,
32
30
  decorators: [withTheme],
33
- parameters: { chromatic: { disableSnapshot: false } },
34
31
  } satisfies Meta<typeof IconButton>;
35
32
 
36
33
  export default meta;
@@ -2,8 +2,6 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React from 'react';
9
7
 
@@ -27,7 +25,6 @@ const meta = {
27
25
  component: Toggle,
28
26
  render: DefaultStory,
29
27
  decorators: [withTheme],
30
- parameters: { chromatic: { disableSnapshot: false } },
31
28
  } satisfies Meta<typeof Toggle>;
32
29
 
33
30
  export default meta;
@@ -2,8 +2,6 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React from 'react';
9
7
 
@@ -31,7 +29,6 @@ const meta = {
31
29
  component: ToggleGroup,
32
30
  render: DefaultStory,
33
31
  decorators: [withTheme],
34
- parameters: { chromatic: { disableSnapshot: false } },
35
32
  } satisfies Meta<typeof ToggleGroup>;
36
33
 
37
34
  export default meta;
@@ -2,8 +2,6 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React from 'react';
9
7
 
@@ -53,7 +51,6 @@ const meta = {
53
51
  component: AlertDialog.Root as any,
54
52
  render: DefaultStory as any,
55
53
  decorators: [withTheme],
56
- parameters: { chromatic: { disableSnapshot: false } },
57
54
  } satisfies Meta<typeof DefaultStory>;
58
55
 
59
56
  export default meta;
@@ -2,8 +2,6 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React from 'react';
9
7
 
@@ -46,7 +44,11 @@ const meta = {
46
44
  component: Dialog as any,
47
45
  render: DefaultStory,
48
46
  decorators: [withTheme],
49
- parameters: { chromatic: { disableSnapshot: false } },
47
+ parameters: {
48
+ chromatic: {
49
+ disableSnapshot: false,
50
+ },
51
+ },
50
52
  } satisfies Meta<typeof DefaultStory>;
51
53
 
52
54
  export default meta;
@@ -16,7 +16,7 @@ export type IconProps = ThemedClassName<ComponentPropsWithRef<typeof Primitive.s
16
16
  };
17
17
 
18
18
  export const Icon = memo(
19
- forwardRef<SVGSVGElement, IconProps>(({ icon, classNames, size, ...props }, forwardedRef) => {
19
+ forwardRef<SVGSVGElement, IconProps>(({ icon, classNames, size = 4, ...props }, forwardedRef) => {
20
20
  const { tx } = useThemeContext();
21
21
  const href = useIconHref(icon);
22
22
  return (
@@ -2,8 +2,6 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React from 'react';
9
7
 
@@ -94,7 +92,6 @@ const meta = {
94
92
  component: Input.Root as any,
95
93
  render: DefaultStory,
96
94
  decorators: [withTheme],
97
- parameters: { chromatic: { disableSnapshot: false } },
98
95
  } satisfies Meta<typeof DefaultStory>;
99
96
 
100
97
  export default meta;
@@ -2,7 +2,6 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type IconWeight } from '@phosphor-icons/react';
6
5
  import { Root as CheckboxPrimitive, type CheckboxProps as CheckboxPrimitiveProps } from '@radix-ui/react-checkbox';
7
6
  import { useControllableState } from '@radix-ui/react-use-controllable-state';
8
7
  import React, { type ComponentPropsWithRef, type ForwardRefExoticComponent, forwardRef, useCallback } from 'react';
@@ -230,7 +229,9 @@ const TextArea = forwardRef<HTMLTextAreaElement, InputScopedProps<TextAreaProps>
230
229
  },
231
230
  );
232
231
 
233
- type CheckboxProps = ThemedClassName<Omit<CheckboxPrimitiveProps, 'children'>> & { size?: Size; weight?: IconWeight };
232
+ type CheckboxProps = ThemedClassName<Omit<CheckboxPrimitiveProps, 'children'>> & {
233
+ size?: Size;
234
+ };
234
235
 
235
236
  const Checkbox: ForwardRefExoticComponent<CheckboxProps> = forwardRef<
236
237
  HTMLButtonElement,
@@ -243,7 +244,6 @@ const Checkbox: ForwardRefExoticComponent<CheckboxProps> = forwardRef<
243
244
  defaultChecked: propsDefaultChecked,
244
245
  onCheckedChange: propsOnCheckedChange,
245
246
  size,
246
- weight = 'bold',
247
247
  classNames,
248
248
  ...props
249
249
  },
@@ -2,8 +2,6 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
 
9
7
  import { withTheme } from '../../testing';
@@ -14,7 +12,6 @@ const meta = {
14
12
  title: 'ui/react-ui-core/Link',
15
13
  component: Link,
16
14
  decorators: [withTheme],
17
- parameters: { chromatic: { disableSnapshot: false } },
18
15
  } satisfies Meta<typeof Link>;
19
16
 
20
17
  export default meta;
@@ -2,8 +2,6 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { DndContext, type DragEndEvent, type DragStartEvent } from '@dnd-kit/core';
8
6
  import { SortableContext, arrayMove, useSortable, verticalListSortingStrategy } from '@dnd-kit/sortable';
9
7
  import { CSS } from '@dnd-kit/utilities';
@@ -29,7 +27,6 @@ const meta = {
29
27
  title: 'ui/react-ui-core/List',
30
28
  component: List,
31
29
  decorators: [withTheme],
32
- parameters: { chromatic: { disableSnapshot: false } },
33
30
  } satisfies Meta<typeof List>;
34
31
 
35
32
  export default meta;
@@ -198,7 +195,6 @@ export const Collapsible: Story = {
198
195
  },
199
196
  args: {
200
197
  variant: 'unordered',
201
- // toggleOpenLabel: 'Open/close storybook list item', // TODO(burdon): ???
202
198
  },
203
199
  };
204
200
 
@@ -229,11 +225,11 @@ export const SelectableListbox: Story = {
229
225
  key={id}
230
226
  tabIndex={0}
231
227
  selected={selectedId === id}
232
- classNames={mx('items-center', ghostHover, ghostSelected, ghostSelectedTrackingInterFromNormal)}
228
+ classNames={mx(ghostHover, ghostSelected, ghostSelectedTrackingInterFromNormal)}
233
229
  onClick={() => setSelectedId(id)}
234
230
  onKeyUp={(event) => handleKeyUp(event, id)}
235
231
  >
236
- <ListItem.Heading classNames='grow'>Lorem ipsum dolor sit amet</ListItem.Heading>
232
+ <ListItem.Heading classNames='flex pis-1 pie-1 items-center grow truncate'>{text}</ListItem.Heading>
237
233
  </ListItem.Root>
238
234
  ))}
239
235
  </List>
@@ -2,8 +2,6 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React from 'react';
9
7
 
@@ -62,7 +60,6 @@ const meta = {
62
60
  component: Tree as any,
63
61
  render: DefaultStory,
64
62
  decorators: [withTheme],
65
- parameters: { chromatic: { disableSnapshot: false } },
66
63
  } satisfies Meta<typeof DefaultStory>;
67
64
 
68
65
  export default meta;
@@ -2,12 +2,18 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { useArrowNavigationGroup, useFocusableGroup } from '@fluentui/react-tabster';
5
+ import { useFocusFinders } from '@fluentui/react-tabster';
6
6
  import { type Scope, createContextScope } from '@radix-ui/react-context';
7
7
  import { Primitive } from '@radix-ui/react-primitive';
8
8
  import { Slot } from '@radix-ui/react-slot';
9
9
  import { useControllableState } from '@radix-ui/react-use-controllable-state';
10
- import React, { type CSSProperties, type ComponentPropsWithRef, forwardRef } from 'react';
10
+ import React, {
11
+ type CSSProperties,
12
+ type ComponentPropsWithRef,
13
+ type KeyboardEvent,
14
+ forwardRef,
15
+ useCallback,
16
+ } from 'react';
11
17
 
12
18
  import { useThemeContext } from '../../hooks';
13
19
  import { type ThemedClassName } from '../../util';
@@ -40,12 +46,58 @@ const TreegridRoot = forwardRef<HTMLDivElement, TreegridRootProps>(
40
46
  ({ asChild, classNames, children, style, gridTemplateColumns, ...props }, forwardedRef) => {
41
47
  const { tx } = useThemeContext();
42
48
  const Root = asChild ? Slot : Primitive.div;
43
- const arrowNavigationAttrs = useArrowNavigationGroup({ axis: 'vertical', tabbable: false, circular: true });
49
+ const { findFirstFocusable } = useFocusFinders();
50
+
51
+ const handleKeyDown = useCallback(
52
+ (event: KeyboardEvent<HTMLDivElement>) => {
53
+ switch (event.key) {
54
+ case 'ArrowDown':
55
+ case 'ArrowUp': {
56
+ const direction = event.key === 'ArrowDown' ? 'down' : 'up';
57
+ const target = event.target as HTMLElement;
58
+
59
+ // Find ancestor with data-arrow-keys containing the relevant direction.
60
+ const ancestorWithArrowKeys = target.closest(`[data-arrow-keys*="${direction}"], [data-arrow-keys="all"]`);
61
+
62
+ // If no ancestor with data-arrow-keys found, proceed with row navigation.
63
+ if (!ancestorWithArrowKeys) {
64
+ // Find the closest row
65
+ const currentRow = target.closest('[role="row"]');
66
+ if (currentRow) {
67
+ // Find the treegrid container.
68
+ const treegrid = currentRow.closest('[role="treegrid"]');
69
+ if (treegrid) {
70
+ // Get all rows in the treegrid.
71
+ const rows = Array.from(treegrid.querySelectorAll('[role="row"]'));
72
+ const currentIndex = rows.indexOf(currentRow as Element);
73
+
74
+ // Find next or previous row.
75
+ const nextIndex = direction === 'down' ? currentIndex + 1 : currentIndex - 1;
76
+ const targetRow = rows[nextIndex];
77
+
78
+ if (targetRow) {
79
+ // Focus the first focusable element in the target row.
80
+ const firstFocusable = findFirstFocusable(targetRow as HTMLElement);
81
+ if (firstFocusable) {
82
+ event.preventDefault();
83
+ firstFocusable.focus();
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
89
+ break;
90
+ }
91
+ }
92
+ props.onKeyDown?.(event);
93
+ },
94
+ [findFirstFocusable],
95
+ );
44
96
 
45
97
  return (
46
98
  <Root
47
99
  role='treegrid'
48
- {...arrowNavigationAttrs}
100
+ onKeyDown={handleKeyDown}
49
101
  {...props}
50
102
  className={tx('treegrid.root', 'treegrid', {}, classNames)}
51
103
  style={{ ...style, gridTemplateColumns }}
@@ -91,13 +143,6 @@ const TreegridRow = forwardRef<HTMLDivElement, TreegridRowScopedProps<TreegridRo
91
143
  onChange: propsOnOpenChange,
92
144
  defaultProp: defaultOpen,
93
145
  });
94
- const focusableGroupAttrs = useFocusableGroup({ tabBehavior: 'limited' });
95
- const arrowGroupAttrs = useArrowNavigationGroup({
96
- axis: 'horizontal',
97
- tabbable: false,
98
- circular: false,
99
- memorizeCurrent: false,
100
- });
101
146
 
102
147
  return (
103
148
  <TreegridRowProvider open={open} onOpenChange={onOpenChange} scope={__treegridRowScope}>
@@ -106,15 +151,11 @@ const TreegridRow = forwardRef<HTMLDivElement, TreegridRowScopedProps<TreegridRo
106
151
  aria-level={level}
107
152
  className={tx('treegrid.row', 'treegrid__row', { level }, classNames)}
108
153
  {...(parentOf && { 'aria-expanded': open, 'aria-owns': parentOf })}
109
- tabIndex={0}
110
- {...focusableGroupAttrs}
111
154
  {...props}
112
155
  id={id}
113
156
  ref={forwardedRef}
114
157
  >
115
- <div role='none' className='contents' {...arrowGroupAttrs}>
116
- {children}
117
- </div>
158
+ {children}
118
159
  </Root>
119
160
  </TreegridRowProvider>
120
161
  );
@@ -2,8 +2,6 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React from 'react';
9
7
 
@@ -53,8 +51,10 @@ const meta = {
53
51
  render: DefaultStory,
54
52
  decorators: [withTheme],
55
53
  parameters: {
56
- chromatic: { disableSnapshot: false },
57
54
  layout: 'fullscreen',
55
+ chromatic: {
56
+ disableSnapshot: false,
57
+ },
58
58
  },
59
59
  } satisfies Meta<typeof DefaultStory>;
60
60
 
@@ -2,6 +2,7 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
+ import { useFocusableGroup } from '@fluentui/react-tabster';
5
6
  import { createContext } from '@radix-ui/react-context';
6
7
  import { DialogContent, Root as DialogRoot, DialogTitle } from '@radix-ui/react-dialog';
7
8
  import { Primitive } from '@radix-ui/react-primitive';
@@ -70,7 +71,10 @@ const useLandmarkMover = (propsOnKeyDown: ComponentPropsWithoutRef<'div'>['onKey
70
71
  },
71
72
  [propsOnKeyDown],
72
73
  );
73
- const focusableGroupAttrs = window ? {} : { tabBehavior: 'limited', ignoreDefaultKeydown: { Tab: true } };
74
+
75
+ // TODO(thure): This was disconnected once before in #8818, if this should change again to support the browser
76
+ // extension, please ensure the change doesn’t break web, desktop and mobile.
77
+ const focusableGroupAttrs = useFocusableGroup({ tabBehavior: 'limited', ignoreDefaultKeydown: { Tab: true } });
74
78
 
75
79
  return {
76
80
  onKeyDown: handleKeyDown,
@@ -141,7 +145,7 @@ const MainRoot = ({
141
145
  children,
142
146
  ...props
143
147
  }: MainRootProps) => {
144
- const [isLg] = useMediaQuery('lg', { ssr: false });
148
+ const [isLg] = useMediaQuery('lg');
145
149
  const [navigationSidebarState = isLg ? 'expanded' : 'collapsed', setNavigationSidebarState] =
146
150
  useControllableState<SidebarState>({
147
151
  prop: propsNavigationSidebarState,
@@ -210,7 +214,7 @@ const MainSidebar = forwardRef<HTMLDivElement, MainSidebarProps>(
210
214
  { classNames, children, swipeToDismiss, onOpenAutoFocus, state, resizing, onStateChange, side, label, ...props },
211
215
  forwardedRef,
212
216
  ) => {
213
- const [isLg] = useMediaQuery('lg', { ssr: false });
217
+ const [isLg] = useMediaQuery('lg');
214
218
  const { tx } = useThemeContext();
215
219
  const { t } = useTranslation();
216
220
  const ref = useForwardedRef(forwardedRef);
@@ -218,10 +222,15 @@ const MainSidebar = forwardRef<HTMLDivElement, MainSidebarProps>(
218
222
  useSwipeToDismiss(swipeToDismiss ? ref : noopRef, {
219
223
  onDismiss: () => onStateChange?.('closed'),
220
224
  });
225
+ // NOTE(thure): This is a workaround for something further down the tree grabbing focus on Escape. Adding this
226
+ // intervention to `Tabs.Root` or `Tabs.Tabpenel` instances is somehow ineffectual.
221
227
  const handleKeyDown = useCallback(
222
228
  (event: KeyboardEvent<HTMLDivElement>) => {
223
- if (event.key === 'Escape') {
224
- ((event.target as HTMLDivElement).closest('[data-tabster]') as HTMLDivElement)?.focus();
229
+ const focusGroupParent = (event.target as HTMLElement).closest('[data-tabster]');
230
+ if (event.key === 'Escape' && focusGroupParent) {
231
+ event.preventDefault();
232
+ event.stopPropagation();
233
+ (focusGroupParent as HTMLElement).focus();
225
234
  }
226
235
  props.onKeyDown?.(event);
227
236
  },
@@ -239,8 +248,8 @@ const MainSidebar = forwardRef<HTMLDivElement, MainSidebarProps>(
239
248
  data-state={state}
240
249
  data-resizing={resizing ? 'true' : 'false'}
241
250
  className={tx('main.sidebar', 'main__sidebar', {}, classNames)}
242
- onKeyDown={handleKeyDown}
243
- {...(state === 'closed' && { inert: 'true' })}
251
+ onKeyDownCapture={handleKeyDown}
252
+ {...(state === 'closed' && { inert: true })}
244
253
  ref={ref}
245
254
  >
246
255
  {children}
@@ -329,7 +338,7 @@ MainContent.displayName = MAIN_NAME;
329
338
  type MainOverlayProps = ThemedClassName<Omit<ComponentPropsWithRef<typeof Primitive.div>, 'children'>>;
330
339
 
331
340
  const MainOverlay = forwardRef<HTMLDivElement, MainOverlayProps>(({ classNames, ...props }, forwardedRef) => {
332
- const [isLg] = useMediaQuery('lg', { ssr: false });
341
+ const [isLg] = useMediaQuery('lg');
333
342
  const { navigationSidebarState, setNavigationSidebarState, complementarySidebarState, setComplementarySidebarState } =
334
343
  useMainContext(MAIN_NAME);
335
344
  const { tx } = useThemeContext();
@@ -2,8 +2,6 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React from 'react';
9
7
 
@@ -98,7 +96,6 @@ const meta = {
98
96
  component: ContextMenu.Root as any,
99
97
  render: DefaultStory,
100
98
  decorators: [withTheme],
101
- parameters: { chromatic: { disableSnapshot: false } },
102
99
  } satisfies Meta<typeof DefaultStory>;
103
100
 
104
101
  export default meta;
@@ -2,8 +2,6 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React, { useRef, useState } from 'react';
9
7
 
@@ -98,7 +96,6 @@ const meta = {
98
96
  component: DropdownMenu.Root,
99
97
  render: DefaultStory,
100
98
  decorators: [withTheme],
101
- parameters: { chromatic: { disableSnapshot: false } },
102
99
  } satisfies Meta<typeof DefaultStory>;
103
100
 
104
101
  export default meta;
@@ -168,7 +168,7 @@ DropdownMenuTrigger.displayName = TRIGGER_NAME;
168
168
  const VIRTUAL_TRIGGER_NAME = 'DropdownMenuVirtualTrigger';
169
169
 
170
170
  interface DropdownMenuVirtualTriggerProps {
171
- virtualRef: RefObject<DropdownMenuTriggerElement>;
171
+ virtualRef: RefObject<DropdownMenuTriggerElement | null>;
172
172
  }
173
173
 
174
174
  const DropdownMenuVirtualTrigger = (props: ScopedProps<DropdownMenuVirtualTriggerProps>) => {
@@ -180,7 +180,7 @@ const DropdownMenuVirtualTrigger = (props: ScopedProps<DropdownMenuVirtualTrigge
180
180
  context.triggerRef.current = virtualRef.current;
181
181
  }
182
182
  });
183
- return <MenuPrimitive.Anchor {...menuScope} virtualRef={virtualRef} />;
183
+ return <MenuPrimitive.Anchor {...menuScope} virtualRef={virtualRef as RefObject<DropdownMenuTriggerElement>} />;
184
184
  };
185
185
 
186
186
  DropdownMenuVirtualTrigger.displayName = VIRTUAL_TRIGGER_NAME;
@@ -2,8 +2,6 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React from 'react';
9
7
 
@@ -2,8 +2,6 @@
2
2
  // Copyright 2022 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React, { type PropsWithChildren, type ReactNode, useRef, useState } from 'react';
9
7
 
@@ -35,7 +33,6 @@ const meta = {
35
33
  component: Popover.Root,
36
34
  render: DefaultStory,
37
35
  decorators: [withTheme],
38
- parameters: { chromatic: { disableSnapshot: false } },
39
36
  } satisfies Meta<typeof DefaultStory>;
40
37
 
41
38
  export default meta;