pydzn 0.1.2__tar.gz → 0.1.3__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 (30) hide show
  1. {pydzn-0.1.2/src/pydzn.egg-info → pydzn-0.1.3}/PKG-INFO +1 -1
  2. {pydzn-0.1.2 → pydzn-0.1.3}/pyproject.toml +1 -1
  3. {pydzn-0.1.2 → pydzn-0.1.3}/src/pydzn/base_component.py +0 -1
  4. pydzn-0.1.3/src/pydzn/components/__init__.py +8 -0
  5. pydzn-0.1.3/src/pydzn/components/card/component.py +15 -0
  6. pydzn-0.1.3/src/pydzn/components/card/template.html +3 -0
  7. pydzn-0.1.3/src/pydzn/components/drawer/component.py +14 -0
  8. pydzn-0.1.3/src/pydzn/components/drawer/template.html +3 -0
  9. pydzn-0.1.3/src/pydzn/components/nav_item/component.py +56 -0
  10. pydzn-0.1.3/src/pydzn/components/nav_item/template.html +3 -0
  11. pydzn-0.1.3/src/pydzn/components/sidebar/component.py +15 -0
  12. pydzn-0.1.3/src/pydzn/components/sidebar/template.html +3 -0
  13. pydzn-0.1.3/src/pydzn/components/text/component.py +15 -0
  14. pydzn-0.1.3/src/pydzn/components/text/template.html +3 -0
  15. {pydzn-0.1.2 → pydzn-0.1.3/src/pydzn.egg-info}/PKG-INFO +1 -1
  16. pydzn-0.1.3/src/pydzn.egg-info/SOURCES.txt +26 -0
  17. pydzn-0.1.2/src/pydzn/components/button/__init__.py +0 -0
  18. pydzn-0.1.2/src/pydzn.egg-info/SOURCES.txt +0 -16
  19. {pydzn-0.1.2 → pydzn-0.1.3}/LICENSE +0 -0
  20. {pydzn-0.1.2 → pydzn-0.1.3}/README.md +0 -0
  21. {pydzn-0.1.2 → pydzn-0.1.3}/setup.cfg +0 -0
  22. {pydzn-0.1.2 → pydzn-0.1.3}/src/pydzn/__init__.py +0 -0
  23. {pydzn-0.1.2/src/pydzn/components → pydzn-0.1.3/src/pydzn/components/button}/__init__.py +0 -0
  24. {pydzn-0.1.2 → pydzn-0.1.3}/src/pydzn/components/button/component.py +0 -0
  25. {pydzn-0.1.2 → pydzn-0.1.3}/src/pydzn/components/button/template.html +0 -0
  26. {pydzn-0.1.2 → pydzn-0.1.3}/src/pydzn/dzn.py +0 -0
  27. {pydzn-0.1.2 → pydzn-0.1.3}/src/pydzn/grid_builder.py +0 -0
  28. {pydzn-0.1.2 → pydzn-0.1.3}/src/pydzn.egg-info/dependency_links.txt +0 -0
  29. {pydzn-0.1.2 → pydzn-0.1.3}/src/pydzn.egg-info/requires.txt +0 -0
  30. {pydzn-0.1.2 → pydzn-0.1.3}/src/pydzn.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydzn
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Tiny design-system utilities (Tailwind-like), composable HTML components, and a grid layout builder for Python/Jinja apps.
5
5
  Author-email: Ryan Kirkish <ryan@foo.com>
6
6
  License: Apache-2.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pydzn"
7
- version = "0.1.2"
7
+ version = "0.1.3"
8
8
  description = "Tiny design-system utilities (Tailwind-like), composable HTML components, and a grid layout builder for Python/Jinja apps."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -6,7 +6,6 @@ import json
6
6
  import inspect
7
7
  from pathlib import Path
8
8
  from jinja2 import Environment, FileSystemLoader, select_autoescape
9
- from .base_agent import BaseAssistant
10
9
  from .dzn import register_dzn_classes
11
10
 
12
11
 
