@xsolla/xui-counter 0.201.5 → 0.202.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.
package/native/index.js CHANGED
@@ -122,6 +122,7 @@ var Box = ({
122
122
  flexShrink,
123
123
  gap,
124
124
  overflow,
125
+ opacity,
125
126
  zIndex,
126
127
  hoverStyle,
127
128
  pressStyle,
@@ -149,6 +150,7 @@ var Box = ({
149
150
  borderRadius,
150
151
  borderStyle,
151
152
  overflow,
153
+ opacity: opacity ?? (disabled ? 0.5 : void 0),
152
154
  zIndex,
153
155
  height,
154
156
  width,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.tsx","../../src/Counter.tsx","../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/Text.tsx","../../../../foundation/primitives-native/src/Icon.tsx","../../../../foundation/primitives-native/src/index.tsx","../../src/utils.ts"],"sourcesContent":["export { Counter } from \"./Counter\";\nexport type { CounterProps, CounterType } from \"./types\";\n","import React, { forwardRef, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon, isWeb } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme, useId } from \"@xsolla/xui-core\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { MinusSq, PlusSq } from \"@xsolla/xui-icons-base\";\nimport type { CounterProps } from \"./types\";\nimport {\n COUNTER_SIZE_CONFIG,\n allowsNegative,\n clampToRange,\n parseCounterValue,\n sanitizeCounterInput,\n} from \"./utils\";\n\ninterface CounterButtonProps {\n icon: React.ReactNode;\n label: string;\n onPress: () => void;\n available: boolean;\n boxSize: number;\n borderRadius: number;\n color: string;\n hoverColor: string;\n testID?: string;\n}\n\nconst CounterButton: React.FC<CounterButtonProps> = ({\n icon,\n label,\n onPress,\n available,\n boxSize,\n borderRadius,\n color,\n hoverColor,\n testID,\n}) => (\n <Box\n as=\"button\"\n type=\"button\"\n width={boxSize}\n height={boxSize}\n flexShrink={0}\n alignItems=\"center\"\n justifyContent=\"center\"\n padding={0}\n borderWidth={0}\n borderRadius={borderRadius}\n backgroundColor=\"transparent\"\n cursor={available ? \"pointer\" : \"not-allowed\"}\n disabled={!available}\n aria-disabled={!available || undefined}\n aria-label={label}\n // Keep a stable Pressable host on native even when unavailable so the\n // control stays in the a11y tree with a disabled state.\n onPress={onPress}\n hoverStyle={available ? { backgroundColor: hoverColor } : undefined}\n // Keep focus in the field so a click does not commit-then-step.\n {...(isWeb && {\n onMouseDown: (e: React.MouseEvent<HTMLButtonElement>) =>\n e.preventDefault(),\n })}\n data-testid={testID}\n testID={testID}\n >\n <Icon size={boxSize} color={color}>\n {icon}\n </Icon>\n </Box>\n);\n\n/**\n * A numeric stepper that lets the user increase or decrease a value using\n * dedicated − and + buttons.\n *\n * Counter has no error state: values outside the allowed range are never\n * rejected, they are silently clamped to the nearest bound on commit, so the\n * component is always in a valid state.\n */\nexport const Counter = forwardRef<HTMLInputElement, CounterProps>(\n (\n {\n value,\n defaultValue = null,\n onChange,\n min,\n max,\n step = 1,\n size = \"md\",\n type = \"input\",\n disabled = false,\n label,\n \"aria-label\": ariaLabel,\n decrementLabel = \"Decrease quantity\",\n incrementLabel = \"Increase quantity\",\n name,\n id: providedId,\n testID,\n themeMode,\n themeProductContext,\n },\n ref\n ) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n\n const rawId = useId();\n const safeId = rawId.replace(/:/g, \"\");\n const counterId = providedId || `counter-${safeId}`;\n\n const isControlled = value !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState<number | null>(\n defaultValue\n );\n const committedValue = isControlled ? (value ?? null) : uncontrolledValue;\n\n // Text held while the user is mid-entry. `null` means \"show the committed\n // value\" — typing is never committed keystroke-by-keystroke.\n const [draft, setDraft] = useState<string | null>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n\n React.useImperativeHandle(\n ref,\n () => inputRef.current as HTMLInputElement,\n []\n );\n\n const sizeConfig = COUNTER_SIZE_CONFIG[size];\n const inputSizing = theme.sizing.input(size);\n const isReadOnly = type === \"readOnly\";\n\n // The value the buttons step from: an uncommitted draft wins over the last\n // committed value so typing 7 then pressing + lands on 8, not oldValue + 1.\n const pendingValue =\n draft !== null ? parseCounterValue(draft) : committedValue;\n const stepBase = pendingValue ?? min ?? 0;\n\n const canDecrement =\n !disabled && (typeof min !== \"number\" || stepBase > min);\n const canIncrement =\n !disabled && (typeof max !== \"number\" || stepBase < max);\n\n const commit = (next: number | null) => {\n setDraft(null);\n // An empty field on commit restores the previous value — the counter is\n // never left in an empty, indeterminate state after commit.\n const resolved = next ?? committedValue;\n if (resolved === null) return;\n const clamped = clampToRange(resolved, min, max);\n if (!isControlled) setUncontrolledValue(clamped);\n if (clamped !== committedValue) onChange?.(clamped);\n };\n\n const stepBy = (direction: 1 | -1) => {\n commit(clampToRange(stepBase + direction * step, min, max));\n };\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setDraft(sanitizeCounterInput(e.target.value, allowsNegative(min)));\n };\n\n const handleBlur = () => {\n commit(draft !== null ? parseCounterValue(draft) : committedValue);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"ArrowUp\") {\n e.preventDefault();\n if (canIncrement) stepBy(1);\n return;\n }\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n if (canDecrement) stepBy(-1);\n return;\n }\n if (e.key === \"Home\" && typeof min === \"number\") {\n e.preventDefault();\n commit(min);\n return;\n }\n if (e.key === \"End\" && typeof max === \"number\") {\n e.preventDefault();\n commit(max);\n return;\n }\n // Native TextInput reports Return as \"Enter\" or \"\\n\" via onKeyPress.\n if (e.key === \"Enter\" || e.key === \"\\n\") {\n e.preventDefault();\n commit(draft !== null ? parseCounterValue(draft) : committedValue);\n }\n };\n\n const enabledIconColor = theme.colors.content.secondary;\n const disabledIconColor = theme.colors.control.text.disable;\n const hoverColor = theme.colors.overlay.mono;\n const buttonRadius = theme.shape.input[size].borderRadius;\n\n const decrementButton = (\n <CounterButton\n icon={<MinusSq />}\n label={decrementLabel}\n onPress={() => {\n if (canDecrement) stepBy(-1);\n }}\n available={canDecrement}\n boxSize={sizeConfig.control}\n borderRadius={buttonRadius}\n color={canDecrement ? enabledIconColor : disabledIconColor}\n hoverColor={hoverColor}\n testID={testID ? `${testID}__decrement` : undefined}\n />\n );\n\n const incrementButton = (\n <CounterButton\n icon={<PlusSq />}\n label={incrementLabel}\n onPress={() => {\n if (canIncrement) stepBy(1);\n }}\n available={canIncrement}\n boxSize={sizeConfig.control}\n borderRadius={buttonRadius}\n color={canIncrement ? enabledIconColor : disabledIconColor}\n hoverColor={hoverColor}\n testID={testID ? `${testID}__increment` : undefined}\n />\n );\n\n // Label sits above the whole control row (buttons + value), never inside\n // the Input between the buttons — that would push − / + off the field's\n // vertical center (Figma Counter has no in-component label; labels come\n // from FieldGroup / adjacent text, or this convenience prop).\n const labelId = `${counterId}-label`;\n const showLabel = Boolean(label) && !isReadOnly;\n const labelNode = showLabel ? (\n <Box as=\"label\" id={labelId}>\n <Text\n color={theme.colors.content.secondary}\n fontSize={inputSizing.fontSize - 2}\n fontWeight=\"500\"\n >\n {label}\n </Text>\n </Box>\n ) : null;\n\n if (isReadOnly) {\n // Read-only renders the value as plain text, never as a disabled or\n // `readonly` input — both would tell assistive technology the value\n // cannot change, which is false: the buttons still change it.\n const readOnlyValue = String(committedValue ?? min ?? 0);\n return (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={sizeConfig.gap}\n width={sizeConfig.readOnlyWidth}\n role=\"group\"\n aria-label={ariaLabel || label}\n aria-disabled={disabled || undefined}\n data-testid={testID}\n >\n {decrementButton}\n <Box flex={1} minWidth={0} aria-live=\"polite\" alignItems=\"center\">\n <Text\n color={\n disabled\n ? theme.colors.control.input.textDisable\n : theme.colors.control.input.text\n }\n fontSize={inputSizing.fontSize}\n lineHeight={inputSizing.fontSize + 2}\n textAlign=\"center\"\n data-testid={testID ? `${testID}__value` : undefined}\n >\n {readOnlyValue}\n </Text>\n </Box>\n {incrementButton}\n </Box>\n );\n }\n\n const displayValue =\n draft !== null\n ? draft\n : committedValue === null\n ? \"\"\n : String(committedValue);\n\n return (\n <Box\n flexDirection=\"column\"\n gap={inputSizing.fieldGap}\n alignItems=\"flex-start\"\n role=\"group\"\n aria-label={showLabel ? undefined : ariaLabel}\n aria-labelledby={showLabel ? labelId : undefined}\n aria-disabled={disabled || undefined}\n data-testid={testID}\n >\n {labelNode}\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={sizeConfig.gap}\n width={sizeConfig.inputWidth}\n >\n {decrementButton}\n <Box flex={1} minWidth={0}>\n <Input\n ref={inputRef}\n id={counterId}\n name={name}\n size={size}\n value={displayValue}\n disabled={disabled}\n onChange={handleInputChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n // `type=\"text\"` + `inputMode=\"numeric\"`, not `type=\"number\"`,\n // which would add the browser's own spinners next to ours.\n type=\"text\"\n inputMode=\"numeric\"\n role=\"spinbutton\"\n aria-valuenow={committedValue ?? undefined}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-label={showLabel ? undefined : ariaLabel}\n {...(showLabel ? { \"aria-labelledby\": labelId } : {})}\n // Figma centers the value in the compact field.\n style={{ textAlign: \"center\" }}\n themeMode={themeMode}\n themeProductContext={themeProductContext}\n testID={testID ? `${testID}__input` : undefined}\n />\n </Box>\n {incrementButton}\n </Box>\n </Box>\n );\n }\n);\n\nCounter.displayName = \"Counter\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n AccessibilityRole,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleToAccessibilityRole: Record<string, AccessibilityRole> = {\n button: \"button\",\n link: \"link\",\n img: \"image\",\n image: \"image\",\n summary: \"summary\",\n switch: \"switch\",\n checkbox: \"checkbox\",\n radio: \"radio\",\n heading: \"header\",\n text: \"text\",\n search: \"search\",\n alert: \"alert\",\n none: \"none\",\n presentation: \"none\",\n progressbar: \"progressbar\",\n scrollbar: \"scrollbar\",\n adjustable: \"adjustable\",\n tab: \"tab\",\n menu: \"menu\",\n menuitem: \"menuitem\",\n list: \"list\",\n timer: \"timer\",\n};\n\n/** RN ViewStyle.gap is typed as number (Yoga gap), not DimensionValue. */\nconst toGapValue = (gap: number | string | undefined): number | undefined => {\n if (gap === undefined) return undefined;\n if (typeof gap === \"number\") return gap;\n const pxMatch = /^(\\d+(?:\\.\\d+)?)px$/.exec(gap);\n if (pxMatch) return Number(pxMatch[1]);\n const asNumber = Number(gap);\n return Number.isFinite(asNumber) ? asNumber : undefined;\n};\n\nexport const Box: React.FC<BoxProps> = ({\n children,\n onPress,\n onLayout,\n onMoveShouldSetResponder,\n onResponderGrant,\n onResponderMove,\n onResponderRelease,\n onResponderTerminate,\n backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius,\n borderStyle,\n height,\n padding,\n paddingHorizontal,\n paddingVertical,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n flexShrink,\n gap,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n disabled,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n minWidth: minWidth as DimensionValue,\n minHeight: minHeight as DimensionValue,\n maxWidth: maxWidth as DimensionValue,\n maxHeight: maxHeight as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n flexShrink,\n gap: toGapValue(gap),\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Map web a11y props; drop the rest of the web-only attributes before\n // spreading onto RN hosts (unknown props warn at runtime).\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\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 className,\n \"data-testid\": _dataTestId,\n cursor: _cursor,\n type: _type,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n const accessibilityRole =\n (typeof role === \"string\" && roleToAccessibilityRole[role]) ||\n (as === \"button\" ? \"button\" : undefined);\n const isDisabled = Boolean(disabled || ariaDisabled);\n const accessibilityState = {\n disabled: isDisabled || undefined,\n busy: Boolean(ariaBusy) || undefined,\n };\n const accessibilityLiveRegion =\n ariaLive === \"polite\" || ariaLive === \"assertive\" ? ariaLive : undefined;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : alt}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n // Prefer Pressable whenever the node is interactive or explicitly a button,\n // so disabled / aria-disabled controls stay in the a11y tree as buttons.\n if (onPress || as === \"button\") {\n return (\n <Pressable\n onPress={!isDisabled && onPress ? onPress : undefined}\n disabled={isDisabled}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={\n typeof ariaLabel === \"string\" ? ariaLabel : undefined\n }\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : undefined}\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: TextStyle = {\n color: color ?? incomingStyle?.color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={dataTestId || testID || id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\n};\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Icon: React.FC<IconProps> = ({\n children,\n color,\n size,\n testID,\n \"data-testid\": dataTestId,\n}) => {\n const style: ViewStyle = {\n width: typeof size === \"number\" ? size : undefined,\n height: typeof size === \"number\" ? size : undefined,\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n\n // On native, we try to pass the color down to children (like Text primitives)\n // to mimic the CSS inheritance behavior of the web version.\n const childrenWithProps = React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n return React.cloneElement(child, {\n color: child.props.color || color,\n // Also pass size if child seems to be an icon that needs it\n size: child.props.size || size,\n });\n }\n return child;\n });\n\n return (\n <View style={style} testID={dataTestId || testID}>\n {childrenWithProps}\n </View>\n );\n};\n","export * from \"./Box\";\nexport * from \"./Text\";\nexport * from \"./Spinner\";\nexport * from \"./Icon\";\nexport * from \"./Divider\";\nexport * from \"./Input\";\nexport * from \"./TextArea\";\nexport * from \"./LinearGradient\";\n\nexport const isWeb = false;\nexport const isNative = true;\n","/**\n * Per-size geometry taken from the Figma \"Counter\" component set.\n *\n * `control` is the square box of the − / + buttons; `gap` is the spacing\n * between the three elements. `inputWidth` / `readOnlyWidth` are the full\n * control widths from Figma (buttons + gaps + value). Field height, radius,\n * and font size come from `theme.sizing.input(size)` / `theme.shape.input[size]`\n * because the middle of a `type=\"input\"` Counter is a standard Input.\n */\nexport const COUNTER_SIZE_CONFIG = {\n xl: { control: 28, gap: 10, inputWidth: 149, readOnlyWidth: 100 },\n lg: { control: 24, gap: 10, inputWidth: 142, readOnlyWidth: 90 },\n md: { control: 24, gap: 8, inputWidth: 132, readOnlyWidth: 83 },\n sm: { control: 18, gap: 8, inputWidth: 92, readOnlyWidth: 69 },\n xs: { control: 16, gap: 6, inputWidth: 82, readOnlyWidth: 59 },\n} as const;\n\n/**\n * Rounds `value` into `[min, max]`. A value above the maximum is rounded down\n * to the maximum, and a value below the minimum is rounded up to the minimum.\n * Missing bounds are unbounded on that side.\n */\nexport const clampToRange = (\n value: number,\n min?: number,\n max?: number\n): number => {\n let next = value;\n if (typeof min === \"number\" && next < min) next = min;\n if (typeof max === \"number\" && next > max) next = max;\n return next;\n};\n\n/**\n * Strips everything that cannot be part of an integer from typed input.\n * Non-numeric characters are rejected silently rather than flagged — Counter\n * has no error state. A single leading `-` survives only when negatives are\n * allowed.\n */\nexport const sanitizeCounterInput = (\n raw: string,\n allowNegative: boolean\n): string => {\n const digitsAndSigns = raw.replace(/[^\\d-]/g, \"\");\n const digits = digitsAndSigns.replace(/-/g, \"\");\n if (allowNegative && digitsAndSigns.startsWith(\"-\")) {\n return `-${digits}`;\n }\n return digits;\n};\n\n/**\n * Parses committed text into a number. Returns `null` for an empty field or a\n * lone `-`, which the caller resolves by restoring the previous value.\n */\nexport const parseCounterValue = (raw: string): number | null => {\n const trimmed = raw.trim();\n if (trimmed === \"\" || trimmed === \"-\") return null;\n const parsed = Number.parseInt(trimmed, 10);\n return Number.isNaN(parsed) ? null : parsed;\n};\n\n/**\n * True when the range allows values below zero, which is what decides whether\n * a typed `-` is kept.\n */\nexport const allowsNegative = (min?: number): boolean =>\n typeof min !== \"number\" || min < 0;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAoD;;;ACCpD,0BASO;AAsMD;AAnMN,IAAM,0BAA6D;AAAA,EACjE,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,cAAc;AAAA,EACd,aAAa;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM;AAAA,EACN,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AAA,QAC3B,eAAa;AAAA,QAEZ;AAAA;AAAA,UACD;AAAA,YAAC;AAAA;AAAA,cACC,eAAc;AAAA,cACd,YAAW;AAAA,cACX,KAAK,WAAW;AAAA,cAChB,OAAO,WAAW;AAAA,cAEjB;AAAA;AAAA,gBACD,6CAAC,OAAI,MAAM,GAAG,UAAU,GACtB;AAAA,kBAAC;AAAA;AAAA,oBACC,KAAK;AAAA,oBACL,IAAI;AAAA,oBACJ;AAAA,oBACA;AAAA,oBACA,OAAO;AAAA,oBACP;AAAA,oBACA,UAAU;AAAA,oBACV,QAAQ;AAAA,oBACR,WAAW;AAAA,oBAGX,MAAK;AAAA,oBACL,WAAU;AAAA,oBACV,MAAK;AAAA,oBACL,iBAAe,kBAAkB;AAAA,oBACjC,iBAAe;AAAA,oBACf,iBAAe;AAAA,oBACf,cAAY,YAAY,SAAY;AAAA,oBACnC,GAAI,YAAY,EAAE,mBAAmB,QAAQ,IAAI,CAAC;AAAA,oBAEnD,OAAO,EAAE,WAAW,SAAS;AAAA,oBAC7B;AAAA,oBACA;AAAA,oBACA,QAAQ,SAAS,GAAG,MAAM,YAAY;AAAA;AAAA,gBACxC,GACF;AAAA,gBACC;AAAA;AAAA;AAAA,UACH;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,QAAQ,cAAc;","names":["import_react","import_react_native","import_jsx_runtime","RNText","import_react_native","import_jsx_runtime","React","import_jsx_runtime","React"]}
1
+ {"version":3,"sources":["../../src/index.tsx","../../src/Counter.tsx","../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/Text.tsx","../../../../foundation/primitives-native/src/Icon.tsx","../../../../foundation/primitives-native/src/index.tsx","../../src/utils.ts"],"sourcesContent":["export { Counter } from \"./Counter\";\nexport type { CounterProps, CounterType } from \"./types\";\n","import React, { forwardRef, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon, isWeb } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme, useId } from \"@xsolla/xui-core\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { MinusSq, PlusSq } from \"@xsolla/xui-icons-base\";\nimport type { CounterProps } from \"./types\";\nimport {\n COUNTER_SIZE_CONFIG,\n allowsNegative,\n clampToRange,\n parseCounterValue,\n sanitizeCounterInput,\n} from \"./utils\";\n\ninterface CounterButtonProps {\n icon: React.ReactNode;\n label: string;\n onPress: () => void;\n available: boolean;\n boxSize: number;\n borderRadius: number;\n color: string;\n hoverColor: string;\n testID?: string;\n}\n\nconst CounterButton: React.FC<CounterButtonProps> = ({\n icon,\n label,\n onPress,\n available,\n boxSize,\n borderRadius,\n color,\n hoverColor,\n testID,\n}) => (\n <Box\n as=\"button\"\n type=\"button\"\n width={boxSize}\n height={boxSize}\n flexShrink={0}\n alignItems=\"center\"\n justifyContent=\"center\"\n padding={0}\n borderWidth={0}\n borderRadius={borderRadius}\n backgroundColor=\"transparent\"\n cursor={available ? \"pointer\" : \"not-allowed\"}\n disabled={!available}\n aria-disabled={!available || undefined}\n aria-label={label}\n // Keep a stable Pressable host on native even when unavailable so the\n // control stays in the a11y tree with a disabled state.\n onPress={onPress}\n hoverStyle={available ? { backgroundColor: hoverColor } : undefined}\n // Keep focus in the field so a click does not commit-then-step.\n {...(isWeb && {\n onMouseDown: (e: React.MouseEvent<HTMLButtonElement>) =>\n e.preventDefault(),\n })}\n data-testid={testID}\n testID={testID}\n >\n <Icon size={boxSize} color={color}>\n {icon}\n </Icon>\n </Box>\n);\n\n/**\n * A numeric stepper that lets the user increase or decrease a value using\n * dedicated − and + buttons.\n *\n * Counter has no error state: values outside the allowed range are never\n * rejected, they are silently clamped to the nearest bound on commit, so the\n * component is always in a valid state.\n */\nexport const Counter = forwardRef<HTMLInputElement, CounterProps>(\n (\n {\n value,\n defaultValue = null,\n onChange,\n min,\n max,\n step = 1,\n size = \"md\",\n type = \"input\",\n disabled = false,\n label,\n \"aria-label\": ariaLabel,\n decrementLabel = \"Decrease quantity\",\n incrementLabel = \"Increase quantity\",\n name,\n id: providedId,\n testID,\n themeMode,\n themeProductContext,\n },\n ref\n ) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n\n const rawId = useId();\n const safeId = rawId.replace(/:/g, \"\");\n const counterId = providedId || `counter-${safeId}`;\n\n const isControlled = value !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState<number | null>(\n defaultValue\n );\n const committedValue = isControlled ? (value ?? null) : uncontrolledValue;\n\n // Text held while the user is mid-entry. `null` means \"show the committed\n // value\" — typing is never committed keystroke-by-keystroke.\n const [draft, setDraft] = useState<string | null>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n\n React.useImperativeHandle(\n ref,\n () => inputRef.current as HTMLInputElement,\n []\n );\n\n const sizeConfig = COUNTER_SIZE_CONFIG[size];\n const inputSizing = theme.sizing.input(size);\n const isReadOnly = type === \"readOnly\";\n\n // The value the buttons step from: an uncommitted draft wins over the last\n // committed value so typing 7 then pressing + lands on 8, not oldValue + 1.\n const pendingValue =\n draft !== null ? parseCounterValue(draft) : committedValue;\n const stepBase = pendingValue ?? min ?? 0;\n\n const canDecrement =\n !disabled && (typeof min !== \"number\" || stepBase > min);\n const canIncrement =\n !disabled && (typeof max !== \"number\" || stepBase < max);\n\n const commit = (next: number | null) => {\n setDraft(null);\n // An empty field on commit restores the previous value — the counter is\n // never left in an empty, indeterminate state after commit.\n const resolved = next ?? committedValue;\n if (resolved === null) return;\n const clamped = clampToRange(resolved, min, max);\n if (!isControlled) setUncontrolledValue(clamped);\n if (clamped !== committedValue) onChange?.(clamped);\n };\n\n const stepBy = (direction: 1 | -1) => {\n commit(clampToRange(stepBase + direction * step, min, max));\n };\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setDraft(sanitizeCounterInput(e.target.value, allowsNegative(min)));\n };\n\n const handleBlur = () => {\n commit(draft !== null ? parseCounterValue(draft) : committedValue);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"ArrowUp\") {\n e.preventDefault();\n if (canIncrement) stepBy(1);\n return;\n }\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n if (canDecrement) stepBy(-1);\n return;\n }\n if (e.key === \"Home\" && typeof min === \"number\") {\n e.preventDefault();\n commit(min);\n return;\n }\n if (e.key === \"End\" && typeof max === \"number\") {\n e.preventDefault();\n commit(max);\n return;\n }\n // Native TextInput reports Return as \"Enter\" or \"\\n\" via onKeyPress.\n if (e.key === \"Enter\" || e.key === \"\\n\") {\n e.preventDefault();\n commit(draft !== null ? parseCounterValue(draft) : committedValue);\n }\n };\n\n const enabledIconColor = theme.colors.content.secondary;\n const disabledIconColor = theme.colors.control.text.disable;\n const hoverColor = theme.colors.overlay.mono;\n const buttonRadius = theme.shape.input[size].borderRadius;\n\n const decrementButton = (\n <CounterButton\n icon={<MinusSq />}\n label={decrementLabel}\n onPress={() => {\n if (canDecrement) stepBy(-1);\n }}\n available={canDecrement}\n boxSize={sizeConfig.control}\n borderRadius={buttonRadius}\n color={canDecrement ? enabledIconColor : disabledIconColor}\n hoverColor={hoverColor}\n testID={testID ? `${testID}__decrement` : undefined}\n />\n );\n\n const incrementButton = (\n <CounterButton\n icon={<PlusSq />}\n label={incrementLabel}\n onPress={() => {\n if (canIncrement) stepBy(1);\n }}\n available={canIncrement}\n boxSize={sizeConfig.control}\n borderRadius={buttonRadius}\n color={canIncrement ? enabledIconColor : disabledIconColor}\n hoverColor={hoverColor}\n testID={testID ? `${testID}__increment` : undefined}\n />\n );\n\n // Label sits above the whole control row (buttons + value), never inside\n // the Input between the buttons — that would push − / + off the field's\n // vertical center (Figma Counter has no in-component label; labels come\n // from FieldGroup / adjacent text, or this convenience prop).\n const labelId = `${counterId}-label`;\n const showLabel = Boolean(label) && !isReadOnly;\n const labelNode = showLabel ? (\n <Box as=\"label\" id={labelId}>\n <Text\n color={theme.colors.content.secondary}\n fontSize={inputSizing.fontSize - 2}\n fontWeight=\"500\"\n >\n {label}\n </Text>\n </Box>\n ) : null;\n\n if (isReadOnly) {\n // Read-only renders the value as plain text, never as a disabled or\n // `readonly` input — both would tell assistive technology the value\n // cannot change, which is false: the buttons still change it.\n const readOnlyValue = String(committedValue ?? min ?? 0);\n return (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={sizeConfig.gap}\n width={sizeConfig.readOnlyWidth}\n role=\"group\"\n aria-label={ariaLabel || label}\n aria-disabled={disabled || undefined}\n data-testid={testID}\n >\n {decrementButton}\n <Box flex={1} minWidth={0} aria-live=\"polite\" alignItems=\"center\">\n <Text\n color={\n disabled\n ? theme.colors.control.input.textDisable\n : theme.colors.control.input.text\n }\n fontSize={inputSizing.fontSize}\n lineHeight={inputSizing.fontSize + 2}\n textAlign=\"center\"\n data-testid={testID ? `${testID}__value` : undefined}\n >\n {readOnlyValue}\n </Text>\n </Box>\n {incrementButton}\n </Box>\n );\n }\n\n const displayValue =\n draft !== null\n ? draft\n : committedValue === null\n ? \"\"\n : String(committedValue);\n\n return (\n <Box\n flexDirection=\"column\"\n gap={inputSizing.fieldGap}\n alignItems=\"flex-start\"\n role=\"group\"\n aria-label={showLabel ? undefined : ariaLabel}\n aria-labelledby={showLabel ? labelId : undefined}\n aria-disabled={disabled || undefined}\n data-testid={testID}\n >\n {labelNode}\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={sizeConfig.gap}\n width={sizeConfig.inputWidth}\n >\n {decrementButton}\n <Box flex={1} minWidth={0}>\n <Input\n ref={inputRef}\n id={counterId}\n name={name}\n size={size}\n value={displayValue}\n disabled={disabled}\n onChange={handleInputChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n // `type=\"text\"` + `inputMode=\"numeric\"`, not `type=\"number\"`,\n // which would add the browser's own spinners next to ours.\n type=\"text\"\n inputMode=\"numeric\"\n role=\"spinbutton\"\n aria-valuenow={committedValue ?? undefined}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-label={showLabel ? undefined : ariaLabel}\n {...(showLabel ? { \"aria-labelledby\": labelId } : {})}\n // Figma centers the value in the compact field.\n style={{ textAlign: \"center\" }}\n themeMode={themeMode}\n themeProductContext={themeProductContext}\n testID={testID ? `${testID}__input` : undefined}\n />\n </Box>\n {incrementButton}\n </Box>\n </Box>\n );\n }\n);\n\nCounter.displayName = \"Counter\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n AccessibilityRole,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleToAccessibilityRole: Record<string, AccessibilityRole> = {\n button: \"button\",\n link: \"link\",\n img: \"image\",\n image: \"image\",\n summary: \"summary\",\n switch: \"switch\",\n checkbox: \"checkbox\",\n radio: \"radio\",\n heading: \"header\",\n text: \"text\",\n search: \"search\",\n alert: \"alert\",\n none: \"none\",\n presentation: \"none\",\n progressbar: \"progressbar\",\n scrollbar: \"scrollbar\",\n adjustable: \"adjustable\",\n tab: \"tab\",\n menu: \"menu\",\n menuitem: \"menuitem\",\n list: \"list\",\n timer: \"timer\",\n};\n\n/** RN ViewStyle.gap is typed as number (Yoga gap), not DimensionValue. */\nconst toGapValue = (gap: number | string | undefined): number | undefined => {\n if (gap === undefined) return undefined;\n if (typeof gap === \"number\") return gap;\n const pxMatch = /^(\\d+(?:\\.\\d+)?)px$/.exec(gap);\n if (pxMatch) return Number(pxMatch[1]);\n const asNumber = Number(gap);\n return Number.isFinite(asNumber) ? asNumber : undefined;\n};\n\nexport const Box: React.FC<BoxProps> = ({\n children,\n onPress,\n onLayout,\n onMoveShouldSetResponder,\n onResponderGrant,\n onResponderMove,\n onResponderRelease,\n onResponderTerminate,\n backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius,\n borderStyle,\n height,\n padding,\n paddingHorizontal,\n paddingVertical,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n flexShrink,\n gap,\n overflow,\n opacity,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n disabled,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n opacity: opacity ?? (disabled ? 0.5 : undefined),\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n minWidth: minWidth as DimensionValue,\n minHeight: minHeight as DimensionValue,\n maxWidth: maxWidth as DimensionValue,\n maxHeight: maxHeight as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n flexShrink,\n gap: toGapValue(gap),\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Map web a11y props; drop the rest of the web-only attributes before\n // spreading onto RN hosts (unknown props warn at runtime).\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\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 className,\n \"data-testid\": _dataTestId,\n cursor: _cursor,\n type: _type,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n const accessibilityRole =\n (typeof role === \"string\" && roleToAccessibilityRole[role]) ||\n (as === \"button\" ? \"button\" : undefined);\n const isDisabled = Boolean(disabled || ariaDisabled);\n const accessibilityState = {\n disabled: isDisabled || undefined,\n busy: Boolean(ariaBusy) || undefined,\n };\n const accessibilityLiveRegion =\n ariaLive === \"polite\" || ariaLive === \"assertive\" ? ariaLive : undefined;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : alt}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n // Prefer Pressable whenever the node is interactive or explicitly a button,\n // so disabled / aria-disabled controls stay in the a11y tree as buttons.\n if (onPress || as === \"button\") {\n return (\n <Pressable\n onPress={!isDisabled && onPress ? onPress : undefined}\n disabled={isDisabled}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={\n typeof ariaLabel === \"string\" ? ariaLabel : undefined\n }\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : undefined}\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: TextStyle = {\n color: color ?? incomingStyle?.color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={dataTestId || testID || id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\n};\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Icon: React.FC<IconProps> = ({\n children,\n color,\n size,\n testID,\n \"data-testid\": dataTestId,\n}) => {\n const style: ViewStyle = {\n width: typeof size === \"number\" ? size : undefined,\n height: typeof size === \"number\" ? size : undefined,\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n\n // On native, we try to pass the color down to children (like Text primitives)\n // to mimic the CSS inheritance behavior of the web version.\n const childrenWithProps = React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n return React.cloneElement(child, {\n color: child.props.color || color,\n // Also pass size if child seems to be an icon that needs it\n size: child.props.size || size,\n });\n }\n return child;\n });\n\n return (\n <View style={style} testID={dataTestId || testID}>\n {childrenWithProps}\n </View>\n );\n};\n","export * from \"./Box\";\nexport * from \"./Text\";\nexport * from \"./Spinner\";\nexport * from \"./Icon\";\nexport * from \"./Divider\";\nexport * from \"./Input\";\nexport * from \"./TextArea\";\nexport * from \"./LinearGradient\";\n\nexport const isWeb = false;\nexport const isNative = true;\n","/**\n * Per-size geometry taken from the Figma \"Counter\" component set.\n *\n * `control` is the square box of the − / + buttons; `gap` is the spacing\n * between the three elements. `inputWidth` / `readOnlyWidth` are the full\n * control widths from Figma (buttons + gaps + value). Field height, radius,\n * and font size come from `theme.sizing.input(size)` / `theme.shape.input[size]`\n * because the middle of a `type=\"input\"` Counter is a standard Input.\n */\nexport const COUNTER_SIZE_CONFIG = {\n xl: { control: 28, gap: 10, inputWidth: 149, readOnlyWidth: 100 },\n lg: { control: 24, gap: 10, inputWidth: 142, readOnlyWidth: 90 },\n md: { control: 24, gap: 8, inputWidth: 132, readOnlyWidth: 83 },\n sm: { control: 18, gap: 8, inputWidth: 92, readOnlyWidth: 69 },\n xs: { control: 16, gap: 6, inputWidth: 82, readOnlyWidth: 59 },\n} as const;\n\n/**\n * Rounds `value` into `[min, max]`. A value above the maximum is rounded down\n * to the maximum, and a value below the minimum is rounded up to the minimum.\n * Missing bounds are unbounded on that side.\n */\nexport const clampToRange = (\n value: number,\n min?: number,\n max?: number\n): number => {\n let next = value;\n if (typeof min === \"number\" && next < min) next = min;\n if (typeof max === \"number\" && next > max) next = max;\n return next;\n};\n\n/**\n * Strips everything that cannot be part of an integer from typed input.\n * Non-numeric characters are rejected silently rather than flagged — Counter\n * has no error state. A single leading `-` survives only when negatives are\n * allowed.\n */\nexport const sanitizeCounterInput = (\n raw: string,\n allowNegative: boolean\n): string => {\n const digitsAndSigns = raw.replace(/[^\\d-]/g, \"\");\n const digits = digitsAndSigns.replace(/-/g, \"\");\n if (allowNegative && digitsAndSigns.startsWith(\"-\")) {\n return `-${digits}`;\n }\n return digits;\n};\n\n/**\n * Parses committed text into a number. Returns `null` for an empty field or a\n * lone `-`, which the caller resolves by restoring the previous value.\n */\nexport const parseCounterValue = (raw: string): number | null => {\n const trimmed = raw.trim();\n if (trimmed === \"\" || trimmed === \"-\") return null;\n const parsed = Number.parseInt(trimmed, 10);\n return Number.isNaN(parsed) ? null : parsed;\n};\n\n/**\n * True when the range allows values below zero, which is what decides whether\n * a typed `-` is kept.\n */\nexport const allowsNegative = (min?: number): boolean =>\n type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oBACA;AAAA,oBACA,QAAQ,SAAS,GAAG,MAAM,YAAY;AAAA;AAAA,gBACxC,GACF;AAAA,gBACC;AAAA;AAAA;AAAA,UACH;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,QAAQ,cAAc;","names":["import_react","import_react_native","import_jsx_runtime","RNText","import_react_native","import_jsx_runtime","React","import_jsx_runtime","React"]}
package/native/index.mjs CHANGED
@@ -90,6 +90,7 @@ var Box = ({
90
90
  flexShrink,
91
91
  gap,
92
92
  overflow,
93
+ opacity,
93
94
  zIndex,
94
95
  hoverStyle,
95
96
  pressStyle,
@@ -117,6 +118,7 @@ var Box = ({
117
118
  borderRadius,
118
119
  borderStyle,
119
120
  overflow,
121
+ opacity: opacity ?? (disabled ? 0.5 : void 0),
120
122
  zIndex,
121
123
  height,
122
124
  width,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Counter.tsx","../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/Text.tsx","../../../../foundation/primitives-native/src/Icon.tsx","../../../../foundation/primitives-native/src/index.tsx","../../src/utils.ts"],"sourcesContent":["import React, { forwardRef, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon, isWeb } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme, useId } from \"@xsolla/xui-core\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { MinusSq, PlusSq } from \"@xsolla/xui-icons-base\";\nimport type { CounterProps } from \"./types\";\nimport {\n COUNTER_SIZE_CONFIG,\n allowsNegative,\n clampToRange,\n parseCounterValue,\n sanitizeCounterInput,\n} from \"./utils\";\n\ninterface CounterButtonProps {\n icon: React.ReactNode;\n label: string;\n onPress: () => void;\n available: boolean;\n boxSize: number;\n borderRadius: number;\n color: string;\n hoverColor: string;\n testID?: string;\n}\n\nconst CounterButton: React.FC<CounterButtonProps> = ({\n icon,\n label,\n onPress,\n available,\n boxSize,\n borderRadius,\n color,\n hoverColor,\n testID,\n}) => (\n <Box\n as=\"button\"\n type=\"button\"\n width={boxSize}\n height={boxSize}\n flexShrink={0}\n alignItems=\"center\"\n justifyContent=\"center\"\n padding={0}\n borderWidth={0}\n borderRadius={borderRadius}\n backgroundColor=\"transparent\"\n cursor={available ? \"pointer\" : \"not-allowed\"}\n disabled={!available}\n aria-disabled={!available || undefined}\n aria-label={label}\n // Keep a stable Pressable host on native even when unavailable so the\n // control stays in the a11y tree with a disabled state.\n onPress={onPress}\n hoverStyle={available ? { backgroundColor: hoverColor } : undefined}\n // Keep focus in the field so a click does not commit-then-step.\n {...(isWeb && {\n onMouseDown: (e: React.MouseEvent<HTMLButtonElement>) =>\n e.preventDefault(),\n })}\n data-testid={testID}\n testID={testID}\n >\n <Icon size={boxSize} color={color}>\n {icon}\n </Icon>\n </Box>\n);\n\n/**\n * A numeric stepper that lets the user increase or decrease a value using\n * dedicated − and + buttons.\n *\n * Counter has no error state: values outside the allowed range are never\n * rejected, they are silently clamped to the nearest bound on commit, so the\n * component is always in a valid state.\n */\nexport const Counter = forwardRef<HTMLInputElement, CounterProps>(\n (\n {\n value,\n defaultValue = null,\n onChange,\n min,\n max,\n step = 1,\n size = \"md\",\n type = \"input\",\n disabled = false,\n label,\n \"aria-label\": ariaLabel,\n decrementLabel = \"Decrease quantity\",\n incrementLabel = \"Increase quantity\",\n name,\n id: providedId,\n testID,\n themeMode,\n themeProductContext,\n },\n ref\n ) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n\n const rawId = useId();\n const safeId = rawId.replace(/:/g, \"\");\n const counterId = providedId || `counter-${safeId}`;\n\n const isControlled = value !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState<number | null>(\n defaultValue\n );\n const committedValue = isControlled ? (value ?? null) : uncontrolledValue;\n\n // Text held while the user is mid-entry. `null` means \"show the committed\n // value\" — typing is never committed keystroke-by-keystroke.\n const [draft, setDraft] = useState<string | null>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n\n React.useImperativeHandle(\n ref,\n () => inputRef.current as HTMLInputElement,\n []\n );\n\n const sizeConfig = COUNTER_SIZE_CONFIG[size];\n const inputSizing = theme.sizing.input(size);\n const isReadOnly = type === \"readOnly\";\n\n // The value the buttons step from: an uncommitted draft wins over the last\n // committed value so typing 7 then pressing + lands on 8, not oldValue + 1.\n const pendingValue =\n draft !== null ? parseCounterValue(draft) : committedValue;\n const stepBase = pendingValue ?? min ?? 0;\n\n const canDecrement =\n !disabled && (typeof min !== \"number\" || stepBase > min);\n const canIncrement =\n !disabled && (typeof max !== \"number\" || stepBase < max);\n\n const commit = (next: number | null) => {\n setDraft(null);\n // An empty field on commit restores the previous value — the counter is\n // never left in an empty, indeterminate state after commit.\n const resolved = next ?? committedValue;\n if (resolved === null) return;\n const clamped = clampToRange(resolved, min, max);\n if (!isControlled) setUncontrolledValue(clamped);\n if (clamped !== committedValue) onChange?.(clamped);\n };\n\n const stepBy = (direction: 1 | -1) => {\n commit(clampToRange(stepBase + direction * step, min, max));\n };\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setDraft(sanitizeCounterInput(e.target.value, allowsNegative(min)));\n };\n\n const handleBlur = () => {\n commit(draft !== null ? parseCounterValue(draft) : committedValue);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"ArrowUp\") {\n e.preventDefault();\n if (canIncrement) stepBy(1);\n return;\n }\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n if (canDecrement) stepBy(-1);\n return;\n }\n if (e.key === \"Home\" && typeof min === \"number\") {\n e.preventDefault();\n commit(min);\n return;\n }\n if (e.key === \"End\" && typeof max === \"number\") {\n e.preventDefault();\n commit(max);\n return;\n }\n // Native TextInput reports Return as \"Enter\" or \"\\n\" via onKeyPress.\n if (e.key === \"Enter\" || e.key === \"\\n\") {\n e.preventDefault();\n commit(draft !== null ? parseCounterValue(draft) : committedValue);\n }\n };\n\n const enabledIconColor = theme.colors.content.secondary;\n const disabledIconColor = theme.colors.control.text.disable;\n const hoverColor = theme.colors.overlay.mono;\n const buttonRadius = theme.shape.input[size].borderRadius;\n\n const decrementButton = (\n <CounterButton\n icon={<MinusSq />}\n label={decrementLabel}\n onPress={() => {\n if (canDecrement) stepBy(-1);\n }}\n available={canDecrement}\n boxSize={sizeConfig.control}\n borderRadius={buttonRadius}\n color={canDecrement ? enabledIconColor : disabledIconColor}\n hoverColor={hoverColor}\n testID={testID ? `${testID}__decrement` : undefined}\n />\n );\n\n const incrementButton = (\n <CounterButton\n icon={<PlusSq />}\n label={incrementLabel}\n onPress={() => {\n if (canIncrement) stepBy(1);\n }}\n available={canIncrement}\n boxSize={sizeConfig.control}\n borderRadius={buttonRadius}\n color={canIncrement ? enabledIconColor : disabledIconColor}\n hoverColor={hoverColor}\n testID={testID ? `${testID}__increment` : undefined}\n />\n );\n\n // Label sits above the whole control row (buttons + value), never inside\n // the Input between the buttons — that would push − / + off the field's\n // vertical center (Figma Counter has no in-component label; labels come\n // from FieldGroup / adjacent text, or this convenience prop).\n const labelId = `${counterId}-label`;\n const showLabel = Boolean(label) && !isReadOnly;\n const labelNode = showLabel ? (\n <Box as=\"label\" id={labelId}>\n <Text\n color={theme.colors.content.secondary}\n fontSize={inputSizing.fontSize - 2}\n fontWeight=\"500\"\n >\n {label}\n </Text>\n </Box>\n ) : null;\n\n if (isReadOnly) {\n // Read-only renders the value as plain text, never as a disabled or\n // `readonly` input — both would tell assistive technology the value\n // cannot change, which is false: the buttons still change it.\n const readOnlyValue = String(committedValue ?? min ?? 0);\n return (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={sizeConfig.gap}\n width={sizeConfig.readOnlyWidth}\n role=\"group\"\n aria-label={ariaLabel || label}\n aria-disabled={disabled || undefined}\n data-testid={testID}\n >\n {decrementButton}\n <Box flex={1} minWidth={0} aria-live=\"polite\" alignItems=\"center\">\n <Text\n color={\n disabled\n ? theme.colors.control.input.textDisable\n : theme.colors.control.input.text\n }\n fontSize={inputSizing.fontSize}\n lineHeight={inputSizing.fontSize + 2}\n textAlign=\"center\"\n data-testid={testID ? `${testID}__value` : undefined}\n >\n {readOnlyValue}\n </Text>\n </Box>\n {incrementButton}\n </Box>\n );\n }\n\n const displayValue =\n draft !== null\n ? draft\n : committedValue === null\n ? \"\"\n : String(committedValue);\n\n return (\n <Box\n flexDirection=\"column\"\n gap={inputSizing.fieldGap}\n alignItems=\"flex-start\"\n role=\"group\"\n aria-label={showLabel ? undefined : ariaLabel}\n aria-labelledby={showLabel ? labelId : undefined}\n aria-disabled={disabled || undefined}\n data-testid={testID}\n >\n {labelNode}\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={sizeConfig.gap}\n width={sizeConfig.inputWidth}\n >\n {decrementButton}\n <Box flex={1} minWidth={0}>\n <Input\n ref={inputRef}\n id={counterId}\n name={name}\n size={size}\n value={displayValue}\n disabled={disabled}\n onChange={handleInputChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n // `type=\"text\"` + `inputMode=\"numeric\"`, not `type=\"number\"`,\n // which would add the browser's own spinners next to ours.\n type=\"text\"\n inputMode=\"numeric\"\n role=\"spinbutton\"\n aria-valuenow={committedValue ?? undefined}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-label={showLabel ? undefined : ariaLabel}\n {...(showLabel ? { \"aria-labelledby\": labelId } : {})}\n // Figma centers the value in the compact field.\n style={{ textAlign: \"center\" }}\n themeMode={themeMode}\n themeProductContext={themeProductContext}\n testID={testID ? `${testID}__input` : undefined}\n />\n </Box>\n {incrementButton}\n </Box>\n </Box>\n );\n }\n);\n\nCounter.displayName = \"Counter\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n AccessibilityRole,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleToAccessibilityRole: Record<string, AccessibilityRole> = {\n button: \"button\",\n link: \"link\",\n img: \"image\",\n image: \"image\",\n summary: \"summary\",\n switch: \"switch\",\n checkbox: \"checkbox\",\n radio: \"radio\",\n heading: \"header\",\n text: \"text\",\n search: \"search\",\n alert: \"alert\",\n none: \"none\",\n presentation: \"none\",\n progressbar: \"progressbar\",\n scrollbar: \"scrollbar\",\n adjustable: \"adjustable\",\n tab: \"tab\",\n menu: \"menu\",\n menuitem: \"menuitem\",\n list: \"list\",\n timer: \"timer\",\n};\n\n/** RN ViewStyle.gap is typed as number (Yoga gap), not DimensionValue. */\nconst toGapValue = (gap: number | string | undefined): number | undefined => {\n if (gap === undefined) return undefined;\n if (typeof gap === \"number\") return gap;\n const pxMatch = /^(\\d+(?:\\.\\d+)?)px$/.exec(gap);\n if (pxMatch) return Number(pxMatch[1]);\n const asNumber = Number(gap);\n return Number.isFinite(asNumber) ? asNumber : undefined;\n};\n\nexport const Box: React.FC<BoxProps> = ({\n children,\n onPress,\n onLayout,\n onMoveShouldSetResponder,\n onResponderGrant,\n onResponderMove,\n onResponderRelease,\n onResponderTerminate,\n backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius,\n borderStyle,\n height,\n padding,\n paddingHorizontal,\n paddingVertical,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n flexShrink,\n gap,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n disabled,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n minWidth: minWidth as DimensionValue,\n minHeight: minHeight as DimensionValue,\n maxWidth: maxWidth as DimensionValue,\n maxHeight: maxHeight as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n flexShrink,\n gap: toGapValue(gap),\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Map web a11y props; drop the rest of the web-only attributes before\n // spreading onto RN hosts (unknown props warn at runtime).\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\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 className,\n \"data-testid\": _dataTestId,\n cursor: _cursor,\n type: _type,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n const accessibilityRole =\n (typeof role === \"string\" && roleToAccessibilityRole[role]) ||\n (as === \"button\" ? \"button\" : undefined);\n const isDisabled = Boolean(disabled || ariaDisabled);\n const accessibilityState = {\n disabled: isDisabled || undefined,\n busy: Boolean(ariaBusy) || undefined,\n };\n const accessibilityLiveRegion =\n ariaLive === \"polite\" || ariaLive === \"assertive\" ? ariaLive : undefined;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : alt}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n // Prefer Pressable whenever the node is interactive or explicitly a button,\n // so disabled / aria-disabled controls stay in the a11y tree as buttons.\n if (onPress || as === \"button\") {\n return (\n <Pressable\n onPress={!isDisabled && onPress ? onPress : undefined}\n disabled={isDisabled}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={\n typeof ariaLabel === \"string\" ? ariaLabel : undefined\n }\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : undefined}\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: TextStyle = {\n color: color ?? incomingStyle?.color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={dataTestId || testID || id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\n};\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Icon: React.FC<IconProps> = ({\n children,\n color,\n size,\n testID,\n \"data-testid\": dataTestId,\n}) => {\n const style: ViewStyle = {\n width: typeof size === \"number\" ? size : undefined,\n height: typeof size === \"number\" ? size : undefined,\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n\n // On native, we try to pass the color down to children (like Text primitives)\n // to mimic the CSS inheritance behavior of the web version.\n const childrenWithProps = React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n return React.cloneElement(child, {\n color: child.props.color || color,\n // Also pass size if child seems to be an icon that needs it\n size: child.props.size || size,\n });\n }\n return child;\n });\n\n return (\n <View style={style} testID={dataTestId || testID}>\n {childrenWithProps}\n </View>\n );\n};\n","export * from \"./Box\";\nexport * from \"./Text\";\nexport * from \"./Spinner\";\nexport * from \"./Icon\";\nexport * from \"./Divider\";\nexport * from \"./Input\";\nexport * from \"./TextArea\";\nexport * from \"./LinearGradient\";\n\nexport const isWeb = false;\nexport const isNative = true;\n","/**\n * Per-size geometry taken from the Figma \"Counter\" component set.\n *\n * `control` is the square box of the − / + buttons; `gap` is the spacing\n * between the three elements. `inputWidth` / `readOnlyWidth` are the full\n * control widths from Figma (buttons + gaps + value). Field height, radius,\n * and font size come from `theme.sizing.input(size)` / `theme.shape.input[size]`\n * because the middle of a `type=\"input\"` Counter is a standard Input.\n */\nexport const COUNTER_SIZE_CONFIG = {\n xl: { control: 28, gap: 10, inputWidth: 149, readOnlyWidth: 100 },\n lg: { control: 24, gap: 10, inputWidth: 142, readOnlyWidth: 90 },\n md: { control: 24, gap: 8, inputWidth: 132, readOnlyWidth: 83 },\n sm: { control: 18, gap: 8, inputWidth: 92, readOnlyWidth: 69 },\n xs: { control: 16, gap: 6, inputWidth: 82, readOnlyWidth: 59 },\n} as const;\n\n/**\n * Rounds `value` into `[min, max]`. A value above the maximum is rounded down\n * to the maximum, and a value below the minimum is rounded up to the minimum.\n * Missing bounds are unbounded on that side.\n */\nexport const clampToRange = (\n value: number,\n min?: number,\n max?: number\n): number => {\n let next = value;\n if (typeof min === \"number\" && next < min) next = min;\n if (typeof max === \"number\" && next > max) next = max;\n return next;\n};\n\n/**\n * Strips everything that cannot be part of an integer from typed input.\n * Non-numeric characters are rejected silently rather than flagged — Counter\n * has no error state. A single leading `-` survives only when negatives are\n * allowed.\n */\nexport const sanitizeCounterInput = (\n raw: string,\n allowNegative: boolean\n): string => {\n const digitsAndSigns = raw.replace(/[^\\d-]/g, \"\");\n const digits = digitsAndSigns.replace(/-/g, \"\");\n if (allowNegative && digitsAndSigns.startsWith(\"-\")) {\n return `-${digits}`;\n }\n return digits;\n};\n\n/**\n * Parses committed text into a number. Returns `null` for an empty field or a\n * lone `-`, which the caller resolves by restoring the previous value.\n */\nexport const parseCounterValue = (raw: string): number | null => {\n const trimmed = raw.trim();\n if (trimmed === \"\" || trimmed === \"-\") return null;\n const parsed = Number.parseInt(trimmed, 10);\n return Number.isNaN(parsed) ? null : parsed;\n};\n\n/**\n * True when the range allows values below zero, which is what decides whether\n * a typed `-` is kept.\n */\nexport const allowsNegative = (min?: number): boolean =>\n typeof min !== \"number\" || min < 0;\n"],"mappings":";AAAA,OAAOA,UAAS,YAAY,QAAQ,gBAAgB;;;ACCpD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AAsMD;AAnMN,IAAM,0BAA6D;AAAA,EACjE,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,cAAc;AAAA,EACd,aAAa;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,KAAK;AAA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;AAAA,MAAC;AAAA;AAAA,QACC,eAAc;AAAA,QACd,KAAK,YAAY;AAAA,QACjB,YAAW;AAAA,QACX,MAAK;AAAA,QACL,cAAY,YAAY,SAAY;AAAA,QACpC,mBAAiB,YAAY,UAAU;AAAA,QACvC,iBAAe,YAAY;AAAA,QAC3B,eAAa;AAAA,QAEZ;AAAA;AAAA,UACD;AAAA,YAAC;AAAA;AAAA,cACC,eAAc;AAAA,cACd,YAAW;AAAA,cACX,KAAK,WAAW;AAAA,cAChB,OAAO,WAAW;AAAA,cAEjB;AAAA;AAAA,gBACD,gBAAAA,KAAC,OAAI,MAAM,GAAG,UAAU,GACtB,0BAAAA;AAAA,kBAAC;AAAA;AAAA,oBACC,KAAK;AAAA,oBACL,IAAI;AAAA,oBACJ;AAAA,oBACA;AAAA,oBACA,OAAO;AAAA,oBACP;AAAA,oBACA,UAAU;AAAA,oBACV,QAAQ;AAAA,oBACR,WAAW;AAAA,oBAGX,MAAK;AAAA,oBACL,WAAU;AAAA,oBACV,MAAK;AAAA,oBACL,iBAAe,kBAAkB;AAAA,oBACjC,iBAAe;AAAA,oBACf,iBAAe;AAAA,oBACf,cAAY,YAAY,SAAY;AAAA,oBACnC,GAAI,YAAY,EAAE,mBAAmB,QAAQ,IAAI,CAAC;AAAA,oBAEnD,OAAO,EAAE,WAAW,SAAS;AAAA,oBAC7B;AAAA,oBACA;AAAA,oBACA,QAAQ,SAAS,GAAG,MAAM,YAAY;AAAA;AAAA,gBACxC,GACF;AAAA,gBACC;AAAA;AAAA;AAAA,UACH;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,QAAQ,cAAc;","names":["React","jsx","View","jsx","jsx","React"]}
1
+ {"version":3,"sources":["../../src/Counter.tsx","../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/Text.tsx","../../../../foundation/primitives-native/src/Icon.tsx","../../../../foundation/primitives-native/src/index.tsx","../../src/utils.ts"],"sourcesContent":["import React, { forwardRef, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon, isWeb } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme, useId } from \"@xsolla/xui-core\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { MinusSq, PlusSq } from \"@xsolla/xui-icons-base\";\nimport type { CounterProps } from \"./types\";\nimport {\n COUNTER_SIZE_CONFIG,\n allowsNegative,\n clampToRange,\n parseCounterValue,\n sanitizeCounterInput,\n} from \"./utils\";\n\ninterface CounterButtonProps {\n icon: React.ReactNode;\n label: string;\n onPress: () => void;\n available: boolean;\n boxSize: number;\n borderRadius: number;\n color: string;\n hoverColor: string;\n testID?: string;\n}\n\nconst CounterButton: React.FC<CounterButtonProps> = ({\n icon,\n label,\n onPress,\n available,\n boxSize,\n borderRadius,\n color,\n hoverColor,\n testID,\n}) => (\n <Box\n as=\"button\"\n type=\"button\"\n width={boxSize}\n height={boxSize}\n flexShrink={0}\n alignItems=\"center\"\n justifyContent=\"center\"\n padding={0}\n borderWidth={0}\n borderRadius={borderRadius}\n backgroundColor=\"transparent\"\n cursor={available ? \"pointer\" : \"not-allowed\"}\n disabled={!available}\n aria-disabled={!available || undefined}\n aria-label={label}\n // Keep a stable Pressable host on native even when unavailable so the\n // control stays in the a11y tree with a disabled state.\n onPress={onPress}\n hoverStyle={available ? { backgroundColor: hoverColor } : undefined}\n // Keep focus in the field so a click does not commit-then-step.\n {...(isWeb && {\n onMouseDown: (e: React.MouseEvent<HTMLButtonElement>) =>\n e.preventDefault(),\n })}\n data-testid={testID}\n testID={testID}\n >\n <Icon size={boxSize} color={color}>\n {icon}\n </Icon>\n </Box>\n);\n\n/**\n * A numeric stepper that lets the user increase or decrease a value using\n * dedicated − and + buttons.\n *\n * Counter has no error state: values outside the allowed range are never\n * rejected, they are silently clamped to the nearest bound on commit, so the\n * component is always in a valid state.\n */\nexport const Counter = forwardRef<HTMLInputElement, CounterProps>(\n (\n {\n value,\n defaultValue = null,\n onChange,\n min,\n max,\n step = 1,\n size = \"md\",\n type = \"input\",\n disabled = false,\n label,\n \"aria-label\": ariaLabel,\n decrementLabel = \"Decrease quantity\",\n incrementLabel = \"Increase quantity\",\n name,\n id: providedId,\n testID,\n themeMode,\n themeProductContext,\n },\n ref\n ) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n\n const rawId = useId();\n const safeId = rawId.replace(/:/g, \"\");\n const counterId = providedId || `counter-${safeId}`;\n\n const isControlled = value !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState<number | null>(\n defaultValue\n );\n const committedValue = isControlled ? (value ?? null) : uncontrolledValue;\n\n // Text held while the user is mid-entry. `null` means \"show the committed\n // value\" — typing is never committed keystroke-by-keystroke.\n const [draft, setDraft] = useState<string | null>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n\n React.useImperativeHandle(\n ref,\n () => inputRef.current as HTMLInputElement,\n []\n );\n\n const sizeConfig = COUNTER_SIZE_CONFIG[size];\n const inputSizing = theme.sizing.input(size);\n const isReadOnly = type === \"readOnly\";\n\n // The value the buttons step from: an uncommitted draft wins over the last\n // committed value so typing 7 then pressing + lands on 8, not oldValue + 1.\n const pendingValue =\n draft !== null ? parseCounterValue(draft) : committedValue;\n const stepBase = pendingValue ?? min ?? 0;\n\n const canDecrement =\n !disabled && (typeof min !== \"number\" || stepBase > min);\n const canIncrement =\n !disabled && (typeof max !== \"number\" || stepBase < max);\n\n const commit = (next: number | null) => {\n setDraft(null);\n // An empty field on commit restores the previous value — the counter is\n // never left in an empty, indeterminate state after commit.\n const resolved = next ?? committedValue;\n if (resolved === null) return;\n const clamped = clampToRange(resolved, min, max);\n if (!isControlled) setUncontrolledValue(clamped);\n if (clamped !== committedValue) onChange?.(clamped);\n };\n\n const stepBy = (direction: 1 | -1) => {\n commit(clampToRange(stepBase + direction * step, min, max));\n };\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setDraft(sanitizeCounterInput(e.target.value, allowsNegative(min)));\n };\n\n const handleBlur = () => {\n commit(draft !== null ? parseCounterValue(draft) : committedValue);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"ArrowUp\") {\n e.preventDefault();\n if (canIncrement) stepBy(1);\n return;\n }\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n if (canDecrement) stepBy(-1);\n return;\n }\n if (e.key === \"Home\" && typeof min === \"number\") {\n e.preventDefault();\n commit(min);\n return;\n }\n if (e.key === \"End\" && typeof max === \"number\") {\n e.preventDefault();\n commit(max);\n return;\n }\n // Native TextInput reports Return as \"Enter\" or \"\\n\" via onKeyPress.\n if (e.key === \"Enter\" || e.key === \"\\n\") {\n e.preventDefault();\n commit(draft !== null ? parseCounterValue(draft) : committedValue);\n }\n };\n\n const enabledIconColor = theme.colors.content.secondary;\n const disabledIconColor = theme.colors.control.text.disable;\n const hoverColor = theme.colors.overlay.mono;\n const buttonRadius = theme.shape.input[size].borderRadius;\n\n const decrementButton = (\n <CounterButton\n icon={<MinusSq />}\n label={decrementLabel}\n onPress={() => {\n if (canDecrement) stepBy(-1);\n }}\n available={canDecrement}\n boxSize={sizeConfig.control}\n borderRadius={buttonRadius}\n color={canDecrement ? enabledIconColor : disabledIconColor}\n hoverColor={hoverColor}\n testID={testID ? `${testID}__decrement` : undefined}\n />\n );\n\n const incrementButton = (\n <CounterButton\n icon={<PlusSq />}\n label={incrementLabel}\n onPress={() => {\n if (canIncrement) stepBy(1);\n }}\n available={canIncrement}\n boxSize={sizeConfig.control}\n borderRadius={buttonRadius}\n color={canIncrement ? enabledIconColor : disabledIconColor}\n hoverColor={hoverColor}\n testID={testID ? `${testID}__increment` : undefined}\n />\n );\n\n // Label sits above the whole control row (buttons + value), never inside\n // the Input between the buttons — that would push − / + off the field's\n // vertical center (Figma Counter has no in-component label; labels come\n // from FieldGroup / adjacent text, or this convenience prop).\n const labelId = `${counterId}-label`;\n const showLabel = Boolean(label) && !isReadOnly;\n const labelNode = showLabel ? (\n <Box as=\"label\" id={labelId}>\n <Text\n color={theme.colors.content.secondary}\n fontSize={inputSizing.fontSize - 2}\n fontWeight=\"500\"\n >\n {label}\n </Text>\n </Box>\n ) : null;\n\n if (isReadOnly) {\n // Read-only renders the value as plain text, never as a disabled or\n // `readonly` input — both would tell assistive technology the value\n // cannot change, which is false: the buttons still change it.\n const readOnlyValue = String(committedValue ?? min ?? 0);\n return (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={sizeConfig.gap}\n width={sizeConfig.readOnlyWidth}\n role=\"group\"\n aria-label={ariaLabel || label}\n aria-disabled={disabled || undefined}\n data-testid={testID}\n >\n {decrementButton}\n <Box flex={1} minWidth={0} aria-live=\"polite\" alignItems=\"center\">\n <Text\n color={\n disabled\n ? theme.colors.control.input.textDisable\n : theme.colors.control.input.text\n }\n fontSize={inputSizing.fontSize}\n lineHeight={inputSizing.fontSize + 2}\n textAlign=\"center\"\n data-testid={testID ? `${testID}__value` : undefined}\n >\n {readOnlyValue}\n </Text>\n </Box>\n {incrementButton}\n </Box>\n );\n }\n\n const displayValue =\n draft !== null\n ? draft\n : committedValue === null\n ? \"\"\n : String(committedValue);\n\n return (\n <Box\n flexDirection=\"column\"\n gap={inputSizing.fieldGap}\n alignItems=\"flex-start\"\n role=\"group\"\n aria-label={showLabel ? undefined : ariaLabel}\n aria-labelledby={showLabel ? labelId : undefined}\n aria-disabled={disabled || undefined}\n data-testid={testID}\n >\n {labelNode}\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={sizeConfig.gap}\n width={sizeConfig.inputWidth}\n >\n {decrementButton}\n <Box flex={1} minWidth={0}>\n <Input\n ref={inputRef}\n id={counterId}\n name={name}\n size={size}\n value={displayValue}\n disabled={disabled}\n onChange={handleInputChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n // `type=\"text\"` + `inputMode=\"numeric\"`, not `type=\"number\"`,\n // which would add the browser's own spinners next to ours.\n type=\"text\"\n inputMode=\"numeric\"\n role=\"spinbutton\"\n aria-valuenow={committedValue ?? undefined}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-label={showLabel ? undefined : ariaLabel}\n {...(showLabel ? { \"aria-labelledby\": labelId } : {})}\n // Figma centers the value in the compact field.\n style={{ textAlign: \"center\" }}\n themeMode={themeMode}\n themeProductContext={themeProductContext}\n testID={testID ? `${testID}__input` : undefined}\n />\n </Box>\n {incrementButton}\n </Box>\n </Box>\n );\n }\n);\n\nCounter.displayName = \"Counter\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n AccessibilityRole,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleToAccessibilityRole: Record<string, AccessibilityRole> = {\n button: \"button\",\n link: \"link\",\n img: \"image\",\n image: \"image\",\n summary: \"summary\",\n switch: \"switch\",\n checkbox: \"checkbox\",\n radio: \"radio\",\n heading: \"header\",\n text: \"text\",\n search: \"search\",\n alert: \"alert\",\n none: \"none\",\n presentation: \"none\",\n progressbar: \"progressbar\",\n scrollbar: \"scrollbar\",\n adjustable: \"adjustable\",\n tab: \"tab\",\n menu: \"menu\",\n menuitem: \"menuitem\",\n list: \"list\",\n timer: \"timer\",\n};\n\n/** RN ViewStyle.gap is typed as number (Yoga gap), not DimensionValue. */\nconst toGapValue = (gap: number | string | undefined): number | undefined => {\n if (gap === undefined) return undefined;\n if (typeof gap === \"number\") return gap;\n const pxMatch = /^(\\d+(?:\\.\\d+)?)px$/.exec(gap);\n if (pxMatch) return Number(pxMatch[1]);\n const asNumber = Number(gap);\n return Number.isFinite(asNumber) ? asNumber : undefined;\n};\n\nexport const Box: React.FC<BoxProps> = ({\n children,\n onPress,\n onLayout,\n onMoveShouldSetResponder,\n onResponderGrant,\n onResponderMove,\n onResponderRelease,\n onResponderTerminate,\n backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius,\n borderStyle,\n height,\n padding,\n paddingHorizontal,\n paddingVertical,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n flexShrink,\n gap,\n overflow,\n opacity,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n disabled,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n opacity: opacity ?? (disabled ? 0.5 : undefined),\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n minWidth: minWidth as DimensionValue,\n minHeight: minHeight as DimensionValue,\n maxWidth: maxWidth as DimensionValue,\n maxHeight: maxHeight as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n flexDirection,\n flexWrap,\n alignItems,\n justifyContent,\n alignSelf,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n flexShrink,\n gap: toGapValue(gap),\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Map web a11y props; drop the rest of the web-only attributes before\n // spreading onto RN hosts (unknown props warn at runtime).\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\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 className,\n \"data-testid\": _dataTestId,\n cursor: _cursor,\n type: _type,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n const accessibilityRole =\n (typeof role === \"string\" && roleToAccessibilityRole[role]) ||\n (as === \"button\" ? \"button\" : undefined);\n const isDisabled = Boolean(disabled || ariaDisabled);\n const accessibilityState = {\n disabled: isDisabled || undefined,\n busy: Boolean(ariaBusy) || undefined,\n };\n const accessibilityLiveRegion =\n ariaLive === \"polite\" || ariaLive === \"assertive\" ? ariaLive : undefined;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : alt}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n // Prefer Pressable whenever the node is interactive or explicitly a button,\n // so disabled / aria-disabled controls stay in the a11y tree as buttons.\n if (onPress || as === \"button\") {\n return (\n <Pressable\n onPress={!isDisabled && onPress ? onPress : undefined}\n disabled={isDisabled}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={\n typeof ariaLabel === \"string\" ? ariaLabel : undefined\n }\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={typeof ariaLabel === \"string\" ? ariaLabel : undefined}\n accessibilityState={accessibilityState}\n accessibilityLiveRegion={accessibilityLiveRegion}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","import React from \"react\";\nimport {\n Text as RNText,\n TextStyle,\n AccessibilityRole,\n StyleSheet,\n} from \"react-native\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\n\nconst roleMap: Record<string, AccessibilityRole> = {\n alert: \"alert\",\n heading: \"header\",\n button: \"button\",\n link: \"link\",\n text: \"text\",\n};\n\nconst parseNumericValue = (\n value: string | number | undefined\n): number | undefined => {\n if (value === undefined) return undefined;\n if (typeof value === \"number\") return value;\n const parsed = parseFloat(value);\n return isNaN(parsed) ? undefined : parsed;\n};\n\nexport const Text: React.FC<TextProps> = ({\n children,\n color,\n fontSize,\n fontWeight,\n fontFamily,\n textAlign,\n lineHeight,\n numberOfLines,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n style: styleProp,\n ...props\n}) => {\n let resolvedFontFamily = fontFamily\n ? fontFamily.split(\",\")[0].replace(/['\"]/g, \"\").trim()\n : undefined;\n\n if (\n resolvedFontFamily === \"Pilat Wide\" ||\n resolvedFontFamily === \"Pilat Wide Bold\" ||\n resolvedFontFamily === \"Aktiv Grotesk\"\n ) {\n resolvedFontFamily = undefined;\n }\n\n const incomingStyle = StyleSheet.flatten(styleProp) as TextStyle | undefined;\n\n const baseStyle: TextStyle = {\n color: color ?? incomingStyle?.color,\n fontSize: typeof fontSize === \"number\" ? fontSize : undefined,\n fontWeight: fontWeight as TextStyle[\"fontWeight\"],\n fontFamily: resolvedFontFamily,\n textDecorationLine: props.textDecoration as TextStyle[\"textDecorationLine\"],\n textAlign: textAlign ?? incomingStyle?.textAlign,\n lineHeight: parseNumericValue(lineHeight ?? incomingStyle?.lineHeight),\n marginTop: parseNumericValue(\n incomingStyle?.marginTop as number | string | undefined\n ),\n marginBottom: parseNumericValue(\n incomingStyle?.marginBottom as number | string | undefined\n ),\n };\n\n const accessibilityRole = role ? roleMap[role] : undefined;\n\n return (\n <RNText\n style={baseStyle}\n numberOfLines={numberOfLines}\n testID={dataTestId || testID || id}\n accessibilityRole={accessibilityRole}\n >\n {children}\n </RNText>\n );\n};\n","import React from \"react\";\nimport { View, ViewStyle } from \"react-native\";\nimport { IconProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Icon: React.FC<IconProps> = ({\n children,\n color,\n size,\n testID,\n \"data-testid\": dataTestId,\n}) => {\n const style: ViewStyle = {\n width: typeof size === \"number\" ? size : undefined,\n height: typeof size === \"number\" ? size : undefined,\n alignItems: \"center\",\n justifyContent: \"center\",\n };\n\n // On native, we try to pass the color down to children (like Text primitives)\n // to mimic the CSS inheritance behavior of the web version.\n const childrenWithProps = React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n return React.cloneElement(child, {\n color: child.props.color || color,\n // Also pass size if child seems to be an icon that needs it\n size: child.props.size || size,\n });\n }\n return child;\n });\n\n return (\n <View style={style} testID={dataTestId || testID}>\n {childrenWithProps}\n </View>\n );\n};\n","export * from \"./Box\";\nexport * from \"./Text\";\nexport * from \"./Spinner\";\nexport * from \"./Icon\";\nexport * from \"./Divider\";\nexport * from \"./Input\";\nexport * from \"./TextArea\";\nexport * from \"./LinearGradient\";\n\nexport const isWeb = false;\nexport const isNative = true;\n","/**\n * Per-size geometry taken from the Figma \"Counter\" component set.\n *\n * `control` is the square box of the − / + buttons; `gap` is the spacing\n * between the three elements. `inputWidth` / `readOnlyWidth` are the full\n * control widths from Figma (buttons + gaps + value). Field height, radius,\n * and font size come from `theme.sizing.input(size)` / `theme.shape.input[size]`\n * because the middle of a `type=\"input\"` Counter is a standard Input.\n */\nexport const COUNTER_SIZE_CONFIG = {\n xl: { control: 28, gap: 10, inputWidth: 149, readOnlyWidth: 100 },\n lg: { control: 24, gap: 10, inputWidth: 142, readOnlyWidth: 90 },\n md: { control: 24, gap: 8, inputWidth: 132, readOnlyWidth: 83 },\n sm: { control: 18, gap: 8, inputWidth: 92, readOnlyWidth: 69 },\n xs: { control: 16, gap: 6, inputWidth: 82, readOnlyWidth: 59 },\n} as const;\n\n/**\n * Rounds `value` into `[min, max]`. A value above the maximum is rounded down\n * to the maximum, and a value below the minimum is rounded up to the minimum.\n * Missing bounds are unbounded on that side.\n */\nexport const clampToRange = (\n value: number,\n min?: number,\n max?: number\n): number => {\n let next = value;\n if (typeof min === \"number\" && next < min) next = min;\n if (typeof max === \"number\" && next > max) next = max;\n return next;\n};\n\n/**\n * Strips everything that cannot be part of an integer from typed input.\n * Non-numeric characters are rejected silently rather than flagged — Counter\n * has no error state. A single leading `-` survives only when negatives are\n * allowed.\n */\nexport const sanitizeCounterInput = (\n raw: string,\n allowNegative: boolean\n): string => {\n const digitsAndSigns = raw.replace(/[^\\d-]/g, \"\");\n const digits = digitsAndSigns.replace(/-/g, \"\");\n if (allowNegative && digitsAndSigns.startsWith(\"-\")) {\n return `-${digits}`;\n }\n return digits;\n};\n\n/**\n * Parses committed text into a number. Returns `null` for an empty field or a\n * lone `-`, which the caller resolves by restoring the previous value.\n */\nexport const parseCounterValue = (raw: string): number | null => {\n const trimmed = raw.trim();\n if (trimmed === \"\" || trimmed === \"-\") return null;\n const parsed = Number.parseInt(trimmed, 10);\n return Number.isNaN(parsed) ? null : parsed;\n};\n\n/**\n * True when the range allows values below zero, which is what decides whether\n * a typed `-` is kept.\n */\nexport const allowsNegative = (min?: number): boolean =>\n typeof min !== \"number\" || min < 0;\n"],"mappings":";AAAA,OAAOA,UAAS,YAAY,QAAQ,gBAAgB;;;ACCpD;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAMK;AAwMD;AArMN,IAAM,0BAA6D;AAAA,EACjE,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,cAAc;AAAA,EACd,aAAa;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,MAAM;AAAA,EACN,UAAU;AAAA,EACV,MAAM;AAAA,EACN,OAAO;AACT;AAGA,IAAM,aAAa,CAAC,QAAyD;AAC3E,MAAI,QAAQ,OAAW,QAAO;AAC9B,MAAI,OAAO,QAAQ,SAAU,QAAO;AACpC,QAAM,UAAU,sBAAsB,KAAK,GAAG;AAC9C,MAAI,QAAS,QAAO,OAAO,QAAQ,CAAC,CAAC;AACrC,QAAM,WAAW,OAAO,GAAG;AAC3B,SAAO,OAAO,SAAS,QAAQ,IAAI,WAAW;AAChD;AAEO,IAAM,MAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA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MAAK;AAAA,oBACL,iBAAe,kBAAkB;AAAA,oBACjC,iBAAe;AAAA,oBACf,iBAAe;AAAA,oBACf,cAAY,YAAY,SAAY;AAAA,oBACnC,GAAI,YAAY,EAAE,mBAAmB,QAAQ,IAAI,CAAC;AAAA,oBAEnD,OAAO,EAAE,WAAW,SAAS;AAAA,oBAC7B;AAAA,oBACA;AAAA,oBACA,QAAQ,SAAS,GAAG,MAAM,YAAY;AAAA;AAAA,gBACxC,GACF;AAAA,gBACC;AAAA;AAAA;AAAA,UACH;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,QAAQ,cAAc;","names":["React","jsx","View","jsx","jsx","React"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xsolla/xui-counter",
3
- "version": "0.201.5",
3
+ "version": "0.202.1",
4
4
  "main": "./web/index.js",
5
5
  "module": "./web/index.mjs",
6
6
  "types": "./web/index.d.ts",
@@ -13,10 +13,10 @@
13
13
  "test:coverage": "vitest run --coverage"
14
14
  },
15
15
  "dependencies": {
16
- "@xsolla/xui-core": "0.201.5",
17
- "@xsolla/xui-icons-base": "0.201.5",
18
- "@xsolla/xui-input": "0.201.5",
19
- "@xsolla/xui-primitives-core": "0.201.5"
16
+ "@xsolla/xui-core": "0.202.1",
17
+ "@xsolla/xui-icons-base": "0.202.1",
18
+ "@xsolla/xui-input": "0.202.1",
19
+ "@xsolla/xui-primitives-core": "0.202.1"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "react": ">=16.8.0",
package/web/index.js CHANGED
@@ -79,6 +79,7 @@ var ADDITIONAL_BLOCKED_PROPS = /* @__PURE__ */ new Set([
79
79
  "strokeWidth",
80
80
  // CSS properties that pass isPropValid but are used as component props
81
81
  "overflow",
82
+ "opacity",
82
83
  "cursor",
83
84
  "fontSize",
84
85
  "fontWeight",
@@ -188,11 +189,14 @@ var StyledBox = (0, import_styled_components.default)(FilteredDiv)`
188
189
  flex-shrink: ${(props) => props.flexShrink ?? 1};
189
190
  gap: ${(props) => typeof props.gap === "number" ? `${props.gap}px` : props.gap || 0};
190
191
  align-self: ${(props) => props.alignSelf || "auto"};
192
+ /* Only emit overflow-x/y when explicitly set. Defaulting them to
193
+ visible after overflow would override the shorthand and break
194
+ clipping (e.g. OtherCard bottom-right promo image). */
191
195
  overflow: ${(props) => props.overflow || "visible"};
192
- overflow-x: ${(props) => props.overflowX || "visible"};
193
- overflow-y: ${(props) => props.overflowY || "visible"};
196
+ ${(props) => props.overflowX != null ? `overflow-x: ${props.overflowX};` : ""}
197
+ ${(props) => props.overflowY != null ? `overflow-y: ${props.overflowY};` : ""}
194
198
  z-index: ${(props) => props.zIndex};
195
- opacity: ${(props) => props.disabled ? 0.5 : 1};
199
+ opacity: ${(props) => props.opacity != null ? props.opacity : props.disabled ? 0.5 : 1};
196
200
  pointer-events: ${(props) => props.disabled ? "none" : "auto"};
197
201
 
198
202
  &:hover {
@@ -243,6 +247,7 @@ var Box = import_react2.default.forwardRef(
243
247
  alt: alt || "",
244
248
  onError,
245
249
  onLoad,
250
+ "data-testid": dataTestId || testID,
246
251
  style: {
247
252
  display: "block",
248
253
  objectFit: "cover",
package/web/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.tsx","../../src/Counter.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/textTruncation.ts","../../../../foundation/primitives-web/src/Icon.tsx","../../../../foundation/primitives-web/src/index.tsx","../../src/utils.ts"],"sourcesContent":["export { Counter } from \"./Counter\";\nexport type { CounterProps, CounterType } from \"./types\";\n","import React, { forwardRef, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon, isWeb } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme, useId } from \"@xsolla/xui-core\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { MinusSq, PlusSq } from \"@xsolla/xui-icons-base\";\nimport type { CounterProps } from \"./types\";\nimport {\n COUNTER_SIZE_CONFIG,\n allowsNegative,\n clampToRange,\n parseCounterValue,\n sanitizeCounterInput,\n} from \"./utils\";\n\ninterface CounterButtonProps {\n icon: React.ReactNode;\n label: string;\n onPress: () => void;\n available: boolean;\n boxSize: number;\n borderRadius: number;\n color: string;\n hoverColor: string;\n testID?: string;\n}\n\nconst CounterButton: React.FC<CounterButtonProps> = ({\n icon,\n label,\n onPress,\n available,\n boxSize,\n borderRadius,\n color,\n hoverColor,\n testID,\n}) => (\n <Box\n as=\"button\"\n type=\"button\"\n width={boxSize}\n height={boxSize}\n flexShrink={0}\n alignItems=\"center\"\n justifyContent=\"center\"\n padding={0}\n borderWidth={0}\n borderRadius={borderRadius}\n backgroundColor=\"transparent\"\n cursor={available ? \"pointer\" : \"not-allowed\"}\n disabled={!available}\n aria-disabled={!available || undefined}\n aria-label={label}\n // Keep a stable Pressable host on native even when unavailable so the\n // control stays in the a11y tree with a disabled state.\n onPress={onPress}\n hoverStyle={available ? { backgroundColor: hoverColor } : undefined}\n // Keep focus in the field so a click does not commit-then-step.\n {...(isWeb && {\n onMouseDown: (e: React.MouseEvent<HTMLButtonElement>) =>\n e.preventDefault(),\n })}\n data-testid={testID}\n testID={testID}\n >\n <Icon size={boxSize} color={color}>\n {icon}\n </Icon>\n </Box>\n);\n\n/**\n * A numeric stepper that lets the user increase or decrease a value using\n * dedicated − and + buttons.\n *\n * Counter has no error state: values outside the allowed range are never\n * rejected, they are silently clamped to the nearest bound on commit, so the\n * component is always in a valid state.\n */\nexport const Counter = forwardRef<HTMLInputElement, CounterProps>(\n (\n {\n value,\n defaultValue = null,\n onChange,\n min,\n max,\n step = 1,\n size = \"md\",\n type = \"input\",\n disabled = false,\n label,\n \"aria-label\": ariaLabel,\n decrementLabel = \"Decrease quantity\",\n incrementLabel = \"Increase quantity\",\n name,\n id: providedId,\n testID,\n themeMode,\n themeProductContext,\n },\n ref\n ) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n\n const rawId = useId();\n const safeId = rawId.replace(/:/g, \"\");\n const counterId = providedId || `counter-${safeId}`;\n\n const isControlled = value !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState<number | null>(\n defaultValue\n );\n const committedValue = isControlled ? (value ?? null) : uncontrolledValue;\n\n // Text held while the user is mid-entry. `null` means \"show the committed\n // value\" — typing is never committed keystroke-by-keystroke.\n const [draft, setDraft] = useState<string | null>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n\n React.useImperativeHandle(\n ref,\n () => inputRef.current as HTMLInputElement,\n []\n );\n\n const sizeConfig = COUNTER_SIZE_CONFIG[size];\n const inputSizing = theme.sizing.input(size);\n const isReadOnly = type === \"readOnly\";\n\n // The value the buttons step from: an uncommitted draft wins over the last\n // committed value so typing 7 then pressing + lands on 8, not oldValue + 1.\n const pendingValue =\n draft !== null ? parseCounterValue(draft) : committedValue;\n const stepBase = pendingValue ?? min ?? 0;\n\n const canDecrement =\n !disabled && (typeof min !== \"number\" || stepBase > min);\n const canIncrement =\n !disabled && (typeof max !== \"number\" || stepBase < max);\n\n const commit = (next: number | null) => {\n setDraft(null);\n // An empty field on commit restores the previous value — the counter is\n // never left in an empty, indeterminate state after commit.\n const resolved = next ?? committedValue;\n if (resolved === null) return;\n const clamped = clampToRange(resolved, min, max);\n if (!isControlled) setUncontrolledValue(clamped);\n if (clamped !== committedValue) onChange?.(clamped);\n };\n\n const stepBy = (direction: 1 | -1) => {\n commit(clampToRange(stepBase + direction * step, min, max));\n };\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setDraft(sanitizeCounterInput(e.target.value, allowsNegative(min)));\n };\n\n const handleBlur = () => {\n commit(draft !== null ? parseCounterValue(draft) : committedValue);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"ArrowUp\") {\n e.preventDefault();\n if (canIncrement) stepBy(1);\n return;\n }\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n if (canDecrement) stepBy(-1);\n return;\n }\n if (e.key === \"Home\" && typeof min === \"number\") {\n e.preventDefault();\n commit(min);\n return;\n }\n if (e.key === \"End\" && typeof max === \"number\") {\n e.preventDefault();\n commit(max);\n return;\n }\n // Native TextInput reports Return as \"Enter\" or \"\\n\" via onKeyPress.\n if (e.key === \"Enter\" || e.key === \"\\n\") {\n e.preventDefault();\n commit(draft !== null ? parseCounterValue(draft) : committedValue);\n }\n };\n\n const enabledIconColor = theme.colors.content.secondary;\n const disabledIconColor = theme.colors.control.text.disable;\n const hoverColor = theme.colors.overlay.mono;\n const buttonRadius = theme.shape.input[size].borderRadius;\n\n const decrementButton = (\n <CounterButton\n icon={<MinusSq />}\n label={decrementLabel}\n onPress={() => {\n if (canDecrement) stepBy(-1);\n }}\n available={canDecrement}\n boxSize={sizeConfig.control}\n borderRadius={buttonRadius}\n color={canDecrement ? enabledIconColor : disabledIconColor}\n hoverColor={hoverColor}\n testID={testID ? `${testID}__decrement` : undefined}\n />\n );\n\n const incrementButton = (\n <CounterButton\n icon={<PlusSq />}\n label={incrementLabel}\n onPress={() => {\n if (canIncrement) stepBy(1);\n }}\n available={canIncrement}\n boxSize={sizeConfig.control}\n borderRadius={buttonRadius}\n color={canIncrement ? enabledIconColor : disabledIconColor}\n hoverColor={hoverColor}\n testID={testID ? `${testID}__increment` : undefined}\n />\n );\n\n // Label sits above the whole control row (buttons + value), never inside\n // the Input between the buttons — that would push − / + off the field's\n // vertical center (Figma Counter has no in-component label; labels come\n // from FieldGroup / adjacent text, or this convenience prop).\n const labelId = `${counterId}-label`;\n const showLabel = Boolean(label) && !isReadOnly;\n const labelNode = showLabel ? (\n <Box as=\"label\" id={labelId}>\n <Text\n color={theme.colors.content.secondary}\n fontSize={inputSizing.fontSize - 2}\n fontWeight=\"500\"\n >\n {label}\n </Text>\n </Box>\n ) : null;\n\n if (isReadOnly) {\n // Read-only renders the value as plain text, never as a disabled or\n // `readonly` input — both would tell assistive technology the value\n // cannot change, which is false: the buttons still change it.\n const readOnlyValue = String(committedValue ?? min ?? 0);\n return (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={sizeConfig.gap}\n width={sizeConfig.readOnlyWidth}\n role=\"group\"\n aria-label={ariaLabel || label}\n aria-disabled={disabled || undefined}\n data-testid={testID}\n >\n {decrementButton}\n <Box flex={1} minWidth={0} aria-live=\"polite\" alignItems=\"center\">\n <Text\n color={\n disabled\n ? theme.colors.control.input.textDisable\n : theme.colors.control.input.text\n }\n fontSize={inputSizing.fontSize}\n lineHeight={inputSizing.fontSize + 2}\n textAlign=\"center\"\n data-testid={testID ? `${testID}__value` : undefined}\n >\n {readOnlyValue}\n </Text>\n </Box>\n {incrementButton}\n </Box>\n );\n }\n\n const displayValue =\n draft !== null\n ? draft\n : committedValue === null\n ? \"\"\n : String(committedValue);\n\n return (\n <Box\n flexDirection=\"column\"\n gap={inputSizing.fieldGap}\n alignItems=\"flex-start\"\n role=\"group\"\n aria-label={showLabel ? undefined : ariaLabel}\n aria-labelledby={showLabel ? labelId : undefined}\n aria-disabled={disabled || undefined}\n data-testid={testID}\n >\n {labelNode}\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={sizeConfig.gap}\n width={sizeConfig.inputWidth}\n >\n {decrementButton}\n <Box flex={1} minWidth={0}>\n <Input\n ref={inputRef}\n id={counterId}\n name={name}\n size={size}\n value={displayValue}\n disabled={disabled}\n onChange={handleInputChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n // `type=\"text\"` + `inputMode=\"numeric\"`, not `type=\"number\"`,\n // which would add the browser's own spinners next to ours.\n type=\"text\"\n inputMode=\"numeric\"\n role=\"spinbutton\"\n aria-valuenow={committedValue ?? undefined}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-label={showLabel ? undefined : ariaLabel}\n {...(showLabel ? { \"aria-labelledby\": labelId } : {})}\n // Figma centers the value in the compact field.\n style={{ textAlign: \"center\" }}\n themeMode={themeMode}\n themeProductContext={themeProductContext}\n testID={testID ? `${testID}__input` : undefined}\n />\n </Box>\n {incrementButton}\n </Box>\n </Box>\n );\n }\n);\n\nCounter.displayName = \"Counter\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n ...props.style,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n // 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","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\nimport { truncationStyles } from \"./textTruncation\";\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 /* Keep last: single-line truncation has to win over white-space above. */\n ${(props) => truncationStyles(props.numberOfLines)}\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n data-testid={dataTestId || testID}\n />\n );\n};\n","/**\n * Web implementation of the cross-platform `numberOfLines` text prop.\n *\n * Native maps `numberOfLines` straight onto `RNText`. A web `<span>` has no\n * equivalent, so emit the CSS that produces the same result.\n *\n * Two details matter for the single-line case:\n * - `text-overflow` only takes effect on a block container, so the inline\n * `<span>` is promoted to `display: block` and capped at `max-width: 100%`.\n * - `min-width: 0` lets the text shrink below its own content width when it\n * sits in a flex row. Without it a `nowrap` label keeps its full intrinsic\n * width and pushes its siblings (icons, chevrons) out of a fixed-width field.\n *\n * Returns an empty string when there is nothing to clamp, so the declaration\n * block stays untouched for the majority of callers.\n */\nexport const truncationStyles = (numberOfLines?: number): string => {\n if (!numberOfLines || numberOfLines < 1) return \"\";\n\n if (numberOfLines === 1) {\n return `\n display: block;\n max-width: 100%;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `;\n }\n\n return `\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ${numberOfLines};\n line-clamp: ${numberOfLines};\n max-width: 100%;\n min-width: 0;\n overflow: hidden;\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 /* Icons paint themselves — each icon's own SVG sets its fill/stroke\n (icons-base via inline \"fill: currentColor\", Lucide via \"fill\"/\"stroke\"\n attributes). Do not add fill/stroke here: it re-strokes fill-based icons\n and thickens the glyph. See FEP-877. */\n svg {\n width: 100%;\n height: 100%;\n }\n`;\n\nexport const Icon: React.FC<IconProps> = ({\n children,\n testID,\n \"data-testid\": dataTestId,\n ...props\n}) => {\n return (\n <StyledIcon data-testid={dataTestId || testID} {...props}>\n {children}\n </StyledIcon>\n );\n};\n","export * from \"./Box\";\nexport * from \"./Text\";\nexport * from \"./Spinner\";\nexport * from \"./Icon\";\nexport * from \"./Divider\";\nexport * from \"./Input\";\nexport * from \"./TextArea\";\nexport * from \"./LinearGradient\";\n\nexport const isWeb = true;\nexport const isNative = false;\n","/**\n * Per-size geometry taken from the Figma \"Counter\" component set.\n *\n * `control` is the square box of the − / + buttons; `gap` is the spacing\n * between the three elements. `inputWidth` / `readOnlyWidth` are the full\n * control widths from Figma (buttons + gaps + value). Field height, radius,\n * and font size come from `theme.sizing.input(size)` / `theme.shape.input[size]`\n * because the middle of a `type=\"input\"` Counter is a standard Input.\n */\nexport const COUNTER_SIZE_CONFIG = {\n xl: { control: 28, gap: 10, inputWidth: 149, readOnlyWidth: 100 },\n lg: { control: 24, gap: 10, inputWidth: 142, readOnlyWidth: 90 },\n md: { control: 24, gap: 8, inputWidth: 132, readOnlyWidth: 83 },\n sm: { control: 18, gap: 8, inputWidth: 92, readOnlyWidth: 69 },\n xs: { control: 16, gap: 6, inputWidth: 82, readOnlyWidth: 59 },\n} as const;\n\n/**\n * Rounds `value` into `[min, max]`. A value above the maximum is rounded down\n * to the maximum, and a value below the minimum is rounded up to the minimum.\n * Missing bounds are unbounded on that side.\n */\nexport const clampToRange = (\n value: number,\n min?: number,\n max?: number\n): number => {\n let next = value;\n if (typeof min === \"number\" && next < min) next = min;\n if (typeof max === \"number\" && next > max) next = max;\n return next;\n};\n\n/**\n * Strips everything that cannot be part of an integer from typed input.\n * Non-numeric characters are rejected silently rather than flagged — Counter\n * has no error state. A single leading `-` survives only when negatives are\n * allowed.\n */\nexport const sanitizeCounterInput = (\n raw: string,\n allowNegative: boolean\n): string => {\n const digitsAndSigns = raw.replace(/[^\\d-]/g, \"\");\n const digits = digitsAndSigns.replace(/-/g, \"\");\n if (allowNegative && digitsAndSigns.startsWith(\"-\")) {\n return `-${digits}`;\n }\n return digits;\n};\n\n/**\n * Parses committed text into a number. Returns `null` for an empty field or a\n * lone `-`, which the caller resolves by restoring the previous value.\n */\nexport const parseCounterValue = (raw: string): number | null => {\n const trimmed = raw.trim();\n if (trimmed === \"\" || trimmed === \"-\") return null;\n const parsed = Number.parseInt(trimmed, 10);\n return Number.isNaN(parsed) ? null : parsed;\n};\n\n/**\n * True when the range allows values below zero, which is what decides whether\n * a typed `-` is kept.\n */\nexport const allowsNegative = (min?: number): boolean =>\n typeof min !== \"number\" || min < 0;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAoD;;;ACApD,IAAAC,gBAAkB;AAClB,+BAAmB;;;ACDnB,mBAAkB;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SAAO,SAAU,KAAK;AACpB,QAAI,MAAM,GAAG,MAAM,OAAW,OAAM,GAAG,IAAI,GAAG,GAAG;AACjD,WAAO,MAAM,GAAG;AAAA,EAClB;AACF;AAEA,IAAO,sBAAQ;;;ACNf,IAA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Y;AAAA;AAAA,gBACxC,GACF;AAAA,gBACC;AAAA;AAAA;AAAA,UACH;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,QAAQ,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","React"]}
1
+ {"version":3,"sources":["../../src/index.tsx","../../src/Counter.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/textTruncation.ts","../../../../foundation/primitives-web/src/Icon.tsx","../../../../foundation/primitives-web/src/index.tsx","../../src/utils.ts"],"sourcesContent":["export { Counter } from \"./Counter\";\nexport type { CounterProps, CounterType } from \"./types\";\n","import React, { forwardRef, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon, isWeb } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme, useId } from \"@xsolla/xui-core\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { MinusSq, PlusSq } from \"@xsolla/xui-icons-base\";\nimport type { CounterProps } from \"./types\";\nimport {\n COUNTER_SIZE_CONFIG,\n allowsNegative,\n clampToRange,\n parseCounterValue,\n sanitizeCounterInput,\n} from \"./utils\";\n\ninterface CounterButtonProps {\n icon: React.ReactNode;\n label: string;\n onPress: () => void;\n available: boolean;\n boxSize: number;\n borderRadius: number;\n color: string;\n hoverColor: string;\n testID?: string;\n}\n\nconst CounterButton: React.FC<CounterButtonProps> = ({\n icon,\n label,\n onPress,\n available,\n boxSize,\n borderRadius,\n color,\n hoverColor,\n testID,\n}) => (\n <Box\n as=\"button\"\n type=\"button\"\n width={boxSize}\n height={boxSize}\n flexShrink={0}\n alignItems=\"center\"\n justifyContent=\"center\"\n padding={0}\n borderWidth={0}\n borderRadius={borderRadius}\n backgroundColor=\"transparent\"\n cursor={available ? \"pointer\" : \"not-allowed\"}\n disabled={!available}\n aria-disabled={!available || undefined}\n aria-label={label}\n // Keep a stable Pressable host on native even when unavailable so the\n // control stays in the a11y tree with a disabled state.\n onPress={onPress}\n hoverStyle={available ? { backgroundColor: hoverColor } : undefined}\n // Keep focus in the field so a click does not commit-then-step.\n {...(isWeb && {\n onMouseDown: (e: React.MouseEvent<HTMLButtonElement>) =>\n e.preventDefault(),\n })}\n data-testid={testID}\n testID={testID}\n >\n <Icon size={boxSize} color={color}>\n {icon}\n </Icon>\n </Box>\n);\n\n/**\n * A numeric stepper that lets the user increase or decrease a value using\n * dedicated − and + buttons.\n *\n * Counter has no error state: values outside the allowed range are never\n * rejected, they are silently clamped to the nearest bound on commit, so the\n * component is always in a valid state.\n */\nexport const Counter = forwardRef<HTMLInputElement, CounterProps>(\n (\n {\n value,\n defaultValue = null,\n onChange,\n min,\n max,\n step = 1,\n size = \"md\",\n type = \"input\",\n disabled = false,\n label,\n \"aria-label\": ariaLabel,\n decrementLabel = \"Decrease quantity\",\n incrementLabel = \"Increase quantity\",\n name,\n id: providedId,\n testID,\n themeMode,\n themeProductContext,\n },\n ref\n ) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n\n const rawId = useId();\n const safeId = rawId.replace(/:/g, \"\");\n const counterId = providedId || `counter-${safeId}`;\n\n const isControlled = value !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState<number | null>(\n defaultValue\n );\n const committedValue = isControlled ? (value ?? null) : uncontrolledValue;\n\n // Text held while the user is mid-entry. `null` means \"show the committed\n // value\" — typing is never committed keystroke-by-keystroke.\n const [draft, setDraft] = useState<string | null>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n\n React.useImperativeHandle(\n ref,\n () => inputRef.current as HTMLInputElement,\n []\n );\n\n const sizeConfig = COUNTER_SIZE_CONFIG[size];\n const inputSizing = theme.sizing.input(size);\n const isReadOnly = type === \"readOnly\";\n\n // The value the buttons step from: an uncommitted draft wins over the last\n // committed value so typing 7 then pressing + lands on 8, not oldValue + 1.\n const pendingValue =\n draft !== null ? parseCounterValue(draft) : committedValue;\n const stepBase = pendingValue ?? min ?? 0;\n\n const canDecrement =\n !disabled && (typeof min !== \"number\" || stepBase > min);\n const canIncrement =\n !disabled && (typeof max !== \"number\" || stepBase < max);\n\n const commit = (next: number | null) => {\n setDraft(null);\n // An empty field on commit restores the previous value — the counter is\n // never left in an empty, indeterminate state after commit.\n const resolved = next ?? committedValue;\n if (resolved === null) return;\n const clamped = clampToRange(resolved, min, max);\n if (!isControlled) setUncontrolledValue(clamped);\n if (clamped !== committedValue) onChange?.(clamped);\n };\n\n const stepBy = (direction: 1 | -1) => {\n commit(clampToRange(stepBase + direction * step, min, max));\n };\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setDraft(sanitizeCounterInput(e.target.value, allowsNegative(min)));\n };\n\n const handleBlur = () => {\n commit(draft !== null ? parseCounterValue(draft) : committedValue);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"ArrowUp\") {\n e.preventDefault();\n if (canIncrement) stepBy(1);\n return;\n }\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n if (canDecrement) stepBy(-1);\n return;\n }\n if (e.key === \"Home\" && typeof min === \"number\") {\n e.preventDefault();\n commit(min);\n return;\n }\n if (e.key === \"End\" && typeof max === \"number\") {\n e.preventDefault();\n commit(max);\n return;\n }\n // Native TextInput reports Return as \"Enter\" or \"\\n\" via onKeyPress.\n if (e.key === \"Enter\" || e.key === \"\\n\") {\n e.preventDefault();\n commit(draft !== null ? parseCounterValue(draft) : committedValue);\n }\n };\n\n const enabledIconColor = theme.colors.content.secondary;\n const disabledIconColor = theme.colors.control.text.disable;\n const hoverColor = theme.colors.overlay.mono;\n const buttonRadius = theme.shape.input[size].borderRadius;\n\n const decrementButton = (\n <CounterButton\n icon={<MinusSq />}\n label={decrementLabel}\n onPress={() => {\n if (canDecrement) stepBy(-1);\n }}\n available={canDecrement}\n boxSize={sizeConfig.control}\n borderRadius={buttonRadius}\n color={canDecrement ? enabledIconColor : disabledIconColor}\n hoverColor={hoverColor}\n testID={testID ? `${testID}__decrement` : undefined}\n />\n );\n\n const incrementButton = (\n <CounterButton\n icon={<PlusSq />}\n label={incrementLabel}\n onPress={() => {\n if (canIncrement) stepBy(1);\n }}\n available={canIncrement}\n boxSize={sizeConfig.control}\n borderRadius={buttonRadius}\n color={canIncrement ? enabledIconColor : disabledIconColor}\n hoverColor={hoverColor}\n testID={testID ? `${testID}__increment` : undefined}\n />\n );\n\n // Label sits above the whole control row (buttons + value), never inside\n // the Input between the buttons — that would push − / + off the field's\n // vertical center (Figma Counter has no in-component label; labels come\n // from FieldGroup / adjacent text, or this convenience prop).\n const labelId = `${counterId}-label`;\n const showLabel = Boolean(label) && !isReadOnly;\n const labelNode = showLabel ? (\n <Box as=\"label\" id={labelId}>\n <Text\n color={theme.colors.content.secondary}\n fontSize={inputSizing.fontSize - 2}\n fontWeight=\"500\"\n >\n {label}\n </Text>\n </Box>\n ) : null;\n\n if (isReadOnly) {\n // Read-only renders the value as plain text, never as a disabled or\n // `readonly` input — both would tell assistive technology the value\n // cannot change, which is false: the buttons still change it.\n const readOnlyValue = String(committedValue ?? min ?? 0);\n return (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={sizeConfig.gap}\n width={sizeConfig.readOnlyWidth}\n role=\"group\"\n aria-label={ariaLabel || label}\n aria-disabled={disabled || undefined}\n data-testid={testID}\n >\n {decrementButton}\n <Box flex={1} minWidth={0} aria-live=\"polite\" alignItems=\"center\">\n <Text\n color={\n disabled\n ? theme.colors.control.input.textDisable\n : theme.colors.control.input.text\n }\n fontSize={inputSizing.fontSize}\n lineHeight={inputSizing.fontSize + 2}\n textAlign=\"center\"\n data-testid={testID ? `${testID}__value` : undefined}\n >\n {readOnlyValue}\n </Text>\n </Box>\n {incrementButton}\n </Box>\n );\n }\n\n const displayValue =\n draft !== null\n ? draft\n : committedValue === null\n ? \"\"\n : String(committedValue);\n\n return (\n <Box\n flexDirection=\"column\"\n gap={inputSizing.fieldGap}\n alignItems=\"flex-start\"\n role=\"group\"\n aria-label={showLabel ? undefined : ariaLabel}\n aria-labelledby={showLabel ? labelId : undefined}\n aria-disabled={disabled || undefined}\n data-testid={testID}\n >\n {labelNode}\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={sizeConfig.gap}\n width={sizeConfig.inputWidth}\n >\n {decrementButton}\n <Box flex={1} minWidth={0}>\n <Input\n ref={inputRef}\n id={counterId}\n name={name}\n size={size}\n value={displayValue}\n disabled={disabled}\n onChange={handleInputChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n // `type=\"text\"` + `inputMode=\"numeric\"`, not `type=\"number\"`,\n // which would add the browser's own spinners next to ours.\n type=\"text\"\n inputMode=\"numeric\"\n role=\"spinbutton\"\n aria-valuenow={committedValue ?? undefined}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-label={showLabel ? undefined : ariaLabel}\n {...(showLabel ? { \"aria-labelledby\": labelId } : {})}\n // Figma centers the value in the compact field.\n style={{ textAlign: \"center\" }}\n themeMode={themeMode}\n themeProductContext={themeProductContext}\n testID={testID ? `${testID}__input` : undefined}\n />\n </Box>\n {incrementButton}\n </Box>\n </Box>\n );\n }\n);\n\nCounter.displayName = \"Counter\";\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 &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n 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","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\nimport { truncationStyles } from \"./textTruncation\";\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 /* Keep last: single-line truncation has to win over white-space above. */\n ${(props) => truncationStyles(props.numberOfLines)}\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n data-testid={dataTestId || testID}\n />\n );\n};\n","/**\n * Web implementation of the cross-platform `numberOfLines` text prop.\n *\n * Native maps `numberOfLines` straight onto `RNText`. A web `<span>` has no\n * equivalent, so emit the CSS that produces the same result.\n *\n * Two details matter for the single-line case:\n * - `text-overflow` only takes effect on a block container, so the inline\n * `<span>` is promoted to `display: block` and capped at `max-width: 100%`.\n * - `min-width: 0` lets the text shrink below its own content width when it\n * sits in a flex row. Without it a `nowrap` label keeps its full intrinsic\n * width and pushes its siblings (icons, chevrons) out of a fixed-width field.\n *\n * Returns an empty string when there is nothing to clamp, so the declaration\n * block stays untouched for the majority of callers.\n */\nexport const truncationStyles = (numberOfLines?: number): string => {\n if (!numberOfLines || numberOfLines < 1) return \"\";\n\n if (numberOfLines === 1) {\n return `\n display: block;\n max-width: 100%;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `;\n }\n\n return `\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ${numberOfLines};\n line-clamp: ${numberOfLines};\n max-width: 100%;\n min-width: 0;\n overflow: hidden;\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 /* Icons paint themselves — each icon's own SVG sets its fill/stroke\n (icons-base via inline \"fill: currentColor\", Lucide via \"fill\"/\"stroke\"\n attributes). Do not add fill/stroke here: it re-strokes fill-based icons\n and thickens the glyph. See FEP-877. */\n svg {\n width: 100%;\n height: 100%;\n }\n`;\n\nexport const Icon: React.FC<IconProps> = ({\n children,\n testID,\n \"data-testid\": dataTestId,\n ...props\n}) => {\n return (\n <StyledIcon data-testid={dataTestId || testID} {...props}>\n {children}\n </StyledIcon>\n );\n};\n","export * from \"./Box\";\nexport * from \"./Text\";\nexport * from \"./Spinner\";\nexport * from \"./Icon\";\nexport * from \"./Divider\";\nexport * from \"./Input\";\nexport * from \"./TextArea\";\nexport * from \"./LinearGradient\";\n\nexport const isWeb = true;\nexport const isNative = false;\n","/**\n * Per-size geometry taken from the Figma \"Counter\" component set.\n *\n * `control` is the square box of the − / + buttons; `gap` is the spacing\n * between the three elements. `inputWidth` / `readOnlyWidth` are the full\n * control widths from Figma (buttons + gaps + value). Field height, radius,\n * and font size come from `theme.sizing.input(size)` / `theme.shape.input[size]`\n * because the middle of a `type=\"input\"` Counter is a standard Input.\n */\nexport const COUNTER_SIZE_CONFIG = {\n xl: { control: 28, gap: 10, inputWidth: 149, readOnlyWidth: 100 },\n lg: { control: 24, gap: 10, inputWidth: 142, readOnlyWidth: 90 },\n md: { control: 24, gap: 8, inputWidth: 132, readOnlyWidth: 83 },\n sm: { control: 18, gap: 8, inputWidth: 92, readOnlyWidth: 69 },\n xs: { control: 16, gap: 6, inputWidth: 82, readOnlyWidth: 59 },\n} as const;\n\n/**\n * Rounds `value` into `[min, max]`. A value above the maximum is rounded down\n * to the maximum, and a value below the minimum is rounded up to the minimum.\n * Missing bounds are unbounded on that side.\n */\nexport const clampToRange = (\n value: number,\n min?: number,\n max?: number\n): number => {\n let next = value;\n if (typeof min === \"number\" && next < min) next = min;\n if (typeof max === \"number\" && next > max) next = max;\n return next;\n};\n\n/**\n * Strips everything that cannot be part of an integer from typed input.\n * Non-numeric characters are rejected silently rather than flagged — Counter\n * has no error state. A single leading `-` survives only when negatives are\n * allowed.\n */\nexport const sanitizeCounterInput = (\n raw: string,\n allowNegative: boolean\n): string => {\n const digitsAndSigns = raw.replace(/[^\\d-]/g, \"\");\n const digits = digitsAndSigns.replace(/-/g, \"\");\n if (allowNegative && digitsAndSigns.startsWith(\"-\")) {\n return `-${digits}`;\n }\n return digits;\n};\n\n/**\n * Parses committed text into a number. Returns `null` for an empty field or a\n * lone `-`, which the caller resolves by restoring the previous value.\n */\nexport const parseCounterValue = (raw: string): number | null => {\n const trimmed = raw.trim();\n if (trimmed === \"\" || trimmed === \"-\") return null;\n const parsed = Number.parseInt(trimmed, 10);\n return Number.isNaN(parsed) ? null : parsed;\n};\n\n/**\n * True when the range allows values below zero, which is what decides whether\n * a typed `-` is kept.\n */\nexport const allowsNegative = (min?: number): boolean =>\n typeof min !== \"number\" || min < 0;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAoD;;;ACApD,IAAAC,gBAAkB;AAClB,+BAAmB;;;ACDnB,mBAAkB;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SAAO,SAAU,KAAK;AACpB,QAAI,MAAM,GAAG,MAAM,OAAW,OAAM,GAAG,IAAI,GAAG,GAAG;AACjD,WAAO,MAAM,GAAG;AAAA,EAClB;AACF;AAEA,IAAO,sBAAQ;;;ACNf,IAAI,kBAAkB;AAEtB,IAAI,QAAQ;AAAA,EAAQ,SAAU,MAAM;AAClC,WAAO,gBAAgB,KAAK,IAAI,KAAK,KAAK,WAAW,CAAC,MAAM,OAEzD,KAAK,WAAW,CAAC,MAAM,OAEvB,KAAK,WAAW,CAAC,IAAI;AAAA,EAC1B;AAAA;AAEA;AAEA,IAAO,4BAAQ;;;AFRR,IAAM,2BAA2B,oBAAI,IAAI;AAAA;AAAA,EAE9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;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AAA,YACC;AAAA;AAAA;AAAA,MACH;AAAA,IAEJ;AAEA,UAAM,eACJ,UAAU,OACN,QACA,mBAAmB,OACjB,KACA,OAAO,cAAc;AAE7B,WACE;AAAA,MAAC;AAAA;AAAA,QACC,eAAc;AAAA,QACd,KAAK,YAAY;AAAA,QACjB,YAAW;AAAA,QACX,MAAK;AAAA,QACL,cAAY,YAAY,SAAY;AAAA,QACpC,mBAAiB,YAAY,UAAU;AAAA,QACvC,iBAAe,YAAY;AAAA,QAC3B,eAAa;AAAA,QAEZ;AAAA;AAAA,UACD;AAAA,YAAC;AAAA;AAAA,cACC,eAAc;AAAA,cACd,YAAW;AAAA,cACX,KAAK,WAAW;AAAA,cAChB,OAAO,WAAW;AAAA,cAEjB;AAAA;AAAA,gBACD,6CAAC,OAAI,MAAM,GAAG,UAAU,GACtB;AAAA,kBAAC;AAAA;AAAA,oBACC,KAAK;AAAA,oBACL,IAAI;AAAA,oBACJ;AAAA,oBACA;AAAA,oBACA,OAAO;AAAA,oBACP;AAAA,oBACA,UAAU;AAAA,oBACV,QAAQ;AAAA,oBACR,WAAW;AAAA,oBAGX,MAAK;AAAA,oBACL,WAAU;AAAA,oBACV,MAAK;AAAA,oBACL,iBAAe,kBAAkB;AAAA,oBACjC,iBAAe;AAAA,oBACf,iBAAe;AAAA,oBACf,cAAY,YAAY,SAAY;AAAA,oBACnC,GAAI,YAAY,EAAE,mBAAmB,QAAQ,IAAI,CAAC;AAAA,oBAEnD,OAAO,EAAE,WAAW,SAAS;AAAA,oBAC7B;AAAA,oBACA;AAAA,oBACA,QAAQ,SAAS,GAAG,MAAM,YAAY;AAAA;AAAA,gBACxC,GACF;AAAA,gBACC;AAAA;AAAA;AAAA,UACH;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,QAAQ,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","React"]}
package/web/index.mjs CHANGED
@@ -43,6 +43,7 @@ var ADDITIONAL_BLOCKED_PROPS = /* @__PURE__ */ new Set([
43
43
  "strokeWidth",
44
44
  // CSS properties that pass isPropValid but are used as component props
45
45
  "overflow",
46
+ "opacity",
46
47
  "cursor",
47
48
  "fontSize",
48
49
  "fontWeight",
@@ -152,11 +153,14 @@ var StyledBox = styled(FilteredDiv)`
152
153
  flex-shrink: ${(props) => props.flexShrink ?? 1};
153
154
  gap: ${(props) => typeof props.gap === "number" ? `${props.gap}px` : props.gap || 0};
154
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). */
155
159
  overflow: ${(props) => props.overflow || "visible"};
156
- overflow-x: ${(props) => props.overflowX || "visible"};
157
- overflow-y: ${(props) => props.overflowY || "visible"};
160
+ ${(props) => props.overflowX != null ? `overflow-x: ${props.overflowX};` : ""}
161
+ ${(props) => props.overflowY != null ? `overflow-y: ${props.overflowY};` : ""}
158
162
  z-index: ${(props) => props.zIndex};
159
- opacity: ${(props) => props.disabled ? 0.5 : 1};
163
+ opacity: ${(props) => props.opacity != null ? props.opacity : props.disabled ? 0.5 : 1};
160
164
  pointer-events: ${(props) => props.disabled ? "none" : "auto"};
161
165
 
162
166
  &:hover {
@@ -207,6 +211,7 @@ var Box = React2.forwardRef(
207
211
  alt: alt || "",
208
212
  onError,
209
213
  onLoad,
214
+ "data-testid": dataTestId || testID,
210
215
  style: {
211
216
  display: "block",
212
217
  objectFit: "cover",
package/web/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Counter.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/textTruncation.ts","../../../../foundation/primitives-web/src/Icon.tsx","../../../../foundation/primitives-web/src/index.tsx","../../src/utils.ts"],"sourcesContent":["import React, { forwardRef, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon, isWeb } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme, useId } from \"@xsolla/xui-core\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { MinusSq, PlusSq } from \"@xsolla/xui-icons-base\";\nimport type { CounterProps } from \"./types\";\nimport {\n COUNTER_SIZE_CONFIG,\n allowsNegative,\n clampToRange,\n parseCounterValue,\n sanitizeCounterInput,\n} from \"./utils\";\n\ninterface CounterButtonProps {\n icon: React.ReactNode;\n label: string;\n onPress: () => void;\n available: boolean;\n boxSize: number;\n borderRadius: number;\n color: string;\n hoverColor: string;\n testID?: string;\n}\n\nconst CounterButton: React.FC<CounterButtonProps> = ({\n icon,\n label,\n onPress,\n available,\n boxSize,\n borderRadius,\n color,\n hoverColor,\n testID,\n}) => (\n <Box\n as=\"button\"\n type=\"button\"\n width={boxSize}\n height={boxSize}\n flexShrink={0}\n alignItems=\"center\"\n justifyContent=\"center\"\n padding={0}\n borderWidth={0}\n borderRadius={borderRadius}\n backgroundColor=\"transparent\"\n cursor={available ? \"pointer\" : \"not-allowed\"}\n disabled={!available}\n aria-disabled={!available || undefined}\n aria-label={label}\n // Keep a stable Pressable host on native even when unavailable so the\n // control stays in the a11y tree with a disabled state.\n onPress={onPress}\n hoverStyle={available ? { backgroundColor: hoverColor } : undefined}\n // Keep focus in the field so a click does not commit-then-step.\n {...(isWeb && {\n onMouseDown: (e: React.MouseEvent<HTMLButtonElement>) =>\n e.preventDefault(),\n })}\n data-testid={testID}\n testID={testID}\n >\n <Icon size={boxSize} color={color}>\n {icon}\n </Icon>\n </Box>\n);\n\n/**\n * A numeric stepper that lets the user increase or decrease a value using\n * dedicated − and + buttons.\n *\n * Counter has no error state: values outside the allowed range are never\n * rejected, they are silently clamped to the nearest bound on commit, so the\n * component is always in a valid state.\n */\nexport const Counter = forwardRef<HTMLInputElement, CounterProps>(\n (\n {\n value,\n defaultValue = null,\n onChange,\n min,\n max,\n step = 1,\n size = \"md\",\n type = \"input\",\n disabled = false,\n label,\n \"aria-label\": ariaLabel,\n decrementLabel = \"Decrease quantity\",\n incrementLabel = \"Increase quantity\",\n name,\n id: providedId,\n testID,\n themeMode,\n themeProductContext,\n },\n ref\n ) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n\n const rawId = useId();\n const safeId = rawId.replace(/:/g, \"\");\n const counterId = providedId || `counter-${safeId}`;\n\n const isControlled = value !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState<number | null>(\n defaultValue\n );\n const committedValue = isControlled ? (value ?? null) : uncontrolledValue;\n\n // Text held while the user is mid-entry. `null` means \"show the committed\n // value\" — typing is never committed keystroke-by-keystroke.\n const [draft, setDraft] = useState<string | null>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n\n React.useImperativeHandle(\n ref,\n () => inputRef.current as HTMLInputElement,\n []\n );\n\n const sizeConfig = COUNTER_SIZE_CONFIG[size];\n const inputSizing = theme.sizing.input(size);\n const isReadOnly = type === \"readOnly\";\n\n // The value the buttons step from: an uncommitted draft wins over the last\n // committed value so typing 7 then pressing + lands on 8, not oldValue + 1.\n const pendingValue =\n draft !== null ? parseCounterValue(draft) : committedValue;\n const stepBase = pendingValue ?? min ?? 0;\n\n const canDecrement =\n !disabled && (typeof min !== \"number\" || stepBase > min);\n const canIncrement =\n !disabled && (typeof max !== \"number\" || stepBase < max);\n\n const commit = (next: number | null) => {\n setDraft(null);\n // An empty field on commit restores the previous value — the counter is\n // never left in an empty, indeterminate state after commit.\n const resolved = next ?? committedValue;\n if (resolved === null) return;\n const clamped = clampToRange(resolved, min, max);\n if (!isControlled) setUncontrolledValue(clamped);\n if (clamped !== committedValue) onChange?.(clamped);\n };\n\n const stepBy = (direction: 1 | -1) => {\n commit(clampToRange(stepBase + direction * step, min, max));\n };\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setDraft(sanitizeCounterInput(e.target.value, allowsNegative(min)));\n };\n\n const handleBlur = () => {\n commit(draft !== null ? parseCounterValue(draft) : committedValue);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"ArrowUp\") {\n e.preventDefault();\n if (canIncrement) stepBy(1);\n return;\n }\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n if (canDecrement) stepBy(-1);\n return;\n }\n if (e.key === \"Home\" && typeof min === \"number\") {\n e.preventDefault();\n commit(min);\n return;\n }\n if (e.key === \"End\" && typeof max === \"number\") {\n e.preventDefault();\n commit(max);\n return;\n }\n // Native TextInput reports Return as \"Enter\" or \"\\n\" via onKeyPress.\n if (e.key === \"Enter\" || e.key === \"\\n\") {\n e.preventDefault();\n commit(draft !== null ? parseCounterValue(draft) : committedValue);\n }\n };\n\n const enabledIconColor = theme.colors.content.secondary;\n const disabledIconColor = theme.colors.control.text.disable;\n const hoverColor = theme.colors.overlay.mono;\n const buttonRadius = theme.shape.input[size].borderRadius;\n\n const decrementButton = (\n <CounterButton\n icon={<MinusSq />}\n label={decrementLabel}\n onPress={() => {\n if (canDecrement) stepBy(-1);\n }}\n available={canDecrement}\n boxSize={sizeConfig.control}\n borderRadius={buttonRadius}\n color={canDecrement ? enabledIconColor : disabledIconColor}\n hoverColor={hoverColor}\n testID={testID ? `${testID}__decrement` : undefined}\n />\n );\n\n const incrementButton = (\n <CounterButton\n icon={<PlusSq />}\n label={incrementLabel}\n onPress={() => {\n if (canIncrement) stepBy(1);\n }}\n available={canIncrement}\n boxSize={sizeConfig.control}\n borderRadius={buttonRadius}\n color={canIncrement ? enabledIconColor : disabledIconColor}\n hoverColor={hoverColor}\n testID={testID ? `${testID}__increment` : undefined}\n />\n );\n\n // Label sits above the whole control row (buttons + value), never inside\n // the Input between the buttons — that would push − / + off the field's\n // vertical center (Figma Counter has no in-component label; labels come\n // from FieldGroup / adjacent text, or this convenience prop).\n const labelId = `${counterId}-label`;\n const showLabel = Boolean(label) && !isReadOnly;\n const labelNode = showLabel ? (\n <Box as=\"label\" id={labelId}>\n <Text\n color={theme.colors.content.secondary}\n fontSize={inputSizing.fontSize - 2}\n fontWeight=\"500\"\n >\n {label}\n </Text>\n </Box>\n ) : null;\n\n if (isReadOnly) {\n // Read-only renders the value as plain text, never as a disabled or\n // `readonly` input — both would tell assistive technology the value\n // cannot change, which is false: the buttons still change it.\n const readOnlyValue = String(committedValue ?? min ?? 0);\n return (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={sizeConfig.gap}\n width={sizeConfig.readOnlyWidth}\n role=\"group\"\n aria-label={ariaLabel || label}\n aria-disabled={disabled || undefined}\n data-testid={testID}\n >\n {decrementButton}\n <Box flex={1} minWidth={0} aria-live=\"polite\" alignItems=\"center\">\n <Text\n color={\n disabled\n ? theme.colors.control.input.textDisable\n : theme.colors.control.input.text\n }\n fontSize={inputSizing.fontSize}\n lineHeight={inputSizing.fontSize + 2}\n textAlign=\"center\"\n data-testid={testID ? `${testID}__value` : undefined}\n >\n {readOnlyValue}\n </Text>\n </Box>\n {incrementButton}\n </Box>\n );\n }\n\n const displayValue =\n draft !== null\n ? draft\n : committedValue === null\n ? \"\"\n : String(committedValue);\n\n return (\n <Box\n flexDirection=\"column\"\n gap={inputSizing.fieldGap}\n alignItems=\"flex-start\"\n role=\"group\"\n aria-label={showLabel ? undefined : ariaLabel}\n aria-labelledby={showLabel ? labelId : undefined}\n aria-disabled={disabled || undefined}\n data-testid={testID}\n >\n {labelNode}\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={sizeConfig.gap}\n width={sizeConfig.inputWidth}\n >\n {decrementButton}\n <Box flex={1} minWidth={0}>\n <Input\n ref={inputRef}\n id={counterId}\n name={name}\n size={size}\n value={displayValue}\n disabled={disabled}\n onChange={handleInputChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n // `type=\"text\"` + `inputMode=\"numeric\"`, not `type=\"number\"`,\n // which would add the browser's own spinners next to ours.\n type=\"text\"\n inputMode=\"numeric\"\n role=\"spinbutton\"\n aria-valuenow={committedValue ?? undefined}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-label={showLabel ? undefined : ariaLabel}\n {...(showLabel ? { \"aria-labelledby\": labelId } : {})}\n // Figma centers the value in the compact field.\n style={{ textAlign: \"center\" }}\n themeMode={themeMode}\n themeProductContext={themeProductContext}\n testID={testID ? `${testID}__input` : undefined}\n />\n </Box>\n {incrementButton}\n </Box>\n </Box>\n );\n }\n);\n\nCounter.displayName = \"Counter\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n ...props.style,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n // 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","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\nimport { truncationStyles } from \"./textTruncation\";\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 /* Keep last: single-line truncation has to win over white-space above. */\n ${(props) => truncationStyles(props.numberOfLines)}\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n data-testid={dataTestId || testID}\n />\n );\n};\n","/**\n * Web implementation of the cross-platform `numberOfLines` text prop.\n *\n * Native maps `numberOfLines` straight onto `RNText`. A web `<span>` has no\n * equivalent, so emit the CSS that produces the same result.\n *\n * Two details matter for the single-line case:\n * - `text-overflow` only takes effect on a block container, so the inline\n * `<span>` is promoted to `display: block` and capped at `max-width: 100%`.\n * - `min-width: 0` lets the text shrink below its own content width when it\n * sits in a flex row. Without it a `nowrap` label keeps its full intrinsic\n * width and pushes its siblings (icons, chevrons) out of a fixed-width field.\n *\n * Returns an empty string when there is nothing to clamp, so the declaration\n * block stays untouched for the majority of callers.\n */\nexport const truncationStyles = (numberOfLines?: number): string => {\n if (!numberOfLines || numberOfLines < 1) return \"\";\n\n if (numberOfLines === 1) {\n return `\n display: block;\n max-width: 100%;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `;\n }\n\n return `\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ${numberOfLines};\n line-clamp: ${numberOfLines};\n max-width: 100%;\n min-width: 0;\n overflow: hidden;\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 /* Icons paint themselves — each icon's own SVG sets its fill/stroke\n (icons-base via inline \"fill: currentColor\", Lucide via \"fill\"/\"stroke\"\n attributes). Do not add fill/stroke here: it re-strokes fill-based icons\n and thickens the glyph. See FEP-877. */\n svg {\n width: 100%;\n height: 100%;\n }\n`;\n\nexport const Icon: React.FC<IconProps> = ({\n children,\n testID,\n \"data-testid\": dataTestId,\n ...props\n}) => {\n return (\n <StyledIcon data-testid={dataTestId || testID} {...props}>\n {children}\n </StyledIcon>\n );\n};\n","export * from \"./Box\";\nexport * from \"./Text\";\nexport * from \"./Spinner\";\nexport * from \"./Icon\";\nexport * from \"./Divider\";\nexport * from \"./Input\";\nexport * from \"./TextArea\";\nexport * from \"./LinearGradient\";\n\nexport const isWeb = true;\nexport const isNative = false;\n","/**\n * Per-size geometry taken from the Figma \"Counter\" component set.\n *\n * `control` is the square box of the − / + buttons; `gap` is the spacing\n * between the three elements. `inputWidth` / `readOnlyWidth` are the full\n * control widths from Figma (buttons + gaps + value). Field height, radius,\n * and font size come from `theme.sizing.input(size)` / `theme.shape.input[size]`\n * because the middle of a `type=\"input\"` Counter is a standard Input.\n */\nexport const COUNTER_SIZE_CONFIG = {\n xl: { control: 28, gap: 10, inputWidth: 149, readOnlyWidth: 100 },\n lg: { control: 24, gap: 10, inputWidth: 142, readOnlyWidth: 90 },\n md: { control: 24, gap: 8, inputWidth: 132, readOnlyWidth: 83 },\n sm: { control: 18, gap: 8, inputWidth: 92, readOnlyWidth: 69 },\n xs: { control: 16, gap: 6, inputWidth: 82, readOnlyWidth: 59 },\n} as const;\n\n/**\n * Rounds `value` into `[min, max]`. A value above the maximum is rounded down\n * to the maximum, and a value below the minimum is rounded up to the minimum.\n * Missing bounds are unbounded on that side.\n */\nexport const clampToRange = (\n value: number,\n min?: number,\n max?: number\n): number => {\n let next = value;\n if (typeof min === \"number\" && next < min) next = min;\n if (typeof max === \"number\" && next > max) next = max;\n return next;\n};\n\n/**\n * Strips everything that cannot be part of an integer from typed input.\n * Non-numeric characters are rejected silently rather than flagged — Counter\n * has no error state. A single leading `-` survives only when negatives are\n * allowed.\n */\nexport const sanitizeCounterInput = (\n raw: string,\n allowNegative: boolean\n): string => {\n const digitsAndSigns = raw.replace(/[^\\d-]/g, \"\");\n const digits = digitsAndSigns.replace(/-/g, \"\");\n if (allowNegative && digitsAndSigns.startsWith(\"-\")) {\n return `-${digits}`;\n }\n return digits;\n};\n\n/**\n * Parses committed text into a number. Returns `null` for an empty field or a\n * lone `-`, which the caller resolves by restoring the previous value.\n */\nexport const parseCounterValue = (raw: string): number | null => {\n const trimmed = raw.trim();\n if (trimmed === \"\" || trimmed === \"-\") return null;\n const parsed = Number.parseInt(trimmed, 10);\n return Number.isNaN(parsed) ? null : parsed;\n};\n\n/**\n * True when the range allows values below zero, which is what decides whether\n * a typed `-` is kept.\n */\nexport const allowsNegative = (min?: number): boolean =>\n typeof min !== \"number\" || min < 0;\n"],"mappings":";AAAA,OAAOA,UAAS,YAAY,QAAQ,gBAAgB;;;ACApD,OAAOC,YAAW;AAClB,OAAO,YAAY;;;ACDnB,OAAO,WAAW;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SAAO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kB;AAAA,oBACjC,iBAAe;AAAA,oBACf,iBAAe;AAAA,oBACf,cAAY,YAAY,SAAY;AAAA,oBACnC,GAAI,YAAY,EAAE,mBAAmB,QAAQ,IAAI,CAAC;AAAA,oBAEnD,OAAO,EAAE,WAAW,SAAS;AAAA,oBAC7B;AAAA,oBACA;AAAA,oBACA,QAAQ,SAAS,GAAG,MAAM,YAAY;AAAA;AAAA,gBACxC,GACF;AAAA,gBACC;AAAA;AAAA;AAAA,UACH;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,QAAQ,cAAc;","names":["React","React","React","styled","jsx","styled","styled","jsx","FilteredDiv","styled","jsx","React"]}
1
+ {"version":3,"sources":["../../src/Counter.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/textTruncation.ts","../../../../foundation/primitives-web/src/Icon.tsx","../../../../foundation/primitives-web/src/index.tsx","../../src/utils.ts"],"sourcesContent":["import React, { forwardRef, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, Text, Icon, isWeb } from \"@xsolla/xui-primitives\";\nimport { useResolvedTheme, useId } from \"@xsolla/xui-core\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { MinusSq, PlusSq } from \"@xsolla/xui-icons-base\";\nimport type { CounterProps } from \"./types\";\nimport {\n COUNTER_SIZE_CONFIG,\n allowsNegative,\n clampToRange,\n parseCounterValue,\n sanitizeCounterInput,\n} from \"./utils\";\n\ninterface CounterButtonProps {\n icon: React.ReactNode;\n label: string;\n onPress: () => void;\n available: boolean;\n boxSize: number;\n borderRadius: number;\n color: string;\n hoverColor: string;\n testID?: string;\n}\n\nconst CounterButton: React.FC<CounterButtonProps> = ({\n icon,\n label,\n onPress,\n available,\n boxSize,\n borderRadius,\n color,\n hoverColor,\n testID,\n}) => (\n <Box\n as=\"button\"\n type=\"button\"\n width={boxSize}\n height={boxSize}\n flexShrink={0}\n alignItems=\"center\"\n justifyContent=\"center\"\n padding={0}\n borderWidth={0}\n borderRadius={borderRadius}\n backgroundColor=\"transparent\"\n cursor={available ? \"pointer\" : \"not-allowed\"}\n disabled={!available}\n aria-disabled={!available || undefined}\n aria-label={label}\n // Keep a stable Pressable host on native even when unavailable so the\n // control stays in the a11y tree with a disabled state.\n onPress={onPress}\n hoverStyle={available ? { backgroundColor: hoverColor } : undefined}\n // Keep focus in the field so a click does not commit-then-step.\n {...(isWeb && {\n onMouseDown: (e: React.MouseEvent<HTMLButtonElement>) =>\n e.preventDefault(),\n })}\n data-testid={testID}\n testID={testID}\n >\n <Icon size={boxSize} color={color}>\n {icon}\n </Icon>\n </Box>\n);\n\n/**\n * A numeric stepper that lets the user increase or decrease a value using\n * dedicated − and + buttons.\n *\n * Counter has no error state: values outside the allowed range are never\n * rejected, they are silently clamped to the nearest bound on commit, so the\n * component is always in a valid state.\n */\nexport const Counter = forwardRef<HTMLInputElement, CounterProps>(\n (\n {\n value,\n defaultValue = null,\n onChange,\n min,\n max,\n step = 1,\n size = \"md\",\n type = \"input\",\n disabled = false,\n label,\n \"aria-label\": ariaLabel,\n decrementLabel = \"Decrease quantity\",\n incrementLabel = \"Increase quantity\",\n name,\n id: providedId,\n testID,\n themeMode,\n themeProductContext,\n },\n ref\n ) => {\n const { theme } = useResolvedTheme({ themeMode, themeProductContext });\n\n const rawId = useId();\n const safeId = rawId.replace(/:/g, \"\");\n const counterId = providedId || `counter-${safeId}`;\n\n const isControlled = value !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState<number | null>(\n defaultValue\n );\n const committedValue = isControlled ? (value ?? null) : uncontrolledValue;\n\n // Text held while the user is mid-entry. `null` means \"show the committed\n // value\" — typing is never committed keystroke-by-keystroke.\n const [draft, setDraft] = useState<string | null>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n\n React.useImperativeHandle(\n ref,\n () => inputRef.current as HTMLInputElement,\n []\n );\n\n const sizeConfig = COUNTER_SIZE_CONFIG[size];\n const inputSizing = theme.sizing.input(size);\n const isReadOnly = type === \"readOnly\";\n\n // The value the buttons step from: an uncommitted draft wins over the last\n // committed value so typing 7 then pressing + lands on 8, not oldValue + 1.\n const pendingValue =\n draft !== null ? parseCounterValue(draft) : committedValue;\n const stepBase = pendingValue ?? min ?? 0;\n\n const canDecrement =\n !disabled && (typeof min !== \"number\" || stepBase > min);\n const canIncrement =\n !disabled && (typeof max !== \"number\" || stepBase < max);\n\n const commit = (next: number | null) => {\n setDraft(null);\n // An empty field on commit restores the previous value — the counter is\n // never left in an empty, indeterminate state after commit.\n const resolved = next ?? committedValue;\n if (resolved === null) return;\n const clamped = clampToRange(resolved, min, max);\n if (!isControlled) setUncontrolledValue(clamped);\n if (clamped !== committedValue) onChange?.(clamped);\n };\n\n const stepBy = (direction: 1 | -1) => {\n commit(clampToRange(stepBase + direction * step, min, max));\n };\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setDraft(sanitizeCounterInput(e.target.value, allowsNegative(min)));\n };\n\n const handleBlur = () => {\n commit(draft !== null ? parseCounterValue(draft) : committedValue);\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === \"ArrowUp\") {\n e.preventDefault();\n if (canIncrement) stepBy(1);\n return;\n }\n if (e.key === \"ArrowDown\") {\n e.preventDefault();\n if (canDecrement) stepBy(-1);\n return;\n }\n if (e.key === \"Home\" && typeof min === \"number\") {\n e.preventDefault();\n commit(min);\n return;\n }\n if (e.key === \"End\" && typeof max === \"number\") {\n e.preventDefault();\n commit(max);\n return;\n }\n // Native TextInput reports Return as \"Enter\" or \"\\n\" via onKeyPress.\n if (e.key === \"Enter\" || e.key === \"\\n\") {\n e.preventDefault();\n commit(draft !== null ? parseCounterValue(draft) : committedValue);\n }\n };\n\n const enabledIconColor = theme.colors.content.secondary;\n const disabledIconColor = theme.colors.control.text.disable;\n const hoverColor = theme.colors.overlay.mono;\n const buttonRadius = theme.shape.input[size].borderRadius;\n\n const decrementButton = (\n <CounterButton\n icon={<MinusSq />}\n label={decrementLabel}\n onPress={() => {\n if (canDecrement) stepBy(-1);\n }}\n available={canDecrement}\n boxSize={sizeConfig.control}\n borderRadius={buttonRadius}\n color={canDecrement ? enabledIconColor : disabledIconColor}\n hoverColor={hoverColor}\n testID={testID ? `${testID}__decrement` : undefined}\n />\n );\n\n const incrementButton = (\n <CounterButton\n icon={<PlusSq />}\n label={incrementLabel}\n onPress={() => {\n if (canIncrement) stepBy(1);\n }}\n available={canIncrement}\n boxSize={sizeConfig.control}\n borderRadius={buttonRadius}\n color={canIncrement ? enabledIconColor : disabledIconColor}\n hoverColor={hoverColor}\n testID={testID ? `${testID}__increment` : undefined}\n />\n );\n\n // Label sits above the whole control row (buttons + value), never inside\n // the Input between the buttons — that would push − / + off the field's\n // vertical center (Figma Counter has no in-component label; labels come\n // from FieldGroup / adjacent text, or this convenience prop).\n const labelId = `${counterId}-label`;\n const showLabel = Boolean(label) && !isReadOnly;\n const labelNode = showLabel ? (\n <Box as=\"label\" id={labelId}>\n <Text\n color={theme.colors.content.secondary}\n fontSize={inputSizing.fontSize - 2}\n fontWeight=\"500\"\n >\n {label}\n </Text>\n </Box>\n ) : null;\n\n if (isReadOnly) {\n // Read-only renders the value as plain text, never as a disabled or\n // `readonly` input — both would tell assistive technology the value\n // cannot change, which is false: the buttons still change it.\n const readOnlyValue = String(committedValue ?? min ?? 0);\n return (\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={sizeConfig.gap}\n width={sizeConfig.readOnlyWidth}\n role=\"group\"\n aria-label={ariaLabel || label}\n aria-disabled={disabled || undefined}\n data-testid={testID}\n >\n {decrementButton}\n <Box flex={1} minWidth={0} aria-live=\"polite\" alignItems=\"center\">\n <Text\n color={\n disabled\n ? theme.colors.control.input.textDisable\n : theme.colors.control.input.text\n }\n fontSize={inputSizing.fontSize}\n lineHeight={inputSizing.fontSize + 2}\n textAlign=\"center\"\n data-testid={testID ? `${testID}__value` : undefined}\n >\n {readOnlyValue}\n </Text>\n </Box>\n {incrementButton}\n </Box>\n );\n }\n\n const displayValue =\n draft !== null\n ? draft\n : committedValue === null\n ? \"\"\n : String(committedValue);\n\n return (\n <Box\n flexDirection=\"column\"\n gap={inputSizing.fieldGap}\n alignItems=\"flex-start\"\n role=\"group\"\n aria-label={showLabel ? undefined : ariaLabel}\n aria-labelledby={showLabel ? labelId : undefined}\n aria-disabled={disabled || undefined}\n data-testid={testID}\n >\n {labelNode}\n <Box\n flexDirection=\"row\"\n alignItems=\"center\"\n gap={sizeConfig.gap}\n width={sizeConfig.inputWidth}\n >\n {decrementButton}\n <Box flex={1} minWidth={0}>\n <Input\n ref={inputRef}\n id={counterId}\n name={name}\n size={size}\n value={displayValue}\n disabled={disabled}\n onChange={handleInputChange}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n // `type=\"text\"` + `inputMode=\"numeric\"`, not `type=\"number\"`,\n // which would add the browser's own spinners next to ours.\n type=\"text\"\n inputMode=\"numeric\"\n role=\"spinbutton\"\n aria-valuenow={committedValue ?? undefined}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-label={showLabel ? undefined : ariaLabel}\n {...(showLabel ? { \"aria-labelledby\": labelId } : {})}\n // Figma centers the value in the compact field.\n style={{ textAlign: \"center\" }}\n themeMode={themeMode}\n themeProductContext={themeProductContext}\n testID={testID ? `${testID}__input` : undefined}\n />\n </Box>\n {incrementButton}\n </Box>\n </Box>\n );\n }\n);\n\nCounter.displayName = \"Counter\";\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 &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n 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","import React from \"react\";\nimport styled from \"styled-components\";\nimport { TextProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\nimport { truncationStyles } from \"./textTruncation\";\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 /* Keep last: single-line truncation has to win over white-space above. */\n ${(props) => truncationStyles(props.numberOfLines)}\n`;\n\nexport const Text: React.FC<TextProps> = ({\n style,\n className,\n id,\n role,\n testID,\n \"data-testid\": dataTestId,\n ...props\n}) => {\n return (\n <StyledText\n {...props}\n style={style}\n className={className}\n id={id}\n role={role}\n data-testid={dataTestId || testID}\n />\n );\n};\n","/**\n * Web implementation of the cross-platform `numberOfLines` text prop.\n *\n * Native maps `numberOfLines` straight onto `RNText`. A web `<span>` has no\n * equivalent, so emit the CSS that produces the same result.\n *\n * Two details matter for the single-line case:\n * - `text-overflow` only takes effect on a block container, so the inline\n * `<span>` is promoted to `display: block` and capped at `max-width: 100%`.\n * - `min-width: 0` lets the text shrink below its own content width when it\n * sits in a flex row. Without it a `nowrap` label keeps its full intrinsic\n * width and pushes its siblings (icons, chevrons) out of a fixed-width field.\n *\n * Returns an empty string when there is nothing to clamp, so the declaration\n * block stays untouched for the majority of callers.\n */\nexport const truncationStyles = (numberOfLines?: number): string => {\n if (!numberOfLines || numberOfLines < 1) return \"\";\n\n if (numberOfLines === 1) {\n return `\n display: block;\n max-width: 100%;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `;\n }\n\n return `\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: ${numberOfLines};\n line-clamp: ${numberOfLines};\n max-width: 100%;\n min-width: 0;\n overflow: hidden;\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 /* Icons paint themselves — each icon's own SVG sets its fill/stroke\n (icons-base via inline \"fill: currentColor\", Lucide via \"fill\"/\"stroke\"\n attributes). Do not add fill/stroke here: it re-strokes fill-based icons\n and thickens the glyph. See FEP-877. */\n svg {\n width: 100%;\n height: 100%;\n }\n`;\n\nexport const Icon: React.FC<IconProps> = ({\n children,\n testID,\n \"data-testid\": dataTestId,\n ...props\n}) => {\n return (\n <StyledIcon data-testid={dataTestId || testID} {...props}>\n {children}\n </StyledIcon>\n );\n};\n","export * from \"./Box\";\nexport * from \"./Text\";\nexport * from \"./Spinner\";\nexport * from \"./Icon\";\nexport * from \"./Divider\";\nexport * from \"./Input\";\nexport * from \"./TextArea\";\nexport * from \"./LinearGradient\";\n\nexport const isWeb = true;\nexport const isNative = false;\n","/**\n * Per-size geometry taken from the Figma \"Counter\" component set.\n *\n * `control` is the square box of the − / + buttons; `gap` is the spacing\n * between the three elements. `inputWidth` / `readOnlyWidth` are the full\n * control widths from Figma (buttons + gaps + value). Field height, radius,\n * and font size come from `theme.sizing.input(size)` / `theme.shape.input[size]`\n * because the middle of a `type=\"input\"` Counter is a standard Input.\n */\nexport const COUNTER_SIZE_CONFIG = {\n xl: { control: 28, gap: 10, inputWidth: 149, readOnlyWidth: 100 },\n lg: { control: 24, gap: 10, inputWidth: 142, readOnlyWidth: 90 },\n md: { control: 24, gap: 8, inputWidth: 132, readOnlyWidth: 83 },\n sm: { control: 18, gap: 8, inputWidth: 92, readOnlyWidth: 69 },\n xs: { control: 16, gap: 6, inputWidth: 82, readOnlyWidth: 59 },\n} as const;\n\n/**\n * Rounds `value` into `[min, max]`. A value above the maximum is rounded down\n * to the maximum, and a value below the minimum is rounded up to the minimum.\n * Missing bounds are unbounded on that side.\n */\nexport const clampToRange = (\n value: number,\n min?: number,\n max?: number\n): number => {\n let next = value;\n if (typeof min === \"number\" && next < min) next = min;\n if (typeof max === \"number\" && next > max) next = max;\n return next;\n};\n\n/**\n * Strips everything that cannot be part of an integer from typed input.\n * Non-numeric characters are rejected silently rather than flagged — Counter\n * has no error state. A single leading `-` survives only when negatives are\n * allowed.\n */\nexport const sanitizeCounterInput = (\n raw: string,\n allowNegative: boolean\n): string => {\n const digitsAndSigns = raw.replace(/[^\\d-]/g, \"\");\n const digits = digitsAndSigns.replace(/-/g, \"\");\n if (allowNegative && digitsAndSigns.startsWith(\"-\")) {\n return `-${digits}`;\n }\n return digits;\n};\n\n/**\n * Parses committed text into a number. Returns `null` for an empty field or a\n * lone `-`, which the caller resolves by restoring the previous value.\n */\nexport const parseCounterValue = (raw: string): number | null => {\n const trimmed = raw.trim();\n if (trimmed === \"\" || trimmed === \"-\") return null;\n const parsed = Number.parseInt(trimmed, 10);\n return Number.isNaN(parsed) ? null : parsed;\n};\n\n/**\n * True when the range allows values below zero, which is what decides whether\n * a typed `-` is kept.\n */\nexport const allowsNegative = (min?: number): boolean =>\n typeof min !== \"number\" || min < 0;\n"],"mappings":";AAAA,OAAOA,UAAS,YAAY,QAAQ,gBAAgB;;;ACApD,OAAOC,YAAW;AAClB,OAAO,YAAY;;;ACDnB,OAAO,WAAW;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SAAO,SAAU,KAAK;AACpB,QAAI,MAAM,GAAG,MAAM,OAAW,OAAM,GAAG,IAAI,GAAG,GAAG;AACjD,WAAO,MAAM,GAAG;AAAA,EAClB;AACF;AAEA,IAAO,sBAAQ;;;ACNf,IAAI,kBAAkB;AAEtB,IAAI,QAAQ;AAAA,EAAQ,SAAU,MAAM;AAClC,WAAO,gBAAgB,KAAK,IAAI,KAAK,KAAK,WAAW,CAAC,MAAM,OAEzD,KAAK,WAAW,CAAC,MAAM,OAEvB,KAAK,WAAW,CAAC,IAAI;AAAA,EAC1B;AAAA;AAEA;AAEA,IAAO,4BAAQ;;;AFRR,IAAM,2BAA2B,oBAAI,IAAI;AAAA;AAAA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A,UACH;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,QAAQ,cAAc;","names":["React","React","React","styled","jsx","styled","styled","jsx","FilteredDiv","styled","jsx","React"]}