@thalassic/ui 0.1.1 → 0.3.0
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/LICENSE.txt +21 -0
- package/features/button/button.scss +2 -42
- package/features/divider/divider.scss +91 -0
- package/features/form/input/input.scss +6 -0
- package/fesm2022/thalassic-ui.mjs +199 -61
- package/fesm2022/thalassic-ui.mjs.map +1 -1
- package/package.json +2 -1
- package/styles/components/_index.scss +1 -0
- package/styles/components/button/_button-appearance.scss +136 -0
- package/{features/button/button-color.scss → styles/components/button/_button-color.scss} +9 -9
- package/{features/button/button-size.scss → styles/components/button/_button-size.scss} +20 -15
- package/styles/components/button/_button.scss +49 -0
- package/styles/components/button/_index.scss +4 -0
- package/styles/components/form/{form-control/_form-control-group-size.scss → _form-control-group-size.scss} +7 -0
- package/styles/components/form/{form-control/_form-control-group.scss → _form-control-group.scss} +1 -0
- package/styles/components/form/{form-control/_form-control-size.scss → _form-control-size.scss} +7 -0
- package/styles/components/form/_index.scss +4 -0
- package/types/thalassic-ui.d.ts +125 -22
- package/features/button/button-appearance.scss +0 -144
- package/index.scss +0 -1
- package/styles/components/form/form-control/_index.scss +0 -5
- /package/styles/components/form/{form-control/_form-control-addon.scss → _form-control-addon.scss} +0 -0
- /package/styles/components/form/{form-control/_form-control.scss → _form-control.scss} +0 -0
- /package/styles/{_index.scss → index.scss} +0 -0
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
height: var(--tls-button-height);
|
|
4
|
-
padding-inline: var(--tls-button-padding-inline);
|
|
1
|
+
.tls-button {
|
|
2
|
+
--tls-button-width: auto;
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
letter-spacing: var(--tls-button-letter-spacing);
|
|
4
|
+
width: var(--tls-button-width);
|
|
5
|
+
height: var(--tls-button-height);
|
|
6
|
+
padding-inline: var(--tls-button-padding-inline);
|
|
10
7
|
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
font-size: var(--tls-button-font-size);
|
|
9
|
+
font-weight: var(--tls-button-font-weight);
|
|
10
|
+
line-height: var(--tls-button-line-height);
|
|
11
|
+
letter-spacing: var(--tls-button-letter-spacing);
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
&.tls-button--icon-only {
|
|
14
|
+
padding-inline: 0;
|
|
15
|
+
|
|
16
|
+
aspect-ratio: 1/1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.tls-button--fluid {
|
|
20
|
+
--tls-button-width: 100%;
|
|
16
21
|
}
|
|
17
22
|
|
|
18
|
-
|
|
23
|
+
&.tls-button--sm {
|
|
19
24
|
--tls-button-height: var(--control-height-sm);
|
|
20
25
|
--tls-button-padding-inline: var(--spacing-3);
|
|
21
26
|
|
|
@@ -25,7 +30,7 @@
|
|
|
25
30
|
--tls-button-letter-spacing: var(--font-label-small-letter-spacing);
|
|
26
31
|
}
|
|
27
32
|
|
|
28
|
-
|
|
33
|
+
&.tls-button--md {
|
|
29
34
|
--tls-button-height: var(--control-height-md);
|
|
30
35
|
--tls-button-padding-inline: var(--spacing-4);
|
|
31
36
|
|
|
@@ -35,7 +40,7 @@
|
|
|
35
40
|
--tls-button-letter-spacing: var(--font-label-medium-letter-spacing);
|
|
36
41
|
}
|
|
37
42
|
|
|
38
|
-
|
|
43
|
+
&.tls-button--lg {
|
|
39
44
|
--tls-button-height: var(--control-height-lg);
|
|
40
45
|
--tls-button-padding-inline: var(--spacing-5);
|
|
41
46
|
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
@use '../../mixins' as mixins;
|
|
2
|
+
|
|
3
|
+
.tls-button {
|
|
4
|
+
--tls-button-border-width: 1px;
|
|
5
|
+
|
|
6
|
+
position: relative;
|
|
7
|
+
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: 0.25rem;
|
|
12
|
+
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
user-select: none;
|
|
15
|
+
|
|
16
|
+
transition: color var(--motion-fast) var(--motion-ease-in-out);
|
|
17
|
+
|
|
18
|
+
&:focus-visible {
|
|
19
|
+
@include mixins.focus-ring;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&::before,
|
|
23
|
+
&::after {
|
|
24
|
+
content: '';
|
|
25
|
+
width: 100%;
|
|
26
|
+
height: 100%;
|
|
27
|
+
|
|
28
|
+
position: absolute;
|
|
29
|
+
z-index: -1;
|
|
30
|
+
|
|
31
|
+
border: var(--tls-button-border-width) solid var(--tls-button-color);
|
|
32
|
+
border-radius: var(--radius-md);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&::before {
|
|
36
|
+
transition:
|
|
37
|
+
background-color var(--motion-fast) var(--motion-ease-in-out),
|
|
38
|
+
opacity var(--motion-fast) var(--motion-ease-in-out);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&::after {
|
|
42
|
+
border: none;
|
|
43
|
+
border-radius: var(--radius-md);
|
|
44
|
+
|
|
45
|
+
transition:
|
|
46
|
+
border-color var(--motion-fast) var(--motion-ease-in-out),
|
|
47
|
+
box-shadow var(--motion-fast) var(--motion-ease-in-out);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
.tls-form-control-group {
|
|
2
|
+
--tls-form-control-group-width: auto;
|
|
3
|
+
|
|
4
|
+
width: var(--tls-form-control-group-width);
|
|
2
5
|
height: var(--tls-form-control-group-height);
|
|
3
6
|
padding-inline: var(--tls-form-control-group-padding-inline);
|
|
4
7
|
|
|
@@ -7,6 +10,10 @@
|
|
|
7
10
|
line-height: var(--tls-form-control-group-line-height);
|
|
8
11
|
letter-spacing: var(--tls-form-control-group-letter-spacing);
|
|
9
12
|
|
|
13
|
+
&.tls-form-control-group--fluid {
|
|
14
|
+
--tls-form-control-group-width: 100%;
|
|
15
|
+
}
|
|
16
|
+
|
|
10
17
|
&.tls-form-control-group--sm {
|
|
11
18
|
--tls-form-control-group-height: var(--control-height-sm);
|
|
12
19
|
--tls-form-control-group-padding-inline: var(--spacing-2);
|
package/styles/components/form/{form-control/_form-control-size.scss → _form-control-size.scss}
RENAMED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
.tls-form-control {
|
|
2
|
+
--tls-form-control-width: auto;
|
|
3
|
+
|
|
4
|
+
width: var(--tls-form-control-width);
|
|
2
5
|
height: var(--tls-form-control-height);
|
|
3
6
|
padding-inline: var(--tls-form-control-padding-inline);
|
|
4
7
|
|
|
@@ -7,6 +10,10 @@
|
|
|
7
10
|
line-height: var(--tls-form-control-line-height);
|
|
8
11
|
letter-spacing: var(--tls-form-control-letter-spacing);
|
|
9
12
|
|
|
13
|
+
&.tls-form-control--fluid {
|
|
14
|
+
--tls-form-control-width: 100%;
|
|
15
|
+
}
|
|
16
|
+
|
|
10
17
|
&.tls-form-control--sm {
|
|
11
18
|
--tls-form-control-height: var(--control-height-sm);
|
|
12
19
|
--tls-form-control-padding-inline: var(--spacing-2);
|
package/types/thalassic-ui.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { InputSignalWithTransform, Signal, InputSignal, InjectionToken, ModelSignal, EnvironmentProviders } from '@angular/core';
|
|
3
|
+
import * as _thalassic_ui from '@thalassic/ui';
|
|
3
4
|
import { FieldTree, FormUiControl, WithOptionalFieldTree, ValidationError, FormCheckboxControl, FormValueControl } from '@angular/forms/signals';
|
|
4
5
|
import { SafeHtml } from '@angular/platform-browser';
|
|
5
6
|
|
|
@@ -10,6 +11,7 @@ type controlSize = 'sm' | 'md' | 'lg';
|
|
|
10
11
|
interface tlsUiConfigProvider {
|
|
11
12
|
components: {
|
|
12
13
|
button?: Partial<ButtonConfig>;
|
|
14
|
+
divider?: Partial<DividerConfig>;
|
|
13
15
|
input?: Partial<InputConfig>;
|
|
14
16
|
password?: Partial<PasswordConfig>;
|
|
15
17
|
switch?: Partial<SwitchConfig>;
|
|
@@ -23,24 +25,53 @@ type buttonSize = controlSize;
|
|
|
23
25
|
type buttonAppearance = 'filled' | 'outlined' | 'text' | 'elevated';
|
|
24
26
|
type buttonColor = color;
|
|
25
27
|
|
|
26
|
-
declare class
|
|
28
|
+
declare abstract class ButtonBase {
|
|
29
|
+
protected _config: _thalassic_ui.ButtonConfig;
|
|
30
|
+
protected APPLY_HOST_CLASSES: boolean;
|
|
31
|
+
readonly disabled: InputSignalWithTransform<boolean, unknown>;
|
|
32
|
+
abstract readonly icon: Signal<string | boolean>;
|
|
33
|
+
readonly color: InputSignal<buttonColor>;
|
|
34
|
+
readonly appearance: InputSignal<buttonAppearance>;
|
|
35
|
+
readonly size: InputSignal<buttonSize>;
|
|
36
|
+
/** Whether the button stretches to fill its container's width. */
|
|
37
|
+
readonly fluid: InputSignalWithTransform<boolean, unknown>;
|
|
38
|
+
protected classes: Signal<string[]>;
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ButtonBase, never>;
|
|
40
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ButtonBase, never, never, { "disabled": { "alias": "disabled"; "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; }; "fluid": { "alias": "fluid"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare class Button extends ButtonBase {
|
|
27
44
|
private _routerLink;
|
|
28
|
-
|
|
29
|
-
label
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
45
|
+
protected APPLY_HOST_CLASSES: boolean;
|
|
46
|
+
/** The text label displayed inside the button. Takes priority over projected content. */
|
|
47
|
+
readonly label: InputSignal<string | undefined>;
|
|
48
|
+
readonly type: InputSignal<buttonType>;
|
|
49
|
+
/**
|
|
50
|
+
* Icon to display on the button. Accepts:
|
|
51
|
+
* - A string icon name to render a specific icon.
|
|
52
|
+
* - An empty string or boolean `true` to render an icon-only button (using a projected icon).
|
|
53
|
+
* - `false` to render no icon.
|
|
54
|
+
*/
|
|
55
|
+
readonly icon: InputSignalWithTransform<string | boolean, unknown>;
|
|
56
|
+
/** An optional URL that causes the button to render as an anchor link. */
|
|
57
|
+
readonly href: InputSignal<string | null>;
|
|
58
|
+
readonly tabindex: InputSignal<string>;
|
|
38
59
|
protected isLink: i0.Signal<boolean>;
|
|
39
60
|
protected isIconString: i0.Signal<boolean>;
|
|
40
|
-
protected classes: i0.Signal<string[]>;
|
|
41
61
|
protected readonly String: StringConstructor;
|
|
42
62
|
static ɵfac: i0.ɵɵFactoryDeclaration<Button, never>;
|
|
43
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<Button, "tls-button", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "
|
|
63
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Button, "tls-button", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "href": { "alias": "href"; "required": false; "isSignal": true; }; "tabindex": { "alias": "tabindex"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
declare class ButtonDirective extends ButtonBase {
|
|
67
|
+
/**
|
|
68
|
+
* Whether the button is in icon-only mode (uses a projected icon).
|
|
69
|
+
* - `true` to render an icon-only button.
|
|
70
|
+
* - `false` (default) to render a standard button with no icon-only styling.
|
|
71
|
+
*/
|
|
72
|
+
readonly icon: InputSignalWithTransform<boolean, unknown>;
|
|
73
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ButtonDirective, never>;
|
|
74
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ButtonDirective, "[tlsButton]", never, { "icon": { "alias": "icon"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
44
75
|
}
|
|
45
76
|
|
|
46
77
|
interface ButtonConfig {
|
|
@@ -48,11 +79,37 @@ interface ButtonConfig {
|
|
|
48
79
|
appearance: buttonAppearance;
|
|
49
80
|
size: buttonSize;
|
|
50
81
|
type: buttonType;
|
|
82
|
+
fluid: boolean;
|
|
51
83
|
}
|
|
52
84
|
declare const DEFAULT_BUTTON_CONFIG: ButtonConfig;
|
|
53
85
|
|
|
54
86
|
declare const BUTTON_CONFIG: InjectionToken<ButtonConfig>;
|
|
55
87
|
|
|
88
|
+
type dividerOrientation = 'horizontal' | 'vertical';
|
|
89
|
+
type dividerContentPosition = 'start' | 'center' | 'end';
|
|
90
|
+
type dividerVariant = 'dashed' | 'dotted' | 'solid';
|
|
91
|
+
|
|
92
|
+
declare class Divider {
|
|
93
|
+
private _config;
|
|
94
|
+
orientation: InputSignal<dividerOrientation>;
|
|
95
|
+
position: InputSignal<dividerContentPosition>;
|
|
96
|
+
variant: InputSignal<dividerVariant>;
|
|
97
|
+
flush: InputSignalWithTransform<boolean, unknown>;
|
|
98
|
+
protected hostClasses: i0.Signal<string[]>;
|
|
99
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Divider, never>;
|
|
100
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Divider, "tls-divider", never, { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "position": { "alias": "position"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "flush": { "alias": "flush"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
interface DividerConfig {
|
|
104
|
+
orientation: dividerOrientation;
|
|
105
|
+
position: dividerContentPosition;
|
|
106
|
+
variant: dividerVariant;
|
|
107
|
+
flush: boolean;
|
|
108
|
+
}
|
|
109
|
+
declare const DEFAULT_DIVIDER_CONFIG: DividerConfig;
|
|
110
|
+
|
|
111
|
+
declare const DIVIDER_CONFIG: InjectionToken<DividerConfig>;
|
|
112
|
+
|
|
56
113
|
type ErrorMessageFn = (fieldTree?: FieldTree<unknown>) => string;
|
|
57
114
|
type ErrorMessageMap = Record<string, ErrorMessageFn>;
|
|
58
115
|
|
|
@@ -142,24 +199,28 @@ declare class Input extends ValueFormControl<string> {
|
|
|
142
199
|
readonly inputId: InputSignal<string | null>;
|
|
143
200
|
readonly placeholder: InputSignal<string>;
|
|
144
201
|
readonly size: InputSignal<inputSize>;
|
|
202
|
+
readonly fluid: InputSignalWithTransform<boolean, unknown>;
|
|
145
203
|
protected readonly classes: Signal<string[]>;
|
|
146
204
|
protected onInput(event: Event): void;
|
|
147
205
|
static ɵfac: i0.ɵɵFactoryDeclaration<Input, never>;
|
|
148
|
-
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>;
|
|
206
|
+
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; }; "fluid": { "alias": "fluid"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
149
207
|
}
|
|
150
208
|
|
|
151
209
|
interface InputConfig {
|
|
152
210
|
size: inputSize;
|
|
153
211
|
type: string;
|
|
154
212
|
placeholder: string;
|
|
213
|
+
fluid: boolean;
|
|
155
214
|
}
|
|
156
215
|
declare const DEFAULT_INPUT_CONFIG: InputConfig;
|
|
157
216
|
|
|
158
217
|
declare class InputDirective {
|
|
218
|
+
private _config;
|
|
159
219
|
readonly size: InputSignal<inputSize>;
|
|
220
|
+
readonly fluid: InputSignalWithTransform<boolean, unknown>;
|
|
160
221
|
protected readonly classes: Signal<string[]>;
|
|
161
222
|
static ɵfac: i0.ɵɵFactoryDeclaration<InputDirective, never>;
|
|
162
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<InputDirective, "[tlsInput]", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
223
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<InputDirective, "[tlsInput]", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; "fluid": { "alias": "fluid"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
163
224
|
}
|
|
164
225
|
|
|
165
226
|
declare const INPUT_CONFIG: InjectionToken<InputConfig>;
|
|
@@ -171,17 +232,19 @@ declare class Password extends ValueFormControl<string> {
|
|
|
171
232
|
readonly inputId: InputSignal<string | null>;
|
|
172
233
|
readonly placeholder: InputSignal<string>;
|
|
173
234
|
readonly size: InputSignal<inputSize>;
|
|
235
|
+
readonly fluid: InputSignalWithTransform<boolean, unknown>;
|
|
174
236
|
protected readonly classes: Signal<string[]>;
|
|
175
237
|
protected type: Signal<"text" | "password">;
|
|
176
238
|
protected onInput(event: Event): void;
|
|
177
239
|
protected toggle(): void;
|
|
178
240
|
static ɵfac: i0.ɵɵFactoryDeclaration<Password, never>;
|
|
179
|
-
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>;
|
|
241
|
+
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; }; "fluid": { "alias": "fluid"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "visible": "visibleChange"; }, never, never, true, never>;
|
|
180
242
|
}
|
|
181
243
|
|
|
182
244
|
interface PasswordConfig {
|
|
183
245
|
size: inputSize;
|
|
184
246
|
placeholder: string;
|
|
247
|
+
fluid: boolean;
|
|
185
248
|
}
|
|
186
249
|
declare const DEFAULT_PASSWORD_CONFIG: PasswordConfig;
|
|
187
250
|
|
|
@@ -252,6 +315,11 @@ declare const ICON_CONFIG: InjectionToken<IconConfig>;
|
|
|
252
315
|
|
|
253
316
|
type themeType = 'light' | 'dark';
|
|
254
317
|
|
|
318
|
+
type themePreference = 'light' | 'dark' | 'system';
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Service responsible for managing the application's theme (light/dark/system).
|
|
322
|
+
*/
|
|
255
323
|
declare class ThemeService {
|
|
256
324
|
private readonly _config;
|
|
257
325
|
private readonly _document;
|
|
@@ -261,13 +329,48 @@ declare class ThemeService {
|
|
|
261
329
|
private readonly _isBrowser;
|
|
262
330
|
private readonly LS_THEME;
|
|
263
331
|
private _currentTheme;
|
|
332
|
+
private _currentThemePreference;
|
|
264
333
|
constructor();
|
|
334
|
+
/**
|
|
335
|
+
* A readonly signal of the currently applied theme (`'light'` or `'dark'`).
|
|
336
|
+
* Reflects the resolved theme even when the preference is `'system'`.
|
|
337
|
+
*/
|
|
265
338
|
get currentTheme(): Signal<themeType>;
|
|
339
|
+
/**
|
|
340
|
+
* A readonly signal of the user's selected theme preference (`'light'`, `'dark'`, or `'system'`).
|
|
341
|
+
*/
|
|
342
|
+
get currentThemePreference(): Signal<themePreference>;
|
|
343
|
+
/**
|
|
344
|
+
* Toggles between `'light'` and `'dark'` themes based on the currently applied theme.
|
|
345
|
+
* Does not toggle to `'system'`.
|
|
346
|
+
*/
|
|
266
347
|
toggle(): void;
|
|
267
|
-
|
|
348
|
+
/**
|
|
349
|
+
* Sets the theme preference and applies the corresponding theme to the document.
|
|
350
|
+
* When `'system'` is passed, the theme is resolved from the OS color scheme preference.
|
|
351
|
+
*
|
|
352
|
+
* @param preference - The desired theme preference: `'light'`, `'dark'`, or `'system'`.
|
|
353
|
+
*/
|
|
354
|
+
setTheme(preference: themePreference): void;
|
|
355
|
+
/**
|
|
356
|
+
* Applies the given theme to the document root element by toggling theme CSS classes.
|
|
357
|
+
*
|
|
358
|
+
* @param theme - The theme to apply: `'light'` or `'dark'`.
|
|
359
|
+
*/
|
|
360
|
+
private _applyTheme;
|
|
361
|
+
/**
|
|
362
|
+
* Detects the OS-level color scheme preference using the `prefers-color-scheme` media query.
|
|
363
|
+
*
|
|
364
|
+
* @returns `'dark'` if the OS prefers dark mode, otherwise `'light'`.
|
|
365
|
+
*/
|
|
268
366
|
private _detectSystemTheme;
|
|
367
|
+
/**
|
|
368
|
+
* Initializes the theme on app startup (browser only).
|
|
369
|
+
* Reads the stored preference from localStorage, falling back to the configured default.
|
|
370
|
+
* Also registers a listener for OS color scheme changes to reactively update the theme
|
|
371
|
+
* when the preference is `'system'`.
|
|
372
|
+
*/
|
|
269
373
|
private _initTheme;
|
|
270
|
-
private _initDefaultTheme;
|
|
271
374
|
static ɵfac: i0.ɵɵFactoryDeclaration<ThemeService, never>;
|
|
272
375
|
static ɵprov: i0.ɵɵInjectableDeclaration<ThemeService>;
|
|
273
376
|
}
|
|
@@ -276,10 +379,10 @@ declare const provideThalassicUIConfig: (config: tlsUiConfigProvider) => Environ
|
|
|
276
379
|
|
|
277
380
|
interface ThemeConfig {
|
|
278
381
|
localStorageKey: string;
|
|
279
|
-
defaultTheme:
|
|
382
|
+
defaultTheme: themePreference;
|
|
280
383
|
}
|
|
281
384
|
|
|
282
385
|
declare const provideTheme: (config?: Partial<ThemeConfig>) => EnvironmentProviders;
|
|
283
386
|
|
|
284
|
-
export { BUTTON_CONFIG, Button, CHECKBOX_CONFIG, Checkbox, DEFAULT_BUTTON_CONFIG, DEFAULT_CHECKBOX_CONFIG, DEFAULT_FORM_ITEM_CONFIG, DEFAULT_ICON_CONFIG, DEFAULT_INPUT_CONFIG, DEFAULT_PASSWORD_CONFIG, DEFAULT_RADIO_BUTTON_CONFIG, DEFAULT_SWITCH_CONFIG, FORM_ITEM_CONFIG, FormItem, ICON_CONFIG, INPUT_CONFIG, Icon, Input, InputDirective, PASSWORD_CONFIG, Password, RADIO_BUTTON_CONFIG, RadioButton, SWITCH_CONFIG, Switch, ThemeService, provideThalassicUIConfig, provideTheme };
|
|
285
|
-
export type { ButtonConfig, CheckboxConfig, FormItemConfig, IconConfig, InputConfig, PasswordConfig, RadioButtonConfig, SwitchConfig, color, controlSize, themeType, tlsUiConfigProvider };
|
|
387
|
+
export { BUTTON_CONFIG, Button, ButtonDirective, CHECKBOX_CONFIG, Checkbox, DEFAULT_BUTTON_CONFIG, DEFAULT_CHECKBOX_CONFIG, DEFAULT_DIVIDER_CONFIG, DEFAULT_FORM_ITEM_CONFIG, DEFAULT_ICON_CONFIG, DEFAULT_INPUT_CONFIG, DEFAULT_PASSWORD_CONFIG, DEFAULT_RADIO_BUTTON_CONFIG, DEFAULT_SWITCH_CONFIG, DIVIDER_CONFIG, Divider, FORM_ITEM_CONFIG, FormItem, ICON_CONFIG, INPUT_CONFIG, Icon, Input, InputDirective, PASSWORD_CONFIG, Password, RADIO_BUTTON_CONFIG, RadioButton, SWITCH_CONFIG, Switch, ThemeService, provideThalassicUIConfig, provideTheme };
|
|
388
|
+
export type { ButtonConfig, CheckboxConfig, DividerConfig, FormItemConfig, IconConfig, InputConfig, PasswordConfig, RadioButtonConfig, SwitchConfig, color, controlSize, themePreference, themeType, tlsUiConfigProvider };
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
.tls-button {
|
|
3
|
-
@mixin hover-focus-state {
|
|
4
|
-
&:not(.tls-button--disabled):hover,
|
|
5
|
-
&:not(.tls-button--disabled):focus-visible {
|
|
6
|
-
@content;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
@mixin active-state {
|
|
11
|
-
&:not(.tls-button--disabled):active {
|
|
12
|
-
@content;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Appearances
|
|
17
|
-
&--filled {
|
|
18
|
-
.tls-button__content {
|
|
19
|
-
color: var(--tls-button-on-color);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.tls-button__background {
|
|
23
|
-
background-color: var(--tls-button-color);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
@include hover-focus-state {
|
|
27
|
-
.tls-button__background {
|
|
28
|
-
opacity: 0.85;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
@include active-state {
|
|
33
|
-
.tls-button__background {
|
|
34
|
-
opacity: 0.75;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
&--outlined {
|
|
40
|
-
.tls-button__content {
|
|
41
|
-
color: var(--tls-button-color);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.tls-button__background {
|
|
45
|
-
background-color: var(--tls-button-color);
|
|
46
|
-
|
|
47
|
-
opacity: 0;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
@include hover-focus-state {
|
|
51
|
-
.tls-button__background {
|
|
52
|
-
opacity: 0.075;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
@include active-state {
|
|
57
|
-
.tls-button__background {
|
|
58
|
-
opacity: 0.15;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
&--text {
|
|
64
|
-
border-color: transparent;
|
|
65
|
-
|
|
66
|
-
.tls-button__content {
|
|
67
|
-
color: var(--tls-button-color);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.tls-button__background {
|
|
71
|
-
background-color: var(--tls-button-color);
|
|
72
|
-
|
|
73
|
-
opacity: 0;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
@include hover-focus-state {
|
|
77
|
-
.tls-button__background {
|
|
78
|
-
opacity: 0.075;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
@include active-state {
|
|
83
|
-
.tls-button__background {
|
|
84
|
-
opacity: 0.15;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
&--elevated {
|
|
90
|
-
border: none;
|
|
91
|
-
|
|
92
|
-
box-shadow: var(--shadow-sm);
|
|
93
|
-
|
|
94
|
-
transition: box-shadow var(--motion-fast) var(--motion-ease-in-out);
|
|
95
|
-
|
|
96
|
-
.tls-button__content {
|
|
97
|
-
color: var(--tls-button-color);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.tls-button__background {
|
|
101
|
-
background-color: var(--tls-button-color);
|
|
102
|
-
|
|
103
|
-
opacity: 0;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
&:not(.tls-button--disabled) {
|
|
107
|
-
padding-inline: calc(var(--tls-button-padding-inline) + var(--tls-button-border-width));
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
@include hover-focus-state {
|
|
111
|
-
box-shadow: var(--shadow-md);
|
|
112
|
-
|
|
113
|
-
.tls-button__background {
|
|
114
|
-
opacity: 0.075;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
@include active-state {
|
|
119
|
-
box-shadow: var(--shadow-sm);
|
|
120
|
-
|
|
121
|
-
.tls-button__background {
|
|
122
|
-
opacity: 0.15;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
&--disabled {
|
|
128
|
-
cursor: not-allowed;
|
|
129
|
-
|
|
130
|
-
border: var(--tls-button-border-width) solid var(--color-outline);
|
|
131
|
-
|
|
132
|
-
box-shadow: none;
|
|
133
|
-
|
|
134
|
-
.tls-button__content {
|
|
135
|
-
color: var(--tls-button-on-color);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
.tls-button__background {
|
|
139
|
-
opacity: 1;
|
|
140
|
-
transition: none;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
package/index.scss
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@forward 'styles';
|
/package/styles/components/form/{form-control/_form-control-addon.scss → _form-control-addon.scss}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|