faststrap 0.2.2__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.
- faststrap-0.2.2/.gitignore +60 -0
- faststrap-0.2.2/BUILDING_COMPONENTS.md +347 -0
- faststrap-0.2.2/CHANGE_LOG.md +250 -0
- faststrap-0.2.2/COMPONENT_SPEC.md +777 -0
- faststrap-0.2.2/CONTRIBUTING.md +422 -0
- faststrap-0.2.2/LICENSE +21 -0
- faststrap-0.2.2/PKG-INFO +427 -0
- faststrap-0.2.2/README.md +392 -0
- faststrap-0.2.2/ROADMAP.md +373 -0
- faststrap-0.2.2/examples/01_hello_button/README.md +12 -0
- faststrap-0.2.2/examples/01_hello_button/app.py +29 -0
- faststrap-0.2.2/examples/01_hello_button/test_all.py +90 -0
- faststrap-0.2.2/examples/02_phase_1_complete/app.py +139 -0
- faststrap-0.2.2/examples/03_examples/app.py +173 -0
- faststrap-0.2.2/examples/04_example/app.py +777 -0
- faststrap-0.2.2/examples/demo.py +0 -0
- faststrap-0.2.2/pyproject.toml +166 -0
- faststrap-0.2.2/src/faststrap/__init__.py +61 -0
- faststrap-0.2.2/src/faststrap/components/__init__.py +37 -0
- faststrap-0.2.2/src/faststrap/components/display/__init__.py +6 -0
- faststrap-0.2.2/src/faststrap/components/display/badge.py +82 -0
- faststrap-0.2.2/src/faststrap/components/display/card.py +140 -0
- faststrap-0.2.2/src/faststrap/components/feedback/__init__.py +7 -0
- faststrap-0.2.2/src/faststrap/components/feedback/alert.py +112 -0
- faststrap-0.2.2/src/faststrap/components/feedback/modal.py +167 -0
- faststrap-0.2.2/src/faststrap/components/feedback/toast.py +205 -0
- faststrap-0.2.2/src/faststrap/components/forms/__init__.py +6 -0
- faststrap-0.2.2/src/faststrap/components/forms/button.py +88 -0
- faststrap-0.2.2/src/faststrap/components/forms/buttongroup.py +143 -0
- faststrap-0.2.2/src/faststrap/components/layout/__init__.py +5 -0
- faststrap-0.2.2/src/faststrap/components/layout/grid.py +226 -0
- faststrap-0.2.2/src/faststrap/components/navigation/__init__.py +6 -0
- faststrap-0.2.2/src/faststrap/components/navigation/drawer.py +136 -0
- faststrap-0.2.2/src/faststrap/components/navigation/navbar.py +197 -0
- faststrap-0.2.2/src/faststrap/core/__init__.py +6 -0
- faststrap-0.2.2/src/faststrap/core/assets.py +128 -0
- faststrap-0.2.2/src/faststrap/core/base.py +67 -0
- faststrap-0.2.2/src/faststrap/core/registry.py +109 -0
- faststrap-0.2.2/src/faststrap/py.typed +0 -0
- faststrap-0.2.2/src/faststrap/templates/component_template.py +75 -0
- faststrap-0.2.2/src/faststrap/templates/test_file_template.py +67 -0
- faststrap-0.2.2/src/faststrap/utils/__init__.py +3 -0
- faststrap-0.2.2/src/faststrap/utils/attrs.py +35 -0
- faststrap-0.2.2/src/faststrap/utils/icons.py +22 -0
- faststrap-0.2.2/static/css/bootstrap-icons.min.css +5 -0
- faststrap-0.2.2/static/css/bootstrap.min.css +12 -0
- faststrap-0.2.2/static/css/fonts/bootstrap-icons.woff +0 -0
- faststrap-0.2.2/static/css/fonts/bootstrap-icons.woff2 +0 -0
- faststrap-0.2.2/static/js/bootstrap.bundle.min.js +7 -0
- faststrap-0.2.2/tests/__init__.py +0 -0
- faststrap-0.2.2/tests/conftest.py +45 -0
- faststrap-0.2.2/tests/test_components/__init__.py +0 -0
- faststrap-0.2.2/tests/test_components/test_alert.py +122 -0
- faststrap-0.2.2/tests/test_components/test_badge.py +80 -0
- faststrap-0.2.2/tests/test_components/test_button.py +101 -0
- faststrap-0.2.2/tests/test_components/test_buttongroup.py +98 -0
- faststrap-0.2.2/tests/test_components/test_card.py +151 -0
- faststrap-0.2.2/tests/test_components/test_drawer.py +125 -0
- faststrap-0.2.2/tests/test_components/test_grid.py +143 -0
- faststrap-0.2.2/tests/test_components/test_modal.py +149 -0
- faststrap-0.2.2/tests/test_components/test_navbar.py +151 -0
- faststrap-0.2.2/tests/test_components/test_toast.py +137 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
build/
|
|
8
|
+
develop-eggs/
|
|
9
|
+
dist/
|
|
10
|
+
downloads/
|
|
11
|
+
eggs/
|
|
12
|
+
.eggs/
|
|
13
|
+
lib/
|
|
14
|
+
lib64/
|
|
15
|
+
parts/
|
|
16
|
+
sdist/
|
|
17
|
+
var/
|
|
18
|
+
wheels/
|
|
19
|
+
*.egg-info/
|
|
20
|
+
.installed.cfg
|
|
21
|
+
*.egg
|
|
22
|
+
MANIFEST
|
|
23
|
+
.sesskey
|
|
24
|
+
|
|
25
|
+
# Virtual environments
|
|
26
|
+
.env
|
|
27
|
+
.venv
|
|
28
|
+
env/
|
|
29
|
+
venv/
|
|
30
|
+
ENV/
|
|
31
|
+
env.bak/
|
|
32
|
+
venv.bak/
|
|
33
|
+
|
|
34
|
+
# Testing
|
|
35
|
+
.pytest_cache/
|
|
36
|
+
.coverage
|
|
37
|
+
.coverage.*
|
|
38
|
+
htmlcov/
|
|
39
|
+
.tox/
|
|
40
|
+
.hypothesis/
|
|
41
|
+
|
|
42
|
+
# IDE
|
|
43
|
+
.vscode/
|
|
44
|
+
.idea/
|
|
45
|
+
*.swp
|
|
46
|
+
*.swo
|
|
47
|
+
*~
|
|
48
|
+
.DS_Store
|
|
49
|
+
|
|
50
|
+
# MyPy
|
|
51
|
+
.mypy_cache/
|
|
52
|
+
.dmypy.json
|
|
53
|
+
dmypy.json
|
|
54
|
+
|
|
55
|
+
# Ruff
|
|
56
|
+
.ruff_cache/
|
|
57
|
+
|
|
58
|
+
# Distribution
|
|
59
|
+
*.tar.gz
|
|
60
|
+
*.whl
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
# Building FastStrap Components - Complete Guide
|
|
2
|
+
|
|
3
|
+
**For contributors, LLMs, and developers building new components.**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🎯 Quick Start (30 seconds)
|
|
8
|
+
|
|
9
|
+
1. Copy an existing component from `src/faststrap/components/` as template
|
|
10
|
+
2. Follow the patterns below
|
|
11
|
+
3. Add tests to `tests/test_components/`
|
|
12
|
+
4. Submit PR
|
|
13
|
+
|
|
14
|
+
**Best templates to copy:**
|
|
15
|
+
- Simple component: `badge.py`
|
|
16
|
+
- Complex component: `card.py`
|
|
17
|
+
- Interactive (Bootstrap JS): `modal.py`
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 📋 Component Checklist
|
|
22
|
+
|
|
23
|
+
Before submitting, ensure:
|
|
24
|
+
|
|
25
|
+
- [ ] File in correct directory (`forms/`, `display/`, `feedback/`, `navigation/`, `layout/`)
|
|
26
|
+
- [ ] Function uses Python 3.10+ type hints (`str | None` not `Optional[str]`)
|
|
27
|
+
- [ ] Includes `_convert_attrs()` helper for HTMX support
|
|
28
|
+
- [ ] Uses `merge_classes()` from `core.base` for CSS
|
|
29
|
+
- [ ] Comprehensive docstring with examples
|
|
30
|
+
- [ ] Test file with 8-15 tests
|
|
31
|
+
- [ ] Exported in `__init__.py` files
|
|
32
|
+
- [ ] Works with `to_xml()` (not just `str()`)
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 🏗️ Component Structure Template
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
"""Bootstrap [ComponentName] for [purpose]."""
|
|
40
|
+
|
|
41
|
+
from typing import Any, Literal
|
|
42
|
+
|
|
43
|
+
from fasthtml.common import Div # Or appropriate FT type
|
|
44
|
+
|
|
45
|
+
from ...core.base import merge_classes
|
|
46
|
+
from ...utils.attrs import convert_attrs
|
|
47
|
+
|
|
48
|
+
# Type aliases
|
|
49
|
+
VariantType = Literal["primary", "secondary", "success", "danger", "warning", "info", "light", "dark"]
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def ComponentName(
|
|
53
|
+
*children: Any,
|
|
54
|
+
variant: VariantType = "primary",
|
|
55
|
+
**kwargs: Any,
|
|
56
|
+
) -> Div:
|
|
57
|
+
"""Bootstrap [ComponentName] component.
|
|
58
|
+
|
|
59
|
+
Args:
|
|
60
|
+
*children: Component content
|
|
61
|
+
variant: Bootstrap color variant
|
|
62
|
+
**kwargs: Additional HTML attributes (cls, id, hx-*, data-*, etc.)
|
|
63
|
+
|
|
64
|
+
Returns:
|
|
65
|
+
FastHTML Div element
|
|
66
|
+
|
|
67
|
+
Example:
|
|
68
|
+
Basic:
|
|
69
|
+
>>> ComponentName("Content", variant="success")
|
|
70
|
+
|
|
71
|
+
With HTMX:
|
|
72
|
+
>>> ComponentName("Load", hx_get="/api", hx_target="#result")
|
|
73
|
+
|
|
74
|
+
Custom styling:
|
|
75
|
+
>>> ComponentName("Custom", cls="mt-3 shadow")
|
|
76
|
+
|
|
77
|
+
See Also:
|
|
78
|
+
Bootstrap docs: https://getbootstrap.com/docs/5.3/components/[name]/
|
|
79
|
+
"""
|
|
80
|
+
# Build classes
|
|
81
|
+
classes = ["component-base", f"component-{variant}"]
|
|
82
|
+
|
|
83
|
+
# Merge with user classes
|
|
84
|
+
user_cls = kwargs.pop("cls", "")
|
|
85
|
+
all_classes = merge_classes(" ".join(classes), user_cls)
|
|
86
|
+
|
|
87
|
+
# Build attributes
|
|
88
|
+
attrs: dict[str, Any] = {"cls": all_classes}
|
|
89
|
+
attrs.update(convert_attrs(kwargs))
|
|
90
|
+
|
|
91
|
+
return Div(*children, **attrs)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## 🔧 Critical Patterns
|
|
97
|
+
|
|
98
|
+
### 1. **Type Hints (Python 3.10+)**
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
# ✅ CORRECT
|
|
102
|
+
from typing import Any, Literal
|
|
103
|
+
|
|
104
|
+
def Component(
|
|
105
|
+
*children: Any,
|
|
106
|
+
size: Literal["sm", "lg"] | None = None,
|
|
107
|
+
**kwargs: Any
|
|
108
|
+
) -> Div:
|
|
109
|
+
...
|
|
110
|
+
|
|
111
|
+
# ❌ WRONG (old style)
|
|
112
|
+
from typing import Optional, Union
|
|
113
|
+
|
|
114
|
+
def Component(
|
|
115
|
+
size: Optional[Union[str, None]] = None
|
|
116
|
+
) -> Div:
|
|
117
|
+
...
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### 2. **Class Merging**
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
from ...core.base import merge_classes
|
|
124
|
+
|
|
125
|
+
# Always merge user classes
|
|
126
|
+
user_cls = kwargs.pop("cls", "")
|
|
127
|
+
all_classes = merge_classes("btn btn-primary", user_cls)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 3. **HTMX Attribute Conversion**
|
|
131
|
+
|
|
132
|
+
```python
|
|
133
|
+
# Always include _convert_attrs() function
|
|
134
|
+
attrs.update(_convert_attrs(kwargs))
|
|
135
|
+
|
|
136
|
+
# This allows:
|
|
137
|
+
Button("Save", hx_post="/save", hx_target="#result")
|
|
138
|
+
# To become: <button hx-post="/save" hx-target="#result">Save</button>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### 4. **Bootstrap Variants**
|
|
142
|
+
|
|
143
|
+
```python
|
|
144
|
+
# Standard variants
|
|
145
|
+
VariantType = Literal[
|
|
146
|
+
"primary", "secondary", "success", "danger",
|
|
147
|
+
"warning", "info", "light", "dark"
|
|
148
|
+
]
|
|
149
|
+
|
|
150
|
+
# Apply as:
|
|
151
|
+
classes.append(f"btn-{variant}") # OR
|
|
152
|
+
classes.append(f"text-bg-{variant}") # For colored backgrounds
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### 5. **Component IDs (Special Handling)**
|
|
156
|
+
|
|
157
|
+
If your component requires an `id` (like Modal, Drawer):
|
|
158
|
+
|
|
159
|
+
```python
|
|
160
|
+
def Modal(
|
|
161
|
+
*children: Any,
|
|
162
|
+
modal_id: str, # ← Use custom param name, NOT "id"
|
|
163
|
+
**kwargs: Any
|
|
164
|
+
) -> Div:
|
|
165
|
+
# Build component first
|
|
166
|
+
result = Div(*parts, **attrs)
|
|
167
|
+
|
|
168
|
+
# Set id AFTER creation (bypasses FastHTML quirk)
|
|
169
|
+
result.attrs['id'] = modal_id
|
|
170
|
+
|
|
171
|
+
return result
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Why:** FastHTML's `str()` has a bug with `id` parameter. Use `modal_id`/`drawer_id`/etc.
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## 🧪 Test File Template
|
|
179
|
+
|
|
180
|
+
```python
|
|
181
|
+
"""Tests for ComponentName."""
|
|
182
|
+
|
|
183
|
+
from fasthtml.common import to_xml # ← IMPORTANT: Use to_xml(), not str()
|
|
184
|
+
|
|
185
|
+
from faststrap.components.category import ComponentName
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
def test_component_basic():
|
|
189
|
+
"""Component renders correctly."""
|
|
190
|
+
comp = ComponentName("Test")
|
|
191
|
+
html = to_xml(comp) # ← Use to_xml()
|
|
192
|
+
|
|
193
|
+
assert "Test" in html
|
|
194
|
+
assert "component-base" in html
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
def test_component_variants():
|
|
198
|
+
"""Component supports all variants."""
|
|
199
|
+
variants = ["primary", "secondary", "success", "danger"]
|
|
200
|
+
|
|
201
|
+
for variant in variants:
|
|
202
|
+
comp = ComponentName("Test", variant=variant)
|
|
203
|
+
html = to_xml(comp)
|
|
204
|
+
assert f"component-{variant}" in html
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
def test_component_custom_classes():
|
|
208
|
+
"""Component merges custom classes."""
|
|
209
|
+
comp = ComponentName("Test", cls="custom-class mt-3")
|
|
210
|
+
html = to_xml(comp)
|
|
211
|
+
|
|
212
|
+
assert "component-base" in html
|
|
213
|
+
assert "custom-class" in html
|
|
214
|
+
assert "mt-3" in html
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
def test_component_htmx():
|
|
218
|
+
"""Component supports HTMX."""
|
|
219
|
+
comp = ComponentName("Load", hx_get="/api", hx_target="#result")
|
|
220
|
+
html = to_xml(comp)
|
|
221
|
+
|
|
222
|
+
assert 'hx-get="/api"' in html
|
|
223
|
+
assert 'hx-target="#result"' in html
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
def test_component_data_attributes():
|
|
227
|
+
"""Component handles data attributes."""
|
|
228
|
+
comp = ComponentName("Test", data_id="123", data_type="info")
|
|
229
|
+
html = to_xml(comp)
|
|
230
|
+
|
|
231
|
+
assert 'data-id="123"' in html
|
|
232
|
+
assert 'data-type="info"' in html
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
**CRITICAL:** Always use `to_xml(component)`, **never** `str(component)` due to FastHTML bug.
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## 📁 File Structure
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
src/faststrap/components/
|
|
243
|
+
├── display/ # Visual elements (Badge, Card, Avatar)
|
|
244
|
+
│ ├── __init__.py
|
|
245
|
+
│ └── component.py
|
|
246
|
+
├── feedback/ # User feedback (Alert, Toast, Modal)
|
|
247
|
+
├── forms/ # Form inputs (Button, Input, Select)
|
|
248
|
+
├── layout/ # Layout helpers (Container, Row, Col)
|
|
249
|
+
└── navigation/ # Navigation (Navbar, Tabs, Breadcrumb)
|
|
250
|
+
|
|
251
|
+
tests/test_components/
|
|
252
|
+
└── test_component.py
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## 🎨 Bootstrap Component Reference
|
|
258
|
+
|
|
259
|
+
When building a component, reference Bootstrap docs:
|
|
260
|
+
|
|
261
|
+
**Base URL:** `https://getbootstrap.com/docs/5.3/components/[name]/`
|
|
262
|
+
|
|
263
|
+
**Key classes to know:**
|
|
264
|
+
- Variants: `btn-primary`, `alert-success`, `text-bg-danger`
|
|
265
|
+
- Sizes: `btn-sm`, `btn-lg`, `form-control-lg`
|
|
266
|
+
- States: `disabled`, `active`, `show`, `fade`
|
|
267
|
+
- Utilities: `d-flex`, `gap-2`, `mt-3`, `shadow`
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## 🚀 Component Priority List
|
|
272
|
+
|
|
273
|
+
### **Phase 2 (Next):**
|
|
274
|
+
1. Tabs
|
|
275
|
+
2. Dropdown
|
|
276
|
+
3. Input (text, email, password)
|
|
277
|
+
4. Select
|
|
278
|
+
5. Breadcrumb
|
|
279
|
+
6. Pagination
|
|
280
|
+
7. Spinner
|
|
281
|
+
8. Progress
|
|
282
|
+
|
|
283
|
+
### **Phase 3:**
|
|
284
|
+
9. Table
|
|
285
|
+
10. Accordion
|
|
286
|
+
11. Carousel
|
|
287
|
+
12. ListGroup
|
|
288
|
+
13. Tooltip
|
|
289
|
+
14. Popover
|
|
290
|
+
15. Checkbox/Radio/Switch
|
|
291
|
+
16. Range
|
|
292
|
+
17. FileInput
|
|
293
|
+
18. FormValidation
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## 💡 Tips for LLMs
|
|
298
|
+
|
|
299
|
+
When asking an LLM to build a component:
|
|
300
|
+
|
|
301
|
+
**Good prompt:**
|
|
302
|
+
> "Build the Tabs component for FastStrap following BUILDING_COMPONENTS.md. Use Badge.py as template. Include nav-tabs, nav-pills, and content panes. Add 10 tests using to_xml(). Reference: https://getbootstrap.com/docs/5.3/components/navs-tabs/"
|
|
303
|
+
|
|
304
|
+
**Include:**
|
|
305
|
+
- This guide
|
|
306
|
+
- An existing component as reference
|
|
307
|
+
- Bootstrap docs link
|
|
308
|
+
- Specific test count
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## 🤝 Getting Help
|
|
313
|
+
|
|
314
|
+
- **Questions:** Open GitHub Discussion
|
|
315
|
+
- **Bugs:** Open GitHub Issue
|
|
316
|
+
- **PRs:** We review within 48 hours
|
|
317
|
+
- **Discord:** Join FastHTML community
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## ✅ Submission Checklist
|
|
322
|
+
|
|
323
|
+
Before submitting PR:
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
# 1. Run tests
|
|
327
|
+
pytest tests/test_components/test_yourcomponent.py -v
|
|
328
|
+
|
|
329
|
+
# 2. Check coverage
|
|
330
|
+
pytest --cov=faststrap.components.category.yourcomponent
|
|
331
|
+
|
|
332
|
+
# 3. Type check
|
|
333
|
+
mypy src/faststrap/components/category/yourcomponent.py
|
|
334
|
+
|
|
335
|
+
# 4. Format
|
|
336
|
+
black src/faststrap/components/category/yourcomponent.py
|
|
337
|
+
ruff check src/faststrap/components/category/yourcomponent.py
|
|
338
|
+
|
|
339
|
+
# 5. Test example
|
|
340
|
+
python examples/demo_yourcomponent.py
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
All checks pass? Submit PR! 🎉
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
**Ready to build? Pick a component from Phase 2 and start coding!**
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to FastStrap 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.2.2] - 2025-12-09
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Interactive demo with HTMX theme toggle (no custom JavaScript)
|
|
12
|
+
- HTMX-powered toast trigger button
|
|
13
|
+
- Complete showcase of all 12 components with real interactions
|
|
14
|
+
|
|
15
|
+
### Improved
|
|
16
|
+
- Demo now proves components work without custom JavaScript
|
|
17
|
+
- Theme switching via HTMX POST request
|
|
18
|
+
- Toast notifications via HTMX GET request
|
|
19
|
+
- Better documentation of HTMX integration
|
|
20
|
+
|
|
21
|
+
### Technical
|
|
22
|
+
- Added `/toggle-theme` route for theme switching
|
|
23
|
+
- Added `/show-toast` route for toast notifications
|
|
24
|
+
- Minimal Bootstrap JS usage (only built-in features)
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## [0.2.0] - 2025-12-08
|
|
29
|
+
|
|
30
|
+
### 🎉 Phase 1 + Phase 2 Complete - Production Ready!
|
|
31
|
+
|
|
32
|
+
This is the first production-ready release of FastStrap, featuring 12 fully-tested Bootstrap 5 components for FastHTML.
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
|
|
36
|
+
#### **Components (12 total)**
|
|
37
|
+
|
|
38
|
+
**Forms (2):**
|
|
39
|
+
- `Button` - Fully-featured button with variants, sizes, icons, loading states, and outline styles
|
|
40
|
+
- `ButtonGroup` - Group buttons together with vertical/horizontal orientation and toolbar support
|
|
41
|
+
- `ButtonToolbar` - Organize multiple button groups
|
|
42
|
+
|
|
43
|
+
**Display (2):**
|
|
44
|
+
- `Badge` - Status indicators and labels with pill style option
|
|
45
|
+
- `Card` - Flexible content container with header, footer, image support, and overlay mode
|
|
46
|
+
|
|
47
|
+
**Feedback (3):**
|
|
48
|
+
- `Alert` - Contextual feedback messages with dismissible option and custom headings
|
|
49
|
+
- `Toast` - Auto-dismissing notifications with positioning via ToastContainer
|
|
50
|
+
- `Modal` - Dialog boxes with multiple sizes, centering, scrollable content, and fullscreen modes
|
|
51
|
+
|
|
52
|
+
**Layout (3):**
|
|
53
|
+
- `Container` - Fixed-width or fluid responsive containers
|
|
54
|
+
- `Row` - Grid rows with responsive column counts
|
|
55
|
+
- `Col` - Grid columns with responsive sizing and offsets
|
|
56
|
+
|
|
57
|
+
**Navigation (2):**
|
|
58
|
+
- `Navbar` - Responsive navigation bar with brand, collapse, and theming
|
|
59
|
+
- `Drawer` (Offcanvas) - Sliding side panels with multiple placements and backdrop control
|
|
60
|
+
|
|
61
|
+
**Utils (1):**
|
|
62
|
+
- `Icon` - Bootstrap Icons helper for easy icon integration
|
|
63
|
+
|
|
64
|
+
#### **Core Features**
|
|
65
|
+
- Asset management system with CDN and local file support
|
|
66
|
+
- Theme system supporting light, dark, and auto modes
|
|
67
|
+
- Base component classes and protocols for consistent API
|
|
68
|
+
- HTMX attribute conversion (`hx_get` → `hx-get`)
|
|
69
|
+
- Class merging utility for combining Bootstrap and custom classes
|
|
70
|
+
- Python 3.10+ type hints throughout
|
|
71
|
+
|
|
72
|
+
#### **Infrastructure**
|
|
73
|
+
- Complete test suite with 121 tests
|
|
74
|
+
- 84% code coverage
|
|
75
|
+
- Type checking with MyPy
|
|
76
|
+
- Code formatting with Black and Ruff
|
|
77
|
+
- GitHub Actions CI/CD pipeline
|
|
78
|
+
- Automatic PyPI publishing on release
|
|
79
|
+
|
|
80
|
+
#### **Documentation**
|
|
81
|
+
- Comprehensive README with quick start guide
|
|
82
|
+
- Component specification guide (COMPONENT_SPEC.md)
|
|
83
|
+
- Contributor guide (BUILDING_COMPONENTS.md)
|
|
84
|
+
- Development roadmap (ROADMAP.md)
|
|
85
|
+
- Example applications demonstrating all components
|
|
86
|
+
- Inline documentation with usage examples
|
|
87
|
+
|
|
88
|
+
### Fixed
|
|
89
|
+
- FastHTML `id` parameter handling using `modal_id`/`drawer_id` workaround
|
|
90
|
+
- Test suite updated to use `to_xml()` instead of `str()` (FastHTML 0.12.33 bug workaround)
|
|
91
|
+
- HTMX attribute conversion for proper HTML rendering
|
|
92
|
+
- Class merging to prevent duplicate Bootstrap classes
|
|
93
|
+
- Theme application via `htmlkw` for proper Bootstrap theming
|
|
94
|
+
|
|
95
|
+
### Technical Details
|
|
96
|
+
- **Python Version:** 3.10+
|
|
97
|
+
- **FastHTML Version:** 0.6.0+
|
|
98
|
+
- **Bootstrap Version:** 5.3.3
|
|
99
|
+
- **Bootstrap Icons Version:** 1.11.3
|
|
100
|
+
- **Type Checking:** MyPy strict mode
|
|
101
|
+
- **Linting:** Ruff + Black
|
|
102
|
+
- **Testing:** pytest with coverage reporting
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## [0.1.0] - 2025-12-05
|
|
107
|
+
|
|
108
|
+
### 🌟 Initial Development Release
|
|
109
|
+
|
|
110
|
+
First internal release establishing the foundation of FastStrap.
|
|
111
|
+
|
|
112
|
+
### Added
|
|
113
|
+
|
|
114
|
+
#### **Phase 1 Components (5):**
|
|
115
|
+
- `Button` - Basic button implementation with variants and sizes
|
|
116
|
+
- `Badge` - Simple badge component with color variants
|
|
117
|
+
- `Alert` - Alert component with dismissible functionality
|
|
118
|
+
- `Card` - Card container with header and footer
|
|
119
|
+
- Grid system (`Container`, `Row`, `Col`) - Responsive layout system
|
|
120
|
+
|
|
121
|
+
#### **Core Infrastructure**
|
|
122
|
+
- Project structure and build configuration
|
|
123
|
+
- Asset management for Bootstrap CSS/JS
|
|
124
|
+
- Base component classes and utilities
|
|
125
|
+
- Initial test framework setup
|
|
126
|
+
- GitHub repository initialization
|
|
127
|
+
|
|
128
|
+
### Development Notes
|
|
129
|
+
- Established component development patterns
|
|
130
|
+
- Created test templates and examples
|
|
131
|
+
- Set up CI/CD pipeline
|
|
132
|
+
- Documented contribution guidelines
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## [Unreleased]
|
|
137
|
+
|
|
138
|
+
### 🚀 Coming in v0.3.0 (Phase 2 - Q1 2025)
|
|
139
|
+
|
|
140
|
+
#### **Planned Components (8):**
|
|
141
|
+
- `Tabs` - Navigation tabs and pills
|
|
142
|
+
- `Dropdown` - Contextual dropdown menus
|
|
143
|
+
- `Input` - Text input controls with validation
|
|
144
|
+
- `Select` - Dropdown selection controls
|
|
145
|
+
- `Breadcrumb` - Navigation breadcrumbs
|
|
146
|
+
- `Pagination` - Page navigation controls
|
|
147
|
+
- `Spinner` - Loading indicators
|
|
148
|
+
- `Progress` - Progress bars with labels and animations
|
|
149
|
+
|
|
150
|
+
#### **Planned Features:**
|
|
151
|
+
- Enhanced form validation helpers
|
|
152
|
+
- Additional theme customization options
|
|
153
|
+
- Component playground documentation site
|
|
154
|
+
- Video tutorials and examples
|
|
155
|
+
- Performance optimizations
|
|
156
|
+
|
|
157
|
+
See [ROADMAP.md](ROADMAP.md) for complete future plans.
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Release Statistics
|
|
162
|
+
|
|
163
|
+
### v0.2.0 Metrics
|
|
164
|
+
- **Components:** 12
|
|
165
|
+
- **Tests:** 121
|
|
166
|
+
- **Coverage:** 84%
|
|
167
|
+
- **Lines of Code:** ~1,500
|
|
168
|
+
- **Contributors:** 2
|
|
169
|
+
- **Development Time:** 2 weeks
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Migration Guides
|
|
174
|
+
|
|
175
|
+
### Migrating from 0.1.0 to 0.2.0
|
|
176
|
+
|
|
177
|
+
**Breaking Changes:**
|
|
178
|
+
- None - First public release
|
|
179
|
+
|
|
180
|
+
**New Features:**
|
|
181
|
+
- 7 new components added (Toast, Modal, Drawer, Navbar, ButtonGroup)
|
|
182
|
+
- HTMX integration now fully supported
|
|
183
|
+
- Theme system implemented
|
|
184
|
+
- All components now production-ready
|
|
185
|
+
|
|
186
|
+
**Deprecations:**
|
|
187
|
+
- None
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Version History Summary
|
|
192
|
+
|
|
193
|
+
| Version | Release Date | Components | Tests | Coverage | Status |
|
|
194
|
+
|---------|--------------|------------|-------|----------|--------|
|
|
195
|
+
| 0.2.0 | 2025-12-08 | 12 | 121 | 84% | ✅ Stable |
|
|
196
|
+
| 0.1.0 | 2025-12-06 | 5 | 56 | 75% | 🔒 Internal |
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Contributing
|
|
201
|
+
|
|
202
|
+
We welcome contributions! See:
|
|
203
|
+
- [BUILDING_COMPONENTS.md](BUILDING_COMPONENTS.md) - How to build components
|
|
204
|
+
- [ROADMAP.md](ROADMAP.md) - What needs to be built
|
|
205
|
+
- [CONTRIBUTING.md](CONTRIBUTING.md) - Contribution guidelines
|
|
206
|
+
|
|
207
|
+
### Reporting Issues
|
|
208
|
+
Found a bug? [Open an issue](https://github.com/Evayoung/Faststrap/issues/new)
|
|
209
|
+
|
|
210
|
+
### Requesting Features
|
|
211
|
+
Want a new component? [Start a discussion](https://github.com/Evayoung/Faststrap/discussions/new)
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## Acknowledgments
|
|
216
|
+
|
|
217
|
+
### v0.2.0 Contributors
|
|
218
|
+
- **Olorundare Micheal** (@Evayoung) - Lead Developer
|
|
219
|
+
- **Claude (Anthropic)** - AI Development Assistant
|
|
220
|
+
- FastHTML Community - Testing and feedback
|
|
221
|
+
|
|
222
|
+
### Special Thanks
|
|
223
|
+
- **Jeremy Howard** - Creator of FastHTML
|
|
224
|
+
- **Answer.AI Team** - FastHTML development
|
|
225
|
+
- **Bootstrap Team** - Amazing CSS framework
|
|
226
|
+
- All early testers and contributors
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## License
|
|
231
|
+
|
|
232
|
+
FastStrap is released under the [MIT License](LICENSE).
|
|
233
|
+
|
|
234
|
+
Copyright (c) 2024 FastStrap Contributors
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Links
|
|
239
|
+
|
|
240
|
+
- **Homepage:** https://github.com/Evayoung/Faststrap
|
|
241
|
+
- **Documentation:** [BUILDING_COMPONENTS.md](BUILDING_COMPONENTS.md)
|
|
242
|
+
- **PyPI:** https://pypi.org/project/faststrap/
|
|
243
|
+
- **Issues:** https://github.com/Evayoung/Faststrap/issues
|
|
244
|
+
- **Discussions:** https://github.com/Evayoung/Faststrap/discussions
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
*For older releases and detailed commit history, see [GitHub Releases](https://github.com/Evayoung/Faststrap/releases).*
|
|
249
|
+
|
|
250
|
+
**Last Updated:** December 8, 2025
|