@ssa-ui-kit/core 2.16.2 → 2.16.3-canary-be61b75-20250507
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/DateRangePicker/styles.d.ts +10 -0
- package/dist/components/Typeahead/Typeahead.context.d.ts +12 -12
- package/dist/components/Typeahead/Typeahead.d.ts +1 -1
- package/dist/components/Typeahead/types.d.ts +5 -4
- package/dist/components/Typeahead/useTypeahead.d.ts +16 -15
- package/dist/index.js +280 -282
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -32,3 +32,13 @@ export declare const MonthsViewCell: import("@emotion/styled").StyledComponent<{
|
|
|
32
32
|
isCalendarSecondDateSelected?: boolean;
|
|
33
33
|
isHighlighted: boolean;
|
|
34
34
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
35
|
+
export declare const TriggerWrapper: import("@emotion/styled").StyledComponent<{
|
|
36
|
+
theme?: import("@emotion/react").Theme;
|
|
37
|
+
as?: React.ElementType;
|
|
38
|
+
} & {
|
|
39
|
+
avatarSize?: number;
|
|
40
|
+
direction?: string;
|
|
41
|
+
alignItems?: string;
|
|
42
|
+
} & import("../..").CommonProps & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
43
|
+
theme?: import("@emotion/react").Theme;
|
|
44
|
+
}, {}, {}>;
|
|
@@ -4,13 +4,13 @@ import { UseTypeaheadResult } from './useTypeahead';
|
|
|
4
4
|
export declare const TypeaheadContext: React.Context<{
|
|
5
5
|
isOpen: boolean;
|
|
6
6
|
isDisabled: boolean | undefined;
|
|
7
|
-
optionsWithKey: Record<string | number,
|
|
8
|
-
selectedItems: (
|
|
7
|
+
optionsWithKey: Record<string | number, import("./types").TypeaheadOptionProps>;
|
|
8
|
+
selectedItems: import("./types").TypeaheadValue[];
|
|
9
9
|
inputRef: React.RefObject<HTMLInputElement>;
|
|
10
10
|
firstSuggestion: string;
|
|
11
11
|
isMultiple: boolean | undefined;
|
|
12
12
|
typeaheadId: string;
|
|
13
|
-
triggerRef: React.
|
|
13
|
+
triggerRef: React.RefObject<HTMLDivElement>;
|
|
14
14
|
className: string | undefined;
|
|
15
15
|
startIcon: React.ReactNode;
|
|
16
16
|
endIcon: React.ReactNode;
|
|
@@ -21,18 +21,18 @@ export declare const TypeaheadContext: React.Context<{
|
|
|
21
21
|
inputValue: string;
|
|
22
22
|
validationSchema: Record<string, unknown> | undefined;
|
|
23
23
|
status: "error" | "success" | "basic";
|
|
24
|
+
error: import("react-hook-form").FieldError | import("react-hook-form").Merge<import("react-hook-form").FieldError, import("react-hook-form").FieldErrorsImpl<any>> | undefined;
|
|
24
25
|
placeholder: string | null | undefined;
|
|
25
|
-
options: React.ReactElement<
|
|
26
|
+
options: (React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null)[];
|
|
26
27
|
useFormResult: UseFormReturn<FieldValues, any, undefined>;
|
|
27
|
-
register: import("react-hook-form").UseFormRegister<FieldValues
|
|
28
|
-
setValue: import("react-hook-form").UseFormSetValue<FieldValues
|
|
29
|
-
|
|
30
|
-
handleClearAll: (
|
|
31
|
-
handleOpenChange: (open: boolean) => void;
|
|
32
|
-
handleInputChange: React.
|
|
28
|
+
register: import("react-hook-form").UseFormRegister<FieldValues>;
|
|
29
|
+
setValue: import("react-hook-form").UseFormSetValue<FieldValues>;
|
|
30
|
+
onChange: ((selectedItem: import("./types").TypeaheadValue, isSelected: boolean) => void) | undefined;
|
|
31
|
+
handleClearAll: (e: React.MouseEvent) => void;
|
|
32
|
+
handleOpenChange: (open: boolean, event: Event, reason?: import("@floating-ui/react").OpenChangeReason) => void;
|
|
33
|
+
handleInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
33
34
|
handleInputClick: React.MouseEventHandler<HTMLInputElement>;
|
|
34
35
|
handleInputKeyDown: React.KeyboardEventHandler<HTMLInputElement>;
|
|
35
|
-
|
|
36
|
-
handleRemoveSelectedClick: (selectedItem: number | string) => React.MouseEventHandler<HTMLButtonElement>;
|
|
36
|
+
handleRemoveSelectedClick: (value: string | number) => (e: React.MouseEvent) => void;
|
|
37
37
|
}>;
|
|
38
38
|
export declare const useTypeaheadContext: () => UseTypeaheadResult;
|
|
@@ -8,4 +8,4 @@ import { TypeaheadProps } from './types';
|
|
|
8
8
|
* Aria attributes are set according to
|
|
9
9
|
* https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/
|
|
10
10
|
**/
|
|
11
|
-
export declare const Typeahead: ({ name, label, selectedItems, isOpen, isDisabled, isMultiple, children, className, startIcon, endIcon, error, success, helperText, validationSchema, placeholder, startIconClassName, endIconClassName, optionsClassName, wrapperClassName, width,
|
|
11
|
+
export declare const Typeahead: ({ name, label, selectedItems, defaultSelectedItems, isOpen, isDisabled, isMultiple, children, className, startIcon, endIcon, error, success, helperText, validationSchema, placeholder, startIconClassName, endIconClassName, optionsClassName, wrapperClassName, width, onChange, onEmptyChange, onClearAll, onRemoveSelectedClick, renderOption, }: TypeaheadProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { CommonProps } from '../../types/emotion';
|
|
2
|
-
import { FieldError
|
|
2
|
+
import { FieldError } from 'react-hook-form';
|
|
3
3
|
export type TypeaheadValue = string | number;
|
|
4
4
|
export type TypeaheadOptionProps = Record<string, TypeaheadValue>;
|
|
5
5
|
export interface TypeaheadProps {
|
|
6
6
|
selectedItems?: Array<TypeaheadValue>;
|
|
7
|
+
defaultSelectedItems?: Array<TypeaheadValue>;
|
|
7
8
|
isMultiple?: boolean;
|
|
8
9
|
isDisabled?: boolean;
|
|
9
10
|
children?: React.ReactNode;
|
|
@@ -23,8 +24,8 @@ export interface TypeaheadProps {
|
|
|
23
24
|
success?: boolean;
|
|
24
25
|
validationSchema?: Record<string, unknown>;
|
|
25
26
|
placeholder?: string | null;
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
filterOptions?: boolean;
|
|
28
|
+
autoSelect?: boolean;
|
|
28
29
|
onChange?: (selectedItem: TypeaheadValue, isSelected: boolean) => void;
|
|
29
30
|
onClearAll?: () => void;
|
|
30
31
|
onRemoveSelectedClick?: (selectedItem: TypeaheadValue) => void;
|
|
@@ -35,7 +36,7 @@ export interface TypeaheadProps {
|
|
|
35
36
|
label: string;
|
|
36
37
|
}) => React.ReactNode;
|
|
37
38
|
}
|
|
38
|
-
export type UseTypeaheadProps = Pick<TypeaheadProps, 'selectedItems' | 'isDisabled' | 'children' | 'isMultiple' | 'onChange' | 'onClearAll' | 'onRemoveSelectedClick' | 'onEmptyChange' | 'renderOption' | 'isOpen' | 'className' | 'startIcon' | 'endIcon' | 'startIconClassName' | 'endIconClassName' | 'name' | '
|
|
39
|
+
export type UseTypeaheadProps = Pick<TypeaheadProps, 'selectedItems' | 'defaultSelectedItems' | 'isDisabled' | 'children' | 'isMultiple' | 'onChange' | 'onClearAll' | 'onRemoveSelectedClick' | 'onEmptyChange' | 'renderOption' | 'isOpen' | 'className' | 'startIcon' | 'endIcon' | 'startIconClassName' | 'endIconClassName' | 'name' | 'validationSchema' | 'error' | 'success' | 'placeholder' | 'filterOptions' | 'autoSelect'>;
|
|
39
40
|
export interface TypeaheadItemsListProps extends CommonProps {
|
|
40
41
|
children?: React.ReactNode;
|
|
41
42
|
noItemsMessage?: string;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { OpenChangeReason } from '@floating-ui/react';
|
|
3
|
+
import { TypeaheadOptionProps, TypeaheadValue, UseTypeaheadProps } from './types';
|
|
4
|
+
export declare const useTypeahead: ({ name, isOpen: isInitOpen, selectedItems: providedSelectedItems, defaultSelectedItems, isDisabled, isMultiple, children, className, startIcon, endIcon, startIconClassName, endIconClassName, validationSchema, error, success, placeholder, filterOptions, autoSelect, onChange, onClearAll, onRemoveSelectedClick, onEmptyChange, renderOption, }: UseTypeaheadProps) => {
|
|
4
5
|
isOpen: boolean;
|
|
5
6
|
isDisabled: boolean | undefined;
|
|
6
|
-
optionsWithKey: Record<string | number,
|
|
7
|
-
selectedItems:
|
|
7
|
+
optionsWithKey: Record<string | number, TypeaheadOptionProps>;
|
|
8
|
+
selectedItems: TypeaheadValue[];
|
|
8
9
|
inputRef: React.RefObject<HTMLInputElement>;
|
|
9
10
|
firstSuggestion: string;
|
|
10
11
|
isMultiple: boolean | undefined;
|
|
11
12
|
typeaheadId: string;
|
|
12
|
-
triggerRef: React.
|
|
13
|
+
triggerRef: React.RefObject<HTMLDivElement>;
|
|
13
14
|
className: string | undefined;
|
|
14
15
|
startIcon: React.ReactNode;
|
|
15
16
|
endIcon: React.ReactNode;
|
|
@@ -20,18 +21,18 @@ export declare const useTypeahead: ({ name, isOpen: isInitOpen, selectedItems, i
|
|
|
20
21
|
inputValue: string;
|
|
21
22
|
validationSchema: Record<string, unknown> | undefined;
|
|
22
23
|
status: "error" | "success" | "basic";
|
|
24
|
+
error: import("react-hook-form").FieldError | import("react-hook-form").Merge<import("react-hook-form").FieldError, import("react-hook-form").FieldErrorsImpl<any>> | undefined;
|
|
23
25
|
placeholder: string | null | undefined;
|
|
24
|
-
options: React.ReactElement<
|
|
26
|
+
options: (React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null)[];
|
|
25
27
|
useFormResult: import("react-hook-form").UseFormReturn<import("react-hook-form").FieldValues, any, undefined>;
|
|
26
|
-
register: import("react-hook-form").UseFormRegister<import("react-hook-form").FieldValues
|
|
27
|
-
setValue: import("react-hook-form").UseFormSetValue<import("react-hook-form").FieldValues
|
|
28
|
-
|
|
29
|
-
handleClearAll: (
|
|
30
|
-
handleOpenChange: (open: boolean) => void;
|
|
31
|
-
handleInputChange: React.
|
|
28
|
+
register: import("react-hook-form").UseFormRegister<import("react-hook-form").FieldValues>;
|
|
29
|
+
setValue: import("react-hook-form").UseFormSetValue<import("react-hook-form").FieldValues>;
|
|
30
|
+
onChange: ((selectedItem: TypeaheadValue, isSelected: boolean) => void) | undefined;
|
|
31
|
+
handleClearAll: (e: React.MouseEvent) => void;
|
|
32
|
+
handleOpenChange: (open: boolean, event: Event, reason?: OpenChangeReason) => void;
|
|
33
|
+
handleInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
32
34
|
handleInputClick: React.MouseEventHandler<HTMLInputElement>;
|
|
33
35
|
handleInputKeyDown: React.KeyboardEventHandler<HTMLInputElement>;
|
|
34
|
-
|
|
35
|
-
handleRemoveSelectedClick: (selectedItem: number | string) => MouseEventHandler<HTMLButtonElement>;
|
|
36
|
+
handleRemoveSelectedClick: (value: string | number) => (e: React.MouseEvent) => void;
|
|
36
37
|
};
|
|
37
38
|
export type UseTypeaheadResult = ReturnType<typeof useTypeahead>;
|