@functionalcms/svelte-components 4.9.0 → 4.9.1

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.
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
- import { cn } from '../../utils.ts';
3
- import { NavigationDirection, Tab, TabSizes } from './tabs.ts';
2
+ import { cn } from '../../utils.js';
3
+ import { NavigationDirection, Tab, TabSizes } from './tabs.js';
4
4
 
5
5
  interface Props {
6
6
  tabs: Array<Tab>; //` = [];
@@ -20,6 +20,7 @@
20
20
 
21
21
  let dynamicComponentRefs = $state([]); //https://svelte.dev/tutorial/component-this
22
22
  let tabButtonRefs: Array<HTMLButtonElement> = $state([]);
23
+ let activePanel = $state(null);
23
24
 
24
25
  const baseStyles = () => `tabs ${isVerticalOrientation ? 'tabs-vertical' : ''}`;
25
26
 
@@ -181,11 +182,14 @@
181
182
  <!-- {/if} -->
182
183
  {/each}
183
184
  </div>
184
- {#each tabs as panel}
185
+ {#if activePanel}
186
+ {@render activePanel?.tabPanelComponent()}
187
+ {/if}
188
+ <!-- {#each tabs as panel}
185
189
  {#if panel.isActive}
186
190
  {@render panel?.tabPanelComponent()}
187
- {/if}
188
- {/each}
191
+
192
+ {/each} -->
189
193
  </div>
190
194
 
191
195
  <style>
@@ -1,4 +1,4 @@
1
- import { Tab, TabSizes } from './tabs.ts';
1
+ import { Tab, TabSizes } from './tabs.js';
2
2
  interface Props {
3
3
  tabs: Array<Tab>;
4
4
  size?: TabSizes;
@@ -1,7 +1,9 @@
1
1
  import type { Snippet } from "svelte";
2
2
  export interface Tab {
3
3
  title: string;
4
- tabPanelComponent: Snippet;
4
+ tabId?: string;
5
+ tabHref?: string;
6
+ tabPanelComponent?: Snippet;
5
7
  tabButtonComponent?: Snippet;
6
8
  isActive?: boolean;
7
9
  ariaControls?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@functionalcms/svelte-components",
3
- "version": "4.9.0",
3
+ "version": "4.9.1",
4
4
  "watch": {
5
5
  "build": {
6
6
  "patterns": [