@nulogy/components 9.0.3 → 10.0.1

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 (35) hide show
  1. package/dist/main.js +119 -117
  2. package/dist/main.module.js +119 -118
  3. package/dist/src/Alert/Alert.d.ts +7 -1
  4. package/dist/src/Alert/index.d.ts +2 -1
  5. package/dist/src/AsyncSelect/AsyncSelect.d.ts +3 -0
  6. package/dist/src/Box/Box.d.ts +9 -28
  7. package/dist/src/BrandedNavBar/NavBarBackground.d.ts +5 -2
  8. package/dist/src/Breadcrumbs/Breadcrumbs.d.ts +6 -1
  9. package/dist/src/Card/CardSet.d.ts +1 -1
  10. package/dist/src/Divider/Divider.d.ts +1 -2
  11. package/dist/src/DropdownMenu/DropdownButton.d.ts +2 -1
  12. package/dist/src/FieldLabel/HelpText.d.ts +2 -2
  13. package/dist/src/Flex/Flex.d.ts +6 -2
  14. package/dist/src/Flex/Flex.story.d.ts +0 -12
  15. package/dist/src/Form/Field.d.ts +1 -2
  16. package/dist/src/NavBar/NavBar.d.ts +5 -1
  17. package/dist/src/Select/Select.d.ts +26 -38
  18. package/dist/src/Select/Select.spec-utils.d.ts +5 -2
  19. package/dist/src/Select/Select.story.d.ts +1 -1
  20. package/dist/src/Select/SelectOption.d.ts +6 -1
  21. package/dist/src/Select/customReactSelectStyles.d.ts +12 -949
  22. package/dist/src/StyledProps/index.d.ts +28 -7
  23. package/dist/src/Tabs/TabContainer.d.ts +1 -2
  24. package/dist/src/Tooltip/TooltipContainer.d.ts +2 -2
  25. package/dist/src/Type/Headings.d.ts +8 -8
  26. package/dist/src/Type/Text.d.ts +1 -1
  27. package/dist/src/index.d.ts +3 -2
  28. package/dist/src/theme.d.ts +1 -1
  29. package/dist/src/theme.type.d.ts +22 -22
  30. package/package.json +3 -3
  31. package/dist/src/StyledProps/cursor.d.ts +0 -4
  32. package/dist/src/StyledProps/textOverflow.d.ts +0 -5
  33. package/dist/src/StyledProps/transform.d.ts +0 -4
  34. package/dist/src/StyledProps/transition.d.ts +0 -8
  35. package/dist/src/StyledProps/visibility.d.ts +0 -4
@@ -1,44 +1,32 @@
1
- import React from "react";
1
+ import React, { ReactNode } from "react";
2
+ import { GroupBase } from "react-windowed-select";
3
+ import type { MenuPlacement, MenuPosition, Props as SelectProps } from "react-select";
2
4
  import { ComponentSize } from "../NDSProvider/ComponentSizeContext";
