@edc-motor/ui 0.4.18 → 0.4.20

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.18",
3
+ "version": "0.4.20",
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",
@@ -22,7 +22,7 @@
22
22
  }
23
23
 
24
24
  .block__related-button {
25
- justify-self: start;
25
+ justify-self: center; // estrecho: los botones de bloque van centrados
26
26
 
27
27
  @media (min-width: $bp-sm) {
28
28
  justify-self: end;
@@ -21,12 +21,23 @@
21
21
  // Tipografía de bloque: texto $fs-16, subtítulo $fs-20, título $fs-28
22
22
  // (la cabecera sube a 32/24). Los títulos nunca se justifican.
23
23
  &__title { margin: 0; font-size: $fs-28; }
24
- &__subtitle { margin: 0; color: $text-2; font-size: $fs-20; }
24
+ // pre-line: el subtítulo es un textarea — sus saltos de línea cuentan.
25
+ &__subtitle { margin: 0; color: $text-2; font-size: $fs-20; white-space: pre-line; }
25
26
  &__text { color: $text-1; font-size: $fs-16; }
26
27
 
27
28
  &--align-justify &__title,
28
29
  &--align-justify &__subtitle { text-align: left; }
29
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
+
30
41
  &__label {
31
42
  display: inline-block;
32
43
  justify-self: start;
@@ -160,10 +171,30 @@
160
171
  align-content: center; // centrado frente a la imagen sangrada
161
172
  }
162
173
 
174
+ // Botón del CTA: en estrecho va SIEMPRE centrado (como el del related);
175
+ // de $bp-sm para arriba manda su campo "Alineación del botón".
176
+ &__cta-button--left,
177
+ &__cta-button--center,
178
+ &__cta-button--right {
179
+ justify-self: center;
180
+ }
181
+
182
+ @media (min-width: $bp-sm) {
183
+ &__cta-button--left { justify-self: start; }
184
+ &__cta-button--center { justify-self: center; }
185
+ &__cta-button--right { justify-self: end; }
186
+ }
187
+
163
188
  // La imagen del CTA sangra hasta el borde de la tarjeta según su posición:
164
189
  // en columnas toca arriba, abajo y su lateral (el título viaja a la
165
190
  // columna de texto); arriba/abajo toca los laterales. Esquinas siguiendo
166
191
  // el radio de la tarjeta.
192
+ // La tarjeta del CTA lleva un halo SUTIL del acento, igual por los cuatro
193
+ // bordes (sin offset), además de su sombra de profundidad normal.
194
+ &--cta .block__card {
195
+ box-shadow: $shadow-sm, 0 0 18px color-mix(in srgb, $accent-500 30%, transparent);
196
+ }
197
+
167
198
  &--cta.block--image-right .block__media-layout .block__image-frame,
168
199
  &--cta.block--image-left .block__media-layout .block__image-frame {
169
200
  @container content (min-width: #{$bp-sm}) {
@@ -201,23 +232,28 @@
201
232
  border-radius: 0 0 $radius-lg $radius-lg;
202
233
  }
203
234
 
235
+ // Cita: sin adorno de borde, en GRANDE ($fs-32, el token más cercano a
236
+ // los ~40px pedidos) y del color de acento.
204
237
  &--quote .block__quote {
205
238
  margin: 0;
206
- border-left: 3px solid $accent-500;
207
- padding-left: $space-4;
208
239
  // Fuente "especial" de la configuración de la web (doc 10); las fuentes
209
240
  // decorativas piden un cuerpo mayor.
210
241
  font-family: var(--font-special, inherit);
211
- font-size: $fs-24;
242
+ font-size: $fs-32;
212
243
  font-style: italic;
244
+ color: $accent-500;
213
245
  }
214
246
  &__author {
215
247
  margin-top: $space-2;
216
248
  color: $text-3;
217
249
  // El autor no hereda la fuente especial de la cita.
218
250
  font-family: var(--font-body, inherit);
219
- font-style: normal;
251
+ font-style: italic;
220
252
  font-size: $fs-14;
253
+
254
+ &--left { text-align: left; }
255
+ &--center { text-align: center; }
256
+ &--right { text-align: right; }
221
257
  }
222
258
  }
223
259
 
@@ -267,6 +303,9 @@
267
303
  align-items: center;
268
304
  gap: $space-2;
269
305
  padding: $space-2 $space-5;
306
+
307
+ // "Botón grande" (campo button_large del CTA): más aire interior.
308
+ &--large { padding: $space-4 $space-8; }
270
309
  border: 1px solid $accent-500;
271
310
  border-radius: $radius-md;
272
311
  font-size: $fs-18;
@@ -44,10 +44,16 @@ const layoutStyle = computed(() => {
44
44
  <p v-if="settings.subtitle" class="block__subtitle">{{ settings.subtitle }}</p>
45
45
  </template>
46
46
  <div v-if="settings.body" class="block__text rich-content" v-html="settings.body" />
47
+ <!-- Alineación propia (button_align; en estrecho el CSS centra
48
+ siempre) y tamaño grande opcional (button_large) -->
47
49
  <a
48
50
  v-if="settings.button_text && settings.button_url"
49
51
  class="block-button"
50
- :class="`block-button--${settings.button_variant || 'primary'}`"
52
+ :class="[
53
+ `block-button--${settings.button_variant || 'primary'}`,
54
+ `block__cta-button--${settings.button_align || 'left'}`,
55
+ settings.button_large ? 'block-button--large' : '',
56
+ ]"
51
57
  :href="String(settings.button_url)"
52
58
  >
53
59
  {{ settings.button_text }}
@@ -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>
@@ -9,7 +9,15 @@ import { computed, type CSSProperties } from 'vue'
9
9
  const props = defineProps<{ settings: Record<string, unknown> }>()
10
10
 
11
11
  const width = computed(() => `block--w-${(props.settings.width as string) || 'wide'}`)
12
- const align = computed(() => `block--align-${(props.settings.align as string) || 'left'}`)
12
+ // Sin valor guardado, JUSTIFICADO (el default del campo común del motor).
13
+ const align = computed(() => `block--align-${(props.settings.align as string) || 'justify'}`)
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
+ }
13
21
 
14
22
  const style = computed<CSSProperties>(() => {
15
23
  const background = props.settings.background as string | undefined
@@ -17,13 +25,17 @@ const style = computed<CSSProperties>(() => {
17
25
  '--block-bg': background
18
26
  ? `color-mix(in srgb, ${background} var(--block-tint, 15%), transparent)`
19
27
  : 'transparent',
20
- textAlign: ((props.settings.align as string) || 'left') as CSSProperties['textAlign'],
28
+ textAlign: ((props.settings.align as string) || 'justify') as CSSProperties['textAlign'],
21
29
  }
22
30
  })
23
31
  </script>
24
32
 
25
33
  <template>
26
- <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
+ >
27
39
  <div class="block__inner">
28
40
  <slot />
29
41
  </div>