django-usp-theme 0.1.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 (27) hide show
  1. django_usp_theme-0.1.0/LICENSE +21 -0
  2. django_usp_theme-0.1.0/PKG-INFO +173 -0
  3. django_usp_theme-0.1.0/README.md +161 -0
  4. django_usp_theme-0.1.0/django_usp_theme/__init__.py +0 -0
  5. django_usp_theme-0.1.0/django_usp_theme/static/usp_theme/css/base.css +53 -0
  6. django_usp_theme-0.1.0/django_usp_theme/static/usp_theme/css/components.css +537 -0
  7. django_usp_theme-0.1.0/django_usp_theme/static/usp_theme/css/layout.css +196 -0
  8. django_usp_theme-0.1.0/django_usp_theme/static/usp_theme/css/tokens.css +86 -0
  9. django_usp_theme-0.1.0/django_usp_theme/static/usp_theme/css/usp_theme.css +9 -0
  10. django_usp_theme-0.1.0/django_usp_theme/static/usp_theme/css/utilities.css +121 -0
  11. django_usp_theme-0.1.0/django_usp_theme/static/usp_theme/img/bg-headtop.gif +0 -0
  12. django_usp_theme-0.1.0/django_usp_theme/static/usp_theme/img/usp-logo-f.png +0 -0
  13. django_usp_theme-0.1.0/django_usp_theme/templates/usp_theme/base.html +73 -0
  14. django_usp_theme-0.1.0/django_usp_theme/templates/usp_theme/components/alert_messages.html +12 -0
  15. django_usp_theme-0.1.0/django_usp_theme/templates/usp_theme/components/content_card.html +10 -0
  16. django_usp_theme-0.1.0/django_usp_theme/templates/usp_theme/components/empty_state.html +5 -0
  17. django_usp_theme-0.1.0/django_usp_theme/templates/usp_theme/components/loading_button.html +8 -0
  18. django_usp_theme-0.1.0/django_usp_theme/templates/usp_theme/components/page_header.html +6 -0
  19. django_usp_theme-0.1.0/django_usp_theme/templatetags/__init__.py +0 -0
  20. django_usp_theme-0.1.0/django_usp_theme/templatetags/usp_filters.py +24 -0
  21. django_usp_theme-0.1.0/django_usp_theme.egg-info/PKG-INFO +173 -0
  22. django_usp_theme-0.1.0/django_usp_theme.egg-info/SOURCES.txt +25 -0
  23. django_usp_theme-0.1.0/django_usp_theme.egg-info/dependency_links.txt +1 -0
  24. django_usp_theme-0.1.0/django_usp_theme.egg-info/requires.txt +1 -0
  25. django_usp_theme-0.1.0/django_usp_theme.egg-info/top_level.txt +1 -0
  26. django_usp_theme-0.1.0/pyproject.toml +24 -0
  27. django_usp_theme-0.1.0/setup.cfg +4 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 USP
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.
@@ -0,0 +1,173 @@
1
+ Metadata-Version: 2.4
2
+ Name: django-usp-theme
3
+ Version: 0.1.0
4
+ Summary: Tema visual USP para aplicações Django — design system, componentes e templates reutilizáveis.
5
+ License-Expression: MIT
6
+ Project-URL: Repository, https://github.com/usp/django-usp-theme
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: django>=4.2
11
+ Dynamic: license-file
12
+
13
+ # django-usp-theme
14
+
15
+ Tema visual USP para aplicações Django — design system, componentes e templates reutilizáveis.
16
+
17
+ ## Instalação
18
+
19
+ ```bash
20
+ pip install django-usp-theme
21
+ ```
22
+
23
+ ## Configuração
24
+
25
+ Adicione `django_usp_theme` ao `INSTALLED_APPS`:
26
+
27
+ ```python
28
+ INSTALLED_APPS = [
29
+ ...
30
+ 'django_usp_theme',
31
+ ]
32
+ ```
33
+
34
+ ## Uso
35
+
36
+ ### Template base
37
+
38
+ Estenda o template base em seus templates:
39
+
40
+ ```html
41
+ {% extends "usp_theme/base.html" %}
42
+ {% load static usp_filters %}
43
+
44
+ {% block title %}Minha Aplicação{% endblock %}
45
+
46
+ {% block header_logo %}
47
+ <a href="https://www.usp.br">
48
+ <img src="{% static 'usp_theme/img/usp-logo-f.png' %}" alt="Logo USP">
49
+ </a>
50
+ {% endblock %}
51
+
52
+ {% block brand %}Minha Aplicação{% endblock %}
53
+
54
+ {% block nav %}
55
+ <a class="nav-link" href="{% url 'home' %}">INÍCIO</a>
56
+ <a class="nav-link" href="{% url 'lista' %}">LISTA</a>
57
+ {% endblock %}
58
+
59
+ {% block nav_user %}
60
+ <div class="nav-user">
61
+ <span>{{ user.username }}</span>
62
+ <form action="{% url 'logout' %}" method="post" class="mb-0">
63
+ {% csrf_token %}
64
+ <button type="submit" class="btn btn-sm btn-outline-secondary">
65
+ <i class="bi bi-door-open"></i> Sair
66
+ </button>
67
+ </form>
68
+ </div>
69
+ {% endblock %}
70
+
71
+ {% block content %}
72
+ <!-- Conteúdo da página -->
73
+ {% endblock %}
74
+ ```
75
+
76
+ ### Componentes
77
+
78
+ #### Page Header
79
+
80
+ ```html
81
+ {% include "usp_theme/components/page_header.html" %}
82
+ ```
83
+
84
+ Ou com bloco:
85
+
86
+ ```html
87
+ {% include "usp_theme/components/page_header.html" with title="Minha Página" %}
88
+ ```
89
+
90
+ #### Content Card
91
+
92
+ ```html
93
+ {% include "usp_theme/components/content_card.html" with card_title="Título do Card" %}
94
+ ```
95
+
96
+ #### Empty State
97
+
98
+ ```html
99
+ {% include "usp_theme/components/empty_state.html" %}
100
+ ```
101
+
102
+ Ou customizado:
103
+
104
+ ```html
105
+ {% include "usp_theme/components/empty_state.html" with empty_icon="bi-folder" empty_text="Nenhum item encontrado." %}
106
+ ```
107
+
108
+ #### Loading Button
109
+
110
+ ```html
111
+ {% include "usp_theme/components/loading_button.html" with text="Salvar" icon="bi-check-lg" loading=False %}
112
+ ```
113
+
114
+ ### Template Tags
115
+
116
+ #### usp_moeda
117
+
118
+ Formata valor para formato brasileiro:
119
+
120
+ ```html
121
+ {% load usp_filters %}
122
+
123
+ {{ valor|usp_moeda }}
124
+ <!-- Saída: R$ 1.234,56 -->
125
+ ```
126
+
127
+ #### usp_filename
128
+
129
+ Extrai nome do arquivo de um caminho:
130
+
131
+ ```html
132
+ {% load usp_filters %}
133
+
134
+ {{ caminho|usp_filename }}
135
+ <!-- Saída: arquivo.docx -->
136
+ ```
137
+
138
+ ## CSS
139
+
140
+ O design system é composto por módulos CSS:
141
+
142
+ - `tokens.css` — Variáveis CSS (cores, tipografia, espaçamento)
143
+ - `base.css` — Reset e tipografia
144
+ - `components.css` — Botões, formulários, tabelas, cards, alertas
145
+ - `layout.css` — Header, navegação, container
146
+ - `utilities.css` — Espaçamento, impressão, acessibilidade
147
+
148
+ Para usar apenas parte do CSS:
149
+
150
+ ```html
151
+ <link href="{% static 'usp_theme/css/tokens.css' %}" rel="stylesheet">
152
+ <link href="{% static 'usp_theme/css/base.css' %}" rel="stylesheet">
153
+ ```
154
+
155
+ Ou usar o CSS unificado:
156
+
157
+ ```html
158
+ <link href="{% static 'usp_theme/css/usp_theme.css' %}" rel="stylesheet">
159
+ ```
160
+
161
+ ## Variáveis CSS
162
+
163
+ O tema utiliza CSS custom properties com prefixo `--usp-*`. Para customizar:
164
+
165
+ ```css
166
+ :root {
167
+ --usp-color-primary: #0066cc; /* Cor primária personalizada */
168
+ }
169
+ ```
170
+
171
+ ## Licença
172
+
173
+ MIT
@@ -0,0 +1,161 @@
1
+ # django-usp-theme
2
+
3
+ Tema visual USP para aplicações Django — design system, componentes e templates reutilizáveis.
4
+
5
+ ## Instalação
6
+
7
+ ```bash
8
+ pip install django-usp-theme
9
+ ```
10
+
11
+ ## Configuração
12
+
13
+ Adicione `django_usp_theme` ao `INSTALLED_APPS`:
14
+
15
+ ```python
16
+ INSTALLED_APPS = [
17
+ ...
18
+ 'django_usp_theme',
19
+ ]
20
+ ```
21
+
22
+ ## Uso
23
+
24
+ ### Template base
25
+
26
+ Estenda o template base em seus templates:
27
+
28
+ ```html
29
+ {% extends "usp_theme/base.html" %}
30
+ {% load static usp_filters %}
31
+
32
+ {% block title %}Minha Aplicação{% endblock %}
33
+
34
+ {% block header_logo %}
35
+ <a href="https://www.usp.br">
36
+ <img src="{% static 'usp_theme/img/usp-logo-f.png' %}" alt="Logo USP">
37
+ </a>
38
+ {% endblock %}
39
+
40
+ {% block brand %}Minha Aplicação{% endblock %}
41
+
42
+ {% block nav %}
43
+ <a class="nav-link" href="{% url 'home' %}">INÍCIO</a>
44
+ <a class="nav-link" href="{% url 'lista' %}">LISTA</a>
45
+ {% endblock %}
46
+
47
+ {% block nav_user %}
48
+ <div class="nav-user">
49
+ <span>{{ user.username }}</span>
50
+ <form action="{% url 'logout' %}" method="post" class="mb-0">
51
+ {% csrf_token %}
52
+ <button type="submit" class="btn btn-sm btn-outline-secondary">
53
+ <i class="bi bi-door-open"></i> Sair
54
+ </button>
55
+ </form>
56
+ </div>
57
+ {% endblock %}
58
+
59
+ {% block content %}
60
+ <!-- Conteúdo da página -->
61
+ {% endblock %}
62
+ ```
63
+
64
+ ### Componentes
65
+
66
+ #### Page Header
67
+
68
+ ```html
69
+ {% include "usp_theme/components/page_header.html" %}
70
+ ```
71
+
72
+ Ou com bloco:
73
+
74
+ ```html
75
+ {% include "usp_theme/components/page_header.html" with title="Minha Página" %}
76
+ ```
77
+
78
+ #### Content Card
79
+
80
+ ```html
81
+ {% include "usp_theme/components/content_card.html" with card_title="Título do Card" %}
82
+ ```
83
+
84
+ #### Empty State
85
+
86
+ ```html
87
+ {% include "usp_theme/components/empty_state.html" %}
88
+ ```
89
+
90
+ Ou customizado:
91
+
92
+ ```html
93
+ {% include "usp_theme/components/empty_state.html" with empty_icon="bi-folder" empty_text="Nenhum item encontrado." %}
94
+ ```
95
+
96
+ #### Loading Button
97
+
98
+ ```html
99
+ {% include "usp_theme/components/loading_button.html" with text="Salvar" icon="bi-check-lg" loading=False %}
100
+ ```
101
+
102
+ ### Template Tags
103
+
104
+ #### usp_moeda
105
+
106
+ Formata valor para formato brasileiro:
107
+
108
+ ```html
109
+ {% load usp_filters %}
110
+
111
+ {{ valor|usp_moeda }}
112
+ <!-- Saída: R$ 1.234,56 -->
113
+ ```
114
+
115
+ #### usp_filename
116
+
117
+ Extrai nome do arquivo de um caminho:
118
+
119
+ ```html
120
+ {% load usp_filters %}
121
+
122
+ {{ caminho|usp_filename }}
123
+ <!-- Saída: arquivo.docx -->
124
+ ```
125
+
126
+ ## CSS
127
+
128
+ O design system é composto por módulos CSS:
129
+
130
+ - `tokens.css` — Variáveis CSS (cores, tipografia, espaçamento)
131
+ - `base.css` — Reset e tipografia
132
+ - `components.css` — Botões, formulários, tabelas, cards, alertas
133
+ - `layout.css` — Header, navegação, container
134
+ - `utilities.css` — Espaçamento, impressão, acessibilidade
135
+
136
+ Para usar apenas parte do CSS:
137
+
138
+ ```html
139
+ <link href="{% static 'usp_theme/css/tokens.css' %}" rel="stylesheet">
140
+ <link href="{% static 'usp_theme/css/base.css' %}" rel="stylesheet">
141
+ ```
142
+
143
+ Ou usar o CSS unificado:
144
+
145
+ ```html
146
+ <link href="{% static 'usp_theme/css/usp_theme.css' %}" rel="stylesheet">
147
+ ```
148
+
149
+ ## Variáveis CSS
150
+
151
+ O tema utiliza CSS custom properties com prefixo `--usp-*`. Para customizar:
152
+
153
+ ```css
154
+ :root {
155
+ --usp-color-primary: #0066cc; /* Cor primária personalizada */
156
+ }
157
+ ```
158
+
159
+ ## Licença
160
+
161
+ MIT
File without changes
@@ -0,0 +1,53 @@
1
+ /* ============================================
2
+ USP Theme — Base
3
+ ============================================ */
4
+
5
+ *,
6
+ *::before,
7
+ *::after {
8
+ box-sizing: border-box;
9
+ }
10
+
11
+ body {
12
+ margin: 0;
13
+ font-family: var(--usp-font-sans);
14
+ font-size: var(--usp-text-base);
15
+ line-height: var(--usp-leading-normal);
16
+ color: var(--usp-color-ink);
17
+ background-color: var(--usp-color-bg);
18
+ -webkit-font-smoothing: antialiased;
19
+ -moz-osx-font-smoothing: grayscale;
20
+ }
21
+
22
+ /* ---------- Typography ---------- */
23
+
24
+ h1, h2, h3, h4, h5, h6 {
25
+ margin-top: 0;
26
+ font-weight: var(--usp-weight-semibold);
27
+ line-height: var(--usp-leading-tight);
28
+ color: var(--usp-color-ink);
29
+ text-wrap: balance;
30
+ }
31
+
32
+ h1 { font-size: var(--usp-text-4xl); }
33
+ h2 { font-size: var(--usp-text-3xl); }
34
+ h3 { font-size: var(--usp-text-2xl); }
35
+ h4 { font-size: var(--usp-text-xl); }
36
+ h5 { font-size: var(--usp-text-lg); }
37
+ h6 { font-size: var(--usp-text-base); }
38
+
39
+ p {
40
+ text-wrap: pretty;
41
+ }
42
+
43
+ .text-muted {
44
+ color: var(--usp-color-ink-muted) !important;
45
+ }
46
+
47
+ .text-secondary {
48
+ color: var(--usp-color-ink-secondary) !important;
49
+ }
50
+
51
+ small {
52
+ font-size: var(--usp-text-xs);
53
+ }