@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/web/index.mjs
CHANGED
|
@@ -46,6 +46,8 @@ var StyledBox = styled.div`
|
|
|
46
46
|
width: ${(props) => typeof props.width === "number" ? `${props.width}px` : props.width || "auto"};
|
|
47
47
|
min-width: ${(props) => typeof props.minWidth === "number" ? `${props.minWidth}px` : props.minWidth || "auto"};
|
|
48
48
|
min-height: ${(props) => typeof props.minHeight === "number" ? `${props.minHeight}px` : props.minHeight || "auto"};
|
|
49
|
+
max-width: ${(props) => typeof props.maxWidth === "number" ? `${props.maxWidth}px` : props.maxWidth || "none"};
|
|
50
|
+
max-height: ${(props) => typeof props.maxHeight === "number" ? `${props.maxHeight}px` : props.maxHeight || "none"};
|
|
49
51
|
|
|
50
52
|
padding: ${(props) => typeof props.padding === "number" ? `${props.padding}px` : props.padding || 0};
|
|
51
53
|
${(props) => props.paddingHorizontal && `
|
|
@@ -340,7 +342,7 @@ var InputPrimitive = forwardRef(
|
|
|
340
342
|
InputPrimitive.displayName = "InputPrimitive";
|
|
341
343
|
|
|
342
344
|
// src/ContextMenu.tsx
|
|
343
|
-
import {
|
|
345
|
+
import { useResolvedTheme as useResolvedTheme7 } from "@xsolla/xui-core";
|
|
344
346
|
import { Spinner } from "@xsolla/xui-spinner";
|
|
345
347
|
|
|
346
348
|
// src/ContextMenuContext.tsx
|
|
@@ -362,7 +364,7 @@ var useContextMenuRequired = () => {
|
|
|
362
364
|
|
|
363
365
|
// src/ContextMenuItem.tsx
|
|
364
366
|
import { forwardRef as forwardRef2, useEffect, useRef } from "react";
|
|
365
|
-
import {
|
|
367
|
+
import { useResolvedTheme } from "@xsolla/xui-core";
|
|
366
368
|
import { ArrowRight } from "@xsolla/xui-icons";
|
|
367
369
|
import { jsx as jsx5, jsxs } from "react/jsx-runtime";
|
|
368
370
|
var ContextMenuItem = forwardRef2(
|
|
@@ -378,9 +380,11 @@ var ContextMenuItem = forwardRef2(
|
|
|
378
380
|
size: propSize,
|
|
379
381
|
hasSubmenu,
|
|
380
382
|
onPress,
|
|
381
|
-
"data-testid": testId = "context-menu-item"
|
|
383
|
+
"data-testid": testId = "context-menu-item",
|
|
384
|
+
themeMode,
|
|
385
|
+
themeProductContext
|
|
382
386
|
}, ref) => {
|
|
383
|
-
const { theme } =
|
|
387
|
+
const { theme } = useResolvedTheme({ themeMode, themeProductContext });
|
|
384
388
|
const context = useContextMenu();
|
|
385
389
|
const size = propSize || context?.size || "md";
|
|
386
390
|
const sizeStyles = theme.sizing.contextMenu(size);
|
|
@@ -526,7 +530,7 @@ ContextMenuItem.displayName = "ContextMenuItem";
|
|
|
526
530
|
|
|
527
531
|
// src/ContextMenuCheckboxItem.tsx
|
|
528
532
|
import { forwardRef as forwardRef3, useEffect as useEffect2, useRef as useRef2 } from "react";
|
|
529
|
-
import {
|
|
533
|
+
import { useResolvedTheme as useResolvedTheme2 } from "@xsolla/xui-core";
|
|
530
534
|
import { Check, Minus } from "@xsolla/xui-icons";
|
|
531
535
|
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
532
536
|
var checkboxSizeMap = {
|
|
@@ -545,9 +549,11 @@ var CheckboxIndicator = ({
|
|
|
545
549
|
checked,
|
|
546
550
|
indeterminate,
|
|
547
551
|
size,
|
|
548
|
-
disabled
|
|
552
|
+
disabled,
|
|
553
|
+
themeMode,
|
|
554
|
+
themeProductContext
|
|
549
555
|
}) => {
|
|
550
|
-
const { theme } =
|
|
556
|
+
const { theme } = useResolvedTheme2({ themeMode, themeProductContext });
|
|
551
557
|
const brandColors = theme.colors.control.brand.primary;
|
|
552
558
|
const faintColors = theme.colors.control.faint;
|
|
553
559
|
const contentColors = theme.colors.content;
|
|
@@ -610,9 +616,11 @@ var ContextMenuCheckboxItem = forwardRef3(
|
|
|
610
616
|
size: propSize,
|
|
611
617
|
onCheckedChange,
|
|
612
618
|
onPress,
|
|
613
|
-
"data-testid": testId = "context-menu-checkbox-item"
|
|
619
|
+
"data-testid": testId = "context-menu-checkbox-item",
|
|
620
|
+
themeMode,
|
|
621
|
+
themeProductContext
|
|
614
622
|
}, ref) => {
|
|
615
|
-
const { theme } =
|
|
623
|
+
const { theme } = useResolvedTheme2({ themeMode, themeProductContext });
|
|
616
624
|
const context = useContextMenu();
|
|
617
625
|
const size = propSize || context?.size || "md";
|
|
618
626
|
const sizeStyles = theme.sizing.contextMenu(size);
|
|
@@ -692,7 +700,9 @@ var ContextMenuCheckboxItem = forwardRef3(
|
|
|
692
700
|
checked,
|
|
693
701
|
indeterminate,
|
|
694
702
|
size,
|
|
695
|
-
disabled
|
|
703
|
+
disabled,
|
|
704
|
+
themeMode,
|
|
705
|
+
themeProductContext
|
|
696
706
|
}
|
|
697
707
|
)
|
|
698
708
|
}
|
|
@@ -746,7 +756,7 @@ ContextMenuRadioGroup.displayName = "ContextMenuRadioGroup";
|
|
|
746
756
|
|
|
747
757
|
// src/ContextMenuRadioItem.tsx
|
|
748
758
|
import { forwardRef as forwardRef5, useEffect as useEffect3, useRef as useRef3 } from "react";
|
|
749
|
-
import {
|
|
759
|
+
import { useResolvedTheme as useResolvedTheme3 } from "@xsolla/xui-core";
|
|
750
760
|
import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
751
761
|
var radioSizeMap = {
|
|
752
762
|
sm: 14,
|
|
@@ -763,9 +773,11 @@ var radioDotSizeMap = {
|
|
|
763
773
|
var RadioIndicator = ({
|
|
764
774
|
checked,
|
|
765
775
|
size,
|
|
766
|
-
disabled
|
|
776
|
+
disabled,
|
|
777
|
+
themeMode,
|
|
778
|
+
themeProductContext
|
|
767
779
|
}) => {
|
|
768
|
-
const { theme } =
|
|
780
|
+
const { theme } = useResolvedTheme3({ themeMode, themeProductContext });
|
|
769
781
|
const brandColors = theme.colors.control.brand.primary;
|
|
770
782
|
const faintColors = theme.colors.control.faint;
|
|
771
783
|
const contentColors = theme.colors.content;
|
|
@@ -817,9 +829,11 @@ var ContextMenuRadioItem = forwardRef5(
|
|
|
817
829
|
disabled,
|
|
818
830
|
size: propSize,
|
|
819
831
|
onPress,
|
|
820
|
-
"data-testid": testId = "context-menu-radio-item"
|
|
832
|
+
"data-testid": testId = "context-menu-radio-item",
|
|
833
|
+
themeMode,
|
|
834
|
+
themeProductContext
|
|
821
835
|
}, ref) => {
|
|
822
|
-
const { theme } =
|
|
836
|
+
const { theme } = useResolvedTheme3({ themeMode, themeProductContext });
|
|
823
837
|
const context = useContextMenu();
|
|
824
838
|
const radioGroup = useRadioGroup();
|
|
825
839
|
const size = propSize || context?.size || "md";
|
|
@@ -894,7 +908,16 @@ var ContextMenuRadioItem = forwardRef5(
|
|
|
894
908
|
marginTop: description ? 2 : 0,
|
|
895
909
|
alignItems: "center",
|
|
896
910
|
justifyContent: "center",
|
|
897
|
-
children: /* @__PURE__ */ jsx8(
|
|
911
|
+
children: /* @__PURE__ */ jsx8(
|
|
912
|
+
RadioIndicator,
|
|
913
|
+
{
|
|
914
|
+
checked,
|
|
915
|
+
size,
|
|
916
|
+
disabled,
|
|
917
|
+
themeMode,
|
|
918
|
+
themeProductContext
|
|
919
|
+
}
|
|
920
|
+
)
|
|
898
921
|
}
|
|
899
922
|
),
|
|
900
923
|
/* @__PURE__ */ jsxs3(Box, { flex: 1, flexDirection: "column", gap: 2, children: [
|
|
@@ -927,7 +950,7 @@ ContextMenuRadioItem.displayName = "ContextMenuRadioItem";
|
|
|
927
950
|
|
|
928
951
|
// src/ContextMenuGroup.tsx
|
|
929
952
|
import { forwardRef as forwardRef6 } from "react";
|
|
930
|
-
import {
|
|
953
|
+
import { useResolvedTheme as useResolvedTheme4 } from "@xsolla/xui-core";
|
|
931
954
|
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
932
955
|
var ContextMenuGroup = forwardRef6(
|
|
933
956
|
({
|
|
@@ -935,9 +958,11 @@ var ContextMenuGroup = forwardRef6(
|
|
|
935
958
|
description,
|
|
936
959
|
children,
|
|
937
960
|
size: propSize,
|
|
938
|
-
"data-testid": testId = "context-menu-group"
|
|
961
|
+
"data-testid": testId = "context-menu-group",
|
|
962
|
+
themeMode,
|
|
963
|
+
themeProductContext
|
|
939
964
|
}, ref) => {
|
|
940
|
-
const { theme } =
|
|
965
|
+
const { theme } = useResolvedTheme4({ themeMode, themeProductContext });
|
|
941
966
|
const context = useContextMenu();
|
|
942
967
|
const size = propSize || context?.size || "md";
|
|
943
968
|
const sizeStyles = theme.sizing.contextMenu(size);
|
|
@@ -977,13 +1002,15 @@ var ContextMenuGroup = forwardRef6(
|
|
|
977
1002
|
ContextMenuGroup.displayName = "ContextMenuGroup";
|
|
978
1003
|
|
|
979
1004
|
// src/ContextMenuSeparator.tsx
|
|
980
|
-
import {
|
|
1005
|
+
import { useResolvedTheme as useResolvedTheme5 } from "@xsolla/xui-core";
|
|
981
1006
|
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
982
1007
|
var ContextMenuSeparator = ({
|
|
983
1008
|
size: propSize,
|
|
984
|
-
"data-testid": testId = "context-menu-separator"
|
|
1009
|
+
"data-testid": testId = "context-menu-separator",
|
|
1010
|
+
themeMode,
|
|
1011
|
+
themeProductContext
|
|
985
1012
|
}) => {
|
|
986
|
-
const { theme } =
|
|
1013
|
+
const { theme } = useResolvedTheme5({ themeMode, themeProductContext });
|
|
987
1014
|
const context = useContextMenu();
|
|
988
1015
|
const size = propSize || context?.size || "md";
|
|
989
1016
|
const sizeStyles = theme.sizing.contextMenu(size);
|
|
@@ -1003,7 +1030,7 @@ ContextMenuSeparator.displayName = "ContextMenuSeparator";
|
|
|
1003
1030
|
|
|
1004
1031
|
// src/ContextMenuSearch.tsx
|
|
1005
1032
|
import React6, { forwardRef as forwardRef7, useRef as useRef4, useEffect as useEffect4 } from "react";
|
|
1006
|
-
import {
|
|
1033
|
+
import { useResolvedTheme as useResolvedTheme6 } from "@xsolla/xui-core";
|
|
1007
1034
|
|
|
1008
1035
|
// ../icons-base/dist/web/index.mjs
|
|
1009
1036
|
import styled5 from "styled-components";
|
|
@@ -1451,9 +1478,11 @@ var ContextMenuSearch = forwardRef7(
|
|
|
1451
1478
|
placeholder = "Search",
|
|
1452
1479
|
autoFocus = true,
|
|
1453
1480
|
size: propSize,
|
|
1454
|
-
"data-testid": testId = "context-menu-search"
|
|
1481
|
+
"data-testid": testId = "context-menu-search",
|
|
1482
|
+
themeMode,
|
|
1483
|
+
themeProductContext
|
|
1455
1484
|
}, ref) => {
|
|
1456
|
-
const { theme } =
|
|
1485
|
+
const { theme } = useResolvedTheme6({ themeMode, themeProductContext });
|
|
1457
1486
|
const context = useContextMenu();
|
|
1458
1487
|
const size = propSize || context?.size || "md";
|
|
1459
1488
|
const sizeStyles = theme.sizing.contextMenu(size);
|
|
@@ -1545,9 +1574,11 @@ var ContextMenuRoot = forwardRef8(
|
|
|
1545
1574
|
closeOnSelect = true,
|
|
1546
1575
|
isLoading,
|
|
1547
1576
|
"aria-label": ariaLabel,
|
|
1548
|
-
"data-testid": testId = "context-menu"
|
|
1577
|
+
"data-testid": testId = "context-menu",
|
|
1578
|
+
themeMode,
|
|
1579
|
+
themeProductContext
|
|
1549
1580
|
}, ref) => {
|
|
1550
|
-
const { theme } =
|
|
1581
|
+
const { theme } = useResolvedTheme7({ themeMode, themeProductContext });
|
|
1551
1582
|
const [internalIsOpen, setInternalIsOpen] = useState(false);
|
|
1552
1583
|
const [activeIndex, setActiveIndex] = useState(-1);
|
|
1553
1584
|
const containerRef = useRef5(null);
|