tailjng 0.1.6 → 0.1.8
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 +27 -5
- package/cli/execute/init-app.js +5 -2
- package/cli/execute/sync-app.js +14 -2
- package/cli/settings/colors-config-utils.js +69 -11
- package/cli/settings/icons-config-utils.js +62 -0
- package/cli/settings/path-utils.js +32 -2
- package/cli/settings/project-utils.js +7 -1
- package/cli/templates/app.generator.js +8 -5
- package/fesm2022/tailjng.mjs +247 -80
- package/fesm2022/tailjng.mjs.map +1 -1
- package/lib/services/static/theme.service.d.ts +39 -1
- package/lib/utils/theme/theme-variables.util.d.ts +31 -0
- package/package.json +1 -1
- package/public-api.d.ts +2 -1
- package/registry/components.json +41 -18
- package/src/colors.safelist.css +2 -2
- package/src/lib/components/.config/README.md +11 -0
- package/src/lib/components/.config/colors/README.md +40 -0
- package/src/lib/components/{colors-config → .config/colors}/colors.config.ts +5 -5
- package/src/lib/components/{colors-config → .config/colors}/colors.safelist.css +2 -2
- package/src/lib/components/.config/icons/README.md +26 -0
- package/src/lib/components/.config/icons/icons.lucide.ts +134 -0
- package/src/lib/components/.config/input/README.md +24 -0
- package/src/lib/components/.config/input/input.classes.ts +119 -0
- package/src/lib/components/alert/alert-dialog/dialog-alert.component.css +177 -6
- package/src/lib/components/alert/alert-dialog/dialog-alert.component.html +24 -37
- package/src/lib/components/alert/alert-dialog/dialog-alert.component.ts +66 -56
- package/src/lib/components/alert/alert-dialog/dialog-alert.types.ts +19 -0
- package/src/lib/components/alert/alert-toast/toast-alert.component.css +494 -14
- package/src/lib/components/alert/alert-toast/toast-alert.component.html +106 -102
- package/src/lib/components/alert/alert-toast/toast-alert.component.ts +485 -128
- package/src/lib/components/alert/alert-toast/toast-alert.types.ts +25 -0
- package/src/lib/components/badge/badge.component.html +34 -21
- package/src/lib/components/badge/badge.component.ts +140 -31
- package/src/lib/components/button/button.component.html +16 -10
- package/src/lib/components/button/button.component.ts +162 -22
- package/src/lib/components/card/card-complete/complete-card.component.html +2 -2
- package/src/lib/components/card/card-complete/complete-card.component.ts +26 -16
- package/src/lib/components/card/card-crud-complete/complete-crud-card.component.html +2 -2
- package/src/lib/components/card/card-crud-complete/complete-crud-card.component.ts +26 -16
- package/src/lib/components/checkbox/checkbox-input/input-checkbox.component.css +30 -0
- package/src/lib/components/checkbox/checkbox-input/input-checkbox.component.html +58 -46
- package/src/lib/components/checkbox/checkbox-input/input-checkbox.component.ts +135 -64
- package/src/lib/components/checkbox/checkbox-input/input-checkbox.types.ts +3 -0
- package/src/lib/components/checkbox/checkbox-switch/switch-checkbox.component.css +62 -0
- package/src/lib/components/checkbox/checkbox-switch/switch-checkbox.component.html +39 -25
- package/src/lib/components/checkbox/checkbox-switch/switch-checkbox.component.ts +74 -15
- package/src/lib/components/checkbox/checkbox-switch/switch-checkbox.types.ts +1 -0
- package/src/lib/components/coach-mark/coach-mark.component.html +6 -24
- package/src/lib/components/coach-mark/coach-mark.component.scss +1 -7
- package/src/lib/components/coach-mark/coach-mark.component.ts +51 -18
- package/src/lib/components/coach-mark/coach-mark.directive.ts +133 -78
- package/src/lib/components/coach-mark/coach-mark.types.ts +12 -0
- package/src/lib/components/dialog/dialog.component.css +1 -1
- package/src/lib/components/dialog/dialog.component.html +56 -65
- package/src/lib/components/dialog/dialog.component.ts +136 -110
- package/src/lib/components/dialog/dialog.types.ts +19 -0
- package/src/lib/components/filter/filter-complete/complete-filter.component.html +17 -20
- package/src/lib/components/filter/filter-complete/complete-filter.component.scss +25 -0
- package/src/lib/components/filter/filter-complete/complete-filter.component.ts +58 -34
- package/src/lib/components/filter/filter-complete/complete-filter.types.ts +7 -0
- package/src/lib/components/filter/filter-complete/complete-filter.util.ts +16 -0
- package/src/lib/components/form/form-container/container-form.component.css +4 -0
- package/src/lib/components/form/form-container/container-form.component.html +2 -2
- package/src/lib/components/form/form-container/container-form.component.ts +72 -16
- package/src/lib/components/form/form-container/container-form.types.ts +42 -0
- package/src/lib/components/form/form-container/form-col-span.directive.ts +25 -0
- package/src/lib/components/form/form-sidebar/sidebar-form.component.css +45 -0
- package/src/lib/components/form/form-sidebar/sidebar-form.component.html +128 -124
- package/src/lib/components/form/form-sidebar/sidebar-form.component.ts +114 -34
- package/src/lib/components/form/form-sidebar/sidebar-form.types.ts +3 -0
- package/src/lib/components/{toggle-radio/toggle-radio.component.css → form/form-validation/validation-form.component.css} +0 -1
- package/src/lib/components/form/form-validation/validation-form.component.html +10 -6
- package/src/lib/components/form/form-validation/validation-form.component.ts +99 -12
- package/src/lib/components/form/form-validation/validation-form.types.ts +33 -0
- package/src/lib/components/icon/icon.component.html +8 -5
- package/src/lib/components/icon/icon.component.ts +111 -9
- package/src/lib/components/input/input/input.component.css +0 -14
- package/src/lib/components/input/input/input.component.html +19 -16
- package/src/lib/components/input/input/input.component.ts +130 -53
- package/src/lib/components/input/input/input.types.ts +8 -0
- package/src/lib/components/input/input-file/file-input.component.html +65 -56
- package/src/lib/components/input/input-file/file-input.component.ts +276 -173
- package/src/lib/components/input/input-file/file-input.types.ts +2 -0
- package/src/lib/components/input/input-range/range-input.component.css +67 -0
- package/src/lib/components/input/input-range/range-input.component.html +50 -58
- package/src/lib/components/input/input-range/range-input.component.ts +148 -60
- package/src/lib/components/input/input-range/range-input.types.ts +7 -0
- package/src/lib/components/input/input-textarea/textarea-input.component.html +16 -7
- package/src/lib/components/input/input-textarea/textarea-input.component.ts +140 -50
- package/src/lib/components/input/input-textarea/textarea-input.types.ts +2 -0
- package/src/lib/components/label/label.component.html +17 -16
- package/src/lib/components/label/label.component.ts +94 -16
- package/src/lib/components/label/label.types.ts +2 -0
- package/src/lib/components/menu/menu-options-table/menu-options-defaults.ts +34 -0
- package/src/lib/components/menu/menu-options-table/options-table-menu.component.html +34 -20
- package/src/lib/components/menu/menu-options-table/options-table-menu.component.ts +211 -58
- package/src/lib/components/menu/menu-options-table/options-table-menu.types.ts +38 -0
- package/src/lib/components/menu/options-coach-menu/options-coach-menu.component.html +49 -52
- package/src/lib/components/menu/options-coach-menu/options-coach-menu.component.ts +112 -24
- package/src/lib/components/menu/options-coach-menu/options-coach-menu.types.ts +9 -0
- package/src/lib/components/mode-toggle/mode-toggle.component.html +11 -16
- package/src/lib/components/mode-toggle/mode-toggle.component.ts +69 -33
- package/src/lib/components/paginator/paginator-complete/complete-paginator.component.html +4 -4
- package/src/lib/components/paginator/paginator-complete/complete-paginator.component.ts +31 -7
- package/src/lib/components/paginator/paginator-complete/complete-paginator.types.ts +12 -0
- package/src/lib/components/paginator/paginator-complete/complete-paginator.util.ts +36 -0
- package/src/lib/components/progress-bar/progress-bar.component.html +41 -40
- package/src/lib/components/progress-bar/progress-bar.component.ts +95 -11
- package/src/lib/components/progress-bar/progress-bar.types.ts +2 -0
- package/src/lib/components/select/select-dropdown/dropdown-select.component.html +56 -46
- package/src/lib/components/select/select-dropdown/dropdown-select.component.ts +450 -509
- package/src/lib/components/select/select-dropdown/dropdown-select.types.ts +43 -0
- package/src/lib/components/select/select-dropdown/dropdown-select.util.ts +179 -0
- package/src/lib/components/select/select-multi-dropdown/multi-dropdown-select.component.html +131 -42
- package/src/lib/components/select/select-multi-dropdown/multi-dropdown-select.component.ts +491 -475
- package/src/lib/components/select/select-multi-dropdown/multi-dropdown-select.types.ts +22 -0
- package/src/lib/components/select/select-multi-dropdown/multi-dropdown-select.util.ts +20 -0
- package/src/lib/components/select/select-multi-table/multi-table-select.component.css +4 -0
- package/src/lib/components/select/select-multi-table/multi-table-select.component.html +76 -60
- package/src/lib/components/select/select-multi-table/multi-table-select.component.ts +250 -313
- package/src/lib/components/select/select-multi-table/multi-table-select.types.ts +10 -0
- package/src/lib/components/select/select-multi-table/multi-table-select.util.ts +5 -0
- package/src/lib/components/sidebar/sidebar-static/static-sidebar.component.css +155 -0
- package/src/lib/components/sidebar/sidebar-static/static-sidebar.component.html +72 -53
- package/src/lib/components/sidebar/sidebar-static/static-sidebar.component.ts +84 -27
- package/src/lib/components/sidebar/sidebar-static/static-sidebar.types.ts +2 -0
- package/src/lib/components/table/table-complete/complete-table.component.html +21 -23
- package/src/lib/components/table/table-complete/complete-table.component.ts +190 -338
- package/src/lib/components/table/table-complete/complete-table.types.ts +28 -0
- package/src/lib/components/table/table-complete/complete-table.util.ts +236 -0
- package/src/lib/components/table/table-complete/index.ts +2 -0
- package/src/lib/components/table/table-crud-complete/complete-crud-table.animations.ts +34 -0
- package/src/lib/components/table/table-crud-complete/complete-crud-table.component.html +87 -142
- package/src/lib/components/table/table-crud-complete/complete-crud-table.component.scss +0 -63
- package/src/lib/components/table/table-crud-complete/complete-crud-table.component.ts +544 -831
- package/src/lib/components/table/table-crud-complete/complete-crud-table.types.ts +57 -0
- package/src/lib/components/table/table-crud-complete/complete-crud-table.util.ts +723 -0
- package/src/lib/components/table/table-crud-complete/index.ts +3 -0
- package/src/lib/components/theme-generator/theme-generator.component.css +21 -0
- package/src/lib/components/theme-generator/theme-generator.component.html +141 -116
- package/src/lib/components/theme-generator/theme-generator.component.ts +44 -24
- package/src/lib/components/toggle-radio/shared/toggle-options.types.ts +8 -0
- package/src/lib/components/toggle-radio/shared/toggle-options.util.ts +62 -0
- package/src/lib/components/toggle-radio/toggle-radio/toggle-radio.component.css +22 -0
- package/src/lib/components/toggle-radio/toggle-radio/toggle-radio.component.html +65 -0
- package/src/lib/components/toggle-radio/toggle-radio/toggle-radio.component.ts +192 -0
- package/src/lib/components/toggle-radio/toggle-radio/toggle-radio.types.ts +1 -0
- package/src/lib/components/toggle-radio/toggle-segment/segment-toggle.component.css +34 -0
- package/src/lib/components/toggle-radio/toggle-segment/segment-toggle.component.html +47 -0
- package/src/lib/components/toggle-radio/toggle-segment/segment-toggle.component.ts +187 -0
- package/src/lib/components/toggle-radio/toggle-segment/segment-toggle.types.ts +1 -0
- package/src/lib/components/tooltip/tooltip.directive.ts +12 -9
- package/src/lib/components/tooltip/tooltip.service.ts +331 -133
- package/src/lib/components/tooltip/tooltip.types.ts +9 -0
- package/src/lib/components/viewer/viewer-image/image-viewer.component.css +14 -4
- package/src/lib/components/viewer/viewer-image/image-viewer.component.html +61 -95
- package/src/lib/components/viewer/viewer-image/image-viewer.component.ts +182 -177
- package/src/lib/components/viewer/viewer-image/image-viewer.types.ts +3 -0
- package/src/lib/components/viewer/viewer-pdf/pdf-viewer.component.css +25 -0
- package/src/lib/components/viewer/viewer-pdf/pdf-viewer.component.html +95 -24
- package/src/lib/components/viewer/viewer-pdf/pdf-viewer.component.ts +168 -15
- package/src/lib/components/viewer/viewer-pdf/pdf-viewer.types.ts +1 -0
- package/src/styles.css +2 -2
- package/lib/services/static/icons.service.d.ts +0 -65
- package/src/lib/components/colors-config/README.md +0 -38
- package/src/lib/components/form/form-sidebar/sidebar-form.component.scss +0 -0
- package/src/lib/components/form/form-validation/validation-form.component.scss +0 -0
- package/src/lib/components/menu/menu-options-table/options-table-menu.component.scss +0 -0
- package/src/lib/components/menu/options-coach-menu/options-coach-menu.component.scss +0 -12
- package/src/lib/components/sidebar/sidebar-static/static-sidebar.component.scss +0 -0
- package/src/lib/components/toggle-radio/toggle-radio.component.html +0 -51
- package/src/lib/components/toggle-radio/toggle-radio.component.ts +0 -222
- package/src/lib/components/viewer/viewer-pdf/pdf-viewer.component.scss +0 -0
- package/tailjng-0.1.6.tgz +0 -0
|
@@ -1,17 +1,188 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: contents;
|
|
3
|
+
}
|
|
4
|
+
|
|
1
5
|
.j-alert-dialog-card {
|
|
2
|
-
|
|
6
|
+
border: 1px solid color-mix(in srgb, var(--color-border) 65%, transparent);
|
|
7
|
+
background-color: color-mix(in srgb, var(--color-background) 92%, transparent);
|
|
8
|
+
box-shadow: 0 20px 48px rgb(0 0 0 / 0.14);
|
|
3
9
|
}
|
|
4
10
|
|
|
5
|
-
.j-alert-dialog-
|
|
11
|
+
:host-context(.dark) .j-alert-dialog-card,
|
|
12
|
+
:host-context(html.dark) .j-alert-dialog-card {
|
|
13
|
+
border-color: color-mix(in srgb, var(--color-dark-border) 70%, transparent);
|
|
14
|
+
background-color: color-mix(in srgb, var(--color-dark-background) 92%, transparent);
|
|
15
|
+
box-shadow: 0 24px 56px rgb(0 0 0 / 0.45);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.j-alert-dialog-card--mono {
|
|
19
|
+
background-color: color-mix(in srgb, var(--color-background) 95%, transparent);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
:host-context(.dark) .j-alert-dialog-card--mono,
|
|
23
|
+
:host-context(html.dark) .j-alert-dialog-card--mono {
|
|
24
|
+
background-color: color-mix(in srgb, var(--color-dark-background) 95%, transparent);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.j-alert-dialog-card--success {
|
|
28
|
+
background-color: color-mix(in srgb, #22c55e 9%, var(--color-background));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.j-alert-dialog-card--error {
|
|
32
|
+
background-color: color-mix(in srgb, #ef4444 9%, var(--color-background));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.j-alert-dialog-card--warning {
|
|
36
|
+
background-color: color-mix(in srgb, #eab308 10%, var(--color-background));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.j-alert-dialog-card--info {
|
|
40
|
+
background-color: color-mix(in srgb, #3b82f6 9%, var(--color-background));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.j-alert-dialog-card--question {
|
|
44
|
+
background-color: color-mix(in srgb, #a855f7 9%, var(--color-background));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.j-alert-dialog-card--loading {
|
|
48
|
+
background-color: color-mix(in srgb, var(--color-muted) 22%, var(--color-background));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host-context(.dark) .j-alert-dialog-card--success,
|
|
52
|
+
:host-context(html.dark) .j-alert-dialog-card--success {
|
|
53
|
+
background-color: color-mix(in srgb, #22c55e 14%, var(--color-dark-background));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:host-context(.dark) .j-alert-dialog-card--error,
|
|
57
|
+
:host-context(html.dark) .j-alert-dialog-card--error {
|
|
58
|
+
background-color: color-mix(in srgb, #ef4444 14%, var(--color-dark-background));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:host-context(.dark) .j-alert-dialog-card--warning,
|
|
62
|
+
:host-context(html.dark) .j-alert-dialog-card--warning {
|
|
63
|
+
background-color: color-mix(in srgb, #eab308 14%, var(--color-dark-background));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
:host-context(.dark) .j-alert-dialog-card--info,
|
|
67
|
+
:host-context(html.dark) .j-alert-dialog-card--info {
|
|
68
|
+
background-color: color-mix(in srgb, #3b82f6 14%, var(--color-dark-background));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
:host-context(.dark) .j-alert-dialog-card--question,
|
|
72
|
+
:host-context(html.dark) .j-alert-dialog-card--question {
|
|
73
|
+
background-color: color-mix(in srgb, #a855f7 14%, var(--color-dark-background));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:host-context(.dark) .j-alert-dialog-card--loading,
|
|
77
|
+
:host-context(html.dark) .j-alert-dialog-card--loading {
|
|
78
|
+
background-color: color-mix(in srgb, var(--color-dark-muted) 28%, var(--color-dark-background));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.j-alert-dialog-accent {
|
|
82
|
+
position: absolute;
|
|
83
|
+
top: 0;
|
|
84
|
+
bottom: 0;
|
|
85
|
+
left: 0;
|
|
86
|
+
z-index: 1;
|
|
87
|
+
width: 0.25rem;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.j-alert-dialog-accent--mono {
|
|
91
|
+
background-color: var(--color-primary);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.j-alert-dialog-accent--success {
|
|
95
|
+
background-color: #22c55e;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.j-alert-dialog-accent--error {
|
|
99
|
+
background-color: #ef4444;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.j-alert-dialog-accent--warning {
|
|
103
|
+
background-color: #eab308;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.j-alert-dialog-accent--info {
|
|
107
|
+
background-color: #3b82f6;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.j-alert-dialog-accent--question {
|
|
111
|
+
background-color: #a855f7;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.j-alert-dialog-accent--loading {
|
|
115
|
+
background-color: var(--color-muted-foreground);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.j-alert-dialog-watermark {
|
|
119
|
+
position: absolute;
|
|
120
|
+
z-index: 0;
|
|
121
|
+
pointer-events: none;
|
|
122
|
+
user-select: none;
|
|
123
|
+
opacity: 0.22;
|
|
6
124
|
filter: blur(0.15px);
|
|
7
125
|
}
|
|
8
126
|
|
|
9
|
-
.j-alert-dialog-watermark--
|
|
127
|
+
.j-alert-dialog-watermark--subtle {
|
|
128
|
+
opacity: 0.12;
|
|
10
129
|
filter: blur(0.1px);
|
|
11
130
|
}
|
|
12
131
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
132
|
+
.j-alert-dialog-watermark--lg {
|
|
133
|
+
bottom: -2rem;
|
|
134
|
+
left: -1.25rem;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.j-alert-dialog-watermark--sm {
|
|
138
|
+
top: 0.5rem;
|
|
139
|
+
right: 0.75rem;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.j-alert-dialog-watermark--mono {
|
|
143
|
+
color: var(--color-primary);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.j-alert-dialog-watermark--success {
|
|
147
|
+
color: #22c55e;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.j-alert-dialog-watermark--error {
|
|
151
|
+
color: #ef4444;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.j-alert-dialog-watermark--warning {
|
|
155
|
+
color: #eab308;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.j-alert-dialog-watermark--info {
|
|
159
|
+
color: #3b82f6;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.j-alert-dialog-watermark--question {
|
|
163
|
+
color: #a855f7;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.j-alert-dialog-watermark--loading {
|
|
167
|
+
color: var(--color-muted-foreground);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.j-alert-dialog-watermark--spin {
|
|
171
|
+
animation: j-alert-dialog-spin 1s linear infinite;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@keyframes j-alert-dialog-spin {
|
|
175
|
+
to {
|
|
176
|
+
transform: rotate(360deg);
|
|
16
177
|
}
|
|
17
178
|
}
|
|
179
|
+
|
|
180
|
+
.j-alert-dialog-description :is(b, strong) {
|
|
181
|
+
font-weight: 600;
|
|
182
|
+
color: var(--color-foreground);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
:host-context(.dark) .j-alert-dialog-description :is(b, strong),
|
|
186
|
+
:host-context(html.dark) .j-alert-dialog-description :is(b, strong) {
|
|
187
|
+
color: var(--color-dark-foreground);
|
|
188
|
+
}
|
|
@@ -1,69 +1,56 @@
|
|
|
1
1
|
@for (dialog of dialogs(); track dialog.config.title) {
|
|
2
2
|
<div
|
|
3
|
-
class="
|
|
3
|
+
class="fixed inset-0 z-[999999] flex items-center justify-center p-4 bg-black/45 backdrop-blur-[2px]"
|
|
4
4
|
role="dialog"
|
|
5
5
|
aria-modal="true"
|
|
6
|
+
[attr.aria-label]="dialog.config.title"
|
|
6
7
|
>
|
|
7
8
|
<div
|
|
8
9
|
@modalTransition
|
|
9
|
-
class="j-alert-dialog-card relative w-full max-w-md overflow-hidden rounded-xl
|
|
10
|
-
[ngClass]="
|
|
10
|
+
class="j-alert-dialog-card relative w-full max-w-md min-h-[5.5rem] overflow-hidden rounded-xl backdrop-blur-[16px] max-[450px]:max-w-full"
|
|
11
|
+
[ngClass]="cardClasses(dialog.config.type)"
|
|
11
12
|
>
|
|
12
|
-
<div
|
|
13
|
-
class="absolute left-0 top-0 bottom-0 w-1 z-[1]"
|
|
14
|
-
[ngClass]="getAccentBarClass(dialog.config.type)"
|
|
15
|
-
></div>
|
|
13
|
+
<div [ngClass]="accentClasses(dialog.config.type)"></div>
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
[ngClass]="{ 'animate-spin': dialog.config.type === 'loading' }"
|
|
21
|
-
>
|
|
22
|
-
<lucide-icon
|
|
23
|
-
[name]="getIcon(dialog.config.type)"
|
|
15
|
+
<div [ngClass]="watermarkClasses(dialog.config.type)">
|
|
16
|
+
<JIcon
|
|
17
|
+
[icon]="typeIcon(dialog.config.type)"
|
|
24
18
|
[size]="104"
|
|
25
|
-
[
|
|
26
|
-
|
|
19
|
+
[inheritParentColor]="true"
|
|
20
|
+
[ariaHidden]="true"
|
|
21
|
+
/>
|
|
27
22
|
</div>
|
|
28
23
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
[ngClass]="{ 'animate-spin': dialog.config.type === 'loading' }"
|
|
33
|
-
>
|
|
34
|
-
<lucide-icon
|
|
35
|
-
[name]="getIcon(dialog.config.type)"
|
|
24
|
+
<div [ngClass]="watermarkClasses(dialog.config.type, true)">
|
|
25
|
+
<JIcon
|
|
26
|
+
[icon]="typeIcon(dialog.config.type)"
|
|
36
27
|
[size]="32"
|
|
37
|
-
[
|
|
38
|
-
|
|
28
|
+
[inheritParentColor]="true"
|
|
29
|
+
[ariaHidden]="true"
|
|
30
|
+
/>
|
|
39
31
|
</div>
|
|
40
32
|
|
|
41
|
-
<!-- Texto -->
|
|
42
33
|
<div
|
|
43
|
-
class="relative z-10
|
|
34
|
+
class="relative z-10 p-4 pl-5"
|
|
44
35
|
[class.pb-2]="hasActions(dialog)"
|
|
45
|
-
[class.pb-4]="!hasActions(dialog)"
|
|
46
36
|
>
|
|
47
|
-
<h3 class="m-0 text-sm font-semibold leading-
|
|
48
|
-
{{ dialog.config.title }}
|
|
49
|
-
</h3>
|
|
37
|
+
<h3 class="m-0 text-sm font-semibold leading-[1.3] tracking-[-0.01em] text-foreground dark:text-dark-foreground">{{ dialog.config.title }}</h3>
|
|
50
38
|
|
|
51
39
|
@if (dialog.config.description) {
|
|
52
40
|
<p
|
|
53
|
-
class="
|
|
41
|
+
class="j-alert-dialog-description mt-1.5 mb-0 text-xs leading-[1.55] text-muted-foreground dark:text-dark-muted-foreground"
|
|
54
42
|
[innerHTML]="dialog.config.description"
|
|
55
43
|
></p>
|
|
56
44
|
}
|
|
57
45
|
</div>
|
|
58
46
|
|
|
59
|
-
<!-- Acciones alineadas a la card -->
|
|
60
47
|
@if (hasActions(dialog)) {
|
|
61
|
-
<div class="relative z-10 flex flex-wrap justify-end gap-1.5
|
|
48
|
+
<div class="relative z-10 flex flex-wrap justify-end gap-1.5 py-0 pr-4 pb-4 pl-5">
|
|
62
49
|
@if (showRetryButton(dialog.config)) {
|
|
63
50
|
<JButton
|
|
64
51
|
size="sm"
|
|
65
52
|
(clicked)="handleAction('retry')"
|
|
66
|
-
[disabled]="dialog
|
|
53
|
+
[disabled]="isActionDisabled(dialog)"
|
|
67
54
|
[isLoading]="dialog.isRetryLoading"
|
|
68
55
|
[ngClasses]="getButtonSecondaryClass(dialog.config.type)"
|
|
69
56
|
>
|
|
@@ -75,7 +62,7 @@
|
|
|
75
62
|
<JButton
|
|
76
63
|
size="sm"
|
|
77
64
|
(clicked)="handleAction('cancel')"
|
|
78
|
-
[disabled]="dialog
|
|
65
|
+
[disabled]="isActionDisabled(dialog)"
|
|
79
66
|
[isLoading]="dialog.isCancelLoading"
|
|
80
67
|
[ngClasses]="getButtonSecondaryClass(dialog.config.type)"
|
|
81
68
|
>
|
|
@@ -87,7 +74,7 @@
|
|
|
87
74
|
<JButton
|
|
88
75
|
size="sm"
|
|
89
76
|
(clicked)="handleAction('confirm')"
|
|
90
|
-
[disabled]="dialog
|
|
77
|
+
[disabled]="isActionDisabled(dialog)"
|
|
91
78
|
[isLoading]="dialog.isConfirmLoading"
|
|
92
79
|
[ngClasses]="getButtonClass(dialog.config.type)"
|
|
93
80
|
>
|
|
@@ -1,90 +1,100 @@
|
|
|
1
|
-
import { Component,
|
|
1
|
+
import { Component, computed, inject, Input } from '@angular/core';
|
|
2
2
|
import { NgClass } from '@angular/common';
|
|
3
3
|
import { trigger, transition, style, animate } from '@angular/animations';
|
|
4
|
-
import {
|
|
5
|
-
import { LucideAngularModule } from 'lucide-angular';
|
|
4
|
+
import { JAlertDialogService, AlertDialogProps, JColorsService, Dialog } from 'tailjng';
|
|
6
5
|
import { JButtonComponent } from '../../button/button.component';
|
|
6
|
+
import { JIconComponent } from '../../icon/icon.component';
|
|
7
|
+
import { AlertDialogType, ALERT_DIALOG_TYPE_ICONS } from './dialog-alert.types';
|
|
7
8
|
|
|
9
|
+
export type { AlertDialogType } from './dialog-alert.types';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Global alert/confirm dialog host — mount once (e.g. app root) and call `JAlertDialogService.AlertDialog()`.
|
|
13
|
+
*
|
|
14
|
+
* Install: `npx tailjng add alert-dialog`
|
|
15
|
+
*/
|
|
8
16
|
@Component({
|
|
9
17
|
selector: 'JAlertDialog',
|
|
10
|
-
imports: [
|
|
18
|
+
imports: [NgClass, JButtonComponent, JIconComponent],
|
|
11
19
|
templateUrl: './dialog-alert.component.html',
|
|
12
20
|
styleUrl: './dialog-alert.component.css',
|
|
13
21
|
animations: [
|
|
14
22
|
trigger('modalTransition', [
|
|
15
23
|
transition(':enter', [
|
|
16
24
|
style({ opacity: 0, transform: 'scale(0.96) translateY(0.5rem)' }),
|
|
17
|
-
animate(
|
|
25
|
+
animate(
|
|
26
|
+
'320ms cubic-bezier(0.16, 1, 0.3, 1)',
|
|
27
|
+
style({ opacity: 1, transform: 'scale(1) translateY(0)' }),
|
|
28
|
+
),
|
|
18
29
|
]),
|
|
19
30
|
transition(':leave', [
|
|
20
|
-
animate(
|
|
31
|
+
animate(
|
|
32
|
+
'180ms cubic-bezier(0.4, 0, 1, 1)',
|
|
33
|
+
style({ opacity: 0, transform: 'scale(0.98) translateY(0.25rem)' }),
|
|
34
|
+
),
|
|
21
35
|
]),
|
|
22
36
|
]),
|
|
23
37
|
],
|
|
24
38
|
})
|
|
25
39
|
export class JAlertDialogComponent {
|
|
26
|
-
|
|
27
|
-
@Input() monocromatic: boolean = false;
|
|
28
40
|
private readonly alertDialogService = inject(JAlertDialogService);
|
|
41
|
+
private readonly colorsService = inject(JColorsService);
|
|
29
42
|
|
|
30
|
-
|
|
43
|
+
@Input() monocromatic = false;
|
|
31
44
|
|
|
32
|
-
|
|
33
|
-
private readonly colorsService: JColorsService,
|
|
34
|
-
private readonly iconsService: JIconsService,
|
|
35
|
-
) { }
|
|
45
|
+
readonly dialogs = computed(() => this.alertDialogService.dialogs());
|
|
36
46
|
|
|
37
|
-
|
|
38
|
-
|
|
47
|
+
handleAction(action: 'confirm' | 'cancel' | 'retry'): void {
|
|
48
|
+
this.alertDialogService.executeAction(action);
|
|
39
49
|
}
|
|
40
50
|
|
|
41
|
-
|
|
42
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Lucide icon for the dialog semantic type.
|
|
53
|
+
*/
|
|
54
|
+
typeIcon(type: string) {
|
|
55
|
+
return ALERT_DIALOG_TYPE_ICONS[type as AlertDialogType] ?? ALERT_DIALOG_TYPE_ICONS.info;
|
|
43
56
|
}
|
|
44
57
|
|
|
45
58
|
/**
|
|
46
|
-
*
|
|
59
|
+
* Class map for the dialog card shell.
|
|
47
60
|
*/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const surfaces: Record<string, string> = {
|
|
54
|
-
success: 'bg-green-50/95 dark:bg-[#15241f]/95',
|
|
55
|
-
error: 'bg-red-50/95 dark:bg-[#21181c]/95',
|
|
56
|
-
warning: 'bg-yellow-50/95 dark:bg-[#1f1c1a]/95',
|
|
57
|
-
info: 'bg-blue-50/95 dark:bg-[#1a1a24]/95',
|
|
58
|
-
question: 'bg-purple-50/95 dark:bg-[#241732]/95',
|
|
59
|
-
loading: 'bg-gray-50/95 dark:bg-[#15181e]/95',
|
|
61
|
+
cardClasses(type: string): Record<string, boolean> {
|
|
62
|
+
const alertType = type as AlertDialogType;
|
|
63
|
+
return {
|
|
64
|
+
[`j-alert-dialog-card--${alertType}`]: !this.monocromatic,
|
|
65
|
+
'j-alert-dialog-card--mono': this.monocromatic,
|
|
60
66
|
};
|
|
61
|
-
|
|
62
|
-
return surfaces[type] ?? 'bg-white/95 dark:bg-foreground/95';
|
|
63
67
|
}
|
|
64
68
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
loading: 'bg-gray-500',
|
|
69
|
+
/**
|
|
70
|
+
* Class map for the left accent bar.
|
|
71
|
+
*/
|
|
72
|
+
accentClasses(type: string): Record<string, boolean> {
|
|
73
|
+
const alertType = type as AlertDialogType;
|
|
74
|
+
return {
|
|
75
|
+
'j-alert-dialog-accent': true,
|
|
76
|
+
[`j-alert-dialog-accent--${alertType}`]: !this.monocromatic,
|
|
77
|
+
'j-alert-dialog-accent--mono': this.monocromatic,
|
|
75
78
|
};
|
|
76
|
-
|
|
77
|
-
return accents[type] ?? 'bg-primary';
|
|
78
79
|
}
|
|
79
80
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
/**
|
|
82
|
+
* Class map for decorative watermark icons.
|
|
83
|
+
*/
|
|
84
|
+
watermarkClasses(type: string, subtle = false): Record<string, boolean> {
|
|
85
|
+
const alertType = type as AlertDialogType;
|
|
86
|
+
return {
|
|
87
|
+
'j-alert-dialog-watermark': true,
|
|
88
|
+
'j-alert-dialog-watermark--lg': !subtle,
|
|
89
|
+
'j-alert-dialog-watermark--sm': subtle,
|
|
90
|
+
'j-alert-dialog-watermark--subtle': subtle,
|
|
91
|
+
[`j-alert-dialog-watermark--${alertType}`]: !this.monocromatic,
|
|
92
|
+
'j-alert-dialog-watermark--mono': this.monocromatic,
|
|
93
|
+
'j-alert-dialog-watermark--spin': type === 'loading',
|
|
94
|
+
};
|
|
85
95
|
}
|
|
86
96
|
|
|
87
|
-
hasActions(dialog:
|
|
97
|
+
hasActions(dialog: Dialog): boolean {
|
|
88
98
|
const { config } = dialog;
|
|
89
99
|
return (
|
|
90
100
|
this.showConfirmButton(config) ||
|
|
@@ -121,15 +131,15 @@ export class JAlertDialogComponent {
|
|
|
121
131
|
: 'Reintentar';
|
|
122
132
|
}
|
|
123
133
|
|
|
124
|
-
|
|
125
|
-
return this.colorsService.getIconClass(type, this.monocromatic);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
getButtonClass(type: string): { [key: string]: boolean } {
|
|
134
|
+
getButtonClass(type: string): Record<string, boolean> {
|
|
129
135
|
return this.colorsService.getButtonClass(type, this.monocromatic);
|
|
130
136
|
}
|
|
131
137
|
|
|
132
|
-
getButtonSecondaryClass(type: string):
|
|
138
|
+
getButtonSecondaryClass(type: string): Record<string, boolean> {
|
|
133
139
|
return this.colorsService.getButtonSecondaryClass(type, this.monocromatic);
|
|
134
140
|
}
|
|
141
|
+
|
|
142
|
+
isActionDisabled(dialog: Dialog): boolean {
|
|
143
|
+
return dialog.isRetryLoading || dialog.isCancelLoading || dialog.isConfirmLoading;
|
|
144
|
+
}
|
|
135
145
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LucideIconData } from 'lucide-angular';
|
|
2
|
+
import { Icons } from '../../.config/icons/icons.lucide';
|
|
3
|
+
|
|
4
|
+
export type AlertDialogType =
|
|
5
|
+
| 'success'
|
|
6
|
+
| 'error'
|
|
7
|
+
| 'warning'
|
|
8
|
+
| 'info'
|
|
9
|
+
| 'question'
|
|
10
|
+
| 'loading';
|
|
11
|
+
|
|
12
|
+
export const ALERT_DIALOG_TYPE_ICONS: Record<AlertDialogType, LucideIconData> = {
|
|
13
|
+
success: Icons.CircleCheck,
|
|
14
|
+
error: Icons.CircleX,
|
|
15
|
+
warning: Icons.TriangleAlert,
|
|
16
|
+
info: Icons.Info,
|
|
17
|
+
question: Icons.CircleHelp,
|
|
18
|
+
loading: Icons.Loader2,
|
|
19
|
+
};
|