@xsolla/xui-b2c-video-player 0.217.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.tsx","../../src/VideoPlayer.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"],"sourcesContent":["export { VideoPlayer, formatPlaybackTime } from \"./VideoPlayer\";\n\nexport type {\n VideoPlayerProps,\n VideoPlayerCurrencyReward,\n VideoPlayerLabelReward,\n VideoPlayerRewardChip,\n VideoPlayerRewardTone,\n VideoPlayerView,\n} from \"./types\";\n","import React, { useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme } from \"@xsolla/xui-core\";\nimport { IconButton } from \"@xsolla/xui-button\";\nimport { Slider } from \"@xsolla/xui-slider\";\nimport { Tag } from \"@xsolla/xui-tag\";\nimport { CurrencyTag } from \"@xsolla/xui-b2c-currency-tag\";\nimport { Typography } from \"@xsolla/xui-typography\";\nimport {\n ExitFullScreen,\n FullScreen,\n Pause,\n Play,\n VolumeMute,\n VolumeUp,\n} from \"@xsolla/xui-icons-base\";\nimport type {\n VideoPlayerCurrencyReward,\n VideoPlayerProps,\n VideoPlayerRewardChip,\n} from \"./types\";\n\n/** Height of the control bar, per Figma `VideoPlayer` (node 1923:9871). */\nconst CONTROL_BAR_HEIGHT = 64;\n\n/** Padding inside the bar. Figma `VideoPlayerBar` uses 12px, which is not on the spacing scale. */\nconst CONTROL_BAR_PADDING = 12;\n\n/** Gap between the reward row and the copy. Figma container gap is 12px. */\nconst HEADER_COPY_GAP = 12;\n\n/** Gap between mute and expand. Figma `Controls` gap is 12px. */\nconst SIDE_CONTROL_GAP = 12;\n\n/**\n * Light-mode success chips in this spec veil `background/success/primary`\n * (`#95ff80`) with 64% white. `Tag` paints the solid token, so the veil is\n * layered on top. Figma node `1738:8181`.\n */\nconst SUCCESS_REWARD_VEIL =\n \"linear-gradient(rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.64))\";\n\n/**\n * Figma `tag/sm` insets the label by `padding-x` (4) plus the text-container\n * `gap` (2). `Tag` only applies the outer 4px.\n */\nconst LABEL_REWARD_PADDING = 6;\n\nconst isCurrencyReward = (\n reward: VideoPlayerRewardChip\n): reward is VideoPlayerCurrencyReward => reward.kind === \"currency\";\n\n/**\n * Formats a position in seconds as `mm:ss`. Values past an hour keep counting\n * in minutes (`72:30`) rather than growing a third segment, matching the\n * fixed-width clock slot in the design.\n */\nexport const formatPlaybackTime = (seconds: number): string => {\n const safe =\n Number.isFinite(seconds) && seconds > 0 ? Math.floor(seconds) : 0;\n const minutes = Math.floor(safe / 60);\n const remainder = safe % 60;\n\n return `${String(minutes).padStart(2, \"0\")}:${String(remainder).padStart(\n 2,\n \"0\"\n )}`;\n};\n\n/**\n * B2C video player overlay chrome.\n *\n * This is **not** an HTML5 `<video>` wrapper — it renders the chrome that sits\n * on top of a video surface: optional reward chips (`Tag` and `CurrencyTag`),\n * title and description copy, and a control bar with play/pause, a seek\n * slider, the elapsed clock, mute, and expand/collapse.\n *\n * Spec: Figma `VideoPlayer` component set —\n * https://www.figma.com/design/SOOtaT80JAVJf7PKlFnt7Q/B2C-Components%E2%80%A8Xsolla-UI-Toolkit?node-id=1909-5990\n * (node `1923:9871`).\n */\nexport const VideoPlayer: React.FC<VideoPlayerProps> = ({\n view = \"full\",\n title,\n description,\n rewards,\n currentTime,\n duration = 0,\n playing,\n muted,\n expanded,\n disabled = false,\n onPlayPause,\n onMute,\n onExpand,\n onSeek,\n overlayThemeMode = \"dark\",\n \"aria-label\": ariaLabel = \"Video player\",\n testID,\n themeMode,\n themeProductContext = \"b2c\",\n}) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n const { theme: overlayTheme } = useResolvedTheme({\n themeMode: overlayThemeMode,\n themeProductContext,\n });\n\n const [internalTime, setInternalTime] = useState(currentTime ?? 0);\n const [internalPlaying, setInternalPlaying] = useState(playing ?? false);\n const [internalMuted, setInternalMuted] = useState(muted ?? false);\n const [internalExpanded, setInternalExpanded] = useState(expanded ?? false);\n\n const resolvedTime = currentTime ?? internalTime;\n const isPlaying = playing ?? internalPlaying;\n const isMuted = muted ?? internalMuted;\n const isExpanded = expanded ?? internalExpanded;\n\n const isCompact = view === \"compact\";\n const isSeekable = duration > 0;\n const overlayContentColor = overlayTheme.colors.content.static.light;\n const copyColor = theme.colors.content.static.light;\n\n const handleSeek = (next: number) => {\n setInternalTime(next);\n onSeek?.(next);\n };\n\n const handlePlayPause = () => {\n const next = !isPlaying;\n setInternalPlaying(next);\n onPlayPause?.(next);\n };\n\n const handleMute = () => {\n const next = !isMuted;\n setInternalMuted(next);\n onMute?.(next);\n };\n\n const handleExpand = () => {\n const next = !isExpanded;\n setInternalExpanded(next);\n onExpand?.(next);\n };\n\n const hasRewards = Boolean(rewards && rewards.length > 0);\n const hasCopy = Boolean(title || description);\n const showHeader = !isCompact && (hasRewards || hasCopy);\n\n const controlBar = (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n width=\"100%\"\n height={CONTROL_BAR_HEIGHT}\n gap={theme.spacing.lg}\n padding={CONTROL_BAR_PADDING}\n borderRadius={theme.shape.cell.borderRadius}\n backgroundColor={overlayTheme.colors.layer.scrim}\n style={{ backdropFilter: \"blur(8px)\", WebkitBackdropFilter: \"blur(8px)\" }}\n testID={testID ? `${testID}-controls` : \"video-player-controls\"}\n >\n <Box\n flex={1}\n minWidth={0}\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={theme.spacing.sm}\n >\n <IconButton\n variant=\"tertiary\"\n tone=\"mono\"\n size=\"xs\"\n themeMode={overlayThemeMode}\n themeProductContext={themeProductContext}\n disabled={disabled}\n icon={isPlaying ? <Pause /> : <Play />}\n aria-label={isPlaying ? \"Pause\" : \"Play\"}\n aria-pressed={isPlaying}\n onPress={handlePlayPause}\n testID={testID ? `${testID}-play-pause` : \"video-player-play-pause\"}\n />\n\n <Box flex={1} minWidth={0}>\n <Slider\n value={resolvedTime}\n min={0}\n max={isSeekable ? duration : 1}\n step={1}\n size=\"sm\"\n disabled={disabled || !isSeekable}\n onChange={handleSeek}\n aria-label=\"Seek\"\n themeMode={overlayThemeMode}\n themeProductContext={themeProductContext}\n testID={testID ? `${testID}-seek` : \"video-player-seek\"}\n />\n </Box>\n\n <Typography\n variant=\"bodySm\"\n color={overlayContentColor}\n productContext={themeProductContext}\n align=\"right\"\n noWrap\n testID={testID ? `${testID}-time` : \"video-player-time\"}\n >\n {formatPlaybackTime(resolvedTime)}\n </Typography>\n </Box>\n\n <Box flexDirection=\"row\" alignItems=\"center\" gap={SIDE_CONTROL_GAP}>\n <IconButton\n variant=\"tertiary\"\n tone=\"mono\"\n size=\"sm\"\n themeMode={overlayThemeMode}\n themeProductContext={themeProductContext}\n disabled={disabled}\n icon={isMuted ? <VolumeMute /> : <VolumeUp />}\n aria-label={isMuted ? \"Unmute\" : \"Mute\"}\n aria-pressed={isMuted}\n onPress={handleMute}\n testID={testID ? `${testID}-mute` : \"video-player-mute\"}\n />\n\n <IconButton\n variant=\"tertiary\"\n tone=\"mono\"\n size=\"sm\"\n themeMode={overlayThemeMode}\n themeProductContext={themeProductContext}\n disabled={disabled}\n icon={isExpanded ? <ExitFullScreen /> : <FullScreen />}\n aria-label={isExpanded ? \"Collapse\" : \"Expand\"}\n aria-pressed={isExpanded}\n onPress={handleExpand}\n testID={testID ? `${testID}-expand` : \"video-player-expand\"}\n />\n </Box>\n </Box>\n );\n\n return (\n <Box\n role=\"group\"\n aria-label={ariaLabel}\n flexDirection=\"column\"\n justifyContent=\"space-between\"\n width=\"100%\"\n gap={theme.spacing.lg}\n testID={testID || \"video-player\"}\n >\n {showHeader && (\n <Box flexDirection=\"column\" gap={HEADER_COPY_GAP}>\n {hasRewards && (\n <Box flexDirection=\"row\" alignItems=\"center\" gap={theme.spacing.xs}>\n {rewards?.map((reward) => {\n const rewardTestID = testID\n ? `${testID}-reward-${reward.key}`\n : `video-player-reward-${reward.key}`;\n\n if (isCurrencyReward(reward)) {\n return (\n <CurrencyTag\n key={reward.key}\n currency={reward.currency}\n value={reward.value}\n sublabel={reward.sublabel}\n size=\"sm\"\n themeProductContext={themeProductContext}\n testID={rewardTestID}\n />\n );\n }\n\n const tone = reward.tone ?? \"primary\";\n\n return (\n <Tag\n key={reward.key}\n size=\"sm\"\n tone={tone}\n iconLeft={reward.icon}\n /*\n * Reward chips are bound to the Light token set in Figma so\n * they keep their contrast against the video behind them.\n */\n themeMode=\"light\"\n themeProductContext={themeProductContext}\n style={{\n ...(reward.icon\n ? {}\n : {\n paddingLeft: LABEL_REWARD_PADDING,\n paddingRight: LABEL_REWARD_PADDING,\n }),\n ...(tone === \"success\"\n ? { backgroundImage: SUCCESS_REWARD_VEIL }\n : {}),\n }}\n testID={rewardTestID}\n >\n {reward.label}\n </Tag>\n );\n })}\n </Box>\n )}\n\n {hasCopy && (\n <Box flexDirection=\"column\">\n {title && (\n <Typography\n variant=\"bodyLgAccent\"\n color={copyColor}\n productContext={themeProductContext}\n noWrap\n >\n {title}\n </Typography>\n )}\n\n {description && (\n <Typography\n variant=\"bodySm\"\n color={copyColor}\n productContext={themeProductContext}\n noWrap\n style={{ opacity: 0.5 }}\n >\n {description}\n </Typography>\n )}\n </Box>\n )}\n </Box>\n )}\n\n {controlBar}\n </Box>\n );\n};\n\nVideoPlayer.displayName = \"VideoPlayer\";\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 /* Only emit overflow-x/y when explicitly set. Defaulting them to\n visible after overflow would override the shorthand and break\n clipping (e.g. OtherCard bottom-right promo image). */\n overflow: ${(props) => props.overflow || \"visible\"};\n ${(props) =>\n props.overflowX != null ? `overflow-x: ${props.overflowX};` : \"\"}\n ${(props) =>\n props.overflowY != null ? `overflow-y: ${props.overflowY};` : \"\"}\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) =>\n props.opacity != null ? props.opacity : props.disabled ? 0.5 : 1};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n /* \\`background\\` is emitted before \\`background-color\\` so a caller passing\n both still gets backgroundColor as the winner. Use the shorthand for a\n layered fill (e.g. an overlay tint over a resting surface colour), which\n a single background-color cannot express. */\n &:hover {\n ${(props) =>\n props.hoverStyle?.background &&\n `background: ${props.hoverStyle.background};`}\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?.background &&\n `background: ${props.pressStyle.background};`}\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 data-testid={dataTestId || testID}\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 \"opacity\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n // Cross-platform layout prop that Text consumes as CSS, never as an\n // attribute. Pinned explicitly because it is now spread into the styled\n // component rather than destructured away before it can reach the DOM.\n \"numberOfLines\",\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAgC;;;ACAhC,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;;;ACN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jsx_runtime"]}
package/web/index.mjs ADDED
@@ -0,0 +1,553 @@
1
+ // src/VideoPlayer.tsx
2
+ import { useState } 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
+ "opacity",
47
+ "cursor",
48
+ "fontSize",
49
+ "fontWeight",
50
+ "fontFamily",
51
+ "textDecoration",
52
+ // Cross-platform layout prop that Text consumes as CSS, never as an
53
+ // attribute. Pinned explicitly because it is now spread into the styled
54
+ // component rather than destructured away before it can reach the DOM.
55
+ "numberOfLines"
56
+ ]);
57
+ function shouldForwardProp(key) {
58
+ if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;
59
+ return is_prop_valid_esm_default(key);
60
+ }
61
+ function createFilteredElement(defaultTag) {
62
+ const Component = React.forwardRef(
63
+ ({ children, elementType, ...props }, ref) => {
64
+ const Tag2 = elementType || defaultTag;
65
+ const htmlProps = {};
66
+ for (const key of Object.keys(props)) {
67
+ if (shouldForwardProp(key)) {
68
+ htmlProps[key] = props[key];
69
+ }
70
+ }
71
+ return React.createElement(
72
+ Tag2,
73
+ { ref, ...htmlProps },
74
+ children
75
+ );
76
+ }
77
+ );
78
+ Component.displayName = `Filtered(${defaultTag})`;
79
+ return Component;
80
+ }
81
+
82
+ // ../../foundation/primitives-web/src/Box.tsx
83
+ import { jsx } from "react/jsx-runtime";
84
+ var FilteredDiv = createFilteredElement("div");
85
+ var StyledBox = styled(FilteredDiv)`
86
+ display: flex;
87
+ box-sizing: border-box;
88
+ background-color: ${(props) => props.backgroundColor || "transparent"};
89
+ border-color: ${(props) => props.borderColor || "transparent"};
90
+ border-width: ${(props) => typeof props.borderWidth === "number" ? `${props.borderWidth}px` : props.borderWidth || 0};
91
+
92
+ ${(props) => props.borderBottomWidth !== void 0 && `
93
+ border-bottom-width: ${typeof props.borderBottomWidth === "number" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};
94
+ border-bottom-color: ${props.borderBottomColor || props.borderColor || "transparent"};
95
+ border-bottom-style: solid;
96
+ `}
97
+ ${(props) => props.borderTopWidth !== void 0 && `
98
+ border-top-width: ${typeof props.borderTopWidth === "number" ? `${props.borderTopWidth}px` : props.borderTopWidth};
99
+ border-top-color: ${props.borderTopColor || props.borderColor || "transparent"};
100
+ border-top-style: solid;
101
+ `}
102
+ ${(props) => props.borderLeftWidth !== void 0 && `
103
+ border-left-width: ${typeof props.borderLeftWidth === "number" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};
104
+ border-left-color: ${props.borderLeftColor || props.borderColor || "transparent"};
105
+ border-left-style: solid;
106
+ `}
107
+ ${(props) => props.borderRightWidth !== void 0 && `
108
+ border-right-width: ${typeof props.borderRightWidth === "number" ? `${props.borderRightWidth}px` : props.borderRightWidth};
109
+ border-right-color: ${props.borderRightColor || props.borderColor || "transparent"};
110
+ border-right-style: solid;
111
+ `}
112
+
113
+ border-style: ${(props) => props.borderStyle || (props.borderWidth || props.borderBottomWidth || props.borderTopWidth || props.borderLeftWidth || props.borderRightWidth ? "solid" : "none")};
114
+ border-radius: ${(props) => typeof props.borderRadius === "number" ? `${props.borderRadius}px` : props.borderRadius || 0};
115
+ height: ${(props) => typeof props.height === "number" ? `${props.height}px` : props.height || "auto"};
116
+ width: ${(props) => typeof props.width === "number" ? `${props.width}px` : props.width || "auto"};
117
+ min-width: ${(props) => typeof props.minWidth === "number" ? `${props.minWidth}px` : props.minWidth || "auto"};
118
+ min-height: ${(props) => typeof props.minHeight === "number" ? `${props.minHeight}px` : props.minHeight || "auto"};
119
+ max-width: ${(props) => typeof props.maxWidth === "number" ? `${props.maxWidth}px` : props.maxWidth || "none"};
120
+ max-height: ${(props) => typeof props.maxHeight === "number" ? `${props.maxHeight}px` : props.maxHeight || "none"};
121
+
122
+ padding: ${(props) => typeof props.padding === "number" ? `${props.padding}px` : props.padding || 0};
123
+ ${(props) => props.paddingHorizontal && `
124
+ padding-left: ${typeof props.paddingHorizontal === "number" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};
125
+ padding-right: ${typeof props.paddingHorizontal === "number" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};
126
+ `}
127
+ ${(props) => props.paddingVertical && `
128
+ padding-top: ${typeof props.paddingVertical === "number" ? `${props.paddingVertical}px` : props.paddingVertical};
129
+ padding-bottom: ${typeof props.paddingVertical === "number" ? `${props.paddingVertical}px` : props.paddingVertical};
130
+ `}
131
+ ${(props) => props.paddingTop !== void 0 && `padding-top: ${typeof props.paddingTop === "number" ? `${props.paddingTop}px` : props.paddingTop};`}
132
+ ${(props) => props.paddingBottom !== void 0 && `padding-bottom: ${typeof props.paddingBottom === "number" ? `${props.paddingBottom}px` : props.paddingBottom};`}
133
+ ${(props) => props.paddingLeft !== void 0 && `padding-left: ${typeof props.paddingLeft === "number" ? `${props.paddingLeft}px` : props.paddingLeft};`}
134
+ ${(props) => props.paddingRight !== void 0 && `padding-right: ${typeof props.paddingRight === "number" ? `${props.paddingRight}px` : props.paddingRight};`}
135
+
136
+ margin: ${(props) => typeof props.margin === "number" ? `${props.margin}px` : props.margin || 0};
137
+ ${(props) => props.marginTop !== void 0 && `margin-top: ${typeof props.marginTop === "number" ? `${props.marginTop}px` : props.marginTop};`}
138
+ ${(props) => props.marginBottom !== void 0 && `margin-bottom: ${typeof props.marginBottom === "number" ? `${props.marginBottom}px` : props.marginBottom};`}
139
+ ${(props) => props.marginLeft !== void 0 && `margin-left: ${typeof props.marginLeft === "number" ? `${props.marginLeft}px` : props.marginLeft};`}
140
+ ${(props) => props.marginRight !== void 0 && `margin-right: ${typeof props.marginRight === "number" ? `${props.marginRight}px` : props.marginRight};`}
141
+
142
+ flex-direction: ${(props) => props.flexDirection || "column"};
143
+ flex-wrap: ${(props) => props.flexWrap || "nowrap"};
144
+ align-items: ${(props) => props.alignItems || "stretch"};
145
+ justify-content: ${(props) => props.justifyContent || "flex-start"};
146
+ cursor: ${(props) => props.cursor ? props.cursor : props.onClick || props.onPress ? "pointer" : "inherit"};
147
+ position: ${(props) => props.position || "static"};
148
+ top: ${(props) => typeof props.top === "number" ? `${props.top}px` : props.top};
149
+ bottom: ${(props) => typeof props.bottom === "number" ? `${props.bottom}px` : props.bottom};
150
+ left: ${(props) => typeof props.left === "number" ? `${props.left}px` : props.left};
151
+ right: ${(props) => typeof props.right === "number" ? `${props.right}px` : props.right};
152
+ flex: ${(props) => props.flex};
153
+ flex-shrink: ${(props) => props.flexShrink ?? 1};
154
+ gap: ${(props) => typeof props.gap === "number" ? `${props.gap}px` : props.gap || 0};
155
+ align-self: ${(props) => props.alignSelf || "auto"};
156
+ /* Only emit overflow-x/y when explicitly set. Defaulting them to
157
+ visible after overflow would override the shorthand and break
158
+ clipping (e.g. OtherCard bottom-right promo image). */
159
+ overflow: ${(props) => props.overflow || "visible"};
160
+ ${(props) => props.overflowX != null ? `overflow-x: ${props.overflowX};` : ""}
161
+ ${(props) => props.overflowY != null ? `overflow-y: ${props.overflowY};` : ""}
162
+ z-index: ${(props) => props.zIndex};
163
+ opacity: ${(props) => props.opacity != null ? props.opacity : props.disabled ? 0.5 : 1};
164
+ pointer-events: ${(props) => props.disabled ? "none" : "auto"};
165
+
166
+ /* \`background\` is emitted before \`background-color\` so a caller passing
167
+ both still gets backgroundColor as the winner. Use the shorthand for a
168
+ layered fill (e.g. an overlay tint over a resting surface colour), which
169
+ a single background-color cannot express. */
170
+ &:hover {
171
+ ${(props) => props.hoverStyle?.background && `background: ${props.hoverStyle.background};`}
172
+ ${(props) => props.hoverStyle?.backgroundColor && `background-color: ${props.hoverStyle.backgroundColor};`}
173
+ ${(props) => props.hoverStyle?.borderColor && `border-color: ${props.hoverStyle.borderColor};`}
174
+ }
175
+
176
+ &:active {
177
+ ${(props) => props.pressStyle?.background && `background: ${props.pressStyle.background};`}
178
+ ${(props) => props.pressStyle?.backgroundColor && `background-color: ${props.pressStyle.backgroundColor};`}
179
+ }
180
+ `;
181
+ var Box = React2.forwardRef(
182
+ ({
183
+ children,
184
+ onPress,
185
+ onKeyDown,
186
+ onKeyUp,
187
+ role,
188
+ "aria-label": ariaLabel,
189
+ "aria-labelledby": ariaLabelledBy,
190
+ "aria-current": ariaCurrent,
191
+ "aria-disabled": ariaDisabled,
192
+ "aria-live": ariaLive,
193
+ "aria-busy": ariaBusy,
194
+ "aria-describedby": ariaDescribedBy,
195
+ "aria-expanded": ariaExpanded,
196
+ "aria-haspopup": ariaHasPopup,
197
+ "aria-pressed": ariaPressed,
198
+ "aria-controls": ariaControls,
199
+ tabIndex,
200
+ as,
201
+ src,
202
+ alt,
203
+ onError,
204
+ onLoad,
205
+ type,
206
+ disabled,
207
+ id,
208
+ testID,
209
+ "data-testid": dataTestId,
210
+ ...props
211
+ }, ref) => {
212
+ if (as === "img" && src) {
213
+ return /* @__PURE__ */ jsx(
214
+ "img",
215
+ {
216
+ src,
217
+ alt: alt || "",
218
+ onError,
219
+ onLoad,
220
+ "data-testid": dataTestId || testID,
221
+ style: {
222
+ display: "block",
223
+ objectFit: "cover",
224
+ width: typeof props.width === "number" ? `${props.width}px` : props.width,
225
+ height: typeof props.height === "number" ? `${props.height}px` : props.height,
226
+ borderRadius: typeof props.borderRadius === "number" ? `${props.borderRadius}px` : props.borderRadius,
227
+ position: props.position,
228
+ top: typeof props.top === "number" ? `${props.top}px` : props.top,
229
+ left: typeof props.left === "number" ? `${props.left}px` : props.left,
230
+ right: typeof props.right === "number" ? `${props.right}px` : props.right,
231
+ bottom: typeof props.bottom === "number" ? `${props.bottom}px` : props.bottom,
232
+ ...props.style
233
+ }
234
+ }
235
+ );
236
+ }
237
+ return /* @__PURE__ */ jsx(
238
+ StyledBox,
239
+ {
240
+ ref,
241
+ elementType: as,
242
+ id,
243
+ type: as === "button" ? type || "button" : void 0,
244
+ disabled: as === "button" ? disabled : void 0,
245
+ onClick: onPress,
246
+ onKeyDown,
247
+ onKeyUp,
248
+ role,
249
+ "aria-label": ariaLabel,
250
+ "aria-labelledby": ariaLabelledBy,
251
+ "aria-current": ariaCurrent,
252
+ "aria-disabled": ariaDisabled,
253
+ "aria-busy": ariaBusy,
254
+ "aria-describedby": ariaDescribedBy,
255
+ "aria-expanded": ariaExpanded,
256
+ "aria-haspopup": ariaHasPopup,
257
+ "aria-pressed": ariaPressed,
258
+ "aria-controls": ariaControls,
259
+ "aria-live": ariaLive,
260
+ tabIndex: tabIndex !== void 0 ? tabIndex : void 0,
261
+ "data-testid": dataTestId || testID,
262
+ ...props,
263
+ children
264
+ }
265
+ );
266
+ }
267
+ );
268
+ Box.displayName = "Box";
269
+
270
+ // src/VideoPlayer.tsx
271
+ import { useResolvedTheme } from "@xsolla/xui-core";
272
+ import { IconButton } from "@xsolla/xui-button";
273
+ import { Slider } from "@xsolla/xui-slider";
274
+ import { Tag } from "@xsolla/xui-tag";
275
+ import { CurrencyTag } from "@xsolla/xui-b2c-currency-tag";
276
+ import { Typography } from "@xsolla/xui-typography";
277
+ import {
278
+ ExitFullScreen,
279
+ FullScreen,
280
+ Pause,
281
+ Play,
282
+ VolumeMute,
283
+ VolumeUp
284
+ } from "@xsolla/xui-icons-base";
285
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
286
+ var CONTROL_BAR_HEIGHT = 64;
287
+ var CONTROL_BAR_PADDING = 12;
288
+ var HEADER_COPY_GAP = 12;
289
+ var SIDE_CONTROL_GAP = 12;
290
+ var SUCCESS_REWARD_VEIL = "linear-gradient(rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.64))";
291
+ var LABEL_REWARD_PADDING = 6;
292
+ var isCurrencyReward = (reward) => reward.kind === "currency";
293
+ var formatPlaybackTime = (seconds) => {
294
+ const safe = Number.isFinite(seconds) && seconds > 0 ? Math.floor(seconds) : 0;
295
+ const minutes = Math.floor(safe / 60);
296
+ const remainder = safe % 60;
297
+ return `${String(minutes).padStart(2, "0")}:${String(remainder).padStart(
298
+ 2,
299
+ "0"
300
+ )}`;
301
+ };
302
+ var VideoPlayer = ({
303
+ view = "full",
304
+ title,
305
+ description,
306
+ rewards,
307
+ currentTime,
308
+ duration = 0,
309
+ playing,
310
+ muted,
311
+ expanded,
312
+ disabled = false,
313
+ onPlayPause,
314
+ onMute,
315
+ onExpand,
316
+ onSeek,
317
+ overlayThemeMode = "dark",
318
+ "aria-label": ariaLabel = "Video player",
319
+ testID,
320
+ themeMode,
321
+ themeProductContext = "b2c"
322
+ }) => {
323
+ const { theme } = useResolvedTheme({ themeMode, themeProductContext });
324
+ const { theme: overlayTheme } = useResolvedTheme({
325
+ themeMode: overlayThemeMode,
326
+ themeProductContext
327
+ });
328
+ const [internalTime, setInternalTime] = useState(currentTime ?? 0);
329
+ const [internalPlaying, setInternalPlaying] = useState(playing ?? false);
330
+ const [internalMuted, setInternalMuted] = useState(muted ?? false);
331
+ const [internalExpanded, setInternalExpanded] = useState(expanded ?? false);
332
+ const resolvedTime = currentTime ?? internalTime;
333
+ const isPlaying = playing ?? internalPlaying;
334
+ const isMuted = muted ?? internalMuted;
335
+ const isExpanded = expanded ?? internalExpanded;
336
+ const isCompact = view === "compact";
337
+ const isSeekable = duration > 0;
338
+ const overlayContentColor = overlayTheme.colors.content.static.light;
339
+ const copyColor = theme.colors.content.static.light;
340
+ const handleSeek = (next) => {
341
+ setInternalTime(next);
342
+ onSeek?.(next);
343
+ };
344
+ const handlePlayPause = () => {
345
+ const next = !isPlaying;
346
+ setInternalPlaying(next);
347
+ onPlayPause?.(next);
348
+ };
349
+ const handleMute = () => {
350
+ const next = !isMuted;
351
+ setInternalMuted(next);
352
+ onMute?.(next);
353
+ };
354
+ const handleExpand = () => {
355
+ const next = !isExpanded;
356
+ setInternalExpanded(next);
357
+ onExpand?.(next);
358
+ };
359
+ const hasRewards = Boolean(rewards && rewards.length > 0);
360
+ const hasCopy = Boolean(title || description);
361
+ const showHeader = !isCompact && (hasRewards || hasCopy);
362
+ const controlBar = /* @__PURE__ */ jsxs(
363
+ Box,
364
+ {
365
+ flexDirection: "row",
366
+ alignItems: "center",
367
+ width: "100%",
368
+ height: CONTROL_BAR_HEIGHT,
369
+ gap: theme.spacing.lg,
370
+ padding: CONTROL_BAR_PADDING,
371
+ borderRadius: theme.shape.cell.borderRadius,
372
+ backgroundColor: overlayTheme.colors.layer.scrim,
373
+ style: { backdropFilter: "blur(8px)", WebkitBackdropFilter: "blur(8px)" },
374
+ testID: testID ? `${testID}-controls` : "video-player-controls",
375
+ children: [
376
+ /* @__PURE__ */ jsxs(
377
+ Box,
378
+ {
379
+ flex: 1,
380
+ minWidth: 0,
381
+ flexDirection: "row",
382
+ alignItems: "center",
383
+ gap: theme.spacing.sm,
384
+ children: [
385
+ /* @__PURE__ */ jsx2(
386
+ IconButton,
387
+ {
388
+ variant: "tertiary",
389
+ tone: "mono",
390
+ size: "xs",
391
+ themeMode: overlayThemeMode,
392
+ themeProductContext,
393
+ disabled,
394
+ icon: isPlaying ? /* @__PURE__ */ jsx2(Pause, {}) : /* @__PURE__ */ jsx2(Play, {}),
395
+ "aria-label": isPlaying ? "Pause" : "Play",
396
+ "aria-pressed": isPlaying,
397
+ onPress: handlePlayPause,
398
+ testID: testID ? `${testID}-play-pause` : "video-player-play-pause"
399
+ }
400
+ ),
401
+ /* @__PURE__ */ jsx2(Box, { flex: 1, minWidth: 0, children: /* @__PURE__ */ jsx2(
402
+ Slider,
403
+ {
404
+ value: resolvedTime,
405
+ min: 0,
406
+ max: isSeekable ? duration : 1,
407
+ step: 1,
408
+ size: "sm",
409
+ disabled: disabled || !isSeekable,
410
+ onChange: handleSeek,
411
+ "aria-label": "Seek",
412
+ themeMode: overlayThemeMode,
413
+ themeProductContext,
414
+ testID: testID ? `${testID}-seek` : "video-player-seek"
415
+ }
416
+ ) }),
417
+ /* @__PURE__ */ jsx2(
418
+ Typography,
419
+ {
420
+ variant: "bodySm",
421
+ color: overlayContentColor,
422
+ productContext: themeProductContext,
423
+ align: "right",
424
+ noWrap: true,
425
+ testID: testID ? `${testID}-time` : "video-player-time",
426
+ children: formatPlaybackTime(resolvedTime)
427
+ }
428
+ )
429
+ ]
430
+ }
431
+ ),
432
+ /* @__PURE__ */ jsxs(Box, { flexDirection: "row", alignItems: "center", gap: SIDE_CONTROL_GAP, children: [
433
+ /* @__PURE__ */ jsx2(
434
+ IconButton,
435
+ {
436
+ variant: "tertiary",
437
+ tone: "mono",
438
+ size: "sm",
439
+ themeMode: overlayThemeMode,
440
+ themeProductContext,
441
+ disabled,
442
+ icon: isMuted ? /* @__PURE__ */ jsx2(VolumeMute, {}) : /* @__PURE__ */ jsx2(VolumeUp, {}),
443
+ "aria-label": isMuted ? "Unmute" : "Mute",
444
+ "aria-pressed": isMuted,
445
+ onPress: handleMute,
446
+ testID: testID ? `${testID}-mute` : "video-player-mute"
447
+ }
448
+ ),
449
+ /* @__PURE__ */ jsx2(
450
+ IconButton,
451
+ {
452
+ variant: "tertiary",
453
+ tone: "mono",
454
+ size: "sm",
455
+ themeMode: overlayThemeMode,
456
+ themeProductContext,
457
+ disabled,
458
+ icon: isExpanded ? /* @__PURE__ */ jsx2(ExitFullScreen, {}) : /* @__PURE__ */ jsx2(FullScreen, {}),
459
+ "aria-label": isExpanded ? "Collapse" : "Expand",
460
+ "aria-pressed": isExpanded,
461
+ onPress: handleExpand,
462
+ testID: testID ? `${testID}-expand` : "video-player-expand"
463
+ }
464
+ )
465
+ ] })
466
+ ]
467
+ }
468
+ );
469
+ return /* @__PURE__ */ jsxs(
470
+ Box,
471
+ {
472
+ role: "group",
473
+ "aria-label": ariaLabel,
474
+ flexDirection: "column",
475
+ justifyContent: "space-between",
476
+ width: "100%",
477
+ gap: theme.spacing.lg,
478
+ testID: testID || "video-player",
479
+ children: [
480
+ showHeader && /* @__PURE__ */ jsxs(Box, { flexDirection: "column", gap: HEADER_COPY_GAP, children: [
481
+ hasRewards && /* @__PURE__ */ jsx2(Box, { flexDirection: "row", alignItems: "center", gap: theme.spacing.xs, children: rewards?.map((reward) => {
482
+ const rewardTestID = testID ? `${testID}-reward-${reward.key}` : `video-player-reward-${reward.key}`;
483
+ if (isCurrencyReward(reward)) {
484
+ return /* @__PURE__ */ jsx2(
485
+ CurrencyTag,
486
+ {
487
+ currency: reward.currency,
488
+ value: reward.value,
489
+ sublabel: reward.sublabel,
490
+ size: "sm",
491
+ themeProductContext,
492
+ testID: rewardTestID
493
+ },
494
+ reward.key
495
+ );
496
+ }
497
+ const tone = reward.tone ?? "primary";
498
+ return /* @__PURE__ */ jsx2(
499
+ Tag,
500
+ {
501
+ size: "sm",
502
+ tone,
503
+ iconLeft: reward.icon,
504
+ themeMode: "light",
505
+ themeProductContext,
506
+ style: {
507
+ ...reward.icon ? {} : {
508
+ paddingLeft: LABEL_REWARD_PADDING,
509
+ paddingRight: LABEL_REWARD_PADDING
510
+ },
511
+ ...tone === "success" ? { backgroundImage: SUCCESS_REWARD_VEIL } : {}
512
+ },
513
+ testID: rewardTestID,
514
+ children: reward.label
515
+ },
516
+ reward.key
517
+ );
518
+ }) }),
519
+ hasCopy && /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
520
+ title && /* @__PURE__ */ jsx2(
521
+ Typography,
522
+ {
523
+ variant: "bodyLgAccent",
524
+ color: copyColor,
525
+ productContext: themeProductContext,
526
+ noWrap: true,
527
+ children: title
528
+ }
529
+ ),
530
+ description && /* @__PURE__ */ jsx2(
531
+ Typography,
532
+ {
533
+ variant: "bodySm",
534
+ color: copyColor,
535
+ productContext: themeProductContext,
536
+ noWrap: true,
537
+ style: { opacity: 0.5 },
538
+ children: description
539
+ }
540
+ )
541
+ ] })
542
+ ] }),
543
+ controlBar
544
+ ]
545
+ }
546
+ );
547
+ };
548
+ VideoPlayer.displayName = "VideoPlayer";
549
+ export {
550
+ VideoPlayer,
551
+ formatPlaybackTime
552
+ };
553
+ //# sourceMappingURL=index.mjs.map