@telefonica/mistica 16.56.1-beta.1 → 16.57.0-beta.2

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.
Files changed (191) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/accordion.css-mistica.js +6 -6
  3. package/dist/align.css-mistica.js +1 -1
  4. package/dist/autocomplete.css-mistica.js +1 -1
  5. package/dist/avatar.css-mistica.js +1 -1
  6. package/dist/badge.css-mistica.js +1 -1
  7. package/dist/box.css-mistica.js +13 -13
  8. package/dist/boxed.css-mistica.js +24 -24
  9. package/dist/button-group.css-mistica.js +1 -1
  10. package/dist/button-layout.css-mistica.js +14 -14
  11. package/dist/button.css-mistica.js +30 -30
  12. package/dist/callout.css-mistica.js +11 -11
  13. package/dist/card-internal.css-mistica.js +15 -15
  14. package/dist/carousel.css-mistica.js +8 -8
  15. package/dist/checkbox.css-mistica.js +11 -11
  16. package/dist/chip.css-mistica.js +15 -15
  17. package/dist/circle.css-mistica.js +1 -1
  18. package/dist/community/advanced-data-card.css-mistica.js +6 -6
  19. package/dist/community/blocks.css-mistica.js +1 -1
  20. package/dist/community/example-component.css-mistica.js +1 -1
  21. package/dist/counter.css-mistica.js +1 -1
  22. package/dist/cover-hero.css-mistica.js +2 -2
  23. package/dist/credit-card-number-field.css-mistica.js +3 -3
  24. package/dist/date-field.css-mistica.js +1 -1
  25. package/dist/date-time-picker.css-mistica.js +1 -1
  26. package/dist/dialog.css-mistica.js +4 -4
  27. package/dist/divider.css-mistica.js +5 -5
  28. package/dist/double-field.css-mistica.js +2 -2
  29. package/dist/drawer.css-mistica.js +1 -1
  30. package/dist/empty-state-card.css-mistica.js +1 -1
  31. package/dist/empty-state.css-mistica.js +5 -5
  32. package/dist/fade-in.css-mistica.js +1 -1
  33. package/dist/feedback.css-mistica.js +1 -1
  34. package/dist/file-upload.css-mistica.js +7 -7
  35. package/dist/fixed-footer-layout.css-mistica.js +2 -2
  36. package/dist/form.css-mistica.js +1 -1
  37. package/dist/grid-layout.css-mistica.js +3 -3
  38. package/dist/grid.css-mistica.js +120 -120
  39. package/dist/header.css-mistica.js +1 -1
  40. package/dist/hero.css-mistica.js +2 -2
  41. package/dist/horizontal-scroll.css-mistica.js +1 -1
  42. package/dist/icon-button.css-mistica.js +53 -53
  43. package/dist/icons/icon-chevron.css-mistica.js +2 -2
  44. package/dist/icons/icon-error.css-mistica.js +1 -1
  45. package/dist/image.css-mistica.js +2 -2
  46. package/dist/inline.css-mistica.js +9 -9
  47. package/dist/list.css-mistica.js +1 -1
  48. package/dist/loading-bar.css-mistica.js +1 -1
  49. package/dist/loading-screen.css-mistica.js +4 -4
  50. package/dist/logo.css-mistica.js +5 -5
  51. package/dist/menu.css-mistica.js +13 -13
  52. package/dist/mosaic.css-mistica.js +1 -1
  53. package/dist/navigation-bar.css-mistica.js +18 -18
  54. package/dist/navigation-breadcrumbs.css-mistica.js +1 -1
  55. package/dist/package-version.js +1 -1
  56. package/dist/pin-field.css-mistica.js +1 -1
  57. package/dist/popover.css-mistica.js +1 -1
  58. package/dist/progress-bar.css-mistica.js +6 -6
  59. package/dist/radio-button.css-mistica.js +19 -19
  60. package/dist/rating.css-mistica.js +2 -2
  61. package/dist/responsive-layout.css-mistica.js +6 -6
  62. package/dist/screen-reader-only.css-mistica.js +1 -1
  63. package/dist/select.css-mistica.js +15 -15
  64. package/dist/sheet-action-row.css-mistica.js +1 -1
  65. package/dist/sheet-common.css-mistica.js +1 -1
  66. package/dist/sheet-info.css-mistica.js +1 -1
  67. package/dist/skeletons.css-mistica.js +6 -6
  68. package/dist/skins/skin-contract.css-mistica.js +684 -684
  69. package/dist/skip-link.css-mistica.js +1 -1
  70. package/dist/slider.css-mistica.js +18 -18
  71. package/dist/snackbar.css-mistica.js +4 -4
  72. package/dist/spinner.css-mistica.js +1 -1
  73. package/dist/square.css-mistica.js +1 -1
  74. package/dist/stack.css-mistica.js +5 -5
  75. package/dist/stacking-group.css-mistica.js +1 -1
  76. package/dist/stepper.css-mistica.js +2 -2
  77. package/dist/switch-component.css-mistica.js +35 -35
  78. package/dist/table.css-mistica.js +9 -9
  79. package/dist/tabs.css-mistica.js +17 -17
  80. package/dist/tag.css-mistica.js +1 -1
  81. package/dist/text-field-base.css-mistica.js +15 -15
  82. package/dist/text-field-components.css-mistica.js +3 -3
  83. package/dist/text-link.css-mistica.js +6 -6
  84. package/dist/text.css-mistica.js +6 -6
  85. package/dist/theme-context.css-mistica.js +1 -1
  86. package/dist/timeline.css-mistica.js +9 -9
  87. package/dist/timer.css-mistica.js +6 -6
  88. package/dist/tooltip.css-mistica.js +1 -1
  89. package/dist/touchable.css-mistica.js +1 -1
  90. package/dist/utils/aspect-ratio-support.css-mistica.js +2 -2
  91. package/dist/video.css-mistica.js +1 -1
  92. package/dist/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +1 -1
  93. package/dist-es/accordion.css-mistica.js +6 -6
  94. package/dist-es/align.css-mistica.js +1 -1
  95. package/dist-es/autocomplete.css-mistica.js +1 -1
  96. package/dist-es/avatar.css-mistica.js +1 -1
  97. package/dist-es/badge.css-mistica.js +1 -1
  98. package/dist-es/box.css-mistica.js +13 -13
  99. package/dist-es/boxed.css-mistica.js +23 -23
  100. package/dist-es/button-group.css-mistica.js +1 -1
  101. package/dist-es/button-layout.css-mistica.js +14 -14
  102. package/dist-es/button.css-mistica.js +30 -30
  103. package/dist-es/callout.css-mistica.js +11 -11
  104. package/dist-es/card-internal.css-mistica.js +15 -15
  105. package/dist-es/carousel.css-mistica.js +8 -8
  106. package/dist-es/checkbox.css-mistica.js +11 -11
  107. package/dist-es/chip.css-mistica.js +15 -15
  108. package/dist-es/circle.css-mistica.js +1 -1
  109. package/dist-es/community/advanced-data-card.css-mistica.js +6 -6
  110. package/dist-es/community/blocks.css-mistica.js +1 -1
  111. package/dist-es/community/example-component.css-mistica.js +1 -1
  112. package/dist-es/counter.css-mistica.js +1 -1
  113. package/dist-es/cover-hero.css-mistica.js +2 -2
  114. package/dist-es/credit-card-number-field.css-mistica.js +3 -3
  115. package/dist-es/date-field.css-mistica.js +1 -1
  116. package/dist-es/date-time-picker.css-mistica.js +1 -1
  117. package/dist-es/dialog.css-mistica.js +4 -4
  118. package/dist-es/divider.css-mistica.js +5 -5
  119. package/dist-es/double-field.css-mistica.js +2 -2
  120. package/dist-es/drawer.css-mistica.js +1 -1
  121. package/dist-es/empty-state-card.css-mistica.js +1 -1
  122. package/dist-es/empty-state.css-mistica.js +5 -5
  123. package/dist-es/fade-in.css-mistica.js +1 -1
  124. package/dist-es/feedback.css-mistica.js +1 -1
  125. package/dist-es/file-upload.css-mistica.js +7 -7
  126. package/dist-es/fixed-footer-layout.css-mistica.js +2 -2
  127. package/dist-es/form.css-mistica.js +1 -1
  128. package/dist-es/grid-layout.css-mistica.js +3 -3
  129. package/dist-es/grid.css-mistica.js +120 -120
  130. package/dist-es/header.css-mistica.js +1 -1
  131. package/dist-es/hero.css-mistica.js +2 -2
  132. package/dist-es/horizontal-scroll.css-mistica.js +1 -1
  133. package/dist-es/icon-button.css-mistica.js +53 -53
  134. package/dist-es/icons/icon-chevron.css-mistica.js +2 -2
  135. package/dist-es/icons/icon-error.css-mistica.js +1 -1
  136. package/dist-es/image.css-mistica.js +2 -2
  137. package/dist-es/inline.css-mistica.js +9 -9
  138. package/dist-es/list.css-mistica.js +1 -1
  139. package/dist-es/loading-bar.css-mistica.js +1 -1
  140. package/dist-es/loading-screen.css-mistica.js +4 -4
  141. package/dist-es/logo.css-mistica.js +5 -5
  142. package/dist-es/menu.css-mistica.js +13 -13
  143. package/dist-es/mosaic.css-mistica.js +1 -1
  144. package/dist-es/navigation-bar.css-mistica.js +18 -18
  145. package/dist-es/navigation-breadcrumbs.css-mistica.js +1 -1
  146. package/dist-es/package-version.js +1 -1
  147. package/dist-es/pin-field.css-mistica.js +1 -1
  148. package/dist-es/popover.css-mistica.js +1 -1
  149. package/dist-es/progress-bar.css-mistica.js +6 -6
  150. package/dist-es/radio-button.css-mistica.js +19 -19
  151. package/dist-es/rating.css-mistica.js +2 -2
  152. package/dist-es/responsive-layout.css-mistica.js +6 -6
  153. package/dist-es/screen-reader-only.css-mistica.js +1 -1
  154. package/dist-es/select.css-mistica.js +15 -15
  155. package/dist-es/sheet-action-row.css-mistica.js +1 -1
  156. package/dist-es/sheet-common.css-mistica.js +1 -1
  157. package/dist-es/sheet-info.css-mistica.js +1 -1
  158. package/dist-es/skeletons.css-mistica.js +6 -6
  159. package/dist-es/skins/skin-contract.css-mistica.js +684 -684
  160. package/dist-es/skip-link.css-mistica.js +1 -1
  161. package/dist-es/slider.css-mistica.js +18 -18
  162. package/dist-es/snackbar.css-mistica.js +4 -4
  163. package/dist-es/spinner.css-mistica.js +1 -1
  164. package/dist-es/square.css-mistica.js +1 -1
  165. package/dist-es/stack.css-mistica.js +5 -5
  166. package/dist-es/stacking-group.css-mistica.js +1 -1
  167. package/dist-es/stepper.css-mistica.js +2 -2
  168. package/dist-es/style.css +1 -1
  169. package/dist-es/switch-component.css-mistica.js +35 -35
  170. package/dist-es/table.css-mistica.js +9 -9
  171. package/dist-es/tabs.css-mistica.js +17 -17
  172. package/dist-es/tag.css-mistica.js +1 -1
  173. package/dist-es/text-field-base.css-mistica.js +15 -15
  174. package/dist-es/text-field-components.css-mistica.js +3 -3
  175. package/dist-es/text-link.css-mistica.js +6 -6
  176. package/dist-es/text.css-mistica.js +6 -6
  177. package/dist-es/theme-context.css-mistica.js +1 -1
  178. package/dist-es/timeline.css-mistica.js +9 -9
  179. package/dist-es/timer.css-mistica.js +6 -6
  180. package/dist-es/tooltip.css-mistica.js +1 -1
  181. package/dist-es/touchable.css-mistica.js +1 -1
  182. package/dist-es/utils/aspect-ratio-support.css-mistica.js +2 -2
  183. package/dist-es/video.css-mistica.js +1 -1
  184. package/dist-es/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +1 -1
  185. package/doc/design-tokens.md +19 -92
  186. package/doc/fonts.md +194 -76
  187. package/doc/layout.md +10 -3
  188. package/doc/llms.md +52 -9
  189. package/doc/patterns.md +11 -5
  190. package/doc/theme-config.md +38 -0
  191. package/package.json +1 -1
