@xsolla/xui-date-picker 0.172.1 → 0.172.2-pr358.1781799261
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/native/index.d.mts +5 -0
- package/native/index.d.ts +5 -0
- package/native/index.js +17 -12
- package/native/index.js.map +1 -1
- package/native/index.mjs +17 -12
- package/native/index.mjs.map +1 -1
- package/package.json +5 -5
- package/web/index.d.mts +5 -0
- package/web/index.d.ts +5 -0
- package/web/index.js +17 -12
- package/web/index.js.map +1 -1
- package/web/index.mjs +17 -12
- package/web/index.mjs.map +1 -1
package/README.md
CHANGED
|
@@ -77,6 +77,8 @@ const [date, setDate] = useState<Date | null>(null);
|
|
|
77
77
|
| `bottomContent` | `(api: { close: () => void }) => ReactNode` | — | Custom content below the calendar. |
|
|
78
78
|
| `contextMenuMaxHeight` | `number` | — | Max height for the month/year context menus. |
|
|
79
79
|
| `testID` | `string` | — | Test identifier. |
|
|
80
|
+
| `overlayThemeMode` | `ThemeMode` | `themeMode` | Theme mode for the calendar overlay. |
|
|
81
|
+
| `overlayThemeProductContext` | `ProductContext` | `themeProductContext` | Product context for the calendar overlay. |
|
|
80
82
|
|
|
81
83
|
`DatePicker` extends `CalendarProps` (excluding `onChange`).
|
|
82
84
|
|
package/native/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CalendarProps, CalendarLocaleType } from '@xsolla/xui-calendar';
|
|
2
2
|
export { Calendar, CalendarChipOption, CalendarChips, CalendarChipsProps, CalendarGrid, CalendarGridProps, CalendarHeader, CalendarHeaderProps, CalendarLocaleType, CalendarProps, DualCalendar, DualCalendarProps } from '@xsolla/xui-calendar';
|
|
3
3
|
import * as react from 'react';
|
|
4
|
+
import { ThemeMode, ProductContext } from '@xsolla/xui-core';
|
|
4
5
|
|
|
5
6
|
type DateRangeType = [Date | null, Date | null];
|
|
6
7
|
type DatePickerDropdownPosition = "left" | "right";
|
|
@@ -36,6 +37,10 @@ interface DatePickerProps extends Omit<CalendarProps, "onChange"> {
|
|
|
36
37
|
dropdownPosition?: DatePickerDropdownPosition;
|
|
37
38
|
/** Test ID for testing frameworks */
|
|
38
39
|
testID?: string;
|
|
40
|
+
/** Theme mode for the calendar overlay. Defaults to themeMode when not set. */
|
|
41
|
+
overlayThemeMode?: ThemeMode;
|
|
42
|
+
/** Product context for the calendar overlay. Defaults to themeProductContext when not set. */
|
|
43
|
+
overlayThemeProductContext?: ProductContext;
|
|
39
44
|
}
|
|
40
45
|
|
|
41
46
|
declare const DatePicker: react.ForwardRefExoticComponent<DatePickerProps & react.RefAttributes<any>>;
|
package/native/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CalendarProps, CalendarLocaleType } from '@xsolla/xui-calendar';
|
|
2
2
|
export { Calendar, CalendarChipOption, CalendarChips, CalendarChipsProps, CalendarGrid, CalendarGridProps, CalendarHeader, CalendarHeaderProps, CalendarLocaleType, CalendarProps, DualCalendar, DualCalendarProps } from '@xsolla/xui-calendar';
|
|
3
3
|
import * as react from 'react';
|
|
4
|
+
import { ThemeMode, ProductContext } from '@xsolla/xui-core';
|
|
4
5
|
|
|
5
6
|
type DateRangeType = [Date | null, Date | null];
|
|
6
7
|
type DatePickerDropdownPosition = "left" | "right";
|
|
@@ -36,6 +37,10 @@ interface DatePickerProps extends Omit<CalendarProps, "onChange"> {
|
|
|
36
37
|
dropdownPosition?: DatePickerDropdownPosition;
|
|
37
38
|
/** Test ID for testing frameworks */
|
|
38
39
|
testID?: string;
|
|
40
|
+
/** Theme mode for the calendar overlay. Defaults to themeMode when not set. */
|
|
41
|
+
overlayThemeMode?: ThemeMode;
|
|
42
|
+
/** Product context for the calendar overlay. Defaults to themeProductContext when not set. */
|
|
43
|
+
overlayThemeProductContext?: ProductContext;
|
|
39
44
|
}
|
|
40
45
|
|
|
41
46
|
declare const DatePicker: react.ForwardRefExoticComponent<DatePickerProps & react.RefAttributes<any>>;
|
package/native/index.js
CHANGED
|
@@ -244,6 +244,10 @@ var DatePicker = (0, import_react.forwardRef)(
|
|
|
244
244
|
activeChip,
|
|
245
245
|
onChipSelect,
|
|
246
246
|
dropdownPosition = "left",
|
|
247
|
+
themeMode,
|
|
248
|
+
themeProductContext,
|
|
249
|
+
overlayThemeMode,
|
|
250
|
+
overlayThemeProductContext,
|
|
247
251
|
...rest
|
|
248
252
|
}, ref) => {
|
|
249
253
|
const isDual = variant === "dual";
|
|
@@ -301,9 +305,7 @@ var DatePicker = (0, import_react.forwardRef)(
|
|
|
301
305
|
} else {
|
|
302
306
|
const range = date;
|
|
303
307
|
onChange?.(range);
|
|
304
|
-
if (range[0] && range[1])
|
|
305
|
-
setOpen(false);
|
|
306
|
-
}
|
|
308
|
+
if (range[0] && range[1]) setOpen(false);
|
|
307
309
|
}
|
|
308
310
|
};
|
|
309
311
|
(0, import_react.useEffect)(() => {
|
|
@@ -316,6 +318,10 @@ var DatePicker = (0, import_react.forwardRef)(
|
|
|
316
318
|
document.addEventListener("mousedown", handleClickOutside);
|
|
317
319
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
318
320
|
}, []);
|
|
321
|
+
const overlayThemeProps = {
|
|
322
|
+
themeMode: overlayThemeMode ?? themeMode,
|
|
323
|
+
themeProductContext: overlayThemeProductContext ?? themeProductContext
|
|
324
|
+
};
|
|
319
325
|
const renderCalendar = () => isDual ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
320
326
|
import_xui_calendar.DualCalendar,
|
|
321
327
|
{
|
|
@@ -326,7 +332,8 @@ var DatePicker = (0, import_react.forwardRef)(
|
|
|
326
332
|
chips,
|
|
327
333
|
activeChip: activeChipValue,
|
|
328
334
|
onChipSelect: handleChipSelect,
|
|
329
|
-
...rest
|
|
335
|
+
...rest,
|
|
336
|
+
...overlayThemeProps
|
|
330
337
|
}
|
|
331
338
|
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
332
339
|
import_xui_calendar.Calendar,
|
|
@@ -340,7 +347,8 @@ var DatePicker = (0, import_react.forwardRef)(
|
|
|
340
347
|
chips,
|
|
341
348
|
activeChip: activeChipValue,
|
|
342
349
|
onChipSelect: handleChipSelect,
|
|
343
|
-
...rest
|
|
350
|
+
...rest,
|
|
351
|
+
...overlayThemeProps
|
|
344
352
|
}
|
|
345
353
|
);
|
|
346
354
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
@@ -364,7 +372,9 @@ var DatePicker = (0, import_react.forwardRef)(
|
|
|
364
372
|
onChangeText: handleInputChange,
|
|
365
373
|
onFocus: () => setOpen(true),
|
|
366
374
|
backgroundColor,
|
|
367
|
-
testID
|
|
375
|
+
testID,
|
|
376
|
+
themeMode,
|
|
377
|
+
themeProductContext
|
|
368
378
|
}
|
|
369
379
|
),
|
|
370
380
|
open && (isWeb ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
@@ -378,12 +388,7 @@ var DatePicker = (0, import_react.forwardRef)(
|
|
|
378
388
|
zIndex: 1e3,
|
|
379
389
|
children: renderCalendar()
|
|
380
390
|
}
|
|
381
|
-
) : (
|
|
382
|
-
// Native implementation could use a Modal here
|
|
383
|
-
// For now, we just show it below the input if needed,
|
|
384
|
-
// but usually a bottom sheet or centered modal is better.
|
|
385
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box, { marginTop: 4, children: renderCalendar() })
|
|
386
|
-
))
|
|
391
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box, { marginTop: 4, children: renderCalendar() }))
|
|
387
392
|
]
|
|
388
393
|
}
|
|
389
394
|
);
|
package/native/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.tsx","../../src/DatePicker.tsx","../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/index.tsx","../../src/utils.ts"],"sourcesContent":["export {\n Calendar,\n DualCalendar,\n CalendarHeader,\n CalendarGrid,\n CalendarChips,\n} from \"@xsolla/xui-calendar\";\nexport type {\n CalendarProps,\n DualCalendarProps,\n CalendarChipOption,\n CalendarChipsProps,\n CalendarGridProps,\n CalendarHeaderProps,\n CalendarLocaleType,\n} from \"@xsolla/xui-calendar\";\nexport * from \"./DatePicker\";\nexport * from \"./types\";\nexport * from \"./utils\";\n","import { forwardRef, useCallback, useEffect, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, isWeb, isNative } from \"@xsolla/xui-primitives\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { format } from \"date-fns\";\nimport { Calendar, DualCalendar } from \"@xsolla/xui-calendar\";\nimport type { DatePickerProps, DateRangeType } from \"./types\";\n\nexport const DatePicker = forwardRef<any, DatePickerProps>(\n (\n {\n onChange,\n size = \"md\",\n locale = \"enUS\",\n variant = \"single\",\n selectsRange = false,\n startDate,\n endDate,\n selectedDate,\n placeholder,\n backgroundColor,\n testID,\n chips,\n activeChip,\n onChipSelect,\n dropdownPosition = \"left\",\n ...rest\n },\n ref\n ) => {\n const isDual = variant === \"dual\";\n const isRange = isDual || selectsRange;\n const [open, setOpen] = useState(false);\n const [inputValue, setInputValue] = useState(\"\");\n const [internalChip, setInternalChip] = useState<string | null>(null);\n const containerRef = useRef<any>(null);\n const chipSelectionRef = useRef(false);\n\n const activeChipValue =\n activeChip !== undefined ? activeChip : internalChip;\n\n const formatDateForDisplay = (date: Date | null | undefined): string => {\n if (!date) return \"\";\n try {\n return format(date, \"MM/dd/yyyy\");\n } catch {\n return \"\";\n }\n };\n\n const getDisplayValue = useCallback((): string => {\n if (activeChipValue && chips) {\n const chip = chips.find((c) => c.value === activeChipValue);\n if (chip) return chip.label;\n }\n if (isRange) {\n if (startDate && endDate) {\n return `${formatDateForDisplay(startDate)} - ${formatDateForDisplay(endDate)}`;\n } else if (startDate) {\n return formatDateForDisplay(startDate);\n }\n return \"\";\n } else {\n return formatDateForDisplay(selectedDate);\n }\n }, [isRange, startDate, endDate, selectedDate, activeChipValue, chips]);\n\n useEffect(() => {\n setInputValue(getDisplayValue());\n }, [getDisplayValue]);\n\n const handleInputChange = (text: string) => {\n setInputValue(text);\n };\n\n const handleChipSelect = (value: string | null) => {\n chipSelectionRef.current = true;\n setInternalChip(value);\n onChipSelect?.(value);\n };\n\n const handleDateChange = (date: Date | [Date | null, Date | null]) => {\n if (!chipSelectionRef.current) {\n setInternalChip(null);\n onChipSelect?.(null);\n }\n chipSelectionRef.current = false;\n\n if (!isRange) {\n onChange?.(date as Date);\n setOpen(false);\n } else {\n const range = date as DateRangeType;\n onChange?.(range);\n if (range[0] && range[1]) {\n setOpen(false);\n }\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n !containerRef.current.contains(event.target as Node)\n ) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () =>\n document.removeEventListener(\"mousedown\", handleClickOutside);\n }, []);\n\n const renderCalendar = () =>\n isDual ? (\n <DualCalendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n onChange={handleDateChange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n ) : (\n <Calendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n selectedDate={selectedDate}\n onChange={handleDateChange}\n selectsRange={selectsRange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n );\n\n return (\n <Box\n ref={(node: any) => {\n containerRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) (ref as any).current = node;\n }}\n position=\"relative\"\n width=\"100%\"\n >\n <Input\n {...rest}\n size={size}\n placeholder={\n placeholder || (isRange ? \"MM/DD/YYYY - MM/DD/YYYY\" : \"MM/DD/YYYY\")\n }\n value={inputValue}\n onChangeText={handleInputChange}\n onFocus={() => setOpen(true)}\n backgroundColor={backgroundColor}\n testID={testID}\n />\n {open &&\n (isWeb ? (\n <Box\n position=\"absolute\"\n top=\"100%\"\n left={dropdownPosition === \"left\" ? 0 : \"auto\"}\n right={dropdownPosition === \"right\" ? 0 : \"auto\"}\n marginTop={4}\n zIndex={1000}\n >\n {renderCalendar()}\n </Box>\n ) : (\n // Native implementation could use a Modal here\n // For now, we just show it below the input if needed,\n // but usually a bottom sheet or centered modal is better.\n <Box marginTop={4}>{renderCalendar()}</Box>\n ))}\n </Box>\n );\n }\n);\n\nDatePicker.displayName = \"DatePicker\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Box: React.FC<BoxProps> = ({\n children,\n onPress,\n onLayout,\n onMoveShouldSetResponder,\n onResponderGrant,\n onResponderMove,\n onResponderRelease,\n onResponderTerminate,\n backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius,\n borderStyle,\n height,\n padding,\n paddingHorizontal,\n paddingVertical,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n flexDirection,\n alignItems,\n justifyContent,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n minWidth: minWidth as DimensionValue,\n minHeight: minHeight as DimensionValue,\n maxWidth: maxWidth as DimensionValue,\n maxHeight: maxHeight as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n flexDirection,\n alignItems,\n justifyContent,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Destructure and drop web-only props from rest before passing to RN components\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\n \"aria-label\": _ariaLabel,\n \"aria-labelledby\": _ariaLabelledBy,\n \"aria-current\": _ariaCurrent,\n \"aria-disabled\": _ariaDisabled,\n \"aria-live\": _ariaLive,\n className,\n \"data-testid\": _dataTestId,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n if (onPress) {\n return (\n <Pressable\n onPress={onPress}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","export * from \"./Box\";\nexport * from \"./Text\";\nexport * from \"./Spinner\";\nexport * from \"./Icon\";\nexport * from \"./Divider\";\nexport * from \"./Input\";\nexport * from \"./TextArea\";\nexport * from \"./LinearGradient\";\n\nexport const isWeb = false;\nexport const isNative = true;\n","import { format } from \"date-fns\";\nimport * as locales from \"date-fns/locale\";\nimport type { CalendarLocaleType } from \"@xsolla/xui-calendar\";\n\nconst defaultLocale = \"enUS\";\n\nexport function formatDate(\n date: Date,\n formatStr: string,\n locale: CalendarLocaleType = defaultLocale\n) {\n const localeObj = locales[locale] || locales[defaultLocale];\n\n return format(date, formatStr, {\n locale: localeObj,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;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;A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AAAA,cACT,KAAI;AAAA,cACJ,MAAM,qBAAqB,SAAS,IAAI;AAAA,cACxC,OAAO,qBAAqB,UAAU,IAAI;AAAA,cAC1C,WAAW;AAAA,cACX,QAAQ;AAAA,cAEP,yBAAe;AAAA;AAAA,UAClB;AAAA;AAAA;AAAA;AAAA,YAKA,6CAAC,OAAI,WAAW,GAAI,yBAAe,GAAE;AAAA;AAAA;AAAA;AAAA,IAE3C;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;;;AG3LzB,IAAAC,mBAAuB;AACvB,cAAyB;AAGzB,IAAM,gBAAgB;AAEf,SAAS,WACd,MACA,WACA,SAA6B,eAC7B;AACA,QAAM,YAAY,QAAQ,MAAM,KAAK,QAAQ,aAAa;AAE1D,aAAO,yBAAO,MAAM,WAAW;AAAA,IAC7B,QAAQ;AAAA,EACV,CAAC;AACH;","names":["import_xui_calendar","import_jsx_runtime","import_date_fns"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.tsx","../../src/DatePicker.tsx","../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/index.tsx","../../src/utils.ts"],"sourcesContent":["export {\n Calendar,\n DualCalendar,\n CalendarHeader,\n CalendarGrid,\n CalendarChips,\n} from \"@xsolla/xui-calendar\";\nexport type {\n CalendarProps,\n DualCalendarProps,\n CalendarChipOption,\n CalendarChipsProps,\n CalendarGridProps,\n CalendarHeaderProps,\n CalendarLocaleType,\n} from \"@xsolla/xui-calendar\";\nexport * from \"./DatePicker\";\nexport * from \"./types\";\nexport * from \"./utils\";\n","import { forwardRef, useCallback, useEffect, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, isWeb, isNative } from \"@xsolla/xui-primitives\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { format } from \"date-fns\";\nimport { Calendar, DualCalendar } from \"@xsolla/xui-calendar\";\nimport type { DatePickerProps, DateRangeType } from \"./types\";\n\nexport const DatePicker = forwardRef<any, DatePickerProps>(\n (\n {\n onChange,\n size = \"md\",\n locale = \"enUS\",\n variant = \"single\",\n selectsRange = false,\n startDate,\n endDate,\n selectedDate,\n placeholder,\n backgroundColor,\n testID,\n chips,\n activeChip,\n onChipSelect,\n dropdownPosition = \"left\",\n themeMode,\n themeProductContext,\n overlayThemeMode,\n overlayThemeProductContext,\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 = 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 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]) setOpen(false);\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n const handleClickOutside = (event: MouseEvent) => {\n if (containerRef.current && !containerRef.current.contains(event.target as Node)) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => document.removeEventListener(\"mousedown\", handleClickOutside);\n }, []);\n\n const overlayThemeProps = {\n themeMode: overlayThemeMode ?? themeMode,\n themeProductContext: overlayThemeProductContext ?? themeProductContext,\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 {...overlayThemeProps}\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 {...overlayThemeProps}\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={placeholder || (isRange ? \"MM/DD/YYYY - MM/DD/YYYY\" : \"MM/DD/YYYY\")}\n value={inputValue}\n onChangeText={handleInputChange}\n onFocus={() => setOpen(true)}\n backgroundColor={backgroundColor}\n testID={testID}\n themeMode={themeMode}\n themeProductContext={themeProductContext}\n />\n {open &&\n (isWeb ? (\n <Box\n position=\"absolute\"\n top=\"100%\"\n left={dropdownPosition === \"left\" ? 0 : \"auto\"}\n right={dropdownPosition === \"right\" ? 0 : \"auto\"}\n marginTop={4}\n zIndex={1000}\n >\n {renderCalendar()}\n </Box>\n ) : (\n <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,GAAG;AACL,MAAM;AACJ,QAAM,oBAAoB,CAAC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Ae,GAAE;AAAA;AAAA;AAAA,IAE3C;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;;;AG3LzB,IAAAC,mBAAuB;AACvB,cAAyB;AAGzB,IAAM,gBAAgB;AAEf,SAAS,WACd,MACA,WACA,SAA6B,eAC7B;AACA,QAAM,YAAY,QAAQ,MAAM,KAAK,QAAQ,aAAa;AAE1D,aAAO,yBAAO,MAAM,WAAW;AAAA,IAC7B,QAAQ;AAAA,EACV,CAAC;AACH;","names":["import_xui_calendar","import_jsx_runtime","import_date_fns"]}
|
package/native/index.mjs
CHANGED
|
@@ -214,6 +214,10 @@ var DatePicker = forwardRef(
|
|
|
214
214
|
activeChip,
|
|
215
215
|
onChipSelect,
|
|
216
216
|
dropdownPosition = "left",
|
|
217
|
+
themeMode,
|
|
218
|
+
themeProductContext,
|
|
219
|
+
overlayThemeMode,
|
|
220
|
+
overlayThemeProductContext,
|
|
217
221
|
...rest
|
|
218
222
|
}, ref) => {
|
|
219
223
|
const isDual = variant === "dual";
|
|
@@ -271,9 +275,7 @@ var DatePicker = forwardRef(
|
|
|
271
275
|
} else {
|
|
272
276
|
const range = date;
|
|
273
277
|
onChange?.(range);
|
|
274
|
-
if (range[0] && range[1])
|
|
275
|
-
setOpen(false);
|
|
276
|
-
}
|
|
278
|
+
if (range[0] && range[1]) setOpen(false);
|
|
277
279
|
}
|
|
278
280
|
};
|
|
279
281
|
useEffect(() => {
|
|
@@ -286,6 +288,10 @@ var DatePicker = forwardRef(
|
|
|
286
288
|
document.addEventListener("mousedown", handleClickOutside);
|
|
287
289
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
288
290
|
}, []);
|
|
291
|
+
const overlayThemeProps = {
|
|
292
|
+
themeMode: overlayThemeMode ?? themeMode,
|
|
293
|
+
themeProductContext: overlayThemeProductContext ?? themeProductContext
|
|
294
|
+
};
|
|
289
295
|
const renderCalendar = () => isDual ? /* @__PURE__ */ jsx2(
|
|
290
296
|
DualCalendar,
|
|
291
297
|
{
|
|
@@ -296,7 +302,8 @@ var DatePicker = forwardRef(
|
|
|
296
302
|
chips,
|
|
297
303
|
activeChip: activeChipValue,
|
|
298
304
|
onChipSelect: handleChipSelect,
|
|
299
|
-
...rest
|
|
305
|
+
...rest,
|
|
306
|
+
...overlayThemeProps
|
|
300
307
|
}
|
|
301
308
|
) : /* @__PURE__ */ jsx2(
|
|
302
309
|
Calendar,
|
|
@@ -310,7 +317,8 @@ var DatePicker = forwardRef(
|
|
|
310
317
|
chips,
|
|
311
318
|
activeChip: activeChipValue,
|
|
312
319
|
onChipSelect: handleChipSelect,
|
|
313
|
-
...rest
|
|
320
|
+
...rest,
|
|
321
|
+
...overlayThemeProps
|
|
314
322
|
}
|
|
315
323
|
);
|
|
316
324
|
return /* @__PURE__ */ jsxs(
|
|
@@ -334,7 +342,9 @@ var DatePicker = forwardRef(
|
|
|
334
342
|
onChangeText: handleInputChange,
|
|
335
343
|
onFocus: () => setOpen(true),
|
|
336
344
|
backgroundColor,
|
|
337
|
-
testID
|
|
345
|
+
testID,
|
|
346
|
+
themeMode,
|
|
347
|
+
themeProductContext
|
|
338
348
|
}
|
|
339
349
|
),
|
|
340
350
|
open && (isWeb ? /* @__PURE__ */ jsx2(
|
|
@@ -348,12 +358,7 @@ var DatePicker = forwardRef(
|
|
|
348
358
|
zIndex: 1e3,
|
|
349
359
|
children: renderCalendar()
|
|
350
360
|
}
|
|
351
|
-
) : (
|
|
352
|
-
// Native implementation could use a Modal here
|
|
353
|
-
// For now, we just show it below the input if needed,
|
|
354
|
-
// but usually a bottom sheet or centered modal is better.
|
|
355
|
-
/* @__PURE__ */ jsx2(Box, { marginTop: 4, children: renderCalendar() })
|
|
356
|
-
))
|
|
361
|
+
) : /* @__PURE__ */ jsx2(Box, { marginTop: 4, children: renderCalendar() }))
|
|
357
362
|
]
|
|
358
363
|
}
|
|
359
364
|
);
|
package/native/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.tsx","../../src/DatePicker.tsx","../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/index.tsx","../../src/utils.ts"],"sourcesContent":["export {\n Calendar,\n DualCalendar,\n CalendarHeader,\n CalendarGrid,\n CalendarChips,\n} from \"@xsolla/xui-calendar\";\nexport type {\n CalendarProps,\n DualCalendarProps,\n CalendarChipOption,\n CalendarChipsProps,\n CalendarGridProps,\n CalendarHeaderProps,\n CalendarLocaleType,\n} from \"@xsolla/xui-calendar\";\nexport * from \"./DatePicker\";\nexport * from \"./types\";\nexport * from \"./utils\";\n","import { forwardRef, useCallback, useEffect, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, isWeb, isNative } from \"@xsolla/xui-primitives\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { format } from \"date-fns\";\nimport { Calendar, DualCalendar } from \"@xsolla/xui-calendar\";\nimport type { DatePickerProps, DateRangeType } from \"./types\";\n\nexport const DatePicker = forwardRef<any, DatePickerProps>(\n (\n {\n onChange,\n size = \"md\",\n locale = \"enUS\",\n variant = \"single\",\n selectsRange = false,\n startDate,\n endDate,\n selectedDate,\n placeholder,\n backgroundColor,\n testID,\n chips,\n activeChip,\n onChipSelect,\n dropdownPosition = \"left\",\n ...rest\n },\n ref\n ) => {\n const isDual = variant === \"dual\";\n const isRange = isDual || selectsRange;\n const [open, setOpen] = useState(false);\n const [inputValue, setInputValue] = useState(\"\");\n const [internalChip, setInternalChip] = useState<string | null>(null);\n const containerRef = useRef<any>(null);\n const chipSelectionRef = useRef(false);\n\n const activeChipValue =\n activeChip !== undefined ? activeChip : internalChip;\n\n const formatDateForDisplay = (date: Date | null | undefined): string => {\n if (!date) return \"\";\n try {\n return format(date, \"MM/dd/yyyy\");\n } catch {\n return \"\";\n }\n };\n\n const getDisplayValue = useCallback((): string => {\n if (activeChipValue && chips) {\n const chip = chips.find((c) => c.value === activeChipValue);\n if (chip) return chip.label;\n }\n if (isRange) {\n if (startDate && endDate) {\n return `${formatDateForDisplay(startDate)} - ${formatDateForDisplay(endDate)}`;\n } else if (startDate) {\n return formatDateForDisplay(startDate);\n }\n return \"\";\n } else {\n return formatDateForDisplay(selectedDate);\n }\n }, [isRange, startDate, endDate, selectedDate, activeChipValue, chips]);\n\n useEffect(() => {\n setInputValue(getDisplayValue());\n }, [getDisplayValue]);\n\n const handleInputChange = (text: string) => {\n setInputValue(text);\n };\n\n const handleChipSelect = (value: string | null) => {\n chipSelectionRef.current = true;\n setInternalChip(value);\n onChipSelect?.(value);\n };\n\n const handleDateChange = (date: Date | [Date | null, Date | null]) => {\n if (!chipSelectionRef.current) {\n setInternalChip(null);\n onChipSelect?.(null);\n }\n chipSelectionRef.current = false;\n\n if (!isRange) {\n onChange?.(date as Date);\n setOpen(false);\n } else {\n const range = date as DateRangeType;\n onChange?.(range);\n if (range[0] && range[1]) {\n setOpen(false);\n }\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n !containerRef.current.contains(event.target as Node)\n ) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () =>\n document.removeEventListener(\"mousedown\", handleClickOutside);\n }, []);\n\n const renderCalendar = () =>\n isDual ? (\n <DualCalendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n onChange={handleDateChange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n ) : (\n <Calendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n selectedDate={selectedDate}\n onChange={handleDateChange}\n selectsRange={selectsRange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n );\n\n return (\n <Box\n ref={(node: any) => {\n containerRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) (ref as any).current = node;\n }}\n position=\"relative\"\n width=\"100%\"\n >\n <Input\n {...rest}\n size={size}\n placeholder={\n placeholder || (isRange ? \"MM/DD/YYYY - MM/DD/YYYY\" : \"MM/DD/YYYY\")\n }\n value={inputValue}\n onChangeText={handleInputChange}\n onFocus={() => setOpen(true)}\n backgroundColor={backgroundColor}\n testID={testID}\n />\n {open &&\n (isWeb ? (\n <Box\n position=\"absolute\"\n top=\"100%\"\n left={dropdownPosition === \"left\" ? 0 : \"auto\"}\n right={dropdownPosition === \"right\" ? 0 : \"auto\"}\n marginTop={4}\n zIndex={1000}\n >\n {renderCalendar()}\n </Box>\n ) : (\n // Native implementation could use a Modal here\n // For now, we just show it below the input if needed,\n // but usually a bottom sheet or centered modal is better.\n <Box marginTop={4}>{renderCalendar()}</Box>\n ))}\n </Box>\n );\n }\n);\n\nDatePicker.displayName = \"DatePicker\";\n","import React from \"react\";\nimport {\n View,\n Pressable,\n Image,\n ViewStyle,\n ImageStyle,\n DimensionValue,\n AnimatableNumericValue,\n} from \"react-native\";\nimport { BoxProps } from \"@xsolla/xui-primitives-core\";\n\nexport const Box: React.FC<BoxProps> = ({\n children,\n onPress,\n onLayout,\n onMoveShouldSetResponder,\n onResponderGrant,\n onResponderMove,\n onResponderRelease,\n onResponderTerminate,\n backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius,\n borderStyle,\n height,\n padding,\n paddingHorizontal,\n paddingVertical,\n margin,\n marginTop,\n marginBottom,\n marginLeft,\n marginRight,\n flexDirection,\n alignItems,\n justifyContent,\n position,\n top,\n bottom,\n left,\n right,\n width,\n minWidth,\n minHeight,\n maxWidth,\n maxHeight,\n flex,\n overflow,\n zIndex,\n hoverStyle,\n pressStyle,\n style,\n \"data-testid\": dataTestId,\n testID,\n as,\n src,\n alt,\n ...rest\n}) => {\n const getContainerStyle = (pressed?: boolean): ViewStyle => ({\n backgroundColor:\n pressed && pressStyle?.backgroundColor\n ? pressStyle.backgroundColor\n : backgroundColor,\n borderColor,\n borderWidth,\n borderBottomWidth,\n borderBottomColor,\n borderTopWidth,\n borderTopColor,\n borderLeftWidth,\n borderLeftColor,\n borderRightWidth,\n borderRightColor,\n borderRadius: borderRadius as AnimatableNumericValue,\n borderStyle: borderStyle as ViewStyle[\"borderStyle\"],\n overflow,\n zIndex,\n height: height as DimensionValue,\n width: width as DimensionValue,\n minWidth: minWidth as DimensionValue,\n minHeight: minHeight as DimensionValue,\n maxWidth: maxWidth as DimensionValue,\n maxHeight: maxHeight as DimensionValue,\n padding: padding as DimensionValue,\n paddingHorizontal: paddingHorizontal as DimensionValue,\n paddingVertical: paddingVertical as DimensionValue,\n margin: margin as DimensionValue,\n marginTop: marginTop as DimensionValue,\n marginBottom: marginBottom as DimensionValue,\n marginLeft: marginLeft as DimensionValue,\n marginRight: marginRight as DimensionValue,\n flexDirection,\n alignItems,\n justifyContent,\n position: position as ViewStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n flex,\n ...(style as ViewStyle),\n });\n\n const finalTestID = dataTestId || testID;\n\n // Destructure and drop web-only props from rest before passing to RN components\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const {\n role,\n tabIndex,\n onKeyDown,\n onKeyUp,\n \"aria-label\": _ariaLabel,\n \"aria-labelledby\": _ariaLabelledBy,\n \"aria-current\": _ariaCurrent,\n \"aria-disabled\": _ariaDisabled,\n \"aria-live\": _ariaLive,\n className,\n \"data-testid\": _dataTestId,\n ...nativeRest\n } = rest as Record<string, unknown>;\n\n // Handle as=\"img\" for React Native\n if (as === \"img\" && src) {\n const imageStyle: ImageStyle = {\n width: width as DimensionValue,\n height: height as DimensionValue,\n borderRadius: borderRadius as number,\n position: position as ImageStyle[\"position\"],\n top: top as DimensionValue,\n bottom: bottom as DimensionValue,\n left: left as DimensionValue,\n right: right as DimensionValue,\n ...(style as ImageStyle),\n };\n\n return (\n <Image\n source={{ uri: src }}\n style={imageStyle}\n testID={finalTestID}\n resizeMode=\"cover\"\n {...nativeRest}\n />\n );\n }\n\n if (onPress) {\n return (\n <Pressable\n onPress={onPress}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n style={({ pressed }) => getContainerStyle(pressed)}\n testID={finalTestID}\n {...nativeRest}\n >\n {children}\n </Pressable>\n );\n }\n\n return (\n <View\n style={getContainerStyle()}\n testID={finalTestID}\n onLayout={onLayout}\n onMoveShouldSetResponder={onMoveShouldSetResponder}\n onResponderGrant={onResponderGrant}\n onResponderMove={onResponderMove}\n onResponderRelease={onResponderRelease}\n onResponderTerminate={onResponderTerminate}\n {...nativeRest}\n >\n {children}\n </View>\n );\n};\n","export * from \"./Box\";\nexport * from \"./Text\";\nexport * from \"./Spinner\";\nexport * from \"./Icon\";\nexport * from \"./Divider\";\nexport * from \"./Input\";\nexport * from \"./TextArea\";\nexport * from \"./LinearGradient\";\n\nexport const isWeb = false;\nexport const isNative = true;\n","import { format } from \"date-fns\";\nimport * as locales from \"date-fns/locale\";\nimport type { CalendarLocaleType } from \"@xsolla/xui-calendar\";\n\nconst defaultLocale = \"enUS\";\n\nexport function formatDate(\n date: Date,\n formatStr: string,\n locale: CalendarLocaleType = defaultLocale\n) {\n const localeObj = locales[locale] || locales[defaultLocale];\n\n return format(date, formatStr, {\n locale: localeObj,\n });\n}\n"],"mappings":";AAAA;AAAA,EACE,YAAAA;AAAA,EACA,gBAAAC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACNP,SAAS,YAAY,aAAa,WAAW,QAAQ,gBAAgB;;;ACCrE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAKK;AA2ID;AAxIC,IAAM,MAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;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,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,qBAAqB,SAAS,IAAI;AAAA,cACxC,OAAO,qBAAqB,UAAU,IAAI;AAAA,cAC1C,WAAW;AAAA,cACX,QAAQ;AAAA,cAEP,yBAAe;AAAA;AAAA,UAClB;AAAA;AAAA;AAAA;AAAA,YAKA,gBAAAA,KAAC,OAAI,WAAW,GAAI,yBAAe,GAAE;AAAA;AAAA;AAAA;AAAA,IAE3C;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;;;AG3LzB,SAAS,UAAAC,eAAc;AACvB,YAAY,aAAa;AAGzB,IAAM,gBAAgB;AAEf,SAAS,WACd,MACA,WACA,SAA6B,eAC7B;AACA,QAAM,YAAY,QAAQ,MAAM,KAAK,QAAQ,aAAa;AAE1D,SAAOA,QAAO,MAAM,WAAW;AAAA,IAC7B,QAAQ;AAAA,EACV,CAAC;AACH;","names":["Calendar","DualCalendar","jsx","format"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.tsx","../../src/DatePicker.tsx","../../../../foundation/primitives-native/src/Box.tsx","../../../../foundation/primitives-native/src/index.tsx","../../src/utils.ts"],"sourcesContent":["export {\n Calendar,\n DualCalendar,\n CalendarHeader,\n CalendarGrid,\n CalendarChips,\n} from \"@xsolla/xui-calendar\";\nexport type {\n CalendarProps,\n DualCalendarProps,\n CalendarChipOption,\n CalendarChipsProps,\n CalendarGridProps,\n CalendarHeaderProps,\n CalendarLocaleType,\n} from \"@xsolla/xui-calendar\";\nexport * from \"./DatePicker\";\nexport * from \"./types\";\nexport * from \"./utils\";\n","import { forwardRef, useCallback, useEffect, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, isWeb, isNative } from \"@xsolla/xui-primitives\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { format } from \"date-fns\";\nimport { Calendar, DualCalendar } from \"@xsolla/xui-calendar\";\nimport type { DatePickerProps, DateRangeType } from \"./types\";\n\nexport const DatePicker = forwardRef<any, DatePickerProps>(\n (\n {\n onChange,\n size = \"md\",\n locale = \"enUS\",\n variant = \"single\",\n selectsRange = false,\n startDate,\n endDate,\n selectedDate,\n placeholder,\n backgroundColor,\n testID,\n chips,\n activeChip,\n onChipSelect,\n dropdownPosition = \"left\",\n themeMode,\n themeProductContext,\n overlayThemeMode,\n overlayThemeProductContext,\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 = 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 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]) setOpen(false);\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n const handleClickOutside = (event: MouseEvent) => {\n if (containerRef.current && !containerRef.current.contains(event.target as Node)) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => document.removeEventListener(\"mousedown\", handleClickOutside);\n }, []);\n\n const overlayThemeProps = {\n themeMode: overlayThemeMode ?? themeMode,\n themeProductContext: overlayThemeProductContext ?? themeProductContext,\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 {...overlayThemeProps}\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 {...overlayThemeProps}\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={placeholder || (isRange ? \"MM/DD/YYYY - MM/DD/YYYY\" : \"MM/DD/YYYY\")}\n value={inputValue}\n onChangeText={handleInputChange}\n onFocus={() => setOpen(true)}\n backgroundColor={backgroundColor}\n testID={testID}\n themeMode={themeMode}\n themeProductContext={themeProductContext}\n />\n {open &&\n (isWeb ? (\n <Box\n position=\"absolute\"\n top=\"100%\"\n left={dropdownPosition === \"left\" ? 0 : \"auto\"}\n right={dropdownPosition === \"right\" ? 0 : \"auto\"}\n marginTop={4}\n zIndex={1000}\n >\n {renderCalendar()}\n </Box>\n ) : (\n <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;AAA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A;AAAA,cACA;AAAA,cACA;AAAA;AAAA,UACF;AAAA,UACC,SACE,QACC,gBAAAA;AAAA,YAAC;AAAA;AAAA,cACC,UAAS;AAAA,cACT,KAAI;AAAA,cACJ,MAAM,qBAAqB,SAAS,IAAI;AAAA,cACxC,OAAO,qBAAqB,UAAU,IAAI;AAAA,cAC1C,WAAW;AAAA,cACX,QAAQ;AAAA,cAEP,yBAAe;AAAA;AAAA,UAClB,IAEA,gBAAAA,KAAC,OAAI,WAAW,GAAI,yBAAe,GAAE;AAAA;AAAA;AAAA,IAE3C;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;;;AG3LzB,SAAS,UAAAC,eAAc;AACvB,YAAY,aAAa;AAGzB,IAAM,gBAAgB;AAEf,SAAS,WACd,MACA,WACA,SAA6B,eAC7B;AACA,QAAM,YAAY,QAAQ,MAAM,KAAK,QAAQ,aAAa;AAE1D,SAAOA,QAAO,MAAM,WAAW;AAAA,IAC7B,QAAQ;AAAA,EACV,CAAC;AACH;","names":["Calendar","DualCalendar","jsx","format"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xsolla/xui-date-picker",
|
|
3
|
-
"version": "0.172.
|
|
3
|
+
"version": "0.172.2-pr358.1781799261",
|
|
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.172.
|
|
17
|
-
"@xsolla/xui-core": "0.172.
|
|
18
|
-
"@xsolla/xui-input": "0.172.
|
|
19
|
-
"@xsolla/xui-primitives-core": "0.172.
|
|
16
|
+
"@xsolla/xui-calendar": "0.172.2-pr358.1781799261",
|
|
17
|
+
"@xsolla/xui-core": "0.172.2-pr358.1781799261",
|
|
18
|
+
"@xsolla/xui-input": "0.172.2-pr358.1781799261",
|
|
19
|
+
"@xsolla/xui-primitives-core": "0.172.2-pr358.1781799261",
|
|
20
20
|
"date-fns": "^3.0.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
package/web/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CalendarProps, CalendarLocaleType } from '@xsolla/xui-calendar';
|
|
2
2
|
export { Calendar, CalendarChipOption, CalendarChips, CalendarChipsProps, CalendarGrid, CalendarGridProps, CalendarHeader, CalendarHeaderProps, CalendarLocaleType, CalendarProps, DualCalendar, DualCalendarProps } from '@xsolla/xui-calendar';
|
|
3
3
|
import * as react from 'react';
|
|
4
|
+
import { ThemeMode, ProductContext } from '@xsolla/xui-core';
|
|
4
5
|
|
|
5
6
|
type DateRangeType = [Date | null, Date | null];
|
|
6
7
|
type DatePickerDropdownPosition = "left" | "right";
|
|
@@ -36,6 +37,10 @@ interface DatePickerProps extends Omit<CalendarProps, "onChange"> {
|
|
|
36
37
|
dropdownPosition?: DatePickerDropdownPosition;
|
|
37
38
|
/** Test ID for testing frameworks */
|
|
38
39
|
testID?: string;
|
|
40
|
+
/** Theme mode for the calendar overlay. Defaults to themeMode when not set. */
|
|
41
|
+
overlayThemeMode?: ThemeMode;
|
|
42
|
+
/** Product context for the calendar overlay. Defaults to themeProductContext when not set. */
|
|
43
|
+
overlayThemeProductContext?: ProductContext;
|
|
39
44
|
}
|
|
40
45
|
|
|
41
46
|
declare const DatePicker: react.ForwardRefExoticComponent<DatePickerProps & react.RefAttributes<any>>;
|
package/web/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CalendarProps, CalendarLocaleType } from '@xsolla/xui-calendar';
|
|
2
2
|
export { Calendar, CalendarChipOption, CalendarChips, CalendarChipsProps, CalendarGrid, CalendarGridProps, CalendarHeader, CalendarHeaderProps, CalendarLocaleType, CalendarProps, DualCalendar, DualCalendarProps } from '@xsolla/xui-calendar';
|
|
3
3
|
import * as react from 'react';
|
|
4
|
+
import { ThemeMode, ProductContext } from '@xsolla/xui-core';
|
|
4
5
|
|
|
5
6
|
type DateRangeType = [Date | null, Date | null];
|
|
6
7
|
type DatePickerDropdownPosition = "left" | "right";
|
|
@@ -36,6 +37,10 @@ interface DatePickerProps extends Omit<CalendarProps, "onChange"> {
|
|
|
36
37
|
dropdownPosition?: DatePickerDropdownPosition;
|
|
37
38
|
/** Test ID for testing frameworks */
|
|
38
39
|
testID?: string;
|
|
40
|
+
/** Theme mode for the calendar overlay. Defaults to themeMode when not set. */
|
|
41
|
+
overlayThemeMode?: ThemeMode;
|
|
42
|
+
/** Product context for the calendar overlay. Defaults to themeProductContext when not set. */
|
|
43
|
+
overlayThemeProductContext?: ProductContext;
|
|
39
44
|
}
|
|
40
45
|
|
|
41
46
|
declare const DatePicker: react.ForwardRefExoticComponent<DatePickerProps & react.RefAttributes<any>>;
|
package/web/index.js
CHANGED
|
@@ -321,6 +321,10 @@ var DatePicker = (0, import_react3.forwardRef)(
|
|
|
321
321
|
activeChip,
|
|
322
322
|
onChipSelect,
|
|
323
323
|
dropdownPosition = "left",
|
|
324
|
+
themeMode,
|
|
325
|
+
themeProductContext,
|
|
326
|
+
overlayThemeMode,
|
|
327
|
+
overlayThemeProductContext,
|
|
324
328
|
...rest
|
|
325
329
|
}, ref) => {
|
|
326
330
|
const isDual = variant === "dual";
|
|
@@ -378,9 +382,7 @@ var DatePicker = (0, import_react3.forwardRef)(
|
|
|
378
382
|
} else {
|
|
379
383
|
const range = date;
|
|
380
384
|
onChange?.(range);
|
|
381
|
-
if (range[0] && range[1])
|
|
382
|
-
setOpen(false);
|
|
383
|
-
}
|
|
385
|
+
if (range[0] && range[1]) setOpen(false);
|
|
384
386
|
}
|
|
385
387
|
};
|
|
386
388
|
(0, import_react3.useEffect)(() => {
|
|
@@ -393,6 +395,10 @@ var DatePicker = (0, import_react3.forwardRef)(
|
|
|
393
395
|
document.addEventListener("mousedown", handleClickOutside);
|
|
394
396
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
395
397
|
}, []);
|
|
398
|
+
const overlayThemeProps = {
|
|
399
|
+
themeMode: overlayThemeMode ?? themeMode,
|
|
400
|
+
themeProductContext: overlayThemeProductContext ?? themeProductContext
|
|
401
|
+
};
|
|
396
402
|
const renderCalendar = () => isDual ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
397
403
|
import_xui_calendar.DualCalendar,
|
|
398
404
|
{
|
|
@@ -403,7 +409,8 @@ var DatePicker = (0, import_react3.forwardRef)(
|
|
|
403
409
|
chips,
|
|
404
410
|
activeChip: activeChipValue,
|
|
405
411
|
onChipSelect: handleChipSelect,
|
|
406
|
-
...rest
|
|
412
|
+
...rest,
|
|
413
|
+
...overlayThemeProps
|
|
407
414
|
}
|
|
408
415
|
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
409
416
|
import_xui_calendar.Calendar,
|
|
@@ -417,7 +424,8 @@ var DatePicker = (0, import_react3.forwardRef)(
|
|
|
417
424
|
chips,
|
|
418
425
|
activeChip: activeChipValue,
|
|
419
426
|
onChipSelect: handleChipSelect,
|
|
420
|
-
...rest
|
|
427
|
+
...rest,
|
|
428
|
+
...overlayThemeProps
|
|
421
429
|
}
|
|
422
430
|
);
|
|
423
431
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
@@ -441,7 +449,9 @@ var DatePicker = (0, import_react3.forwardRef)(
|
|
|
441
449
|
onChangeText: handleInputChange,
|
|
442
450
|
onFocus: () => setOpen(true),
|
|
443
451
|
backgroundColor,
|
|
444
|
-
testID
|
|
452
|
+
testID,
|
|
453
|
+
themeMode,
|
|
454
|
+
themeProductContext
|
|
445
455
|
}
|
|
446
456
|
),
|
|
447
457
|
open && (isWeb ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
@@ -455,12 +465,7 @@ var DatePicker = (0, import_react3.forwardRef)(
|
|
|
455
465
|
zIndex: 1e3,
|
|
456
466
|
children: renderCalendar()
|
|
457
467
|
}
|
|
458
|
-
) : (
|
|
459
|
-
// Native implementation could use a Modal here
|
|
460
|
-
// For now, we just show it below the input if needed,
|
|
461
|
-
// but usually a bottom sheet or centered modal is better.
|
|
462
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box, { marginTop: 4, children: renderCalendar() })
|
|
463
|
-
))
|
|
468
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box, { marginTop: 4, children: renderCalendar() }))
|
|
464
469
|
]
|
|
465
470
|
}
|
|
466
471
|
);
|
package/web/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.tsx","../../src/DatePicker.tsx","../../../../foundation/primitives-web/src/Box.tsx","../../../../foundation/primitives-web/src/filterDOMProps.ts","../../../../../node_modules/@emotion/memoize/dist/memoize.esm.js","../../../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js","../../../../foundation/primitives-web/src/index.tsx","../../src/utils.ts"],"sourcesContent":["export {\n Calendar,\n DualCalendar,\n CalendarHeader,\n CalendarGrid,\n CalendarChips,\n} from \"@xsolla/xui-calendar\";\nexport type {\n CalendarProps,\n DualCalendarProps,\n CalendarChipOption,\n CalendarChipsProps,\n CalendarGridProps,\n CalendarHeaderProps,\n CalendarLocaleType,\n} from \"@xsolla/xui-calendar\";\nexport * from \"./DatePicker\";\nexport * from \"./types\";\nexport * from \"./utils\";\n","import { forwardRef, useCallback, useEffect, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, isWeb, isNative } from \"@xsolla/xui-primitives\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { format } from \"date-fns\";\nimport { Calendar, DualCalendar } from \"@xsolla/xui-calendar\";\nimport type { DatePickerProps, DateRangeType } from \"./types\";\n\nexport const DatePicker = forwardRef<any, DatePickerProps>(\n (\n {\n onChange,\n size = \"md\",\n locale = \"enUS\",\n variant = \"single\",\n selectsRange = false,\n startDate,\n endDate,\n selectedDate,\n placeholder,\n backgroundColor,\n testID,\n chips,\n activeChip,\n onChipSelect,\n dropdownPosition = \"left\",\n ...rest\n },\n ref\n ) => {\n const isDual = variant === \"dual\";\n const isRange = isDual || selectsRange;\n const [open, setOpen] = useState(false);\n const [inputValue, setInputValue] = useState(\"\");\n const [internalChip, setInternalChip] = useState<string | null>(null);\n const containerRef = useRef<any>(null);\n const chipSelectionRef = useRef(false);\n\n const activeChipValue =\n activeChip !== undefined ? activeChip : internalChip;\n\n const formatDateForDisplay = (date: Date | null | undefined): string => {\n if (!date) return \"\";\n try {\n return format(date, \"MM/dd/yyyy\");\n } catch {\n return \"\";\n }\n };\n\n const getDisplayValue = useCallback((): string => {\n if (activeChipValue && chips) {\n const chip = chips.find((c) => c.value === activeChipValue);\n if (chip) return chip.label;\n }\n if (isRange) {\n if (startDate && endDate) {\n return `${formatDateForDisplay(startDate)} - ${formatDateForDisplay(endDate)}`;\n } else if (startDate) {\n return formatDateForDisplay(startDate);\n }\n return \"\";\n } else {\n return formatDateForDisplay(selectedDate);\n }\n }, [isRange, startDate, endDate, selectedDate, activeChipValue, chips]);\n\n useEffect(() => {\n setInputValue(getDisplayValue());\n }, [getDisplayValue]);\n\n const handleInputChange = (text: string) => {\n setInputValue(text);\n };\n\n const handleChipSelect = (value: string | null) => {\n chipSelectionRef.current = true;\n setInternalChip(value);\n onChipSelect?.(value);\n };\n\n const handleDateChange = (date: Date | [Date | null, Date | null]) => {\n if (!chipSelectionRef.current) {\n setInternalChip(null);\n onChipSelect?.(null);\n }\n chipSelectionRef.current = false;\n\n if (!isRange) {\n onChange?.(date as Date);\n setOpen(false);\n } else {\n const range = date as DateRangeType;\n onChange?.(range);\n if (range[0] && range[1]) {\n setOpen(false);\n }\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n !containerRef.current.contains(event.target as Node)\n ) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () =>\n document.removeEventListener(\"mousedown\", handleClickOutside);\n }, []);\n\n const renderCalendar = () =>\n isDual ? (\n <DualCalendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n onChange={handleDateChange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n ) : (\n <Calendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n selectedDate={selectedDate}\n onChange={handleDateChange}\n selectsRange={selectsRange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n );\n\n return (\n <Box\n ref={(node: any) => {\n containerRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) (ref as any).current = node;\n }}\n position=\"relative\"\n width=\"100%\"\n >\n <Input\n {...rest}\n size={size}\n placeholder={\n placeholder || (isRange ? \"MM/DD/YYYY - MM/DD/YYYY\" : \"MM/DD/YYYY\")\n }\n value={inputValue}\n onChangeText={handleInputChange}\n onFocus={() => setOpen(true)}\n backgroundColor={backgroundColor}\n testID={testID}\n />\n {open &&\n (isWeb ? (\n <Box\n position=\"absolute\"\n top=\"100%\"\n left={dropdownPosition === \"left\" ? 0 : \"auto\"}\n right={dropdownPosition === \"right\" ? 0 : \"auto\"}\n marginTop={4}\n zIndex={1000}\n >\n {renderCalendar()}\n </Box>\n ) : (\n // Native implementation could use a Modal here\n // For now, we just show it below the input if needed,\n // but usually a bottom sheet or centered modal is better.\n <Box marginTop={4}>{renderCalendar()}</Box>\n ))}\n </Box>\n );\n }\n);\n\nDatePicker.displayName = \"DatePicker\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n ...props.style,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","export * from \"./Box\";\nexport * from \"./Text\";\nexport * from \"./Spinner\";\nexport * from \"./Icon\";\nexport * from \"./Divider\";\nexport * from \"./Input\";\nexport * from \"./TextArea\";\nexport * from \"./LinearGradient\";\n\nexport const isWeb = true;\nexport const isNative = false;\n","import { format } from \"date-fns\";\nimport * as locales from \"date-fns/locale\";\nimport type { CalendarLocaleType } from \"@xsolla/xui-calendar\";\n\nconst defaultLocale = \"enUS\";\n\nexport function formatDate(\n date: Date,\n formatStr: string,\n locale: CalendarLocaleType = defaultLocale\n) {\n const localeObj = locales[locale] || locales[defaultLocale];\n\n return format(date, formatStr, {\n locale: localeObj,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,uBAMO;;;ACNP,IAAAC,gBAAqE;;;ACArE,IAAAC,gBAAkB;AAClB,+BAAmB;;;ACDnB,mBAAkB;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,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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_react","import_react","React","styled","React","import_jsx_runtime","import_date_fns"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.tsx","../../src/DatePicker.tsx","../../../../foundation/primitives-web/src/Box.tsx","../../../../foundation/primitives-web/src/filterDOMProps.ts","../../../../../node_modules/@emotion/memoize/dist/memoize.esm.js","../../../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js","../../../../foundation/primitives-web/src/index.tsx","../../src/utils.ts"],"sourcesContent":["export {\n Calendar,\n DualCalendar,\n CalendarHeader,\n CalendarGrid,\n CalendarChips,\n} from \"@xsolla/xui-calendar\";\nexport type {\n CalendarProps,\n DualCalendarProps,\n CalendarChipOption,\n CalendarChipsProps,\n CalendarGridProps,\n CalendarHeaderProps,\n CalendarLocaleType,\n} from \"@xsolla/xui-calendar\";\nexport * from \"./DatePicker\";\nexport * from \"./types\";\nexport * from \"./utils\";\n","import { forwardRef, useCallback, useEffect, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, isWeb, isNative } from \"@xsolla/xui-primitives\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { format } from \"date-fns\";\nimport { Calendar, DualCalendar } from \"@xsolla/xui-calendar\";\nimport type { DatePickerProps, DateRangeType } from \"./types\";\n\nexport const DatePicker = forwardRef<any, DatePickerProps>(\n (\n {\n onChange,\n size = \"md\",\n locale = \"enUS\",\n variant = \"single\",\n selectsRange = false,\n startDate,\n endDate,\n selectedDate,\n placeholder,\n backgroundColor,\n testID,\n chips,\n activeChip,\n onChipSelect,\n dropdownPosition = \"left\",\n themeMode,\n themeProductContext,\n overlayThemeMode,\n overlayThemeProductContext,\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 = 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 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]) setOpen(false);\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n const handleClickOutside = (event: MouseEvent) => {\n if (containerRef.current && !containerRef.current.contains(event.target as Node)) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => document.removeEventListener(\"mousedown\", handleClickOutside);\n }, []);\n\n const overlayThemeProps = {\n themeMode: overlayThemeMode ?? themeMode,\n themeProductContext: overlayThemeProductContext ?? themeProductContext,\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 {...overlayThemeProps}\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 {...overlayThemeProps}\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={placeholder || (isRange ? \"MM/DD/YYYY - MM/DD/YYYY\" : \"MM/DD/YYYY\")}\n value={inputValue}\n onChangeText={handleInputChange}\n onFocus={() => setOpen(true)}\n backgroundColor={backgroundColor}\n testID={testID}\n themeMode={themeMode}\n themeProductContext={themeProductContext}\n />\n {open &&\n (isWeb ? (\n <Box\n position=\"absolute\"\n top=\"100%\"\n left={dropdownPosition === \"left\" ? 0 : \"auto\"}\n right={dropdownPosition === \"right\" ? 0 : \"auto\"}\n marginTop={4}\n zIndex={1000}\n >\n {renderCalendar()}\n </Box>\n ) : (\n <Box marginTop={4}>{renderCalendar()}</Box>\n ))}\n </Box>\n );\n }\n);\n\nDatePicker.displayName = \"DatePicker\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n ...props.style,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","export * from \"./Box\";\nexport * from \"./Text\";\nexport * from \"./Spinner\";\nexport * from \"./Icon\";\nexport * from \"./Divider\";\nexport * from \"./Input\";\nexport * from \"./TextArea\";\nexport * from \"./LinearGradient\";\n\nexport const isWeb = true;\nexport const isNative = false;\n","import { format } from \"date-fns\";\nimport * as locales from \"date-fns/locale\";\nimport type { CalendarLocaleType } from \"@xsolla/xui-calendar\";\n\nconst defaultLocale = \"enUS\";\n\nexport function formatDate(\n date: Date,\n formatStr: string,\n locale: CalendarLocaleType = defaultLocale\n) {\n const localeObj = locales[locale] || locales[defaultLocale];\n\n return format(date, formatStr, {\n locale: localeObj,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,uBAMO;;;ACNP,IAAAC,gBAAqE;;;ACArE,IAAAC,gBAAkB;AAClB,+BAAmB;;;ACDnB,mBAAkB;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SAAO,SAAU,KAAK;AACpB,QAAI,MAAM,GAAG,MAAM,OAAW,OAAM,GAAG,IAAI,GAAG,GAAG;AACjD,WAAO,MAAM,GAAG;AAAA,EAClB;AACF;AAEA,IAAO,sBAAQ;;;ACNf,IAAI,kBAAkB;AAEtB,IAAI,QAAQ;AAAA,EAAQ,SAAU,MAAM;AAClC,WAAO,gBAAgB,KAAK,IAAI,KAAK,KAAK,WAAW,CAAC,MAAM,OAEzD,KAAK,WAAW,CAAC,MAAM,OAEvB,KAAK,WAAW,CAAC,IAAI;AAAA,EAC1B;AAAA;AAEA;AAEA,IAAO,4BAAQ;;;AFRR,IAAM,2BAA2B,oBAAI,IAAI;AAAA;AAAA,EAE9C;AAAA,EACA;A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V;AAAA,QACA;AAAA,QACA,YAAY;AAAA,QACZ,cAAc;AAAA,QACb,GAAG;AAAA,QACH,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;AAAA,YAAC;AAAA;AAAA,cACE,GAAG;AAAA,cACJ;AAAA,cACA,aAAa,gBAAgB,UAAU,4BAA4B;AAAA,cACnE,OAAO;AAAA,cACP,cAAc;AAAA,cACd,SAAS,MAAM,QAAQ,IAAI;AAAA,cAC3B;AAAA,cACA;AAAA,cACA;AAAA,cACA;AAAA;AAAA,UACF;AAAA,UACC,SACE,QACC;AAAA,YAAC;AAAA;AAAA,cACC,UAAS;AAAA,cACT,KAAI;AAAA,cACJ,MAAM,qBAAqB,SAAS,IAAI;AAAA,cACxC,OAAO,qBAAqB,UAAU,IAAI;AAAA,cAC1C,WAAW;AAAA,cACX,QAAQ;AAAA,cAEP,yBAAe;AAAA;AAAA,UAClB,IAEA,6CAAC,OAAI,WAAW,GAAI,yBAAe,GAAE;AAAA;AAAA;AAAA,IAE3C;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;;;AM3LzB,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
|
@@ -287,6 +287,10 @@ var DatePicker = forwardRef(
|
|
|
287
287
|
activeChip,
|
|
288
288
|
onChipSelect,
|
|
289
289
|
dropdownPosition = "left",
|
|
290
|
+
themeMode,
|
|
291
|
+
themeProductContext,
|
|
292
|
+
overlayThemeMode,
|
|
293
|
+
overlayThemeProductContext,
|
|
290
294
|
...rest
|
|
291
295
|
}, ref) => {
|
|
292
296
|
const isDual = variant === "dual";
|
|
@@ -344,9 +348,7 @@ var DatePicker = forwardRef(
|
|
|
344
348
|
} else {
|
|
345
349
|
const range = date;
|
|
346
350
|
onChange?.(range);
|
|
347
|
-
if (range[0] && range[1])
|
|
348
|
-
setOpen(false);
|
|
349
|
-
}
|
|
351
|
+
if (range[0] && range[1]) setOpen(false);
|
|
350
352
|
}
|
|
351
353
|
};
|
|
352
354
|
useEffect(() => {
|
|
@@ -359,6 +361,10 @@ var DatePicker = forwardRef(
|
|
|
359
361
|
document.addEventListener("mousedown", handleClickOutside);
|
|
360
362
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
361
363
|
}, []);
|
|
364
|
+
const overlayThemeProps = {
|
|
365
|
+
themeMode: overlayThemeMode ?? themeMode,
|
|
366
|
+
themeProductContext: overlayThemeProductContext ?? themeProductContext
|
|
367
|
+
};
|
|
362
368
|
const renderCalendar = () => isDual ? /* @__PURE__ */ jsx2(
|
|
363
369
|
DualCalendar,
|
|
364
370
|
{
|
|
@@ -369,7 +375,8 @@ var DatePicker = forwardRef(
|
|
|
369
375
|
chips,
|
|
370
376
|
activeChip: activeChipValue,
|
|
371
377
|
onChipSelect: handleChipSelect,
|
|
372
|
-
...rest
|
|
378
|
+
...rest,
|
|
379
|
+
...overlayThemeProps
|
|
373
380
|
}
|
|
374
381
|
) : /* @__PURE__ */ jsx2(
|
|
375
382
|
Calendar,
|
|
@@ -383,7 +390,8 @@ var DatePicker = forwardRef(
|
|
|
383
390
|
chips,
|
|
384
391
|
activeChip: activeChipValue,
|
|
385
392
|
onChipSelect: handleChipSelect,
|
|
386
|
-
...rest
|
|
393
|
+
...rest,
|
|
394
|
+
...overlayThemeProps
|
|
387
395
|
}
|
|
388
396
|
);
|
|
389
397
|
return /* @__PURE__ */ jsxs(
|
|
@@ -407,7 +415,9 @@ var DatePicker = forwardRef(
|
|
|
407
415
|
onChangeText: handleInputChange,
|
|
408
416
|
onFocus: () => setOpen(true),
|
|
409
417
|
backgroundColor,
|
|
410
|
-
testID
|
|
418
|
+
testID,
|
|
419
|
+
themeMode,
|
|
420
|
+
themeProductContext
|
|
411
421
|
}
|
|
412
422
|
),
|
|
413
423
|
open && (isWeb ? /* @__PURE__ */ jsx2(
|
|
@@ -421,12 +431,7 @@ var DatePicker = forwardRef(
|
|
|
421
431
|
zIndex: 1e3,
|
|
422
432
|
children: renderCalendar()
|
|
423
433
|
}
|
|
424
|
-
) : (
|
|
425
|
-
// Native implementation could use a Modal here
|
|
426
|
-
// For now, we just show it below the input if needed,
|
|
427
|
-
// but usually a bottom sheet or centered modal is better.
|
|
428
|
-
/* @__PURE__ */ jsx2(Box, { marginTop: 4, children: renderCalendar() })
|
|
429
|
-
))
|
|
434
|
+
) : /* @__PURE__ */ jsx2(Box, { marginTop: 4, children: renderCalendar() }))
|
|
430
435
|
]
|
|
431
436
|
}
|
|
432
437
|
);
|
package/web/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.tsx","../../src/DatePicker.tsx","../../../../foundation/primitives-web/src/Box.tsx","../../../../foundation/primitives-web/src/filterDOMProps.ts","../../../../../node_modules/@emotion/memoize/dist/memoize.esm.js","../../../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.esm.js","../../../../foundation/primitives-web/src/index.tsx","../../src/utils.ts"],"sourcesContent":["export {\n Calendar,\n DualCalendar,\n CalendarHeader,\n CalendarGrid,\n CalendarChips,\n} from \"@xsolla/xui-calendar\";\nexport type {\n CalendarProps,\n DualCalendarProps,\n CalendarChipOption,\n CalendarChipsProps,\n CalendarGridProps,\n CalendarHeaderProps,\n CalendarLocaleType,\n} from \"@xsolla/xui-calendar\";\nexport * from \"./DatePicker\";\nexport * from \"./types\";\nexport * from \"./utils\";\n","import { forwardRef, useCallback, useEffect, useRef, useState } from \"react\";\n// @ts-expect-error - this will be resolved at build time\nimport { Box, isWeb, isNative } from \"@xsolla/xui-primitives\";\nimport { Input } from \"@xsolla/xui-input\";\nimport { format } from \"date-fns\";\nimport { Calendar, DualCalendar } from \"@xsolla/xui-calendar\";\nimport type { DatePickerProps, DateRangeType } from \"./types\";\n\nexport const DatePicker = forwardRef<any, DatePickerProps>(\n (\n {\n onChange,\n size = \"md\",\n locale = \"enUS\",\n variant = \"single\",\n selectsRange = false,\n startDate,\n endDate,\n selectedDate,\n placeholder,\n backgroundColor,\n testID,\n chips,\n activeChip,\n onChipSelect,\n dropdownPosition = \"left\",\n ...rest\n },\n ref\n ) => {\n const isDual = variant === \"dual\";\n const isRange = isDual || selectsRange;\n const [open, setOpen] = useState(false);\n const [inputValue, setInputValue] = useState(\"\");\n const [internalChip, setInternalChip] = useState<string | null>(null);\n const containerRef = useRef<any>(null);\n const chipSelectionRef = useRef(false);\n\n const activeChipValue =\n activeChip !== undefined ? activeChip : internalChip;\n\n const formatDateForDisplay = (date: Date | null | undefined): string => {\n if (!date) return \"\";\n try {\n return format(date, \"MM/dd/yyyy\");\n } catch {\n return \"\";\n }\n };\n\n const getDisplayValue = useCallback((): string => {\n if (activeChipValue && chips) {\n const chip = chips.find((c) => c.value === activeChipValue);\n if (chip) return chip.label;\n }\n if (isRange) {\n if (startDate && endDate) {\n return `${formatDateForDisplay(startDate)} - ${formatDateForDisplay(endDate)}`;\n } else if (startDate) {\n return formatDateForDisplay(startDate);\n }\n return \"\";\n } else {\n return formatDateForDisplay(selectedDate);\n }\n }, [isRange, startDate, endDate, selectedDate, activeChipValue, chips]);\n\n useEffect(() => {\n setInputValue(getDisplayValue());\n }, [getDisplayValue]);\n\n const handleInputChange = (text: string) => {\n setInputValue(text);\n };\n\n const handleChipSelect = (value: string | null) => {\n chipSelectionRef.current = true;\n setInternalChip(value);\n onChipSelect?.(value);\n };\n\n const handleDateChange = (date: Date | [Date | null, Date | null]) => {\n if (!chipSelectionRef.current) {\n setInternalChip(null);\n onChipSelect?.(null);\n }\n chipSelectionRef.current = false;\n\n if (!isRange) {\n onChange?.(date as Date);\n setOpen(false);\n } else {\n const range = date as DateRangeType;\n onChange?.(range);\n if (range[0] && range[1]) {\n setOpen(false);\n }\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n const handleClickOutside = (event: MouseEvent) => {\n if (\n containerRef.current &&\n !containerRef.current.contains(event.target as Node)\n ) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () =>\n document.removeEventListener(\"mousedown\", handleClickOutside);\n }, []);\n\n const renderCalendar = () =>\n isDual ? (\n <DualCalendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n onChange={handleDateChange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n ) : (\n <Calendar\n locale={locale}\n startDate={startDate}\n endDate={endDate}\n selectedDate={selectedDate}\n onChange={handleDateChange}\n selectsRange={selectsRange}\n chips={chips}\n activeChip={activeChipValue}\n onChipSelect={handleChipSelect}\n {...rest}\n />\n );\n\n return (\n <Box\n ref={(node: any) => {\n containerRef.current = node;\n if (typeof ref === \"function\") ref(node);\n else if (ref) (ref as any).current = node;\n }}\n position=\"relative\"\n width=\"100%\"\n >\n <Input\n {...rest}\n size={size}\n placeholder={\n placeholder || (isRange ? \"MM/DD/YYYY - MM/DD/YYYY\" : \"MM/DD/YYYY\")\n }\n value={inputValue}\n onChangeText={handleInputChange}\n onFocus={() => setOpen(true)}\n backgroundColor={backgroundColor}\n testID={testID}\n />\n {open &&\n (isWeb ? (\n <Box\n position=\"absolute\"\n top=\"100%\"\n left={dropdownPosition === \"left\" ? 0 : \"auto\"}\n right={dropdownPosition === \"right\" ? 0 : \"auto\"}\n marginTop={4}\n zIndex={1000}\n >\n {renderCalendar()}\n </Box>\n ) : (\n // Native implementation could use a Modal here\n // For now, we just show it below the input if needed,\n // but usually a bottom sheet or centered modal is better.\n <Box marginTop={4}>{renderCalendar()}</Box>\n ))}\n </Box>\n );\n }\n);\n\nDatePicker.displayName = \"DatePicker\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n ...props.style,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","export * from \"./Box\";\nexport * from \"./Text\";\nexport * from \"./Spinner\";\nexport * from \"./Icon\";\nexport * from \"./Divider\";\nexport * from \"./Input\";\nexport * from \"./TextArea\";\nexport * from \"./LinearGradient\";\n\nexport const isWeb = true;\nexport const isNative = false;\n","import { format } from \"date-fns\";\nimport * as locales from \"date-fns/locale\";\nimport type { CalendarLocaleType } from \"@xsolla/xui-calendar\";\n\nconst defaultLocale = \"enUS\";\n\nexport function formatDate(\n date: Date,\n formatStr: string,\n locale: CalendarLocaleType = defaultLocale\n) {\n const localeObj = locales[locale] || locales[defaultLocale];\n\n return format(date, formatStr, {\n locale: localeObj,\n });\n}\n"],"mappings":";AAAA;AAAA,EACE,YAAAA;AAAA,EACA,gBAAAC;AAAA,EACA;AAAA,EACA;AAAA,EAC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UAClB;AAAA;AAAA;AAAA;AAAA,YAKA,gBAAAA,KAAC,OAAI,WAAW,GAAI,yBAAe,GAAE;AAAA;AAAA;AAAA;AAAA,IAE3C;AAAA,EAEJ;AACF;AAEA,WAAW,cAAc;;;AM3LzB,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 dropdownPosition = \"left\",\n themeMode,\n themeProductContext,\n overlayThemeMode,\n overlayThemeProductContext,\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 = 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 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]) setOpen(false);\n }\n };\n\n useEffect(() => {\n if (isNative) return;\n const handleClickOutside = (event: MouseEvent) => {\n if (containerRef.current && !containerRef.current.contains(event.target as Node)) {\n setOpen(false);\n }\n };\n document.addEventListener(\"mousedown\", handleClickOutside);\n return () => document.removeEventListener(\"mousedown\", handleClickOutside);\n }, []);\n\n const overlayThemeProps = {\n themeMode: overlayThemeMode ?? themeMode,\n themeProductContext: overlayThemeProductContext ?? themeProductContext,\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 {...overlayThemeProps}\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 {...overlayThemeProps}\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={placeholder || (isRange ? \"MM/DD/YYYY - MM/DD/YYYY\" : \"MM/DD/YYYY\")}\n value={inputValue}\n onChangeText={handleInputChange}\n onFocus={() => setOpen(true)}\n backgroundColor={backgroundColor}\n testID={testID}\n themeMode={themeMode}\n themeProductContext={themeProductContext}\n />\n {open &&\n (isWeb ? (\n <Box\n position=\"absolute\"\n top=\"100%\"\n left={dropdownPosition === \"left\" ? 0 : \"auto\"}\n right={dropdownPosition === \"right\" ? 0 : \"auto\"}\n marginTop={4}\n zIndex={1000}\n >\n {renderCalendar()}\n </Box>\n ) : (\n <Box marginTop={4}>{renderCalendar()}</Box>\n ))}\n </Box>\n );\n }\n);\n\nDatePicker.displayName = \"DatePicker\";\n","import React from \"react\";\nimport styled from \"styled-components\";\nimport type { BoxProps } from \"@xsolla/xui-primitives-core\";\nimport { createFilteredElement } from \"./filterDOMProps\";\n\nconst FilteredDiv = createFilteredElement(\"div\");\n\nconst StyledBox = styled(FilteredDiv)<BoxProps>`\n display: flex;\n box-sizing: border-box;\n background-color: ${(props) => props.backgroundColor || \"transparent\"};\n border-color: ${(props) => props.borderColor || \"transparent\"};\n border-width: ${(props) =>\n typeof props.borderWidth === \"number\"\n ? `${props.borderWidth}px`\n : props.borderWidth || 0};\n\n ${(props) =>\n props.borderBottomWidth !== undefined &&\n `\n border-bottom-width: ${typeof props.borderBottomWidth === \"number\" ? `${props.borderBottomWidth}px` : props.borderBottomWidth};\n border-bottom-color: ${props.borderBottomColor || props.borderColor || \"transparent\"};\n border-bottom-style: solid;\n `}\n ${(props) =>\n props.borderTopWidth !== undefined &&\n `\n border-top-width: ${typeof props.borderTopWidth === \"number\" ? `${props.borderTopWidth}px` : props.borderTopWidth};\n border-top-color: ${props.borderTopColor || props.borderColor || \"transparent\"};\n border-top-style: solid;\n `}\n ${(props) =>\n props.borderLeftWidth !== undefined &&\n `\n border-left-width: ${typeof props.borderLeftWidth === \"number\" ? `${props.borderLeftWidth}px` : props.borderLeftWidth};\n border-left-color: ${props.borderLeftColor || props.borderColor || \"transparent\"};\n border-left-style: solid;\n `}\n ${(props) =>\n props.borderRightWidth !== undefined &&\n `\n border-right-width: ${typeof props.borderRightWidth === \"number\" ? `${props.borderRightWidth}px` : props.borderRightWidth};\n border-right-color: ${props.borderRightColor || props.borderColor || \"transparent\"};\n border-right-style: solid;\n `}\n\n border-style: ${(props) =>\n props.borderStyle ||\n (props.borderWidth ||\n props.borderBottomWidth ||\n props.borderTopWidth ||\n props.borderLeftWidth ||\n props.borderRightWidth\n ? \"solid\"\n : \"none\")};\n border-radius: ${(props) =>\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius || 0};\n height: ${(props) =>\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height || \"auto\"};\n width: ${(props) =>\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width || \"auto\"};\n min-width: ${(props) =>\n typeof props.minWidth === \"number\"\n ? `${props.minWidth}px`\n : props.minWidth || \"auto\"};\n min-height: ${(props) =>\n typeof props.minHeight === \"number\"\n ? `${props.minHeight}px`\n : props.minHeight || \"auto\"};\n max-width: ${(props) =>\n typeof props.maxWidth === \"number\"\n ? `${props.maxWidth}px`\n : props.maxWidth || \"none\"};\n max-height: ${(props) =>\n typeof props.maxHeight === \"number\"\n ? `${props.maxHeight}px`\n : props.maxHeight || \"none\"};\n\n padding: ${(props) =>\n typeof props.padding === \"number\"\n ? `${props.padding}px`\n : props.padding || 0};\n ${(props) =>\n props.paddingHorizontal &&\n `\n padding-left: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n padding-right: ${typeof props.paddingHorizontal === \"number\" ? `${props.paddingHorizontal}px` : props.paddingHorizontal};\n `}\n ${(props) =>\n props.paddingVertical &&\n `\n padding-top: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n padding-bottom: ${typeof props.paddingVertical === \"number\" ? `${props.paddingVertical}px` : props.paddingVertical};\n `}\n ${(props) =>\n props.paddingTop !== undefined &&\n `padding-top: ${typeof props.paddingTop === \"number\" ? `${props.paddingTop}px` : props.paddingTop};`}\n ${(props) =>\n props.paddingBottom !== undefined &&\n `padding-bottom: ${typeof props.paddingBottom === \"number\" ? `${props.paddingBottom}px` : props.paddingBottom};`}\n ${(props) =>\n props.paddingLeft !== undefined &&\n `padding-left: ${typeof props.paddingLeft === \"number\" ? `${props.paddingLeft}px` : props.paddingLeft};`}\n ${(props) =>\n props.paddingRight !== undefined &&\n `padding-right: ${typeof props.paddingRight === \"number\" ? `${props.paddingRight}px` : props.paddingRight};`}\n\n margin: ${(props) =>\n typeof props.margin === \"number\" ? `${props.margin}px` : props.margin || 0};\n ${(props) =>\n props.marginTop !== undefined &&\n `margin-top: ${typeof props.marginTop === \"number\" ? `${props.marginTop}px` : props.marginTop};`}\n ${(props) =>\n props.marginBottom !== undefined &&\n `margin-bottom: ${typeof props.marginBottom === \"number\" ? `${props.marginBottom}px` : props.marginBottom};`}\n ${(props) =>\n props.marginLeft !== undefined &&\n `margin-left: ${typeof props.marginLeft === \"number\" ? `${props.marginLeft}px` : props.marginLeft};`}\n ${(props) =>\n props.marginRight !== undefined &&\n `margin-right: ${typeof props.marginRight === \"number\" ? `${props.marginRight}px` : props.marginRight};`}\n\n flex-direction: ${(props) => props.flexDirection || \"column\"};\n flex-wrap: ${(props) => props.flexWrap || \"nowrap\"};\n align-items: ${(props) => props.alignItems || \"stretch\"};\n justify-content: ${(props) => props.justifyContent || \"flex-start\"};\n cursor: ${(props) =>\n props.cursor\n ? props.cursor\n : props.onClick || props.onPress\n ? \"pointer\"\n : \"inherit\"};\n position: ${(props) => props.position || \"static\"};\n top: ${(props) =>\n typeof props.top === \"number\" ? `${props.top}px` : props.top};\n bottom: ${(props) =>\n typeof props.bottom === \"number\" ? `${props.bottom}px` : props.bottom};\n left: ${(props) =>\n typeof props.left === \"number\" ? `${props.left}px` : props.left};\n right: ${(props) =>\n typeof props.right === \"number\" ? `${props.right}px` : props.right};\n flex: ${(props) => props.flex};\n flex-shrink: ${(props) => props.flexShrink ?? 1};\n gap: ${(props) =>\n typeof props.gap === \"number\" ? `${props.gap}px` : props.gap || 0};\n align-self: ${(props) => props.alignSelf || \"auto\"};\n overflow: ${(props) => props.overflow || \"visible\"};\n overflow-x: ${(props) => props.overflowX || \"visible\"};\n overflow-y: ${(props) => props.overflowY || \"visible\"};\n z-index: ${(props) => props.zIndex};\n opacity: ${(props) => (props.disabled ? 0.5 : 1)};\n pointer-events: ${(props) => (props.disabled ? \"none\" : \"auto\")};\n\n &:hover {\n ${(props) =>\n props.hoverStyle?.backgroundColor &&\n `background-color: ${props.hoverStyle.backgroundColor};`}\n ${(props) =>\n props.hoverStyle?.borderColor &&\n `border-color: ${props.hoverStyle.borderColor};`}\n }\n\n &:active {\n ${(props) =>\n props.pressStyle?.backgroundColor &&\n `background-color: ${props.pressStyle.backgroundColor};`}\n }\n`;\n\nexport const Box = React.forwardRef<\n HTMLDivElement | HTMLButtonElement,\n BoxProps\n>(\n (\n {\n children,\n onPress,\n onKeyDown,\n onKeyUp,\n role,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-current\": ariaCurrent,\n \"aria-disabled\": ariaDisabled,\n \"aria-live\": ariaLive,\n \"aria-busy\": ariaBusy,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-expanded\": ariaExpanded,\n \"aria-haspopup\": ariaHasPopup,\n \"aria-pressed\": ariaPressed,\n \"aria-controls\": ariaControls,\n tabIndex,\n as,\n src,\n alt,\n onError,\n onLoad,\n type,\n disabled,\n id,\n testID,\n \"data-testid\": dataTestId,\n ...props\n },\n ref\n ) => {\n // Handle as=\"img\" for rendering images with proper border-radius\n if (as === \"img\" && src) {\n return (\n <img\n src={src}\n alt={alt || \"\"}\n onError={onError}\n onLoad={onLoad}\n style={{\n display: \"block\",\n objectFit: \"cover\",\n width:\n typeof props.width === \"number\"\n ? `${props.width}px`\n : props.width,\n height:\n typeof props.height === \"number\"\n ? `${props.height}px`\n : props.height,\n borderRadius:\n typeof props.borderRadius === \"number\"\n ? `${props.borderRadius}px`\n : props.borderRadius,\n position: props.position,\n top: typeof props.top === \"number\" ? `${props.top}px` : props.top,\n left:\n typeof props.left === \"number\" ? `${props.left}px` : props.left,\n right:\n typeof props.right === \"number\"\n ? `${props.right}px`\n : props.right,\n bottom:\n typeof props.bottom === \"number\"\n ? `${props.bottom}px`\n : props.bottom,\n ...props.style,\n }}\n />\n );\n }\n\n return (\n <StyledBox\n ref={ref}\n elementType={as}\n id={id}\n type={as === \"button\" ? type || \"button\" : undefined}\n disabled={as === \"button\" ? disabled : undefined}\n onClick={onPress}\n onKeyDown={onKeyDown}\n onKeyUp={onKeyUp}\n role={role}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-current={ariaCurrent}\n aria-disabled={ariaDisabled}\n aria-busy={ariaBusy}\n aria-describedby={ariaDescribedBy}\n aria-expanded={ariaExpanded}\n aria-haspopup={ariaHasPopup}\n aria-pressed={ariaPressed}\n aria-controls={ariaControls}\n aria-live={ariaLive}\n tabIndex={tabIndex !== undefined ? tabIndex : undefined}\n data-testid={dataTestId || testID}\n {...props}\n >\n {children}\n </StyledBox>\n );\n }\n);\n\nBox.displayName = \"Box\";\n","import React from \"react\";\nimport isPropValid from \"@emotion/is-prop-valid\";\n\n// Props that @emotion/is-prop-valid incorrectly treats as valid HTML.\n// These are React Native or component-specific props that match\n// valid HTML patterns (on* event handlers, SVG attributes).\nexport const ADDITIONAL_BLOCKED_PROPS = new Set([\n // RN-only event handlers (pass isPropValid's on* pattern)\n \"onPress\",\n \"onChangeText\",\n \"onLayout\",\n \"onMoveShouldSetResponder\",\n \"onResponderGrant\",\n \"onResponderMove\",\n \"onResponderRelease\",\n \"onResponderTerminate\",\n // SVG attributes that pass isPropValid\n \"strokeWidth\",\n // CSS properties that pass isPropValid but are used as component props\n \"overflow\",\n \"cursor\",\n \"fontSize\",\n \"fontWeight\",\n \"fontFamily\",\n \"textDecoration\",\n]);\n\nfunction shouldForwardProp(key: string): boolean {\n if (ADDITIONAL_BLOCKED_PROPS.has(key)) return false;\n return isPropValid(key);\n}\n\n/**\n * Creates a React component that renders the given HTML tag\n * but filters out non-HTML props before they reach the DOM.\n *\n * Uses @emotion/is-prop-valid (same library styled-components v4\n * uses internally) to automatically block invalid HTML attributes,\n * plus a small blocklist for false positives (RN on* handlers, SVG attrs).\n *\n * Usage: `const FilteredDiv = createFilteredElement(\"div\");`\n * Then: `const StyledBox = styled(FilteredDiv)<BoxProps>\\`...\\`;`\n *\n * styled-components can still read ALL props for CSS interpolation,\n * but only valid HTML attributes are forwarded to the DOM element.\n */\nexport function createFilteredElement(defaultTag: string) {\n const Component = React.forwardRef<HTMLElement, Record<string, unknown>>(\n ({ children, elementType, ...props }, ref) => {\n const Tag = (elementType as string) || defaultTag;\n const htmlProps: Record<string, unknown> = {};\n for (const key of Object.keys(props)) {\n if (shouldForwardProp(key)) {\n htmlProps[key] = props[key];\n }\n }\n return React.createElement(\n Tag,\n { ref, ...htmlProps },\n children as React.ReactNode\n );\n }\n );\n Component.displayName = `Filtered(${defaultTag})`;\n return Component;\n}\n","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","export * from \"./Box\";\nexport * from \"./Text\";\nexport * from \"./Spinner\";\nexport * from \"./Icon\";\nexport * from \"./Divider\";\nexport * from \"./Input\";\nexport * from \"./TextArea\";\nexport * from \"./LinearGradient\";\n\nexport const isWeb = true;\nexport const isNative = false;\n","import { format } from \"date-fns\";\nimport * as locales from \"date-fns/locale\";\nimport type { CalendarLocaleType } from \"@xsolla/xui-calendar\";\n\nconst defaultLocale = \"enUS\";\n\nexport function formatDate(\n date: Date,\n formatStr: string,\n locale: CalendarLocaleType = defaultLocale\n) {\n const localeObj = locales[locale] || locales[defaultLocale];\n\n return format(date, formatStr, {\n locale: localeObj,\n });\n}\n"],"mappings":";AAAA;AAAA,EACE,YAAAA;AAAA,EACA,gBAAAC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACNP,SAAS,YAAY,aAAa,WAAW,QAAQ,gBAAgB;;;ACArE,OAAOC,YAAW;AAClB,OAAO,YAAY;;;ACDnB,OAAO,WAAW;;;ACAlB,SAAS,QAAQ,IAAI;AACnB,MAAI,QAAQ,CAAC;AACb,SAAO,SAAU,KAAK;AACpB,QAAI,MAAM,GAAG,MAAM,OAAW,OAAM,GAAG,IAAI,GAAG,GA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