@octanejs/floating-ui 0.1.52 → 0.1.54
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/cjs/Composite.cjs +1 -1
- package/dist/cjs/FloatingList.cjs +1 -1
- package/dist/cjs/FloatingPortal.cjs +1 -1
- package/dist/cjs/delayGroup.cjs +2 -2
- package/dist/cjs/tree.cjs +2 -2
- package/package.json +5 -5
- package/src/Composite.ts +1 -1
- package/src/FloatingList.ts +1 -1
- package/src/FloatingPortal.ts +1 -1
- package/src/delayGroup.ts +2 -2
- package/src/tree.ts +2 -2
- package/src/utils/index.ts +3 -12
package/dist/cjs/Composite.cjs
CHANGED
|
@@ -193,7 +193,7 @@ function Composite(props) {
|
|
|
193
193
|
handleKeyDown(e);
|
|
194
194
|
}
|
|
195
195
|
};
|
|
196
|
-
return (0, import_octane.createElement)(CompositeContext
|
|
196
|
+
return (0, import_octane.createElement)(CompositeContext, {
|
|
197
197
|
value: contextValue,
|
|
198
198
|
children: (0, import_octane.createElement)(import_FloatingList.FloatingList, {
|
|
199
199
|
elementsRef,
|
|
@@ -84,7 +84,7 @@ function FloatingList(props) {
|
|
|
84
84
|
[register, unregister, map, elementsRef, labelsRef],
|
|
85
85
|
(0, import_internal.S)("FloatingList:value")
|
|
86
86
|
);
|
|
87
|
-
return (0, import_octane.createElement)(FloatingListContext
|
|
87
|
+
return (0, import_octane.createElement)(FloatingListContext, { value, children });
|
|
88
88
|
}
|
|
89
89
|
function useListItem(...args) {
|
|
90
90
|
const [user, slotArg] = (0, import_internal.splitSlot)(args);
|
|
@@ -220,7 +220,7 @@ function FloatingPortal(props) {
|
|
|
220
220
|
[preserveTabOrder, portalNode],
|
|
221
221
|
(0, import_internal.S)("FloatingPortal:value")
|
|
222
222
|
);
|
|
223
|
-
return (0, import_octane.createElement)(PortalContext
|
|
223
|
+
return (0, import_octane.createElement)(PortalContext, {
|
|
224
224
|
value,
|
|
225
225
|
children: [
|
|
226
226
|
shouldRenderGuards && portalNode ? (0, import_octane.createElement)(FocusGuard, {
|
package/dist/cjs/delayGroup.cjs
CHANGED
|
@@ -87,7 +87,7 @@ function FloatingDelayGroup(props) {
|
|
|
87
87
|
[state, setCurrentId],
|
|
88
88
|
(0, import_internal.S)("FloatingDelayGroup:value")
|
|
89
89
|
);
|
|
90
|
-
return (0, import_octane.createElement)(FloatingDelayGroupContext
|
|
90
|
+
return (0, import_octane.createElement)(FloatingDelayGroupContext, { value, children });
|
|
91
91
|
}
|
|
92
92
|
function useDelayGroup(...args) {
|
|
93
93
|
const [user, slot] = (0, import_internal.splitSlot)(args);
|
|
@@ -181,7 +181,7 @@ function NextFloatingDelayGroup(props) {
|
|
|
181
181
|
[timeoutMs],
|
|
182
182
|
(0, import_internal.S)("NextFloatingDelayGroup:value")
|
|
183
183
|
);
|
|
184
|
-
return (0, import_octane.createElement)(NextFloatingDelayGroupContext
|
|
184
|
+
return (0, import_octane.createElement)(NextFloatingDelayGroupContext, { value, children });
|
|
185
185
|
}
|
|
186
186
|
function useNextDelayGroup(...args) {
|
|
187
187
|
const [user, slot] = (0, import_internal.splitSlot)(args);
|
package/dist/cjs/tree.cjs
CHANGED
|
@@ -66,7 +66,7 @@ function FloatingNode(props) {
|
|
|
66
66
|
const id = props.id;
|
|
67
67
|
const parentId = useFloatingParentNodeId();
|
|
68
68
|
const value = (0, import_octane.useMemo)(() => ({ id, parentId }), [id, parentId], (0, import_internal.S)("FloatingNode:value"));
|
|
69
|
-
return (0, import_octane.createElement)(FloatingNodeContext
|
|
69
|
+
return (0, import_octane.createElement)(FloatingNodeContext, { value, children });
|
|
70
70
|
}
|
|
71
71
|
function FloatingTree(props) {
|
|
72
72
|
const children = props.children;
|
|
@@ -91,7 +91,7 @@ function FloatingTree(props) {
|
|
|
91
91
|
[addNode, removeNode, events],
|
|
92
92
|
(0, import_internal.S)("FloatingTree:value")
|
|
93
93
|
);
|
|
94
|
-
return (0, import_octane.createElement)(FloatingTreeContext
|
|
94
|
+
return (0, import_octane.createElement)(FloatingTreeContext, { value, children });
|
|
95
95
|
}
|
|
96
96
|
// Annotate the CommonJS export names for ESM import in node:
|
|
97
97
|
0 && (module.exports = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/floating-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.54",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"tabbable": "^6.5.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"octane": "^0.1.51 || ^0.2.0"
|
|
56
|
+
"octane": "^0.1.51 || ^0.2.0 || ^0.3.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@radix-ui/react-checkbox": "1.0.4",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@testing-library/user-event": "14.6.1",
|
|
64
64
|
"@types/react": "18.3.19",
|
|
65
65
|
"@types/react-dom": "18.3.1",
|
|
66
|
-
"@tsrx/react": "^0.
|
|
66
|
+
"@tsrx/react": "^0.3.0",
|
|
67
67
|
"@vitest/browser": "4.1.10",
|
|
68
68
|
"@floating-ui/react": "0.27.19",
|
|
69
69
|
"@floating-ui/react-dom": "2.1.8",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"vite": "^8.1.5",
|
|
81
81
|
"vitest": "3.0.9",
|
|
82
82
|
"vitest-browser-react": "0.1.1",
|
|
83
|
-
"@octanejs/testing-library": "0.1.
|
|
84
|
-
"octane": "0.
|
|
83
|
+
"@octanejs/testing-library": "0.1.52",
|
|
84
|
+
"octane": "0.3.0"
|
|
85
85
|
},
|
|
86
86
|
"scripts": {
|
|
87
87
|
"build:cjs": "node ../../scripts/build-package-commonjs.mjs",
|
package/src/Composite.ts
CHANGED
package/src/FloatingList.ts
CHANGED
|
@@ -104,7 +104,7 @@ export function FloatingList(props: FloatingListProps): OctaneNode {
|
|
|
104
104
|
[register, unregister, map, elementsRef, labelsRef],
|
|
105
105
|
S('FloatingList:value'),
|
|
106
106
|
);
|
|
107
|
-
return createElement(FloatingListContext
|
|
107
|
+
return createElement(FloatingListContext, { value, children });
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
export interface UseListItemProps {
|
package/src/FloatingPortal.ts
CHANGED
|
@@ -312,7 +312,7 @@ export function FloatingPortal(props: FloatingPortalProps): OctaneNode {
|
|
|
312
312
|
S('FloatingPortal:value'),
|
|
313
313
|
);
|
|
314
314
|
|
|
315
|
-
return createElement(PortalContext
|
|
315
|
+
return createElement(PortalContext, {
|
|
316
316
|
value,
|
|
317
317
|
children: [
|
|
318
318
|
shouldRenderGuards && portalNode
|
package/src/delayGroup.ts
CHANGED
|
@@ -123,7 +123,7 @@ export function FloatingDelayGroup(props: FloatingDelayGroupProps): OctaneNode {
|
|
|
123
123
|
[state, setCurrentId],
|
|
124
124
|
S('FloatingDelayGroup:value'),
|
|
125
125
|
);
|
|
126
|
-
return createElement(FloatingDelayGroupContext
|
|
126
|
+
return createElement(FloatingDelayGroupContext, { value, children });
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
/**
|
|
@@ -256,7 +256,7 @@ export function NextFloatingDelayGroup(props: NextFloatingDelayGroupProps): Octa
|
|
|
256
256
|
[timeoutMs],
|
|
257
257
|
S('NextFloatingDelayGroup:value'),
|
|
258
258
|
);
|
|
259
|
-
return createElement(NextFloatingDelayGroupContext
|
|
259
|
+
return createElement(NextFloatingDelayGroupContext, { value, children });
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
export interface UseNextDelayGroupOptions {
|
package/src/tree.ts
CHANGED
|
@@ -88,7 +88,7 @@ export function FloatingNode(props: FloatingNodeProps): OctaneNode {
|
|
|
88
88
|
const id = props.id;
|
|
89
89
|
const parentId = useFloatingParentNodeId();
|
|
90
90
|
const value = useMemo(() => ({ id, parentId }), [id, parentId], S('FloatingNode:value'));
|
|
91
|
-
return createElement(FloatingNodeContext
|
|
91
|
+
return createElement(FloatingNodeContext, { value, children });
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
export interface FloatingTreeProps {
|
|
@@ -123,5 +123,5 @@ export function FloatingTree(props: FloatingTreeProps): OctaneNode {
|
|
|
123
123
|
[addNode, removeNode, events],
|
|
124
124
|
S('FloatingTree:value'),
|
|
125
125
|
);
|
|
126
|
-
return createElement(FloatingTreeContext
|
|
126
|
+
return createElement(FloatingTreeContext, { value, children });
|
|
127
127
|
}
|
package/src/utils/index.ts
CHANGED
|
@@ -7,24 +7,15 @@
|
|
|
7
7
|
import { isShadowRoot, isHTMLElement } from '@floating-ui/utils/dom';
|
|
8
8
|
import { floor } from '@floating-ui/utils';
|
|
9
9
|
import { tabbable, type FocusableElement } from 'tabbable';
|
|
10
|
-
import { useCallback, useLayoutEffect, useRef } from 'octane';
|
|
11
|
-
import type { Octane } from 'octane/jsx-runtime';
|
|
10
|
+
import { useCallback, useLayoutEffect, useRef, type CSSProperties } from 'octane';
|
|
12
11
|
import type { Dimensions } from '@floating-ui/dom';
|
|
13
12
|
|
|
14
13
|
import { subSlot } from '../internal';
|
|
15
14
|
import type { Delay, MutableRefObject } from '../types';
|
|
16
15
|
|
|
17
|
-
export {
|
|
16
|
+
export type { CSSProperties } from 'octane';
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
* The OBJECT form of octane's `style` prop — the port's analog of
|
|
21
|
-
* `React.CSSProperties` (octane's `style` additionally accepts a plain string;
|
|
22
|
-
* helpers that merge/inspect style objects require this form).
|
|
23
|
-
*/
|
|
24
|
-
export type CSSProperties = Exclude<
|
|
25
|
-
Octane.HTMLAttributes<HTMLElement>['style'],
|
|
26
|
-
string | undefined
|
|
27
|
-
>;
|
|
18
|
+
export { getDeepestNode, getNodeAncestors, getNodeChildren } from './nodes';
|
|
28
19
|
|
|
29
20
|
/** Which list items are disabled (mirrors upstream's unexported `DisabledIndices`). */
|
|
30
21
|
export type DisabledIndices = Array<number> | ((index: number) => boolean);
|