package/doc/fonts.md CHANGED
@@ -1,127 +1,260 @@
1
1
  # Fonts
2
2
 
3
- <!-- TOC -->
3
+ Mistica does **not** inject a font family automatically. Without explicit setup, browsers fall back to their
4
+ default serif font (Times New Roman on desktop). You must declare `@font-face` rules and set `font-family` on
5
+ `body`.
4
6
 
5
- - [Fonts](#fonts)
6
- - [Font family](#font-family)
7
- - [System Fonts (Roboto / San Francisco)](#system-fonts-roboto--san-francisco)
8
- - [OnAir or Telefonica fonts](#onair-or-telefonica-fonts)
9
- - [Override brower fonts for some specific html elements](#override-brower-fonts-for-some-specific-html-elements)
10
- - [Dynamic font sizes](#dynamic-font-sizes)
7
+ ## Font per skin
11
8
 
12
- <!-- /TOC -->
9
+ Each skin has a designated font family. Use the correct one for the skin your app is using:
13
10
 
14
- ## Font family
11
+ | Skin | Getter function | Font family |
12
+ | ---------------------------- | ---------------------- | ------------------- |
13
+ | `movistar-new` _(preferred)_ | `getMovistarNewSkin()` | `'Movistar Sans'` |
14
+ | `movistar` _(legacy)_ | `getMovistarSkin()` | `'On Air'` |
15
+ | `o2-new` _(preferred)_ | `getO2NewSkin()` | `'On Air'` |
16
+ | `o2` _(legacy)_ | `getO2Skin()` | `'On Air'` |
17
+ | `vivo-new` _(preferred)_ | `getVivoNewSkin()` | `'Vivo Type'` |
18
+ | `vivo` _(legacy)_ | `getVivoSkin()` | `'Roboto'` |
19
+ | `telefonica` | `getTelefonicaSkin()` | `'Telefonica Sans'` |
20
+ | `blau` | `getBlauSkin()` | `'Roboto'` |
21
+ | `tu` | `getTuSkin()` | `'Telefonica Sans'` |
22
+ | `esimflag` | `getEsimflagSkin()` | `'On Air'` |
15
23
 
16
- Mistica components are optimized to work with iOS/Android system fonts (Roboto and San Francisco), but it can
17
- also work fine with other font families.
24
+ ## Setting font-family
18
25
 
19
- ### System Fonts (Roboto / San Francisco)
26
+ Set the font from inside a component rendered under `ThemeContextProvider`. This keeps font and background
27
+ color in sync with the active theme, including in dark mode:
20
28
 
21
- If you use system fonts in your web application we recommend you to setup it as follows:
29
+ ```tsx
30
+ import {skinVars} from '@telefonica/mistica';
31
+
32
+ const GlobalStyles = () => (
33
+ <style>{`
34
+ body {
35
+ font-family: 'Movistar Sans', 'Helvetica', 'Arial', sans-serif;
36
+ background-color: ${skinVars.colors.background};
37
+ }
38
+ `}</style>
39
+ );
40
+ ```
41
+
42
+ Render `<GlobalStyles />` as a direct child of `ThemeContextProvider`, before the rest of the app.
43
+
44
+ ## @font-face setup
45
+
46
+ Declare the font weights your app needs. Mistica uses **300 (light), 400 (regular), 500 (medium) and 700
47
+ (bold)**. Serve the `.woff2` files from your own static hosting.
48
+
49
+ ### On Air (Movistar, O2, O2 New, Esimflag)
22
50
 
23
51
  ```css
52
+ @font-face {
53
+ font-family: 'On Air';
54
+ font-style: normal;
55
+ font-weight: 300;
56
+ src: url('/fonts/OnAir-Light.woff2') format('woff2');
57
+ }
58
+ @font-face {
59
+ font-family: 'On Air';
60
+ font-style: normal;
61
+ font-weight: 400;
62
+ src: url('/fonts/OnAir-Regular.woff2') format('woff2');
63
+ }
64
+ @font-face {
65
+ font-family: 'On Air';
66
+ font-style: normal;
67
+ font-weight: 500;
68
+ src: url('/fonts/OnAir-Medium.woff2') format('woff2');
69
+ }
70
+ @font-face {
71
+ font-family: 'On Air';
72
+ font-style: normal;
73
+ font-weight: 700;
74
+ src: url('/fonts/OnAir-Bold.woff2') format('woff2');
75
+ }
76
+
24
77
  body {
25
- font-family: -apple-system, 'Roboto', 'Helvetica', 'Arial', sans-serif;
78
+ font-family: 'On Air', 'Helvetica', 'Arial', sans-serif;
26
79
  }
27
80
  ```
28
81
 
29
- And additionaly declare a Roboto font family for desktop browsers. For example:
82
+ ### Movistar Sans (Movistar New)
30
83
 
31
84
  ```css
32
85
  @font-face {
33
- font-family: 'Roboto';
86
+ font-family: 'Movistar Sans';
34
87
  font-style: normal;
35
88
  font-weight: 300;
36
- src:
37
- local('Roboto Light'),
38
- local('Roboto-Light'),
39
- url('/static/fonts/roboto-v18-latin_latin-ext-300.woff2') format('woff2');
89
+ src: url('/fonts/MovistarSans-Light.woff2') format('woff2');
40
90
  }
41
91
  @font-face {
42
- font-family: 'Roboto';
92
+ font-family: 'Movistar Sans';
43
93
  font-style: normal;
44
94
  font-weight: 400;
45
- src:
46
- local('Roboto'),
47
- local('Roboto-Regular'),
48
- url('/static/fonts/roboto-v18-latin_latin-ext-regular.woff2') format('woff2');
95
+ src: url('/fonts/MovistarSans-Regular.woff2') format('woff2');
49
96
  }
50
97
  @font-face {
51
- font-family: 'Roboto';
98
+ font-family: 'Movistar Sans';
52
99
  font-style: normal;
53
100
  font-weight: 500;
54
- src:
55
- local('Roboto Medium'),
56
- local('Roboto-Medium'),
57
- url('/static/fonts/roboto-v18-latin_latin-ext-500.woff2') format('woff2');
101
+ src: url('/fonts/MovistarSans-Medium.woff2') format('woff2');
58
102
  }
59
103
  @font-face {
60
- font-family: 'Roboto';
104
+ font-family: 'Movistar Sans';
61
105
  font-style: normal;
62
106
  font-weight: 700;
63
- src:
64
- local('Roboto Bold'),
65
- local('Roboto-Bold'),
66
- url('/static/fonts/roboto-v18-latin_latin-ext-700.woff2') format('woff2');
107
+ src: url('/fonts/MovistarSans-Bold.woff2') format('woff2');
108
+ }
109
+
110
+ body {
111
+ font-family: 'Movistar Sans', 'Helvetica', 'Arial', sans-serif;
67
112
  }
68
113
  ```
69
114
 
70
- This is just an example, you'll need to change the `url()` declarations to point to the fonts served by your
71
- web server. The important part here is to serve different font weights for 300 (light), 400 (regular), 500
72
- (medium) and 700 (bold).
115
+ ### Vivo Type (Vivo New)
73
116
 
74
- ### OnAir or Telefonica fonts
117
+ ```css
118
+ @font-face {
119
+ font-family: 'Vivo Type';
120
+ font-style: normal;
121
+ font-weight: 300;
122
+ src: url('/fonts/vivo-type-light.woff2') format('woff2');
123
+ }
124
+ @font-face {
125
+ font-family: 'Vivo Type';
126
+ font-style: normal;
127
+ font-weight: 400;
128
+ src: url('/fonts/vivo-type-regular.woff2') format('woff2');
129
+ }
130
+ @font-face {
131
+ font-family: 'Vivo Type';
132
+ font-style: normal;
133
+ font-weight: 500;
134
+ src: url('/fonts/vivo-type-medium.woff2') format('woff2');
135
+ }
136
+ @font-face {
137
+ font-family: 'Vivo Type';
138
+ font-style: normal;
139
+ font-weight: 700;
140
+ src: url('/fonts/vivo-type-bold.woff2') format('woff2');
141
+ }
142
+
143
+ body {
144
+ font-family: 'Vivo Type', 'Helvetica', 'Arial', sans-serif;
145
+ }
146
+ ```
75
147
 
76
- Mistica works fine too with other fonts like OnAir or Telefonica fonts, but these fonts don't have a medium
77
- weight (only light, regular and bold). In these cases, we recomend to use the regular font weight for the 500
78
- `font-weight`. Something like this:
148
+ ### Telefonica Sans (Telefonica, Tu)
79
149
 
80
150
  ```css
81
151
  @font-face {
82
- font-family: 'OnAir';
152
+ font-family: 'Telefonica Sans';
83
153
  font-style: normal;
84
154
  font-weight: 300;
85
- src: url('/static/fonts/OnAir-Light.woff2') format('woff2');
155
+ src: url('/fonts/Telefonica_Sans_Light.woff2') format('woff2');
86
156
  }
87
157
  @font-face {
88
- font-family: 'OnAir';
158
+ font-family: 'Telefonica Sans';
89
159
  font-style: normal;
90
160
  font-weight: 400;
91
- src: url('/static/fonts/OnAir-Regular.woff2') format('woff2');
161
+ src: url('/fonts/Telefonica_Sans_Regular.woff2') format('woff2');
92
162
  }
93
163
  @font-face {
94
- font-family: 'OnAir';
164
+ font-family: 'Telefonica Sans';
95
165
  font-style: normal;
96
166
  font-weight: 500;
97
- /* Note we are using OnAir Regular for medium (500) font-weight too: */
98
- src: url('/static/fonts/OnAir-Regular.woff2') format('woff2');
167
+ src: url('/fonts/Telefonica_Sans_Medium.woff2') format('woff2');
99
168
  }
100
169
  @font-face {
101
- font-family: 'OnAir';
170
+ font-family: 'Telefonica Sans';
102
171
  font-style: normal;
103
172
  font-weight: 700;
104
- src: url('/static/fonts/OnAir-Bold.woff2') format('woff2');
173
+ src: url('/fonts/Telefonica_Sans_Bold.woff2') format('woff2');
105
174
  }
106
175
 
107
176
  body {
108
- font-family: 'OnAir', 'Helvetica', 'Arial', sans-serif;
177
+ font-family: 'Telefonica Sans', 'Helvetica', 'Arial', sans-serif;
109
178
  }
110
179
  ```
111
180
 
112
- ### Override brower fonts for some specific html elements
181
+ ### Roboto (Vivo, Blau)
113
182
 
114
- All the html elements in your page will inherit the body font by default, except if a style sheet sets a
115
- different font family for the element, and most browsers use to set specific font families for some elements
116
- like `input`, `textarea`, `pre`, etc. If you want to avoid that browser behavior, you have different options:
183
+ Roboto is available via [Google Fonts](https://fonts.google.com/specimen/Roboto) or
184
+ [Bunny Fonts](https://fonts.bunny.net/family/roboto) (GDPR-friendly alternative). The weights needed are 300,
185
+ 400, 500, and 700.
117
186
 
118
- 1. Explicitly set the your font family for those elements:
187
+ Google Fonts import:
188
+
189
+ ```html
190
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
191
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
192
+ <link
193
+ href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap"
194
+ rel="stylesheet"
195
+ />
196
+ ```
197
+
198
+ Or self-hosted `@font-face`:
119
199
 
120
200
  ```css
201
+ @font-face {
202
+ font-family: 'Roboto';
203
+ font-style: normal;
204
+ font-weight: 300;
205
+ src:
206
+ local('Roboto Light'),
207
+ local('Roboto-Light'),
208
+ url('/fonts/roboto-300.woff2') format('woff2');
209
+ }
210
+ @font-face {
211
+ font-family: 'Roboto';
212
+ font-style: normal;
213
+ font-weight: 400;
214
+ src:
215
+ local('Roboto'),
216
+ local('Roboto-Regular'),
217
+ url('/fonts/roboto-400.woff2') format('woff2');
218
+ }
219
+ @font-face {
220
+ font-family: 'Roboto';
221
+ font-style: normal;
222
+ font-weight: 500;
223
+ src:
224
+ local('Roboto Medium'),
225
+ local('Roboto-Medium'),
226
+ url('/fonts/roboto-500.woff2') format('woff2');
227
+ }
228
+ @font-face {
229
+ font-family: 'Roboto';
230
+ font-style: normal;
231
+ font-weight: 700;
232
+ src:
233
+ local('Roboto Bold'),
234
+ local('Roboto-Bold'),
235
+ url('/fonts/roboto-700.woff2') format('woff2');
236
+ }
237
+
121
238
  body {
122
239
  font-family: -apple-system, 'Roboto', 'Helvetica', 'Arial', sans-serif;
123
240
  }
241
+ ```
124
242
 
243
+ ## Body background color
244
+
245
+ Always set `body` background from inside a component under `ThemeContextProvider` using the
246
+ `skinVars.colors.background` token. This ensures the background matches the active theme in both light and
247
+ dark mode:
248
+
249
+ ```tsx
250
+ const GlobalStyles = () => <style>{`body { background-color: ${skinVars.colors.background}; }`}</style>;
251
+ ```
252
+
253
+ ## Override browser fonts for form elements
254
+
255
+ Some browsers apply a different `font-family` to form inputs, textareas, and code elements. Override with:
256
+
257
+ ```css
125
258
  input,
126
259
  textarea,
127
260
  pre,
@@ -130,23 +263,12 @@ code {
130
263
  }
131
264
  ```
132
265
 
133
- 2. Apply the font-family with a wildcard selector:
134
-
135
- ```css
136
- * {
137
- font-family: -apple-system, 'Roboto', 'Helvetica', 'Arial', sans-serif;
138
- }
139
- ```
140
-
141
- 3. Use a [reset.css](https://meyerweb.com/eric/tools/css/reset/) that does this for you.
142
-
143
- We use to recomend option 3.
266
+ Or use a CSS reset that handles this, such as
267
+ [modern-normalize](https://github.com/sindresorhus/modern-normalize).
144
268
 
145
269
  ## Dynamic font sizes
146
270
 
147
- Mistica components support scalling font sizes automatically based on OS or browser accesibility settings. If
148
- you want your web to properly work with dynamic font sizes, we recommend to setup a base font size of 16px or
149
- 100% (which is the same as 16px in most browsers):
271
+ To support OS/browser accessibility font size settings, set the base size on `html`:
150
272
 
151
273
  ```css
152
274
  html {
@@ -154,13 +276,9 @@ html {
154
276
  }
155
277
  ```
156
278
 
157
- Also, to make dynamic font sizes work properly in iOS devices you need to include this:
279
+ To support Dynamic Type on iOS:
158
280
 
159
281
  ```css
160
- /**
161
- * To enable Dynamic Type in apple devices:
162
- * See: https://dev.to/colingourlay/how-to-support-apple-s-dynamic-text-in-your-web-content-with-css-40c0
163
- */
164
282
  @supports (font: -apple-system-body) {
165
283
  html {
166
284
  font: -apple-system-body !important;
package/doc/layout.md CHANGED
@@ -73,15 +73,22 @@ Vertically distributes its children using the given `space` separation.
73
73
  ## Inline
74
74
 
75
75
  Horizontally distributes its children using the given `space` separation. This component can be considered as
76
- an horizontal `Stack`.
76
+ a horizontal `Stack`, and it covers the most common row-layout use cases you might otherwise solve with
77
+ `display: flex`.
77
78
 
78
- :information_source: Items can be aligned vertically. Check `Inline` component in
79
+ It supports:
80
+
81
+ - horizontal distribution via `space={number}` or `space="between" | "around" | "evenly"`
82
+ - vertical alignment of children via `alignItems="flex-start" | "flex-end" | "center" | "stretch" | "baseline"`
83
+ - wrapping via `wrap` and row spacing via `verticalSpace`
84
+
85
+ :information_source: Check `Inline` in
79
86
  [Storybook](https://mistica-web.vercel.app/?path=/story/layout-inline--default) to learn more about it.
80
87
 
81
88
  ### numeric space
82
89
 
83
90
  ```tsx
84
- <Inline space={16}>
91
+ <Inline space={16} alignItems="center">
85
92
  <Child1 />
86
93
  <Child2 />
87
94
  <Child3 />
package/doc/llms.md CHANGED
@@ -17,16 +17,31 @@ repository at `https://github.com/Telefonica/mistica-web/blob/master/doc/<filena
17
17
 
18
18
  ## Critical Rules
19
19
 
20
- 1. **NEVER hardcode colors.** Always use `skinVars.colors.*` design tokens from `@telefonica/mistica`.
20
+ 1. **NEVER hardcode colors in app/component UI code.** Always use `skinVars.colors.*` design tokens from
21
+ `@telefonica/mistica`. The exception is skin authoring: when creating or extending a `Skin`, you may use
22
+ built-in palette exports (for example `movistarNewPalette`) or your own custom palette/colors inside the
23
+ skin definition.
21
24
  2. **Try not to use raw `<div>` for layout.** Use Mistica layout components: `Box`, `Stack`, `Inline`,
22
25
  `Align`, `ResponsiveLayout`, `GridLayout`, `Grid`.
23
26
  3. **NEVER set font sizes manually.** Use text components: `Text1`-`Text10`, `Title1`-`Title4`.
24
27
  4. **NEVER set border radius manually.** Use `skinVars.borderRadii.*` or Mistica components that handle it
25
- automatically.
28
+ automatically. If you need to change the default visual styling of components (colors, border radius,
29
+ etc.) and there is no specific prop for it, create or extend a custom skin instead of adding ad hoc style
30
+ overrides.
26
31
  5. **Always wrap your app** with `<ThemeContextProvider>` and import `@telefonica/mistica/css/mistica.css`.
27
32
  6. **Always namespace React hooks**: `React.useState`, `React.useEffect`, `React.useRef`.
28
33
  7. **Add `'use client';`** directive to client components when using Next.js app router.
29
34
  8. Use `skinVars.rawColors.*` (not `skinVars.colors.*`) when applying alpha with `applyAlpha`.
35
+ 9. **Always set `font-family` on `body` and use the correct font for the active skin.** Mistica does NOT
36
+ inject a font — without it browsers render text with their default serif font (Times New Roman on desktop).
37
+ Each skin has a designated font; see the [fonts reference](./fonts.md) for `@font-face` setup and the
38
+ per-skin font table.
39
+ 10. **Always set `body` background color using `skinVars.colors.background`.** Without it the page background
40
+ won't match the theme (especially in dark mode). Do this inside a component rendered under
41
+ `ThemeContextProvider` so `skinVars` resolves to the correct theme values:
42
+ ```tsx
43
+ <style>{`body { background-color: ${skinVars.colors.background}; }`}</style>
44
+ ```
30
45
 
31
46
  ## Install
32
47
 
@@ -42,13 +57,22 @@ npm install @telefonica/mistica
42
57
 
43
58
  ## Quick Start
44
59
 
60
+ **Two global CSS concerns that Mistica does NOT handle automatically:**
61
+
62
+ 1. **Font family** — without it, browsers fall back to their default serif font (Times New Roman on desktop).
63
+ Each skin has its own font; see [fonts.md](./fonts.md) for the per-skin table and `@font-face` setup.
64
+ 2. **Body background color** — without it, the page background won't match the active theme (critical in dark
65
+ mode). Set it from inside a component rendered under `ThemeContextProvider` using
66
+ `skinVars.colors.background`.
67
+
45
68
  ```tsx
46
69
  'use client';
47
70
 
48
71
  import '@telefonica/mistica/css/mistica.css';
49
72
  import {
50
73
  ThemeContextProvider,
51
- getMovistarSkin,
74
+ getMovistarNewSkin,
75
+ skinVars,
52
76
  ResponsiveLayout,
53
77
  Box,
54
78
  Stack,
@@ -58,12 +82,23 @@ import {
58
82
  } from '@telefonica/mistica';
59
83
 
60
84
  const misticaTheme = {
61
- skin: getMovistarSkin(),
85
+ skin: getMovistarNewSkin(),
62
86
  i18n: {locale: 'es-ES', phoneNumberFormattingRegionCode: 'ES'},
63
87
  };
64
88
 
89
+ // Rendered under ThemeContextProvider so skinVars resolves correctly
90
+ const GlobalStyles = () => (
91
+ <style>{`
92
+ body {
93
+ font-family: 'Movistar Sans', 'Helvetica', 'Arial', sans-serif; /* font for Movistar New skin */
94
+ background-color: ${skinVars.colors.background};
95
+ }
96
+ `}</style>
97
+ );
98
+
65
99
  const App = () => (
66
100
  <ThemeContextProvider theme={misticaTheme}>
101
+ <GlobalStyles />
67
102
  <ResponsiveLayout>
68
103
  <Box paddingY={24}>
69
104
  <Stack space={16}>
@@ -100,8 +135,13 @@ type ThemeConfig = {
100
135
  };
101
136
  ```
102
137
 
103
- Available skins: `getMovistarSkin()`, `getVivoSkin()`, `getO2Skin()`, `getTelefonicaSkin()`, `getBlauSkin()`,
104
- `getTuSkin()`, and others via `getSkinByName()`. You can also create a custom skin.
138
+ Available skins: `getMovistarNewSkin()`, `getVivoNewSkin()`, `getO2NewSkin()`, `getTelefonicaSkin()`,
139
+ `getBlauSkin()`, `getTuSkin()`, and others via `getSkinByName()`. Legacy variants without the `New` suffix
140
+ also exist (`getMovistarSkin()`, `getVivoSkin()`, `getO2Skin()`); prefer the `New` versions for new projects.
141
+ You can also create a custom skin. If you need to customize default component colors, radii, or other visual
142
+ tokens beyond the props exposed by a component, prefer extending a skin over overriding component styles.
143
+ Built-in palette exports such as `movistarNewPalette`, `o2NewPalette`, `vivoNewPalette`, etc. are available
144
+ for skin authoring, and custom skins may also define their own palette colors from scratch.
105
145
 
106
146
  Built-in Link integrations: `Next12`, `Next13`, `Next14`, `ReactRouter5`, `ReactRouter6`.
107
147
 
@@ -159,11 +199,11 @@ Vertical rhythm: containers 24px padding, sections 32px spacing, elements 16px s
159
199
  ### Buttons
160
200
 
161
201
  `ButtonPrimary`, `ButtonSecondary`, `ButtonDanger`, `ButtonLink`, `ButtonLinkDanger`, `ButtonGroup`,
162
- `ButtonLayout`, `IconButton`, `ToggleIconButton`
202
+ `ButtonLayout`, `IconButton`, `ToggleIconButton`, `TextLink`
163
203
 
164
204
  ### Text
165
205
 
166
- `Text1`-`Text10`, `Title1`-`Title4`, `TextLink`
206
+ `Text1`-`Text10`, `Title1`-`Title4`
167
207
 
168
208
  ### Cards
169
209
 
@@ -231,6 +271,9 @@ All tokens via `skinVars` from `@telefonica/mistica`:
231
271
 
232
272
  - **Colors**: `skinVars.colors.*` (286 tokens for backgrounds, text, borders, controls, status, tags)
233
273
  - **Raw colors**: `skinVars.rawColors.*` (same tokens as RGB values, for use with `applyAlpha`)
274
+ - **Palettes for skin authoring**: built-in palette exports such as `movistarNewPalette`, `o2NewPalette`,
275
+ `vivoNewPalette`, etc. Use these only when creating/extending a `Skin`, not for styling app components
276
+ directly.
234
277
  - **Border radii**: `skinVars.borderRadii.*` (container, button, input, popup, chip, sheet, avatar, tag, etc.)
235
278
  - **Text presets**: Handled by text components, not accessed directly
236
279
 
@@ -246,7 +289,7 @@ All tokens via `skinVars` from `@telefonica/mistica`:
246
289
  - [Layout](./layout.md): Core layout primitives (Box, Stack, Inline, Align, Grid/GridItem, NegativeBox,
247
290
  Divider, HorizontalScroll, Boxed, Overlay, StackingGroup) and page layouts (ResponsiveLayout, HeaderLayout,
248
291
  GridLayout, MasterDetailLayout, FixedFooterLayout, ButtonFixedFooterLayout, ButtonLayout, DoubleField),
249
- vertical rhythm
292
+ vertical rhythm, and `Inline` alignment/wrapping capabilities
250
293
  - [Forms](./forms.md): Form component, all form field types, DoubleField, useForm hook
251
294
  - [Analytics](./analytics.md): trackingEvent prop, logEvent setup, default tracking, GA4 support,
252
295
  TrackingConfig
package/doc/patterns.md CHANGED
@@ -2,15 +2,18 @@
2
2
 
3
3
  ## Critical rules
4
4
 
5
- 1. **NEVER hardcode colors.** Always use `skinVars.colors.*` from `@telefonica/mistica`.
5
+ 1. **NEVER hardcode colors in app/component UI code.** Always use `skinVars.colors.*` from
6
+ `@telefonica/mistica`. For skins and theme-level customization, see [theme-config.md](./theme-config.md).
6
7
  2. **NEVER use raw `<div>` for layout.** Use `Box`, `Stack`, `Inline`, `ResponsiveLayout`, `GridLayout`,
7
8
  `Grid`.
8
9
  3. **NEVER set font sizes manually.** Use text components (`Text1`-`Text10`, `Title1`-`Title4`).
9
10
  4. **NEVER set border radius manually.** Use `skinVars.borderRadii.*` or components that handle it (`Boxed`,
10
- cards, etc.).
11
+ cards, etc.). For theme-level visual customization without a dedicated component prop, use a custom skin.
11
12
  5. **Always wrap your app** with `ThemeContextProvider` and import `@telefonica/mistica/css/mistica.css`.
12
13
  6. **Always namespace React hooks**: `React.useState`, `React.useEffect`, `React.useRef`, etc.
13
14
  7. **Add `'use client';`** directive to client components when using Next.js app router.
15
+ 8. **Set `font-family` and `body` background color.** See [llms.md](./llms.md) rules 9–10 and
16
+ [fonts.md](./fonts.md) for the per-skin font table, `@font-face` setup, and the `GlobalStyles` pattern.
14
17
 
15
18
  ## Page layout composition
16
19
 
@@ -121,7 +124,7 @@ import {skinVars, applyAlpha} from '@telefonica/mistica';
121
124
  const overlay = applyAlpha(skinVars.rawColors.backgroundBrand, 0.8);
122
125
  ```
123
126
 
124
- ### DON'T: Hardcode colors
127
+ ### DON'T: Hardcode colors in component code
125
128
 
126
129
  ```tsx
127
130
  // BAD - hardcoded colors
@@ -134,6 +137,9 @@ const overlay = applyAlpha(skinVars.rawColors.backgroundBrand, 0.8);
134
137
  <Boxed><Text2 regular>Content in container</Text2></Boxed>
135
138
  ```
136
139
 
140
+ If you need brand-specific defaults, put those colors in a custom skin and then consume them through
141
+ `skinVars.colors.*` instead of styling individual components with palette values.
142
+
137
143
  ## Responsive patterns
138
144
 
139
145
  ### Conditional rendering by screen size
@@ -509,7 +515,7 @@ return (
509
515
  import Link from 'next/link';
510
516
 
511
517
  const theme = {
512
- skin: getMovistarSkin(),
518
+ skin: getMovistarNewSkin(),
513
519
  i18n: {locale: 'es-ES', phoneNumberFormattingRegionCode: 'ES'},
514
520
  Link: {type: 'Next14', Component: Link},
515
521
  };
@@ -521,7 +527,7 @@ const theme = {
521
527
  import {Link} from 'react-router-dom';
522
528
 
523
529
  const theme = {
524
- skin: getMovistarSkin(),
530
+ skin: getMovistarNewSkin(),
525
531
  i18n: {locale: 'es-ES', phoneNumberFormattingRegionCode: 'ES'},
526
532
  Link: {type: 'ReactRouter6', Component: Link},
527
533
  };
@@ -95,6 +95,13 @@ If your app doesn't follow the branding of mistica builtin skins (Movistar, Vivo
95
95
  can still use mistica with your custom skin. Just import the `Skin` type and create a new skin config that
96
96
  implements the `Skin` interface (you need to define all the required color constants):
97
97
 
98
+ If you need to customize default component colors, border radii, or similar visual tokens and there is no
99
+ component prop for that, prefer a custom skin over ad hoc CSS/style overrides. You can:
100
+
101
+ - start from a built-in skin like `getMovistarNewSkin()` and override the tokens you need
102
+ - start from a built-in palette export like `movistarNewPalette`
103
+ - define your own palette/colors from scratch
104
+
98
105
  ```ts
99
106
  import type {Skin} from '@telefonica/mistica';
100
107
 
@@ -121,4 +128,35 @@ const skin: Skin = {
121
128
  </ThemeContextProvider>;
122
129
  ```
123
130
 
131
+ You can also extend an existing skin instead of defining everything from scratch:
132
+
133
+ ```ts
134
+ import {getMovistarNewSkin, movistarNewPalette, type Skin} from '@telefonica/mistica';
135
+
136
+ const baseSkin = getMovistarNewSkin();
137
+ const palette = {
138
+ ...movistarNewPalette,
139
+ brandPrimary: '#0050D8',
140
+ };
141
+
142
+ const skin: Skin = {
143
+ ...baseSkin,
144
+ name: 'Acme',
145
+ colors: {
146
+ ...baseSkin.colors,
147
+ brand: palette.brandPrimary,
148
+ backgroundBrand: palette.brandPrimary,
149
+ backgroundBrandTop: palette.brandPrimary,
150
+ backgroundBrandBottom: palette.blue800,
151
+ buttonPrimaryBackground: palette.brandPrimary,
152
+ buttonPrimaryBackgroundHover: palette.blue800,
153
+ buttonPrimaryBackgroundPressed: palette.blue800,
154
+ textButtonPrimary: palette.white,
155
+ },
156
+ };
157
+ ```
158
+
159
+ If you also need different default radii, override `borderRadii` in the custom skin rather than setting
160
+ border radius ad hoc in component styles.
161
+
124
162
  You can see an example in the [examples folder](../examples/custom-skin/).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telefonica/mistica",
3
- "version": "16.56.1-beta.1",
3
+ "version": "16.57.0-beta.2",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",