tailjng 0.1.5 → 0.1.7

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.
Files changed (176) hide show
  1. package/README.md +12 -4
  2. package/cli/execute/init-app.js +5 -3
  3. package/cli/execute/sync-app.js +14 -2
  4. package/cli/settings/colors-config-utils.js +43 -8
  5. package/cli/settings/icons-config-utils.js +62 -0
  6. package/cli/settings/path-utils.js +32 -2
  7. package/cli/settings/project-utils.js +7 -1
  8. package/cli/templates/app.generator.js +2 -2
  9. package/fesm2022/tailjng.mjs +247 -80
  10. package/fesm2022/tailjng.mjs.map +1 -1
  11. package/lib/services/static/theme.service.d.ts +39 -1
  12. package/lib/utils/theme/theme-variables.util.d.ts +31 -0
  13. package/package.json +1 -1
  14. package/public-api.d.ts +2 -1
  15. package/registry/components.json +41 -18
  16. package/src/colors.safelist.css +2 -2
  17. package/src/lib/components/.config/README.md +11 -0
  18. package/src/lib/components/.config/colors/README.md +38 -0
  19. package/src/lib/components/{colors-config → .config/colors}/colors.config.ts +5 -5
  20. package/src/lib/components/{colors-config → .config/colors}/colors.safelist.css +2 -2
  21. package/src/lib/components/.config/icons/README.md +26 -0
  22. package/src/lib/components/.config/icons/icons.lucide.ts +134 -0
  23. package/src/lib/components/.config/input/README.md +24 -0
  24. package/src/lib/components/.config/input/input.classes.ts +119 -0
  25. package/src/lib/components/alert/alert-dialog/dialog-alert.component.css +244 -2
  26. package/src/lib/components/alert/alert-dialog/dialog-alert.component.html +25 -38
  27. package/src/lib/components/alert/alert-dialog/dialog-alert.component.ts +66 -56
  28. package/src/lib/components/alert/alert-dialog/dialog-alert.types.ts +19 -0
  29. package/src/lib/components/alert/alert-toast/toast-alert.component.css +630 -12
  30. package/src/lib/components/alert/alert-toast/toast-alert.component.html +103 -102
  31. package/src/lib/components/alert/alert-toast/toast-alert.component.ts +485 -128
  32. package/src/lib/components/alert/alert-toast/toast-alert.types.ts +25 -0
  33. package/src/lib/components/badge/badge.component.html +34 -21
  34. package/src/lib/components/badge/badge.component.ts +140 -31
  35. package/src/lib/components/button/button.component.html +16 -10
  36. package/src/lib/components/button/button.component.ts +162 -22
  37. package/src/lib/components/card/card-complete/complete-card.component.html +2 -2
  38. package/src/lib/components/card/card-complete/complete-card.component.ts +26 -16
  39. package/src/lib/components/card/card-crud-complete/complete-crud-card.component.html +2 -2
  40. package/src/lib/components/card/card-crud-complete/complete-crud-card.component.ts +26 -16
  41. package/src/lib/components/checkbox/checkbox-input/input-checkbox.component.css +97 -0
  42. package/src/lib/components/checkbox/checkbox-input/input-checkbox.component.html +54 -46
  43. package/src/lib/components/checkbox/checkbox-input/input-checkbox.component.ts +135 -64
  44. package/src/lib/components/checkbox/checkbox-input/input-checkbox.types.ts +3 -0
  45. package/src/lib/components/checkbox/checkbox-switch/switch-checkbox.component.css +112 -0
  46. package/src/lib/components/checkbox/checkbox-switch/switch-checkbox.component.html +28 -25
  47. package/src/lib/components/checkbox/checkbox-switch/switch-checkbox.component.ts +67 -15
  48. package/src/lib/components/checkbox/checkbox-switch/switch-checkbox.types.ts +1 -0
  49. package/src/lib/components/coach-mark/coach-mark.component.html +4 -22
  50. package/src/lib/components/coach-mark/coach-mark.component.scss +1 -1
  51. package/src/lib/components/coach-mark/coach-mark.component.ts +51 -18
  52. package/src/lib/components/coach-mark/coach-mark.directive.ts +133 -78
  53. package/src/lib/components/coach-mark/coach-mark.types.ts +12 -0
  54. package/src/lib/components/dialog/dialog.component.css +103 -1
  55. package/src/lib/components/dialog/dialog.component.html +46 -66
  56. package/src/lib/components/dialog/dialog.component.ts +136 -110
  57. package/src/lib/components/dialog/dialog.types.ts +19 -0
  58. package/src/lib/components/filter/filter-complete/complete-filter.component.html +16 -19
  59. package/src/lib/components/filter/filter-complete/complete-filter.component.scss +35 -0
  60. package/src/lib/components/filter/filter-complete/complete-filter.component.ts +58 -34
  61. package/src/lib/components/filter/filter-complete/complete-filter.types.ts +7 -0
  62. package/src/lib/components/filter/filter-complete/complete-filter.util.ts +16 -0
  63. package/src/lib/components/form/form-container/container-form.component.css +4 -0
  64. package/src/lib/components/form/form-container/container-form.component.html +2 -2
  65. package/src/lib/components/form/form-container/container-form.component.ts +72 -16
  66. package/src/lib/components/form/form-container/container-form.types.ts +42 -0
  67. package/src/lib/components/form/form-container/form-col-span.directive.ts +25 -0
  68. package/src/lib/components/form/form-sidebar/sidebar-form.component.css +276 -0
  69. package/src/lib/components/form/form-sidebar/sidebar-form.component.html +117 -125
  70. package/src/lib/components/form/form-sidebar/sidebar-form.component.ts +109 -34
  71. package/src/lib/components/form/form-sidebar/sidebar-form.types.ts +3 -0
  72. package/src/lib/components/{toggle-radio/toggle-radio.component.css → form/form-validation/validation-form.component.css} +0 -1
  73. package/src/lib/components/form/form-validation/validation-form.component.html +10 -6
  74. package/src/lib/components/form/form-validation/validation-form.component.ts +99 -12
  75. package/src/lib/components/form/form-validation/validation-form.types.ts +33 -0
  76. package/src/lib/components/icon/icon.component.html +8 -5
  77. package/src/lib/components/icon/icon.component.ts +111 -9
  78. package/src/lib/components/input/input/input.component.html +19 -16
  79. package/src/lib/components/input/input/input.component.ts +130 -53
  80. package/src/lib/components/input/input/input.types.ts +8 -0
  81. package/src/lib/components/input/input-file/file-input.component.html +65 -56
  82. package/src/lib/components/input/input-file/file-input.component.ts +276 -173
  83. package/src/lib/components/input/input-file/file-input.types.ts +2 -0
  84. package/src/lib/components/input/input-range/range-input.component.css +67 -0
  85. package/src/lib/components/input/input-range/range-input.component.html +50 -58
  86. package/src/lib/components/input/input-range/range-input.component.ts +148 -60
  87. package/src/lib/components/input/input-range/range-input.types.ts +7 -0
  88. package/src/lib/components/input/input-textarea/textarea-input.component.html +16 -7
  89. package/src/lib/components/input/input-textarea/textarea-input.component.ts +140 -50
  90. package/src/lib/components/input/input-textarea/textarea-input.types.ts +2 -0
  91. package/src/lib/components/label/label.component.html +17 -16
  92. package/src/lib/components/label/label.component.ts +70 -16
  93. package/src/lib/components/label/label.types.ts +2 -0
  94. package/src/lib/components/menu/menu-options-table/menu-options-defaults.ts +34 -0
  95. package/src/lib/components/menu/menu-options-table/options-table-menu.component.html +34 -20
  96. package/src/lib/components/menu/menu-options-table/options-table-menu.component.ts +211 -58
  97. package/src/lib/components/menu/menu-options-table/options-table-menu.types.ts +38 -0
  98. package/src/lib/components/menu/options-coach-menu/options-coach-menu.component.html +49 -52
  99. package/src/lib/components/menu/options-coach-menu/options-coach-menu.component.ts +112 -24
  100. package/src/lib/components/menu/options-coach-menu/options-coach-menu.types.ts +9 -0
  101. package/src/lib/components/mode-toggle/mode-toggle.component.html +11 -16
  102. package/src/lib/components/mode-toggle/mode-toggle.component.ts +69 -33
  103. package/src/lib/components/paginator/paginator-complete/complete-paginator.component.html +4 -4
  104. package/src/lib/components/paginator/paginator-complete/complete-paginator.component.ts +31 -7
  105. package/src/lib/components/paginator/paginator-complete/complete-paginator.types.ts +12 -0
  106. package/src/lib/components/paginator/paginator-complete/complete-paginator.util.ts +36 -0
  107. package/src/lib/components/progress-bar/progress-bar.component.css +11 -0
  108. package/src/lib/components/progress-bar/progress-bar.component.html +41 -40
  109. package/src/lib/components/progress-bar/progress-bar.component.ts +95 -11
  110. package/src/lib/components/progress-bar/progress-bar.types.ts +2 -0
  111. package/src/lib/components/select/select-dropdown/dropdown-select.component.css +6 -0
  112. package/src/lib/components/select/select-dropdown/dropdown-select.component.html +54 -44
  113. package/src/lib/components/select/select-dropdown/dropdown-select.component.ts +450 -509
  114. package/src/lib/components/select/select-dropdown/dropdown-select.types.ts +43 -0
  115. package/src/lib/components/select/select-dropdown/dropdown-select.util.ts +179 -0
  116. package/src/lib/components/select/select-multi-dropdown/multi-dropdown-select.component.css +6 -0
  117. package/src/lib/components/select/select-multi-dropdown/multi-dropdown-select.component.html +131 -42
  118. package/src/lib/components/select/select-multi-dropdown/multi-dropdown-select.component.ts +491 -475
  119. package/src/lib/components/select/select-multi-dropdown/multi-dropdown-select.types.ts +22 -0
  120. package/src/lib/components/select/select-multi-dropdown/multi-dropdown-select.util.ts +20 -0
  121. package/src/lib/components/select/select-multi-table/multi-table-select.component.css +10 -0
  122. package/src/lib/components/select/select-multi-table/multi-table-select.component.html +76 -60
  123. package/src/lib/components/select/select-multi-table/multi-table-select.component.ts +250 -313
  124. package/src/lib/components/select/select-multi-table/multi-table-select.types.ts +10 -0
  125. package/src/lib/components/select/select-multi-table/multi-table-select.util.ts +5 -0
  126. package/src/lib/components/sidebar/sidebar-static/static-sidebar.component.css +212 -0
  127. package/src/lib/components/sidebar/sidebar-static/static-sidebar.component.html +62 -53
  128. package/src/lib/components/sidebar/sidebar-static/static-sidebar.component.ts +84 -27
  129. package/src/lib/components/sidebar/sidebar-static/static-sidebar.types.ts +2 -0
  130. package/src/lib/components/table/table-complete/complete-table.component.html +15 -17
  131. package/src/lib/components/table/table-complete/complete-table.component.ts +190 -338
  132. package/src/lib/components/table/table-complete/complete-table.types.ts +28 -0
  133. package/src/lib/components/table/table-complete/complete-table.util.ts +236 -0
  134. package/src/lib/components/table/table-complete/index.ts +2 -0
  135. package/src/lib/components/table/table-crud-complete/complete-crud-table.animations.ts +34 -0
  136. package/src/lib/components/table/table-crud-complete/complete-crud-table.component.html +73 -128
  137. package/src/lib/components/table/table-crud-complete/complete-crud-table.component.ts +542 -829
  138. package/src/lib/components/table/table-crud-complete/complete-crud-table.types.ts +57 -0
  139. package/src/lib/components/table/table-crud-complete/complete-crud-table.util.ts +723 -0
  140. package/src/lib/components/table/table-crud-complete/index.ts +3 -0
  141. package/src/lib/components/theme-generator/theme-generator.component.css +21 -0
  142. package/src/lib/components/theme-generator/theme-generator.component.html +146 -116
  143. package/src/lib/components/theme-generator/theme-generator.component.ts +44 -24
  144. package/src/lib/components/toggle-radio/shared/toggle-options.types.ts +8 -0
  145. package/src/lib/components/toggle-radio/shared/toggle-options.util.ts +44 -0
  146. package/src/lib/components/toggle-radio/toggle-radio/toggle-radio.component.css +135 -0
  147. package/src/lib/components/toggle-radio/toggle-radio/toggle-radio.component.html +52 -0
  148. package/src/lib/components/toggle-radio/toggle-radio/toggle-radio.component.ts +198 -0
  149. package/src/lib/components/toggle-radio/toggle-radio/toggle-radio.types.ts +1 -0
  150. package/src/lib/components/toggle-radio/toggle-segment/segment-toggle.component.css +108 -0
  151. package/src/lib/components/toggle-radio/toggle-segment/segment-toggle.component.html +37 -0
  152. package/src/lib/components/toggle-radio/toggle-segment/segment-toggle.component.ts +193 -0
  153. package/src/lib/components/toggle-radio/toggle-segment/segment-toggle.types.ts +1 -0
  154. package/src/lib/components/tooltip/tooltip.directive.ts +12 -9
  155. package/src/lib/components/tooltip/tooltip.service.ts +331 -133
  156. package/src/lib/components/tooltip/tooltip.types.ts +9 -0
  157. package/src/lib/components/viewer/viewer-image/image-viewer.component.css +90 -4
  158. package/src/lib/components/viewer/viewer-image/image-viewer.component.html +52 -103
  159. package/src/lib/components/viewer/viewer-image/image-viewer.component.ts +182 -177
  160. package/src/lib/components/viewer/viewer-image/image-viewer.types.ts +3 -0
  161. package/src/lib/components/viewer/viewer-pdf/pdf-viewer.component.css +177 -0
  162. package/src/lib/components/viewer/viewer-pdf/pdf-viewer.component.html +74 -24
  163. package/src/lib/components/viewer/viewer-pdf/pdf-viewer.component.ts +168 -15
  164. package/src/lib/components/viewer/viewer-pdf/pdf-viewer.types.ts +1 -0
  165. package/src/styles.css +2 -2
  166. package/lib/services/static/icons.service.d.ts +0 -65
  167. package/src/lib/components/colors-config/README.md +0 -38
  168. package/src/lib/components/form/form-sidebar/sidebar-form.component.scss +0 -0
  169. package/src/lib/components/form/form-validation/validation-form.component.scss +0 -0
  170. package/src/lib/components/menu/menu-options-table/options-table-menu.component.scss +0 -0
  171. package/src/lib/components/menu/options-coach-menu/options-coach-menu.component.scss +0 -12
  172. package/src/lib/components/sidebar/sidebar-static/static-sidebar.component.scss +0 -0
  173. package/src/lib/components/toggle-radio/toggle-radio.component.html +0 -51
  174. package/src/lib/components/toggle-radio/toggle-radio.component.ts +0 -222
  175. package/src/lib/components/viewer/viewer-pdf/pdf-viewer.component.scss +0 -0
  176. package/tailjng-0.1.5.tgz +0 -0
