@qasa/qds-ui 0.5.0 → 0.6.0
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/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/text-field/text-field.d.ts +5 -0
- package/dist/cjs/types/i18n/locale-context.d.ts +12 -0
- package/dist/cjs/types/i18n/locales.d.ts +8 -0
- package/dist/cjs/types/i18n/use-translation.d.ts +6 -0
- package/dist/cjs/types/qds-provider.d.ts +3 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/text-field/text-field.d.ts +5 -0
- package/dist/esm/types/i18n/locale-context.d.ts +12 -0
- package/dist/esm/types/i18n/locales.d.ts +8 -0
- package/dist/esm/types/i18n/use-translation.d.ts +6 -0
- package/dist/esm/types/qds-provider.d.ts +3 -1
- package/dist/index.d.ts +10 -1
- package/package.json +1 -1
|
@@ -10,6 +10,11 @@ interface TextFieldOptions extends InputBaseOptions {
|
|
|
10
10
|
* The error message to display if `isInvalid` is `true`
|
|
11
11
|
*/
|
|
12
12
|
errorMessage?: string;
|
|
13
|
+
/**
|
|
14
|
+
* If `true`, the input will display an optional indicator.
|
|
15
|
+
* If the `isRequired` prop is also `true`, this prop will be ignored.
|
|
16
|
+
*/
|
|
17
|
+
isOptional?: boolean;
|
|
13
18
|
/**
|
|
14
19
|
* Text that provides additional guidance to the user
|
|
15
20
|
*/
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { LanguageCode } from './locales';
|
|
3
|
+
interface LocaleContextValue {
|
|
4
|
+
currentLanguage: LanguageCode;
|
|
5
|
+
}
|
|
6
|
+
interface LocaleProviderProps {
|
|
7
|
+
language: LanguageCode;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare function LocaleProvider({ language, children }: LocaleProviderProps): JSX.Element;
|
|
11
|
+
export declare function useLocale(): LocaleContextValue;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
declare const SUPPORTED_LANGUAGE_CODES: readonly ["en", "sv", "fi", "fr"];
|
|
2
|
+
export declare type LanguageCode = typeof SUPPORTED_LANGUAGE_CODES[number];
|
|
3
|
+
export interface Resource {
|
|
4
|
+
close: string;
|
|
5
|
+
optional: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const locales: Record<LanguageCode, Resource>;
|
|
8
|
+
export {};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { Options as EmotionCacheOptions } from '@emotion/cache';
|
|
3
3
|
import type { ThemeOverrides } from './theme';
|
|
4
|
+
import type { LanguageCode } from './i18n/locales';
|
|
4
5
|
interface QdsProviderProps {
|
|
5
6
|
children: ReactNode;
|
|
6
7
|
themeOverrides?: ThemeOverrides;
|
|
7
8
|
cacheOptions?: Partial<EmotionCacheOptions>;
|
|
9
|
+
locale: LanguageCode;
|
|
8
10
|
}
|
|
9
|
-
export declare function QdsProvider({ children, themeOverrides, cacheOptions }: QdsProviderProps): JSX.Element;
|
|
11
|
+
export declare function QdsProvider({ children, themeOverrides, cacheOptions, locale }: QdsProviderProps): JSX.Element;
|
|
10
12
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -708,12 +708,16 @@ declare const overrideTheme: (overrides: ThemeOverrides) => {
|
|
|
708
708
|
};
|
|
709
709
|
};
|
|
710
710
|
|
|
711
|
+
declare const SUPPORTED_LANGUAGE_CODES: readonly ["en", "sv", "fi", "fr"];
|
|
712
|
+
declare type LanguageCode = typeof SUPPORTED_LANGUAGE_CODES[number];
|
|
713
|
+
|
|
711
714
|
interface QdsProviderProps {
|
|
712
715
|
children: ReactNode;
|
|
713
716
|
themeOverrides?: ThemeOverrides;
|
|
714
717
|
cacheOptions?: Partial<Options>;
|
|
718
|
+
locale: LanguageCode;
|
|
715
719
|
}
|
|
716
|
-
declare function QdsProvider({ children, themeOverrides, cacheOptions }: QdsProviderProps): JSX.Element;
|
|
720
|
+
declare function QdsProvider({ children, themeOverrides, cacheOptions, locale }: QdsProviderProps): JSX.Element;
|
|
717
721
|
|
|
718
722
|
declare const SIZE_MAP: {
|
|
719
723
|
xs: number;
|
|
@@ -3750,6 +3754,11 @@ interface TextFieldOptions extends InputBaseOptions {
|
|
|
3750
3754
|
* The error message to display if `isInvalid` is `true`
|
|
3751
3755
|
*/
|
|
3752
3756
|
errorMessage?: string;
|
|
3757
|
+
/**
|
|
3758
|
+
* If `true`, the input will display an optional indicator.
|
|
3759
|
+
* If the `isRequired` prop is also `true`, this prop will be ignored.
|
|
3760
|
+
*/
|
|
3761
|
+
isOptional?: boolean;
|
|
3753
3762
|
/**
|
|
3754
3763
|
* Text that provides additional guidance to the user
|
|
3755
3764
|
*/
|