@ssa-ui-kit/core 1.0.5 → 1.0.8

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 (27) hide show
  1. package/dist/components/Typeahead/Typeahead.context.d.ts +4 -2
  2. package/dist/components/Typeahead/Typeahead.d.ts +1 -1
  3. package/dist/components/Typeahead/styles.d.ts +10 -9
  4. package/dist/components/Typeahead/types.d.ts +4 -2
  5. package/dist/components/Typeahead/useTypeahead.d.ts +2 -1
  6. package/dist/index.js +1 -1
  7. package/dist/index.js.map +1 -1
  8. package/package.json +1 -1
  9. package/src/components/CollapsibleNavBar/CollapsibleNavBarBase.ts +3 -3
  10. package/src/components/NavBar/NavBar.stories.tsx +7 -2
  11. package/src/components/NavBar/NavBarWrapper.ts +1 -1
  12. package/src/components/NotificationMenu/NotificationMenu.spec.tsx +1 -1
  13. package/src/components/NotificationMenu/stories/StoryComponent.tsx +1 -1
  14. package/src/components/Radio/RadioBase.tsx +1 -1
  15. package/src/components/RadioGroup/RadioGroup.stories.tsx +1 -1
  16. package/src/components/Typeahead/Typeahead.context.ts +2 -0
  17. package/src/components/Typeahead/Typeahead.spec.tsx +27 -10
  18. package/src/components/Typeahead/Typeahead.stories.tsx +38 -4
  19. package/src/components/Typeahead/Typeahead.tsx +9 -4
  20. package/src/components/Typeahead/components/MultipleTrigger.tsx +6 -5
  21. package/src/components/Typeahead/components/SingleTrigger.tsx +8 -5
  22. package/src/components/Typeahead/components/TypeaheadItem.ts +1 -1
  23. package/src/components/Typeahead/styles.ts +4 -2
  24. package/src/components/Typeahead/types.ts +4 -2
  25. package/src/components/Typeahead/useTypeahead.tsx +36 -13
  26. package/src/components/UserProfile/UserProfile.stories.tsx +4 -2
  27. package/tsbuildcache +1 -1
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import { FieldValues, UseFormReturn } from 'react-hook-form';
2
3
  import { UseTypeaheadResult } from './useTypeahead';
