agroptima-design-system 1.1.1 → 1.1.2-beta.0

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,6 +1,6 @@
1
1
  {
2
2
  "name": "agroptima-design-system",
3
- "version": "1.1.1",
3
+ "version": "1.1.2-beta.0",
4
4
  "scripts": {
5
5
  "dev": "npm run storybook",
6
6
  "storybook": "storybook dev -p 6006 --ci",
@@ -20,10 +20,8 @@ export type Payload = {
20
20
  page_size?: string
21
21
  }
22
22
 
23
- export interface InfiniteSelectProps<T> extends Omit<
24
- BaseSelectProps,
25
- 'defaultValue' | 'isEmpty' | 'children'
26
- > {
23
+ export interface InfiniteSelectProps<T>
24
+ extends Omit<BaseSelectProps, 'defaultValue' | 'isEmpty' | 'children'> {
27
25
  id?: string
28
26
  name?: string
29
27
  label: string
@@ -39,7 +37,7 @@ export interface InfiniteSelectProps<T> extends Omit<
39
37
  query: (payload: Payload) => Promise<{ items: T[]; totalPages: number }>
40
38
  errors?: string[]
41
39
  fullWidth?: boolean
42
- onChange?: (value: T) => void
40
+ onChange?: (value: T | null) => void
43
41
  }
44
42
 
45
43
  export function InfiniteSelect<T extends { uid: string }>({
@@ -90,6 +88,7 @@ export function InfiniteSelect<T extends { uid: string }>({
90
88
 
91
89
  const handleClear = () => {
92
90
  setSelectedItem(null)
91
+ onChange(null)
93
92
  }
94
93
  const handleSelectOption = (item: T) => {
95
94
  // TODO: MultiSelect case
@@ -8,10 +8,8 @@ import { SelectTrigger } from './SelectTrigger'
8
8
 
9
9
  export type Option = { id: string; label: string }
10
10
 
11
- export interface SelectProps extends Omit<
12
- BaseSelectProps,
13
- 'isEmpty' | 'children'
14
- > {
11
+ export interface SelectProps
12
+ extends Omit<BaseSelectProps, 'isEmpty' | 'children'> {
15
13
  placeholder?: string
16
14
  options: Option[]
17
15
  label: string
@@ -140,6 +140,9 @@ export const Primary: Story = {
140
140
  return item.name || ''
141
141
  },
142
142
  query: fakeQuery,
143
+ onChange: (value) => {
144
+ console.log('selected', value)
145
+ },
143
146
  },
144
147
  parameters: figmaPrimaryDesign,
145
148
  }