@apolitical/component-library 3.1.0-beta.3 → 3.2.0-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.
@@ -1,10 +1,4 @@
1
- declare const supportedLanguages: {
2
- en: string;
3
- es: string;
4
- fr: string;
5
- pt: string;
6
- };
7
- export type LanguageType = keyof typeof supportedLanguages;
1
+ import { LanguageType } from '../../context';
8
2
  export type UrlPartsType = {
9
3
  url: string;
10
4
  position: 'before-lang' | 'after-lang';
@@ -23,7 +17,7 @@ interface Props {
23
17
  };
24
18
  };
25
19
  /** The function to call when the language is changed */
26
- onChange?: (language?: LanguageType) => void;
20
+ onChange?: (language?: LanguageType, url?: string) => void;
27
21
  /** Additional parts of the URL */
28
22
  urlParts?: UrlPartsType;
29
23
  /** The version of the language switcher to use */
@@ -1,2 +1,6 @@
1
- import { LanguageType, UrlPartsType } from './language-switcher';
2
- export declare const getUrl: (lang: LanguageType, urlParts?: UrlPartsType) => string;
1
+ import { LanguageType } from '../../context';
2
+ import { UrlPartsType } from './language-switcher';
3
+ export declare const getUrl: (lang: LanguageType, slug?: string, urlParts?: UrlPartsType) => string | {
4
+ url: string;
5
+ urlForRouter: string;
6
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/component-library",
3
- "version": "3.1.0-beta.3",
3
+ "version": "3.2.0-beta.1",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {