@pzerelles/headlessui-svelte 2.1.2-next.51 → 2.1.2-next.52

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.
@@ -68,6 +68,9 @@
68
68
  ? (usesOpenClosedState.value & State.Open) === State.Open
69
69
  : context.disclosureState === DisclosureStates.Open
70
70
  },
71
+ get asChild() {
72
+ return theirProps.asChild
73
+ },
71
74
  })
72
75
 
73
76
  const slot = $derived({
@@ -13,6 +13,7 @@ export declare function useTransition(options: {
13
13
  start?(show: boolean): void;
14
14
  end?(show: boolean): void;
15
15
  };
16
+ asChild?: boolean;
16
17
  }): {
17
18
  readonly visible: boolean;
18
19
  readonly data: TransitionData;
@@ -37,7 +37,7 @@ export function transitionDataAttributes(data) {
37
37
  return attributes;
38
38
  }
39
39
  export function useTransition(options) {
40
- const { enabled, element, show, events } = $derived(options);
40
+ const { enabled, element, show, events, asChild } = $derived(options);
41
41
  let visible = $state((() => show)());
42
42
  let flags = $state((() => (enabled && visible ? TransitionState.Enter | TransitionState.Closed : TransitionState.None))());
43
43
  let inFlight = $state(false);
@@ -58,7 +58,7 @@ export function useTransition(options) {
58
58
  }
59
59
  if (!node) {
60
60
  // Retry if the DOM node isn't available yet
61
- if (show) {
61
+ if (show && !asChild) {
62
62
  flags |= TransitionState.Enter | TransitionState.Closed;
63
63
  return d.nextFrame(() => retry(enabled, show, node, d));
64
64
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pzerelles/headlessui-svelte",
3
- "version": "2.1.2-next.51",
3
+ "version": "2.1.2-next.52",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",