@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.
Files changed (177) hide show
  1. package/dist/components/AccordionGroup/Accordion.d.ts +37 -0
  2. package/dist/components/AccordionGroup/AccordionContent.d.ts +48 -0
  3. package/dist/components/AccordionGroup/AccordionContext.d.ts +76 -2
  4. package/dist/components/AccordionGroup/AccordionGroup.d.ts +56 -0
  5. package/dist/components/AccordionGroup/AccordionTitle.d.ts +41 -0
  6. package/dist/components/AccordionGroup/types.d.ts +199 -1
  7. package/dist/components/Avatar/Avatar.d.ts +33 -0
  8. package/dist/components/Button/Button.d.ts +61 -0
  9. package/dist/components/Button/fixtures.d.ts +52 -31
  10. package/dist/components/Button/styles.d.ts +7 -12
  11. package/dist/components/Button/types.d.ts +98 -4
  12. package/dist/components/Charts/BarGaugeChart/components/BarGaugeChartHeader.d.ts +1 -1
  13. package/dist/components/Charts/BarLineComplexChart/BarLineComplexChartView.d.ts +2 -2
  14. package/dist/components/Charts/BarLineComplexChart/types.d.ts +2 -2
  15. package/dist/components/Charts/BigNumberChart/BigNumberChart.d.ts +4 -2
  16. package/dist/components/Charts/BigNumberChart/components/BigNumberChartHeader.d.ts +1 -1
  17. package/dist/components/Charts/BigNumberChart/components/TrendLine.d.ts +8 -3
  18. package/dist/components/Charts/BigNumberChart/components/TrendLineTooltip.d.ts +8 -5
  19. package/dist/components/Charts/GaugeChart/components/GaugeChartBase.d.ts +3 -1
  20. package/dist/components/Charts/GaugeChart/components/GaugeChartHeader.d.ts +1 -1
  21. package/dist/components/Charts/PieChart/PieChartLegendMarker.d.ts +1 -1
  22. package/dist/components/Charts/PieChart/styles.d.ts +1 -1
  23. package/dist/components/Charts/PieChart/types.d.ts +1 -1
  24. package/dist/components/Charts/RadarChart/RadarChart.d.ts +1 -1
  25. package/dist/components/Charts/RadarChart/components/RadarChartHeader.d.ts +1 -1
  26. package/dist/components/Charts/TreeMapChart/TreeMapChart.d.ts +1 -1
  27. package/dist/components/Charts/TreeMapChart/TreeMapChartHeader.d.ts +1 -1
  28. package/dist/components/Charts/index.d.ts +1 -0
  29. package/dist/components/Charts/utils/nivoReact19Compat.d.ts +18 -0
  30. package/dist/components/Checkbox/Checkbox.d.ts +84 -0
  31. package/dist/components/Checkbox/CheckboxBase.d.ts +1 -1
  32. package/dist/components/Checkbox/styles.d.ts +2 -2
  33. package/dist/components/Checkbox/types.d.ts +104 -3
  34. package/dist/components/Chip/Chip.d.ts +70 -0
  35. package/dist/components/Chip/constants.d.ts +1 -1
  36. package/dist/components/Chip/helpers.d.ts +6 -0
  37. package/dist/components/Chip/types.d.ts +129 -1
  38. package/dist/components/CollapsibleNavBar/CollapsibleNavBar.d.ts +1 -1
  39. package/dist/components/CollapsibleNavBar/CollapsibleNavBarContext.d.ts +2 -2
  40. package/dist/components/CollapsibleNavBar/components/TriggerIcon.d.ts +4 -2
  41. package/dist/components/CollapsibleNavBar/types.d.ts +9 -2
  42. package/dist/components/ColorPicker/components/CopyButton.d.ts +1 -1
  43. package/dist/components/DatePicker/constants.d.ts +22 -0
  44. package/dist/components/DatePicker/hooks/useDatePicker.d.ts +7 -5
  45. package/dist/components/DatePicker/index.d.ts +1 -0
  46. package/dist/components/DatePicker/styles.d.ts +3 -2
  47. package/dist/components/DatePicker/types.d.ts +10 -2
  48. package/dist/components/DatePicker/utils/dates.d.ts +2 -2
  49. package/dist/components/DateRangePicker/DateRangePicker.d.ts +1 -1
  50. package/dist/components/DateRangePicker/DateRangePickerFormBridge.d.ts +46 -0
  51. package/dist/components/DateRangePicker/components/DatesListWrapper.d.ts +3 -2
  52. package/dist/components/DateRangePicker/constants.d.ts +1 -0
  53. package/dist/components/DateRangePicker/hooks/useDateRangePicker.d.ts +22 -17
  54. package/dist/components/DateRangePicker/index.d.ts +3 -0
  55. package/dist/components/DateRangePicker/styles.d.ts +6 -4
  56. package/dist/components/DateRangePicker/types.d.ts +24 -7
  57. package/dist/components/DateRangePicker/utils/dates.d.ts +2 -2
  58. package/dist/components/Drawer/index.d.ts +2 -1
  59. package/dist/components/Dropdown/Dropdown.d.ts +88 -0
  60. package/dist/components/Dropdown/types.d.ts +78 -0
  61. package/dist/components/DropdownOptions/DropdownOptions.d.ts +31 -0
  62. package/dist/components/DropdownOptions/types.d.ts +22 -0
  63. package/dist/components/DropdownToggle/DropdownToggle.d.ts +1 -1
  64. package/dist/components/Field/FieldControl.d.ts +62 -1
  65. package/dist/components/Field/FieldDescription.d.ts +33 -0
  66. package/dist/components/Field/FieldError.d.ts +36 -0
  67. package/dist/components/Field/FieldLabel.d.ts +37 -0
  68. package/dist/components/Field/FieldProvider.d.ts +19 -1
  69. package/dist/components/Field/FieldRoot.d.ts +90 -0
  70. package/dist/components/Field/FieldSuccess.d.ts +34 -0
  71. package/dist/components/Field/index.d.ts +4 -0
  72. package/dist/components/Filters/FilterBlockWrapper.d.ts +3 -2
  73. package/dist/components/Filters/FiltersContext.d.ts +4 -4
  74. package/dist/components/Filters/hooks/useVisibility.d.ts +2 -2
  75. package/dist/components/FullscreenModeContext.d.ts +1 -4
  76. package/dist/components/Icon/icons/iconsList.d.ts +1 -1
  77. package/dist/components/IconButton/IconButton.d.ts +39 -0
  78. package/dist/components/IconButton/index.d.ts +2 -0
  79. package/dist/components/IconButton/styles.d.ts +2 -0
  80. package/dist/components/IconButton/types.d.ts +41 -0
  81. package/dist/components/Indicator/types.d.ts +4 -2
  82. package/dist/components/Input/types.d.ts +157 -0
  83. package/dist/components/JsonSchemaForm/fields/DateRangeField.d.ts +15 -1
  84. package/dist/components/JsonSchemaForm/utils/dateFormats.d.ts +37 -0
  85. package/dist/components/JsonSchemaForm/utils/dateRangeField.d.ts +24 -0
  86. package/dist/components/JsonSchemaForm/utils/index.d.ts +1 -0
  87. package/dist/components/JsonSchemaForm/utils/selectWidget.d.ts +16 -0
  88. package/dist/components/Modal/Modal.d.ts +60 -0
  89. package/dist/components/Modal/types.d.ts +21 -1
  90. package/dist/components/ModalContent/ModalContent.d.ts +42 -1
  91. package/dist/components/ModalDialog/ModalDialog.d.ts +27 -0
  92. package/dist/components/ModalDialog/types.d.ts +18 -0
  93. package/dist/components/ModalDismissButton/ModalDismissButton.d.ts +29 -2
  94. package/dist/components/ModalOpenButton/ModalOpenButton.d.ts +25 -1
  95. package/dist/components/NavBar/types.d.ts +1 -1
  96. package/dist/components/NotificationMenu/types.d.ts +3 -3
  97. package/dist/components/Pagination/ArrowButton.d.ts +32 -0
  98. package/dist/components/Pagination/Pagination.d.ts +81 -0
  99. package/dist/components/Pagination/PaginationButtons.d.ts +35 -0
  100. package/dist/components/Pagination/PaginationContext.d.ts +30 -0
  101. package/dist/components/Pagination/WithPagination.d.ts +47 -4
  102. package/dist/components/Pagination/components/RowsPerPageDropdown/RowsPerPageDropdown.d.ts +41 -0
  103. package/dist/components/Pagination/components/RowsPerPageDropdown/types.d.ts +39 -0
  104. package/dist/components/Pagination/styles.d.ts +1 -1
  105. package/dist/components/Pagination/types.d.ts +178 -0
  106. package/dist/components/PersonInfo/styles.d.ts +1 -1
  107. package/dist/components/Popover/Popover.d.ts +120 -0
  108. package/dist/components/Popover/PopoverClose.d.ts +26 -0
  109. package/dist/components/Popover/PopoverContent.d.ts +33 -0
  110. package/dist/components/Popover/PopoverDescription.d.ts +22 -1
  111. package/dist/components/Popover/PopoverHeading.d.ts +22 -1
  112. package/dist/components/Popover/PopoverTrigger.d.ts +30 -0
  113. package/dist/components/Popover/hooks/usePopover.d.ts +21 -0
  114. package/dist/components/Popover/hooks/usePopoverContext.d.ts +23 -0
  115. package/dist/components/Popover/types.d.ts +86 -0
  116. package/dist/components/Radio/Radio.d.ts +69 -1
  117. package/dist/components/Radio/RadioBase.d.ts +1 -1
  118. package/dist/components/Radio/types.d.ts +109 -0
  119. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
  120. package/dist/components/RadioGroup/index.d.ts +1 -0
  121. package/dist/components/RadioGroup/types.d.ts +42 -0
  122. package/dist/components/SearchBox/SearchBox.d.ts +60 -0
  123. package/dist/components/SearchBox/SearchBoxInput.d.ts +1 -1
  124. package/dist/components/SearchBox/types.d.ts +46 -0
  125. package/dist/components/Slider/Slider.d.ts +53 -0
  126. package/dist/components/Slider/consts.d.ts +4 -0
  127. package/dist/components/Slider/index.d.ts +4 -0
  128. package/dist/components/Slider/styles.d.ts +90 -0
  129. package/dist/components/Slider/types.d.ts +69 -0
  130. package/dist/components/Switch/Switch.d.ts +66 -1
  131. package/dist/components/Switch/SwitchBase.d.ts +5 -1
  132. package/dist/components/Switch/SwitchContext.d.ts +50 -0
  133. package/dist/components/Switch/types.d.ts +74 -0
  134. package/dist/components/Table/Table.d.ts +74 -0
  135. package/dist/components/TableBody/TableBody.d.ts +55 -0
  136. package/dist/components/TableCell/TableCell.d.ts +56 -4
  137. package/dist/components/TableCell/types.d.ts +33 -0
  138. package/dist/components/TableCellHeader/TableCellHeader.d.ts +63 -2
  139. package/dist/components/TableCellHeader/types.d.ts +28 -0
  140. package/dist/components/TableFilters/TableFilters.d.ts +72 -0
  141. package/dist/components/TableFilters/hooks/useTableData.d.ts +3 -3
  142. package/dist/components/TableFilters/types.d.ts +130 -2
  143. package/dist/components/TableHead/TableHead.d.ts +37 -0
  144. package/dist/components/TableRow/TableRow.d.ts +2 -7
  145. package/dist/components/TableRow/types.d.ts +34 -0
  146. package/dist/components/TextField/TextField.d.ts +76 -0
  147. package/dist/components/TextField/types.d.ts +80 -0
  148. package/dist/components/Textarea/Textarea.d.ts +81 -0
  149. package/dist/components/Textarea/types.d.ts +95 -0
  150. package/dist/components/Tooltip/SimpleChartTooltip.d.ts +2 -1
  151. package/dist/components/Tooltip/Tooltip.d.ts +73 -0
  152. package/dist/components/Tooltip/types.d.ts +116 -5
  153. package/dist/components/TooltipContent/TooltipContent.d.ts +45 -0
  154. package/dist/components/TooltipTrigger/TooltipTrigger.d.ts +27 -1
  155. package/dist/components/Typeahead/Typeahead.context.d.ts +10 -4
  156. package/dist/components/Typeahead/Typeahead.d.ts +173 -9
  157. package/dist/components/Typeahead/components/TypeaheadOption.d.ts +1 -1
  158. package/dist/components/Typeahead/styles.d.ts +9 -4
  159. package/dist/components/Typeahead/types.d.ts +191 -1
  160. package/dist/components/Typeahead/useTypeahead.d.ts +13 -5
  161. package/dist/components/Typography/Typography.d.ts +50 -0
  162. package/dist/components/Typography/types.d.ts +67 -0
  163. package/dist/components/UserProfile/UserProfile.d.ts +76 -0
  164. package/dist/components/UserProfile/styles.d.ts +6 -4
  165. package/dist/components/UserProfile/types.d.ts +85 -1
  166. package/dist/components/WidgetCard/Title.d.ts +1 -1
  167. package/dist/components/WidgetCard/WidgetCardBase.d.ts +1 -1
  168. package/dist/components/WithLink.d.ts +1 -1
  169. package/dist/components/Wrapper/Wrapper.d.ts +83 -2
  170. package/dist/components/Wrapper/index.d.ts +1 -0
  171. package/dist/components/index.d.ts +113 -85
  172. package/dist/index.d.ts +1 -0
  173. package/dist/index.js +47400 -19567
  174. package/dist/index.js.map +1 -1
  175. package/dist/types/emotion.d.ts +63 -0
  176. package/dist/utils/react19HocCompat.d.ts +14 -0
  177. package/package.json +42 -33
