@xsolla/xui-b2b-collapsible 0.147.1

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.tsx","../../src/Collapsible.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 { Collapsible } from \"./Collapsible\";\nexport type { CollapsibleProps, CollapsibleView } from \"./types\";\n","import { forwardRef, useState, useCallback, useRef } 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 { ChevronDown, ChevronUp } from \"@xsolla/xui-icons-base\";\nimport type { CollapsibleProps } from \"./types\";\n\nconst PANEL_TRANSITION =\n \"grid-template-rows 280ms cubic-bezier(0.4, 0, 0.2, 1)\";\nconst CHEVRON_TRANSITION = \"transform 280ms cubic-bezier(0.4, 0, 0.2, 1)\";\n\nexport const Collapsible = forwardRef<HTMLDivElement, CollapsibleProps>(\n (\n {\n title,\n caption: captionProp,\n icon,\n trailing: trailingProp,\n view = \"without-surface\",\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n children,\n className,\n \"aria-label\": ariaLabel,\n themeMode,\n themeProductContext,\n // deprecated aliases\n onChange,\n statusIcon,\n description,\n ...rest\n },\n ref\n ) => {\n const caption = captionProp ?? description;\n const trailing = trailingProp ?? statusIcon;\n const resolvedOnOpenChange = onOpenChange ?? onChange;\n\n // Stable panel ID — React 16 compatible (no useId)\n const panelIdRef = useRef<string>();\n if (!panelIdRef.current) {\n panelIdRef.current = `collapsible-panel-${Math.random().toString(36).slice(2, 10)}`;\n }\n const panelId = panelIdRef.current;\n\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const sizing = theme.sizing.collapsibleB2b();\n\n const isControlled = openProp !== undefined;\n const [openState, setOpenState] = useState(defaultOpen);\n const open = isControlled ? openProp! : openState;\n\n const handleToggle = useCallback(() => {\n const next = !open;\n if (!isControlled) setOpenState(next);\n resolvedOnOpenChange?.(next);\n }, [open, isControlled, resolvedOnOpenChange]);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === \"Enter\") {\n e.preventDefault();\n handleToggle();\n } else if (e.key === \" \") {\n e.preventDefault();\n }\n },\n [handleToggle]\n );\n\n const handleKeyUp = useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === \" \") {\n e.preventDefault();\n handleToggle();\n }\n },\n [handleToggle]\n );\n\n const isWhite = view === \"white-surface\";\n const isGrey = view === \"grey-surface\";\n const isWithout = view === \"without-surface\";\n\n // Root is always column — avoids flex-direction flip that breaks width\n const rootStyle: React.CSSProperties = {\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n backgroundColor: isWhite\n ? theme.colors.background.primary\n : isGrey\n ? theme.colors.overlay.mono\n : undefined,\n borderRadius: !isWithout ? sizing.surfaceRadius : undefined,\n borderBottom: isWithout\n ? `1px solid ${theme.colors.border.secondary}`\n : undefined,\n };\n\n const cellStyle: React.CSSProperties = {\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n gap: sizing.triggerGap,\n width: \"100%\",\n minHeight: isWithout ? sizing.triggerMinHeight : undefined,\n padding: !isWithout ? sizing.triggerPadding : 0,\n backgroundColor: isWhite\n ? theme.colors.background.primary\n : isGrey\n ? theme.colors.overlay.mono\n : undefined,\n borderRadius: !isWithout\n ? open\n ? `${sizing.cellRadius}px ${sizing.cellRadius}px 0 0`\n : sizing.cellRadius\n : undefined,\n borderBottom: open\n ? `1px solid ${theme.colors.border.secondary}`\n : undefined,\n };\n\n // grid-template-rows trick: 0fr (collapsed) ↔ 1fr (expanded)\n // The inner div has overflow:hidden so content is clipped during transition\n const panelGridStyle: React.CSSProperties = {\n display: \"grid\",\n gridTemplateRows: open ? \"1fr\" : \"0fr\",\n transition: PANEL_TRANSITION,\n width: \"100%\",\n };\n\n const panelInnerStyle: React.CSSProperties = {\n overflow: \"hidden\",\n };\n\n const panelContentStyle: React.CSSProperties = {\n boxSizing: \"border-box\",\n width: \"100%\",\n padding: sizing.panelPadding,\n };\n\n return (\n <Box\n ref={ref}\n data-testid=\"collapsible\"\n data-open={open}\n className={className}\n width=\"100%\"\n style={rootStyle}\n {...rest}\n >\n {/* Trigger */}\n <div\n role=\"button\"\n tabIndex={0}\n aria-expanded={open}\n aria-controls={panelId}\n aria-label={\n ariaLabel ?? (typeof title === \"string\" ? title : undefined)\n }\n onClick={handleToggle}\n onKeyDown={handleKeyDown}\n onKeyUp={handleKeyUp}\n style={{ boxSizing: \"border-box\", width: \"100%\", cursor: \"pointer\" }}\n >\n <div style={cellStyle}>\n {/* Left icon slot — consumer is responsible for icon/checkbox styling */}\n {icon && (\n <div\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n onKeyUp={(e) => e.stopPropagation()}\n style={{ flexShrink: 0, display: \"flex\", alignItems: \"center\" }}\n >\n {icon}\n </div>\n )}\n\n {/* Title + caption */}\n <div\n style={{\n flex: 1,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: sizing.textGap,\n minWidth: 0,\n }}\n >\n {typeof title === \"string\" || typeof title === \"number\" ? (\n <Text\n color={theme.colors.content.primary}\n fontSize={sizing.titleFontSize}\n lineHeight={sizing.titleLineHeight}\n fontWeight=\"500\"\n >\n {title}\n </Text>\n ) : (\n title\n )}\n {caption !== undefined &&\n (typeof caption === \"string\" || typeof caption === \"number\" ? (\n <Text\n color={theme.colors.content.tertiary}\n fontSize={sizing.captionFontSize}\n lineHeight={sizing.captionLineHeight}\n fontWeight=\"400\"\n >\n {caption}\n </Text>\n ) : (\n caption\n ))}\n </div>\n\n {/* Trailing slot + animated chevron */}\n <div\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n gap: sizing.trailingGap,\n flexShrink: 0,\n }}\n >\n {trailing && (\n <div\n onClick={(e) => e.stopPropagation()}\n onKeyDown={(e) => e.stopPropagation()}\n onKeyUp={(e) => e.stopPropagation()}\n style={{ display: \"flex\", alignItems: \"center\" }}\n >\n {trailing}\n </div>\n )}\n <div\n style={{\n transform: open ? \"rotate(180deg)\" : \"rotate(0deg)\",\n transition: CHEVRON_TRANSITION,\n display: \"flex\",\n alignItems: \"center\",\n }}\n >\n <Icon\n color={theme.colors.content.primary}\n size={sizing.chevronSize}\n >\n <ChevronDown />\n </Icon>\n </div>\n </div>\n </div>\n </div>\n\n {/* Animated panel using grid-template-rows trick */}\n <div id={panelId} style={panelGridStyle}>\n <div style={panelInnerStyle}>\n <div style={panelContentStyle}>{children}</div>\n </div>\n </div>\n </Box>\n );\n }\n);\n\nCollapsible.displayName = \"Collapsible\";\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 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 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 }}\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 numberOfLines: _numberOfLines,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\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> = ({ children, ...props }) => {\n return <StyledIcon {...props}>{children}</StyledIcon>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;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AAAA;AAAA,8BACC,OAAO,MAAM,OAAO,QAAQ;AAAA,8BAC5B,MAAM,OAAO;AAAA,8BAEb,uDAAC,qCAAY;AAAA;AAAA,0BACf;AAAA;AAAA,sBACF;AAAA;AAAA;AAAA,gBACF;AAAA,iBACF;AAAA;AAAA,UACF;AAAA,UAGA,6CAAC,SAAI,IAAI,SAAS,OAAO,gBACvB,uDAAC,SAAI,OAAO,iBACV,uDAAC,SAAI,OAAO,mBAAoB,UAAS,GAC3C,GACF;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,YAAY,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"]}
package/web/index.mjs ADDED
@@ -0,0 +1,536 @@
1
+ // src/Collapsible.tsx
2
+ import { forwardRef, useState, useCallback, useRef } from "react";
3
+
4
+ // ../../foundation/primitives-web/src/Box.tsx
5
+ import React2 from "react";
6
+ import styled from "styled-components";
7
+
8
+ // ../../foundation/primitives-web/src/filterDOMProps.ts
9
+ import React from "react";
10
+
11
+ // ../../../node_modules/@emotion/memoize/dist/memoize.esm.js
12
+ function memoize(fn) {
13
+ var cache = {};
14
+ return function(arg) {
15
+ if (cache[arg] === void 0) cache[arg] = fn(arg);
16
+ return cache[arg];
17
+ };
18
+ }
19
+ var memoize_esm_default = memoize;
20
+
21
+ // ../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js
22
+ var 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)-.*))$/;
23
+ var index = memoize_esm_default(
24
+ function(prop) {
25
+ return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
26
+ }
27
+ /* Z+1 */
28
+ );
29
+ var is_prop_valid_esm_default = index;
30
+
31
+ // ../../foundation/primitives-web/src/filterDOMProps.ts
32
+ var ADDITIONAL_BLOCKED_PROPS = /* @__PURE__ */ new Set([
33
+ // RN-only event handlers (pass isPropValid's on* pattern)
34
+ "onPress",
35
+ "onChangeText",
36
+ "onLayout",
37
+ "onMoveShouldSetResponder",
38
+ "onResponderGrant",
39
+ "onResponderMove",
40
+ "onResponderRelease",
41
+ "onResponderTerminate",
42
+ // SVG attributes that pass isPropValid
43
+ "strokeWidth",
44
+ // CSS properties that pass isPropValid but are used as component props
45
+ "overflow",
46
+ "cursor",
47
+ "fontSize",
48
+ "fontWeight",
49
+ "fontFamily",
50
+ "textDecoration"
51
+ ]);
52
+ function shouldForwardProp(key) {
53
+ if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;
54
+ return is_prop_valid_esm_default(key);
55
+ }
56
+ function createFilteredElement(defaultTag) {
57
+ const Component = React.forwardRef(
58
+ ({ children, elementType, ...props }, ref) => {
59
+ const Tag = elementType || defaultTag;
60
+ const htmlProps = {};
61
+ for (const key of Object.keys(props)) {
62
+ if (shouldForwardProp(key)) {
63
+ htmlProps[key] = props[key];
64
+ }
65
+ }
66
+ return React.createElement(
67
+ Tag,
68
+ { ref, ...htmlProps },
69
+ children
70
+ );
71
+ }
72
+ );
73
+ Component.displayName = `Filtered(${defaultTag})`;
74
+ return Component;
75
+ }
76
+
77
+ // ../../foundation/primitives-web/src/Box.tsx
78
+ import { jsx } from "react/jsx-runtime";
79
+ var FilteredDiv = createFilteredElement("div");
80
+ var StyledBox = styled(FilteredDiv)`
81
+ display: flex;
82
+ box-sizing: border-box;
83
+ background-color: ${(props) => props.backgroundColor || "transparent"};
84
+ border-color: ${(props) => props.borderColor || "transparent"};
85
+ border-width: ${(props) => typeof props.borderWidth === "number" ? `${props.borderWidth}px` : props.borderWidth || 0};
86
+
87
+ ${(props) => props.borderBottomWidth !== void 0 && `
88
+ border-bottom-width: ${typeof props.borderBottomWidth === "number" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};
89
+ border-bottom-color: ${props.borderBottomColor || props.borderColor || "transparent"};
90
+ border-bottom-style: solid;
91
+ `}
92
+ ${(props) => props.borderTopWidth !== void 0 && `
93
+ border-top-width: ${typeof props.borderTopWidth === "number" ? `${props.borderTopWidth}px` : props.borderTopWidth};
94
+ border-top-color: ${props.borderTopColor || props.borderColor || "transparent"};
95
+ border-top-style: solid;
96
+ `}
97
+ ${(props) => props.borderLeftWidth !== void 0 && `
98
+ border-left-width: ${typeof props.borderLeftWidth === "number" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};
99
+ border-left-color: ${props.borderLeftColor || props.borderColor || "transparent"};
100
+ border-left-style: solid;
101
+ `}
102
+ ${(props) => props.borderRightWidth !== void 0 && `
103
+ border-right-width: ${typeof props.borderRightWidth === "number" ? `${props.borderRightWidth}px` : props.borderRightWidth};
104
+ border-right-color: ${props.borderRightColor || props.borderColor || "transparent"};
105
+ border-right-style: solid;
106
+ `}
107
+
108
+ border-style: ${(props) => props.borderStyle || (props.borderWidth || props.borderBottomWidth || props.borderTopWidth || props.borderLeftWidth || props.borderRightWidth ? "solid" : "none")};
109
+ border-radius: ${(props) => typeof props.borderRadius === "number" ? `${props.borderRadius}px` : props.borderRadius || 0};
110
+ height: ${(props) => typeof props.height === "number" ? `${props.height}px` : props.height || "auto"};
111
+ width: ${(props) => typeof props.width === "number" ? `${props.width}px` : props.width || "auto"};
112
+ min-width: ${(props) => typeof props.minWidth === "number" ? `${props.minWidth}px` : props.minWidth || "auto"};
113
+ min-height: ${(props) => typeof props.minHeight === "number" ? `${props.minHeight}px` : props.minHeight || "auto"};
114
+ max-width: ${(props) => typeof props.maxWidth === "number" ? `${props.maxWidth}px` : props.maxWidth || "none"};
115
+ max-height: ${(props) => typeof props.maxHeight === "number" ? `${props.maxHeight}px` : props.maxHeight || "none"};
116
+
117
+ padding: ${(props) => typeof props.padding === "number" ? `${props.padding}px` : props.padding || 0};
118
+ ${(props) => props.paddingHorizontal && `
119
+ padding-left: ${typeof props.paddingHorizontal === "number" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};
120
+ padding-right: ${typeof props.paddingHorizontal === "number" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};
121
+ `}
122
+ ${(props) => props.paddingVertical && `
123
+ padding-top: ${typeof props.paddingVertical === "number" ? `${props.paddingVertical}px` : props.paddingVertical};
124
+ padding-bottom: ${typeof props.paddingVertical === "number" ? `${props.paddingVertical}px` : props.paddingVertical};
125
+ `}
126
+ ${(props) => props.paddingTop !== void 0 && `padding-top: ${typeof props.paddingTop === "number" ? `${props.paddingTop}px` : props.paddingTop};`}
127
+ ${(props) => props.paddingBottom !== void 0 && `padding-bottom: ${typeof props.paddingBottom === "number" ? `${props.paddingBottom}px` : props.paddingBottom};`}
128
+ ${(props) => props.paddingLeft !== void 0 && `padding-left: ${typeof props.paddingLeft === "number" ? `${props.paddingLeft}px` : props.paddingLeft};`}
129
+ ${(props) => props.paddingRight !== void 0 && `padding-right: ${typeof props.paddingRight === "number" ? `${props.paddingRight}px` : props.paddingRight};`}
130
+
131
+ margin: ${(props) => typeof props.margin === "number" ? `${props.margin}px` : props.margin || 0};
132
+ ${(props) => props.marginTop !== void 0 && `margin-top: ${typeof props.marginTop === "number" ? `${props.marginTop}px` : props.marginTop};`}
133
+ ${(props) => props.marginBottom !== void 0 && `margin-bottom: ${typeof props.marginBottom === "number" ? `${props.marginBottom}px` : props.marginBottom};`}
134
+ ${(props) => props.marginLeft !== void 0 && `margin-left: ${typeof props.marginLeft === "number" ? `${props.marginLeft}px` : props.marginLeft};`}
135
+ ${(props) => props.marginRight !== void 0 && `margin-right: ${typeof props.marginRight === "number" ? `${props.marginRight}px` : props.marginRight};`}
136
+
137
+ flex-direction: ${(props) => props.flexDirection || "column"};
138
+ flex-wrap: ${(props) => props.flexWrap || "nowrap"};
139
+ align-items: ${(props) => props.alignItems || "stretch"};
140
+ justify-content: ${(props) => props.justifyContent || "flex-start"};
141
+ cursor: ${(props) => props.cursor ? props.cursor : props.onClick || props.onPress ? "pointer" : "inherit"};
142
+ position: ${(props) => props.position || "static"};
143
+ top: ${(props) => typeof props.top === "number" ? `${props.top}px` : props.top};
144
+ bottom: ${(props) => typeof props.bottom === "number" ? `${props.bottom}px` : props.bottom};
145
+ left: ${(props) => typeof props.left === "number" ? `${props.left}px` : props.left};
146
+ right: ${(props) => typeof props.right === "number" ? `${props.right}px` : props.right};
147
+ flex: ${(props) => props.flex};
148
+ flex-shrink: ${(props) => props.flexShrink ?? 1};
149
+ gap: ${(props) => typeof props.gap === "number" ? `${props.gap}px` : props.gap || 0};
150
+ align-self: ${(props) => props.alignSelf || "auto"};
151
+ overflow: ${(props) => props.overflow || "visible"};
152
+ overflow-x: ${(props) => props.overflowX || "visible"};
153
+ overflow-y: ${(props) => props.overflowY || "visible"};
154
+ z-index: ${(props) => props.zIndex};
155
+ opacity: ${(props) => props.disabled ? 0.5 : 1};
156
+ pointer-events: ${(props) => props.disabled ? "none" : "auto"};
157
+
158
+ &:hover {
159
+ ${(props) => props.hoverStyle?.backgroundColor && `background-color: ${props.hoverStyle.backgroundColor};`}
160
+ ${(props) => props.hoverStyle?.borderColor && `border-color: ${props.hoverStyle.borderColor};`}
161
+ }
162
+
163
+ &:active {
164
+ ${(props) => props.pressStyle?.backgroundColor && `background-color: ${props.pressStyle.backgroundColor};`}
165
+ }
166
+ `;
167
+ var Box = React2.forwardRef(
168
+ ({
169
+ children,
170
+ onPress,
171
+ onKeyDown,
172
+ onKeyUp,
173
+ role,
174
+ "aria-label": ariaLabel,
175
+ "aria-labelledby": ariaLabelledBy,
176
+ "aria-current": ariaCurrent,
177
+ "aria-disabled": ariaDisabled,
178
+ "aria-live": ariaLive,
179
+ "aria-busy": ariaBusy,
180
+ "aria-describedby": ariaDescribedBy,
181
+ "aria-expanded": ariaExpanded,
182
+ "aria-haspopup": ariaHasPopup,
183
+ "aria-pressed": ariaPressed,
184
+ "aria-controls": ariaControls,
185
+ tabIndex,
186
+ as,
187
+ src,
188
+ alt,
189
+ type,
190
+ disabled,
191
+ id,
192
+ testID,
193
+ "data-testid": dataTestId,
194
+ ...props
195
+ }, ref) => {
196
+ if (as === "img" && src) {
197
+ return /* @__PURE__ */ jsx(
198
+ "img",
199
+ {
200
+ src,
201
+ alt: alt || "",
202
+ style: {
203
+ display: "block",
204
+ objectFit: "cover",
205
+ width: typeof props.width === "number" ? `${props.width}px` : props.width,
206
+ height: typeof props.height === "number" ? `${props.height}px` : props.height,
207
+ borderRadius: typeof props.borderRadius === "number" ? `${props.borderRadius}px` : props.borderRadius,
208
+ position: props.position,
209
+ top: typeof props.top === "number" ? `${props.top}px` : props.top,
210
+ left: typeof props.left === "number" ? `${props.left}px` : props.left,
211
+ right: typeof props.right === "number" ? `${props.right}px` : props.right,
212
+ bottom: typeof props.bottom === "number" ? `${props.bottom}px` : props.bottom
213
+ }
214
+ }
215
+ );
216
+ }
217
+ return /* @__PURE__ */ jsx(
218
+ StyledBox,
219
+ {
220
+ ref,
221
+ elementType: as,
222
+ id,
223
+ type: as === "button" ? type || "button" : void 0,
224
+ disabled: as === "button" ? disabled : void 0,
225
+ onClick: onPress,
226
+ onKeyDown,
227
+ onKeyUp,
228
+ role,
229
+ "aria-label": ariaLabel,
230
+ "aria-labelledby": ariaLabelledBy,
231
+ "aria-current": ariaCurrent,
232
+ "aria-disabled": ariaDisabled,
233
+ "aria-busy": ariaBusy,
234
+ "aria-describedby": ariaDescribedBy,
235
+ "aria-expanded": ariaExpanded,
236
+ "aria-haspopup": ariaHasPopup,
237
+ "aria-pressed": ariaPressed,
238
+ "aria-controls": ariaControls,
239
+ "aria-live": ariaLive,
240
+ tabIndex: tabIndex !== void 0 ? tabIndex : void 0,
241
+ "data-testid": dataTestId || testID,
242
+ ...props,
243
+ children
244
+ }
245
+ );
246
+ }
247
+ );
248
+ Box.displayName = "Box";
249
+
250
+ // ../../foundation/primitives-web/src/Text.tsx
251
+ import styled2 from "styled-components";
252
+ import { jsx as jsx2 } from "react/jsx-runtime";
253
+ var FilteredSpan = createFilteredElement("span");
254
+ var StyledText = styled2(FilteredSpan)`
255
+ color: ${(props) => props.color || "inherit"};
256
+ font-size: ${(props) => typeof props.fontSize === "number" ? `${props.fontSize}px` : props.fontSize || "inherit"};
257
+ font-weight: ${(props) => props.fontWeight || "normal"};
258
+ font-family: ${(props) => props.fontFamily || '"Aktiv Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'};
259
+ line-height: ${(props) => typeof props.lineHeight === "number" ? `${props.lineHeight}px` : props.lineHeight || "inherit"};
260
+ white-space: ${(props) => props.whiteSpace || "normal"};
261
+ text-align: ${(props) => props.textAlign || "inherit"};
262
+ text-decoration: ${(props) => props.textDecoration || "none"};
263
+ `;
264
+ var Text = ({
265
+ style,
266
+ className,
267
+ id,
268
+ role,
269
+ numberOfLines: _numberOfLines,
270
+ ...props
271
+ }) => {
272
+ return /* @__PURE__ */ jsx2(
273
+ StyledText,
274
+ {
275
+ ...props,
276
+ style,
277
+ className,
278
+ id,
279
+ role
280
+ }
281
+ );
282
+ };
283
+
284
+ // ../../foundation/primitives-web/src/Icon.tsx
285
+ import styled3 from "styled-components";
286
+ import { jsx as jsx3 } from "react/jsx-runtime";
287
+ var FilteredDiv2 = createFilteredElement("div");
288
+ var StyledIcon = styled3(FilteredDiv2)`
289
+ display: flex;
290
+ align-items: center;
291
+ justify-content: center;
292
+ width: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
293
+ height: ${(props) => typeof props.size === "number" ? `${props.size}px` : props.size || "24px"};
294
+ color: ${(props) => props.color || "currentColor"};
295
+
296
+ svg {
297
+ width: 100%;
298
+ height: 100%;
299
+ fill: none;
300
+ stroke: currentColor;
301
+ }
302
+ `;
303
+ var Icon = ({ children, ...props }) => {
304
+ return /* @__PURE__ */ jsx3(StyledIcon, { ...props, children });
305
+ };
306
+
307
+ // src/Collapsible.tsx
308
+ import { useResolvedTheme } from "@xsolla/xui-core";
309
+ import { ChevronDown } from "@xsolla/xui-icons-base";
310
+ import { jsx as jsx4, jsxs } from "react/jsx-runtime";
311
+ var PANEL_TRANSITION = "grid-template-rows 280ms cubic-bezier(0.4, 0, 0.2, 1)";
312
+ var CHEVRON_TRANSITION = "transform 280ms cubic-bezier(0.4, 0, 0.2, 1)";
313
+ var Collapsible = forwardRef(
314
+ ({
315
+ title,
316
+ caption: captionProp,
317
+ icon,
318
+ trailing: trailingProp,
319
+ view = "without-surface",
320
+ open: openProp,
321
+ defaultOpen = false,
322
+ onOpenChange,
323
+ children,
324
+ className,
325
+ "aria-label": ariaLabel,
326
+ themeMode,
327
+ themeProductContext,
328
+ // deprecated aliases
329
+ onChange,
330
+ statusIcon,
331
+ description,
332
+ ...rest
333
+ }, ref) => {
334
+ const caption = captionProp ?? description;
335
+ const trailing = trailingProp ?? statusIcon;
336
+ const resolvedOnOpenChange = onOpenChange ?? onChange;
337
+ const panelIdRef = useRef();
338
+ if (!panelIdRef.current) {
339
+ panelIdRef.current = `collapsible-panel-${Math.random().toString(36).slice(2, 10)}`;
340
+ }
341
+ const panelId = panelIdRef.current;
342
+ const { theme } = useResolvedTheme({ themeMode, themeProductContext });
343
+ const sizing = theme.sizing.collapsibleB2b();
344
+ const isControlled = openProp !== void 0;
345
+ const [openState, setOpenState] = useState(defaultOpen);
346
+ const open = isControlled ? openProp : openState;
347
+ const handleToggle = useCallback(() => {
348
+ const next = !open;
349
+ if (!isControlled) setOpenState(next);
350
+ resolvedOnOpenChange?.(next);
351
+ }, [open, isControlled, resolvedOnOpenChange]);
352
+ const handleKeyDown = useCallback(
353
+ (e) => {
354
+ if (e.key === "Enter") {
355
+ e.preventDefault();
356
+ handleToggle();
357
+ } else if (e.key === " ") {
358
+ e.preventDefault();
359
+ }
360
+ },
361
+ [handleToggle]
362
+ );
363
+ const handleKeyUp = useCallback(
364
+ (e) => {
365
+ if (e.key === " ") {
366
+ e.preventDefault();
367
+ handleToggle();
368
+ }
369
+ },
370
+ [handleToggle]
371
+ );
372
+ const isWhite = view === "white-surface";
373
+ const isGrey = view === "grey-surface";
374
+ const isWithout = view === "without-surface";
375
+ const rootStyle = {
376
+ boxSizing: "border-box",
377
+ display: "flex",
378
+ flexDirection: "column",
379
+ overflow: "hidden",
380
+ backgroundColor: isWhite ? theme.colors.background.primary : isGrey ? theme.colors.overlay.mono : void 0,
381
+ borderRadius: !isWithout ? sizing.surfaceRadius : void 0,
382
+ borderBottom: isWithout ? `1px solid ${theme.colors.border.secondary}` : void 0
383
+ };
384
+ const cellStyle = {
385
+ boxSizing: "border-box",
386
+ display: "flex",
387
+ flexDirection: "row",
388
+ alignItems: "center",
389
+ gap: sizing.triggerGap,
390
+ width: "100%",
391
+ minHeight: isWithout ? sizing.triggerMinHeight : void 0,
392
+ padding: !isWithout ? sizing.triggerPadding : 0,
393
+ backgroundColor: isWhite ? theme.colors.background.primary : isGrey ? theme.colors.overlay.mono : void 0,
394
+ borderRadius: !isWithout ? open ? `${sizing.cellRadius}px ${sizing.cellRadius}px 0 0` : sizing.cellRadius : void 0,
395
+ borderBottom: open ? `1px solid ${theme.colors.border.secondary}` : void 0
396
+ };
397
+ const panelGridStyle = {
398
+ display: "grid",
399
+ gridTemplateRows: open ? "1fr" : "0fr",
400
+ transition: PANEL_TRANSITION,
401
+ width: "100%"
402
+ };
403
+ const panelInnerStyle = {
404
+ overflow: "hidden"
405
+ };
406
+ const panelContentStyle = {
407
+ boxSizing: "border-box",
408
+ width: "100%",
409
+ padding: sizing.panelPadding
410
+ };
411
+ return /* @__PURE__ */ jsxs(
412
+ Box,
413
+ {
414
+ ref,
415
+ "data-testid": "collapsible",
416
+ "data-open": open,
417
+ className,
418
+ width: "100%",
419
+ style: rootStyle,
420
+ ...rest,
421
+ children: [
422
+ /* @__PURE__ */ jsx4(
423
+ "div",
424
+ {
425
+ role: "button",
426
+ tabIndex: 0,
427
+ "aria-expanded": open,
428
+ "aria-controls": panelId,
429
+ "aria-label": ariaLabel ?? (typeof title === "string" ? title : void 0),
430
+ onClick: handleToggle,
431
+ onKeyDown: handleKeyDown,
432
+ onKeyUp: handleKeyUp,
433
+ style: { boxSizing: "border-box", width: "100%", cursor: "pointer" },
434
+ children: /* @__PURE__ */ jsxs("div", { style: cellStyle, children: [
435
+ icon && /* @__PURE__ */ jsx4(
436
+ "div",
437
+ {
438
+ onClick: (e) => e.stopPropagation(),
439
+ onKeyDown: (e) => e.stopPropagation(),
440
+ onKeyUp: (e) => e.stopPropagation(),
441
+ style: { flexShrink: 0, display: "flex", alignItems: "center" },
442
+ children: icon
443
+ }
444
+ ),
445
+ /* @__PURE__ */ jsxs(
446
+ "div",
447
+ {
448
+ style: {
449
+ flex: 1,
450
+ display: "flex",
451
+ flexDirection: "column",
452
+ alignItems: "flex-start",
453
+ gap: sizing.textGap,
454
+ minWidth: 0
455
+ },
456
+ children: [
457
+ typeof title === "string" || typeof title === "number" ? /* @__PURE__ */ jsx4(
458
+ Text,
459
+ {
460
+ color: theme.colors.content.primary,
461
+ fontSize: sizing.titleFontSize,
462
+ lineHeight: sizing.titleLineHeight,
463
+ fontWeight: "500",
464
+ children: title
465
+ }
466
+ ) : title,
467
+ caption !== void 0 && (typeof caption === "string" || typeof caption === "number" ? /* @__PURE__ */ jsx4(
468
+ Text,
469
+ {
470
+ color: theme.colors.content.tertiary,
471
+ fontSize: sizing.captionFontSize,
472
+ lineHeight: sizing.captionLineHeight,
473
+ fontWeight: "400",
474
+ children: caption
475
+ }
476
+ ) : caption)
477
+ ]
478
+ }
479
+ ),
480
+ /* @__PURE__ */ jsxs(
481
+ "div",
482
+ {
483
+ style: {
484
+ display: "flex",
485
+ flexDirection: "row",
486
+ alignItems: "center",
487
+ gap: sizing.trailingGap,
488
+ flexShrink: 0
489
+ },
490
+ children: [
491
+ trailing && /* @__PURE__ */ jsx4(
492
+ "div",
493
+ {
494
+ onClick: (e) => e.stopPropagation(),
495
+ onKeyDown: (e) => e.stopPropagation(),
496
+ onKeyUp: (e) => e.stopPropagation(),
497
+ style: { display: "flex", alignItems: "center" },
498
+ children: trailing
499
+ }
500
+ ),
501
+ /* @__PURE__ */ jsx4(
502
+ "div",
503
+ {
504
+ style: {
505
+ transform: open ? "rotate(180deg)" : "rotate(0deg)",
506
+ transition: CHEVRON_TRANSITION,
507
+ display: "flex",
508
+ alignItems: "center"
509
+ },
510
+ children: /* @__PURE__ */ jsx4(
511
+ Icon,
512
+ {
513
+ color: theme.colors.content.primary,
514
+ size: sizing.chevronSize,
515
+ children: /* @__PURE__ */ jsx4(ChevronDown, {})
516
+ }
517
+ )
518
+ }
519
+ )
520
+ ]
521
+ }
522
+ )
523
+ ] })
524
+ }
525
+ ),
526
+ /* @__PURE__ */ jsx4("div", { id: panelId, style: panelGridStyle, children: /* @__PURE__ */ jsx4("div", { style: panelInnerStyle, children: /* @__PURE__ */ jsx4("div", { style: panelContentStyle, children }) }) })
527
+ ]
528
+ }
529
+ );
530
+ }
531
+ );
532
+ Collapsible.displayName = "Collapsible";
533
+ export {
534
+ Collapsible
535
+ };
536
+ //# sourceMappingURL=index.mjs.map