elastic-input 0.2.0 → 0.3.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/README.md CHANGED
@@ -116,15 +116,17 @@ Implicit AND is supported — `status:active level:ERROR` is equivalent to `stat
116
116
  | `styles` | `StyleConfig` | `DEFAULT_STYLES` | Structural/layout style overrides |
117
117
  | `placeholder` | `string` | `"Search..."` | Placeholder text |
118
118
  | `className` | `string` | — | CSS class for the outer container |
119
+ | `classNames` | `ClassNamesConfig` | — | Custom CSS classes for sub-elements (editor, dropdown, tokens, etc.) |
119
120
  | `style` | `CSSProperties` | — | Inline styles for the outer container |
120
121
  | `inputRef` | `(api) => void` | — | Receive an imperative API handle |
121
- | `dropdown` | `DropdownConfig` | `{}` | Dropdown behavior and rendering (mode, triggers, renderers) |
122
+ | `dropdown` | `DropdownConfig` | `{}` | Dropdown behavior and rendering (open, triggers, renderers) |
122
123
  | `features` | `FeaturesConfig` | `{}` | Feature toggles (multiline, smartSelectAll, expandSelection, wildcardWrap, savedSearches, historySearch) |
123
124
  | `onKeyDown` | `(e) => void` | — | Called before internal keyboard handling |
124
125
  | `onFocus` | `() => void` | — | Called when the input gains focus |
125
126
  | `onBlur` | `() => void` | — | Called when the input loses focus |
126
127
  | `onTab` | `(context) => TabActionResult` | — | Override Tab key behavior (accept/blur/submit) |
127
128
  | `validateValue` | `(ctx) => ValidateReturn` | — | Custom validation for all value types |
129
+ | `parseDate` | `(value: string) => Date \| null` | — | Custom date parser for validation and date picker init |
128
130
 
129
131
  ## Field Configuration
130
132
 
@@ -19,6 +19,12 @@ interface AutocompleteDropdownProps {
19
19
  renderSavedSearchItem?: (search: SavedSearch, isSelected: boolean) => React.ReactNode | null | undefined;
20
20
  renderDropdownHeader?: (context: CursorContext) => React.ReactNode | null | undefined;
21
21
  cursorContext?: CursorContext | null;
22
+ /** Custom class names for dropdown elements. */
23
+ classNames?: {
24
+ dropdown?: string;
25
+ dropdownHeader?: string;
26
+ dropdownItem?: string;
27
+ };
22
28
  }
23
- export declare function AutocompleteDropdown({ suggestions, selectedIndex, onSelect, position, colors, styles, visible, fixedWidth, renderHistoryItem, renderSavedSearchItem, renderDropdownHeader, cursorContext, }: AutocompleteDropdownProps): React.ReactPortal | null;
29
+ export declare function AutocompleteDropdown({ suggestions, selectedIndex, onSelect, position, colors, styles, visible, fixedWidth, renderHistoryItem, renderSavedSearchItem, renderDropdownHeader, cursorContext, classNames, }: AutocompleteDropdownProps): React.ReactPortal | null;
24
30
  export {};
@@ -11,6 +11,8 @@ interface DateRangePickerProps {
11
11
  label: string;
12
12
  value: string;
13
13
  }[];
14
+ /** Custom class name for the date picker container. */
15
+ className?: string;
14
16
  }
15
- export declare function DateRangePicker({ onSelect, colors, styles: styleConfig, initialMode, initialStart, initialEnd, presets: presetsProp }: DateRangePickerProps): React.JSX.Element;
17
+ export declare function DateRangePicker({ onSelect, colors, styles: styleConfig, initialMode, initialStart, initialEnd, presets: presetsProp, className }: DateRangePickerProps): React.JSX.Element;
16
18
  export {};
@@ -16,7 +16,7 @@ export declare function computeDatePickerInit(context: {
16
16
  token?: {
17
17
  value: string;
18
18
  };
19
- }): DatePickerInit | null;
19
+ }, parseDateFn?: (value: string) => Date | null): DatePickerInit | null;
20
20
  /**
21
21
  * Determine whether the date picker needs to be unmounted and remounted.
22
22
  * This is necessary when initial state changes because DateRangePicker
@@ -3,5 +3,7 @@ import { ColorConfig } from '../types';
3
3
 
4
4
  export interface HighlightOptions {
5
5
  cursorOffset?: number;
6
+ /** Custom class name appended to every token span. */
7
+ tokenClassName?: string;
6
8
  }
7
9
  export declare function buildHighlightedHTML(tokens: Token[], colorConfig?: ColorConfig, options?: HighlightOptions): string;
@@ -8,6 +8,11 @@ interface ValidationSquigglesProps {
8
8
  colors?: ColorConfig;
9
9
  styles?: StyleConfig;
10
10
  containerRef?: HTMLDivElement | null;
11
+ /** Custom class names for squiggly and tooltip elements. */
12
+ classNames?: {
13
+ squiggly?: string;
14
+ tooltip?: string;
15
+ };
11
16
  }
12
- export declare function ValidationSquiggles({ errors, editorRef, cursorOffset, colors, styles, containerRef }: ValidationSquigglesProps): React.JSX.Element | null;
17
+ export declare function ValidationSquiggles({ errors, editorRef, cursorOffset, colors, styles, containerRef, classNames }: ValidationSquigglesProps): React.JSX.Element | null;
13
18
  export {};