3
4
  export declare const TypeaheadContext: React.Context<{
4
5
  isOpen: boolean;
@@ -22,8 +23,9 @@ export declare const TypeaheadContext: React.Context<{
22
23
  status: "error" | "basic" | "success";
23
24
  placeholder: string | null | undefined;
24
25
  options: React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
25
- register: import("react-hook-form").UseFormRegister<import("react-hook-form").FieldValues> | undefined;
26
- setValue: import("react-hook-form").UseFormSetValue<import("react-hook-form").FieldValues> | undefined;
26
+ useFormResult: UseFormReturn<FieldValues, any, undefined>;
27
+ register: import("react-hook-form").UseFormRegister<FieldValues> | undefined;
28
+ setValue: import("react-hook-form").UseFormSetValue<FieldValues> | undefined;
27
29
  handleChange: (changingValue?: string | number | undefined) => void;
28
30
  handleClearAll: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
29
31
  handleOpenChange: (open: boolean) => void;
@@ -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, initialSelectedItems, isOpen, isDisabled, isMultiple, children, className, startIcon, endIcon, errors, success, helperText, validationSchema, placeholder, startIconClassName, endIconClassName, optionsClassName, setValue, register, onChange, renderOption, }: TypeaheadProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
11
+ export declare const Typeahead: ({ name, label, initialSelectedItems, isOpen, isDisabled, isMultiple, children, className, startIcon, endIcon, error, success, helperText, validationSchema, placeholder, startIconClassName, endIconClassName, optionsClassName, wrapperClassName, width, setValue, register, onChange, renderOption, }: TypeaheadProps) => import("@emotion/react/types/jsx-namespace").EmotionJSX.Element;
@@ -1,46 +1,47 @@
1
1
  /// <reference types="react" />
2
+ import { Theme } from '@emotion/react';
2
3
  import { useTypeahead } from './useTypeahead';
3
4
  import { TypeaheadItemProps } from './types';
4
5
  export declare const TypeaheadOptionsBase: import("@emotion/styled").StyledComponent<{
5
- theme?: import("@emotion/react").Theme | undefined;
6
+ theme?: Theme | undefined;
6
7
  as?: import("react").ElementType<any> | undefined;
7
8
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
8
9
  export declare const TypeaheadOption: import("@emotion/styled").StyledComponent<{
9
- theme?: import("@emotion/react").Theme | undefined;
10
+ theme?: Theme | undefined;
10
11
  as?: import("react").ElementType<any> | undefined;
11
12
  } & TypeaheadItemProps, import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, {}>;
12
- export declare const TypeaheadInput: string;
13
+ export declare const TypeaheadInput: (theme: Theme) => string;
13
14
  export declare const TypeaheadInputPlaceholder: string;
14
15
  export declare const TypeaheadInputWrapper: string;
15
16
  export declare const TypeaheadItem: import("@emotion/styled").StyledComponent<{
16
- theme?: import("@emotion/react").Theme | undefined;
17
+ theme?: Theme | undefined;
17
18
  as?: import("react").ElementType<any> | undefined;
18
19
  } & {
19
20
  isDisabled?: boolean | undefined;
20
21
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
21
22
  export declare const TypeaheadItemLabel: import("@emotion/styled").StyledComponent<{
22
- theme?: import("@emotion/react").Theme | undefined;
23
+ theme?: Theme | undefined;
23
24
  as?: import("react").ElementType<any> | undefined;
24
25
  } & {
25
26
  isDisabled?: boolean | undefined;
26
27
  }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
27
28
  export declare const TypeaheadItemCross: import("@emotion/styled").StyledComponent<import("../Button/types").ButtonProps & import("react").RefAttributes<HTMLButtonElement> & {
28
- theme?: import("@emotion/react").Theme | undefined;
29
+ theme?: Theme | undefined;
29
30
  }, {}, {}>;
30
31
  export declare const TypeaheadInputsGroupWrapper: import("@emotion/styled").StyledComponent<{
31
- theme?: import("@emotion/react").Theme | undefined;
32
+ theme?: Theme | undefined;
32
33
  as?: import("react").ElementType<any> | undefined;
33
34
  } & {
34
35
  avatarSize?: number | undefined;
35
36
  direction?: string | undefined;
36
37
  alignItems?: string | undefined;
37
38
  } & import("../..").CommonProps & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
38
- theme?: import("@emotion/react").Theme | undefined;
39
+ theme?: Theme | undefined;
39
40
  } & {
40
41
  isOpen: boolean;
41
42
  }, {}, {}>;
42
43
  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> & {
43
- theme?: import("@emotion/react").Theme | undefined;
44
+ theme?: Theme | undefined;
44
45
  } & {
45
46
  isOpen: boolean;
46
47
  status: ReturnType<typeof useTypeahead>['status'];
@@ -10,6 +10,8 @@ export interface TypeaheadProps {
10
10
  children?: React.ReactNode;
11
11
  className?: string;
12
12
  optionsClassName?: string;
13
+ wrapperClassName?: string;
14
+ width?: string | number;
13
15
  isOpen?: boolean;
14
16
  startIcon?: React.ReactNode;
15
17
  endIcon?: React.ReactNode;
@@ -18,7 +20,7 @@ export interface TypeaheadProps {
18
20
  name?: string;
19
21
  label?: string;
20
22
  helperText?: string;
21
- errors?: FieldError;
23
+ error?: FieldError;
22
24
  success?: boolean;
23
25
  validationSchema?: Record<string, unknown>;
24
26
  placeholder?: string | null;
@@ -31,7 +33,7 @@ export interface TypeaheadProps {
31
33
  label: string;
32
34
  }) => React.ReactNode;
33
35
  }
34
- export type UseTypeaheadProps = Pick<TypeaheadProps, 'initialSelectedItems' | 'isDisabled' | 'children' | 'isMultiple' | 'onChange' | 'renderOption' | 'isOpen' | 'className' | 'startIcon' | 'endIcon' | 'startIconClassName' | 'endIconClassName' | 'name' | 'register' | 'setValue' | 'validationSchema' | 'errors' | 'success' | 'placeholder'>;
36
+ export type UseTypeaheadProps = Pick<TypeaheadProps, 'initialSelectedItems' | 'isDisabled' | 'children' | 'isMultiple' | 'onChange' | 'renderOption' | 'isOpen' | 'className' | 'startIcon' | 'endIcon' | 'startIconClassName' | 'endIconClassName' | 'name' | 'register' | 'setValue' | 'validationSchema' | 'error' | 'success' | 'placeholder'>;
35
37
  export interface TypeaheadItemsListProps extends CommonProps {
36
38
  children?: React.ReactNode;
37
39
  noItemsMessage?: string;
@@ -1,6 +1,6 @@
1
1
  import React, { MouseEventHandler } from 'react';
2
2
  import { UseTypeaheadProps } from './types';
3
- export declare const useTypeahead: ({ name, isOpen: isInitOpen, initialSelectedItems, isDisabled, isMultiple, children, className, startIcon, endIcon, startIconClassName, endIconClassName, validationSchema, errors, success, placeholder, register, setValue, onChange, renderOption, }: UseTypeaheadProps) => {
3
+ export declare const useTypeahead: ({ name, isOpen: isInitOpen, initialSelectedItems, isDisabled, isMultiple, children, className, startIcon, endIcon, startIconClassName, endIconClassName, validationSchema, error, success, placeholder, register, setValue, onChange, renderOption, }: UseTypeaheadProps) => {
4
4
  isOpen: boolean;
5
5
  isDisabled: boolean | undefined;
6
6
  optionsWithKey: Record<string | number, Record<string, string | number>>;
@@ -22,6 +22,7 @@ export declare const useTypeahead: ({ name, isOpen: isInitOpen, initialSelectedI
22
22
  status: "error" | "basic" | "success";
23
23
  placeholder: string | null | undefined;
24
24
  options: React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
25
+ useFormResult: import("react-hook-form").UseFormReturn<import("react-hook-form").FieldValues, any, undefined>;
25
26
  register: import("react-hook-form").UseFormRegister<import("react-hook-form").FieldValues> | undefined;
26
27
  setValue: import("react-hook-form").UseFormSetValue<import("react-hook-form").FieldValues> | undefined;
27
28
  handleChange: (changingValue?: string | number) => void;