gantri-components 2.246.6 → 2.248.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.
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TextFieldSurface } from './text-field.types';
|
|
3
|
+
/**
|
|
4
|
+
* Lets a parent (typically a `Modal` with `surface="dynamic"`) propagate
|
|
5
|
+
* the surface treatment to all `TextField` / `Dropdown` / `SearchField` /
|
|
6
|
+
* `TextArea` descendants without the consumer having to set `surface`
|
|
7
|
+
* on every input.
|
|
8
|
+
*
|
|
9
|
+
* Resolution order (TextField reads): explicit `surface` prop → context
|
|
10
|
+
* value → undefined (falls back to theme-based legacy behavior).
|
|
11
|
+
*/
|
|
12
|
+
export declare const TextFieldSurfaceContext: import("react").Context<TextFieldSurface | undefined>;
|
|
@@ -4,5 +4,9 @@ export declare const StyledParentContainer: import("styled-components/dist/types
|
|
|
4
4
|
export declare const StyledInputContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledInputContainerProps>> & string;
|
|
5
5
|
export declare const StyledInput: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, never>> & string;
|
|
6
6
|
export declare const StyledFloatingInputWrap: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
7
|
-
export declare const StyledFloatingLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").
|
|
8
|
-
|
|
7
|
+
export declare const StyledFloatingLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, {
|
|
8
|
+
$surface?: "flat" | "dynamic" | undefined;
|
|
9
|
+
}>> & string;
|
|
10
|
+
export declare const StyledFloatingLabelOptional: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
11
|
+
$surface?: "flat" | "dynamic" | undefined;
|
|
12
|
+
}>> & string;
|
|
@@ -11,6 +11,23 @@ export type ErrorMessageType = string | {
|
|
|
11
11
|
};
|
|
12
12
|
export type TextFieldSize = 'small' | 'medium' | 'large';
|
|
13
13
|
export type TextFieldVariant = 'line' | 'filled';
|
|
14
|
+
/**
|
|
15
|
+
* Container fill / text treatment, independent of theme. Mirrors the
|
|
16
|
+
* Figma GDS 3.0 input surface variants:
|
|
17
|
+
*
|
|
18
|
+
* - `'flat'` — solid `rgba(0,0,0,0.07)` tint, near-black text. Use over
|
|
19
|
+
* light page backgrounds in any theme.
|
|
20
|
+
* - `'dynamic'` — frosted-glass luminosity blend (`rgba(204,204,204,0.13)`)
|
|
21
|
+
* with white text. Designed for inputs over photography / dark imagery
|
|
22
|
+
* (e.g. inside a `Modal surface="dynamic"`).
|
|
23
|
+
*
|
|
24
|
+
* Leave `surface` undefined to inherit from the nearest
|
|
25
|
+
* `TextFieldSurfaceContext` provider (a `Modal surface="dynamic"`
|
|
26
|
+
* automatically broadcasts `'dynamic'` to its descendants). When neither
|
|
27
|
+
* prop nor context are set, falls back to the legacy theme-based
|
|
28
|
+
* behavior (modern-dark looks Dynamic, others look Flat).
|
|
29
|
+
*/
|
|
30
|
+
export type TextFieldSurface = 'flat' | 'dynamic';
|
|
14
31
|
export type LabelPosition = 'top' | 'left' | 'floating';
|
|
15
32
|
export interface TextFieldProps {
|
|
16
33
|
ariaLabel?: string;
|
|
@@ -67,6 +84,13 @@ export interface TextFieldProps {
|
|
|
67
84
|
size?: ResolutionAwareProp<TextFieldSize>;
|
|
68
85
|
step?: string | number | undefined;
|
|
69
86
|
style?: CSSProperties;
|
|
87
|
+
/**
|
|
88
|
+
* Visual surface variant. See `TextFieldSurface` for details. When
|
|
89
|
+
* omitted, the input inherits from `TextFieldSurfaceContext` (set
|
|
90
|
+
* automatically by `Modal surface="dynamic"`), and ultimately falls
|
|
91
|
+
* back to theme-based behavior.
|
|
92
|
+
*/
|
|
93
|
+
surface?: TextFieldSurface;
|
|
70
94
|
throttle?: number;
|
|
71
95
|
type?: HTMLInputTypeAttribute | undefined;
|
|
72
96
|
value?: string;
|
|
@@ -83,6 +107,7 @@ export interface StyledInputContainerProps extends Pick<TextFieldProps, 'variant
|
|
|
83
107
|
$disabled: boolean;
|
|
84
108
|
$floating?: boolean;
|
|
85
109
|
$size?: ResolutionAwareProp<TextFieldSize>;
|
|
110
|
+
$surface?: TextFieldSurface;
|
|
86
111
|
$withErrors: boolean;
|
|
87
112
|
}
|
|
88
113
|
export interface StyledParentContainerProps extends Pick<TextFieldProps, 'labelPosition' | 'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft' | 'horizontalMargin' | 'verticalMargin' | 'margin'> {
|