zenite-ui 1.0.3

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.
package/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # Zênite UI Framework
2
+
3
+ O Zênite UI é um framework front-end moderno, leve e responsivo, focado na simplicidade e na elegância. Construído com HTML5, CSS3 puro e Vanilla JavaScript, foi concebido para acelerar o desenvolvimento de interfaces web de alto padrão.
4
+
5
+ ---
6
+
7
+ ## 1. Diferenciais
8
+ - Leveza: Sem dependências externas pesadas, focado em performance.
9
+ - Responsividade: Design totalmente adaptável para qualquer dispositivo.
10
+ - Modularidade: Estrutura organizada para importação direta ou via bundlers.
11
+
12
+ ---
13
+
14
+ ## 2. Instalação
15
+
16
+ O framework pode ser instalado no seu projeto via gerenciador de pacotes NPM. Execute o comando abaixo no seu terminal:
17
+
18
+ npm install zenite-framework
19
+
20
+ ---
21
+
22
+ ## 3. Guia de Utilização
23
+
24
+ ### Importação em Projetos Estáticos (HTML)
25
+ Adicione as referências diretamente no seu arquivo HTML apontando para a pasta node_modules:
26
+
27
+ <link rel="stylesheet" href="./node_modules/zenite-framework/zenite-framework/zenite.css">
28
+ <script src="./node_modules/zenite-framework/js/zenite.js"></script>
29
+
30
+ ### Importação via Bundlers (Webpack, Vite, etc.)
31
+ Em arquiteturas modernas, importe o CSS e o JS nos seus arquivos principais:
32
+
33
+ import 'zenite-framework/zenite-framework/zenite.css';
34
+ import 'zenite-framework';
35
+
36
+ ---
37
+
38
+ ## 4. Estrutura do Projeto
39
+ O framework é composto por diversos módulos para facilitar a manutenção:
40
+ - Layout: Grid, Colunas e classes utilitárias.
41
+ - Componentes: Buttons, Cards, Modals, Navbars, entre outros.
42
+ - Formulários: Inputs estilizados, Checkboxes e Switches.
43
+
44
+ ---
45
+
46
+ ## 5. Licença
47
+ Este projeto está sob a licença MIT. Desenvolvido por Zênite Tecnologia.
package/js/zenite.js ADDED
@@ -0,0 +1,170 @@
1
+ //combobox
2
+ document.addEventListener('DOMContentLoaded', () => {
3
+ const comboboxes = document.querySelectorAll('.zf-combobox');
4
+
5
+ comboboxes.forEach(combobox => {
6
+ const input = combobox.querySelector('.zf-combobox-input');
7
+ const items = combobox.querySelectorAll('.zf-combobox-item');
8
+ const clearBtn = combobox.querySelector('.zf-combobox-clear');
9
+
10
+ const toggleClearBtn = () => {
11
+ if (input.value.trim() !== '') {
12
+ combobox.classList.add('has-value');
13
+ } else {
14
+ combobox.classList.remove('has-value');
15
+ }
16
+ };
17
+
18
+ if (clearBtn) {
19
+ clearBtn.addEventListener('mousedown', (e) => {
20
+ e.preventDefault();
21
+ e.stopPropagation();
22
+
23
+ input.value = '';
24
+ toggleClearBtn();
25
+
26
+ items.forEach(item => item.style.display = '');
27
+
28
+ input.focus();
29
+ });
30
+ }
31
+
32
+ input.addEventListener('focus', () => {
33
+ combobox.classList.add('active');
34
+ });
35
+
36
+ input.addEventListener('mousedown', (e) => {
37
+ if (e.offsetX > input.offsetWidth - 40) {
38
+ e.preventDefault();
39
+
40
+ combobox.classList.toggle('active');
41
+
42
+ if (combobox.classList.contains('active')) {
43
+ input.focus();
44
+ }
45
+ }
46
+ });
47
+
48
+ //filtra itens
49
+ input.addEventListener('input', (e) => {
50
+ toggleClearBtn();
51
+ const termoPesquisa = e.target.value.toLowerCase();
52
+
53
+ items.forEach(item => {
54
+ const textoItem = item.textContent.toLowerCase();
55
+
56
+ if (textoItem.includes(termoPesquisa)) {
57
+ item.style.display = '';
58
+ } else {
59
+ item.style.display = 'none';
60
+ }
61
+ });
62
+ });
63
+
64
+ //seleciona item
65
+ items.forEach(item => {
66
+ item.addEventListener('click', () => {
67
+ const nomeElemento = item.querySelector('.zf-cb-name');
68
+
69
+ let cpfElemento = item.querySelector('.zf-cb-cpf');
70
+ let nomeSelecionado = "";
71
+ let idSelecionado = item.getAttribute('data-id') || "Sem ID";
72
+
73
+ if (nomeElemento) {
74
+ nomeSelecionado = nomeElemento.textContent.trim();
75
+ input.value = nomeSelecionado;
76
+ } else {
77
+ nomeSelecionado = item.textContent.trim();
78
+ input.value = nomeSelecionado;
79
+ }
80
+
81
+ toggleClearBtn();
82
+ combobox.classList.remove('active');
83
+
84
+ const dadosJSON = {
85
+ id: idSelecionado,
86
+ nome: nomeSelecionado,
87
+ cpf: cpfElemento ? cpfElemento.textContent.trim() : "CPF não encontrado"
88
+ };
89
+
90
+ console.log("Objeto Selecionado:", JSON.stringify(dadosJSON, null, 2));
91
+ });
92
+ });
93
+
94
+ //fecha lista se clicar fora
95
+ document.addEventListener('click', (e) => {
96
+ if (!combobox.contains(e.target)) {
97
+ combobox.classList.remove('active');
98
+ }
99
+ });
100
+
101
+ //filtra itens
102
+ input.addEventListener('input', (e) => {
103
+ const termoPesquisa = e.target.value.toLowerCase();
104
+
105
+ items.forEach(item => {
106
+ const textoItem = item.textContent.toLowerCase();
107
+
108
+ if (textoItem.includes(termoPesquisa)) {
109
+ item.style.display = '';
110
+ } else {
111
+ item.style.display = 'none';
112
+ }
113
+ });
114
+ });
115
+
116
+ //seleciona item
117
+ items.forEach(item => {
118
+ item.addEventListener('click', () => {
119
+ const nomeElemento = item.querySelector('.zf-cb-name');
120
+
121
+ let cpfElemento = item.querySelector('.zf-cb-cpf');
122
+ let nomeSelecionado = "";
123
+ let idSelecionado = item.getAttribute('data-id') || "Sem ID";
124
+
125
+ if (nomeElemento) {
126
+ nomeSelecionado = nomeElemento.textContent.trim();
127
+ input.value = nomeSelecionado;
128
+ } else {
129
+ nomeSelecionado = item.textContent.trim();
130
+ input.value = nomeSelecionado;
131
+ }
132
+
133
+ combobox.classList.remove('active');
134
+
135
+ const dadosJSON = {
136
+ id: idSelecionado,
137
+ nome: nomeSelecionado,
138
+ cpf: cpfElemento ? cpfElemento.textContent.trim() : "CPF não encontrado"
139
+ };
140
+
141
+ console.log("Objeto Selecionado:", JSON.stringify(dadosJSON, null, 2));
142
+ alert("JSON:\n" + JSON.stringify(dadosJSON, null, 2));
143
+ });
144
+ });
145
+
146
+ //fecha lista se clicar fora
147
+ document.addEventListener('click', (e) => {
148
+ if (!combobox.contains(e.target)) {
149
+ combobox.classList.remove('active');
150
+ }
151
+ });
152
+ });
153
+
154
+ //--------------------------------------------------------------------------
155
+ //dark/light mode toggle
156
+ const themeSwitch = document.getElementById('theme-toggle');
157
+ const themeLabel = document.getElementById('theme-label');
158
+
159
+ if (themeSwitch) {
160
+ themeSwitch.addEventListener('change', (e) => {
161
+ if (e.target.checked) {
162
+ document.documentElement.removeAttribute('data-theme');
163
+ themeLabel.textContent = "Modo Escuro Ativado";
164
+ } else {
165
+ document.documentElement.setAttribute('data-theme', 'light');
166
+ themeLabel.textContent = "Modo Claro Ativado";
167
+ }
168
+ });
169
+ }
170
+ });
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "zenite-ui",
3
+ "version": "1.0.3",
4
+ "description": " Framework front-end responsivo e elegante em CSS e Vanilla JS.",
5
+ "keywords": [
6
+ "css",
7
+ "framework",
8
+ "ui",
9
+ "frontend",
10
+ "javascript"
11
+ ],
12
+ "homepage": "https://github.com/zenitetecnologia/zenite-ui#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/zenitetecnologia/zenite-ui/issues"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/zenitetecnologia/zenite-ui.git"
19
+ },
20
+ "license": "MIT",
21
+ "author": "Zênite Tecnologia",
22
+ "type": "commonjs",
23
+ "main": "js/zenite.js",
24
+ "style": "zenite-ui/zenite.css",
25
+ "files": [
26
+ "zenite-ui",
27
+ "js"
28
+ ],
29
+ "scripts": {
30
+ "test": "echo \"Error: no test specified\" && exit 1"
31
+ }
32
+ }
@@ -0,0 +1,77 @@
1
+ details {
2
+ background-color: var(--zf-background-secondary);
3
+ border: 1px solid rgba(212, 175, 55, 0.2);
4
+ border-radius: 8px;
5
+ margin-bottom: 1rem;
6
+ padding: 0 1.5rem;
7
+ transition: border-color 0.3s ease;
8
+ overflow: hidden;
9
+ }
10
+
11
+ details:hover {
12
+ border-color: rgba(212, 175, 55, 0.5);
13
+ }
14
+
15
+ summary {
16
+ font-weight: 600;
17
+ color: var(--zf-text-light);
18
+ cursor: pointer;
19
+ padding: 1.5rem 0;
20
+ outline: none;
21
+ list-style: none;
22
+ display: flex;
23
+ justify-content: space-between;
24
+ align-items: center;
25
+ }
26
+
27
+ /*seta dourada */
28
+ summary::after {
29
+ content: "▼";
30
+ color: var(--zf-accent);
31
+ font-size: 0.8em;
32
+ transition: transform 0.3s ease;
33
+ }
34
+
35
+ /*roda a seta quando o detalhe está aberto */
36
+ details[open] summary::after {
37
+ transform: rotate(180deg);
38
+ }
39
+
40
+ details[open] summary {
41
+ border-bottom: 1px solid rgba(212, 175, 55, 0.2);
42
+ margin-bottom: 1rem;
43
+ }
44
+
45
+ details p {
46
+ padding-bottom: 0.5rem;
47
+ }
48
+
49
+ /*animacao da caixa*/
50
+ details[open] {
51
+ animation: expandirCaixa 1.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
52
+ }
53
+
54
+ @keyframes expandirCaixa {
55
+ 0% {
56
+ max-height: 75px;
57
+ }
58
+ 100% {
59
+ max-height: 500px;
60
+ }
61
+ }
62
+
63
+ /*anima a revelação suave do texto*/
64
+ details[open] summary ~ * {
65
+ animation: revelarTexto 0.3s ease-in-out forwards;
66
+ }
67
+
68
+ @keyframes revelarTexto {
69
+ 0% {
70
+ opacity: 0;
71
+ transform: translateY(-15px);
72
+ }
73
+ 100% {
74
+ opacity: 1;
75
+ transform: translateY(0);
76
+ }
77
+ }
@@ -0,0 +1,13 @@
1
+ .alert {
2
+ padding: 1rem 1.5rem;
3
+ border-radius: 8px;
4
+ margin-bottom: 1.5rem;
5
+ background-color: var(--zf-background-secondary);
6
+ color: var(--zf-text-light);
7
+ border-left: 4px solid var(--zf-text-main);
8
+ display: flex;
9
+ align-items: center;
10
+ }
11
+ .alert-success { border-left-color: #28a745; background-color: rgba(40, 167, 69, 0.1); }
12
+ .alert-error { border-left-color: #dc3545; background-color: rgba(220, 53, 69, 0.1); }
13
+ .alert-warning { border-left-color: #ffc107; background-color: rgba(255, 193, 7, 0.1); }
@@ -0,0 +1,16 @@
1
+ .avatar {
2
+ display: inline-flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ width: 48px;
6
+ height: 48px;
7
+ border-radius: 50%;
8
+ background-color: var(--zf-background-secondary);
9
+ color: var(--zf-text-light);
10
+ font-weight: bold;
11
+ object-fit: cover;
12
+ border: 2px solid var(--zf-accent);
13
+ }
14
+
15
+ .avatar-sm { width: 32px; height: 32px; font-size: 0.8rem; }
16
+ .avatar-lg { width: 64px; height: 64px; font-size: 1.5rem; }
@@ -0,0 +1,22 @@
1
+ .badge {
2
+ display: inline-block;
3
+ padding: 0.25em 0.85em;
4
+ font-size: 0.75em;
5
+ font-weight: 700;
6
+ text-transform: uppercase;
7
+ border-radius: 9999px; /*efeito pilula*/
8
+ background-color: transparent;
9
+ color: var(--zf-text-main);
10
+ border: 1px solid var(--zf-text-main);
11
+ letter-spacing: 0.05em;
12
+ line-height: 1.5;
13
+ text-align: center;
14
+ white-space: nowrap;
15
+ }
16
+
17
+ /*dourado para destacar*/
18
+ .badge.badge-accent {
19
+ background-color: rgba(212, 175, 55, 0.1);
20
+ color: var(--zf-accent);
21
+ border-color: var(--zf-accent);
22
+ }
@@ -0,0 +1,53 @@
1
+ .button {
2
+ display: inline-block;
3
+ font-family: inherit;
4
+ font-weight: 600;
5
+ font-size: 1rem;
6
+ line-height: 1.5;
7
+ text-align: center;
8
+ text-decoration: none;
9
+ cursor: pointer;
10
+ padding: 0.75rem 2rem;
11
+ border-radius: 9999px;
12
+ border: 2px solid transparent;
13
+ transition: all 0.3s ease;
14
+
15
+ background-color: var(--zf-accent);
16
+ color: var(--zf-background-primary);
17
+ }
18
+
19
+ .button:hover:not(:disabled) {
20
+ transform: translateY(-2px);
21
+ box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
22
+ }
23
+
24
+ .button:active:not(:disabled) {
25
+ transform: translateY(0);
26
+ }
27
+
28
+ .button.button-outline {
29
+ background-color: transparent;
30
+ border-color: var(--zf-accent);
31
+ color: var(--zf-accent);
32
+ }
33
+
34
+ .button.button-outline:hover:not(:disabled) {
35
+ background-color: var(--zf-accent);
36
+ color: var(--zf-background-primary);
37
+ }
38
+
39
+ .button:disabled,
40
+ .button[disabled] {
41
+ opacity: 0.6;
42
+ cursor: not-allowed;
43
+ transform: none;
44
+ box-shadow: none;
45
+ }
46
+
47
+ .button-group {
48
+ display: flex;
49
+ flex-wrap: wrap;
50
+ gap: 1rem;
51
+ align-items: center;
52
+ margin-bottom: 1.5rem;
53
+ }
@@ -0,0 +1,111 @@
1
+ .calendar {
2
+ background-color: var(--zf-background-secondary);
3
+ border: 1px solid rgba(212, 175, 55, 0.2);
4
+ border-radius: 8px;
5
+ padding: 1.5rem;
6
+ margin-bottom: 1.5rem;
7
+ width: 100%;
8
+ max-width: 380px;
9
+ transition: border-color 0.3s ease, box-shadow 0.3s ease;
10
+ }
11
+
12
+ .calendar:hover {
13
+ border-color: var(--zf-accent);
14
+ box-shadow: 0 8px 24px rgba(2, 13, 42, 0.8);
15
+ }
16
+
17
+ /*cabeçalho(mes, ano e botoes)*/
18
+ .calendar-header {
19
+ display: flex;
20
+ justify-content: space-between;
21
+ align-items: center;
22
+ margin-bottom: 1.5rem;
23
+ }
24
+
25
+ .calendar-header h3 {
26
+ margin: 0;
27
+ color: var(--zf-text-light);
28
+ font-size: 1.2rem;
29
+ font-weight: 700;
30
+ }
31
+
32
+ /*botoes de mes*/
33
+ .calendar-btn {
34
+ background: transparent;
35
+ border: 1px solid rgba(212, 175, 55, 0.3);
36
+ color: var(--zf-text-main);
37
+ border-radius: 8px;
38
+ width: 36px;
39
+ height: 36px;
40
+ display: flex;
41
+ align-items: center;
42
+ justify-content: center;
43
+ cursor: pointer;
44
+ transition: all 0.3s ease;
45
+ font-weight: bold;
46
+ }
47
+
48
+ .calendar-btn:hover {
49
+ background-color: var(--zf-accent);
50
+ color: var(--zf-background-primary);
51
+ border-color: var(--zf-accent);
52
+ }
53
+
54
+ /*dias*/
55
+ .calendar-grid {
56
+ display: grid;
57
+ grid-template-columns: repeat(7, 1fr);
58
+ gap: 0.5rem;
59
+ text-align: center;
60
+ }
61
+
62
+ /*dias da semana*/
63
+ .calendar-day-name {
64
+ font-weight: 700;
65
+ font-size: 0.8rem;
66
+ color: var(--zf-accent);
67
+ text-transform: uppercase;
68
+ margin-bottom: 0.5rem;
69
+ }
70
+
71
+ /*numeros dos dias*/
72
+ .calendar-day {
73
+ aspect-ratio: 1;
74
+ display: flex;
75
+ align-items: center;
76
+ justify-content: center;
77
+ border-radius: 50%;
78
+ font-size: 0.95rem;
79
+ color: var(--zf-text-main);
80
+ cursor: pointer;
81
+ transition: all 0.2s ease;
82
+ border: 1px solid transparent;
83
+ }
84
+
85
+ .calendar-day:hover:not(.empty) {
86
+ background-color: rgba(212, 175, 55, 0.1);
87
+ color: var(--zf-text-light);
88
+ border-color: rgba(212, 175, 55, 0.3);
89
+ }
90
+
91
+ /*dia selecionado */
92
+ .calendar-day.active {
93
+ background-color: var(--zf-accent);
94
+ color: var(--zf-background-primary);
95
+ font-weight: bold;
96
+ box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3);
97
+ }
98
+
99
+ .calendar-day.empty {
100
+ cursor: default;
101
+ opacity: 0.3;
102
+ }
103
+
104
+ /*ajuste modo claro*/
105
+ [data-theme="light"] .calendar {
106
+ border-color: #0A1F44 !important;
107
+ }
108
+
109
+ [data-theme="light"] .calendar-day.active {
110
+ color: #FFFFFF !important;
111
+ }
@@ -0,0 +1,33 @@
1
+ .card {
2
+ background-color: var(--zf-background-secondary);
3
+ border: 1px solid rgba(212, 175, 55, 0.2);
4
+ border-radius: 8px;
5
+ padding: 1.5rem;
6
+ margin-bottom: 1.0rem;
7
+ display: flex;
8
+ flex-direction: column;
9
+ transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
10
+ height: 100%;
11
+ position: relative;
12
+ z-index: 1;
13
+ }
14
+
15
+ /*efeito de elevaçao interativa*/
16
+ .card:hover,
17
+ .card:focus-within {
18
+ transform: translateY(-4px);
19
+ border-color: var(--zf-accent);
20
+ box-shadow: 0 8px 24px rgba(2, 13, 42, 0.8);
21
+ z-index: 50;
22
+ }
23
+
24
+ /*ajustes de tipografia dentro do card para nao ter margens excessivas*/
25
+ .card > h1:first-child,
26
+ .card > h2:first-child,
27
+ .card > h3:first-child {
28
+ margin-top: 0;
29
+ }
30
+
31
+ .card > *:last-child {
32
+ margin-bottom: 0;
33
+ }
@@ -0,0 +1,56 @@
1
+ .carousel {
2
+ display: flex;
3
+ overflow-x: auto;
4
+ scroll-snap-type: x mandatory;
5
+ gap: 1.5rem;
6
+ padding-bottom: 1.5rem;
7
+ margin-bottom: 1.5rem;
8
+
9
+ scrollbar-width: thin;
10
+ scrollbar-color: var(--zf-accent) var(--zf-background-secondary);
11
+ }
12
+
13
+ .carousel::-webkit-scrollbar {
14
+ height: 8px;
15
+ }
16
+
17
+ .carousel::-webkit-scrollbar-track {
18
+ background: var(--zf-background-secondary);
19
+ border-radius: 4px;
20
+ }
21
+
22
+ .carousel::-webkit-scrollbar-thumb {
23
+ background: var(--zf-accent);
24
+ border-radius: 4px;
25
+ }
26
+
27
+ .carousel-item {
28
+ flex: 0 0 100%;
29
+ scroll-snap-align: center;
30
+ border-radius: 8px;
31
+ overflow: hidden;
32
+ position: relative;
33
+ }
34
+
35
+ .carousel-item img {
36
+ width: 100%;
37
+ height: 100%;
38
+ object-fit: cover;
39
+ display: block;
40
+ }
41
+
42
+ .carousel-cards .carousel-item {
43
+ flex: 0 0 calc(100% - 3rem);
44
+ }
45
+
46
+ @media (min-width: 768px) {
47
+ .carousel-cards .carousel-item {
48
+ flex: 0 0 calc(50% - 0.75rem);
49
+ }
50
+ }
51
+
52
+ @media (min-width: 1024px) {
53
+ .carousel-cards .carousel-item {
54
+ flex: 0 0 calc(33.333% - 1rem);
55
+ }
56
+ }
@@ -0,0 +1,41 @@
1
+ .container {
2
+ width: 100%;
3
+ max-width: var(--zf-container-width);
4
+ margin: 0 auto;
5
+ padding: 0 1rem;
6
+ }
7
+
8
+ .row {
9
+ display: flex;
10
+ flex-wrap: wrap;
11
+ gap: var(--zf-column-gap);
12
+ margin-bottom: var(--zf-column-gap);
13
+ }
14
+
15
+ /*coluna automatica*/
16
+ .column {
17
+ flex: 1 1 0;
18
+ min-width: 0;
19
+ }
20
+
21
+ /*12 colunas*/
22
+ .column-1 { flex: 0 0 calc(8.333% - (var(--zf-column-gap) * 11 / 12)); }
23
+ .column-2 { flex: 0 0 calc(16.666% - (var(--zf-column-gap) * 10 / 12)); }
24
+ .column-3 { flex: 0 0 calc(25% - (var(--zf-column-gap) * 9 / 12)); }
25
+ .column-4 { flex: 0 0 calc(33.333% - (var(--zf-column-gap) * 8 / 12)); }
26
+ .column-5 { flex: 0 0 calc(41.666% - (var(--zf-column-gap) * 7 / 12)); }
27
+ .column-6 { flex: 0 0 calc(50% - (var(--zf-column-gap) * 6 / 12)); }
28
+ .column-7 { flex: 0 0 calc(58.333% - (var(--zf-column-gap) * 5 / 12)); }
29
+ .column-8 { flex: 0 0 calc(66.666% - (var(--zf-column-gap) * 4 / 12)); }
30
+ .column-9 { flex: 0 0 calc(75% - (var(--zf-column-gap) * 3 / 12)); }
31
+ .column-10 { flex: 0 0 calc(83.333% - (var(--zf-column-gap) * 2 / 12)); }
32
+ .column-11 { flex: 0 0 calc(91.666% - (var(--zf-column-gap) * 1 / 12)); }
33
+ .column-12 { flex: 0 0 100%; }
34
+
35
+ /*responsivo mobile*/
36
+ @media (max-width: 768px) {
37
+ .column,
38
+ [class^="column-"] {
39
+ flex: 0 0 100%;
40
+ }
41
+ }