@startupjs-ui/auto-suggest 0.1.15 → 0.1.17

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/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.1.17](https://github.com/startupjs/startupjs-ui/compare/v0.1.16...v0.1.17) (2026-02-12)
7
+
8
+ **Note:** Version bump only for package @startupjs-ui/auto-suggest
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.1.16](https://github.com/startupjs/startupjs-ui/compare/v0.1.15...v0.1.16) (2026-02-10)
15
+
16
+ **Note:** Version bump only for package @startupjs-ui/auto-suggest
17
+
18
+
19
+
20
+
21
+
6
22
  ## [0.1.15](https://github.com/startupjs/startupjs-ui/compare/v0.1.14...v0.1.15) (2026-02-06)
7
23
 
8
24
  **Note:** Version bump only for package @startupjs-ui/auto-suggest
package/README.mdx CHANGED
@@ -6,7 +6,12 @@ import Span from '@startupjs-ui/span'
6
6
  import { Sandbox } from '@startupjs-ui/docs'
7
7
 
8
8
  # AutoSuggest
9
- A text field with a pop-up list of options.
9
+
10
+ AutoSuggest is a text input with a pop-up list of filterable options. As the user types, the options are filtered to match the input text.
11
+
12
+ Use the `options` prop to provide the list of options (strings, numbers, or objects with `value` and `label` keys), `value` for the currently selected value, and `onChange` to handle selection. The component also supports `placeholder` (defaults to `'Select value'`), `size` (`'s'`, `'m'`, `'l'`, defaults to `'m'`), `disabled`, `readonly`, and `isLoading` to show a loader while fetching options.
13
+
14
+ For custom styling, use `style` for the suggestion list container, `captionStyle` for the input wrapper, `inputStyle` for the input field, `iconStyle` for the clear icon, and `inputIcon` for a custom input icon. Use `testID` for testing.
10
15
 
11
16
  ```jsx
12
17
  import { AutoSuggest } from 'startupjs-ui'
@@ -14,9 +19,10 @@ import { AutoSuggest } from 'startupjs-ui'
14
19
 
15
20
  ## Initialization
16
21
 
17
- Before use you need to configure [Portal](/docs/components/Portal)
22
+ Before using AutoSuggest, you need to configure [Portal](/docs/components/Portal).
18
23
 
19
24
  ## Simple example
25
+
20
26
  ```jsx example
21
27
  const [value, setValue] = useState()
22
28
 
@@ -36,11 +42,14 @@ return (
36
42
  ```
37
43
 
38
44
  ## Props
39
- - options: array of objects for options, each option has a value and a label
40
- - value: active value
41
- - maxHeight: maximum height of the popup list
42
- - placeholder: the title of the field
43
- - onChange: callback function, called after selecting a value, takes the selected value as the first parameter
45
+
46
+ - `options` -- an array of options, each being a string, number, or object with `value` and `label` keys.
47
+ - `value` -- the currently selected value.
48
+ - `placeholder` -- placeholder text displayed when no value is selected.
49
+ - `onChange` -- callback called when the user selects a value, receiving the selected value as its argument.
50
+ - `onChangeText` -- callback called when the user types in the input, receiving the current text.
51
+ - `onDismiss` -- callback called when the suggestion list closes.
52
+ - `onScrollEnd` -- callback called when the list is scrolled to the end (useful for loading more options).
44
53
 
45
54
  ```jsx example
46
55
  const [value, setValue] = useState()
@@ -67,7 +76,8 @@ return (
67
76
  ```
68
77
 
69
78
  ## Customization
70
- - renderItem: a function that is called when rendering each element of the array. Gets 3 arguments - the current element (item), its index, and the selected index.
79
+
80
+ Use the `renderItem` prop to customize how each option is rendered. The function receives three arguments: the current item, its index, and the currently highlighted index.
71
81
 
72
82
  ```jsx example
73
83
  const [value, setValue] = useState()
@@ -114,13 +124,6 @@ return (
114
124
  )
115
125
  ```
116
126
 
117
- ## Also
118
- - style: responsible for styled hidden content
119
- - captionStyle: responsible for heading styles (input)
120
- - onDismiss: callback, called when the list is closed
121
- - onChangeText: callback, called when entering text, accepts 1 argument text
122
- - onScrollEnd: callback, called at the end of the scroll
123
-
124
127
  ## Sandbox
125
128
 
126
129
  <Sandbox
package/index.cssx.styl CHANGED
@@ -19,7 +19,7 @@
19
19
  height 100%
20
20
 
21
21
  .contentCase
22
- border-radius 1u
22
+ radius()
23
23
  width 100%
24
24
  height 100%
25
25
  overflow hidden
package/index.d.ts CHANGED
@@ -26,6 +26,8 @@ export interface AutoSuggestProps {
26
26
  options?: AutoSuggestOption[];
27
27
  /** Current selected value */
28
28
  value?: AutoSuggestValue;
29
+ /** Size preset @default 'm' */
30
+ size?: 'l' | 'm' | 's';
29
31
  /** Placeholder text @default 'Select value' */
30
32
  placeholder?: string | number;
31
33
  /** Custom item renderer (item, index, highlightedIndex) */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startupjs-ui/auto-suggest",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -8,17 +8,17 @@
8
8
  "types": "index.d.ts",
9
9
  "type": "module",
10
10
  "dependencies": {
11
- "@startupjs-ui/abstract-popover": "^0.1.11",
11
+ "@startupjs-ui/abstract-popover": "^0.1.16",
12
12
  "@startupjs-ui/core": "^0.1.11",
13
- "@startupjs-ui/flat-list": "^0.1.11",
14
- "@startupjs-ui/loader": "^0.1.11",
15
- "@startupjs-ui/menu": "^0.1.13",
16
- "@startupjs-ui/text-input": "^0.1.13"
13
+ "@startupjs-ui/flat-list": "^0.1.16",
14
+ "@startupjs-ui/loader": "^0.1.16",
15
+ "@startupjs-ui/menu": "^0.1.16",
16
+ "@startupjs-ui/text-input": "^0.1.16"
17
17
  },
18
18
  "peerDependencies": {
19
19
  "react": "*",
20
20
  "react-native": "*",
21
21
  "startupjs": "*"
22
22
  },
23
- "gitHead": "65cbb2aab65224d324a7c9a6f44fb3190ae4bcc2"
23
+ "gitHead": "902cb7536d017b53dc268cc54e8e54818279744c"
24
24
  }