@xsolla/xui-toggle-button-group 0.148.0 → 0.148.1
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/package.json +3 -3
- package/web/index.d.mts +61 -0
- package/web/index.d.ts +61 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-toggle-button-group",
|
|
3
|
-
"version": "0.148.
|
|
3
|
+
"version": "0.148.1",
|
|
4
4
|
"main": "./web/index.js",
|
|
5
5
|
"module": "./web/index.mjs",
|
|
6
6
|
"types": "./web/index.d.ts",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"build:native": "PLATFORM=native tsup"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xsolla/xui-core": "0.148.
|
|
14
|
-
"@xsolla/xui-primitives-core": "0.148.
|
|
13
|
+
"@xsolla/xui-core": "0.148.1",
|
|
14
|
+
"@xsolla/xui-primitives-core": "0.148.1"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"react": ">=16.8.0",
|
package/web/index.d.mts
CHANGED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ThemeOverrideProps } from '@xsolla/xui-core';
|
|
3
|
+
|
|
4
|
+
type ToggleButtonGroupSize = "xl" | "lg" | "md" | "sm" | "xs";
|
|
5
|
+
type ToggleButtonGroupAppearance = "separated" | "united";
|
|
6
|
+
interface ToggleButtonGroupItem {
|
|
7
|
+
/** Unique identifier for the item */
|
|
8
|
+
id: string;
|
|
9
|
+
/** Display label for the item */
|
|
10
|
+
label: string;
|
|
11
|
+
/** Optional icon to display on the left */
|
|
12
|
+
iconLeft?: React.ReactNode;
|
|
13
|
+
/** Optional icon to display on the right */
|
|
14
|
+
iconRight?: React.ReactNode;
|
|
15
|
+
/** Whether the item is disabled */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** Accessible label for screen readers */
|
|
18
|
+
"aria-label"?: string;
|
|
19
|
+
}
|
|
20
|
+
interface ToggleButtonGroupProps extends ThemeOverrideProps {
|
|
21
|
+
/** Array of items */
|
|
22
|
+
items: ToggleButtonGroupItem[];
|
|
23
|
+
/** ID(s) of the currently active item(s). For single selection, pass a string. For multiple selection, pass an array. */
|
|
24
|
+
value?: string | string[];
|
|
25
|
+
/** Default value(s) for uncontrolled mode */
|
|
26
|
+
defaultValue?: string | string[];
|
|
27
|
+
/** Callback when selection changes. Returns string for single selection, string[] for multiple. */
|
|
28
|
+
onChange?: (value: string | string[]) => void;
|
|
29
|
+
/** Size variant */
|
|
30
|
+
size?: ToggleButtonGroupSize;
|
|
31
|
+
/** Visual appearance - separated has gaps, united has connected items */
|
|
32
|
+
appearance?: ToggleButtonGroupAppearance;
|
|
33
|
+
/** Whether multiple items can be selected */
|
|
34
|
+
multiple?: boolean;
|
|
35
|
+
/** HTML id attribute */
|
|
36
|
+
id?: string;
|
|
37
|
+
/** Test ID for testing frameworks */
|
|
38
|
+
testID?: string;
|
|
39
|
+
/** Accessible label for the group */
|
|
40
|
+
"aria-label"?: string;
|
|
41
|
+
/** ID of element that labels this group */
|
|
42
|
+
"aria-labelledby"?: string;
|
|
43
|
+
/** Full width of the container */
|
|
44
|
+
fullWidth?: boolean;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* ToggleButtonGroup - A control for picking one or several options from a set
|
|
49
|
+
*
|
|
50
|
+
* Used to pick one or several options from a linear set of closely related options.
|
|
51
|
+
* Can be used to filter or to sort elements.
|
|
52
|
+
*
|
|
53
|
+
* ## Accessibility Features
|
|
54
|
+
*
|
|
55
|
+
* - **Role**: Uses `role="radiogroup"` for single selection, `role="group"` for multiple
|
|
56
|
+
* - **Keyboard Navigation**: Arrow keys to navigate, Enter/Space to select
|
|
57
|
+
* - **ARIA**: Proper aria-checked and aria-disabled states
|
|
58
|
+
*/
|
|
59
|
+
declare const ToggleButtonGroup: React.FC<ToggleButtonGroupProps>;
|
|
60
|
+
|
|
61
|
+
export { ToggleButtonGroup, type ToggleButtonGroupAppearance, type ToggleButtonGroupItem, type ToggleButtonGroupProps, type ToggleButtonGroupSize };
|
package/web/index.d.ts
CHANGED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ThemeOverrideProps } from '@xsolla/xui-core';
|
|
3
|
+
|
|
4
|
+
type ToggleButtonGroupSize = "xl" | "lg" | "md" | "sm" | "xs";
|
|
5
|
+
type ToggleButtonGroupAppearance = "separated" | "united";
|
|
6
|
+
interface ToggleButtonGroupItem {
|
|
7
|
+
/** Unique identifier for the item */
|
|
8
|
+
id: string;
|
|
9
|
+
/** Display label for the item */
|
|
10
|
+
label: string;
|
|
11
|
+
/** Optional icon to display on the left */
|
|
12
|
+
iconLeft?: React.ReactNode;
|
|
13
|
+
/** Optional icon to display on the right */
|
|
14
|
+
iconRight?: React.ReactNode;
|
|
15
|
+
/** Whether the item is disabled */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** Accessible label for screen readers */
|
|
18
|
+
"aria-label"?: string;
|
|
19
|
+
}
|
|
20
|
+
interface ToggleButtonGroupProps extends ThemeOverrideProps {
|
|
21
|
+
/** Array of items */
|
|
22
|
+
items: ToggleButtonGroupItem[];
|
|
23
|
+
/** ID(s) of the currently active item(s). For single selection, pass a string. For multiple selection, pass an array. */
|
|
24
|
+
value?: string | string[];
|
|
25
|
+
/** Default value(s) for uncontrolled mode */
|
|
26
|
+
defaultValue?: string | string[];
|
|
27
|
+
/** Callback when selection changes. Returns string for single selection, string[] for multiple. */
|
|
28
|
+
onChange?: (value: string | string[]) => void;
|
|
29
|
+
/** Size variant */
|
|
30
|
+
size?: ToggleButtonGroupSize;
|
|
31
|
+
/** Visual appearance - separated has gaps, united has connected items */
|
|
32
|
+
appearance?: ToggleButtonGroupAppearance;
|
|
33
|
+
/** Whether multiple items can be selected */
|
|
34
|
+
multiple?: boolean;
|
|
35
|
+
/** HTML id attribute */
|
|
36
|
+
id?: string;
|
|
37
|
+
/** Test ID for testing frameworks */
|
|
38
|
+
testID?: string;
|
|
39
|
+
/** Accessible label for the group */
|
|
40
|
+
"aria-label"?: string;
|
|
41
|
+
/** ID of element that labels this group */
|
|
42
|
+
"aria-labelledby"?: string;
|
|
43
|
+
/** Full width of the container */
|
|
44
|
+
fullWidth?: boolean;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* ToggleButtonGroup - A control for picking one or several options from a set
|
|
49
|
+
*
|
|
50
|
+
* Used to pick one or several options from a linear set of closely related options.
|
|
51
|
+
* Can be used to filter or to sort elements.
|
|
52
|
+
*
|
|
53
|
+
* ## Accessibility Features
|
|
54
|
+
*
|
|
55
|
+
* - **Role**: Uses `role="radiogroup"` for single selection, `role="group"` for multiple
|
|
56
|
+
* - **Keyboard Navigation**: Arrow keys to navigate, Enter/Space to select
|
|
57
|
+
* - **ARIA**: Proper aria-checked and aria-disabled states
|
|
58
|
+
*/
|
|
59
|
+
declare const ToggleButtonGroup: React.FC<ToggleButtonGroupProps>;
|
|
60
|
+
|
|
61
|
+
export { ToggleButtonGroup, type ToggleButtonGroupAppearance, type ToggleButtonGroupItem, type ToggleButtonGroupProps, type ToggleButtonGroupSize };
|