@spaethtech/svelte-ui 0.7.1-dev.46.8e420d1 → 0.7.1-dev.48.f0e45b8

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.
@@ -125,6 +125,7 @@
125
125
  hoverExpandCloseMs = 200,
126
126
  side = "left",
127
127
  api = $bindable(),
128
+ activeMode = $bindable(),
128
129
  class: additionalClass = "",
129
130
  }: {
130
131
  items?: SideBarMenuItem[];
@@ -187,6 +188,9 @@
187
188
  * (SvelteKit `afterNavigate`, etc.) so a programmatic `goto()`/back-button closes the drawer +
188
189
  * any open popout and returns a stepped drawer to the top. */
189
190
  api?: SideBarMenuApi;
191
+ /** Read-only (bindable) — the currently active {@link SideBarMenuMode}. Bind it to decide whether
192
+ * your own header trigger should render (e.g. only in `drawer`/`stepped`). */
193
+ activeMode?: SideBarMenuMode;
190
194
  class?: string;
191
195
  } = $props();
192
196
 
@@ -239,6 +243,11 @@
239
243
  return () => queries.forEach((q) => q.removeEventListener("change", sync));
240
244
  });
241
245
 
246
+ // Mirror the resolved mode out for consumers (bindable, read-only).
247
+ $effect(() => {
248
+ activeMode = currentMode;
249
+ });
250
+
242
251
  const isStepped = $derived(currentMode === "stepped");
243
252
  const isDrawer = $derived(currentMode === "drawer" || currentMode === "stepped");
244
253
  // Dock side. `right` mirrors the frame, drawer slide, hamburger corner, popout side, and item layout.
@@ -135,8 +135,11 @@ type $$ComponentProps = {
135
135
  * (SvelteKit `afterNavigate`, etc.) so a programmatic `goto()`/back-button closes the drawer +
136
136
  * any open popout and returns a stepped drawer to the top. */
137
137
  api?: SideBarMenuApi;
138
+ /** Read-only (bindable) — the currently active {@link SideBarMenuMode}. Bind it to decide whether
139
+ * your own header trigger should render (e.g. only in `drawer`/`stepped`). */
140
+ activeMode?: SideBarMenuMode;
138
141
  class?: string;
139
142
  };
140
- declare const SideBarMenu: import("svelte").Component<$$ComponentProps, {}, "open" | "stepLevel" | "api">;
143
+ declare const SideBarMenu: import("svelte").Component<$$ComponentProps, {}, "open" | "stepLevel" | "api" | "activeMode">;
141
144
  type SideBarMenu = ReturnType<typeof SideBarMenu>;
142
145
  export default SideBarMenu;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaethtech/svelte-ui",
3
- "version": "0.7.1-dev.46.8e420d1",
3
+ "version": "0.7.1-dev.48.f0e45b8",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/spaethtech/svelte-ui.git"