@thalassic/ui 0.0.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/README.md +7 -0
- package/fesm2022/thalassic-ui.mjs +476 -0
- package/fesm2022/thalassic-ui.mjs.map +1 -0
- package/package.json +26 -0
- package/types/thalassic-ui.d.ts +212 -0
package/README.md
ADDED
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
import { NgTemplateOutlet, isPlatformBrowser } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { InjectionToken, inject, Injectable, input, computed, Component, booleanAttribute, model, Directive, DOCUMENT, RendererFactory2, PLATFORM_ID, signal, effect, makeEnvironmentProviders } from '@angular/core';
|
|
4
|
+
import { RouterLink } from '@angular/router';
|
|
5
|
+
import { rxResource } from '@angular/core/rxjs-interop';
|
|
6
|
+
import { HttpClient } from '@angular/common/http';
|
|
7
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
8
|
+
import { throwError, map, shareReplay } from 'rxjs';
|
|
9
|
+
|
|
10
|
+
const DEFAULT_ICON_CONFIG = {
|
|
11
|
+
allowedSources: [],
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const ICON_CONFIG = new InjectionToken('ICON_CONFIG', {
|
|
15
|
+
factory: () => DEFAULT_ICON_CONFIG,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
class IconService {
|
|
19
|
+
_http = inject(HttpClient);
|
|
20
|
+
_sanitizer = inject(DomSanitizer);
|
|
21
|
+
_cache = new Map();
|
|
22
|
+
getSvgContent(url, allowedSources) {
|
|
23
|
+
if (allowedSources.length > 0 && !this._isUrlAllowed(url, allowedSources)) {
|
|
24
|
+
return throwError(() => new Error('SVG URL not from trusted source'));
|
|
25
|
+
}
|
|
26
|
+
const cache = this._cache.get(url);
|
|
27
|
+
if (!cache) {
|
|
28
|
+
const svg$ = this._http.get(url, { responseType: 'text' }).pipe(map(svg => this._sanitizeSvg(svg)), shareReplay(1));
|
|
29
|
+
this._cache.set(url, svg$);
|
|
30
|
+
return svg$;
|
|
31
|
+
}
|
|
32
|
+
return cache;
|
|
33
|
+
}
|
|
34
|
+
// Private methods
|
|
35
|
+
_isUrlAllowed(url, allowedSource) {
|
|
36
|
+
return allowedSource.some(source => url.startsWith(source));
|
|
37
|
+
}
|
|
38
|
+
_sanitizeSvg(svg) {
|
|
39
|
+
const safeSvg = this._makeSafe(svg);
|
|
40
|
+
return this._sanitizer.bypassSecurityTrustHtml(safeSvg);
|
|
41
|
+
}
|
|
42
|
+
_makeSafe(svg) {
|
|
43
|
+
return (svg
|
|
44
|
+
// Remove script tags
|
|
45
|
+
.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '')
|
|
46
|
+
// Remove event handlers (onclick, onload, onmouseover, etc.)
|
|
47
|
+
.replace(/on\w+\s*=\s*["'][^"']*["']/gi, '')
|
|
48
|
+
// Remove external xlink:href (keep internal references starting with #)
|
|
49
|
+
.replace(/xlink:href\s*=\s*["'](?!#)[^"']*["']/gi, '')
|
|
50
|
+
// Remove external href in <use>, <image>, <a> tags (keep internal #refs)
|
|
51
|
+
.replace(/href\s*=\s*["'](?!#)[^"']*["']/gi, '')
|
|
52
|
+
// Remove data URIs with HTML content
|
|
53
|
+
.replace(/href\s*=\s*["']data:text\/html[^"']*["']/gi, '')
|
|
54
|
+
.replace(/src\s*=\s*["']data:text\/html[^"']*["']/gi, '')
|
|
55
|
+
// Remove javascript: protocol
|
|
56
|
+
.replace(/javascript:/gi, '')
|
|
57
|
+
// Remove import statements in style
|
|
58
|
+
.replace(/@import/gi, ''));
|
|
59
|
+
}
|
|
60
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: IconService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
61
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: IconService, providedIn: 'root' });
|
|
62
|
+
}
|
|
63
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: IconService, decorators: [{
|
|
64
|
+
type: Injectable,
|
|
65
|
+
args: [{ providedIn: 'root' }]
|
|
66
|
+
}] });
|
|
67
|
+
|
|
68
|
+
class Icon {
|
|
69
|
+
// Injections
|
|
70
|
+
_iconService = inject(IconService);
|
|
71
|
+
_config = inject(ICON_CONFIG);
|
|
72
|
+
// Inputs
|
|
73
|
+
iconSrc = input.required(...(ngDevMode ? [{ debugName: "iconSrc" }] : []));
|
|
74
|
+
alt = input('', ...(ngDevMode ? [{ debugName: "alt" }] : []));
|
|
75
|
+
allowedSources = input(this._config.allowedSources, ...(ngDevMode ? [{ debugName: "allowedSources" }] : []));
|
|
76
|
+
isSvg = computed(() => {
|
|
77
|
+
return this.iconSrc().endsWith('.svg');
|
|
78
|
+
}, ...(ngDevMode ? [{ debugName: "isSvg" }] : []));
|
|
79
|
+
_svgContentResource = rxResource({
|
|
80
|
+
defaultValue: '',
|
|
81
|
+
params: () => ({
|
|
82
|
+
iconSrc: this.iconSrc(),
|
|
83
|
+
allowedSources: this.allowedSources(),
|
|
84
|
+
}),
|
|
85
|
+
stream: params => this._iconService.getSvgContent(params.params.iconSrc, params.params.allowedSources),
|
|
86
|
+
});
|
|
87
|
+
// Accessors
|
|
88
|
+
get svgContent() {
|
|
89
|
+
return this._svgContentResource.value.asReadonly();
|
|
90
|
+
}
|
|
91
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Icon, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
92
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: Icon, isStandalone: true, selector: "tls-icon", inputs: { iconSrc: { classPropertyName: "iconSrc", publicName: "iconSrc", isSignal: true, isRequired: true, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, allowedSources: { classPropertyName: "allowedSources", publicName: "allowedSources", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (isSvg() && iconSrc()) {\n <span [innerHTML]=\"svgContent()\" class=\"tls-svg-icon\"></span>\n} @else if (iconSrc()) {\n <img [src]=\"iconSrc()\" [alt]=\"alt()\" class=\"tls-img-icon\" />\n} @else {\n {{ iconSrc() }}\n}\n", styles: [":host{width:auto;height:auto;min-width:auto;min-height:auto;display:inline-block;color:inherit}:host .tls-svg-icon{color:inherit}\n"] });
|
|
93
|
+
}
|
|
94
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Icon, decorators: [{
|
|
95
|
+
type: Component,
|
|
96
|
+
args: [{ selector: 'tls-icon', imports: [], template: "@if (isSvg() && iconSrc()) {\n <span [innerHTML]=\"svgContent()\" class=\"tls-svg-icon\"></span>\n} @else if (iconSrc()) {\n <img [src]=\"iconSrc()\" [alt]=\"alt()\" class=\"tls-img-icon\" />\n} @else {\n {{ iconSrc() }}\n}\n", styles: [":host{width:auto;height:auto;min-width:auto;min-height:auto;display:inline-block;color:inherit}:host .tls-svg-icon{color:inherit}\n"] }]
|
|
97
|
+
}], propDecorators: { iconSrc: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconSrc", required: true }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], allowedSources: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowedSources", required: false }] }] } });
|
|
98
|
+
|
|
99
|
+
const DEFAULT_BUTTON_CONFIG = {
|
|
100
|
+
color: 'primary',
|
|
101
|
+
appearance: 'filled',
|
|
102
|
+
size: 'md',
|
|
103
|
+
type: 'button',
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const BUTTON_CONFIG = new InjectionToken('BUTTON_CONFIG', {
|
|
107
|
+
factory: () => DEFAULT_BUTTON_CONFIG,
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
class Button {
|
|
111
|
+
// Injections
|
|
112
|
+
_routerLink = inject(RouterLink, { optional: true });
|
|
113
|
+
_config = inject(BUTTON_CONFIG);
|
|
114
|
+
// Inputs
|
|
115
|
+
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
116
|
+
type = input(this._config.type, ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
117
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
118
|
+
icon = input(false, { ...(ngDevMode ? { debugName: "icon" } : {}), transform: (value) => {
|
|
119
|
+
if (typeof value === 'string' && value === '')
|
|
120
|
+
return true;
|
|
121
|
+
else if (typeof value === 'string')
|
|
122
|
+
return value;
|
|
123
|
+
else
|
|
124
|
+
return booleanAttribute(value);
|
|
125
|
+
} });
|
|
126
|
+
color = input(this._config.color, ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
127
|
+
appearance = input(this._config.appearance, ...(ngDevMode ? [{ debugName: "appearance" }] : []));
|
|
128
|
+
size = input(this._config.size, ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
129
|
+
href = input(null, ...(ngDevMode ? [{ debugName: "href" }] : []));
|
|
130
|
+
tabindex = input('0', ...(ngDevMode ? [{ debugName: "tabindex" }] : []));
|
|
131
|
+
// Computed
|
|
132
|
+
isLink = computed(() => Boolean(this._routerLink || this.href()), ...(ngDevMode ? [{ debugName: "isLink" }] : []));
|
|
133
|
+
isIconString = computed(() => typeof this.icon() === 'string', ...(ngDevMode ? [{ debugName: "isIconString" }] : []));
|
|
134
|
+
classes = computed(() => {
|
|
135
|
+
const className = 'tls-button';
|
|
136
|
+
const array = [className];
|
|
137
|
+
array.push(`${className}--${this.color()}`);
|
|
138
|
+
array.push(`${className}--${this.appearance()}`);
|
|
139
|
+
array.push(`${className}--${this.size()}`);
|
|
140
|
+
if (this.disabled())
|
|
141
|
+
array.push(`${className}--disabled`);
|
|
142
|
+
if (this.icon())
|
|
143
|
+
array.push(`${className}--icon-only`);
|
|
144
|
+
return array;
|
|
145
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : []));
|
|
146
|
+
String = String;
|
|
147
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Button, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
148
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: Button, isStandalone: true, selector: "tls-button", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, href: { classPropertyName: "href", publicName: "href", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "tabindex": "-1" } }, ngImport: i0, template: "@if (isLink()) {\r\n <a\r\n role=\"link\"\r\n [class]=\"classes()\"\r\n [href]=\"href()\"\r\n [tabindex]=\"tabindex()\"\r\n [attr.aria-disabled]=\"disabled()\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"></ng-container>\r\n </a>\r\n} @else {\r\n <button\r\n role=\"button\"\r\n [class]=\"classes()\"\r\n [type]=\"type()\"\r\n [tabindex]=\"tabindex()\"\r\n [disabled]=\"disabled()\"\r\n [attr.aria-disabled]=\"disabled()\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"></ng-container>\r\n </button>\r\n}\r\n\r\n<!-- Content -->\r\n<ng-template #contentTemplate>\r\n <span class=\"tls-button__content\">\r\n @if (icon()) {\r\n @if (isIconString()) {\r\n <tls-icon [iconSrc]=\"String(icon())\" />\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"projectedContentTemplate\"></ng-container>\r\n }\r\n } @else {\r\n @if (label()) {\r\n {{ label() }}\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"projectedContentTemplate\"></ng-container>\r\n }\r\n }\r\n </span>\r\n <div class=\"tls-button__background\"></div>\r\n</ng-template>\r\n\r\n<ng-template #projectedContentTemplate>\r\n <ng-content></ng-content>\r\n</ng-template>\r\n", styles: [":host{width:fit-content;display:inline-block;--tls-button-border-width: 1px}:host:focus-visible{outline:none}:host .tls-button{position:relative;display:inline-flex;justify-content:center;align-items:center;gap:.25rem;border:var(--tls-button-border-width) solid var(--tls-button-color);border-radius:var(--radius-md);cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color var(--motion-fast) var(--motion-ease-in-out)}:host .tls-button:focus-visible{outline:var(--control-focus-ring-width) solid var(--control-focus-ring-color);outline-offset:var(--control-focus-ring-offset)}:host .tls-button__content{z-index:1;display:flex;align-items:center;transition:color var(--motion-fast) var(--motion-ease-in-out)}:host .tls-button__background{position:absolute;inset:0;border-radius:inherit;transition:background-color var(--motion-fast) var(--motion-ease-in-out),opacity var(--motion-fast) var(--motion-ease-in-out)}\n", ":host .tls-button--filled .tls-button__content{color:var(--tls-button-on-color)}:host .tls-button--filled .tls-button__background{background-color:var(--tls-button-color)}:host .tls-button--filled:not(.tls-button--disabled):hover .tls-button__background,:host .tls-button--filled:not(.tls-button--disabled):focus-visible .tls-button__background{opacity:.85}:host .tls-button--filled:not(.tls-button--disabled):active .tls-button__background{opacity:.75}:host .tls-button--outlined .tls-button__content{color:var(--tls-button-color)}:host .tls-button--outlined .tls-button__background{background-color:var(--tls-button-color);opacity:0}:host .tls-button--outlined:not(.tls-button--disabled):hover .tls-button__background,:host .tls-button--outlined:not(.tls-button--disabled):focus-visible .tls-button__background{opacity:.075}:host .tls-button--outlined:not(.tls-button--disabled):active .tls-button__background{opacity:.15}:host .tls-button--text{border-color:transparent}:host .tls-button--text .tls-button__content{color:var(--tls-button-color)}:host .tls-button--text .tls-button__background{background-color:var(--tls-button-color);opacity:0}:host .tls-button--text:not(.tls-button--disabled):hover .tls-button__background,:host .tls-button--text:not(.tls-button--disabled):focus-visible .tls-button__background{opacity:.075}:host .tls-button--text:not(.tls-button--disabled):active .tls-button__background{opacity:.15}:host .tls-button--elevated{border:none;box-shadow:var(--shadow-sm);transition:box-shadow var(--motion-fast) var(--motion-ease-in-out)}:host .tls-button--elevated .tls-button__content{color:var(--tls-button-color)}:host .tls-button--elevated .tls-button__background{background-color:var(--tls-button-color);opacity:0}:host .tls-button--elevated:not(.tls-button--disabled){padding-inline:calc(var(--tls-button-padding-inline) + var(--tls-button-border-width))}:host .tls-button--elevated:not(.tls-button--disabled):hover,:host .tls-button--elevated:not(.tls-button--disabled):focus-visible{box-shadow:var(--shadow-md)}:host .tls-button--elevated:not(.tls-button--disabled):hover .tls-button__background,:host .tls-button--elevated:not(.tls-button--disabled):focus-visible .tls-button__background{opacity:.075}:host .tls-button--elevated:not(.tls-button--disabled):active{box-shadow:var(--shadow-sm)}:host .tls-button--elevated:not(.tls-button--disabled):active .tls-button__background{opacity:.15}:host .tls-button--disabled{cursor:not-allowed;border:var(--tls-button-border-width) solid var(--color-outline);box-shadow:none}:host .tls-button--disabled .tls-button__content{color:var(--tls-button-on-color)}:host .tls-button--disabled .tls-button__background{opacity:1;transition:none}\n", ":host:has(.tls-button.tls-button--primary){--tls-button-on-color: var(--color-on-primary);--tls-button-color: var(--color-primary)}:host:has(.tls-button.tls-button--secondary){--tls-button-on-color: var(--color-on-secondary);--tls-button-color: var(--color-secondary)}:host:has(.tls-button.tls-button--tertiary){--tls-button-on-color: var(--color-on-tertiary);--tls-button-color: var(--color-tertiary)}:host:has(.tls-button.tls-button--success){--tls-button-on-color: var(--color-on-success);--tls-button-color: var(--color-success)}:host:has(.tls-button.tls-button--info){--tls-button-on-color: var(--color-on-info);--tls-button-color: var(--color-info)}:host:has(.tls-button.tls-button--warning){--tls-button-on-color: var(--color-on-warning);--tls-button-color: var(--color-warning)}:host:has(.tls-button.tls-button--danger){--tls-button-on-color: var(--color-on-danger);--tls-button-color: var(--color-danger)}:host:has(.tls-button.tls-button--disabled){--tls-button-on-color: var(--color-on-surface-variant);--tls-button-color: var(--color-surface-variant)}\n", ":host .tls-button{height:var(--tls-button-height);padding-inline:var(--tls-button-padding-inline);font-size:var(--tls-button-font-size);font-weight:var(--tls-button-font-weight);line-height:var(--tls-button-line-height);letter-spacing:var(--tls-button-letter-spacing)}:host .tls-button.tls-button--icon-only{padding-inline:0;aspect-ratio:1/1}:host:has(.tls-button.tls-button--sm){--tls-button-height: var(--control-height-sm);--tls-button-padding-inline: var(--spacing-3);--tls-button-font-size: var(--font-label-small-size);--tls-button-font-weight: var(--font-label-small-weight);--tls-button-line-height: var(--font-label-small-line-height);--tls-button-letter-spacing: var(--font-label-small-letter-spacing)}:host:has(.tls-button.tls-button--md){--tls-button-height: var(--control-height-md);--tls-button-padding-inline: var(--spacing-4);--tls-button-font-size: var(--font-label-medium-size);--tls-button-font-weight: var(--font-label-medium-weight);--tls-button-line-height: var(--font-label-medium-line-height);--tls-button-letter-spacing: var(--font-label-medium-letter-spacing)}:host:has(.tls-button.tls-button--lg){--tls-button-height: var(--control-height-lg);--tls-button-padding-inline: var(--spacing-5);--tls-button-font-size: var(--font-label-large-size);--tls-button-font-weight: var(--font-label-large-weight);--tls-button-line-height: var(--font-label-large-line-height);--tls-button-letter-spacing: var(--font-label-large-letter-spacing)}\n"], dependencies: [{ kind: "component", type: Icon, selector: "tls-icon", inputs: ["iconSrc", "alt", "allowedSources"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] });
|
|
149
|
+
}
|
|
150
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Button, decorators: [{
|
|
151
|
+
type: Component,
|
|
152
|
+
args: [{ selector: 'tls-button', imports: [Icon, NgTemplateOutlet], host: {
|
|
153
|
+
'[tabindex]': '-1',
|
|
154
|
+
}, template: "@if (isLink()) {\r\n <a\r\n role=\"link\"\r\n [class]=\"classes()\"\r\n [href]=\"href()\"\r\n [tabindex]=\"tabindex()\"\r\n [attr.aria-disabled]=\"disabled()\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"></ng-container>\r\n </a>\r\n} @else {\r\n <button\r\n role=\"button\"\r\n [class]=\"classes()\"\r\n [type]=\"type()\"\r\n [tabindex]=\"tabindex()\"\r\n [disabled]=\"disabled()\"\r\n [attr.aria-disabled]=\"disabled()\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"></ng-container>\r\n </button>\r\n}\r\n\r\n<!-- Content -->\r\n<ng-template #contentTemplate>\r\n <span class=\"tls-button__content\">\r\n @if (icon()) {\r\n @if (isIconString()) {\r\n <tls-icon [iconSrc]=\"String(icon())\" />\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"projectedContentTemplate\"></ng-container>\r\n }\r\n } @else {\r\n @if (label()) {\r\n {{ label() }}\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"projectedContentTemplate\"></ng-container>\r\n }\r\n }\r\n </span>\r\n <div class=\"tls-button__background\"></div>\r\n</ng-template>\r\n\r\n<ng-template #projectedContentTemplate>\r\n <ng-content></ng-content>\r\n</ng-template>\r\n", styles: [":host{width:fit-content;display:inline-block;--tls-button-border-width: 1px}:host:focus-visible{outline:none}:host .tls-button{position:relative;display:inline-flex;justify-content:center;align-items:center;gap:.25rem;border:var(--tls-button-border-width) solid var(--tls-button-color);border-radius:var(--radius-md);cursor:pointer;-webkit-user-select:none;user-select:none;transition:border-color var(--motion-fast) var(--motion-ease-in-out)}:host .tls-button:focus-visible{outline:var(--control-focus-ring-width) solid var(--control-focus-ring-color);outline-offset:var(--control-focus-ring-offset)}:host .tls-button__content{z-index:1;display:flex;align-items:center;transition:color var(--motion-fast) var(--motion-ease-in-out)}:host .tls-button__background{position:absolute;inset:0;border-radius:inherit;transition:background-color var(--motion-fast) var(--motion-ease-in-out),opacity var(--motion-fast) var(--motion-ease-in-out)}\n", ":host .tls-button--filled .tls-button__content{color:var(--tls-button-on-color)}:host .tls-button--filled .tls-button__background{background-color:var(--tls-button-color)}:host .tls-button--filled:not(.tls-button--disabled):hover .tls-button__background,:host .tls-button--filled:not(.tls-button--disabled):focus-visible .tls-button__background{opacity:.85}:host .tls-button--filled:not(.tls-button--disabled):active .tls-button__background{opacity:.75}:host .tls-button--outlined .tls-button__content{color:var(--tls-button-color)}:host .tls-button--outlined .tls-button__background{background-color:var(--tls-button-color);opacity:0}:host .tls-button--outlined:not(.tls-button--disabled):hover .tls-button__background,:host .tls-button--outlined:not(.tls-button--disabled):focus-visible .tls-button__background{opacity:.075}:host .tls-button--outlined:not(.tls-button--disabled):active .tls-button__background{opacity:.15}:host .tls-button--text{border-color:transparent}:host .tls-button--text .tls-button__content{color:var(--tls-button-color)}:host .tls-button--text .tls-button__background{background-color:var(--tls-button-color);opacity:0}:host .tls-button--text:not(.tls-button--disabled):hover .tls-button__background,:host .tls-button--text:not(.tls-button--disabled):focus-visible .tls-button__background{opacity:.075}:host .tls-button--text:not(.tls-button--disabled):active .tls-button__background{opacity:.15}:host .tls-button--elevated{border:none;box-shadow:var(--shadow-sm);transition:box-shadow var(--motion-fast) var(--motion-ease-in-out)}:host .tls-button--elevated .tls-button__content{color:var(--tls-button-color)}:host .tls-button--elevated .tls-button__background{background-color:var(--tls-button-color);opacity:0}:host .tls-button--elevated:not(.tls-button--disabled){padding-inline:calc(var(--tls-button-padding-inline) + var(--tls-button-border-width))}:host .tls-button--elevated:not(.tls-button--disabled):hover,:host .tls-button--elevated:not(.tls-button--disabled):focus-visible{box-shadow:var(--shadow-md)}:host .tls-button--elevated:not(.tls-button--disabled):hover .tls-button__background,:host .tls-button--elevated:not(.tls-button--disabled):focus-visible .tls-button__background{opacity:.075}:host .tls-button--elevated:not(.tls-button--disabled):active{box-shadow:var(--shadow-sm)}:host .tls-button--elevated:not(.tls-button--disabled):active .tls-button__background{opacity:.15}:host .tls-button--disabled{cursor:not-allowed;border:var(--tls-button-border-width) solid var(--color-outline);box-shadow:none}:host .tls-button--disabled .tls-button__content{color:var(--tls-button-on-color)}:host .tls-button--disabled .tls-button__background{opacity:1;transition:none}\n", ":host:has(.tls-button.tls-button--primary){--tls-button-on-color: var(--color-on-primary);--tls-button-color: var(--color-primary)}:host:has(.tls-button.tls-button--secondary){--tls-button-on-color: var(--color-on-secondary);--tls-button-color: var(--color-secondary)}:host:has(.tls-button.tls-button--tertiary){--tls-button-on-color: var(--color-on-tertiary);--tls-button-color: var(--color-tertiary)}:host:has(.tls-button.tls-button--success){--tls-button-on-color: var(--color-on-success);--tls-button-color: var(--color-success)}:host:has(.tls-button.tls-button--info){--tls-button-on-color: var(--color-on-info);--tls-button-color: var(--color-info)}:host:has(.tls-button.tls-button--warning){--tls-button-on-color: var(--color-on-warning);--tls-button-color: var(--color-warning)}:host:has(.tls-button.tls-button--danger){--tls-button-on-color: var(--color-on-danger);--tls-button-color: var(--color-danger)}:host:has(.tls-button.tls-button--disabled){--tls-button-on-color: var(--color-on-surface-variant);--tls-button-color: var(--color-surface-variant)}\n", ":host .tls-button{height:var(--tls-button-height);padding-inline:var(--tls-button-padding-inline);font-size:var(--tls-button-font-size);font-weight:var(--tls-button-font-weight);line-height:var(--tls-button-line-height);letter-spacing:var(--tls-button-letter-spacing)}:host .tls-button.tls-button--icon-only{padding-inline:0;aspect-ratio:1/1}:host:has(.tls-button.tls-button--sm){--tls-button-height: var(--control-height-sm);--tls-button-padding-inline: var(--spacing-3);--tls-button-font-size: var(--font-label-small-size);--tls-button-font-weight: var(--font-label-small-weight);--tls-button-line-height: var(--font-label-small-line-height);--tls-button-letter-spacing: var(--font-label-small-letter-spacing)}:host:has(.tls-button.tls-button--md){--tls-button-height: var(--control-height-md);--tls-button-padding-inline: var(--spacing-4);--tls-button-font-size: var(--font-label-medium-size);--tls-button-font-weight: var(--font-label-medium-weight);--tls-button-line-height: var(--font-label-medium-line-height);--tls-button-letter-spacing: var(--font-label-medium-letter-spacing)}:host:has(.tls-button.tls-button--lg){--tls-button-height: var(--control-height-lg);--tls-button-padding-inline: var(--spacing-5);--tls-button-font-size: var(--font-label-large-size);--tls-button-font-weight: var(--font-label-large-weight);--tls-button-line-height: var(--font-label-large-line-height);--tls-button-letter-spacing: var(--font-label-large-letter-spacing)}\n"] }]
|
|
155
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], href: [{ type: i0.Input, args: [{ isSignal: true, alias: "href", required: false }] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", required: false }] }] } });
|
|
156
|
+
|
|
157
|
+
class FormControl {
|
|
158
|
+
// Models
|
|
159
|
+
touched = model(false, ...(ngDevMode ? [{ debugName: "touched" }] : []));
|
|
160
|
+
// Inputs
|
|
161
|
+
name = input('', ...(ngDevMode ? [{ debugName: "name" }] : []));
|
|
162
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : {}), transform: booleanAttribute });
|
|
163
|
+
readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : {}), transform: booleanAttribute });
|
|
164
|
+
hidden = input(false, { ...(ngDevMode ? { debugName: "hidden" } : {}), transform: booleanAttribute });
|
|
165
|
+
invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : {}), transform: booleanAttribute });
|
|
166
|
+
pending = input(false, { ...(ngDevMode ? { debugName: "pending" } : {}), transform: booleanAttribute });
|
|
167
|
+
dirty = input(false, { ...(ngDevMode ? { debugName: "dirty" } : {}), transform: booleanAttribute });
|
|
168
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : []));
|
|
169
|
+
required = input(false, { ...(ngDevMode ? { debugName: "required" } : {}), transform: booleanAttribute });
|
|
170
|
+
notInteractive = computed(() => this.disabled() || this.readonly(), ...(ngDevMode ? [{ debugName: "notInteractive" }] : []));
|
|
171
|
+
controlClasses = computed(() => {
|
|
172
|
+
const className = 'tls-form-control';
|
|
173
|
+
const array = [className];
|
|
174
|
+
if (this.disabled())
|
|
175
|
+
array.push(`${className}--disabled`);
|
|
176
|
+
if (this.readonly())
|
|
177
|
+
array.push(`${className}--readonly`);
|
|
178
|
+
if (this.invalid())
|
|
179
|
+
array.push(`${className}--invalid`);
|
|
180
|
+
if (this.pending())
|
|
181
|
+
array.push(`${className}--pending`);
|
|
182
|
+
if (this.dirty())
|
|
183
|
+
array.push(`${className}--dirty`);
|
|
184
|
+
return array;
|
|
185
|
+
}, ...(ngDevMode ? [{ debugName: "controlClasses" }] : []));
|
|
186
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: FormControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
187
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.1", type: FormControl, isStandalone: true, inputs: { touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, hidden: { classPropertyName: "hidden", publicName: "hidden", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, pending: { classPropertyName: "pending", publicName: "pending", isSignal: true, isRequired: false, transformFunction: null }, dirty: { classPropertyName: "dirty", publicName: "dirty", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { touched: "touchedChange" }, ngImport: i0 });
|
|
188
|
+
}
|
|
189
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: FormControl, decorators: [{
|
|
190
|
+
type: Directive
|
|
191
|
+
}], propDecorators: { touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], hidden: [{ type: i0.Input, args: [{ isSignal: true, alias: "hidden", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], pending: [{ type: i0.Input, args: [{ isSignal: true, alias: "pending", required: false }] }], dirty: [{ type: i0.Input, args: [{ isSignal: true, alias: "dirty", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }] } });
|
|
192
|
+
|
|
193
|
+
class CheckboxFormControl extends FormControl {
|
|
194
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: CheckboxFormControl, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
195
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.1", type: CheckboxFormControl, isStandalone: true, usesInheritance: true, ngImport: i0 });
|
|
196
|
+
}
|
|
197
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: CheckboxFormControl, decorators: [{
|
|
198
|
+
type: Directive
|
|
199
|
+
}] });
|
|
200
|
+
|
|
201
|
+
class ValueFormControl extends FormControl {
|
|
202
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ValueFormControl, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
203
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.1", type: ValueFormControl, isStandalone: true, usesInheritance: true, ngImport: i0 });
|
|
204
|
+
}
|
|
205
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ValueFormControl, decorators: [{
|
|
206
|
+
type: Directive
|
|
207
|
+
}] });
|
|
208
|
+
|
|
209
|
+
const DEFAULT_INPUT_CONFIG = {
|
|
210
|
+
size: 'md',
|
|
211
|
+
type: 'text',
|
|
212
|
+
placeholder: '',
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const INPUT_CONFIG = new InjectionToken('INPUT_CONFIG', {
|
|
216
|
+
factory: () => DEFAULT_INPUT_CONFIG,
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
class Input extends ValueFormControl {
|
|
220
|
+
// Injections
|
|
221
|
+
_config = inject(INPUT_CONFIG);
|
|
222
|
+
// Inputs
|
|
223
|
+
type = input(this._config.type, ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
224
|
+
value = model('', ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
225
|
+
inputId = input(null, ...(ngDevMode ? [{ debugName: "inputId" }] : []));
|
|
226
|
+
placeholder = input(this._config.placeholder, ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
227
|
+
size = input(this._config.size, ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
228
|
+
classes = computed(() => {
|
|
229
|
+
const className = 'tls-form-field';
|
|
230
|
+
const array = [className];
|
|
231
|
+
array.push(`${className}--${this.size()}`);
|
|
232
|
+
return array.concat(this.controlClasses());
|
|
233
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : []));
|
|
234
|
+
// Protected methods
|
|
235
|
+
onInput(event) {
|
|
236
|
+
const target = event.target;
|
|
237
|
+
this.value.set(target.value);
|
|
238
|
+
}
|
|
239
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Input, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
240
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", type: Input, isStandalone: true, selector: "tls-input", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, usesInheritance: true, ngImport: i0, template: "<input\r\n [type]=\"type()\"\r\n [class]=\"classes()\"\r\n [attr.id]=\"inputId()\"\r\n [placeholder]=\"placeholder()\"\r\n [disabled]=\"disabled()\"\r\n [readonly]=\"readonly()\"\r\n [value]=\"value()\"\r\n (input)=\"onInput($event)\"\r\n>\r\n", styles: [":host{display:inline-block}\n"] });
|
|
241
|
+
}
|
|
242
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Input, decorators: [{
|
|
243
|
+
type: Component,
|
|
244
|
+
args: [{ selector: 'tls-input', template: "<input\r\n [type]=\"type()\"\r\n [class]=\"classes()\"\r\n [attr.id]=\"inputId()\"\r\n [placeholder]=\"placeholder()\"\r\n [disabled]=\"disabled()\"\r\n [readonly]=\"readonly()\"\r\n [value]=\"value()\"\r\n (input)=\"onInput($event)\"\r\n>\r\n", styles: [":host{display:inline-block}\n"] }]
|
|
245
|
+
}], propDecorators: { type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
246
|
+
|
|
247
|
+
class InputDirective {
|
|
248
|
+
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
249
|
+
classes = computed(() => {
|
|
250
|
+
const className = 'tls-form-field';
|
|
251
|
+
const array = [className];
|
|
252
|
+
array.push(`${className}--${this.size()}`);
|
|
253
|
+
return array;
|
|
254
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : []));
|
|
255
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: InputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
256
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.1", type: InputDirective, isStandalone: true, selector: "[tlsInput]", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, ngImport: i0 });
|
|
257
|
+
}
|
|
258
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: InputDirective, decorators: [{
|
|
259
|
+
type: Directive,
|
|
260
|
+
args: [{
|
|
261
|
+
selector: '[tlsInput]',
|
|
262
|
+
host: {
|
|
263
|
+
'[class]': 'classes()',
|
|
264
|
+
},
|
|
265
|
+
}]
|
|
266
|
+
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
267
|
+
|
|
268
|
+
const DEFAULT_PASSWORD_CONFIG = {
|
|
269
|
+
size: 'md',
|
|
270
|
+
placeholder: '',
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
const PASSWORD_CONFIG = new InjectionToken('PASSWORD_CONFIG', {
|
|
274
|
+
factory: () => DEFAULT_PASSWORD_CONFIG,
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
class Password extends ValueFormControl {
|
|
278
|
+
_config = inject(PASSWORD_CONFIG);
|
|
279
|
+
value = model('', ...(ngDevMode ? [{ debugName: "value" }] : []));
|
|
280
|
+
visible = model(false, ...(ngDevMode ? [{ debugName: "visible" }] : []));
|
|
281
|
+
inputId = input(null, ...(ngDevMode ? [{ debugName: "inputId" }] : []));
|
|
282
|
+
placeholder = input(this._config.placeholder, ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
283
|
+
size = input(this._config.size, ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
284
|
+
classes = computed(() => {
|
|
285
|
+
const className = 'tls-form-field-group';
|
|
286
|
+
const array = [className];
|
|
287
|
+
array.push(`${className}--${this.size()}`);
|
|
288
|
+
return array.concat(this.controlClasses());
|
|
289
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : []));
|
|
290
|
+
type = computed(() => (this.visible() ? 'text' : 'password'), ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
291
|
+
// Protected methods
|
|
292
|
+
onInput(event) {
|
|
293
|
+
const target = event.target;
|
|
294
|
+
this.value.set(target.value);
|
|
295
|
+
}
|
|
296
|
+
toggle() {
|
|
297
|
+
if (this.notInteractive())
|
|
298
|
+
return;
|
|
299
|
+
this.visible.update(prev => !prev);
|
|
300
|
+
}
|
|
301
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Password, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
302
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", type: Password, isStandalone: true, selector: "tls-password", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", visible: "visibleChange" }, host: { properties: { "class": "classes()" } }, usesInheritance: true, ngImport: i0, template: "<input\r\n class=\"tls-form-field\"\r\n [type]=\"type()\"\r\n [attr.id]=\"inputId()\"\r\n [placeholder]=\"placeholder()\"\r\n [disabled]=\"disabled()\"\r\n [readonly]=\"readonly()\"\r\n [value]=\"value()\"\r\n (input)=\"onInput($event)\"\r\n>\r\n<button class=\"tls-password-toggle tls-form-field-addon\" (click)=\"toggle()\">\r\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"visible()\">\r\n <span class=\"text-label-md\">Show</span>\r\n </span>\r\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"!visible()\">\r\n <span class=\"text-label-md\">Hide</span>\r\n </span>\r\n</button>\r\n", styles: [":host{display:inline-flex}:host .tls-password-toggle{display:grid;align-items:center}:host .tls-password-toggle:focus-visible{outline:var(--control-focus-ring-width) solid var(--control-focus-ring-color);outline-offset:var(--control-focus-ring-offset);border-radius:var(--radius-md)}:host .tls-password-toggle__item{grid-area:1/1;text-align:center}:host .tls-password-toggle__item--hidden{visibility:hidden}\n"] });
|
|
303
|
+
}
|
|
304
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Password, decorators: [{
|
|
305
|
+
type: Component,
|
|
306
|
+
args: [{ selector: 'tls-password', host: {
|
|
307
|
+
'[class]': 'classes()',
|
|
308
|
+
}, template: "<input\r\n class=\"tls-form-field\"\r\n [type]=\"type()\"\r\n [attr.id]=\"inputId()\"\r\n [placeholder]=\"placeholder()\"\r\n [disabled]=\"disabled()\"\r\n [readonly]=\"readonly()\"\r\n [value]=\"value()\"\r\n (input)=\"onInput($event)\"\r\n>\r\n<button class=\"tls-password-toggle tls-form-field-addon\" (click)=\"toggle()\">\r\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"visible()\">\r\n <span class=\"text-label-md\">Show</span>\r\n </span>\r\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"!visible()\">\r\n <span class=\"text-label-md\">Hide</span>\r\n </span>\r\n</button>\r\n", styles: [":host{display:inline-flex}:host .tls-password-toggle{display:grid;align-items:center}:host .tls-password-toggle:focus-visible{outline:var(--control-focus-ring-width) solid var(--control-focus-ring-color);outline-offset:var(--control-focus-ring-offset);border-radius:var(--radius-md)}:host .tls-password-toggle__item{grid-area:1/1;text-align:center}:host .tls-password-toggle__item--hidden{visibility:hidden}\n"] }]
|
|
309
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
310
|
+
|
|
311
|
+
const DEFAULT_SWITCH_CONFIG = {
|
|
312
|
+
color: 'primary',
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
const SWITCH_CONFIG = new InjectionToken('SWITCH_CONFIG', {
|
|
316
|
+
factory: () => DEFAULT_SWITCH_CONFIG,
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
class Switch extends CheckboxFormControl {
|
|
320
|
+
_config = inject(SWITCH_CONFIG);
|
|
321
|
+
checked = model(false, ...(ngDevMode ? [{ debugName: "checked" }] : []));
|
|
322
|
+
inputId = input(...(ngDevMode ? [undefined, { debugName: "inputId" }] : []));
|
|
323
|
+
color = input(this._config.color, ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
324
|
+
tabindex = input(0, ...(ngDevMode ? [{ debugName: "tabindex" }] : []));
|
|
325
|
+
classes = computed(() => {
|
|
326
|
+
const className = 'tls-switch';
|
|
327
|
+
const array = [className];
|
|
328
|
+
array.push(`${className}--${this.color()}`);
|
|
329
|
+
if (this.checked())
|
|
330
|
+
array.push(`${className}--checked`);
|
|
331
|
+
return array.concat(this.controlClasses());
|
|
332
|
+
}, ...(ngDevMode ? [{ debugName: "classes" }] : []));
|
|
333
|
+
// Protected methods
|
|
334
|
+
toggle() {
|
|
335
|
+
if (this.notInteractive())
|
|
336
|
+
return;
|
|
337
|
+
this.checked.update(prev => !prev);
|
|
338
|
+
}
|
|
339
|
+
onKeyboardToggle(event) {
|
|
340
|
+
event.preventDefault();
|
|
341
|
+
this.toggle();
|
|
342
|
+
}
|
|
343
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Switch, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
344
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.1", type: Switch, isStandalone: true, selector: "tls-switch", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, tabindex: { classPropertyName: "tabindex", publicName: "tabindex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange" }, host: { attributes: { "role": "switch" }, listeners: { "click": "toggle()", "keydown.space": "onKeyboardToggle($event)", "keydown.enter": "onKeyboardToggle($event)" }, properties: { "class": "classes()", "tabindex": "disabled() ? -1 : tabindex()", "attr.aria-checked": "checked()", "attr.aria-disabled": "disabled()", "attr.aria-readonly": "readonly()" } }, usesInheritance: true, ngImport: i0, template: "<input\r\n type=\"checkbox\"\r\n class=\"tls-switch-input\"\r\n [id]=\"inputId()\"\r\n [disabled]=\"disabled()\"\r\n [readonly]=\"readonly()\"\r\n [checked]=\"checked()\"\r\n/>\r\n<div class=\"tls-switch-handle\"></div>\r\n", styles: [":host{--tls-switch-width: 48px;--tls-switch-height: var(--control-height-sm);--tls-switch-handle-gap: 4px;--tls-switch-handle-size: calc( var(--tls-switch-height) - (var(--tls-switch-handle-gap) * 2) - (var(--tls-switch-border-width) * 2) );--tls-switch-border-width: 2px;--tls-switch-border-radius: 24px;--tls-switch-color: var(--color-surface-variant);--tls-switch-on-color: var(--color-surface);--tls-switch-border-color: var(--tls-switch-color);width:var(--tls-switch-width);height:var(--tls-switch-height);display:flex;border:var(--tls-switch-border-width) solid var(--tls-switch-border-color);border-radius:var(--tls-switch-border-radius);background-color:var(--tls-switch-color);cursor:pointer;transition:background-color var(--motion-fast) var(--motion-ease-in-out),border-color var(--motion-fast) var(--motion-ease-in-out),filter var(--motion-fast) var(--motion-ease-in-out)}:host:focus-visible{outline:var(--control-focus-ring-width) solid var(--control-focus-ring-color);outline-offset:var(--control-focus-ring-offset)}:host .tls-switch-input{display:none}:host .tls-switch-handle{width:var(--tls-switch-handle-size);height:var(--tls-switch-handle-size);margin:calc(var(--tls-switch-handle-gap));border-radius:50%;background-color:var(--tls-switch-on-color);box-shadow:var(--shadow-xs);transition:transform var(--motion-fast) var(--motion-ease-in-out)}:host.tls-switch--checked{--tls-switch-handle-gap: 3px}:host.tls-switch--checked .tls-switch-handle{transform:translate(calc(var(--tls-switch-width) - var(--tls-switch-handle-size) - var(--tls-switch-handle-gap) * 2 - var(--tls-switch-border-width) * 2))}:host.tls-switch.tls-form-control--disabled{cursor:not-allowed;filter:brightness(.9)}:host.tls-form-control--dirty.tls-form-control--invalid{--tls-switch-border-color: var(--color-danger)}\n", ":host.tls-switch--checked.tls-switch--primary{--tls-switch-color: var(--color-primary);--tls-switch-on-color: var(--color-on-primary)}:host.tls-switch--checked.tls-switch--secondary{--tls-switch-color: var(--color-secondary);--tls-switch-on-color: var(--color-on-secondary)}:host.tls-switch--checked.tls-switch--tertiary{--tls-switch-color: var(--color-tertiary);--tls-switch-on-color: var(--color-on-tertiary)}:host.tls-switch--checked.tls-switch--success{--tls-switch-color: var(--color-success);--tls-switch-on-color: var(--color-on-success)}:host.tls-switch--checked.tls-switch--info{--tls-switch-color: var(--color-info);--tls-switch-on-color: var(--color-on-info)}:host.tls-switch--checked.tls-switch--warning{--tls-switch-color: var(--color-warning);--tls-switch-on-color: var(--color-on-warning)}:host.tls-switch--checked.tls-switch--danger{--tls-switch-color: var(--color-danger);--tls-switch-on-color: var(--color-on-danger)}\n"] });
|
|
345
|
+
}
|
|
346
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: Switch, decorators: [{
|
|
347
|
+
type: Component,
|
|
348
|
+
args: [{ selector: 'tls-switch', host: {
|
|
349
|
+
role: 'switch',
|
|
350
|
+
'[class]': 'classes()',
|
|
351
|
+
'[tabindex]': 'disabled() ? -1 : tabindex()',
|
|
352
|
+
'[attr.aria-checked]': 'checked()',
|
|
353
|
+
'[attr.aria-disabled]': 'disabled()',
|
|
354
|
+
'[attr.aria-readonly]': 'readonly()',
|
|
355
|
+
'(click)': 'toggle()',
|
|
356
|
+
'(keydown.space)': 'onKeyboardToggle($event)',
|
|
357
|
+
'(keydown.enter)': 'onKeyboardToggle($event)',
|
|
358
|
+
}, template: "<input\r\n type=\"checkbox\"\r\n class=\"tls-switch-input\"\r\n [id]=\"inputId()\"\r\n [disabled]=\"disabled()\"\r\n [readonly]=\"readonly()\"\r\n [checked]=\"checked()\"\r\n/>\r\n<div class=\"tls-switch-handle\"></div>\r\n", styles: [":host{--tls-switch-width: 48px;--tls-switch-height: var(--control-height-sm);--tls-switch-handle-gap: 4px;--tls-switch-handle-size: calc( var(--tls-switch-height) - (var(--tls-switch-handle-gap) * 2) - (var(--tls-switch-border-width) * 2) );--tls-switch-border-width: 2px;--tls-switch-border-radius: 24px;--tls-switch-color: var(--color-surface-variant);--tls-switch-on-color: var(--color-surface);--tls-switch-border-color: var(--tls-switch-color);width:var(--tls-switch-width);height:var(--tls-switch-height);display:flex;border:var(--tls-switch-border-width) solid var(--tls-switch-border-color);border-radius:var(--tls-switch-border-radius);background-color:var(--tls-switch-color);cursor:pointer;transition:background-color var(--motion-fast) var(--motion-ease-in-out),border-color var(--motion-fast) var(--motion-ease-in-out),filter var(--motion-fast) var(--motion-ease-in-out)}:host:focus-visible{outline:var(--control-focus-ring-width) solid var(--control-focus-ring-color);outline-offset:var(--control-focus-ring-offset)}:host .tls-switch-input{display:none}:host .tls-switch-handle{width:var(--tls-switch-handle-size);height:var(--tls-switch-handle-size);margin:calc(var(--tls-switch-handle-gap));border-radius:50%;background-color:var(--tls-switch-on-color);box-shadow:var(--shadow-xs);transition:transform var(--motion-fast) var(--motion-ease-in-out)}:host.tls-switch--checked{--tls-switch-handle-gap: 3px}:host.tls-switch--checked .tls-switch-handle{transform:translate(calc(var(--tls-switch-width) - var(--tls-switch-handle-size) - var(--tls-switch-handle-gap) * 2 - var(--tls-switch-border-width) * 2))}:host.tls-switch.tls-form-control--disabled{cursor:not-allowed;filter:brightness(.9)}:host.tls-form-control--dirty.tls-form-control--invalid{--tls-switch-border-color: var(--color-danger)}\n", ":host.tls-switch--checked.tls-switch--primary{--tls-switch-color: var(--color-primary);--tls-switch-on-color: var(--color-on-primary)}:host.tls-switch--checked.tls-switch--secondary{--tls-switch-color: var(--color-secondary);--tls-switch-on-color: var(--color-on-secondary)}:host.tls-switch--checked.tls-switch--tertiary{--tls-switch-color: var(--color-tertiary);--tls-switch-on-color: var(--color-on-tertiary)}:host.tls-switch--checked.tls-switch--success{--tls-switch-color: var(--color-success);--tls-switch-on-color: var(--color-on-success)}:host.tls-switch--checked.tls-switch--info{--tls-switch-color: var(--color-info);--tls-switch-on-color: var(--color-on-info)}:host.tls-switch--checked.tls-switch--warning{--tls-switch-color: var(--color-warning);--tls-switch-on-color: var(--color-on-warning)}:host.tls-switch--checked.tls-switch--danger{--tls-switch-color: var(--color-danger);--tls-switch-on-color: var(--color-on-danger)}\n"] }]
|
|
359
|
+
}], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], inputId: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputId", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], tabindex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabindex", required: false }] }] } });
|
|
360
|
+
|
|
361
|
+
const LIGHT_THEME_CLASS = 'tls-light';
|
|
362
|
+
const DARK_THEME_CLASS = 'tls-dark';
|
|
363
|
+
|
|
364
|
+
const DEFAULT_THEME_CONFIG = {
|
|
365
|
+
defaultTheme: 'system',
|
|
366
|
+
localStorageKey: 'tls-theme',
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
const THEME_CONFIG = new InjectionToken('THEME_CONFIG', {
|
|
370
|
+
factory: () => DEFAULT_THEME_CONFIG,
|
|
371
|
+
});
|
|
372
|
+
|
|
373
|
+
class ThemeService {
|
|
374
|
+
// Injections
|
|
375
|
+
_config = inject(THEME_CONFIG);
|
|
376
|
+
_document = inject(DOCUMENT);
|
|
377
|
+
_rendererFactory = inject(RendererFactory2);
|
|
378
|
+
_platformId = inject(PLATFORM_ID);
|
|
379
|
+
_renderer = this._rendererFactory.createRenderer(null, null);
|
|
380
|
+
_isBrowser = isPlatformBrowser(this._platformId);
|
|
381
|
+
LS_THEME = this._config.localStorageKey;
|
|
382
|
+
// Private
|
|
383
|
+
_currentTheme = signal('light', ...(ngDevMode ? [{ debugName: "_currentTheme" }] : []));
|
|
384
|
+
constructor() {
|
|
385
|
+
this._initTheme();
|
|
386
|
+
effect(() => {
|
|
387
|
+
if (this._isBrowser)
|
|
388
|
+
localStorage.setItem(this.LS_THEME, this._currentTheme());
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
// Accessors
|
|
392
|
+
get currentTheme() {
|
|
393
|
+
return this._currentTheme.asReadonly();
|
|
394
|
+
}
|
|
395
|
+
// Public methods
|
|
396
|
+
toggle() {
|
|
397
|
+
this.setTheme(this._currentTheme() === 'light' ? 'dark' : 'light');
|
|
398
|
+
}
|
|
399
|
+
setTheme(theme) {
|
|
400
|
+
const documentElement = this._document.documentElement;
|
|
401
|
+
const lightThemeClass = LIGHT_THEME_CLASS;
|
|
402
|
+
const darkThemeClass = DARK_THEME_CLASS;
|
|
403
|
+
if (theme === 'dark') {
|
|
404
|
+
this._renderer.removeClass(documentElement, lightThemeClass);
|
|
405
|
+
this._renderer.addClass(documentElement, darkThemeClass);
|
|
406
|
+
this._currentTheme.set('dark');
|
|
407
|
+
}
|
|
408
|
+
else {
|
|
409
|
+
this._renderer.removeClass(documentElement, darkThemeClass);
|
|
410
|
+
this._renderer.addClass(documentElement, lightThemeClass);
|
|
411
|
+
this._currentTheme.set('light');
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
// Private methods
|
|
415
|
+
_detectSystemTheme() {
|
|
416
|
+
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
417
|
+
}
|
|
418
|
+
_initTheme() {
|
|
419
|
+
if (!this._isBrowser)
|
|
420
|
+
return;
|
|
421
|
+
const localStorageValue = localStorage.getItem(this.LS_THEME);
|
|
422
|
+
if (localStorageValue) {
|
|
423
|
+
this.setTheme(localStorageValue);
|
|
424
|
+
}
|
|
425
|
+
else
|
|
426
|
+
this._initDefaultTheme();
|
|
427
|
+
}
|
|
428
|
+
_initDefaultTheme() {
|
|
429
|
+
if (this._config.defaultTheme === 'system') {
|
|
430
|
+
this.setTheme(this._detectSystemTheme());
|
|
431
|
+
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
|
|
432
|
+
if (!localStorage.getItem(this.LS_THEME)) {
|
|
433
|
+
this.setTheme(event.matches ? 'dark' : 'light');
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
else {
|
|
438
|
+
this.setTheme(this._config.defaultTheme);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
442
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ThemeService });
|
|
443
|
+
}
|
|
444
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: ThemeService, decorators: [{
|
|
445
|
+
type: Injectable
|
|
446
|
+
}], ctorParameters: () => [] });
|
|
447
|
+
|
|
448
|
+
// Features
|
|
449
|
+
|
|
450
|
+
const provideThalassicUIConfig = (config) => {
|
|
451
|
+
return makeEnvironmentProviders([
|
|
452
|
+
// Components
|
|
453
|
+
{ provide: BUTTON_CONFIG, useValue: { ...DEFAULT_BUTTON_CONFIG, ...config.components.button } },
|
|
454
|
+
{ provide: INPUT_CONFIG, useValue: { ...DEFAULT_INPUT_CONFIG, ...config.components.input } },
|
|
455
|
+
{
|
|
456
|
+
provide: PASSWORD_CONFIG,
|
|
457
|
+
useValue: { ...DEFAULT_PASSWORD_CONFIG, ...config.components.password },
|
|
458
|
+
},
|
|
459
|
+
{ provide: SWITCH_CONFIG, useValue: { ...DEFAULT_SWITCH_CONFIG, ...config.components.switch } },
|
|
460
|
+
{ provide: ICON_CONFIG, useValue: { ...DEFAULT_ICON_CONFIG, ...config.components.icon } },
|
|
461
|
+
]);
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
const provideTheme = (config) => {
|
|
465
|
+
return makeEnvironmentProviders([
|
|
466
|
+
{ provide: THEME_CONFIG, useValue: { ...DEFAULT_THEME_CONFIG, ...config } },
|
|
467
|
+
ThemeService,
|
|
468
|
+
]);
|
|
469
|
+
};
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Generated bundle index. Do not edit.
|
|
473
|
+
*/
|
|
474
|
+
|
|
475
|
+
export { BUTTON_CONFIG, Button, DEFAULT_BUTTON_CONFIG, DEFAULT_ICON_CONFIG, DEFAULT_INPUT_CONFIG, DEFAULT_PASSWORD_CONFIG, DEFAULT_SWITCH_CONFIG, ICON_CONFIG, INPUT_CONFIG, Icon, Input, InputDirective, PASSWORD_CONFIG, Password, SWITCH_CONFIG, Switch, ThemeService, provideThalassicUIConfig, provideTheme };
|
|
476
|
+
//# sourceMappingURL=thalassic-ui.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thalassic-ui.mjs","sources":["../../../../libs/ui/src/lib/features/icon/icon.config.ts","../../../../libs/ui/src/lib/features/icon/icon.token.ts","../../../../libs/ui/src/lib/features/icon/icon.service.ts","../../../../libs/ui/src/lib/features/icon/icon.ts","../../../../libs/ui/src/lib/features/icon/icon.html","../../../../libs/ui/src/lib/features/button/button.config.ts","../../../../libs/ui/src/lib/features/button/button.token.ts","../../../../libs/ui/src/lib/features/button/button.ts","../../../../libs/ui/src/lib/features/button/button.html","../../../../libs/ui/src/lib/abstract/form-control.ts","../../../../libs/ui/src/lib/abstract/checkbox-form-control.ts","../../../../libs/ui/src/lib/abstract/value-form-control.ts","../../../../libs/ui/src/lib/features/form/input/input.config.ts","../../../../libs/ui/src/lib/features/form/input/input.token.ts","../../../../libs/ui/src/lib/features/form/input/input.ts","../../../../libs/ui/src/lib/features/form/input/input.html","../../../../libs/ui/src/lib/features/form/input/input.directive.ts","../../../../libs/ui/src/lib/features/form/password/password.config.ts","../../../../libs/ui/src/lib/features/form/password/password.token.ts","../../../../libs/ui/src/lib/features/form/password/password.ts","../../../../libs/ui/src/lib/features/form/password/password.html","../../../../libs/ui/src/lib/features/form/switch/switch.config.ts","../../../../libs/ui/src/lib/features/form/switch/switch.token.ts","../../../../libs/ui/src/lib/features/form/switch/switch.ts","../../../../libs/ui/src/lib/features/form/switch/switch.html","../../../../libs/ui/src/lib/features/theme/constants/theme-class-names.ts","../../../../libs/ui/src/lib/features/theme/theme.config.ts","../../../../libs/ui/src/lib/features/theme/theme.token.ts","../../../../libs/ui/src/lib/features/theme/theme.service.ts","../../../../libs/ui/src/lib/features/index.ts","../../../../libs/ui/src/lib/providers/ui-config.provider.ts","../../../../libs/ui/src/lib/providers/theme.provider.ts","../../../../libs/ui/src/thalassic-ui.ts"],"sourcesContent":["export interface IconConfig {\r\n allowedSources: string[];\r\n}\r\n\r\nexport const DEFAULT_ICON_CONFIG: IconConfig = {\r\n allowedSources: [],\r\n};\r\n","import { InjectionToken } from '@angular/core';\r\nimport { DEFAULT_ICON_CONFIG, IconConfig } from './icon.config';\r\n\r\nexport const ICON_CONFIG = new InjectionToken<IconConfig>('ICON_CONFIG', {\r\n factory: () => DEFAULT_ICON_CONFIG,\r\n});\r\n","import { HttpClient } from '@angular/common/http';\nimport { inject, Injectable } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { map, Observable, shareReplay, throwError } from 'rxjs';\n\n@Injectable({ providedIn: 'root' })\nexport class IconService {\n private readonly _http: HttpClient = inject(HttpClient);\n private readonly _sanitizer: DomSanitizer = inject(DomSanitizer);\n\n private readonly _cache = new Map<string, Observable<SafeHtml>>();\n\n public getSvgContent(url: string, allowedSources: string[]): Observable<SafeHtml> {\n if (allowedSources.length > 0 && !this._isUrlAllowed(url, allowedSources)) {\n return throwError(() => new Error('SVG URL not from trusted source'));\n }\n\n const cache = this._cache.get(url);\n\n if (!cache) {\n const svg$ = this._http.get(url, { responseType: 'text' }).pipe(\n map(svg => this._sanitizeSvg(svg)),\n shareReplay(1),\n );\n this._cache.set(url, svg$);\n return svg$;\n }\n\n return cache;\n }\n\n // Private methods\n private _isUrlAllowed(url: string, allowedSource: string[]): boolean {\n return allowedSource.some(source => url.startsWith(source));\n }\n\n private _sanitizeSvg(svg: string): SafeHtml {\n const safeSvg = this._makeSafe(svg);\n return this._sanitizer.bypassSecurityTrustHtml(safeSvg);\n }\n\n private _makeSafe(svg: string): string {\n return (\n svg\n // Remove script tags\n .replace(/<script\\b[^<]*(?:(?!<\\/script>)<[^<]*)*<\\/script>/gi, '')\n // Remove event handlers (onclick, onload, onmouseover, etc.)\n .replace(/on\\w+\\s*=\\s*[\"'][^\"']*[\"']/gi, '')\n // Remove external xlink:href (keep internal references starting with #)\n .replace(/xlink:href\\s*=\\s*[\"'](?!#)[^\"']*[\"']/gi, '')\n // Remove external href in <use>, <image>, <a> tags (keep internal #refs)\n .replace(/href\\s*=\\s*[\"'](?!#)[^\"']*[\"']/gi, '')\n // Remove data URIs with HTML content\n .replace(/href\\s*=\\s*[\"']data:text\\/html[^\"']*[\"']/gi, '')\n .replace(/src\\s*=\\s*[\"']data:text\\/html[^\"']*[\"']/gi, '')\n // Remove javascript: protocol\n .replace(/javascript:/gi, '')\n // Remove import statements in style\n .replace(/@import/gi, '')\n );\n }\n}\n","import { Component, computed, inject, input, InputSignal, Signal } from '@angular/core';\r\nimport { rxResource } from '@angular/core/rxjs-interop';\r\nimport { SafeHtml } from '@angular/platform-browser';\r\nimport { ICON_CONFIG } from './icon.token';\r\nimport { IconService } from './icon.service';\r\n\r\n@Component({\r\n selector: 'tls-icon',\r\n imports: [],\r\n templateUrl: './icon.html',\r\n styleUrl: './icon.scss',\r\n})\r\nexport class Icon {\r\n // Injections\r\n private _iconService = inject(IconService);\r\n private _config = inject(ICON_CONFIG);\r\n\r\n // Inputs\r\n public iconSrc: InputSignal<string> = input.required<string>();\r\n public alt = input<string>('');\r\n public allowedSources: InputSignal<string[]> = input<string[]>(this._config.allowedSources);\r\n\r\n protected isSvg: Signal<boolean> = computed(() => {\r\n return this.iconSrc().endsWith('.svg');\r\n });\r\n\r\n private _svgContentResource = rxResource({\r\n defaultValue: '',\r\n params: () => ({\r\n iconSrc: this.iconSrc(),\r\n allowedSources: this.allowedSources(),\r\n }),\r\n stream: params =>\r\n this._iconService.getSvgContent(params.params.iconSrc, params.params.allowedSources),\r\n });\r\n\r\n // Accessors\r\n get svgContent(): Signal<SafeHtml> {\r\n return this._svgContentResource.value.asReadonly();\r\n }\r\n}\r\n","@if (isSvg() && iconSrc()) {\n <span [innerHTML]=\"svgContent()\" class=\"tls-svg-icon\"></span>\n} @else if (iconSrc()) {\n <img [src]=\"iconSrc()\" [alt]=\"alt()\" class=\"tls-img-icon\" />\n} @else {\n {{ iconSrc() }}\n}\n","import { buttonAppearance, buttonColor, buttonSize, buttonType } from './button.types';\r\n\r\nexport interface ButtonConfig {\r\n color: buttonColor;\r\n appearance: buttonAppearance;\r\n size: buttonSize;\r\n type: buttonType;\r\n}\r\n\r\nexport const DEFAULT_BUTTON_CONFIG: ButtonConfig = {\r\n color: 'primary',\r\n appearance: 'filled',\r\n size: 'md',\r\n type: 'button',\r\n};\r\n","import { InjectionToken } from '@angular/core';\r\nimport { ButtonConfig, DEFAULT_BUTTON_CONFIG } from './button.config';\r\n\r\nexport const BUTTON_CONFIG = new InjectionToken<ButtonConfig>('BUTTON_CONFIG', {\r\n factory: () => DEFAULT_BUTTON_CONFIG,\r\n});\r\n","import { NgTemplateOutlet } from '@angular/common';\r\nimport {\r\n booleanAttribute,\r\n Component,\r\n computed,\r\n inject,\r\n input,\r\n InputSignal,\r\n InputSignalWithTransform,\r\n} from '@angular/core';\r\nimport { RouterLink } from '@angular/router';\r\nimport { Icon } from '../icon';\r\nimport { BUTTON_CONFIG } from './button.token';\r\nimport { buttonAppearance, buttonColor, buttonSize, buttonType } from './button.types';\r\n\r\n@Component({\r\n selector: 'tls-button',\r\n imports: [Icon, NgTemplateOutlet],\r\n templateUrl: './button.html',\r\n host: {\r\n '[tabindex]': '-1',\r\n },\r\n styleUrls: ['./button.scss', './button-appearance.scss', 'button-color.scss', 'button-size.scss'],\r\n})\r\nexport class Button {\r\n // Injections\r\n private _routerLink = inject(RouterLink, { optional: true });\r\n private _config = inject(BUTTON_CONFIG);\r\n\r\n // Inputs\r\n public label = input<string>();\r\n public type: InputSignal<buttonType> = input<buttonType>(this._config.type);\r\n public disabled: InputSignalWithTransform<boolean, unknown> = input(false, {\r\n transform: booleanAttribute,\r\n });\r\n public icon: InputSignalWithTransform<string | boolean, unknown> = input(false, {\r\n transform: (value: unknown) => {\r\n if (typeof value === 'string' && value === '') return true;\r\n else if (typeof value === 'string') return value;\r\n else return booleanAttribute(value);\r\n },\r\n });\r\n public color: InputSignal<buttonColor> = input<buttonColor>(this._config.color);\r\n public appearance: InputSignal<buttonAppearance> = input<buttonAppearance>(\r\n this._config.appearance,\r\n );\r\n public size: InputSignal<buttonSize> = input<buttonSize>(this._config.size);\r\n public href = input<string | null>(null);\r\n public tabindex = input<string>('0');\r\n\r\n // Computed\r\n protected isLink = computed<boolean>(() => Boolean(this._routerLink || this.href()));\r\n protected isIconString = computed<boolean>(() => typeof this.icon() === 'string');\r\n\r\n protected classes = computed(() => {\r\n const className = 'tls-button';\r\n\r\n const array: string[] = [className];\r\n\r\n array.push(`${className}--${this.color()}`);\r\n array.push(`${className}--${this.appearance()}`);\r\n array.push(`${className}--${this.size()}`);\r\n if (this.disabled()) array.push(`${className}--disabled`);\r\n if (this.icon()) array.push(`${className}--icon-only`);\r\n\r\n return array;\r\n });\r\n\r\n protected readonly String = String;\r\n}\r\n","@if (isLink()) {\r\n <a\r\n role=\"link\"\r\n [class]=\"classes()\"\r\n [href]=\"href()\"\r\n [tabindex]=\"tabindex()\"\r\n [attr.aria-disabled]=\"disabled()\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"></ng-container>\r\n </a>\r\n} @else {\r\n <button\r\n role=\"button\"\r\n [class]=\"classes()\"\r\n [type]=\"type()\"\r\n [tabindex]=\"tabindex()\"\r\n [disabled]=\"disabled()\"\r\n [attr.aria-disabled]=\"disabled()\"\r\n >\r\n <ng-container [ngTemplateOutlet]=\"contentTemplate\"></ng-container>\r\n </button>\r\n}\r\n\r\n<!-- Content -->\r\n<ng-template #contentTemplate>\r\n <span class=\"tls-button__content\">\r\n @if (icon()) {\r\n @if (isIconString()) {\r\n <tls-icon [iconSrc]=\"String(icon())\" />\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"projectedContentTemplate\"></ng-container>\r\n }\r\n } @else {\r\n @if (label()) {\r\n {{ label() }}\r\n } @else {\r\n <ng-container *ngTemplateOutlet=\"projectedContentTemplate\"></ng-container>\r\n }\r\n }\r\n </span>\r\n <div class=\"tls-button__background\"></div>\r\n</ng-template>\r\n\r\n<ng-template #projectedContentTemplate>\r\n <ng-content></ng-content>\r\n</ng-template>\r\n","import {\n booleanAttribute,\n computed,\n Directive,\n input,\n InputSignal,\n InputSignalWithTransform,\n model,\n ModelSignal,\n Signal,\n} from '@angular/core';\nimport { FormUiControl, ValidationError, WithOptionalFieldTree } from '@angular/forms/signals';\n\n@Directive()\nexport abstract class FormControl implements FormUiControl {\n // Models\n public readonly touched: ModelSignal<boolean> = model<boolean>(false);\n\n // Inputs\n public readonly name: InputSignal<string> = input<string>('');\n\n public readonly disabled: InputSignalWithTransform<boolean, unknown> = input<boolean, unknown>(\n false,\n { transform: booleanAttribute },\n );\n\n public readonly readonly: InputSignalWithTransform<boolean, unknown> = input<boolean, unknown>(\n false,\n { transform: booleanAttribute },\n );\n\n public readonly hidden: InputSignalWithTransform<boolean, unknown> = input<boolean, unknown>(\n false,\n { transform: booleanAttribute },\n );\n\n public readonly invalid: InputSignalWithTransform<boolean, unknown> = input<boolean, unknown>(\n false,\n { transform: booleanAttribute },\n );\n\n public readonly pending: InputSignalWithTransform<boolean, unknown> = input<boolean, unknown>(\n false,\n { transform: booleanAttribute },\n );\n\n public readonly dirty: InputSignalWithTransform<boolean, unknown> = input<boolean, unknown>(\n false,\n { transform: booleanAttribute },\n );\n\n public readonly errors = input<readonly WithOptionalFieldTree<ValidationError>[]>([]);\n\n public readonly required: InputSignalWithTransform<boolean, unknown> = input<boolean, unknown>(\n false,\n { transform: booleanAttribute },\n );\n\n protected notInteractive: Signal<boolean> = computed<boolean>(\n () => this.disabled() || this.readonly(),\n );\n protected controlClasses: Signal<string[]> = computed<string[]>(() => {\n const className = 'tls-form-control';\n\n const array: string[] = [className];\n\n if (this.disabled()) array.push(`${className}--disabled`);\n if (this.readonly()) array.push(`${className}--readonly`);\n if (this.invalid()) array.push(`${className}--invalid`);\n if (this.pending()) array.push(`${className}--pending`);\n if (this.dirty()) array.push(`${className}--dirty`);\n\n return array;\n });\n}\n","import { Directive, ModelSignal } from '@angular/core';\r\nimport { FormCheckboxControl } from '@angular/forms/signals';\r\nimport { FormControl } from './form-control';\r\n\r\n@Directive()\r\nexport abstract class CheckboxFormControl extends FormControl implements FormCheckboxControl {\r\n public abstract readonly checked: ModelSignal<boolean>;\r\n}\r\n","import { Directive, ModelSignal } from '@angular/core';\r\nimport { FormValueControl } from '@angular/forms/signals';\r\nimport { FormControl } from './form-control';\r\n\r\n@Directive()\r\nexport abstract class ValueFormControl<T> extends FormControl implements FormValueControl<T> {\r\n public abstract readonly value: ModelSignal<T>;\r\n}\r\n","import { inputSize } from './input.types';\r\n\r\nexport interface InputConfig {\r\n size: inputSize;\r\n type: string;\r\n placeholder: string;\r\n}\r\n\r\nexport const DEFAULT_INPUT_CONFIG: InputConfig = {\r\n size: 'md',\r\n type: 'text',\r\n placeholder: '',\r\n};\r\n","import { InjectionToken } from '@angular/core';\r\nimport { DEFAULT_INPUT_CONFIG, InputConfig } from './input.config';\r\n\r\nexport const INPUT_CONFIG = new InjectionToken<InputConfig>('INPUT_CONFIG', {\r\n factory: () => DEFAULT_INPUT_CONFIG,\r\n});\r\n","import {\r\n Component,\r\n computed,\r\n inject,\r\n input,\r\n InputSignal,\r\n model,\r\n ModelSignal,\r\n Signal,\r\n} from '@angular/core';\r\nimport { ValueFormControl } from '../../../abstract';\r\nimport { INPUT_CONFIG } from './input.token';\r\nimport { inputSize } from './input.types';\r\n\r\n@Component({\r\n selector: 'tls-input',\r\n templateUrl: './input.html',\r\n styleUrl: './input.scss',\r\n})\r\nexport class Input extends ValueFormControl<string> {\r\n // Injections\r\n private _config = inject(INPUT_CONFIG);\r\n\r\n // Inputs\r\n public readonly type = input<string>(this._config.type);\r\n public readonly value: ModelSignal<string> = model<string>('');\r\n public readonly inputId = input<string | null>(null);\r\n public readonly placeholder = input<string>(this._config.placeholder);\r\n public readonly size: InputSignal<inputSize> = input<inputSize>(this._config.size);\r\n\r\n protected readonly classes: Signal<string[]> = computed(() => {\r\n const className = 'tls-form-field';\r\n\r\n const array: string[] = [className];\r\n\r\n array.push(`${className}--${this.size()}`);\r\n\r\n return array.concat(this.controlClasses());\r\n });\r\n\r\n // Protected methods\r\n protected onInput(event: Event) {\r\n const target = event.target as HTMLInputElement;\r\n\r\n this.value.set(target.value);\r\n }\r\n}\r\n","<input\r\n [type]=\"type()\"\r\n [class]=\"classes()\"\r\n [attr.id]=\"inputId()\"\r\n [placeholder]=\"placeholder()\"\r\n [disabled]=\"disabled()\"\r\n [readonly]=\"readonly()\"\r\n [value]=\"value()\"\r\n (input)=\"onInput($event)\"\r\n>\r\n","import { computed, Directive, input, InputSignal, Signal } from '@angular/core';\nimport { inputSize } from './input.types';\n\n@Directive({\n selector: '[tlsInput]',\n host: {\n '[class]': 'classes()',\n },\n})\nexport class InputDirective {\n public readonly size: InputSignal<inputSize> = input<inputSize>('md');\n\n protected readonly classes: Signal<string[]> = computed(() => {\n const className = 'tls-form-field';\n\n const array: string[] = [className];\n\n array.push(`${className}--${this.size()}`);\n\n return array;\n });\n}\n","import { inputSize } from '../input/input.types';\r\n\r\nexport interface PasswordConfig {\r\n size: inputSize;\r\n placeholder: string;\r\n}\r\n\r\nexport const DEFAULT_PASSWORD_CONFIG: PasswordConfig = {\r\n size: 'md',\r\n placeholder: '',\r\n};\r\n","import { InjectionToken } from '@angular/core';\r\nimport { DEFAULT_PASSWORD_CONFIG, PasswordConfig } from './password.config';\r\n\r\nexport const PASSWORD_CONFIG = new InjectionToken<PasswordConfig>('PASSWORD_CONFIG', {\r\n factory: () => DEFAULT_PASSWORD_CONFIG,\r\n});\r\n","import { Component, computed, inject, input, InputSignal, model, ModelSignal, Signal } from '@angular/core';\r\nimport { ValueFormControl } from '../../../abstract';\r\nimport { PASSWORD_CONFIG } from './password.token';\r\nimport { inputSize } from '../input/input.types';\r\n\r\n@Component({\r\n selector: 'tls-password',\r\n templateUrl: './password.html',\r\n styleUrl: './password.scss',\r\n host: {\r\n '[class]': 'classes()',\r\n },\r\n})\r\nexport class Password extends ValueFormControl<string> {\r\n private _config = inject(PASSWORD_CONFIG);\r\n\r\n public readonly value: ModelSignal<string> = model<string>('');\r\n public readonly visible: ModelSignal<boolean> = model<boolean>(false);\r\n public readonly inputId = input<string | null>(null);\r\n public readonly placeholder = input<string>(this._config.placeholder);\r\n public readonly size: InputSignal<inputSize> = input<inputSize>(this._config.size);\r\n\r\n protected readonly classes: Signal<string[]> = computed(() => {\r\n const className = 'tls-form-field-group';\r\n\r\n const array: string[] = [className];\r\n\r\n array.push(`${className}--${this.size()}`);\r\n\r\n return array.concat(this.controlClasses());\r\n });\r\n\r\n protected type = computed(() => (this.visible() ? 'text' : 'password'));\r\n\r\n // Protected methods\r\n protected onInput(event: Event) {\r\n const target = event.target as HTMLInputElement;\r\n\r\n this.value.set(target.value);\r\n }\r\n\r\n protected toggle() {\r\n if (this.notInteractive()) return;\r\n\r\n this.visible.update(prev => !prev);\r\n }\r\n}\r\n","<input\r\n class=\"tls-form-field\"\r\n [type]=\"type()\"\r\n [attr.id]=\"inputId()\"\r\n [placeholder]=\"placeholder()\"\r\n [disabled]=\"disabled()\"\r\n [readonly]=\"readonly()\"\r\n [value]=\"value()\"\r\n (input)=\"onInput($event)\"\r\n>\r\n<button class=\"tls-password-toggle tls-form-field-addon\" (click)=\"toggle()\">\r\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"visible()\">\r\n <span class=\"text-label-md\">Show</span>\r\n </span>\r\n <span class=\"tls-password-toggle__item\" [class.tls-password-toggle__item--hidden]=\"!visible()\">\r\n <span class=\"text-label-md\">Hide</span>\r\n </span>\r\n</button>\r\n","import { switchColor } from './switch.types';\r\n\r\nexport interface SwitchConfig {\r\n color: switchColor;\r\n}\r\n\r\nexport const DEFAULT_SWITCH_CONFIG: SwitchConfig = {\r\n color: 'primary',\r\n};\r\n","import { InjectionToken } from '@angular/core';\r\nimport { DEFAULT_SWITCH_CONFIG, SwitchConfig } from './switch.config';\r\n\r\nexport const SWITCH_CONFIG = new InjectionToken<SwitchConfig>('SWITCH_CONFIG', {\r\n factory: () => DEFAULT_SWITCH_CONFIG,\r\n});\r\n","import { Component, computed, inject, input, InputSignal, model, ModelSignal, Signal } from '@angular/core';\r\nimport { CheckboxFormControl } from '../../../abstract';\r\nimport { SWITCH_CONFIG } from './switch.token';\r\nimport { switchColor } from './switch.types';\r\n\r\n@Component({\r\n selector: 'tls-switch',\r\n templateUrl: './switch.html',\r\n styleUrls: ['./switch.scss', 'switch-color.scss'],\r\n host: {\r\n role: 'switch',\r\n '[class]': 'classes()',\r\n '[tabindex]': 'disabled() ? -1 : tabindex()',\r\n '[attr.aria-checked]': 'checked()',\r\n '[attr.aria-disabled]': 'disabled()',\r\n '[attr.aria-readonly]': 'readonly()',\r\n '(click)': 'toggle()',\r\n '(keydown.space)': 'onKeyboardToggle($event)',\r\n '(keydown.enter)': 'onKeyboardToggle($event)',\r\n },\r\n})\r\nexport class Switch extends CheckboxFormControl {\r\n private _config = inject(SWITCH_CONFIG);\r\n\r\n public readonly checked: ModelSignal<boolean> = model<boolean>(false);\r\n public readonly inputId = input<string>();\r\n public readonly color: InputSignal<switchColor> = input<switchColor>(this._config.color);\r\n public readonly tabindex: InputSignal<string | number> = input<string | number>(0);\r\n\r\n protected readonly classes: Signal<string[]> = computed(() => {\r\n const className = 'tls-switch';\r\n\r\n const array: string[] = [className];\r\n\r\n array.push(`${className}--${this.color()}`);\r\n if (this.checked()) array.push(`${className}--checked`);\r\n\r\n return array.concat(this.controlClasses());\r\n });\r\n\r\n // Protected methods\r\n protected toggle() {\r\n if (this.notInteractive()) return;\r\n\r\n this.checked.update(prev => !prev);\r\n }\r\n\r\n protected onKeyboardToggle(event: Event) {\r\n event.preventDefault();\r\n this.toggle();\r\n }\r\n}\r\n","<input\r\n type=\"checkbox\"\r\n class=\"tls-switch-input\"\r\n [id]=\"inputId()\"\r\n [disabled]=\"disabled()\"\r\n [readonly]=\"readonly()\"\r\n [checked]=\"checked()\"\r\n/>\r\n<div class=\"tls-switch-handle\"></div>\r\n","export const LIGHT_THEME_CLASS = 'tls-light';\r\n\r\nexport const DARK_THEME_CLASS = 'tls-dark';\r\n","import { themeType } from './types';\r\n\r\nexport interface ThemeConfig {\r\n localStorageKey: string;\r\n defaultTheme: themeType | 'system';\r\n}\r\n\r\nexport const DEFAULT_THEME_CONFIG: ThemeConfig = {\r\n defaultTheme: 'system',\r\n localStorageKey: 'tls-theme',\r\n};\r\n","import { InjectionToken } from '@angular/core';\r\nimport { DEFAULT_THEME_CONFIG, ThemeConfig } from './theme.config';\r\n\r\nexport const THEME_CONFIG = new InjectionToken<ThemeConfig>('THEME_CONFIG', {\r\n factory: () => DEFAULT_THEME_CONFIG,\r\n});\r\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n DOCUMENT,\n effect,\n inject,\n Injectable,\n PLATFORM_ID,\n Renderer2,\n RendererFactory2,\n Signal,\n signal,\n} from '@angular/core';\nimport { DARK_THEME_CLASS, LIGHT_THEME_CLASS } from './constants';\nimport { ThemeConfig } from './theme.config';\nimport { THEME_CONFIG } from './theme.token';\nimport { themeType } from './types';\n\n@Injectable()\nexport class ThemeService {\n // Injections\n private readonly _config: ThemeConfig = inject(THEME_CONFIG);\n private readonly _document: Document = inject(DOCUMENT);\n private readonly _rendererFactory: RendererFactory2 = inject(RendererFactory2);\n private readonly _platformId = inject(PLATFORM_ID);\n\n private readonly _renderer: Renderer2 = this._rendererFactory.createRenderer(null, null);\n private readonly _isBrowser: boolean = isPlatformBrowser(this._platformId);\n\n private readonly LS_THEME = this._config.localStorageKey;\n\n // Private\n private _currentTheme = signal<themeType>('light');\n\n constructor() {\n this._initTheme();\n\n effect(() => {\n if (this._isBrowser) localStorage.setItem(this.LS_THEME, this._currentTheme());\n });\n }\n\n // Accessors\n get currentTheme(): Signal<themeType> {\n return this._currentTheme.asReadonly();\n }\n\n // Public methods\n public toggle(): void {\n this.setTheme(this._currentTheme() === 'light' ? 'dark' : 'light');\n }\n\n public setTheme(theme: themeType): void {\n const documentElement = this._document.documentElement;\n const lightThemeClass = LIGHT_THEME_CLASS;\n const darkThemeClass = DARK_THEME_CLASS;\n\n if (theme === 'dark') {\n this._renderer.removeClass(documentElement, lightThemeClass);\n this._renderer.addClass(documentElement, darkThemeClass);\n this._currentTheme.set('dark');\n } else {\n this._renderer.removeClass(documentElement, darkThemeClass);\n this._renderer.addClass(documentElement, lightThemeClass);\n this._currentTheme.set('light');\n }\n }\n\n // Private methods\n private _detectSystemTheme(): themeType {\n return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n }\n\n private _initTheme(): void {\n if (!this._isBrowser) return;\n const localStorageValue = localStorage.getItem(this.LS_THEME) as themeType;\n if (localStorageValue) {\n this.setTheme(localStorageValue);\n } else this._initDefaultTheme();\n }\n\n private _initDefaultTheme(): void {\n if (this._config.defaultTheme === 'system') {\n this.setTheme(this._detectSystemTheme());\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {\n if (!localStorage.getItem(this.LS_THEME)) {\n this.setTheme(event.matches ? 'dark' : 'light');\n }\n });\n } else {\n this.setTheme(this._config.defaultTheme);\n }\n }\n}\n","// Features\nexport * from './button';\nexport * from './icon';\nexport * from './form/input';\nexport * from './form/password';\nexport * from './form/switch';\n\n// Theme\nexport * from './theme';\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\r\nimport {\r\n BUTTON_CONFIG,\r\n DEFAULT_BUTTON_CONFIG,\r\n DEFAULT_ICON_CONFIG,\r\n DEFAULT_INPUT_CONFIG,\r\n DEFAULT_PASSWORD_CONFIG,\r\n DEFAULT_SWITCH_CONFIG,\r\n ICON_CONFIG,\r\n INPUT_CONFIG,\r\n PASSWORD_CONFIG,\r\n SWITCH_CONFIG,\r\n} from '../features';\r\nimport { tlsUiConfigProvider } from '../types';\r\n\r\nexport const provideThalassicUIConfig = (config: tlsUiConfigProvider): EnvironmentProviders => {\r\n return makeEnvironmentProviders([\r\n // Components\r\n { provide: BUTTON_CONFIG, useValue: { ...DEFAULT_BUTTON_CONFIG, ...config.components.button } },\r\n { provide: INPUT_CONFIG, useValue: { ...DEFAULT_INPUT_CONFIG, ...config.components.input } },\r\n {\r\n provide: PASSWORD_CONFIG,\r\n useValue: { ...DEFAULT_PASSWORD_CONFIG, ...config.components.password },\r\n },\r\n { provide: SWITCH_CONFIG, useValue: { ...DEFAULT_SWITCH_CONFIG, ...config.components.switch } },\r\n { provide: ICON_CONFIG, useValue: { ...DEFAULT_ICON_CONFIG, ...config.components.icon } },\r\n ]);\r\n};\r\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { ThemeService } from '../features';\nimport { DEFAULT_THEME_CONFIG, ThemeConfig } from '../features/theme/theme.config';\nimport { THEME_CONFIG } from '../features/theme/theme.token';\n\nexport const provideTheme = (config?: Partial<ThemeConfig>): EnvironmentProviders => {\n return makeEnvironmentProviders([\n { provide: THEME_CONFIG, useValue: { ...DEFAULT_THEME_CONFIG, ...config } },\n ThemeService,\n ]);\n};","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAIO,MAAM,mBAAmB,GAAe;AAC7C,IAAA,cAAc,EAAE,EAAE;;;MCFP,WAAW,GAAG,IAAI,cAAc,CAAa,aAAa,EAAE;AACvE,IAAA,OAAO,EAAE,MAAM,mBAAmB;AACnC,CAAA;;MCCY,WAAW,CAAA;AACL,IAAA,KAAK,GAAe,MAAM,CAAC,UAAU,CAAC;AACtC,IAAA,UAAU,GAAiB,MAAM,CAAC,YAAY,CAAC;AAE/C,IAAA,MAAM,GAAG,IAAI,GAAG,EAAgC;IAE1D,aAAa,CAAC,GAAW,EAAE,cAAwB,EAAA;AACxD,QAAA,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,cAAc,CAAC,EAAE;YACzE,OAAO,UAAU,CAAC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACvE;QAEA,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;QAElC,IAAI,CAAC,KAAK,EAAE;AACV,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,CAC7D,GAAG,CAAC,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,EAClC,WAAW,CAAC,CAAC,CAAC,CACf;YACD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC;AAC1B,YAAA,OAAO,IAAI;QACb;AAEA,QAAA,OAAO,KAAK;IACd;;IAGQ,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C,IAAI,EAAE,EAAE;AAC1F,KAAA,CAAC;AACJ;;ACtBO,MAAM,YAAY,GAAG,CAAC,MAA6B,KAA0B;AAClF,IAAA,OAAO,wBAAwB,CAAC;AAC9B,QAAA,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,GAAG,oBAAoB,EAAE,GAAG,MAAM,EAAE,EAAE;QAC3E,YAAY;AACb,KAAA,CAAC;AACJ;;ACVA;;AAEG;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@thalassic/ui",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/common": "^21.0.0",
|
|
6
|
+
"@angular/core": "^21.0.0"
|
|
7
|
+
},
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"module": "fesm2022/thalassic-ui.mjs",
|
|
13
|
+
"typings": "types/thalassic-ui.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": {
|
|
16
|
+
"default": "./package.json"
|
|
17
|
+
},
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./types/thalassic-ui.d.ts",
|
|
20
|
+
"default": "./fesm2022/thalassic-ui.mjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"tslib": "^2.3.0"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InputSignal, InputSignalWithTransform, InjectionToken, Signal, ModelSignal, EnvironmentProviders } from '@angular/core';
|
|
3
|
+
import { SafeHtml } from '@angular/platform-browser';
|
|
4
|
+
import { FormUiControl, WithOptionalFieldTree, ValidationError, FormCheckboxControl, FormValueControl } from '@angular/forms/signals';
|
|
5
|
+
|
|
6
|
+
type color = 'primary' | 'secondary' | 'tertiary' | 'success' | 'info' | 'warning' | 'danger';
|
|
7
|
+
|
|
8
|
+
type controlSize = 'sm' | 'md' | 'lg';
|
|
9
|
+
|
|
10
|
+
interface tlsUiConfigProvider {
|
|
11
|
+
components: {
|
|
12
|
+
button?: Partial<ButtonConfig>;
|
|
13
|
+
input?: Partial<InputConfig>;
|
|
14
|
+
password?: Partial<PasswordConfig>;
|
|
15
|
+
switch?: Partial<SwitchConfig>;
|
|
16
|
+
icon?: Partial<IconConfig>;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type buttonType = 'submit' | 'reset' | 'button';
|
|
21
|
+
type buttonSize = controlSize;
|
|
22
|
+
type buttonAppearance = 'filled' | 'outlined' | 'text' | 'elevated';
|
|
23
|
+
type buttonColor = color;
|
|
24
|
+
|
|
25
|
+
declare class Button {
|
|
26
|
+
private _routerLink;
|
|
27
|
+
private _config;
|
|
28
|
+
label: InputSignal<string | undefined>;
|
|
29
|
+
type: InputSignal<buttonType>;
|
|
30
|
+
disabled: InputSignalWithTransform<boolean, unknown>;
|
|
31
|
+
icon: InputSignalWithTransform<string | boolean, unknown>;
|
|
32
|
+
color: InputSignal<buttonColor>;
|
|
33
|
+
appearance: InputSignal<buttonAppearance>;
|
|
34
|
+
size: InputSignal<buttonSize>;
|
|
35
|
+
href: InputSignal<string | null>;
|
|
36
|
+
tabindex: InputSignal<string>;
|
|
37
|
+
protected isLink: i0.Signal<boolean>;
|
|
38
|
+
protected isIconString: i0.Signal<boolean>;
|
|
39
|
+
protected classes: i0.Signal<string[]>;
|
|
40
|
+
protected readonly String: StringConstructor;
|
|
41
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Button, never>;
|
|
42
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Button, "tls-button", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "appearance": { "alias": "appearance"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "href": { "alias": "href"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface ButtonConfig {
|
|
46
|
+
color: buttonColor;
|
|
47
|
+
appearance: buttonAppearance;
|
|
48
|
+
size: buttonSize;
|
|
49
|
+
type: buttonType;
|
|
50
|
+
}
|
|
51
|
+
declare const DEFAULT_BUTTON_CONFIG: ButtonConfig;
|
|
52
|
+
|
|
53
|
+
declare const BUTTON_CONFIG: InjectionToken<ButtonConfig>;
|
|
54
|
+
|
|
55
|
+
declare class Icon {
|
|
56
|
+
private _iconService;
|
|
57
|
+
private _config;
|
|
58
|
+
iconSrc: InputSignal<string>;
|
|
59
|
+
alt: InputSignal<string>;
|
|
60
|
+
allowedSources: InputSignal<string[]>;
|
|
61
|
+
protected isSvg: Signal<boolean>;
|
|
62
|
+
private _svgContentResource;
|
|
63
|
+
get svgContent(): Signal<SafeHtml>;
|
|
64
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Icon, never>;
|
|
65
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Icon, "tls-icon", never, { "iconSrc": { "alias": "iconSrc"; "required": true; "isSignal": true; }; "alt": { "alias": "alt"; "required": false; "isSignal": true; }; "allowedSources": { "alias": "allowedSources"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
interface IconConfig {
|
|
69
|
+
allowedSources: string[];
|
|
70
|
+
}
|
|
71
|
+
declare const DEFAULT_ICON_CONFIG: IconConfig;
|
|
72
|
+
|
|
73
|
+
declare const ICON_CONFIG: InjectionToken<IconConfig>;
|
|
74
|
+
|
|
75
|
+
declare abstract class FormControl implements FormUiControl {
|
|
76
|
+
readonly touched: ModelSignal<boolean>;
|
|
77
|
+
readonly name: InputSignal<string>;
|
|
78
|
+
readonly disabled: InputSignalWithTransform<boolean, unknown>;
|
|
79
|
+
readonly readonly: InputSignalWithTransform<boolean, unknown>;
|
|
80
|
+
readonly hidden: InputSignalWithTransform<boolean, unknown>;
|
|
81
|
+
readonly invalid: InputSignalWithTransform<boolean, unknown>;
|
|
82
|
+
readonly pending: InputSignalWithTransform<boolean, unknown>;
|
|
83
|
+
readonly dirty: InputSignalWithTransform<boolean, unknown>;
|
|
84
|
+
readonly errors: InputSignal<readonly WithOptionalFieldTree<ValidationError>[]>;
|
|
85
|
+
readonly required: InputSignalWithTransform<boolean, unknown>;
|
|
86
|
+
protected notInteractive: Signal<boolean>;
|
|
87
|
+
protected controlClasses: Signal<string[]>;
|
|
88
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormControl, never>;
|
|
89
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<FormControl, never, never, { "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "hidden": { "alias": "hidden"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "pending": { "alias": "pending"; "required": false; "isSignal": true; }; "dirty": { "alias": "dirty"; "required": false; "isSignal": true; }; "errors": { "alias": "errors"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; }, { "touched": "touchedChange"; }, never, never, true, never>;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
declare abstract class CheckboxFormControl extends FormControl implements FormCheckboxControl {
|
|
93
|
+
abstract readonly checked: ModelSignal<boolean>;
|
|
94
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CheckboxFormControl, never>;
|
|
95
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CheckboxFormControl, never, never, {}, {}, never, never, true, never>;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
declare abstract class ValueFormControl<T> extends FormControl implements FormValueControl<T> {
|
|
99
|
+
abstract readonly value: ModelSignal<T>;
|
|
100
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ValueFormControl<any>, never>;
|
|
101
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ValueFormControl<any>, never, never, {}, {}, never, never, true, never>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
type inputSize = controlSize;
|
|
105
|
+
|
|
106
|
+
declare class Input extends ValueFormControl<string> {
|
|
107
|
+
private _config;
|
|
108
|
+
readonly type: InputSignal<string>;
|
|
109
|
+
readonly value: ModelSignal<string>;
|
|
110
|
+
readonly inputId: InputSignal<string | null>;
|
|
111
|
+
readonly placeholder: InputSignal<string>;
|
|
112
|
+
readonly size: InputSignal<inputSize>;
|
|
113
|
+
protected readonly classes: Signal<string[]>;
|
|
114
|
+
protected onInput(event: Event): void;
|
|
115
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Input, never>;
|
|
116
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Input, "tls-input", never, { "type": { "alias": "type"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
interface InputConfig {
|
|
120
|
+
size: inputSize;
|
|
121
|
+
type: string;
|
|
122
|
+
placeholder: string;
|
|
123
|
+
}
|
|
124
|
+
declare const DEFAULT_INPUT_CONFIG: InputConfig;
|
|
125
|
+
|
|
126
|
+
declare class InputDirective {
|
|
127
|
+
readonly size: InputSignal<inputSize>;
|
|
128
|
+
protected readonly classes: Signal<string[]>;
|
|
129
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InputDirective, never>;
|
|
130
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<InputDirective, "[tlsInput]", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
declare const INPUT_CONFIG: InjectionToken<InputConfig>;
|
|
134
|
+
|
|
135
|
+
declare class Password extends ValueFormControl<string> {
|
|
136
|
+
private _config;
|
|
137
|
+
readonly value: ModelSignal<string>;
|
|
138
|
+
readonly visible: ModelSignal<boolean>;
|
|
139
|
+
readonly inputId: InputSignal<string | null>;
|
|
140
|
+
readonly placeholder: InputSignal<string>;
|
|
141
|
+
readonly size: InputSignal<inputSize>;
|
|
142
|
+
protected readonly classes: Signal<string[]>;
|
|
143
|
+
protected type: Signal<"text" | "password">;
|
|
144
|
+
protected onInput(event: Event): void;
|
|
145
|
+
protected toggle(): void;
|
|
146
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Password, never>;
|
|
147
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Password, "tls-password", never, { "value": { "alias": "value"; "required": false; "isSignal": true; }; "visible": { "alias": "visible"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "visible": "visibleChange"; }, never, never, true, never>;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
interface PasswordConfig {
|
|
151
|
+
size: inputSize;
|
|
152
|
+
placeholder: string;
|
|
153
|
+
}
|
|
154
|
+
declare const DEFAULT_PASSWORD_CONFIG: PasswordConfig;
|
|
155
|
+
|
|
156
|
+
declare const PASSWORD_CONFIG: InjectionToken<PasswordConfig>;
|
|
157
|
+
|
|
158
|
+
type switchColor = color;
|
|
159
|
+
|
|
160
|
+
declare class Switch extends CheckboxFormControl {
|
|
161
|
+
private _config;
|
|
162
|
+
readonly checked: ModelSignal<boolean>;
|
|
163
|
+
readonly inputId: InputSignal<string | undefined>;
|
|
164
|
+
readonly color: InputSignal<switchColor>;
|
|
165
|
+
readonly tabindex: InputSignal<string | number>;
|
|
166
|
+
protected readonly classes: Signal<string[]>;
|
|
167
|
+
protected toggle(): void;
|
|
168
|
+
protected onKeyboardToggle(event: Event): void;
|
|
169
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Switch, never>;
|
|
170
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Switch, "tls-switch", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; }, never, never, true, never>;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
interface SwitchConfig {
|
|
174
|
+
color: switchColor;
|
|
175
|
+
}
|
|
176
|
+
declare const DEFAULT_SWITCH_CONFIG: SwitchConfig;
|
|
177
|
+
|
|
178
|
+
declare const SWITCH_CONFIG: InjectionToken<SwitchConfig>;
|
|
179
|
+
|
|
180
|
+
type themeType = 'light' | 'dark';
|
|
181
|
+
|
|
182
|
+
declare class ThemeService {
|
|
183
|
+
private readonly _config;
|
|
184
|
+
private readonly _document;
|
|
185
|
+
private readonly _rendererFactory;
|
|
186
|
+
private readonly _platformId;
|
|
187
|
+
private readonly _renderer;
|
|
188
|
+
private readonly _isBrowser;
|
|
189
|
+
private readonly LS_THEME;
|
|
190
|
+
private _currentTheme;
|
|
191
|
+
constructor();
|
|
192
|
+
get currentTheme(): Signal<themeType>;
|
|
193
|
+
toggle(): void;
|
|
194
|
+
setTheme(theme: themeType): void;
|
|
195
|
+
private _detectSystemTheme;
|
|
196
|
+
private _initTheme;
|
|
197
|
+
private _initDefaultTheme;
|
|
198
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ThemeService, never>;
|
|
199
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ThemeService>;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
declare const provideThalassicUIConfig: (config: tlsUiConfigProvider) => EnvironmentProviders;
|
|
203
|
+
|
|
204
|
+
interface ThemeConfig {
|
|
205
|
+
localStorageKey: string;
|
|
206
|
+
defaultTheme: themeType | 'system';
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
declare const provideTheme: (config?: Partial<ThemeConfig>) => EnvironmentProviders;
|
|
210
|
+
|
|
211
|
+
export { BUTTON_CONFIG, Button, DEFAULT_BUTTON_CONFIG, DEFAULT_ICON_CONFIG, DEFAULT_INPUT_CONFIG, DEFAULT_PASSWORD_CONFIG, DEFAULT_SWITCH_CONFIG, ICON_CONFIG, INPUT_CONFIG, Icon, Input, InputDirective, PASSWORD_CONFIG, Password, SWITCH_CONFIG, Switch, ThemeService, provideThalassicUIConfig, provideTheme };
|
|
212
|
+
export type { ButtonConfig, IconConfig, InputConfig, PasswordConfig, SwitchConfig, color, controlSize, themeType, tlsUiConfigProvider };
|