@sixbell-telco/sdk 0.6.1 → 0.7.1
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/CHANGELOG.md +33 -0
- package/README.md +158 -12
- package/_index.scss +6 -0
- package/components/audio-player/button-play/button-play.component.d.ts +11 -1
- package/components/audio-player/services/audio.service.d.ts +1 -0
- package/components/button/src/button.component.d.ts +2 -2
- package/components/file-upload/file-dropzone/src/file-dropzone.component.d.ts +59 -6
- package/components/file-upload/file-dropzone/src/file-dropzone.constants.d.ts +6 -0
- package/components/file-upload/file-uploader/src/file-uploader.component.d.ts +2 -2
- package/components/forms/input/src/input.component.d.ts +2 -2
- package/components/icon/src/icon.component.d.ts +3 -4
- package/components/modal/src/modal.component.d.ts +72 -4
- package/components/table/src/table.component.d.ts +140 -0
- package/components/table/table-header-checkbox/table-header-checkbox.component.d.ts +42 -0
- package/components/table/table-row-checkbox/table-row-checkbox.component.d.ts +46 -0
- package/components/tooltip/src/tooltip.component.d.ts +1 -2
- package/directives/typography/src/typography.directive.d.ts +46 -0
- package/esm2022/components/audio-player/button-play/button-play.component.mjs +14 -5
- package/esm2022/components/audio-player/services/audio.service.mjs +4 -1
- package/esm2022/components/audio-player/src/audio-player.component.mjs +1 -1
- package/esm2022/components/audio-player/track-info/track-info.component.mjs +3 -3
- package/esm2022/components/audio-player/volume-control/volume-control.component.mjs +2 -2
- package/esm2022/components/badge/src/badge.component.mjs +2 -2
- package/esm2022/components/button/src/button.component.mjs +5 -4
- package/esm2022/components/dropdown/src/dropdown.component.mjs +1 -1
- package/esm2022/components/file-upload/file-dropzone/src/file-dropzone.component.mjs +211 -16
- package/esm2022/components/file-upload/file-dropzone/src/file-dropzone.constants.mjs +7 -0
- package/esm2022/components/file-upload/file-uploader/src/file-uploader.component.mjs +1 -1
- package/esm2022/components/forms/datepicker/src/datepicker.component.mjs +1 -1
- package/esm2022/components/forms/input/src/input.component.mjs +6 -5
- package/esm2022/components/icon/src/icon.component.mjs +5 -5
- package/esm2022/components/link/src/link.component.mjs +2 -2
- package/esm2022/components/modal/src/modal.component.mjs +79 -6
- package/esm2022/components/notification/src/notification.component.mjs +1 -1
- package/esm2022/components/paginator/components/pagination-item/pagination-item.component.mjs +2 -2
- package/esm2022/components/product-card/src/product-card.component.mjs +1 -1
- package/esm2022/components/table/src/table.component.mjs +144 -8
- package/esm2022/components/table/table-header-checkbox/table-header-checkbox.component.mjs +43 -1
- package/esm2022/components/table/table-row-checkbox/table-row-checkbox.component.mjs +47 -1
- package/esm2022/components/toast/toast-message/toast-message.component.mjs +2 -2
- package/esm2022/components/tooltip/src/tooltip.component.mjs +3 -5
- package/esm2022/components/wizard/wizard-step/wizard-step.component.mjs +1 -1
- package/esm2022/directives/typography/src/typography.directive.mjs +62 -13
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs +20 -8
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-button.mjs +4 -3
- package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload-file-dropzone.mjs +216 -15
- package/fesm2022/sixbell-telco-sdk-components-file-upload-file-dropzone.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload-file-uploader.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-datepicker.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-datepicker.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +5 -4
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-icon.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-icon.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-link.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-link.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-modal.mjs +78 -5
- package/fesm2022/sixbell-telco-sdk-components-modal.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-notification.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-notification.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-product-card.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-product-card.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-table.mjs +231 -7
- package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-toast.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-toast.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs +2 -4
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-typography.mjs +61 -12
- package/fesm2022/sixbell-telco-sdk-directives-typography.mjs.map +1 -1
- package/package.json +50 -48
|
@@ -2,7 +2,7 @@ import { Component, input } from '@angular/core';
|
|
|
2
2
|
import { cn } from '@sixbell-telco/sdk/utils/cn';
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
-
export const tooltipComponent = cva(['tooltip'], {
|
|
5
|
+
export const tooltipComponent = cva(['tooltip', 'inline-flex', 'items-center'], {
|
|
6
6
|
variants: {
|
|
7
7
|
variant: {
|
|
8
8
|
primary: ['tooltip-primary'],
|
|
@@ -29,19 +29,17 @@ export const tooltipComponent = cva(['tooltip'], {
|
|
|
29
29
|
export class TooltipComponent {
|
|
30
30
|
variant = input();
|
|
31
31
|
position = input();
|
|
32
|
-
classes = input('');
|
|
33
32
|
label = input.required();
|
|
34
33
|
get componentClass() {
|
|
35
34
|
return cn(tooltipComponent({
|
|
36
35
|
variant: this.variant(),
|
|
37
|
-
class: this.classes(),
|
|
38
36
|
}));
|
|
39
37
|
}
|
|
40
38
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: TooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
41
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.12", type: TooltipComponent, isStandalone: true, selector: "st-tooltip", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null },
|
|
39
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.12", type: TooltipComponent, isStandalone: true, selector: "st-tooltip", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div [class]=\"componentClass\" [attr.data-tip]=\"label()\">\n\t<ng-content></ng-content>\n</div>\n", styles: [""] });
|
|
42
40
|
}
|
|
43
41
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: TooltipComponent, decorators: [{
|
|
44
42
|
type: Component,
|
|
45
43
|
args: [{ selector: 'st-tooltip', standalone: true, imports: [], template: "<div [class]=\"componentClass\" [attr.data-tip]=\"label()\">\n\t<ng-content></ng-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GlwUG9zaXRpb25Qcm9wcyA9ICd0b3AnIHwgJ2JvdHRvbScgfCAncmlnaHQnIHwgJ2xlZnQnIHwgbnVsbCB8IHVuZGVmaW5lZDtcblxuZXhwb3J0IHR5cGUgVG9vbHRpcFByb3BzID0ge1xuXHR2YXJpYW50PzogVG9vbHRpcFZhcmlhbnRQcm9wcztcblx0cG9zaXRpb24/OiBUb29sdGlwUG9zaXRpb25Qcm9wcztcbn07XG5cbkBDb21wb25lbnQoe1xuXHRzZWxlY3RvcjogJ3N0LXRvb2x0aXAnLFxuXHRzdGFuZGFsb25lOiB0cnVlLFxuXHRpbXBvcnRzOiBbXSxcblx0dGVtcGxhdGVVcmw6ICcuL3Rvb2x0aXAuY29tcG9uZW50Lmh0bWwnLFxuXHRzdHlsZXM6ICcnLFxufSlcbmV4cG9ydCBjbGFzcyBUb29sdGlwQ29tcG9uZW50IHtcblx0dmFyaWFudCA9IGlucHV0PFRvb2x0aXBWYXJpYW50UHJvcHM+KCk7XG5cdHBvc2l0aW9uID0gaW5wdXQ8VG9vbHRpcFBvc2l0aW9uUHJvcHM+KCk7XG5cdGxhYmVsID0gaW5wdXQucmVxdWlyZWQ8c3RyaW5nPigpO1xuXG5cdGdldCBjb21wb25lbnRDbGFzcygpIHtcblx0XHRyZXR1cm4gY24oXG5cdFx0XHR0b29sdGlwQ29tcG9uZW50KHtcblx0XHRcdFx0dmFyaWFudDogdGhpcy52YXJpYW50KCksXG5cdFx0XHR9KSxcblx0XHQpO1xuXHR9XG59XG4iLCI8ZGl2IFtjbGFzc109XCJjb21wb25lbnRDbGFzc1wiIFthdHRyLmRhdGEtdGlwXT1cImxhYmVsKClcIj5cblx0PG5nLWNvbnRlbnQ+PC9uZy1jb250ZW50PlxuPC9kaXY+XG4iXX0=
|
|
@@ -35,7 +35,7 @@ export class WizardStepComponent {
|
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: WizardStepComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
38
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.12", type: WizardStepComponent, isStandalone: true, selector: "st-wizard-step", inputs: { status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: true, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, currentStep: { classPropertyName: "currentStep", publicName: "currentStep", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@let currentStepVar = currentStep();\n@let contentVar = content();\n\n<div [class]=\"getStepClasses(currentStepVar, contentVar).outerClasses\">\n\t<div [class]=\"getStepClasses(currentStepVar, contentVar).innerClasses\">\n\t\t<div [class]=\"stepNumberClasses\">\n\t\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'inherit'\" [tyFontWeight]=\"'semibold'\">\n\t\t\t\t{{ contentVar.step() + 1 }}\n\t\t\t</span>\n\t\t</div>\n\t\t<st-icon [class]=\"stepIconClasses\" [icon]=\"icon\" color=\"inherit\" size=\"md\"></st-icon>\n\t</div>\n</div>\n", dependencies: [{ kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight", "tyTextOverflow"] }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "
|
|
38
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.12", type: WizardStepComponent, isStandalone: true, selector: "st-wizard-step", inputs: { status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: true, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, currentStep: { classPropertyName: "currentStep", publicName: "currentStep", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@let currentStepVar = currentStep();\n@let contentVar = content();\n\n<div [class]=\"getStepClasses(currentStepVar, contentVar).outerClasses\">\n\t<div [class]=\"getStepClasses(currentStepVar, contentVar).innerClasses\">\n\t\t<div [class]=\"stepNumberClasses\">\n\t\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'inherit'\" [tyFontWeight]=\"'semibold'\">\n\t\t\t\t{{ contentVar.step() + 1 }}\n\t\t\t</span>\n\t\t</div>\n\t\t<st-icon [class]=\"stepIconClasses\" [icon]=\"icon\" color=\"inherit\" size=\"md\"></st-icon>\n\t</div>\n</div>\n", dependencies: [{ kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight", "tyTextOverflow"] }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
39
39
|
}
|
|
40
40
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: WizardStepComponent, decorators: [{
|
|
41
41
|
type: Component,
|
|
@@ -2,18 +2,22 @@ import { Directive, ElementRef, Renderer2, effect, inject, input } from '@angula
|
|
|
2
2
|
import { cn } from '@sixbell-telco/sdk/utils/cn';
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
* CSS class generator for typography variants
|
|
8
|
+
*/
|
|
5
9
|
const typographyDirective = cva([], {
|
|
6
10
|
variants: {
|
|
7
11
|
variant: {
|
|
8
|
-
h1: ['text-[
|
|
9
|
-
h2: ['text-[1.
|
|
10
|
-
h3: ['text-[1.
|
|
11
|
-
h4: ['text-[1.
|
|
12
|
-
h5: ['text-[1.
|
|
13
|
-
h6: ['text-
|
|
14
|
-
body: ['text-base', 'text-pretty', 'font-body', 'leading-normal'],
|
|
15
|
-
'body-sm': ['text-[0.
|
|
16
|
-
'body-xs': ['text-[0.
|
|
12
|
+
h1: ['text-[1.476rem]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],
|
|
13
|
+
h2: ['text-[1.383rem]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],
|
|
14
|
+
h3: ['text-[1.296rem]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],
|
|
15
|
+
h4: ['text-[1.215rem]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],
|
|
16
|
+
h5: ['text-[1.138rem]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],
|
|
17
|
+
h6: ['text-[1.067rem]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],
|
|
18
|
+
body: ['text-base', 'text-pretty', 'font-body', 'leading-normal', 'tracking-tight'],
|
|
19
|
+
'body-sm': ['text-[0.937rem]', 'text-pretty', 'font-body', 'leading-normal', 'tracking-tight'],
|
|
20
|
+
'body-xs': ['text-[0.878rem]', 'text-pretty', 'font-body', 'leading-normal', 'tracking-tight'],
|
|
17
21
|
inherit: ['font-body'],
|
|
18
22
|
},
|
|
19
23
|
color: {
|
|
@@ -26,7 +30,7 @@ const typographyDirective = cva([], {
|
|
|
26
30
|
semibold: 'font-semibold',
|
|
27
31
|
medium: 'font-medium',
|
|
28
32
|
normal: 'font-normal',
|
|
29
|
-
inherit:
|
|
33
|
+
inherit: 'font-inherit',
|
|
30
34
|
},
|
|
31
35
|
textOverflow: {
|
|
32
36
|
clip: 'text-clip',
|
|
@@ -42,16 +46,61 @@ const typographyDirective = cva([], {
|
|
|
42
46
|
textOverflow: 'clip',
|
|
43
47
|
},
|
|
44
48
|
});
|
|
49
|
+
/**
|
|
50
|
+
* A directive for applying consistent typography styles using Tailwind CSS
|
|
51
|
+
*
|
|
52
|
+
* @remarks
|
|
53
|
+
* Applies text styling based on variant, color, weight, and overflow properties.
|
|
54
|
+
* Uses Angular's signal-based inputs for reactive style updates.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```html
|
|
58
|
+
* <h1 typography tyVariant="h2" tyColor="base" tyFontWeight="bold">
|
|
59
|
+
* Heading with custom typography
|
|
60
|
+
* </h1>
|
|
61
|
+
*
|
|
62
|
+
* <p typography tyVariant="body-sm" tyTextOverflow="ellipsis">
|
|
63
|
+
* Small body text with ellipsis overflow
|
|
64
|
+
* </p>
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
45
67
|
export class TypographyDirective {
|
|
46
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Typography variant style (heading level or body type)
|
|
70
|
+
* @alias tyVariant
|
|
71
|
+
* @defaultValue 'body'
|
|
72
|
+
*/
|
|
47
73
|
variant = input('body', { alias: 'tyVariant' });
|
|
74
|
+
/**
|
|
75
|
+
* Text color variant
|
|
76
|
+
* @alias tyColor
|
|
77
|
+
* @defaultValue 'inherit'
|
|
78
|
+
*/
|
|
48
79
|
color = input('inherit', { alias: 'tyColor' });
|
|
80
|
+
/**
|
|
81
|
+
* Font weight variant
|
|
82
|
+
* @alias tyFontWeight
|
|
83
|
+
* @defaultValue 'normal'
|
|
84
|
+
*/
|
|
49
85
|
fontWeight = input('normal', { alias: 'tyFontWeight' });
|
|
86
|
+
/**
|
|
87
|
+
* Text overflow handling method
|
|
88
|
+
* @alias tyTextOverflow
|
|
89
|
+
* @defaultValue 'clip'
|
|
90
|
+
*/
|
|
50
91
|
textOverflow = input('clip', { alias: 'tyTextOverflow' });
|
|
92
|
+
/** @internal Reference to host element */
|
|
51
93
|
element = inject(ElementRef);
|
|
94
|
+
/** @internal Angular renderer instance */
|
|
52
95
|
renderer = inject(Renderer2);
|
|
96
|
+
/** @internal Effect to update classes when inputs change */
|
|
53
97
|
classListEffect = effect(() => {
|
|
54
|
-
const classList = cn(typographyDirective({
|
|
98
|
+
const classList = cn(typographyDirective({
|
|
99
|
+
variant: this.variant(),
|
|
100
|
+
color: this.color(),
|
|
101
|
+
fontWeight: this.fontWeight(),
|
|
102
|
+
textOverflow: this.textOverflow(),
|
|
103
|
+
}));
|
|
55
104
|
this.renderer.setAttribute(this.element.nativeElement, 'class', classList);
|
|
56
105
|
});
|
|
57
106
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: TypographyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
@@ -65,4 +114,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
|
|
|
65
114
|
standalone: true,
|
|
66
115
|
}]
|
|
67
116
|
}] });
|
|
68
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
117
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwb2dyYXBoeS5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9zZGsvZGlyZWN0aXZlcy90eXBvZ3JhcGh5L3NyYy90eXBvZ3JhcGh5LmRpcmVjdGl2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLFVBQVUsRUFBRSxTQUFTLEVBQUUsTUFBTSxFQUFFLE1BQU0sRUFBRSxLQUFLLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDeEYsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQ2pELE9BQU8sRUFBRSxHQUFHLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQzs7QUFFL0M7OztHQUdHO0FBQ0gsTUFBTSxtQkFBbUIsR0FBRyxHQUFHLENBQUMsRUFBRSxFQUFFO0lBQ25DLFFBQVEsRUFBRTtRQUNULE9BQU8sRUFBRTtZQUNSLEVBQUUsRUFBRSxDQUFDLGlCQUFpQixFQUFFLGNBQWMsRUFBRSxjQUFjLEVBQUUsZUFBZSxFQUFFLGVBQWUsQ0FBQztZQUN6RixFQUFFLEVBQUUsQ0FBQyxpQkFBaUIsRUFBRSxjQUFjLEVBQUUsY0FBYyxFQUFFLGVBQWUsR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QW5ndWxhciByZW5kZXJlciBpbnN0YW5jZSAqL1xuXHRwcml2YXRlIHJlbmRlcmVyOiBSZW5kZXJlcjIgPSBpbmplY3QoUmVuZGVyZXIyKTtcblxuXHQvKiogQGludGVybmFsIEVmZmVjdCB0byB1cGRhdGUgY2xhc3NlcyB3aGVuIGlucHV0cyBjaGFuZ2UgKi9cblx0Y2xhc3NMaXN0RWZmZWN0ID0gZWZmZWN0KCgpID0+IHtcblx0XHRjb25zdCBjbGFzc0xpc3QgPSBjbihcblx0XHRcdHR5cG9ncmFwaHlEaXJlY3RpdmUoe1xuXHRcdFx0XHR2YXJpYW50OiB0aGlzLnZhcmlhbnQoKSxcblx0XHRcdFx0Y29sb3I6IHRoaXMuY29sb3IoKSxcblx0XHRcdFx0Zm9udFdlaWdodDogdGhpcy5mb250V2VpZ2h0KCksXG5cdFx0XHRcdHRleHRPdmVyZmxvdzogdGhpcy50ZXh0T3ZlcmZsb3coKSxcblx0XHRcdH0pLFxuXHRcdCk7XG5cdFx0dGhpcy5yZW5kZXJlci5zZXRBdHRyaWJ1dGUodGhpcy5lbGVtZW50Lm5hdGl2ZUVsZW1lbnQsICdjbGFzcycsIGNsYXNzTGlzdCk7XG5cdH0pO1xufVxuIl19
|
|
@@ -158,6 +158,9 @@ class AudioPlayerService {
|
|
|
158
158
|
seekTo(time) {
|
|
159
159
|
this.audio.currentTime = time;
|
|
160
160
|
}
|
|
161
|
+
isPlayingATrack() {
|
|
162
|
+
return this.audio.src !== '' && !this.audio.paused;
|
|
163
|
+
}
|
|
161
164
|
// Private handlers
|
|
162
165
|
updateDuration() {
|
|
163
166
|
this._duration.set(this.audio.duration);
|
|
@@ -196,6 +199,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImpo
|
|
|
196
199
|
|
|
197
200
|
class ButtonPlayComponent {
|
|
198
201
|
audioService = inject(AudioPlayerService);
|
|
202
|
+
variant = input();
|
|
203
|
+
ghost = input(false);
|
|
204
|
+
outline = input(false);
|
|
205
|
+
circle = input(false);
|
|
206
|
+
square = input(false);
|
|
207
|
+
glass = input(false);
|
|
208
|
+
size = input();
|
|
209
|
+
shadow = input(false);
|
|
210
|
+
asButton = input(false);
|
|
199
211
|
isHovered = signal(false);
|
|
200
212
|
trackIndex = input.required();
|
|
201
213
|
onTogglePlay = output();
|
|
@@ -210,7 +222,7 @@ class ButtonPlayComponent {
|
|
|
210
222
|
{ delay: '0.4s', class: 'h-1/5 animate-wave w-[2px] rounded-full bg-current' },
|
|
211
223
|
];
|
|
212
224
|
get ButtonClass() {
|
|
213
|
-
return cn('absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 opacity-0 transition-opacity duration-200', {
|
|
225
|
+
return cn('absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 opacity-0 transition-opacity duration-200 inline-flex items-center justify-center', {
|
|
214
226
|
'opacity-100': (this.audioService.isPlaying() && this.trackIndex() === this.audioService.currentTrackIndex()) || this.isHovered(),
|
|
215
227
|
});
|
|
216
228
|
}
|
|
@@ -220,7 +232,7 @@ class ButtonPlayComponent {
|
|
|
220
232
|
});
|
|
221
233
|
}
|
|
222
234
|
get IconClass() {
|
|
223
|
-
return cn('opacity-0 absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transition-opacity duration-200', {
|
|
235
|
+
return cn('opacity-0 absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transition-opacity duration-200 inline-flex items-center justify-center', {
|
|
224
236
|
'opacity-100': !this.audioService.isPlaying() || this.trackIndex() !== this.audioService.currentTrackIndex() || this.isHovered(),
|
|
225
237
|
});
|
|
226
238
|
}
|
|
@@ -240,11 +252,11 @@ class ButtonPlayComponent {
|
|
|
240
252
|
this.onTogglePlay.emit();
|
|
241
253
|
}
|
|
242
254
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: ButtonPlayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
243
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: ButtonPlayComponent, isStandalone: true, selector: "st-button-play", inputs: { trackIndex: { classPropertyName: "trackIndex", publicName: "trackIndex", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { onTogglePlay: "onTogglePlay" }, ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n\n<div\n\tclass=\"relative grid h-10 min-h-10 w-10 min-w-10 place-content-center rounded bg-gradient-to-br from-primary
|
|
255
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: ButtonPlayComponent, isStandalone: true, selector: "st-button-play", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, ghost: { classPropertyName: "ghost", publicName: "ghost", isSignal: true, isRequired: false, transformFunction: null }, outline: { classPropertyName: "outline", publicName: "outline", isSignal: true, isRequired: false, transformFunction: null }, circle: { classPropertyName: "circle", publicName: "circle", isSignal: true, isRequired: false, transformFunction: null }, square: { classPropertyName: "square", publicName: "square", isSignal: true, isRequired: false, transformFunction: null }, glass: { classPropertyName: "glass", publicName: "glass", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, shadow: { classPropertyName: "shadow", publicName: "shadow", isSignal: true, isRequired: false, transformFunction: null }, asButton: { classPropertyName: "asButton", publicName: "asButton", isSignal: true, isRequired: false, transformFunction: null }, trackIndex: { classPropertyName: "trackIndex", publicName: "trackIndex", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { onTogglePlay: "onTogglePlay" }, ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n\n@if (!asButton()) {\n\t<div\n\t\tclass=\"to-primary-gradient relative grid h-10 min-h-10 w-10 min-w-10 place-content-center rounded bg-gradient-to-br from-primary text-white\"\n\t\t(mouseenter)=\"handleHover(true)\"\n\t\t(mouseleave)=\"handleHover(false)\"\n\t>\n\t\t<st-icon [icon]=\"iconMusicNote\"></st-icon>\n\n\t\t<div [class]=\"ButtonClass\">\n\t\t\t<st-button\n\t\t\t\t[circle]=\"true\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\t[shadow]=\"true\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\t(click)=\"handleTogglePlay()\"\n\t\t\t\tclass=\"inline-flex items-center justify-center\"\n\t\t\t>\n\t\t\t\t<div class=\"relative h-full w-full\">\n\t\t\t\t\t<div [class]=\"WaveBarsClass\">\n\t\t\t\t\t\t<div class=\"flex h-full w-full items-center justify-between\">\n\t\t\t\t\t\t\t@for (bar of waveBars; track $index) {\n\t\t\t\t\t\t\t\t<div [class]=\"bar.class\" [style.--i]=\"bar.delay\"></div>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div [class]=\"IconClass\">\n\t\t\t\t\t\t<st-icon [icon]=\"Icon\"></st-icon>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</st-button>\n\t\t</div>\n\t</div>\n} @else {\n\t<st-button\n\t\t[variant]=\"variant()\"\n\t\t[ghost]=\"ghost()\"\n\t\t[outline]=\"outline()\"\n\t\t[circle]=\"circle()\"\n\t\t[square]=\"square()\"\n\t\t[glass]=\"glass()\"\n\t\t[size]=\"size()\"\n\t\t[shadow]=\"shadow()\"\n\t\t(click)=\"handleTogglePlay()\"\n\t\t(mouseenter)=\"handleHover(true)\"\n\t\t(mouseleave)=\"handleHover(false)\"\n\t\tclass=\"inline-flex items-center justify-center\"\n\t>\n\t\t<div class=\"relative h-full w-full\">\n\t\t\t<div [class]=\"WaveBarsClass\">\n\t\t\t\t<div class=\"flex h-full w-full items-center justify-between\">\n\t\t\t\t\t@for (bar of waveBars; track $index) {\n\t\t\t\t\t\t<div [class]=\"bar.class\" [style.--i]=\"bar.delay\"></div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div [class]=\"IconClass\">\n\t\t\t\t<st-icon [icon]=\"Icon\"></st-icon>\n\t\t\t</div>\n\t\t</div>\n\t</st-button>\n}\n", styles: [""], dependencies: [{ kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon"] }, { kind: "ngmodule", type: CommonModule }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "circle", "square", "glass", "block", "loader", "size", "shadow", "icon", "iconPosition", "type", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
244
256
|
}
|
|
245
257
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: ButtonPlayComponent, decorators: [{
|
|
246
258
|
type: Component,
|
|
247
|
-
args: [{ selector: 'st-button-play', standalone: true, imports: [IconComponent, CommonModule, ButtonComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n\n<div\n\tclass=\"relative grid h-10 min-h-10 w-10 min-w-10 place-content-center rounded bg-gradient-to-br from-primary
|
|
259
|
+
args: [{ selector: 'st-button-play', standalone: true, imports: [IconComponent, CommonModule, ButtonComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n\n@if (!asButton()) {\n\t<div\n\t\tclass=\"to-primary-gradient relative grid h-10 min-h-10 w-10 min-w-10 place-content-center rounded bg-gradient-to-br from-primary text-white\"\n\t\t(mouseenter)=\"handleHover(true)\"\n\t\t(mouseleave)=\"handleHover(false)\"\n\t>\n\t\t<st-icon [icon]=\"iconMusicNote\"></st-icon>\n\n\t\t<div [class]=\"ButtonClass\">\n\t\t\t<st-button\n\t\t\t\t[circle]=\"true\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\t[shadow]=\"true\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\t(click)=\"handleTogglePlay()\"\n\t\t\t\tclass=\"inline-flex items-center justify-center\"\n\t\t\t>\n\t\t\t\t<div class=\"relative h-full w-full\">\n\t\t\t\t\t<div [class]=\"WaveBarsClass\">\n\t\t\t\t\t\t<div class=\"flex h-full w-full items-center justify-between\">\n\t\t\t\t\t\t\t@for (bar of waveBars; track $index) {\n\t\t\t\t\t\t\t\t<div [class]=\"bar.class\" [style.--i]=\"bar.delay\"></div>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div [class]=\"IconClass\">\n\t\t\t\t\t\t<st-icon [icon]=\"Icon\"></st-icon>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</st-button>\n\t\t</div>\n\t</div>\n} @else {\n\t<st-button\n\t\t[variant]=\"variant()\"\n\t\t[ghost]=\"ghost()\"\n\t\t[outline]=\"outline()\"\n\t\t[circle]=\"circle()\"\n\t\t[square]=\"square()\"\n\t\t[glass]=\"glass()\"\n\t\t[size]=\"size()\"\n\t\t[shadow]=\"shadow()\"\n\t\t(click)=\"handleTogglePlay()\"\n\t\t(mouseenter)=\"handleHover(true)\"\n\t\t(mouseleave)=\"handleHover(false)\"\n\t\tclass=\"inline-flex items-center justify-center\"\n\t>\n\t\t<div class=\"relative h-full w-full\">\n\t\t\t<div [class]=\"WaveBarsClass\">\n\t\t\t\t<div class=\"flex h-full w-full items-center justify-between\">\n\t\t\t\t\t@for (bar of waveBars; track $index) {\n\t\t\t\t\t\t<div [class]=\"bar.class\" [style.--i]=\"bar.delay\"></div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div [class]=\"IconClass\">\n\t\t\t\t<st-icon [icon]=\"Icon\"></st-icon>\n\t\t\t</div>\n\t\t</div>\n\t</st-button>\n}\n" }]
|
|
248
260
|
}] });
|
|
249
261
|
|
|
250
262
|
class AudioTimelineComponent {
|
|
@@ -320,11 +332,11 @@ class TrackInfoComponent {
|
|
|
320
332
|
currentTrack = input();
|
|
321
333
|
iconMusicNote = heroMusicalNoteMini;
|
|
322
334
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: TrackInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
323
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.12", type: TrackInfoComponent, isStandalone: true, selector: "st-track-info", inputs: { currentTrack: { classPropertyName: "currentTrack", publicName: "currentTrack", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n\n<div class=\"relative flex max-w-80 items-center gap-4 overflow-x-hidden whitespace-nowrap\">\n\t<div class=\"flex items-center gap-3\">\n\t\t<!-- Album/Track Icon -->\n\t\t<div class=\"grid h-12 min-h-12 w-12 min-w-12 place-content-center rounded bg-gradient-to-br from-primary
|
|
335
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.12", type: TrackInfoComponent, isStandalone: true, selector: "st-track-info", inputs: { currentTrack: { classPropertyName: "currentTrack", publicName: "currentTrack", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n\n<div class=\"relative flex max-w-80 items-center gap-4 overflow-x-hidden whitespace-nowrap\">\n\t<div class=\"flex items-center gap-3\">\n\t\t<!-- Album/Track Icon -->\n\t\t<div class=\"to-primary-gradient grid h-12 min-h-12 w-12 min-w-12 place-content-center rounded bg-gradient-to-br from-primary text-white\">\n\t\t\t<st-icon [icon]=\"iconMusicNote\"></st-icon>\n\t\t</div>\n\n\t\t<!-- Track Info -->\n\t\t@let currentTrackVar = this.currentTrack();\n\t\t<div class=\"min-w-0 flex-1\">\n\t\t\t<p typography tyVariant=\"body\" tyFontWeight=\"medium\" tyColor=\"base\">\n\t\t\t\t{{ currentTrackVar?.title ?? 'No title' }}\n\t\t\t</p>\n\t\t\t<p typography tyVariant=\"body-sm\" tyFontWeight=\"normal\" tyColor=\"base\">\n\t\t\t\t{{ currentTrackVar?.description ?? 'No description' }}\n\t\t\t</p>\n\t\t</div>\n\t</div>\n\t<div class=\"pointer-events-none absolute inset-y-0 right-0 w-12 bg-gradient-to-l from-base-200 to-transparent\"></div>\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight", "tyTextOverflow"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
324
336
|
}
|
|
325
337
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: TrackInfoComponent, decorators: [{
|
|
326
338
|
type: Component,
|
|
327
|
-
args: [{ selector: 'st-track-info', standalone: true, imports: [IconComponent, CommonModule, TypographyDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n\n<div class=\"relative flex max-w-80 items-center gap-4 overflow-x-hidden whitespace-nowrap\">\n\t<div class=\"flex items-center gap-3\">\n\t\t<!-- Album/Track Icon -->\n\t\t<div class=\"grid h-12 min-h-12 w-12 min-w-12 place-content-center rounded bg-gradient-to-br from-primary
|
|
339
|
+
args: [{ selector: 'st-track-info', standalone: true, imports: [IconComponent, CommonModule, TypographyDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n\n<div class=\"relative flex max-w-80 items-center gap-4 overflow-x-hidden whitespace-nowrap\">\n\t<div class=\"flex items-center gap-3\">\n\t\t<!-- Album/Track Icon -->\n\t\t<div class=\"to-primary-gradient grid h-12 min-h-12 w-12 min-w-12 place-content-center rounded bg-gradient-to-br from-primary text-white\">\n\t\t\t<st-icon [icon]=\"iconMusicNote\"></st-icon>\n\t\t</div>\n\n\t\t<!-- Track Info -->\n\t\t@let currentTrackVar = this.currentTrack();\n\t\t<div class=\"min-w-0 flex-1\">\n\t\t\t<p typography tyVariant=\"body\" tyFontWeight=\"medium\" tyColor=\"base\">\n\t\t\t\t{{ currentTrackVar?.title ?? 'No title' }}\n\t\t\t</p>\n\t\t\t<p typography tyVariant=\"body-sm\" tyFontWeight=\"normal\" tyColor=\"base\">\n\t\t\t\t{{ currentTrackVar?.description ?? 'No description' }}\n\t\t\t</p>\n\t\t</div>\n\t</div>\n\t<div class=\"pointer-events-none absolute inset-y-0 right-0 w-12 bg-gradient-to-l from-base-200 to-transparent\"></div>\n</div>\n" }]
|
|
328
340
|
}] });
|
|
329
341
|
|
|
330
342
|
class VolumeControlComponent {
|
|
@@ -383,7 +395,7 @@ class VolumeControlComponent {
|
|
|
383
395
|
this.audioService.setMuted(!this.audioService.isMuted());
|
|
384
396
|
}
|
|
385
397
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: VolumeControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
386
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: VolumeControlComponent, isStandalone: true, selector: "st-volume-control", host: { listeners: { "document:mousemove": "onVolumeDrag($event)", "document:touchmove": "onVolumeDrag($event)", "document:mouseup": "stopVolumeDrag()", "document:touchend": "stopVolumeDrag()" } }, viewQueries: [{ propertyName: "volumeTimeline", first: true, predicate: ["volumeTimeline"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n\n<!-- Volume Control -->\n<div class=\"flex items-center justify-end gap-2\">\n\t<!-- Mute/Unmute Button -->\n\t<st-button [ghost]=\"true\" size=\"sm\" [circle]=\"true\" (click)=\"toggleMute()\">\n\t\t@if (audioService.volume() === 0) {\n\t\t\t<st-icon [icon]=\"iconVolumeMute\"></st-icon>\n\t\t} @else if (audioService.volume() > 0.5) {\n\t\t\t<st-icon [icon]=\"iconVolumeUp\"></st-icon>\n\t\t} @else {\n\t\t\t<st-icon [icon]=\"iconVolumeDown\"></st-icon>\n\t\t}\n\t</st-button>\n\n\t<!-- Custom Volume Progress Bar -->\n\t<div\n\t\t[class]=\"volumeTimelineClass\"\n\t\t(click)=\"seekVolume($event)\"\n\t\t#volumeTimeline\n\t\t(mouseenter)=\"handleVolumeHover(true)\"\n\t\t(mouseleave)=\"handleVolumeHover(false)\"\n\t>\n\t\t<!-- Volume Progress Bar Background -->\n\t\t<div class=\"absolute h-full rounded-full bg-primary\" [style.width]=\"audioService.volume() * 100 + '%'\"></div>\n\n\t\t<!-- Draggable Volume Circle -->\n\t\t<div\n\t\t\t[style.left]=\"'calc(' + audioService.volume() * 100 + '% - ' + (audioService.volume() === 1 ? '6px' : '3px') + ')'\"\n\t\t\t[class]=\"volumeTimelineCircleClass\"\n\t\t\t#volumeCircle\n\t\t\t(mousedown)=\"startVolumeDrag($event)\"\n\t\t\t(touchstart)=\"startVolumeDrag($event)\"\n\t\t></div>\n\t</div>\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "
|
|
398
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: VolumeControlComponent, isStandalone: true, selector: "st-volume-control", host: { listeners: { "document:mousemove": "onVolumeDrag($event)", "document:touchmove": "onVolumeDrag($event)", "document:mouseup": "stopVolumeDrag()", "document:touchend": "stopVolumeDrag()" } }, viewQueries: [{ propertyName: "volumeTimeline", first: true, predicate: ["volumeTimeline"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n\n<!-- Volume Control -->\n<div class=\"flex items-center justify-end gap-2\">\n\t<!-- Mute/Unmute Button -->\n\t<st-button [ghost]=\"true\" size=\"sm\" [circle]=\"true\" (click)=\"toggleMute()\">\n\t\t@if (audioService.volume() === 0) {\n\t\t\t<st-icon [icon]=\"iconVolumeMute\"></st-icon>\n\t\t} @else if (audioService.volume() > 0.5) {\n\t\t\t<st-icon [icon]=\"iconVolumeUp\"></st-icon>\n\t\t} @else {\n\t\t\t<st-icon [icon]=\"iconVolumeDown\"></st-icon>\n\t\t}\n\t</st-button>\n\n\t<!-- Custom Volume Progress Bar -->\n\t<div\n\t\t[class]=\"volumeTimelineClass\"\n\t\t(click)=\"seekVolume($event)\"\n\t\t#volumeTimeline\n\t\t(mouseenter)=\"handleVolumeHover(true)\"\n\t\t(mouseleave)=\"handleVolumeHover(false)\"\n\t>\n\t\t<!-- Volume Progress Bar Background -->\n\t\t<div class=\"absolute h-full rounded-full bg-primary\" [style.width]=\"audioService.volume() * 100 + '%'\"></div>\n\n\t\t<!-- Draggable Volume Circle -->\n\t\t<div\n\t\t\t[style.left]=\"'calc(' + audioService.volume() * 100 + '% - ' + (audioService.volume() === 1 ? '6px' : '3px') + ')'\"\n\t\t\t[class]=\"volumeTimelineCircleClass\"\n\t\t\t#volumeCircle\n\t\t\t(mousedown)=\"startVolumeDrag($event)\"\n\t\t\t(touchstart)=\"startVolumeDrag($event)\"\n\t\t></div>\n\t</div>\n</div>\n", styles: [""], dependencies: [{ kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon"] }, { kind: "ngmodule", type: CommonModule }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "circle", "square", "glass", "block", "loader", "size", "shadow", "icon", "iconPosition", "type", "disabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
387
399
|
}
|
|
388
400
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: VolumeControlComponent, decorators: [{
|
|
389
401
|
type: Component,
|
|
@@ -458,7 +470,7 @@ class AudioPlayerComponent {
|
|
|
458
470
|
this.audioPlayerService.cleanup();
|
|
459
471
|
}
|
|
460
472
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: AudioPlayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
461
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: AudioPlayerComponent, isStandalone: true, selector: "st-audio-player", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, opened: { classPropertyName: "opened", publicName: "opened", isSignal: true, isRequired: false, transformFunction: null }, trackListTitle: { classPropertyName: "trackListTitle", publicName: "trackListTitle", isSignal: true, isRequired: false, transformFunction: null }, currentTrackIndex: { classPropertyName: "currentTrackIndex", publicName: "currentTrackIndex", isSignal: true, isRequired: false, transformFunction: null }, tracks: { classPropertyName: "tracks", publicName: "tracks", isSignal: true, isRequired: false, transformFunction: null }, showTrackList: { classPropertyName: "showTrackList", publicName: "showTrackList", isSignal: true, isRequired: false, transformFunction: null }, shadow: { classPropertyName: "shadow", publicName: "shadow", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { currentTrackIndex: "currentTrackIndexChange" }, ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n\n<div class=\"flex w-full flex-col gap-4\">\n\t<!-- Track List -->\n\t@if (showTrackList()) {\n\t\t<div class=\"mb-4 rounded-box border border-neutral shadow-sm\">\n\t\t\t<div class=\"p-4\">\n\t\t\t\t<h4 typography tyVariant=\"h4\">{{ trackListTitle() }}</h4>\n\t\t\t\t<div class=\"max-h-[300px] space-y-2 overflow-y-auto\">\n\t\t\t\t\t@for (track of tracks(); track $index; let i = $index) {\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass=\"flex cursor-pointer items-center gap-2 rounded-btn p-2 hover:bg-base-300\"\n\t\t\t\t\t\t\t[class.bg-base-300]=\"audioPlayerService.currentTrackIndex() === i\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<st-button-play [trackIndex]=\"i\"> </st-button-play>\n\t\t\t\t\t\t\t<div class=\"flex-1\">\n\t\t\t\t\t\t\t\t<div typography tyVariant=\"body\">{{ track.title }}</div>\n\t\t\t\t\t\t\t\t<div typography tyVariant=\"body-sm\">{{ track.description }}</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t}\n\n\t<div [class]=\"playerClass\">\n\t\t<!-- track info -->\n\t\t<st-track-info [currentTrack]=\"currentTrack\"></st-track-info>\n\n\t\t<div class=\"grid items-center\">\n\t\t\t<!-- Controls -->\n\t\t\t<div class=\"flex items-center justify-center gap-2\">\n\t\t\t\t<st-button (click)=\"previous()\" [ghost]=\"true\" [icon]=\"iconSkipPrevious\" [circle]=\"true\" size=\"sm\"> </st-button>\n\n\t\t\t\t<st-button (click)=\"togglePlay()\" [icon]=\"audioPlayerService.isPlaying() ? iconPause : iconPlay\" [circle]=\"true\" size=\"sm\" [shadow]=\"true\">\n\t\t\t\t</st-button>\n\n\t\t\t\t<st-button (click)=\"next()\" [ghost]=\"true\" [icon]=\"iconSkipNext\" [circle]=\"true\" size=\"sm\"> </st-button>\n\t\t\t</div>\n\n\t\t\t<!-- Progress Bar -->\n\t\t\t<st-timeline></st-timeline>\n\t\t</div>\n\n\t\t<!-- Volume Control -->\n\t\t<st-volume-control></st-volume-control>\n\t</div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "circle", "square", "glass", "block", "loader", "size", "shadow", "icon", "iconPosition", "type", "disabled"] }, { kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight", "tyTextOverflow"] }, { kind: "component", type: VolumeControlComponent, selector: "st-volume-control" }, { kind: "component", type: TrackInfoComponent, selector: "st-track-info", inputs: ["currentTrack"] }, { kind: "component", type: AudioTimelineComponent, selector: "st-timeline" }, { kind: "component", type: ButtonPlayComponent, selector: "st-button-play", inputs: ["trackIndex"], outputs: ["onTogglePlay"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
473
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: AudioPlayerComponent, isStandalone: true, selector: "st-audio-player", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, opened: { classPropertyName: "opened", publicName: "opened", isSignal: true, isRequired: false, transformFunction: null }, trackListTitle: { classPropertyName: "trackListTitle", publicName: "trackListTitle", isSignal: true, isRequired: false, transformFunction: null }, currentTrackIndex: { classPropertyName: "currentTrackIndex", publicName: "currentTrackIndex", isSignal: true, isRequired: false, transformFunction: null }, tracks: { classPropertyName: "tracks", publicName: "tracks", isSignal: true, isRequired: false, transformFunction: null }, showTrackList: { classPropertyName: "showTrackList", publicName: "showTrackList", isSignal: true, isRequired: false, transformFunction: null }, shadow: { classPropertyName: "shadow", publicName: "shadow", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { currentTrackIndex: "currentTrackIndexChange" }, ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/interactive-supports-focus -->\n<!-- eslint-disable @angular-eslint/template/click-events-have-key-events -->\n\n<div class=\"flex w-full flex-col gap-4\">\n\t<!-- Track List -->\n\t@if (showTrackList()) {\n\t\t<div class=\"mb-4 rounded-box border border-neutral shadow-sm\">\n\t\t\t<div class=\"p-4\">\n\t\t\t\t<h4 typography tyVariant=\"h4\">{{ trackListTitle() }}</h4>\n\t\t\t\t<div class=\"max-h-[300px] space-y-2 overflow-y-auto\">\n\t\t\t\t\t@for (track of tracks(); track $index; let i = $index) {\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass=\"flex cursor-pointer items-center gap-2 rounded-btn p-2 hover:bg-base-300\"\n\t\t\t\t\t\t\t[class.bg-base-300]=\"audioPlayerService.currentTrackIndex() === i\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<st-button-play [trackIndex]=\"i\"> </st-button-play>\n\t\t\t\t\t\t\t<div class=\"flex-1\">\n\t\t\t\t\t\t\t\t<div typography tyVariant=\"body\">{{ track.title }}</div>\n\t\t\t\t\t\t\t\t<div typography tyVariant=\"body-sm\">{{ track.description }}</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t}\n\n\t<div [class]=\"playerClass\">\n\t\t<!-- track info -->\n\t\t<st-track-info [currentTrack]=\"currentTrack\"></st-track-info>\n\n\t\t<div class=\"grid items-center\">\n\t\t\t<!-- Controls -->\n\t\t\t<div class=\"flex items-center justify-center gap-2\">\n\t\t\t\t<st-button (click)=\"previous()\" [ghost]=\"true\" [icon]=\"iconSkipPrevious\" [circle]=\"true\" size=\"sm\"> </st-button>\n\n\t\t\t\t<st-button (click)=\"togglePlay()\" [icon]=\"audioPlayerService.isPlaying() ? iconPause : iconPlay\" [circle]=\"true\" size=\"sm\" [shadow]=\"true\">\n\t\t\t\t</st-button>\n\n\t\t\t\t<st-button (click)=\"next()\" [ghost]=\"true\" [icon]=\"iconSkipNext\" [circle]=\"true\" size=\"sm\"> </st-button>\n\t\t\t</div>\n\n\t\t\t<!-- Progress Bar -->\n\t\t\t<st-timeline></st-timeline>\n\t\t</div>\n\n\t\t<!-- Volume Control -->\n\t\t<st-volume-control></st-volume-control>\n\t</div>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "circle", "square", "glass", "block", "loader", "size", "shadow", "icon", "iconPosition", "type", "disabled"] }, { kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight", "tyTextOverflow"] }, { kind: "component", type: VolumeControlComponent, selector: "st-volume-control" }, { kind: "component", type: TrackInfoComponent, selector: "st-track-info", inputs: ["currentTrack"] }, { kind: "component", type: AudioTimelineComponent, selector: "st-timeline" }, { kind: "component", type: ButtonPlayComponent, selector: "st-button-play", inputs: ["variant", "ghost", "outline", "circle", "square", "glass", "size", "shadow", "asButton", "trackIndex"], outputs: ["onTogglePlay"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
462
474
|
}
|
|
463
475
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: AudioPlayerComponent, decorators: [{
|
|
464
476
|
type: Component,
|