@xsolla/xui-status-dropdown 0.216.1 → 0.217.0
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 +2 -1
- package/native/index.d.mts +9 -1
- package/native/index.d.ts +9 -1
- package/native/index.js +2 -1
- package/native/index.js.map +1 -1
- package/native/index.mjs +2 -1
- package/native/index.mjs.map +1 -1
- package/package.json +5 -5
- package/web/index.d.mts +9 -1
- package/web/index.d.ts +9 -1
- package/web/index.js +2 -1
- package/web/index.js.map +1 -1
- package/web/index.mjs +2 -1
- package/web/index.mjs.map +1 -1
package/README.md
CHANGED
|
@@ -86,6 +86,7 @@ const [status, setStatus] = useState('Success');
|
|
|
86
86
|
| `palette` | `'Neutral' \| 'Success' \| 'Warning' \| 'Alert' \| 'Brand'` | `'Neutral'` | Colour palette for the trigger. |
|
|
87
87
|
| `dot` | `boolean` | `false` | Show a small status dot before the label. |
|
|
88
88
|
| `children` | `ReactNode` | — | Menu content; typically `ContextMenuItem` elements. |
|
|
89
|
+
| `triggerThemeMode` | `ThemeMode` | — | Theme mode for the trigger only, overriding `themeMode` for the trigger. When omitted, the trigger falls back to `themeMode` (which inherits from `XUIProvider`). Set `triggerThemeMode="light"` to keep the trigger light while the menu is dark (FEP-898). |
|
|
89
90
|
| `placement` | `ContextMenuPlacement` | `'bottom-start'` | Menu placement relative to the trigger. |
|
|
90
91
|
| `onSelect` | `(value: any) => void` | — | Fired when a menu item is selected. |
|
|
91
92
|
| `isOpen` | `boolean` | — | Controlled open state. |
|
|
@@ -94,7 +95,7 @@ const [status, setStatus] = useState('Success');
|
|
|
94
95
|
| `id` | `string` | — | HTML id on the underlying dropdown. |
|
|
95
96
|
| `testID` | `string` | — | Test identifier; suffixed for inner trigger and dot. |
|
|
96
97
|
|
|
97
|
-
Inherits `ThemeOverrideProps` (`themeMode`, `themeProductContext`).
|
|
98
|
+
Inherits `ThemeOverrideProps` (`themeMode`, `themeProductContext`). `themeMode` styles both the trigger and the menu; use `triggerThemeMode` to override the trigger's theme independently (e.g. a light trigger over a dark menu).
|
|
98
99
|
|
|
99
100
|
### Types
|
|
100
101
|
|
package/native/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import { ThemeOverrideProps } from '@xsolla/xui-core';
|
|
2
|
+
import { ThemeOverrideProps, ThemeMode } from '@xsolla/xui-core';
|
|
3
3
|
import { ContextMenuPlacement } from '@xsolla/xui-context-menu';
|
|
4
4
|
|
|
5
5
|
type StatusDropdownPalette = "Neutral" | "Success" | "Warning" | "Alert" | "Brand";
|
|
@@ -17,6 +17,14 @@ interface StatusDropdownProps extends ThemeOverrideProps {
|
|
|
17
17
|
dot?: boolean;
|
|
18
18
|
/** Dropdown menu content (usually ContextMenuItem components) */
|
|
19
19
|
children: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Theme mode for the trigger only, overriding the context menu's `themeMode`
|
|
22
|
+
* for the trigger. When omitted, the trigger falls back to `themeMode` (which
|
|
23
|
+
* inherits from XUIProvider), so trigger and menu match by default. Set
|
|
24
|
+
* `triggerThemeMode="light"` to keep the trigger light while the menu is dark,
|
|
25
|
+
* matching Figma (FEP-898).
|
|
26
|
+
*/
|
|
27
|
+
triggerThemeMode?: ThemeMode;
|
|
20
28
|
/** Menu placement relative to the trigger. Defaults to `"bottom-start"`. */
|
|
21
29
|
placement?: ContextMenuPlacement;
|
|
22
30
|
/** Whether the dropdown is open (controlled) */
|
package/native/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import { ThemeOverrideProps } from '@xsolla/xui-core';
|
|
2
|
+
import { ThemeOverrideProps, ThemeMode } from '@xsolla/xui-core';
|
|
3
3
|
import { ContextMenuPlacement } from '@xsolla/xui-context-menu';
|
|
4
4
|
|
|
5
5
|
type StatusDropdownPalette = "Neutral" | "Success" | "Warning" | "Alert" | "Brand";
|
|
@@ -17,6 +17,14 @@ interface StatusDropdownProps extends ThemeOverrideProps {
|
|
|
17
17
|
dot?: boolean;
|
|
18
18
|
/** Dropdown menu content (usually ContextMenuItem components) */
|
|
19
19
|
children: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Theme mode for the trigger only, overriding the context menu's `themeMode`
|
|
22
|
+
* for the trigger. When omitted, the trigger falls back to `themeMode` (which
|
|
23
|
+
* inherits from XUIProvider), so trigger and menu match by default. Set
|
|
24
|
+
* `triggerThemeMode="light"` to keep the trigger light while the menu is dark,
|
|
25
|
+
* matching Figma (FEP-898).
|
|
26
|
+
*/
|
|
27
|
+
triggerThemeMode?: ThemeMode;
|
|
20
28
|
/** Menu placement relative to the trigger. Defaults to `"bottom-start"`. */
|
|
21
29
|
placement?: ContextMenuPlacement;
|
|
22
30
|
/** Whether the dropdown is open (controlled) */
|
package/native/index.js
CHANGED
|
@@ -1213,6 +1213,7 @@ var StatusDropdown = (0, import_react2.forwardRef)(
|
|
|
1213
1213
|
maxWidth,
|
|
1214
1214
|
dot = false,
|
|
1215
1215
|
children,
|
|
1216
|
+
triggerThemeMode,
|
|
1216
1217
|
placement = "bottom-start",
|
|
1217
1218
|
isOpen: propIsOpen,
|
|
1218
1219
|
onOpenChange,
|
|
@@ -1223,7 +1224,7 @@ var StatusDropdown = (0, import_react2.forwardRef)(
|
|
|
1223
1224
|
themeProductContext
|
|
1224
1225
|
}, ref) => {
|
|
1225
1226
|
const { theme: rawTheme } = (0, import_xui_core.useResolvedTheme)({
|
|
1226
|
-
themeMode,
|
|
1227
|
+
themeMode: triggerThemeMode ?? themeMode,
|
|
1227
1228
|
themeProductContext
|
|
1228
1229
|
});
|
|
1229
1230
|
const theme = rawTheme;
|