@@ -0,0 +1,8 @@
1
+ from .button.component import Button
2
+ from .text.component import Text
3
+ from .drawer.component import Drawer
4
+ from .sidebar.component import Sidebar
5
+ from .nav_item.component import NavItem
6
+
7
+
8
+ __all__ = ["Button", "Text", "Drawer", "Sidebar", "NavItem"]
@@ -0,0 +1,15 @@
1
+ from pydzn.base_component import BaseComponent
2
+
3
+
4
+ class Card(BaseComponent):
5
+ """
6
+ Renders a card element.
7
+ Expects `template.html`
8
+ """
9
+
10
+ def __init__(self, children: str | None = None, tag: str = "div", **html_attrs):
11
+ super().__init__(children=children, tag=tag, **html_attrs)
12
+
13
+
14
+ def context(self) -> dict:
15
+ return {}
@@ -0,0 +1,3 @@
1
+ <{{ tag }}{% if attrs %} {{ attrs|safe }}{% endif %}>
2
+ {{ children|safe }}
3
+ </{{ tag }}>
@@ -0,0 +1,14 @@
1
+ from pydzn.base_component import BaseComponent
2
+
3
+
4
+ class Drawer(BaseComponent):
5
+ """
6
+ Renders a drawer element.
7
+ Expects `template.html`
8
+ """
9
+
10
+ def __init__(self, children: str | None = None, tag: str = "div", **html_attrs):
11
+ super().__init__(children=children, tag=tag, **html_attrs)
12
+
13
+ def context(self) -> dict:
14
+ return {}
@@ -0,0 +1,3 @@
1
+ <{{ tag }}{% if attrs %} {{ attrs|safe }}{% endif %}>
2
+ {{ children|safe }}
3
+ </{{ tag }}>
@@ -0,0 +1,56 @@
1
+ from pydzn.base_component import BaseComponent
2
+ from pydzn.dzn import register_dzn_classes
3
+
4
+
5
+ class NavItem(BaseComponent):
6
+ """
7
+ Minimal sidebar/nav item.
8
+ - No default styling; pass dzn yourself.
9
+ - Put label/content in `children` (e.g., render a Text component).
10
+ - Optional: `active=True` to start active; `group_toggle=True` to clear
11
+ siblings and apply `active_classes` on click (client-only).
12
+ """
13
+
14
+ def __init__(
15
+ self,
16
+ *,
17
+ children: str | None = None,
18
+ tag: str = "div",
19
+ dzn: str | None = None,
20
+ active: bool = False,
21
+ active_classes: list[str] | tuple[str, ...] | None = None,
22
+ group_toggle: bool = False,
23
+ **attrs,
24
+ ):
25
+ # No default design; just pass through what caller wants.
26
+ self._active_classes = list(active_classes or [])
27
+
28
+ # If we'll toggle classes at runtime, pre-register them so /_dzn.css emits rules.
29
+ if self._active_classes:
30
+ register_dzn_classes(self._active_classes)
31
+
32
+ # Start active = append active classes up front
33
+ effective_dzn = (dzn or "")
34
+ if active and self._active_classes:
35
+ effective_dzn = (effective_dzn + " " + " ".join(self._active_classes)).strip()
36
+
37
+ # Sensible a11y defaults (still “unstyled”)
38
+ attrs.setdefault("role", "button")
39
+ attrs.setdefault("tabindex", "0")
40
+
41
+ # Optional sibling-clearing active toggle, only if requested and not overridden
42
+ if group_toggle and "hx-on:click" not in attrs and self._active_classes:
43
+ # Build JS that removes active classes from siblings, adds to this.
44
+ rm = ",".join(f"'{c}'" for c in self._active_classes)
45
+ add = rm
46
+ attrs["hx-on:click"] = (
47
+ "var p=this.parentElement;"
48
+ f"for(const el of p.children){{el.classList.remove({rm});}}"
49
+ f"this.classList.add({add});"
50
+ )
51
+
52
+ super().__init__(children=children or "", tag=tag, dzn=effective_dzn, **attrs)
53
+
54
+ def context(self) -> dict:
55
+ # No label here; use children (e.g., a Text component) for content.
56
+ return {}
@@ -0,0 +1,3 @@
1
+ <{{ tag }} {{ attrs|safe }}>
2
+ {{ children|safe }}
3
+ </{{ tag }}>
@@ -0,0 +1,15 @@
1
+ from pydzn.base_component import BaseComponent
2
+
3
+
4
+ class Sidebar(BaseComponent):
5
+ """
6
+ Minimal sidebar container.
7
+ Spans parent height; default subtle panel bg.
8
+ The layout decides which side shows the divider.
9
+ """
10
+
11
+ def __init__(self, *, children: str | None = None, tag: str = "div", dzn: str | None = None, **attrs):
12
+ super().__init__(children=children or "", tag=tag, dzn=dzn, **attrs)
13
+
14
+ def context(self) -> dict:
15
+ return {}
@@ -0,0 +1,3 @@
1
+ <{{ tag }} {{ attrs|safe }}>
2
+ {{ children|safe }}
3
+ </{{ tag }}>
@@ -0,0 +1,15 @@
1
+ from pydzn.base_component import BaseComponent
2
+
3
+
4
+ class Text(BaseComponent):
5
+ """
6
+ Renders a text element.
7
+ Expects `template.html`
8
+ """
9
+
10
+ def __init__(self, text: str = "", children: str | None = None, tag: str = "div", **html_attrs):
11
+ super().__init__(children=children, tag=tag, **html_attrs)
12
+ self.text = text
13
+
14
+ def context(self) -> dict:
15
+ return {"text": self.text}
@@ -0,0 +1,3 @@
1
+ <{{ tag }}{% if attrs %} {{ attrs|safe }}{% endif %}>
2
+ {{ text }}{{ children|safe }}
3
+ </{{ tag }}>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pydzn
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Tiny design-system utilities (Tailwind-like), composable HTML components, and a grid layout builder for Python/Jinja apps.
5
5
  Author-email: Ryan Kirkish <ryan@foo.com>
