eidosui 0.1.0__py3-none-any.whl → 0.2.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 CHANGED
@@ -1,57 +1,2 @@
1
- """
2
- EidosUI - A modern, flexible Tailwind CSS-based UI library for Python web frameworks
3
-
4
- Key Features:
5
- - CSS variable-based theming (light/dark)
6
- - Class-based components for maximum flexibility
7
- - Mobile-first responsive design patterns
8
- - Comprehensive style dataclasses with sensible defaults
9
- - Built on fastapi-tags for modern Python web development
10
- """
11
-
12
- from .core import (
13
- # ThemeManager,
14
- # theme_manager,
15
- button_styles,
16
- typography_styles,
17
- form_styles,
18
- merge_classes,
19
- serve_eidos_static,
20
- create_eidos_head_tag,
21
- )
22
-
23
- from .components import (
24
- # Typography
25
- H1, H2, H3, H4, H5, H6,
26
- P, Text, Em, Strong, A, Code, Pre, Mark, Small,
27
-
28
- # Forms
29
- Button, Input, Textarea, Select, Label, FormGroup,
30
- )
31
-
32
- # Version info
33
- __version__ = "0.1.0"
34
- __author__ = "Isaac Flath"
35
-
36
- __all__ = [
37
- # Core
38
- "ThemeManager",
39
- "theme_manager",
40
- "button_styles",
41
- "typography_styles",
42
- "form_styles",
43
- "merge_classes",
44
- "serve_eidos_static",
45
- "create_eidos_head_tag",
46
-
47
- # Typography components
48
- "H1", "H2", "H3", "H4", "H5", "H6",
49
- "P", "Text", "Em", "Strong", "A", "Code", "Pre", "Mark", "Small",
50
-
51
- # Form components
52
- "Button", "Input", "Textarea", "Select", "Label", "FormGroup",
53
-
54
- # Metadata
55
- "__version__",
56
- "__author__",
57
- ]
1
+ from . import tags
2
+ from . import styles
@@ -0,0 +1,29 @@
1
+ from air import Meta, Script, Link, Html, Head, Title
2
+ from ..tags import Body
3
+
4
+ def get_css_urls():
5
+ """Return list of CSS URLs for EidosUI."""
6
+ return [
7
+ "/eidos/css/styles.css",
8
+ "/eidos/css/themes/eidos-variables.css",
9
+ "/eidos/css/themes/light.css",
10
+ "/eidos/css/themes/dark.css"
11
+ ]
12
+ def EidosHeaders(include_tailwind=True, theme="light"):
13
+ """Standard EidosUI headers with CSS includes."""
14
+ headers = [
15
+ Meta(charset="UTF-8"),
16
+ Meta(name="viewport", content="width=device-width, initial-scale=1.0"),
17
+ ]
18
+
19
+ if include_tailwind:
20
+ headers.append(Script(src="https://cdn.tailwindcss.com"))
21
+
22
+ # Add EidosUI CSS files
23
+ for css_url in get_css_urls():
24
+ headers.append(Link(rel="stylesheet", href=css_url))
25
+
26
+ # Set initial theme
27
+ headers.append(Script(f"document.documentElement.setAttribute('data-theme', '{theme}');"))
28
+
29
+ return headers
eidos/css/styles.css ADDED
@@ -0,0 +1,337 @@
1
+ /* EidosUI Button Styles - Simplified for CDN */
2
+
3
+ /* Base Button - One size that works everywhere */
4
+ .eidos-btn {
5
+ display: inline-flex;
6
+ align-items: center;
7
+ justify-content: center;
8
+ padding: var(--space-sm) var(--space-md);
9
+ font-size: var(--font-size-base);
10
+ font-weight: var(--font-weight-medium);
11
+ line-height: var(--line-height-normal);
12
+ border-radius: var(--radius-md);
13
+ border: none;
14
+ cursor: pointer;
15
+ text-decoration: none;
16
+ transition: all var(--transition-fast);
17
+ outline: none;
18
+ user-select: none;
19
+ }
20
+
21
+ .eidos-btn:focus-visible {
22
+ outline: var(--border-2) solid currentColor;
23
+ outline-offset: var(--border-2);
24
+ }
25
+
26
+ .eidos-btn:active {
27
+ transform: scale(0.98);
28
+ }
29
+
30
+ /* Primary Button */
31
+ .eidos-btn-primary {
32
+ background-color: var(--color-primary);
33
+ color: var(--color-primary-foreground);
34
+ }
35
+
36
+ .eidos-btn-primary:hover {
37
+ background-color: var(--color-primary-hover);
38
+ }
39
+
40
+ /* Secondary Button */
41
+ .eidos-btn-secondary {
42
+ background-color: var(--color-secondary-light);
43
+ color: var(--color-secondary-dark);
44
+ }
45
+
46
+ .eidos-btn-secondary:hover {
47
+ background-color: var(--color-border);
48
+ }
49
+
50
+ /* Ghost Button */
51
+ .eidos-btn-ghost {
52
+ background-color: transparent;
53
+ color: var(--color-secondary-dark);
54
+ }
55
+
56
+ .eidos-btn-ghost:hover {
57
+ background-color: rgba(0, 0, 0, var(--opacity-5));
58
+ }
59
+
60
+ /* Outline Button */
61
+ .eidos-btn-outline {
62
+ background-color: transparent;
63
+ border: var(--border-2) solid var(--color-primary);
64
+ color: var(--color-primary);
65
+ }
66
+
67
+ .eidos-btn-outline:hover {
68
+ background-color: var(--color-primary);
69
+ color: var(--color-primary-foreground);
70
+ }
71
+
72
+ /* Success Button */
73
+ .eidos-btn-success {
74
+ background-color: var(--color-success);
75
+ color: var(--color-success-foreground);
76
+ }
77
+
78
+ .eidos-btn-success:hover {
79
+ background-color: var(--color-success-hover);
80
+ }
81
+
82
+ /* Error Button */
83
+ .eidos-btn-error {
84
+ background-color: var(--color-error);
85
+ color: var(--color-error-foreground);
86
+ }
87
+
88
+ .eidos-btn-error:hover {
89
+ background-color: var(--color-error-hover);
90
+ }
91
+
92
+ /* CTA Button */
93
+ .eidos-btn-cta {
94
+ background-color: var(--color-cta);
95
+ color: var(--color-cta-foreground);
96
+ }
97
+
98
+ .eidos-btn-cta:hover {
99
+ background-color: var(--color-cta-hover);
100
+ }
101
+
102
+ .eidos-h1 {
103
+ font-size: var(--font-size-3xl);
104
+ font-weight: var(--font-weight-bold);
105
+ line-height: var(--line-height-tight);
106
+ margin-bottom: var(--space-md);
107
+ }
108
+
109
+ .eidos-h2 {
110
+ font-size: var(--font-size-2xl);
111
+ font-weight: var(--font-weight-semibold);
112
+ line-height: var(--line-height-snug);
113
+ margin-bottom: calc(var(--space-sm) * 1.6);
114
+ }
115
+
116
+ .eidos-h3 {
117
+ font-size: var(--font-size-xl);
118
+ font-weight: var(--font-weight-semibold);
119
+ line-height: var(--line-height-snug);
120
+ margin-bottom: calc(var(--space-sm) * 1.2);
121
+ }
122
+
123
+ .eidos-h4 {
124
+ font-size: var(--font-size-base);
125
+ font-weight: var(--font-weight-semibold);
126
+ line-height: var(--line-height-normal);
127
+ margin-bottom: calc(var(--space-sm) * 0.8);
128
+ }
129
+
130
+ .eidos-h5 {
131
+ font-size: var(--font-size-sm);
132
+ font-weight: var(--font-weight-semibold);
133
+ line-height: var(--line-height-relaxed);
134
+ margin-bottom: calc(var(--space-xs) * 0.8);
135
+ }
136
+
137
+ .eidos-h6 {
138
+ font-size: var(--font-size-xs);
139
+ font-weight: var(--font-weight-semibold);
140
+ line-height: var(--line-height-relaxed);
141
+ margin-bottom: calc(var(--space-xs) * 0.4);
142
+ }
143
+
144
+
145
+ .eidos-body {
146
+ background-color: var(--color-background);
147
+ color: var(--color-text);
148
+ transition: background-color var(--transition-slow), color var(--transition-slow);
149
+ }
150
+
151
+ /* Semantic HTML Elements */
152
+
153
+ /* Strong emphasis */
154
+ .eidos-strong {
155
+ font-weight: var(--font-weight-bold);
156
+ color: var(--color-text);
157
+ }
158
+
159
+ /* Italic emphasis */
160
+ .eidos-i {
161
+ font-style: italic;
162
+ }
163
+
164
+ /* Small text */
165
+ .eidos-small {
166
+ font-size: var(--font-size-sm);
167
+ color: var(--color-text-muted);
168
+ }
169
+
170
+ /* Deleted text */
171
+ .eidos-del {
172
+ text-decoration: line-through;
173
+ color: var(--color-text-muted);
174
+ opacity: var(--opacity-70);
175
+ }
176
+
177
+ /* Abbreviation */
178
+ .eidos-abbr {
179
+ text-decoration: underline dotted;
180
+ cursor: help;
181
+ text-decoration-thickness: var(--border);
182
+ text-underline-offset: 0.2em;
183
+ }
184
+
185
+ /* Variable */
186
+ .eidos-var {
187
+ font-family: monospace;
188
+ font-style: italic;
189
+ background-color: var(--color-surface);
190
+ padding: 0 var(--space-xs);
191
+ border-radius: var(--radius-sm);
192
+ }
193
+
194
+ /* Summary (for details element) */
195
+ .eidos-summary {
196
+ cursor: pointer;
197
+ font-weight: var(--font-weight-medium);
198
+ padding: var(--space-sm) var(--space-md);
199
+ background-color: var(--color-surface);
200
+ border-radius: var(--radius-md);
201
+ transition: all var(--transition-fast);
202
+ user-select: none;
203
+ }
204
+
205
+ .eidos-summary:hover {
206
+ background-color: var(--color-border);
207
+ }
208
+
209
+ /* Details */
210
+ .eidos-details {
211
+ border: var(--border) solid var(--color-border);
212
+ border-radius: var(--radius-md);
213
+ margin-bottom: var(--space-md);
214
+ }
215
+
216
+ .eidos-details[open] .eidos-summary {
217
+ border-bottom: var(--border) solid var(--color-border);
218
+ border-radius: var(--radius-md) var(--radius-md) 0 0;
219
+ }
220
+
221
+ .eidos-details-content {
222
+ padding: var(--space-md);
223
+ }
224
+
225
+ /* Blockquote */
226
+ .eidos-blockquote {
227
+ margin: var(--space-md) 0;
228
+ padding: var(--space-md) var(--space-lg);
229
+ border-left: var(--border-4) solid var(--color-primary);
230
+ background-color: var(--color-surface);
231
+ font-style: italic;
232
+ color: var(--color-text-muted);
233
+ }
234
+
235
+ /* Citation */
236
+ .eidos-cite {
237
+ font-style: italic;
238
+ color: var(--color-text-muted);
239
+ }
240
+
241
+ /* Code elements */
242
+ .eidos-code {
243
+ font-family: monospace;
244
+ font-size: var(--font-size-sm);
245
+ background-color: var(--color-surface);
246
+ padding: var(--space-xs) var(--space-sm);
247
+ border-radius: var(--radius-sm);
248
+ color: var(--color-accent);
249
+ }
250
+
251
+ /* Preformatted text */
252
+ .eidos-pre {
253
+ font-family: monospace;
254
+ font-size: var(--font-size-sm);
255
+ background-color: var(--color-surface);
256
+ padding: var(--space-md);
257
+ border-radius: var(--radius-md);
258
+ overflow-x: auto;
259
+ line-height: var(--line-height-relaxed);
260
+ border: var(--border) solid var(--color-border);
261
+ }
262
+
263
+ /* Keyboard input */
264
+ .eidos-kbd {
265
+ font-family: monospace;
266
+ font-size: var(--font-size-sm);
267
+ background-color: var(--color-surface);
268
+ padding: var(--space-xs) var(--space-sm);
269
+ border: var(--border) solid var(--color-border);
270
+ border-radius: var(--radius-sm);
271
+ box-shadow: var(--shadow-xs);
272
+ display: inline-block;
273
+ min-width: 1.5em;
274
+ text-align: center;
275
+ }
276
+
277
+ /* Sample output */
278
+ .eidos-samp {
279
+ font-family: monospace;
280
+ font-size: var(--font-size-sm);
281
+ color: var(--color-text-muted);
282
+ }
283
+
284
+ /* Mark/highlight */
285
+ .eidos-mark {
286
+ background-color: var(--color-warning);
287
+ color: var(--color-text);
288
+ padding: 0 var(--space-xs);
289
+ border-radius: var(--radius-sm);
290
+ }
291
+
292
+ /* Time */
293
+ .eidos-time {
294
+ color: var(--color-text-muted);
295
+ }
296
+
297
+ /* Address */
298
+ .eidos-address {
299
+ font-style: normal;
300
+ line-height: var(--line-height-relaxed);
301
+ color: var(--color-text-muted);
302
+ }
303
+
304
+ /* Definition list */
305
+ .eidos-dl {
306
+ margin: var(--space-md) 0;
307
+ }
308
+
309
+ .eidos-dt {
310
+ font-weight: var(--font-weight-semibold);
311
+ margin-bottom: var(--space-xs);
312
+ }
313
+
314
+ .eidos-dd {
315
+ margin-left: var(--space-lg);
316
+ margin-bottom: var(--space-sm);
317
+ color: var(--color-text-muted);
318
+ }
319
+
320
+ /* Figure */
321
+ .eidos-figure {
322
+ margin: var(--space-lg) 0;
323
+ text-align: center;
324
+ }
325
+
326
+ .eidos-figcaption {
327
+ font-size: var(--font-size-sm);
328
+ color: var(--color-text-muted);
329
+ margin-top: var(--space-sm);
330
+ }
331
+
332
+ /* Horizontal rule */
333
+ .eidos-hr {
334
+ border: none;
335
+ border-top: var(--border) solid var(--color-border);
336
+ margin: var(--space-xl) 0;
337
+ }
@@ -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
+ }