@xsolla/xui-date-picker 0.158.0 → 0.160.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/native/index.d.mts +8 -1
- package/native/index.d.ts +8 -1
- package/native/index.js +3 -1
- package/native/index.js.map +1 -1
- package/native/index.mjs +3 -1
- package/native/index.mjs.map +1 -1
- package/package.json +5 -5
- package/web/index.d.mts +8 -1
- package/web/index.d.ts +8 -1
- package/web/index.js +3 -1
- package/web/index.js.map +1 -1
- package/web/index.mjs +3 -1
- package/web/index.mjs.map +1 -1
package/README.md
CHANGED
|
@@ -63,6 +63,7 @@ const [date, setDate] = useState<Date | null>(null);
|
|
|
63
63
|
| `size` | `'xs' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Input size. |
|
|
64
64
|
| `disabled` | `boolean` | `false` | Disable the input. |
|
|
65
65
|
| `backgroundColor` | `string` | — | Custom background colour for the input. |
|
|
66
|
+
| `dropdownPosition` | `'left' \| 'right'` | `'left'` | Align the calendar dropdown to the left or right edge of the input. |
|
|
66
67
|
| `locale` | `CalendarLocaleType` | `'enUS'` | `date-fns` locale identifier. |
|
|
67
68
|
| `firstDayOfWeek` | `number` | — | First day of the week (0 = Sunday … 6 = Saturday). |
|
|
68
69
|
| `initialMonth` | `Date` | — | Month shown on first render. |
|
|
@@ -141,6 +142,7 @@ const [end, setEnd] = useState<Date | null>(null);
|
|
|
141
142
|
|
|
142
143
|
<DatePicker
|
|
143
144
|
variant="dual"
|
|
145
|
+
dropdownPosition="right"
|
|
144
146
|
startDate={start}
|
|
145
147
|
endDate={end}
|
|
146
148
|
onChange={(range) => {
|
package/native/index.d.mts
CHANGED
|
@@ -3,6 +3,7 @@ export { Calendar, CalendarChipOption, CalendarChips, CalendarChipsProps, Calend
|
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
|
|
5
5
|
type DateRangeType = [Date | null, Date | null];
|
|
6
|
+
type DatePickerDropdownPosition = "left" | "right";
|
|
6
7
|
interface DatePickerProps extends Omit<CalendarProps, "onChange"> {
|
|
7
8
|
/**
|
|
8
9
|
* Calendar variant: "single" shows a single month, "dual" shows two months side-by-side.
|
|
@@ -29,10 +30,16 @@ interface DatePickerProps extends Omit<CalendarProps, "onChange"> {
|
|
|
29
30
|
* Custom background color for the input
|
|
30
31
|
*/
|
|
31
32
|
backgroundColor?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Horizontal alignment of the calendar dropdown relative to the input.
|
|
35
|
+
*/
|
|
36
|
+
dropdownPosition?: DatePickerDropdownPosition;
|
|
37
|
+
/** Test ID for testing frameworks */
|
|
38
|
+
testID?: string;
|
|
32
39
|
}
|
|
33
40
|
|
|
34
41
|
declare const DatePicker: react.ForwardRefExoticComponent<DatePickerProps & react.RefAttributes<any>>;
|
|
35
42
|
|
|
36
43
|
declare function formatDate(date: Date, formatStr: string, locale?: CalendarLocaleType): string;
|
|
37
44
|
|
|
38
|
-
export { DatePicker, type DatePickerProps, type DateRangeType, formatDate };
|
|
45
|
+
export { DatePicker, type DatePickerDropdownPosition, type DatePickerProps, type DateRangeType, formatDate };
|
package/native/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { Calendar, CalendarChipOption, CalendarChips, CalendarChipsProps, Calend
|
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
|
|
5
5
|
type DateRangeType = [Date | null, Date | null];
|
|
6
|
+
type DatePickerDropdownPosition = "left" | "right";
|
|
6
7
|
interface DatePickerProps extends Omit<CalendarProps, "onChange"> {
|
|
7
8
|
/**
|
|
8
9
|
* Calendar variant: "single" shows a single month, "dual" shows two months side-by-side.
|
|
@@ -29,10 +30,16 @@ interface DatePickerProps extends Omit<CalendarProps, "onChange"> {
|
|
|
29
30
|
* Custom background color for the input
|
|
30
31
|
*/
|
|
31
32
|
backgroundColor?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Horizontal alignment of the calendar dropdown relative to the input.
|
|
35
|
+
*/
|
|
36
|
+
dropdownPosition?: DatePickerDropdownPosition;
|
|
37
|
+
/** Test ID for testing frameworks */
|
|
38
|
+
testID?: string;
|
|
32
39
|
}
|
|
33
40
|
|
|
34
41
|
declare const DatePicker: react.ForwardRefExoticComponent<DatePickerProps & react.RefAttributes<any>>;
|
|
35
42
|
|
|
36
43
|
declare function formatDate(date: Date, formatStr: string, locale?: CalendarLocaleType): string;
|
|
37
44
|
|
|
38
|
-
export { DatePicker, type DatePickerProps, type DateRangeType, formatDate };
|
|
45
|
+
export { DatePicker, type DatePickerDropdownPosition, type DatePickerProps, type DateRangeType, formatDate };
|
package/native/index.js
CHANGED
|
@@ -243,6 +243,7 @@ var DatePicker = (0, import_react.forwardRef)(
|
|
|
243
243
|
chips,
|
|
244
244
|
activeChip,
|
|
245
245
|
onChipSelect,
|
|
246
|
+
dropdownPosition = "left",
|
|
246
247
|
...rest
|
|
247
248
|
}, ref) => {
|
|
248
249
|
const isDual = variant === "dual";
|
|
@@ -371,7 +372,8 @@ var DatePicker = (0, import_react.forwardRef)(
|
|
|
371
372
|
{
|
|
372
373
|
position: "absolute",
|
|
373
374
|
top: "100%",
|
|
374
|
-
left: 0,
|
|
375
|
+
left: dropdownPosition === "left" ? 0 : "auto",
|
|
376
|
+
right: dropdownPosition === "right" ? 0 : "auto",
|
|
375
377
|
marginTop: 4,
|
|
376
378
|
zIndex: 1e3,
|
|
377
379
|
children: renderCalendar()
|
package/native/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.tsx","../../src/DatePicker.tsx","../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/index.tsx","../../src/utils.ts"],"sourcesContent":["export {\n Calendar,\n DualCalendar,\n CalendarHeader,\n CalendarGrid,\n CalendarChips,\n} from \"@xsolla/xui-calendar\";\nexport type {\n CalendarProps,\n DualCalendarProps,\n CalendarChipOption,\n CalendarChipsProps,\n CalendarGridProps,\n CalendarHeaderProps,\n CalendarLocaleType,\n} from \"@xsolla/xui-calendar\";\nexport * from \"./DatePicker\";\nexport * from \"./types\";\nexport * from \"./utils\";\n","import { forwardRef, useCallback, useEffect, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, isWeb, isNative } from \"@xsolla/xui-primitives\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { format } from \"date-fns\";\nimport { Calendar, DualCalendar } from \"@xsolla/xui-calendar\";\nimport type { DatePickerProps, DateRangeType } from \"./types\";\n\nexport const DatePicker = forwardRef<any, DatePickerProps>(\n (\n {\n onChange,\n size = \"md\",\n locale = \"enUS\",\n variant = \"single\",\n selectsRange = false,\n startDate,\n endDate,\n selectedDate,\n placeholder,\n backgroundColor,\n testID,\n chips,\n activeChip,\n onChipSelect,\n ...rest\n },\n ref\n ) => {\n const isDual = variant === \"dual\";\n const isRange = isDual || selectsRange;\n const [open, setOpen] = useState(false);\n const [inputValue, setInputValue] = useState(\"\");\n const [internalChip, setInternalChip] = useState<string | null>(null);\n const containerRef = useRef<any>(null);\n const chipSelectionRef = useRef(false);\n\n const activeChipValue =\n activeChip !== undefined ? activeChip : internalChip;\n\n const formatDateForDisplay = (date: Date | null | undefined): string => {\n if (!date) return \"\";\n try {\n return format(date, \"MM/dd/yyyy\");\n } catch {\n return \"\";\n }\n };\n\n const getDisplayValue = useCallback((): string => {\n if (activeChipValue && chips) {\n const chip = chips.find((c) => c.value === activeChipValue);\n if (chip) return chip.label;\n }\n if (isRange) {\n if (startDate && endDate) {\n return `${formatDateForDisplay(startDate)} - ${formatDateForDisplay(endDate)}`;\n } else if (startDate) {\n return formatDateForDisplay(startDate);\n }\n return \"\";\n } else {\n return formatDateForDisplay(selectedDate);\n }\n }, [isRange, startDate, endDate, selectedDate, activeChipValue, chips]);\n\n useEffect(() => {\n setInputValue(getDisplayValue());\n }, [getDisplayValue]);\n\n const handleInputChange = (text: string) => {\n setInputValue(text);\n };\n\n const handleChipSelect = (value: string | null) => {\n chipSelectionRef.current = true;\n setInternalChip(value);\n onChipSelect?.(value);\n };\n\n const handleDateChange = (date: Date | [Date | null, Date | null]) => {\n if (!chipSelectionRef.current) {\n setInternalChip(null);\n onChipSelect?.(null);\n }\n chipSelectionRef.current = false;\n\n if (!isRange) {\n onChange?.(date as Date);\n setOpen(false);\n } else {\n const range = date as DateRangeType;\n onChange?.(range);\n if (range[0] && range[1]) {\n setOpen(false);\n }\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n !containerRef.current.contains(event.target as Node)\n ) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () =>\n document.removeEventListener(\"mousedown\", handleClickOutside);\n }, []);\n\n const renderCalendar = () =>\n isDual ? (\n <DualCalendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n onChange={handleDateChange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n ) : (\n <Calendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n selectedDate={selectedDate}\n onChange={handleDateChange}\n selectsRange={selectsRange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n );\n\n return (\n <Box\n ref={(node: any) => {\n containerRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) (ref as any).current = node;\n }}\n position=\"relative\"\n width=\"100%\"\n >\n <Input\n {...rest}\n size={size}\n placeholder={\n placeholder || (isRange ? \"MM/DD/YYYY - MM/DD/YYYY\" : \"MM/DD/YYYY\")\n }\n value={inputValue}\n onChangeText={handleInputChange}\n onFocus={() => setOpen(true)}\n backgroundColor={backgroundColor}\n testID={testID}\n />\n {open &&\n (isWeb ? (\n <Box\n position=\"absolute\"\n top=\"100%\"\n left={0}\n marginTop={4}\n zIndex={1000}\n >\n {renderCalendar()}\n </Box>\n ) : (\n // Native implementation could use a Modal here\n // For now, we just show it below the input if needed,\n // but usually a bottom sheet or centered modal is better.\n <Box marginTop={4}>{renderCalendar()}</Box>\n ))}\n </Box>\n );\n }\n);\n\nDatePicker.displayName = \"DatePicker\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\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 alignItems,\n justifyContent,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\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 alignItems,\n justifyContent,\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 ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Destructure and drop web-only props from rest before passing to RN components\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 className,\n \"data-testid\": _dataTestId,\n ...nativeRest\n } = rest as Record<string, unknown>;\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 resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n if (onPress) {\n return (\n <Pressable\n onPress={onPress}\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 {...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 {...nativeRest}\n >\n {children}\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","import { format } from \"date-fns\";\nimport * as locales from \"date-fns/locale\";\nimport type { CalendarLocaleType } from \"@xsolla/xui-calendar\";\n\nconst defaultLocale = \"enUS\";\n\nexport function formatDate(\n date: Date,\n formatStr: string,\n locale: CalendarLocaleType = defaultLocale\n) {\n const localeObj = locales[locale] || locales[defaultLocale];\n\n return format(date, formatStr, {\n locale: localeObj,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,uBAMO;;;ACNP,mBAAqE;;;ACCrE,0BAQO;AA2ID;AAxIC,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,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;AAA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Ac;;;AGzLzB,IAAAC,mBAAuB;AACvB,cAAyB;AAGzB,IAAM,gBAAgB;AAEf,SAAS,WACd,MACA,WACA,SAA6B,eAC7B;AACA,QAAM,YAAY,QAAQ,MAAM,KAAK,QAAQ,aAAa;AAE1D,aAAO,yBAAO,MAAM,WAAW;AAAA,IAC7B,QAAQ;AAAA,EACV,CAAC;AACH;","names":["import_xui_calendar","import_jsx_runtime","import_date_fns"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.tsx","../../src/DatePicker.tsx","../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/index.tsx","../../src/utils.ts"],"sourcesContent":["export {\n Calendar,\n DualCalendar,\n CalendarHeader,\n CalendarGrid,\n CalendarChips,\n} from \"@xsolla/xui-calendar\";\nexport type {\n CalendarProps,\n DualCalendarProps,\n CalendarChipOption,\n CalendarChipsProps,\n CalendarGridProps,\n CalendarHeaderProps,\n CalendarLocaleType,\n} from \"@xsolla/xui-calendar\";\nexport * from \"./DatePicker\";\nexport * from \"./types\";\nexport * from \"./utils\";\n","import { forwardRef, useCallback, useEffect, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, isWeb, isNative } from \"@xsolla/xui-primitives\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { format } from \"date-fns\";\nimport { Calendar, DualCalendar } from \"@xsolla/xui-calendar\";\nimport type { DatePickerProps, DateRangeType } from \"./types\";\n\nexport const DatePicker = forwardRef<any, DatePickerProps>(\n (\n {\n onChange,\n size = \"md\",\n locale = \"enUS\",\n variant = \"single\",\n selectsRange = false,\n startDate,\n endDate,\n selectedDate,\n placeholder,\n backgroundColor,\n testID,\n chips,\n activeChip,\n onChipSelect,\n dropdownPosition = \"left\",\n ...rest\n },\n ref\n ) => {\n const isDual = variant === \"dual\";\n const isRange = isDual || selectsRange;\n const [open, setOpen] = useState(false);\n const [inputValue, setInputValue] = useState(\"\");\n const [internalChip, setInternalChip] = useState<string | null>(null);\n const containerRef = useRef<any>(null);\n const chipSelectionRef = useRef(false);\n\n const activeChipValue =\n activeChip !== undefined ? activeChip : internalChip;\n\n const formatDateForDisplay = (date: Date | null | undefined): string => {\n if (!date) return \"\";\n try {\n return format(date, \"MM/dd/yyyy\");\n } catch {\n return \"\";\n }\n };\n\n const getDisplayValue = useCallback((): string => {\n if (activeChipValue && chips) {\n const chip = chips.find((c) => c.value === activeChipValue);\n if (chip) return chip.label;\n }\n if (isRange) {\n if (startDate && endDate) {\n return `${formatDateForDisplay(startDate)} - ${formatDateForDisplay(endDate)}`;\n } else if (startDate) {\n return formatDateForDisplay(startDate);\n }\n return \"\";\n } else {\n return formatDateForDisplay(selectedDate);\n }\n }, [isRange, startDate, endDate, selectedDate, activeChipValue, chips]);\n\n useEffect(() => {\n setInputValue(getDisplayValue());\n }, [getDisplayValue]);\n\n const handleInputChange = (text: string) => {\n setInputValue(text);\n };\n\n const handleChipSelect = (value: string | null) => {\n chipSelectionRef.current = true;\n setInternalChip(value);\n onChipSelect?.(value);\n };\n\n const handleDateChange = (date: Date | [Date | null, Date | null]) => {\n if (!chipSelectionRef.current) {\n setInternalChip(null);\n onChipSelect?.(null);\n }\n chipSelectionRef.current = false;\n\n if (!isRange) {\n onChange?.(date as Date);\n setOpen(false);\n } else {\n const range = date as DateRangeType;\n onChange?.(range);\n if (range[0] && range[1]) {\n setOpen(false);\n }\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n !containerRef.current.contains(event.target as Node)\n ) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () =>\n document.removeEventListener(\"mousedown\", handleClickOutside);\n }, []);\n\n const renderCalendar = () =>\n isDual ? (\n <DualCalendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n onChange={handleDateChange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n ) : (\n <Calendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n selectedDate={selectedDate}\n onChange={handleDateChange}\n selectsRange={selectsRange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n );\n\n return (\n <Box\n ref={(node: any) => {\n containerRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) (ref as any).current = node;\n }}\n position=\"relative\"\n width=\"100%\"\n >\n <Input\n {...rest}\n size={size}\n placeholder={\n placeholder || (isRange ? \"MM/DD/YYYY - MM/DD/YYYY\" : \"MM/DD/YYYY\")\n }\n value={inputValue}\n onChangeText={handleInputChange}\n onFocus={() => setOpen(true)}\n backgroundColor={backgroundColor}\n testID={testID}\n />\n {open &&\n (isWeb ? (\n <Box\n position=\"absolute\"\n top=\"100%\"\n left={dropdownPosition === \"left\" ? 0 : \"auto\"}\n right={dropdownPosition === \"right\" ? 0 : \"auto\"}\n marginTop={4}\n zIndex={1000}\n >\n {renderCalendar()}\n </Box>\n ) : (\n // Native implementation could use a Modal here\n // For now, we just show it below the input if needed,\n // but usually a bottom sheet or centered modal is better.\n <Box marginTop={4}>{renderCalendar()}</Box>\n ))}\n </Box>\n );\n }\n);\n\nDatePicker.displayName = \"DatePicker\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\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 alignItems,\n justifyContent,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\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 alignItems,\n justifyContent,\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 ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Destructure and drop web-only props from rest before passing to RN components\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 className,\n \"data-testid\": _dataTestId,\n ...nativeRest\n } = rest as Record<string, unknown>;\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 resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n if (onPress) {\n return (\n <Pressable\n onPress={onPress}\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 {...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 {...nativeRest}\n >\n {children}\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","import { format } from \"date-fns\";\nimport * as locales from \"date-fns/locale\";\nimport type { CalendarLocaleType } from \"@xsolla/xui-calendar\";\n\nconst defaultLocale = \"enUS\";\n\nexport function formatDate(\n date: Date,\n formatStr: string,\n locale: CalendarLocaleType = defaultLocale\n) {\n const localeObj = locales[locale] || locales[defaultLocale];\n\n return format(date, formatStr, {\n locale: localeObj,\n });\n}\n"],"mappings":";;;;;;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AAA,QACC,KAAK,CAAC,SAAc;AAClB,uBAAa,UAAU;AACvB,cAAI,OAAO,QAAQ,WAAY,KAAI,IAAI;AAAA,mBAC9B,IAAK,CAAC,IAAY,UAAU;AAAA,QACvC;AAAA,QACA,UAAS;AAAA,QACT,OAAM;AAAA,QAEN;AAAA;AAAA,YAAC;AAAA;AAAA,cACE,GAAG;AAAA,cACJ;AAAA,cACA,aACE,gBAAgB,UAAU,4BAA4B;AAAA,cAExD,OAAO;AAAA,cACP,cAAc;AAAA,cACd,SAAS,MAAM,QAAQ,IAAI;AAAA,cAC3B;AAAA,cACA;AAAA;AAAA,UACF;AAAA,UACC,SACE,QACC;AAAA,YAAC;AAAA;AAAA,cACC,UAAS;AAAA,cACT,KAAI;AAAA,cACJ,MAAM,qBAAqB,SAAS,IAAI;AAAA,cACxC,OAAO,qBAAqB,UAAU,IAAI;AAAA,cAC1C,WAAW;AAAA,cACX,QAAQ;AAAA,cAEP,yBAAe;AAAA;AAAA,UAClB;AAAA;AAAA;AAAA;AAAA,YAKA,6CAAC,OAAI,WAAW,GAAI,yBAAe,GAAE;AAAA;AAAA;AAAA;AAAA,IAE3C;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;;;AG3LzB,IAAAC,mBAAuB;AACvB,cAAyB;AAGzB,IAAM,gBAAgB;AAEf,SAAS,WACd,MACA,WACA,SAA6B,eAC7B;AACA,QAAM,YAAY,QAAQ,MAAM,KAAK,QAAQ,aAAa;AAE1D,aAAO,yBAAO,MAAM,WAAW;AAAA,IAC7B,QAAQ;AAAA,EACV,CAAC;AACH;","names":["import_xui_calendar","import_jsx_runtime","import_date_fns"]}
|
package/native/index.mjs
CHANGED
|
@@ -213,6 +213,7 @@ var DatePicker = forwardRef(
|
|
|
213
213
|
chips,
|
|
214
214
|
activeChip,
|
|
215
215
|
onChipSelect,
|
|
216
|
+
dropdownPosition = "left",
|
|
216
217
|
...rest
|
|
217
218
|
}, ref) => {
|
|
218
219
|
const isDual = variant === "dual";
|
|
@@ -341,7 +342,8 @@ var DatePicker = forwardRef(
|
|
|
341
342
|
{
|
|
342
343
|
position: "absolute",
|
|
343
344
|
top: "100%",
|
|
344
|
-
left: 0,
|
|
345
|
+
left: dropdownPosition === "left" ? 0 : "auto",
|
|
346
|
+
right: dropdownPosition === "right" ? 0 : "auto",
|
|
345
347
|
marginTop: 4,
|
|
346
348
|
zIndex: 1e3,
|
|
347
349
|
children: renderCalendar()
|
package/native/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.tsx","../../src/DatePicker.tsx","../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/index.tsx","../../src/utils.ts"],"sourcesContent":["export {\n Calendar,\n DualCalendar,\n CalendarHeader,\n CalendarGrid,\n CalendarChips,\n} from \"@xsolla/xui-calendar\";\nexport type {\n CalendarProps,\n DualCalendarProps,\n CalendarChipOption,\n CalendarChipsProps,\n CalendarGridProps,\n CalendarHeaderProps,\n CalendarLocaleType,\n} from \"@xsolla/xui-calendar\";\nexport * from \"./DatePicker\";\nexport * from \"./types\";\nexport * from \"./utils\";\n","import { forwardRef, useCallback, useEffect, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, isWeb, isNative } from \"@xsolla/xui-primitives\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { format } from \"date-fns\";\nimport { Calendar, DualCalendar } from \"@xsolla/xui-calendar\";\nimport type { DatePickerProps, DateRangeType } from \"./types\";\n\nexport const DatePicker = forwardRef<any, DatePickerProps>(\n (\n {\n onChange,\n size = \"md\",\n locale = \"enUS\",\n variant = \"single\",\n selectsRange = false,\n startDate,\n endDate,\n selectedDate,\n placeholder,\n backgroundColor,\n testID,\n chips,\n activeChip,\n onChipSelect,\n ...rest\n },\n ref\n ) => {\n const isDual = variant === \"dual\";\n const isRange = isDual || selectsRange;\n const [open, setOpen] = useState(false);\n const [inputValue, setInputValue] = useState(\"\");\n const [internalChip, setInternalChip] = useState<string | null>(null);\n const containerRef = useRef<any>(null);\n const chipSelectionRef = useRef(false);\n\n const activeChipValue =\n activeChip !== undefined ? activeChip : internalChip;\n\n const formatDateForDisplay = (date: Date | null | undefined): string => {\n if (!date) return \"\";\n try {\n return format(date, \"MM/dd/yyyy\");\n } catch {\n return \"\";\n }\n };\n\n const getDisplayValue = useCallback((): string => {\n if (activeChipValue && chips) {\n const chip = chips.find((c) => c.value === activeChipValue);\n if (chip) return chip.label;\n }\n if (isRange) {\n if (startDate && endDate) {\n return `${formatDateForDisplay(startDate)} - ${formatDateForDisplay(endDate)}`;\n } else if (startDate) {\n return formatDateForDisplay(startDate);\n }\n return \"\";\n } else {\n return formatDateForDisplay(selectedDate);\n }\n }, [isRange, startDate, endDate, selectedDate, activeChipValue, chips]);\n\n useEffect(() => {\n setInputValue(getDisplayValue());\n }, [getDisplayValue]);\n\n const handleInputChange = (text: string) => {\n setInputValue(text);\n };\n\n const handleChipSelect = (value: string | null) => {\n chipSelectionRef.current = true;\n setInternalChip(value);\n onChipSelect?.(value);\n };\n\n const handleDateChange = (date: Date | [Date | null, Date | null]) => {\n if (!chipSelectionRef.current) {\n setInternalChip(null);\n onChipSelect?.(null);\n }\n chipSelectionRef.current = false;\n\n if (!isRange) {\n onChange?.(date as Date);\n setOpen(false);\n } else {\n const range = date as DateRangeType;\n onChange?.(range);\n if (range[0] && range[1]) {\n setOpen(false);\n }\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n !containerRef.current.contains(event.target as Node)\n ) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () =>\n document.removeEventListener(\"mousedown\", handleClickOutside);\n }, []);\n\n const renderCalendar = () =>\n isDual ? (\n <DualCalendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n onChange={handleDateChange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n ) : (\n <Calendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n selectedDate={selectedDate}\n onChange={handleDateChange}\n selectsRange={selectsRange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n );\n\n return (\n <Box\n ref={(node: any) => {\n containerRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) (ref as any).current = node;\n }}\n position=\"relative\"\n width=\"100%\"\n >\n <Input\n {...rest}\n size={size}\n placeholder={\n placeholder || (isRange ? \"MM/DD/YYYY - MM/DD/YYYY\" : \"MM/DD/YYYY\")\n }\n value={inputValue}\n onChangeText={handleInputChange}\n onFocus={() => setOpen(true)}\n backgroundColor={backgroundColor}\n testID={testID}\n />\n {open &&\n (isWeb ? (\n <Box\n position=\"absolute\"\n top=\"100%\"\n left={0}\n marginTop={4}\n zIndex={1000}\n >\n {renderCalendar()}\n </Box>\n ) : (\n // Native implementation could use a Modal here\n // For now, we just show it below the input if needed,\n // but usually a bottom sheet or centered modal is better.\n <Box marginTop={4}>{renderCalendar()}</Box>\n ))}\n </Box>\n );\n }\n);\n\nDatePicker.displayName = \"DatePicker\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\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 alignItems,\n justifyContent,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\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 alignItems,\n justifyContent,\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 ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Destructure and drop web-only props from rest before passing to RN components\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 className,\n \"data-testid\": _dataTestId,\n ...nativeRest\n } = rest as Record<string, unknown>;\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 resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n if (onPress) {\n return (\n <Pressable\n onPress={onPress}\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 {...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 {...nativeRest}\n >\n {children}\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","import { format } from \"date-fns\";\nimport * as locales from \"date-fns/locale\";\nimport type { CalendarLocaleType } from \"@xsolla/xui-calendar\";\n\nconst defaultLocale = \"enUS\";\n\nexport function formatDate(\n date: Date,\n formatStr: string,\n locale: CalendarLocaleType = defaultLocale\n) {\n const localeObj = locales[locale] || locales[defaultLocale];\n\n return format(date, formatStr, {\n locale: localeObj,\n });\n}\n"],"mappings":";AAAA;AAAA,EACE,YAAAA;AAAA,EACA,gBAAAC;AA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A;AAAA,QACC,KAAK,CAAC,SAAc;AAClB,uBAAa,UAAU;AACvB,cAAI,OAAO,QAAQ,WAAY,KAAI,IAAI;AAAA,mBAC9B,IAAK,CAAC,IAAY,UAAU;AAAA,QACvC;AAAA,QACA,UAAS;AAAA,QACT,OAAM;AAAA,QAEN;AAAA,0BAAAA;AAAA,YAAC;AAAA;AAAA,cACE,GAAG;AAAA,cACJ;AAAA,cACA,aACE,gBAAgB,UAAU,4BAA4B;AAAA,cAExD,OAAO;AAAA,cACP,cAAc;AAAA,cACd,SAAS,MAAM,QAAQ,IAAI;AAAA,cAC3B;AAAA,cACA;AAAA;AAAA,UACF;AAAA,UACC,SACE,QACC,gBAAAA;AAAA,YAAC;AAAA;AAAA,cACC,UAAS;AAAA,cACT,KAAI;AAAA,cACJ,MAAM;AAAA,cACN,WAAW;AAAA,cACX,QAAQ;AAAA,cAEP,yBAAe;AAAA;AAAA,UAClB;AAAA;AAAA;AAAA;AAAA,YAKA,gBAAAA,KAAC,OAAI,WAAW,GAAI,yBAAe,GAAE;AAAA;AAAA;AAAA;AAAA,IAE3C;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;;;AGzLzB,SAAS,UAAAC,eAAc;AACvB,YAAY,aAAa;AAGzB,IAAM,gBAAgB;AAEf,SAAS,WACd,MACA,WACA,SAA6B,eAC7B;AACA,QAAM,YAAY,QAAQ,MAAM,KAAK,QAAQ,aAAa;AAE1D,SAAOA,QAAO,MAAM,WAAW;AAAA,IAC7B,QAAQ;AAAA,EACV,CAAC;AACH;","names":["Calendar","DualCalendar","jsx","format"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.tsx","../../src/DatePicker.tsx","../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/index.tsx","../../src/utils.ts"],"sourcesContent":["export {\n Calendar,\n DualCalendar,\n CalendarHeader,\n CalendarGrid,\n CalendarChips,\n} from \"@xsolla/xui-calendar\";\nexport type {\n CalendarProps,\n DualCalendarProps,\n CalendarChipOption,\n CalendarChipsProps,\n CalendarGridProps,\n CalendarHeaderProps,\n CalendarLocaleType,\n} from \"@xsolla/xui-calendar\";\nexport * from \"./DatePicker\";\nexport * from \"./types\";\nexport * from \"./utils\";\n","import { forwardRef, useCallback, useEffect, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, isWeb, isNative } from \"@xsolla/xui-primitives\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { format } from \"date-fns\";\nimport { Calendar, DualCalendar } from \"@xsolla/xui-calendar\";\nimport type { DatePickerProps, DateRangeType } from \"./types\";\n\nexport const DatePicker = forwardRef<any, DatePickerProps>(\n (\n {\n onChange,\n size = \"md\",\n locale = \"enUS\",\n variant = \"single\",\n selectsRange = false,\n startDate,\n endDate,\n selectedDate,\n placeholder,\n backgroundColor,\n testID,\n chips,\n activeChip,\n onChipSelect,\n dropdownPosition = \"left\",\n ...rest\n },\n ref\n ) => {\n const isDual = variant === \"dual\";\n const isRange = isDual || selectsRange;\n const [open, setOpen] = useState(false);\n const [inputValue, setInputValue] = useState(\"\");\n const [internalChip, setInternalChip] = useState<string | null>(null);\n const containerRef = useRef<any>(null);\n const chipSelectionRef = useRef(false);\n\n const activeChipValue =\n activeChip !== undefined ? activeChip : internalChip;\n\n const formatDateForDisplay = (date: Date | null | undefined): string => {\n if (!date) return \"\";\n try {\n return format(date, \"MM/dd/yyyy\");\n } catch {\n return \"\";\n }\n };\n\n const getDisplayValue = useCallback((): string => {\n if (activeChipValue && chips) {\n const chip = chips.find((c) => c.value === activeChipValue);\n if (chip) return chip.label;\n }\n if (isRange) {\n if (startDate && endDate) {\n return `${formatDateForDisplay(startDate)} - ${formatDateForDisplay(endDate)}`;\n } else if (startDate) {\n return formatDateForDisplay(startDate);\n }\n return \"\";\n } else {\n return formatDateForDisplay(selectedDate);\n }\n }, [isRange, startDate, endDate, selectedDate, activeChipValue, chips]);\n\n useEffect(() => {\n setInputValue(getDisplayValue());\n }, [getDisplayValue]);\n\n const handleInputChange = (text: string) => {\n setInputValue(text);\n };\n\n const handleChipSelect = (value: string | null) => {\n chipSelectionRef.current = true;\n setInternalChip(value);\n onChipSelect?.(value);\n };\n\n const handleDateChange = (date: Date | [Date | null, Date | null]) => {\n if (!chipSelectionRef.current) {\n setInternalChip(null);\n onChipSelect?.(null);\n }\n chipSelectionRef.current = false;\n\n if (!isRange) {\n onChange?.(date as Date);\n setOpen(false);\n } else {\n const range = date as DateRangeType;\n onChange?.(range);\n if (range[0] && range[1]) {\n setOpen(false);\n }\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n !containerRef.current.contains(event.target as Node)\n ) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () =>\n document.removeEventListener(\"mousedown\", handleClickOutside);\n }, []);\n\n const renderCalendar = () =>\n isDual ? (\n <DualCalendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n onChange={handleDateChange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n ) : (\n <Calendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n selectedDate={selectedDate}\n onChange={handleDateChange}\n selectsRange={selectsRange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n );\n\n return (\n <Box\n ref={(node: any) => {\n containerRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) (ref as any).current = node;\n }}\n position=\"relative\"\n width=\"100%\"\n >\n <Input\n {...rest}\n size={size}\n placeholder={\n placeholder || (isRange ? \"MM/DD/YYYY - MM/DD/YYYY\" : \"MM/DD/YYYY\")\n }\n value={inputValue}\n onChangeText={handleInputChange}\n onFocus={() => setOpen(true)}\n backgroundColor={backgroundColor}\n testID={testID}\n />\n {open &&\n (isWeb ? (\n <Box\n position=\"absolute\"\n top=\"100%\"\n left={dropdownPosition === \"left\" ? 0 : \"auto\"}\n right={dropdownPosition === \"right\" ? 0 : \"auto\"}\n marginTop={4}\n zIndex={1000}\n >\n {renderCalendar()}\n </Box>\n ) : (\n // Native implementation could use a Modal here\n // For now, we just show it below the input if needed,\n // but usually a bottom sheet or centered modal is better.\n <Box marginTop={4}>{renderCalendar()}</Box>\n ))}\n </Box>\n );\n }\n);\n\nDatePicker.displayName = \"DatePicker\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\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 alignItems,\n justifyContent,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\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 alignItems,\n justifyContent,\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 ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Destructure and drop web-only props from rest before passing to RN components\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 className,\n \"data-testid\": _dataTestId,\n ...nativeRest\n } = rest as Record<string, unknown>;\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 resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n if (onPress) {\n return (\n <Pressable\n onPress={onPress}\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 {...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 {...nativeRest}\n >\n {children}\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","import { format } from \"date-fns\";\nimport * as locales from \"date-fns/locale\";\nimport type { CalendarLocaleType } from \"@xsolla/xui-calendar\";\n\nconst defaultLocale = \"enUS\";\n\nexport function formatDate(\n date: Date,\n formatStr: string,\n locale: CalendarLocaleType = defaultLocale\n) {\n const localeObj = locales[locale] || locales[defaultLocale];\n\n return format(date, formatStr, {\n locale: localeObj,\n });\n}\n"],"mappings":";AAAA;AAAA,EACE,YAAAA;AAAA,EACA,gBAAAC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACNP,SAAS,YAAY,aAAa,WAAW,QAAQ,gBAAgB;;;ACCrE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AA2ID;AAxIC,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;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AAS;AAAA,cACT,KAAI;AAAA,cACJ,MAAM,qBAAqB,SAAS,IAAI;AAAA,cACxC,OAAO,qBAAqB,UAAU,IAAI;AAAA,cAC1C,WAAW;AAAA,cACX,QAAQ;AAAA,cAEP,yBAAe;AAAA;AAAA,UAClB;AAAA;AAAA;AAAA;AAAA,YAKA,gBAAAA,KAAC,OAAI,WAAW,GAAI,yBAAe,GAAE;AAAA;AAAA;AAAA;AAAA,IAE3C;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;;;AG3LzB,SAAS,UAAAC,eAAc;AACvB,YAAY,aAAa;AAGzB,IAAM,gBAAgB;AAEf,SAAS,WACd,MACA,WACA,SAA6B,eAC7B;AACA,QAAM,YAAY,QAAQ,MAAM,KAAK,QAAQ,aAAa;AAE1D,SAAOA,QAAO,MAAM,WAAW;AAAA,IAC7B,QAAQ;AAAA,EACV,CAAC;AACH;","names":["Calendar","DualCalendar","jsx","format"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-date-picker",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.160.0",
|
|
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-calendar": "0.
|
|
17
|
-
"@xsolla/xui-core": "0.
|
|
18
|
-
"@xsolla/xui-input": "0.
|
|
19
|
-
"@xsolla/xui-primitives-core": "0.
|
|
16
|
+
"@xsolla/xui-calendar": "0.160.0",
|
|
17
|
+
"@xsolla/xui-core": "0.160.0",
|
|
18
|
+
"@xsolla/xui-input": "0.160.0",
|
|
19
|
+
"@xsolla/xui-primitives-core": "0.160.0",
|
|
20
20
|
"date-fns": "^3.0.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
package/web/index.d.mts
CHANGED
|
@@ -3,6 +3,7 @@ export { Calendar, CalendarChipOption, CalendarChips, CalendarChipsProps, Calend
|
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
|
|
5
5
|
type DateRangeType = [Date | null, Date | null];
|
|
6
|
+
type DatePickerDropdownPosition = "left" | "right";
|
|
6
7
|
interface DatePickerProps extends Omit<CalendarProps, "onChange"> {
|
|
7
8
|
/**
|
|
8
9
|
* Calendar variant: "single" shows a single month, "dual" shows two months side-by-side.
|
|
@@ -29,10 +30,16 @@ interface DatePickerProps extends Omit<CalendarProps, "onChange"> {
|
|
|
29
30
|
* Custom background color for the input
|
|
30
31
|
*/
|
|
31
32
|
backgroundColor?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Horizontal alignment of the calendar dropdown relative to the input.
|
|
35
|
+
*/
|
|
36
|
+
dropdownPosition?: DatePickerDropdownPosition;
|
|
37
|
+
/** Test ID for testing frameworks */
|
|
38
|
+
testID?: string;
|
|
32
39
|
}
|
|
33
40
|
|
|
34
41
|
declare const DatePicker: react.ForwardRefExoticComponent<DatePickerProps & react.RefAttributes<any>>;
|
|
35
42
|
|
|
36
43
|
declare function formatDate(date: Date, formatStr: string, locale?: CalendarLocaleType): string;
|
|
37
44
|
|
|
38
|
-
export { DatePicker, type DatePickerProps, type DateRangeType, formatDate };
|
|
45
|
+
export { DatePicker, type DatePickerDropdownPosition, type DatePickerProps, type DateRangeType, formatDate };
|
package/web/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { Calendar, CalendarChipOption, CalendarChips, CalendarChipsProps, Calend
|
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
|
|
5
5
|
type DateRangeType = [Date | null, Date | null];
|
|
6
|
+
type DatePickerDropdownPosition = "left" | "right";
|
|
6
7
|
interface DatePickerProps extends Omit<CalendarProps, "onChange"> {
|
|
7
8
|
/**
|
|
8
9
|
* Calendar variant: "single" shows a single month, "dual" shows two months side-by-side.
|
|
@@ -29,10 +30,16 @@ interface DatePickerProps extends Omit<CalendarProps, "onChange"> {
|
|
|
29
30
|
* Custom background color for the input
|
|
30
31
|
*/
|
|
31
32
|
backgroundColor?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Horizontal alignment of the calendar dropdown relative to the input.
|
|
35
|
+
*/
|
|
36
|
+
dropdownPosition?: DatePickerDropdownPosition;
|
|
37
|
+
/** Test ID for testing frameworks */
|
|
38
|
+
testID?: string;
|
|
32
39
|
}
|
|
33
40
|
|
|
34
41
|
declare const DatePicker: react.ForwardRefExoticComponent<DatePickerProps & react.RefAttributes<any>>;
|
|
35
42
|
|
|
36
43
|
declare function formatDate(date: Date, formatStr: string, locale?: CalendarLocaleType): string;
|
|
37
44
|
|
|
38
|
-
export { DatePicker, type DatePickerProps, type DateRangeType, formatDate };
|
|
45
|
+
export { DatePicker, type DatePickerDropdownPosition, type DatePickerProps, type DateRangeType, formatDate };
|
package/web/index.js
CHANGED
|
@@ -320,6 +320,7 @@ var DatePicker = (0, import_react3.forwardRef)(
|
|
|
320
320
|
chips,
|
|
321
321
|
activeChip,
|
|
322
322
|
onChipSelect,
|
|
323
|
+
dropdownPosition = "left",
|
|
323
324
|
...rest
|
|
324
325
|
}, ref) => {
|
|
325
326
|
const isDual = variant === "dual";
|
|
@@ -448,7 +449,8 @@ var DatePicker = (0, import_react3.forwardRef)(
|
|
|
448
449
|
{
|
|
449
450
|
position: "absolute",
|
|
450
451
|
top: "100%",
|
|
451
|
-
left: 0,
|
|
452
|
+
left: dropdownPosition === "left" ? 0 : "auto",
|
|
453
|
+
right: dropdownPosition === "right" ? 0 : "auto",
|
|
452
454
|
marginTop: 4,
|
|
453
455
|
zIndex: 1e3,
|
|
454
456
|
children: renderCalendar()
|
package/web/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.tsx","../../src/DatePicker.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/index.tsx","../../src/utils.ts"],"sourcesContent":["export {\n Calendar,\n DualCalendar,\n CalendarHeader,\n CalendarGrid,\n CalendarChips,\n} from \"@xsolla/xui-calendar\";\nexport type {\n CalendarProps,\n DualCalendarProps,\n CalendarChipOption,\n CalendarChipsProps,\n CalendarGridProps,\n CalendarHeaderProps,\n CalendarLocaleType,\n} from \"@xsolla/xui-calendar\";\nexport * from \"./DatePicker\";\nexport * from \"./types\";\nexport * from \"./utils\";\n","import { forwardRef, useCallback, useEffect, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, isWeb, isNative } from \"@xsolla/xui-primitives\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { format } from \"date-fns\";\nimport { Calendar, DualCalendar } from \"@xsolla/xui-calendar\";\nimport type { DatePickerProps, DateRangeType } from \"./types\";\n\nexport const DatePicker = forwardRef<any, DatePickerProps>(\n (\n {\n onChange,\n size = \"md\",\n locale = \"enUS\",\n variant = \"single\",\n selectsRange = false,\n startDate,\n endDate,\n selectedDate,\n placeholder,\n backgroundColor,\n testID,\n chips,\n activeChip,\n onChipSelect,\n ...rest\n },\n ref\n ) => {\n const isDual = variant === \"dual\";\n const isRange = isDual || selectsRange;\n const [open, setOpen] = useState(false);\n const [inputValue, setInputValue] = useState(\"\");\n const [internalChip, setInternalChip] = useState<string | null>(null);\n const containerRef = useRef<any>(null);\n const chipSelectionRef = useRef(false);\n\n const activeChipValue =\n activeChip !== undefined ? activeChip : internalChip;\n\n const formatDateForDisplay = (date: Date | null | undefined): string => {\n if (!date) return \"\";\n try {\n return format(date, \"MM/dd/yyyy\");\n } catch {\n return \"\";\n }\n };\n\n const getDisplayValue = useCallback((): string => {\n if (activeChipValue && chips) {\n const chip = chips.find((c) => c.value === activeChipValue);\n if (chip) return chip.label;\n }\n if (isRange) {\n if (startDate && endDate) {\n return `${formatDateForDisplay(startDate)} - ${formatDateForDisplay(endDate)}`;\n } else if (startDate) {\n return formatDateForDisplay(startDate);\n }\n return \"\";\n } else {\n return formatDateForDisplay(selectedDate);\n }\n }, [isRange, startDate, endDate, selectedDate, activeChipValue, chips]);\n\n useEffect(() => {\n setInputValue(getDisplayValue());\n }, [getDisplayValue]);\n\n const handleInputChange = (text: string) => {\n setInputValue(text);\n };\n\n const handleChipSelect = (value: string | null) => {\n chipSelectionRef.current = true;\n setInternalChip(value);\n onChipSelect?.(value);\n };\n\n const handleDateChange = (date: Date | [Date | null, Date | null]) => {\n if (!chipSelectionRef.current) {\n setInternalChip(null);\n onChipSelect?.(null);\n }\n chipSelectionRef.current = false;\n\n if (!isRange) {\n onChange?.(date as Date);\n setOpen(false);\n } else {\n const range = date as DateRangeType;\n onChange?.(range);\n if (range[0] && range[1]) {\n setOpen(false);\n }\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n !containerRef.current.contains(event.target as Node)\n ) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () =>\n document.removeEventListener(\"mousedown\", handleClickOutside);\n }, []);\n\n const renderCalendar = () =>\n isDual ? (\n <DualCalendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n onChange={handleDateChange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n ) : (\n <Calendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n selectedDate={selectedDate}\n onChange={handleDateChange}\n selectsRange={selectsRange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n );\n\n return (\n <Box\n ref={(node: any) => {\n containerRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) (ref as any).current = node;\n }}\n position=\"relative\"\n width=\"100%\"\n >\n <Input\n {...rest}\n size={size}\n placeholder={\n placeholder || (isRange ? \"MM/DD/YYYY - MM/DD/YYYY\" : \"MM/DD/YYYY\")\n }\n value={inputValue}\n onChangeText={handleInputChange}\n onFocus={() => setOpen(true)}\n backgroundColor={backgroundColor}\n testID={testID}\n />\n {open &&\n (isWeb ? (\n <Box\n position=\"absolute\"\n top=\"100%\"\n left={0}\n marginTop={4}\n zIndex={1000}\n >\n {renderCalendar()}\n </Box>\n ) : (\n // Native implementation could use a Modal here\n // For now, we just show it below the input if needed,\n // but usually a bottom sheet or centered modal is better.\n <Box marginTop={4}>{renderCalendar()}</Box>\n ))}\n </Box>\n );\n }\n);\n\nDatePicker.displayName = \"DatePicker\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n ...props.style,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","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","import { format } from \"date-fns\";\nimport * as locales from \"date-fns/locale\";\nimport type { CalendarLocaleType } from \"@xsolla/xui-calendar\";\n\nconst defaultLocale = \"enUS\";\n\nexport function formatDate(\n date: Date,\n formatStr: string,\n locale: CalendarLocaleType = defaultLocale\n) {\n const localeObj = locales[locale] || locales[defaultLocale];\n\n return format(date, formatStr, {\n locale: localeObj,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,uBAMO;;;ACNP,IAAAC,gBAAqE;;;ACArE,IAAAC,gBAAkB;AAClB,+BAAmB;;;ACDnB,mBAAkB;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SAAO,SAAU,KAAK;AACpB,QAAI,MAAM,GAAG,MAAM,OAAW,OAAM,GAAG,IAAI,GAAG,GAAG;AACjD,WAAO,MAAM,GAAG;AAAA,EAClB;AACF;AAEA,IAAO,sBAAQ;;;ACNf,IAAI,kBAAkB;AAEtB,IAAI,QAAQ;AAAA,EAAQ,SAAU,MAAM;AAClC,WAAO,gBAAgB,KAAK,IAAI,KAAK,KAAK,WAAW,CAAC,MAAM,OAEzD,KAAK,WAAW,CAAC,MAAM,OAEvB,KAAK,WAAW,CAAC,IAAI;AAAA,EAC1B;AAAA;AAEA;AAEA,IAAO,4BAAQ;;;AFRR,IAAM,2BAA2B,oBAAI,IAAI;AAAA;AAAA,EAE9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,SAAS,kBAAkB,KAAsB;AAC/C,MAAI,yBAAyB,IAAI,GAAG,EAAG,QAAO;AAC9C,SAAO,0BAAY,GAAG;AACxB;AAgBO,SAAS,sBAAsB,YAAoB;AACxD,QAAM,YAAY,aAAAC,QAAM;A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;AAAA,UACF;AAAA,UACC,SACE,QACC;AAAA,YAAC;AAAA;AAAA,cACC,UAAS;AAAA,cACT,KAAI;AAAA,cACJ,MAAM;AAAA,cACN,WAAW;AAAA,cACX,QAAQ;AAAA,cAEP,yBAAe;AAAA;AAAA,UAClB;AAAA;AAAA;AAAA;AAAA,YAKA,6CAAC,OAAI,WAAW,GAAI,yBAAe,GAAE;AAAA;AAAA;AAAA;AAAA,IAE3C;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;;;AMzLzB,IAAAC,mBAAuB;AACvB,cAAyB;AAGzB,IAAM,gBAAgB;AAEf,SAAS,WACd,MACA,WACA,SAA6B,eAC7B;AACA,QAAM,YAAY,QAAQ,MAAM,KAAK,QAAQ,aAAa;AAE1D,aAAO,yBAAO,MAAM,WAAW;AAAA,IAC7B,QAAQ;AAAA,EACV,CAAC;AACH;","names":["import_xui_calendar","import_react","import_react","React","styled","React","import_jsx_runtime","import_date_fns"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.tsx","../../src/DatePicker.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/index.tsx","../../src/utils.ts"],"sourcesContent":["export {\n Calendar,\n DualCalendar,\n CalendarHeader,\n CalendarGrid,\n CalendarChips,\n} from \"@xsolla/xui-calendar\";\nexport type {\n CalendarProps,\n DualCalendarProps,\n CalendarChipOption,\n CalendarChipsProps,\n CalendarGridProps,\n CalendarHeaderProps,\n CalendarLocaleType,\n} from \"@xsolla/xui-calendar\";\nexport * from \"./DatePicker\";\nexport * from \"./types\";\nexport * from \"./utils\";\n","import { forwardRef, useCallback, useEffect, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, isWeb, isNative } from \"@xsolla/xui-primitives\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { format } from \"date-fns\";\nimport { Calendar, DualCalendar } from \"@xsolla/xui-calendar\";\nimport type { DatePickerProps, DateRangeType } from \"./types\";\n\nexport const DatePicker = forwardRef<any, DatePickerProps>(\n (\n {\n onChange,\n size = \"md\",\n locale = \"enUS\",\n variant = \"single\",\n selectsRange = false,\n startDate,\n endDate,\n selectedDate,\n placeholder,\n backgroundColor,\n testID,\n chips,\n activeChip,\n onChipSelect,\n dropdownPosition = \"left\",\n ...rest\n },\n ref\n ) => {\n const isDual = variant === \"dual\";\n const isRange = isDual || selectsRange;\n const [open, setOpen] = useState(false);\n const [inputValue, setInputValue] = useState(\"\");\n const [internalChip, setInternalChip] = useState<string | null>(null);\n const containerRef = useRef<any>(null);\n const chipSelectionRef = useRef(false);\n\n const activeChipValue =\n activeChip !== undefined ? activeChip : internalChip;\n\n const formatDateForDisplay = (date: Date | null | undefined): string => {\n if (!date) return \"\";\n try {\n return format(date, \"MM/dd/yyyy\");\n } catch {\n return \"\";\n }\n };\n\n const getDisplayValue = useCallback((): string => {\n if (activeChipValue && chips) {\n const chip = chips.find((c) => c.value === activeChipValue);\n if (chip) return chip.label;\n }\n if (isRange) {\n if (startDate && endDate) {\n return `${formatDateForDisplay(startDate)} - ${formatDateForDisplay(endDate)}`;\n } else if (startDate) {\n return formatDateForDisplay(startDate);\n }\n return \"\";\n } else {\n return formatDateForDisplay(selectedDate);\n }\n }, [isRange, startDate, endDate, selectedDate, activeChipValue, chips]);\n\n useEffect(() => {\n setInputValue(getDisplayValue());\n }, [getDisplayValue]);\n\n const handleInputChange = (text: string) => {\n setInputValue(text);\n };\n\n const handleChipSelect = (value: string | null) => {\n chipSelectionRef.current = true;\n setInternalChip(value);\n onChipSelect?.(value);\n };\n\n const handleDateChange = (date: Date | [Date | null, Date | null]) => {\n if (!chipSelectionRef.current) {\n setInternalChip(null);\n onChipSelect?.(null);\n }\n chipSelectionRef.current = false;\n\n if (!isRange) {\n onChange?.(date as Date);\n setOpen(false);\n } else {\n const range = date as DateRangeType;\n onChange?.(range);\n if (range[0] && range[1]) {\n setOpen(false);\n }\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n !containerRef.current.contains(event.target as Node)\n ) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () =>\n document.removeEventListener(\"mousedown\", handleClickOutside);\n }, []);\n\n const renderCalendar = () =>\n isDual ? (\n <DualCalendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n onChange={handleDateChange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n ) : (\n <Calendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n selectedDate={selectedDate}\n onChange={handleDateChange}\n selectsRange={selectsRange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n );\n\n return (\n <Box\n ref={(node: any) => {\n containerRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) (ref as any).current = node;\n }}\n position=\"relative\"\n width=\"100%\"\n >\n <Input\n {...rest}\n size={size}\n placeholder={\n placeholder || (isRange ? \"MM/DD/YYYY - MM/DD/YYYY\" : \"MM/DD/YYYY\")\n }\n value={inputValue}\n onChangeText={handleInputChange}\n onFocus={() => setOpen(true)}\n backgroundColor={backgroundColor}\n testID={testID}\n />\n {open &&\n (isWeb ? (\n <Box\n position=\"absolute\"\n top=\"100%\"\n left={dropdownPosition === \"left\" ? 0 : \"auto\"}\n right={dropdownPosition === \"right\" ? 0 : \"auto\"}\n marginTop={4}\n zIndex={1000}\n >\n {renderCalendar()}\n </Box>\n ) : (\n // Native implementation could use a Modal here\n // For now, we just show it below the input if needed,\n // but usually a bottom sheet or centered modal is better.\n <Box marginTop={4}>{renderCalendar()}</Box>\n ))}\n </Box>\n );\n }\n);\n\nDatePicker.displayName = \"DatePicker\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n ...props.style,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","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","import { format } from \"date-fns\";\nimport * as locales from \"date-fns/locale\";\nimport type { CalendarLocaleType } from \"@xsolla/xui-calendar\";\n\nconst defaultLocale = \"enUS\";\n\nexport function formatDate(\n date: Date,\n formatStr: string,\n locale: CalendarLocaleType = defaultLocale\n) {\n const localeObj = locales[locale] || locales[defaultLocale];\n\n return format(date, formatStr, {\n locale: localeObj,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,uBAMO;;;ACNP,IAAAC,gBAAqE;;;ACArE,IAAAC,gBAAkB;AAClB,+BAAmB;;;ACDnB,mBAAkB;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SA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B;AAEf,SAAS,WACd,MACA,WACA,SAA6B,eAC7B;AACA,QAAM,YAAY,QAAQ,MAAM,KAAK,QAAQ,aAAa;AAE1D,aAAO,yBAAO,MAAM,WAAW;AAAA,IAC7B,QAAQ;AAAA,EACV,CAAC;AACH;","names":["import_xui_calendar","import_react","import_react","React","styled","React","import_jsx_runtime","import_date_fns"]}
|
package/web/index.mjs
CHANGED
|
@@ -286,6 +286,7 @@ var DatePicker = forwardRef(
|
|
|
286
286
|
chips,
|
|
287
287
|
activeChip,
|
|
288
288
|
onChipSelect,
|
|
289
|
+
dropdownPosition = "left",
|
|
289
290
|
...rest
|
|
290
291
|
}, ref) => {
|
|
291
292
|
const isDual = variant === "dual";
|
|
@@ -414,7 +415,8 @@ var DatePicker = forwardRef(
|
|
|
414
415
|
{
|
|
415
416
|
position: "absolute",
|
|
416
417
|
top: "100%",
|
|
417
|
-
left: 0,
|
|
418
|
+
left: dropdownPosition === "left" ? 0 : "auto",
|
|
419
|
+
right: dropdownPosition === "right" ? 0 : "auto",
|
|
418
420
|
marginTop: 4,
|
|
419
421
|
zIndex: 1e3,
|
|
420
422
|
children: renderCalendar()
|
package/web/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.tsx","../../src/DatePicker.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/index.tsx","../../src/utils.ts"],"sourcesContent":["export {\n Calendar,\n DualCalendar,\n CalendarHeader,\n CalendarGrid,\n CalendarChips,\n} from \"@xsolla/xui-calendar\";\nexport type {\n CalendarProps,\n DualCalendarProps,\n CalendarChipOption,\n CalendarChipsProps,\n CalendarGridProps,\n CalendarHeaderProps,\n CalendarLocaleType,\n} from \"@xsolla/xui-calendar\";\nexport * from \"./DatePicker\";\nexport * from \"./types\";\nexport * from \"./utils\";\n","import { forwardRef, useCallback, useEffect, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, isWeb, isNative } from \"@xsolla/xui-primitives\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { format } from \"date-fns\";\nimport { Calendar, DualCalendar } from \"@xsolla/xui-calendar\";\nimport type { DatePickerProps, DateRangeType } from \"./types\";\n\nexport const DatePicker = forwardRef<any, DatePickerProps>(\n (\n {\n onChange,\n size = \"md\",\n locale = \"enUS\",\n variant = \"single\",\n selectsRange = false,\n startDate,\n endDate,\n selectedDate,\n placeholder,\n backgroundColor,\n testID,\n chips,\n activeChip,\n onChipSelect,\n ...rest\n },\n ref\n ) => {\n const isDual = variant === \"dual\";\n const isRange = isDual || selectsRange;\n const [open, setOpen] = useState(false);\n const [inputValue, setInputValue] = useState(\"\");\n const [internalChip, setInternalChip] = useState<string | null>(null);\n const containerRef = useRef<any>(null);\n const chipSelectionRef = useRef(false);\n\n const activeChipValue =\n activeChip !== undefined ? activeChip : internalChip;\n\n const formatDateForDisplay = (date: Date | null | undefined): string => {\n if (!date) return \"\";\n try {\n return format(date, \"MM/dd/yyyy\");\n } catch {\n return \"\";\n }\n };\n\n const getDisplayValue = useCallback((): string => {\n if (activeChipValue && chips) {\n const chip = chips.find((c) => c.value === activeChipValue);\n if (chip) return chip.label;\n }\n if (isRange) {\n if (startDate && endDate) {\n return `${formatDateForDisplay(startDate)} - ${formatDateForDisplay(endDate)}`;\n } else if (startDate) {\n return formatDateForDisplay(startDate);\n }\n return \"\";\n } else {\n return formatDateForDisplay(selectedDate);\n }\n }, [isRange, startDate, endDate, selectedDate, activeChipValue, chips]);\n\n useEffect(() => {\n setInputValue(getDisplayValue());\n }, [getDisplayValue]);\n\n const handleInputChange = (text: string) => {\n setInputValue(text);\n };\n\n const handleChipSelect = (value: string | null) => {\n chipSelectionRef.current = true;\n setInternalChip(value);\n onChipSelect?.(value);\n };\n\n const handleDateChange = (date: Date | [Date | null, Date | null]) => {\n if (!chipSelectionRef.current) {\n setInternalChip(null);\n onChipSelect?.(null);\n }\n chipSelectionRef.current = false;\n\n if (!isRange) {\n onChange?.(date as Date);\n setOpen(false);\n } else {\n const range = date as DateRangeType;\n onChange?.(range);\n if (range[0] && range[1]) {\n setOpen(false);\n }\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n !containerRef.current.contains(event.target as Node)\n ) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () =>\n document.removeEventListener(\"mousedown\", handleClickOutside);\n }, []);\n\n const renderCalendar = () =>\n isDual ? (\n <DualCalendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n onChange={handleDateChange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n ) : (\n <Calendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n selectedDate={selectedDate}\n onChange={handleDateChange}\n selectsRange={selectsRange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n );\n\n return (\n <Box\n ref={(node: any) => {\n containerRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) (ref as any).current = node;\n }}\n position=\"relative\"\n width=\"100%\"\n >\n <Input\n {...rest}\n size={size}\n placeholder={\n placeholder || (isRange ? \"MM/DD/YYYY - MM/DD/YYYY\" : \"MM/DD/YYYY\")\n }\n value={inputValue}\n onChangeText={handleInputChange}\n onFocus={() => setOpen(true)}\n backgroundColor={backgroundColor}\n testID={testID}\n />\n {open &&\n (isWeb ? (\n <Box\n position=\"absolute\"\n top=\"100%\"\n left={0}\n marginTop={4}\n zIndex={1000}\n >\n {renderCalendar()}\n </Box>\n ) : (\n // Native implementation could use a Modal here\n // For now, we just show it below the input if needed,\n // but usually a bottom sheet or centered modal is better.\n <Box marginTop={4}>{renderCalendar()}</Box>\n ))}\n </Box>\n );\n }\n);\n\nDatePicker.displayName = \"DatePicker\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n ...props.style,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","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","import { format } from \"date-fns\";\nimport * as locales from \"date-fns/locale\";\nimport type { CalendarLocaleType } from \"@xsolla/xui-calendar\";\n\nconst defaultLocale = \"enUS\";\n\nexport function formatDate(\n date: Date,\n formatStr: string,\n locale: CalendarLocaleType = defaultLocale\n) {\n const localeObj = locales[locale] || locales[defaultLocale];\n\n return format(date, formatStr, {\n locale: localeObj,\n });\n}\n"],"mappings":";AAAA;AAAA,EACE,YAAAA;AAAA,EACA,gBAAAC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACNP,SAAS,YAAY,aAAa,WAAW,QAAQ,gBAAgB;;;ACArE,OAAOC,YAAW;AAClB,OAAO,YAAY;;;ACDnB,OA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a;AAGzB,IAAM,gBAAgB;AAEf,SAAS,WACd,MACA,WACA,SAA6B,eAC7B;AACA,QAAM,YAAY,QAAQ,MAAM,KAAK,QAAQ,aAAa;AAE1D,SAAOA,QAAO,MAAM,WAAW;AAAA,IAC7B,QAAQ;AAAA,EACV,CAAC;AACH;","names":["Calendar","DualCalendar","React","React","jsx","format"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.tsx","../../src/DatePicker.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/index.tsx","../../src/utils.ts"],"sourcesContent":["export {\n Calendar,\n DualCalendar,\n CalendarHeader,\n CalendarGrid,\n CalendarChips,\n} from \"@xsolla/xui-calendar\";\nexport type {\n CalendarProps,\n DualCalendarProps,\n CalendarChipOption,\n CalendarChipsProps,\n CalendarGridProps,\n CalendarHeaderProps,\n CalendarLocaleType,\n} from \"@xsolla/xui-calendar\";\nexport * from \"./DatePicker\";\nexport * from \"./types\";\nexport * from \"./utils\";\n","import { forwardRef, useCallback, useEffect, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, isWeb, isNative } from \"@xsolla/xui-primitives\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { format } from \"date-fns\";\nimport { Calendar, DualCalendar } from \"@xsolla/xui-calendar\";\nimport type { DatePickerProps, DateRangeType } from \"./types\";\n\nexport const DatePicker = forwardRef<any, DatePickerProps>(\n (\n {\n onChange,\n size = \"md\",\n locale = \"enUS\",\n variant = \"single\",\n selectsRange = false,\n startDate,\n endDate,\n selectedDate,\n placeholder,\n backgroundColor,\n testID,\n chips,\n activeChip,\n onChipSelect,\n dropdownPosition = \"left\",\n ...rest\n },\n ref\n ) => {\n const isDual = variant === \"dual\";\n const isRange = isDual || selectsRange;\n const [open, setOpen] = useState(false);\n const [inputValue, setInputValue] = useState(\"\");\n const [internalChip, setInternalChip] = useState<string | null>(null);\n const containerRef = useRef<any>(null);\n const chipSelectionRef = useRef(false);\n\n const activeChipValue =\n activeChip !== undefined ? activeChip : internalChip;\n\n const formatDateForDisplay = (date: Date | null | undefined): string => {\n if (!date) return \"\";\n try {\n return format(date, \"MM/dd/yyyy\");\n } catch {\n return \"\";\n }\n };\n\n const getDisplayValue = useCallback((): string => {\n if (activeChipValue && chips) {\n const chip = chips.find((c) => c.value === activeChipValue);\n if (chip) return chip.label;\n }\n if (isRange) {\n if (startDate && endDate) {\n return `${formatDateForDisplay(startDate)} - ${formatDateForDisplay(endDate)}`;\n } else if (startDate) {\n return formatDateForDisplay(startDate);\n }\n return \"\";\n } else {\n return formatDateForDisplay(selectedDate);\n }\n }, [isRange, startDate, endDate, selectedDate, activeChipValue, chips]);\n\n useEffect(() => {\n setInputValue(getDisplayValue());\n }, [getDisplayValue]);\n\n const handleInputChange = (text: string) => {\n setInputValue(text);\n };\n\n const handleChipSelect = (value: string | null) => {\n chipSelectionRef.current = true;\n setInternalChip(value);\n onChipSelect?.(value);\n };\n\n const handleDateChange = (date: Date | [Date | null, Date | null]) => {\n if (!chipSelectionRef.current) {\n setInternalChip(null);\n onChipSelect?.(null);\n }\n chipSelectionRef.current = false;\n\n if (!isRange) {\n onChange?.(date as Date);\n setOpen(false);\n } else {\n const range = date as DateRangeType;\n onChange?.(range);\n if (range[0] && range[1]) {\n setOpen(false);\n }\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n !containerRef.current.contains(event.target as Node)\n ) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () =>\n document.removeEventListener(\"mousedown\", handleClickOutside);\n }, []);\n\n const renderCalendar = () =>\n isDual ? (\n <DualCalendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n onChange={handleDateChange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n ) : (\n <Calendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n selectedDate={selectedDate}\n onChange={handleDateChange}\n selectsRange={selectsRange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n );\n\n return (\n <Box\n ref={(node: any) => {\n containerRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) (ref as any).current = node;\n }}\n position=\"relative\"\n width=\"100%\"\n >\n <Input\n {...rest}\n size={size}\n placeholder={\n placeholder || (isRange ? \"MM/DD/YYYY - MM/DD/YYYY\" : \"MM/DD/YYYY\")\n }\n value={inputValue}\n onChangeText={handleInputChange}\n onFocus={() => setOpen(true)}\n backgroundColor={backgroundColor}\n testID={testID}\n />\n {open &&\n (isWeb ? (\n <Box\n position=\"absolute\"\n top=\"100%\"\n left={dropdownPosition === \"left\" ? 0 : \"auto\"}\n right={dropdownPosition === \"right\" ? 0 : \"auto\"}\n marginTop={4}\n zIndex={1000}\n >\n {renderCalendar()}\n </Box>\n ) : (\n // Native implementation could use a Modal here\n // For now, we just show it below the input if needed,\n // but usually a bottom sheet or centered modal is better.\n <Box marginTop={4}>{renderCalendar()}</Box>\n ))}\n </Box>\n );\n }\n);\n\nDatePicker.displayName = \"DatePicker\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n ...props.style,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","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","import { format } from \"date-fns\";\nimport * as locales from \"date-fns/locale\";\nimport type { CalendarLocaleType } from \"@xsolla/xui-calendar\";\n\nconst defaultLocale = \"enUS\";\n\nexport function formatDate(\n date: Date,\n formatStr: string,\n locale: CalendarLocaleType = defaultLocale\n) {\n const localeObj = locales[locale] || locales[defaultLocale];\n\n return format(date, formatStr, {\n locale: localeObj,\n });\n}\n"],"mappings":";AAAA;AAAA,EACE,YAAAA;AAAA,EACA,gBAAAC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACNP,SAAS,YAAY,aAAa,WAAW,QAAQ,gBAAgB;;;ACArE,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,4B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