@sproutsocial/seeds-react-menu 0.2.2 → 0.2.3
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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +6 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +28 -7
- package/dist/index.d.ts +28 -7
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/ActionMenu/ActionMenu.tsx +2 -16
- package/src/ActionMenu/ActionMenuTypes.ts +12 -0
- package/src/ActionMenu/index.ts +1 -0
- package/src/{ComboBox/ComboBox.feature → Autocomplete/Autocomplete.feature} +16 -16
- package/src/Autocomplete/Autocomplete.tsx +65 -0
- package/src/Autocomplete/AutocompleteTypes.ts +8 -0
- package/src/Autocomplete/__tests__/Autocomplete.test.tsx +113 -0
- package/src/Autocomplete/__tests__/Autocomplete.typetest.tsx +78 -0
- package/src/Autocomplete/index.ts +2 -0
- package/src/MenuContent/MenuContent.tsx +1 -1
- package/src/MenuContext.tsx +65 -9
- package/src/MenuItem/__tests__/MenuItem.test.tsx +4 -1
- package/src/MultiSelectMenu/MultiSelectMenuTypes.ts +5 -1
- package/src/MultiSelectMenu/__tests__/MultiSelectMenu.test.tsx +0 -2
- package/src/MultiSelectMenu/index.ts +1 -0
- package/src/SingleSelectMenu/SingleSelectMenuTypes.ts +2 -3
- package/src/reducers/useComboboxStateReducer.tsx +26 -0
- package/src/ComboBox/TokenInput.feature +0 -84
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
Feature: TokenInput
|
|
2
|
-
|
|
3
|
-
A component that allows users to search, select, and manage tokens with autocomplete functionality.
|
|
4
|
-
|
|
5
|
-
Rule: User behavior
|
|
6
|
-
|
|
7
|
-
Background:
|
|
8
|
-
Given an end user is using the component
|
|
9
|
-
|
|
10
|
-
Scenario: User can add tokens
|
|
11
|
-
Given the ComboBox accepts new values
|
|
12
|
-
When text is typed
|
|
13
|
-
And a delimiter key is pressed
|
|
14
|
-
Then a new token is created from the input text
|
|
15
|
-
|
|
16
|
-
Scenario: User can not add tokens
|
|
17
|
-
Given the ComboBox does not accept new values
|
|
18
|
-
When text is typed
|
|
19
|
-
And a delimiter key is pressed
|
|
20
|
-
Then no new token is added
|
|
21
|
-
|
|
22
|
-
Scenario: User can remove tokens manually
|
|
23
|
-
Given the ComboBox has tokens
|
|
24
|
-
When token's remove button is clicked
|
|
25
|
-
Then the token is removed
|
|
26
|
-
|
|
27
|
-
Scenario: User can remove tokens with backspace
|
|
28
|
-
Given the ComboBox has tokens
|
|
29
|
-
When backspace is hit
|
|
30
|
-
Then the token is removed
|
|
31
|
-
|
|
32
|
-
Scenario: User can navigate tokens via keyboard
|
|
33
|
-
Given the ComboBox has tokens
|
|
34
|
-
And the Combobox Input has focus
|
|
35
|
-
When the tokens are navigated using arrow keys
|
|
36
|
-
Then the activeToken callback fires
|
|
37
|
-
|
|
38
|
-
Scenario: Component handles token addition
|
|
39
|
-
When a new token is added
|
|
40
|
-
Then the onAddToken callback fires
|
|
41
|
-
|
|
42
|
-
Scenario: Component handles token removal
|
|
43
|
-
Given the ComboBox is rendered with tokens
|
|
44
|
-
When a token is removed
|
|
45
|
-
Then the onRemoveToken callback fires
|
|
46
|
-
|
|
47
|
-
Scenario: Component handles token click
|
|
48
|
-
When a token is clicked
|
|
49
|
-
Then the onClickToken callback fires
|
|
50
|
-
|
|
51
|
-
Scenario: Component handles input change
|
|
52
|
-
When the input value changes
|
|
53
|
-
Then the onChange callback fires
|
|
54
|
-
|
|
55
|
-
Rule: API
|
|
56
|
-
Background:
|
|
57
|
-
Given an engineer is developing using the component
|
|
58
|
-
|
|
59
|
-
Scenario: TokenInput extends Combobox
|
|
60
|
-
When Combobox features are used in TokenInput
|
|
61
|
-
Then the TokenInput responds as a Combobox would
|
|
62
|
-
|
|
63
|
-
Scenario: ComboBox accepts tokens
|
|
64
|
-
When a token component is passed to the Combobox
|
|
65
|
-
And an item is selected
|
|
66
|
-
Then the token is rendered in the input
|
|
67
|
-
|
|
68
|
-
Scenario: ComboBox has a maximum token length
|
|
69
|
-
When 'tokenMaxLength' is set to <value>
|
|
70
|
-
Then the token string size is limited to <value>
|
|
71
|
-
|
|
72
|
-
Scenario Outline: ComboBox checks its types
|
|
73
|
-
When <propName> is passed a value
|
|
74
|
-
Then ComboBox expects it to be of type <propType>
|
|
75
|
-
|
|
76
|
-
Examples: Prop Types
|
|
77
|
-
| activeToken | string |
|
|
78
|
-
| tokens | array of { id: string, iconName?: EnumIconNames, value: string, valid?: boolean } |
|
|
79
|
-
| onChangeTokens | function |
|
|
80
|
-
| onAddToken | function |
|
|
81
|
-
| onRemoveToken | function |
|
|
82
|
-
| onClickToken | function |
|
|
83
|
-
| maxLength | number |
|
|
84
|
-
| tokenMaxLength | number |
|