@xsolla/xui-status-dropdown 0.148.0-pr266.1777536173

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 ADDED
@@ -0,0 +1,24 @@
1
+ # @xsolla/xui-status-dropdown
2
+
3
+ An interactive status tag component that opens a context menu to change the status.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ yarn add @xsolla/xui-status-dropdown
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```tsx
14
+ import { StatusDropdown } from '@xsolla/xui-status-dropdown';
15
+
16
+ <StatusDropdown
17
+ palette="success"
18
+ label="Success"
19
+ onStatusChange={(newStatus) => console.log(newStatus)}
20
+ >
21
+ <ContextMenuItem label="Success" value="success" />
22
+ <ContextMenuItem label="Warning" value="warning" />
23
+ </StatusDropdown>
24
+ ```
@@ -0,0 +1,35 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { ThemeOverrideProps } from '@xsolla/xui-core';
3
+
4
+ type StatusDropdownPalette = "Neutral" | "Success" | "Warning" | "Alert" | "Brand";
5
+ interface StatusDropdownProps extends ThemeOverrideProps {
6
+ /** The current status label to display */
7
+ label: string;
8
+ /** Color palette for the status indicator */
9
+ palette?: StatusDropdownPalette;
10
+ /** Whether to show the status dot */
11
+ dot?: boolean;
12
+ /** Dropdown menu content (usually ContextMenuItem components) */
13
+ children: ReactNode;
14
+ /** Callback when a menu item is selected. Value comes from child ContextMenuItem. */
15
+ onSelect?: (value: any) => void;
16
+ /** Whether the dropdown is open (controlled) */
17
+ isOpen?: boolean;
18
+ /** Callback when the open state changes */
19
+ onOpenChange?: (isOpen: boolean) => void;
20
+ /** Accessible label for the dropdown trigger. If not provided, one is generated from label. */
21
+ "aria-label"?: string;
22
+ /** Test ID for testing frameworks */
23
+ testID?: string;
24
+ /** HTML id attribute */
25
+ id?: string;
26
+ }
27
+
28
+ /**
29
+ * StatusDropdown - A compact interactive status tag
30
+ *
31
+ * Displays current status and allows changing it via a context menu.
32
+ */
33
+ declare const StatusDropdown: React.ForwardRefExoticComponent<StatusDropdownProps & React.RefAttributes<any>>;
34
+
35
+ export { StatusDropdown, type StatusDropdownPalette, type StatusDropdownProps };
@@ -0,0 +1,35 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { ThemeOverrideProps } from '@xsolla/xui-core';
3
+
4
+ type StatusDropdownPalette = "Neutral" | "Success" | "Warning" | "Alert" | "Brand";
5
+ interface StatusDropdownProps extends ThemeOverrideProps {
6
+ /** The current status label to display */
7
+ label: string;
8
+ /** Color palette for the status indicator */
9
+ palette?: StatusDropdownPalette;
10
+ /** Whether to show the status dot */
11
+ dot?: boolean;
12
+ /** Dropdown menu content (usually ContextMenuItem components) */
13
+ children: ReactNode;
14
+ /** Callback when a menu item is selected. Value comes from child ContextMenuItem. */
15
+ onSelect?: (value: any) => void;
16
+ /** Whether the dropdown is open (controlled) */
17
+ isOpen?: boolean;
18
+ /** Callback when the open state changes */
19
+ onOpenChange?: (isOpen: boolean) => void;
20
+ /** Accessible label for the dropdown trigger. If not provided, one is generated from label. */
21
+ "aria-label"?: string;
22
+ /** Test ID for testing frameworks */
23
+ testID?: string;
24
+ /** HTML id attribute */
25
+ id?: string;
26
+ }
27
+
28
+ /**
29
+ * StatusDropdown - A compact interactive status tag
30
+ *
31
+ * Displays current status and allows changing it via a context menu.
32
+ */
33
+ declare const StatusDropdown: React.ForwardRefExoticComponent<StatusDropdownProps & React.RefAttributes<any>>;
34
+
35
+ export { StatusDropdown, type StatusDropdownPalette, type StatusDropdownProps };