@xsolla/xui-date-picker 0.141.0 → 0.141.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/native/index.js +2 -2
- package/native/index.js.map +1 -1
- package/native/index.mjs +2 -2
- package/native/index.mjs.map +1 -1
- package/package.json +5 -5
- package/web/index.js +7 -7
- package/web/index.js.map +1 -1
- package/web/index.mjs +7 -7
- package/web/index.mjs.map +1 -1
- package/README.md +0 -170
package/native/index.js
CHANGED
|
@@ -44,7 +44,7 @@ var import_xui_calendar2 = require("@xsolla/xui-calendar");
|
|
|
44
44
|
// src/DatePicker.tsx
|
|
45
45
|
var import_react = require("react");
|
|
46
46
|
|
|
47
|
-
//
|
|
47
|
+
// ../../foundation/primitives-native/src/Box.tsx
|
|
48
48
|
var import_react_native = require("react-native");
|
|
49
49
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
50
|
var Box = ({
|
|
@@ -218,7 +218,7 @@ var Box = ({
|
|
|
218
218
|
);
|
|
219
219
|
};
|
|
220
220
|
|
|
221
|
-
//
|
|
221
|
+
// ../../foundation/primitives-native/src/index.tsx
|
|
222
222
|
var isWeb = false;
|
|
223
223
|
var isNative = true;
|
|
224
224
|
|
package/native/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.tsx","../../src/DatePicker.tsx","../../../primitives-native/src/Box.tsx","../../../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;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GA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AAQ,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 ...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;A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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;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;;;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"]}
|
package/native/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
// src/DatePicker.tsx
|
|
11
11
|
import { forwardRef, useCallback, useEffect, useRef, useState } from "react";
|
|
12
12
|
|
|
13
|
-
//
|
|
13
|
+
// ../../foundation/primitives-native/src/Box.tsx
|
|
14
14
|
import {
|
|
15
15
|
View,
|
|
16
16
|
Pressable,
|
|
@@ -188,7 +188,7 @@ var Box = ({
|
|
|
188
188
|
);
|
|
189
189
|
};
|
|
190
190
|
|
|
191
|
-
//
|
|
191
|
+
// ../../foundation/primitives-native/src/index.tsx
|
|
192
192
|
var isWeb = false;
|
|
193
193
|
var isNative = true;
|
|
194
194
|
|
package/native/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.tsx","../../src/DatePicker.tsx","../../../primitives-native/src/Box.tsx","../../../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;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,EAC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;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 ...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;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;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,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,oBAAoB,CAAC,aAAkC;AAAA,IAC3D,iBACE,WAAW,YAAY,kBACnB,WAAW,kBACX;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;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AQ;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.141.
|
|
3
|
+
"version": "0.141.1",
|
|
4
4
|
"main": "./web/index.js",
|
|
5
5
|
"module": "./web/index.mjs",
|
|
6
6
|
"types": "./web/index.d.ts",
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
"test:coverage": "vitest run --coverage"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@xsolla/xui-calendar": "0.141.
|
|
17
|
-
"@xsolla/xui-core": "0.141.
|
|
18
|
-
"@xsolla/xui-input": "0.141.
|
|
19
|
-
"@xsolla/xui-primitives-core": "0.141.
|
|
16
|
+
"@xsolla/xui-calendar": "0.141.1",
|
|
17
|
+
"@xsolla/xui-core": "0.141.1",
|
|
18
|
+
"@xsolla/xui-input": "0.141.1",
|
|
19
|
+
"@xsolla/xui-primitives-core": "0.141.1",
|
|
20
20
|
"date-fns": "^3.0.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
package/web/index.js
CHANGED
|
@@ -44,14 +44,14 @@ var import_xui_calendar2 = require("@xsolla/xui-calendar");
|
|
|
44
44
|
// src/DatePicker.tsx
|
|
45
45
|
var import_react3 = require("react");
|
|
46
46
|
|
|
47
|
-
//
|
|
47
|
+
// ../../foundation/primitives-web/src/Box.tsx
|
|
48
48
|
var import_react2 = __toESM(require("react"));
|
|
49
49
|
var import_styled_components = __toESM(require("styled-components"));
|
|
50
50
|
|
|
51
|
-
//
|
|
51
|
+
// ../../foundation/primitives-web/src/filterDOMProps.ts
|
|
52
52
|
var import_react = __toESM(require("react"));
|
|
53
53
|
|
|
54
|
-
//
|
|
54
|
+
// ../../../node_modules/@emotion/memoize/dist/memoize.esm.js
|
|
55
55
|
function memoize(fn) {
|
|
56
56
|
var cache = {};
|
|
57
57
|
return function(arg) {
|
|
@@ -61,7 +61,7 @@ function memoize(fn) {
|
|
|
61
61
|
}
|
|
62
62
|
var memoize_esm_default = memoize;
|
|
63
63
|
|
|
64
|
-
//
|
|
64
|
+
// ../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js
|
|
65
65
|
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
|
|
66
66
|
var index = memoize_esm_default(
|
|
67
67
|
function(prop) {
|
|
@@ -71,7 +71,7 @@ var index = memoize_esm_default(
|
|
|
71
71
|
);
|
|
72
72
|
var is_prop_valid_esm_default = index;
|
|
73
73
|
|
|
74
|
-
//
|
|
74
|
+
// ../../foundation/primitives-web/src/filterDOMProps.ts
|
|
75
75
|
var ADDITIONAL_BLOCKED_PROPS = /* @__PURE__ */ new Set([
|
|
76
76
|
// RN-only event handlers (pass isPropValid's on* pattern)
|
|
77
77
|
"onPress",
|
|
@@ -117,7 +117,7 @@ function createFilteredElement(defaultTag) {
|
|
|
117
117
|
return Component;
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
//
|
|
120
|
+
// ../../foundation/primitives-web/src/Box.tsx
|
|
121
121
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
122
122
|
var FilteredDiv = createFilteredElement("div");
|
|
123
123
|
var StyledBox = (0, import_styled_components.default)(FilteredDiv)`
|
|
@@ -290,7 +290,7 @@ var Box = import_react2.default.forwardRef(
|
|
|
290
290
|
);
|
|
291
291
|
Box.displayName = "Box";
|
|
292
292
|
|
|
293
|
-
//
|
|
293
|
+
// ../../foundation/primitives-web/src/index.tsx
|
|
294
294
|
var isWeb = true;
|
|
295
295
|
var isNative = false;
|
|
296
296
|
|
package/web/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.tsx","../../src/DatePicker.tsx","../../../primitives-web/src/Box.tsx","../../../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","../../../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 type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","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,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,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 ...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 type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","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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B,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;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"]}
|
package/web/index.mjs
CHANGED
|
@@ -10,14 +10,14 @@ import {
|
|
|
10
10
|
// src/DatePicker.tsx
|
|
11
11
|
import { forwardRef, useCallback, useEffect, useRef, useState } from "react";
|
|
12
12
|
|
|
13
|
-
//
|
|
13
|
+
// ../../foundation/primitives-web/src/Box.tsx
|
|
14
14
|
import React2 from "react";
|
|
15
15
|
import styled from "styled-components";
|
|
16
16
|
|
|
17
|
-
//
|
|
17
|
+
// ../../foundation/primitives-web/src/filterDOMProps.ts
|
|
18
18
|
import React from "react";
|
|
19
19
|
|
|
20
|
-
//
|
|
20
|
+
// ../../../node_modules/@emotion/memoize/dist/memoize.esm.js
|
|
21
21
|
function memoize(fn) {
|
|
22
22
|
var cache = {};
|
|
23
23
|
return function(arg) {
|
|
@@ -27,7 +27,7 @@ function memoize(fn) {
|
|
|
27
27
|
}
|
|
28
28
|
var memoize_esm_default = memoize;
|
|
29
29
|
|
|
30
|
-
//
|
|
30
|
+
// ../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js
|
|
31
31
|
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
|
|
32
32
|
var index = memoize_esm_default(
|
|
33
33
|
function(prop) {
|
|
@@ -37,7 +37,7 @@ var index = memoize_esm_default(
|
|
|
37
37
|
);
|
|
38
38
|
var is_prop_valid_esm_default = index;
|
|
39
39
|
|
|
40
|
-
//
|
|
40
|
+
// ../../foundation/primitives-web/src/filterDOMProps.ts
|
|
41
41
|
var ADDITIONAL_BLOCKED_PROPS = /* @__PURE__ */ new Set([
|
|
42
42
|
// RN-only event handlers (pass isPropValid's on* pattern)
|
|
43
43
|
"onPress",
|
|
@@ -83,7 +83,7 @@ function createFilteredElement(defaultTag) {
|
|
|
83
83
|
return Component;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
//
|
|
86
|
+
// ../../foundation/primitives-web/src/Box.tsx
|
|
87
87
|
import { jsx } from "react/jsx-runtime";
|
|
88
88
|
var FilteredDiv = createFilteredElement("div");
|
|
89
89
|
var StyledBox = styled(FilteredDiv)`
|
|
@@ -256,7 +256,7 @@ var Box = React2.forwardRef(
|
|
|
256
256
|
);
|
|
257
257
|
Box.displayName = "Box";
|
|
258
258
|
|
|
259
|
-
//
|
|
259
|
+
// ../../foundation/primitives-web/src/index.tsx
|
|
260
260
|
var isWeb = true;
|
|
261
261
|
var isNative = false;
|
|
262
262
|
|
package/web/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.tsx","../../src/DatePicker.tsx","../../../primitives-web/src/Box.tsx","../../../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","../../../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 type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","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,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,MAAM;AAAA,IACtB,CAAC,EAAE,UAAU,aAAa,GAAG,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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;;;AMzLzB,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","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 ...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 type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","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,gBAA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A,QACA;AAAA,QACA,YAAY;AAAA,QACZ,cAAc;AAAA,QACb,GAAG;AAAA;AAAA,IACN;AAGJ,WACE;AAAA,MAAC;AAAA;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;;;AMzLzB,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","React","React","jsx","format"]}
|
package/README.md
DELETED
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
# Date Picker
|
|
2
|
-
|
|
3
|
-
A cross-platform React date picker component with an input field that opens a calendar dropdown for date selection. The calendar is provided by `@xsolla/xui-calendar`.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @xsolla/xui-date-picker
|
|
9
|
-
# or
|
|
10
|
-
yarn add @xsolla/xui-date-picker
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
> The `Calendar`, `DualCalendar`, `CalendarChips`, and related components are available from `@xsolla/xui-calendar` and are re-exported from this package for backward compatibility. For standalone calendar usage (without the input), install `@xsolla/xui-calendar` directly.
|
|
14
|
-
|
|
15
|
-
## Demo
|
|
16
|
-
|
|
17
|
-
### Single Date Selection
|
|
18
|
-
|
|
19
|
-
```tsx
|
|
20
|
-
import * as React from 'react';
|
|
21
|
-
import { DatePicker } from '@xsolla/xui-date-picker';
|
|
22
|
-
|
|
23
|
-
export default function SingleDate() {
|
|
24
|
-
const [date, setDate] = React.useState<Date | null>(null);
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<DatePicker
|
|
28
|
-
selectedDate={date}
|
|
29
|
-
onChange={(newDate) => setDate(newDate as Date)}
|
|
30
|
-
placeholder="Select a date"
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### Date Range Selection
|
|
37
|
-
|
|
38
|
-
```tsx
|
|
39
|
-
import * as React from 'react';
|
|
40
|
-
import { DatePicker } from '@xsolla/xui-date-picker';
|
|
41
|
-
|
|
42
|
-
export default function DateRange() {
|
|
43
|
-
const [startDate, setStartDate] = React.useState<Date | null>(null);
|
|
44
|
-
const [endDate, setEndDate] = React.useState<Date | null>(null);
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<DatePicker
|
|
48
|
-
selectsRange
|
|
49
|
-
startDate={startDate}
|
|
50
|
-
endDate={endDate}
|
|
51
|
-
onChange={(range) => {
|
|
52
|
-
const [start, end] = range as [Date | null, Date | null];
|
|
53
|
-
setStartDate(start);
|
|
54
|
-
setEndDate(end);
|
|
55
|
-
}}
|
|
56
|
-
/>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### With Preset Chips
|
|
62
|
-
|
|
63
|
-
```tsx
|
|
64
|
-
import * as React from 'react';
|
|
65
|
-
import { DatePicker } from '@xsolla/xui-date-picker';
|
|
66
|
-
|
|
67
|
-
const chips = [
|
|
68
|
-
{ label: 'Today', value: 'today' },
|
|
69
|
-
{ label: 'Last 7 days', value: 'last7' },
|
|
70
|
-
{ label: 'Last 30 days', value: 'last30' },
|
|
71
|
-
];
|
|
72
|
-
|
|
73
|
-
export default function WithChips() {
|
|
74
|
-
const [date, setDate] = React.useState<Date | null>(null);
|
|
75
|
-
const [activeChip, setActiveChip] = React.useState<string | null>('last30');
|
|
76
|
-
|
|
77
|
-
return (
|
|
78
|
-
<DatePicker
|
|
79
|
-
selectedDate={date}
|
|
80
|
-
onChange={(newDate) => setDate(newDate as Date)}
|
|
81
|
-
chips={chips}
|
|
82
|
-
activeChip={activeChip}
|
|
83
|
-
onChipSelect={setActiveChip}
|
|
84
|
-
/>
|
|
85
|
-
);
|
|
86
|
-
}
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### Different Sizes
|
|
90
|
-
|
|
91
|
-
```tsx
|
|
92
|
-
import * as React from 'react';
|
|
93
|
-
import { DatePicker } from '@xsolla/xui-date-picker';
|
|
94
|
-
|
|
95
|
-
export default function Sizes() {
|
|
96
|
-
return (
|
|
97
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: 16 }}>
|
|
98
|
-
<DatePicker size="sm" placeholder="Small" />
|
|
99
|
-
<DatePicker size="md" placeholder="Medium" />
|
|
100
|
-
<DatePicker size="lg" placeholder="Large" />
|
|
101
|
-
</div>
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### Standalone Calendar
|
|
107
|
-
|
|
108
|
-
For standalone calendar usage, import from `@xsolla/xui-calendar`:
|
|
109
|
-
|
|
110
|
-
```tsx
|
|
111
|
-
import { Calendar, DualCalendar } from '@xsolla/xui-calendar';
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
## API Reference
|
|
115
|
-
|
|
116
|
-
### DatePicker
|
|
117
|
-
|
|
118
|
-
**DatePickerProps:**
|
|
119
|
-
|
|
120
|
-
| Prop | Type | Default | Description |
|
|
121
|
-
| :--- | :--- | :------ | :---------- |
|
|
122
|
-
| selectedDate | `Date` | - | Selected date for single mode. |
|
|
123
|
-
| startDate | `Date` | - | Start date for range mode. |
|
|
124
|
-
| endDate | `Date` | - | End date for range mode. |
|
|
125
|
-
| selectsRange | `boolean` | `false` | Enable date range selection. |
|
|
126
|
-
| onChange | `(date: Date \| [Date, Date]) => void` | - | Date change callback. |
|
|
127
|
-
| size | `"xs" \| "sm" \| "md" \| "lg" \| "xl"` | `"md"` | Input size variant. |
|
|
128
|
-
| locale | `string` | `"enUS"` | Date-fns locale identifier. |
|
|
129
|
-
| placeholder | `string` | `"MM/DD/YYYY"` | Input placeholder text. |
|
|
130
|
-
| minDate | `Date` | - | Minimum selectable date. |
|
|
131
|
-
| maxDate | `Date` | - | Maximum selectable date. |
|
|
132
|
-
| backgroundColor | `string` | - | Custom background color. |
|
|
133
|
-
| chips | `CalendarChipOption[]` | - | Preset date range chips. |
|
|
134
|
-
| activeChip | `string \| null` | - | Currently active chip value. |
|
|
135
|
-
| onChipSelect | `(value: string) => void` | - | Chip selection callback. |
|
|
136
|
-
| testID | `string` | - | Test identifier. |
|
|
137
|
-
|
|
138
|
-
## Date Format
|
|
139
|
-
|
|
140
|
-
The component displays dates in `MM/DD/YYYY` format:
|
|
141
|
-
|
|
142
|
-
| Mode | Display Format |
|
|
143
|
-
| :--- | :------------- |
|
|
144
|
-
| Single | `01/15/2024` |
|
|
145
|
-
| Range | `01/15/2024 - 01/20/2024` |
|
|
146
|
-
|
|
147
|
-
## Calendar Features
|
|
148
|
-
|
|
149
|
-
- **Month navigation**: Previous/next month buttons
|
|
150
|
-
- **Year navigation**: Year selection dropdown
|
|
151
|
-
- **Today indicator**: Current date is highlighted
|
|
152
|
-
- **Selected state**: Selected date(s) have distinct styling
|
|
153
|
-
- **Range highlighting**: Dates between start and end are highlighted
|
|
154
|
-
- **Disabled dates**: Dates outside min/max range are disabled
|
|
155
|
-
- **Preset chips**: Quick-select date ranges (Today, Last 7 days, etc.)
|
|
156
|
-
|
|
157
|
-
## Behavior
|
|
158
|
-
|
|
159
|
-
- Calendar opens on input focus
|
|
160
|
-
- Calendar closes when a date is selected (single mode)
|
|
161
|
-
- Calendar closes when both dates are selected (range mode)
|
|
162
|
-
- Clicking outside closes the calendar
|
|
163
|
-
- Input value updates immediately on selection
|
|
164
|
-
|
|
165
|
-
## Accessibility
|
|
166
|
-
|
|
167
|
-
- Input is keyboard accessible
|
|
168
|
-
- Calendar dates are navigable via keyboard
|
|
169
|
-
- Selected dates are announced to screen readers
|
|
170
|
-
- Focus is managed when calendar opens/closes
|