@tolle_/tolle-ui 0.0.5-beta → 0.0.7-beta
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/esm2022/lib/theme.service.mjs +77 -7
- package/esm2022/lib/tolle-config.mjs +3 -4
- package/fesm2022/tolle_-tolle-ui.mjs +78 -9
- package/fesm2022/tolle_-tolle-ui.mjs.map +1 -1
- package/lib/button.component.d.ts +1 -1
- package/lib/theme.service.d.ts +8 -5
- package/package.json +4 -1
- package/preset.js +56 -0
- package/theme.css +39 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" |
|
|
4
|
+
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
5
|
size?: "default" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon" | "icon-lg" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
export type ButtonProps = VariantProps<typeof buttonVariants>;
|
package/lib/theme.service.d.ts
CHANGED
|
@@ -8,19 +8,22 @@ export declare class ThemeService {
|
|
|
8
8
|
private renderer;
|
|
9
9
|
private isDarkSubject;
|
|
10
10
|
isDark$: import("rxjs").Observable<boolean>;
|
|
11
|
+
private styleId;
|
|
11
12
|
constructor(document: Document, platformId: Object, config: TolleConfig, rendererFactory: RendererFactory2);
|
|
12
13
|
private initializeTheme;
|
|
13
14
|
/**
|
|
14
|
-
* Applies the brand identity variables
|
|
15
|
-
* These are applied to :root (html) so they ripple through all color-mix functions.
|
|
15
|
+
* Applies the brand identity variables with full shade palette
|
|
16
16
|
*/
|
|
17
17
|
applyBrandConfig(config: TolleConfig): void;
|
|
18
|
+
/**
|
|
19
|
+
* Generates full primary color palette (50-900) based on base color
|
|
20
|
+
* Uses color-mix() for consistency with your existing approach
|
|
21
|
+
*/
|
|
22
|
+
private generatePrimaryShades;
|
|
23
|
+
private injectDynamicStyles;
|
|
18
24
|
toggleTheme(): void;
|
|
19
25
|
private enableDarkMode;
|
|
20
26
|
private disableDarkMode;
|
|
21
|
-
/**
|
|
22
|
-
* Helper to get current state for components that might need JS-based logic
|
|
23
|
-
*/
|
|
24
27
|
get currentTheme(): 'dark' | 'light';
|
|
25
28
|
static ɵfac: i0.ɵɵFactoryDeclaration<ThemeService, [null, null, { optional: true; }, null]>;
|
|
26
29
|
static ɵprov: i0.ɵɵInjectableDeclaration<ThemeService>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tolle_/tolle-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7-beta",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
"./theme.css": {
|
|
9
9
|
"default": "./theme.css"
|
|
10
10
|
},
|
|
11
|
+
"./preset": {
|
|
12
|
+
"default": "./preset.js"
|
|
13
|
+
},
|
|
11
14
|
"./package.json": {
|
|
12
15
|
"default": "./package.json"
|
|
13
16
|
},
|
package/preset.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
theme: {
|
|
4
|
+
extend: {
|
|
5
|
+
colors: {
|
|
6
|
+
// Primary with full palette
|
|
7
|
+
primary: {
|
|
8
|
+
50: 'var(--primary-50)',
|
|
9
|
+
100: 'var(--primary-100)',
|
|
10
|
+
200: 'var(--primary-200)',
|
|
11
|
+
300: 'var(--primary-300)',
|
|
12
|
+
400: 'var(--primary-400)',
|
|
13
|
+
500: 'var(--primary-500)',
|
|
14
|
+
600: 'var(--primary-600)',
|
|
15
|
+
700: 'var(--primary-700)',
|
|
16
|
+
800: 'var(--primary-800)',
|
|
17
|
+
900: 'var(--primary-900)',
|
|
18
|
+
DEFAULT: 'var(--primary-500)',
|
|
19
|
+
foreground: 'var(--primary-foreground)',
|
|
20
|
+
},
|
|
21
|
+
// Other colors
|
|
22
|
+
secondary: {
|
|
23
|
+
DEFAULT: 'var(--secondary)',
|
|
24
|
+
foreground: 'var(--secondary-foreground)',
|
|
25
|
+
},
|
|
26
|
+
muted: {
|
|
27
|
+
DEFAULT: 'var(--muted)',
|
|
28
|
+
foreground: 'var(--muted-foreground)',
|
|
29
|
+
},
|
|
30
|
+
accent: {
|
|
31
|
+
DEFAULT: 'var(--accent)',
|
|
32
|
+
foreground: 'var(--accent-foreground)',
|
|
33
|
+
},
|
|
34
|
+
destructive: {
|
|
35
|
+
DEFAULT: 'var(--destructive)',
|
|
36
|
+
foreground: 'var(--destructive-foreground)',
|
|
37
|
+
},
|
|
38
|
+
border: 'var(--border)',
|
|
39
|
+
input: 'var(--input)',
|
|
40
|
+
ring: 'var(--ring)',
|
|
41
|
+
background: 'var(--background)',
|
|
42
|
+
foreground: 'var(--foreground)',
|
|
43
|
+
popover: {
|
|
44
|
+
DEFAULT: 'var(--popover)',
|
|
45
|
+
foreground: 'var(--popover-foreground)',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
borderRadius: {
|
|
49
|
+
lg: 'var(--radius)',
|
|
50
|
+
md: 'calc(var(--radius) - 2px)',
|
|
51
|
+
sm: 'calc(var(--radius) - 4px)',
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
plugins: [],
|
|
56
|
+
};
|
package/theme.css
CHANGED
|
@@ -6,25 +6,34 @@
|
|
|
6
6
|
@tailwind utilities;
|
|
7
7
|
|
|
8
8
|
/* -------------------------------------------------------------------------- */
|
|
9
|
-
/* 2. THEME VARIABLES (The Engine)
|
|
9
|
+
/* 2. THEME VARIABLES (The Engine) - WITH FULL PALETTE */
|
|
10
10
|
/* -------------------------------------------------------------------------- */
|
|
11
11
|
:root {
|
|
12
12
|
/* --- Configuration (Source of Truth) --- */
|
|
13
13
|
--primary: #2563eb;
|
|
14
14
|
--radius: 0.5rem;
|
|
15
15
|
|
|
16
|
-
/* --- Auto-Generated
|
|
16
|
+
/* --- Auto-Generated Full Palette (Defaults) --- */
|
|
17
|
+
--primary-50: #eff6ff;
|
|
18
|
+
--primary-100: #dbeafe;
|
|
19
|
+
--primary-200: #bfdbfe;
|
|
20
|
+
--primary-300: #93c5fd;
|
|
21
|
+
--primary-400: #60a5fa;
|
|
22
|
+
--primary-500: #3b82f6;
|
|
23
|
+
--primary-600: #2563eb;
|
|
24
|
+
--primary-700: #1d4ed8;
|
|
25
|
+
--primary-800: #1e40af;
|
|
26
|
+
--primary-900: #1e3a8a;
|
|
27
|
+
|
|
28
|
+
/* --- Derived Colors (will be overridden by dynamic styles) --- */
|
|
17
29
|
--primary-foreground: #ffffff;
|
|
18
|
-
--secondary: color-mix(in srgb, var(--primary),
|
|
19
|
-
--secondary-foreground:
|
|
20
|
-
|
|
21
|
-
--muted: color-mix(in srgb, var(--primary), #
|
|
22
|
-
--
|
|
23
|
-
|
|
24
|
-
--
|
|
25
|
-
--accent-foreground: var(--primary);
|
|
26
|
-
|
|
27
|
-
--ring: color-mix(in srgb, var(--primary), transparent 75%);
|
|
30
|
+
--secondary: color-mix(in srgb, var(--primary-200), transparent 40%);
|
|
31
|
+
--secondary-foreground: var(--primary-900);
|
|
32
|
+
--muted: color-mix(in srgb, var(--primary-50), #f3f4f6 50%);
|
|
33
|
+
--muted-foreground: color-mix(in srgb, var(--primary-400), #4b5563 60%);
|
|
34
|
+
--accent: color-mix(in srgb, var(--primary-100), transparent 70%);
|
|
35
|
+
--accent-foreground: var(--primary-700);
|
|
36
|
+
--ring: color-mix(in srgb, var(--primary-300), transparent 50%);
|
|
28
37
|
|
|
29
38
|
/* --- Neutral/Layout Base --- */
|
|
30
39
|
--background: #ffffff;
|
|
@@ -34,10 +43,23 @@
|
|
|
34
43
|
--destructive: #ef4444;
|
|
35
44
|
--destructive-foreground: #f8fafc;
|
|
36
45
|
--input-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
46
|
+
--popover: #ffffff;
|
|
47
|
+
--popover-foreground: #020817;
|
|
37
48
|
}
|
|
38
49
|
|
|
39
50
|
/* --- Dark Mode (Google/Charcoal Palette) --- */
|
|
40
51
|
.dark {
|
|
52
|
+
--primary-50: #1e3a8a;
|
|
53
|
+
--primary-100: #1e40af;
|
|
54
|
+
--primary-200: #1d4ed8;
|
|
55
|
+
--primary-300: #2563eb;
|
|
56
|
+
--primary-400: #3b82f6;
|
|
57
|
+
--primary-500: #60a5fa;
|
|
58
|
+
--primary-600: #93c5fd;
|
|
59
|
+
--primary-700: #bfdbfe;
|
|
60
|
+
--primary-800: #dbeafe;
|
|
61
|
+
--primary-900: #eff6ff;
|
|
62
|
+
|
|
41
63
|
--background: #121212;
|
|
42
64
|
--foreground: #e3e3e3;
|
|
43
65
|
--secondary: #1f1f1f;
|
|
@@ -49,11 +71,14 @@
|
|
|
49
71
|
--popover: #1f1f1f;
|
|
50
72
|
--popover-foreground: #e3e3e3;
|
|
51
73
|
--accent: rgba(255, 255, 255, 0.04);
|
|
52
|
-
--accent-foreground: var(--primary);
|
|
53
|
-
--ring: color-mix(in srgb, var(--primary), transparent
|
|
74
|
+
--accent-foreground: var(--primary-400);
|
|
75
|
+
--ring: color-mix(in srgb, var(--primary-500), transparent 60%);
|
|
54
76
|
--input-shadow: 0 0 #0000;
|
|
77
|
+
--destructive: #dc2626;
|
|
78
|
+
--destructive-foreground: #f8fafc;
|
|
55
79
|
}
|
|
56
80
|
|
|
81
|
+
/* [Rest of your existing CSS remains the same - everything below stays] */
|
|
57
82
|
/* -------------------------------------------------------------------------- */
|
|
58
83
|
/* 3. BASE LAYER (Icons & Typography) */
|
|
59
84
|
/* -------------------------------------------------------------------------- */
|