@@ -1,15 +1,53 @@
1
+ import { GeneratedColors } from '../../interfaces/theme/theme-generator.interface';
1
2
  import * as i0 from "@angular/core";
2
3
  export type ThemeMode = 'light' | 'dark';
3
4
  export declare class JThemeService {
4
5
  private readonly _theme;
5
6
  readonly themeSignal: import("@angular/core").Signal<ThemeMode>;
7
+ private previewColorsActive;
8
+ private persistedColors;
9
+ private activeColors;
6
10
  constructor();
7
11
  private initializeTheme;
8
12
  private listenToExternalChanges;
9
- private applyTheme;
13
+ private applyThemeModeClass;
14
+ /**
15
+ * Re-applies the `dark` class on the next frame so Tailwind re-evaluates tokens.
16
+ */
17
+ private refreshThemeModeClass;
18
+ private syncActiveColorsToDocument;
19
+ private setActiveColors;
20
+ /**
21
+ * Loads a previously saved custom palette from localStorage and applies it.
22
+ */
23
+ loadPersistedCustomColors(): void;
24
+ /**
25
+ * Whether a custom palette is saved in localStorage.
26
+ * @returns `true` when a persisted palette exists.
27
+ */
28
+ hasPersistedCustomColors(): boolean;
29
+ /**
30
+ * Saves and applies a custom palette for the whole app (survives reloads).
31
+ * @param colors Generated palette from the theme generator.
32
+ */
33
+ saveCustomColors(colors: GeneratedColors): void;
34
+ /**
35
+ * Removes the saved custom palette and restores `@theme` defaults from CSS.
36
+ */
37
+ clearPersistedCustomColors(): void;
38
+ /**
39
+ * Applies generated palette CSS variables to the document for live preview.
40
+ * @param colors Palette from the theme generator.
41
+ */
42
+ applyPreviewColors(colors: GeneratedColors): void;
43
+ /**
44
+ * Ends live preview — reverts to the saved palette or CSS defaults.
45
+ */
46
+ clearPreviewColors(): void;
10
47
  toggleTheme(): void;
11
48
  setTheme(theme: ThemeMode): void;
12
49
  getThemeMode(): ThemeMode;
50
+ private isValidGeneratedColors;
13
51
  static ɵfac: i0.ɵɵFactoryDeclaration<JThemeService, never>;
14
52
  static ɵprov: i0.ɵɵInjectableDeclaration<JThemeService>;
15
53
  }
