@ojiepermana/angular 21.1.23 → 21.1.25
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/etos/styles/style.css +4 -2
- package/fesm2022/ojiepermana-angular-brand-etos.mjs +8 -6
- package/fesm2022/ojiepermana-angular-brand-etos.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-component.mjs +602 -8
- package/fesm2022/ojiepermana-angular-component.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-layout.mjs +59 -2
- package/fesm2022/ojiepermana-angular-layout.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-navigation.mjs +13 -13
- package/fesm2022/ojiepermana-angular-navigation.mjs.map +1 -1
- package/fesm2022/ojiepermana-angular-theme.mjs +24 -3
- package/fesm2022/ojiepermana-angular-theme.mjs.map +1 -1
- package/package.json +9 -1
- package/theme/styles/themes/library/_components.css +18 -0
- package/theme/styles/themes/library/_tokens.css +11 -10
- package/theme/styles/themes/library/color/amber.css +24 -11
- package/theme/styles/themes/library/color/base.css +36 -0
- package/theme/styles/themes/library/color/blue.css +23 -15
- package/theme/styles/themes/library/color/cyan.css +31 -0
- package/theme/styles/themes/library/color/emerald.css +31 -0
- package/theme/styles/themes/library/color/fuchsia.css +31 -0
- package/theme/styles/themes/library/color/green.css +23 -10
- package/theme/styles/themes/library/color/index.css +15 -2
- package/theme/styles/themes/library/color/indigo.css +31 -0
- package/theme/styles/themes/library/color/lime.css +31 -0
- package/theme/styles/themes/library/color/orange.css +31 -0
- package/theme/styles/themes/library/color/pink.css +31 -0
- package/theme/styles/themes/library/color/purple.css +23 -10
- package/theme/styles/themes/library/color/red.css +23 -10
- package/theme/styles/themes/library/color/rose.css +31 -0
- package/theme/styles/themes/library/color/sky.css +31 -0
- package/theme/styles/themes/library/color/teal.css +31 -0
- package/theme/styles/themes/library/color/violet.css +31 -0
- package/theme/styles/themes/library/color/yellow.css +31 -0
- package/theme/styles/themes/library/style/brutal.css +4 -2
- package/theme/styles/themes/library/style/default.css +4 -2
- package/theme/styles/themes/library/style/sharp.css +4 -2
- package/theme/styles/themes/library/style/soft.css +4 -2
- package/theme/styles/themes/tailwind.css +3 -1
- package/types/ojiepermana-angular-brand-etos.d.ts +3 -3
- package/types/ojiepermana-angular-component.d.ts +215 -6
- package/types/ojiepermana-angular-layout.d.ts +16 -1
- package/types/ojiepermana-angular-navigation.d.ts +1 -1
- package/types/ojiepermana-angular-theme.d.ts +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
import { twMerge } from 'tailwind-merge';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Directive, input, model, computed, forwardRef, ChangeDetectionStrategy, Component, inject, signal, output, viewChild, ElementRef, DestroyRef, ViewContainerRef, effect, untracked, ContentChildren, TemplateRef, Injectable } from '@angular/core';
|
|
4
|
+
import { Directive, input, model, computed, forwardRef, ChangeDetectionStrategy, Component, inject, signal, output, viewChild, ElementRef, DestroyRef, ViewContainerRef, effect, untracked, ContentChildren, TemplateRef, Injectable, InjectionToken } from '@angular/core';
|
|
5
5
|
import { cva } from 'class-variance-authority';
|
|
6
6
|
import { MatCalendar, MatDatepicker, MatDatepickerInput, MatDatepickerToggle } from '@angular/material/datepicker';
|
|
7
7
|
import * as i1 from '@angular/forms';
|
|
@@ -23,6 +23,7 @@ import { MatSlideToggle } from '@angular/material/slide-toggle';
|
|
|
23
23
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
24
24
|
import * as i1$1 from '@angular/material/tooltip';
|
|
25
25
|
import { MatTooltip } from '@angular/material/tooltip';
|
|
26
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
29
|
* Concatenate and dedupe Tailwind class names.
|
|
@@ -2342,6 +2343,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
2342
2343
|
}]
|
|
2343
2344
|
}] });
|
|
2344
2345
|
|
|
2346
|
+
const POPOVER_TRIGGER_DEFAULTS = new InjectionToken('POPOVER_TRIGGER_DEFAULTS');
|
|
2345
2347
|
const POSITION_ANCHORS = {
|
|
2346
2348
|
top: (a) => ({
|
|
2347
2349
|
originX: a === 'start' ? 'start' : a === 'end' ? 'end' : 'center',
|
|
@@ -2395,10 +2397,11 @@ class PopoverTriggerDirective {
|
|
|
2395
2397
|
vcr = inject(ViewContainerRef);
|
|
2396
2398
|
el = inject(ElementRef);
|
|
2397
2399
|
destroyRef = inject(DestroyRef);
|
|
2400
|
+
defaults = inject(POPOVER_TRIGGER_DEFAULTS, { optional: true });
|
|
2398
2401
|
uiPopoverTrigger = input.required(...(ngDevMode ? [{ debugName: "uiPopoverTrigger" }] : /* istanbul ignore next */ []));
|
|
2399
|
-
side = input(
|
|
2400
|
-
align = input(
|
|
2401
|
-
sideOffset = input(
|
|
2402
|
+
side = input(undefined, ...(ngDevMode ? [{ debugName: "side" }] : /* istanbul ignore next */ []));
|
|
2403
|
+
align = input(undefined, ...(ngDevMode ? [{ debugName: "align" }] : /* istanbul ignore next */ []));
|
|
2404
|
+
sideOffset = input(undefined, ...(ngDevMode ? [{ debugName: "sideOffset" }] : /* istanbul ignore next */ []));
|
|
2402
2405
|
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
2403
2406
|
openedChange = output();
|
|
2404
2407
|
overlayRef = null;
|
|
@@ -2408,11 +2411,21 @@ class PopoverTriggerDirective {
|
|
|
2408
2411
|
return;
|
|
2409
2412
|
this.isOpen() ? this.close() : this.open();
|
|
2410
2413
|
}
|
|
2414
|
+
onKeyboardToggle(event) {
|
|
2415
|
+
if (this.disabled() || this.usesNativeKeyboardActivation()) {
|
|
2416
|
+
return;
|
|
2417
|
+
}
|
|
2418
|
+
event.preventDefault();
|
|
2419
|
+
this.toggle();
|
|
2420
|
+
}
|
|
2411
2421
|
open() {
|
|
2412
2422
|
if (this.isOpen() || this.disabled())
|
|
2413
2423
|
return;
|
|
2414
|
-
const
|
|
2415
|
-
const
|
|
2424
|
+
const side = this.side() ?? this.defaults?.side?.() ?? 'bottom';
|
|
2425
|
+
const align = this.align() ?? this.defaults?.align?.() ?? 'center';
|
|
2426
|
+
const sideOffset = this.sideOffset() ?? this.defaults?.sideOffset?.() ?? 8;
|
|
2427
|
+
const primary = positionFor(side, align, sideOffset);
|
|
2428
|
+
const fallback = positionFor(this.oppositeSide(side), align, sideOffset);
|
|
2416
2429
|
const positionStrategy = this.overlay
|
|
2417
2430
|
.position()
|
|
2418
2431
|
.flexibleConnectedTo(this.el)
|
|
@@ -2444,8 +2457,18 @@ class PopoverTriggerDirective {
|
|
|
2444
2457
|
oppositeSide(side) {
|
|
2445
2458
|
return side === 'top' ? 'bottom' : side === 'bottom' ? 'top' : side === 'left' ? 'right' : 'left';
|
|
2446
2459
|
}
|
|
2460
|
+
usesNativeKeyboardActivation() {
|
|
2461
|
+
const host = this.el.nativeElement;
|
|
2462
|
+
const tagName = host.tagName;
|
|
2463
|
+
return (tagName === 'BUTTON' ||
|
|
2464
|
+
tagName === 'INPUT' ||
|
|
2465
|
+
tagName === 'SELECT' ||
|
|
2466
|
+
tagName === 'TEXTAREA' ||
|
|
2467
|
+
tagName === 'SUMMARY' ||
|
|
2468
|
+
(tagName === 'A' && host.hasAttribute('href')));
|
|
2469
|
+
}
|
|
2447
2470
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: PopoverTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2448
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.13", type: PopoverTriggerDirective, isStandalone: true, selector: "[uiPopoverTrigger]", inputs: { uiPopoverTrigger: { classPropertyName: "uiPopoverTrigger", publicName: "uiPopoverTrigger", isSignal: true, isRequired: true, transformFunction: null }, side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, sideOffset: { classPropertyName: "sideOffset", publicName: "sideOffset", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { openedChange: "openedChange" }, host: { listeners: { "click": "toggle()", "keydown.escape": "close()" }, properties: { "attr.aria-expanded": "isOpen()", "attr.aria-haspopup": "\"dialog\"" } }, exportAs: ["uiPopoverTrigger"], ngImport: i0 });
|
|
2471
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.13", type: PopoverTriggerDirective, isStandalone: true, selector: "[uiPopoverTrigger]", inputs: { uiPopoverTrigger: { classPropertyName: "uiPopoverTrigger", publicName: "uiPopoverTrigger", isSignal: true, isRequired: true, transformFunction: null }, side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, sideOffset: { classPropertyName: "sideOffset", publicName: "sideOffset", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { openedChange: "openedChange" }, host: { listeners: { "click": "toggle()", "keydown.enter": "onKeyboardToggle($event)", "keydown.space": "onKeyboardToggle($event)", "keydown.escape": "close()" }, properties: { "attr.aria-expanded": "isOpen()", "attr.aria-haspopup": "\"dialog\"" } }, exportAs: ["uiPopoverTrigger"], ngImport: i0 });
|
|
2449
2472
|
}
|
|
2450
2473
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: PopoverTriggerDirective, decorators: [{
|
|
2451
2474
|
type: Directive,
|
|
@@ -2456,6 +2479,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
2456
2479
|
'[attr.aria-expanded]': 'isOpen()',
|
|
2457
2480
|
'[attr.aria-haspopup]': '"dialog"',
|
|
2458
2481
|
'(click)': 'toggle()',
|
|
2482
|
+
'(keydown.enter)': 'onKeyboardToggle($event)',
|
|
2483
|
+
'(keydown.space)': 'onKeyboardToggle($event)',
|
|
2459
2484
|
'(keydown.escape)': 'close()',
|
|
2460
2485
|
},
|
|
2461
2486
|
}]
|
|
@@ -3462,6 +3487,575 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
3462
3487
|
}]
|
|
3463
3488
|
}], ctorParameters: () => [], propDecorators: { uiTooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "uiTooltip", required: false }] }] } });
|
|
3464
3489
|
|
|
3490
|
+
const THEME_PANEL_THEME_PORT = new InjectionToken('THEME_PANEL_THEME_PORT');
|
|
3491
|
+
const THEME_PANEL_LAYOUT_PORT = new InjectionToken('THEME_PANEL_LAYOUT_PORT');
|
|
3492
|
+
const THEME_COLOR_OPTIONS = [
|
|
3493
|
+
{ value: 'base', label: 'Base', swatchClass: 'bg-zinc-800' },
|
|
3494
|
+
{ value: 'red', label: 'Red', swatchClass: 'bg-red-500' },
|
|
3495
|
+
{ value: 'orange', label: 'Orange', swatchClass: 'bg-orange-500' },
|
|
3496
|
+
{ value: 'amber', label: 'Amber', swatchClass: 'bg-amber-400' },
|
|
3497
|
+
{ value: 'yellow', label: 'Yellow', swatchClass: 'bg-yellow-400' },
|
|
3498
|
+
{ value: 'lime', label: 'Lime', swatchClass: 'bg-lime-400' },
|
|
3499
|
+
{ value: 'green', label: 'Green', swatchClass: 'bg-green-600' },
|
|
3500
|
+
{ value: 'emerald', label: 'Emerald', swatchClass: 'bg-emerald-600' },
|
|
3501
|
+
{ value: 'teal', label: 'Teal', swatchClass: 'bg-teal-600' },
|
|
3502
|
+
{ value: 'cyan', label: 'Cyan', swatchClass: 'bg-cyan-600' },
|
|
3503
|
+
{ value: 'sky', label: 'Sky', swatchClass: 'bg-sky-600' },
|
|
3504
|
+
{ value: 'blue', label: 'Blue', swatchClass: 'bg-blue-500' },
|
|
3505
|
+
{ value: 'indigo', label: 'Indigo', swatchClass: 'bg-indigo-500' },
|
|
3506
|
+
{ value: 'violet', label: 'Violet', swatchClass: 'bg-violet-500' },
|
|
3507
|
+
{ value: 'purple', label: 'Purple', swatchClass: 'bg-purple-500' },
|
|
3508
|
+
{ value: 'fuchsia', label: 'Fuchsia', swatchClass: 'bg-fuchsia-600' },
|
|
3509
|
+
{ value: 'pink', label: 'Pink', swatchClass: 'bg-pink-600' },
|
|
3510
|
+
{ value: 'rose', label: 'Rose', swatchClass: 'bg-rose-500' },
|
|
3511
|
+
];
|
|
3512
|
+
const THEME_MODE_OPTIONS = [
|
|
3513
|
+
{ value: 'light', label: 'Light', icon: 'sun' },
|
|
3514
|
+
{ value: 'dark', label: 'Dark', icon: 'moon' },
|
|
3515
|
+
{ value: 'system', label: 'System', icon: 'system' },
|
|
3516
|
+
];
|
|
3517
|
+
const THEME_STYLE_OPTIONS = [
|
|
3518
|
+
{ value: 'default', label: 'Default', icon: 'default-style' },
|
|
3519
|
+
{ value: 'sharp', label: 'Sharp', icon: 'sharp-style' },
|
|
3520
|
+
{ value: 'brutal', label: 'Brutal', icon: 'brutal-style' },
|
|
3521
|
+
{ value: 'soft', label: 'Soft', icon: 'soft-style' },
|
|
3522
|
+
];
|
|
3523
|
+
const LAYOUT_MODE_OPTIONS = [
|
|
3524
|
+
{ value: 'vertical', label: 'Vertical', icon: 'vertical-layout' },
|
|
3525
|
+
{ value: 'horizontal', label: 'Horizontal', icon: 'horizontal-layout' },
|
|
3526
|
+
{ value: 'empty', label: 'Empty', icon: 'empty-layout' },
|
|
3527
|
+
];
|
|
3528
|
+
const LAYOUT_WIDTH_OPTIONS = [
|
|
3529
|
+
{ value: 'full', label: 'Full', icon: 'full-width' },
|
|
3530
|
+
{ value: 'container', label: 'Container', icon: 'container-width' },
|
|
3531
|
+
{ value: 'wide', label: 'Wide', icon: 'wide-width' },
|
|
3532
|
+
];
|
|
3533
|
+
class ThemePanelComponent {
|
|
3534
|
+
sanitizer = inject(DomSanitizer);
|
|
3535
|
+
themePort = inject(THEME_PANEL_THEME_PORT, { optional: true });
|
|
3536
|
+
layoutPort = inject(THEME_PANEL_LAYOUT_PORT, { optional: true });
|
|
3537
|
+
connected = input(true, ...(ngDevMode ? [{ debugName: "connected" }] : /* istanbul ignore next */ []));
|
|
3538
|
+
class = input('', ...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
3539
|
+
title = input('Theme panel', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
3540
|
+
description = input('', ...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
|
|
3541
|
+
userName = input('', ...(ngDevMode ? [{ debugName: "userName" }] : /* istanbul ignore next */ []));
|
|
3542
|
+
userSubtitle = input('', ...(ngDevMode ? [{ debugName: "userSubtitle" }] : /* istanbul ignore next */ []));
|
|
3543
|
+
userInitials = input('', ...(ngDevMode ? [{ debugName: "userInitials" }] : /* istanbul ignore next */ []));
|
|
3544
|
+
themeColor = input('base', ...(ngDevMode ? [{ debugName: "themeColor" }] : /* istanbul ignore next */ []));
|
|
3545
|
+
themeMode = input('light', ...(ngDevMode ? [{ debugName: "themeMode" }] : /* istanbul ignore next */ []));
|
|
3546
|
+
themeStyle = input('default', ...(ngDevMode ? [{ debugName: "themeStyle" }] : /* istanbul ignore next */ []));
|
|
3547
|
+
layoutMode = input('vertical', ...(ngDevMode ? [{ debugName: "layoutMode" }] : /* istanbul ignore next */ []));
|
|
3548
|
+
layoutWidth = input('container', ...(ngDevMode ? [{ debugName: "layoutWidth" }] : /* istanbul ignore next */ []));
|
|
3549
|
+
themeColorChange = output();
|
|
3550
|
+
themeModeChange = output();
|
|
3551
|
+
themeStyleChange = output();
|
|
3552
|
+
layoutModeChange = output();
|
|
3553
|
+
layoutWidthChange = output();
|
|
3554
|
+
currentThemeColor = signal(this.themeColor(), ...(ngDevMode ? [{ debugName: "currentThemeColor" }] : /* istanbul ignore next */ []));
|
|
3555
|
+
currentThemeMode = signal(this.themeMode(), ...(ngDevMode ? [{ debugName: "currentThemeMode" }] : /* istanbul ignore next */ []));
|
|
3556
|
+
currentThemeStyle = signal(this.themeStyle(), ...(ngDevMode ? [{ debugName: "currentThemeStyle" }] : /* istanbul ignore next */ []));
|
|
3557
|
+
currentLayoutMode = signal(this.layoutMode(), ...(ngDevMode ? [{ debugName: "currentLayoutMode" }] : /* istanbul ignore next */ []));
|
|
3558
|
+
currentLayoutWidth = signal(this.layoutWidth(), ...(ngDevMode ? [{ debugName: "currentLayoutWidth" }] : /* istanbul ignore next */ []));
|
|
3559
|
+
themeColorOptions = THEME_COLOR_OPTIONS;
|
|
3560
|
+
themeModeOptions = THEME_MODE_OPTIONS;
|
|
3561
|
+
themeStyleOptions = THEME_STYLE_OPTIONS;
|
|
3562
|
+
layoutModeOptions = LAYOUT_MODE_OPTIONS;
|
|
3563
|
+
layoutWidthOptions = LAYOUT_WIDTH_OPTIONS;
|
|
3564
|
+
hostClasses = computed(() => cn('block overflow-hidden rounded-lg border border-border/70 bg-card text-card-foreground shadow-sm', this.class()), ...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
3565
|
+
hasUserHeader = computed(() => !!this.userName().trim() || !!this.userSubtitle().trim(), ...(ngDevMode ? [{ debugName: "hasUserHeader" }] : /* istanbul ignore next */ []));
|
|
3566
|
+
resolvedUserInitials = computed(() => this.userInitials().trim() || this.toInitials(this.userName() || this.title()), ...(ngDevMode ? [{ debugName: "resolvedUserInitials" }] : /* istanbul ignore next */ []));
|
|
3567
|
+
currentThemeColorLabel = computed(() => this.themeColorOptions.find((option) => option.value === this.currentThemeColor())?.label ?? '', ...(ngDevMode ? [{ debugName: "currentThemeColorLabel" }] : /* istanbul ignore next */ []));
|
|
3568
|
+
constructor() {
|
|
3569
|
+
effect(() => {
|
|
3570
|
+
this.currentThemeColor.set(this.connected() && this.themePort ? this.themePort.color() : this.themeColor());
|
|
3571
|
+
});
|
|
3572
|
+
effect(() => {
|
|
3573
|
+
this.currentThemeMode.set(this.connected() && this.themePort ? this.themePort.scheme() : this.themeMode());
|
|
3574
|
+
});
|
|
3575
|
+
effect(() => {
|
|
3576
|
+
this.currentThemeStyle.set(this.connected() && this.themePort ? this.themePort.style() : this.themeStyle());
|
|
3577
|
+
});
|
|
3578
|
+
effect(() => {
|
|
3579
|
+
this.currentLayoutMode.set(this.connected() && this.layoutPort ? this.layoutPort.mode() : this.layoutMode());
|
|
3580
|
+
});
|
|
3581
|
+
effect(() => {
|
|
3582
|
+
this.currentLayoutWidth.set(this.connected() && this.layoutPort ? this.layoutPort.width() : this.layoutWidth());
|
|
3583
|
+
});
|
|
3584
|
+
}
|
|
3585
|
+
setThemeColor(color) {
|
|
3586
|
+
this.currentThemeColor.set(color);
|
|
3587
|
+
this.themePort?.setColor(color);
|
|
3588
|
+
this.themeColorChange.emit(color);
|
|
3589
|
+
}
|
|
3590
|
+
setThemeMode(mode) {
|
|
3591
|
+
this.currentThemeMode.set(mode);
|
|
3592
|
+
this.themePort?.setScheme(mode);
|
|
3593
|
+
this.themeModeChange.emit(mode);
|
|
3594
|
+
}
|
|
3595
|
+
setThemeStyle(style) {
|
|
3596
|
+
this.currentThemeStyle.set(style);
|
|
3597
|
+
this.themePort?.setStyle(style);
|
|
3598
|
+
this.themeStyleChange.emit(style);
|
|
3599
|
+
}
|
|
3600
|
+
setLayoutMode(mode) {
|
|
3601
|
+
this.currentLayoutMode.set(mode);
|
|
3602
|
+
this.layoutPort?.setMode(mode);
|
|
3603
|
+
this.layoutModeChange.emit(mode);
|
|
3604
|
+
}
|
|
3605
|
+
setLayoutWidth(width) {
|
|
3606
|
+
this.currentLayoutWidth.set(width);
|
|
3607
|
+
this.layoutPort?.setWidth(width);
|
|
3608
|
+
this.layoutWidthChange.emit(width);
|
|
3609
|
+
}
|
|
3610
|
+
sectionEyebrowClasses() {
|
|
3611
|
+
return 'text-[0.72rem] font-semibold uppercase tracking-[0.22em] text-muted-foreground';
|
|
3612
|
+
}
|
|
3613
|
+
segmentedOptionClasses(active) {
|
|
3614
|
+
return cn('rounded-[calc(var(--layout-frame-radius)-2px)] px-3', active
|
|
3615
|
+
? 'border border-border/70 bg-background shadow-sm hover:bg-background'
|
|
3616
|
+
: 'text-muted-foreground hover:bg-background/70 hover:text-foreground');
|
|
3617
|
+
}
|
|
3618
|
+
swatchButtonClasses(active) {
|
|
3619
|
+
return cn('size-9 rounded-full p-0', active
|
|
3620
|
+
? 'border border-border/70 bg-background shadow-sm hover:bg-background'
|
|
3621
|
+
: 'border border-transparent hover:bg-background/70');
|
|
3622
|
+
}
|
|
3623
|
+
optionIconClasses(active) {
|
|
3624
|
+
return cn('inline-flex size-4 shrink-0 items-center justify-center [&_svg]:size-4', active ? 'text-foreground' : 'text-muted-foreground');
|
|
3625
|
+
}
|
|
3626
|
+
colorSwatchClasses(swatchClass, isActive) {
|
|
3627
|
+
return cn('size-4 rounded-full border border-black/10 shadow-sm', swatchClass, isActive ? 'ring-2 ring-ring ring-offset-2 ring-offset-background' : '');
|
|
3628
|
+
}
|
|
3629
|
+
iconSvg(name) {
|
|
3630
|
+
return this.sanitizer.bypassSecurityTrustHtml(this.rawIconSvg(name));
|
|
3631
|
+
}
|
|
3632
|
+
rawIconSvg(name) {
|
|
3633
|
+
switch (name) {
|
|
3634
|
+
case 'sun':
|
|
3635
|
+
return '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="4"></circle><path d="M12 2.5v2.2"></path><path d="M12 19.3v2.2"></path><path d="M4.93 4.93 6.5 6.5"></path><path d="M17.5 17.5 19.07 19.07"></path><path d="M2.5 12h2.2"></path><path d="M19.3 12h2.2"></path><path d="M4.93 19.07 6.5 17.5"></path><path d="M17.5 6.5 19.07 4.93"></path></svg>';
|
|
3636
|
+
case 'moon':
|
|
3637
|
+
return '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M20.4 14.8A8.8 8.8 0 1 1 9.2 3.6a7.2 7.2 0 0 0 11.2 11.2Z"></path></svg>';
|
|
3638
|
+
case 'system':
|
|
3639
|
+
return '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="3.5" y="4.5" width="17" height="11.5" rx="1.8"></rect><path d="M9 19.5h6"></path><path d="M12 16v3.5"></path></svg>';
|
|
3640
|
+
case 'default-style':
|
|
3641
|
+
return '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="5" y="5" width="14" height="14" rx="4"></rect></svg>';
|
|
3642
|
+
case 'sharp-style':
|
|
3643
|
+
return '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="5" y="5" width="14" height="14" rx="1"></rect></svg>';
|
|
3644
|
+
case 'brutal-style':
|
|
3645
|
+
return '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M5 7.5h14"></path><path d="M5 12h14"></path><path d="M5 16.5h14"></path></svg>';
|
|
3646
|
+
case 'soft-style':
|
|
3647
|
+
return '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M7.5 9A4.5 4.5 0 0 1 12 4.5h1A4.5 4.5 0 0 1 17.5 9v1A4.5 4.5 0 0 1 13 14.5h-1A4.5 4.5 0 0 1 7.5 10Z"></path><path d="M6.5 15.5c1.3 2 3.2 3 5.5 3s4.2-1 5.5-3"></path></svg>';
|
|
3648
|
+
case 'vertical-layout':
|
|
3649
|
+
return '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="5" width="16" height="14" rx="2"></rect><path d="M9 5v14"></path></svg>';
|
|
3650
|
+
case 'horizontal-layout':
|
|
3651
|
+
return '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="5" width="16" height="14" rx="2"></rect><path d="M4 10h16"></path></svg>';
|
|
3652
|
+
case 'empty-layout':
|
|
3653
|
+
return '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="4.5" y="5.5" width="15" height="13" rx="2"></rect></svg>';
|
|
3654
|
+
case 'full-width':
|
|
3655
|
+
return '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="M4 8V5h3"></path><path d="M20 8V5h-3"></path><path d="M4 16v3h3"></path><path d="M20 16v3h-3"></path><path d="M8 5H4"></path><path d="M20 5h-4"></path><path d="M8 19H4"></path><path d="M20 19h-4"></path></svg>';
|
|
3656
|
+
case 'container-width':
|
|
3657
|
+
return '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="6" width="16" height="12" rx="2"></rect><path d="M9 9.5h6"></path><path d="M9 14.5h6"></path></svg>';
|
|
3658
|
+
case 'wide-width':
|
|
3659
|
+
return '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="6" width="18" height="12" rx="2"></rect><path d="M7 9.5h10"></path><path d="M7 14.5h10"></path></svg>';
|
|
3660
|
+
}
|
|
3661
|
+
}
|
|
3662
|
+
toInitials(value) {
|
|
3663
|
+
const words = value
|
|
3664
|
+
.split(/\s+/)
|
|
3665
|
+
.map((item) => item.trim())
|
|
3666
|
+
.filter(Boolean)
|
|
3667
|
+
.slice(0, 2);
|
|
3668
|
+
if (!words.length) {
|
|
3669
|
+
return 'UI';
|
|
3670
|
+
}
|
|
3671
|
+
return words.map((word) => word[0]?.toUpperCase() ?? '').join('');
|
|
3672
|
+
}
|
|
3673
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ThemePanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3674
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.13", type: ThemePanelComponent, isStandalone: true, selector: "ui-theme-panel", inputs: { connected: { classPropertyName: "connected", publicName: "connected", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, userName: { classPropertyName: "userName", publicName: "userName", isSignal: true, isRequired: false, transformFunction: null }, userSubtitle: { classPropertyName: "userSubtitle", publicName: "userSubtitle", isSignal: true, isRequired: false, transformFunction: null }, userInitials: { classPropertyName: "userInitials", publicName: "userInitials", isSignal: true, isRequired: false, transformFunction: null }, themeColor: { classPropertyName: "themeColor", publicName: "themeColor", isSignal: true, isRequired: false, transformFunction: null }, themeMode: { classPropertyName: "themeMode", publicName: "themeMode", isSignal: true, isRequired: false, transformFunction: null }, themeStyle: { classPropertyName: "themeStyle", publicName: "themeStyle", isSignal: true, isRequired: false, transformFunction: null }, layoutMode: { classPropertyName: "layoutMode", publicName: "layoutMode", isSignal: true, isRequired: false, transformFunction: null }, layoutWidth: { classPropertyName: "layoutWidth", publicName: "layoutWidth", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { themeColorChange: "themeColorChange", themeModeChange: "themeModeChange", themeStyleChange: "themeStyleChange", layoutModeChange: "layoutModeChange", layoutWidthChange: "layoutWidthChange" }, host: { properties: { "class": "hostClasses()" } }, ngImport: i0, template: `
|
|
3675
|
+
<div class="flex flex-col gap-4 p-4">
|
|
3676
|
+
@if (hasUserHeader()) {
|
|
3677
|
+
<header class="flex items-center gap-3 px-1 pt-1">
|
|
3678
|
+
<span class="flex size-14 items-center justify-center rounded-full bg-primary/10 text-primary">
|
|
3679
|
+
<span
|
|
3680
|
+
class="flex size-11 items-center justify-center rounded-full bg-primary text-xs font-semibold tracking-[0.22em] text-primary-foreground">
|
|
3681
|
+
{{ resolvedUserInitials() }}
|
|
3682
|
+
</span>
|
|
3683
|
+
</span>
|
|
3684
|
+
|
|
3685
|
+
<div class="min-w-0 flex-1">
|
|
3686
|
+
<h2 class="truncate text-[1.05rem] font-semibold leading-none tracking-tight text-foreground">
|
|
3687
|
+
{{ userName() }}
|
|
3688
|
+
</h2>
|
|
3689
|
+
@if (userSubtitle(); as subtitle) {
|
|
3690
|
+
<p class="mt-1 text-sm leading-none text-muted-foreground">{{ subtitle }}</p>
|
|
3691
|
+
}
|
|
3692
|
+
</div>
|
|
3693
|
+
</header>
|
|
3694
|
+
} @else {
|
|
3695
|
+
<header class="space-y-1 px-1 pt-1">
|
|
3696
|
+
<h2 class="text-base font-semibold tracking-tight text-foreground">{{ title() }}</h2>
|
|
3697
|
+
@if (description(); as text) {
|
|
3698
|
+
<p class="text-sm leading-6 text-muted-foreground">{{ text }}</p>
|
|
3699
|
+
}
|
|
3700
|
+
</header>
|
|
3701
|
+
}
|
|
3702
|
+
|
|
3703
|
+
<div class="grid gap-4">
|
|
3704
|
+
<section data-setting="theme-mode" [attr.data-current]="currentThemeMode()" class="space-y-2">
|
|
3705
|
+
<div class="px-1">
|
|
3706
|
+
<p [class]="sectionEyebrowClasses()">Mode</p>
|
|
3707
|
+
</div>
|
|
3708
|
+
|
|
3709
|
+
<div class="rounded-(--layout-frame-radius) bg-muted/65 p-0.5">
|
|
3710
|
+
<div class="grid grid-cols-3 gap-1" role="group" aria-label="Theme mode">
|
|
3711
|
+
@for (option of themeModeOptions; track option.value) {
|
|
3712
|
+
<button
|
|
3713
|
+
type="button"
|
|
3714
|
+
ui-button
|
|
3715
|
+
size="sm"
|
|
3716
|
+
variant="ghost"
|
|
3717
|
+
data-setting-option="theme-mode"
|
|
3718
|
+
[attr.data-value]="option.value"
|
|
3719
|
+
[attr.aria-pressed]="currentThemeMode() === option.value"
|
|
3720
|
+
[class]="segmentedOptionClasses(currentThemeMode() === option.value)"
|
|
3721
|
+
(click)="setThemeMode(option.value)">
|
|
3722
|
+
<span class="inline-flex items-center gap-2.5">
|
|
3723
|
+
<span
|
|
3724
|
+
aria-hidden="true"
|
|
3725
|
+
[class]="optionIconClasses(currentThemeMode() === option.value)"
|
|
3726
|
+
[innerHTML]="iconSvg(option.icon!)"></span>
|
|
3727
|
+
<span class="text-sm font-semibold leading-none">{{ option.label }}</span>
|
|
3728
|
+
</span>
|
|
3729
|
+
</button>
|
|
3730
|
+
}
|
|
3731
|
+
</div>
|
|
3732
|
+
</div>
|
|
3733
|
+
</section>
|
|
3734
|
+
|
|
3735
|
+
<section data-setting="theme-color" [attr.data-current]="currentThemeColor()" class="space-y-2">
|
|
3736
|
+
<div class="flex items-center justify-between gap-3 px-1">
|
|
3737
|
+
<p [class]="sectionEyebrowClasses()">Color</p>
|
|
3738
|
+
<p class="text-xs font-semibold text-muted-foreground">{{ currentThemeColorLabel() }}</p>
|
|
3739
|
+
</div>
|
|
3740
|
+
|
|
3741
|
+
<div class="rounded-(--layout-frame-radius) bg-muted/65 p-1">
|
|
3742
|
+
<div class="grid grid-cols-6 justify-items-center gap-1" role="group" aria-label="Theme color">
|
|
3743
|
+
@for (option of themeColorOptions; track option.value) {
|
|
3744
|
+
<button
|
|
3745
|
+
type="button"
|
|
3746
|
+
ui-button
|
|
3747
|
+
size="icon"
|
|
3748
|
+
variant="ghost"
|
|
3749
|
+
data-setting-option="theme-color"
|
|
3750
|
+
[attr.data-value]="option.value"
|
|
3751
|
+
[attr.aria-label]="'Theme color ' + option.label"
|
|
3752
|
+
[attr.aria-pressed]="currentThemeColor() === option.value"
|
|
3753
|
+
[class]="swatchButtonClasses(currentThemeColor() === option.value)"
|
|
3754
|
+
(click)="setThemeColor(option.value)">
|
|
3755
|
+
<span
|
|
3756
|
+
aria-hidden="true"
|
|
3757
|
+
[class]="colorSwatchClasses(option.swatchClass, currentThemeColor() === option.value)"></span>
|
|
3758
|
+
<span class="sr-only">{{ option.label }}</span>
|
|
3759
|
+
</button>
|
|
3760
|
+
}
|
|
3761
|
+
</div>
|
|
3762
|
+
</div>
|
|
3763
|
+
</section>
|
|
3764
|
+
|
|
3765
|
+
<section data-setting="theme-style" [attr.data-current]="currentThemeStyle()" class="space-y-2">
|
|
3766
|
+
<div class="px-1">
|
|
3767
|
+
<p [class]="sectionEyebrowClasses()">Style</p>
|
|
3768
|
+
</div>
|
|
3769
|
+
|
|
3770
|
+
<div class="rounded-(--layout-frame-radius) bg-muted/65 p-0.5">
|
|
3771
|
+
<div class="grid grid-cols-2 gap-1 sm:grid-cols-4" role="group" aria-label="Theme style">
|
|
3772
|
+
@for (option of themeStyleOptions; track option.value) {
|
|
3773
|
+
<button
|
|
3774
|
+
type="button"
|
|
3775
|
+
ui-button
|
|
3776
|
+
size="sm"
|
|
3777
|
+
variant="ghost"
|
|
3778
|
+
data-setting-option="theme-style"
|
|
3779
|
+
[attr.data-value]="option.value"
|
|
3780
|
+
[attr.aria-pressed]="currentThemeStyle() === option.value"
|
|
3781
|
+
[class]="segmentedOptionClasses(currentThemeStyle() === option.value)"
|
|
3782
|
+
(click)="setThemeStyle(option.value)">
|
|
3783
|
+
<span class="inline-flex items-center gap-2.5">
|
|
3784
|
+
<span
|
|
3785
|
+
aria-hidden="true"
|
|
3786
|
+
[class]="optionIconClasses(currentThemeStyle() === option.value)"
|
|
3787
|
+
[innerHTML]="iconSvg(option.icon!)"></span>
|
|
3788
|
+
<span class="text-sm font-semibold leading-none">{{ option.label }}</span>
|
|
3789
|
+
</span>
|
|
3790
|
+
</button>
|
|
3791
|
+
}
|
|
3792
|
+
</div>
|
|
3793
|
+
</div>
|
|
3794
|
+
</section>
|
|
3795
|
+
|
|
3796
|
+
<section data-setting="layout-mode" [attr.data-current]="currentLayoutMode()" class="space-y-2">
|
|
3797
|
+
<div class="px-1">
|
|
3798
|
+
<p [class]="sectionEyebrowClasses()">Layout</p>
|
|
3799
|
+
</div>
|
|
3800
|
+
|
|
3801
|
+
<div class="rounded-(--layout-frame-radius) bg-muted/65 p-0.5">
|
|
3802
|
+
<div class="grid grid-cols-3 gap-1" role="group" aria-label="Layout mode">
|
|
3803
|
+
@for (option of layoutModeOptions; track option.value) {
|
|
3804
|
+
<button
|
|
3805
|
+
type="button"
|
|
3806
|
+
ui-button
|
|
3807
|
+
size="sm"
|
|
3808
|
+
variant="ghost"
|
|
3809
|
+
data-setting-option="layout-mode"
|
|
3810
|
+
[attr.data-value]="option.value"
|
|
3811
|
+
[attr.aria-pressed]="currentLayoutMode() === option.value"
|
|
3812
|
+
[class]="segmentedOptionClasses(currentLayoutMode() === option.value)"
|
|
3813
|
+
(click)="setLayoutMode(option.value)">
|
|
3814
|
+
<span class="inline-flex items-center gap-2.5">
|
|
3815
|
+
<span
|
|
3816
|
+
aria-hidden="true"
|
|
3817
|
+
[class]="optionIconClasses(currentLayoutMode() === option.value)"
|
|
3818
|
+
[innerHTML]="iconSvg(option.icon!)"></span>
|
|
3819
|
+
<span class="text-sm font-semibold leading-none">{{ option.label }}</span>
|
|
3820
|
+
</span>
|
|
3821
|
+
</button>
|
|
3822
|
+
}
|
|
3823
|
+
</div>
|
|
3824
|
+
</div>
|
|
3825
|
+
</section>
|
|
3826
|
+
|
|
3827
|
+
<section data-setting="layout-width" [attr.data-current]="currentLayoutWidth()" class="space-y-2">
|
|
3828
|
+
<div class="px-1">
|
|
3829
|
+
<p [class]="sectionEyebrowClasses()">Width</p>
|
|
3830
|
+
</div>
|
|
3831
|
+
|
|
3832
|
+
<div class="rounded-(--layout-frame-radius) bg-muted/65 p-0.5">
|
|
3833
|
+
<div class="grid grid-cols-3 gap-1" role="group" aria-label="Layout width">
|
|
3834
|
+
@for (option of layoutWidthOptions; track option.value) {
|
|
3835
|
+
<button
|
|
3836
|
+
type="button"
|
|
3837
|
+
ui-button
|
|
3838
|
+
size="sm"
|
|
3839
|
+
variant="ghost"
|
|
3840
|
+
data-setting-option="layout-width"
|
|
3841
|
+
[attr.data-value]="option.value"
|
|
3842
|
+
[attr.aria-pressed]="currentLayoutWidth() === option.value"
|
|
3843
|
+
[class]="segmentedOptionClasses(currentLayoutWidth() === option.value)"
|
|
3844
|
+
(click)="setLayoutWidth(option.value)">
|
|
3845
|
+
<span class="inline-flex items-center gap-2.5">
|
|
3846
|
+
<span
|
|
3847
|
+
aria-hidden="true"
|
|
3848
|
+
[class]="optionIconClasses(currentLayoutWidth() === option.value)"
|
|
3849
|
+
[innerHTML]="iconSvg(option.icon!)"></span>
|
|
3850
|
+
<span class="text-sm font-semibold leading-none">{{ option.label }}</span>
|
|
3851
|
+
</span>
|
|
3852
|
+
</button>
|
|
3853
|
+
}
|
|
3854
|
+
</div>
|
|
3855
|
+
</div>
|
|
3856
|
+
</section>
|
|
3857
|
+
</div>
|
|
3858
|
+
</div>
|
|
3859
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ButtonComponent, selector: "button[ui-button], a[ui-button]", inputs: ["variant", "size", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3860
|
+
}
|
|
3861
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImport: i0, type: ThemePanelComponent, decorators: [{
|
|
3862
|
+
type: Component,
|
|
3863
|
+
args: [{
|
|
3864
|
+
selector: 'ui-theme-panel',
|
|
3865
|
+
imports: [ButtonComponent],
|
|
3866
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3867
|
+
host: {
|
|
3868
|
+
'[class]': 'hostClasses()',
|
|
3869
|
+
},
|
|
3870
|
+
template: `
|
|
3871
|
+
<div class="flex flex-col gap-4 p-4">
|
|
3872
|
+
@if (hasUserHeader()) {
|
|
3873
|
+
<header class="flex items-center gap-3 px-1 pt-1">
|
|
3874
|
+
<span class="flex size-14 items-center justify-center rounded-full bg-primary/10 text-primary">
|
|
3875
|
+
<span
|
|
3876
|
+
class="flex size-11 items-center justify-center rounded-full bg-primary text-xs font-semibold tracking-[0.22em] text-primary-foreground">
|
|
3877
|
+
{{ resolvedUserInitials() }}
|
|
3878
|
+
</span>
|
|
3879
|
+
</span>
|
|
3880
|
+
|
|
3881
|
+
<div class="min-w-0 flex-1">
|
|
3882
|
+
<h2 class="truncate text-[1.05rem] font-semibold leading-none tracking-tight text-foreground">
|
|
3883
|
+
{{ userName() }}
|
|
3884
|
+
</h2>
|
|
3885
|
+
@if (userSubtitle(); as subtitle) {
|
|
3886
|
+
<p class="mt-1 text-sm leading-none text-muted-foreground">{{ subtitle }}</p>
|
|
3887
|
+
}
|
|
3888
|
+
</div>
|
|
3889
|
+
</header>
|
|
3890
|
+
} @else {
|
|
3891
|
+
<header class="space-y-1 px-1 pt-1">
|
|
3892
|
+
<h2 class="text-base font-semibold tracking-tight text-foreground">{{ title() }}</h2>
|
|
3893
|
+
@if (description(); as text) {
|
|
3894
|
+
<p class="text-sm leading-6 text-muted-foreground">{{ text }}</p>
|
|
3895
|
+
}
|
|
3896
|
+
</header>
|
|
3897
|
+
}
|
|
3898
|
+
|
|
3899
|
+
<div class="grid gap-4">
|
|
3900
|
+
<section data-setting="theme-mode" [attr.data-current]="currentThemeMode()" class="space-y-2">
|
|
3901
|
+
<div class="px-1">
|
|
3902
|
+
<p [class]="sectionEyebrowClasses()">Mode</p>
|
|
3903
|
+
</div>
|
|
3904
|
+
|
|
3905
|
+
<div class="rounded-(--layout-frame-radius) bg-muted/65 p-0.5">
|
|
3906
|
+
<div class="grid grid-cols-3 gap-1" role="group" aria-label="Theme mode">
|
|
3907
|
+
@for (option of themeModeOptions; track option.value) {
|
|
3908
|
+
<button
|
|
3909
|
+
type="button"
|
|
3910
|
+
ui-button
|
|
3911
|
+
size="sm"
|
|
3912
|
+
variant="ghost"
|
|
3913
|
+
data-setting-option="theme-mode"
|
|
3914
|
+
[attr.data-value]="option.value"
|
|
3915
|
+
[attr.aria-pressed]="currentThemeMode() === option.value"
|
|
3916
|
+
[class]="segmentedOptionClasses(currentThemeMode() === option.value)"
|
|
3917
|
+
(click)="setThemeMode(option.value)">
|
|
3918
|
+
<span class="inline-flex items-center gap-2.5">
|
|
3919
|
+
<span
|
|
3920
|
+
aria-hidden="true"
|
|
3921
|
+
[class]="optionIconClasses(currentThemeMode() === option.value)"
|
|
3922
|
+
[innerHTML]="iconSvg(option.icon!)"></span>
|
|
3923
|
+
<span class="text-sm font-semibold leading-none">{{ option.label }}</span>
|
|
3924
|
+
</span>
|
|
3925
|
+
</button>
|
|
3926
|
+
}
|
|
3927
|
+
</div>
|
|
3928
|
+
</div>
|
|
3929
|
+
</section>
|
|
3930
|
+
|
|
3931
|
+
<section data-setting="theme-color" [attr.data-current]="currentThemeColor()" class="space-y-2">
|
|
3932
|
+
<div class="flex items-center justify-between gap-3 px-1">
|
|
3933
|
+
<p [class]="sectionEyebrowClasses()">Color</p>
|
|
3934
|
+
<p class="text-xs font-semibold text-muted-foreground">{{ currentThemeColorLabel() }}</p>
|
|
3935
|
+
</div>
|
|
3936
|
+
|
|
3937
|
+
<div class="rounded-(--layout-frame-radius) bg-muted/65 p-1">
|
|
3938
|
+
<div class="grid grid-cols-6 justify-items-center gap-1" role="group" aria-label="Theme color">
|
|
3939
|
+
@for (option of themeColorOptions; track option.value) {
|
|
3940
|
+
<button
|
|
3941
|
+
type="button"
|
|
3942
|
+
ui-button
|
|
3943
|
+
size="icon"
|
|
3944
|
+
variant="ghost"
|
|
3945
|
+
data-setting-option="theme-color"
|
|
3946
|
+
[attr.data-value]="option.value"
|
|
3947
|
+
[attr.aria-label]="'Theme color ' + option.label"
|
|
3948
|
+
[attr.aria-pressed]="currentThemeColor() === option.value"
|
|
3949
|
+
[class]="swatchButtonClasses(currentThemeColor() === option.value)"
|
|
3950
|
+
(click)="setThemeColor(option.value)">
|
|
3951
|
+
<span
|
|
3952
|
+
aria-hidden="true"
|
|
3953
|
+
[class]="colorSwatchClasses(option.swatchClass, currentThemeColor() === option.value)"></span>
|
|
3954
|
+
<span class="sr-only">{{ option.label }}</span>
|
|
3955
|
+
</button>
|
|
3956
|
+
}
|
|
3957
|
+
</div>
|
|
3958
|
+
</div>
|
|
3959
|
+
</section>
|
|
3960
|
+
|
|
3961
|
+
<section data-setting="theme-style" [attr.data-current]="currentThemeStyle()" class="space-y-2">
|
|
3962
|
+
<div class="px-1">
|
|
3963
|
+
<p [class]="sectionEyebrowClasses()">Style</p>
|
|
3964
|
+
</div>
|
|
3965
|
+
|
|
3966
|
+
<div class="rounded-(--layout-frame-radius) bg-muted/65 p-0.5">
|
|
3967
|
+
<div class="grid grid-cols-2 gap-1 sm:grid-cols-4" role="group" aria-label="Theme style">
|
|
3968
|
+
@for (option of themeStyleOptions; track option.value) {
|
|
3969
|
+
<button
|
|
3970
|
+
type="button"
|
|
3971
|
+
ui-button
|
|
3972
|
+
size="sm"
|
|
3973
|
+
variant="ghost"
|
|
3974
|
+
data-setting-option="theme-style"
|
|
3975
|
+
[attr.data-value]="option.value"
|
|
3976
|
+
[attr.aria-pressed]="currentThemeStyle() === option.value"
|
|
3977
|
+
[class]="segmentedOptionClasses(currentThemeStyle() === option.value)"
|
|
3978
|
+
(click)="setThemeStyle(option.value)">
|
|
3979
|
+
<span class="inline-flex items-center gap-2.5">
|
|
3980
|
+
<span
|
|
3981
|
+
aria-hidden="true"
|
|
3982
|
+
[class]="optionIconClasses(currentThemeStyle() === option.value)"
|
|
3983
|
+
[innerHTML]="iconSvg(option.icon!)"></span>
|
|
3984
|
+
<span class="text-sm font-semibold leading-none">{{ option.label }}</span>
|
|
3985
|
+
</span>
|
|
3986
|
+
</button>
|
|
3987
|
+
}
|
|
3988
|
+
</div>
|
|
3989
|
+
</div>
|
|
3990
|
+
</section>
|
|
3991
|
+
|
|
3992
|
+
<section data-setting="layout-mode" [attr.data-current]="currentLayoutMode()" class="space-y-2">
|
|
3993
|
+
<div class="px-1">
|
|
3994
|
+
<p [class]="sectionEyebrowClasses()">Layout</p>
|
|
3995
|
+
</div>
|
|
3996
|
+
|
|
3997
|
+
<div class="rounded-(--layout-frame-radius) bg-muted/65 p-0.5">
|
|
3998
|
+
<div class="grid grid-cols-3 gap-1" role="group" aria-label="Layout mode">
|
|
3999
|
+
@for (option of layoutModeOptions; track option.value) {
|
|
4000
|
+
<button
|
|
4001
|
+
type="button"
|
|
4002
|
+
ui-button
|
|
4003
|
+
size="sm"
|
|
4004
|
+
variant="ghost"
|
|
4005
|
+
data-setting-option="layout-mode"
|
|
4006
|
+
[attr.data-value]="option.value"
|
|
4007
|
+
[attr.aria-pressed]="currentLayoutMode() === option.value"
|
|
4008
|
+
[class]="segmentedOptionClasses(currentLayoutMode() === option.value)"
|
|
4009
|
+
(click)="setLayoutMode(option.value)">
|
|
4010
|
+
<span class="inline-flex items-center gap-2.5">
|
|
4011
|
+
<span
|
|
4012
|
+
aria-hidden="true"
|
|
4013
|
+
[class]="optionIconClasses(currentLayoutMode() === option.value)"
|
|
4014
|
+
[innerHTML]="iconSvg(option.icon!)"></span>
|
|
4015
|
+
<span class="text-sm font-semibold leading-none">{{ option.label }}</span>
|
|
4016
|
+
</span>
|
|
4017
|
+
</button>
|
|
4018
|
+
}
|
|
4019
|
+
</div>
|
|
4020
|
+
</div>
|
|
4021
|
+
</section>
|
|
4022
|
+
|
|
4023
|
+
<section data-setting="layout-width" [attr.data-current]="currentLayoutWidth()" class="space-y-2">
|
|
4024
|
+
<div class="px-1">
|
|
4025
|
+
<p [class]="sectionEyebrowClasses()">Width</p>
|
|
4026
|
+
</div>
|
|
4027
|
+
|
|
4028
|
+
<div class="rounded-(--layout-frame-radius) bg-muted/65 p-0.5">
|
|
4029
|
+
<div class="grid grid-cols-3 gap-1" role="group" aria-label="Layout width">
|
|
4030
|
+
@for (option of layoutWidthOptions; track option.value) {
|
|
4031
|
+
<button
|
|
4032
|
+
type="button"
|
|
4033
|
+
ui-button
|
|
4034
|
+
size="sm"
|
|
4035
|
+
variant="ghost"
|
|
4036
|
+
data-setting-option="layout-width"
|
|
4037
|
+
[attr.data-value]="option.value"
|
|
4038
|
+
[attr.aria-pressed]="currentLayoutWidth() === option.value"
|
|
4039
|
+
[class]="segmentedOptionClasses(currentLayoutWidth() === option.value)"
|
|
4040
|
+
(click)="setLayoutWidth(option.value)">
|
|
4041
|
+
<span class="inline-flex items-center gap-2.5">
|
|
4042
|
+
<span
|
|
4043
|
+
aria-hidden="true"
|
|
4044
|
+
[class]="optionIconClasses(currentLayoutWidth() === option.value)"
|
|
4045
|
+
[innerHTML]="iconSvg(option.icon!)"></span>
|
|
4046
|
+
<span class="text-sm font-semibold leading-none">{{ option.label }}</span>
|
|
4047
|
+
</span>
|
|
4048
|
+
</button>
|
|
4049
|
+
}
|
|
4050
|
+
</div>
|
|
4051
|
+
</div>
|
|
4052
|
+
</section>
|
|
4053
|
+
</div>
|
|
4054
|
+
</div>
|
|
4055
|
+
`,
|
|
4056
|
+
}]
|
|
4057
|
+
}], ctorParameters: () => [], propDecorators: { connected: [{ type: i0.Input, args: [{ isSignal: true, alias: "connected", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], userName: [{ type: i0.Input, args: [{ isSignal: true, alias: "userName", required: false }] }], userSubtitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "userSubtitle", required: false }] }], userInitials: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInitials", required: false }] }], themeColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "themeColor", required: false }] }], themeMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "themeMode", required: false }] }], themeStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "themeStyle", required: false }] }], layoutMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "layoutMode", required: false }] }], layoutWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "layoutWidth", required: false }] }], themeColorChange: [{ type: i0.Output, args: ["themeColorChange"] }], themeModeChange: [{ type: i0.Output, args: ["themeModeChange"] }], themeStyleChange: [{ type: i0.Output, args: ["themeStyleChange"] }], layoutModeChange: [{ type: i0.Output, args: ["layoutModeChange"] }], layoutWidthChange: [{ type: i0.Output, args: ["layoutWidthChange"] }] } });
|
|
4058
|
+
|
|
3465
4059
|
/*
|
|
3466
4060
|
* Public API Surface of @ojiepermana/angular/component
|
|
3467
4061
|
*/
|
|
@@ -3471,5 +4065,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.13", ngImpo
|
|
|
3471
4065
|
* Generated bundle index. Do not edit.
|
|
3472
4066
|
*/
|
|
3473
4067
|
|
|
3474
|
-
export { AccordionComponent, AccordionContentComponent, AccordionContextBase, AccordionItemComponent, AccordionTriggerComponent, AlertComponent, AlertDescriptionComponent, AlertTitleComponent, AvatarComponent, AvatarFallbackComponent, AvatarImageComponent, BadgeComponent, BreadcrumbComponent, BreadcrumbEllipsisComponent, BreadcrumbItemComponent, BreadcrumbLinkComponent, BreadcrumbListComponent, BreadcrumbPageComponent, BreadcrumbSeparatorComponent, ButtonComponent, CalendarComponent, CardComponent, CardContentComponent, CardDescriptionComponent, CardFooterComponent, CardHeaderComponent, CardTitleComponent, CheckboxComponent, ComboboxComponent, CommandComponent, CommandContextBase, CommandEmptyComponent, CommandGroupComponent, CommandInputComponent, CommandItemComponent, CommandListComponent, CommandSeparatorComponent, CommandShortcutComponent, ContextMenuTriggerDirective, DatePickerComponent, DialogComponent, DialogContentComponent, DialogDescriptionComponent, DialogFooterComponent, DialogHeaderComponent, DialogTitleComponent, FormControlDirective, FormDescriptionComponent, FormFieldComponent, FormFieldContext, FormLabelComponent, FormMessageComponent, InputComponent, LabelComponent, MenuContentDirective, MenuItemComponent, MenuLabelComponent, MenuSeparatorComponent, MenuShortcutComponent, MenuSurfaceComponent, MenuTriggerDirective, OptionComponent, PaginationComponent, PopoverContentDirective, PopoverTriggerDirective, ProgressComponent, RadioComponent, RadioGroupComponent, ScrollAreaComponent, SelectComponent, SeparatorComponent, SheetComponent, SheetContentComponent, SheetDescriptionComponent, SheetFooterComponent, SheetHeaderComponent, SheetTitleComponent, SkeletonComponent, SliderComponent, SwitchComponent, TableBodyComponent, TableCaptionComponent, TableCellComponent, TableComponent, TableFooterComponent, TableHeadComponent, TableHeaderComponent, TableRowComponent, TabsComponent, TabsContentComponent, TabsContextBase, TabsListComponent, TabsTriggerComponent, TextareaComponent, ToastService, TooltipDirective, alertVariants, badgeVariants, buttonVariants, cn };
|
|
4068
|
+
export { AccordionComponent, AccordionContentComponent, AccordionContextBase, AccordionItemComponent, AccordionTriggerComponent, AlertComponent, AlertDescriptionComponent, AlertTitleComponent, AvatarComponent, AvatarFallbackComponent, AvatarImageComponent, BadgeComponent, BreadcrumbComponent, BreadcrumbEllipsisComponent, BreadcrumbItemComponent, BreadcrumbLinkComponent, BreadcrumbListComponent, BreadcrumbPageComponent, BreadcrumbSeparatorComponent, ButtonComponent, CalendarComponent, CardComponent, CardContentComponent, CardDescriptionComponent, CardFooterComponent, CardHeaderComponent, CardTitleComponent, CheckboxComponent, ComboboxComponent, CommandComponent, CommandContextBase, CommandEmptyComponent, CommandGroupComponent, CommandInputComponent, CommandItemComponent, CommandListComponent, CommandSeparatorComponent, CommandShortcutComponent, ContextMenuTriggerDirective, DatePickerComponent, DialogComponent, DialogContentComponent, DialogDescriptionComponent, DialogFooterComponent, DialogHeaderComponent, DialogTitleComponent, FormControlDirective, FormDescriptionComponent, FormFieldComponent, FormFieldContext, FormLabelComponent, FormMessageComponent, InputComponent, LabelComponent, MenuContentDirective, MenuItemComponent, MenuLabelComponent, MenuSeparatorComponent, MenuShortcutComponent, MenuSurfaceComponent, MenuTriggerDirective, OptionComponent, POPOVER_TRIGGER_DEFAULTS, PaginationComponent, PopoverContentDirective, PopoverTriggerDirective, ProgressComponent, RadioComponent, RadioGroupComponent, ScrollAreaComponent, SelectComponent, SeparatorComponent, SheetComponent, SheetContentComponent, SheetDescriptionComponent, SheetFooterComponent, SheetHeaderComponent, SheetTitleComponent, SkeletonComponent, SliderComponent, SwitchComponent, THEME_PANEL_LAYOUT_PORT, THEME_PANEL_THEME_PORT, TableBodyComponent, TableCaptionComponent, TableCellComponent, TableComponent, TableFooterComponent, TableHeadComponent, TableHeaderComponent, TableRowComponent, TabsComponent, TabsContentComponent, TabsContextBase, TabsListComponent, TabsTriggerComponent, TextareaComponent, ThemePanelComponent, ToastService, TooltipDirective, alertVariants, badgeVariants, buttonVariants, cn };
|
|
3475
4069
|
//# sourceMappingURL=ojiepermana-angular-component.mjs.map
|