@sellgar/kit 0.0.49 → 0.0.50

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@sellgar/kit",
4
- "version": "0.0.49",
4
+ "version": "0.0.50",
5
5
  "description": "Sellgar storybook",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",
@@ -1,11 +1,13 @@
1
1
  import { ReferenceType } from '@floating-ui/react';
2
2
  import { default as React } from 'react';
3
3
  interface IOptions {
4
+ tabIndex?: number;
4
5
  initialOpen?: boolean;
5
- initialSelectedIndex?: number;
6
+ initialSelectedIndex?: number | null;
6
7
  open?: boolean;
7
8
  disabled?: boolean;
8
9
  setOpen?(open: boolean): void;
10
+ onSelect?(selectedIndex: number | null): void;
9
11
  }
10
12
  declare const useSelect: (options: IOptions) => {
11
13
  open: boolean | undefined;
@@ -56,7 +58,9 @@ declare const useSelect: (options: IOptions) => {
56
58
  };
57
59
  };
58
60
  interactions: import('@floating-ui/react').UseInteractionsReturn;
61
+ tabIndex: number | undefined;
59
62
  disabled: boolean | undefined;
63
+ onSelect: ((selectedIndex: number | null) => void) | undefined;
60
64
  };
61
65
  type TSelectContext = ReturnType<typeof useSelect>;
62
66
  export declare const useSelectContext: () => {
@@ -108,14 +112,18 @@ export declare const useSelectContext: () => {
108
112
  };
109
113
  };
110
114
  interactions: import('@floating-ui/react').UseInteractionsReturn;
115
+ tabIndex: number | undefined;
111
116
  disabled: boolean | undefined;
117
+ onSelect: ((selectedIndex: number | null) => void) | undefined;
112
118
  };
113
119
  interface IProps {
120
+ tabIndex?: number;
114
121
  initialOpen?: boolean;
115
- initialSelectedIndex?: number;
122
+ initialSelectedIndex?: number | null;
116
123
  open?: boolean;
117
124
  disabled?: boolean;
118
125
  setOpen?(open: boolean): void;
126
+ onSelect?(selectedIndex: number | null): void;
119
127
  }
120
128
  declare const SelectWrapper: React.FC<React.PropsWithChildren<IProps>>;
121
129
  interface IReferenceProps {
@@ -9,6 +9,8 @@ export interface IProps<T extends Record<string, any>, K extends keyof T> {
9
9
  optionValue: K;
10
10
  options: T[];
11
11
  value?: T[K];
12
+ tabIndex?: number;
13
+ placeholder?: string;
12
14
  disabled?: boolean;
13
15
  isClearable?: boolean;
14
16
  templateValue?(option?: T): React.ReactNode;
@@ -17,4 +19,4 @@ export interface IProps<T extends Record<string, any>, K extends keyof T> {
17
19
  onFocus?: () => void;
18
20
  onBlur?: () => void;
19
21
  }
20
- export declare const Select: <T extends Record<string, any>, K extends keyof T>({ value, options, optionKey, optionValue, templateValue, templateOption, onBlur, onFocus, onChange, disabled, isClearable, ...props }: IProps<T, K>) => React.JSX.Element;
22
+ export declare const Select: <T extends Record<string, any>, K extends keyof T>({ value, placeholder, tabIndex, options, optionKey, optionValue, templateValue, templateOption, onBlur, onFocus, onChange, disabled, isClearable, ...props }: IProps<T, K>) => React.JSX.Element;