@@ -1,30 +1,110 @@
1
1
  import { useInteractions, FloatingArrow, Placement, UseFloatingReturn, OffsetOptions } from '@floating-ui/react';
2
- import { PointTooltipProps, Point } from '@nivo/line';
2
+ import { PointTooltipProps, Point, LineSeries } from '@nivo/line';
3
3
  import { MapIconsType } from '../Icon/types';
4
4
  import { ProgressBarProps } from '../ProgressBar/types';
5
5
  import { SerializedStyles } from '@emotion/react';
6
6
  import { CommonProps } from '../../types/emotion';
7
+ /**
8
+ * Size variant for tooltip content
9
+ * - `small`: Compact tooltip with minimal padding
10
+ * - `medium`: Standard tooltip size (default)
11
+ * - `large`: Larger tooltip for more content
12
+ */
7
13
  export type TooltipSize = 'small' | 'medium' | 'large';
14
+ /**
15
+ * Props for the Tooltip component
16
+ *
17
+ * Root container component for tooltip system using compound component pattern.
18
+ * Provides context and positioning configuration for TooltipTrigger and TooltipContent.
19
+ * Built on Floating UI for flexible positioning and interaction modes.
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * <Tooltip placement="top">
24
+ * <TooltipTrigger>
25
+ * <Button>Hover me</Button>
26
+ * </TooltipTrigger>
27
+ * <TooltipContent>This is a tooltip</TooltipContent>
28
+ * </Tooltip>
29
+ * ```
30
+ */
8
31
  export interface TooltipProps extends CommonProps {
32
+ /**
33
+ * TooltipTrigger and TooltipContent components
34
+ * Must include both TooltipTrigger and TooltipContent as children
35
+ */
9
36
  children: React.ReactNode;
37
+ /**
38
+ * Preferred placement of the tooltip relative to trigger
39
+ * Floating UI will auto-adjust if space is insufficient
40
+ */
10
41
  placement?: Placement;
42
+ /**
43
+ * Enable tooltip on hover interaction
44
+ * @default true
45
+ */
11
46
  enableHover?: boolean;
47
+ /**
48
+ * Enable tooltip on click interaction
49
+ * @default false
50
+ */
12
51
  enableClick?: boolean;
52
+ /**
53
+ * Enable tooltip to follow client point (mouse position)
54
+ * Useful for interactive tooltips like charts
55
+ * @default false
56
+ */
13
57
  enableClientPoint?: boolean;
58
+ /**
59
+ * Offset configuration for tooltip positioning
60
+ * Allows fine-tuning of spacing from trigger element
61
+ */
14
62
  offsetOptions?: OffsetOptions;
63
+ /**
64
+ * Allow hovering over tooltip content itself
65
+ * When true, tooltip stays open when hovering over content
66
+ * @default false
67
+ */
15
68
  allowHoverContent?: boolean;
69
+ /**
70
+ * Delay in milliseconds before tooltip appears on hover
71
+ * Helps prevent "traffic light" effect when quickly moving through multiple tooltips
72
+ * @default 0
73
+ */
74
+ hoverOpenDelay?: number;
75
+ /**
76
+ * Delay in milliseconds before tooltip disappears after mouse leaves
77
+ * Helps prevent tooltip from flickering when moving between trigger and content
78
+ * @default 0
79
+ */
80
+ hoverCloseDelay?: number;
81
+ /**
82
+ * Size variant of the tooltip content
83
+ * @default 'medium'
84
+ */
16
85
  size?: TooltipSize;
86
+ /**
87
+ * Whether to display arrow pointing to trigger
88
+ * @default true
89
+ */
17
90
  hasArrow?: boolean;
91
+ /**
92
+ * Additional props for the arrow element
93
+ */
18
94
  arrowProps?: TooltipArrowProps;
95
+ /**
96
+ * Controlled open state
97
+ * When provided, controls tooltip visibility externally
98
+ */
19
99
  isOpen?: boolean;
20
100
  }
