@xsolla/xui-context-menu 0.209.1 → 0.210.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 +16 -1
- package/native/index.d.mts +4 -0
- package/native/index.d.ts +4 -0
- package/native/index.js +7 -3
- package/native/index.js.map +1 -1
- package/native/index.mjs +7 -3
- package/native/index.mjs.map +1 -1
- package/package.json +10 -10
- package/web/index.d.mts +4 -0
- package/web/index.d.ts +4 -0
- package/web/index.js +13 -3
- package/web/index.js.map +1 -1
- package/web/index.mjs +13 -3
- package/web/index.mjs.map +1 -1
package/web/index.mjs
CHANGED
|
@@ -174,12 +174,18 @@ var StyledBox = styled(FilteredDiv)`
|
|
|
174
174
|
opacity: ${(props) => props.opacity != null ? props.opacity : props.disabled ? 0.5 : 1};
|
|
175
175
|
pointer-events: ${(props) => props.disabled ? "none" : "auto"};
|
|
176
176
|
|
|
177
|
+
/* \`background\` is emitted before \`background-color\` so a caller passing
|
|
178
|
+
both still gets backgroundColor as the winner. Use the shorthand for a
|
|
179
|
+
layered fill (e.g. an overlay tint over a resting surface colour), which
|
|
180
|
+
a single background-color cannot express. */
|
|
177
181
|
&:hover {
|
|
182
|
+
${(props) => props.hoverStyle?.background && `background: ${props.hoverStyle.background};`}
|
|
178
183
|
${(props) => props.hoverStyle?.backgroundColor && `background-color: ${props.hoverStyle.backgroundColor};`}
|
|
179
184
|
${(props) => props.hoverStyle?.borderColor && `border-color: ${props.hoverStyle.borderColor};`}
|
|
180
185
|
}
|
|
181
186
|
|
|
182
187
|
&:active {
|
|
188
|
+
${(props) => props.pressStyle?.background && `background: ${props.pressStyle.background};`}
|
|
183
189
|
${(props) => props.pressStyle?.backgroundColor && `background-color: ${props.pressStyle.backgroundColor};`}
|
|
184
190
|
}
|
|
185
191
|
`;
|
|
@@ -847,6 +853,7 @@ var HeadingCell = ({
|
|
|
847
853
|
size: propSize,
|
|
848
854
|
label,
|
|
849
855
|
description,
|
|
856
|
+
isUppercase = true,
|
|
850
857
|
testID,
|
|
851
858
|
themeMode,
|
|
852
859
|
themeProductContext,
|
|
@@ -889,7 +896,7 @@ var HeadingCell = ({
|
|
|
889
896
|
{
|
|
890
897
|
variant: variants.headingAccent,
|
|
891
898
|
color: theme.colors.content.secondary,
|
|
892
|
-
style: { textTransform: "uppercase", letterSpacing: 0.5 },
|
|
899
|
+
style: isUppercase ? { textTransform: "uppercase", letterSpacing: 0.5 } : { textTransform: "none" },
|
|
893
900
|
children: label
|
|
894
901
|
}
|
|
895
902
|
),
|
|
@@ -1536,6 +1543,7 @@ var ContextMenuRoot = forwardRef(
|
|
|
1536
1543
|
width,
|
|
1537
1544
|
maxHeight = 300,
|
|
1538
1545
|
withArrow = false,
|
|
1546
|
+
noPadding = false,
|
|
1539
1547
|
onSelect,
|
|
1540
1548
|
closeOnSelect,
|
|
1541
1549
|
"aria-label": ariaLabel,
|
|
@@ -1567,6 +1575,8 @@ var ContextMenuRoot = forwardRef(
|
|
|
1567
1575
|
const isOpen = propIsOpen !== void 0 ? propIsOpen : internalIsOpen;
|
|
1568
1576
|
const sizeStyles = xuiTheme.sizing.contextMenu(size);
|
|
1569
1577
|
const borderRadius = xuiTheme.shape?.contextMenu?.[size]?.borderRadius ?? 8;
|
|
1578
|
+
const panelPaddingVertical = noPadding ? 0 : sizeStyles.paddingVertical;
|
|
1579
|
+
const panelPaddingHorizontal = noPadding ? 0 : sizeStyles.paddingHorizontal;
|
|
1570
1580
|
const shouldCloseOnSelect = closeOnSelect ?? (type === "checkbox" ? false : true);
|
|
1571
1581
|
const positionOffset = withArrow ? offset + ARROW_TIP_PROTRUSION : offset;
|
|
1572
1582
|
const positioned = useContextMenuPosition({
|
|
@@ -1940,8 +1950,8 @@ var ContextMenuRoot = forwardRef(
|
|
|
1940
1950
|
borderColor: xuiTheme.colors.border.secondary,
|
|
1941
1951
|
borderWidth: 1,
|
|
1942
1952
|
borderRadius,
|
|
1943
|
-
paddingVertical:
|
|
1944
|
-
paddingHorizontal:
|
|
1953
|
+
paddingVertical: panelPaddingVertical,
|
|
1954
|
+
paddingHorizontal: panelPaddingHorizontal,
|
|
1945
1955
|
width,
|
|
1946
1956
|
minWidth: sizeStyles.minWidth,
|
|
1947
1957
|
tabIndex: -1,
|