@dxos/react-ui-stack 0.8.1-main.ae460ac → 0.8.1-staging.31c3ee1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/index.mjs +8 -7
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +8 -7
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +8 -7
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/MenuSignifier.d.ts +3 -2
- package/dist/types/src/components/MenuSignifier.d.ts.map +1 -1
- package/dist/types/src/components/Stack.d.ts.map +1 -1
- package/dist/types/src/components/Stack.stories.d.ts +2 -1
- package/dist/types/src/components/Stack.stories.d.ts.map +1 -1
- package/dist/types/src/components/StackItem.d.ts +4 -4
- package/dist/types/src/components/StackItem.d.ts.map +1 -1
- package/dist/types/src/components/StackItemContent.d.ts +2 -2
- package/dist/types/src/components/StackItemContent.d.ts.map +1 -1
- package/dist/types/src/components/StackItemDragHandle.d.ts +2 -2
- package/dist/types/src/components/StackItemDragHandle.d.ts.map +1 -1
- package/dist/types/src/components/StackItemHeading.d.ts +1 -1
- package/dist/types/src/components/StackItemHeading.d.ts.map +1 -1
- package/dist/types/src/components/StackItemResizeHandle.d.ts +2 -1
- package/dist/types/src/components/StackItemResizeHandle.d.ts.map +1 -1
- package/dist/types/src/components/StackItemSigil.d.ts +3 -1
- package/dist/types/src/components/StackItemSigil.d.ts.map +1 -1
- package/package.json +21 -21
- package/src/components/Stack.tsx +5 -4
- package/src/components/StackItem.tsx +3 -2
- package/src/components/StackItemContent.tsx +1 -1
- package/src/components/StackItemHeading.tsx +2 -0
- package/src/components/StackItemSigil.tsx +9 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-stack",
|
|
3
|
-
"version": "0.8.1-
|
|
3
|
+
"version": "0.8.1-staging.31c3ee1",
|
|
4
4
|
"description": "A stack component.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@atlaskit/pragmatic-drag-and-drop": "^1.4.0",
|
|
40
40
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
|
|
41
41
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.3",
|
|
42
|
-
"@fluentui/react-tabster": "9.
|
|
42
|
+
"@fluentui/react-tabster": "^9.24.2",
|
|
43
43
|
"@radix-ui/primitive": "1.1.1",
|
|
44
44
|
"@radix-ui/react-compose-refs": "1.1.1",
|
|
45
45
|
"@radix-ui/react-context": "1.1.1",
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
"@radix-ui/react-slot": "1.1.2",
|
|
48
48
|
"@radix-ui/react-use-controllable-state": "1.1.0",
|
|
49
49
|
"react-resize-detector": "^11.0.1",
|
|
50
|
-
"@dxos/echo-schema": "0.8.1-
|
|
51
|
-
"@dxos/keyboard": "0.8.1-
|
|
52
|
-
"@dxos/live-object": "0.8.1-
|
|
53
|
-
"@dxos/react-ui-attention": "0.8.1-
|
|
54
|
-
"@dxos/react-ui-dnd": "0.8.1-
|
|
55
|
-
"@dxos/util": "0.8.1-
|
|
50
|
+
"@dxos/echo-schema": "0.8.1-staging.31c3ee1",
|
|
51
|
+
"@dxos/keyboard": "0.8.1-staging.31c3ee1",
|
|
52
|
+
"@dxos/live-object": "0.8.1-staging.31c3ee1",
|
|
53
|
+
"@dxos/react-ui-attention": "0.8.1-staging.31c3ee1",
|
|
54
|
+
"@dxos/react-ui-dnd": "0.8.1-staging.31c3ee1",
|
|
55
|
+
"@dxos/util": "0.8.1-staging.31c3ee1"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@phosphor-icons/react": "^2.1.5",
|
|
@@ -61,24 +61,24 @@
|
|
|
61
61
|
"react": "~18.2.0",
|
|
62
62
|
"react-dom": "~18.2.0",
|
|
63
63
|
"vite": "5.4.7",
|
|
64
|
-
"@dxos/app-graph": "0.8.1-
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/random": "0.8.1-
|
|
68
|
-
"@dxos/react-ui": "0.8.1-
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/react-ui-theme": "0.8.1-
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/test-utils": "0.8.1-
|
|
64
|
+
"@dxos/app-graph": "0.8.1-staging.31c3ee1",
|
|
65
|
+
"@dxos/client": "0.8.1-staging.31c3ee1",
|
|
66
|
+
"@dxos/echo-schema": "0.8.1-staging.31c3ee1",
|
|
67
|
+
"@dxos/random": "0.8.1-staging.31c3ee1",
|
|
68
|
+
"@dxos/react-ui": "0.8.1-staging.31c3ee1",
|
|
69
|
+
"@dxos/storybook-utils": "0.8.1-staging.31c3ee1",
|
|
70
|
+
"@dxos/react-ui-theme": "0.8.1-staging.31c3ee1",
|
|
71
|
+
"@dxos/react-ui-editor": "0.8.1-staging.31c3ee1",
|
|
72
|
+
"@dxos/test-utils": "0.8.1-staging.31c3ee1"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"@phosphor-icons/react": "^2.1.5",
|
|
76
76
|
"react": "~18.2.0",
|
|
77
77
|
"react-dom": "~18.2.0",
|
|
78
|
-
"@dxos/client": "0.8.1-
|
|
79
|
-
"@dxos/random": "0.8.1-
|
|
80
|
-
"@dxos/react-ui": "0.8.1-
|
|
81
|
-
"@dxos/react-ui-theme": "0.8.1-
|
|
78
|
+
"@dxos/client": "0.8.1-staging.31c3ee1",
|
|
79
|
+
"@dxos/random": "0.8.1-staging.31c3ee1",
|
|
80
|
+
"@dxos/react-ui": "0.8.1-staging.31c3ee1",
|
|
81
|
+
"@dxos/react-ui-theme": "0.8.1-staging.31c3ee1"
|
|
82
82
|
},
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"access": "public"
|
package/src/components/Stack.tsx
CHANGED
|
@@ -46,7 +46,7 @@ export const Stack = forwardRef<HTMLDivElement, StackProps>(
|
|
|
46
46
|
) => {
|
|
47
47
|
const [stackElement, stackRef] = useState<HTMLDivElement | null>(null);
|
|
48
48
|
const composedItemRef = composeRefs<HTMLDivElement>(stackRef, forwardedRef);
|
|
49
|
-
const
|
|
49
|
+
const arrowNavigationAttrs = useArrowNavigationGroup({ axis: orientation });
|
|
50
50
|
|
|
51
51
|
const styles: CSSProperties = {
|
|
52
52
|
[orientation === 'horizontal' ? 'gridTemplateColumns' : 'gridTemplateRows']:
|
|
@@ -79,14 +79,14 @@ export const Stack = forwardRef<HTMLDivElement, StackProps>(
|
|
|
79
79
|
<StackContext.Provider value={{ orientation, rail, size, onRearrange }}>
|
|
80
80
|
<div
|
|
81
81
|
{...props}
|
|
82
|
-
{...
|
|
82
|
+
{...arrowNavigationAttrs}
|
|
83
83
|
className={mx(
|
|
84
84
|
'grid relative',
|
|
85
85
|
gridClasses,
|
|
86
86
|
(size === 'contain' || size === 'contain-fit-content') &&
|
|
87
87
|
(orientation === 'horizontal'
|
|
88
|
-
? 'overflow-x-auto min-bs-0 bs-full
|
|
89
|
-
: 'overflow-y-auto min-is-0 is-full
|
|
88
|
+
? 'overflow-x-auto min-bs-0 max-bs-full bs-full'
|
|
89
|
+
: 'overflow-y-auto min-is-0 max-is-full is-full'),
|
|
90
90
|
classNames,
|
|
91
91
|
)}
|
|
92
92
|
data-rail={rail}
|
|
@@ -110,4 +110,5 @@ export const Stack = forwardRef<HTMLDivElement, StackProps>(
|
|
|
110
110
|
);
|
|
111
111
|
|
|
112
112
|
export { StackContext };
|
|
113
|
+
|
|
113
114
|
export type { StackContextValue };
|
|
@@ -96,6 +96,7 @@ const StackItemRoot = forwardRef<HTMLDivElement, StackItemRootProps>(
|
|
|
96
96
|
if (!itemElement || !onRearrange || disableRearrange) {
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
|
+
|
|
99
100
|
return combine(
|
|
100
101
|
draggable({
|
|
101
102
|
element: itemElement,
|
|
@@ -146,14 +147,14 @@ const StackItemRoot = forwardRef<HTMLDivElement, StackItemRootProps>(
|
|
|
146
147
|
);
|
|
147
148
|
}, [orientation, item, onRearrange, selfDragHandleElement, itemElement]);
|
|
148
149
|
|
|
149
|
-
const
|
|
150
|
+
const focusableGroupAttrs = useFocusableGroup({ tabBehavior: 'limited' });
|
|
150
151
|
|
|
151
152
|
return (
|
|
152
153
|
<StackItemContext.Provider value={{ selfDragHandleRef, size, setSize }}>
|
|
153
154
|
<Root
|
|
154
155
|
{...props}
|
|
155
156
|
tabIndex={0}
|
|
156
|
-
{...
|
|
157
|
+
{...focusableGroupAttrs}
|
|
157
158
|
className={mx(
|
|
158
159
|
'group/stack-item grid relative',
|
|
159
160
|
focusIndicatorVariant === 'over-all'
|
|
@@ -14,7 +14,7 @@ export type StackItemContentProps = ThemedClassName<ComponentPropsWithoutRef<'di
|
|
|
14
14
|
* This flag is required in order to clarify a developer experience that seemed like it needed extra boilerplate
|
|
15
15
|
* (`row-span-2`) or was buggy. See the description of the StackItem.Content component itself for more information.
|
|
16
16
|
*/
|
|
17
|
-
toolbar
|
|
17
|
+
toolbar?: boolean;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Whether to provide for the layout of a statusbar after the content.
|
|
@@ -16,6 +16,7 @@ export type StackItemHeadingProps = ThemedClassName<ComponentPropsWithoutRef<'di
|
|
|
16
16
|
export const StackItemHeading = ({ children, classNames, ...props }: StackItemHeadingProps) => {
|
|
17
17
|
const { orientation } = useStack();
|
|
18
18
|
const focusableGroupAttrs = useFocusableGroup({ tabBehavior: 'limited' });
|
|
19
|
+
|
|
19
20
|
return (
|
|
20
21
|
<div
|
|
21
22
|
role='heading'
|
|
@@ -38,6 +39,7 @@ export type StackItemHeadingLabelProps = ThemedClassName<ComponentPropsWithRef<'
|
|
|
38
39
|
export const StackItemHeadingLabel = forwardRef<HTMLHeadingElement, StackItemHeadingLabelProps>(
|
|
39
40
|
({ attendableId, related, classNames, ...props }, forwardedRef) => {
|
|
40
41
|
const { hasAttention, isAncestor, isRelated } = useAttention(attendableId);
|
|
42
|
+
|
|
41
43
|
return (
|
|
42
44
|
<h1
|
|
43
45
|
{...props}
|
|
@@ -24,12 +24,17 @@ export type KeyBinding = {
|
|
|
24
24
|
|
|
25
25
|
export type StackItemSigilAction = Pick<ActionLike, 'id' | 'properties' | 'data'>;
|
|
26
26
|
|
|
27
|
-
export type StackItemSigilButtonProps = Omit<ButtonProps, 'variant'> &
|
|
27
|
+
export type StackItemSigilButtonProps = Omit<ButtonProps, 'variant'> &
|
|
28
|
+
AttendableId &
|
|
29
|
+
Related & {
|
|
30
|
+
isMenu?: boolean;
|
|
31
|
+
};
|
|
28
32
|
|
|
29
33
|
export const StackItemSigilButton = forwardRef<HTMLButtonElement, StackItemSigilButtonProps>(
|
|
30
|
-
({ attendableId, classNames, related, children, ...props }, forwardedRef) => {
|
|
34
|
+
({ attendableId, classNames, related, isMenu = true, children, ...props }, forwardedRef) => {
|
|
31
35
|
const { hasAttention, isAncestor, isRelated } = useAttention(attendableId);
|
|
32
36
|
const variant = (related && isRelated) || hasAttention || isAncestor ? 'primary' : 'ghost';
|
|
37
|
+
// TODO(wittjosiah): Disable hover styles when isMenu is false.
|
|
33
38
|
return (
|
|
34
39
|
<Button
|
|
35
40
|
{...props}
|
|
@@ -37,7 +42,7 @@ export const StackItemSigilButton = forwardRef<HTMLButtonElement, StackItemSigil
|
|
|
37
42
|
classNames={['shrink-0 pli-0 min-bs-0 is-[--rail-action] bs-[--rail-action] relative app-no-drag', classNames]}
|
|
38
43
|
ref={forwardedRef}
|
|
39
44
|
>
|
|
40
|
-
<MenuSignifierHorizontal />
|
|
45
|
+
{isMenu && <MenuSignifierHorizontal />}
|
|
41
46
|
{children}
|
|
42
47
|
</Button>
|
|
43
48
|
);
|
|
@@ -67,6 +72,7 @@ export const StackItemSigil = forwardRef<HTMLButtonElement, StackItemSigilProps>
|
|
|
67
72
|
<StackItemSigilButton
|
|
68
73
|
attendableId={attendableId}
|
|
69
74
|
related={related}
|
|
75
|
+
isMenu={hasActions}
|
|
70
76
|
// TODO(wittjosiah): Better disabling of interactive styles when no action are available.
|
|
71
77
|
// Remove underscore icon when no actions are available?
|
|
72
78
|
classNames={!hasActions && 'cursor-default'}
|