21
101
  export type UseTooltipArgs = Omit<TooltipProps, 'children'>;
22
102
  type UseInteractions = ReturnType<typeof useInteractions>;
23
- interface MutableRefObject<T> {
103
+ interface RefObject<T> {
24
104
  current: T;
25
105
  }
26
106
  export type UseTooltip = (props?: UseTooltipArgs) => Pick<TooltipProps, 'size' | 'hasArrow' | 'arrowProps'> & {
27
- arrowRef: MutableRefObject<null>;
107
+ arrowRef: RefObject<null>;
28
108
  isOpen: boolean;
29
109
  setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
30
110
  } & UseFloatingReturn & UseInteractions;
@@ -34,9 +114,26 @@ export type TooltipContextType = (UseFloatingReturn & ReturnType<typeof useInter
34
114
  setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
35
115
  } & Pick<TooltipProps, 'size' | 'hasArrow' | 'arrowProps'>) | null;
36
116
  export type TooltipArrowProps = Omit<React.ComponentProps<typeof FloatingArrow>, 'context'>;
117
+ /**
118
+ * Props for TooltipContent component
119
+ *
120
+ * Content container for tooltip. Renders the actual tooltip content that appears
121
+ * when the trigger is activated. Supports custom styling and is automatically
122
+ * positioned using Floating UI.
123
+ */
37
124
  export interface TooltipContentProps {
125
+ /**
126
+ * Tooltip content to display
127
+ * Can be text, React nodes, or formatted content
128
+ */
38
129
  children: React.ReactNode;
130
+ /**
131
+ * Custom CSS class name
132
+ */
39
133
  className?: string;
134
+ /**
135
+ * Inline styles for the tooltip content
136
+ */
40
137
  style?: React.CSSProperties;
41
138
  }
