@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.
- package/dist/ts-components.d.mts +2 -1
- package/dist/ts-components.d.mts.map +1 -1
- package/dist/ts-components.mjs +118 -64
- package/dist/ts-components.mjs.map +1 -1
- package/package.json +9 -9
- package/src/standard/btn/btn.ts +4 -4
- package/src/standard/classicLogo/classicLogo.ts +14 -6
- package/src/standard/composer/composer.ts +29 -14
- package/src/standard/composer/emailHtmlPolicy.ts +4 -1
- package/src/standard/consent/consent.ts +7 -5
- package/src/standard/form/form.ts +6 -4
- package/src/standard/logo/logo.ts +43 -12
- package/src/standard/modal/modal.ts +2 -2
- package/src/standard/navMenu/navMenu.ts +7 -7
- package/src/standard/pageLinks/pageLinks.ts +4 -4
- package/src/standard/pageScript/pageScript.ts +6 -9
- package/src/standard/pageToc/pageToc.ts +5 -9
- package/src/standard/searchBox/searchBox.ts +4 -4
- package/src/standard/signIn/signIn.ts +2 -2
- package/src/standard/tabs/tabs.ts +5 -3
- package/src/standard/tabs/tabsStyle.ts +9 -5
- package/src/standard/topBar/topBar.ts +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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
|
-
|
|
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
|
|
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
|
|
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 {
|
|
1
|
+
import type { PageContext, SiteLogoConfig } from '@purestack/ts-common'
|
|
2
2
|
|
|
3
|
-
import {
|
|
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:
|
|
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(
|
|
109
|
+
context: (head) => resolveTopBar(resolvePageContext(head), head.props),
|
|
110
110
|
})
|
|
111
111
|
}
|
|
112
112
|
|