eidosui 0.1.0__py3-none-any.whl → 0.3.0__py3-none-any.whl
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.
- eidos/__init__.py +0 -57
- eidos/components/headers.py +68 -0
- eidos/components/navigation.py +78 -0
- eidos/css/styles.css +430 -0
- eidos/css/themes/dark.css +119 -0
- eidos/css/themes/eidos-variables.css +190 -0
- eidos/css/themes/light.css +80 -0
- eidos/js/eidos.js +112 -0
- eidos/plugins/__init__.py +1 -0
- eidos/plugins/markdown/__init__.py +21 -0
- eidos/plugins/markdown/components.py +53 -0
- eidos/plugins/markdown/css/markdown.css +283 -0
- eidos/plugins/markdown/extensions/__init__.py +1 -0
- eidos/plugins/markdown/extensions/alerts.py +134 -0
- eidos/plugins/markdown/renderer.py +58 -0
- eidos/styles.py +80 -0
- eidos/tags.py +99 -0
- eidos/utils.py +72 -0
- eidosui-0.3.0.dist-info/METADATA +127 -0
- eidosui-0.3.0.dist-info/RECORD +22 -0
- eidosui-0.3.0.dist-info/licenses/LICENSE +21 -0
- eidos/components/__init__.py +0 -22
- eidos/components/forms.py +0 -57
- eidos/components/typography.py +0 -85
- eidos/core/__init__.py +0 -25
- eidos/core/helpers.py +0 -87
- eidos/core/styles.py +0 -92
- eidos/core/utils.py +0 -46
- eidos/static/eidos-ui.js +0 -74
- eidos/themes/dark.css +0 -52
- eidos/themes/light.css +0 -110
- eidosui-0.1.0.dist-info/METADATA +0 -61
- eidosui-0.1.0.dist-info/RECORD +0 -14
- {eidosui-0.1.0.dist-info → eidosui-0.3.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,119 @@
|
|
1
|
+
/* EidosUI Dark Theme */
|
2
|
+
[data-theme="dark"] {
|
3
|
+
/* Core Colors - Dark Mode Adjusted */
|
4
|
+
--color-primary: #60a5fa;
|
5
|
+
--color-primary-hover: #3b82f6;
|
6
|
+
--color-primary-light: #1e3a8a;
|
7
|
+
--color-primary-dark: #2563eb;
|
8
|
+
--color-primary-foreground: #0f172a;
|
9
|
+
|
10
|
+
--color-secondary: #9ca3af;
|
11
|
+
--color-secondary-hover: #d1d5db;
|
12
|
+
--color-secondary-light: #374151;
|
13
|
+
--color-secondary-dark: #e5e7eb;
|
14
|
+
--color-secondary-foreground: #0f172a;
|
15
|
+
|
16
|
+
--color-accent: #a78bfa;
|
17
|
+
--color-accent-hover: #8b5cf6;
|
18
|
+
--color-accent-light: #5b21b6;
|
19
|
+
--color-accent-dark: #7c3aed;
|
20
|
+
--color-accent-foreground: #0f172a;
|
21
|
+
|
22
|
+
/* Semantic Colors - Dark Mode Adjusted */
|
23
|
+
--color-success: #34d399;
|
24
|
+
--color-success-hover: #10b981;
|
25
|
+
--color-success-light: #065f46;
|
26
|
+
--color-success-dark: #6ee7b7;
|
27
|
+
--color-success-foreground: #0f172a;
|
28
|
+
|
29
|
+
--color-cta: #fbbf24;
|
30
|
+
--color-cta-hover: #f59e0b;
|
31
|
+
--color-cta-light: #92400e;
|
32
|
+
--color-cta-dark: #fcd34d;
|
33
|
+
--color-cta-foreground: #0f172a;
|
34
|
+
|
35
|
+
--color-warning: #fde047;
|
36
|
+
--color-warning-hover: #facc15;
|
37
|
+
--color-warning-light: #713f12;
|
38
|
+
--color-warning-dark: #fef08a;
|
39
|
+
--color-warning-foreground: #0f172a;
|
40
|
+
|
41
|
+
--color-error: #f87171;
|
42
|
+
--color-error-hover: #ef4444;
|
43
|
+
--color-error-light: #7f1d1d;
|
44
|
+
--color-error-dark: #fca5a5;
|
45
|
+
--color-error-foreground: #0f172a;
|
46
|
+
|
47
|
+
--color-info: #38bdf8;
|
48
|
+
--color-info-hover: #0ea5e9;
|
49
|
+
--color-info-light: #0c4a6e;
|
50
|
+
--color-info-dark: #7dd3fc;
|
51
|
+
--color-info-foreground: #0f172a;
|
52
|
+
|
53
|
+
/* Surface Colors - Dark Mode */
|
54
|
+
--color-background: #0f172a;
|
55
|
+
--color-surface: #1e293b;
|
56
|
+
--color-surface-elevated: #334155;
|
57
|
+
--color-border: #334155;
|
58
|
+
--color-border-hover: #475569;
|
59
|
+
--color-input: #1e293b;
|
60
|
+
--color-card: #1e293b;
|
61
|
+
|
62
|
+
/* Text Colors - Dark Mode */
|
63
|
+
--color-text: #f8fafc;
|
64
|
+
--color-text-muted: #94a3b8;
|
65
|
+
--color-text-subtle: #64748b;
|
66
|
+
--color-text-inverse: #0f172a;
|
67
|
+
|
68
|
+
/* Shadows - Subtle for Dark Mode */
|
69
|
+
--shadow-xs: 0 0 0 1px rgb(255 255 255 / 0.05);
|
70
|
+
--shadow-sm: 0 0 0 1px rgb(255 255 255 / 0.1);
|
71
|
+
--shadow-base: 0 0 0 1px rgb(255 255 255 / 0.1), 0 1px 2px 0 rgb(0 0 0 / 0.3);
|
72
|
+
--shadow-md: 0 0 0 1px rgb(255 255 255 / 0.1), 0 4px 6px -1px rgb(0 0 0 / 0.3);
|
73
|
+
--shadow-lg: 0 0 0 1px rgb(255 255 255 / 0.1), 0 10px 15px -3px rgb(0 0 0 / 0.3);
|
74
|
+
--shadow-xl: 0 0 0 1px rgb(255 255 255 / 0.1), 0 20px 25px -5px rgb(0 0 0 / 0.3);
|
75
|
+
--shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.5);
|
76
|
+
--shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.3);
|
77
|
+
}
|
78
|
+
|
79
|
+
/* Dark theme button overrides for better aesthetics */
|
80
|
+
[data-theme="dark"] .eidos-btn-primary,
|
81
|
+
[data-theme="dark"] .eidos-btn-secondary,
|
82
|
+
[data-theme="dark"] .eidos-btn-success,
|
83
|
+
[data-theme="dark"] .eidos-btn-error,
|
84
|
+
[data-theme="dark"] .eidos-btn-warning,
|
85
|
+
[data-theme="dark"] .eidos-btn-info,
|
86
|
+
[data-theme="dark"] .eidos-btn-cta {
|
87
|
+
box-shadow: 0 2px 4px 0 rgb(0 0 0 / 0.2), 0 0 0 1px rgb(255 255 255 / 0.05);
|
88
|
+
}
|
89
|
+
|
90
|
+
[data-theme="dark"] .eidos-btn-primary:hover,
|
91
|
+
[data-theme="dark"] .eidos-btn-secondary:hover,
|
92
|
+
[data-theme="dark"] .eidos-btn-success:hover,
|
93
|
+
[data-theme="dark"] .eidos-btn-error:hover,
|
94
|
+
[data-theme="dark"] .eidos-btn-warning:hover,
|
95
|
+
[data-theme="dark"] .eidos-btn-info:hover,
|
96
|
+
[data-theme="dark"] .eidos-btn-cta:hover {
|
97
|
+
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.2), 0 0 0 1px rgb(255 255 255 / 0.1);
|
98
|
+
}
|
99
|
+
|
100
|
+
[data-theme="dark"] .eidos-btn-primary:active,
|
101
|
+
[data-theme="dark"] .eidos-btn-secondary:active,
|
102
|
+
[data-theme="dark"] .eidos-btn-success:active,
|
103
|
+
[data-theme="dark"] .eidos-btn-error:active,
|
104
|
+
[data-theme="dark"] .eidos-btn-warning:active,
|
105
|
+
[data-theme="dark"] .eidos-btn-info:active,
|
106
|
+
[data-theme="dark"] .eidos-btn-cta:active {
|
107
|
+
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.2), 0 0 0 1px rgb(255 255 255 / 0.05);
|
108
|
+
}
|
109
|
+
|
110
|
+
[data-theme="dark"] .eidos-btn-ghost {
|
111
|
+
color: var(--color-text-muted);
|
112
|
+
}
|
113
|
+
|
114
|
+
[data-theme="dark"] .eidos-btn-ghost:hover {
|
115
|
+
color: var(--color-text);
|
116
|
+
background-color: rgb(255 255 255 / 0.05);
|
117
|
+
border-color: rgb(255 255 255 / 0.1);
|
118
|
+
box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.2);
|
119
|
+
}
|
@@ -0,0 +1,190 @@
|
|
1
|
+
/* EidosUI CSS Variables - Base Configuration */
|
2
|
+
|
3
|
+
:root {
|
4
|
+
/* Core Colors */
|
5
|
+
--color-primary: #3b82f6;
|
6
|
+
--color-primary-hover: #2563eb;
|
7
|
+
--color-primary-light: #dbeafe;
|
8
|
+
--color-primary-dark: #1d4ed8;
|
9
|
+
--color-primary-foreground: #ffffff;
|
10
|
+
|
11
|
+
--color-secondary: #6b7280;
|
12
|
+
--color-secondary-hover: #4b5563;
|
13
|
+
--color-secondary-light: #f9fafb;
|
14
|
+
--color-secondary-dark: #374151;
|
15
|
+
--color-secondary-foreground: #ffffff;
|
16
|
+
|
17
|
+
--color-accent: #7c3aed;
|
18
|
+
--color-accent-hover: #6d28d9;
|
19
|
+
--color-accent-light: #f3e8ff;
|
20
|
+
--color-accent-dark: #5b21b6;
|
21
|
+
--color-accent-foreground: #ffffff;
|
22
|
+
|
23
|
+
/* Semantic Colors */
|
24
|
+
--color-success: #10b981;
|
25
|
+
--color-success-hover: #059669;
|
26
|
+
--color-success-light: #d1fae5;
|
27
|
+
--color-success-dark: #047857;
|
28
|
+
--color-success-foreground: #ffffff;
|
29
|
+
|
30
|
+
--color-cta: #f59e0b;
|
31
|
+
--color-cta-hover: #d97706;
|
32
|
+
--color-cta-light: #fef3c7;
|
33
|
+
--color-cta-dark: #b45309;
|
34
|
+
--color-cta-foreground: #ffffff;
|
35
|
+
|
36
|
+
--color-warning: #eab308;
|
37
|
+
--color-warning-hover: #ca8a04;
|
38
|
+
--color-warning-light: #fefce8;
|
39
|
+
--color-warning-dark: #a16207;
|
40
|
+
--color-warning-foreground: #000000;
|
41
|
+
|
42
|
+
--color-error: #dc2626;
|
43
|
+
--color-error-hover: #b91c1c;
|
44
|
+
--color-error-light: #fef2f2;
|
45
|
+
--color-error-dark: #991b1b;
|
46
|
+
--color-error-foreground: #ffffff;
|
47
|
+
|
48
|
+
--color-info: #0ea5e9;
|
49
|
+
--color-info-hover: #0284c7;
|
50
|
+
--color-info-light: #f0f9ff;
|
51
|
+
--color-info-dark: #0369a1;
|
52
|
+
--color-info-foreground: #ffffff;
|
53
|
+
|
54
|
+
/* Surface Colors */
|
55
|
+
--color-background: #ffffff;
|
56
|
+
--color-surface: #f8fafc;
|
57
|
+
--color-surface-elevated: #ffffff;
|
58
|
+
--color-border: #e2e8f0;
|
59
|
+
--color-border-hover: #cbd5e1;
|
60
|
+
--color-input: #ffffff;
|
61
|
+
--color-card: #ffffff;
|
62
|
+
|
63
|
+
/* Text Colors */
|
64
|
+
--color-text: #0f172a;
|
65
|
+
--color-text-muted: #64748b;
|
66
|
+
--color-text-subtle: #94a3b8;
|
67
|
+
--color-text-inverse: #ffffff;
|
68
|
+
|
69
|
+
/* RGB Values for Gradients (without rgb() wrapper) */
|
70
|
+
--color-primary-rgb: 59, 130, 246;
|
71
|
+
--color-secondary-rgb: 156, 163, 175;
|
72
|
+
--color-accent-rgb: 168, 85, 247;
|
73
|
+
--color-surface-rgb: 248, 250, 252;
|
74
|
+
--color-background-rgb: 255, 255, 255;
|
75
|
+
|
76
|
+
/* Spacing Scale */
|
77
|
+
--space-xs: 0.25rem; /* 4px */
|
78
|
+
--space-sm: 0.5rem; /* 8px */
|
79
|
+
--space-md: 1rem; /* 16px */
|
80
|
+
--space-lg: 1.5rem; /* 24px */
|
81
|
+
--space-xl: 2rem; /* 32px */
|
82
|
+
--space-2xl: 3rem; /* 48px */
|
83
|
+
--space-3xl: 4rem; /* 64px */
|
84
|
+
|
85
|
+
/* Typography Scale */
|
86
|
+
--font-size-xs: 0.75rem; /* 12px */
|
87
|
+
--font-size-sm: 0.875rem; /* 14px */
|
88
|
+
--font-size-base: 1rem; /* 16px */
|
89
|
+
--font-size-lg: 1.125rem; /* 18px */
|
90
|
+
--font-size-xl: 1.25rem; /* 20px */
|
91
|
+
--font-size-2xl: 1.5rem; /* 24px */
|
92
|
+
--font-size-3xl: 1.875rem; /* 30px */
|
93
|
+
--font-size-4xl: 2.25rem; /* 36px */
|
94
|
+
--font-size-5xl: 3rem; /* 48px */
|
95
|
+
--font-size-6xl: 3.75rem; /* 60px */
|
96
|
+
|
97
|
+
/* Font Weights */
|
98
|
+
--font-weight-thin: 100;
|
99
|
+
--font-weight-light: 300;
|
100
|
+
--font-weight-normal: 400;
|
101
|
+
--font-weight-medium: 500;
|
102
|
+
--font-weight-semibold: 600;
|
103
|
+
--font-weight-bold: 700;
|
104
|
+
--font-weight-extrabold: 800;
|
105
|
+
--font-weight-black: 900;
|
106
|
+
|
107
|
+
/* Line Heights */
|
108
|
+
--line-height-none: 1;
|
109
|
+
--line-height-tight: 1.25;
|
110
|
+
--line-height-snug: 1.375;
|
111
|
+
--line-height-normal: 1.5;
|
112
|
+
--line-height-relaxed: 1.625;
|
113
|
+
--line-height-loose: 2;
|
114
|
+
|
115
|
+
/* Letter Spacing */
|
116
|
+
--letter-spacing-tighter: -0.05em;
|
117
|
+
--letter-spacing-tight: -0.025em;
|
118
|
+
--letter-spacing-normal: 0em;
|
119
|
+
--letter-spacing-wide: 0.025em;
|
120
|
+
--letter-spacing-wider: 0.05em;
|
121
|
+
--letter-spacing-widest: 0.1em;
|
122
|
+
|
123
|
+
/* Border Radius */
|
124
|
+
--radius-none: 0;
|
125
|
+
--radius-sm: 0.125rem; /* 2px */
|
126
|
+
--radius-base: 0.25rem; /* 4px */
|
127
|
+
--radius-md: 0.375rem; /* 6px */
|
128
|
+
--radius-lg: 0.5rem; /* 8px */
|
129
|
+
--radius-xl: 0.75rem; /* 12px */
|
130
|
+
--radius-2xl: 1rem; /* 16px */
|
131
|
+
--radius-3xl: 1.5rem; /* 24px */
|
132
|
+
--radius-full: 9999px;
|
133
|
+
|
134
|
+
/* Border Width */
|
135
|
+
--border-0: 0px;
|
136
|
+
--border: 1px;
|
137
|
+
--border-2: 2px;
|
138
|
+
--border-4: 4px;
|
139
|
+
--border-8: 8px;
|
140
|
+
|
141
|
+
/* Shadows */
|
142
|
+
--shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
143
|
+
--shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
144
|
+
--shadow-base: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
145
|
+
--shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
146
|
+
--shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
|
147
|
+
--shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
|
148
|
+
--shadow-2xl: 0 30px 60px -15px rgb(0 0 0 / 0.3);
|
149
|
+
--shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
|
150
|
+
--shadow-none: none;
|
151
|
+
|
152
|
+
/* Opacity */
|
153
|
+
--opacity-0: 0;
|
154
|
+
--opacity-5: 0.05;
|
155
|
+
--opacity-10: 0.1;
|
156
|
+
--opacity-20: 0.2;
|
157
|
+
--opacity-25: 0.25;
|
158
|
+
--opacity-30: 0.3;
|
159
|
+
--opacity-40: 0.4;
|
160
|
+
--opacity-50: 0.5;
|
161
|
+
--opacity-60: 0.6;
|
162
|
+
--opacity-70: 0.7;
|
163
|
+
--opacity-75: 0.75;
|
164
|
+
--opacity-80: 0.8;
|
165
|
+
--opacity-90: 0.9;
|
166
|
+
--opacity-95: 0.95;
|
167
|
+
--opacity-100: 1;
|
168
|
+
|
169
|
+
/* Animation */
|
170
|
+
--transition-fast: 150ms ease;
|
171
|
+
--transition-base: 200ms ease;
|
172
|
+
--transition-slow: 300ms ease;
|
173
|
+
--transition-slower: 500ms ease;
|
174
|
+
|
175
|
+
/* Z-index */
|
176
|
+
--z-index-0: 0;
|
177
|
+
--z-index-10: 10;
|
178
|
+
--z-index-20: 20;
|
179
|
+
--z-index-30: 30;
|
180
|
+
--z-index-40: 40;
|
181
|
+
--z-index-50: 50;
|
182
|
+
--z-index-auto: auto;
|
183
|
+
|
184
|
+
/* Breakpoints (for reference in JavaScript) */
|
185
|
+
--breakpoint-sm: 640px;
|
186
|
+
--breakpoint-md: 768px;
|
187
|
+
--breakpoint-lg: 1024px;
|
188
|
+
--breakpoint-xl: 1280px;
|
189
|
+
--breakpoint-2xl: 1536px;
|
190
|
+
}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
/* EidosUI Light Theme */
|
2
|
+
/* Default theme - these values are already defined in eidos-variables.css */
|
3
|
+
/* This file exists for explicit light theme selection and future customization */
|
4
|
+
|
5
|
+
[data-theme="light"] {
|
6
|
+
/* Core Colors */
|
7
|
+
--color-primary: #3b82f6;
|
8
|
+
--color-primary-hover: #2563eb;
|
9
|
+
--color-primary-light: #dbeafe;
|
10
|
+
--color-primary-dark: #1d4ed8;
|
11
|
+
--color-primary-foreground: #ffffff;
|
12
|
+
|
13
|
+
--color-secondary: #6b7280;
|
14
|
+
--color-secondary-hover: #4b5563;
|
15
|
+
--color-secondary-light: #f9fafb;
|
16
|
+
--color-secondary-dark: #374151;
|
17
|
+
--color-secondary-foreground: #ffffff;
|
18
|
+
|
19
|
+
--color-accent: #7c3aed;
|
20
|
+
--color-accent-hover: #6d28d9;
|
21
|
+
--color-accent-light: #f3e8ff;
|
22
|
+
--color-accent-dark: #5b21b6;
|
23
|
+
--color-accent-foreground: #ffffff;
|
24
|
+
|
25
|
+
/* Semantic Colors */
|
26
|
+
--color-success: #10b981;
|
27
|
+
--color-success-hover: #059669;
|
28
|
+
--color-success-light: #d1fae5;
|
29
|
+
--color-success-dark: #047857;
|
30
|
+
--color-success-foreground: #ffffff;
|
31
|
+
|
32
|
+
--color-cta: #f59e0b;
|
33
|
+
--color-cta-hover: #d97706;
|
34
|
+
--color-cta-light: #fef3c7;
|
35
|
+
--color-cta-dark: #b45309;
|
36
|
+
--color-cta-foreground: #ffffff;
|
37
|
+
|
38
|
+
--color-warning: #eab308;
|
39
|
+
--color-warning-hover: #ca8a04;
|
40
|
+
--color-warning-light: #fefce8;
|
41
|
+
--color-warning-dark: #a16207;
|
42
|
+
--color-warning-foreground: #000000;
|
43
|
+
|
44
|
+
--color-error: #dc2626;
|
45
|
+
--color-error-hover: #b91c1c;
|
46
|
+
--color-error-light: #fef2f2;
|
47
|
+
--color-error-dark: #991b1b;
|
48
|
+
--color-error-foreground: #ffffff;
|
49
|
+
|
50
|
+
--color-info: #0ea5e9;
|
51
|
+
--color-info-hover: #0284c7;
|
52
|
+
--color-info-light: #f0f9ff;
|
53
|
+
--color-info-dark: #0369a1;
|
54
|
+
--color-info-foreground: #ffffff;
|
55
|
+
|
56
|
+
/* Surface Colors */
|
57
|
+
--color-background: #ffffff;
|
58
|
+
--color-surface: #f8fafc;
|
59
|
+
--color-surface-elevated: #ffffff;
|
60
|
+
--color-border: #e2e8f0;
|
61
|
+
--color-border-hover: #cbd5e1;
|
62
|
+
--color-input: #ffffff;
|
63
|
+
--color-card: #ffffff;
|
64
|
+
|
65
|
+
/* Text Colors */
|
66
|
+
--color-text: #0f172a;
|
67
|
+
--color-text-muted: #64748b;
|
68
|
+
--color-text-subtle: #94a3b8;
|
69
|
+
--color-text-inverse: #ffffff;
|
70
|
+
|
71
|
+
/* Shadows - Light Theme */
|
72
|
+
--shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
73
|
+
--shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
74
|
+
--shadow-base: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
75
|
+
--shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
76
|
+
--shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
|
77
|
+
--shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
|
78
|
+
--shadow-2xl: 0 30px 60px -15px rgb(0 0 0 / 0.3);
|
79
|
+
--shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
|
80
|
+
}
|
eidos/js/eidos.js
ADDED
@@ -0,0 +1,112 @@
|
|
1
|
+
// eidos.js - Main EidosUI JavaScript file
|
2
|
+
(function() {
|
3
|
+
'use strict';
|
4
|
+
|
5
|
+
class EidosUI {
|
6
|
+
constructor() {
|
7
|
+
this.initToggle();
|
8
|
+
this.initScrollspy();
|
9
|
+
}
|
10
|
+
|
11
|
+
initToggle() {
|
12
|
+
document.querySelectorAll('[data-toggle]').forEach(btn => {
|
13
|
+
btn.addEventListener('click', (e) => {
|
14
|
+
e.preventDefault();
|
15
|
+
const targetId = btn.dataset.toggle;
|
16
|
+
const target = document.querySelector(targetId);
|
17
|
+
if (target) {
|
18
|
+
const isHidden = target.classList.contains('hidden');
|
19
|
+
target.classList.toggle('hidden');
|
20
|
+
|
21
|
+
// Update ARIA attributes
|
22
|
+
const toggleButtons = document.querySelectorAll(`[data-toggle="${targetId}"][role="button"]`);
|
23
|
+
toggleButtons.forEach(toggleBtn => {
|
24
|
+
toggleBtn.setAttribute('aria-expanded', isHidden);
|
25
|
+
|
26
|
+
// Toggle menu icons if they exist
|
27
|
+
const openIcon = toggleBtn.querySelector('[data-menu-icon="open"]');
|
28
|
+
const closeIcon = toggleBtn.querySelector('[data-menu-icon="close"]');
|
29
|
+
if (openIcon && closeIcon) {
|
30
|
+
openIcon.classList.toggle('hidden');
|
31
|
+
closeIcon.classList.toggle('hidden');
|
32
|
+
}
|
33
|
+
});
|
34
|
+
}
|
35
|
+
});
|
36
|
+
});
|
37
|
+
|
38
|
+
// Auto-close mobile menu when clicking a link
|
39
|
+
document.querySelectorAll('[data-mobile-menu="true"] a').forEach(link => {
|
40
|
+
link.addEventListener('click', () => {
|
41
|
+
const menu = link.closest('[data-mobile-menu="true"]');
|
42
|
+
if (menu && !menu.classList.contains('hidden')) {
|
43
|
+
menu.classList.add('hidden');
|
44
|
+
// Update toggle button state
|
45
|
+
const menuId = '#' + menu.id;
|
46
|
+
const toggleBtn = document.querySelector(`[data-toggle="${menuId}"][role="button"]`);
|
47
|
+
if (toggleBtn) {
|
48
|
+
toggleBtn.setAttribute('aria-expanded', 'false');
|
49
|
+
const openIcon = toggleBtn.querySelector('[data-menu-icon="open"]');
|
50
|
+
const closeIcon = toggleBtn.querySelector('[data-menu-icon="close"]');
|
51
|
+
if (openIcon && closeIcon) {
|
52
|
+
openIcon.classList.remove('hidden');
|
53
|
+
closeIcon.classList.add('hidden');
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
});
|
58
|
+
});
|
59
|
+
}
|
60
|
+
|
61
|
+
initScrollspy() {
|
62
|
+
const containers = document.querySelectorAll('[data-scrollspy="true"]');
|
63
|
+
if (!containers.length) return;
|
64
|
+
|
65
|
+
const sections = document.querySelectorAll('section[id], [data-scrollspy-target]');
|
66
|
+
if (!sections.length) return;
|
67
|
+
|
68
|
+
const observerOptions = {
|
69
|
+
rootMargin: '-20% 0px -70% 0px',
|
70
|
+
threshold: [0, 0.1, 0.5, 1]
|
71
|
+
};
|
72
|
+
|
73
|
+
const observer = new IntersectionObserver((entries) => {
|
74
|
+
entries.forEach(entry => {
|
75
|
+
if (entry.intersectionRatio > 0.1) {
|
76
|
+
const id = entry.target.id;
|
77
|
+
containers.forEach(container => {
|
78
|
+
const links = container.querySelectorAll('a[href^="#"]');
|
79
|
+
links.forEach(link => {
|
80
|
+
const isActive = link.getAttribute('href') === `#${id}`;
|
81
|
+
link.classList.toggle('eidos-active', isActive);
|
82
|
+
});
|
83
|
+
});
|
84
|
+
}
|
85
|
+
});
|
86
|
+
}, observerOptions);
|
87
|
+
|
88
|
+
sections.forEach(section => observer.observe(section));
|
89
|
+
|
90
|
+
// Smooth scrolling for nav links
|
91
|
+
containers.forEach(container => {
|
92
|
+
container.querySelectorAll('a[href^="#"]').forEach(link => {
|
93
|
+
link.addEventListener('click', (e) => {
|
94
|
+
const targetId = link.getAttribute('href');
|
95
|
+
const target = document.querySelector(targetId);
|
96
|
+
if (target) {
|
97
|
+
e.preventDefault();
|
98
|
+
target.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
99
|
+
}
|
100
|
+
});
|
101
|
+
});
|
102
|
+
});
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
window.EidosUI = EidosUI;
|
107
|
+
if (document.readyState === 'loading') {
|
108
|
+
document.addEventListener('DOMContentLoaded', () => new EidosUI());
|
109
|
+
} else {
|
110
|
+
new EidosUI();
|
111
|
+
}
|
112
|
+
})();
|
@@ -0,0 +1 @@
|
|
1
|
+
# EidosUI plugins package
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"""EidosUI Markdown Plugin - Theme-aware markdown rendering
|
2
|
+
|
3
|
+
This plugin provides markdown rendering that automatically integrates with
|
4
|
+
EidosUI themes through CSS variables.
|
5
|
+
|
6
|
+
Basic usage:
|
7
|
+
from eidos.plugins.markdown import Markdown, MarkdownCSS
|
8
|
+
|
9
|
+
# In your document head
|
10
|
+
MarkdownCSS()
|
11
|
+
|
12
|
+
# In your content
|
13
|
+
Markdown("# Hello World\\n\\nThis is **markdown**!")
|
14
|
+
"""
|
15
|
+
|
16
|
+
from .components import Markdown, MarkdownCSS
|
17
|
+
from .renderer import MarkdownRenderer
|
18
|
+
|
19
|
+
__all__ = ["Markdown", "MarkdownCSS", "MarkdownRenderer"]
|
20
|
+
|
21
|
+
__version__ = "0.1.0"
|
@@ -0,0 +1,53 @@
|
|
1
|
+
"""Markdown components for EidosUI"""
|
2
|
+
|
3
|
+
import air
|
4
|
+
from typing import Optional
|
5
|
+
from .renderer import MarkdownRenderer
|
6
|
+
|
7
|
+
|
8
|
+
# Global renderer instance for reuse
|
9
|
+
_renderer = MarkdownRenderer()
|
10
|
+
|
11
|
+
|
12
|
+
def Markdown(content: str, class_: Optional[str] = None, **kwargs) -> air.Div:
|
13
|
+
"""Main markdown component that renders markdown content with theme integration.
|
14
|
+
|
15
|
+
Args:
|
16
|
+
content: Markdown text to render
|
17
|
+
class_: Additional CSS classes to apply
|
18
|
+
**kwargs: Additional attributes to pass to the wrapper div
|
19
|
+
|
20
|
+
Returns:
|
21
|
+
air.Div containing the rendered markdown HTML
|
22
|
+
"""
|
23
|
+
# Render the markdown content
|
24
|
+
html_content = _renderer.render(content)
|
25
|
+
|
26
|
+
# Create the div with raw HTML content
|
27
|
+
if class_:
|
28
|
+
return air.Div(
|
29
|
+
air.RawHTML(html_content),
|
30
|
+
class_=class_,
|
31
|
+
**kwargs
|
32
|
+
)
|
33
|
+
else:
|
34
|
+
return air.Div(
|
35
|
+
air.RawHTML(html_content),
|
36
|
+
**kwargs
|
37
|
+
)
|
38
|
+
|
39
|
+
|
40
|
+
def MarkdownCSS() -> air.Link:
|
41
|
+
"""Returns a link tag to include the markdown CSS.
|
42
|
+
|
43
|
+
This should be included in the head of your document to ensure
|
44
|
+
markdown styling is available.
|
45
|
+
|
46
|
+
Returns:
|
47
|
+
air.Link element pointing to the markdown CSS file
|
48
|
+
"""
|
49
|
+
return air.Link(
|
50
|
+
rel="stylesheet",
|
51
|
+
href="/eidos/plugins/markdown/css/markdown.css",
|
52
|
+
type="text/css"
|
53
|
+
)
|