42
139
  export interface TooltipContentSizes {
@@ -44,12 +141,26 @@ export interface TooltipContentSizes {
44
141
  medium: SerializedStyles;
45
142
  large: SerializedStyles;
46
143
  }
144
+ /**
145
+ * Props for TooltipTrigger component
146
+ *
147
+ * Trigger element that activates the tooltip. Must be a single React element
148
+ * (component or DOM element) that will receive the tooltip trigger props.
149
+ */
47
150
  export interface TooltipTriggerProps {
151
+ /**
152
+ * Single React element to use as trigger
153
+ * Can be any element (Button, Icon, div, etc.)
154
+ * Must be a valid React element (not fragment or array)
155
+ */
48
156
  children: React.ReactNode;
157
+ /**
158
+ * Custom CSS class name
159
+ */
49
160
  className?: string;
50
161
  }
51
- export type SimpleChartTooltipProps = PointTooltipProps & Pick<TooltipProps, 'size'> & {
52
- renderValue?: (data: Point['data']) => React.ReactNode;
162
+ export type SimpleChartTooltipProps<Series extends LineSeries> = PointTooltipProps<Series> & Pick<TooltipProps, 'size'> & {
163
+ renderValue?: (data: Point<Series>['data']) => React.ReactNode;
53
164
  };
54
165
  export interface ProgressChartTooltipProps {
55
166
  caption: string;
@@ -1,3 +1,48 @@
1
1
  import { TooltipContentProps } from '../Tooltip/types';
2
+ /**
3
+ * TooltipContent - Content container for tooltip display
4
+ *
5
+ * Renders the actual tooltip content that appears when the trigger is activated.
6
+ * Uses Floating Portal for proper z-index stacking and FloatingFocusManager for
7
+ * keyboard accessibility. Automatically positions based on Floating UI context
8
+ * and respects size variants and arrow configuration.
9
+ *
10
+ * Only renders when tooltip is open (isOpen is true). Supports custom styling
11
+ * and can contain any React content.
12
+ *
13
+ * @category Components
14
+ * @subcategory Overlay
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * <Tooltip>
19
+ * <TooltipTrigger>
20
+ * <Button>Info</Button>
21
+ * </TooltipTrigger>
22
+ * <TooltipContent>
23
+ * This is the tooltip content
24
+ * </TooltipContent>
25
+ * </Tooltip>
26
+ * ```
27
+ *
28
+ * @example
29
+ * ```tsx
30
+ * // Tooltip with custom styling
31
+ * <TooltipContent style={{ padding: 16, maxWidth: 300 }}>
32
+ * <div>
33
+ * <strong>Title</strong>
34
+ * <p>Detailed description here</p>
35
+ * </div>
36
+ * </TooltipContent>
37
+ * ```
38
+ *
39
+ * @see {@link Tooltip} - Parent component that provides context
40
+ * @see {@link TooltipTrigger} - Trigger component that activates tooltip
41
+ *
42
+ * @accessibility
43
+ * - Renders in FloatingPortal for proper stacking
44
+ * - Uses FloatingFocusManager for keyboard navigation
45
+ * - Only visible when isOpen is true
46
+ */
2
47
  declare const TooltipContent: import("react").ForwardRefExoticComponent<TooltipContentProps & import("react").RefAttributes<HTMLDivElement>>;
3
48
  export default TooltipContent;
@@ -1,3 +1,29 @@
1
1
  import { TooltipTriggerProps } from '../Tooltip/types';
2
- declare const TooltipTrigger: ({ children, className }: TooltipTriggerProps) => import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | null;
2
+ /**
3
+ * TooltipTrigger - Trigger element for tooltip activation
4
+ *
5
+ * Wraps a single React element to make it trigger the tooltip. The wrapped
6
+ * element receives tooltip interaction props (onMouseEnter, onMouseLeave, onClick, etc.)
7
+ * and Floating UI reference props for positioning.
8
+ *
9
+ * Must be used within a Tooltip component and must have a single child element
10
+ * (not a fragment or array). Returns null if children is not a valid element.
11
+ *
12
+ * @category Components
13
+ * @subcategory Overlay
14
+ *
15
+ * @example
16
+ * ```tsx
17
+ * <Tooltip>
18
+ * <TooltipTrigger>
19
+ * <Button>Hover me</Button>
20
+ * </TooltipTrigger>
21
+ * <TooltipContent>Tooltip content</TooltipContent>
22
+ * </Tooltip>
23
+ * ```
24
+ *
25
+ * @see {@link Tooltip} - Parent component that provides context
26
+ * @see {@link TooltipContent} - Content component that displays tooltip
27
+ */
28
+ declare const TooltipTrigger: ({ children, className }: TooltipTriggerProps) => import("react").ReactElement<TooltipTriggerProps, string | import("react").JSXElementConstructor<any>> | null;
3
29
  export default TooltipTrigger;
@@ -6,11 +6,11 @@ export declare const TypeaheadContext: React.Context<{
6
6
  isDisabled: boolean | undefined;
7
7
  optionsWithKey: Record<string | number, import("./types").TypeaheadOptionProps>;
8
8
  selectedItems: import("./types").TypeaheadValue[];
9
- inputRef: React.RefObject<HTMLInputElement>;
9
+ inputRef: React.RefObject<HTMLInputElement | null>;
10
10
  firstSuggestion: string;
11
11
  isMultiple: boolean | undefined;
12
12
  typeaheadId: string;
13
- triggerRef: React.RefObject<HTMLDivElement>;
13
+ triggerRef: React.RefObject<HTMLDivElement | null>;
14
14
  className: string | undefined;
15
15
  startIcon: React.ReactNode;
16
16
  endIcon: React.ReactNode;
@@ -23,8 +23,14 @@ export declare const TypeaheadContext: React.Context<{
23
23
  status: "error" | "success" | "basic";
24
24
  error: import("react-hook-form").FieldError | import("react-hook-form").Merge<import("react-hook-form").FieldError, import("react-hook-form").FieldErrorsImpl<any>> | undefined;
25
25
  placeholder: string | null | undefined;
26
- options: (React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null)[];
27
- useFormResult: UseFormReturn<FieldValues, any, undefined>;
26
+ options: (React.ReactElement<any, string | React.JSXElementConstructor<any>> | null)[];
27
+ customOptionValue: string | null;
28
+ handleChange: ({ value, shouldClose, resetInput, }: {
29
+ value?: string | number;
30
+ shouldClose?: boolean;
31
+ resetInput?: boolean;
32
+ }) => void;
33
+ useFormResult: UseFormReturn<FieldValues, any, FieldValues>;
28
34
  register: import("react-hook-form").UseFormRegister<FieldValues>;
29
35
  setValue: import("react-hook-form").UseFormSetValue<FieldValues>;
30
36
  onChange: ((selectedItem: import("./types").TypeaheadValue, isSelected: boolean) => void) | undefined;
@@ -1,11 +1,175 @@
1
1
  import { TypeaheadProps } from './types';
2
2
  /**
3
- * The structure of the component:
4
- * - TypeaheadTrigger
5
- * - TypeaheadOptions
6
- * - FormHelperText
7
- *
8
- * Aria attributes are set according to
9
- * https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/
10
- **/
11
- export declare const Typeahead: ({ name, label, selectedItems, defaultSelectedItems, isOpen, isDisabled, isMultiple, children, className, startIcon, endIcon, error, success, helperText, validationSchema, placeholder, startIconClassName, endIconClassName, popoverClassName, optionsClassName, wrapperClassName, filterOptions, width, onChange, onEmptyChange, onClearAll, onRemoveSelectedClick, renderOption, }: TypeaheadProps) => import("@emotion/react/jsx-runtime").JSX.Element;
3
+ * Typeahead - Advanced autocomplete search component with dropdown functionality
4
+ *
5
+ * A powerful autocomplete component that provides search-as-you-type functionality
6
+ * with dropdown suggestions. Supports both single and multiple selection modes,
7
+ * filtering, custom rendering, custom values (user-typed values not in options list),
8
+ * and integrates seamlessly with React Hook Form for validation and form management.
9
+ *
10
+ * Component structure:
11
+ * - Typeahead (root container with context)
12
+ * - TypeaheadTrigger (search input with selected items display)
13
+ * - TypeaheadOptions (filtered dropdown options list)
14
+ * - FormHelperText (validation messages and helper text)
15
+ *
16
+ * @category Form Controls
17
+ * @subcategory Selection
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * // Single selection with React Hook Form
22
+ * const form = useForm();
23
+ * return (
24
+ * <FormProvider {...form}>
25
+ * <Typeahead
26
+ * name="language"
27
+ * label="Programming Language"
28
+ * placeholder="Select a language"
29
+ * validationSchema={{ required: 'Language is required' }}>
30
+ * {languages.map(lang => (
31
+ * <TypeaheadOption key={lang.id} value={lang.id} label={lang.name}>
32
+ * {lang.name}
33
+ * </TypeaheadOption>
34
+ * ))}
35
+ * </Typeahead>
36
+ * </FormProvider>
37
+ * );
38
+ * ```
39
+ *
40
+ * @example
41
+ * ```tsx
42
+ * // Multiple selection
43
+ * <Typeahead
44
+ * name="tags"
45
+ * isMultiple
46
+ * label="Tags"
47
+ * selectedItems={selected}
48
+ * onChange={(item, isSelected) => handleToggle(item, isSelected)}>
49
+ * {options.map(opt => (
50
+ * <TypeaheadOption key={opt.id} value={opt.id}>
51
+ * {opt.label}
52
+ * </TypeaheadOption>
53
+ * ))}
54
+ * </Typeahead>
55
+ * ```
56
+ *
57
+ * @example
58
+ * ```tsx
59
+ * // With custom values - allows users to type and add values not in options
60
+ * <Typeahead
61
+ * name="tags"
62
+ * isMultiple
63
+ * allowCustomValues={true}
64
+ * label="Tags">
65
+ * {options.map(opt => (
66
+ * <TypeaheadOption key={opt.id} value={opt.id}>
67
+ * {opt.label}
68
+ * </TypeaheadOption>
69
+ * ))}
70
+ * </Typeahead>
71
+ * // Users can type "custom-tag" and press Enter to add it
72
+ * // Custom values appear in blue in the dropdown and selected items
73
+ * ```
74
+ *
75
+ * @example
76
+ * ```tsx
77
+ * // With custom option rendering
78
+ * <Typeahead
79
+ * name="users"
80
+ * label="Select User"
81
+ * renderOption={({ value, label, input }) => (
82
+ * <div>
83
+ * <Avatar src={users[value].avatar} />
84
+ * <span>{highlightMatch(label, input)}</span>
85
+ * </div>
86
+ * )}>
87
+ * {users.map(user => (
88
+ * <TypeaheadOption key={user.id} value={user.id} label={user.name} />
89
+ * ))}
90
+ * </Typeahead>
91
+ * ```
92
+ *
93
+ * @example
94
+ * ```tsx
95
+ * // Schema validation in Form Builder (JsonSchemaForm)
96
+ * // For single select - use 'required' in schema
97
+ * const schema = {
98
+ * type: 'string',
99
+ * title: 'Select field title',
100
+ * enum: ['Option 1', 'Option 2'],
101
+ * // required: ['selectField'] // Add to top-level required array
102
+ * };
103
+ *
104
+ * // For multiple select (array) - use 'required' + 'minItems'
105
+ * const schema = {
106
+ * type: 'array',
107
+ * title: 'Select multiple fields title',
108
+ * items: {
109
+ * type: 'string',
110
+ * enum: ['Option 1', 'Option 2', 'Option 3'],
111
+ * },
112
+ * minItems: 1, // Ensures at least one item is selected
113
+ * // required: ['selectMultipleField'] // Add to top-level required array
114
+ * };
115
+ * ```
116
+ *
117
+ * @example
118
+ * ```tsx
119
+ * // Schema validation in standalone mode (React Hook Form)
120
+ * // For single select - use 'required' in validationSchema
121
+ * <Typeahead
122
+ * name="language"
123
+ * label="Language"
124
+ * validationSchema={{
125
+ * required: 'Language is required',
126
+ * }}>
127
+ * {options.map(opt => (
128
+ * <TypeaheadOption key={opt.id} value={opt.id}>
129
+ * {opt.label}
130
+ * </TypeaheadOption>
131
+ * ))}
132
+ * </Typeahead>
133
+ *
134
+ * // For multiple select - use 'validate' function to check array length
135
+ * <Typeahead
136
+ * name="tags"
137
+ * isMultiple
138
+ * label="Tags"
139
+ * validationSchema={{
140
+ * validate: (value: string[]) => {
141
+ * if (!value || value.length === 0) {
142
+ * return 'At least one tag is required';
143
+ * }
144
+ * return true;
145
+ * },
146
+ * }}>
147
+ * {options.map(opt => (
148
+ * <TypeaheadOption key={opt.id} value={opt.id}>
149
+ * {opt.label}
150
+ * </TypeaheadOption>
151
+ * ))}
152
+ * </Typeahead>
153
+ * ```
154
+ *
155
+ * @note Validation differences:
156
+ * - **Form Builder (JsonSchemaForm)**: Uses JSON Schema validation. For arrays, use `minItems` property
157
+ * (e.g., `minItems: 1` to require at least one selection). The `required` array at the schema root
158
+ * marks fields as required.
159
+ * - **Standalone mode**: Uses React Hook Form validation. For arrays, use a `validate` function to check
160
+ * array length, as React Hook Form doesn't have a built-in `minItems` rule. The `required` rule works
161
+ * for single select fields.
162
+ *
163
+ * @see {@link TypeaheadOption} - Child component for individual options
164
+ * @see {@link Popover} - Used for dropdown positioning
165
+ *
166
+ * @accessibility
167
+ * - ARIA attributes set according to WAI-ARIA combobox pattern
168
+ * - Keyboard navigation (Arrow keys, Enter, Escape, Tab)
169
+ * - Screen reader friendly
170
+ * - Focus management with trap
171
+ * - Search input filtering
172
+ *
173
+ * @see https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/
174
+ */
175
+ export declare const Typeahead: ({ name, label, selectedItems, defaultSelectedItems, isOpen, isDisabled, isMultiple, children, className, startIcon, endIcon, error, success, helperText, validationSchema, placeholder, startIconClassName, endIconClassName, popoverClassName, optionsClassName, wrapperClassName, filterOptions, autoSelect, allowCustomValues, width, onChange, onEmptyChange, onClearAll, onRemoveSelectedClick, renderOption, }: TypeaheadProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import { TypeaheadItemProps } from '../types';
2
- export declare const TypeaheadOption: ({ children, avatar, ...rest }: TypeaheadItemProps) => import("@emotion/react/jsx-runtime").JSX.Element;
2
+ export declare const TypeaheadOption: ({ children, avatar, isCustomValue, ...rest }: TypeaheadItemProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -17,6 +17,7 @@ export declare const TypeaheadItem: import("@emotion/styled").StyledComponent<{
17
17
  as?: React.ElementType;
18
18
  } & {
19
19
  isDisabled?: boolean;
20
+ isCustomValue?: boolean;
20
21
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
21
22
  export declare const TypeaheadItemAvatar: import("@emotion/styled").StyledComponent<{
22
23
  theme?: Theme;
@@ -27,16 +28,20 @@ export declare const TypeaheadItemLabel: import("@emotion/styled").StyledCompone
27
28
  as?: React.ElementType;
28
29
  } & {
29
30
  isDisabled?: boolean;
31
+ isCustomValue?: boolean;
30
32
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
31
- export declare const TypeaheadItemCross: import("@emotion/styled").StyledComponent<import("../Button/types").ButtonProps & import("react").RefAttributes<HTMLButtonElement> & {
33
+ export declare const TypeaheadItemCross: import("@emotion/styled").StyledComponent<import("..").ButtonProps & import("react").RefAttributes<HTMLButtonElement> & {
32
34
  theme?: Theme;
35
+ } & {
36
+ isCustomValue?: boolean;
33
37
  }, {}, {}>;
34
38
  export declare const TypeaheadInputsGroupWrapper: import("@emotion/styled").StyledComponent<{
35
39
  theme?: Theme;
36
40
  as?: React.ElementType;
37
41
  } & {
38
- direction?: string;
39
- alignItems?: string;
42
+ direction?: import("../Wrapper").WrapperDirection;
43
+ alignItems?: import("../Wrapper").WrapperAlignItems;
44
+ justifyContent?: import("../Wrapper").WrapperJustifyContent;
40
45
  fade?: boolean;
41
46
  fadeDelay?: number;
42
47
  isVisible?: boolean;
@@ -45,7 +50,7 @@ export declare const TypeaheadInputsGroupWrapper: import("@emotion/styled").Styl
45
50
  } & {
46
51
  isOpen: boolean;
47
52
  }, {}, {}>;
48
- export declare const TypeaheadTrigger: import("@emotion/styled").StyledComponent<Omit<import("react").HTMLProps<HTMLElement> & import("../Button/types").ButtonProps & import("../Popover/types").PopoverTriggerProps, "ref"> & import("react").RefAttributes<HTMLElement> & {
53
+ export declare const TypeaheadTrigger: import("@emotion/styled").StyledComponent<Omit<import("react").HTMLProps<HTMLElement> & import("..").ButtonProps & import("../Popover/types").PopoverTriggerProps, "ref"> & import("react").RefAttributes<HTMLElement> & {
49
54
  theme?: Theme;
50
55
  } & {
51
56
  isOpen: boolean;