Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions 2nd-gen/packages/core/components/tabs/Tabs.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export abstract class TabsBase extends SpectrumElement {
this.requestUpdate('keyboardActivation', old);
}

/** @internal */
private _keyboardActivation: KeyboardActivation = KEYBOARD_ACTIVATION_DEFAULT;

/**
Expand Down Expand Up @@ -139,6 +140,7 @@ export abstract class TabsBase extends SpectrumElement {
this.requestUpdate('density', old);
}

/** @internal */
private _density: TabDensity = TAB_DENSITY_DEFAULT;

/**
Expand Down Expand Up @@ -181,6 +183,7 @@ export abstract class TabsBase extends SpectrumElement {
this.requestUpdate('direction', oldDirection);
}

/** @internal */
private _direction: TabsDirection = TABS_DEFAULT_DIRECTION;

/**
Expand Down Expand Up @@ -209,23 +212,30 @@ export abstract class TabsBase extends SpectrumElement {
// IMPLEMENTATION
// ──────────────────────

/** @internal */
private static readonly INDICATOR_BASE_SIZE = 100;

/**
* @internal
*
* Inline style applied to the selection indicator element.
* Computed from the selected tab's position and dimensions.
*/
@state()
protected selectionIndicatorStyle = '';

/**
* @internal
*
* Suppresses the transition on the very first indicator placement
* so it doesn't animate from the origin.
*/
@state()
protected shouldAnimate = false;

/**
* @internal
*
* Cached list of tab elements managed by this container. Updated
* via `handleTabSlotChange`.
*/
Expand Down Expand Up @@ -519,6 +529,8 @@ export abstract class TabsBase extends SpectrumElement {
// ───────────────────────────────────

/**
* @internal
*
* Recalculates the selection indicator's position and size based
* on the currently selected tab element. Uses CSS transforms for
* smooth animation between tab positions.
Expand Down Expand Up @@ -565,6 +577,7 @@ export abstract class TabsBase extends SpectrumElement {
}
};

/** @internal */
private _resizeObserver?: ResizeObserver;

// ───────────────────────────────────
Expand Down
2 changes: 2 additions & 0 deletions 2nd-gen/packages/swc/components/tabs/Tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ import styles from './tabs.css';
*/
export class Tabs extends TabsBase {
/**
* @internal
*
* Shadow `delegatesFocus: true` keeps native focus-delegation where supported;
* `TabsBase.focus()` focuses the selected slotted tab explicitly so
* programmatic `focus()` matches 1st-gen expectations regardless of engine.
Expand Down
Loading