@@ -0,0 +1,31 @@
1
+ import { GeneratedColors } from '../../interfaces/theme/theme-generator.interface';
2
+ /** All keys emitted by the theme generator into `@theme`. */
3
+ export declare const GENERATED_COLOR_KEYS: readonly ["background", "foreground", "card", "cardForeground", "popover", "popoverForeground", "primary", "primaryForeground", "secondary", "secondaryForeground", "muted", "mutedForeground", "accent", "accentForeground", "destructive", "destructiveForeground", "border", "input", "ring", "darkBackground", "darkForeground", "darkCard", "darkCardForeground", "darkPopover", "darkPopoverForeground", "darkPrimary", "darkPrimaryForeground", "darkSecondary", "darkSecondaryForeground", "darkMuted", "darkMutedForeground", "darkAccent", "darkAccentForeground", "darkDestructive", "darkDestructiveForeground", "darkBorder", "darkInput", "darkRing"];
4
+ export declare const CUSTOM_THEME_STYLE_ID = "tailjng-custom-theme";
5
+ /**
6
+ * Converts a generated color key to a Tailwind `@theme` CSS variable name.
7
+ * @param key Generated palette key.
8
+ * @returns CSS custom property name.
9
+ */
10
+ export declare function generatedColorToCssVarName(key: keyof GeneratedColors): string;
11
+ /**
12
+ * Builds a `:root` CSS block for the generated palette.
13
+ * @param colors Generated palette.
14
+ * @returns CSS rules for `:root`.
15
+ */
16
+ export declare function buildRootThemeCss(colors: GeneratedColors): string;
17
+ /**
18
+ * Applies generated palette values through a dedicated stylesheet (reliable with Tailwind v4).
19
+ * @param colors Generated palette.
20
+ */
21
+ export declare function applyGeneratedColorsToDocument(colors: GeneratedColors): void;
22
+ /**
23
+ * Removes custom theme overrides from the document.
24
+ */
25
+ export declare function clearGeneratedColorsFromDocument(): void;
26
+ /**
27
+ * Builds the `@theme { ... }` block copied by the theme generator.
28
+ * @param colors Generated palette.
29
+ * @returns Tailwind v4 `@theme` snippet.
30
+ */
31
+ export declare function buildThemeCode(colors: GeneratedColors): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailjng",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.2.0",
6
6
  "@angular/core": "^19.2.0",
