@sixbell-telco/sdk 2.1.0 → 3.1.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/CHANGELOG.md +82 -1
- package/README.md +323 -84
- package/_index.css +17 -3
- package/components/card/card-actions/card-actions.component.d.ts +4 -4
- package/components/card/card-body/card-body.component.d.ts +5 -0
- package/components/card/card-context.d.ts +8 -0
- package/components/card/card-footer/card-footer.component.d.ts +7 -0
- package/components/card/card-header/card-header.component.d.ts +5 -0
- package/components/card/card-header-aside/card-header-aside.component.d.ts +5 -0
- package/components/card/card-section/card-section.component.d.ts +5 -0
- package/components/card/card-section-body/card-section-body.component.d.ts +13 -0
- package/components/card/card-section-footer/card-section-footer.component.d.ts +5 -0
- package/components/card/card-section-group/card-section-group.component.d.ts +16 -0
- package/components/card/card-section-header/card-section-header.component.d.ts +5 -0
- package/components/card/card-section-header-aside/card-section-header-aside.component.d.ts +5 -0
- package/components/card/card-subtitle/card-subtitle.component.d.ts +34 -0
- package/components/card/card-title/card-title.component.d.ts +23 -14
- package/components/card/public-api.d.ts +12 -1
- package/components/card/src/card.component.d.ts +5 -1
- package/components/data-table/actions/actions.component.d.ts +67 -0
- package/components/data-table/actions/actions.types.d.ts +38 -0
- package/components/data-table/public-api.d.ts +2 -0
- package/components/data-table/sortable-header/sortable-header.component.d.ts +2 -0
- package/components/data-table/src/data-table.component.d.ts +14 -5
- package/{directives/typography → components/divider}/index.d.ts +1 -1
- package/components/divider/public-api.d.ts +1 -0
- package/components/divider/src/divider.component.d.ts +13 -0
- package/components/forms/date-picker/src/date-picker.component.d.ts +3 -0
- package/components/forms/form-error/src/form-error.component.d.ts +8 -1
- package/components/forms/input/src/input.component.d.ts +1 -12
- package/components/forms/textarea/src/textarea.component.d.ts +1 -6
- package/components/paginator/components/pagination-item/pagination-item.component.d.ts +10 -1
- package/components/paginator/src/paginator.component.d.ts +7 -1
- package/components/table/public-api.d.ts +1 -0
- package/components/table/src/table.component.d.ts +37 -4
- package/components/table/table-action/table-action.component.d.ts +2 -6
- package/components/table/table-actions/table-actions.component.d.ts +52 -6
- package/components/table/table-actions/table-actions.types.d.ts +28 -0
- package/components/{toast → text}/index.d.ts +1 -1
- package/components/text/public-api.d.ts +2 -0
- package/components/text/src/text.component.d.ts +38 -0
- package/directives/only-numbers/public-api.d.ts +0 -5
- package/directives/only-numbers/src/only-numbers.directive.d.ts +1 -13
- package/directives/text/index.d.ts +5 -0
- package/directives/text/public-api.d.ts +1 -0
- package/directives/text/src/text.directive.d.ts +87 -0
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs +9 -9
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs +10 -11
- package/fesm2022/sixbell-telco-sdk-components-avatar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-button.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-card.mjs +428 -47
- package/fesm2022/sixbell-telco-sdk-components-card.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +202 -51
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs +5 -5
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-divider.mjs +44 -0
- package/fesm2022/sixbell-telco-sdk-components-divider.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs +6 -6
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs +21 -5
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs +12 -5
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +3 -15
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-radio.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-range.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +5 -11
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-forms-toggle.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-icon.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-icon.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-link.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-link.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +46 -18
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-progress.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-table.mjs +439 -47
- package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-text.mjs +308 -0
- package/fesm2022/sixbell-telco-sdk-components-text.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +12 -12
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs +5 -22
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-text.mjs +160 -0
- package/fesm2022/sixbell-telco-sdk-directives-text.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-formatting.mjs +490 -0
- package/fesm2022/sixbell-telco-sdk-utils-formatting.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs +49 -1
- package/fesm2022/sixbell-telco-sdk-utils-translation.mjs.map +1 -1
- package/package.json +100 -92
- package/utils/formatting/README.md +100 -0
- package/utils/formatting/index.d.ts +5 -0
- package/utils/formatting/public-api.d.ts +9 -0
- package/utils/formatting/src/constants/constants.d.ts +18 -0
- package/utils/formatting/src/models/formatting.d.ts +33 -0
- package/utils/formatting/src/pipes/currency/st-currency.pipe.d.ts +9 -0
- package/utils/formatting/src/pipes/date/st-date.pipe.d.ts +9 -0
- package/utils/formatting/src/pipes/decimal/st-decimal.pipe.d.ts +9 -0
- package/utils/formatting/src/pipes/percent/st-percent.pipe.d.ts +9 -0
- package/utils/formatting/src/service/formatting.service.d.ts +13 -0
- package/utils/formatting/src/utils/date-format/date-format.d.ts +9 -0
- package/utils/formatting/src/utils/number-format/number-format.d.ts +12 -0
- package/utils/logger/README.md +8 -19
- package/utils/runtime-config/README.md +1 -1
- package/utils/theme/README.md +21 -2
- package/utils/translation/README.md +40 -10
- package/utils/translation/public-api.d.ts +1 -1
- package/utils/translation/src/constants.d.ts +9 -2
- package/utils/translation/src/models/translation.d.ts +11 -0
- package/utils/translation/src/providers/translation.provider.d.ts +1 -1
- package/utils/translation/src/translation.service.d.ts +6 -1
- package/assets/styles/toast.css +0 -63
- package/components/card/card-content/card-content.component.d.ts +0 -30
- package/components/toast/public-api.d.ts +0 -12
- package/components/toast/services/toast.service.d.ts +0 -35
- package/components/toast/toast-message/toast-message.component.d.ts +0 -70
- package/components/toast/toasts-container/toasts-container.component.d.ts +0 -21
- package/directives/typography/public-api.d.ts +0 -1
- package/directives/typography/src/typography.directive.d.ts +0 -68
- package/fesm2022/sixbell-telco-sdk-components-toast.mjs +0 -250
- package/fesm2022/sixbell-telco-sdk-components-toast.mjs.map +0 -1
- package/fesm2022/sixbell-telco-sdk-directives-typography.mjs +0 -126
- package/fesm2022/sixbell-telco-sdk-directives-typography.mjs.map +0 -1
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, computed, Injectable, input, output, Component, inject } from '@angular/core';
|
|
3
|
-
import { generateUniqueId } from '@sixbell-telco/sdk/utils/generators/uuid';
|
|
4
|
-
import { NgClass } from '@angular/common';
|
|
5
|
-
import { IconComponent } from '@sixbell-telco/sdk/components/icon';
|
|
6
|
-
import { matCheckCircleOutline, matWarningOutline, matErrorOutline, matInfoOutline } from '@sixbell-telco/sdk/components/icon/material/outline';
|
|
7
|
-
import { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';
|
|
8
|
-
import { cn } from '@sixbell-telco/sdk/utils/cn';
|
|
9
|
-
import { cva } from 'class-variance-authority';
|
|
10
|
-
|
|
11
|
-
var ToastTypes;
|
|
12
|
-
(function (ToastTypes) {
|
|
13
|
-
ToastTypes["SUCCESS"] = "toast-success";
|
|
14
|
-
ToastTypes["ERROR"] = "toast-error";
|
|
15
|
-
ToastTypes["INFO"] = "toast-info";
|
|
16
|
-
ToastTypes["WARNING"] = "toast-warning";
|
|
17
|
-
})(ToastTypes || (ToastTypes = {}));
|
|
18
|
-
/**
|
|
19
|
-
* @deprecated This toast service is deprecated. Use @sixbell-telco/sdk/components/sonner instead.
|
|
20
|
-
*/
|
|
21
|
-
class ToastService {
|
|
22
|
-
toastsSignal = signal([]);
|
|
23
|
-
expandedSignal = signal(false);
|
|
24
|
-
// Create computed signals for derived state
|
|
25
|
-
toasts = computed(() => this.toastsSignal());
|
|
26
|
-
expanded = computed(() => this.expandedSignal());
|
|
27
|
-
isEmpty = computed(() => this.toasts().length === 0);
|
|
28
|
-
notify(type, message, title = '', duration = 10000) {
|
|
29
|
-
console.warn('ToastService is deprecated. Migrate to @sixbell-telco/sdk/components/sonner.');
|
|
30
|
-
const toast = {
|
|
31
|
-
id: generateUniqueId(),
|
|
32
|
-
type,
|
|
33
|
-
message,
|
|
34
|
-
title,
|
|
35
|
-
duration,
|
|
36
|
-
animate: 'enter',
|
|
37
|
-
};
|
|
38
|
-
// Create a new array reference to ensure change detection
|
|
39
|
-
this.toastsSignal.update((toasts) => [toast, ...toasts]);
|
|
40
|
-
this.scheduleDismiss(toast);
|
|
41
|
-
}
|
|
42
|
-
scheduleDismiss(toast) {
|
|
43
|
-
setTimeout(() => {
|
|
44
|
-
this.remove(toast);
|
|
45
|
-
}, toast.duration);
|
|
46
|
-
}
|
|
47
|
-
animateRemoval(toast) {
|
|
48
|
-
this.toastsSignal.update((toasts) => toasts.map((t) => (t.id === toast.id ? { ...t, animate: 'leave' } : t)));
|
|
49
|
-
}
|
|
50
|
-
remove(toast) {
|
|
51
|
-
this.toastsSignal.update((toasts) => toasts.filter((t) => t.id !== toast.id));
|
|
52
|
-
if (this.isEmpty()) {
|
|
53
|
-
this.collapse();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
clear() {
|
|
57
|
-
this.toastsSignal.set([]);
|
|
58
|
-
this.collapse();
|
|
59
|
-
}
|
|
60
|
-
toggle() {
|
|
61
|
-
this.expandedSignal.update((expanded) => !expanded);
|
|
62
|
-
}
|
|
63
|
-
collapse() {
|
|
64
|
-
this.expandedSignal.set(false);
|
|
65
|
-
}
|
|
66
|
-
expand() {
|
|
67
|
-
this.expandedSignal.set(true);
|
|
68
|
-
}
|
|
69
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: ToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
70
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: ToastService, providedIn: 'root' });
|
|
71
|
-
}
|
|
72
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: ToastService, decorators: [{
|
|
73
|
-
type: Injectable,
|
|
74
|
-
args: [{
|
|
75
|
-
providedIn: 'root',
|
|
76
|
-
}]
|
|
77
|
-
}] });
|
|
78
|
-
|
|
79
|
-
const toastComponent = cva([
|
|
80
|
-
'toast-message bg-base-200 ease-ease-in-and-out-back relative mb-2 flex h-20 min-h-20 w-[400px] cursor-pointer items-center rounded-lg border-2 p-2 transition-all duration-300',
|
|
81
|
-
], {
|
|
82
|
-
variants: {
|
|
83
|
-
variant: {
|
|
84
|
-
info: ['border-primary', 'text-primary'],
|
|
85
|
-
success: ['border-success', 'text-success'],
|
|
86
|
-
warning: ['border-warning', 'text-warning'],
|
|
87
|
-
error: ['border-error', 'text-error'],
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
compoundVariants: [],
|
|
91
|
-
defaultVariants: {
|
|
92
|
-
variant: 'info',
|
|
93
|
-
},
|
|
94
|
-
});
|
|
95
|
-
/**
|
|
96
|
-
* @deprecated This component is deprecated. Use @sixbell-telco/sdk/components/sonner instead.
|
|
97
|
-
*/
|
|
98
|
-
class ToastMessageComponent {
|
|
99
|
-
variant = input();
|
|
100
|
-
classes = input('');
|
|
101
|
-
types = ToastTypes;
|
|
102
|
-
toast = input.required();
|
|
103
|
-
toastAmount = input.required();
|
|
104
|
-
toastIndex = input.required();
|
|
105
|
-
clicked = output();
|
|
106
|
-
/**
|
|
107
|
-
* Stop event propagation for activation events
|
|
108
|
-
* @defaultValue false
|
|
109
|
-
*/
|
|
110
|
-
stopPropagation = input(false);
|
|
111
|
-
/**
|
|
112
|
-
* Event emitted on pointer down
|
|
113
|
-
*/
|
|
114
|
-
pointerDown = output();
|
|
115
|
-
/**
|
|
116
|
-
* Event emitted on Enter keydown
|
|
117
|
-
*/
|
|
118
|
-
keyDownEnter = output();
|
|
119
|
-
/**
|
|
120
|
-
* Event emitted on Space keydown
|
|
121
|
-
*/
|
|
122
|
-
keyDownSpace = output();
|
|
123
|
-
/**
|
|
124
|
-
* Event emitted on activation (click or keyboard)
|
|
125
|
-
*/
|
|
126
|
-
triggered = output();
|
|
127
|
-
iconCheckCircle = matCheckCircleOutline;
|
|
128
|
-
iconWarning = matWarningOutline;
|
|
129
|
-
iconError = matErrorOutline;
|
|
130
|
-
iconInfo = matInfoOutline;
|
|
131
|
-
componentClass = computed(() => {
|
|
132
|
-
const toast = this.toast();
|
|
133
|
-
const classes = this.classes();
|
|
134
|
-
switch (toast.type) {
|
|
135
|
-
case this.types.SUCCESS:
|
|
136
|
-
return cn(toastComponent({ variant: 'success', class: classes }));
|
|
137
|
-
case this.types.ERROR:
|
|
138
|
-
return cn(toastComponent({ variant: 'error', class: classes }));
|
|
139
|
-
case this.types.WARNING:
|
|
140
|
-
return cn(toastComponent({ variant: 'warning', class: classes }));
|
|
141
|
-
case this.types.INFO:
|
|
142
|
-
return cn(toastComponent({ variant: 'info', class: classes }));
|
|
143
|
-
default:
|
|
144
|
-
return cn(toastComponent({ variant: 'info', class: classes }));
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
handleClose() {
|
|
148
|
-
this.clicked.emit(this.toast());
|
|
149
|
-
this.triggered.emit();
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* @internal
|
|
153
|
-
* Handle click activation
|
|
154
|
-
*/
|
|
155
|
-
handleClick(event) {
|
|
156
|
-
if (this.stopPropagation()) {
|
|
157
|
-
event.stopPropagation();
|
|
158
|
-
}
|
|
159
|
-
this.handleClose();
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* @internal
|
|
163
|
-
* Handle pointer down activation
|
|
164
|
-
*/
|
|
165
|
-
handlePointerDown(event) {
|
|
166
|
-
if (this.stopPropagation()) {
|
|
167
|
-
event.stopPropagation();
|
|
168
|
-
}
|
|
169
|
-
this.pointerDown.emit(event);
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* @internal
|
|
173
|
-
* Handle Enter key activation
|
|
174
|
-
*/
|
|
175
|
-
handleKeyDownEnter(event) {
|
|
176
|
-
if (this.stopPropagation()) {
|
|
177
|
-
event.stopPropagation();
|
|
178
|
-
}
|
|
179
|
-
this.keyDownEnter.emit(event);
|
|
180
|
-
this.handleClose();
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* @internal
|
|
184
|
-
* Handle Space key activation
|
|
185
|
-
*/
|
|
186
|
-
handleKeyDownSpace(event) {
|
|
187
|
-
event.preventDefault();
|
|
188
|
-
if (this.stopPropagation()) {
|
|
189
|
-
event.stopPropagation();
|
|
190
|
-
}
|
|
191
|
-
this.keyDownSpace.emit(event);
|
|
192
|
-
this.handleClose();
|
|
193
|
-
}
|
|
194
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: ToastMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
195
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.0", type: ToastMessageComponent, isStandalone: true, selector: "st-toast-message", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, classes: { classPropertyName: "classes", publicName: "classes", isSignal: true, isRequired: false, transformFunction: null }, toast: { classPropertyName: "toast", publicName: "toast", isSignal: true, isRequired: true, transformFunction: null }, toastAmount: { classPropertyName: "toastAmount", publicName: "toastAmount", isSignal: true, isRequired: true, transformFunction: null }, toastIndex: { classPropertyName: "toastIndex", publicName: "toastIndex", isSignal: true, isRequired: true, transformFunction: null }, stopPropagation: { classPropertyName: "stopPropagation", publicName: "stopPropagation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked", pointerDown: "pointerDown", keyDownEnter: "keyDownEnter", keyDownSpace: "keyDownSpace", triggered: "triggered" }, ngImport: i0, template: "<li\n\t[class]=\"componentClass()\"\n\t[ngClass]=\"{\n\t\t'animate-toast-slide-out bottom-0': toast().animate === 'leave' && toastAmount() > 1,\n\t\t'animate-slide-out': toast().animate === 'leave' && toastAmount() === 1,\n\t\t'animate-fade-out': toast().animate === 'leave' && toastAmount() > 1 && toastIndex() === 0,\n\t\t'animate-slide-in': toast().animate === 'enter',\n\t}\"\n\t(pointerdown)=\"handlePointerDown($event)\"\n\t(click)=\"handleClick($event)\"\n\t(keydown.enter)=\"handleKeyDownEnter($event)\"\n\t(keydown.space)=\"handleKeyDownSpace($event)\"\n\trole=\"button\"\n\ttabindex=\"0\"\n>\n\t<div class=\"flex flex-1 items-center justify-center\">\n\t\t@if (this.toast().type === this.types.SUCCESS) {\n\t\t\t<st-icon [icon]=\"iconCheckCircle\" color=\"inherit\" size=\"md\"></st-icon>\n\t\t} @else if (this.toast().type === this.types.WARNING) {\n\t\t\t<st-icon [icon]=\"iconWarning\" color=\"inherit\" size=\"md\"></st-icon>\n\t\t} @else if (this.toast().type === this.types.ERROR) {\n\t\t\t<st-icon [icon]=\"iconError\" color=\"inherit\" size=\"md\"></st-icon>\n\t\t} @else if (this.toast().type === this.types.INFO) {\n\t\t\t<st-icon [icon]=\"iconInfo\" color=\"inherit\" size=\"md\"></st-icon>\n\t\t}\n\t</div>\n\t<div class=\"flex-4\">\n\t\t<div class=\"grid grid-rows-[min-content_1fr]\">\n\t\t\t<div typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'semibold'\">{{ toast().title }}</div>\n\t\t\t<div typography [tyVariant]=\"'body-xs'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">\n\t\t\t\t{{ toast().message }}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</li>\n", dependencies: [{ kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight", "tyTextOverflow"] }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
196
|
-
}
|
|
197
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: ToastMessageComponent, decorators: [{
|
|
198
|
-
type: Component,
|
|
199
|
-
args: [{ selector: 'st-toast-message', imports: [TypographyDirective, IconComponent, NgClass], template: "<li\n\t[class]=\"componentClass()\"\n\t[ngClass]=\"{\n\t\t'animate-toast-slide-out bottom-0': toast().animate === 'leave' && toastAmount() > 1,\n\t\t'animate-slide-out': toast().animate === 'leave' && toastAmount() === 1,\n\t\t'animate-fade-out': toast().animate === 'leave' && toastAmount() > 1 && toastIndex() === 0,\n\t\t'animate-slide-in': toast().animate === 'enter',\n\t}\"\n\t(pointerdown)=\"handlePointerDown($event)\"\n\t(click)=\"handleClick($event)\"\n\t(keydown.enter)=\"handleKeyDownEnter($event)\"\n\t(keydown.space)=\"handleKeyDownSpace($event)\"\n\trole=\"button\"\n\ttabindex=\"0\"\n>\n\t<div class=\"flex flex-1 items-center justify-center\">\n\t\t@if (this.toast().type === this.types.SUCCESS) {\n\t\t\t<st-icon [icon]=\"iconCheckCircle\" color=\"inherit\" size=\"md\"></st-icon>\n\t\t} @else if (this.toast().type === this.types.WARNING) {\n\t\t\t<st-icon [icon]=\"iconWarning\" color=\"inherit\" size=\"md\"></st-icon>\n\t\t} @else if (this.toast().type === this.types.ERROR) {\n\t\t\t<st-icon [icon]=\"iconError\" color=\"inherit\" size=\"md\"></st-icon>\n\t\t} @else if (this.toast().type === this.types.INFO) {\n\t\t\t<st-icon [icon]=\"iconInfo\" color=\"inherit\" size=\"md\"></st-icon>\n\t\t}\n\t</div>\n\t<div class=\"flex-4\">\n\t\t<div class=\"grid grid-rows-[min-content_1fr]\">\n\t\t\t<div typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'semibold'\">{{ toast().title }}</div>\n\t\t\t<div typography [tyVariant]=\"'body-xs'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">\n\t\t\t\t{{ toast().message }}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</li>\n" }]
|
|
200
|
-
}] });
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* @deprecated This component is deprecated. Use @sixbell-telco/sdk/components/sonner instead.
|
|
204
|
-
*/
|
|
205
|
-
class ToastsContainerComponent {
|
|
206
|
-
toastService = inject(ToastService);
|
|
207
|
-
containerClasses = computed(() => {
|
|
208
|
-
const toastCount = this.toastService.toasts().length;
|
|
209
|
-
const isExpanded = this.toastService.expanded();
|
|
210
|
-
return {
|
|
211
|
-
'min-h-64': toastCount === 3 && isExpanded,
|
|
212
|
-
'min-h-48': toastCount === 2 && isExpanded,
|
|
213
|
-
'h-24 min-h-24': toastCount === 1 && isExpanded,
|
|
214
|
-
'h-28 min-h-28': toastCount > 0 && !isExpanded,
|
|
215
|
-
'h-0 min-h-0': toastCount === 0 && !isExpanded,
|
|
216
|
-
};
|
|
217
|
-
});
|
|
218
|
-
handleExpand() {
|
|
219
|
-
this.toastService.expand();
|
|
220
|
-
}
|
|
221
|
-
handleCollapse() {
|
|
222
|
-
this.toastService.collapse();
|
|
223
|
-
}
|
|
224
|
-
handleRemove(toast) {
|
|
225
|
-
this.toastService.animateRemoval(toast);
|
|
226
|
-
setTimeout(() => {
|
|
227
|
-
this.toastService.remove(toast);
|
|
228
|
-
}, 500);
|
|
229
|
-
}
|
|
230
|
-
getToastIndex(toast) {
|
|
231
|
-
return this.toastService.toasts().findIndex((t) => t.id === toast.id);
|
|
232
|
-
}
|
|
233
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: ToastsContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
234
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.0", type: ToastsContainerComponent, isStandalone: true, selector: "st-toasts-container", ngImport: i0, template: "<section class=\"fixed right-4 bottom-2 z-[1001]\">\n\t<ol\n\t\tclass=\"toast-container group flex min-w-[400px] flex-col gap-2\"\n\t\t[ngClass]=\"containerClasses()\"\n\t\t[attr.aria-expanded]=\"toastService.expanded()\"\n\t\t(mouseenter)=\"handleExpand()\"\n\t\t(mouseleave)=\"handleCollapse()\"\n\t>\n\t\t@for (toast of toastService.toasts(); track toast.id) {\n\t\t\t<st-toast-message\n\t\t\t\t[toast]=\"toast\"\n\t\t\t\t[toastIndex]=\"getToastIndex(toast)\"\n\t\t\t\t[toastAmount]=\"toastService.toasts().length\"\n\t\t\t\t(clicked)=\"handleRemove($event)\"\n\t\t\t/>\n\t\t}\n\t</ol>\n</section>\n", dependencies: [{ kind: "component", type: ToastMessageComponent, selector: "st-toast-message", inputs: ["variant", "classes", "toast", "toastAmount", "toastIndex", "stopPropagation"], outputs: ["clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
235
|
-
}
|
|
236
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: ToastsContainerComponent, decorators: [{
|
|
237
|
-
type: Component,
|
|
238
|
-
args: [{ selector: 'st-toasts-container', imports: [ToastMessageComponent, NgClass], template: "<section class=\"fixed right-4 bottom-2 z-[1001]\">\n\t<ol\n\t\tclass=\"toast-container group flex min-w-[400px] flex-col gap-2\"\n\t\t[ngClass]=\"containerClasses()\"\n\t\t[attr.aria-expanded]=\"toastService.expanded()\"\n\t\t(mouseenter)=\"handleExpand()\"\n\t\t(mouseleave)=\"handleCollapse()\"\n\t>\n\t\t@for (toast of toastService.toasts(); track toast.id) {\n\t\t\t<st-toast-message\n\t\t\t\t[toast]=\"toast\"\n\t\t\t\t[toastIndex]=\"getToastIndex(toast)\"\n\t\t\t\t[toastAmount]=\"toastService.toasts().length\"\n\t\t\t\t(clicked)=\"handleRemove($event)\"\n\t\t\t/>\n\t\t}\n\t</ol>\n</section>\n" }]
|
|
239
|
-
}] });
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* @deprecated This toast system is deprecated. Use @sixbell-telco/sdk/components/sonner instead.
|
|
243
|
-
*/
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Generated bundle index. Do not edit.
|
|
247
|
-
*/
|
|
248
|
-
|
|
249
|
-
export { ToastMessageComponent, ToastService, ToastTypes, ToastsContainerComponent, toastComponent };
|
|
250
|
-
//# sourceMappingURL=sixbell-telco-sdk-components-toast.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sixbell-telco-sdk-components-toast.mjs","sources":["../../../projects/sdk/components/toast/services/toast.service.ts","../../../projects/sdk/components/toast/toast-message/toast-message.component.ts","../../../projects/sdk/components/toast/toast-message/toast-message.component.html","../../../projects/sdk/components/toast/toasts-container/toasts-container.component.ts","../../../projects/sdk/components/toast/toasts-container/toasts-container.component.html","../../../projects/sdk/components/toast/public-api.ts","../../../projects/sdk/components/toast/sixbell-telco-sdk-components-toast.ts"],"sourcesContent":["import { computed, Injectable, signal } from '@angular/core';\nimport { generateUniqueId } from '@sixbell-telco/sdk/utils/generators/uuid';\n\nexport enum ToastTypes {\n\tSUCCESS = 'toast-success',\n\tERROR = 'toast-error',\n\tINFO = 'toast-info',\n\tWARNING = 'toast-warning',\n}\n\nexport type Toast = {\n\tid: string;\n\ttype: ToastTypes;\n\tmessage: string;\n\ttitle: string;\n\tduration: number;\n\tanimate: 'enter' | 'leave';\n};\n\n/**\n * @deprecated This toast service is deprecated. Use @sixbell-telco/sdk/components/sonner instead.\n */\n@Injectable({\n\tprovidedIn: 'root',\n})\nexport class ToastService {\n\tprivate toastsSignal = signal<Toast[]>([]);\n\tprivate expandedSignal = signal(false);\n\n\t// Create computed signals for derived state\n\treadonly toasts = computed(() => this.toastsSignal());\n\treadonly expanded = computed(() => this.expandedSignal());\n\treadonly isEmpty = computed(() => this.toasts().length === 0);\n\n\tnotify(type: ToastTypes, message: string, title: string = '', duration: number = 10000) {\n\t\tconsole.warn('ToastService is deprecated. Migrate to @sixbell-telco/sdk/components/sonner.');\n\t\tconst toast: Toast = {\n\t\t\tid: generateUniqueId(),\n\t\t\ttype,\n\t\t\tmessage,\n\t\t\ttitle,\n\t\t\tduration,\n\t\t\tanimate: 'enter',\n\t\t};\n\n\t\t// Create a new array reference to ensure change detection\n\t\tthis.toastsSignal.update((toasts) => [toast, ...toasts]);\n\n\t\tthis.scheduleDismiss(toast);\n\t}\n\n\tscheduleDismiss(toast: Toast) {\n\t\tsetTimeout(() => {\n\t\t\tthis.remove(toast);\n\t\t}, toast.duration);\n\t}\n\n\tanimateRemoval(toast: Toast) {\n\t\tthis.toastsSignal.update((toasts) => toasts.map((t) => (t.id === toast.id ? { ...t, animate: 'leave' } : t)));\n\t}\n\n\tremove(toast: Toast) {\n\t\tthis.toastsSignal.update((toasts) => toasts.filter((t) => t.id !== toast.id));\n\n\t\tif (this.isEmpty()) {\n\t\t\tthis.collapse();\n\t\t}\n\t}\n\n\tclear() {\n\t\tthis.toastsSignal.set([]);\n\t\tthis.collapse();\n\t}\n\n\ttoggle() {\n\t\tthis.expandedSignal.update((expanded) => !expanded);\n\t}\n\n\tcollapse() {\n\t\tthis.expandedSignal.set(false);\n\t}\n\n\texpand() {\n\t\tthis.expandedSignal.set(true);\n\t}\n}\n","import { NgClass } from '@angular/common';\nimport { Component, computed, input, output } from '@angular/core';\nimport { IconComponent } from '@sixbell-telco/sdk/components/icon';\nimport { matCheckCircleOutline, matErrorOutline, matInfoOutline, matWarningOutline } from '@sixbell-telco/sdk/components/icon/material/outline';\nimport { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\nimport { Toast, ToastTypes } from '../services/toast.service';\n\nexport const toastComponent = cva(\n\t[\n\t\t'toast-message bg-base-200 ease-ease-in-and-out-back relative mb-2 flex h-20 min-h-20 w-[400px] cursor-pointer items-center rounded-lg border-2 p-2 transition-all duration-300',\n\t],\n\t{\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tinfo: ['border-primary', 'text-primary'],\n\t\t\t\tsuccess: ['border-success', 'text-success'],\n\t\t\t\twarning: ['border-warning', 'text-warning'],\n\t\t\t\terror: ['border-error', 'text-error'],\n\t\t\t},\n\t\t},\n\t\tcompoundVariants: [],\n\t\tdefaultVariants: {\n\t\t\tvariant: 'info',\n\t\t},\n\t},\n);\n\nexport type ToastVariantProps = 'info' | 'success' | 'warning' | 'error' | null | undefined;\n\nexport type ToastProps = {\n\tvariant?: ToastVariantProps;\n};\n\n/**\n * @deprecated This component is deprecated. Use @sixbell-telco/sdk/components/sonner instead.\n */\n@Component({\n\tselector: 'st-toast-message',\n\timports: [TypographyDirective, IconComponent, NgClass],\n\ttemplateUrl: './toast-message.component.html',\n})\nexport class ToastMessageComponent {\n\tvariant = input<ToastVariantProps>();\n\tclasses = input<string>('');\n\ttypes = ToastTypes;\n\ttoast = input.required<Toast>();\n\ttoastAmount = input.required<number>();\n\ttoastIndex = input.required<number>();\n\tclicked = output<Toast>();\n\n\t/**\n\t * Stop event propagation for activation events\n\t * @defaultValue false\n\t */\n\tstopPropagation = input<boolean>(false);\n\n\t/**\n\t * Event emitted on pointer down\n\t */\n\tpointerDown = output<PointerEvent>();\n\n\t/**\n\t * Event emitted on Enter keydown\n\t */\n\tkeyDownEnter = output<KeyboardEvent>();\n\n\t/**\n\t * Event emitted on Space keydown\n\t */\n\tkeyDownSpace = output<KeyboardEvent>();\n\n\t/**\n\t * Event emitted on activation (click or keyboard)\n\t */\n\ttriggered = output<void>();\n\ticonCheckCircle = matCheckCircleOutline;\n\ticonWarning = matWarningOutline;\n\ticonError = matErrorOutline;\n\ticonInfo = matInfoOutline;\n\n\tcomponentClass = computed(() => {\n\t\tconst toast = this.toast();\n\t\tconst classes = this.classes();\n\n\t\tswitch (toast.type) {\n\t\t\tcase this.types.SUCCESS:\n\t\t\t\treturn cn(toastComponent({ variant: 'success', class: classes }));\n\t\t\tcase this.types.ERROR:\n\t\t\t\treturn cn(toastComponent({ variant: 'error', class: classes }));\n\t\t\tcase this.types.WARNING:\n\t\t\t\treturn cn(toastComponent({ variant: 'warning', class: classes }));\n\t\t\tcase this.types.INFO:\n\t\t\t\treturn cn(toastComponent({ variant: 'info', class: classes }));\n\t\t\tdefault:\n\t\t\t\treturn cn(toastComponent({ variant: 'info', class: classes }));\n\t\t}\n\t});\n\n\thandleClose() {\n\t\tthis.clicked.emit(this.toast());\n\t\tthis.triggered.emit();\n\t}\n\n\t/**\n\t * @internal\n\t * Handle click activation\n\t */\n\thandleClick(event: MouseEvent) {\n\t\tif (this.stopPropagation()) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\tthis.handleClose();\n\t}\n\n\t/**\n\t * @internal\n\t * Handle pointer down activation\n\t */\n\thandlePointerDown(event: PointerEvent) {\n\t\tif (this.stopPropagation()) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\tthis.pointerDown.emit(event);\n\t}\n\n\t/**\n\t * @internal\n\t * Handle Enter key activation\n\t */\n\thandleKeyDownEnter(event: Event) {\n\t\tif (this.stopPropagation()) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\tthis.keyDownEnter.emit(event as KeyboardEvent);\n\t\tthis.handleClose();\n\t}\n\n\t/**\n\t * @internal\n\t * Handle Space key activation\n\t */\n\thandleKeyDownSpace(event: Event) {\n\t\tevent.preventDefault();\n\t\tif (this.stopPropagation()) {\n\t\t\tevent.stopPropagation();\n\t\t}\n\t\tthis.keyDownSpace.emit(event as KeyboardEvent);\n\t\tthis.handleClose();\n\t}\n}\n","<li\n\t[class]=\"componentClass()\"\n\t[ngClass]=\"{\n\t\t'animate-toast-slide-out bottom-0': toast().animate === 'leave' && toastAmount() > 1,\n\t\t'animate-slide-out': toast().animate === 'leave' && toastAmount() === 1,\n\t\t'animate-fade-out': toast().animate === 'leave' && toastAmount() > 1 && toastIndex() === 0,\n\t\t'animate-slide-in': toast().animate === 'enter',\n\t}\"\n\t(pointerdown)=\"handlePointerDown($event)\"\n\t(click)=\"handleClick($event)\"\n\t(keydown.enter)=\"handleKeyDownEnter($event)\"\n\t(keydown.space)=\"handleKeyDownSpace($event)\"\n\trole=\"button\"\n\ttabindex=\"0\"\n>\n\t<div class=\"flex flex-1 items-center justify-center\">\n\t\t@if (this.toast().type === this.types.SUCCESS) {\n\t\t\t<st-icon [icon]=\"iconCheckCircle\" color=\"inherit\" size=\"md\"></st-icon>\n\t\t} @else if (this.toast().type === this.types.WARNING) {\n\t\t\t<st-icon [icon]=\"iconWarning\" color=\"inherit\" size=\"md\"></st-icon>\n\t\t} @else if (this.toast().type === this.types.ERROR) {\n\t\t\t<st-icon [icon]=\"iconError\" color=\"inherit\" size=\"md\"></st-icon>\n\t\t} @else if (this.toast().type === this.types.INFO) {\n\t\t\t<st-icon [icon]=\"iconInfo\" color=\"inherit\" size=\"md\"></st-icon>\n\t\t}\n\t</div>\n\t<div class=\"flex-4\">\n\t\t<div class=\"grid grid-rows-[min-content_1fr]\">\n\t\t\t<div typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'semibold'\">{{ toast().title }}</div>\n\t\t\t<div typography [tyVariant]=\"'body-xs'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">\n\t\t\t\t{{ toast().message }}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</li>\n","import { NgClass } from '@angular/common';\nimport { Component, computed, inject } from '@angular/core';\nimport { Toast, ToastService } from '../services/toast.service';\nimport { ToastMessageComponent } from '../toast-message/toast-message.component';\n\n/**\n * @deprecated This component is deprecated. Use @sixbell-telco/sdk/components/sonner instead.\n */\n@Component({\n\tselector: 'st-toasts-container',\n\timports: [ToastMessageComponent, NgClass],\n\ttemplateUrl: './toasts-container.component.html',\n})\nexport class ToastsContainerComponent {\n\ttoastService = inject(ToastService);\n\n\tprotected containerClasses = computed(() => {\n\t\tconst toastCount = this.toastService.toasts().length;\n\t\tconst isExpanded = this.toastService.expanded();\n\n\t\treturn {\n\t\t\t'min-h-64': toastCount === 3 && isExpanded,\n\t\t\t'min-h-48': toastCount === 2 && isExpanded,\n\t\t\t'h-24 min-h-24': toastCount === 1 && isExpanded,\n\t\t\t'h-28 min-h-28': toastCount > 0 && !isExpanded,\n\t\t\t'h-0 min-h-0': toastCount === 0 && !isExpanded,\n\t\t};\n\t});\n\n\thandleExpand(): void {\n\t\tthis.toastService.expand();\n\t}\n\n\thandleCollapse(): void {\n\t\tthis.toastService.collapse();\n\t}\n\n\thandleRemove(toast: Toast): void {\n\t\tthis.toastService.animateRemoval(toast);\n\t\tsetTimeout(() => {\n\t\t\tthis.toastService.remove(toast);\n\t\t}, 500);\n\t}\n\n\tgetToastIndex(toast: Toast): number {\n\t\treturn this.toastService.toasts().findIndex((t) => t.id === toast.id);\n\t}\n}\n","<section class=\"fixed right-4 bottom-2 z-[1001]\">\n\t<ol\n\t\tclass=\"toast-container group flex min-w-[400px] flex-col gap-2\"\n\t\t[ngClass]=\"containerClasses()\"\n\t\t[attr.aria-expanded]=\"toastService.expanded()\"\n\t\t(mouseenter)=\"handleExpand()\"\n\t\t(mouseleave)=\"handleCollapse()\"\n\t>\n\t\t@for (toast of toastService.toasts(); track toast.id) {\n\t\t\t<st-toast-message\n\t\t\t\t[toast]=\"toast\"\n\t\t\t\t[toastIndex]=\"getToastIndex(toast)\"\n\t\t\t\t[toastAmount]=\"toastService.toasts().length\"\n\t\t\t\t(clicked)=\"handleRemove($event)\"\n\t\t\t/>\n\t\t}\n\t</ol>\n</section>\n","/**\n * @deprecated This toast system is deprecated. Use @sixbell-telco/sdk/components/sonner instead.\n */\nexport * from './services/toast.service';\n/**\n * @deprecated This toast system is deprecated. Use @sixbell-telco/sdk/components/sonner instead.\n */\nexport * from './toast-message/toast-message.component';\n/**\n * @deprecated This toast system is deprecated. Use @sixbell-telco/sdk/components/sonner instead.\n */\nexport * from './toasts-container/toasts-container.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;IAGY;AAAZ,CAAA,UAAY,UAAU,EAAA;AACrB,IAAA,UAAA,CAAA,SAAA,CAAA,GAAA,eAAyB;AACzB,IAAA,UAAA,CAAA,OAAA,CAAA,GAAA,aAAqB;AACrB,IAAA,UAAA,CAAA,MAAA,CAAA,GAAA,YAAmB;AACnB,IAAA,UAAA,CAAA,SAAA,CAAA,GAAA,eAAyB;AAC1B,CAAC,EALW,UAAU,KAAV,UAAU,GAKrB,EAAA,CAAA,CAAA;AAWD;;AAEG;MAIU,YAAY,CAAA;AAChB,IAAA,YAAY,GAAG,MAAM,CAAU,EAAE,CAAC;AAClC,IAAA,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC;;IAG7B,MAAM,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;IAC5C,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,cAAc,EAAE,CAAC;AAChD,IAAA,OA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qBAAqB,wOAAE,OAAO,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,SAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAG5B,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBALpC,SAAS;AACC,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,qBAAqB,EACtB,OAAA,EAAA,CAAC,qBAAqB,EAAE,OAAO,CAAC,EAAA,QAAA,EAAA,4lBAAA,EAAA;;;AEV1C;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, inject, ElementRef, Renderer2, effect, Directive } from '@angular/core';
|
|
3
|
-
import { cn } from '@sixbell-telco/sdk/utils/cn';
|
|
4
|
-
import { cva } from 'class-variance-authority';
|
|
5
|
-
|
|
6
|
-
/* eslint-disable @angular-eslint/no-input-rename */
|
|
7
|
-
/**
|
|
8
|
-
* @internal
|
|
9
|
-
* CSS class generator for typography variants
|
|
10
|
-
*/
|
|
11
|
-
const typographyDirective = cva([], {
|
|
12
|
-
variants: {
|
|
13
|
-
variant: {
|
|
14
|
-
h1: ['text-[28.38px]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],
|
|
15
|
-
h2: ['text-[25.23px]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],
|
|
16
|
-
h3: ['text-[22.43px]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],
|
|
17
|
-
h4: ['text-[19.93px]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],
|
|
18
|
-
h5: ['text-[17.72px]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],
|
|
19
|
-
h6: ['text-[15.75px]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],
|
|
20
|
-
body: ['text-[14px]', 'text-pretty', 'font-body', 'leading-normal', 'tracking-tight'],
|
|
21
|
-
'body-sm': ['text-[12.44px]', 'text-pretty', 'font-body', 'leading-normal', 'tracking-tight'],
|
|
22
|
-
'body-xs': ['text-[11.06px]', 'text-pretty', 'font-body', 'leading-normal', 'tracking-tight'],
|
|
23
|
-
'body-xxs': ['text-[9.83px]', 'text-pretty', 'font-body', 'leading-normal', 'tracking-tight'],
|
|
24
|
-
inherit: ['font-body'],
|
|
25
|
-
},
|
|
26
|
-
color: {
|
|
27
|
-
base: 'text-base-content',
|
|
28
|
-
'base-placeholder': 'text-neutral',
|
|
29
|
-
inherit: 'text-inherit',
|
|
30
|
-
},
|
|
31
|
-
fontWeight: {
|
|
32
|
-
bold: 'font-bold',
|
|
33
|
-
semibold: 'font-semibold',
|
|
34
|
-
medium: 'font-medium',
|
|
35
|
-
normal: 'font-normal',
|
|
36
|
-
inherit: 'font-inherit',
|
|
37
|
-
},
|
|
38
|
-
textOverflow: {
|
|
39
|
-
clip: 'text-clip',
|
|
40
|
-
ellipsis: 'text-ellipsis',
|
|
41
|
-
truncate: 'text-truncate',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
compoundVariants: [],
|
|
45
|
-
defaultVariants: {
|
|
46
|
-
variant: 'body',
|
|
47
|
-
color: 'inherit',
|
|
48
|
-
fontWeight: 'normal',
|
|
49
|
-
textOverflow: 'clip',
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
/**
|
|
53
|
-
* A directive for applying consistent typography styles using Tailwind CSS
|
|
54
|
-
*
|
|
55
|
-
* @remarks
|
|
56
|
-
* Applies text styling based on variant, color, weight, and overflow properties.
|
|
57
|
-
* Uses Angular's signal-based inputs for reactive style updates.
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* ```html
|
|
61
|
-
* <h1 typography tyVariant="h2" tyColor="base" tyFontWeight="bold">
|
|
62
|
-
* Heading with custom typography
|
|
63
|
-
* </h1>
|
|
64
|
-
*
|
|
65
|
-
* <p typography tyVariant="body-sm" tyTextOverflow="ellipsis">
|
|
66
|
-
* Small body text with ellipsis overflow
|
|
67
|
-
* </p>
|
|
68
|
-
* ```
|
|
69
|
-
*/
|
|
70
|
-
class TypographyDirective {
|
|
71
|
-
/**
|
|
72
|
-
* Typography variant style (heading level or body type)
|
|
73
|
-
* @alias tyVariant
|
|
74
|
-
* @defaultValue 'body'
|
|
75
|
-
*/
|
|
76
|
-
variant = input('body', { alias: 'tyVariant' });
|
|
77
|
-
/**
|
|
78
|
-
* Text color variant
|
|
79
|
-
* @alias tyColor
|
|
80
|
-
* @defaultValue 'inherit'
|
|
81
|
-
*/
|
|
82
|
-
color = input('inherit', { alias: 'tyColor' });
|
|
83
|
-
/**
|
|
84
|
-
* Font weight variant
|
|
85
|
-
* @alias tyFontWeight
|
|
86
|
-
* @defaultValue 'normal'
|
|
87
|
-
*/
|
|
88
|
-
fontWeight = input('normal', { alias: 'tyFontWeight' });
|
|
89
|
-
/**
|
|
90
|
-
* Text overflow handling method
|
|
91
|
-
* @alias tyTextOverflow
|
|
92
|
-
* @defaultValue 'clip'
|
|
93
|
-
*/
|
|
94
|
-
textOverflow = input('clip', { alias: 'tyTextOverflow' });
|
|
95
|
-
/** @internal Reference to host element */
|
|
96
|
-
element = inject(ElementRef);
|
|
97
|
-
/** @internal Angular renderer instance */
|
|
98
|
-
renderer = inject(Renderer2);
|
|
99
|
-
/** @internal Effect to update classes when inputs change */
|
|
100
|
-
classListEffect = effect(() => {
|
|
101
|
-
const classList = cn(typographyDirective({
|
|
102
|
-
variant: this.variant(),
|
|
103
|
-
color: this.color(),
|
|
104
|
-
fontWeight: this.fontWeight(),
|
|
105
|
-
textOverflow: this.textOverflow(),
|
|
106
|
-
}));
|
|
107
|
-
this.renderer.setAttribute(this.element.nativeElement, 'class', classList);
|
|
108
|
-
});
|
|
109
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: TypographyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
110
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.0", type: TypographyDirective, isStandalone: true, selector: "[typography]", inputs: { variant: { classPropertyName: "variant", publicName: "tyVariant", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "tyColor", isSignal: true, isRequired: false, transformFunction: null }, fontWeight: { classPropertyName: "fontWeight", publicName: "tyFontWeight", isSignal: true, isRequired: false, transformFunction: null }, textOverflow: { classPropertyName: "textOverflow", publicName: "tyTextOverflow", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
111
|
-
}
|
|
112
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.0", ngImport: i0, type: TypographyDirective, decorators: [{
|
|
113
|
-
type: Directive,
|
|
114
|
-
args: [{
|
|
115
|
-
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
116
|
-
selector: '[typography]',
|
|
117
|
-
standalone: true,
|
|
118
|
-
}]
|
|
119
|
-
}] });
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Generated bundle index. Do not edit.
|
|
123
|
-
*/
|
|
124
|
-
|
|
125
|
-
export { TypographyDirective };
|
|
126
|
-
//# sourceMappingURL=sixbell-telco-sdk-directives-typography.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sixbell-telco-sdk-directives-typography.mjs","sources":["../../../projects/sdk/directives/typography/src/typography.directive.ts","../../../projects/sdk/directives/typography/sixbell-telco-sdk-directives-typography.ts"],"sourcesContent":["/* eslint-disable @angular-eslint/no-input-rename */\nimport { Directive, ElementRef, Renderer2, effect, inject, input } from '@angular/core';\nimport { cn } from '@sixbell-telco/sdk/utils/cn';\nimport { cva } from 'class-variance-authority';\n\n/**\n * @internal\n * CSS class generator for typography variants\n */\nconst typographyDirective = cva([], {\n\tvariants: {\n\t\tvariant: {\n\t\t\th1: ['text-[28.38px]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],\n\t\t\th2: ['text-[25.23px]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],\n\t\t\th3: ['text-[22.43px]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],\n\t\t\th4: ['text-[19.93px]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],\n\t\t\th5: ['text-[17.72px]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],\n\t\t\th6: ['text-[15.75px]', 'text-balance', 'font-heading', 'leading-tight', 'tracking-wide'],\n\t\t\tbody: ['text-[14px]', 'text-pretty', 'font-body', 'leading-normal', 'tracking-tight'],\n\t\t\t'body-sm': ['text-[12.44px]', 'text-pretty', 'font-body', 'leading-normal', 'tracking-tight'],\n\t\t\t'body-xs': ['text-[11.06px]', 'text-pretty', 'font-body', 'leading-normal', 'tracking-tight'],\n\t\t\t'body-xxs': ['text-[9.83px]', 'text-pretty', 'font-body', 'leading-normal', 'tracking-tight'],\n\t\t\tinherit: ['font-body'],\n\t\t},\n\t\tcolor: {\n\t\t\tbase: 'text-base-content',\n\t\t\t'base-placeholder': 'text-neutral',\n\t\t\tinherit: 'text-inherit',\n\t\t},\n\t\tfontWeight: {\n\t\t\tbold: 'font-bold',\n\t\t\tsemibold: 'font-semibold',\n\t\t\tmedium: 'font-medium',\n\t\t\tnormal: 'font-normal',\n\t\t\tinherit: 'font-inherit',\n\t\t},\n\t\ttextOverflow: {\n\t\t\tclip: 'text-clip',\n\t\t\tellipsis: 'text-ellipsis',\n\t\t\ttruncate: 'text-truncate',\n\t\t},\n\t},\n\tcompoundVariants: [],\n\tdefaultVariants: {\n\t\tvariant: 'body',\n\t\tcolor: 'inherit',\n\t\tfontWeight: 'normal',\n\t\ttextOverflow: 'clip',\n\t},\n});\n\n/** Available typography heading and body variants */\nexport type TypographyVariantProps =\n\t| 'h1'\n\t| 'h2'\n\t| 'h3'\n\t| 'h4'\n\t| 'h5'\n\t| 'h6'\n\t| 'body'\n\t| 'body-sm'\n\t| 'body-xs'\n\t| 'body-xxs'\n\t| 'inherit'\n\t| null\n\t| undefined;\n\n/** Text color variants for typography */\nexport type TypographyColorProps = 'base' | 'base-placeholder' | 'inherit' | null | undefined;\n\n/** Font weight options for typography */\nexport type TypographyFontWeightProps = 'bold' | 'semibold' | 'medium' | 'normal' | 'inherit' | null | undefined;\n\n/** Text overflow handling methods */\nexport type TypographyTextOverflowProps = 'clip' | 'ellipsis' | 'truncate' | null | undefined;\n\n/** Configuration object for typography styles */\nexport type TypographyProps = {\n\tvariant?: TypographyVariantProps;\n\tcolor?: TypographyColorProps;\n\tfontWeight?: TypographyFontWeightProps;\n\ttextOverflow?: TypographyTextOverflowProps;\n};\n\n/**\n * A directive for applying consistent typography styles using Tailwind CSS\n *\n * @remarks\n * Applies text styling based on variant, color, weight, and overflow properties.\n * Uses Angular's signal-based inputs for reactive style updates.\n *\n * @example\n * ```html\n * <h1 typography tyVariant=\"h2\" tyColor=\"base\" tyFontWeight=\"bold\">\n * Heading with custom typography\n * </h1>\n *\n * <p typography tyVariant=\"body-sm\" tyTextOverflow=\"ellipsis\">\n * Small body text with ellipsis overflow\n * </p>\n * ```\n */\n@Directive({\n\t// eslint-disable-next-line @angular-eslint/directive-selector\n\tselector: '[typography]',\n\tstandalone: true,\n})\nexport class TypographyDirective {\n\t/**\n\t * Typography variant style (heading level or body type)\n\t * @alias tyVariant\n\t * @defaultValue 'body'\n\t */\n\tvariant = input<TypographyVariantProps>('body', { alias: 'tyVariant' });\n\n\t/**\n\t * Text color variant\n\t * @alias tyColor\n\t * @defaultValue 'inherit'\n\t */\n\tcolor = input<TypographyColorProps>('inherit', { alias: 'tyColor' });\n\n\t/**\n\t * Font weight variant\n\t * @alias tyFontWeight\n\t * @defaultValue 'normal'\n\t */\n\tfontWeight = input<TypographyFontWeightProps>('normal', { alias: 'tyFontWeight' });\n\n\t/**\n\t * Text overflow handling method\n\t * @alias tyTextOverflow\n\t * @defaultValue 'clip'\n\t */\n\ttextOverflow = input<TypographyTextOverflowProps>('clip', { alias: 'tyTextOverflow' });\n\n\t/** @internal Reference to host element */\n\tprivate element: ElementRef = inject(ElementRef);\n\n\t/** @internal Angular renderer instance */\n\tprivate renderer: Renderer2 = inject(Renderer2);\n\n\t/** @internal Effect to update classes when inputs change */\n\tclassListEffect = effect(() => {\n\t\tconst classList = cn(\n\t\t\ttypographyDirective({\n\t\t\t\tvariant: this.variant(),\n\t\t\t\tcolor: this.color(),\n\t\t\t\tfontWeight: this.fontWeight(),\n\t\t\t\ttextOverflow: this.textOverflow(),\n\t\t\t}),\n\t\t);\n\t\tthis.renderer.setAttribute(this.element.nativeElement, 'class', classList);\n\t});\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;AAKA;;;AAGG;AACH,MAAM,mBAAmB,GAAG,GAAG,CAAC,EAAE,EAAE;AACnC,IAAA,QAAQ,EAAE;AACT,QAAA,OAAO,EAAE;YACR,EAAE,EAAE,CAAC,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,CAAC;YACxF,EAAE,EAAE,CAAC,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,CAAC;YACxF,EAAE,EAAE,CAAC,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,CAAC;YACxF,EAAE,EAAE,CAAC,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,CAAC;YACxF,EAAE,EAAE,CAAC,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,CAAC;YACxF,EAAE,EAAE,CAAC,gBAAgB,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,CAAC;YACxF,IAAI,EAAE,CAAC,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,CAAC;YACrF,SAAS,EAAE,CAAC,gBAAgB,EAAE,aAAa,EAAE,WAAW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