@ssa-ui-kit/core 2.33.0 → 3.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/dist/components/AccordionGroup/Accordion.d.ts +37 -0
- package/dist/components/AccordionGroup/AccordionContent.d.ts +48 -0
- package/dist/components/AccordionGroup/AccordionContext.d.ts +76 -2
- package/dist/components/AccordionGroup/AccordionGroup.d.ts +56 -0
- package/dist/components/AccordionGroup/AccordionTitle.d.ts +41 -0
- package/dist/components/AccordionGroup/types.d.ts +199 -1
- package/dist/components/Avatar/Avatar.d.ts +33 -0
- package/dist/components/Button/Button.d.ts +61 -0
- package/dist/components/Button/fixtures.d.ts +52 -31
- package/dist/components/Button/styles.d.ts +7 -12
- package/dist/components/Button/types.d.ts +98 -4
- package/dist/components/Charts/BarGaugeChart/components/BarGaugeChartHeader.d.ts +1 -1
- package/dist/components/Charts/BarLineComplexChart/BarLineComplexChartView.d.ts +2 -2
- package/dist/components/Charts/BarLineComplexChart/types.d.ts +2 -2
- package/dist/components/Charts/BigNumberChart/BigNumberChart.d.ts +4 -2
- package/dist/components/Charts/BigNumberChart/components/BigNumberChartHeader.d.ts +1 -1
- package/dist/components/Charts/BigNumberChart/components/TrendLine.d.ts +8 -3
- package/dist/components/Charts/BigNumberChart/components/TrendLineTooltip.d.ts +8 -5
- package/dist/components/Charts/GaugeChart/components/GaugeChartBase.d.ts +3 -1
- package/dist/components/Charts/GaugeChart/components/GaugeChartHeader.d.ts +1 -1
- package/dist/components/Charts/PieChart/PieChartLegendMarker.d.ts +1 -1
- package/dist/components/Charts/PieChart/styles.d.ts +1 -1
- package/dist/components/Charts/PieChart/types.d.ts +1 -1
- package/dist/components/Charts/RadarChart/RadarChart.d.ts +1 -1
- package/dist/components/Charts/RadarChart/components/RadarChartHeader.d.ts +1 -1
- package/dist/components/Charts/TreeMapChart/TreeMapChart.d.ts +1 -1
- package/dist/components/Charts/TreeMapChart/TreeMapChartHeader.d.ts +1 -1
- package/dist/components/Charts/index.d.ts +1 -0
- package/dist/components/Charts/utils/nivoReact19Compat.d.ts +18 -0
- package/dist/components/Checkbox/Checkbox.d.ts +84 -0
- package/dist/components/Checkbox/CheckboxBase.d.ts +1 -1
- package/dist/components/Checkbox/styles.d.ts +2 -2
- package/dist/components/Checkbox/types.d.ts +104 -3
- package/dist/components/Chip/Chip.d.ts +70 -0
- package/dist/components/Chip/constants.d.ts +1 -1
- package/dist/components/Chip/helpers.d.ts +6 -0
- package/dist/components/Chip/types.d.ts +129 -1
- package/dist/components/CollapsibleNavBar/CollapsibleNavBar.d.ts +1 -1
- package/dist/components/CollapsibleNavBar/CollapsibleNavBarContext.d.ts +2 -2
- package/dist/components/CollapsibleNavBar/components/TriggerIcon.d.ts +4 -2
- package/dist/components/CollapsibleNavBar/types.d.ts +9 -2
- package/dist/components/ColorPicker/components/CopyButton.d.ts +1 -1
- package/dist/components/DatePicker/constants.d.ts +22 -0
- package/dist/components/DatePicker/hooks/useDatePicker.d.ts +7 -5
- package/dist/components/DatePicker/index.d.ts +1 -0
- package/dist/components/DatePicker/styles.d.ts +3 -2
- package/dist/components/DatePicker/types.d.ts +10 -2
- package/dist/components/DatePicker/utils/dates.d.ts +2 -2
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +1 -1
- package/dist/components/DateRangePicker/DateRangePickerFormBridge.d.ts +46 -0
- package/dist/components/DateRangePicker/components/DatesListWrapper.d.ts +3 -2
- package/dist/components/DateRangePicker/constants.d.ts +1 -0
- package/dist/components/DateRangePicker/hooks/useDateRangePicker.d.ts +22 -17
- package/dist/components/DateRangePicker/index.d.ts +3 -0
- package/dist/components/DateRangePicker/styles.d.ts +6 -4
- package/dist/components/DateRangePicker/types.d.ts +24 -7
- package/dist/components/DateRangePicker/utils/dates.d.ts +2 -2
- package/dist/components/Drawer/index.d.ts +2 -1
- package/dist/components/Dropdown/Dropdown.d.ts +88 -0
- package/dist/components/Dropdown/types.d.ts +78 -0
- package/dist/components/DropdownOptions/DropdownOptions.d.ts +31 -0
- package/dist/components/DropdownOptions/types.d.ts +22 -0
- package/dist/components/DropdownToggle/DropdownToggle.d.ts +1 -1
- package/dist/components/Field/FieldControl.d.ts +62 -1
- package/dist/components/Field/FieldDescription.d.ts +33 -0
- package/dist/components/Field/FieldError.d.ts +36 -0
- package/dist/components/Field/FieldLabel.d.ts +37 -0
- package/dist/components/Field/FieldProvider.d.ts +19 -1
- package/dist/components/Field/FieldRoot.d.ts +90 -0
- package/dist/components/Field/FieldSuccess.d.ts +34 -0
- package/dist/components/Field/index.d.ts +4 -0
- package/dist/components/Filters/FilterBlockWrapper.d.ts +3 -2
- package/dist/components/Filters/FiltersContext.d.ts +4 -4
- package/dist/components/Filters/hooks/useVisibility.d.ts +2 -2
- package/dist/components/FullscreenModeContext.d.ts +1 -4
- package/dist/components/Icon/icons/iconsList.d.ts +1 -1
- package/dist/components/IconButton/IconButton.d.ts +39 -0
- package/dist/components/IconButton/index.d.ts +2 -0
- package/dist/components/IconButton/styles.d.ts +2 -0
- package/dist/components/IconButton/types.d.ts +41 -0
- package/dist/components/Indicator/types.d.ts +4 -2
- package/dist/components/Input/types.d.ts +157 -0
- package/dist/components/JsonSchemaForm/fields/DateRangeField.d.ts +15 -1
- package/dist/components/JsonSchemaForm/utils/dateFormats.d.ts +37 -0
- package/dist/components/JsonSchemaForm/utils/dateRangeField.d.ts +24 -0
- package/dist/components/JsonSchemaForm/utils/index.d.ts +1 -0
- package/dist/components/JsonSchemaForm/utils/selectWidget.d.ts +16 -0
- package/dist/components/Modal/Modal.d.ts +60 -0
- package/dist/components/Modal/types.d.ts +21 -1
- package/dist/components/ModalContent/ModalContent.d.ts +42 -1
- package/dist/components/ModalDialog/ModalDialog.d.ts +27 -0
- package/dist/components/ModalDialog/types.d.ts +18 -0
- package/dist/components/ModalDismissButton/ModalDismissButton.d.ts +29 -2
- package/dist/components/ModalOpenButton/ModalOpenButton.d.ts +25 -1
- package/dist/components/NavBar/types.d.ts +1 -1
- package/dist/components/NotificationMenu/types.d.ts +3 -3
- package/dist/components/Pagination/ArrowButton.d.ts +32 -0
- package/dist/components/Pagination/Pagination.d.ts +81 -0
- package/dist/components/Pagination/PaginationButtons.d.ts +35 -0
- package/dist/components/Pagination/PaginationContext.d.ts +30 -0
- package/dist/components/Pagination/WithPagination.d.ts +47 -4
- package/dist/components/Pagination/components/RowsPerPageDropdown/RowsPerPageDropdown.d.ts +41 -0
- package/dist/components/Pagination/components/RowsPerPageDropdown/types.d.ts +39 -0
- package/dist/components/Pagination/styles.d.ts +1 -1
- package/dist/components/Pagination/types.d.ts +178 -0
- package/dist/components/PersonInfo/styles.d.ts +1 -1
- package/dist/components/Popover/Popover.d.ts +120 -0
- package/dist/components/Popover/PopoverClose.d.ts +26 -0
- package/dist/components/Popover/PopoverContent.d.ts +33 -0
- package/dist/components/Popover/PopoverDescription.d.ts +22 -1
- package/dist/components/Popover/PopoverHeading.d.ts +22 -1
- package/dist/components/Popover/PopoverTrigger.d.ts +30 -0
- package/dist/components/Popover/hooks/usePopover.d.ts +21 -0
- package/dist/components/Popover/hooks/usePopoverContext.d.ts +23 -0
- package/dist/components/Popover/types.d.ts +86 -0
- package/dist/components/Radio/Radio.d.ts +69 -1
- package/dist/components/Radio/RadioBase.d.ts +1 -1
- package/dist/components/Radio/types.d.ts +109 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup/index.d.ts +1 -0
- package/dist/components/RadioGroup/types.d.ts +42 -0
- package/dist/components/SearchBox/SearchBox.d.ts +60 -0
- package/dist/components/SearchBox/SearchBoxInput.d.ts +1 -1
- package/dist/components/SearchBox/types.d.ts +46 -0
- package/dist/components/Slider/Slider.d.ts +53 -0
- package/dist/components/Slider/consts.d.ts +4 -0
- package/dist/components/Slider/index.d.ts +4 -0
- package/dist/components/Slider/styles.d.ts +90 -0
- package/dist/components/Slider/types.d.ts +69 -0
- package/dist/components/Switch/Switch.d.ts +66 -1
- package/dist/components/Switch/SwitchBase.d.ts +5 -1
- package/dist/components/Switch/SwitchContext.d.ts +50 -0
- package/dist/components/Switch/types.d.ts +74 -0
- package/dist/components/Table/Table.d.ts +74 -0
- package/dist/components/TableBody/TableBody.d.ts +55 -0
- package/dist/components/TableCell/TableCell.d.ts +56 -4
- package/dist/components/TableCell/types.d.ts +33 -0
- package/dist/components/TableCellHeader/TableCellHeader.d.ts +63 -2
- package/dist/components/TableCellHeader/types.d.ts +28 -0
- package/dist/components/TableFilters/TableFilters.d.ts +72 -0
- package/dist/components/TableFilters/hooks/useTableData.d.ts +3 -3
- package/dist/components/TableFilters/types.d.ts +130 -2
- package/dist/components/TableHead/TableHead.d.ts +37 -0
- package/dist/components/TableRow/TableRow.d.ts +2 -7
- package/dist/components/TableRow/types.d.ts +34 -0
- package/dist/components/TextField/TextField.d.ts +76 -0
- package/dist/components/TextField/types.d.ts +80 -0
- package/dist/components/Textarea/Textarea.d.ts +81 -0
- package/dist/components/Textarea/types.d.ts +95 -0
- package/dist/components/Tooltip/SimpleChartTooltip.d.ts +2 -1
- package/dist/components/Tooltip/Tooltip.d.ts +73 -0
- package/dist/components/Tooltip/types.d.ts +116 -5
- package/dist/components/TooltipContent/TooltipContent.d.ts +45 -0
- package/dist/components/TooltipTrigger/TooltipTrigger.d.ts +27 -1
- package/dist/components/Typeahead/Typeahead.context.d.ts +10 -4
- package/dist/components/Typeahead/Typeahead.d.ts +173 -9
- package/dist/components/Typeahead/components/TypeaheadOption.d.ts +1 -1
- package/dist/components/Typeahead/styles.d.ts +9 -4
- package/dist/components/Typeahead/types.d.ts +191 -1
- package/dist/components/Typeahead/useTypeahead.d.ts +13 -5
- package/dist/components/Typography/Typography.d.ts +50 -0
- package/dist/components/Typography/types.d.ts +67 -0
- package/dist/components/UserProfile/UserProfile.d.ts +76 -0
- package/dist/components/UserProfile/styles.d.ts +6 -4
- package/dist/components/UserProfile/types.d.ts +85 -1
- package/dist/components/WidgetCard/Title.d.ts +1 -1
- package/dist/components/WidgetCard/WidgetCardBase.d.ts +1 -1
- package/dist/components/WithLink.d.ts +1 -1
- package/dist/components/Wrapper/Wrapper.d.ts +83 -2
- package/dist/components/Wrapper/index.d.ts +1 -0
- package/dist/components/index.d.ts +113 -85
- package/dist/index.d.ts +1 -0
- package/dist/index.js +47400 -19567
- package/dist/index.js.map +1 -1
- package/dist/types/emotion.d.ts +63 -0
- package/dist/utils/react19HocCompat.d.ts +14 -0
- package/package.json +42 -33
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { DateTime } from 'luxon';
|
|
3
|
+
import { useMergeRefs } from '@floating-ui/react';
|
|
2
4
|
import { CalendarType, DateRangePickerProps, DateTimeTuple } from '../types';
|
|
3
5
|
export declare const useDateRangePicker: ({ dateMin, dateMax, name: _name, format: propFormat, maskOptions, isOpenState, defaultValue, rangePickerType, onOpen, onClose, onError, onChange, ...rest }: DateRangePickerProps & {
|
|
4
6
|
isOpenState?: boolean;
|
|
@@ -10,32 +12,35 @@ export declare const useDateRangePicker: ({ dateMin, dateMax, name: _name, forma
|
|
|
10
12
|
};
|
|
11
13
|
dateMinParts: number[];
|
|
12
14
|
dateMaxParts: number[];
|
|
13
|
-
dateMinDT: DateTime
|
|
14
|
-
dateMaxDT: DateTime
|
|
15
|
+
dateMinDT: DateTime;
|
|
16
|
+
dateMaxDT: DateTime;
|
|
15
17
|
dateTime: DateTimeTuple;
|
|
16
|
-
inputValueFrom
|
|
17
|
-
inputValueTo
|
|
18
|
-
calendarViewDateTime:
|
|
18
|
+
inputValueFrom?: string;
|
|
19
|
+
inputValueTo?: string;
|
|
20
|
+
calendarViewDateTime: DateTimeTuple;
|
|
19
21
|
calendarType: CalendarType;
|
|
20
|
-
lastChangedDate
|
|
22
|
+
lastChangedDate?: [Date | undefined | null, Date | undefined | null];
|
|
21
23
|
luxonFormat: string;
|
|
22
24
|
lastFocusedElement: "from" | "to";
|
|
23
25
|
nameFrom: string;
|
|
24
26
|
nameTo: string;
|
|
25
27
|
currentIndex: number;
|
|
26
|
-
currentCalendarViewDT: DateTime
|
|
28
|
+
currentCalendarViewDT: DateTime;
|
|
27
29
|
isOpen: boolean;
|
|
28
|
-
status
|
|
29
|
-
inputFromRef:
|
|
30
|
-
inputToRef:
|
|
31
|
-
setIsOpen:
|
|
32
|
-
setLastFocusedElement:
|
|
30
|
+
status?: "error" | "success" | "basic";
|
|
31
|
+
inputFromRef: ReturnType<typeof useMergeRefs<HTMLInputElement | null>>;
|
|
32
|
+
inputToRef: ReturnType<typeof useMergeRefs<HTMLInputElement | null>>;
|
|
33
|
+
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
34
|
+
setLastFocusedElement: React.Dispatch<React.SetStateAction<"from" | "to">>;
|
|
33
35
|
safeOnChange: (newDateTime?: DateTime) => void;
|
|
34
|
-
setCalendarType:
|
|
35
|
-
setCalendarViewDateTime:
|
|
36
|
-
setDateTime:
|
|
37
|
-
handleBlur:
|
|
36
|
+
setCalendarType: React.Dispatch<React.SetStateAction<CalendarType>>;
|
|
37
|
+
setCalendarViewDateTime: React.Dispatch<React.SetStateAction<DateTimeTuple>>;
|
|
38
|
+
setDateTime: React.Dispatch<React.SetStateAction<DateTimeTuple>>;
|
|
39
|
+
handleBlur: React.FocusEventHandler<HTMLInputElement>;
|
|
38
40
|
rangeSelectionStep: "start" | "end" | null;
|
|
39
|
-
setRangeSelectionStep:
|
|
41
|
+
setRangeSelectionStep: React.Dispatch<React.SetStateAction<"start" | "end" | null>>;
|
|
40
42
|
clearInputValue: (field: "from" | "to") => void;
|
|
43
|
+
isEndDatePresent: boolean;
|
|
44
|
+
setIsEndDatePresent: React.Dispatch<React.SetStateAction<boolean>>;
|
|
45
|
+
setLastChangedDate: React.Dispatch<React.SetStateAction<[Date | undefined | null, Date | undefined | null]>>;
|
|
41
46
|
};
|
|
@@ -1 +1,4 @@
|
|
|
1
1
|
export * from './DateRangePicker';
|
|
2
|
+
export { DateRangePickerFormBridge, PRESENT_VALUE, type DateRangePickerFormBridgeProps, type DateRangePickerFormBridgeValue, } from './DateRangePickerFormBridge';
|
|
3
|
+
export { DEFAULT_MASK_FORMAT, DEFAULT_EUROPEAN_MASK_FORMAT, DEFAULT_MONTH_MASK_FORMAT, DEFAULT_YEAR_MASK_FORMAT, } from './constants';
|
|
4
|
+
export type { LastFocusedElement, RangePickerType, Format, DateRangePickerProps, DateRangePickerOnChangeDates, DateTimeTuple, DateRangePickerContextProps, } from './types';
|
|
@@ -2,8 +2,9 @@ export declare const DaysViewCell: import("@emotion/styled").StyledComponent<{
|
|
|
2
2
|
theme?: import("@emotion/react").Theme;
|
|
3
3
|
as?: React.ElementType;
|
|
4
4
|
} & {
|
|
5
|
-
direction?:
|
|
6
|
-
alignItems?:
|
|
5
|
+
direction?: import("../Wrapper").WrapperDirection;
|
|
6
|
+
alignItems?: import("../Wrapper").WrapperAlignItems;
|
|
7
|
+
justifyContent?: import("../Wrapper").WrapperJustifyContent;
|
|
7
8
|
fade?: boolean;
|
|
8
9
|
fadeDelay?: number;
|
|
9
10
|
isVisible?: boolean;
|
|
@@ -37,8 +38,9 @@ export declare const TriggerWrapper: import("@emotion/styled").StyledComponent<{
|
|
|
37
38
|
theme?: import("@emotion/react").Theme;
|
|
38
39
|
as?: React.ElementType;
|
|
39
40
|
} & {
|
|
40
|
-
direction?:
|
|
41
|
-
alignItems?:
|
|
41
|
+
direction?: import("../Wrapper").WrapperDirection;
|
|
42
|
+
alignItems?: import("../Wrapper").WrapperAlignItems;
|
|
43
|
+
justifyContent?: import("../Wrapper").WrapperJustifyContent;
|
|
42
44
|
fade?: boolean;
|
|
43
45
|
fadeDelay?: number;
|
|
44
46
|
isVisible?: boolean;
|
|
@@ -3,16 +3,28 @@ import { DateTime } from 'luxon';
|
|
|
3
3
|
import { useMask } from '@react-input/mask';
|
|
4
4
|
import { FieldContextValue } from '../Field/FieldProvider';
|
|
5
5
|
import { InputProps } from '../Input/types';
|
|
6
|
+
import type { PickerCalendarType, DateFormat } from '../JsonSchemaForm/utils/dateFormats';
|
|
6
7
|
export type LastFocusedElement = 'from' | 'to';
|
|
7
|
-
export type RangePickerType =
|
|
8
|
-
export type Format =
|
|
8
|
+
export type RangePickerType = PickerCalendarType;
|
|
9
|
+
export type Format = DateFormat;
|
|
10
|
+
/**
|
|
11
|
+
* Type for the dates tuple passed to DateRangePicker's onChange callback.
|
|
12
|
+
*
|
|
13
|
+
* - Date: A valid date was selected
|
|
14
|
+
* - null: "Present" option was selected (end date only)
|
|
15
|
+
* - undefined: Date field is empty/unset
|
|
16
|
+
*/
|
|
17
|
+
export type DateRangePickerOnChangeDates = [
|
|
18
|
+
Date | null | undefined,
|
|
19
|
+
Date | null | undefined
|
|
20
|
+
];
|
|
9
21
|
export type DateRangePickerProps = {
|
|
10
22
|
name: string;
|
|
11
23
|
label?: string;
|
|
12
24
|
format?: Format;
|
|
13
25
|
isOpenState?: boolean;
|
|
14
|
-
value?: [string | undefined, string | undefined];
|
|
15
|
-
defaultValue?: [string, string];
|
|
26
|
+
value?: [string | undefined | null, string | undefined | null];
|
|
27
|
+
defaultValue?: [string, string | null] | [string, string];
|
|
16
28
|
maskOptions?: Parameters<typeof useMask>[0];
|
|
17
29
|
inputProps?: Partial<InputProps>;
|
|
18
30
|
status?: FieldContextValue['status'];
|
|
@@ -39,7 +51,7 @@ export type DateRangePickerProps = {
|
|
|
39
51
|
calendar?: string;
|
|
40
52
|
label?: string;
|
|
41
53
|
};
|
|
42
|
-
onChange?: (dates?:
|
|
54
|
+
onChange?: (dates?: DateRangePickerOnChangeDates) => void;
|
|
43
55
|
onOpen?: () => void;
|
|
44
56
|
onClose?: () => void;
|
|
45
57
|
onError?: (date: unknown, error?: string | null) => void;
|
|
@@ -47,6 +59,7 @@ export type DateRangePickerProps = {
|
|
|
47
59
|
onYearChange?: (date: Date) => void;
|
|
48
60
|
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
49
61
|
allowReverseSelection?: boolean;
|
|
62
|
+
showPresentOption?: boolean;
|
|
50
63
|
};
|
|
51
64
|
export type DateTimeTuple = [DateTime | undefined, DateTime | undefined];
|
|
52
65
|
export type DateRangePickerContextProps = Omit<DateRangePickerProps, 'dateMin' | 'dateMax'> & {
|
|
@@ -72,9 +85,10 @@ export type DateRangePickerContextProps = Omit<DateRangePickerProps, 'dateMin' |
|
|
|
72
85
|
year: number;
|
|
73
86
|
};
|
|
74
87
|
lastFocusedElement: LastFocusedElement;
|
|
75
|
-
lastChangedDate?: [Date | undefined, Date | undefined];
|
|
88
|
+
lastChangedDate?: [Date | undefined | null, Date | undefined | null];
|
|
76
89
|
safeOnChange?: (date?: DateTime) => void;
|
|
77
90
|
setLastFocusedElement: Dispatch<SetStateAction<LastFocusedElement>>;
|
|
91
|
+
setLastChangedDate: Dispatch<SetStateAction<[Date | undefined | null, Date | undefined | null]>>;
|
|
78
92
|
handleToggleOpen: MouseEventHandler<HTMLButtonElement | HTMLInputElement>;
|
|
79
93
|
setCalendarViewDateTime: Dispatch<SetStateAction<DateTimeTuple>>;
|
|
80
94
|
setDateTime: Dispatch<SetStateAction<DateTimeTuple>>;
|
|
@@ -83,5 +97,8 @@ export type DateRangePickerContextProps = Omit<DateRangePickerProps, 'dateMin' |
|
|
|
83
97
|
rangeSelectionStep: 'start' | 'end' | null;
|
|
84
98
|
setRangeSelectionStep: Dispatch<SetStateAction<'start' | 'end' | null>>;
|
|
85
99
|
clearInputValue: (field: 'from' | 'to') => void;
|
|
100
|
+
showPresentOption?: boolean;
|
|
101
|
+
isEndDatePresent: boolean;
|
|
102
|
+
setIsEndDatePresent: Dispatch<SetStateAction<boolean>>;
|
|
86
103
|
};
|
|
87
|
-
export type CalendarType =
|
|
104
|
+
export type CalendarType = PickerCalendarType;
|
|
@@ -5,7 +5,7 @@ export declare const getYearsList: (props?: {
|
|
|
5
5
|
yearsCount?: number;
|
|
6
6
|
}) => number[];
|
|
7
7
|
export declare const processDate: (dateParts: {
|
|
8
|
-
month
|
|
9
|
-
day
|
|
8
|
+
month?: string;
|
|
9
|
+
day?: string;
|
|
10
10
|
year: string;
|
|
11
11
|
}, yearMin: number, yearMax: number) => boolean;
|
|
@@ -1,4 +1,92 @@
|
|
|
1
1
|
import { DropdownOptionProps } from '../DropdownOptions/types';
|
|
2
2
|
import { DropdownProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Dropdown - Select-like dropdown component for single selection
|
|
5
|
+
*
|
|
6
|
+
* A flexible dropdown component that allows users to select one option from
|
|
7
|
+
* a list of choices. Uses a compound component pattern with DropdownOption
|
|
8
|
+
* children. Provides keyboard navigation, accessibility features, and click-outside
|
|
9
|
+
* to close functionality.
|
|
10
|
+
*
|
|
11
|
+
* Component structure:
|
|
12
|
+
* - Dropdown (root container with context)
|
|
13
|
+
* - DropdownToggle (button that opens/closes dropdown)
|
|
14
|
+
* - DropdownOptions (menu container that appears when open)
|
|
15
|
+
* - DropdownOption (individual selectable items)
|
|
16
|
+
*
|
|
17
|
+
* @category Form Controls
|
|
18
|
+
* @subcategory Selection
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* const items = [
|
|
23
|
+
* { id: 1, value: 'Apple' },
|
|
24
|
+
* { id: 2, value: 'Banana' },
|
|
25
|
+
* { id: 3, value: 'Cherry' },
|
|
26
|
+
* ];
|
|
27
|
+
*
|
|
28
|
+
* <Dropdown
|
|
29
|
+
* selectedItem={items[0]}
|
|
30
|
+
* onChange={(item) => handleSelection(item)}
|
|
31
|
+
* placeholder="Select a fruit"
|
|
32
|
+
* >
|
|
33
|
+
* {items.map(item => (
|
|
34
|
+
* <DropdownOption key={item.id} value={item.id}>
|
|
35
|
+
* {item.value}
|
|
36
|
+
* </DropdownOption>
|
|
37
|
+
* ))}
|
|
38
|
+
* </Dropdown>
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* // Controlled open state
|
|
44
|
+
* const [isOpen, setIsOpen] = useState(false);
|
|
45
|
+
* <Dropdown
|
|
46
|
+
* isOpen={isOpen}
|
|
47
|
+
* onChange={handleChange}
|
|
48
|
+
* selectedItem={selected}
|
|
49
|
+
* >
|
|
50
|
+
* {options.map(opt => (
|
|
51
|
+
* <DropdownOption key={opt.id} value={opt.id}>
|
|
52
|
+
* {opt.label}
|
|
53
|
+
* </DropdownOption>
|
|
54
|
+
* ))}
|
|
55
|
+
* </Dropdown>
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```tsx
|
|
60
|
+
* // With custom props for sub-components
|
|
61
|
+
* <Dropdown
|
|
62
|
+
* selectedItem={selected}
|
|
63
|
+
* onChange={handleChange}
|
|
64
|
+
* dropdownProps={{
|
|
65
|
+
* base: { id: 'my-dropdown' },
|
|
66
|
+
* toggleButton: { 'data-testid': 'dropdown-toggle' },
|
|
67
|
+
* toggleButtonArrow: { className: 'custom-arrow' }
|
|
68
|
+
* }}
|
|
69
|
+
* >
|
|
70
|
+
* {options.map(opt => (
|
|
71
|
+
* <DropdownOption key={opt.id} value={opt.id}>
|
|
72
|
+
* {opt.label}
|
|
73
|
+
* </DropdownOption>
|
|
74
|
+
* ))}
|
|
75
|
+
* </Dropdown>
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* @see {@link DropdownOption} - Child component for individual options
|
|
79
|
+
* @see {@link DropdownToggle} - Toggle button component
|
|
80
|
+
* @see {@link DropdownOptions} - Options menu container
|
|
81
|
+
*
|
|
82
|
+
* @accessibility
|
|
83
|
+
* - ARIA attributes set according to WAI-ARIA combobox pattern
|
|
84
|
+
* - Keyboard navigation (Arrow keys, Enter, Escape)
|
|
85
|
+
* - Click outside to close
|
|
86
|
+
* - Screen reader friendly
|
|
87
|
+
* - Focus management
|
|
88
|
+
*
|
|
89
|
+
* @see https://www.w3.org/WAI/ARIA/apg/example-index/combobox/combobox-select-only.html
|
|
90
|
+
*/
|
|
3
91
|
declare const Dropdown: <T extends DropdownOptionProps>({ selectedItem, isDisabled, isOpen: isInitOpen, children, onChange: handleChange, className, placeholder, dropdownProps: componentProps, }: DropdownProps<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
4
92
|
export default Dropdown;
|
|
@@ -2,22 +2,100 @@ import React from 'react';
|
|
|
2
2
|
import { DropdownOptionProps } from '../DropdownOptions';
|
|
3
3
|
import { CommonProps } from '../../types/emotion';
|
|
4
4
|
import { IconProps } from '../Icon/types';
|
|
5
|
+
/**
|
|
6
|
+
* Props that are controlled by Dropdown component
|
|
7
|
+
* These props cannot be passed via dropdownProps.toggleButton
|
|
8
|
+
*/
|
|
5
9
|
export type ControlledButtonProps = 'onClick' | 'onFocus' | 'disabled' | 'type' | 'role' | 'aria-expanded' | 'aria-haspopup' | 'aria-labelledby' | 'aria-controls' | 'children';
|
|
10
|
+
/**
|
|
11
|
+
* Props for the Dropdown component
|
|
12
|
+
*
|
|
13
|
+
* A select-like dropdown component that allows users to choose one option from
|
|
14
|
+
* a list. Uses compound component pattern with DropdownOption children.
|
|
15
|
+
* Provides keyboard navigation, accessibility, and customizable styling.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* const items = [
|
|
20
|
+
* { id: 1, value: 'Option 1' },
|
|
21
|
+
* { id: 2, value: 'Option 2' },
|
|
22
|
+
* ];
|
|
23
|
+
*
|
|
24
|
+
* <Dropdown
|
|
25
|
+
* selectedItem={items[0]}
|
|
26
|
+
* onChange={(item) => console.log(item)}
|
|
27
|
+
* placeholder="Select an option"
|
|
28
|
+
* >
|
|
29
|
+
* {items.map(item => (
|
|
30
|
+
* <DropdownOption key={item.id} value={item.id}>
|
|
31
|
+
* {item.value}
|
|
32
|
+
* </DropdownOption>
|
|
33
|
+
* ))}
|
|
34
|
+
* </Dropdown>
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
6
37
|
export interface DropdownProps<P extends DropdownOptionProps> extends CommonProps {
|
|
38
|
+
/**
|
|
39
|
+
* Currently selected item
|
|
40
|
+
* When provided, this item will be displayed in the toggle button
|
|
41
|
+
*/
|
|
7
42
|
selectedItem?: P;
|
|
43
|
+
/**
|
|
44
|
+
* Callback function called when an option is selected
|
|
45
|
+
* Receives the selected DropdownOptionProps object
|
|
46
|
+
*/
|
|
8
47
|
onChange?: (item: P) => void;
|
|
48
|
+
/**
|
|
49
|
+
* Whether the dropdown is disabled
|
|
50
|
+
* Disabled dropdowns cannot be opened or interacted with
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
9
53
|
isDisabled?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Placeholder text displayed when no item is selected
|
|
56
|
+
* @default 'Select something'
|
|
57
|
+
*/
|
|
10
58
|
placeholder?: string;
|
|
59
|
+
/**
|
|
60
|
+
* DropdownOption components as children
|
|
61
|
+
* Each child must be a DropdownOption component
|
|
62
|
+
*/
|
|
11
63
|
children?: React.ReactNode;
|
|
64
|
+
/**
|
|
65
|
+
* Custom CSS class name for the toggle button
|
|
66
|
+
*/
|
|
12
67
|
className?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Controlled open state
|
|
70
|
+
* When provided, controls dropdown open/closed state externally
|
|
71
|
+
*/
|
|
13
72
|
isOpen?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Props object for sub-components
|
|
75
|
+
* Allows fine-grained control over component parts
|
|
76
|
+
*/
|
|
14
77
|
dropdownProps?: {
|
|
78
|
+
/** Props for the wrapper div element */
|
|
15
79
|
base?: React.HTMLAttributes<HTMLDivElement>;
|
|
80
|
+
/** Props for the toggle button element (excluding controlled props) */
|
|
16
81
|
toggleButton?: Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, ControlledButtonProps>;
|
|
82
|
+
/** Props for the arrow icon SVG element */
|
|
17
83
|
toggleButtonArrow?: Omit<IconProps, 'name' | 'size'>;
|
|
18
84
|
};
|
|
19
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Dropdown context value
|
|
88
|
+
* Provides selection state and change handler to child DropdownOption components
|
|
89
|
+
*/
|
|
20
90
|
export interface DropdownContextType {
|
|
91
|
+
/**
|
|
92
|
+
* Function to handle option selection
|
|
93
|
+
* Called when a DropdownOption is clicked
|
|
94
|
+
*/
|
|
21
95
|
onChange: (item?: string) => void;
|
|
96
|
+
/**
|
|
97
|
+
* Currently active/selected item
|
|
98
|
+
* Used to highlight the selected option
|
|
99
|
+
*/
|
|
22
100
|
activeItem?: DropdownOptionProps | null;
|
|
23
101
|
}
|
|
@@ -1,3 +1,34 @@
|
|
|
1
1
|
import { DropdownItemsListProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* DropdownOptions - Options menu container for Dropdown component
|
|
4
|
+
*
|
|
5
|
+
* Renders the scrollable list of options that appears when the dropdown is open.
|
|
6
|
+
* Provides proper ARIA attributes for accessibility and keyboard navigation.
|
|
7
|
+
*
|
|
8
|
+
* @category Form Controls
|
|
9
|
+
* @subcategory Selection
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* // Used within Dropdown component
|
|
14
|
+
* <Dropdown selectedItem={selected} onChange={handleChange}>
|
|
15
|
+
* <DropdownOptions>
|
|
16
|
+
* {items.map(item => (
|
|
17
|
+
* <DropdownOption key={item.id} value={item.id}>
|
|
18
|
+
* {item.label}
|
|
19
|
+
* </DropdownOption>
|
|
20
|
+
* ))}
|
|
21
|
+
* </DropdownOptions>
|
|
22
|
+
* </Dropdown>
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @see {@link Dropdown} - Parent component
|
|
26
|
+
* @see {@link DropdownOption} - Individual option components
|
|
27
|
+
*
|
|
28
|
+
* @accessibility
|
|
29
|
+
* - Uses role="listbox" for proper ARIA semantics
|
|
30
|
+
* - Supports keyboard navigation (Arrow keys, Enter, Escape)
|
|
31
|
+
* - Screen reader friendly
|
|
32
|
+
*/
|
|
2
33
|
declare const DropdownOptions: ({ ariaLabelledby, id, children, }: DropdownItemsListProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
3
34
|
export default DropdownOptions;
|
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
import { CommonProps } from '../../types/emotion';
|
|
2
|
+
/**
|
|
3
|
+
* Props for DropdownOption component
|
|
4
|
+
*
|
|
5
|
+
* Record type that allows any string or number properties.
|
|
6
|
+
* Common properties include: value, label, children, etc.
|
|
7
|
+
*/
|
|
2
8
|
export type DropdownOptionProps = Record<string, string | number>;
|
|
9
|
+
/**
|
|
10
|
+
* Props for DropdownOptions component
|
|
11
|
+
*
|
|
12
|
+
* Container component for dropdown option items. Renders as a scrollable
|
|
13
|
+
* list with proper ARIA attributes.
|
|
14
|
+
*/
|
|
3
15
|
export interface DropdownItemsListProps extends CommonProps {
|
|
16
|
+
/**
|
|
17
|
+
* ARIA label reference
|
|
18
|
+
* Associates the listbox with its label
|
|
19
|
+
*/
|
|
4
20
|
ariaLabelledby?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Unique identifier for the options container
|
|
23
|
+
*/
|
|
5
24
|
id?: string;
|
|
25
|
+
/**
|
|
26
|
+
* DropdownOption components as children
|
|
27
|
+
*/
|
|
6
28
|
children?: React.ReactNode;
|
|
7
29
|
}
|
|
@@ -2,6 +2,6 @@ import { DropdownToggleProps } from './types';
|
|
|
2
2
|
export declare const DropdownToggleBase: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
theme?: import("@emotion/react").Theme;
|
|
4
4
|
as?: React.ElementType;
|
|
5
|
-
} & Pick<DropdownToggleProps, "colors" | "disabled" | "
|
|
5
|
+
} & Pick<DropdownToggleProps, "colors" | "disabled" | "isOpen" | "isMultiple" | "selectedCount">, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
|
|
6
6
|
declare const DropdownToggle: ({ onClick, onFocus, isOpen, isMultiple, selectedCount, disabled, children, ariaLabelledby, ariaControls, colors, className, ...restProps }: DropdownToggleProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
7
7
|
export default DropdownToggle;
|
|
@@ -1,7 +1,68 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from 'react';
|
|
2
2
|
import { FieldContextValue } from './FieldProvider';
|
|
3
|
+
/**
|
|
4
|
+
* Props for Field.Control component
|
|
5
|
+
*
|
|
6
|
+
* Wrapper component for form controls (inputs, textarea elements, selects, etc.).
|
|
7
|
+
* Provides consistent styling, validation state borders, and optional focus forwarding.
|
|
8
|
+
* Can accept children as React nodes or a render function that receives field context.
|
|
9
|
+
*/
|
|
3
10
|
export interface FieldControlProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
4
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Optional ref to a specific element to focus when control is clicked
|
|
13
|
+
* If not provided, will attempt to focus the first child input element
|
|
14
|
+
*/
|
|
15
|
+
controlRef?: React.RefObject<HTMLElement | null>;
|
|
16
|
+
/**
|
|
17
|
+
* Form control element(s) to wrap
|
|
18
|
+
* Can be a React node or a function that receives FieldContextValue and returns a node
|
|
19
|
+
*/
|
|
5
20
|
children: React.ReactNode | ((props: FieldContextValue) => React.ReactNode);
|
|
6
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Field.Control - Wrapper component for form controls
|
|
24
|
+
*
|
|
25
|
+
* Provides a styled container for form inputs with automatic focus forwarding,
|
|
26
|
+
* validation state styling (error/success borders), and consistent layout.
|
|
27
|
+
* Clicking anywhere in the control area will focus the contained input when
|
|
28
|
+
* forwardFocus is enabled in Field.Root.
|
|
29
|
+
*
|
|
30
|
+
* @category Form Controls
|
|
31
|
+
* @subcategory Layout
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* <Field.Root>
|
|
36
|
+
* <Field.Label htmlFor="username">Username</Field.Label>
|
|
37
|
+
* <Field.Control>
|
|
38
|
+
* <Input id="username" name="username" />
|
|
39
|
+
* </Field.Control>
|
|
40
|
+
* </Field.Root>
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```tsx
|
|
45
|
+
* // With render function
|
|
46
|
+
* <Field.Control>
|
|
47
|
+
* {(context) => (
|
|
48
|
+
* <Input
|
|
49
|
+
* name="email"
|
|
50
|
+
* disabled={context.disabled}
|
|
51
|
+
* css={{ borderColor: context.status === 'error' ? 'red' : 'blue' }}
|
|
52
|
+
* />
|
|
53
|
+
* )}
|
|
54
|
+
* </Field.Control>
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```tsx
|
|
59
|
+
* // With custom control ref
|
|
60
|
+
* const inputRef = useRef<HTMLInputElement>(null);
|
|
61
|
+
* <Field.Control controlRef={inputRef}>
|
|
62
|
+
* <CustomInput ref={inputRef} />
|
|
63
|
+
* </Field.Control>
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* @see {@link Field.Root} - Parent component that provides context
|
|
67
|
+
*/
|
|
7
68
|
export declare const FieldControl: React.ForwardRefExoticComponent<FieldControlProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,4 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for Field.Description component
|
|
3
|
+
*
|
|
4
|
+
* Helper text component that only displays when field status is 'basic'.
|
|
5
|
+
* Automatically hidden when field is in 'error' or 'success' state to avoid
|
|
6
|
+
* conflicting with Field.Error or Field.Success messages.
|
|
7
|
+
*/
|
|
1
8
|
export interface FieldDescriptionProps {
|
|
9
|
+
/**
|
|
10
|
+
* Helper text content to display
|
|
11
|
+
*/
|
|
2
12
|
children: React.ReactNode;
|
|
3
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Field.Description - Helper text for form fields
|
|
16
|
+
*
|
|
17
|
+
* Displays descriptive helper text below form controls. Only visible when
|
|
18
|
+
* the field status is 'basic' (hidden when status is 'error' or 'success'
|
|
19
|
+
* to avoid conflicts with validation messages).
|
|
20
|
+
*
|
|
21
|
+
* @category Form Controls
|
|
22
|
+
* @subcategory Layout
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <Field.Root>
|
|
27
|
+
* <Field.Label htmlFor="password">Password</Field.Label>
|
|
28
|
+
* <Field.Control>
|
|
29
|
+
* <Input id="password" name="password" type="password" />
|
|
30
|
+
* </Field.Control>
|
|
31
|
+
* <Field.Description>
|
|
32
|
+
* Must be at least 8 characters with one number
|
|
33
|
+
* </Field.Description>
|
|
34
|
+
* </Field.Root>
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
4
37
|
export declare const FieldDescription: ({ children }: FieldDescriptionProps) => import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,4 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Props for Field.Error component
|
|
3
|
+
*
|
|
4
|
+
* Error message component that only displays when field status is 'error'.
|
|
5
|
+
* Automatically hidden when field is in 'basic' or 'success' state.
|
|
6
|
+
*/
|
|
1
7
|
export interface FieldErrorProps {
|
|
8
|
+
/**
|
|
9
|
+
* Error message text to display
|
|
10
|
+
*/
|
|
2
11
|
children: React.ReactNode;
|
|
3
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Field.Error - Error message for form fields
|
|
15
|
+
*
|
|
16
|
+
* Displays error messages below form controls. Only visible when the field
|
|
17
|
+
* status is 'error'. Automatically styled with error colors and hidden when
|
|
18
|
+
* status is 'basic' or 'success'.
|
|
19
|
+
*
|
|
20
|
+
* @category Form Controls
|
|
21
|
+
* @subcategory Layout
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <Field.Root status={errors.email ? 'error' : 'basic'}>
|
|
26
|
+
* <Field.Label htmlFor="email">Email</Field.Label>
|
|
27
|
+
* <Field.Control>
|
|
28
|
+
* <Input id="email" name="email" />
|
|
29
|
+
* </Field.Control>
|
|
30
|
+
* <Field.Error>
|
|
31
|
+
* {errors.email?.message || 'Email is required'}
|
|
32
|
+
* </Field.Error>
|
|
33
|
+
* </Field.Root>
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @accessibility
|
|
37
|
+
* - Uses role="status" for screen reader announcements
|
|
38
|
+
* - Visible only when status is 'error'
|
|
39
|
+
*/
|
|
4
40
|
export declare const FieldError: ({ children }: FieldErrorProps) => import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
import { LabelProps } from '../Label/types';
|
|
2
|
+
/**
|
|
3
|
+
* Props for Field.Label component
|
|
4
|
+
*
|
|
5
|
+
* Accessible label component that automatically respects the disabled state
|
|
6
|
+
* from Field.Root context. Should be associated with form controls via htmlFor prop.
|
|
7
|
+
*/
|
|
2
8
|
export interface FieldLabelProps extends LabelProps {
|
|
9
|
+
/**
|
|
10
|
+
* Label text content
|
|
11
|
+
*/
|
|
3
12
|
children: React.ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Custom CSS class name
|
|
15
|
+
*/
|
|
4
16
|
className?: string;
|
|
5
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Field.Label - Accessible label for form fields
|
|
20
|
+
*
|
|
21
|
+
* Provides an accessible label that automatically respects the disabled state
|
|
22
|
+
* from the Field.Root context. Should be associated with form controls using
|
|
23
|
+
* the htmlFor prop matching the control's id.
|
|
24
|
+
*
|
|
25
|
+
* @category Form Controls
|
|
26
|
+
* @subcategory Layout
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <Field.Root>
|
|
31
|
+
* <Field.Label htmlFor="email">Email Address</Field.Label>
|
|
32
|
+
* <Field.Control>
|
|
33
|
+
* <Input id="email" name="email" />
|
|
34
|
+
* </Field.Control>
|
|
35
|
+
* </Field.Root>
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @accessibility
|
|
39
|
+
* - Properly associated with form controls via htmlFor/id
|
|
40
|
+
* - Respects disabled state from Field context
|
|
41
|
+
* - Screen reader friendly
|
|
42
|
+
*/
|
|
6
43
|
export declare const FieldLabel: ({ children, ...props }: FieldLabelProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Field context value shared between Field components
|
|
3
|
+
* Provides validation status, disabled state, and focus behavior to child components
|
|
4
|
+
*/
|
|
1
5
|
export interface FieldContextValue {
|
|
6
|
+
/**
|
|
7
|
+
* Validation status of the field
|
|
8
|
+
* - `basic`: Default state, no validation feedback
|
|
9
|
+
* - `error`: Error state with red styling
|
|
10
|
+
* - `success`: Success state with green styling
|
|
11
|
+
* @default 'basic'
|
|
12
|
+
*/
|
|
2
13
|
status: 'error' | 'success' | 'basic';
|
|
14
|
+
/**
|
|
15
|
+
* Whether the field is disabled
|
|
16
|
+
* Disabled fields appear muted and cannot be interacted with
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
3
19
|
disabled: boolean;
|
|
4
20
|
/**
|
|
5
|
-
* If true,
|
|
21
|
+
* If true, clicking on FieldControl will forward focus to its child input element
|
|
22
|
+
* This enables clicking anywhere in the control area to focus the input
|
|
23
|
+
* @default true
|
|
6
24
|
*/
|
|
7
25
|
forwardFocus: boolean;
|
|
8
26
|
}
|