djust-components 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.
- djust_components-0.3.0/.github/dependabot.yml +6 -0
- djust_components-0.3.0/.github/workflows/publish.yml +69 -0
- djust_components-0.3.0/.github/workflows/release.yml +69 -0
- djust_components-0.3.0/.github/workflows/test.yml +38 -0
- djust_components-0.3.0/.gitignore +77 -0
- djust_components-0.3.0/CHANGELOG.md +83 -0
- djust_components-0.3.0/COMPONENT_CLASSES.md +628 -0
- djust_components-0.3.0/PKG-INFO +324 -0
- djust_components-0.3.0/README.md +298 -0
- djust_components-0.3.0/pyproject.toml +40 -0
- djust_components-0.3.0/src/djust_components/__init__.py +29 -0
- djust_components-0.3.0/src/djust_components/apps.py +7 -0
- djust_components-0.3.0/src/djust_components/static/djust_components/components-classes.css +405 -0
- djust_components-0.3.0/src/djust_components/static/djust_components/components.css +157 -0
- djust_components-0.3.0/src/djust_components/templates/djust_components/accordion.html +0 -0
- djust_components-0.3.0/src/djust_components/templates/djust_components/avatar.html +10 -0
- djust_components-0.3.0/src/djust_components/templates/djust_components/badge.html +4 -0
- djust_components-0.3.0/src/djust_components/templates/djust_components/card.html +0 -0
- djust_components-0.3.0/src/djust_components/templates/djust_components/dropdown.html +0 -0
- djust_components-0.3.0/src/djust_components/templates/djust_components/modal.html +0 -0
- djust_components-0.3.0/src/djust_components/templates/djust_components/pagination.html +11 -0
- djust_components-0.3.0/src/djust_components/templates/djust_components/progress.html +11 -0
- djust_components-0.3.0/src/djust_components/templates/djust_components/table.html +36 -0
- djust_components-0.3.0/src/djust_components/templates/djust_components/tabs.html +0 -0
- djust_components-0.3.0/src/djust_components/templates/djust_components/toast.html +16 -0
- djust_components-0.3.0/src/djust_components/templates/djust_components/tooltip.html +0 -0
- djust_components-0.3.0/src/djust_components/templatetags/__init__.py +0 -0
- djust_components-0.3.0/src/djust_components/templatetags/djust_components.py +499 -0
- djust_components-0.3.0/tests/__init__.py +0 -0
- djust_components-0.3.0/tests/test_component_classes.py +515 -0
- djust_components-0.3.0/tests/test_components.py +206 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
inputs:
|
|
8
|
+
test_pypi:
|
|
9
|
+
description: 'Publish to Test PyPI instead of PyPI'
|
|
10
|
+
required: false
|
|
11
|
+
default: 'false'
|
|
12
|
+
type: boolean
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: read
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
build:
|
|
19
|
+
name: Build distribution
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
|
|
24
|
+
- name: Set up Python
|
|
25
|
+
uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: '3.12'
|
|
28
|
+
|
|
29
|
+
- name: Install build tools
|
|
30
|
+
run: pip install build
|
|
31
|
+
|
|
32
|
+
- name: Build package
|
|
33
|
+
run: python -m build
|
|
34
|
+
|
|
35
|
+
- name: Upload dist artifacts
|
|
36
|
+
uses: actions/upload-artifact@v4
|
|
37
|
+
with:
|
|
38
|
+
name: dist
|
|
39
|
+
path: dist/
|
|
40
|
+
|
|
41
|
+
publish:
|
|
42
|
+
name: Publish to PyPI
|
|
43
|
+
needs: build
|
|
44
|
+
runs-on: ubuntu-latest
|
|
45
|
+
environment:
|
|
46
|
+
name: pypi
|
|
47
|
+
url: https://pypi.org/p/djust-components
|
|
48
|
+
permissions:
|
|
49
|
+
id-token: write # Required for OIDC trusted publishing
|
|
50
|
+
|
|
51
|
+
steps:
|
|
52
|
+
- name: Download dist artifacts
|
|
53
|
+
uses: actions/download-artifact@v4
|
|
54
|
+
with:
|
|
55
|
+
name: dist
|
|
56
|
+
path: dist/
|
|
57
|
+
|
|
58
|
+
- name: Publish to Test PyPI
|
|
59
|
+
if: ${{ github.event.inputs.test_pypi == 'true' }}
|
|
60
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
61
|
+
with:
|
|
62
|
+
repository-url: https://test.pypi.org/legacy/
|
|
63
|
+
skip-existing: true
|
|
64
|
+
|
|
65
|
+
- name: Publish to PyPI
|
|
66
|
+
if: ${{ github.event.inputs.test_pypi != 'true' }}
|
|
67
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
68
|
+
with:
|
|
69
|
+
skip-existing: true
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
id-token: write
|
|
11
|
+
|
|
12
|
+
# Prevent concurrent releases
|
|
13
|
+
concurrency:
|
|
14
|
+
group: release
|
|
15
|
+
cancel-in-progress: false
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
verify:
|
|
19
|
+
name: Verify release
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
outputs:
|
|
22
|
+
version: ${{ steps.version.outputs.version }}
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
|
|
26
|
+
- name: Get version from tag
|
|
27
|
+
id: version
|
|
28
|
+
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
|
29
|
+
|
|
30
|
+
- name: Verify tag matches pyproject.toml
|
|
31
|
+
run: |
|
|
32
|
+
TAG_VERSION="${{ steps.version.outputs.version }}"
|
|
33
|
+
PY_VERSION=$(grep '^version = ' pyproject.toml | head -1 | sed 's/version = "//; s/"//')
|
|
34
|
+
echo "Tag version: $TAG_VERSION"
|
|
35
|
+
echo "pyproject.toml version: $PY_VERSION"
|
|
36
|
+
if [ "$TAG_VERSION" != "$PY_VERSION" ]; then
|
|
37
|
+
echo "::error::Tag v$TAG_VERSION doesn't match pyproject.toml version $PY_VERSION"
|
|
38
|
+
exit 1
|
|
39
|
+
fi
|
|
40
|
+
echo "✅ Version verified: $TAG_VERSION"
|
|
41
|
+
|
|
42
|
+
publish:
|
|
43
|
+
name: Publish to PyPI
|
|
44
|
+
needs: verify
|
|
45
|
+
runs-on: ubuntu-latest
|
|
46
|
+
environment:
|
|
47
|
+
name: pypi
|
|
48
|
+
url: https://pypi.org/p/djust-components
|
|
49
|
+
permissions:
|
|
50
|
+
id-token: write
|
|
51
|
+
|
|
52
|
+
steps:
|
|
53
|
+
- uses: actions/checkout@v4
|
|
54
|
+
|
|
55
|
+
- name: Set up Python
|
|
56
|
+
uses: actions/setup-python@v5
|
|
57
|
+
with:
|
|
58
|
+
python-version: '3.12'
|
|
59
|
+
|
|
60
|
+
- name: Install build tools
|
|
61
|
+
run: pip install build
|
|
62
|
+
|
|
63
|
+
- name: Build package
|
|
64
|
+
run: python -m build
|
|
65
|
+
|
|
66
|
+
- name: Publish to PyPI
|
|
67
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
68
|
+
with:
|
|
69
|
+
skip-existing: true
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
fail-fast: false
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: ['3.10', '3.11', '3.12']
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: ${{ matrix.python-version }}
|
|
24
|
+
|
|
25
|
+
- name: Cache pip
|
|
26
|
+
uses: actions/cache@v4
|
|
27
|
+
with:
|
|
28
|
+
path: ~/.cache/pip
|
|
29
|
+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
|
|
30
|
+
restore-keys: |
|
|
31
|
+
${{ runner.os }}-pip-${{ matrix.python-version }}-
|
|
32
|
+
${{ runner.os }}-pip-
|
|
33
|
+
|
|
34
|
+
- name: Install dependencies
|
|
35
|
+
run: pip install -e . pytest pytest-django pytest-cov
|
|
36
|
+
|
|
37
|
+
- name: Run tests
|
|
38
|
+
run: pytest --cov --cov-report=term-missing
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.pyo
|
|
5
|
+
*.pyd
|
|
6
|
+
.Python
|
|
7
|
+
*.egg
|
|
8
|
+
*.egg-info/
|
|
9
|
+
dist/
|
|
10
|
+
build/
|
|
11
|
+
eggs/
|
|
12
|
+
parts/
|
|
13
|
+
var/
|
|
14
|
+
sdist/
|
|
15
|
+
develop-eggs/
|
|
16
|
+
.installed.cfg
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
.eggs/
|
|
20
|
+
*.so
|
|
21
|
+
|
|
22
|
+
# Virtual environments
|
|
23
|
+
.venv/
|
|
24
|
+
venv/
|
|
25
|
+
env/
|
|
26
|
+
ENV/
|
|
27
|
+
|
|
28
|
+
# Django
|
|
29
|
+
*.sqlite3
|
|
30
|
+
*.log
|
|
31
|
+
local_settings.py
|
|
32
|
+
db.sqlite3
|
|
33
|
+
staticfiles/
|
|
34
|
+
media/
|
|
35
|
+
|
|
36
|
+
# Distribution / packaging
|
|
37
|
+
.Python
|
|
38
|
+
build/
|
|
39
|
+
dist/
|
|
40
|
+
.eggs/
|
|
41
|
+
*.egg-info/
|
|
42
|
+
|
|
43
|
+
# Testing
|
|
44
|
+
.tox/
|
|
45
|
+
.coverage
|
|
46
|
+
.coverage.*
|
|
47
|
+
htmlcov/
|
|
48
|
+
.pytest_cache/
|
|
49
|
+
*.cover
|
|
50
|
+
coverage.xml
|
|
51
|
+
nosetests.xml
|
|
52
|
+
|
|
53
|
+
# IDE
|
|
54
|
+
.idea/
|
|
55
|
+
.vscode/
|
|
56
|
+
*.swp
|
|
57
|
+
*.swo
|
|
58
|
+
*.DS_Store
|
|
59
|
+
.DS_Store
|
|
60
|
+
|
|
61
|
+
# Jupyter
|
|
62
|
+
.ipynb_checkpoints
|
|
63
|
+
|
|
64
|
+
# mypy
|
|
65
|
+
.mypy_cache/
|
|
66
|
+
.dmypy.json
|
|
67
|
+
dmypy.json
|
|
68
|
+
|
|
69
|
+
# Temporary
|
|
70
|
+
*.tmp
|
|
71
|
+
*.bak
|
|
72
|
+
context/
|
|
73
|
+
|
|
74
|
+
# Local Django showcase app (not part of the published package)
|
|
75
|
+
component_showcase/
|
|
76
|
+
components/
|
|
77
|
+
manage.py
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to djust-components will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.3.0] - 2026-02-19
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Component Class API** — Python-first alternative to template tags for programmatic use in LiveViews
|
|
12
|
+
- `Badge` — status/priority badge with factory methods `Badge.status()` and `Badge.priority()` for auto-coloring
|
|
13
|
+
- `StatusDot` — animated dot indicator with built-in status → variant/animation mappings
|
|
14
|
+
- `Button` — action button with variants, icons, loading state, and djust event wiring
|
|
15
|
+
- `Card` — content container with image/header/content/footer sections and hover/click support
|
|
16
|
+
- `Markdown` — renders Markdown to sanitized HTML; strips dangerous tags and `on*` event attributes; wraps in `<div class="dj-prose">`
|
|
17
|
+
- `markdown>=3.0` added as a dependency (required by `Markdown` component)
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
- `Markdown`: post-render sanitization instead of pre-escaping source text, fixing code spans containing `&`, `<`, `>`
|
|
21
|
+
|
|
22
|
+
## [0.2.0] - 2026-02-17
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
- **djust-theming Integration**
|
|
26
|
+
- All components now use djust-theming CSS variables for automatic theme adaptation
|
|
27
|
+
- Components automatically adapt to theme preset (Default, Shadcn, Blue, Green, Purple, Orange, Rose)
|
|
28
|
+
- Components automatically adapt to theme mode (light/dark/system)
|
|
29
|
+
- Support for all 31 theme color tokens (including new info, link, code, selection colors)
|
|
30
|
+
|
|
31
|
+
- **Design Tokens**
|
|
32
|
+
- Spacing: Uses djust-theming spacing scale (`--space-1` to `--space-24`)
|
|
33
|
+
- Typography: Uses djust-theming type scale (`--text-xs` to `--text-4xl`, line heights, font weights)
|
|
34
|
+
- Radius: Uses djust-theming radius tokens (`--radius-sm` to `--radius-full`)
|
|
35
|
+
- Transitions: Uses djust-theming timing tokens (`--duration-fast`, `--duration-normal`)
|
|
36
|
+
- Shadows: Uses djust-theming shadow tokens (`--shadow-sm`, `--shadow-md`, `--shadow-lg`)
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
- **Complete CSS Refactor**
|
|
40
|
+
- Replaced all hardcoded colors with theme CSS variables
|
|
41
|
+
- Replaced all hardcoded spacing/sizing with design tokens
|
|
42
|
+
- Replaced all hardcoded border radius values with design tokens
|
|
43
|
+
- Replaced all hardcoded transition timings with design tokens
|
|
44
|
+
- Replaced all hardcoded box-shadow values with design tokens
|
|
45
|
+
|
|
46
|
+
- **Dependencies**
|
|
47
|
+
- Added `djust-theming>=1.1.0` as a required dependency
|
|
48
|
+
|
|
49
|
+
### Removed
|
|
50
|
+
- **Legacy CSS Custom Properties**
|
|
51
|
+
- Removed `--dj-primary`, `--dj-success`, `--dj-warning`, `--dj-danger`, `--dj-info`
|
|
52
|
+
- Removed `--dj-text`, `--dj-bg`, `--dj-bg-subtle`, `--dj-border`, `--dj-radius`
|
|
53
|
+
- All replaced with djust-theming variables
|
|
54
|
+
|
|
55
|
+
### Migration Guide from 0.1.0 to 0.2.0
|
|
56
|
+
|
|
57
|
+
If you were using custom CSS variables to style components, you need to migrate to djust-theming:
|
|
58
|
+
|
|
59
|
+
1. Install djust-theming: `pip install djust-theming`
|
|
60
|
+
2. Add `djust_theming` to `INSTALLED_APPS`
|
|
61
|
+
3. Replace component CSS include with:
|
|
62
|
+
```html
|
|
63
|
+
{% load djust_theming %}
|
|
64
|
+
{% theme_head %}
|
|
65
|
+
<link rel="stylesheet" href="{% static 'djust_components/components.css' %}">
|
|
66
|
+
```
|
|
67
|
+
4. Remove custom CSS variable overrides (components now use theme variables)
|
|
68
|
+
5. Use djust-theming's preset system for custom themes
|
|
69
|
+
|
|
70
|
+
**Breaking Change:** Components no longer support custom CSS variables. Use djust-theming presets instead.
|
|
71
|
+
|
|
72
|
+
## [0.1.0] - 2026-02-04
|
|
73
|
+
|
|
74
|
+
### Added
|
|
75
|
+
- Initial release with 12 pre-built components
|
|
76
|
+
- Modal, Tabs, Accordion, Dropdown, Toast, Tooltip, Progress, Badge, Card, DataTable, Pagination, Avatar
|
|
77
|
+
- Self-contained CSS with no JavaScript dependencies
|
|
78
|
+
- Full djust event system integration (`dj-click`, `dj-input`, etc.)
|
|
79
|
+
- Customizable via CSS custom properties
|
|
80
|
+
|
|
81
|
+
[0.3.0]: https://github.com/djust-org/djust-components/compare/v0.2.0...v0.3.0
|
|
82
|
+
[0.2.0]: https://github.com/djust-org/djust-components/compare/v0.1.0...v0.2.0
|
|
83
|
+
[0.1.0]: https://github.com/djust-org/djust-components/releases/tag/v0.1.0
|