eidosui 0.1.0__tar.gz → 0.3.0__tar.gz

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 (37) hide show
  1. {eidosui-0.1.0 → eidosui-0.3.0}/.gitignore +1 -1
  2. eidosui-0.3.0/LICENSE +21 -0
  3. eidosui-0.3.0/PKG-INFO +127 -0
  4. eidosui-0.3.0/README.md +91 -0
  5. eidosui-0.3.0/eidos/__init__.py +0 -0
  6. eidosui-0.3.0/eidos/components/headers.py +68 -0
  7. eidosui-0.3.0/eidos/components/navigation.py +78 -0
  8. eidosui-0.3.0/eidos/css/styles.css +430 -0
  9. eidosui-0.3.0/eidos/css/themes/dark.css +119 -0
  10. eidosui-0.3.0/eidos/css/themes/eidos-variables.css +190 -0
  11. eidosui-0.3.0/eidos/css/themes/light.css +80 -0
  12. eidosui-0.3.0/eidos/js/eidos.js +112 -0
  13. eidosui-0.3.0/eidos/plugins/__init__.py +1 -0
  14. eidosui-0.3.0/eidos/plugins/markdown/__init__.py +21 -0
  15. eidosui-0.3.0/eidos/plugins/markdown/components.py +53 -0
  16. eidosui-0.3.0/eidos/plugins/markdown/css/markdown.css +283 -0
  17. eidosui-0.3.0/eidos/plugins/markdown/extensions/__init__.py +1 -0
  18. eidosui-0.3.0/eidos/plugins/markdown/extensions/alerts.py +134 -0
  19. eidosui-0.3.0/eidos/plugins/markdown/renderer.py +58 -0
  20. eidosui-0.3.0/eidos/styles.py +80 -0
  21. eidosui-0.3.0/eidos/tags.py +99 -0
  22. eidosui-0.3.0/eidos/utils.py +72 -0
  23. eidosui-0.3.0/pyproject.toml +76 -0
  24. eidosui-0.1.0/PKG-INFO +0 -61
  25. eidosui-0.1.0/README.md +0 -26
  26. eidosui-0.1.0/eidos/__init__.py +0 -57
  27. eidosui-0.1.0/eidos/components/__init__.py +0 -22
  28. eidosui-0.1.0/eidos/components/forms.py +0 -57
  29. eidosui-0.1.0/eidos/components/typography.py +0 -85
  30. eidosui-0.1.0/eidos/core/__init__.py +0 -25
  31. eidosui-0.1.0/eidos/core/helpers.py +0 -87
  32. eidosui-0.1.0/eidos/core/styles.py +0 -92
  33. eidosui-0.1.0/eidos/core/utils.py +0 -46
  34. eidosui-0.1.0/eidos/static/eidos-ui.js +0 -74
  35. eidosui-0.1.0/eidos/themes/dark.css +0 -52
  36. eidosui-0.1.0/eidos/themes/light.css +0 -110
  37. eidosui-0.1.0/pyproject.toml +0 -108
@@ -2,7 +2,7 @@
2
2
  __pycache__/
3
3
  *.py[cod]
4
4
  *$py.class
