@midas-ds/components 6.2.0 → 7.0.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/CHANGELOG.md +4 -0
- package/character-counter/CharacterCounter.d.ts +3 -0
- package/character-counter/index.d.ts +1 -0
- package/field-error/FieldError.d.ts +3 -0
- package/field-error/index.d.ts +1 -0
- package/index.cjs +29 -29
- package/index.css +1 -1
- package/index.d.ts +2 -1
- package/index.js +5805 -5843
- package/package.json +1 -1
- package/textfield/Input.d.ts +4 -0
- package/textfield/PasswordField.d.ts +3 -0
- package/textfield/TextArea.d.ts +7 -0
- package/textfield/TextField.d.ts +5 -23
- package/textfield/TextFieldBase.d.ts +18 -0
- package/textfield/index.d.ts +3 -0
- package/textfield/intl/translations.json.d.ts +85 -0
- package/utils/intl/index.d.ts +2 -0
- package/utils/intl/useLocalizedStringFormatter.d.ts +11 -0
- package/utils/intl/useMessageFormatter.d.ts +11 -0
- package/textarea/TextArea.d.ts +0 -20
- package/textarea/index.d.ts +0 -1
package/package.json
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TextFieldBaseProps } from './TextFieldBase';
|
|
2
|
+
import { TextAreaProps as AriaTextAreaProps } from 'react-aria-components';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
export interface TextAreaProps extends Omit<TextFieldBaseProps, 'children' | 'type'> {
|
|
5
|
+
className?: AriaTextAreaProps['className'];
|
|
6
|
+
}
|
|
7
|
+
export declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
package/textfield/TextField.d.ts
CHANGED
|
@@ -1,25 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TextFieldBaseProps } from './TextFieldBase';
|
|
2
|
+
import { InputProps } from './Input';
|
|
2
3
|
import * as React from 'react';
|
|
3
|
-
export interface TextFieldProps extends
|
|
4
|
-
|
|
5
|
-
/** Specify label displayed above the TextField*/
|
|
6
|
-
label?: string;
|
|
7
|
-
/** Specify description displayed below the label */
|
|
8
|
-
description?: string;
|
|
9
|
-
/** Custom error messages */
|
|
10
|
-
errorMessage?: string | ((validation: ValidationResult) => string) | undefined;
|
|
11
|
-
/** Enable validations or add your own regex */
|
|
12
|
-
validationType?: 'ssn' | 'dossnr' | RegExp;
|
|
13
|
-
/**
|
|
14
|
-
* Whether to show the character counter or not
|
|
15
|
-
* @default
|
|
16
|
-
* false
|
|
17
|
-
*/
|
|
18
|
-
showCounter?: boolean;
|
|
4
|
+
export interface TextFieldProps extends Omit<TextFieldBaseProps, 'children'> {
|
|
5
|
+
className?: InputProps['className'];
|
|
19
6
|
}
|
|
20
|
-
export declare const TextField: React.
|
|
21
|
-
type InputWrapperProps = Pick<TextFieldProps, 'label' | 'description' | 'errorMessage' | 'children'>;
|
|
22
|
-
export declare const InputWrapper: ({ label, description, errorMessage, children, }: InputWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
export declare const ssnRegEx: RegExp;
|
|
24
|
-
export declare const dossNrRegEx: RegExp;
|
|
25
|
-
export {};
|
|
7
|
+
export declare const TextField: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TextFieldProps, ValidationResult } from 'react-aria-components';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface TextFieldBaseProps extends Omit<TextFieldProps, 'className'> {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
/** Specify label displayed above the TextField*/
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Specify description displayed below the label */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** Custom error messages */
|
|
10
|
+
errorMessage?: string | ((validation: ValidationResult) => string) | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Whether to show the character counter or not
|
|
13
|
+
* @default
|
|
14
|
+
* false
|
|
15
|
+
*/
|
|
16
|
+
showCounter?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const TextFieldBase: React.ForwardRefExoticComponent<TextFieldBaseProps & React.RefAttributes<HTMLDivElement>>;
|
package/textfield/index.d.ts
CHANGED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"en": {
|
|
3
|
+
"hide": "Hide",
|
|
4
|
+
"show": "Show"
|
|
5
|
+
},
|
|
6
|
+
"sv": {
|
|
7
|
+
"hide": "Dölj",
|
|
8
|
+
"show": "Visa"
|
|
9
|
+
},
|
|
10
|
+
"es": {
|
|
11
|
+
"hide": "Ocultar",
|
|
12
|
+
"show": "Mostrar"
|
|
13
|
+
},
|
|
14
|
+
"fr": {
|
|
15
|
+
"hide": "Cacher",
|
|
16
|
+
"show": "Afficher"
|
|
17
|
+
},
|
|
18
|
+
"de": {
|
|
19
|
+
"hide": "Verstecken",
|
|
20
|
+
"show": "Anzeigen"
|
|
21
|
+
},
|
|
22
|
+
"ja": {
|
|
23
|
+
"hide": "隠す",
|
|
24
|
+
"show": "表示"
|
|
25
|
+
},
|
|
26
|
+
"zh": {
|
|
27
|
+
"hide": "隐藏",
|
|
28
|
+
"show": "显示"
|
|
29
|
+
},
|
|
30
|
+
"ar": {
|
|
31
|
+
"hide": "إخفاء",
|
|
32
|
+
"show": "إظهار"
|
|
33
|
+
},
|
|
34
|
+
"ru": {
|
|
35
|
+
"hide": "Скрыть",
|
|
36
|
+
"show": "Показать"
|
|
37
|
+
},
|
|
38
|
+
"pt": {
|
|
39
|
+
"hide": "Ocultar",
|
|
40
|
+
"show": "Mostrar"
|
|
41
|
+
},
|
|
42
|
+
"it": {
|
|
43
|
+
"hide": "Nascondi",
|
|
44
|
+
"show": "Mostra"
|
|
45
|
+
},
|
|
46
|
+
"ko": {
|
|
47
|
+
"hide": "숨기기",
|
|
48
|
+
"show": "보여주기"
|
|
49
|
+
},
|
|
50
|
+
"hi": {
|
|
51
|
+
"hide": "छुपाएँ",
|
|
52
|
+
"show": "दिखाएँ"
|
|
53
|
+
},
|
|
54
|
+
"nl": {
|
|
55
|
+
"hide": "Verbergen",
|
|
56
|
+
"show": "Tonen"
|
|
57
|
+
},
|
|
58
|
+
"pl": {
|
|
59
|
+
"hide": "Ukryj",
|
|
60
|
+
"show": "Pokaż"
|
|
61
|
+
},
|
|
62
|
+
"tr": {
|
|
63
|
+
"hide": "Gizle",
|
|
64
|
+
"show": "Göster"
|
|
65
|
+
},
|
|
66
|
+
"vi": {
|
|
67
|
+
"hide": "Ẩn",
|
|
68
|
+
"show": "Hiện"
|
|
69
|
+
},
|
|
70
|
+
"th": {
|
|
71
|
+
"hide": "ซ่อน",
|
|
72
|
+
"show": "แสดง"
|
|
73
|
+
},
|
|
74
|
+
"id": {
|
|
75
|
+
"hide": "Sembunyikan",
|
|
76
|
+
"show": "Tampilkan"
|
|
77
|
+
},
|
|
78
|
+
"ms": {
|
|
79
|
+
"hide": "Sembunyikan",
|
|
80
|
+
"show": "Tunjukkan"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
;
|
|
84
|
+
|
|
85
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LocalizedString, LocalizedStringDictionary, LocalizedStringFormatter, LocalizedStrings } from '@internationalized/string';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a cached LocalizedStringDictionary for the given strings.
|
|
4
|
+
*/
|
|
5
|
+
export declare function useLocalizedStringDictionary<K extends string = string, T extends LocalizedString = string>(strings: LocalizedStrings<K, T>, packageName?: string): LocalizedStringDictionary<K, T>;
|
|
6
|
+
/**
|
|
7
|
+
* Provides localized string formatting for the current locale. Supports interpolating variables,
|
|
8
|
+
* selecting the correct pluralization, and formatting numbers. Automatically updates when the locale changes.
|
|
9
|
+
* @param strings - A mapping of languages to localized strings by key.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useLocalizedStringFormatter<K extends string = string, T extends LocalizedString = string>(strings: LocalizedStrings<K, T>, packageName?: string): LocalizedStringFormatter<K, T>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LocalizedStrings } from '@internationalized/message';
|
|
2
|
+
export type FormatMessage = (key: string, variables?: {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}) => string;
|
|
5
|
+
/**
|
|
6
|
+
* Handles formatting ICU Message strings to create localized strings for the current locale.
|
|
7
|
+
* Automatically updates when the locale changes, and handles caching of messages for performance.
|
|
8
|
+
* @param strings - A mapping of languages to strings by key.
|
|
9
|
+
* @deprecated - use useLocalizedStringFormatter instead.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useMessageFormatter(strings: LocalizedStrings): FormatMessage;
|
package/textarea/TextArea.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ValidationResult, TextFieldProps as AriaTextFieldProps } from 'react-aria-components';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
export interface TextAreaProps extends AriaTextFieldProps {
|
|
4
|
-
/** Specify label displayed above the TextArea*/
|
|
5
|
-
label?: string;
|
|
6
|
-
/** Specify description displayed below the label */
|
|
7
|
-
description?: string;
|
|
8
|
-
/** Set number of rows for the TextArea */
|
|
9
|
-
rows?: number;
|
|
10
|
-
/** Set minimum number of characters that are allowed before the TextArea is put in an invalid state */
|
|
11
|
-
minLength?: number;
|
|
12
|
-
/**
|
|
13
|
-
* Whether to show the character counter or not
|
|
14
|
-
* @default
|
|
15
|
-
* false
|
|
16
|
-
*/
|
|
17
|
-
showCounter?: boolean;
|
|
18
|
-
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
19
|
-
}
|
|
20
|
-
export declare const TextArea: React.FC<TextAreaProps>;
|
package/textarea/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { TextArea } from './TextArea';
|