@purestack/ts-components 1.1.7 → 1.1.9

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,4 +1,4 @@
1
- import { tryResolveTsSsgContext } from '@purestack/ts-common'
1
+ import { tryResolvePageContext } from '@purestack/ts-common'
2
2
  import type { SemanticTone } from '@purestack/ts-style'
3
3
  import {
4
4
  type ComponentHead,
@@ -27,6 +27,7 @@ export class Tabs {
27
27
  group: string = defaultGroup
28
28
  ariaLabel?: RefOrValue<string>
29
29
  selectedTab?: RefOrValue<string>
30
+ mobileSelect?: RefOrValue<boolean>
30
31
  tone?: RefOrValue<SemanticTone>
31
32
  variant?: RefOrValue<ComponentVariant>
32
33
  variantMode?: RefOrValue<ComponentVariantMode>
@@ -48,7 +49,7 @@ export interface TabPane {
48
49
  tabClasses?: ComputedRef<string>
49
50
  }
50
51
 
51
- const tabsTemplate = html`<section class="tabs" :class="classes">
52
+ const tabsTemplate = html`<section class="tabs" :class="classes" :data-mobile-select="mobileSelect">
52
53
  <slot name="header"></slot>
53
54
  <div class="tabs__list" role="tablist" :aria-label="ariaLabel || 'Tabs'">
54
55
  <slot></slot>
@@ -96,6 +97,7 @@ function defineTabsComponent() {
96
97
  'ariaLabel',
97
98
  'group',
98
99
  'selectedTab',
100
+ 'mobileSelect',
99
101
  'tone',
100
102
  'variant',
101
103
  'variantMode',
@@ -189,5 +191,5 @@ function resolveTabPane(head: ComponentHead<TabPane>): TabPane {
189
191
  }
190
192
 
191
193
  function markTabsRuntimeEmbed(head: ComponentHead<Tabs>) {
192
- tryResolveTsSsgContext(head)?.recordRuntimeEmbed('tabs', 'head')
194
+ tryResolvePageContext(head)?.recordRuntimeEmbed('tabs', 'head')
193
195
  }
@@ -215,17 +215,21 @@ function registerTabsPanelStyles(theme: ThemeMode) {
215
215
  }
216
216
 
217
217
  function registerTabsResponsiveStyles(theme: ThemeMode) {
218
- styleBuilder.select('.tabs--enhanced .tabs__tabs-row', theme).display('flex')
218
+ styleBuilder
219
+ .select('.tabs--enhanced > .tabs__tabs-row', theme)
220
+ .display('flex')
219
221
 
220
222
  styleBuilder
221
- .select('.tabs--compact .tabs__select-wrap', theme)
223
+ .select('.tabs--compact > .tabs__select-wrap', theme)
222
224
  .display('block')
223
225
 
224
- styleBuilder.select('.tabs--enhanced .tabs__tab', theme).display('none')
226
+ styleBuilder
227
+ .select('.tabs--enhanced > .tabs__list > .tabs__item > .tabs__tab', theme)
228
+ .display('none')
225
229
 
226
- styleBuilder.select('.tabs--compact .tabs__tabs-row', theme).display('none')
230
+ styleBuilder.select('.tabs--compact > .tabs__tabs-row', theme).display('none')
227
231
 
228
232
  styleBuilder
229
- .select('.tabs--compact .tabs__list', theme)
233
+ .select('.tabs--compact > .tabs__list', theme)
230
234
  .gridTemplateColumns('1fr')
231
235
  }
@@ -1,6 +1,6 @@
1
- import type { SiteLogoConfig, TsSsgContext } from '@purestack/ts-common'
1
+ import type { PageContext, SiteLogoConfig } from '@purestack/ts-common'
2
2
 
3
- import { resolveTsSsgContext } from '@purestack/ts-common'
3
+ import { resolvePageContext } from '@purestack/ts-common'
4
4
  import type { SemanticTone } from '@purestack/ts-style'
5
5
  import {
6
6
  type ComputedRef,
@@ -35,7 +35,7 @@ export interface TopBar {
35
35
  const DEFAULT_TOP_BAR_VARIANT: ComponentVariant = 'surfaceAlt'
36
36
  const DEFAULT_TOP_BAR_VARIANT_MODE: ComponentVariantMode = 'stateless'
37
37
 
38
- function resolveTopBar(context: TsSsgContext, props: TopBar): TopBar {
38
+ function resolveTopBar(context: PageContext, props: TopBar): TopBar {
39
39
  return {
40
40
  ...props,
41
41
  siteLogo: context.site.logo,
@@ -106,7 +106,7 @@ function defineTopBarComponent() {
106
106
  'signInEnabled',
107
107
  'search',
108
108
  ],
109
- context: (head) => resolveTopBar(resolveTsSsgContext(head), head.props),
109
+ context: (head) => resolveTopBar(resolvePageContext(head), head.props),
110
110
  })
111
111
  }
112
112