@xsolla/xui-button 0.206.2 → 0.208.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 +46 -0
- package/native/index.d.mts +17 -0
- package/native/index.d.ts +17 -0
- package/native/index.js +3 -2
- package/native/index.js.map +1 -1
- package/native/index.mjs +3 -2
- package/native/index.mjs.map +1 -1
- package/package.json +4 -4
- package/web/index.d.mts +17 -0
- package/web/index.d.ts +17 -0
- package/web/index.js +3 -2
- package/web/index.js.map +1 -1
- package/web/index.mjs +3 -2
- package/web/index.mjs.map +1 -1
package/web/index.mjs
CHANGED
|
@@ -1485,6 +1485,7 @@ import { useResolvedTheme as useResolvedTheme5 } from "@xsolla/xui-core";
|
|
|
1485
1485
|
import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1486
1486
|
var ButtonGroup = ({
|
|
1487
1487
|
orientation = "horizontal",
|
|
1488
|
+
split,
|
|
1488
1489
|
size = "md",
|
|
1489
1490
|
children,
|
|
1490
1491
|
description,
|
|
@@ -1512,7 +1513,7 @@ var ButtonGroup = ({
|
|
|
1512
1513
|
};
|
|
1513
1514
|
const flatChildren = flattenChildren(children);
|
|
1514
1515
|
const childCount = flatChildren.length;
|
|
1515
|
-
const useSpaceBetween = orientation === "horizontal" && childCount > 2;
|
|
1516
|
+
const useSpaceBetween = orientation === "horizontal" && childCount > 1 && (split ?? childCount > 2);
|
|
1516
1517
|
const verticalGapMap = {
|
|
1517
1518
|
xl: 16,
|
|
1518
1519
|
lg: 16,
|
|
@@ -1535,7 +1536,7 @@ var ButtonGroup = ({
|
|
|
1535
1536
|
error && errorId ? errorId : void 0,
|
|
1536
1537
|
description && descriptionId ? descriptionId : void 0
|
|
1537
1538
|
].filter(Boolean).join(" ") || void 0;
|
|
1538
|
-
const stretchChildren = orientation === "vertical" || orientation === "horizontal" && childCount <= 2;
|
|
1539
|
+
const stretchChildren = orientation === "vertical" || orientation === "horizontal" && childCount <= 2 && !useSpaceBetween;
|
|
1539
1540
|
const processChildren = (childrenToProcess) => {
|
|
1540
1541
|
if (stretchChildren) {
|
|
1541
1542
|
return childrenToProcess.map((child, index2) => {
|