@edc-motor/ui 0.4.18 → 0.4.19

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.19",
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,7 +21,8 @@
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,
@@ -160,10 +161,30 @@
160
161
  align-content: center; // centrado frente a la imagen sangrada
161
162
  }
162
163
 
164
+ // Botón del CTA: en estrecho va SIEMPRE centrado (como el del related);
165
+ // de $bp-sm para arriba manda su campo "Alineación del botón".
166
+ &__cta-button--left,
167
+ &__cta-button--center,
168
+ &__cta-button--right {
169
+ justify-self: center;
170
+ }
171
+
172
+ @media (min-width: $bp-sm) {
173
+ &__cta-button--left { justify-self: start; }
174
+ &__cta-button--center { justify-self: center; }
175
+ &__cta-button--right { justify-self: end; }
176
+ }
177
+
163
178
  // La imagen del CTA sangra hasta el borde de la tarjeta según su posición:
164
179
  // en columnas toca arriba, abajo y su lateral (el título viaja a la
165
180
  // columna de texto); arriba/abajo toca los laterales. Esquinas siguiendo
166
181
  // el radio de la tarjeta.
182
+ // La tarjeta del CTA lleva un halo SUTIL del acento, igual por los cuatro
183
+ // bordes (sin offset), además de su sombra de profundidad normal.
184
+ &--cta .block__card {
185
+ box-shadow: $shadow-sm, 0 0 18px color-mix(in srgb, $accent-500 30%, transparent);
186
+ }
187
+
167
188
  &--cta.block--image-right .block__media-layout .block__image-frame,
168
189
  &--cta.block--image-left .block__media-layout .block__image-frame {
169
190
  @container content (min-width: #{$bp-sm}) {
@@ -267,6 +288,9 @@
267
288
  align-items: center;
268
289
  gap: $space-2;
269
290
  padding: $space-2 $space-5;
291
+
292
+ // "Botón grande" (campo button_large del CTA): más aire interior.
293
+ &--large { padding: $space-4 $space-8; }
270
294
  border: 1px solid $accent-500;
271
295
  border-radius: $radius-md;
272
296
  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 }}
@@ -9,7 +9,8 @@ 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'}`)
13
14
 
14
15
  const style = computed<CSSProperties>(() => {
15
16
  const background = props.settings.background as string | undefined
@@ -17,7 +18,7 @@ const style = computed<CSSProperties>(() => {
17
18
  '--block-bg': background
18
19
  ? `color-mix(in srgb, ${background} var(--block-tint, 15%), transparent)`
19
20
  : 'transparent',
20
- textAlign: ((props.settings.align as string) || 'left') as CSSProperties['textAlign'],
21
+ textAlign: ((props.settings.align as string) || 'justify') as CSSProperties['textAlign'],
21
22
  }
22
23
  })
23
24
  </script>