package/public-api.d.ts CHANGED
@@ -6,6 +6,7 @@ export * from './lib/interfaces/crud/filter.interface';
6
6
  export * from './lib/interfaces/crud/form.interface';
7
7
  export * from './lib/interfaces/theme/theme-generator.interface';
8
8
  export * from './lib/interfaces/alert/dialog-alert.interface';
9
+ export * from './lib/interfaces/alert/toast-alert.interface';
9
10
  export * from './lib/interfaces/colors/colors-config.interface';
10
11
  export * from './lib/shared/form.shared';
11
12
  export * from './lib/shared/dialog.shared';
@@ -16,9 +17,9 @@ export * from './lib/services/http/file-http.service';
16
17
  export * from './lib/services/http/errorHandler-http.service';
17
18
  export * from './lib/services/transformer/calendar.service';
18
19
  export * from './lib/services/transformer/transform.service';
19
- export * from './lib/services/static/icons.service';
20
20
  export * from './lib/services/static/theme.service';
21
21
  export * from './lib/services/static/colors.service';
22
+ export * from './lib/utils/theme/theme-variables.util';
22
23
  export * from './lib/services/alert/dialog-alert.service';
23
24
  export * from './lib/services/alert/toast-alert.service';
24
25
  export * from './lib/services/report/excel.service';
