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 +2 -57
- eidos/components/headers.py +29 -0
- eidos/css/styles.css +337 -0
- eidos/css/themes/dark.css +119 -0
- eidos/css/themes/eidos-variables.css +190 -0
- eidos/css/themes/light.css +80 -0
- eidos/styles.py +80 -0
- eidos/tags.py +99 -0
- eidos/utils.py +63 -0
- eidosui-0.2.0.dist-info/METADATA +124 -0
- eidosui-0.2.0.dist-info/RECORD +13 -0
- eidosui-0.2.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.2.0.dist-info}/WHEEL +0 -0
@@ -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/styles.py
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
"""CSS class constants for EidosUI components.
|
2
|
+
|
3
|
+
This module provides Python constants for CSS classes that exist in styles.css.
|
4
|
+
Only includes classes that are actually defined in the CSS file.
|
5
|
+
"""
|
6
|
+
|
7
|
+
from typing import Final
|
8
|
+
|
9
|
+
class Theme:
|
10
|
+
"""Theme-related CSS classes from styles.css."""
|
11
|
+
body: Final[str] = "eidos-body"
|
12
|
+
|
13
|
+
class Buttons:
|
14
|
+
"""Button-related CSS classes from styles.css."""
|
15
|
+
|
16
|
+
# Base button class (required for all buttons)
|
17
|
+
base: Final[str] = "eidos-btn"
|
18
|
+
|
19
|
+
# Button variants
|
20
|
+
primary: Final[str] = "eidos-btn-primary"
|
21
|
+
secondary: Final[str] = "eidos-btn-secondary"
|
22
|
+
ghost: Final[str] = "eidos-btn-ghost"
|
23
|
+
outline: Final[str] = "eidos-btn-outline"
|
24
|
+
success: Final[str] = "eidos-btn-success"
|
25
|
+
error: Final[str] = "eidos-btn-error"
|
26
|
+
cta: Final[str] = "eidos-btn-cta"
|
27
|
+
|
28
|
+
class Typography:
|
29
|
+
"""Typography-related CSS classes from styles.css."""
|
30
|
+
|
31
|
+
h1: Final[str] = "eidos-h1"
|
32
|
+
h2: Final[str] = "eidos-h2"
|
33
|
+
h3: Final[str] = "eidos-h3"
|
34
|
+
h4: Final[str] = "eidos-h4"
|
35
|
+
h5: Final[str] = "eidos-h5"
|
36
|
+
h6: Final[str] = "eidos-h6"
|
37
|
+
|
38
|
+
class Semantic:
|
39
|
+
"""Semantic HTML element CSS classes from styles.css."""
|
40
|
+
|
41
|
+
# Text formatting
|
42
|
+
strong: Final[str] = "eidos-strong"
|
43
|
+
i: Final[str] = "eidos-i"
|
44
|
+
small: Final[str] = "eidos-small"
|
45
|
+
del_: Final[str] = "eidos-del" # del is reserved keyword
|
46
|
+
abbr: Final[str] = "eidos-abbr"
|
47
|
+
var: Final[str] = "eidos-var"
|
48
|
+
mark: Final[str] = "eidos-mark"
|
49
|
+
time: Final[str] = "eidos-time"
|
50
|
+
|
51
|
+
# Code elements
|
52
|
+
code: Final[str] = "eidos-code"
|
53
|
+
pre: Final[str] = "eidos-pre"
|
54
|
+
kbd: Final[str] = "eidos-kbd"
|
55
|
+
samp: Final[str] = "eidos-samp"
|
56
|
+
|
57
|
+
# Structural elements
|
58
|
+
blockquote: Final[str] = "eidos-blockquote"
|
59
|
+
cite: Final[str] = "eidos-cite"
|
60
|
+
address: Final[str] = "eidos-address"
|
61
|
+
hr: Final[str] = "eidos-hr"
|
62
|
+
|
63
|
+
# Interactive elements
|
64
|
+
details: Final[str] = "eidos-details"
|
65
|
+
summary: Final[str] = "eidos-summary"
|
66
|
+
details_content: Final[str] = "eidos-details-content"
|
67
|
+
|
68
|
+
# Definition list
|
69
|
+
dl: Final[str] = "eidos-dl"
|
70
|
+
dt: Final[str] = "eidos-dt"
|
71
|
+
dd: Final[str] = "eidos-dd"
|
72
|
+
|
73
|
+
# Figure
|
74
|
+
figure: Final[str] = "eidos-figure"
|
75
|
+
figcaption: Final[str] = "eidos-figcaption"
|
76
|
+
|
77
|
+
# Create singleton instance for easy access
|
78
|
+
buttons = Buttons()
|
79
|
+
typography = Typography()
|
80
|
+
semantic = Semantic()
|
eidos/tags.py
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
from typing import Optional, Literal
|
2
|
+
import air
|
3
|
+
from . import styles
|
4
|
+
from .utils import stringify
|
5
|
+
|
6
|
+
def Button(*content, cls = styles.buttons.primary, **kwargs):
|
7
|
+
return air.Button(*content, cls=stringify(styles.buttons.base, cls), **kwargs)
|
8
|
+
|
9
|
+
def H1(*content, cls = None, **kwargs):
|
10
|
+
return air.H1(*content, cls=stringify(styles.typography.h1, cls), **kwargs)
|
11
|
+
|
12
|
+
def H2(*content, cls = None, **kwargs):
|
13
|
+
return air.H2(*content, cls=stringify(styles.typography.h2, cls), **kwargs)
|
14
|
+
|
15
|
+
def H3(*content, cls = None, **kwargs):
|
16
|
+
return air.H3(*content, cls=stringify(styles.typography.h3, cls), **kwargs)
|
17
|
+
|
18
|
+
def H4(*content, cls = None, **kwargs):
|
19
|
+
return air.H4(*content, cls=stringify(styles.typography.h4, cls), **kwargs)
|
20
|
+
|
21
|
+
def H5(*content, cls = None, **kwargs):
|
22
|
+
return air.H5(*content, cls=stringify(styles.typography.h5, cls), **kwargs)
|
23
|
+
|
24
|
+
def H6(*content, cls = None, **kwargs):
|
25
|
+
return air.H6(*content, cls=stringify(styles.typography.h6, cls), **kwargs)
|
26
|
+
|
27
|
+
def Body(*content, cls = None, **kwargs):
|
28
|
+
return air.Body(*content, cls=stringify(styles.Theme.body, cls), **kwargs)
|
29
|
+
|
30
|
+
# Semantic HTML Elements
|
31
|
+
|
32
|
+
def Strong(*content, cls = None, **kwargs):
|
33
|
+
return air.Strong(*content, cls=stringify(styles.semantic.strong, cls), **kwargs)
|
34
|
+
|
35
|
+
def I(*content, cls = None, **kwargs):
|
36
|
+
return air.I(*content, cls=stringify(styles.semantic.i, cls), **kwargs)
|
37
|
+
|
38
|
+
def Small(*content, cls = None, **kwargs):
|
39
|
+
return air.Small(*content, cls=stringify(styles.semantic.small, cls), **kwargs)
|
40
|
+
|
41
|
+
def Del(*content, cls = None, **kwargs):
|
42
|
+
return air.Del(*content, cls=stringify(styles.semantic.del_, cls), **kwargs)
|
43
|
+
|
44
|
+
def Abbr(*content, cls = None, **kwargs):
|
45
|
+
return air.Abbr(*content, cls=stringify(styles.semantic.abbr, cls), **kwargs)
|
46
|
+
|
47
|
+
def Var(*content, cls = None, **kwargs):
|
48
|
+
return air.Var(*content, cls=stringify(styles.semantic.var, cls), **kwargs)
|
49
|
+
|
50
|
+
def Mark(*content, cls = None, **kwargs):
|
51
|
+
return air.Mark(*content, cls=stringify(styles.semantic.mark, cls), **kwargs)
|
52
|
+
|
53
|
+
def Time(*content, cls = None, **kwargs):
|
54
|
+
return air.Time(*content, cls=stringify(styles.semantic.time, cls), **kwargs)
|
55
|
+
|
56
|
+
def Code(*content, cls = None, **kwargs):
|
57
|
+
return air.Code(*content, cls=stringify(styles.semantic.code, cls), **kwargs)
|
58
|
+
|
59
|
+
def Pre(*content, cls = None, **kwargs):
|
60
|
+
return air.Pre(*content, cls=stringify(styles.semantic.pre, cls), **kwargs)
|
61
|
+
|
62
|
+
def Kbd(*content, cls = None, **kwargs):
|
63
|
+
return air.Kbd(*content, cls=stringify(styles.semantic.kbd, cls), **kwargs)
|
64
|
+
|
65
|
+
def Samp(*content, cls = None, **kwargs):
|
66
|
+
return air.Samp(*content, cls=stringify(styles.semantic.samp, cls), **kwargs)
|
67
|
+
|
68
|
+
def Blockquote(*content, cls = None, **kwargs):
|
69
|
+
return air.Blockquote(*content, cls=stringify(styles.semantic.blockquote, cls), **kwargs)
|
70
|
+
|
71
|
+
def Cite(*content, cls = None, **kwargs):
|
72
|
+
return air.Cite(*content, cls=stringify(styles.semantic.cite, cls), **kwargs)
|
73
|
+
|
74
|
+
def Address(*content, cls = None, **kwargs):
|
75
|
+
return air.Address(*content, cls=stringify(styles.semantic.address, cls), **kwargs)
|
76
|
+
|
77
|
+
def Hr(cls = None, **kwargs):
|
78
|
+
return air.Hr(cls=stringify(styles.semantic.hr, cls), **kwargs)
|
79
|
+
|
80
|
+
def Details(*content, cls = None, **kwargs):
|
81
|
+
return air.Details(*content, cls=stringify(styles.semantic.details, cls), **kwargs)
|
82
|
+
|
83
|
+
def Summary(*content, cls = None, **kwargs):
|
84
|
+
return air.Summary(*content, cls=stringify(styles.semantic.summary, cls), **kwargs)
|
85
|
+
|
86
|
+
def Dl(*content, cls = None, **kwargs):
|
87
|
+
return air.Dl(*content, cls=stringify(styles.semantic.dl, cls), **kwargs)
|
88
|
+
|
89
|
+
def Dt(*content, cls = None, **kwargs):
|
90
|
+
return air.Dt(*content, cls=cls, **kwargs)
|
91
|
+
|
92
|
+
def Dd(*content, cls = None, **kwargs):
|
93
|
+
return air.Dd(*content, cls=stringify(styles.semantic.dd, cls), **kwargs)
|
94
|
+
|
95
|
+
def Figure(*content, cls = None, **kwargs):
|
96
|
+
return air.Figure(*content, cls=stringify(styles.semantic.figure, cls), **kwargs)
|
97
|
+
|
98
|
+
def Figcaption(*content, cls = None, **kwargs):
|
99
|
+
return air.Figcaption(*content, cls=stringify(styles.semantic.figcaption, cls), **kwargs)
|
eidos/utils.py
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
"""Core utility functions for EidosUI."""
|
2
|
+
|
3
|
+
from typing import Optional, Union, List
|
4
|
+
import os
|
5
|
+
import sys
|
6
|
+
|
7
|
+
|
8
|
+
def stringify(*classes: Optional[Union[str, List[str]]]) -> str:
|
9
|
+
"""
|
10
|
+
Concatenate CSS classes, filtering out None values and flattening lists.
|
11
|
+
|
12
|
+
Args:
|
13
|
+
*classes: Variable number of class strings, lists of strings, or None values
|
14
|
+
|
15
|
+
Returns:
|
16
|
+
A single space-separated string of CSS classes
|
17
|
+
|
18
|
+
Examples:
|
19
|
+
>>> stringify("btn", "btn-primary")
|
20
|
+
"btn btn-primary"
|
21
|
+
|
22
|
+
>>> stringify("btn", None, "btn-lg")
|
23
|
+
"btn btn-lg"
|
24
|
+
|
25
|
+
>>> stringify(["btn", "btn-primary"], "mt-4")
|
26
|
+
"btn btn-primary mt-4"
|
27
|
+
"""
|
28
|
+
result = []
|
29
|
+
|
30
|
+
for cls in classes:
|
31
|
+
if cls is None:
|
32
|
+
continue
|
33
|
+
elif isinstance(cls, list):
|
34
|
+
# Recursively handle lists
|
35
|
+
result.extend(c for c in cls if c)
|
36
|
+
elif isinstance(cls, str) and cls.strip():
|
37
|
+
result.append(cls.strip())
|
38
|
+
|
39
|
+
return " ".join(result)
|
40
|
+
|
41
|
+
|
42
|
+
def get_eidos_static_directory() -> str:
|
43
|
+
"""
|
44
|
+
Get the path to eidos static files for mounting in FastAPI/Air apps.
|
45
|
+
|
46
|
+
This function returns the directory containing the eidos package files,
|
47
|
+
which includes the CSS directory. Use this when mounting static files
|
48
|
+
in your application.
|
49
|
+
|
50
|
+
Returns:
|
51
|
+
The absolute path to the eidos package directory
|
52
|
+
|
53
|
+
Example:
|
54
|
+
>>> from fastapi.staticfiles import StaticFiles
|
55
|
+
>>> from eidos.utils import get_eidos_static_directory
|
56
|
+
>>> app.mount("/eidos", StaticFiles(directory=get_eidos_static_directory()), name="eidos")
|
57
|
+
"""
|
58
|
+
try:
|
59
|
+
from importlib.resources import files
|
60
|
+
return str(files('eidos'))
|
61
|
+
except (ImportError, AttributeError):
|
62
|
+
# Fallback for development or if importlib.resources fails
|
63
|
+
return os.path.dirname(os.path.abspath(__file__))
|
@@ -0,0 +1,124 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: eidosui
|
3
|
+
Version: 0.2.0
|
4
|
+
Summary: A modern, Tailwind CSS-based UI library for Python web frameworks
|
5
|
+
Project-URL: Homepage, https://github.com/isaac-flath/EidosUI
|
6
|
+
Project-URL: Repository, https://github.com/isaac-flath/EidosUI
|
7
|
+
Project-URL: Issues, https://github.com/isaac-flath/EidosUI/issues
|
8
|
+
Project-URL: Documentation, https://github.com/isaac-flath/EidosUI#readme
|
9
|
+
Author: Isaac Flath
|
10
|
+
License-Expression: MIT
|
11
|
+
License-File: LICENSE
|
12
|
+
Keywords: components,css,fastapi,tailwind,ui,web
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
14
|
+
Classifier: Intended Audience :: Developers
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
20
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
22
|
+
Requires-Python: >=3.10
|
23
|
+
Requires-Dist: air
|
24
|
+
Requires-Dist: fastapi
|
25
|
+
Requires-Dist: uvicorn
|
26
|
+
Provides-Extra: dev
|
27
|
+
Requires-Dist: black; extra == 'dev'
|
28
|
+
Requires-Dist: isort; extra == 'dev'
|
29
|
+
Requires-Dist: mypy; extra == 'dev'
|
30
|
+
Requires-Dist: pytest; extra == 'dev'
|
31
|
+
Requires-Dist: ruff; extra == 'dev'
|
32
|
+
Description-Content-Type: text/markdown
|
33
|
+
|
34
|
+
# EidosUI 🎨
|
35
|
+
|
36
|
+
A modern, flexible Tailwind CSS-based UI library for Python web frameworks. Built for maximum developer flexibility while providing excellent defaults.
|
37
|
+
|
38
|
+
> [!CAUTION]
|
39
|
+
> This library is not ready for anything yet. IN fact, this readme is more of design ideas than anything as much of what's in here isn't implemented yet!
|
40
|
+
|
41
|
+
|
42
|
+
## Design
|
43
|
+
|
44
|
+
### Base CSS
|
45
|
+
|
46
|
+
- `styles.css` : defines all the core css logic to create classes like `edios-mark`, `eidos-small`, etc.
|
47
|
+
- `light.css`/`dark.css` : These define lots of css variables used in `styles.css` and are themes
|
48
|
+
|
49
|
+
Users would create a custom theme by copying light/dark css files and changing the variable definitions.
|
50
|
+
|
51
|
+
### Styles
|
52
|
+
|
53
|
+
This has enums that make the Base CSS clases accessible in python. For example:
|
54
|
+
|
55
|
+
`styles.typography.h1` or `styles.buttons.primary`
|
56
|
+
|
57
|
+
### Tags
|
58
|
+
|
59
|
+
```python
|
60
|
+
def H1(*content, cls: str = None, **kwargs) -> air.H1:
|
61
|
+
"""Semantic H1 heading"""
|
62
|
+
return air.H1(*content, cls=stringify(styles.typography.h1, cls), **kwargs)
|
63
|
+
|
64
|
+
def Mark(*content, cls: str = None, **kwargs) -> air.Mark:
|
65
|
+
"""Highlighted text"""
|
66
|
+
return .Mark(*content, cls=stringify(styles.typography.mark, cls), **kwargs)
|
67
|
+
|
68
|
+
def Small(*content, cls: str = , **kwargs) -> air.Small:
|
69
|
+
"""Small text"""
|
70
|
+
return air.Small(*content, cls=stringify(styles.typography.small, cls), **kwargs)
|
71
|
+
```
|
72
|
+
|
73
|
+
### Components (Not Built Yet)
|
74
|
+
|
75
|
+
Theses are things that go beyond just exposing css to python. Here's a simple example of what might be added.
|
76
|
+
|
77
|
+
```python
|
78
|
+
class Table:
|
79
|
+
def __init__(self, cls: str = None, **kwargs):
|
80
|
+
"""Create an empty table with optional styling"""
|
81
|
+
self.cls = cls
|
82
|
+
self.kwargs = kwargs
|
83
|
+
|
84
|
+
@classmethod
|
85
|
+
def from_lists(cls, data: list[list], headers: list[str] = None, cls_: str = None, **kwargs):
|
86
|
+
"""Create table from list of lists"""
|
87
|
+
thead = []
|
88
|
+
if headers:
|
89
|
+
thead = THead(Tr(*[Th(header) for header in headers]))
|
90
|
+
|
91
|
+
tbody_rows = []
|
92
|
+
for data in row_data:
|
93
|
+
tbody_rows.append(Tr(*map(Td, row_data)))
|
94
|
+
tbody = TBody(*tbody_rows)
|
95
|
+
|
96
|
+
return Table(thead+tbody, cls=cls_, **kwargs)
|
97
|
+
|
98
|
+
@classmethod
|
99
|
+
def from_dicts(cls, data: list[dict], headers: list[str] = None, cls_: str = None, **kwargs):
|
100
|
+
"""Create table from list of dictionaries"""
|
101
|
+
thead = []
|
102
|
+
if headers:
|
103
|
+
thead = THead(Tr(*[Th(header) for header in headers]))
|
104
|
+
|
105
|
+
tbody_rows = []
|
106
|
+
for row in data:
|
107
|
+
tbody_rows.append(Tr(*[Td(row.get(header, "")) for header in (headers or list(row.keys()))]))
|
108
|
+
tbody = TBody(*tbody_rows)
|
109
|
+
|
110
|
+
return Table(thead+tbody, cls=cls_, **kwargs)
|
111
|
+
|
112
|
+
# Usage examples:
|
113
|
+
Table.from_lists([["A", "B"], ["C", "D"]], headers=["Col1", "Col2"])
|
114
|
+
Table.from_dicts([{"name": "John", "age": 25}], headers=["Name", "Age"])
|
115
|
+
```
|
116
|
+
|
117
|
+
## Plugins
|
118
|
+
|
119
|
+
### edios-md
|
120
|
+
|
121
|
+
This will be installable with `pip install "eidos[markdown]"`.
|
122
|
+
|
123
|
+
This is a plugin for rendering markdown that is well scoped to just markdown rendering. This module does markdown rendering well with table of contents with scrollspy, code highlighting, latex rendering, etc. It must be used with `EidosUI` as it uses css variables from there for the styling (so it is always in sync with the theme)
|
124
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
eidos/__init__.py,sha256=wPMqILVs6Iof510BteshYDZgsW-08w_RfenImYKlPlM,40
|
2
|
+
eidos/styles.py,sha256=QupOwC0VuSZ6zdNJiNFT_PqTnvbJvaNplKO5M5xzMVI,2380
|
3
|
+
eidos/tags.py,sha256=9jX9u8QLHjv48vRB7yorR3dV25UEt3AjgUlYPJDcxPM,3975
|
4
|
+
eidos/utils.py,sha256=dncLrIjn78x6HW-lX1feG76jtAilfLaxsRmJ8ewCCCs,1922
|
5
|
+
eidos/components/headers.py,sha256=qE5xa2Yt545FGlBAITPjPAU5CQkz0cnYq7biYcb6mB0,939
|
6
|
+
eidos/css/styles.css,sha256=4VWOWe436DQRXBN4b6g6tsIRqXsYJrwuoKNnsrQQv_M,7643
|
7
|
+
eidos/css/themes/dark.css,sha256=yUDNz7iLEJ_Q63MrKXlrhYcpojm1L2eNUOthzhYc3Vs,4170
|
8
|
+
eidos/css/themes/eidos-variables.css,sha256=s4_CUivnqvndE4c7T1stp59orEHL_0C9tmN0rxai7bU,5686
|
9
|
+
eidos/css/themes/light.css,sha256=kESbN5Z4ovCn-Q3fxilQcjafgMCIyyJiocU9kMC5sIM,2674
|
10
|
+
eidosui-0.2.0.dist-info/METADATA,sha256=ME2HeKBZS9nenM2SpdQ5FBYbA51rlU0CnO3UvoDy44g,4609
|
11
|
+
eidosui-0.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
12
|
+
eidosui-0.2.0.dist-info/licenses/LICENSE,sha256=evjPJs6lg9eka9CYtC6ErQrZ71IovVbdvZqqz3ax8E8,1064
|
13
|
+
eidosui-0.2.0.dist-info/RECORD,,
|
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2025 Feldroy
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|