@xsolla/xui-context-menu 0.128.0 → 0.130.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/native/index.d.mts +14 -13
- package/native/index.d.ts +14 -13
- package/native/index.js +58 -21
- package/native/index.js.map +1 -1
- package/native/index.mjs +65 -28
- package/native/index.mjs.map +1 -1
- package/package.json +8 -8
- package/web/index.d.mts +14 -13
- package/web/index.d.ts +14 -13
- package/web/index.js +51 -20
- package/web/index.js.map +1 -1
- package/web/index.mjs +58 -27
- package/web/index.mjs.map +1 -1
package/native/index.mjs
CHANGED
|
@@ -55,6 +55,10 @@ var Box = ({
|
|
|
55
55
|
left,
|
|
56
56
|
right,
|
|
57
57
|
width,
|
|
58
|
+
minWidth,
|
|
59
|
+
minHeight,
|
|
60
|
+
maxWidth,
|
|
61
|
+
maxHeight,
|
|
58
62
|
flex,
|
|
59
63
|
overflow,
|
|
60
64
|
zIndex,
|
|
@@ -86,6 +90,10 @@ var Box = ({
|
|
|
86
90
|
zIndex,
|
|
87
91
|
height,
|
|
88
92
|
width,
|
|
93
|
+
minWidth,
|
|
94
|
+
minHeight,
|
|
95
|
+
maxWidth,
|
|
96
|
+
maxHeight,
|
|
89
97
|
padding,
|
|
90
98
|
paddingHorizontal,
|
|
91
99
|
paddingVertical,
|
|
@@ -217,7 +225,7 @@ var Text = ({
|
|
|
217
225
|
}
|
|
218
226
|
const incomingStyle = StyleSheet.flatten(styleProp);
|
|
219
227
|
const baseStyle = {
|
|
220
|
-
color,
|
|
228
|
+
color: color ?? incomingStyle?.color,
|
|
221
229
|
fontSize: typeof fontSize === "number" ? fontSize : void 0,
|
|
222
230
|
fontWeight,
|
|
223
231
|
fontFamily: resolvedFontFamily,
|
|
@@ -392,7 +400,7 @@ var InputPrimitive = forwardRef(
|
|
|
392
400
|
InputPrimitive.displayName = "InputPrimitive";
|
|
393
401
|
|
|
394
402
|
// src/ContextMenu.tsx
|
|
395
|
-
import {
|
|
403
|
+
import { useResolvedTheme as useResolvedTheme7 } from "@xsolla/xui-core";
|
|
396
404
|
import { Spinner } from "@xsolla/xui-spinner";
|
|
397
405
|
|
|
398
406
|
// src/ContextMenuContext.tsx
|
|
@@ -414,7 +422,7 @@ var useContextMenuRequired = () => {
|
|
|
414
422
|
|
|
415
423
|
// src/ContextMenuItem.tsx
|
|
416
424
|
import { forwardRef as forwardRef2, useEffect, useRef } from "react";
|
|
417
|
-
import {
|
|
425
|
+
import { useResolvedTheme } from "@xsolla/xui-core";
|
|
418
426
|
import { ArrowRight } from "@xsolla/xui-icons";
|
|
419
427
|
import { jsx as jsx5, jsxs } from "react/jsx-runtime";
|
|
420
428
|
var ContextMenuItem = forwardRef2(
|
|
@@ -430,9 +438,11 @@ var ContextMenuItem = forwardRef2(
|
|
|
430
438
|
size: propSize,
|
|
431
439
|
hasSubmenu,
|
|
432
440
|
onPress,
|
|
433
|
-
"data-testid": testId = "context-menu-item"
|
|
441
|
+
"data-testid": testId = "context-menu-item",
|
|
442
|
+
themeMode,
|
|
443
|
+
themeProductContext
|
|
434
444
|
}, ref) => {
|
|
435
|
-
const { theme } =
|
|
445
|
+
const { theme } = useResolvedTheme({ themeMode, themeProductContext });
|
|
436
446
|
const context = useContextMenu();
|
|
437
447
|
const size = propSize || context?.size || "md";
|
|
438
448
|
const sizeStyles = theme.sizing.contextMenu(size);
|
|
@@ -578,7 +588,7 @@ ContextMenuItem.displayName = "ContextMenuItem";
|
|
|
578
588
|
|
|
579
589
|
// src/ContextMenuCheckboxItem.tsx
|
|
580
590
|
import { forwardRef as forwardRef3, useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
581
|
-
import {
|
|
591
|
+
import { useResolvedTheme as useResolvedTheme2 } from "@xsolla/xui-core";
|
|
582
592
|
import { Check, Minus } from "@xsolla/xui-icons";
|
|
583
593
|
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
584
594
|
var checkboxSizeMap = {
|
|
@@ -597,9 +607,11 @@ var CheckboxIndicator = ({
|
|
|
597
607
|
checked,
|
|
598
608
|
indeterminate,
|
|
599
609
|
size,
|
|
600
|
-
disabled
|
|
610
|
+
disabled,
|
|
611
|
+
themeMode,
|
|
612
|
+
themeProductContext
|
|
601
613
|
}) => {
|
|
602
|
-
const { theme } =
|
|
614
|
+
const { theme } = useResolvedTheme2({ themeMode, themeProductContext });
|
|
603
615
|
const brandColors = theme.colors.control.brand.primary;
|
|
604
616
|
const faintColors = theme.colors.control.faint;
|
|
605
617
|
const contentColors = theme.colors.content;
|
|
@@ -662,9 +674,11 @@ var ContextMenuCheckboxItem = forwardRef3(
|
|
|
662
674
|
size: propSize,
|
|
663
675
|
onCheckedChange,
|
|
664
676
|
onPress,
|
|
665
|
-
"data-testid": testId = "context-menu-checkbox-item"
|
|
677
|
+
"data-testid": testId = "context-menu-checkbox-item",
|
|
678
|
+
themeMode,
|
|
679
|
+
themeProductContext
|
|
666
680
|
}, ref) => {
|
|
667
|
-
const { theme } =
|
|
681
|
+
const { theme } = useResolvedTheme2({ themeMode, themeProductContext });
|
|
668
682
|
const context = useContextMenu();
|
|
669
683
|
const size = propSize || context?.size || "md";
|
|
670
684
|
const sizeStyles = theme.sizing.contextMenu(size);
|
|
@@ -744,7 +758,9 @@ var ContextMenuCheckboxItem = forwardRef3(
|
|
|
744
758
|
checked,
|
|
745
759
|
indeterminate,
|
|
746
760
|
size,
|
|
747
|
-
disabled
|
|
761
|
+
disabled,
|
|
762
|
+
themeMode,
|
|
763
|
+
themeProductContext
|
|
748
764
|
}
|
|
749
765
|
)
|
|
750
766
|
}
|
|
@@ -798,7 +814,7 @@ ContextMenuRadioGroup.displayName = "ContextMenuRadioGroup";
|
|
|
798
814
|
|
|
799
815
|
// src/ContextMenuRadioItem.tsx
|
|
800
816
|
import { forwardRef as forwardRef5, useEffect as useEffect3, useRef as useRef3 } from "react";
|
|
801
|
-
import {
|
|
817
|
+
import { useResolvedTheme as useResolvedTheme3 } from "@xsolla/xui-core";
|
|
802
818
|
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
803
819
|
var radioSizeMap = {
|
|
804
820
|
sm: 14,
|
|
@@ -815,9 +831,11 @@ var radioDotSizeMap = {
|
|
|
815
831
|
var RadioIndicator = ({
|
|
816
832
|
checked,
|
|
817
833
|
size,
|
|
818
|
-
disabled
|
|
834
|
+
disabled,
|
|
835
|
+
themeMode,
|
|
836
|
+
themeProductContext
|
|
819
837
|
}) => {
|
|
820
|
-
const { theme } =
|
|
838
|
+
const { theme } = useResolvedTheme3({ themeMode, themeProductContext });
|
|
821
839
|
const brandColors = theme.colors.control.brand.primary;
|
|
822
840
|
const faintColors = theme.colors.control.faint;
|
|
823
841
|
const contentColors = theme.colors.content;
|
|
@@ -869,9 +887,11 @@ var ContextMenuRadioItem = forwardRef5(
|
|
|
869
887
|
disabled,
|
|
870
888
|
size: propSize,
|
|
871
889
|
onPress,
|
|
872
|
-
"data-testid": testId = "context-menu-radio-item"
|
|
890
|
+
"data-testid": testId = "context-menu-radio-item",
|
|
891
|
+
themeMode,
|
|
892
|
+
themeProductContext
|
|
873
893
|
}, ref) => {
|
|
874
|
-
const { theme } =
|
|
894
|
+
const { theme } = useResolvedTheme3({ themeMode, themeProductContext });
|
|
875
895
|
const context = useContextMenu();
|
|
876
896
|
const radioGroup = useRadioGroup();
|
|
877
897
|
const size = propSize || context?.size || "md";
|
|
@@ -946,7 +966,16 @@ var ContextMenuRadioItem = forwardRef5(
|
|
|
946
966
|
marginTop: description ? 2 : 0,
|
|
947
967
|
alignItems: "center",
|
|
948
968
|
justifyContent: "center",
|
|
949
|
-
children: /* @__PURE__ */ jsx8(
|
|
969
|
+
children: /* @__PURE__ */ jsx8(
|
|
970
|
+
RadioIndicator,
|
|
971
|
+
{
|
|
972
|
+
checked,
|
|
973
|
+
size,
|
|
974
|
+
disabled,
|
|
975
|
+
themeMode,
|
|
976
|
+
themeProductContext
|
|
977
|
+
}
|
|
978
|
+
)
|
|
950
979
|
}
|
|
951
980
|
),
|
|
952
981
|
/* @__PURE__ */ jsxs3(Box, { flex: 1, flexDirection: "column", gap: 2, children: [
|
|
@@ -979,7 +1008,7 @@ ContextMenuRadioItem.displayName = "ContextMenuRadioItem";
|
|
|
979
1008
|
|
|
980
1009
|
// src/ContextMenuGroup.tsx
|
|
981
1010
|
import { forwardRef as forwardRef6 } from "react";
|
|
982
|
-
import {
|
|
1011
|
+
import { useResolvedTheme as useResolvedTheme4 } from "@xsolla/xui-core";
|
|
983
1012
|
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
984
1013
|
var ContextMenuGroup = forwardRef6(
|
|
985
1014
|
({
|
|
@@ -987,9 +1016,11 @@ var ContextMenuGroup = forwardRef6(
|
|
|
987
1016
|
description,
|
|
988
1017
|
children,
|
|
989
1018
|
size: propSize,
|
|
990
|
-
"data-testid": testId = "context-menu-group"
|
|
1019
|
+
"data-testid": testId = "context-menu-group",
|
|
1020
|
+
themeMode,
|
|
1021
|
+
themeProductContext
|
|
991
1022
|
}, ref) => {
|
|
992
|
-
const { theme } =
|
|
1023
|
+
const { theme } = useResolvedTheme4({ themeMode, themeProductContext });
|
|
993
1024
|
const context = useContextMenu();
|
|
994
1025
|
const size = propSize || context?.size || "md";
|
|
995
1026
|
const sizeStyles = theme.sizing.contextMenu(size);
|
|
@@ -1029,13 +1060,15 @@ var ContextMenuGroup = forwardRef6(
|
|
|
1029
1060
|
ContextMenuGroup.displayName = "ContextMenuGroup";
|
|
1030
1061
|
|
|
1031
1062
|
// src/ContextMenuSeparator.tsx
|
|
1032
|
-
import {
|
|
1063
|
+
import { useResolvedTheme as useResolvedTheme5 } from "@xsolla/xui-core";
|
|
1033
1064
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1034
1065
|
var ContextMenuSeparator = ({
|
|
1035
1066
|
size: propSize,
|
|
1036
|
-
"data-testid": testId = "context-menu-separator"
|
|
1067
|
+
"data-testid": testId = "context-menu-separator",
|
|
1068
|
+
themeMode,
|
|
1069
|
+
themeProductContext
|
|
1037
1070
|
}) => {
|
|
1038
|
-
const { theme } =
|
|
1071
|
+
const { theme } = useResolvedTheme5({ themeMode, themeProductContext });
|
|
1039
1072
|
const context = useContextMenu();
|
|
1040
1073
|
const size = propSize || context?.size || "md";
|
|
1041
1074
|
const sizeStyles = theme.sizing.contextMenu(size);
|
|
@@ -1055,7 +1088,7 @@ ContextMenuSeparator.displayName = "ContextMenuSeparator";
|
|
|
1055
1088
|
|
|
1056
1089
|
// src/ContextMenuSearch.tsx
|
|
1057
1090
|
import React6, { forwardRef as forwardRef7, useRef as useRef4, useEffect as useEffect4 } from "react";
|
|
1058
|
-
import {
|
|
1091
|
+
import { useResolvedTheme as useResolvedTheme6 } from "@xsolla/xui-core";
|
|
1059
1092
|
|
|
1060
1093
|
// ../icons-base/dist/web/index.mjs
|
|
1061
1094
|
import styled from "styled-components";
|
|
@@ -1503,9 +1536,11 @@ var ContextMenuSearch = forwardRef7(
|
|
|
1503
1536
|
placeholder = "Search",
|
|
1504
1537
|
autoFocus = true,
|
|
1505
1538
|
size: propSize,
|
|
1506
|
-
"data-testid": testId = "context-menu-search"
|
|
1539
|
+
"data-testid": testId = "context-menu-search",
|
|
1540
|
+
themeMode,
|
|
1541
|
+
themeProductContext
|
|
1507
1542
|
}, ref) => {
|
|
1508
|
-
const { theme } =
|
|
1543
|
+
const { theme } = useResolvedTheme6({ themeMode, themeProductContext });
|
|
1509
1544
|
const context = useContextMenu();
|
|
1510
1545
|
const size = propSize || context?.size || "md";
|
|
1511
1546
|
const sizeStyles = theme.sizing.contextMenu(size);
|
|
@@ -1597,9 +1632,11 @@ var ContextMenuRoot = forwardRef8(
|
|
|
1597
1632
|
closeOnSelect = true,
|
|
1598
1633
|
isLoading,
|
|
1599
1634
|
"aria-label": ariaLabel,
|
|
1600
|
-
"data-testid": testId = "context-menu"
|
|
1635
|
+
"data-testid": testId = "context-menu",
|
|
1636
|
+
themeMode,
|
|
1637
|
+
themeProductContext
|
|
1601
1638
|
}, ref) => {
|
|
1602
|
-
const { theme } =
|
|
1639
|
+
const { theme } = useResolvedTheme7({ themeMode, themeProductContext });
|
|
1603
1640
|
const [internalIsOpen, setInternalIsOpen] = useState(false);
|
|
1604
1641
|
const [activeIndex, setActiveIndex] = useState(-1);
|
|
1605
1642
|
const containerRef = useRef5(null);
|