@@ -1,12 +1,24 @@
1
1
  {
2
2
  "components": {
3
3
  "colors": {
4
- "path": "src/lib/components/colors-config",
4
+ "path": "src/lib/components/.config/colors",
5
5
  "dependencies": []
6
6
  },
7
+ "icons": {
8
+ "path": "src/lib/components/.config/icons",
9
+ "dependencies": []
10
+ },
11
+ "input-classes": {
12
+ "path": "src/lib/components/.config/input",
13
+ "dependencies": []
14
+ },
15
+ "icon": {
16
+ "path": "src/lib/components/icon",
17
+ "dependencies": ["icons"]
18
+ },
7
19
  "mode-toggle": {
8
20
  "path": "src/lib/components/mode-toggle",
9
- "dependencies": []
21
+ "dependencies": ["icon", "icons"]
10
22
  },
11
23
  "tooltip": {
12
24
  "path": "src/lib/components/tooltip",
@@ -18,35 +30,39 @@
18
30
  },
19
31
  "badge": {
20
32
  "path": "src/lib/components/badge",
21
- "dependencies": ["tooltip"]
33
+ "dependencies": ["tooltip", "icon", "icons"]
22
34
  },
23
35
  "label": {
24
36
  "path": "src/lib/components/label",
25
- "dependencies": ["tooltip"]
37
+ "dependencies": ["tooltip", "icon", "icons"]
26
38
  },
27
39
  "toggle-radio": {
28
- "path": "src/lib/components/toggle-radio",
29
- "dependencies": []
40
+ "path": "src/lib/components/toggle-radio/toggle-radio",
41
+ "dependencies": ["icon", "icons"]
42
+ },
43
+ "toggle-segment": {
44
+ "path": "src/lib/components/toggle-radio/toggle-segment",
45
+ "dependencies": ["icon", "icons"]
30
46
  },
31
47
  "button": {
32
48
  "path": "src/lib/components/button",
33
- "dependencies": ["tooltip"]
49
+ "dependencies": ["tooltip", "icon", "icons"]
34
50
  },
35
51
  "checkbox-input": {
36
52
  "path": "src/lib/components/checkbox/checkbox-input",
37
- "dependencies": ["tooltip"]
53
+ "dependencies": ["tooltip", "icon", "icons"]
38
54
  },
39
55
  "checkbox-switch": {
40
56
  "path": "src/lib/components/checkbox/checkbox-switch",
41
- "dependencies": []
57
+ "dependencies": ["icon", "icons"]
42
58
  },
43
59
  "alert-dialog": {
44
60
  "path": "src/lib/components/alert/alert-dialog",
45
- "dependencies": ["button"]
61
+ "dependencies": ["button", "icon", "icons"]
46
62
  },
47
63
  "alert-toast": {
48
64
  "path": "src/lib/components/alert/alert-toast",
49
- "dependencies": ["button"]
65
+ "dependencies": ["button", "icon", "icons"]
50
66
  },
51
67
  "progress-bar": {
52
68
  "path": "src/lib/components/progress-bar",
@@ -54,11 +70,11 @@
54
70
  },
55
71
  "viewer-image": {
56
72
  "path": "src/lib/components/viewer/viewer-image",
57
- "dependencies": ["button"]
73
+ "dependencies": ["button", "tooltip", "icon", "icons"]
58
74
  },
59
75
  "viewer-pdf": {
60
76
  "path": "src/lib/components/viewer/viewer-pdf",
61
- "dependencies": []
77
+ "dependencies": ["button", "icon", "icons"]
62
78
  },
63
79
  "dialog": {
64
80
  "path": "src/lib/components/dialog",
@@ -66,11 +82,11 @@
66
82
  },
67
83
  "input-file": {
68
84
  "path": "src/lib/components/input/input-file",
69
- "dependencies": []
85
+ "dependencies": ["input-classes", "icon", "icons"]
70
86
  },
71
87
  "input-textarea": {
72
88
  "path": "src/lib/components/input/input-textarea",
73
- "dependencies": []
89
+ "dependencies": ["input-classes", "icon", "icons"]
74
90
  },
75
91
  "input-range": {
76
92
  "path": "src/lib/components/input/input-range",
@@ -78,7 +94,7 @@
78
94
  },
79
95
  "input": {
80
96
  "path": "src/lib/components/input/input",
81
- "dependencies": []
97
+ "dependencies": ["input-classes", "icon", "icons"]
82
98
  },
83
99
  "select-multi-table": {
84
100
  "path": "src/lib/components/select/select-multi-table",
@@ -94,7 +110,7 @@
94
110
  },
95
111
  "sidebar-static": {
96
112
  "path": "src/lib/components/sidebar/sidebar-static",
97
- "dependencies": ["checkbox-switch"]
113
+ "dependencies": ["checkbox-switch", "icon", "icons"]
98
114
  },
99
115
  "form-container": {
100
116
  "path": "src/lib/components/form/form-container",
@@ -162,7 +178,14 @@
162
178
  },
163
179
  "theme-generator": {
164
180
  "path": "src/lib/components/theme-generator",
165
- "dependencies": ["input", "input-range", "button", "label", "form-container"]
181
+ "dependencies": [
182
+ "input",
183
+ "input-range",
184
+ "input-classes",
185
+ "button",
186
+ "label",
187
+ "form-container"
188
+ ]
166
189
  }
167
190
  }
168
191
  }
@@ -1,5 +1,5 @@
1
1
  /* AUTO-GENERATED — do not edit blocks 1-N. Run: node scripts/generate-colors-safelist.mjs */
2
- /* npm fallback — prefer src/app/tailjng/colors/colors.safelist.css in projects */
2
+ /* npm fallback — prefer src/app/tailjng/.config/colors/colors.safelist.css in projects */
3
3
 
