bluefox-components 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.
- bluefox_components/__init__.py +5 -0
- bluefox_components/setup.py +34 -0
- bluefox_components/static/bfx/bluefox.css +105 -0
- bluefox_components/templates/bfx/base.html +50 -0
- bluefox_components-0.2.0.dist-info/METADATA +14 -0
- bluefox_components-0.2.0.dist-info/RECORD +7 -0
- bluefox_components-0.2.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""Register bluefox-components templates and static files with a FastAPI app."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
from fastapi import FastAPI
|
|
6
|
+
from fastapi.staticfiles import StaticFiles
|
|
7
|
+
|
|
8
|
+
from bluefox_core.templates import add_template_directory
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
_PKG_DIR = Path(__file__).parent
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def setup_components(app: FastAPI) -> None:
|
|
15
|
+
"""Register the component templates and mount static assets.
|
|
16
|
+
|
|
17
|
+
Call this once during app startup::
|
|
18
|
+
|
|
19
|
+
from bluefox_components import setup_components
|
|
20
|
+
setup_components(app)
|
|
21
|
+
"""
|
|
22
|
+
# Register bfx/ templates so apps can {% extends "bfx/base.html" %}
|
|
23
|
+
add_template_directory(app, _PKG_DIR / "templates")
|
|
24
|
+
|
|
25
|
+
# Mount the CSS theme file at /static/bfx/ (guard against duplicate mounts)
|
|
26
|
+
already_mounted = any(
|
|
27
|
+
getattr(r, "path", None) == "/static/bfx" for r in app.routes
|
|
28
|
+
)
|
|
29
|
+
if not already_mounted:
|
|
30
|
+
app.mount(
|
|
31
|
+
"/static/bfx",
|
|
32
|
+
StaticFiles(directory=str(_PKG_DIR / "static" / "bfx")),
|
|
33
|
+
name="bfx-static",
|
|
34
|
+
)
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/* bluefox.css — Bluefox theme layer on top of Pico CSS
|
|
2
|
+
*
|
|
3
|
+
* Only Pico CSS variable overrides. No custom classes, no !important,
|
|
4
|
+
* no component-scoped styles. Just the Bluefox palette mapped to Pico tokens.
|
|
5
|
+
*
|
|
6
|
+
* Design tokens from THEME.md:
|
|
7
|
+
* --bg: #FAFAF8 --accent: #D4652A
|
|
8
|
+
* --bg-warm: #F5F4F0 --accent-light: #F0DED2
|
|
9
|
+
* --text: #1A1A18 --border: #E4E3DF
|
|
10
|
+
* --text-secondary: #6B6B64
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
:root {
|
|
14
|
+
/* ── Typography ─────────────────────────────────────── */
|
|
15
|
+
--pico-font-family: "DM Sans", system-ui, -apple-system, sans-serif;
|
|
16
|
+
--pico-font-size: 106.25%; /* 17px base */
|
|
17
|
+
--pico-line-height: 1.5;
|
|
18
|
+
--pico-font-weight: 400;
|
|
19
|
+
|
|
20
|
+
/* Monospace (code blocks, inline code) */
|
|
21
|
+
--pico-font-family-monospace: "JetBrains Mono", ui-monospace, "Cascadia Code", "Fira Code", monospace;
|
|
22
|
+
|
|
23
|
+
/* ── Brand colors ───────────────────────────────────── */
|
|
24
|
+
--pico-primary: #D4652A;
|
|
25
|
+
--pico-primary-hover: #BF5520;
|
|
26
|
+
--pico-primary-focus: rgba(212, 101, 42, 0.25);
|
|
27
|
+
--pico-primary-inverse: #fff;
|
|
28
|
+
|
|
29
|
+
--pico-primary-background: #D4652A;
|
|
30
|
+
--pico-primary-border: #D4652A;
|
|
31
|
+
--pico-primary-hover-background: #BF5520;
|
|
32
|
+
--pico-primary-hover-border: #BF5520;
|
|
33
|
+
|
|
34
|
+
/* ── Background & surface ───────────────────────────── */
|
|
35
|
+
--pico-background-color: #FAFAF8;
|
|
36
|
+
--pico-card-background-color: #fff;
|
|
37
|
+
--pico-card-sectioning-background-color: #F5F4F0;
|
|
38
|
+
|
|
39
|
+
/* ── Text ────────────────────────────────────────────── */
|
|
40
|
+
--pico-color: #1A1A18;
|
|
41
|
+
--pico-muted-color: #6B6B64;
|
|
42
|
+
--pico-h1-color: #1A1A18;
|
|
43
|
+
--pico-h2-color: #1A1A18;
|
|
44
|
+
--pico-h3-color: #1A1A18;
|
|
45
|
+
--pico-h4-color: #1A1A18;
|
|
46
|
+
--pico-h5-color: #6B6B64;
|
|
47
|
+
--pico-h6-color: #6B6B64;
|
|
48
|
+
|
|
49
|
+
/* ── Borders ─────────────────────────────────────────── */
|
|
50
|
+
--pico-muted-border-color: #E4E3DF;
|
|
51
|
+
--pico-card-border-color: #E4E3DF;
|
|
52
|
+
--pico-table-border-color: #E4E3DF;
|
|
53
|
+
|
|
54
|
+
/* ── Border radius ───────────────────────────────────── */
|
|
55
|
+
--pico-border-radius: 0.375rem;
|
|
56
|
+
|
|
57
|
+
/* ── Code blocks ─────────────────────────────────────── */
|
|
58
|
+
--pico-code-background-color: #1A1A18;
|
|
59
|
+
--pico-code-color: #E8E6E1;
|
|
60
|
+
|
|
61
|
+
/* ── Form elements ───────────────────────────────────── */
|
|
62
|
+
--pico-form-element-background-color: #fff;
|
|
63
|
+
--pico-form-element-border-color: #E4E3DF;
|
|
64
|
+
--pico-form-element-active-border-color: #D4652A;
|
|
65
|
+
--pico-form-element-focus-color: rgba(212, 101, 42, 0.25);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* ── Dark mode (auto via OS preference) ────────────────── */
|
|
69
|
+
@media (prefers-color-scheme: dark) {
|
|
70
|
+
:root {
|
|
71
|
+
--pico-primary: #E88B5A;
|
|
72
|
+
--pico-primary-hover: #F0A474;
|
|
73
|
+
--pico-primary-focus: rgba(232, 139, 90, 0.25);
|
|
74
|
+
|
|
75
|
+
--pico-primary-background: #D4652A;
|
|
76
|
+
--pico-primary-border: #E88B5A;
|
|
77
|
+
--pico-primary-hover-background: #BF5520;
|
|
78
|
+
--pico-primary-hover-border: #F0A474;
|
|
79
|
+
|
|
80
|
+
--pico-background-color: #141413;
|
|
81
|
+
--pico-card-background-color: #1A1A18;
|
|
82
|
+
--pico-card-sectioning-background-color: #222220;
|
|
83
|
+
|
|
84
|
+
--pico-color: #E8E6E1;
|
|
85
|
+
--pico-muted-color: #8B8B84;
|
|
86
|
+
--pico-h1-color: #E8E6E1;
|
|
87
|
+
--pico-h2-color: #E8E6E1;
|
|
88
|
+
--pico-h3-color: #E8E6E1;
|
|
89
|
+
--pico-h4-color: #E8E6E1;
|
|
90
|
+
--pico-h5-color: #8B8B84;
|
|
91
|
+
--pico-h6-color: #8B8B84;
|
|
92
|
+
|
|
93
|
+
--pico-muted-border-color: #333330;
|
|
94
|
+
--pico-card-border-color: #333330;
|
|
95
|
+
--pico-table-border-color: #333330;
|
|
96
|
+
|
|
97
|
+
--pico-code-background-color: #0E0E0D;
|
|
98
|
+
--pico-code-color: #E8E6E1;
|
|
99
|
+
|
|
100
|
+
--pico-form-element-background-color: #1A1A18;
|
|
101
|
+
--pico-form-element-border-color: #333330;
|
|
102
|
+
--pico-form-element-active-border-color: #E88B5A;
|
|
103
|
+
--pico-form-element-focus-color: rgba(232, 139, 90, 0.25);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<meta name="color-scheme" content="light dark">
|
|
7
|
+
<title>{% block title %}{{ title | default("Bluefox") }}{% endblock %}</title>
|
|
8
|
+
|
|
9
|
+
{# Pico CSS #}
|
|
10
|
+
<link rel="stylesheet"
|
|
11
|
+
href="https://cdn.jsdelivr.net/npm/@picocss/pico@2.0.6/css/pico.min.css"
|
|
12
|
+
integrity="sha384-7P0NVe9LPDbUCAF+fH2R8Egwz1uqNH83Ns/bfJY0fN2XCDBMUI2S9gGzIOIRBKsA"
|
|
13
|
+
crossorigin="anonymous">
|
|
14
|
+
|
|
15
|
+
{# Bluefox theme overrides #}
|
|
16
|
+
<link rel="stylesheet" href="/static/bfx/bluefox.css">
|
|
17
|
+
|
|
18
|
+
{# Google Fonts — DM Sans + JetBrains Mono #}
|
|
19
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
20
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
21
|
+
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;1,300&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
|
22
|
+
|
|
23
|
+
{% block head %}{% endblock %}
|
|
24
|
+
</head>
|
|
25
|
+
<body>
|
|
26
|
+
|
|
27
|
+
{% block nav %}
|
|
28
|
+
<nav class="container">
|
|
29
|
+
<ul>
|
|
30
|
+
<li><strong>{% block brand %}Bluefox{% endblock %}</strong></li>
|
|
31
|
+
</ul>
|
|
32
|
+
<ul>
|
|
33
|
+
{% block nav_items %}{% endblock %}
|
|
34
|
+
</ul>
|
|
35
|
+
</nav>
|
|
36
|
+
{% endblock %}
|
|
37
|
+
|
|
38
|
+
<main class="container">
|
|
39
|
+
{% block content %}{% endblock %}
|
|
40
|
+
</main>
|
|
41
|
+
|
|
42
|
+
<footer class="container">
|
|
43
|
+
{% block footer %}
|
|
44
|
+
<small>Bluefox Stack · <a href="https://bluefox.software">bluefox.software</a></small>
|
|
45
|
+
{% endblock %}
|
|
46
|
+
</footer>
|
|
47
|
+
|
|
48
|
+
{% block scripts %}{% endblock %}
|
|
49
|
+
</body>
|
|
50
|
+
</html>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bluefox-components
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Jinja2 macro components and Pico CSS theming for the Bluefox Stack.
|
|
5
|
+
Project-URL: Homepage, https://bluefox-components.bluefox.software
|
|
6
|
+
Project-URL: Repository, https://github.com/blue-fox-software/bluefox-components
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Requires-Python: >=3.12
|
|
9
|
+
Requires-Dist: bluefox-core>=0.4.0
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
|
|
12
|
+
# bluefox-components
|
|
13
|
+
|
|
14
|
+
Jinja2 macro components and Pico CSS theming for the Bluefox Stack.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
bluefox_components/__init__.py,sha256=ESb-VODPADBFaieSLKw3RCFTaNvpqnDSN3eea-dkRiU,93
|
|
2
|
+
bluefox_components/setup.py,sha256=lVv4lbs4i3i4WwwpeJPnJkf9QJP2w-jDxUZUBBrY7pw,1017
|
|
3
|
+
bluefox_components/static/bfx/bluefox.css,sha256=XS-O4qFS4qCKye24gldACiab1hzauwuYogZkFFoUv68,4154
|
|
4
|
+
bluefox_components/templates/bfx/base.html,sha256=I87e7_UbMQLU1uJkr0Q1we-8VJYOcBV0a3Dsx1-69qE,1620
|
|
5
|
+
bluefox_components-0.2.0.dist-info/METADATA,sha256=FMVU0eNV1WESuAtRGCdGh6DAeV5TcdVGQ3CfMYF4MxI,501
|
|
6
|
+
bluefox_components-0.2.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
7
|
+
bluefox_components-0.2.0.dist-info/RECORD,,
|