@rsltda/components 1.0.21 → 1.0.23

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 CHANGED
@@ -41,7 +41,11 @@ import "@rsltda/components/rs-components.es.js";
41
41
  ```html
42
42
  <rs-whatsapp
43
43
  marca="ktm"
44
- position="bottom-right"
44
+ position="top-right"
45
+ --rs-whatsapp-z-index="10000"
46
+ --rs-whatsapp-font-family="Inter, sans-serif"
47
+ --rs-whatsapp-offset-x="32px"
48
+ --rs-whatsapp-offset-y="32px"
45
49
  time-zone="America/Santiago"
46
50
  >
47
51
  <rs-whatsapp-schedule dias="lun-vie" desde="09:00" hasta="18:00"></rs-whatsapp-schedule>
@@ -90,7 +94,7 @@ import "@rsltda/components/rs-components.es.js";
90
94
  | `label` | Texto visible cuando se usa `show-label`. Por defecto `WhatsApp`. |
91
95
  | `menu-label` | Texto de la accion por defecto dentro del menu. Por defecto `compra de motos`. |
92
96
  | `aria-label` | Etiqueta accesible del boton. Por defecto `Contactar por WhatsApp`. |
93
- | `position` | Posicion flotante: `bottom-right`, `bottom-left`, `top-right` o `top-left`. |
97
+ | `position` | Posicion flotante: `bottom-right`, `bottom-center`, `bottom-left`, `center-right`, `center`, `center-left`, `top-right`, `top-center` o `top-left`. Por defecto `bottom-right`. |
94
98
  | `show-label` | Muestra el texto junto al icono. |
95
99
  | `target` | Target del enlace. Por defecto `_blank`. |
96
100
  | `marca` | Variante visual para elementos internos como el icono de moto: `ktm`, `hqv`, `gasgas`, `voge` o `rs`. El boton principal mantiene el verde de WhatsApp. |
@@ -98,7 +102,44 @@ import "@rsltda/components/rs-components.es.js";
98
102
  | `horario` | Horario de atencion opcional en formato compacto. Ejemplo: `lun-vie 09:00-18:00; sab 10:00-14:00`. |
99
103
  | `fuera-horario` | Fuerza el estado fuera de horario manualmente. |
100
104
  | `mensaje-fuera-horario` | Mensaje mostrado cuando el componente esta fuera de horario. Si hay horario configurado, el componente agrega el resumen del horario. |
101
- | `time-zone` | Zona horaria IANA opcional para evaluar `horario`, por ejemplo `America/Santiago`. Si no se define, usa la zona horaria del navegador. |
105
+ | `time-zone` | Zona horaria IANA opcional para evaluar `horario`, por ejemplo `America/Santiago`. Si no se define, usa `America/Santiago`. |
106
+
107
+ ### Variables CSS configurables
108
+
109
+ Estas variables se pueden pasar como atributos que empiecen por `--`, por ejemplo `--rs-whatsapp-z-index="10000"`.
110
+
111
+ | Variable CSS | Valor por defecto | Descripcion |
112
+ | --- | --- | --- |
113
+ | `--rs-whatsapp-right` | `24px` | Separacion horizontal desde la derecha en `bottom-right` y `top-right`. |
114
+ | `--rs-whatsapp-left` | `24px` | Separacion horizontal desde la izquierda en `bottom-left`, `top-left`, `center-left` y `bottom-center`/`top-center` cuando aplica. |
115
+ | `--rs-whatsapp-top` | `24px` | Separacion vertical desde arriba en `top-right`, `top-left`, `top-center` y variantes centradas verticalmente. |
116
+ | `--rs-whatsapp-bottom` | `24px` | Separacion vertical desde abajo en `bottom-right`, `bottom-left`, `bottom-center` y variantes centradas verticalmente. |
117
+ | `--rs-whatsapp-mobile-right` | `16px` | Separacion horizontal desde la derecha en mobile. |
118
+ | `--rs-whatsapp-mobile-left` | `16px` | Separacion horizontal desde la izquierda en mobile. |
119
+ | `--rs-whatsapp-mobile-top` | `16px` | Separacion vertical desde arriba en mobile. |
120
+ | `--rs-whatsapp-mobile-bottom` | `16px` | Separacion vertical desde abajo en mobile. |
121
+ | `--rs-whatsapp-offset-x` | `0px` | Ajuste fino horizontal adicional para desplazar la posicion. |
122
+ | `--rs-whatsapp-offset-y` | `0px` | Ajuste fino vertical adicional para desplazar la posicion. |
123
+ | `--rs-whatsapp-z-index` | `9999` | Orden de apilado del componente. |
124
+ | `--rs-whatsapp-font-family` | `system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif` | Familia tipografica del componente. |
125
+ | `--rs-whatsapp-size` | `60px` | Tamano del boton principal. |
126
+ | `--rs-whatsapp-bg` | `#25d366` | Color de fondo del boton principal. |
127
+ | `--rs-whatsapp-color` | `#ffffff` | Color del icono y texto del boton principal. |
128
+ | `--rs-whatsapp-shadow` | `0 10px 24px rgb(0 0 0 / 22%)` | Sombra del boton principal. |
129
+ | `--rs-whatsapp-shadow-hover` | `0 14px 28px rgb(0 0 0 / 26%)` | Sombra del boton principal en hover. |
130
+ | `--rs-whatsapp-menu-width` | `280px` | Ancho maximo del menu. |
131
+ | `--rs-whatsapp-menu-border` | `#e5e7eb` | Borde del menu. |
132
+ | `--rs-whatsapp-menu-radius` | `8px` | Radio de borde del menu. |
133
+ | `--rs-whatsapp-menu-bg` | `#ffffff` | Fondo del menu. |
134
+ | `--rs-whatsapp-menu-color` | `#111827` | Color de texto del menu. |
135
+ | `--rs-whatsapp-menu-shadow` | `0 18px 38px rgb(0 0 0 / 18%)` | Sombra del menu. |
136
+ | `--rs-whatsapp-menu-muted` | `#4b5563` | Color del texto secundario del encabezado del menu. |
137
+ | `--rs-whatsapp-menu-brand` | `#111827` | Color del texto principal del encabezado del menu. |
138
+ | `--rs-whatsapp-menu-hover-bg` | `#f3f4f6` | Fondo de hover para las opciones del menu. |
139
+ | `--rs-whatsapp-menu-icon-color` | `var(--rs-whatsapp-brand-color)` | Color de los iconos del menu. |
140
+ | `--rs-whatsapp-closed-bg` | `#f3f4f6` | Fondo del mensaje fuera de horario. |
141
+ | `--rs-whatsapp-closed-color` | `#374151` | Color del mensaje fuera de horario. |
142
+ | `--rs-whatsapp-brand-color` | `#25d366` | Color de marca usado por iconos internos y algunos acentos. Puede ser ajustado por `marca` o sobrescrito manualmente. |
102
143
 
