@smart-factor/gem-ui-components 0.0.29 → 0.0.32
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/FormComponents/Autocomplete/Autocomplete.d.ts +4 -0
- package/dist/components/FormComponents/Autocomplete/Autocomplete.stories.d.ts +11 -0
- package/dist/components/FormComponents/Autocomplete/Autocomplete.styles.d.ts +7 -0
- package/dist/components/FormComponents/Autocomplete/index.d.ts +2 -0
- package/dist/components/FormComponents/Autocomplete/types.d.ts +33 -0
- package/dist/components/FormComponents/index.d.ts +1 -0
- package/dist/components/SimpleAutocomplete/SimpleAutocomplete.d.ts +3 -0
- package/dist/components/SimpleAutocomplete/SimpleAutocomplete.stories.d.ts +11 -0
- package/dist/components/SimpleAutocomplete/index.d.ts +1 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +3352 -3214
- package/package.json +1 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { AutocompleteProps, BaseOption } from './types';
|
|
3
|
+
|
|
4
|
+
export declare const Autocomplete: <T extends FieldValues, B extends BaseOption>({ name, control, multiple, options, idGetter, ...props }: AutocompleteProps<T, B>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { Autocomplete } from './Autocomplete';
|
|
4
|
+
import { AutocompleteProps, BaseOption } from './types';
|
|
5
|
+
|
|
6
|
+
declare const meta: Meta<typeof Autocomplete>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<AutocompleteProps<FieldValues, BaseOption>>;
|
|
9
|
+
export declare const StringOptions: Story;
|
|
10
|
+
export declare const ObjectOptions: Story;
|
|
11
|
+
export declare const MultipleSelection: Story;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AutocompleteProps } from '@mui/material';
|
|
2
|
+
|
|
3
|
+
type StyledAutocompleteProps<T> = AutocompleteProps<T, boolean, boolean, boolean> & {
|
|
4
|
+
isError?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const StyledAutocomplete: <T>(props: StyledAutocompleteProps<T>) => JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SyntheticEvent } from 'react';
|
|
2
|
+
import { Control, FieldValues, Path } from 'react-hook-form';
|
|
3
|
+
import { AutocompleteChangeDetails, AutocompleteChangeReason } from '@mui/material';
|
|
4
|
+
|
|
5
|
+
export type BaseOption = string | {
|
|
6
|
+
id?: any;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
export interface BaseAutocompleteProps<B extends Partial<BaseOption>> {
|
|
10
|
+
options: B[];
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
label: string;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
size?: 'small' | 'medium';
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
multiple?: boolean;
|
|
18
|
+
freeSolo?: boolean;
|
|
19
|
+
clearIcon?: React.ReactNode;
|
|
20
|
+
['data-testId']?: string;
|
|
21
|
+
testId?: string;
|
|
22
|
+
idGetter?: (option: B) => any;
|
|
23
|
+
value?: B | B[] | null;
|
|
24
|
+
onChange?: (event: SyntheticEvent<Element, Event>, value: string | B | (string | B)[] | null, reason: AutocompleteChangeReason, details?: AutocompleteChangeDetails<B> | undefined) => void;
|
|
25
|
+
getOptionLabel: (option: string | B) => string;
|
|
26
|
+
onInputChange?: (event: SyntheticEvent<Element, Event>, value: string) => void;
|
|
27
|
+
inputValue?: string;
|
|
28
|
+
filterOptions?: (options: B[]) => B[];
|
|
29
|
+
}
|
|
30
|
+
export interface AutocompleteProps<T extends FieldValues, B extends Partial<BaseOption>> extends Omit<BaseAutocompleteProps<B>, 'value' | 'onChange'> {
|
|
31
|
+
name: Path<T>;
|
|
32
|
+
control: Control<T>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BaseAutocompleteProps, BaseOption } from '../FormComponents/Autocomplete/types';
|
|
2
|
+
|
|
3
|
+
export declare const SimpleAutocomplete: <B extends BaseOption>({ options, loading, label, placeholder, size, disabled, required, multiple, freeSolo, clearIcon, testId, value, onChange, getOptionLabel, onInputChange, inputValue, filterOptions, ...props }: BaseAutocompleteProps<B>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { BaseAutocompleteProps, BaseOption } from '../FormComponents/Autocomplete/types';
|
|
3
|
+
import { SimpleAutocomplete } from './SimpleAutocomplete';
|
|
4
|
+
|
|
5
|
+
declare const meta: Meta<typeof SimpleAutocomplete>;
|
|
6
|
+
export default meta;
|
|
7
|
+
type Story = StoryObj<BaseAutocompleteProps<BaseOption>>;
|
|
8
|
+
export declare const StringOptions: Story;
|
|
9
|
+
export declare const ObjectOptions: Story;
|
|
10
|
+
export declare const MultipleSelection: Story;
|
|
11
|
+
export declare const DisabledState: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SimpleAutocomplete } from './SimpleAutocomplete';
|
package/dist/main.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { FixedActionsBottomPanel } from './components/FixedActionsBottomPanel/Fi
|
|
|
10
10
|
export * from './components/FormComponents';
|
|
11
11
|
export { LoadingBackdrop } from './components/LoadingBackdrop/LoadingBackdrop';
|
|
12
12
|
export { ResizableWrapper } from './components/ResizableWrapper/ResizableWrapper';
|
|
13
|
+
export { SimpleAutocomplete } from './components/SimpleAutocomplete';
|
|
13
14
|
export { SimpleInput } from './components/SimpleInput/SimpleInput';
|
|
14
15
|
export { SimpleSelect } from './components/SimpleSelect/SimpleSelect';
|
|
15
16
|
export { Stepper } from './components/Stepper/Stepper';
|