@edc-motor/ui 0.4.19 → 0.4.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edc-motor/ui",
3
- "version": "0.4.19",
3
+ "version": "0.4.21",
4
4
  "description": "EdC Motor — componentes públicos Vue 3 + tokens SCSS para webs de juegos de mesa (paquete fuente: lo compila el consumidor con Vite)",
5
5
  "license": "GPL-3.0-only",
6
6
  "type": "module",
package/scss/_tokens.scss CHANGED
@@ -113,6 +113,11 @@ $input-border-hover: $border-strong;
113
113
  $input-border-focus: $accent-500;
114
114
  $input-focus-ring: $focus-ring;
115
115
 
116
+ // Separación entre los ELEMENTOS de un bloque del CRM (título, subtítulo,
117
+ // texto, botón…): un único token para todos los huecos interiores de los
118
+ // bloques (antes cada zona llevaba el suyo: 20/16/12px).
119
+ $block-gap: $space-6; // 24px
120
+
116
121
  // ---------------------------------------------------------
117
122
  // Texto que CONTRASTA con un fondo arbitrario (el acento elegido en
118
123
  // Ajustes, el color de una acción…): el navegador resuelve claro u oscuro
@@ -11,7 +11,7 @@
11
11
  margin: 0 auto;
12
12
  padding: 0 $space-4;
13
13
  display: grid;
14
- gap: $space-5; // separación entre los elementos del bloque
14
+ gap: $block-gap; // separación entre los elementos del bloque
15
15
  }
16
16
 
17
17
  // Anchura del contenido (campo común `width`): coherente entre bloques.
@@ -28,6 +28,16 @@
28
28
  &--align-justify &__title,
29
29
  &--align-justify &__subtitle { text-align: left; }
30
30
 
31
+ // Alineación PROPIA de título/subtítulo (campos comunes title_align y
32
+ // subtitle_align): con valor explícito manda sobre la del bloque (por eso
33
+ // va DESPUÉS del ajuste del justificado).
34
+ &--title-left &__title { text-align: left; }
35
+ &--title-center &__title { text-align: center; }
36
+ &--title-right &__title { text-align: right; }
37
+ &--subtitle-left &__subtitle { text-align: left; }
38
+ &--subtitle-center &__subtitle { text-align: center; }
39
+ &--subtitle-right &__subtitle { text-align: right; }
40
+
31
41
  &__label {
32
42
  display: inline-block;
33
43
  justify-self: start;
@@ -51,7 +61,7 @@
51
61
  box-shadow: $shadow-sm;
52
62
  padding: $space-8;
53
63
  display: grid;
54
- gap: $space-4;
64
+ gap: $block-gap;
55
65
 
56
66
  .edc-button { justify-self: start; text-decoration: none; }
57
67
  }
@@ -156,9 +166,13 @@
156
166
  // Cuerpo del CTA (texto + botón) dentro de su media-layout.
157
167
  &__cta-body {
158
168
  display: grid;
159
- gap: $space-3;
169
+ gap: $block-gap;
160
170
  justify-items: start;
161
171
  align-content: center; // centrado frente a la imagen sangrada
172
+
173
+ // El botón respira más que el resto: su hueco total (gap + margen)
174
+ // casi DOBLA la separación normal entre elementos del bloque.
175
+ .block-button { margin-top: $space-5; }
162
176
  }
163
177
 
164
178
  // Botón del CTA: en estrecho va SIEMPRE centrado (como el del related);
@@ -222,23 +236,28 @@
222
236
  border-radius: 0 0 $radius-lg $radius-lg;
223
237
  }
224
238
 
239
+ // Cita: sin adorno de borde, en GRANDE ($fs-32, el token más cercano a
240
+ // los ~40px pedidos) y del color de acento.
225
241
  &--quote .block__quote {
226
242
  margin: 0;
227
- border-left: 3px solid $accent-500;
228
- padding-left: $space-4;
229
243
  // Fuente "especial" de la configuración de la web (doc 10); las fuentes
230
244
  // decorativas piden un cuerpo mayor.
231
245
  font-family: var(--font-special, inherit);
232
- font-size: $fs-24;
246
+ font-size: $fs-32;
233
247
  font-style: italic;
248
+ color: $accent-500;
234
249
  }
235
250
  &__author {
236
251
  margin-top: $space-2;
237
252
  color: $text-3;
238
253
  // El autor no hereda la fuente especial de la cita.
239
254
  font-family: var(--font-body, inherit);
240
- font-style: normal;
255
+ font-style: italic;
241
256
  font-size: $fs-14;
257
+
258
+ &--left { text-align: left; }
259
+ &--center { text-align: center; }
260
+ &--right { text-align: right; }
242
261
  }
243
262
  }
244
263
 
@@ -12,7 +12,13 @@ defineProps<{ settings: Record<string, unknown>; data?: Record<string, unknown>
12
12
  <blockquote class="block__quote">
13
13
  <img v-if="settings.image" class="block__avatar" :src="String(settings.image)" alt="" />
14
14
  <div class="rich-content" v-html="settings.quote" />
15
- <footer v-if="settings.author" class="block__author">— {{ settings.author }}</footer>
15
+ <footer
16
+ v-if="settings.author"
17
+ class="block__author"
18
+ :class="`block__author--${settings.author_align || 'left'}`"
19
+ >
20
+ — {{ settings.author }}
21
+ </footer>
16
22
  </blockquote>
17
23
  </BlockShell>
18
24
  </template>
@@ -12,6 +12,13 @@ const width = computed(() => `block--w-${(props.settings.width as string) || 'wi
12
12
  // Sin valor guardado, JUSTIFICADO (el default del campo común del motor).
13
13
  const align = computed(() => `block--align-${(props.settings.align as string) || 'justify'}`)
14
14
 
15
+ // Alineación propia de título/subtítulo (campos comunes): solo pinta clase
16
+ // con un valor explícito — "inherit" (o nada) deja mandar a la del bloque.
17
+ const headingAlign = (key: 'title_align' | 'subtitle_align', prefix: string) => {
18
+ const value = props.settings[key] as string | undefined
19
+ return value && value !== 'inherit' ? `block--${prefix}-${value}` : ''
20
+ }
21
+
15
22
  const style = computed<CSSProperties>(() => {
16
23
  const background = props.settings.background as string | undefined
17
24
  return {
@@ -24,7 +31,11 @@ const style = computed<CSSProperties>(() => {
24
31
  </script>
25
32
 
26
33
  <template>
27
- <section class="block" :class="[width, align]" :style="style">
34
+ <section
35
+ class="block"
36
+ :class="[width, align, headingAlign('title_align', 'title'), headingAlign('subtitle_align', 'subtitle')]"
37
+ :style="style"
38
+ >
28
39
  <div class="block__inner">
29
40
  <slot />
30
41
  </div>