gantri-components 2.112.0 → 2.113.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.
|
@@ -2,6 +2,7 @@ import { CheckboxVariant } from './checkbox.types';
|
|
|
2
2
|
export declare const StyledCheckboxWrapper: import("styled-components").StyledComponent<"label", import("styled-components").DefaultTheme, {}, never>;
|
|
3
3
|
export declare const StyledCheckbox: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
4
4
|
$checked: boolean;
|
|
5
|
+
$hasError?: boolean | undefined;
|
|
5
6
|
$variant?: CheckboxVariant | undefined;
|
|
6
7
|
}, never>;
|
|
7
8
|
export declare const StyledCheckboxContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { JSXElementConstructor, MouseEventHandler } from 'react';
|
|
2
|
-
import { TextVariant } from '../typography';
|
|
3
|
-
import { FieldChangeEvent } from '../text-field';
|
|
1
|
+
import { FocusEvent, JSXElementConstructor, MouseEventHandler } from 'react';
|
|
2
|
+
import { TextVariant, TypographyColor } from '../typography';
|
|
3
|
+
import { ErrorMessageType, FieldChangeEvent } from '../text-field';
|
|
4
4
|
export type CheckboxVariant = 'primary' | 'alert';
|
|
5
5
|
export interface CheckboxProps<T = boolean> {
|
|
6
6
|
/** Overrides `labelTx` and `labelText` props to render `Component` inside a `label` element. */
|
|
@@ -9,19 +9,31 @@ export interface CheckboxProps<T = boolean> {
|
|
|
9
9
|
}>;
|
|
10
10
|
checked?: boolean;
|
|
11
11
|
disabled?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* This field is used to map the error message, it can be a string
|
|
14
|
+
* or an object that contains tx and the values used to be mapped
|
|
15
|
+
* against translation keys.
|
|
16
|
+
* */
|
|
17
|
+
errorMessage?: ErrorMessageType;
|
|
12
18
|
indeterminate?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* This field is used only if `Component` is not provided.
|
|
21
|
+
* */
|
|
22
|
+
labelColor?: TypographyColor;
|
|
13
23
|
labelHtmlText?: string;
|
|
14
24
|
labelPosition?: 'left' | 'right';
|
|
15
25
|
labelText?: string;
|
|
16
26
|
labelTx?: string;
|
|
17
27
|
labelVariant?: TextVariant;
|
|
18
28
|
name?: string;
|
|
29
|
+
onBlur?: (event: FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
19
30
|
onChange?: (event: FieldChangeEvent<T>) => void;
|
|
20
31
|
/** Only fired if not disabled. */
|
|
21
32
|
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
33
|
+
onFocus?: (event: FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
|
22
34
|
onSelected?: (value: T) => void;
|
|
23
35
|
variant?: CheckboxVariant;
|
|
24
36
|
}
|
|
25
|
-
export interface LabelContentProps extends Pick<CheckboxProps, 'labelText' | 'labelTx' | 'labelVariant' | 'Component' | 'labelHtmlText'> {
|
|
37
|
+
export interface LabelContentProps extends Pick<CheckboxProps, 'labelText' | 'labelTx' | 'labelVariant' | 'labelColor' | 'Component' | 'labelHtmlText'> {
|
|
26
38
|
isChecked: boolean;
|
|
27
39
|
}
|