@xsolla/xui-multi-select 0.202.2 → 0.202.4

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/README.md CHANGED
@@ -3,67 +3,54 @@
3
3
  A cross-platform multi-select control that lets users pick multiple options from a dropdown list.
4
4
 
5
5
  <!-- BEGIN:xui-mcp-instructions:multi-select -->
6
- MultiSelect lets users choose several values from a predefined list at the same time. Selected values are shown inline as removable tags, so users can see and adjust their choices without reopening the menu. It is commonly used in filters, forms, and settings where more than one option can apply.
6
+ A dropdown input that allows selecting multiple values simultaneously. Displays the current selections inside the field as text labels or removable tag chips, opens a ContextMenu with checkboxes when clicked, and supports an optional count tag when selections overflow. Built on the same trigger pattern as Select but with multi-value semantics.
7
7
 
8
8
  ### When to use
9
-
10
- When the user needs to pick more than one value from a fixed, known list (tags, categories, recipients, etc.)
11
-
12
- When it helps the user to see all current selections at once, displayed as removable tags
13
- - When the set of options is finite and does not require freeform typing
14
- - As part of a larger form or filter bar alongside other controls
9
+ - When the user must choose more than one value from a predefined list — multiple tags, categories, permissions, countries, features
10
+ - In filter bars where the user applies several filters simultaneously
11
+ - In forms where a many-to-many relationship must be configured (e.g. assigning roles, selecting supported platforms)
12
+ - When the full list of options must remain visible and re-selectable without navigating away
15
13
 
16
14
  ### When not to use
17
-
18
- - When only one value can be chosen — use a Select instead
19
- - When the value is freeform text the user must type — use a TextArea instead
20
- - When the list is short and every option should always stay visible — use a group of Checkboxes instead
21
- - When the choice is a single on/off — use a Switch or Checkbox instead
22
- - When the list is very long and the user mainly needs to search rather than browse — pair the field with search or reconsider the pattern
15
+ - When only one value can be selected at a time — use Select
16
+ - When the number of selectable options is very small (2–4) and all options should be permanently visible — use Checkbox group or ToggleButtonGroup
17
+ - When the user needs to type free-form tags or values not from a predefined list — use a tag input component
18
+ - When the user needs to rank or order selections — use a dedicated sortable list
23
19
 
24
20
  ### Content guidelines
25
-
26
- Do not use the placeholder as a substitute for a label.
27
-
28
- Placeholder text should prompt the action, not repeat the label (e.g. *"Select tags"*, not *"Tags"*).
29
-
30
- Option labels should be short, parallel in structure, and ordered logically alphabetically, by frequency, or by a meaningful sequence rather than at random.
31
-
32
- Each selected tag should carry the same label as its option so users can match a tag back to its source.
33
-
34
- When selections overflow a non-flexible field, collapse the remainder into a clear *"+N"* counter (e.g. *"+5"*) rather than truncating tags.
35
-
36
- Error messages should be constructive: explain what is wrong and how to fix it (e.g. *"Select at least one option"*, not just *"Invalid input"*).
37
-
38
- The clear-all button should appear only when at least one value is selected.
21
+ - Placeholder text — use a concise instructional phrase: *"Select categories"*, *"Choose platforms"*, *"Pick permissions"*. Avoid generic *"Select…"* alone.
22
+ - Option labels keep each option label short (1–4 words). Use parallel structure across all options (all nouns or all short phrases). No trailing punctuation.
23
+ - Option order — alphabetical or most common first. Do not randomise.
24
+ - Count tag format always use +N format (e.g. +3, +12). Do not spell out *"3 more"* inside a chip.
25
+ - Clear button — enable for optional fields. Do not show on required fields — clearing all values on a required field immediately produces a validation error.
26
+ - Field labelalways provide a visible label above the field via FieldGroup.
27
+ - Error messages — be specific:
28
+ - *"Please select at least one category"* (required, empty on submit)
29
+ - *"You can select a maximum of 5 items"* (max exceeded)
39
30
 
40
31
  ### Behaviour guidelines
41
-
42
- Flexible: Truethe field grows vertically, wrapping selected tags onto multiple rows so every selection stays visible.
43
-
44
- Flexible: False — the field keeps a single row; tags that don't fit collapse into a *"+N"* counter, and the full set is visible on open or hover.
45
-
46
- Removing values — the on a tag deselects that single value; the clear-all button on the right removes every selection at once.
47
-
48
- Selectingopening the menu shows options with their selected state marked; choosing or unchoosing an option keeps the menu open so users can pick several in a row.
49
-
50
- Dismissalclicking outside the menu or pressing Escape closes the dropdown without discarding the current selection.
51
-
52
- Validation timing — do not show errors before the user has interacted with the field. Validate on blur or on submit, and preserve the selected values when showing an error.
32
+ - Multi-select model — multiple values can be selected independently. Selecting one value does not deselect others. Unchecking an option in the ContextMenu removes it from the field.
33
+ - Individual removal (Tag variant) when Variant=Tag and Remove button=true, clicking on a chip removes that specific value from the selection without reopening the dropdown. The ContextMenu reflects the change if it is open.
34
+ - Clear all — clicking the clear button (✕, Clear button=true) removes all selections at once and returns the field to Fill=False.
35
+ - Count tag when selections overflow the visible content area, show a +N count tag. Clicking it opens the dropdown panel so the user can review all selected values.
36
+ - Opening — clicking the field or pressing Enter / Space / ↓ when focused opens the ContextMenu. The field enters State=Focus; the chevron rotates upward.
37
+ - Closing — the ContextMenu closes on: clicking outside, pressing Escape, or pressing Tab. Focus returns to the MultiSelect field.
38
+ - Validation — validate on blur (field loses focus with the dropdown closed) or on form submit. Show State=Error with a message if the selection is invalid (e.g. required field with no selection, or max selection exceeded).
39
+ - Disabled State=Disable prevents opening the dropdown. Existing selections remain visible in muted style.
40
+ - ContextMenu width — the ContextMenu panel must be at least as wide as the MultiSelect field. Never open a narrower panel.
41
+ - Real-time update the field content updates as the user checks/unchecks options. Do not batch updates to the field until the dropdown closes.
53
42
 
54
43
  ### Accessibility
55
-
56
- Expose the multi-selectable nature and current selection state to assistive technology, and announce changes as values are added or removed.
57
-
58
- Each tag's remove control must be keyboard-focusable and clearly labelled (e.g. *"Remove [value]"*).
59
-
60
- Error messages must be linked to the field via aria-describedby so screen readers announce them on focus.
61
-
62
- Support full keyboard operation: open and close the menu, move through options with the arrow keys, toggle selection with Enter / Space, and remove tags without a mouse.
63
-
64
- Never rely on placeholder, tag color, or icon alone to communicate the field's purpose or state always provide an associated label.
65
-
66
- Disabled fields should not receive keyboard focus; consider a read-only state if the selected values still need to be accessible.
44
+ - MultiSelect must have role=*"combobox"* (or role=*"button"*) with aria-haspopup=*"listbox"* and aria-expanded=*"true"* / *"false"*.
45
+ - The field must have an accessible name via <label for> (from FieldGroup), aria-label, or aria-labelledby.
46
+ - The selected values must be reflected in aria-label or as visually visible text so screen readers can announce the current state — e.g. aria-label=*"Categories: Design, Development, Marketing"*.
47
+ - When Variant=Tag and Remove button=true, each chip's remove button must have aria-label=*"Remove [value name]"* e.g. aria-label=*"Remove Design"*.
48
+ - The count tag (+N) must have aria-label describing the hidden count — e.g. aria-label=*"3 more selected items"*.
49
+ - The clear button must have aria-label=*"Clear all selections"*.
50
+ - When State=Error, the error message must be linked via aria-describedby and in an aria-live=*"polite"* region.
51
+ - The ContextMenu dropdown uses role=*"listbox"* (or role=*"menu"*) with each option as role=*"option"* / role=*"menuitemcheckbox"* and aria-checked=*"true"* / *"false"*.
52
+ - Keyboard navigation: Enter / Space / ↓ opens the dropdown; ↑ / ↓ navigate options; Space toggles the focused option; Escape closes without further changes; Tab closes and moves focus forward.
53
+ - When a value is added or removed (via chip or from dropdown), announce the change via aria-live=*"polite"*: *"Design added"* or *"Design removed"*.
67
54
  <!-- END:xui-mcp-instructions:multi-select -->
68
55
 
69
56
  ## Installation
package/native/index.js CHANGED
@@ -1757,7 +1757,8 @@ var MultiSelect = (0, import_react10.forwardRef)(
1757
1757
  style: {
1758
1758
  maxHeight: searchable ? maxHeight - 60 : maxHeight,
1759
1759
  overflowY: "auto",
1760
- overflowX: optionListOverflowX
1760
+ overflowX: optionListOverflowX,
1761
+ scrollbarWidth: "none"
1761
1762
  },
1762
1763
  children: menuItems.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1763
1764
  Box,