codexly-ui 0.6.16 → 0.6.17
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/fesm2022/codexly-ui.mjs +39 -4
- package/fesm2022/codexly-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/codexly-ui.d.ts +26 -1
package/fesm2022/codexly-ui.mjs
CHANGED
|
@@ -564,6 +564,19 @@ class ClxThemeService {
|
|
|
564
564
|
weight: override?.weight ?? defaultWeight,
|
|
565
565
|
};
|
|
566
566
|
}
|
|
567
|
+
/** Resolved style for ClxPageHeaderComponent's title — falls back to the default
|
|
568
|
+
* text-clx-text-label color (no override) / 2xl / emphasis */
|
|
569
|
+
pageHeaderTitleStyle = computed(() => this._resolvePageHeaderZoneStyle(this._config().pageHeaderTitle, '2xl', 'emphasis'), ...(ngDevMode ? [{ debugName: "pageHeaderTitleStyle" }] : /* istanbul ignore next */ []));
|
|
570
|
+
/** Resolved style for ClxPageHeaderComponent's subtitle — falls back to the default
|
|
571
|
+
* text-clx-text-muted color (no override) / sm / label */
|
|
572
|
+
pageHeaderSubtitleStyle = computed(() => this._resolvePageHeaderZoneStyle(this._config().pageHeaderSubtitle, 'sm', 'label'), ...(ngDevMode ? [{ debugName: "pageHeaderSubtitleStyle" }] : /* istanbul ignore next */ []));
|
|
573
|
+
_resolvePageHeaderZoneStyle(override, defaultSize, defaultWeight) {
|
|
574
|
+
return {
|
|
575
|
+
color: override?.color,
|
|
576
|
+
size: override?.size ?? defaultSize,
|
|
577
|
+
weight: override?.weight ?? defaultWeight,
|
|
578
|
+
};
|
|
579
|
+
}
|
|
567
580
|
constructor() {
|
|
568
581
|
effect(() => {
|
|
569
582
|
if (!this._isBrowser)
|
|
@@ -10012,6 +10025,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
10012
10025
|
args: [{ selector: '[clxPageHeaderTitle]', standalone: true }]
|
|
10013
10026
|
}] });
|
|
10014
10027
|
|
|
10028
|
+
const TEXT_SIZE_CLASS = {
|
|
10029
|
+
sm: 'text-sm',
|
|
10030
|
+
base: 'text-base',
|
|
10031
|
+
lg: 'text-lg',
|
|
10032
|
+
xl: 'text-xl',
|
|
10033
|
+
'2xl': 'text-2xl',
|
|
10034
|
+
'3xl': 'text-3xl',
|
|
10035
|
+
};
|
|
10036
|
+
const WEIGHT_CLASS = {
|
|
10037
|
+
label: 'font-(--clx-font-weight-label)',
|
|
10038
|
+
emphasis: 'font-(--clx-font-weight-emphasis)',
|
|
10039
|
+
};
|
|
10015
10040
|
/**
|
|
10016
10041
|
* Standard page title block: an optional back button, title + optional subtitle on the
|
|
10017
10042
|
* left, a free-content slot (button, select, badge...) on the right. Replaces the
|
|
@@ -10031,6 +10056,16 @@ class ClxPageHeaderComponent {
|
|
|
10031
10056
|
_titleSlot = contentChild(ClxPageHeaderTitleDirective, ...(ngDevMode ? [{ debugName: "_titleSlot" }] : /* istanbul ignore next */ []));
|
|
10032
10057
|
_hasCustomTitle = computed(() => !!this._titleSlot(), ...(ngDevMode ? [{ debugName: "_hasCustomTitle" }] : /* istanbul ignore next */ []));
|
|
10033
10058
|
_color = computed(() => this._themeSvc.config().primaryColor, ...(ngDevMode ? [{ debugName: "_color" }] : /* istanbul ignore next */ []));
|
|
10059
|
+
_titleClass = computed(() => {
|
|
10060
|
+
const s = this._themeSvc.pageHeaderTitleStyle();
|
|
10061
|
+
const colorCls = s.color ? resolveColor(s.color).textSubtle : 'text-clx-text-label';
|
|
10062
|
+
return `${TEXT_SIZE_CLASS[s.size]} ${WEIGHT_CLASS[s.weight]} ${colorCls} truncate`;
|
|
10063
|
+
}, ...(ngDevMode ? [{ debugName: "_titleClass" }] : /* istanbul ignore next */ []));
|
|
10064
|
+
_subtitleClass = computed(() => {
|
|
10065
|
+
const s = this._themeSvc.pageHeaderSubtitleStyle();
|
|
10066
|
+
const colorCls = s.color ? resolveColor(s.color).textSubtle : 'text-clx-text-muted';
|
|
10067
|
+
return `${TEXT_SIZE_CLASS[s.size]} ${WEIGHT_CLASS[s.weight]} ${colorCls} mt-0.5`;
|
|
10068
|
+
}, ...(ngDevMode ? [{ debugName: "_subtitleClass" }] : /* istanbul ignore next */ []));
|
|
10034
10069
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ClxPageHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10035
10070
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: ClxPageHeaderComponent, isStandalone: true, selector: "clx-page-header", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, subtitle: { classPropertyName: "subtitle", publicName: "subtitle", isSignal: true, isRequired: false, transformFunction: null }, showBack: { classPropertyName: "showBack", publicName: "showBack", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { back: "back" }, host: { classAttribute: "flex items-center gap-3 flex-wrap" }, queries: [{ propertyName: "_titleSlot", first: true, predicate: ClxPageHeaderTitleDirective, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
10036
10071
|
@if (showBack()) {
|
|
@@ -10045,9 +10080,9 @@ class ClxPageHeaderComponent {
|
|
|
10045
10080
|
</div>
|
|
10046
10081
|
} @else {
|
|
10047
10082
|
<div class="min-w-0">
|
|
10048
|
-
<h1 class="
|
|
10083
|
+
<h1 [class]="_titleClass()">{{ title() }}</h1>
|
|
10049
10084
|
@if (subtitle()) {
|
|
10050
|
-
<p class="
|
|
10085
|
+
<p [class]="_subtitleClass()">{{ subtitle() }}</p>
|
|
10051
10086
|
}
|
|
10052
10087
|
</div>
|
|
10053
10088
|
}
|
|
@@ -10077,9 +10112,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
10077
10112
|
</div>
|
|
10078
10113
|
} @else {
|
|
10079
10114
|
<div class="min-w-0">
|
|
10080
|
-
<h1 class="
|
|
10115
|
+
<h1 [class]="_titleClass()">{{ title() }}</h1>
|
|
10081
10116
|
@if (subtitle()) {
|
|
10082
|
-
<p class="
|
|
10117
|
+
<p [class]="_subtitleClass()">{{ subtitle() }}</p>
|
|
10083
10118
|
}
|
|
10084
10119
|
</div>
|
|
10085
10120
|
}
|