gantri-components 2.209.0 → 2.211.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,68 @@
1
+ import { ReactElement } from 'react';
2
+ import { ResolutionAwareProp } from '../../types/resolution-aware-prop.type';
3
+ import { BoxDimension } from '../box/box.types';
4
+ import { TextFieldSize } from '../text-field/text-field.types';
5
+ import { TextVariant } from '../typography';
6
+ export type OptionSelectorSize = TextFieldSize;
7
+ export interface OptionSelectorItem {
8
+ /** Unique value for this option. */
9
+ value: string;
10
+ /** Display label for the option. */
11
+ label: string;
12
+ /** Whether this option is disabled. */
13
+ disabled?: boolean;
14
+ /** Optional badge text displayed in the top-right corner of the option. */
15
+ badge?: string;
16
+ }
17
+ export interface OptionSelectorProps {
18
+ /** Array of options. Can be strings (used as both value and label) or OptionSelectorItem objects. */
19
+ items: (string | OptionSelectorItem)[];
20
+ /** Currently selected value. */
21
+ value: string;
22
+ /** Callback when an option is selected. */
23
+ onSelected: (value: string) => void;
24
+ /** Number of columns in the grid. */
25
+ columns?: ResolutionAwareProp<number>;
26
+ /** Gap between items. Defaults to '.5x' (4px). */
27
+ gap?: ResolutionAwareProp<BoxDimension>;
28
+ /** Label text displayed above the options. */
29
+ labelText?: string;
30
+ /** i18n translation key for label. */
31
+ labelTx?: string;
32
+ /** i18n components for label interpolation. */
33
+ labelTxComponents?: readonly ReactElement[] | {
34
+ readonly [tagName: string]: ReactElement;
35
+ };
36
+ /** i18n values for label interpolation. */
37
+ labelTxValues?: Record<string, unknown>;
38
+ /** Typography variant for the label. */
39
+ labelVariant?: ResolutionAwareProp<TextVariant>;
40
+ /** Optional name for form integration. */
41
+ name?: string;
42
+ /** Whether the field is required. */
43
+ required?: boolean;
44
+ /** Formik integration props - injected by FormikInput. */
45
+ onChange?: (event: {
46
+ target: {
47
+ name: string;
48
+ value: string;
49
+ };
50
+ }) => void;
51
+ /** Formik integration props - injected by FormikInput. */
52
+ onBlur?: (event: {
53
+ target: {
54
+ name: string;
55
+ };
56
+ }) => void;
57
+ /** Max width for each option button. */
58
+ optionMaxWidth?: string;
59
+ /** Size of the option buttons. Matches TextField sizes. Defaults to 'medium'. */
60
+ size?: ResolutionAwareProp<OptionSelectorSize>;
61
+ /** Error message from Formik validation. */
62
+ errorMessage?: string;
63
+ }
64
+ export interface StyledOptionProps {
65
+ $disabled: boolean;
66
+ $selected: boolean;
67
+ $size?: ResolutionAwareProp<OptionSelectorSize>;
68
+ }
@@ -3,15 +3,18 @@ import { RadioVariant } from './radio.types';
3
3
  export declare const StyledRadioContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
4
4
  $disabled?: boolean | undefined;
5
5
  }>> & string;
6
- export declare const StyledRadioWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, {
6
+ interface StyledRadioWrapperProps {
7
7
  disabled: boolean | undefined;
8
8
  isChecked: boolean | undefined;
9
9
  showAsTile: boolean | undefined;
10
- }>> & string;
11
- export declare const StyledRadio: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
12
- $checked?: boolean | undefined;
13
- $disabled?: boolean | undefined;
14
- $variant?: RadioVariant | undefined;
15
- }>> & string;
10
+ }
11
+ export declare const StyledRadioWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, StyledRadioWrapperProps>> & string;
12
+ interface StyledRadioProps {
13
+ $checked?: boolean;
14
+ $disabled?: boolean;
15
+ $variant?: RadioVariant;
16
+ }
17
+ export declare const StyledRadio: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledRadioProps>> & string;
16
18
  export declare const StyledRadioInput: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, never>> & string;
17
19
  export declare const StyledRadioMarker: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
20
+ export {};
@@ -2,9 +2,11 @@
2
2
  export declare const StyledToggleContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
3
3
  $disabled?: boolean | undefined;
4
4
  }>> & string;
5
- export declare const StyledToggle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
5
+ interface StyledToggleProps {
6
6
  $checked: boolean;
7
- $disabled?: boolean | undefined;
7
+ $disabled?: boolean;
8
8
  $withErrors: boolean;
9
- }>> & string;
9
+ }
10
+ export declare const StyledToggle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, StyledToggleProps>> & string;
10
11
  export declare const StyledToggleSwitch: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
12
+ export {};