@startupjs-ui/auto-suggest 0.1.14 → 0.1.16

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.16](https://github.com/startupjs/startupjs-ui/compare/v0.1.15...v0.1.16) (2026-02-10)
7
+
8
+ **Note:** Version bump only for package @startupjs-ui/auto-suggest
9
+
10
+
11
+
12
+
13
+
14
+ ## [0.1.15](https://github.com/startupjs/startupjs-ui/compare/v0.1.14...v0.1.15) (2026-02-06)
15
+
16
+ **Note:** Version bump only for package @startupjs-ui/auto-suggest
17
+
18
+
19
+
20
+
21
+
6
22
  ## [0.1.14](https://github.com/startupjs/startupjs-ui/compare/v0.1.13...v0.1.14) (2026-02-06)
7
23
 
8
24
 
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
@@ -6,7 +6,6 @@
6
6
  right 0
7
7
  bottom 0
8
8
 
9
-
10
9
  .loaderCase
11
10
  justify-content center
12
11
  align-items center
@@ -18,7 +17,6 @@
18
17
  .content
19
18
  width 100%
20
19
  height 100%
21
- background-color var(--color-bg-main)
22
20
 
23
21
  .contentCase
24
22
  border-radius 1u
@@ -28,3 +26,9 @@
28
26
 
29
27
  .selectMenu
30
28
  background-color var(--AutoSuggest-itemBg)
29
+
30
+ .attachment
31
+ background-color var(--color-bg-main-strong)
32
+ radius()
33
+ shadow(3)
34
+ 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/index.tsx CHANGED
@@ -233,7 +233,7 @@ function AutoSuggest ({
233
233
  testID=testID
234
234
  )
235
235
 
236
- AbstractPopover(
236
+ AbstractPopover.attachment(
237
237
  visible=(isShow || isLoading)
238
238
  anchorRef=inputRef
239
239
  matchAnchorWidth=matchAnchorWidth
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startupjs-ui/auto-suggest",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
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": "f6c2eb24b758f5e3de16bba9397aeb8f5585e260"
23
+ "gitHead": "9943aa3566d5d80f5b404473906eb3c0611f9ee5"
24
24
  }