6
6
  License: Apache-2.0
@@ -0,0 +1,26 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/pydzn/__init__.py
5
+ src/pydzn/base_component.py
6
+ src/pydzn/dzn.py
7
+ src/pydzn/grid_builder.py
8
+ src/pydzn.egg-info/PKG-INFO
9
+ src/pydzn.egg-info/SOURCES.txt
10
+ src/pydzn.egg-info/dependency_links.txt
11
+ src/pydzn.egg-info/requires.txt
12
+ src/pydzn.egg-info/top_level.txt
13
+ src/pydzn/components/__init__.py
14
+ src/pydzn/components/button/__init__.py
15
+ src/pydzn/components/button/component.py
16
+ src/pydzn/components/button/template.html
17
+ src/pydzn/components/card/component.py
18
+ src/pydzn/components/card/template.html
19
+ src/pydzn/components/drawer/component.py
20
+ src/pydzn/components/drawer/template.html
21
+ src/pydzn/components/nav_item/component.py
22
+ src/pydzn/components/nav_item/template.html
23
+ src/pydzn/components/sidebar/component.py
24
+ src/pydzn/components/sidebar/template.html
25
+ src/pydzn/components/text/component.py
26
+ src/pydzn/components/text/template.html
File without changes
@@ -1,16 +0,0 @@
1
- LICENSE
2
- README.md
3
- pyproject.toml
4
- src/pydzn/__init__.py
5
- src/pydzn/base_component.py
6
- src/pydzn/dzn.py
7
- src/pydzn/grid_builder.py
8
- src/pydzn.egg-info/PKG-INFO
9
- src/pydzn.egg-info/SOURCES.txt
10
- src/pydzn.egg-info/dependency_links.txt
11
- src/pydzn.egg-info/requires.txt
12
- src/pydzn.egg-info/top_level.txt
13
- src/pydzn/components/__init__.py
14
- src/pydzn/components/button/__init__.py
15
- src/pydzn/components/button/component.py
16
- src/pydzn/components/button/template.html
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes