@xsolla/xui-b2b-group-select 0.149.0-pr270.1777888548
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 +9 -0
- package/native/index.d.mts +44 -0
- package/native/index.d.ts +44 -0
- package/native/index.js +908 -0
- package/native/index.js.map +1 -0
- package/native/index.mjs +877 -0
- package/native/index.mjs.map +1 -0
- package/package.json +60 -0
- package/web/index.d.mts +44 -0
- package/web/index.d.ts +44 -0
- package/web/index.js +935 -0
- package/web/index.js.map +1 -0
- package/web/index.mjs +897 -0
- package/web/index.mjs.map +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# @xsolla/xui-b2b-group-select
|
|
2
|
+
|
|
3
|
+
B2B grouped multi-select panel: search, category list (left) with checkboxes and counters, and selectable items (right). Intended for dropdown/popover bodies (e.g. regions and countries).
|
|
4
|
+
|
|
5
|
+
- **Docs:** [b2b-group-select.md](../../../docs/api/components/b2b-group-select.md)
|
|
6
|
+
- **Storybook:** B2B → Product Components → Group select
|
|
7
|
+
- **Field + panel:** pair with `@xsolla/xui-multi-select` (`dropdownMenu={false}`, shared `value` / `onChange`); use exported **`GROUP_SELECT_MIN_PANEL_WIDTH`** (540) with `menuMinWidth`.
|
|
8
|
+
- **A11y / tests:** landmark regions, list semantics, keyboard on category controls, live empty state; unit tests in `src/__tests__/GroupSelect.test.tsx` (run `yarn test:run` in this package).
|
|
9
|
+
- **React 16 / RN:** `react >= 16.8`; `yarn build:web` and `yarn build:native` both target the shared source (see API doc).
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ThemeOverrideProps } from '@xsolla/xui-core';
|
|
3
|
+
|
|
4
|
+
type GroupSelectItem = {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
type GroupSelectGroup = {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
items: GroupSelectItem[];
|
|
13
|
+
};
|
|
14
|
+
type GroupSelectProps = ThemeOverrideProps & {
|
|
15
|
+
/** Accessible name for the panel root (`role="region"`). */
|
|
16
|
+
ariaLabel?: string;
|
|
17
|
+
/** Category list with nested selectable items */
|
|
18
|
+
groups: GroupSelectGroup[];
|
|
19
|
+
/** Selected item ids (flat across all groups) */
|
|
20
|
+
value: string[];
|
|
21
|
+
onChange: (nextValue: string[]) => void;
|
|
22
|
+
/** Controlled active category id */
|
|
23
|
+
activeGroupId?: string;
|
|
24
|
+
/** When active category changes (controlled or uncontrolled) */
|
|
25
|
+
onActiveGroupChange?: (groupId: string) => void;
|
|
26
|
+
/** Placeholder for search input */
|
|
27
|
+
searchPlaceholder?: string;
|
|
28
|
+
/** Message when search/filter yields nothing */
|
|
29
|
+
emptyMessage?: string;
|
|
30
|
+
/** Left column width (Figma default 280) */
|
|
31
|
+
leftColumnWidth?: number;
|
|
32
|
+
/** Max height for scrollable lists */
|
|
33
|
+
listMaxHeight?: number;
|
|
34
|
+
/** Label for bulk-select action when not everything visible is selected */
|
|
35
|
+
selectAllLabel?: string;
|
|
36
|
+
/** Label when all visible items are selected */
|
|
37
|
+
unselectAllLabel?: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** Default `minWidth` of the panel root; keep in sync with MultiSelect external-field default. */
|
|
41
|
+
declare const GROUP_SELECT_MIN_PANEL_WIDTH = 540;
|
|
42
|
+
declare const GroupSelect: React.FC<GroupSelectProps>;
|
|
43
|
+
|
|
44
|
+
export { GROUP_SELECT_MIN_PANEL_WIDTH, GroupSelect, type GroupSelectGroup, type GroupSelectItem, type GroupSelectProps };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ThemeOverrideProps } from '@xsolla/xui-core';
|
|
3
|
+
|
|
4
|
+
type GroupSelectItem = {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
type GroupSelectGroup = {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
items: GroupSelectItem[];
|
|
13
|
+
};
|
|
14
|
+
type GroupSelectProps = ThemeOverrideProps & {
|
|
15
|
+
/** Accessible name for the panel root (`role="region"`). */
|
|
16
|
+
ariaLabel?: string;
|
|
17
|
+
/** Category list with nested selectable items */
|
|
18
|
+
groups: GroupSelectGroup[];
|
|
19
|
+
/** Selected item ids (flat across all groups) */
|
|
20
|
+
value: string[];
|
|
21
|
+
onChange: (nextValue: string[]) => void;
|
|
22
|
+
/** Controlled active category id */
|
|
23
|
+
activeGroupId?: string;
|
|
24
|
+
/** When active category changes (controlled or uncontrolled) */
|
|
25
|
+
onActiveGroupChange?: (groupId: string) => void;
|
|
26
|
+
/** Placeholder for search input */
|
|
27
|
+
searchPlaceholder?: string;
|
|
28
|
+
/** Message when search/filter yields nothing */
|
|
29
|
+
emptyMessage?: string;
|
|
30
|
+
/** Left column width (Figma default 280) */
|
|
31
|
+
leftColumnWidth?: number;
|
|
32
|
+
/** Max height for scrollable lists */
|
|
33
|
+
listMaxHeight?: number;
|
|
34
|
+
/** Label for bulk-select action when not everything visible is selected */
|
|
35
|
+
selectAllLabel?: string;
|
|
36
|
+
/** Label when all visible items are selected */
|
|
37
|
+
unselectAllLabel?: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** Default `minWidth` of the panel root; keep in sync with MultiSelect external-field default. */
|
|
41
|
+
declare const GROUP_SELECT_MIN_PANEL_WIDTH = 540;
|
|
42
|
+
declare const GroupSelect: React.FC<GroupSelectProps>;
|
|
43
|
+
|
|
44
|
+
export { GROUP_SELECT_MIN_PANEL_WIDTH, GroupSelect, type GroupSelectGroup, type GroupSelectItem, type GroupSelectProps };
|