4
4
  @layer utilities {
5
5
  .__tailjng_colors_safelist_1__ {
@@ -22,7 +22,7 @@
22
22
  @apply hover:bg-teal-500/20 hover:bg-teal-600 hover:bg-yellow-600/10 hover:bg-yellow-600/20 hover:bg-yellow-700 shadow-md shadow-sm text-black text-blue-500 text-blue-600 text-cyan-500 text-cyan-600 text-dark-border text-gray-500 text-gray-600 text-green-500 text-green-600 text-orange-500 text-orange-600 text-pink-500 text-pink-600 text-primary text-purple-500 text-purple-600 text-red-500 text-red-600 text-teal-500 text-teal-600 text-white text-yellow-500 text-yellow-600 text-yellow-700;
23
23
  }
24
24
 
25
- /* ── Tus colores custom: descomenta y añade clases Tailwind ── */
25
+ /* ── Custom colors: uncomment and add Tailwind classes ── */
26
26
  .__tailjng_custom_colors__ {
27
27
  /* @apply bg-indigo-600 text-white hover:bg-indigo-700; */
28
28
  }
@@ -0,0 +1,11 @@
1
+ # Tailjng — configuración del proyecto
2
+
3
+ Carpeta copiada a `src/app/tailjng/.config/` por `init:app`, `sync:app` o `npx tailjng add colors|icons`.
4
+
5
+ | Subcarpeta | Contenido |
6
+ |------------|-----------|
7
+ | `colors/` | Variantes de color + safelist Tailwind |
8
+ | `icons/` | Registro `Icons` (Lucide) para TS y templates |
9
+ | `input/` | Clases Tailwind compartidas para inputs (`input.classes.ts`) |
10
+
11
+ No confundir con los componentes UI en `src/app/tailjng/` (button, table, …).
@@ -0,0 +1,38 @@
1
+ # Tailjng colors — project configuration
2
+
3
+ Folder generated at `src/app/tailjng/.config/colors/` by `init:app`, `sync:app`, or `npx tailjng add colors`.
4
+
5
+ ## Files
6
+
7
+ | File | Purpose |
8
+ |------|---------|
9
+ | `colors.config.ts` | Variants (`primary`, `success_soft`, …) plus your own (`brand`, etc.) |
10
+ | `colors.safelist.css` | Tailwind classes the build must generate (`@apply`) |
11
+
12
+ ## Add a custom color
13
+
14
+ **1.** In `colors.config.ts`:
15
+
16
+ ```typescript
17
+ brand: 'bg-indigo-600 text-white hover:bg-indigo-700 border border-indigo-500 shadow-md',
18
+ brand_soft: 'bg-indigo-500/10 text-indigo-600 border border-indigo-500/20 shadow-sm',
19
+ ```
20
+
21
+ **2.** In `colors.safelist.css`, inside the `@layer utilities` block:
22
+
23
+ ```css
24
+ .__tailjng_custom_colors__ {
25
+ @apply bg-indigo-600 text-white hover:bg-indigo-700 border-indigo-500 bg-indigo-500/10 text-indigo-600;
26
+ }
27
+ ```
28
+
29
+ **3.** Usage in components:
30
+
31
+ ```html
32
+ <JButton classes="brand" text="Save" />
33
+ <JBadge classes="brand_soft" value="N" />
34
+ ```
35
+
36
+ ## Provider
37
+
38
+ `app.config.ts` must include `tailjngColorsProvider` (added by `init:app` / `sync:app`).
@@ -1,11 +1,11 @@
1
1
  import { TAILJNG_COLORS_CONFIG } from 'tailjng';
2
2
 
3
3
  /**
4
- * Variantes de color edita las existentes o añade las tuyas al final.
5
- * Uso en componentes: classes="primary" | classes="success_soft" | classes="brand"
4
+ * Color variantsedit existing entries or add your own at the end.
5
+ * Component usage: classes="primary" | classes="success_soft" | classes="brand"
6
6
  *
7
- * Si añades variantes nuevas con clases Tailwind nuevas, regístralas también
8
- * en colors.safelist.css (bloque .__tailjng_custom_colors__).
7
+ * When adding variants with new Tailwind classes, register them in
8
+ * colors.safelist.css as well (block .__tailjng_custom_colors__).
9
9
  */
10
10
  export const colorVariants: Record<string, string> = {
11
11
 
@@ -102,7 +102,7 @@ export const colorVariants: Record<string, string> = {
102
102
  default_outline: 'bg-transparent text-black dark:text-white border border-dark-border dark:border-border hover:bg-black/5 dark:hover:bg-white/10 shadow-sm',
103
103
  default_ghost: 'bg-transparent text-black dark:text-white hover:bg-black/5 dark:hover:bg-white/10 border border-transparent dark:border-transparent',
104
104
 
105
- // ── Custom — añade variantes propias debajo ──
105
+ // ── Custom — add your own variants below ──
106
106
  // brand: 'bg-indigo-600 text-white hover:bg-indigo-700 border border-indigo-500 shadow-md',
107
107
  };
108
108
 
@@ -1,5 +1,5 @@
1
1
  /* AUTO-GENERATED — do not edit blocks 1-N. Run: node scripts/generate-colors-safelist.mjs */
2
- /* Importar en styles.css DESPUÉS de @import "tailwindcss". */
2
+ /* Import in styles.css AFTER @import "tailwindcss". */
3
3
 
4
4
  @layer utilities {
5
5
  .__tailjng_colors_safelist_1__ {
@@ -22,7 +22,7 @@
22
22
  @apply hover:bg-teal-500/20 hover:bg-teal-600 hover:bg-yellow-600/10 hover:bg-yellow-600/20 hover:bg-yellow-700 shadow-md shadow-sm text-black text-blue-500 text-blue-600 text-cyan-500 text-cyan-600 text-dark-border text-gray-500 text-gray-600 text-green-500 text-green-600 text-orange-500 text-orange-600 text-pink-500 text-pink-600 text-primary text-purple-500 text-purple-600 text-red-500 text-red-600 text-teal-500 text-teal-600 text-white text-yellow-500 text-yellow-600 text-yellow-700;
23
23
  }
24
24
 
25
- /* ── Tus colores custom: descomenta y añade clases Tailwind ── */
25
+ /* ── Custom colors: uncomment and add Tailwind classes ── */
26
26
  .__tailjng_custom_colors__ {
27
27
  /* @apply bg-indigo-600 text-white hover:bg-indigo-700; */
28
28
  }
@@ -0,0 +1,26 @@
1
+ # Iconos Tailjng — registro del proyecto
2
+
3
+ Carpeta generada en `src/app/tailjng/.config/icons/` por `init:app`, `sync:app` o `npx tailjng add icons`.
4
+
5
+ ## Uso
6
+
7
+ ```typescript
8
+ import { Icons } from '../.config/icons/icons.lucide';
9
+
10
+ export class MyPageComponent {
11
+ readonly Icons = Icons;
12
+ }
13
+ ```
14
+
15
+ ```html
16
+ <JIcon [icon]="Icons.Save" [size]="18" />
17
+ <JIcon [icon]="Icons.Loader2" iconClass="animate-spin" />
18
+ ```
19
+
20
+ ## Añadir un icono
21
+
22
+ 1. Importa desde `lucide-angular` en `icons.lucide.ts`
23
+ 2. Añade `static readonly NombreLucide = NombreLucide;` (PascalCase, igual que en Lucide)
24
+ 3. Usa `[icon]="Icons.NombreLucide"`
25
+
26
+ Los nombres son los oficiales de Lucide (`Loader2`, `Save`, `CircleCheck`, …), no alias semánticos.
@@ -0,0 +1,134 @@
1
+ import {
2
+ ArrowBigRight,
3
+ ArrowDownWideNarrow,
4
+ Calendar,
5
+ Check,
6
+ ChevronDown,
7
+ ChevronLeft,
8
+ ChevronRight,
9
+ ChevronsLeft,
10
+ ChevronsRight,
11
+ ChevronsUpDown,
12
+ ChevronUp,
13
+ CircleAlert,
14
+ CircleCheck,
15
+ CircleHelp,
16
+ CircleX,
17
+ Clipboard,
18
+ Clock,
19
+ Copy,
20
+ Cpu,
21
+ Download,
22
+ Edit,
23
+ EllipsisVertical,
24
+ Eraser,
25
+ Eye,
26
+ FileSpreadsheet,
27
+ FileUp,
28
+ Filter,
29
+ Image,
30
+ ImageOff,
31
+ Images,
32
+ Info,
33
+ Link,
34
+ Link2Off,
35
+ ListFilter,
36
+ ListRestart,
37
+ Loader2,
38
+ Minimize2,
39
+ MonitorUp,
40
+ Moon,
41
+ Pencil,
42
+ PencilLine,
43
+ RefreshCcw,
44
+ RotateCcw,
45
+ RotateCw,
46
+ Save,
47
+ Scan,
48
+ Search,
49
+ SquareDashedMousePointer,
50
+ Sun,
51
+ Table,
52
+ Trash,
53
+ Trash2,
54
+ TriangleAlert,
55
+ Upload,
56
+ X,
57
+ ZoomIn,
58
+ ZoomOut,
59
+ } from 'lucide-angular';
60
+
61
+ // Icon registry — Lucide names in PascalCase (Icons.Loader2, Icons.Save, …)
62
+ //
63
+ // my-feature.component.ts:
64
+ // import { Icons } from '../.config/icons/icons.lucide';
65
+ // readonly Icons = Icons;
66
+ //
67
+ // template:
68
+ // <JIcon [icon]="Icons.Loader2" [size]="18" />
69
+ export class Icons {
70
+ static readonly Info = Info;
71
+ static readonly CircleCheck = CircleCheck;
72
+ static readonly CircleX = CircleX;
73
+ static readonly TriangleAlert = TriangleAlert;
74
+ static readonly CircleHelp = CircleHelp;
75
+ static readonly X = X;
76
+ static readonly Check = Check;
77
+ static readonly ZoomIn = ZoomIn;
78
+ static readonly ZoomOut = ZoomOut;
79
+ static readonly RotateCw = RotateCw;
80
+ static readonly RotateCcw = RotateCcw;
81
+ static readonly RefreshCcw = RefreshCcw;
82
+ static readonly Scan = Scan;
83
+ static readonly Minimize2 = Minimize2;
84
+ static readonly Image = Image;
85
+ static readonly Images = Images;
86
+ static readonly ImageOff = ImageOff;
87
+ static readonly Upload = Upload;
88
+ static readonly Eye = Eye;
89
+ static readonly ChevronUp = ChevronUp;
90
+ static readonly ChevronDown = ChevronDown;
91
+ static readonly ChevronsUpDown = ChevronsUpDown;
92
+ static readonly SquareDashedMousePointer = SquareDashedMousePointer;
93
+ static readonly Search = Search;
94
+ static readonly Copy = Copy;
95
+ static readonly Save = Save;
96
+ static readonly Sun = Sun;
97
+ static readonly Moon = Moon;
98
+ static readonly Loader2 = Loader2;
99
+ static readonly Table = Table;
100
+ static readonly ListFilter = ListFilter;
101
+
102
+ static readonly ChevronsLeft = ChevronsLeft;
103
+ static readonly ChevronLeft = ChevronLeft;
104
+ static readonly ChevronRight = ChevronRight;
105
+ static readonly ChevronsRight = ChevronsRight;
106
+
107
+ static readonly ArrowBigRight = ArrowBigRight;
108
+
109
+ static readonly Filter = Filter;
110
+ static readonly ArrowDownWideNarrow = ArrowDownWideNarrow;
111
+ static readonly Eraser = Eraser;
112
+ static readonly Trash2 = Trash2;
113
+ static readonly Trash = Trash;
114
+ static readonly Cpu = Cpu;
115
+ static readonly FileSpreadsheet = FileSpreadsheet;
116
+ static readonly MonitorUp = MonitorUp;
117
+ static readonly Download = Download;
118
+ static readonly FileUp = FileUp;
119
+ static readonly ListRestart = ListRestart;
120
+ static readonly PencilLine = PencilLine;
121
+ static readonly Pencil = Pencil;
122
+ static readonly Edit = Edit;
123
+ static readonly EllipsisVertical = EllipsisVertical;
124
+ static readonly Calendar = Calendar;
125
+ static readonly Clock = Clock;
126
+ static readonly CircleAlert = CircleAlert;
127
+ static readonly Clipboard = Clipboard;
128
+ static readonly Link = Link;
129
+ static readonly Link2Off = Link2Off;
130
+
131
+ // ── Custom (import above and add entries here) ──
132
+ // static readonly Home = Home;
133
+ // static readonly Settings = Settings;
134
+ }
@@ -0,0 +1,24 @@
1
+ # Input styles
2
+
3
+ Shared Tailwind class maps for `JInput`, `JTextareaInput`, `JFileInput`, and related components.
4
+
5
+ Copied to `src/app/tailjng/.config/input/` when you install any input component (registry dependency `input-classes`).
6
+
7
+ ## Customize
8
+
9
+ Edit **`input.classes.ts`** to change borders, colors, typography, focus ring, heights, or padding for all inputs at once.
10
+
11
+ | Export | Used by |
12
+ |--------|---------|
13
+ | `INPUT_SURFACE_CLASSES` | All text-like inputs |
14
+ | `INPUT_SINGLE_LINE_HEIGHT_CLASSES` | JInput, JFileInput |
15
+ | `INPUT_TEXTAREA_HEIGHT_CLASSES` | JTextareaInput |
16
+ | `INPUT_FOCUS_CLASSES` | JInput, JTextareaInput |
17
+ | `INPUT_FOCUS_WITHIN_CLASSES` | JFileInput label |
18
+ | `INPUT_PADDING_X_*` | Per control type |
19
+ | `INPUT_FILE_LABEL_LAYOUT_CLASSES` | JFileInput only |
20
+ | `inputActionButtonClasses()` | Clear / clipboard buttons |
21
+
22
+ Component-specific behavior (clear-button padding, textarea resize, range slider thumb) stays in each component.
23
+
24
+ Global pseudo-element rules (placeholder, autofill, date picker) live in app **`styles.css`** under `.input`.
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Shared Tailwind class maps for input components (JInput, JTextareaInput, JFileInput, …).
3
+ *
4
+ * Edit this file to change the default look of all inputs from one place.
5
+ * Component-specific layout (heights, padding, resize) stays in each component.
6
+ */
7
+
8
+ /** Marker class — hooks global `.input` styles in `styles.css`. */
9
+ export const INPUT_MARKER = 'input';
10
+
11
+ /** Border, colors, typography, transitions — shared by all text-like inputs. */
12
+ export const INPUT_SURFACE_CLASSES: Record<string, boolean> = {
13
+ [INPUT_MARKER]: true,
14
+ 'w-full': true,
15
+ 'text-[12px]': true,
16
+ 'bg-background': true,
17
+ 'dark:bg-dark-background': true,
18
+ border: true,
19
+ 'border-border': true,
20
+ 'dark:border-dark-border': true,
21
+ 'text-black': true,
22
+ 'dark:text-white': true,
23
+ 'placeholder:text-muted-foreground/70': true,
24
+ 'dark:placeholder:text-dark-muted-foreground/70': true,
25
+ rounded: true,
26
+ 'py-2': true,
27
+ transition: true,
28
+ 'duration-200': true,
29
+ 'disabled:opacity-60': true,
30
+ 'disabled:cursor-not-allowed': true,
31
+ };
32
+
33
+ /** Default height for single-line fields (JInput, JFileInput label). */
34
+ export const INPUT_SINGLE_LINE_HEIGHT_CLASSES: Record<string, boolean> = {
35
+ 'h-[40px]': true,
36
+ 'max-[400px]:h-[35px]': true,
37
+ };
38
+
39
+ /** Default height for JTextareaInput. */
40
+ export const INPUT_TEXTAREA_HEIGHT_CLASSES: Record<string, boolean> = {
41
+ 'h-[70px]': true,
42
+ 'max-[400px]:h-[35px]': true,
43
+ 'min-h-[70px]': true,
44
+ };
45
+
46
+ /** Focus ring for native `<input>` / `<textarea>`. */
47
+ export const INPUT_FOCUS_CLASSES: Record<string, boolean> = {
48
+ 'focus:outline-none': true,
49
+ 'focus:ring-2': true,
50
+ 'focus:ring-primary': true,
51
+ 'dark:focus:ring-dark-primary': true,
52
+ };
53
+
54
+ /** Focus ring for clickable labels (JFileInput). */
55
+ export const INPUT_FOCUS_WITHIN_CLASSES: Record<string, boolean> = {
56
+ 'focus-within:outline-none': true,
57
+ 'focus-within:ring-2': true,
58
+ 'focus-within:ring-primary': true,
59
+ 'dark:focus-within:ring-dark-primary': true,
60
+ };
61
+
62
+ /** Horizontal padding for single-line inputs. */
63
+ export const INPUT_PADDING_X_SINGLE: Record<string, boolean> = {
64
+ 'pl-3': true,
65
+ };
66
+
67
+ /** Horizontal padding for textarea. */
68
+ export const INPUT_PADDING_X_TEXTAREA: Record<string, boolean> = {
69
+ 'px-3': true,
70
+ };
71
+
72
+ /** Layout utilities for the JFileInput visible label. */
73
+ export const INPUT_FILE_LABEL_LAYOUT_CLASSES: Record<string, boolean> = {
74
+ block: true,
75
+ flex: true,
76
+ 'items-center': true,
77
+ 'justify-between': true,
78
+ 'gap-2': true,
79
+ 'select-none': true,
80
+ 'cursor-pointer': true,
81
+ 'pr-2': true,
82
+ };
83
+
84
+ /** Enabled state for clear / icon action buttons. */
85
+ export const INPUT_ACTION_BUTTON_ENABLED_CLASSES: Record<string, boolean> = {
86
+ 'text-muted-foreground hover:text-foreground dark:text-dark-muted-foreground dark:hover:text-dark-foreground': true,
87
+ };
88
+
89
+ /** Disabled state for clear / icon action buttons. */
90
+ export const INPUT_ACTION_BUTTON_DISABLED_CLASSES: Record<string, boolean> = {
91
+ 'cursor-not-allowed opacity-50': true,
92
+ };
93
+
94
+ /** Programmatic disabled overlay on the field itself. */
95
+ export const INPUT_DISABLED_OVERLAY_CLASSES: Record<string, boolean> = {
96
+ 'opacity-50': true,
97
+ };
98
+
99
+ /**
100
+ * Merges multiple class maps into one object.
101
+ * @param maps Class maps to combine (later entries override earlier keys).
102
+ * @returns Merged class map.
103
+ */
104
+ export function mergeInputClasses(
105
+ ...maps: Record<string, boolean>[]
106
+ ): Record<string, boolean> {
107
+ return Object.assign({}, ...maps);
108
+ }
109
+
110
+ /**
111
+ * Class map for clear / icon action buttons.
112
+ * @param isDisabled Whether the parent control is disabled.
113
+ * @returns Enabled or enabled+disabled utility classes.
114
+ */
115
+ export function inputActionButtonClasses(isDisabled: boolean): Record<string, boolean> {
116
+ return isDisabled
117
+ ? mergeInputClasses(INPUT_ACTION_BUTTON_ENABLED_CLASSES, INPUT_ACTION_BUTTON_DISABLED_CLASSES)
118
+ : INPUT_ACTION_BUTTON_ENABLED_CLASSES;
119
+ }