@telefonica/mistica 16.55.0 → 16.56.1-beta.1
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 +31 -0
- package/css/mistica.css +1 -1
- package/dist/accordion.css-mistica.js +16 -16
- package/dist/align.css-mistica.js +2 -2
- package/dist/autocomplete.css-mistica.js +6 -6
- package/dist/autocomplete.css.d.ts +1 -0
- package/dist/avatar.css-mistica.js +3 -3
- package/dist/badge.css-mistica.js +7 -7
- package/dist/box.css-mistica.js +15 -15
- package/dist/boxed.css-mistica.js +31 -31
- package/dist/button-group.css-mistica.js +10 -10
- package/dist/button-layout.css-mistica.js +21 -21
- package/dist/button.css-mistica.js +51 -51
- package/dist/callout.css-mistica.js +16 -16
- package/dist/card-internal.css-mistica.js +36 -36
- package/dist/carousel.css-mistica.js +18 -18
- package/dist/checkbox.css-mistica.js +21 -21
- package/dist/chip.css-mistica.js +30 -30
- package/dist/circle.css-mistica.js +2 -2
- package/dist/community/advanced-data-card.css-mistica.js +26 -26
- package/dist/community/blocks.css-mistica.js +3 -3
- package/dist/community/example-component.css-mistica.js +2 -2
- package/dist/counter.css-mistica.js +12 -12
- package/dist/cover-hero.css-mistica.js +16 -16
- package/dist/credit-card-number-field.css-mistica.js +6 -6
- package/dist/date-field.css-mistica.js +1 -1
- package/dist/date-time-picker.css-mistica.js +2 -2
- package/dist/dialog.css-mistica.js +15 -15
- package/dist/divider.css-mistica.js +5 -5
- package/dist/double-field.css-mistica.js +4 -4
- package/dist/drawer.css-mistica.js +15 -15
- package/dist/empty-state-card.css-mistica.js +4 -4
- package/dist/empty-state.css-mistica.js +14 -14
- package/dist/fade-in.css-mistica.js +1 -1
- package/dist/feedback.css-mistica.js +14 -14
- package/dist/file-upload.css-mistica.js +14 -14
- package/dist/fixed-footer-layout.css-mistica.js +12 -12
- package/dist/form.css-mistica.js +2 -2
- package/dist/grid-layout.css-mistica.js +9 -9
- package/dist/grid.css-mistica.js +147 -147
- package/dist/header.css-mistica.js +5 -5
- package/dist/hero.css-mistica.js +11 -11
- package/dist/horizontal-scroll.css-mistica.js +3 -3
- package/dist/icon-button.css-mistica.js +66 -66
- package/dist/icons/icon-chevron.css-mistica.js +6 -6
- package/dist/icons/icon-error.css-mistica.js +3 -3
- package/dist/image.css-mistica.js +11 -11
- package/dist/inline.css-mistica.js +16 -16
- package/dist/list.css-mistica.js +15 -15
- package/dist/loading-bar.css-mistica.js +5 -5
- package/dist/loading-screen.css-mistica.js +15 -15
- package/dist/logo-blau-shell.d.ts +10 -0
- package/dist/logo-blau-shell.js +25 -0
- package/dist/logo-blau.d.ts +1 -1
- package/dist/logo-blau.js +25 -40
- package/dist/logo-common.d.ts +0 -1
- package/dist/logo-esimflag-shell.d.ts +10 -0
- package/dist/logo-esimflag-shell.js +25 -0
- package/dist/logo-esimflag.d.ts +1 -1
- package/dist/logo-esimflag.js +11 -26
- package/dist/logo-movistar-new-shell.d.ts +10 -0
- package/dist/logo-movistar-new-shell.js +25 -0
- package/dist/logo-movistar-new.d.ts +1 -1
- package/dist/logo-movistar-new.js +84 -103
- package/dist/logo-movistar-shell.d.ts +10 -0
- package/dist/logo-movistar-shell.js +25 -0
- package/dist/logo-movistar.d.ts +1 -1
- package/dist/logo-movistar.js +16 -31
- package/dist/logo-o2-new-shell.d.ts +8 -0
- package/dist/logo-o2-new-shell.js +24 -0
- package/dist/logo-o2-new.d.ts +1 -1
- package/dist/logo-o2-new.js +6 -13
- package/dist/logo-o2-shell.d.ts +8 -0
- package/dist/logo-o2-shell.js +24 -0
- package/dist/logo-o2.d.ts +1 -1
- package/dist/logo-o2.js +6 -13
- package/dist/logo-telefonica-shell.d.ts +10 -0
- package/dist/logo-telefonica-shell.js +25 -0
- package/dist/logo-telefonica.d.ts +1 -1
- package/dist/logo-telefonica.js +11 -26
- package/dist/logo-tu-shell.d.ts +8 -0
- package/dist/logo-tu-shell.js +24 -0
- package/dist/logo-tu.d.ts +1 -1
- package/dist/logo-tu.js +10 -14
- package/dist/logo-vivo-shell.d.ts +10 -0
- package/dist/logo-vivo-shell.js +25 -0
- package/dist/logo-vivo.d.ts +1 -1
- package/dist/logo-vivo.js +11 -26
- package/dist/logo.css-mistica.js +9 -9
- package/dist/logo.js +223 -205
- package/dist/media-queries.css-mistica.js +13 -13
- package/dist/menu.css-mistica.js +24 -24
- package/dist/mosaic.css-mistica.js +3 -3
- package/dist/navigation-bar.css-mistica.js +45 -45
- package/dist/navigation-breadcrumbs.css-mistica.js +5 -5
- package/dist/package-version.js +2 -2
- package/dist/pin-field.css-mistica.js +10 -10
- package/dist/popover.css-mistica.js +2 -2
- package/dist/progress-bar.css-mistica.js +12 -12
- package/dist/radio-button.css-mistica.js +33 -33
- package/dist/rating.css-mistica.js +12 -12
- package/dist/responsive-layout.css-mistica.js +20 -20
- package/dist/screen-reader-only.css-mistica.js +2 -2
- package/dist/select.css-mistica.js +29 -29
- package/dist/select.css.d.ts +1 -0
- package/dist/sheet-action-row.css-mistica.js +2 -2
- package/dist/sheet-common.css-mistica.js +16 -16
- package/dist/sheet-info.css-mistica.js +4 -4
- package/dist/skeletons.css-mistica.js +12 -12
- package/dist/skins/skin-contract.css-mistica.js +686 -686
- package/dist/skip-link.css-mistica.js +3 -3
- package/dist/slider.css-mistica.js +28 -28
- package/dist/snackbar.css-mistica.js +16 -16
- package/dist/spinner.css-mistica.js +5 -5
- package/dist/square.css-mistica.js +2 -2
- package/dist/stack.css-mistica.js +9 -9
- package/dist/stacking-group.css-mistica.js +2 -2
- package/dist/stepper.css-mistica.js +16 -16
- package/dist/switch-component.css-mistica.js +53 -53
- package/dist/table.css-mistica.js +24 -24
- package/dist/tabs.css-mistica.js +30 -30
- package/dist/tag.css-mistica.js +5 -5
- package/dist/text-field-base.css-mistica.js +30 -30
- package/dist/text-field-base.css.d.ts +1 -0
- package/dist/text-field-base.js +52 -51
- package/dist/text-field-components.css-mistica.js +20 -17
- package/dist/text-field-components.css.d.ts +1 -0
- package/dist/text-field-components.d.ts +2 -1
- package/dist/text-field-components.js +25 -25
- package/dist/text-link.css-mistica.js +10 -10
- package/dist/text.css-mistica.js +13 -13
- package/dist/theme-context.css-mistica.js +2 -2
- package/dist/timeline.css-mistica.js +18 -18
- package/dist/timer.css-mistica.js +13 -13
- package/dist/tooltip.css-mistica.js +12 -12
- package/dist/touchable.css-mistica.js +5 -5
- package/dist/utils/aspect-ratio-support.css-mistica.js +7 -7
- package/dist/video.css-mistica.js +2 -2
- package/dist/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +3 -3
- package/dist-es/accordion.css-mistica.js +7 -7
- package/dist-es/align.css-mistica.js +2 -2
- package/dist-es/autocomplete.css-mistica.js +2 -2
- package/dist-es/avatar.css-mistica.js +2 -2
- package/dist-es/badge.css-mistica.js +2 -2
- package/dist-es/box.css-mistica.js +15 -15
- package/dist-es/boxed.css-mistica.js +25 -25
- package/dist-es/button-group.css-mistica.js +2 -2
- package/dist-es/button-layout.css-mistica.js +16 -16
- package/dist-es/button.css-mistica.js +38 -38
- package/dist-es/callout.css-mistica.js +12 -12
- package/dist-es/card-internal.css-mistica.js +20 -20
- package/dist-es/carousel.css-mistica.js +10 -10
- package/dist-es/checkbox.css-mistica.js +14 -14
- package/dist-es/chip.css-mistica.js +17 -17
- package/dist-es/circle.css-mistica.js +2 -2
- package/dist-es/community/advanced-data-card.css-mistica.js +7 -7
- package/dist-es/community/blocks.css-mistica.js +2 -2
- package/dist-es/community/example-component.css-mistica.js +2 -2
- package/dist-es/counter.css-mistica.js +2 -2
- package/dist-es/cover-hero.css-mistica.js +4 -4
- package/dist-es/credit-card-number-field.css-mistica.js +4 -4
- package/dist-es/date-field.css-mistica.js +1 -1
- package/dist-es/date-time-picker.css-mistica.js +2 -2
- package/dist-es/dialog.css-mistica.js +5 -5
- package/dist-es/divider.css-mistica.js +5 -5
- package/dist-es/double-field.css-mistica.js +4 -4
- package/dist-es/drawer.css-mistica.js +2 -2
- package/dist-es/empty-state-card.css-mistica.js +2 -2
- package/dist-es/empty-state.css-mistica.js +7 -7
- package/dist-es/fade-in.css-mistica.js +1 -1
- package/dist-es/feedback.css-mistica.js +2 -2
- package/dist-es/file-upload.css-mistica.js +8 -8
- package/dist-es/fixed-footer-layout.css-mistica.js +4 -4
- package/dist-es/form.css-mistica.js +2 -2
- package/dist-es/grid-layout.css-mistica.js +4 -4
- package/dist-es/grid.css-mistica.js +127 -127
- package/dist-es/header.css-mistica.js +2 -2
- package/dist-es/hero.css-mistica.js +4 -4
- package/dist-es/horizontal-scroll.css-mistica.js +2 -2
- package/dist-es/icon-button.css-mistica.js +56 -56
- package/dist-es/icons/icon-chevron.css-mistica.js +4 -4
- package/dist-es/icons/icon-error.css-mistica.js +2 -2
- package/dist-es/image.css-mistica.js +4 -4
- package/dist-es/inline.css-mistica.js +10 -10
- package/dist-es/list.css-mistica.js +2 -2
- package/dist-es/loading-bar.css-mistica.js +2 -2
- package/dist-es/loading-screen.css-mistica.js +5 -5
- package/dist-es/logo-blau-shell.js +16 -0
- package/dist-es/logo-blau.js +36 -51
- package/dist-es/logo-esimflag-shell.js +16 -0
- package/dist-es/logo-esimflag.js +13 -28
- package/dist-es/logo-movistar-new-shell.js +16 -0
- package/dist-es/logo-movistar-new.js +86 -105
- package/dist-es/logo-movistar-shell.js +16 -0
- package/dist-es/logo-movistar.js +18 -33
- package/dist-es/logo-o2-new-shell.js +15 -0
- package/dist-es/logo-o2-new.js +7 -14
- package/dist-es/logo-o2-shell.js +15 -0
- package/dist-es/logo-o2.js +7 -14
- package/dist-es/logo-telefonica-shell.js +16 -0
- package/dist-es/logo-telefonica.js +13 -28
- package/dist-es/logo-tu-shell.js +15 -0
- package/dist-es/logo-tu.js +12 -16
- package/dist-es/logo-vivo-shell.js +16 -0
- package/dist-es/logo-vivo.js +13 -28
- package/dist-es/logo.css-mistica.js +7 -7
- package/dist-es/logo.js +221 -203
- package/dist-es/media-queries.css-mistica.js +3 -3
- package/dist-es/menu.css-mistica.js +15 -15
- package/dist-es/mosaic.css-mistica.js +2 -2
- package/dist-es/navigation-bar.css-mistica.js +20 -20
- package/dist-es/navigation-breadcrumbs.css-mistica.js +2 -2
- package/dist-es/package-version.js +2 -2
- package/dist-es/pin-field.css-mistica.js +2 -2
- package/dist-es/popover.css-mistica.js +2 -2
- package/dist-es/progress-bar.css-mistica.js +8 -8
- package/dist-es/radio-button.css-mistica.js +25 -25
- package/dist-es/rating.css-mistica.js +4 -4
- package/dist-es/responsive-layout.css-mistica.js +7 -7
- package/dist-es/screen-reader-only.css-mistica.js +2 -2
- package/dist-es/select.css-mistica.js +20 -20
- package/dist-es/sheet-action-row.css-mistica.js +2 -2
- package/dist-es/sheet-common.css-mistica.js +2 -2
- package/dist-es/sheet-info.css-mistica.js +2 -2
- package/dist-es/skeletons.css-mistica.js +8 -8
- package/dist-es/skins/skin-contract.css-mistica.js +686 -686
- package/dist-es/skip-link.css-mistica.js +2 -2
- package/dist-es/slider.css-mistica.js +20 -20
- package/dist-es/snackbar.css-mistica.js +5 -5
- package/dist-es/spinner.css-mistica.js +2 -2
- package/dist-es/square.css-mistica.js +2 -2
- package/dist-es/stack.css-mistica.js +7 -7
- package/dist-es/stacking-group.css-mistica.js +2 -2
- package/dist-es/stepper.css-mistica.js +4 -4
- package/dist-es/style.css +1 -1
- package/dist-es/switch-component.css-mistica.js +41 -41
- package/dist-es/table.css-mistica.js +11 -11
- package/dist-es/tabs.css-mistica.js +21 -21
- package/dist-es/tag.css-mistica.js +2 -2
- package/dist-es/text-field-base.css-mistica.js +17 -17
- package/dist-es/text-field-base.js +52 -51
- package/dist-es/text-field-components.css-mistica.js +4 -4
- package/dist-es/text-field-components.js +52 -52
- package/dist-es/text-link.css-mistica.js +9 -9
- package/dist-es/text.css-mistica.js +8 -8
- package/dist-es/theme-context.css-mistica.js +2 -2
- package/dist-es/timeline.css-mistica.js +11 -11
- package/dist-es/timer.css-mistica.js +7 -7
- package/dist-es/tooltip.css-mistica.js +3 -3
- package/dist-es/touchable.css-mistica.js +2 -2
- package/dist-es/utils/aspect-ratio-support.css-mistica.js +4 -4
- package/dist-es/video.css-mistica.js +2 -2
- package/dist-es/vivinho-loading-animation/vivinho-loading-animation.css-mistica.js +2 -2
- package/doc/analytics.md +145 -0
- package/doc/components.md +730 -0
- package/doc/design-tokens.md +199 -0
- package/doc/fonts.md +169 -0
- package/doc/forms.md +177 -0
- package/doc/images/layout/box.svg +6 -0
- package/doc/images/layout/grid-layout-desktop-5-4.svg +8 -0
- package/doc/images/layout/grid-layout-desktop-6-6.svg +8 -0
- package/doc/images/layout/grid-layout-desktop-8-4.svg +8 -0
- package/doc/images/layout/grid-layout-desktop.svg +16 -0
- package/doc/images/layout/grid-layout-mobile-5-4.svg +9 -0
- package/doc/images/layout/grid-layout-mobile-6-6.svg +9 -0
- package/doc/images/layout/grid-layout-mobile-8-4.svg +9 -0
- package/doc/images/layout/grid-layout-mobile.svg +5 -0
- package/doc/images/layout/grid-layout-tablet-5-4.svg +8 -0
- package/doc/images/layout/grid-layout-tablet-6-6.svg +8 -0
- package/doc/images/layout/grid-layout-tablet-8-4.svg +8 -0
- package/doc/images/layout/grid-layout-tablet.svg +5 -0
- package/doc/images/layout/header-layout-desktop.svg +6 -0
- package/doc/images/layout/header-layout-mobile.svg +6 -0
- package/doc/images/layout/header-layout-tablet.svg +6 -0
- package/doc/images/layout/inline-around.svg +6 -0
- package/doc/images/layout/inline-between.svg +6 -0
- package/doc/images/layout/inline-evenly.svg +6 -0
- package/doc/images/layout/inline.svg +6 -0
- package/doc/images/layout/master-detail-layout-desktop.svg +8 -0
- package/doc/images/layout/master-detail-layout-mobile-detail.svg +6 -0
- package/doc/images/layout/master-detail-layout-mobile-master.svg +6 -0
- package/doc/images/layout/negative-box-ok-outline.svg +17 -0
- package/doc/images/layout/negative-box-ok-preview.svg +11 -0
- package/doc/images/layout/negative-box-wrong-outline.svg +14 -0
- package/doc/images/layout/negative-box-wrong-preview.svg +11 -0
- package/doc/images/layout/responsive-layout-desktop.svg +4 -0
- package/doc/images/layout/responsive-layout-mobile.svg +4 -0
- package/doc/images/layout/responsive-layout-tablet.svg +4 -0
- package/doc/images/layout/stack.svg +8 -0
- package/doc/images/layout/vertical-rhythm.png +0 -0
- package/doc/layout.md +527 -0
- package/doc/llms.md +258 -0
- package/doc/lottie.md +17 -0
- package/doc/migration-guide.md +76 -0
- package/doc/patterns.md +546 -0
- package/doc/sheet.md +122 -0
- package/doc/testing.md +43 -0
- package/doc/texts.md +42 -0
- package/doc/theme-config.md +124 -0
- package/package.json +4 -4
package/doc/texts.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Customizable texts
|
|
2
|
+
|
|
3
|
+
Some components use some default texts that you can customize using [`theme` prop](./theme-config.md)
|
|
4
|
+
|
|
5
|
+
You can customize them in your page. For example:
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<ThemeContextProvider
|
|
9
|
+
theme={{
|
|
10
|
+
skin: getMovistarSkin(),
|
|
11
|
+
i18n: {locale: 'es-ES', phoneNumberFormattingRegionCode: 'ES'},
|
|
12
|
+
texts: {
|
|
13
|
+
formCreditCardExpirationError: 'Fecha incorrecta',
|
|
14
|
+
// ...
|
|
15
|
+
},
|
|
16
|
+
}}
|
|
17
|
+
>
|
|
18
|
+
<App />
|
|
19
|
+
</ThemeContextProvider>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
See the `Dictionary` type to known all the available texts.
|
|
23
|
+
|
|
24
|
+
If your application supports multi language, you may need to override all the texts and use localized
|
|
25
|
+
translation tokens depending on your user preferred language.
|
|
26
|
+
|
|
27
|
+
## Using Mística text tokens
|
|
28
|
+
|
|
29
|
+
You can use Mística tokens in your texts. The translate function `t` will translate the token using the
|
|
30
|
+
configured locale in the `ThemeContextProvider`.
|
|
31
|
+
|
|
32
|
+
Example:
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import {textTokens} from '@telefonica/mistica';
|
|
36
|
+
|
|
37
|
+
const MyComponent = () => {
|
|
38
|
+
const {t} = useTheme();
|
|
39
|
+
|
|
40
|
+
return <div>{t(textTokens.formCreditCardExpirationError)}</div>;
|
|
41
|
+
};
|
|
42
|
+
```
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Theme config
|
|
2
|
+
|
|
3
|
+
The `ThemeContextProvider` component receives a `theme` prop where you can customize some aspects of the lib.
|
|
4
|
+
The `theme` prop must have the following type:
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
type ThemeConfig = {
|
|
8
|
+
skin: Skin;
|
|
9
|
+
colorScheme?: ColorScheme;
|
|
10
|
+
i18n: {
|
|
11
|
+
locale: Locale;
|
|
12
|
+
phoneNumberFormattingRegionCode: RegionCode;
|
|
13
|
+
};
|
|
14
|
+
platformOverrides?: {
|
|
15
|
+
platform?: 'ios' | 'android';
|
|
16
|
+
insideNovumNativeApp?: boolean;
|
|
17
|
+
userAgent?: string;
|
|
18
|
+
};
|
|
19
|
+
texts?: Partial<Dictionary>;
|
|
20
|
+
analytics?: {
|
|
21
|
+
logEvent: (event: TrackingEvent) => Promise<void>;
|
|
22
|
+
};
|
|
23
|
+
Link?: LinkComponent;
|
|
24
|
+
useHrefDecorator: () => (href: string) => string;
|
|
25
|
+
preventCopyInFormFields?: boolean;
|
|
26
|
+
};
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Only `skin` and `i18n` are mandatory.
|
|
30
|
+
|
|
31
|
+
Here is a description of every attribute:
|
|
32
|
+
|
|
33
|
+
- `skin`: determines the look and feel used by the lib (colors, font weight, etc). You can use
|
|
34
|
+
`getMovistarSkin`, `getVivoSkin` to use a specific skin or `getSkinByName`. You can also create your own
|
|
35
|
+
custom skin.
|
|
36
|
+
- `colorScheme`: used to enable/disable the dark mode support. It can be `'light'` (force light mode),
|
|
37
|
+
`'dark'` (force dark mode), or `'auto'` (uses OS/browser settings, this is the default behavior). We
|
|
38
|
+
recommend using the default setting (`'auto'`) if you want to support dark mode in your app.
|
|
39
|
+
- `i18n`: we use this to localize some messages or formatting dates phone numbers, etc.
|
|
40
|
+
- `locale`: a valid locale (language and region codes separated by `'-'`). For example `'es-ES'`.
|
|
41
|
+
- `phoneNumberFormattingRegionCode`: region code used to format phone numbers (for example in
|
|
42
|
+
`PhoneNumberField`).
|
|
43
|
+
- `platformOverrides?`:
|
|
44
|
+
- `platform?`: the lib applies some style differences depending on the current platform.
|
|
45
|
+
`@telefonica/mistica` will try to automatically detect the platform, but you can manually set this setting
|
|
46
|
+
to `'ios'` or `'android'`
|
|
47
|
+
- `insideNovumNativeApp?:` some components have different behavior if the web is running inside a webview in
|
|
48
|
+
the native Novum App. The lib can autodetect it, but you can force it by setting this to `true`.
|
|
49
|
+
- `userAgent:` **IMPORTANT** In case you are using SSR, you should set this value with the user-agent header
|
|
50
|
+
you receive on every request to your server, otherwise the server-side render won't take the user agent
|
|
51
|
+
into account.
|
|
52
|
+
- `texts?`: some copies you can customize. See [texts doc](./texts.md).
|
|
53
|
+
- `t`: this is the translate funtion. It accepts a token as exported by `textTokens`. See
|
|
54
|
+
[texts doc](./texts.md).
|
|
55
|
+
- `analytics?`: see [analytics docs](./analytics.md).
|
|
56
|
+
- `Link?`: the `Link` component you want to use by Touchables that use the prop `to`. By default, the lib uses
|
|
57
|
+
an anchor tag (`<a>`). Use this prop to use the Link component from ReactRouter, Next.js or any other
|
|
58
|
+
library. Please read the [LinkComponent](#linkcomponent) section for more info.
|
|
59
|
+
- `useHrefDecorator`: it is a React hook that a function that takes a `href` and returns a new `href`. This is
|
|
60
|
+
useful to automatically add parameters to the `href` being used in Touchable components (for example, to add
|
|
61
|
+
a `utm_source` parameter to the `href`).
|
|
62
|
+
- `preventCopyInFormFields?`: this is used as the default value for `preventCopy` prop in form fields. `false`
|
|
63
|
+
by default.
|
|
64
|
+
|
|
65
|
+
## LinkComponent
|
|
66
|
+
|
|
67
|
+
You can use a custom component or use a built in one. Mistica has built in support for: `Next12`, `Next13`,
|
|
68
|
+
`Next14`, `ReactRouter5` and `ReactRouter6`.
|
|
69
|
+
|
|
70
|
+
### Next example
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
import Link from 'next/link';
|
|
74
|
+
|
|
75
|
+
const theme: ThemeConfig = {
|
|
76
|
+
...
|
|
77
|
+
Link: {type: 'Next14', Component: Link}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### React Router example
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
import {Link} from 'react-router-dom';
|
|
85
|
+
|
|
86
|
+
const theme: ThemeConfig = {
|
|
87
|
+
...
|
|
88
|
+
Link: {type: 'ReactRouter6', Component: Link}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Create a custom skin
|
|
93
|
+
|
|
94
|
+
If your app doesn't follow the branding of mistica builtin skins (Movistar, Vivo, O2, Telefonica, etc.), you
|
|
95
|
+
can still use mistica with your custom skin. Just import the `Skin` type and create a new skin config that
|
|
96
|
+
implements the `Skin` interface (you need to define all the required color constants):
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
import type {Skin} from '@telefonica/mistica';
|
|
100
|
+
|
|
101
|
+
const skin: Skin = {
|
|
102
|
+
name: 'your skin name',
|
|
103
|
+
colors: {
|
|
104
|
+
// define here the required color constants
|
|
105
|
+
},
|
|
106
|
+
darkModeColors: {
|
|
107
|
+
// optionally define here the color constant overrides for dark mode
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
<ThemeContextProvider
|
|
112
|
+
theme={{
|
|
113
|
+
skin,
|
|
114
|
+
i18n: {
|
|
115
|
+
locale: 'es-ES',
|
|
116
|
+
phoneNumberFormattingRegionCode: 'ES',
|
|
117
|
+
},
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
<App />
|
|
121
|
+
</ThemeContextProvider>;
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
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.
|
|
3
|
+
"version": "16.56.1-beta.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"dist/**",
|
|
14
14
|
"dist-es/**",
|
|
15
15
|
"css/**",
|
|
16
|
+
"doc/**",
|
|
16
17
|
"community.d.ts",
|
|
17
18
|
"community.js"
|
|
18
19
|
],
|
|
@@ -116,7 +117,7 @@
|
|
|
116
117
|
"lodash": "^4.17.21",
|
|
117
118
|
"mini-css-extract-plugin": "^1.6.2",
|
|
118
119
|
"node-fetch": "^2.6.7",
|
|
119
|
-
"playroom": "^1.
|
|
120
|
+
"playroom": "^1.2.1",
|
|
120
121
|
"postcss": "^8.4.18",
|
|
121
122
|
"postcss-loader": "^4.2.0",
|
|
122
123
|
"prettier": "^3.3.2",
|
|
@@ -198,8 +199,7 @@
|
|
|
198
199
|
"@types/react-dom": "19.2.3",
|
|
199
200
|
"@testing-library/dom": "^8.19.1",
|
|
200
201
|
"lottie-react@^2.4.0": "patch:lottie-react@npm%3A2.4.0#./.yarn/patches/lottie-react-npm-2.4.0-d4d95c55aa.patch",
|
|
201
|
-
"playroom@^
|
|
202
|
-
"playroom@^1.0.3": "patch:playroom@npm%3A1.0.3#./.yarn/patches/playroom-npm-1.0.3-d8e0669615.patch"
|
|
202
|
+
"playroom@^1.2.1": "patch:playroom@npm%3A1.2.1#./.yarn/patches/playroom-npm-1.2.1-6d189aed91.patch"
|
|
203
203
|
},
|
|
204
204
|
"packageManager": "yarn@3.6.1",
|
|
205
205
|
"workspaces": [
|