5
-
5
+ .specstory/**
6
6
  # C extensions
7
7
  *.so
8
8
 
eidosui-0.3.0/LICENSE ADDED
@@ -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.
eidosui-0.3.0/PKG-INFO ADDED
@@ -0,0 +1,127 @@
1
+ Metadata-Version: 2.4
2
+ Name: eidosui
3
+ Version: 0.3.0
4
+ Summary: A modern, Tailwind CSS-based UI library for air development
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: air,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: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Requires-Python: >=3.10
24
+ Requires-Dist: air>=0.12
25
+ Requires-Dist: fastapi[standard]
26
+ Requires-Dist: uvicorn
27
+ Provides-Extra: dev
28
+ Requires-Dist: black; extra == 'dev'
29
+ Requires-Dist: isort; extra == 'dev'
30
+ Requires-Dist: mypy; extra == 'dev'
31
+ Requires-Dist: pytest; extra == 'dev'
32
+ Requires-Dist: ruff; extra == 'dev'
33
+ Provides-Extra: markdown
34
+ Requires-Dist: markdown>=3.4; extra == 'markdown'
35
+ Description-Content-Type: text/markdown
36
+
37
+ # EidosUI 🎨
38
+
39
+ A modern, flexible Tailwind CSS-based UI library for Python web frameworks. Built for maximum developer flexibility while providing excellent defaults.
40
+
41
+ > [!CAUTION]
42
+ > 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!
43
+
44
+
45
+ ## Design
46
+
47
+ ### Base CSS
48
+
49
+ - `styles.css` : defines all the core css logic to create classes like `edios-mark`, `eidos-small`, etc.
50
+ - `light.css`/`dark.css` : These define lots of css variables used in `styles.css` and are themes
51
+
52
+ Users would create a custom theme by copying light/dark css files and changing the variable definitions.
53
+
54
+ ### Styles
55
+
56
+ This has enums that make the Base CSS clases accessible in python. For example:
57
+
58
+ `styles.typography.h1` or `styles.buttons.primary`
59
+
60
+ ### Tags
61
+
62
+ ```python
63
+ def H1(*content, cls: str = None, **kwargs) -> air.H1:
64
+ """Semantic H1 heading"""
65
+ return air.H1(*content, cls=stringify(styles.typography.h1, cls), **kwargs)
66
+
67
+ def Mark(*content, cls: str = None, **kwargs) -> air.Mark:
68
+ """Highlighted text"""
69
+ return .Mark(*content, cls=stringify(styles.typography.mark, cls), **kwargs)
70
+
71
+ def Small(*content, cls: str = , **kwargs) -> air.Small:
72
+ """Small text"""
73
+ return air.Small(*content, cls=stringify(styles.typography.small, cls), **kwargs)
74
+ ```
75
+
76
+ ### Components (Not Built Yet)
77
+
78
+ Theses are things that go beyond just exposing css to python. Here's a simple example of what might be added.
79
+
80
+ ```python
81
+ class Table:
82
+ def __init__(self, cls: str = None, **kwargs):
83
+ """Create an empty table with optional styling"""
84
+ self.cls = cls
85
+ self.kwargs = kwargs
86
+
87
+ @classmethod
88
+ def from_lists(cls, data: list[list], headers: list[str] = None, cls_: str = None, **kwargs):
89
+ """Create table from list of lists"""
90
+ thead = []
91
+ if headers:
92
+ thead = THead(Tr(*[Th(header) for header in headers]))
93
+
94
+ tbody_rows = []
95
+ for data in row_data:
96
+ tbody_rows.append(Tr(*map(Td, row_data)))
97
+ tbody = TBody(*tbody_rows)
98
+
99
+ return Table(thead+tbody, cls=cls_, **kwargs)
100
+
101
+ @classmethod
102
+ def from_dicts(cls, data: list[dict], headers: list[str] = None, cls_: str = None, **kwargs):
103
+ """Create table from list of dictionaries"""
104
+ thead = []
105
+ if headers:
106
+ thead = THead(Tr(*[Th(header) for header in headers]))
107
+
108
+ tbody_rows = []
109
+ for row in data:
110
+ tbody_rows.append(Tr(*[Td(row.get(header, "")) for header in (headers or list(row.keys()))]))
111
+ tbody = TBody(*tbody_rows)
112
+
113
+ return Table(thead+tbody, cls=cls_, **kwargs)
114
+
115
+ # Usage examples:
116
+ Table.from_lists([["A", "B"], ["C", "D"]], headers=["Col1", "Col2"])
117
+ Table.from_dicts([{"name": "John", "age": 25}], headers=["Name", "Age"])
118
+ ```
119
+
120
+ ## Plugins
121
+
122
+ ### edios-md
123
+
124
+ This will be installable with `pip install "eidos[markdown]"`.
125
+
126
+ 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)
127
+
@@ -0,0 +1,91 @@
1
+ # EidosUI 🎨
2
+
3
+ A modern, flexible Tailwind CSS-based UI library for Python web frameworks. Built for maximum developer flexibility while providing excellent defaults.
4
+
5
+ > [!CAUTION]
6
+ > 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!
7
+
8
+
9
+ ## Design
10
+
11
+ ### Base CSS
12
+
13
+ - `styles.css` : defines all the core css logic to create classes like `edios-mark`, `eidos-small`, etc.
14
+ - `light.css`/`dark.css` : These define lots of css variables used in `styles.css` and are themes
15
+
16
+ Users would create a custom theme by copying light/dark css files and changing the variable definitions.
17
+
18
+ ### Styles
19
+
20
+ This has enums that make the Base CSS clases accessible in python. For example:
21
+
22
+ `styles.typography.h1` or `styles.buttons.primary`
23
+
24
+ ### Tags
25
+
26
+ ```python
27
+ def H1(*content, cls: str = None, **kwargs) -> air.H1:
28
+ """Semantic H1 heading"""
29
+ return air.H1(*content, cls=stringify(styles.typography.h1, cls), **kwargs)
30
+
31
+ def Mark(*content, cls: str = None, **kwargs) -> air.Mark:
32
+ """Highlighted text"""
33
+ return .Mark(*content, cls=stringify(styles.typography.mark, cls), **kwargs)
34
+
35
+ def Small(*content, cls: str = , **kwargs) -> air.Small:
36
+ """Small text"""
37
+ return air.Small(*content, cls=stringify(styles.typography.small, cls), **kwargs)
38
+ ```
39
+
40
+ ### Components (Not Built Yet)
41
+
42
+ Theses are things that go beyond just exposing css to python. Here's a simple example of what might be added.
43
+
44
+ ```python
45
+ class Table:
46
+ def __init__(self, cls: str = None, **kwargs):
47
+ """Create an empty table with optional styling"""
48
+ self.cls = cls
49
+ self.kwargs = kwargs
50
+
51
+ @classmethod
52
+ def from_lists(cls, data: list[list], headers: list[str] = None, cls_: str = None, **kwargs):
53
+ """Create table from list of lists"""
54
+ thead = []
55
+ if headers:
56
+ thead = THead(Tr(*[Th(header) for header in headers]))
57
+
58
+ tbody_rows = []
59
+ for data in row_data:
60
+ tbody_rows.append(Tr(*map(Td, row_data)))
61
+ tbody = TBody(*tbody_rows)
62
+
63
+ return Table(thead+tbody, cls=cls_, **kwargs)
64
+
65
+ @classmethod
66
+ def from_dicts(cls, data: list[dict], headers: list[str] = None, cls_: str = None, **kwargs):
67
+ """Create table from list of dictionaries"""
68
+ thead = []
69
+ if headers:
70
+ thead = THead(Tr(*[Th(header) for header in headers]))
71
+
72
+ tbody_rows = []
73
+ for row in data:
74
+ tbody_rows.append(Tr(*[Td(row.get(header, "")) for header in (headers or list(row.keys()))]))
75
+ tbody = TBody(*tbody_rows)
76
+
77
+ return Table(thead+tbody, cls=cls_, **kwargs)
78
+
79
+ # Usage examples:
80
+ Table.from_lists([["A", "B"], ["C", "D"]], headers=["Col1", "Col2"])
81
+ Table.from_dicts([{"name": "John", "age": 25}], headers=["Name", "Age"])
82
+ ```
83
+
84
+ ## Plugins
85
+
86
+ ### edios-md
87
+
88
+ This will be installable with `pip install "eidos[markdown]"`.
89
+
90
+ 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)
91
+
File without changes
@@ -0,0 +1,68 @@
1
+ from air import Meta, Script, Link
2
+ from ..tags import Body
3
+ from typing import Literal
4
+
5
+ def get_css_urls():
6
+ """Return list of CSS URLs for EidosUI."""
7
+ return [
8
+ "/eidos/css/styles.css",
9
+ "/eidos/css/themes/eidos-variables.css",
10
+ "/eidos/css/themes/light.css",
11
+ "/eidos/css/themes/dark.css"
12
+ ]
13
+
14
+ def EidosHeaders(
15
+ include_tailwind: bool = True,
16
+ include_lucide: bool = True,
17
+ include_eidos_js: bool = True,
18
+ theme: Literal["light", "dark"] = "light",
19
+ ):
20
+ """Complete EidosUI headers with EidosUI JavaScript support.
21
+
22
+ Args:
23
+ include_tailwind: Include Tailwind CSS CDN
24
+ include_lucide: Include Lucide Icons CDN
25
+ include_eidos_js: Include EidosUI JavaScript (navigation, future features)
26
+ theme: Initial theme
27
+ """
28
+ headers = [
29
+ Meta(charset="UTF-8"),
30
+ Meta(name="viewport", content="width=device-width, initial-scale=1.0"),
31
+ ]
32
+
33
+ # Core libraries
34
+ if include_tailwind:
35
+ headers.append(Script(src="https://cdn.tailwindcss.com"))
36
+
37
+ if include_lucide:
38
+ headers.append(Script(src="https://unpkg.com/lucide@latest/dist/umd/lucide.js"))
39
+
40
+ # EidosUI CSS
41
+ for css_url in get_css_urls():
42
+ headers.append(Link(rel="stylesheet", href=css_url))
43
+
44
+ # EidosUI JavaScript
45
+ if include_eidos_js:
46
+ headers.append(Script(src="/eidos/js/eidos.js", defer=True))
47
+
48
+ # Initialization script
49
+ init_script = f"""
50
+ // Set theme
51
+ document.documentElement.setAttribute('data-theme', '{theme}');
52
+ """
53
+
54
+ if include_lucide:
55
+ init_script += """
56
+ // Initialize Lucide icons
57
+ if (document.readyState === 'loading') {
58
+ document.addEventListener('DOMContentLoaded', () => {
59
+ if (window.lucide) lucide.createIcons();
60
+ });
61
+ } else {
62
+ if (window.lucide) lucide.createIcons();
63
+ }
64
+ """
65
+
66
+ headers.append(Script(init_script))
67
+
68
+ return headers
@@ -0,0 +1,78 @@
1
+ from air import Div, A, I, Tag
2
+ from ..tags import *
3
+ from ..utils import stringify
4
+ from typing import Final, Optional, Any, Union
5
+ from uuid import uuid4
6
+
7
+ class ScrollspyT:
8
+ underline: Final[str] = 'navbar-underline'
9
+ bold: Final[str] = 'navbar-bold'
10
+
11
+ def NavBar(*c: Any,
12
+ lcontents: Tag = H3("Title"),
13
+ right_cls: str = 'items-center space-x-4',
14
+ mobile_cls: str = '',
15
+ sticky: bool = False,
16
+ scrollspy: bool = False,
17
+ cls: str = 'p-4',
18
+ scrollspy_cls: str = ScrollspyT.underline,
19
+ menu_id: Optional[str] = None,
20
+ ) -> Tag:
21
+ """Pure Tailwind responsive navigation bar with optional scrollspy.
22
+
23
+ Mobile menu uses best practice dropdown with:
24
+ - Centered text links
25
+ - Large touch targets
26
+ - Auto-close on selection
27
+ - Smooth animations
28
+ """
29
+ if menu_id is None: menu_id = f"menu-{uuid4().hex[:8]}"
30
+
31
+ sticky_cls = 'sticky top-0 eidos-navbar-sticky z-50' if sticky else ''
32
+
33
+ # Mobile toggle button with hamburger/close icon
34
+ mobile_icon = A(
35
+ I(data_lucide="menu", class_="w-6 h-6", data_menu_icon="open"),
36
+ I(data_lucide="x", class_="w-6 h-6 hidden", data_menu_icon="close"),
37
+ class_="md:hidden cursor-pointer p-2 eidos-navbar-toggle rounded-lg transition-colors",
38
+ data_toggle=f"#{menu_id}",
39
+ role="button",
40
+ aria_label="Toggle navigation",
41
+ aria_expanded="false"
42
+ )
43
+
44
+ # Desktop navigation
45
+ desktop_nav = Div(
46
+ *c,
47
+ class_=stringify(right_cls, 'hidden md:flex'),
48
+ data_scrollspy="true" if scrollspy else None
49
+ )
50
+
51
+ # Mobile navigation
52
+ mobile_nav = Div(
53
+ *c,
54
+ class_=stringify(
55
+ mobile_cls,
56
+ 'hidden md:hidden absolute top-full left-0 right-0 eidos-navbar-mobile shadow-lg border-t',
57
+ 'flex flex-col eidos-navbar-mobile-divider' if not mobile_cls else '',
58
+ scrollspy_cls
59
+ ),
60
+ id=menu_id,
61
+ data_scrollspy="true" if scrollspy else None,
62
+ data_mobile_menu="true"
63
+ )
64
+
65
+ return Div(
66
+ # Main navbar container with relative positioning for mobile dropdown
67
+ Div(
68
+ Div(
69
+ lcontents,
70
+ mobile_icon,
71
+ desktop_nav,
72
+ class_='flex items-center justify-between'
73
+ ),
74
+ mobile_nav,
75
+ class_=stringify('eidos-navbar relative', cls, scrollspy_cls)
76
+ ),
77
+ class_=sticky_cls
78
+ )