103
144
  Si `<rs-whatsapp>` contiene uno o mas `<rs-whatsapp-option>`, el menu se genera desde esas opciones. Las opciones sin `telefono` no se muestran. Si no contiene opciones, usa `telefono`, `mensaje` y `menu-label` del componente padre como opcion unica.
104
145
 
@@ -59,7 +59,7 @@
59
59
  "name": "RsWhatsapp",
60
60
  "tagName": "rs-whatsapp",
61
61
  "customElement": true,
62
- "description": "Web component para mostrar un boton flotante de WhatsApp con menu configurable.",
62
+ "description": "Web component para mostrar un boton flotante de WhatsApp con menu configurable. Ademas, cualquier atributo que empiece por -- se copia al :host como variable CSS.",
63
63
  "attributes": [
64
64
  {
65
65
  "name": "telefono",
@@ -83,7 +83,7 @@
83
83
  },
84
84
  {
85
85
  "name": "position",
86
- "description": "Posicion flotante: bottom-right, bottom-left, top-right o top-left. Por defecto bottom-right."
86
+ "description": "Posicion flotante: bottom-right, bottom-center, bottom-left, center-right, center, center-left, top-right, top-center o top-left. Por defecto bottom-right."
87
87
  },
88
88
  {
89
89
  "name": "show-label",
@@ -115,7 +115,7 @@
115
115
  },
116
116
  {
117
117
  "name": "time-zone",
118
- "description": "Zona horaria IANA opcional para evaluar horario, por ejemplo America/Santiago. Si no se define, usa la zona horaria del navegador."
118
+ "description": "Zona horaria IANA opcional para evaluar horario, por ejemplo America/Santiago. Si no se define, usa America/Santiago."
119
119
  }
120
120
  ]
121
121
  },
@@ -8,7 +8,9 @@ export declare class RsWhatsapp extends HTMLElement {
8
8
  private closedMessageEl;
9
9
  private closedMessageTextEl;
10
10
  private labelEl;
11
+ private hostAttributeObserver?;
11
12
  private childrenObserver?;
13
+ private appliedCssVariableNames;
12
14
  static get observedAttributes(): string[];
13
15
  constructor();
14
16
  connectedCallback(): void;
@@ -18,6 +20,7 @@ export declare class RsWhatsapp extends HTMLElement {
18
20
  private syncAttributesToState;
19
21
  private buildWhatsappUrl;
20
22
  private sanitizePhone;
23
+ private syncCssVariablesFromAttributes;
21
24
  private syncBrandVariant;
22
25
  private normalizeBrandKey;
23
26
  private renderMenuOptions;
@@ -38,6 +41,7 @@ export declare class RsWhatsapp extends HTMLElement {
38
41
  private handleButtonClick;
39
42
  private handleMenuClick;
40
43
  private handleCustomMenuSlotChange;
44
+ private handleHostAttributesMutation;
41
45
  private handleChildrenMutation;
42
46
  private handleDocumentClick;
43
47
  private handleDocumentKeydown;