@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 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
- * Keeps a node mounted through its exit animation — the dep-light core of
109
- * `@radix-ui/react-presence`. While `present` is true the node is mounted with
110
- * `data-state="open"`; when `present` flips to false the hook switches it to
111
- * `data-state="closed"` and unmounts only after the node's CSS
112
- * animation/transition ends (or immediately if there is none).
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
- const [isPresent, setIsPresent] = React7.useState(present);
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
  {