@evinvest/uikit 0.1.1 → 0.1.2
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/index.d.ts +5 -8
- package/dist/index.js +4 -31
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -105,14 +105,11 @@ declare function useFloating(opts: {
|
|
|
105
105
|
declare function useFocusScope(enabled: boolean): React.RefObject<HTMLDivElement | null>;
|
|
106
106
|
|
|
107
107
|
/**
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
* Usage: spread `{ ref, ...(isPresent ? {} : {}) }` and render only while
|
|
115
|
-
* `isPresent`. The Rust mirror toggles `data-state` without deferring unmount.
|
|
108
|
+
* Tracks whether an overlay should be mounted. Mount/unmount steps in lockstep
|
|
109
|
+
* with `present`: enter animations (`data-[state=open]:animate-in`) still play
|
|
110
|
+
* on mount, but the kit intentionally does **not** defer unmount for an exit
|
|
111
|
+
* animation — deferring made portaled overlays flicker on close. Pass `ref`
|
|
112
|
+
* through to the animated node (kept for API stability / future use).
|
|
116
113
|
*/
|
|
117
114
|
declare function usePresence(present: boolean): {
|
|
118
115
|
isPresent: boolean;
|
package/dist/index.js
CHANGED
|
@@ -226,34 +226,7 @@ function useFocusScope(enabled) {
|
|
|
226
226
|
import * as React7 from "react";
|
|
227
227
|
function usePresence(present) {
|
|
228
228
|
const ref = React7.useRef(null);
|
|
229
|
-
|
|
230
|
-
React7.useEffect(() => {
|
|
231
|
-
const node = ref.current;
|
|
232
|
-
if (present) {
|
|
233
|
-
setIsPresent(true);
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
if (!node) {
|
|
237
|
-
setIsPresent(false);
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
const styles = getComputedStyle(node);
|
|
241
|
-
const hasAnim = styles.animationName && styles.animationName !== "none" || parseFloat(styles.transitionDuration) > 0;
|
|
242
|
-
if (!hasAnim) {
|
|
243
|
-
setIsPresent(false);
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
|
-
function done() {
|
|
247
|
-
setIsPresent(false);
|
|
248
|
-
}
|
|
249
|
-
node.addEventListener("animationend", done);
|
|
250
|
-
node.addEventListener("transitionend", done);
|
|
251
|
-
return () => {
|
|
252
|
-
node.removeEventListener("animationend", done);
|
|
253
|
-
node.removeEventListener("transitionend", done);
|
|
254
|
-
};
|
|
255
|
-
}, [present]);
|
|
256
|
-
return { isPresent: present || isPresent, ref };
|
|
229
|
+
return { isPresent: present, ref };
|
|
257
230
|
}
|
|
258
231
|
|
|
259
232
|
// src/primitives/use-roving-focus.ts
|
|
@@ -2501,6 +2474,9 @@ function Slider({
|
|
|
2501
2474
|
"data-disabled": disabled || void 0,
|
|
2502
2475
|
className: cn(ROOT_BASE2, className),
|
|
2503
2476
|
...props,
|
|
2477
|
+
onPointerDown,
|
|
2478
|
+
onPointerMove,
|
|
2479
|
+
onPointerUp,
|
|
2504
2480
|
children: [
|
|
2505
2481
|
/* @__PURE__ */ jsx31(
|
|
2506
2482
|
"span",
|
|
@@ -2509,9 +2485,6 @@ function Slider({
|
|
|
2509
2485
|
"data-slot": "slider-track",
|
|
2510
2486
|
"data-orientation": orientation,
|
|
2511
2487
|
className: TRACK_BASE,
|
|
2512
|
-
onPointerDown,
|
|
2513
|
-
onPointerMove,
|
|
2514
|
-
onPointerUp,
|
|
2515
2488
|
children: /* @__PURE__ */ jsx31(
|
|
2516
2489
|
"span",
|
|
2517
2490
|
{
|