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