@xsolla/xui-toggle-button-group 0.170.1 → 0.170.3
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 -0
- package/native/index.d.mts +4 -1
- package/native/index.d.ts +4 -1
- package/native/index.js +51 -21
- package/native/index.js.map +1 -1
- package/native/index.mjs +51 -21
- package/native/index.mjs.map +1 -1
- package/package.json +3 -3
- package/web/index.d.mts +4 -1
- package/web/index.d.ts +4 -1
- package/web/index.js +51 -21
- package/web/index.js.map +1 -1
- package/web/index.mjs +51 -21
- package/web/index.mjs.map +1 -1
package/web/index.d.mts
CHANGED
|
@@ -3,6 +3,7 @@ import { ThemeOverrideProps } from '@xsolla/xui-core';
|
|
|
3
3
|
|
|
4
4
|
type ToggleButtonGroupSize = "xl" | "lg" | "md" | "sm" | "xs";
|
|
5
5
|
type ToggleButtonGroupAppearance = "separated" | "united";
|
|
6
|
+
type ToggleButtonGroupView = "horizontal" | "vertical";
|
|
6
7
|
interface ToggleButtonGroupItem {
|
|
7
8
|
/** Unique identifier for the item */
|
|
8
9
|
id: string;
|
|
@@ -30,6 +31,8 @@ interface ToggleButtonGroupProps extends ThemeOverrideProps {
|
|
|
30
31
|
size?: ToggleButtonGroupSize;
|
|
31
32
|
/** Visual appearance - separated has gaps, united has connected items */
|
|
32
33
|
appearance?: ToggleButtonGroupAppearance;
|
|
34
|
+
/** Layout direction */
|
|
35
|
+
view?: ToggleButtonGroupView;
|
|
33
36
|
/** Whether multiple items can be selected */
|
|
34
37
|
multiple?: boolean;
|
|
35
38
|
/** HTML id attribute */
|
|
@@ -58,4 +61,4 @@ interface ToggleButtonGroupProps extends ThemeOverrideProps {
|
|
|
58
61
|
*/
|
|
59
62
|
declare const ToggleButtonGroup: React.FC<ToggleButtonGroupProps>;
|
|
60
63
|
|
|
61
|
-
export { ToggleButtonGroup, type ToggleButtonGroupAppearance, type ToggleButtonGroupItem, type ToggleButtonGroupProps, type ToggleButtonGroupSize };
|
|
64
|
+
export { ToggleButtonGroup, type ToggleButtonGroupAppearance, type ToggleButtonGroupItem, type ToggleButtonGroupProps, type ToggleButtonGroupSize, type ToggleButtonGroupView };
|
package/web/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { ThemeOverrideProps } from '@xsolla/xui-core';
|
|
|
3
3
|
|
|
4
4
|
type ToggleButtonGroupSize = "xl" | "lg" | "md" | "sm" | "xs";
|
|
5
5
|
type ToggleButtonGroupAppearance = "separated" | "united";
|
|
6
|
+
type ToggleButtonGroupView = "horizontal" | "vertical";
|
|
6
7
|
interface ToggleButtonGroupItem {
|
|
7
8
|
/** Unique identifier for the item */
|
|
8
9
|
id: string;
|
|
@@ -30,6 +31,8 @@ interface ToggleButtonGroupProps extends ThemeOverrideProps {
|
|
|
30
31
|
size?: ToggleButtonGroupSize;
|
|
31
32
|
/** Visual appearance - separated has gaps, united has connected items */
|
|
32
33
|
appearance?: ToggleButtonGroupAppearance;
|
|
34
|
+
/** Layout direction */
|
|
35
|
+
view?: ToggleButtonGroupView;
|
|
33
36
|
/** Whether multiple items can be selected */
|
|
34
37
|
multiple?: boolean;
|
|
35
38
|
/** HTML id attribute */
|
|
@@ -58,4 +61,4 @@ interface ToggleButtonGroupProps extends ThemeOverrideProps {
|
|
|
58
61
|
*/
|
|
59
62
|
declare const ToggleButtonGroup: React.FC<ToggleButtonGroupProps>;
|
|
60
63
|
|
|
61
|
-
export { ToggleButtonGroup, type ToggleButtonGroupAppearance, type ToggleButtonGroupItem, type ToggleButtonGroupProps, type ToggleButtonGroupSize };
|
|
64
|
+
export { ToggleButtonGroup, type ToggleButtonGroupAppearance, type ToggleButtonGroupItem, type ToggleButtonGroupProps, type ToggleButtonGroupSize, type ToggleButtonGroupView };
|
package/web/index.js
CHANGED
|
@@ -356,6 +356,34 @@ var Icon = ({
|
|
|
356
356
|
// src/ToggleButtonGroup.tsx
|
|
357
357
|
var import_xui_core = require("@xsolla/xui-core");
|
|
358
358
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
359
|
+
var getUnitedItemCornerStyle = (index2, total, borderRadius, isVertical) => {
|
|
360
|
+
const isFirst = index2 === 0;
|
|
361
|
+
const isLast = index2 === total - 1;
|
|
362
|
+
if (!isFirst && !isLast) return {};
|
|
363
|
+
const radius = `${borderRadius}px`;
|
|
364
|
+
if (isVertical) {
|
|
365
|
+
return {
|
|
366
|
+
...isFirst && {
|
|
367
|
+
borderTopLeftRadius: radius,
|
|
368
|
+
borderTopRightRadius: radius
|
|
369
|
+
},
|
|
370
|
+
...isLast && {
|
|
371
|
+
borderBottomLeftRadius: radius,
|
|
372
|
+
borderBottomRightRadius: radius
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
return {
|
|
377
|
+
...isFirst && {
|
|
378
|
+
borderTopLeftRadius: radius,
|
|
379
|
+
borderBottomLeftRadius: radius
|
|
380
|
+
},
|
|
381
|
+
...isLast && {
|
|
382
|
+
borderTopRightRadius: radius,
|
|
383
|
+
borderBottomRightRadius: radius
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
};
|
|
359
387
|
var ToggleButtonGroup = ({
|
|
360
388
|
items,
|
|
361
389
|
value,
|
|
@@ -363,6 +391,7 @@ var ToggleButtonGroup = ({
|
|
|
363
391
|
onChange,
|
|
364
392
|
size = "md",
|
|
365
393
|
appearance = "separated",
|
|
394
|
+
view = "horizontal",
|
|
366
395
|
multiple = false,
|
|
367
396
|
id,
|
|
368
397
|
testID,
|
|
@@ -449,6 +478,7 @@ var ToggleButtonGroup = ({
|
|
|
449
478
|
[enabledIndices, focusItem, handleSelect, items]
|
|
450
479
|
);
|
|
451
480
|
const isSeparated = appearance === "separated";
|
|
481
|
+
const isVertical = view === "vertical";
|
|
452
482
|
const containerGap = isSeparated ? sizeStyles.itemGap : 0;
|
|
453
483
|
const firstActiveIndex = items.findIndex(
|
|
454
484
|
(item) => currentValue.includes(item.id)
|
|
@@ -462,16 +492,14 @@ var ToggleButtonGroup = ({
|
|
|
462
492
|
"aria-label": ariaLabel,
|
|
463
493
|
"aria-labelledby": ariaLabelledBy,
|
|
464
494
|
testID,
|
|
465
|
-
flexDirection: "row",
|
|
466
|
-
alignItems: "
|
|
467
|
-
flexWrap: "wrap",
|
|
495
|
+
flexDirection: isVertical ? "column" : "row",
|
|
496
|
+
alignItems: "stretch",
|
|
497
|
+
flexWrap: isSeparated && !isVertical ? "wrap" : "nowrap",
|
|
468
498
|
gap: containerGap,
|
|
469
499
|
width: fullWidth ? "100%" : "fit-content",
|
|
470
500
|
...!isSeparated && {
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
borderStyle: "solid",
|
|
474
|
-
borderRadius: sizeStyles.borderRadius
|
|
501
|
+
borderRadius: sizeStyles.borderRadius,
|
|
502
|
+
overflow: "hidden"
|
|
475
503
|
},
|
|
476
504
|
children: items.map((item, index2) => {
|
|
477
505
|
const isActive = isItemActive(item.id);
|
|
@@ -518,32 +546,31 @@ var ToggleButtonGroup = ({
|
|
|
518
546
|
justifyContent: "center",
|
|
519
547
|
gap: sizeStyles.gap,
|
|
520
548
|
backgroundColor: bgColor,
|
|
521
|
-
...isSeparated
|
|
549
|
+
...isSeparated ? {
|
|
522
550
|
borderWidth: 1,
|
|
523
551
|
borderColor,
|
|
524
552
|
borderStyle: "solid",
|
|
525
553
|
borderRadius: sizeStyles.borderRadius
|
|
554
|
+
} : {
|
|
555
|
+
borderWidth: 1,
|
|
556
|
+
borderColor,
|
|
557
|
+
borderStyle: "solid"
|
|
526
558
|
},
|
|
527
559
|
cursor: isDisabled ? "not-allowed" : "pointer",
|
|
528
560
|
hoverStyle: !isDisabled && !isActive ? {
|
|
529
561
|
backgroundColor: toggleColors.bgHover,
|
|
530
562
|
borderColor: toggleColors.borderHover
|
|
531
563
|
} : void 0,
|
|
532
|
-
...!isSeparated && {
|
|
533
|
-
borderLeftWidth: index2 > 0 ? 1 : 0,
|
|
534
|
-
borderLeftColor: theme.colors.control.toggleButton.border,
|
|
535
|
-
borderLeftStyle: "solid"
|
|
536
|
-
},
|
|
537
564
|
style: {
|
|
538
565
|
flexShrink: 0,
|
|
539
|
-
...!isSeparated &&
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
}
|
|
566
|
+
...!isSeparated && getUnitedItemCornerStyle(
|
|
567
|
+
index2,
|
|
568
|
+
items.length,
|
|
569
|
+
sizeStyles.borderRadius,
|
|
570
|
+
isVertical
|
|
571
|
+
),
|
|
572
|
+
...!isSeparated && !isVertical && index2 < items.length - 1 && { marginRight: -1 },
|
|
573
|
+
...!isSeparated && isVertical && index2 < items.length - 1 && { marginBottom: -1 }
|
|
547
574
|
},
|
|
548
575
|
children: [
|
|
549
576
|
item.iconLeft && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { size: sizeStyles.iconSize, color: textColor, "aria-hidden": true, children: item.iconLeft }),
|
|
@@ -554,6 +581,9 @@ var ToggleButtonGroup = ({
|
|
|
554
581
|
fontSize: sizeStyles.fontSize,
|
|
555
582
|
fontWeight: "400",
|
|
556
583
|
textAlign: "center",
|
|
584
|
+
whiteSpace: "nowrap",
|
|
585
|
+
overflow: "hidden",
|
|
586
|
+
textOverflow: "ellipsis",
|
|
557
587
|
style: {
|
|
558
588
|
lineHeight: `${sizeStyles.lineHeight}px`
|
|
559
589
|
},
|
package/web/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.tsx","../../src/ToggleButtonGroup.tsx","../../../../foundation/primitives-web/src/Box.tsx","../../../../foundation/primitives-web/src/filterDOMProps.ts","../../../../../node_modules/@emotion/memoize/dist/memoize.esm.js","../../../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js","../../../../foundation/primitives-web/src/Text.tsx","../../../../foundation/primitives-web/src/Icon.tsx"],"sourcesContent":["export { ToggleButtonGroup } from \"./ToggleButtonGroup\";\nexport type {\n ToggleButtonGroupProps,\n ToggleButtonGroupItem,\n ToggleButtonGroupSize,\n ToggleButtonGroupAppearance,\n} from \"./types\";\n","import React, { useCallback, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme } from \"@xsolla/xui-core\";\nimport type { ToggleButtonGroupProps } from \"./types\";\n\n/**\n * ToggleButtonGroup - A control for picking one or several options from a set\n *\n * Used to pick one or several options from a linear set of closely related options.\n * Can be used to filter or to sort elements.\n *\n * ## Accessibility Features\n *\n * - **Role**: Uses `role=\"radiogroup\"` for single selection, `role=\"group\"` for multiple\n * - **Keyboard Navigation**: Arrow keys to navigate, Enter/Space to select\n * - **ARIA**: Proper aria-checked and aria-disabled states\n */\nexport const ToggleButtonGroup: React.FC<ToggleButtonGroupProps> = ({\n items,\n value,\n defaultValue,\n onChange,\n size = \"md\",\n appearance = \"separated\",\n multiple = false,\n id,\n testID,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n fullWidth = false,\n themeMode,\n themeProductContext,\n}) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const sizeStyles = theme.sizing.toggleButtonGroup(size);\n const itemRefs = useRef<(HTMLElement | null)[]>([]);\n\n // Internal state for uncontrolled mode\n const [internalValue, setInternalValue] = useState<string[]>(() => {\n if (defaultValue !== undefined) {\n return Array.isArray(defaultValue) ? defaultValue : [defaultValue];\n }\n return [];\n });\n\n // Determine current value (controlled vs uncontrolled)\n const currentValue =\n value !== undefined\n ? Array.isArray(value)\n ? value\n : [value]\n : internalValue;\n\n const isItemActive = (itemId: string) => currentValue.includes(itemId);\n\n const enabledIndices = items\n .map((item, index) => (!item.disabled ? index : -1))\n .filter((i) => i !== -1);\n\n const focusItem = useCallback((index: number) => {\n const element = itemRefs.current[index];\n if (element) {\n element.focus();\n }\n }, []);\n\n const handleSelect = useCallback(\n (itemId: string) => {\n let newValue: string[];\n\n if (multiple) {\n // Multiple selection mode\n if (currentValue.includes(itemId)) {\n newValue = currentValue.filter((v) => v !== itemId);\n } else {\n newValue = [...currentValue, itemId];\n }\n } else {\n // Single selection mode\n newValue = [itemId];\n }\n\n // Update internal state for uncontrolled mode\n if (value === undefined) {\n setInternalValue(newValue);\n }\n\n // Call onChange with appropriate type\n if (onChange) {\n if (multiple) {\n onChange(newValue);\n } else {\n onChange(newValue[0] || \"\");\n }\n }\n },\n [currentValue, multiple, value, onChange]\n );\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent, currentIndex: number) => {\n const currentEnabledIndex = enabledIndices.indexOf(currentIndex);\n\n switch (e.key) {\n case \"ArrowRight\":\n case \"ArrowDown\":\n e.preventDefault();\n {\n const nextEnabledIndex =\n currentEnabledIndex < enabledIndices.length - 1\n ? enabledIndices[currentEnabledIndex + 1]\n : enabledIndices[0];\n focusItem(nextEnabledIndex);\n }\n break;\n\n case \"ArrowLeft\":\n case \"ArrowUp\":\n e.preventDefault();\n {\n const prevEnabledIndex =\n currentEnabledIndex > 0\n ? enabledIndices[currentEnabledIndex - 1]\n : enabledIndices[enabledIndices.length - 1];\n focusItem(prevEnabledIndex);\n }\n break;\n\n case \"Enter\":\n case \" \":\n e.preventDefault();\n if (!items[currentIndex].disabled) {\n handleSelect(items[currentIndex].id);\n }\n break;\n\n default:\n break;\n }\n },\n [enabledIndices, focusItem, handleSelect, items]\n );\n\n const isSeparated = appearance === \"separated\";\n const containerGap = isSeparated ? sizeStyles.itemGap : 0;\n\n // Determine first active item for tabindex in single selection mode\n const firstActiveIndex = items.findIndex((item) =>\n currentValue.includes(item.id)\n );\n const firstEnabledIndex = enabledIndices[0] ?? 0;\n\n return (\n <Box\n id={id}\n role={multiple ? \"group\" : \"radiogroup\"}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n testID={testID}\n flexDirection=\"row\"\n alignItems=\"center\"\n flexWrap=\"wrap\"\n gap={containerGap}\n width={fullWidth ? \"100%\" : \"fit-content\"}\n {...(!isSeparated && {\n borderWidth: 1,\n borderColor: theme.colors.control.toggleButton.border,\n borderStyle: \"solid\",\n borderRadius: sizeStyles.borderRadius,\n })}\n >\n {items.map((item, index) => {\n const isActive = isItemActive(item.id);\n const isDisabled = item.disabled;\n const itemId = id ? `${id}-item-${item.id}` : undefined;\n\n // Determine tab index\n let tabIndex: number;\n if (isDisabled) {\n tabIndex = -1;\n } else if (multiple) {\n // In multiple mode, all enabled items are tabbable\n tabIndex = 0;\n } else {\n // In single mode, only the active item (or first enabled if none active) is tabbable\n tabIndex =\n isActive || (firstActiveIndex === -1 && index === firstEnabledIndex)\n ? 0\n : -1;\n }\n\n const handlePress = () => {\n if (!isDisabled) {\n handleSelect(item.id);\n }\n };\n\n // Colors based on state - using toggle button specific colors\n const toggleColors = theme.colors.control.toggleButton;\n\n const bgColor = isDisabled\n ? toggleColors.bgDisable\n : isActive\n ? toggleColors.bgActive\n : toggleColors.bg;\n\n const textColor = isDisabled\n ? toggleColors.textDisable\n : isActive\n ? toggleColors.textActive\n : toggleColors.text;\n\n const borderColor = isDisabled\n ? toggleColors.borderDisable\n : isActive\n ? toggleColors.borderActive\n : toggleColors.border;\n\n return (\n <Box\n key={item.id}\n as=\"button\"\n role={multiple ? \"checkbox\" : \"radio\"}\n id={itemId}\n aria-checked={isActive}\n aria-disabled={isDisabled}\n aria-label={item[\"aria-label\"] || item.label}\n tabIndex={tabIndex}\n disabled={isDisabled}\n ref={(el: HTMLElement | null) => {\n itemRefs.current[index] = el;\n }}\n onPress={handlePress}\n onKeyDown={(e: React.KeyboardEvent) => handleKeyDown(e, index)}\n flex={fullWidth ? 1 : undefined}\n height={sizeStyles.height}\n paddingHorizontal={sizeStyles.paddingHorizontal}\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap={sizeStyles.gap}\n backgroundColor={bgColor}\n {...(isSeparated && {\n borderWidth: 1,\n borderColor: borderColor,\n borderStyle: \"solid\",\n borderRadius: sizeStyles.borderRadius,\n })}\n cursor={isDisabled ? \"not-allowed\" : \"pointer\"}\n hoverStyle={\n !isDisabled && !isActive\n ? {\n backgroundColor: toggleColors.bgHover,\n borderColor: toggleColors.borderHover,\n }\n : undefined\n }\n {...(!isSeparated && {\n borderLeftWidth: index > 0 ? 1 : 0,\n borderLeftColor: theme.colors.control.toggleButton.border,\n borderLeftStyle: \"solid\",\n })}\n style={{\n flexShrink: 0,\n ...(!isSeparated &&\n index === 0 && {\n borderTopLeftRadius: sizeStyles.borderRadius - 1,\n borderBottomLeftRadius: sizeStyles.borderRadius - 1,\n }),\n ...(!isSeparated &&\n index === items.length - 1 && {\n borderTopRightRadius: sizeStyles.borderRadius - 1,\n borderBottomRightRadius: sizeStyles.borderRadius - 1,\n }),\n }}\n >\n {item.iconLeft && (\n <Icon size={sizeStyles.iconSize} color={textColor} aria-hidden>\n {item.iconLeft}\n </Icon>\n )}\n <Text\n color={textColor}\n fontSize={sizeStyles.fontSize}\n fontWeight=\"400\"\n textAlign=\"center\"\n style={{\n lineHeight: `${sizeStyles.lineHeight}px`,\n }}\n >\n {item.label}\n </Text>\n {item.iconRight && (\n <Icon size={sizeStyles.iconSize} color={textColor} aria-hidden>\n {item.iconRight}\n </Icon>\n )}\n </Box>\n );\n })}\n </Box>\n );\n};\n\nToggleButtonGroup.displayName = \"ToggleButtonGroup\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n ...props.style,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredSpan = createFilteredElement(\"span\");\n\nconst StyledText = styled(FilteredSpan)<TextProps>`\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-weight: ${(props) => props.fontWeight || \"normal\"};\n font-family: ${(props) =>\n props.fontFamily ||\n '\"Aktiv Grotesk\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif'};\n line-height: ${(props) =>\n typeof props.lineHeight === \"number\"\n ? `${props.lineHeight}px`\n : props.lineHeight || \"inherit\"};\n white-space: ${(props) => props.whiteSpace || \"normal\"};\n text-align: ${(props) => props.textAlign || \"inherit\"};\n text-decoration: ${(props) => props.textDecoration || \"none\"};\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n numberOfLines: _numberOfLines,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n data-testid={dataTestId || testID}\n />\n );\n};\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledIcon = styled(FilteredDiv)<IconProps>`\n display: flex;\n align-items: center;\n justify-content: center;\n width: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n height: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n color: ${(props) => props.color || \"currentColor\"};\n\n svg {\n width: 100%;\n height: 100%;\n fill: none;\n stroke: currentColor;\n }\n`;\n\nexport const Icon: React.FC<IconProps> = ({\n children,\n testID,\n \"data-testid\": dataTestId,\n ...props\n}) => {\n return (\n <StyledIcon data-testid={dataTestId || testID} {...props}>\n {children}\n </StyledIcon>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAqD;;;ACArD,IAAAC,gBAAkB;AAClB,+BAAmB;;;ACDnB,mBAAkB;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SAAO,SAAU,KAAK;AACpB,QAAI,MAAM,GAAG,MAAM,OAAW,OAAM,GAAG,IAAI,GAAG,GAAG;AACjD,WAAO,MAAM,GAAG;AAAA,EAClB;AACF;AAEA,IAAO,sBAAQ;;;ACNf,IAAI,kBAAkB;AAEtB,IAAI,QAAQ;AAAA,EAAQ,SAAU,MAAM;AAClC,WAAO,gBAAgB,KAAK,IAAI,KAAK,KAAK,WAAW,CAAC,MAAM,OAEzD,KAAK,WAAW,CAAC,MAAM,OAEvB,KAAK,WAAW,CAAC,IAAI;AAAA,EAC1B;AAAA;AAEA;AAEA,IAAO,4BAAQ;;;AFRR,IAAM,2BAA2B,oBAAI,IAAI;AAAA;AAAA,EAE9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,SAAS,kBAAkB,KAAsB;AAC/C,MAAI,yBAAyB,IAAI,GAAG,EAAG,QAAO;AAC9C,SAAO,0BAAY,GAAG;AACxB;AAgBO,SAAS,sBAAsB,YAAoB;A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A,kBAAkB,cAAc;","names":["import_react","import_react","React","styled","React","import_styled_components","import_jsx_runtime","styled","import_styled_components","import_jsx_runtime","FilteredDiv","styled","import_jsx_runtime","index"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.tsx","../../src/ToggleButtonGroup.tsx","../../../../foundation/primitives-web/src/Box.tsx","../../../../foundation/primitives-web/src/filterDOMProps.ts","../../../../../node_modules/@emotion/memoize/dist/memoize.esm.js","../../../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js","../../../../foundation/primitives-web/src/Text.tsx","../../../../foundation/primitives-web/src/Icon.tsx"],"sourcesContent":["export { ToggleButtonGroup } from \"./ToggleButtonGroup\";\nexport type {\n ToggleButtonGroupProps,\n ToggleButtonGroupItem,\n ToggleButtonGroupSize,\n ToggleButtonGroupAppearance,\n ToggleButtonGroupView,\n} from \"./types\";\n","import React, { useCallback, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme } from \"@xsolla/xui-core\";\nimport type { ToggleButtonGroupProps } from \"./types\";\n\nconst getUnitedItemCornerStyle = (\n index: number,\n total: number,\n borderRadius: number,\n isVertical: boolean\n): React.CSSProperties => {\n const isFirst = index === 0;\n const isLast = index === total - 1;\n if (!isFirst && !isLast) return {};\n\n const radius = `${borderRadius}px`;\n\n if (isVertical) {\n return {\n ...(isFirst && {\n borderTopLeftRadius: radius,\n borderTopRightRadius: radius,\n }),\n ...(isLast && {\n borderBottomLeftRadius: radius,\n borderBottomRightRadius: radius,\n }),\n };\n }\n\n return {\n ...(isFirst && {\n borderTopLeftRadius: radius,\n borderBottomLeftRadius: radius,\n }),\n ...(isLast && {\n borderTopRightRadius: radius,\n borderBottomRightRadius: radius,\n }),\n };\n};\n\n/**\n * ToggleButtonGroup - A control for picking one or several options from a set\n *\n * Used to pick one or several options from a linear set of closely related options.\n * Can be used to filter or to sort elements.\n *\n * ## Accessibility Features\n *\n * - **Role**: Uses `role=\"radiogroup\"` for single selection, `role=\"group\"` for multiple\n * - **Keyboard Navigation**: Arrow keys to navigate, Enter/Space to select\n * - **ARIA**: Proper aria-checked and aria-disabled states\n */\nexport const ToggleButtonGroup: React.FC<ToggleButtonGroupProps> = ({\n items,\n value,\n defaultValue,\n onChange,\n size = \"md\",\n appearance = \"separated\",\n view = \"horizontal\",\n multiple = false,\n id,\n testID,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n fullWidth = false,\n themeMode,\n themeProductContext,\n}) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const sizeStyles = theme.sizing.toggleButtonGroup(size);\n const itemRefs = useRef<(HTMLElement | null)[]>([]);\n\n // Internal state for uncontrolled mode\n const [internalValue, setInternalValue] = useState<string[]>(() => {\n if (defaultValue !== undefined) {\n return Array.isArray(defaultValue) ? defaultValue : [defaultValue];\n }\n return [];\n });\n\n // Determine current value (controlled vs uncontrolled)\n const currentValue =\n value !== undefined\n ? Array.isArray(value)\n ? value\n : [value]\n : internalValue;\n\n const isItemActive = (itemId: string) => currentValue.includes(itemId);\n\n const enabledIndices = items\n .map((item, index) => (!item.disabled ? index : -1))\n .filter((i) => i !== -1);\n\n const focusItem = useCallback((index: number) => {\n const element = itemRefs.current[index];\n if (element) {\n element.focus();\n }\n }, []);\n\n const handleSelect = useCallback(\n (itemId: string) => {\n let newValue: string[];\n\n if (multiple) {\n // Multiple selection mode\n if (currentValue.includes(itemId)) {\n newValue = currentValue.filter((v) => v !== itemId);\n } else {\n newValue = [...currentValue, itemId];\n }\n } else {\n // Single selection mode\n newValue = [itemId];\n }\n\n // Update internal state for uncontrolled mode\n if (value === undefined) {\n setInternalValue(newValue);\n }\n\n // Call onChange with appropriate type\n if (onChange) {\n if (multiple) {\n onChange(newValue);\n } else {\n onChange(newValue[0] || \"\");\n }\n }\n },\n [currentValue, multiple, value, onChange]\n );\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent, currentIndex: number) => {\n const currentEnabledIndex = enabledIndices.indexOf(currentIndex);\n\n switch (e.key) {\n case \"ArrowRight\":\n case \"ArrowDown\":\n e.preventDefault();\n {\n const nextEnabledIndex =\n currentEnabledIndex < enabledIndices.length - 1\n ? enabledIndices[currentEnabledIndex + 1]\n : enabledIndices[0];\n focusItem(nextEnabledIndex);\n }\n break;\n\n case \"ArrowLeft\":\n case \"ArrowUp\":\n e.preventDefault();\n {\n const prevEnabledIndex =\n currentEnabledIndex > 0\n ? enabledIndices[currentEnabledIndex - 1]\n : enabledIndices[enabledIndices.length - 1];\n focusItem(prevEnabledIndex);\n }\n break;\n\n case \"Enter\":\n case \" \":\n e.preventDefault();\n if (!items[currentIndex].disabled) {\n handleSelect(items[currentIndex].id);\n }\n break;\n\n default:\n break;\n }\n },\n [enabledIndices, focusItem, handleSelect, items]\n );\n\n const isSeparated = appearance === \"separated\";\n const isVertical = view === \"vertical\";\n const containerGap = isSeparated ? sizeStyles.itemGap : 0;\n\n // Determine first active item for tabindex in single selection mode\n const firstActiveIndex = items.findIndex((item) =>\n currentValue.includes(item.id)\n );\n const firstEnabledIndex = enabledIndices[0] ?? 0;\n\n return (\n <Box\n id={id}\n role={multiple ? \"group\" : \"radiogroup\"}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n testID={testID}\n flexDirection={isVertical ? \"column\" : \"row\"}\n alignItems=\"stretch\"\n flexWrap={isSeparated && !isVertical ? \"wrap\" : \"nowrap\"}\n gap={containerGap}\n width={fullWidth ? \"100%\" : \"fit-content\"}\n {...(!isSeparated && {\n borderRadius: sizeStyles.borderRadius,\n overflow: \"hidden\",\n })}\n >\n {items.map((item, index) => {\n const isActive = isItemActive(item.id);\n const isDisabled = item.disabled;\n const itemId = id ? `${id}-item-${item.id}` : undefined;\n\n // Determine tab index\n let tabIndex: number;\n if (isDisabled) {\n tabIndex = -1;\n } else if (multiple) {\n // In multiple mode, all enabled items are tabbable\n tabIndex = 0;\n } else {\n // In single mode, only the active item (or first enabled if none active) is tabbable\n tabIndex =\n isActive || (firstActiveIndex === -1 && index === firstEnabledIndex)\n ? 0\n : -1;\n }\n\n const handlePress = () => {\n if (!isDisabled) {\n handleSelect(item.id);\n }\n };\n\n // Colors based on state - using toggle button specific colors\n const toggleColors = theme.colors.control.toggleButton;\n\n const bgColor = isDisabled\n ? toggleColors.bgDisable\n : isActive\n ? toggleColors.bgActive\n : toggleColors.bg;\n\n const textColor = isDisabled\n ? toggleColors.textDisable\n : isActive\n ? toggleColors.textActive\n : toggleColors.text;\n\n const borderColor = isDisabled\n ? toggleColors.borderDisable\n : isActive\n ? toggleColors.borderActive\n : toggleColors.border;\n\n return (\n <Box\n key={item.id}\n as=\"button\"\n role={multiple ? \"checkbox\" : \"radio\"}\n id={itemId}\n aria-checked={isActive}\n aria-disabled={isDisabled}\n aria-label={item[\"aria-label\"] || item.label}\n tabIndex={tabIndex}\n disabled={isDisabled}\n ref={(el: HTMLElement | null) => {\n itemRefs.current[index] = el;\n }}\n onPress={handlePress}\n onKeyDown={(e: React.KeyboardEvent) => handleKeyDown(e, index)}\n flex={fullWidth ? 1 : undefined}\n height={sizeStyles.height}\n paddingHorizontal={sizeStyles.paddingHorizontal}\n flexDirection=\"row\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap={sizeStyles.gap}\n backgroundColor={bgColor}\n {...(isSeparated\n ? {\n borderWidth: 1,\n borderColor: borderColor,\n borderStyle: \"solid\",\n borderRadius: sizeStyles.borderRadius,\n }\n : {\n borderWidth: 1,\n borderColor: borderColor,\n borderStyle: \"solid\",\n })}\n cursor={isDisabled ? \"not-allowed\" : \"pointer\"}\n hoverStyle={\n !isDisabled && !isActive\n ? {\n backgroundColor: toggleColors.bgHover,\n borderColor: toggleColors.borderHover,\n }\n : undefined\n }\n style={{\n flexShrink: 0,\n ...(!isSeparated &&\n getUnitedItemCornerStyle(\n index,\n items.length,\n sizeStyles.borderRadius,\n isVertical\n )),\n ...(!isSeparated &&\n !isVertical &&\n index < items.length - 1 && { marginRight: -1 }),\n ...(!isSeparated &&\n isVertical &&\n index < items.length - 1 && { marginBottom: -1 }),\n }}\n >\n {item.iconLeft && (\n <Icon size={sizeStyles.iconSize} color={textColor} aria-hidden>\n {item.iconLeft}\n </Icon>\n )}\n <Text\n color={textColor}\n fontSize={sizeStyles.fontSize}\n fontWeight=\"400\"\n textAlign=\"center\"\n whiteSpace=\"nowrap\"\n overflow=\"hidden\"\n textOverflow=\"ellipsis\"\n style={{\n lineHeight: `${sizeStyles.lineHeight}px`,\n }}\n >\n {item.label}\n </Text>\n {item.iconRight && (\n <Icon size={sizeStyles.iconSize} color={textColor} aria-hidden>\n {item.iconRight}\n </Icon>\n )}\n </Box>\n );\n })}\n </Box>\n );\n};\n\nToggleButtonGroup.displayName = \"ToggleButtonGroup\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n ...props.style,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredSpan = createFilteredElement(\"span\");\n\nconst StyledText = styled(FilteredSpan)<TextProps>`\n color: ${(props) => props.color || \"inherit\"};\n font-size: ${(props) =>\n typeof props.fontSize === \"number\"\n ? `${props.fontSize}px`\n : props.fontSize || \"inherit\"};\n font-weight: ${(props) => props.fontWeight || \"normal\"};\n font-family: ${(props) =>\n props.fontFamily ||\n '\"Aktiv Grotesk\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif'};\n line-height: ${(props) =>\n typeof props.lineHeight === \"number\"\n ? `${props.lineHeight}px`\n : props.lineHeight || \"inherit\"};\n white-space: ${(props) => props.whiteSpace || \"normal\"};\n text-align: ${(props) => props.textAlign || \"inherit\"};\n text-decoration: ${(props) => props.textDecoration || \"none\"};\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n numberOfLines: _numberOfLines,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n data-testid={dataTestId || testID}\n />\n );\n};\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledIcon = styled(FilteredDiv)<IconProps>`\n display: flex;\n align-items: center;\n justify-content: center;\n width: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n height: ${(props) =>\n typeof props.size === \"number\" ? `${props.size}px` : props.size || \"24px\"};\n color: ${(props) => props.color || \"currentColor\"};\n\n svg {\n width: 100%;\n height: 100%;\n fill: none;\n stroke: currentColor;\n }\n`;\n\nexport const Icon: React.FC<IconProps> = ({\n children,\n testID,\n \"data-testid\": dataTestId,\n ...props\n}) => {\n return (\n <StyledIcon data-testid={dataTestId || testID} {...props}>\n {children}\n </StyledIcon>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;A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;AAAA,kBACtC;AAAA,kBAEC,eAAK;AAAA;AAAA,cACR;AAAA,cACC,KAAK,aACJ,6CAAC,QAAK,MAAM,WAAW,UAAU,OAAO,WAAW,eAAW,MAC3D,eAAK,WACR;AAAA;AAAA;AAAA,UAlFG,KAAK;AAAA,QAoFZ;AAAA,MAEJ,CAAC;AAAA;AAAA,EACH;AAEJ;AAEA,kBAAkB,cAAc;","names":["import_react","import_react","React","styled","React","import_styled_components","import_jsx_runtime","styled","import_styled_components","import_jsx_runtime","FilteredDiv","styled","import_jsx_runtime","index"]}
|
package/web/index.mjs
CHANGED
|
@@ -320,6 +320,34 @@ var Icon = ({
|
|
|
320
320
|
// src/ToggleButtonGroup.tsx
|
|
321
321
|
import { useResolvedTheme } from "@xsolla/xui-core";
|
|
322
322
|
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
323
|
+
var getUnitedItemCornerStyle = (index2, total, borderRadius, isVertical) => {
|
|
324
|
+
const isFirst = index2 === 0;
|
|
325
|
+
const isLast = index2 === total - 1;
|
|
326
|
+
if (!isFirst && !isLast) return {};
|
|
327
|
+
const radius = `${borderRadius}px`;
|
|
328
|
+
if (isVertical) {
|
|
329
|
+
return {
|
|
330
|
+
...isFirst && {
|
|
331
|
+
borderTopLeftRadius: radius,
|
|
332
|
+
borderTopRightRadius: radius
|
|
333
|
+
},
|
|
334
|
+
...isLast && {
|
|
335
|
+
borderBottomLeftRadius: radius,
|
|
336
|
+
borderBottomRightRadius: radius
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
return {
|
|
341
|
+
...isFirst && {
|
|
342
|
+
borderTopLeftRadius: radius,
|
|
343
|
+
borderBottomLeftRadius: radius
|
|
344
|
+
},
|
|
345
|
+
...isLast && {
|
|
346
|
+
borderTopRightRadius: radius,
|
|
347
|
+
borderBottomRightRadius: radius
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
};
|
|
323
351
|
var ToggleButtonGroup = ({
|
|
324
352
|
items,
|
|
325
353
|
value,
|
|
@@ -327,6 +355,7 @@ var ToggleButtonGroup = ({
|
|
|
327
355
|
onChange,
|
|
328
356
|
size = "md",
|
|
329
357
|
appearance = "separated",
|
|
358
|
+
view = "horizontal",
|
|
330
359
|
multiple = false,
|
|
331
360
|
id,
|
|
332
361
|
testID,
|
|
@@ -413,6 +442,7 @@ var ToggleButtonGroup = ({
|
|
|
413
442
|
[enabledIndices, focusItem, handleSelect, items]
|
|
414
443
|
);
|
|
415
444
|
const isSeparated = appearance === "separated";
|
|
445
|
+
const isVertical = view === "vertical";
|
|
416
446
|
const containerGap = isSeparated ? sizeStyles.itemGap : 0;
|
|
417
447
|
const firstActiveIndex = items.findIndex(
|
|
418
448
|
(item) => currentValue.includes(item.id)
|
|
@@ -426,16 +456,14 @@ var ToggleButtonGroup = ({
|
|
|
426
456
|
"aria-label": ariaLabel,
|
|
427
457
|
"aria-labelledby": ariaLabelledBy,
|
|
428
458
|
testID,
|
|
429
|
-
flexDirection: "row",
|
|
430
|
-
alignItems: "
|
|
431
|
-
flexWrap: "wrap",
|
|
459
|
+
flexDirection: isVertical ? "column" : "row",
|
|
460
|
+
alignItems: "stretch",
|
|
461
|
+
flexWrap: isSeparated && !isVertical ? "wrap" : "nowrap",
|
|
432
462
|
gap: containerGap,
|
|
433
463
|
width: fullWidth ? "100%" : "fit-content",
|
|
434
464
|
...!isSeparated && {
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
borderStyle: "solid",
|
|
438
|
-
borderRadius: sizeStyles.borderRadius
|
|
465
|
+
borderRadius: sizeStyles.borderRadius,
|
|
466
|
+
overflow: "hidden"
|
|
439
467
|
},
|
|
440
468
|
children: items.map((item, index2) => {
|
|
441
469
|
const isActive = isItemActive(item.id);
|
|
@@ -482,32 +510,31 @@ var ToggleButtonGroup = ({
|
|
|
482
510
|
justifyContent: "center",
|
|
483
511
|
gap: sizeStyles.gap,
|
|
484
512
|
backgroundColor: bgColor,
|
|
485
|
-
...isSeparated
|
|
513
|
+
...isSeparated ? {
|
|
486
514
|
borderWidth: 1,
|
|
487
515
|
borderColor,
|
|
488
516
|
borderStyle: "solid",
|
|
489
517
|
borderRadius: sizeStyles.borderRadius
|
|
518
|
+
} : {
|
|
519
|
+
borderWidth: 1,
|
|
520
|
+
borderColor,
|
|
521
|
+
borderStyle: "solid"
|
|
490
522
|
},
|
|
491
523
|
cursor: isDisabled ? "not-allowed" : "pointer",
|
|
492
524
|
hoverStyle: !isDisabled && !isActive ? {
|
|
493
525
|
backgroundColor: toggleColors.bgHover,
|
|
494
526
|
borderColor: toggleColors.borderHover
|
|
495
527
|
} : void 0,
|
|
496
|
-
...!isSeparated && {
|
|
497
|
-
borderLeftWidth: index2 > 0 ? 1 : 0,
|
|
498
|
-
borderLeftColor: theme.colors.control.toggleButton.border,
|
|
499
|
-
borderLeftStyle: "solid"
|
|
500
|
-
},
|
|
501
528
|
style: {
|
|
502
529
|
flexShrink: 0,
|
|
503
|
-
...!isSeparated &&
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
}
|
|
530
|
+
...!isSeparated && getUnitedItemCornerStyle(
|
|
531
|
+
index2,
|
|
532
|
+
items.length,
|
|
533
|
+
sizeStyles.borderRadius,
|
|
534
|
+
isVertical
|
|
535
|
+
),
|
|
536
|
+
...!isSeparated && !isVertical && index2 < items.length - 1 && { marginRight: -1 },
|
|
537
|
+
...!isSeparated && isVertical && index2 < items.length - 1 && { marginBottom: -1 }
|
|
511
538
|
},
|
|
512
539
|
children: [
|
|
513
540
|
item.iconLeft && /* @__PURE__ */ jsx4(Icon, { size: sizeStyles.iconSize, color: textColor, "aria-hidden": true, children: item.iconLeft }),
|
|
@@ -518,6 +545,9 @@ var ToggleButtonGroup = ({
|
|
|
518
545
|
fontSize: sizeStyles.fontSize,
|
|
519
546
|
fontWeight: "400",
|
|
520
547
|
textAlign: "center",
|
|
548
|
+
whiteSpace: "nowrap",
|
|
549
|
+
overflow: "hidden",
|
|
550
|
+
textOverflow: "ellipsis",
|
|
521
551
|
style: {
|
|
522
552
|
lineHeight: `${sizeStyles.lineHeight}px`
|
|
523
553
|
},
|