diff --git a/frontend/src/components/ui/tab-group/tab-group.ts b/frontend/src/components/ui/tab-group/tab-group.ts index 076218b3d3..fe34449e9b 100644 --- a/frontend/src/components/ui/tab-group/tab-group.ts +++ b/frontend/src/components/ui/tab-group/tab-group.ts @@ -1,4 +1,3 @@ -import clsx from "clsx"; import { html, type PropertyValues } from "lit"; import { customElement, @@ -10,7 +9,7 @@ import type { TabClickDetail, TabGroupTab } from "./tab"; import { type TabGroupPanel } from "./tab-panel"; import { TailwindElement } from "@/classes/TailwindElement"; -import { tw } from "@/utils/tailwind"; +import { pageSectionsWithNav } from "@/layouts/pageSectionsWithNav"; /** * @example Usage: @@ -33,6 +32,10 @@ export class TabGroup extends TailwindElement { @property({ type: String }) placement: "top" | "start" = "top"; + /* Nav sticky */ + @property({ type: Boolean }) + sticky = true; + @property({ type: String, noAccessor: true, reflect: true }) role = "tablist"; @@ -61,29 +64,16 @@ export class TabGroup extends TailwindElement { } render() { - return html` -
-
- -
-
- -
-
- `; + return pageSectionsWithNav({ + nav: html``, + main: html``, + placement: this.placement, + sticky: this.sticky, + }); } private handleActiveChange() { diff --git a/frontend/src/components/ui/tab-list.ts b/frontend/src/components/ui/tab-list.ts index 0ee03401d1..8c9c9f558c 100644 --- a/frontend/src/components/ui/tab-list.ts +++ b/frontend/src/components/ui/tab-list.ts @@ -8,50 +8,10 @@ const DEFAULT_PANEL_ID = "default-panel"; // postcss-lit-disable-next-line export const TWO_COL_SCREEN_MIN_CSS = css`64.5rem`; -/** - * @deprecated Use `btrix-tab-group` - * - * Tab list - * - * Usage example: - * ```ts - * - * One - * Two - * - * - * Tab one content - * Tab two content - * ``` - */ - -@customElement("btrix-tab-panel") -export class TabPanel extends TailwindElement { - @property({ type: String }) - name?: string; +const tabTagName = "btrix-tab-list-tab" as const; - @property({ type: Boolean }) - active = false; - - render() { - return html` -
- -
- `; - } -} - -/** - * @deprecated Use `btrix-tab-group` - */ -@customElement("btrix-tab") -export class Tab extends TailwindElement { +@customElement(tabTagName) +export class TabListTab extends TailwindElement { // ID of panel the tab labels/controls @property({ type: String }) name?: string; @@ -65,7 +25,7 @@ export class Tab extends TailwindElement { render() { return html`