@dxos/react-ui-stack 0.8.1-main.ae460ac → 0.8.1-staging.391c573
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 +5 -5
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +5 -5
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +5 -5
- 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 +3 -3
- package/dist/types/src/components/StackItem.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/package.json +21 -21
- package/src/components/Stack.tsx +5 -4
- package/src/components/StackItem.tsx +3 -2
- package/src/components/StackItemHeading.tsx +2 -0
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'
|
|
@@ -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}
|