3
- export type SelectProps = {
4
- options?: any[];
5
+ interface WindowedSelectProps extends SelectProps {
5
6
  windowThreshold?: number;
6
- filterOption?: (...args: any[]) => any;
7
- autocomplete?: boolean;
8
- disabled?: boolean;
9
- error?: boolean;
10
- errorMessage?: string;
11
- errorList?: string[];
7
+ }
8
+ interface NDSOptionType {
9
+ label: string;
10
+ value: unknown;
11
+ }
12
+ interface CustomProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> {
13
+ autocomplete?: SelectProps<Option, IsMulti, Group>["isSearchable"];
12
14
  labelText?: string;
13
- helpText?: any;
14
- noOptionsMessage?: Function;
15
15
  requirementText?: string;
16
- id?: string;
17
- initialIsOpen?: boolean;
18
- menuPosition?: string;
19
- menuPlacement?: string;
16
+ helpText?: ReactNode;
17
+ disabled?: SelectProps<Option, IsMulti, Group>["isDisabled"];
18
+ errorMessage?: string;
19
+ errorList?: string[];
20
+ initialIsOpen?: SelectProps<Option, IsMulti, Group>["defaultMenuIsOpen"];
21
+ multiselect?: SelectProps<Option, IsMulti, Group>["isMulti"];
20
22
  maxHeight?: string;
21
- multiselect?: boolean;
22
- name?: string;
23
- onBlur?: (...args: any[]) => any;
24
- onChange?: (...args: any[]) => any;
25
- placeholder?: string;
26
- required?: boolean;
27
- value?: any;
28
- defaultValue?: any;
29
- className?: string;
30
- classNamePrefix?: string;
31
- menuIsOpen?: boolean;
32
- onMenuOpen?: (...args: any[]) => any;
33
- onMenuClose?: (...args: any[]) => any;
34
- onInputChange?: (...args: any[]) => any;
35
- components?: any;
36
- closeMenuOnSelect?: boolean;
37
- "aria-label"?: string;
38
23
  size?: ComponentSize;
39
- isClearable?: boolean;
24
+ error?: boolean;
25
+ options: NDSOptionType[];
26
+ onChange?: (newValue: unknown) => void;
40
27
  [key: string]: any;
41
- };
28
+ }
29
+ export type NDSSelectProps<Option, IsMulti extends boolean, Group extends GroupBase<Option>> = Omit<WindowedSelectProps, "isSearchable" | "isDisabled" | "isMulti" | "defaultMenuIsOpen" | "defaultInputValue" | "options" | "onChange"> & CustomProps<Option, IsMulti, Group>;
42
30
  export declare const SelectDefaultProps: {
43
31
  autocomplete: boolean;
44
32
  disabled: any;
@@ -53,8 +41,8 @@ export declare const SelectDefaultProps: {
53
41
  id: any;
54
42
  initialIsOpen: any;
55
43
  maxHeight: string;
56
- menuPosition: string;
57
- menuPlacement: string;
44
+ menuPosition: MenuPosition;
45
+ menuPlacement: MenuPlacement;
58
46
  multiselect: boolean;
59
47
  name: any;
60
48
  onBlur: any;
@@ -71,6 +59,6 @@ export declare const SelectDefaultProps: {
71
59
  components: any;
72
60
  closeMenuOnSelect: boolean;
73
61
  };
74
- declare const ReactSelect: React.ForwardRefExoticComponent<Omit<SelectProps, "ref"> & React.RefAttributes<unknown>>;
75
- export declare const getOption: (options: any, value: any) => any;
62
+ declare const ReactSelect: React.ForwardRefExoticComponent<Omit<Omit<WindowedSelectProps, "isDisabled" | "isMulti" | "isSearchable" | "onChange" | "options" | "defaultMenuIsOpen" | "defaultInputValue"> & CustomProps<unknown, boolean, GroupBase<unknown>>, "ref"> & React.RefAttributes<unknown>>;
63
+ export declare const getOption: (options: NDSOptionType[], value: unknown) => unknown;
76
64
  export default ReactSelect;
@@ -1,2 +1,5 @@
1
- export function openDropdown(container: any, i?: number): void;
2
- export function selectOption(optionText: any, container: any, queryByText: any, i: any): void;
1
+ import { Matcher, SelectorMatcherOptions } from "@testing-library/react";
2
+ type QueryByText = (id: Matcher, options?: SelectorMatcherOptions) => HTMLElement;
3
+ export declare const openDropdown: (element: HTMLElement, i: number) => void;
4
+ export declare const selectOption: (optionText: string, container: HTMLElement, queryByText: QueryByText, i?: number) => void;
5
+ export {};
@@ -109,5 +109,5 @@ export declare const UsingRefToControlFocus: {
109
109
  name: string;
110
110
  };
111
111
  };
112
- export declare const WithCustomProps: () => React.JSX.Element;
113
112
  export declare const WithTopMenuPlacement: () => React.JSX.Element;
113
+ export declare const WithCustomProps: () => React.JSX.Element;
@@ -1,2 +1,7 @@
1
1
  import React from "react";
2
- export declare const SelectOption: (props: any) => React.JSX.Element;
2
+ import { OptionProps } from "react-windowed-select";
3
+ import { GroupBase } from "react-select";
4
+ import { ComponentSize } from "../NDSProvider/ComponentSizeContext";
5
+ export declare function SelectOption<Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: OptionProps<Option, IsMulti, Group> & {
6
+ size: ComponentSize;
7
+ }): React.JSX.Element;