holygrail5 1.0.10 → 1.0.11
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/generate-css.js +1 -8
- package/package.json +5 -13
- package/src/.data/.previous-values.json +2 -2
- package/src/components/_buttons.css +255 -0
- package/src/components/_checkboxes.css +68 -0
- package/src/components/_forms.css +62 -0
- package/src/components/_inputs.css +84 -0
- package/src/components/_labels.css +28 -0
- package/src/components/_radios.css +64 -0
- package/src/components/_switches.css +70 -0
- package/src/css-generator.js +0 -1
- package/src/dev-server.js +141 -37
- package/src/docs-generator/html-generator.js +69 -41
- package/src/generators/utils.js +0 -31
- package/src/watch-config.js +128 -25
package/generate-css.js
CHANGED
|
@@ -67,14 +67,7 @@ if (require.main === module) {
|
|
|
67
67
|
const combinedCSS = combineThemeCSS(themeSourceDir);
|
|
68
68
|
writeFile(themeOutputPath, combinedCSS, `Tema '${themeName}' combinado`);
|
|
69
69
|
|
|
70
|
-
//
|
|
71
|
-
const demoHtmlPath = path.join(themeSourceDir, 'demo.html');
|
|
72
|
-
|
|
73
|
-
if (fs.existsSync(demoHtmlPath)) {
|
|
74
|
-
const demoOutputPath = path.join(themeOutputDir, `${themeName}-demo.html`);
|
|
75
|
-
fs.copyFileSync(demoHtmlPath, demoOutputPath);
|
|
76
|
-
console.log(`✅ Demo HTML copiado: ${themeName}-demo.html`);
|
|
77
|
-
}
|
|
70
|
+
// Nota: La copia de demo.html con sidebar se hace en copy-theme-html.js
|
|
78
71
|
} catch (error) {
|
|
79
72
|
console.warn(`⚠️ No se pudo generar el tema '${themeName}':`, error.message);
|
|
80
73
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "holygrail5",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "Framework CSS generator con Node.js - Genera CSS optimizado con variables CSS desde un archivo JSON de configuración",
|
|
5
5
|
"main": "generate-css.js",
|
|
6
6
|
"style": "dist/output.css",
|
|
@@ -9,14 +9,7 @@
|
|
|
9
9
|
"default": "./generate-css.js"
|
|
10
10
|
},
|
|
11
11
|
"./dist/output": "./dist/output.css",
|
|
12
|
-
"./
|
|
13
|
-
"./themes/dutti/buttons": "./themes/dutti/_buttons.css",
|
|
14
|
-
"./themes/dutti/checkboxes": "./themes/dutti/_checkboxes.css",
|
|
15
|
-
"./themes/dutti/forms": "./themes/dutti/_forms.css",
|
|
16
|
-
"./themes/dutti/inputs": "./themes/dutti/_inputs.css",
|
|
17
|
-
"./themes/dutti/labels": "./themes/dutti/_labels.css",
|
|
18
|
-
"./themes/dutti/radios": "./themes/dutti/_radios.css",
|
|
19
|
-
"./themes/dutti/switches": "./themes/dutti/_switches.css"
|
|
12
|
+
"./dist/dutti": "./dist/themes/dutti.css"
|
|
20
13
|
},
|
|
21
14
|
"bin": {
|
|
22
15
|
"holygrail5": "./generate-css.js"
|
|
@@ -24,7 +17,9 @@
|
|
|
24
17
|
"scripts": {
|
|
25
18
|
"build": "node generate-css.js && npm run copy-theme-html",
|
|
26
19
|
"copy-theme-html": "node copy-theme-html.js",
|
|
27
|
-
"
|
|
20
|
+
"watch": "node src/watch-config.js",
|
|
21
|
+
"serve": "node src/dev-server.js",
|
|
22
|
+
"dev": "node src/dev-server.js",
|
|
28
23
|
"start": "npm run build && npm run serve",
|
|
29
24
|
"test": "node tests/run-all.js",
|
|
30
25
|
"vars:report": "node src/docs-generator/variables-cli.js report",
|
|
@@ -55,8 +50,5 @@
|
|
|
55
50
|
],
|
|
56
51
|
"engines": {
|
|
57
52
|
"node": ">=12.0.0"
|
|
58
|
-
},
|
|
59
|
-
"devDependencies": {
|
|
60
|
-
"serve": "^14.2.1"
|
|
61
53
|
}
|
|
62
54
|
}
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"100-percent": "100%"
|
|
43
43
|
},
|
|
44
44
|
"colors": {
|
|
45
|
-
"
|
|
45
|
+
"white": "#ffffff",
|
|
46
46
|
"black": "#000000",
|
|
47
47
|
"dark-grey": "#737373",
|
|
48
48
|
"middle-grey": "#a9a9a9",
|
|
@@ -275,7 +275,7 @@
|
|
|
275
275
|
"--hg-spacing-66-percent": "66.666667%",
|
|
276
276
|
"--hg-spacing-75-percent": "75%",
|
|
277
277
|
"--hg-spacing-100-percent": "100%",
|
|
278
|
-
"--hg-color-
|
|
278
|
+
"--hg-color-white": "#ffffff",
|
|
279
279
|
"--hg-color-black": "#000000",
|
|
280
280
|
"--hg-color-dark-grey": "#737373",
|
|
281
281
|
"--hg-color-middle-grey": "#a9a9a9",
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Botones
|
|
3
|
+
* Variantes: primary, secondary, tertiary
|
|
4
|
+
* Tamaños: sm, md, lg
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
.btn {
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
justify-content: center;
|
|
11
|
+
gap: var(--hg-spacing-8);
|
|
12
|
+
font-family: var(--hg-typo-font-family-primary);
|
|
13
|
+
font-size: var(--hg-typo-font-size-13);
|
|
14
|
+
font-weight: var(--hg-typo-font-weight-400);
|
|
15
|
+
line-height: var(--hg-typo-line-height-1-5);
|
|
16
|
+
text-decoration: none;
|
|
17
|
+
border: var(--border-width) var(--border-style) transparent;
|
|
18
|
+
border-radius: var(--border-radius);
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
transition: var(--transition);
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
user-select: none;
|
|
23
|
+
-webkit-tap-highlight-color: transparent;
|
|
24
|
+
min-height: 32px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Tamaños de botones */
|
|
28
|
+
.btn-sm {
|
|
29
|
+
padding: var(--btn-padding-y-sm) var(--btn-padding-x-sm);
|
|
30
|
+
font-size: var(--hg-typo-font-size-12);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.btn-md {
|
|
34
|
+
padding: var(--btn-padding-y-md) var(--btn-padding-x-md);
|
|
35
|
+
font-size: var(--hg-typo-font-size-13);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.btn-lg {
|
|
39
|
+
padding: var(--btn-padding-y-lg) var(--btn-padding-x-lg);
|
|
40
|
+
font-size: var(--hg-typo-font-size-14);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* PRIMARY BUTTON */
|
|
44
|
+
.btn-primary {
|
|
45
|
+
color: var(--hg-color-white);
|
|
46
|
+
background-color: var(--hg-color-black);
|
|
47
|
+
border: var(--border-width) var(--border-style) var(--hg-color-black);
|
|
48
|
+
font-family: var(--hg-typo-font-family-primary);
|
|
49
|
+
font-weight: var(--hg-typo-font-weight-400);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.btn-primary svg g {
|
|
53
|
+
fill: var(--hg-color-white);
|
|
54
|
+
stroke: var(--hg-color-white);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.btn-primary svg circle {
|
|
58
|
+
stroke: var(--hg-color-white);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.btn-primary svg path {
|
|
62
|
+
fill: var(--hg-color-white);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.btn-primary:focus,
|
|
66
|
+
.btn-primary.focus,
|
|
67
|
+
.btn-primary:hover,
|
|
68
|
+
.btn-primary.hover,
|
|
69
|
+
.btn-primary:active,
|
|
70
|
+
.btn-primary.active {
|
|
71
|
+
color: var(--hg-color-white);
|
|
72
|
+
background-color: var(--hg-color-dark-grey);
|
|
73
|
+
border: var(--border-width) var(--border-style) var(--hg-color-dark-grey);
|
|
74
|
+
opacity: 1;
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.btn-primary[disabled],
|
|
79
|
+
.btn-primary:disabled,
|
|
80
|
+
.btn-primary.disabled {
|
|
81
|
+
background-color: var(--hg-color-bg-light);
|
|
82
|
+
border: var(--border-width) var(--border-style) var(--hg-color-bg-light);
|
|
83
|
+
color: var(--hg-color-dark-grey);
|
|
84
|
+
opacity: 1;
|
|
85
|
+
cursor: not-allowed;
|
|
86
|
+
pointer-events: none;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.btn-primary[disabled] svg g,
|
|
90
|
+
.btn-primary:disabled svg g,
|
|
91
|
+
.btn-primary.disabled svg g {
|
|
92
|
+
fill: var(--hg-color-dark-grey);
|
|
93
|
+
stroke: var(--hg-color-dark-grey);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.btn-primary[disabled] svg circle,
|
|
97
|
+
.btn-primary:disabled svg circle,
|
|
98
|
+
.btn-primary.disabled svg circle {
|
|
99
|
+
stroke: var(--hg-color-dark-grey);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.btn-primary[disabled] svg path,
|
|
103
|
+
.btn-primary:disabled svg path,
|
|
104
|
+
.btn-primary.disabled svg path {
|
|
105
|
+
fill: var(--hg-color-dark-grey);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* SECONDARY BUTTON */
|
|
109
|
+
.btn-secondary {
|
|
110
|
+
color: var(--hg-color-black);
|
|
111
|
+
background-color: var(--hg-color-white);
|
|
112
|
+
border: var(--border-width) var(--border-style) var(--hg-color-black);
|
|
113
|
+
line-height: 1;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.btn-secondary svg circle {
|
|
117
|
+
stroke: var(--hg-color-black);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.btn-secondary:focus,
|
|
121
|
+
.btn-secondary.focus,
|
|
122
|
+
.btn-secondary:hover,
|
|
123
|
+
.btn-secondary.hover,
|
|
124
|
+
.btn-secondary:active,
|
|
125
|
+
.btn-secondary.active {
|
|
126
|
+
color: var(--hg-color-black);
|
|
127
|
+
background-color: var(--hg-color-white);
|
|
128
|
+
border: var(--border-width) var(--border-style) var(--hg-color-dark-grey);
|
|
129
|
+
opacity: 1;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.btn-secondary[disabled],
|
|
133
|
+
.btn-secondary:disabled,
|
|
134
|
+
.btn-secondary.disabled {
|
|
135
|
+
background-color: var(--hg-color-bg-light);
|
|
136
|
+
border: var(--border-width) var(--border-style) var(--hg-color-bg-light);
|
|
137
|
+
color: var(--hg-color-dark-grey);
|
|
138
|
+
opacity: 1;
|
|
139
|
+
cursor: not-allowed;
|
|
140
|
+
pointer-events: none;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.btn-secondary[disabled] svg g,
|
|
144
|
+
.btn-secondary:disabled svg g,
|
|
145
|
+
.btn-secondary.disabled svg g {
|
|
146
|
+
fill: var(--hg-color-middle-grey);
|
|
147
|
+
stroke: var(--hg-color-middle-grey);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.btn-secondary[disabled] svg circle,
|
|
151
|
+
.btn-secondary:disabled svg circle,
|
|
152
|
+
.btn-secondary.disabled svg circle {
|
|
153
|
+
stroke: var(--hg-color-middle-grey);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.btn-secondary[disabled] svg path,
|
|
157
|
+
.btn-secondary:disabled svg path,
|
|
158
|
+
.btn-secondary.disabled svg path {
|
|
159
|
+
fill: var(--hg-color-middle-grey);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* TERTIARY BUTTON */
|
|
163
|
+
.btn-tertiary {
|
|
164
|
+
background-color: transparent;
|
|
165
|
+
border: 0 solid transparent;
|
|
166
|
+
height: auto;
|
|
167
|
+
min-height: auto;
|
|
168
|
+
padding-top: 6px;
|
|
169
|
+
padding-bottom: 6px;
|
|
170
|
+
line-height: 1;
|
|
171
|
+
min-width: 24px;
|
|
172
|
+
padding-inline: 0;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.btn-tertiary svg g {
|
|
176
|
+
fill: var(--hg-color-black);
|
|
177
|
+
stroke: var(--hg-color-black);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.btn-tertiary svg circle {
|
|
181
|
+
stroke: var(--hg-color-black);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.btn-tertiary:focus,
|
|
185
|
+
.btn-tertiary.focus,
|
|
186
|
+
.btn-tertiary:hover,
|
|
187
|
+
.btn-tertiary.hover,
|
|
188
|
+
.btn-tertiary:active,
|
|
189
|
+
.btn-tertiary.active {
|
|
190
|
+
border: 0 solid transparent;
|
|
191
|
+
background-color: transparent;
|
|
192
|
+
cursor: pointer;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.btn-tertiary.active {
|
|
196
|
+
border-bottom: 0.5px solid var(--hg-color-black);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.btn-tertiary:disabled,
|
|
200
|
+
.btn-tertiary[disabled],
|
|
201
|
+
.btn-tertiary.disabled {
|
|
202
|
+
pointer-events: none;
|
|
203
|
+
cursor: default;
|
|
204
|
+
background-color: var(--hg-color-bg-light);
|
|
205
|
+
border: var(--border-width) var(--border-style) var(--hg-color-bg-light);
|
|
206
|
+
color: var(--hg-color-dark-grey);
|
|
207
|
+
filter: none;
|
|
208
|
+
opacity: 1;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.btn-tertiary:disabled svg-icon,
|
|
212
|
+
.btn-tertiary:disabled svg-icon2,
|
|
213
|
+
.btn-tertiary:disabled md-icon,
|
|
214
|
+
.btn-tertiary[disabled] svg-icon,
|
|
215
|
+
.btn-tertiary[disabled] svg-icon2,
|
|
216
|
+
.btn-tertiary[disabled] md-icon,
|
|
217
|
+
.btn-tertiary.disabled svg-icon,
|
|
218
|
+
.btn-tertiary.disabled svg-icon2,
|
|
219
|
+
.btn-tertiary.disabled md-icon {
|
|
220
|
+
background-color: transparent !important;
|
|
221
|
+
border: 0 solid transparent !important;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* LINK BUTTON */
|
|
225
|
+
.btn-link {
|
|
226
|
+
background-color: transparent;
|
|
227
|
+
border: none;
|
|
228
|
+
color: var(--hg-color-black);
|
|
229
|
+
padding: 0;
|
|
230
|
+
min-height: auto;
|
|
231
|
+
font-weight: var(--hg-typo-font-weight-400);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.btn-link:hover,
|
|
235
|
+
.btn-link:focus {
|
|
236
|
+
color: var(--hg-color-dark-grey);
|
|
237
|
+
background-color: transparent;
|
|
238
|
+
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.btn-link:disabled,
|
|
242
|
+
.btn-link[disabled],
|
|
243
|
+
.btn-link.disabled {
|
|
244
|
+
color: var(--hg-color-dark-grey);
|
|
245
|
+
background-color: transparent;
|
|
246
|
+
cursor: not-allowed;
|
|
247
|
+
pointer-events: none;
|
|
248
|
+
opacity: 0.5;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/* Ancho completo */
|
|
252
|
+
.btn-full {
|
|
253
|
+
width: 100%;
|
|
254
|
+
}
|
|
255
|
+
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checkboxes
|
|
3
|
+
* Estados: checked, disabled, focus
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
.checkbox {
|
|
7
|
+
position: relative;
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: var(--hg-spacing-8);
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
user-select: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.checkbox input[type="checkbox"] {
|
|
16
|
+
position: absolute;
|
|
17
|
+
opacity: 0;
|
|
18
|
+
width: 0;
|
|
19
|
+
height: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.checkbox-indicator {
|
|
23
|
+
display: inline-flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
width: 20px;
|
|
27
|
+
height: 20px;
|
|
28
|
+
background-color: var(--checkbox-bg);
|
|
29
|
+
border: var(--border-width) var(--border-style) var(--checkbox-border);
|
|
30
|
+
border-radius: var(--border-radius);
|
|
31
|
+
transition: var(--transition);
|
|
32
|
+
flex-shrink: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.checkbox input[type="checkbox"]:checked + .checkbox-indicator {
|
|
36
|
+
background-color: var(--checkbox-checked-bg);
|
|
37
|
+
border-color: var(--checkbox-checked-border);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.checkbox input[type="checkbox"]:checked + .checkbox-indicator::after {
|
|
41
|
+
content: "";
|
|
42
|
+
width: 6px;
|
|
43
|
+
height: 10px;
|
|
44
|
+
border: 2px solid var(--hg-color-white);
|
|
45
|
+
border-top: 0;
|
|
46
|
+
border-left: 0;
|
|
47
|
+
transform: rotate(45deg);
|
|
48
|
+
margin-top: -2px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.checkbox input[type="checkbox"]:focus + .checkbox-indicator {
|
|
52
|
+
outline: 2px solid var(--hg-color-info);
|
|
53
|
+
outline-offset: 2px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.checkbox input[type="checkbox"]:disabled + .checkbox-indicator {
|
|
57
|
+
opacity: 0.5;
|
|
58
|
+
cursor: not-allowed;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.checkbox-label {
|
|
62
|
+
font-family: var(--hg-typo-font-family-primary);
|
|
63
|
+
font-size: var(--hg-typo-font-size-13);
|
|
64
|
+
font-weight: var(--hg-typo-font-weight-400);
|
|
65
|
+
line-height: var(--hg-typo-line-height-1-5);
|
|
66
|
+
color: var(--label-color);
|
|
67
|
+
}
|
|
68
|
+
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form Groups, Form Rows y Helper Text
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/* Form Groups */
|
|
6
|
+
.form-group {
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: 0;
|
|
10
|
+
margin-block-end: var(--hg-spacing-24);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.form-group:last-child {
|
|
14
|
+
margin-block-end: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.form-group-inline {
|
|
18
|
+
flex-direction: row;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: var(--hg-spacing-16);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.form-group-inline .label {
|
|
24
|
+
margin-block-end: 0;
|
|
25
|
+
flex-shrink: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Helper Text / Messages */
|
|
29
|
+
.helper-text {
|
|
30
|
+
display: block;
|
|
31
|
+
font-family: var(--hg-typo-font-family-primary);
|
|
32
|
+
font-size: var(--hg-typo-font-size-12);
|
|
33
|
+
font-weight: var(--hg-typo-font-weight-400);
|
|
34
|
+
line-height: var(--hg-typo-line-height-1-5);
|
|
35
|
+
margin-block-start: var(--hg-spacing-4);
|
|
36
|
+
color: var(--hg-color-dark-grey);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.helper-text-error {
|
|
40
|
+
color: var(--hg-color-error);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.helper-text-success {
|
|
44
|
+
color: var(--hg-color-success);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.helper-text-warning {
|
|
48
|
+
color: var(--hg-color-warning);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Form Row */
|
|
52
|
+
.form-row {
|
|
53
|
+
display: flex;
|
|
54
|
+
gap: var(--hg-spacing-16);
|
|
55
|
+
flex-wrap: wrap;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.form-row > * {
|
|
59
|
+
flex: 1;
|
|
60
|
+
min-width: 200px;
|
|
61
|
+
}
|
|
62
|
+
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inputs, Selects y Textareas
|
|
3
|
+
* Estados: error, success, warning, disabled
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
.input,
|
|
7
|
+
.select,
|
|
8
|
+
.textarea {
|
|
9
|
+
display: block;
|
|
10
|
+
width: 100%;
|
|
11
|
+
font-family: var(--hg-typo-font-family-primary);
|
|
12
|
+
font-size: var(--hg-typo-font-size-13);
|
|
13
|
+
font-weight: var(--hg-typo-font-weight-400);
|
|
14
|
+
line-height: var(--hg-typo-line-height-1-5);
|
|
15
|
+
color: var(--input-color);
|
|
16
|
+
background-color: var(--input-bg);
|
|
17
|
+
border: var(--border-width) var(--border-style) var(--input-border);
|
|
18
|
+
border-radius: var(--border-radius);
|
|
19
|
+
padding: var(--input-padding-y) var(--input-padding-x);
|
|
20
|
+
transition: var(--transition);
|
|
21
|
+
-webkit-appearance: none;
|
|
22
|
+
-moz-appearance: none;
|
|
23
|
+
appearance: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.input:focus,
|
|
27
|
+
.select:focus,
|
|
28
|
+
.textarea:focus {
|
|
29
|
+
outline: none;
|
|
30
|
+
border-color: var(--input-border-focus);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.input::placeholder,
|
|
34
|
+
.textarea::placeholder {
|
|
35
|
+
color: var(--input-placeholder);
|
|
36
|
+
opacity: 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.input:disabled,
|
|
40
|
+
.select:disabled,
|
|
41
|
+
.textarea:disabled {
|
|
42
|
+
opacity: 0.5;
|
|
43
|
+
cursor: not-allowed;
|
|
44
|
+
background-color: var(--hg-color-light-grey);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Estados de inputs */
|
|
48
|
+
.input-error,
|
|
49
|
+
.select-error,
|
|
50
|
+
.textarea-error {
|
|
51
|
+
border-color: var(--input-error-border);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.input-success,
|
|
55
|
+
.select-success,
|
|
56
|
+
.textarea-success {
|
|
57
|
+
border-color: var(--input-success-border);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.input-warning,
|
|
61
|
+
.select-warning,
|
|
62
|
+
.textarea-warning {
|
|
63
|
+
border-color: var(--input-warning-border);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* Textarea específico */
|
|
67
|
+
.textarea {
|
|
68
|
+
resize: vertical;
|
|
69
|
+
min-height: 100px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* Select específico */
|
|
73
|
+
.select {
|
|
74
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23000000' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
|
|
75
|
+
background-repeat: no-repeat;
|
|
76
|
+
background-position: right var(--hg-spacing-12) center;
|
|
77
|
+
background-size: 12px;
|
|
78
|
+
padding-right: calc(var(--input-padding-x) * 2 + 12px);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.select::-ms-expand {
|
|
82
|
+
display: none;
|
|
83
|
+
}
|
|
84
|
+
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Labels
|
|
3
|
+
* Variantes: normal, required, inline
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
.label {
|
|
7
|
+
display: block;
|
|
8
|
+
font-family: var(--hg-typo-font-family-primary);
|
|
9
|
+
font-size: var(--hg-typo-font-size-12);
|
|
10
|
+
font-weight: var(--hg-typo-font-weight-700);
|
|
11
|
+
line-height: var(--hg-typo-line-height-1-5);
|
|
12
|
+
color: var(--label-color);
|
|
13
|
+
margin-block-end: var(--hg-spacing-8);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.label-required::after {
|
|
17
|
+
content: " *";
|
|
18
|
+
color: var(--label-required);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.label-inline {
|
|
22
|
+
display: inline-flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
gap: var(--hg-spacing-8);
|
|
25
|
+
margin-block-end: 0;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
}
|
|
28
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Radios
|
|
3
|
+
* Estados: checked, disabled, focus
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
.radio {
|
|
7
|
+
position: relative;
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: var(--hg-spacing-8);
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
user-select: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.radio input[type="radio"] {
|
|
16
|
+
position: absolute;
|
|
17
|
+
opacity: 0;
|
|
18
|
+
width: 0;
|
|
19
|
+
height: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.radio-indicator {
|
|
23
|
+
display: inline-flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
width: 20px;
|
|
27
|
+
height: 20px;
|
|
28
|
+
background-color: var(--radio-bg);
|
|
29
|
+
border: var(--border-width) var(--border-style) var(--radio-border);
|
|
30
|
+
border-radius: 50%;
|
|
31
|
+
transition: var(--transition);
|
|
32
|
+
flex-shrink: 0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.radio input[type="radio"]:checked + .radio-indicator {
|
|
36
|
+
border-color: var(--radio-checked-border);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.radio input[type="radio"]:checked + .radio-indicator::after {
|
|
40
|
+
content: "";
|
|
41
|
+
width: 10px;
|
|
42
|
+
height: 10px;
|
|
43
|
+
background-color: var(--radio-checked-bg);
|
|
44
|
+
border-radius: 50%;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.radio input[type="radio"]:focus + .radio-indicator {
|
|
48
|
+
outline: 2px solid var(--hg-color-info);
|
|
49
|
+
outline-offset: 2px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.radio input[type="radio"]:disabled + .radio-indicator {
|
|
53
|
+
opacity: 0.5;
|
|
54
|
+
cursor: not-allowed;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.radio-label {
|
|
58
|
+
font-family: var(--hg-typo-font-family-primary);
|
|
59
|
+
font-size: var(--hg-typo-font-size-13);
|
|
60
|
+
font-weight: var(--hg-typo-font-weight-400);
|
|
61
|
+
line-height: var(--hg-typo-line-height-1-5);
|
|
62
|
+
color: var(--label-color);
|
|
63
|
+
}
|
|
64
|
+
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Switches / Toggles
|
|
3
|
+
* Estados: checked, disabled, focus
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
.switch {
|
|
7
|
+
position: relative;
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: var(--hg-spacing-8);
|
|
11
|
+
cursor: pointer;
|
|
12
|
+
user-select: none;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.switch input[type="checkbox"] {
|
|
16
|
+
position: absolute;
|
|
17
|
+
opacity: 0;
|
|
18
|
+
width: 0;
|
|
19
|
+
height: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.switch-indicator {
|
|
23
|
+
position: relative;
|
|
24
|
+
display: inline-block;
|
|
25
|
+
width: 44px;
|
|
26
|
+
height: 24px;
|
|
27
|
+
background-color: var(--switch-bg);
|
|
28
|
+
border-radius: 12px;
|
|
29
|
+
transition: var(--transition);
|
|
30
|
+
flex-shrink: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.switch-indicator::after {
|
|
34
|
+
content: "";
|
|
35
|
+
position: absolute;
|
|
36
|
+
top: 2px;
|
|
37
|
+
left: 2px;
|
|
38
|
+
width: 20px;
|
|
39
|
+
height: 20px;
|
|
40
|
+
background-color: var(--switch-thumb);
|
|
41
|
+
border-radius: 50%;
|
|
42
|
+
transition: var(--transition);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.switch input[type="checkbox"]:checked + .switch-indicator {
|
|
46
|
+
background-color: var(--switch-active-bg);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.switch input[type="checkbox"]:checked + .switch-indicator::after {
|
|
50
|
+
transform: translateX(20px);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.switch input[type="checkbox"]:focus + .switch-indicator {
|
|
54
|
+
outline: 2px solid var(--hg-color-info);
|
|
55
|
+
outline-offset: 2px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.switch input[type="checkbox"]:disabled + .switch-indicator {
|
|
59
|
+
opacity: 0.5;
|
|
60
|
+
cursor: not-allowed;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.switch-label {
|
|
64
|
+
font-family: var(--hg-typo-font-family-primary);
|
|
65
|
+
font-size: var(--hg-typo-font-size-13);
|
|
66
|
+
font-weight: var(--hg-typo-font-weight-400);
|
|
67
|
+
line-height: var(--hg-typo-line-height-1-5);
|
|
68
|
+
color: var(--label-color);
|
|
69
|
+
}
|
|
70
|
+
|